commit 75e91e4ddc275fae08ef36c1aa7cbaa010a34e55 Author: arvanitakis95 Date: Thu Nov 7 17:16:20 2024 +0200 first commit diff --git a/.editorconfig b/.editorconfig new file mode 100755 index 0000000..8f0de65 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 + +[docker-compose.yml] +indent_size = 4 diff --git a/.env.example b/.env.example new file mode 100755 index 0000000..a1b3de4 --- /dev/null +++ b/.env.example @@ -0,0 +1,66 @@ +APP_NAME=Laravel +APP_ENV=local +APP_KEY= +APP_DEBUG=true +APP_TIMEZONE=UTC +APP_URL=http://localhost + +APP_LOCALE=en +APP_FALLBACK_LOCALE=en +APP_FAKER_LOCALE=en_US + +APP_MAINTENANCE_DRIVER=file +# APP_MAINTENANCE_STORE=database + +PHP_CLI_SERVER_WORKERS=4 + +BCRYPT_ROUNDS=12 + +LOG_CHANNEL=stack +LOG_STACK=single +LOG_DEPRECATIONS_CHANNEL=null +LOG_LEVEL=debug + +DB_CONNECTION=sqlite +# DB_HOST=127.0.0.1 +# DB_PORT=3306 +# DB_DATABASE=laravel +# DB_USERNAME=root +# DB_PASSWORD= + +SESSION_DRIVER=database +SESSION_LIFETIME=120 +SESSION_ENCRYPT=false +SESSION_PATH=/ +SESSION_DOMAIN=null + +BROADCAST_CONNECTION=log +FILESYSTEM_DISK=local +QUEUE_CONNECTION=database + +CACHE_STORE=database +CACHE_PREFIX= + +MEMCACHED_HOST=127.0.0.1 + +REDIS_CLIENT=phpredis +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=log +MAIL_HOST=127.0.0.1 +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS="hello@example.com" +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= +AWS_USE_PATH_STYLE_ENDPOINT=false + +VITE_APP_NAME="${APP_NAME}" diff --git a/.gitattributes b/.gitattributes new file mode 100755 index 0000000..fcb21d3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +* text=auto eol=lf + +*.blade.php diff=html +*.css diff=css +*.html diff=html +*.md diff=markdown +*.php diff=php + +/.github export-ignore +CHANGELOG.md export-ignore +.styleci.yml export-ignore diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..c3ea31b --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +/.phpunit.cache +/node_modules +/public/build +/public/hot +/public/storage +/storage/*.key +/storage/pail +/vendor +.env +.env.backup +.env.production +.phpactor.json +.phpunit.result.cache +Homestead.json +Homestead.yaml +auth.json +npm-debug.log +yarn-error.log +/.fleet +/.idea +/.vscode +/.zed diff --git a/README.md b/README.md new file mode 100755 index 0000000..1a4c26b --- /dev/null +++ b/README.md @@ -0,0 +1,66 @@ +

Laravel Logo

+ +

+Build Status +Total Downloads +Latest Stable Version +License +

+ +## About Laravel + +Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: + +- [Simple, fast routing engine](https://laravel.com/docs/routing). +- [Powerful dependency injection container](https://laravel.com/docs/container). +- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. +- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). +- Database agnostic [schema migrations](https://laravel.com/docs/migrations). +- [Robust background job processing](https://laravel.com/docs/queues). +- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). + +Laravel is accessible, powerful, and provides tools required for large, robust applications. + +## Learning Laravel + +Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. + +You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch. + +If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. + +## Laravel Sponsors + +We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com). + +### Premium Partners + +- **[Vehikl](https://vehikl.com/)** +- **[Tighten Co.](https://tighten.co)** +- **[WebReinvent](https://webreinvent.com/)** +- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** +- **[64 Robots](https://64robots.com)** +- **[Curotec](https://www.curotec.com/services/technologies/laravel/)** +- **[Cyber-Duck](https://cyber-duck.co.uk)** +- **[DevSquad](https://devsquad.com/hire-laravel-developers)** +- **[Jump24](https://jump24.co.uk)** +- **[Redberry](https://redberry.international/laravel/)** +- **[Active Logic](https://activelogic.com)** +- **[byte5](https://byte5.de)** +- **[OP.GG](https://op.gg)** + +## Contributing + +Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). + +## Code of Conduct + +In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). + +## Security Vulnerabilities + +If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. + +## License + +The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php new file mode 100755 index 0000000..8677cd5 --- /dev/null +++ b/app/Http/Controllers/Controller.php @@ -0,0 +1,8 @@ +service = App::make(UserService::class); + } + + function updated() + { + if (strlen($this->query) > 2) { + $this->display = ""; + $this->queryResults = $this->service->search($this->query); + } + } + + public function add($id) + { + if (!str_contains($this->value, $id)) { + $this->value .= $id . "|"; + $this->selection[] = $this->service->getById($id); + } + } + + public function remove($id) + { + if (str_contains($this->value, $id)) { + $this->value = str_replace($id . "|", "", $this->value); + $this->selection = collect($this->selection)->reject(function ($item) use ($id) { + return $item->id == $id; + }); + } + } + + public function render() + { + return view('livewire.assign-to', [ + "queryResults" => $this->queryResults, + "simpleResult" => $this->simpleResult, + "selection" => $this->selection + ]); + } +} diff --git a/app/Livewire/Trix.php b/app/Livewire/Trix.php new file mode 100644 index 0000000..82e17e7 --- /dev/null +++ b/app/Livewire/Trix.php @@ -0,0 +1,22 @@ + */ + use HasFactory, Notifiable; + + /** + * The attributes that are mass assignable. + * + * @var array + */ + protected $fillable = [ + 'name', + 'email', + 'password', + ]; + + /** + * The attributes that should be hidden for serialization. + * + * @var array + */ + protected $hidden = [ + 'password', + 'remember_token', + ]; + + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + 'email_verified_at' => 'datetime', + 'password' => 'hashed', + ]; + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php new file mode 100755 index 0000000..452e6b6 --- /dev/null +++ b/app/Providers/AppServiceProvider.php @@ -0,0 +1,24 @@ +handleCommand(new ArgvInput); + +exit($status); diff --git a/bootstrap/app.php b/bootstrap/app.php new file mode 100755 index 0000000..7059d05 --- /dev/null +++ b/bootstrap/app.php @@ -0,0 +1,23 @@ +withRouting( + web: __DIR__.'/../routes/web.php', + commands: __DIR__.'/../routes/console.php', + health: '/up', + ) + ->withMiddleware(function (Middleware $middleware) { + $middleware->alias([ + 'hive.auth' => AuthMiddleware::class, + 'hive.guest' => GuestMiddleware::class + ]); + }) + ->withExceptions(function (Exceptions $exceptions) { + // + })->create(); diff --git a/bootstrap/cache/.gitignore b/bootstrap/cache/.gitignore new file mode 100755 index 0000000..d6b7ef3 --- /dev/null +++ b/bootstrap/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/bootstrap/providers.php b/bootstrap/providers.php new file mode 100755 index 0000000..38b258d --- /dev/null +++ b/bootstrap/providers.php @@ -0,0 +1,5 @@ +=5.0.0" + }, + "require-dev": { + "doctrine/dbal": "^4.0.0", + "nesbot/carbon": "^2.71.0 || ^3.0.0", + "phpunit/phpunit": "^10.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KyleKatarn", + "email": "kylekatarnls@gmail.com" + } + ], + "description": "Types to use Carbon in Doctrine", + "keywords": [ + "carbon", + "date", + "datetime", + "doctrine", + "time" + ], + "support": { + "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], + "time": "2024-02-09T16:56:22+00:00" + }, + { + "name": "dflydev/dot-access-data", + "version": "v3.0.3", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/a23a2bf4f31d3518f3ecb38660c95715dfead60f", + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.42", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.3", + "scrutinizer/ocular": "1.6.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Dflydev\\DotAccessData\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + }, + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "support": { + "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", + "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.3" + }, + "time": "2024-07-08T12:26:09+00:00" + }, + { + "name": "doctrine/inflector", + "version": "2.0.10", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^11.0", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.3", + "phpunit/phpunit": "^8.5 || ^9.5", + "vimeo/psalm": "^4.25 || ^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.0.10" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } + ], + "time": "2024-02-18T20:23:39+00:00" + }, + { + "name": "doctrine/lexer", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^5.21" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/3.0.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2024-02-05T11:56:58+00:00" + }, + { + "name": "dragonmantank/cron-expression", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/dragonmantank/cron-expression.git", + "reference": "8c784d071debd117328803d86b2097615b457500" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/8c784d071debd117328803d86b2097615b457500", + "reference": "8c784d071debd117328803d86b2097615b457500", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0", + "webmozart/assert": "^1.0" + }, + "replace": { + "mtdowling/cron-expression": "^1.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.0", + "phpunit/phpunit": "^7.0|^8.0|^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Cron\\": "src/Cron/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Tankersley", + "email": "chris@ctankersley.com", + "homepage": "https://github.com/dragonmantank" + } + ], + "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", + "keywords": [ + "cron", + "schedule" + ], + "support": { + "issues": "https://github.com/dragonmantank/cron-expression/issues", + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://github.com/dragonmantank", + "type": "github" + } + ], + "time": "2024-10-09T13:47:03+00:00" + }, + { + "name": "egulias/email-validator", + "version": "4.0.2", + "source": { + "type": "git", + "url": "https://github.com/egulias/EmailValidator.git", + "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ebaaf5be6c0286928352e054f2d5125608e5405e", + "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^2.0 || ^3.0", + "php": ">=8.1", + "symfony/polyfill-intl-idn": "^1.26" + }, + "require-dev": { + "phpunit/phpunit": "^10.2", + "vimeo/psalm": "^5.12" + }, + "suggest": { + "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Egulias\\EmailValidator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eduardo Gulias Davis" + } + ], + "description": "A library for validating emails against several RFCs", + "homepage": "https://github.com/egulias/EmailValidator", + "keywords": [ + "email", + "emailvalidation", + "emailvalidator", + "validation", + "validator" + ], + "support": { + "issues": "https://github.com/egulias/EmailValidator/issues", + "source": "https://github.com/egulias/EmailValidator/tree/4.0.2" + }, + "funding": [ + { + "url": "https://github.com/egulias", + "type": "github" + } + ], + "time": "2023-10-06T06:47:41+00:00" + }, + { + "name": "fruitcake/php-cors", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/fruitcake/php-cors.git", + "reference": "3d158f36e7875e2f040f37bc0573956240a5a38b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fruitcake/php-cors/zipball/3d158f36e7875e2f040f37bc0573956240a5a38b", + "reference": "3d158f36e7875e2f040f37bc0573956240a5a38b", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0", + "symfony/http-foundation": "^4.4|^5.4|^6|^7" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "phpunit/phpunit": "^9", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Fruitcake\\Cors\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fruitcake", + "homepage": "https://fruitcake.nl" + }, + { + "name": "Barryvdh", + "email": "barryvdh@gmail.com" + } + ], + "description": "Cross-origin resource sharing library for the Symfony HttpFoundation", + "homepage": "https://github.com/fruitcake/php-cors", + "keywords": [ + "cors", + "laravel", + "symfony" + ], + "support": { + "issues": "https://github.com/fruitcake/php-cors/issues", + "source": "https://github.com/fruitcake/php-cors/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2023-10-12T05:21:21+00:00" + }, + { + "name": "graham-campbell/result-type", + "version": "v1.1.3", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "3ba905c11371512af9d9bdd27d99b782216b6945" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/3ba905c11371512af9d9bdd27d99b782216b6945", + "reference": "3ba905c11371512af9d9bdd27d99b782216b6945", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.3" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" + }, + "type": "library", + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "An Implementation Of The Result Type", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Result Type", + "Result-Type", + "result" + ], + "support": { + "issues": "https://github.com/GrahamCampbell/Result-Type/issues", + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2024-07-20T21:45:45+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.9.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "d281ed313b989f213357e3be1a179f02196ac99b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", + "reference": "d281ed313b989f213357e3be1a179f02196ac99b", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.9.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2024-07-24T11:22:20+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2024-10-17T10:06:22+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.7.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.7.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2024-07-18T11:15:46+00:00" + }, + { + "name": "guzzlehttp/uri-template", + "version": "v1.0.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/uri-template.git", + "reference": "ecea8feef63bd4fef1f037ecb288386999ecc11c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/ecea8feef63bd4fef1f037ecb288386999ecc11c", + "reference": "ecea8feef63bd4fef1f037ecb288386999ecc11c", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "symfony/polyfill-php80": "^1.24" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "uri-template/tests": "1.0.0" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\UriTemplate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + } + ], + "description": "A polyfill class for uri_template of PHP", + "keywords": [ + "guzzlehttp", + "uri-template" + ], + "support": { + "issues": "https://github.com/guzzle/uri-template/issues", + "source": "https://github.com/guzzle/uri-template/tree/v1.0.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/uri-template", + "type": "tidelift" + } + ], + "time": "2023-12-03T19:50:20+00:00" + }, + { + "name": "hashids/hashids", + "version": "5.0.2", + "source": { + "type": "git", + "url": "https://github.com/vinkla/hashids.git", + "reference": "197171016b77ddf14e259e186559152eb3f8cf33" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vinkla/hashids/zipball/197171016b77ddf14e259e186559152eb3f8cf33", + "reference": "197171016b77ddf14e259e186559152eb3f8cf33", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-bcmath": "Required to use BC Math arbitrary precision mathematics (*).", + "ext-gmp": "Required to use GNU multiple precision mathematics (*)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Hashids\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ivan Akimov", + "email": "ivan@barreleye.com" + }, + { + "name": "Vincent Klaiber", + "email": "hello@doubledip.se" + } + ], + "description": "Generate short, unique, non-sequential ids (like YouTube and Bitly) from numbers", + "homepage": "https://hashids.org/php", + "keywords": [ + "bitly", + "decode", + "encode", + "hash", + "hashid", + "hashids", + "ids", + "obfuscate", + "youtube" + ], + "support": { + "issues": "https://github.com/vinkla/hashids/issues", + "source": "https://github.com/vinkla/hashids/tree/5.0.2" + }, + "time": "2023-02-23T15:00:54+00:00" + }, + { + "name": "intervention/image", + "version": "2.7.2", + "source": { + "type": "git", + "url": "https://github.com/Intervention/image.git", + "reference": "04be355f8d6734c826045d02a1079ad658322dad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Intervention/image/zipball/04be355f8d6734c826045d02a1079ad658322dad", + "reference": "04be355f8d6734c826045d02a1079ad658322dad", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "guzzlehttp/psr7": "~1.1 || ^2.0", + "php": ">=5.4.0" + }, + "require-dev": { + "mockery/mockery": "~0.9.2", + "phpunit/phpunit": "^4.8 || ^5.7 || ^7.5.15" + }, + "suggest": { + "ext-gd": "to use GD library based image processing.", + "ext-imagick": "to use Imagick based image processing.", + "intervention/imagecache": "Caching extension for the Intervention Image library" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + }, + "laravel": { + "providers": [ + "Intervention\\Image\\ImageServiceProvider" + ], + "aliases": { + "Image": "Intervention\\Image\\Facades\\Image" + } + } + }, + "autoload": { + "psr-4": { + "Intervention\\Image\\": "src/Intervention/Image" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oliver Vogel", + "email": "oliver@intervention.io", + "homepage": "https://intervention.io/" + } + ], + "description": "Image handling and manipulation library with support for Laravel integration", + "homepage": "http://image.intervention.io/", + "keywords": [ + "gd", + "image", + "imagick", + "laravel", + "thumbnail", + "watermark" + ], + "support": { + "issues": "https://github.com/Intervention/image/issues", + "source": "https://github.com/Intervention/image/tree/2.7.2" + }, + "funding": [ + { + "url": "https://paypal.me/interventionio", + "type": "custom" + }, + { + "url": "https://github.com/Intervention", + "type": "github" + } + ], + "time": "2022-05-21T17:30:32+00:00" + }, + { + "name": "laravel/framework", + "version": "v11.30.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/framework.git", + "reference": "dff716442d9c229d716be82ccc9a7de52eb97193" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/framework/zipball/dff716442d9c229d716be82ccc9a7de52eb97193", + "reference": "dff716442d9c229d716be82ccc9a7de52eb97193", + "shasum": "" + }, + "require": { + "brick/math": "^0.9.3|^0.10.2|^0.11|^0.12", + "composer-runtime-api": "^2.2", + "doctrine/inflector": "^2.0.5", + "dragonmantank/cron-expression": "^3.3.2", + "egulias/email-validator": "^3.2.1|^4.0", + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "ext-session": "*", + "ext-tokenizer": "*", + "fruitcake/php-cors": "^1.3", + "guzzlehttp/guzzle": "^7.8", + "guzzlehttp/uri-template": "^1.0", + "laravel/prompts": "^0.1.18|^0.2.0|^0.3.0", + "laravel/serializable-closure": "^1.3", + "league/commonmark": "^2.2.1", + "league/flysystem": "^3.8.0", + "monolog/monolog": "^3.0", + "nesbot/carbon": "^2.72.2|^3.0", + "nunomaduro/termwind": "^2.0", + "php": "^8.2", + "psr/container": "^1.1.1|^2.0.1", + "psr/log": "^1.0|^2.0|^3.0", + "psr/simple-cache": "^1.0|^2.0|^3.0", + "ramsey/uuid": "^4.7", + "symfony/console": "^7.0", + "symfony/error-handler": "^7.0", + "symfony/finder": "^7.0", + "symfony/http-foundation": "^7.0", + "symfony/http-kernel": "^7.0", + "symfony/mailer": "^7.0", + "symfony/mime": "^7.0", + "symfony/polyfill-php83": "^1.28", + "symfony/process": "^7.0", + "symfony/routing": "^7.0", + "symfony/uid": "^7.0", + "symfony/var-dumper": "^7.0", + "tijsverkoyen/css-to-inline-styles": "^2.2.5", + "vlucas/phpdotenv": "^5.4.1", + "voku/portable-ascii": "^2.0" + }, + "conflict": { + "mockery/mockery": "1.6.8", + "tightenco/collect": "<5.5.33" + }, + "provide": { + "psr/container-implementation": "1.1|2.0", + "psr/log-implementation": "1.0|2.0|3.0", + "psr/simple-cache-implementation": "1.0|2.0|3.0" + }, + "replace": { + "illuminate/auth": "self.version", + "illuminate/broadcasting": "self.version", + "illuminate/bus": "self.version", + "illuminate/cache": "self.version", + "illuminate/collections": "self.version", + "illuminate/concurrency": "self.version", + "illuminate/conditionable": "self.version", + "illuminate/config": "self.version", + "illuminate/console": "self.version", + "illuminate/container": "self.version", + "illuminate/contracts": "self.version", + "illuminate/cookie": "self.version", + "illuminate/database": "self.version", + "illuminate/encryption": "self.version", + "illuminate/events": "self.version", + "illuminate/filesystem": "self.version", + "illuminate/hashing": "self.version", + "illuminate/http": "self.version", + "illuminate/log": "self.version", + "illuminate/macroable": "self.version", + "illuminate/mail": "self.version", + "illuminate/notifications": "self.version", + "illuminate/pagination": "self.version", + "illuminate/pipeline": "self.version", + "illuminate/process": "self.version", + "illuminate/queue": "self.version", + "illuminate/redis": "self.version", + "illuminate/routing": "self.version", + "illuminate/session": "self.version", + "illuminate/support": "self.version", + "illuminate/testing": "self.version", + "illuminate/translation": "self.version", + "illuminate/validation": "self.version", + "illuminate/view": "self.version", + "spatie/once": "*" + }, + "require-dev": { + "ably/ably-php": "^1.0", + "aws/aws-sdk-php": "^3.235.5", + "ext-gmp": "*", + "fakerphp/faker": "^1.23", + "league/flysystem-aws-s3-v3": "^3.0", + "league/flysystem-ftp": "^3.0", + "league/flysystem-path-prefixing": "^3.3", + "league/flysystem-read-only": "^3.3", + "league/flysystem-sftp-v3": "^3.0", + "mockery/mockery": "^1.6", + "nyholm/psr7": "^1.2", + "orchestra/testbench-core": "^9.5", + "pda/pheanstalk": "^5.0", + "phpstan/phpstan": "^1.11.5", + "phpunit/phpunit": "^10.5|^11.0", + "predis/predis": "^2.0.2", + "resend/resend-php": "^0.10.0", + "symfony/cache": "^7.0", + "symfony/http-client": "^7.0", + "symfony/psr-http-message-bridge": "^7.0" + }, + "suggest": { + "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", + "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.235.5).", + "brianium/paratest": "Required to run tests in parallel (^7.0|^8.0).", + "ext-apcu": "Required to use the APC cache driver.", + "ext-fileinfo": "Required to use the Filesystem class.", + "ext-ftp": "Required to use the Flysystem FTP driver.", + "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", + "ext-memcached": "Required to use the memcache cache driver.", + "ext-pcntl": "Required to use all features of the queue worker and console signal trapping.", + "ext-pdo": "Required to use all database features.", + "ext-posix": "Required to use all features of the queue worker.", + "ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0|^6.0).", + "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", + "filp/whoops": "Required for friendly error pages in development (^2.14.3).", + "laravel/tinker": "Required to use the tinker console command (^2.0).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).", + "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).", + "league/flysystem-path-prefixing": "Required to use the scoped driver (^3.3).", + "league/flysystem-read-only": "Required to use read-only disks (^3.3)", + "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).", + "mockery/mockery": "Required to use mocking (^1.6).", + "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", + "pda/pheanstalk": "Required to use the beanstalk queue driver (^5.0).", + "phpunit/phpunit": "Required to use assertions and run tests (^10.5|^11.0).", + "predis/predis": "Required to use the predis connector (^2.0.2).", + "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).", + "resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^7.0).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^7.0).", + "symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.0).", + "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.0).", + "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.0).", + "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "11.x-dev" + } + }, + "autoload": { + "files": [ + "src/Illuminate/Collections/helpers.php", + "src/Illuminate/Events/functions.php", + "src/Illuminate/Filesystem/functions.php", + "src/Illuminate/Foundation/helpers.php", + "src/Illuminate/Log/functions.php", + "src/Illuminate/Support/functions.php", + "src/Illuminate/Support/helpers.php" + ], + "psr-4": { + "Illuminate\\": "src/Illuminate/", + "Illuminate\\Support\\": [ + "src/Illuminate/Macroable/", + "src/Illuminate/Collections/", + "src/Illuminate/Conditionable/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Laravel Framework.", + "homepage": "https://laravel.com", + "keywords": [ + "framework", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2024-10-30T15:00:34+00:00" + }, + { + "name": "laravel/prompts", + "version": "v0.1.25", + "source": { + "type": "git", + "url": "https://github.com/laravel/prompts.git", + "reference": "7b4029a84c37cb2725fc7f011586e2997040bc95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/prompts/zipball/7b4029a84c37cb2725fc7f011586e2997040bc95", + "reference": "7b4029a84c37cb2725fc7f011586e2997040bc95", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "illuminate/collections": "^10.0|^11.0", + "php": "^8.1", + "symfony/console": "^6.2|^7.0" + }, + "conflict": { + "illuminate/console": ">=10.17.0 <10.25.0", + "laravel/framework": ">=10.17.0 <10.25.0" + }, + "require-dev": { + "mockery/mockery": "^1.5", + "pestphp/pest": "^2.3", + "phpstan/phpstan": "^1.11", + "phpstan/phpstan-mockery": "^1.1" + }, + "suggest": { + "ext-pcntl": "Required for the spinner to be animated." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.1.x-dev" + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Laravel\\Prompts\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Add beautiful and user-friendly forms to your command-line applications.", + "support": { + "issues": "https://github.com/laravel/prompts/issues", + "source": "https://github.com/laravel/prompts/tree/v0.1.25" + }, + "time": "2024-08-12T22:06:33+00:00" + }, + { + "name": "laravel/serializable-closure", + "version": "v1.3.5", + "source": { + "type": "git", + "url": "https://github.com/laravel/serializable-closure.git", + "reference": "1dc4a3dbfa2b7628a3114e43e32120cce7cdda9c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/1dc4a3dbfa2b7628a3114e43e32120cce7cdda9c", + "reference": "1dc4a3dbfa2b7628a3114e43e32120cce7cdda9c", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "require-dev": { + "illuminate/support": "^8.0|^9.0|^10.0|^11.0", + "nesbot/carbon": "^2.61|^3.0", + "pestphp/pest": "^1.21.3", + "phpstan/phpstan": "^1.8.2", + "symfony/var-dumper": "^5.4.11|^6.2.0|^7.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\SerializableClosure\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Nuno Maduro", + "email": "nuno@laravel.com" + } + ], + "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.", + "keywords": [ + "closure", + "laravel", + "serializable" + ], + "support": { + "issues": "https://github.com/laravel/serializable-closure/issues", + "source": "https://github.com/laravel/serializable-closure" + }, + "time": "2024-09-23T13:33:08+00:00" + }, + { + "name": "laravel/tinker", + "version": "v2.10.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/tinker.git", + "reference": "ba4d51eb56de7711b3a37d63aa0643e99a339ae5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/tinker/zipball/ba4d51eb56de7711b3a37d63aa0643e99a339ae5", + "reference": "ba4d51eb56de7711b3a37d63aa0643e99a339ae5", + "shasum": "" + }, + "require": { + "illuminate/console": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "php": "^7.2.5|^8.0", + "psy/psysh": "^0.11.1|^0.12.0", + "symfony/var-dumper": "^4.3.4|^5.0|^6.0|^7.0" + }, + "require-dev": { + "mockery/mockery": "~1.3.3|^1.4.2", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8.5.8|^9.3.3" + }, + "suggest": { + "illuminate/database": "The Illuminate Database package (^6.0|^7.0|^8.0|^9.0|^10.0|^11.0)." + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Tinker\\TinkerServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Tinker\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Powerful REPL for the Laravel framework.", + "keywords": [ + "REPL", + "Tinker", + "laravel", + "psysh" + ], + "support": { + "issues": "https://github.com/laravel/tinker/issues", + "source": "https://github.com/laravel/tinker/tree/v2.10.0" + }, + "time": "2024-09-23T13:32:56+00:00" + }, + { + "name": "league/commonmark", + "version": "2.5.3", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/commonmark.git", + "reference": "b650144166dfa7703e62a22e493b853b58d874b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/b650144166dfa7703e62a22e493b853b58d874b0", + "reference": "b650144166dfa7703e62a22e493b853b58d874b0", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "league/config": "^1.1.1", + "php": "^7.4 || ^8.0", + "psr/event-dispatcher": "^1.0", + "symfony/deprecation-contracts": "^2.1 || ^3.0", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "cebe/markdown": "^1.0", + "commonmark/cmark": "0.31.1", + "commonmark/commonmark.js": "0.31.1", + "composer/package-versions-deprecated": "^1.8", + "embed/embed": "^4.4", + "erusev/parsedown": "^1.0", + "ext-json": "*", + "github/gfm": "0.29.0", + "michelf/php-markdown": "^1.4 || ^2.0", + "nyholm/psr7": "^1.5", + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0", + "scrutinizer/ocular": "^1.8.1", + "symfony/finder": "^5.3 | ^6.0 || ^7.0", + "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 || ^7.0", + "unleashedtech/php-coding-standard": "^3.1.1", + "vimeo/psalm": "^4.24.0 || ^5.0.0" + }, + "suggest": { + "symfony/yaml": "v2.3+ required if using the Front Matter extension" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "League\\CommonMark\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)", + "homepage": "https://commonmark.thephpleague.com", + "keywords": [ + "commonmark", + "flavored", + "gfm", + "github", + "github-flavored", + "markdown", + "md", + "parser" + ], + "support": { + "docs": "https://commonmark.thephpleague.com/", + "forum": "https://github.com/thephpleague/commonmark/discussions", + "issues": "https://github.com/thephpleague/commonmark/issues", + "rss": "https://github.com/thephpleague/commonmark/releases.atom", + "source": "https://github.com/thephpleague/commonmark" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/commonmark", + "type": "tidelift" + } + ], + "time": "2024-08-16T11:46:16+00:00" + }, + { + "name": "league/config", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/config.git", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/config/zipball/754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^3.0.1", + "nette/schema": "^1.2", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.5", + "scrutinizer/ocular": "^1.8.1", + "unleashedtech/php-coding-standard": "^3.1", + "vimeo/psalm": "^4.7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Define configuration arrays with strict schemas and access values with dot notation", + "homepage": "https://config.thephpleague.com", + "keywords": [ + "array", + "config", + "configuration", + "dot", + "dot-access", + "nested", + "schema" + ], + "support": { + "docs": "https://config.thephpleague.com/", + "issues": "https://github.com/thephpleague/config/issues", + "rss": "https://github.com/thephpleague/config/releases.atom", + "source": "https://github.com/thephpleague/config" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + } + ], + "time": "2022-12-11T20:36:23+00:00" + }, + { + "name": "league/flysystem", + "version": "3.29.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "edc1bb7c86fab0776c3287dbd19b5fa278347319" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/edc1bb7c86fab0776c3287dbd19b5fa278347319", + "reference": "edc1bb7c86fab0776c3287dbd19b5fa278347319", + "shasum": "" + }, + "require": { + "league/flysystem-local": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" + }, + "conflict": { + "async-aws/core": "<1.19.0", + "async-aws/s3": "<1.14.0", + "aws/aws-sdk-php": "3.209.31 || 3.210.0", + "guzzlehttp/guzzle": "<7.0", + "guzzlehttp/ringphp": "<1.1.1", + "phpseclib/phpseclib": "3.0.15", + "symfony/http-client": "<5.2" + }, + "require-dev": { + "async-aws/s3": "^1.5 || ^2.0", + "async-aws/simple-s3": "^1.1 || ^2.0", + "aws/aws-sdk-php": "^3.295.10", + "composer/semver": "^3.0", + "ext-fileinfo": "*", + "ext-ftp": "*", + "ext-mongodb": "^1.3", + "ext-zip": "*", + "friendsofphp/php-cs-fixer": "^3.5", + "google/cloud-storage": "^1.23", + "guzzlehttp/psr7": "^2.6", + "microsoft/azure-storage-blob": "^1.1", + "mongodb/mongodb": "^1.2", + "phpseclib/phpseclib": "^3.0.36", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.11|^10.0", + "sabre/dav": "^4.6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "File storage abstraction for PHP", + "keywords": [ + "WebDAV", + "aws", + "cloud", + "file", + "files", + "filesystem", + "filesystems", + "ftp", + "s3", + "sftp", + "storage" + ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/3.29.1" + }, + "time": "2024-10-08T08:58:34+00:00" + }, + { + "name": "league/flysystem-local", + "version": "3.29.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem-local.git", + "reference": "e0e8d52ce4b2ed154148453d321e97c8e931bd27" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/e0e8d52ce4b2ed154148453d321e97c8e931bd27", + "reference": "e0e8d52ce4b2ed154148453d321e97c8e931bd27", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "league/flysystem": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\Local\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Local filesystem adapter for Flysystem.", + "keywords": [ + "Flysystem", + "file", + "files", + "filesystem", + "local" + ], + "support": { + "source": "https://github.com/thephpleague/flysystem-local/tree/3.29.0" + }, + "time": "2024-08-09T21:24:39+00:00" + }, + { + "name": "league/mime-type-detection", + "version": "1.16.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/2d6702ff215bf922936ccc1ad31007edc76451b9", + "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.2", + "phpstan/phpstan": "^0.12.68", + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\MimeTypeDetection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Mime-type detection for Flysystem", + "support": { + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.16.0" + }, + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "time": "2024-09-21T08:32:55+00:00" + }, + { + "name": "lexx27/lucent", + "version": "v1.2.4", + "dist": { + "type": "path", + "url": "../lucent-laravel", + "reference": "c507dc6031e0e9f771ef90ede522cf1b3e923b87" + }, + "require": { + "ext-imagick": "*", + "ext-pdo": "*", + "ext-sqlite3": "*", + "ext-xml": "*", + "ext-zip": "*", + "guzzlehttp/guzzle": "^7.2", + "intervention/image": "^2.7", + "php": "^8.3", + "phpoption/phpoption": "^1.9", + "spatie/image-optimizer": "^1.6", + "staudenmeir/laravel-cte": "^1.0" + }, + "require-dev": { + "laravel/framework": "^10.10", + "phpstan/phpstan": "^1.8" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Lucent\\LucentServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Lucent\\": "src/" + }, + "files": [ + "src/Response.php", + "src/macros.php" + ] + }, + "license": [ + "MIT" + ], + "description": "Lucent cms", + "transport-options": { + "relative": true + } + }, + { + "name": "livewire/livewire", + "version": "v3.5.12", + "source": { + "type": "git", + "url": "https://github.com/livewire/livewire.git", + "reference": "3c8d1f9d7d9098aaea663093ae168f2d5d2ae73d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/livewire/livewire/zipball/3c8d1f9d7d9098aaea663093ae168f2d5d2ae73d", + "reference": "3c8d1f9d7d9098aaea663093ae168f2d5d2ae73d", + "shasum": "" + }, + "require": { + "illuminate/database": "^10.0|^11.0", + "illuminate/routing": "^10.0|^11.0", + "illuminate/support": "^10.0|^11.0", + "illuminate/validation": "^10.0|^11.0", + "laravel/prompts": "^0.1.24|^0.2|^0.3", + "league/mime-type-detection": "^1.9", + "php": "^8.1", + "symfony/console": "^6.0|^7.0", + "symfony/http-kernel": "^6.2|^7.0" + }, + "require-dev": { + "calebporzio/sushi": "^2.1", + "laravel/framework": "^10.15.0|^11.0", + "mockery/mockery": "^1.3.1", + "orchestra/testbench": "^8.21.0|^9.0", + "orchestra/testbench-dusk": "^8.24|^9.1", + "phpunit/phpunit": "^10.4", + "psy/psysh": "^0.11.22|^0.12" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Livewire\\LivewireServiceProvider" + ], + "aliases": { + "Livewire": "Livewire\\Livewire" + } + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Livewire\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Caleb Porzio", + "email": "calebporzio@gmail.com" + } + ], + "description": "A front-end framework for Laravel.", + "support": { + "issues": "https://github.com/livewire/livewire/issues", + "source": "https://github.com/livewire/livewire/tree/v3.5.12" + }, + "funding": [ + { + "url": "https://github.com/livewire", + "type": "github" + } + ], + "time": "2024-10-15T19:35:06+00:00" + }, + { + "name": "monolog/monolog", + "version": "3.7.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f4393b648b78a5408747de94fca38beb5f7e9ef8", + "reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/log": "^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7 || ^8", + "ext-json": "*", + "graylog2/gelf-php": "^1.4.2 || ^2.0", + "guzzlehttp/guzzle": "^7.4.5", + "guzzlehttp/psr7": "^2.2", + "mongodb/mongodb": "^1.8", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-strict-rules": "^1.4", + "phpunit/phpunit": "^10.5.17", + "predis/predis": "^1.1 || ^2", + "ruflin/elastica": "^7", + "symfony/mailer": "^5.4 || ^6", + "symfony/mime": "^5.4 || ^6" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/3.7.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2024-06-28T09:40:51+00:00" + }, + { + "name": "nesbot/carbon", + "version": "3.8.1", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "10ac0aa86b8062219ce21e8189123d611ca3ecd9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/10ac0aa86b8062219ce21e8189123d611ca3ecd9", + "reference": "10ac0aa86b8062219ce21e8189123d611ca3ecd9", + "shasum": "" + }, + "require": { + "carbonphp/carbon-doctrine-types": "<100.0", + "ext-json": "*", + "php": "^8.1", + "psr/clock": "^1.0", + "symfony/clock": "^6.3 || ^7.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/translation": "^4.4.18 || ^5.2.1|| ^6.0 || ^7.0" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "require-dev": { + "doctrine/dbal": "^3.6.3 || ^4.0", + "doctrine/orm": "^2.15.2 || ^3.0", + "friendsofphp/php-cs-fixer": "^3.57.2", + "kylekatarnls/multi-tester": "^2.5.3", + "ondrejmirtes/better-reflection": "^6.25.0.4", + "phpmd/phpmd": "^2.15.0", + "phpstan/extension-installer": "^1.3.1", + "phpstan/phpstan": "^1.11.2", + "phpunit/phpunit": "^10.5.20", + "squizlabs/php_codesniffer": "^3.9.0" + }, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev", + "dev-2.x": "2.x-dev" + }, + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "https://markido.com" + }, + { + "name": "kylekatarnls", + "homepage": "https://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "https://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "support": { + "docs": "https://carbon.nesbot.com/docs", + "issues": "https://github.com/briannesbitt/Carbon/issues", + "source": "https://github.com/briannesbitt/Carbon" + }, + "funding": [ + { + "url": "https://github.com/sponsors/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon#sponsor", + "type": "opencollective" + }, + { + "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", + "type": "tidelift" + } + ], + "time": "2024-11-03T16:02:24+00:00" + }, + { + "name": "nette/schema", + "version": "v1.3.2", + "source": { + "type": "git", + "url": "https://github.com/nette/schema.git", + "reference": "da801d52f0354f70a638673c4a0f04e16529431d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/schema/zipball/da801d52f0354f70a638673c4a0f04e16529431d", + "reference": "da801d52f0354f70a638673c4a0f04e16529431d", + "shasum": "" + }, + "require": { + "nette/utils": "^4.0", + "php": "8.1 - 8.4" + }, + "require-dev": { + "nette/tester": "^2.5.2", + "phpstan/phpstan-nette": "^1.0", + "tracy/tracy": "^2.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "📐 Nette Schema: validating data structures against a given Schema.", + "homepage": "https://nette.org", + "keywords": [ + "config", + "nette" + ], + "support": { + "issues": "https://github.com/nette/schema/issues", + "source": "https://github.com/nette/schema/tree/v1.3.2" + }, + "time": "2024-10-06T23:10:23+00:00" + }, + { + "name": "nette/utils", + "version": "v4.0.5", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/736c567e257dbe0fcf6ce81b4d6dbe05c6899f96", + "reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96", + "shasum": "" + }, + "require": { + "php": "8.0 - 8.4" + }, + "conflict": { + "nette/finder": "<3", + "nette/schema": "<1.2.2" + }, + "require-dev": { + "jetbrains/phpstorm-attributes": "dev-master", + "nette/tester": "^2.5", + "phpstan/phpstan": "^1.0", + "tracy/tracy": "^2.9" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", + "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "support": { + "issues": "https://github.com/nette/utils/issues", + "source": "https://github.com/nette/utils/tree/v4.0.5" + }, + "time": "2024-08-07T15:39:19+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.3.1", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" + }, + "time": "2024-10-08T18:51:32+00:00" + }, + { + "name": "nunomaduro/termwind", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/termwind.git", + "reference": "42c84e4e8090766bbd6445d06cd6e57650626ea3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/42c84e4e8090766bbd6445d06cd6e57650626ea3", + "reference": "42c84e4e8090766bbd6445d06cd6e57650626ea3", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^8.2", + "symfony/console": "^7.1.5" + }, + "require-dev": { + "illuminate/console": "^11.28.0", + "laravel/pint": "^1.18.1", + "mockery/mockery": "^1.6.12", + "pestphp/pest": "^2.36.0", + "phpstan/phpstan": "^1.12.6", + "phpstan/phpstan-strict-rules": "^1.6.1", + "symfony/var-dumper": "^7.1.5", + "thecodingmachine/phpstan-strict-rules": "^1.0.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Termwind\\Laravel\\TermwindServiceProvider" + ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Termwind\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Its like Tailwind CSS, but for the console.", + "keywords": [ + "cli", + "console", + "css", + "package", + "php", + "style" + ], + "support": { + "issues": "https://github.com/nunomaduro/termwind/issues", + "source": "https://github.com/nunomaduro/termwind/tree/v2.2.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://github.com/xiCO2k", + "type": "github" + } + ], + "time": "2024-10-15T16:15:16+00:00" + }, + { + "name": "phpoption/phpoption", + "version": "1.9.3", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/e3fac8b24f56113f7cb96af14958c0dd16330f54", + "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpOption\\": "src/PhpOption/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh" + }, + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "support": { + "issues": "https://github.com/schmittjoh/php-option/issues", + "source": "https://github.com/schmittjoh/php-option/tree/1.9.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", + "type": "tidelift" + } + ], + "time": "2024-07-20T21:41:07+00:00" + }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "time": "2022-11-25T14:36:26+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "psr/simple-cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, + "time": "2021-10-29T13:26:27+00:00" + }, + { + "name": "psy/psysh", + "version": "v0.12.4", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/psysh.git", + "reference": "2fd717afa05341b4f8152547f142cd2f130f6818" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/2fd717afa05341b4f8152547f142cd2f130f6818", + "reference": "2fd717afa05341b4f8152547f142cd2f130f6818", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-tokenizer": "*", + "nikic/php-parser": "^5.0 || ^4.0", + "php": "^8.0 || ^7.4", + "symfony/console": "^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4", + "symfony/var-dumper": "^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4" + }, + "conflict": { + "symfony/console": "4.4.37 || 5.3.14 || 5.3.15 || 5.4.3 || 5.4.4 || 6.0.3 || 6.0.4" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2" + }, + "suggest": { + "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", + "ext-pdo-sqlite": "The doc command requires SQLite to work.", + "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well." + }, + "bin": [ + "bin/psysh" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.12.x-dev" + }, + "bamarni-bin": { + "bin-links": false, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Psy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info", + "homepage": "http://justinhileman.com" + } + ], + "description": "An interactive shell for modern PHP.", + "homepage": "http://psysh.org", + "keywords": [ + "REPL", + "console", + "interactive", + "shell" + ], + "support": { + "issues": "https://github.com/bobthecow/psysh/issues", + "source": "https://github.com/bobthecow/psysh/tree/v0.12.4" + }, + "time": "2024-06-10T01:18:23+00:00" + }, + { + "name": "radical/lucent-presets", + "version": "dev-master", + "dist": { + "type": "path", + "url": "../lucent-presets", + "reference": "145a78ad345199fec4a5dd2b67e59bbf6080b7c8" + }, + "require": { + "guzzlehttp/guzzle": "^7.2", + "hashids/hashids": "^5.0.2", + "laravel/prompts": "^0.1.18", + "php": "^8.3" + }, + "require-dev": { + "laravel/framework": "^10.10", + "phpstan/phpstan": "^1.8" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "LucentPresets\\LucentPresetsServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "LucentPresets\\": "src/" + } + }, + "license": [ + "MIT" + ], + "description": "Various presets for Lucent", + "transport-options": { + "relative": true + } + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "ramsey/collection", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.28.3", + "fakerphp/faker": "^1.21", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^1.0", + "mockery/mockery": "^1.5", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcsstandards/phpcsutils": "^1.0.0-rc1", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18.4", + "ramsey/coding-standard": "^2.0.3", + "ramsey/conventional-commits": "^1.3", + "vimeo/psalm": "^5.4" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" + } + ], + "time": "2022-12-31T21:50:55+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.7.6", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/91039bc1faa45ba123c4328958e620d382ec7088", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", + "ext-json": "*", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.8", + "ergebnis/composer-normalize": "^2.15", + "mockery/mockery": "^1.3", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.2", + "php-mock/php-mock-mockery": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^8.5 || ^9", + "ramsey/composer-repl": "^1.4", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.9" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.7.6" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "type": "tidelift" + } + ], + "time": "2024-04-27T21:32:50+00:00" + }, + { + "name": "spatie/image-optimizer", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/image-optimizer.git", + "reference": "4fd22035e81d98fffced65a8c20d9ec4daa9671c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/image-optimizer/zipball/4fd22035e81d98fffced65a8c20d9ec4daa9671c", + "reference": "4fd22035e81d98fffced65a8c20d9ec4daa9671c", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.3|^8.0", + "psr/log": "^1.0 | ^2.0 | ^3.0", + "symfony/process": "^4.2|^5.0|^6.0|^7.0" + }, + "require-dev": { + "pestphp/pest": "^1.21", + "phpunit/phpunit": "^8.5.21|^9.4.4", + "symfony/var-dumper": "^4.2|^5.0|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\ImageOptimizer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Easily optimize images using PHP", + "homepage": "https://github.com/spatie/image-optimizer", + "keywords": [ + "image-optimizer", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/image-optimizer/issues", + "source": "https://github.com/spatie/image-optimizer/tree/1.8.0" + }, + "time": "2024-11-04T08:24:54+00:00" + }, + { + "name": "staudenmeir/laravel-cte", + "version": "v1.11.1", + "source": { + "type": "git", + "url": "https://github.com/staudenmeir/laravel-cte.git", + "reference": "9b7bd75c5123fcdf278c0f7be5409544b70d3bf6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/staudenmeir/laravel-cte/zipball/9b7bd75c5123fcdf278c0f7be5409544b70d3bf6", + "reference": "9b7bd75c5123fcdf278c0f7be5409544b70d3bf6", + "shasum": "" + }, + "require": { + "illuminate/database": "^11.0", + "php": "^8.2" + }, + "require-dev": { + "orchestra/testbench": "^9.0", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^11.0", + "singlestoredb/singlestoredb-laravel": "^1.5.4", + "yajra/laravel-oci8": "^11.2.4" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Staudenmeir\\LaravelCte\\DatabaseServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Staudenmeir\\LaravelCte\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonas Staudenmeir", + "email": "mail@jonas-staudenmeir.de" + } + ], + "description": "Laravel queries with common table expressions", + "support": { + "issues": "https://github.com/staudenmeir/laravel-cte/issues", + "source": "https://github.com/staudenmeir/laravel-cte/tree/v1.11.1" + }, + "funding": [ + { + "url": "https://paypal.me/JonasStaudenmeir", + "type": "custom" + } + ], + "time": "2024-07-11T09:07:56+00:00" + }, + { + "name": "symfony/clock", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/clock.git", + "reference": "97bebc53548684c17ed696bc8af016880f0f098d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/clock/zipball/97bebc53548684c17ed696bc8af016880f0f098d", + "reference": "97bebc53548684c17ed696bc8af016880f0f098d", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/clock": "^1.0", + "symfony/polyfill-php83": "^1.28" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/now.php" + ], + "psr-4": { + "Symfony\\Component\\Clock\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Decouples applications from the system clock", + "homepage": "https://symfony.com", + "keywords": [ + "clock", + "psr20", + "time" + ], + "support": { + "source": "https://github.com/symfony/clock/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "symfony/console", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "bb5192af6edc797cbab5c8e8ecfea2fe5f421e57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/bb5192af6edc797cbab5c8e8ecfea2fe5f421e57", + "reference": "bb5192af6edc797cbab5c8e8ecfea2fe5f421e57", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^6.4|^7.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-10-09T08:46:59+00:00" + }, + { + "name": "symfony/css-selector", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "4aa4f6b3d6749c14d3aa815eef8226632e7bbc66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/4aa4f6b3d6749c14d3aa815eef8226632e7bbc66", + "reference": "4aa4f6b3d6749c14d3aa815eef8226632e7bbc66", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Converts CSS selectors to XPath expressions", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/css-selector/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/error-handler", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/error-handler.git", + "reference": "d60117093c2a9fe667baa8fedf84e8a09b9c592f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/d60117093c2a9fe667baa8fedf84e8a09b9c592f", + "reference": "d60117093c2a9fe667baa8fedf84e8a09b9c592f", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/log": "^1|^2|^3", + "symfony/var-dumper": "^6.4|^7.0" + }, + "conflict": { + "symfony/deprecation-contracts": "<2.5", + "symfony/http-kernel": "<6.4" + }, + "require-dev": { + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/serializer": "^6.4|^7.0" + }, + "bin": [ + "Resources/bin/patch-type-declarations" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\ErrorHandler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to manage errors and ease debugging PHP code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/error-handler/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "87254c78dd50721cfd015b62277a8281c5589702" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/87254c78dd50721cfd015b62277a8281c5589702", + "reference": "87254c78dd50721cfd015b62277a8281c5589702", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/8f93aec25d41b72493c6ddff14e916177c9efc50", + "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/finder", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/2cb89664897be33f78c65d3d2845954c8d7a43b8", + "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "symfony/filesystem": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-10-01T08:31:23+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "3d7bbf071b25f802f7d55524d408bed414ea71e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3d7bbf071b25f802f7d55524d408bed414ea71e2", + "reference": "3d7bbf071b25f802f7d55524d408bed414ea71e2", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php83": "^1.27" + }, + "conflict": { + "doctrine/dbal": "<3.6", + "symfony/cache": "<6.4" + }, + "require-dev": { + "doctrine/dbal": "^3.6|^4", + "predis/predis": "^1.1|^2.0", + "symfony/cache": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/mime": "^6.4|^7.0", + "symfony/rate-limiter": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-10-11T19:23:14+00:00" + }, + { + "name": "symfony/http-kernel", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-kernel.git", + "reference": "5d8315899cd76b2e7e29179bf5fea103e41bdf03" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/5d8315899cd76b2e7e29179bf5fea103e41bdf03", + "reference": "5d8315899cd76b2e7e29179bf5fea103e41bdf03", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/log": "^1|^2|^3", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/error-handler": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/browser-kit": "<6.4", + "symfony/cache": "<6.4", + "symfony/config": "<6.4", + "symfony/console": "<6.4", + "symfony/dependency-injection": "<6.4", + "symfony/doctrine-bridge": "<6.4", + "symfony/form": "<6.4", + "symfony/http-client": "<6.4", + "symfony/http-client-contracts": "<2.5", + "symfony/mailer": "<6.4", + "symfony/messenger": "<6.4", + "symfony/translation": "<6.4", + "symfony/translation-contracts": "<2.5", + "symfony/twig-bridge": "<6.4", + "symfony/validator": "<6.4", + "symfony/var-dumper": "<6.4", + "twig/twig": "<3.0.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/cache": "^1.0|^2.0|^3.0", + "symfony/browser-kit": "^6.4|^7.0", + "symfony/clock": "^6.4|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/css-selector": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/dom-crawler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/http-client-contracts": "^2.5|^3", + "symfony/process": "^6.4|^7.0", + "symfony/property-access": "^7.1", + "symfony/routing": "^6.4|^7.0", + "symfony/serializer": "^7.1", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/translation": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3", + "symfony/uid": "^6.4|^7.0", + "symfony/validator": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0", + "symfony/var-exporter": "^6.4|^7.0", + "twig/twig": "^3.0.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a structured process for converting a Request into a Response", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-kernel/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-10-27T13:54:21+00:00" + }, + { + "name": "symfony/mailer", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/mailer.git", + "reference": "69c9948451fb3a6a4d47dc8261d1794734e76cdd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mailer/zipball/69c9948451fb3a6a4d47dc8261d1794734e76cdd", + "reference": "69c9948451fb3a6a4d47dc8261d1794734e76cdd", + "shasum": "" + }, + "require": { + "egulias/email-validator": "^2.1.10|^3|^4", + "php": ">=8.2", + "psr/event-dispatcher": "^1", + "psr/log": "^1|^2|^3", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/mime": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/http-client-contracts": "<2.5", + "symfony/http-kernel": "<6.4", + "symfony/messenger": "<6.4", + "symfony/mime": "<6.4", + "symfony/twig-bridge": "<6.4" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/twig-bridge": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mailer\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Helps sending emails", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/mailer/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "symfony/mime", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/mime.git", + "reference": "caa1e521edb2650b8470918dfe51708c237f0598" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mime/zipball/caa1e521edb2650b8470918dfe51708c237f0598", + "reference": "caa1e521edb2650b8470918dfe51708c237f0598", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-intl-idn": "^1.10", + "symfony/polyfill-mbstring": "^1.0" + }, + "conflict": { + "egulias/email-validator": "~3.0.0", + "phpdocumentor/reflection-docblock": "<3.2.2", + "phpdocumentor/type-resolver": "<1.4.0", + "symfony/mailer": "<6.4", + "symfony/serializer": "<6.4.3|>7.0,<7.0.3" + }, + "require-dev": { + "egulias/email-validator": "^2.1.10|^3.1|^4", + "league/html-to-markdown": "^5.0", + "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/property-access": "^6.4|^7.0", + "symfony/property-info": "^6.4|^7.0", + "symfony/serializer": "^6.4.3|^7.0.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mime\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows manipulating MIME messages", + "homepage": "https://symfony.com", + "keywords": [ + "mime", + "mime-type" + ], + "support": { + "source": "https://github.com/symfony/mime/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-10-25T15:11:02+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773", + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-php83", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php83.git", + "reference": "2fb86d65e2d424369ad2905e83b236a8805ba491" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/2fb86d65e2d424369ad2905e83b236a8805ba491", + "reference": "2fb86d65e2d424369ad2905e83b236a8805ba491", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php83\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php83/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-uuid", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-uuid.git", + "reference": "21533be36c24be3f4b1669c4725c7d1d2bab4ae2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/21533be36c24be3f4b1669c4725c7d1d2bab4ae2", + "reference": "21533be36c24be3f4b1669c4725c7d1d2bab4ae2", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-uuid": "*" + }, + "suggest": { + "ext-uuid": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Uuid\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for uuid functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/process", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "6aaa189ddb4ff6b5de8fa3210f2fb42c87b4d12e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/6aaa189ddb4ff6b5de8fa3210f2fb42c87b4d12e", + "reference": "6aaa189ddb4ff6b5de8fa3210f2fb42c87b4d12e", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "symfony/routing", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/routing.git", + "reference": "66a2c469f6c22d08603235c46a20007c0701ea0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/routing/zipball/66a2c469f6c22d08603235c46a20007c0701ea0a", + "reference": "66a2c469f6c22d08603235c46a20007c0701ea0a", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/config": "<6.4", + "symfony/dependency-injection": "<6.4", + "symfony/yaml": "<6.4" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/yaml": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Routing\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Maps an HTTP request to a set of configuration variables", + "homepage": "https://symfony.com", + "keywords": [ + "router", + "routing", + "uri", + "url" + ], + "support": { + "source": "https://github.com/symfony/routing/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-10-01T08:31:23+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/string", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/61b72d66bf96c360a727ae6232df5ac83c71f626", + "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/emoji": "^7.1", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "symfony/translation", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "b9f72ab14efdb6b772f85041fa12f820dee8d55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/b9f72ab14efdb6b772f85041fa12f820dee8d55f", + "reference": "b9f72ab14efdb6b772f85041fa12f820dee8d55f", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation-contracts": "^2.5|^3.0" + }, + "conflict": { + "symfony/config": "<6.4", + "symfony/console": "<6.4", + "symfony/dependency-injection": "<6.4", + "symfony/http-client-contracts": "<2.5", + "symfony/http-kernel": "<6.4", + "symfony/service-contracts": "<2.5", + "symfony/twig-bundle": "<6.4", + "symfony/yaml": "<6.4" + }, + "provide": { + "symfony/translation-implementation": "2.3|3.0" + }, + "require-dev": { + "nikic/php-parser": "^4.18|^5.0", + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/http-client-contracts": "^2.5|^3.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/polyfill-intl-icu": "^1.21", + "symfony/routing": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-28T12:35:13+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "b9d2189887bb6b2e0367a9fc7136c5239ab9b05a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/b9d2189887bb6b2e0367a9fc7136c5239ab9b05a", + "reference": "b9d2189887bb6b2e0367a9fc7136c5239ab9b05a", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/uid", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/uid.git", + "reference": "65befb3bb2d503bbffbd08c815aa38b472999917" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/uid/zipball/65befb3bb2d503bbffbd08c815aa38b472999917", + "reference": "65befb3bb2d503bbffbd08c815aa38b472999917", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-uuid": "^1.15" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Uid\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to generate and represent UIDs", + "homepage": "https://symfony.com", + "keywords": [ + "UID", + "ulid", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/uid/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "cb5bd55a6b8c2c1c7fb68b0aeae0e257948a720c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/cb5bd55a6b8c2c1c7fb68b0aeae0e257948a720c", + "reference": "cb5bd55a6b8c2c1c7fb68b0aeae0e257948a720c", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/console": "<6.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/console": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/uid": "^6.4|^7.0", + "twig/twig": "^3.0.4" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides mechanisms for walking through any arbitrary PHP variable", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "tijsverkoyen/css-to-inline-styles", + "version": "v2.2.7", + "source": { + "type": "git", + "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", + "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/83ee6f38df0a63106a9e4536e3060458b74ccedb", + "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "php": "^5.5 || ^7.0 || ^8.0", + "symfony/css-selector": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^7.5 || ^8.5.21 || ^9.5.10" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "TijsVerkoyen\\CssToInlineStyles\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Tijs Verkoyen", + "email": "css_to_inline_styles@verkoyen.eu", + "role": "Developer" + } + ], + "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", + "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", + "support": { + "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", + "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/v2.2.7" + }, + "time": "2023-12-08T13:03:43+00:00" + }, + { + "name": "vlucas/phpdotenv", + "version": "v5.6.1", + "source": { + "type": "git", + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/a59a13791077fe3d44f90e7133eb68e7d22eaff2", + "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "graham-campbell/result-type": "^1.1.3", + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.3", + "symfony/polyfill-ctype": "^1.24", + "symfony/polyfill-mbstring": "^1.24", + "symfony/polyfill-php80": "^1.24" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-filter": "*", + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" + }, + "suggest": { + "ext-filter": "Required to use the boolean validator." + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, + "branch-alias": { + "dev-master": "5.6-dev" + } + }, + "autoload": { + "psr-4": { + "Dotenv\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Vance Lucas", + "email": "vance@vancelucas.com", + "homepage": "https://github.com/vlucas" + } + ], + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "support": { + "issues": "https://github.com/vlucas/phpdotenv/issues", + "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", + "type": "tidelift" + } + ], + "time": "2024-07-20T21:52:34+00:00" + }, + { + "name": "voku/portable-ascii", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/voku/portable-ascii.git", + "reference": "b56450eed252f6801410d810c8e1727224ae0743" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b56450eed252f6801410d810c8e1727224ae0743", + "reference": "b56450eed252f6801410d810c8e1727224ae0743", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" + }, + "suggest": { + "ext-intl": "Use Intl for transliterator_transliterate() support" + }, + "type": "library", + "autoload": { + "psr-4": { + "voku\\": "src/voku/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lars Moelleken", + "homepage": "http://www.moelleken.org/" + } + ], + "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", + "homepage": "https://github.com/voku/portable-ascii", + "keywords": [ + "ascii", + "clean", + "php" + ], + "support": { + "issues": "https://github.com/voku/portable-ascii/issues", + "source": "https://github.com/voku/portable-ascii/tree/2.0.1" + }, + "funding": [ + { + "url": "https://www.paypal.me/moelleken", + "type": "custom" + }, + { + "url": "https://github.com/voku", + "type": "github" + }, + { + "url": "https://opencollective.com/portable-ascii", + "type": "open_collective" + }, + { + "url": "https://www.patreon.com/voku", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", + "type": "tidelift" + } + ], + "time": "2022-03-08T17:03:00+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.11.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "php": "^7.2 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.11.0" + }, + "time": "2022-06-03T18:03:27+00:00" + } + ], + "packages-dev": [ + { + "name": "fakerphp/faker", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/FakerPHP/Faker.git", + "reference": "bfb4fe148adbf78eff521199619b93a52ae3554b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/bfb4fe148adbf78eff521199619b93a52ae3554b", + "reference": "bfb4fe148adbf78eff521199619b93a52ae3554b", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "psr/container": "^1.0 || ^2.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "conflict": { + "fzaninotto/faker": "*" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "doctrine/persistence": "^1.3 || ^2.0", + "ext-intl": "*", + "phpunit/phpunit": "^9.5.26", + "symfony/phpunit-bridge": "^5.4.16" + }, + "suggest": { + "doctrine/orm": "Required to use Faker\\ORM\\Doctrine", + "ext-curl": "Required by Faker\\Provider\\Image to download images.", + "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", + "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", + "ext-mbstring": "Required for multibyte Unicode string functionality." + }, + "type": "library", + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "support": { + "issues": "https://github.com/FakerPHP/Faker/issues", + "source": "https://github.com/FakerPHP/Faker/tree/v1.23.1" + }, + "time": "2024-01-02T13:46:09+00:00" + }, + { + "name": "filp/whoops", + "version": "2.16.0", + "source": { + "type": "git", + "url": "https://github.com/filp/whoops.git", + "reference": "befcdc0e5dce67252aa6322d82424be928214fa2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/filp/whoops/zipball/befcdc0e5dce67252aa6322d82424be928214fa2", + "reference": "befcdc0e5dce67252aa6322d82424be928214fa2", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^4.0 || ^5.0" + }, + "suggest": { + "symfony/var-dumper": "Pretty print complex values better with var-dumper available", + "whoops/soap": "Formats errors as SOAP responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Whoops\\": "src/Whoops/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Filipe Dobreira", + "homepage": "https://github.com/filp", + "role": "Developer" + } + ], + "description": "php error handling for cool kids", + "homepage": "https://filp.github.io/whoops/", + "keywords": [ + "error", + "exception", + "handling", + "library", + "throwable", + "whoops" + ], + "support": { + "issues": "https://github.com/filp/whoops/issues", + "source": "https://github.com/filp/whoops/tree/2.16.0" + }, + "funding": [ + { + "url": "https://github.com/denis-sokolov", + "type": "github" + } + ], + "time": "2024-09-25T12:00:00+00:00" + }, + { + "name": "hamcrest/hamcrest-php", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0|^8.0" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "^1.4 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "hamcrest" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "support": { + "issues": "https://github.com/hamcrest/hamcrest-php/issues", + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" + }, + "time": "2020-07-09T08:09:16+00:00" + }, + { + "name": "laravel/pail", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/pail.git", + "reference": "085a2306b520c3896afa361c25704e5fa3c27bf0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pail/zipball/085a2306b520c3896afa361c25704e5fa3c27bf0", + "reference": "085a2306b520c3896afa361c25704e5fa3c27bf0", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "illuminate/console": "^10.24|^11.0", + "illuminate/contracts": "^10.24|^11.0", + "illuminate/log": "^10.24|^11.0", + "illuminate/process": "^10.24|^11.0", + "illuminate/support": "^10.24|^11.0", + "nunomaduro/termwind": "^1.15|^2.0", + "php": "^8.2", + "symfony/console": "^6.0|^7.0" + }, + "require-dev": { + "laravel/pint": "^1.13", + "orchestra/testbench": "^8.12|^9.0", + "pestphp/pest": "^2.20", + "pestphp/pest-plugin-type-coverage": "^2.3", + "phpstan/phpstan": "^1.10", + "symfony/var-dumper": "^6.3|^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Pail\\PailServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Pail\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Easily delve into your Laravel application's log files directly from the command line.", + "homepage": "https://github.com/laravel/pail", + "keywords": [ + "laravel", + "logs", + "php", + "tail" + ], + "support": { + "issues": "https://github.com/laravel/pail/issues", + "source": "https://github.com/laravel/pail" + }, + "time": "2024-10-21T13:59:30+00:00" + }, + { + "name": "laravel/pint", + "version": "v1.18.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/35c00c05ec43e6b46d295efc0f4386ceb30d50d9", + "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "php": "^8.1.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.64.0", + "illuminate/view": "^10.48.20", + "larastan/larastan": "^2.9.8", + "laravel-zero/framework": "^10.4.0", + "mockery/mockery": "^1.6.12", + "nunomaduro/termwind": "^1.15.1", + "pestphp/pest": "^2.35.1" + }, + "bin": [ + "builds/pint" + ], + "type": "project", + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/", + "Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An opinionated code formatter for PHP.", + "homepage": "https://laravel.com", + "keywords": [ + "format", + "formatter", + "lint", + "linter", + "php" + ], + "support": { + "issues": "https://github.com/laravel/pint/issues", + "source": "https://github.com/laravel/pint" + }, + "time": "2024-09-24T17:22:50+00:00" + }, + { + "name": "laravel/sail", + "version": "v1.37.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/sail.git", + "reference": "7efa151ea0d16f48233d6a6cd69f81270acc6e93" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/sail/zipball/7efa151ea0d16f48233d6a6cd69f81270acc6e93", + "reference": "7efa151ea0d16f48233d6a6cd69f81270acc6e93", + "shasum": "" + }, + "require": { + "illuminate/console": "^9.52.16|^10.0|^11.0", + "illuminate/contracts": "^9.52.16|^10.0|^11.0", + "illuminate/support": "^9.52.16|^10.0|^11.0", + "php": "^8.0", + "symfony/console": "^6.0|^7.0", + "symfony/yaml": "^6.0|^7.0" + }, + "require-dev": { + "orchestra/testbench": "^7.0|^8.0|^9.0", + "phpstan/phpstan": "^1.10" + }, + "bin": [ + "bin/sail" + ], + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Sail\\SailServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Sail\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Docker files for running a basic Laravel application.", + "keywords": [ + "docker", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/sail/issues", + "source": "https://github.com/laravel/sail" + }, + "time": "2024-10-29T20:18:14+00:00" + }, + { + "name": "mockery/mockery", + "version": "1.6.12", + "source": { + "type": "git", + "url": "https://github.com/mockery/mockery.git", + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699", + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "^2.0.1", + "lib-pcre": ">=7.0", + "php": ">=7.3" + }, + "conflict": { + "phpunit/phpunit": "<8.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5 || ^9.6.17", + "symplify/easy-coding-standard": "^12.1.14" + }, + "type": "library", + "autoload": { + "files": [ + "library/helpers.php", + "library/Mockery.php" + ], + "psr-4": { + "Mockery\\": "library/Mockery" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "https://github.com/padraic", + "role": "Author" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" + }, + { + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" + } + ], + "description": "Mockery is a simple yet flexible PHP mock object framework", + "homepage": "https://github.com/mockery/mockery", + "keywords": [ + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" + ], + "support": { + "docs": "https://docs.mockery.io/", + "issues": "https://github.com/mockery/mockery/issues", + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories", + "source": "https://github.com/mockery/mockery" + }, + "time": "2024-05-16T03:13:13+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.12.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2024-06-12T14:39:25+00:00" + }, + { + "name": "nunomaduro/collision", + "version": "v8.5.0", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/collision.git", + "reference": "f5c101b929c958e849a633283adff296ed5f38f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/f5c101b929c958e849a633283adff296ed5f38f5", + "reference": "f5c101b929c958e849a633283adff296ed5f38f5", + "shasum": "" + }, + "require": { + "filp/whoops": "^2.16.0", + "nunomaduro/termwind": "^2.1.0", + "php": "^8.2.0", + "symfony/console": "^7.1.5" + }, + "conflict": { + "laravel/framework": "<11.0.0 || >=12.0.0", + "phpunit/phpunit": "<10.5.1 || >=12.0.0" + }, + "require-dev": { + "larastan/larastan": "^2.9.8", + "laravel/framework": "^11.28.0", + "laravel/pint": "^1.18.1", + "laravel/sail": "^1.36.0", + "laravel/sanctum": "^4.0.3", + "laravel/tinker": "^2.10.0", + "orchestra/testbench-core": "^9.5.3", + "pestphp/pest": "^2.36.0 || ^3.4.0", + "sebastian/environment": "^6.1.0 || ^7.2.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" + ] + }, + "branch-alias": { + "dev-8.x": "8.x-dev" + } + }, + "autoload": { + "files": [ + "./src/Adapters/Phpunit/Autoload.php" + ], + "psr-4": { + "NunoMaduro\\Collision\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Cli error handling for console/command-line PHP applications.", + "keywords": [ + "artisan", + "cli", + "command-line", + "console", + "error", + "handling", + "laravel", + "laravel-zero", + "php", + "symfony" + ], + "support": { + "issues": "https://github.com/nunomaduro/collision/issues", + "source": "https://github.com/nunomaduro/collision" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2024-10-15T16:06:32+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "11.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "f7f08030e8811582cc459871d28d6f5a1a4d35ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f7f08030e8811582cc459871d28d6f5a1a4d35ca", + "reference": "f7f08030e8811582cc459871d28d6f5a1a4d35ca", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^5.3.1", + "php": ">=8.2", + "phpunit/php-file-iterator": "^5.1.0", + "phpunit/php-text-template": "^4.0.1", + "sebastian/code-unit-reverse-lookup": "^4.0.1", + "sebastian/complexity": "^4.0.1", + "sebastian/environment": "^7.2.0", + "sebastian/lines-of-code": "^3.0.1", + "sebastian/version": "^5.0.2", + "theseer/tokenizer": "^1.2.3" + }, + "require-dev": { + "phpunit/phpunit": "^11.4.1" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "11.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.7" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-10-09T06:21:38+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "5.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/118cfaaa8bc5aef3287bf315b6060b1174754af6", + "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-08-27T05:02:59+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "5.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/c1ca3814734c07492b3d4c5f794f4b0995333da2", + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^11.0" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/5.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:07:44+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/3e0404dc6b300e6bf56415467ebcb3fe4f33e964", + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:08:43+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "7.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/7.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:09:35+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "11.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "e8e8ed1854de5d36c088ec1833beae40d2dedd76" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e8e8ed1854de5d36c088ec1833beae40d2dedd76", + "reference": "e8e8ed1854de5d36c088ec1833beae40d2dedd76", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.12.0", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=8.2", + "phpunit/php-code-coverage": "^11.0.7", + "phpunit/php-file-iterator": "^5.1.0", + "phpunit/php-invoker": "^5.0.1", + "phpunit/php-text-template": "^4.0.1", + "phpunit/php-timer": "^7.0.1", + "sebastian/cli-parser": "^3.0.2", + "sebastian/code-unit": "^3.0.1", + "sebastian/comparator": "^6.1.1", + "sebastian/diff": "^6.0.2", + "sebastian/environment": "^7.2.0", + "sebastian/exporter": "^6.1.3", + "sebastian/global-state": "^7.0.2", + "sebastian/object-enumerator": "^6.0.1", + "sebastian/type": "^5.1.0", + "sebastian/version": "^5.0.2" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "11.4-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.4.3" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2024-10-28T13:07:50+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:41:36+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "6bb7d09d6623567178cf54126afa9c2310114268" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/6bb7d09d6623567178cf54126afa9c2310114268", + "reference": "6bb7d09d6623567178cf54126afa9c2310114268", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "security": "https://github.com/sebastianbergmann/code-unit/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:44:28+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/183a9b2632194febd219bb9246eee421dad8d45e", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:45:54+00:00" + }, + { + "name": "sebastian/comparator", + "version": "6.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "43d129d6a0f81c78bee378b46688293eb7ea3739" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/43d129d6a0f81c78bee378b46688293eb7ea3739", + "reference": "43d129d6a0f81c78bee378b46688293eb7ea3739", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/diff": "^6.0", + "sebastian/exporter": "^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/6.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-10-31T05:30:08+00:00" + }, + { + "name": "sebastian/complexity", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ee41d384ab1906c68852636b6de493846e13e5a0", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.0", + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:49:50+00:00" + }, + { + "name": "sebastian/diff", + "version": "6.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:53:05+00:00" + }, + { + "name": "sebastian/environment", + "version": "7.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5", + "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "https://github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/7.2.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:54:44+00:00" + }, + { + "name": "sebastian/exporter", + "version": "6.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e", + "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/recursion-context": "^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/6.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:56:19+00:00" + }, + { + "name": "sebastian/global-state", + "version": "7.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:57:36+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.0", + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:58:38+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aa", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:00:13+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:01:32+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "6.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "694d156164372abbd149a4b85ccda2e4670c0e16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/694d156164372abbd149a4b85ccda2e4670c0e16", + "reference": "694d156164372abbd149a4b85ccda2e4670c0e16", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:10:34+00:00" + }, + { + "name": "sebastian/type", + "version": "5.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/461b9c5da241511a2a0e8f240814fb23ce5c0aac", + "reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/5.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-09-17T13:12:04+00:00" + }, + { + "name": "sebastian/version", + "version": "5.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c687e3387b99f5b03b6caa64c74b63e2936ff874", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/5.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-10-09T05:16:32+00:00" + }, + { + "name": "symfony/yaml", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "3ced3f29e4f0d6bce2170ff26719f1fe9aacc671" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/3ced3f29e4f0d6bce2170ff26719f1fe9aacc671", + "reference": "3ced3f29e4f0d6bce2170ff26719f1fe9aacc671", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/console": "<6.4" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0" + }, + "bin": [ + "Resources/bin/yaml-lint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Loads and dumps YAML files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:36:25+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "radical/lucent-presets": 20 + }, + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": "^8.2" + }, + "platform-dev": [], + "plugin-api-version": "2.3.0" +} diff --git a/config/app.php b/config/app.php new file mode 100755 index 0000000..f467267 --- /dev/null +++ b/config/app.php @@ -0,0 +1,126 @@ + env('APP_NAME', 'Laravel'), + + /* + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services the application utilizes. Set this in your ".env" file. + | + */ + + 'env' => env('APP_ENV', 'production'), + + /* + |-------------------------------------------------------------------------- + | Application Debug Mode + |-------------------------------------------------------------------------- + | + | When your application is in debug mode, detailed error messages with + | stack traces will be shown on every error that occurs within your + | application. If disabled, a simple generic error page is shown. + | + */ + + 'debug' => (bool) env('APP_DEBUG', false), + + /* + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | the application so that it's available within Artisan commands. + | + */ + + 'url' => env('APP_URL', 'http://localhost'), + + /* + |-------------------------------------------------------------------------- + | Application Timezone + |-------------------------------------------------------------------------- + | + | Here you may specify the default timezone for your application, which + | will be used by the PHP date and date-time functions. The timezone + | is set to "UTC" by default as it is suitable for most use cases. + | + */ + + 'timezone' => env('APP_TIMEZONE', 'UTC'), + + /* + |-------------------------------------------------------------------------- + | Application Locale Configuration + |-------------------------------------------------------------------------- + | + | The application locale determines the default locale that will be used + | by Laravel's translation / localization methods. This option can be + | set to any locale for which you plan to have translation strings. + | + */ + + 'locale' => env('APP_LOCALE', 'en'), + + 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'), + + 'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'), + + /* + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is utilized by Laravel's encryption services and should be set + | to a random, 32 character string to ensure that all encrypted values + | are secure. You should do this prior to deploying the application. + | + */ + + 'cipher' => 'AES-256-CBC', + + 'key' => env('APP_KEY'), + + 'previous_keys' => [ + ...array_filter( + explode(',', env('APP_PREVIOUS_KEYS', '')) + ), + ], + + /* + |-------------------------------------------------------------------------- + | Maintenance Mode Driver + |-------------------------------------------------------------------------- + | + | These configuration options determine the driver used to determine and + | manage Laravel's "maintenance mode" status. The "cache" driver will + | allow maintenance mode to be controlled across multiple machines. + | + | Supported drivers: "file", "cache" + | + */ + + 'maintenance' => [ + 'driver' => env('APP_MAINTENANCE_DRIVER', 'file'), + 'store' => env('APP_MAINTENANCE_STORE', 'database'), + ], + +]; diff --git a/config/auth.php b/config/auth.php new file mode 100755 index 0000000..0ba5d5d --- /dev/null +++ b/config/auth.php @@ -0,0 +1,115 @@ + [ + 'guard' => env('AUTH_GUARD', 'web'), + 'passwords' => env('AUTH_PASSWORD_BROKER', 'users'), + ], + + /* + |-------------------------------------------------------------------------- + | Authentication Guards + |-------------------------------------------------------------------------- + | + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | which utilizes session storage plus the Eloquent user provider. + | + | All authentication guards have a user provider, which defines how the + | users are actually retrieved out of your database or other storage + | system used by the application. Typically, Eloquent is utilized. + | + | Supported: "session" + | + */ + + 'guards' => [ + 'web' => [ + 'driver' => 'session', + 'provider' => 'users', + ], + ], + + /* + |-------------------------------------------------------------------------- + | User Providers + |-------------------------------------------------------------------------- + | + | All authentication guards have a user provider, which defines how the + | users are actually retrieved out of your database or other storage + | system used by the application. Typically, Eloquent is utilized. + | + | If you have multiple user tables or models you may configure multiple + | providers to represent the model / table. These providers may then + | be assigned to any extra authentication guards you have defined. + | + | Supported: "database", "eloquent" + | + */ + + 'providers' => [ + 'users' => [ + 'driver' => 'eloquent', + 'model' => env('AUTH_MODEL', App\Models\User::class), + ], + + // 'users' => [ + // 'driver' => 'database', + // 'table' => 'users', + // ], + ], + + /* + |-------------------------------------------------------------------------- + | Resetting Passwords + |-------------------------------------------------------------------------- + | + | These configuration options specify the behavior of Laravel's password + | reset functionality, including the table utilized for token storage + | and the user provider that is invoked to actually retrieve users. + | + | The expiry time is the number of minutes that each reset token will be + | considered valid. This security feature keeps tokens short-lived so + | they have less time to be guessed. You may change this as needed. + | + | The throttle setting is the number of seconds a user must wait before + | generating more password reset tokens. This prevents the user from + | quickly generating a very large amount of password reset tokens. + | + */ + + 'passwords' => [ + 'users' => [ + 'provider' => 'users', + 'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'), + 'expire' => 60, + 'throttle' => 60, + ], + ], + + /* + |-------------------------------------------------------------------------- + | Password Confirmation Timeout + |-------------------------------------------------------------------------- + | + | Here you may define the amount of seconds before a password confirmation + | window expires and users are asked to re-enter their password via the + | confirmation screen. By default, the timeout lasts for three hours. + | + */ + + 'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800), + +]; diff --git a/config/cache.php b/config/cache.php new file mode 100755 index 0000000..925f7d2 --- /dev/null +++ b/config/cache.php @@ -0,0 +1,108 @@ + env('CACHE_STORE', 'database'), + + /* + |-------------------------------------------------------------------------- + | Cache Stores + |-------------------------------------------------------------------------- + | + | Here you may define all of the cache "stores" for your application as + | well as their drivers. You may even define multiple stores for the + | same cache driver to group types of items stored in your caches. + | + | Supported drivers: "array", "database", "file", "memcached", + | "redis", "dynamodb", "octane", "null" + | + */ + + 'stores' => [ + + 'array' => [ + 'driver' => 'array', + 'serialize' => false, + ], + + 'database' => [ + 'driver' => 'database', + 'connection' => env('DB_CACHE_CONNECTION'), + 'table' => env('DB_CACHE_TABLE', 'cache'), + 'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'), + 'lock_table' => env('DB_CACHE_LOCK_TABLE'), + ], + + 'file' => [ + 'driver' => 'file', + 'path' => storage_path('framework/cache/data'), + 'lock_path' => storage_path('framework/cache/data'), + ], + + 'memcached' => [ + 'driver' => 'memcached', + 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), + 'sasl' => [ + env('MEMCACHED_USERNAME'), + env('MEMCACHED_PASSWORD'), + ], + 'options' => [ + // Memcached::OPT_CONNECT_TIMEOUT => 2000, + ], + 'servers' => [ + [ + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), + 'weight' => 100, + ], + ], + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'), + 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'), + ], + + 'dynamodb' => [ + 'driver' => 'dynamodb', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'endpoint' => env('DYNAMODB_ENDPOINT'), + ], + + 'octane' => [ + 'driver' => 'octane', + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Cache Key Prefix + |-------------------------------------------------------------------------- + | + | When utilizing the APC, database, memcached, Redis, and DynamoDB cache + | stores, there might be other applications using the same cache. For + | that reason, you may prefix every cache key to avoid collisions. + | + */ + + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), + +]; diff --git a/config/database.php b/config/database.php new file mode 100755 index 0000000..6edc164 --- /dev/null +++ b/config/database.php @@ -0,0 +1,179 @@ + env('DB_CONNECTION', 'sqlite'), + + /* + |-------------------------------------------------------------------------- + | Database Connections + |-------------------------------------------------------------------------- + | + | Below are all of the database connections defined for your application. + | An example configuration is provided for each database system which + | is supported by Laravel. You're free to add / remove connections. + | + */ + + 'connections' => [ + 'lucentdb' => [ + 'driver' => 'sqlite', + 'url' => env('DATABASE_URL'), + 'database' => env('DB_DATABASE', database_path('database.sqlite')), + 'prefix' => '', + 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), + ], + 'sqlite' => [ + 'driver' => 'sqlite', + 'url' => env('DB_URL'), + 'database' => env('DB_DATABASE', database_path('database.sqlite')), + 'prefix' => '', + 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), + 'busy_timeout' => null, + 'journal_mode' => null, + 'synchronous' => null, + ], + + 'mysql' => [ + 'driver' => 'mysql', + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => env('DB_CHARSET', 'utf8mb4'), + 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), + 'prefix' => '', + 'prefix_indexes' => true, + 'strict' => true, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ + PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + ]) : [], + ], + + 'mariadb' => [ + 'driver' => 'mariadb', + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => env('DB_CHARSET', 'utf8mb4'), + 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), + 'prefix' => '', + 'prefix_indexes' => true, + 'strict' => true, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ + PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + ]) : [], + ], + + 'pgsql' => [ + 'driver' => 'pgsql', + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => env('DB_CHARSET', 'utf8'), + 'prefix' => '', + 'prefix_indexes' => true, + 'search_path' => 'public', + 'sslmode' => 'prefer', + ], + + 'sqlsrv' => [ + 'driver' => 'sqlsrv', + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1433'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => env('DB_CHARSET', 'utf8'), + 'prefix' => '', + 'prefix_indexes' => true, + // 'encrypt' => env('DB_ENCRYPT', 'yes'), + // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Migration Repository Table + |-------------------------------------------------------------------------- + | + | This table keeps track of all the migrations that have already run for + | your application. Using this information, we can determine which of + | the migrations on disk haven't actually been run on the database. + | + */ + + 'migrations' => [ + 'table' => 'migrations', + 'update_date_on_publish' => true, + ], + + /* + |-------------------------------------------------------------------------- + | Redis Databases + |-------------------------------------------------------------------------- + | + | Redis is an open source, fast, and advanced key-value store that also + | provides a richer body of commands than a typical key-value system + | such as Memcached. You may define your connection settings here. + | + */ + + 'redis' => [ + + 'client' => env('REDIS_CLIENT', 'phpredis'), + + 'options' => [ + 'cluster' => env('REDIS_CLUSTER', 'redis'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), + ], + + 'default' => [ + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'username' => env('REDIS_USERNAME'), + 'password' => env('REDIS_PASSWORD'), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_DB', '0'), + ], + + 'cache' => [ + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'username' => env('REDIS_USERNAME'), + 'password' => env('REDIS_PASSWORD'), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_CACHE_DB', '1'), + ], + + ], + +]; diff --git a/config/filesystems.php b/config/filesystems.php new file mode 100755 index 0000000..2c5c78f --- /dev/null +++ b/config/filesystems.php @@ -0,0 +1,86 @@ + env('FILESYSTEM_DISK', 'local'), + + /* + |-------------------------------------------------------------------------- + | Filesystem Disks + |-------------------------------------------------------------------------- + | + | Below you may configure as many filesystem disks as necessary, and you + | may even configure multiple disks for the same driver. Examples for + | most supported storage drivers are configured here for reference. + | + | Supported drivers: "local", "ftp", "sftp", "s3" + | + */ + + 'disks' => [ + + 'local' => [ + 'driver' => 'local', + 'root' => storage_path('app/private'), + 'serve' => true, + 'throw' => false, + ], + + 'lucent' => [ + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => env('APP_URL').'/storage', + 'visibility' => 'public', + 'serve' => true, + 'throw' => false + ], + + 'public' => [ + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => env('APP_URL').'/storage', + 'visibility' => 'public', + 'throw' => false, + ], + + 's3' => [ + 'driver' => 's3', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), + 'url' => env('AWS_URL'), + 'endpoint' => env('AWS_ENDPOINT'), + 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), + 'throw' => false, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Symbolic Links + |-------------------------------------------------------------------------- + | + | Here you may configure the symbolic links that will be created when the + | `storage:link` Artisan command is executed. The array keys should be + | the locations of the links and the values should be their targets. + | + */ + + 'links' => [ + public_path('storage') => storage_path('app/public'), + ], + +]; diff --git a/config/logging.php b/config/logging.php new file mode 100755 index 0000000..8d94292 --- /dev/null +++ b/config/logging.php @@ -0,0 +1,132 @@ + env('LOG_CHANNEL', 'stack'), + + /* + |-------------------------------------------------------------------------- + | Deprecations Log Channel + |-------------------------------------------------------------------------- + | + | This option controls the log channel that should be used to log warnings + | regarding deprecated PHP and library features. This allows you to get + | your application ready for upcoming major versions of dependencies. + | + */ + + 'deprecations' => [ + 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), + 'trace' => env('LOG_DEPRECATIONS_TRACE', false), + ], + + /* + |-------------------------------------------------------------------------- + | Log Channels + |-------------------------------------------------------------------------- + | + | Here you may configure the log channels for your application. Laravel + | utilizes the Monolog PHP logging library, which includes a variety + | of powerful log handlers and formatters that you're free to use. + | + | Available drivers: "single", "daily", "slack", "syslog", + | "errorlog", "monolog", "custom", "stack" + | + */ + + 'channels' => [ + + 'stack' => [ + 'driver' => 'stack', + 'channels' => explode(',', env('LOG_STACK', 'single')), + 'ignore_exceptions' => false, + ], + + 'single' => [ + 'driver' => 'single', + 'path' => storage_path('logs/laravel.log'), + 'level' => env('LOG_LEVEL', 'debug'), + 'replace_placeholders' => true, + ], + + 'daily' => [ + 'driver' => 'daily', + 'path' => storage_path('logs/laravel.log'), + 'level' => env('LOG_LEVEL', 'debug'), + 'days' => env('LOG_DAILY_DAYS', 14), + 'replace_placeholders' => true, + ], + + 'slack' => [ + 'driver' => 'slack', + 'url' => env('LOG_SLACK_WEBHOOK_URL'), + 'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'), + 'emoji' => env('LOG_SLACK_EMOJI', ':boom:'), + 'level' => env('LOG_LEVEL', 'critical'), + 'replace_placeholders' => true, + ], + + 'papertrail' => [ + 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), + 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), + 'handler_with' => [ + 'host' => env('PAPERTRAIL_URL'), + 'port' => env('PAPERTRAIL_PORT'), + 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), + ], + 'processors' => [PsrLogMessageProcessor::class], + ], + + 'stderr' => [ + 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), + 'handler' => StreamHandler::class, + 'formatter' => env('LOG_STDERR_FORMATTER'), + 'with' => [ + 'stream' => 'php://stderr', + ], + 'processors' => [PsrLogMessageProcessor::class], + ], + + 'syslog' => [ + 'driver' => 'syslog', + 'level' => env('LOG_LEVEL', 'debug'), + 'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER), + 'replace_placeholders' => true, + ], + + 'errorlog' => [ + 'driver' => 'errorlog', + 'level' => env('LOG_LEVEL', 'debug'), + 'replace_placeholders' => true, + ], + + 'null' => [ + 'driver' => 'monolog', + 'handler' => NullHandler::class, + ], + + 'emergency' => [ + 'path' => storage_path('logs/laravel.log'), + ], + + ], + +]; diff --git a/config/lucent.php b/config/lucent.php new file mode 100755 index 0000000..b813eee --- /dev/null +++ b/config/lucent.php @@ -0,0 +1,17 @@ + env("LUCENT_ENV", "production"), + "schemas_path" => env("LUCENT_SCHEMAS_PATH", "src/Lucent"), + "database" => env('LUCENT_DB_CONNECTION', env('DB_CONNECTION', "sqlite")), + "name" => env("LUCENT_NAME", "Lucent"), + "url" => env("LUCENT_URL", env('APP_URL')), + "previewTarget" => env("LUCENT_PREVIEW_TARGET", "previewTarget"), + "commands" => [ + "generate:static" => "Build Website", + ], + "imageFilters" => [], + "canInvite" => ["admin"], + "canBuild" => ["admin"], + "systemUserId" => "", +]; diff --git a/config/lucentMapper.php b/config/lucentMapper.php new file mode 100755 index 0000000..f70fba8 --- /dev/null +++ b/config/lucentMapper.php @@ -0,0 +1,18 @@ + [ + 'class' => Honeycomb::class, + 'childrenDepth' => 3, + 'casts' => [ + 'userIds' => 'userId', + 'assignTo' => 'userId' + ] + ], + 'userIds' => [ + 'class' => User::class + ] +]; diff --git a/config/mail.php b/config/mail.php new file mode 100755 index 0000000..df13d3d --- /dev/null +++ b/config/mail.php @@ -0,0 +1,116 @@ + env('MAIL_MAILER', 'log'), + + /* + |-------------------------------------------------------------------------- + | Mailer Configurations + |-------------------------------------------------------------------------- + | + | Here you may configure all of the mailers used by your application plus + | their respective settings. Several examples have been configured for + | you and you are free to add your own as your application requires. + | + | Laravel supports a variety of mail "transport" drivers that can be used + | when delivering an email. You may specify which one you're using for + | your mailers below. You may also add additional mailers if needed. + | + | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2", + | "postmark", "resend", "log", "array", + | "failover", "roundrobin" + | + */ + + 'mailers' => [ + + 'smtp' => [ + 'transport' => 'smtp', + 'url' => env('MAIL_URL'), + 'host' => env('MAIL_HOST', '127.0.0.1'), + 'port' => env('MAIL_PORT', 2525), + 'encryption' => env('MAIL_ENCRYPTION', 'tls'), + 'username' => env('MAIL_USERNAME'), + 'password' => env('MAIL_PASSWORD'), + 'timeout' => null, + 'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)), + ], + + 'ses' => [ + 'transport' => 'ses', + ], + + 'postmark' => [ + 'transport' => 'postmark', + // 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'), + // 'client' => [ + // 'timeout' => 5, + // ], + ], + + 'resend' => [ + 'transport' => 'resend', + ], + + 'sendmail' => [ + 'transport' => 'sendmail', + 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), + ], + + 'log' => [ + 'transport' => 'log', + 'channel' => env('MAIL_LOG_CHANNEL'), + ], + + 'array' => [ + 'transport' => 'array', + ], + + 'failover' => [ + 'transport' => 'failover', + 'mailers' => [ + 'smtp', + 'log', + ], + ], + + 'roundrobin' => [ + 'transport' => 'roundrobin', + 'mailers' => [ + 'ses', + 'postmark', + ], + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Global "From" Address + |-------------------------------------------------------------------------- + | + | You may wish for all emails sent by your application to be sent from + | the same address. Here you may specify a name and address that is + | used globally for all emails that are sent by your application. + | + */ + + 'from' => [ + 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), + 'name' => env('MAIL_FROM_NAME', 'Example'), + ], + +]; diff --git a/config/queue.php b/config/queue.php new file mode 100755 index 0000000..116bd8d --- /dev/null +++ b/config/queue.php @@ -0,0 +1,112 @@ + env('QUEUE_CONNECTION', 'database'), + + /* + |-------------------------------------------------------------------------- + | Queue Connections + |-------------------------------------------------------------------------- + | + | Here you may configure the connection options for every queue backend + | used by your application. An example configuration is provided for + | each backend supported by Laravel. You're also free to add more. + | + | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" + | + */ + + 'connections' => [ + + 'sync' => [ + 'driver' => 'sync', + ], + + 'database' => [ + 'driver' => 'database', + 'connection' => env('DB_QUEUE_CONNECTION'), + 'table' => env('DB_QUEUE_TABLE', 'jobs'), + 'queue' => env('DB_QUEUE', 'default'), + 'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90), + 'after_commit' => false, + ], + + 'beanstalkd' => [ + 'driver' => 'beanstalkd', + 'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'), + 'queue' => env('BEANSTALKD_QUEUE', 'default'), + 'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90), + 'block_for' => 0, + 'after_commit' => false, + ], + + 'sqs' => [ + 'driver' => 'sqs', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), + 'queue' => env('SQS_QUEUE', 'default'), + 'suffix' => env('SQS_SUFFIX'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'after_commit' => false, + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'), + 'queue' => env('REDIS_QUEUE', 'default'), + 'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90), + 'block_for' => null, + 'after_commit' => false, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Job Batching + |-------------------------------------------------------------------------- + | + | The following options configure the database and table that store job + | batching information. These options can be updated to any database + | connection and table which has been defined by your application. + | + */ + + 'batching' => [ + 'database' => env('DB_CONNECTION', 'sqlite'), + 'table' => 'job_batches', + ], + + /* + |-------------------------------------------------------------------------- + | Failed Queue Jobs + |-------------------------------------------------------------------------- + | + | These options configure the behavior of failed queue job logging so you + | can control how and where failed jobs are stored. Laravel ships with + | support for storing failed jobs in a simple file or in a database. + | + | Supported drivers: "database-uuids", "dynamodb", "file", "null" + | + */ + + 'failed' => [ + 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), + 'database' => env('DB_CONNECTION', 'sqlite'), + 'table' => 'failed_jobs', + ], + +]; diff --git a/config/services.php b/config/services.php new file mode 100755 index 0000000..27a3617 --- /dev/null +++ b/config/services.php @@ -0,0 +1,38 @@ + [ + 'token' => env('POSTMARK_TOKEN'), + ], + + 'ses' => [ + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + ], + + 'resend' => [ + 'key' => env('RESEND_KEY'), + ], + + 'slack' => [ + 'notifications' => [ + 'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'), + 'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'), + ], + ], + +]; diff --git a/config/session.php b/config/session.php new file mode 100755 index 0000000..f0b6541 --- /dev/null +++ b/config/session.php @@ -0,0 +1,217 @@ + env('SESSION_DRIVER', 'database'), + + /* + |-------------------------------------------------------------------------- + | Session Lifetime + |-------------------------------------------------------------------------- + | + | Here you may specify the number of minutes that you wish the session + | to be allowed to remain idle before it expires. If you want them + | to expire immediately when the browser is closed then you may + | indicate that via the expire_on_close configuration option. + | + */ + + 'lifetime' => env('SESSION_LIFETIME', 120), + + 'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false), + + /* + |-------------------------------------------------------------------------- + | Session Encryption + |-------------------------------------------------------------------------- + | + | This option allows you to easily specify that all of your session data + | should be encrypted before it's stored. All encryption is performed + | automatically by Laravel and you may use the session like normal. + | + */ + + 'encrypt' => env('SESSION_ENCRYPT', false), + + /* + |-------------------------------------------------------------------------- + | Session File Location + |-------------------------------------------------------------------------- + | + | When utilizing the "file" session driver, the session files are placed + | on disk. The default storage location is defined here; however, you + | are free to provide another location where they should be stored. + | + */ + + 'files' => storage_path('framework/sessions'), + + /* + |-------------------------------------------------------------------------- + | Session Database Connection + |-------------------------------------------------------------------------- + | + | When using the "database" or "redis" session drivers, you may specify a + | connection that should be used to manage these sessions. This should + | correspond to a connection in your database configuration options. + | + */ + + 'connection' => env('SESSION_CONNECTION'), + + /* + |-------------------------------------------------------------------------- + | Session Database Table + |-------------------------------------------------------------------------- + | + | When using the "database" session driver, you may specify the table to + | be used to store sessions. Of course, a sensible default is defined + | for you; however, you're welcome to change this to another table. + | + */ + + 'table' => env('SESSION_TABLE', 'sessions'), + + /* + |-------------------------------------------------------------------------- + | Session Cache Store + |-------------------------------------------------------------------------- + | + | When using one of the framework's cache driven session backends, you may + | define the cache store which should be used to store the session data + | between requests. This must match one of your defined cache stores. + | + | Affects: "apc", "dynamodb", "memcached", "redis" + | + */ + + 'store' => env('SESSION_STORE'), + + /* + |-------------------------------------------------------------------------- + | Session Sweeping Lottery + |-------------------------------------------------------------------------- + | + | Some session drivers must manually sweep their storage location to get + | rid of old sessions from storage. Here are the chances that it will + | happen on a given request. By default, the odds are 2 out of 100. + | + */ + + 'lottery' => [2, 100], + + /* + |-------------------------------------------------------------------------- + | Session Cookie Name + |-------------------------------------------------------------------------- + | + | Here you may change the name of the session cookie that is created by + | the framework. Typically, you should not need to change this value + | since doing so does not grant a meaningful security improvement. + | + */ + + 'cookie' => env( + 'SESSION_COOKIE', + Str::slug(env('APP_NAME', 'laravel'), '_').'_session' + ), + + /* + |-------------------------------------------------------------------------- + | Session Cookie Path + |-------------------------------------------------------------------------- + | + | The session cookie path determines the path for which the cookie will + | be regarded as available. Typically, this will be the root path of + | your application, but you're free to change this when necessary. + | + */ + + 'path' => env('SESSION_PATH', '/'), + + /* + |-------------------------------------------------------------------------- + | Session Cookie Domain + |-------------------------------------------------------------------------- + | + | This value determines the domain and subdomains the session cookie is + | available to. By default, the cookie will be available to the root + | domain and all subdomains. Typically, this shouldn't be changed. + | + */ + + 'domain' => env('SESSION_DOMAIN'), + + /* + |-------------------------------------------------------------------------- + | HTTPS Only Cookies + |-------------------------------------------------------------------------- + | + | By setting this option to true, session cookies will only be sent back + | to the server if the browser has a HTTPS connection. This will keep + | the cookie from being sent to you when it can't be done securely. + | + */ + + 'secure' => env('SESSION_SECURE_COOKIE'), + + /* + |-------------------------------------------------------------------------- + | HTTP Access Only + |-------------------------------------------------------------------------- + | + | Setting this value to true will prevent JavaScript from accessing the + | value of the cookie and the cookie will only be accessible through + | the HTTP protocol. It's unlikely you should disable this option. + | + */ + + 'http_only' => env('SESSION_HTTP_ONLY', true), + + /* + |-------------------------------------------------------------------------- + | Same-Site Cookies + |-------------------------------------------------------------------------- + | + | This option determines how your cookies behave when cross-site requests + | take place, and can be used to mitigate CSRF attacks. By default, we + | will set this value to "lax" to permit secure cross-site requests. + | + | See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value + | + | Supported: "lax", "strict", "none", null + | + */ + + 'same_site' => env('SESSION_SAME_SITE', 'lax'), + + /* + |-------------------------------------------------------------------------- + | Partitioned Cookies + |-------------------------------------------------------------------------- + | + | Setting this value to true will tie the cookie to the top-level site for + | a cross-site context. Partitioned cookies are accepted by the browser + | when flagged "secure" and the Same-Site attribute is set to "none". + | + */ + + 'partitioned' => env('SESSION_PARTITIONED_COOKIE', false), + +]; diff --git a/config/sidebar.php b/config/sidebar.php new file mode 100755 index 0000000..68355d0 --- /dev/null +++ b/config/sidebar.php @@ -0,0 +1,6 @@ + 'honeycomb', + // 'honeypots' => 'honeypot' +]; \ No newline at end of file diff --git a/database/.gitignore b/database/.gitignore new file mode 100755 index 0000000..9b19b93 --- /dev/null +++ b/database/.gitignore @@ -0,0 +1 @@ +*.sqlite* diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php new file mode 100755 index 0000000..584104c --- /dev/null +++ b/database/factories/UserFactory.php @@ -0,0 +1,44 @@ + + */ +class UserFactory extends Factory +{ + /** + * The current password being used by the factory. + */ + protected static ?string $password; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => fake()->name(), + 'email' => fake()->unique()->safeEmail(), + 'email_verified_at' => now(), + 'password' => static::$password ??= Hash::make('password'), + 'remember_token' => Str::random(10), + ]; + } + + /** + * Indicate that the model's email address should be unverified. + */ + public function unverified(): static + { + return $this->state(fn (array $attributes) => [ + 'email_verified_at' => null, + ]); + } +} diff --git a/database/migrations/0001_01_01_000002_create_jobs_table.php b/database/migrations/0001_01_01_000002_create_jobs_table.php new file mode 100644 index 0000000..425e705 --- /dev/null +++ b/database/migrations/0001_01_01_000002_create_jobs_table.php @@ -0,0 +1,57 @@ +id(); + $table->string('queue')->index(); + $table->longText('payload'); + $table->unsignedTinyInteger('attempts'); + $table->unsignedInteger('reserved_at')->nullable(); + $table->unsignedInteger('available_at'); + $table->unsignedInteger('created_at'); + }); + + Schema::create('job_batches', function (Blueprint $table) { + $table->string('id')->primary(); + $table->string('name'); + $table->integer('total_jobs'); + $table->integer('pending_jobs'); + $table->integer('failed_jobs'); + $table->longText('failed_job_ids'); + $table->mediumText('options')->nullable(); + $table->integer('cancelled_at')->nullable(); + $table->integer('created_at'); + $table->integer('finished_at')->nullable(); + }); + + Schema::create('failed_jobs', function (Blueprint $table) { + $table->id(); + $table->string('uuid')->unique(); + $table->text('connection'); + $table->text('queue'); + $table->longText('payload'); + $table->longText('exception'); + $table->timestamp('failed_at')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('jobs'); + Schema::dropIfExists('job_batches'); + Schema::dropIfExists('failed_jobs'); + } +}; diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php new file mode 100755 index 0000000..d01a0ef --- /dev/null +++ b/database/seeders/DatabaseSeeder.php @@ -0,0 +1,23 @@ +create(); + + User::factory()->create([ + 'name' => 'Test User', + 'email' => 'test@example.com', + ]); + } +} diff --git a/dummy.txt b/dummy.txt new file mode 100755 index 0000000..5112b8b --- /dev/null +++ b/dummy.txt @@ -0,0 +1,11 @@ +dummy + // "repositories": [ + // { + // "type": "path", + // "url": "../lucent-laravel" + // }, + // { + // "type": "path", + // "url": "../lucent-presets" + // } + // ], \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100755 index 0000000..fb650a3 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3318 @@ +{ + "name": "radical-hive", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "svelte": "^5.1.4", + "trix": "^2.1.8" + }, + "devDependencies": { + "@sveltejs/vite-plugin-svelte": "^4.0.0", + "autoprefixer": "^10.4.20", + "axios": "^1.7.4", + "concurrently": "^9.0.1", + "laravel-vite-plugin": "^1.0", + "node-conditions": "^1.2.0", + "postcss": "^8.4.47", + "sass-embedded": "^1.80.4", + "tailwindcss": "^3.4.13", + "vite": "^5.0" + } + }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@bufbuild/protobuf": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.2.1.tgz", + "integrity": "sha512-gdWzq7eX017a1kZCU/bP/sbk4e0GZ6idjsXOcMrQwODCb/rx985fHJJ8+hCu79KpuG7PfZh7bo3BBjPH37JuZw==", + "dev": true + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.3.tgz", + "integrity": "sha512-ufb2CH2KfBWPJok95frEZZ82LtDl0A6QKTa8MoM+cWwDZvVGl5/jNb79pIhRvAalUu+7LD91VYR0nwRD799HkQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.24.3.tgz", + "integrity": "sha512-iAHpft/eQk9vkWIV5t22V77d90CRofgR2006UiCjHcHJFVI1E0oBkQIAbz+pLtthFw3hWEmVB4ilxGyBf48i2Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.3.tgz", + "integrity": "sha512-QPW2YmkWLlvqmOa2OwrfqLJqkHm7kJCIMq9kOz40Zo9Ipi40kf9ONG5Sz76zszrmIZZ4hgRIkez69YnTHgEz1w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.24.3.tgz", + "integrity": "sha512-KO0pN5x3+uZm1ZXeIfDqwcvnQ9UEGN8JX5ufhmgH5Lz4ujjZMAnxQygZAVGemFWn+ZZC0FQopruV4lqmGMshow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.24.3.tgz", + "integrity": "sha512-CsC+ZdIiZCZbBI+aRlWpYJMSWvVssPuWqrDy/zi9YfnatKKSLFCe6fjna1grHuo/nVaHG+kiglpRhyBQYRTK4A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.24.3.tgz", + "integrity": "sha512-F0nqiLThcfKvRQhZEzMIXOQG4EeX61im61VYL1jo4eBxv4aZRmpin6crnBJQ/nWnCsjH5F6J3W6Stdm0mBNqBg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.24.3.tgz", + "integrity": "sha512-KRSFHyE/RdxQ1CSeOIBVIAxStFC/hnBgVcaiCkQaVC+EYDtTe4X7z5tBkFyRoBgUGtB6Xg6t9t2kulnX6wJc6A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.24.3.tgz", + "integrity": "sha512-h6Q8MT+e05zP5BxEKz0vi0DhthLdrNEnspdLzkoFqGwnmOzakEHSlXfVyA4HJ322QtFy7biUAVFPvIDEDQa6rw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.24.3.tgz", + "integrity": "sha512-fKElSyXhXIJ9pqiYRqisfirIo2Z5pTTve5K438URf08fsypXrEkVmShkSfM8GJ1aUyvjakT+fn2W7Czlpd/0FQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.24.3.tgz", + "integrity": "sha512-YlddZSUk8G0px9/+V9PVilVDC6ydMz7WquxozToozSnfFK6wa6ne1ATUjUvjin09jp34p84milxlY5ikueoenw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.24.3.tgz", + "integrity": "sha512-yNaWw+GAO8JjVx3s3cMeG5Esz1cKVzz8PkTJSfYzE5u7A+NvGmbVFEHP+BikTIyYWuz0+DX9kaA3pH9Sqxp69g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.24.3.tgz", + "integrity": "sha512-lWKNQfsbpv14ZCtM/HkjCTm4oWTKTfxPmr7iPfp3AHSqyoTz5AgLemYkWLwOBWc+XxBbrU9SCokZP0WlBZM9lA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.24.3.tgz", + "integrity": "sha512-HoojGXTC2CgCcq0Woc/dn12wQUlkNyfH0I1ABK4Ni9YXyFQa86Fkt2Q0nqgLfbhkyfQ6003i3qQk9pLh/SpAYw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.3.tgz", + "integrity": "sha512-mnEOh4iE4USSccBOtcrjF5nj+5/zm6NcNhbSEfR3Ot0pxBwvEn5QVUXcuOwwPkapDtGZ6pT02xLoPaNv06w7KQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.3.tgz", + "integrity": "sha512-rMTzawBPimBQkG9NKpNHvquIUTQPzrnPxPbCY1Xt+mFkW7pshvyIS5kYgcf74goxXOQk0CP3EoOC1zcEezKXhw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.24.3.tgz", + "integrity": "sha512-2lg1CE305xNvnH3SyiKwPVsTVLCg4TmNCF1z7PSHX2uZY2VbUpdkgAllVoISD7JO7zu+YynpWNSKAtOrX3AiuA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.24.3.tgz", + "integrity": "sha512-9SjYp1sPyxJsPWuhOCX6F4jUMXGbVVd5obVpoVEi8ClZqo52ViZewA6eFz85y8ezuOA+uJMP5A5zo6Oz4S5rVQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.3.tgz", + "integrity": "sha512-HGZgRFFYrMrP3TJlq58nR1xy8zHKId25vhmm5S9jETEfDf6xybPxsavFTJaufe2zgOGYJBskGlj49CwtEuFhWQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@sveltejs/vite-plugin-svelte": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-4.0.0.tgz", + "integrity": "sha512-kpVJwF+gNiMEsoHaw+FJL76IYiwBikkxYU83+BpqQLdVMff19KeRKLd2wisS8niNBMJ2omv5gG+iGDDwd8jzag==", + "dev": true, + "dependencies": { + "@sveltejs/vite-plugin-svelte-inspector": "^3.0.0-next.0||^3.0.0", + "debug": "^4.3.7", + "deepmerge": "^4.3.1", + "kleur": "^4.1.5", + "magic-string": "^0.30.12", + "vitefu": "^1.0.3" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22" + }, + "peerDependencies": { + "svelte": "^5.0.0-next.96 || ^5.0.0", + "vite": "^5.0.0" + } + }, + "node_modules/@sveltejs/vite-plugin-svelte-inspector": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-3.0.1.tgz", + "integrity": "sha512-2CKypmj1sM4GE7HjllT7UKmo4Q6L5xFRd7VMGEWhYnZ+wc6AUVU01IBd7yUi6WnFndEwWoMNOd6e8UjoN0nbvQ==", + "dev": true, + "dependencies": { + "debug": "^4.3.7" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22" + }, + "peerDependencies": { + "@sveltejs/vite-plugin-svelte": "^4.0.0-next.0||^4.0.0", + "svelte": "^5.0.0-next.96 || ^5.0.0", + "vite": "^5.0.0" + } + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==" + }, + "node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-typescript": { + "version": "1.4.13", + "resolved": "https://registry.npmjs.org/acorn-typescript/-/acorn-typescript-1.4.13.tgz", + "integrity": "sha512-xsc9Xv0xlVfwp2o7sQ+GCQ1PgbkdcpWdTzrwXxO3xDMTAywVS3oXVOcOHuRjAPkS4P9b+yc/qNF15460v+jp4Q==", + "peerDependencies": { + "acorn": ">=8.9.0" + } + }, + "node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", + "dev": true + }, + "node_modules/aria-query": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/autoprefixer": { + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", + "integrity": "sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "browserslist": "^4.23.3", + "caniuse-lite": "^1.0.30001646", + "fraction.js": "^4.3.7", + "normalize-range": "^0.1.2", + "picocolors": "^1.0.1", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/axios": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axobject-query": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", + "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.24.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", + "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001669", + "electron-to-chromium": "^1.5.41", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.1" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer-builder": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/buffer-builder/-/buffer-builder-0.2.0.tgz", + "integrity": "sha512-7VPMEPuYznPSoR21NE1zvd2Xna6c/CloiZCfcMXR1Jny6PjX0N4Nsa38zcBFo/FMK+BlA+FLKbJCQ0i2yxp+Xg==", + "dev": true + }, + "node_modules/camelcase-css": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", + "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001674", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001674.tgz", + "integrity": "sha512-jOsKlZVRnzfhLojb+Ykb+gyUSp9Xb57So+fAiFlLzzTKpqg8xxSav0e40c8/4F/v9N8QSvrRRaLeVzQbLqomYw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/colorjs.io": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/colorjs.io/-/colorjs.io-0.5.2.tgz", + "integrity": "sha512-twmVoizEW7ylZSN32OgKdXRmo1qg+wT5/6C3xu5b9QsWzSFAhHLn2xd8ro0diCsKfCj1RdaTP/nrcW+vAoQPIw==", + "dev": true + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/concurrently": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.0.1.tgz", + "integrity": "sha512-wYKvCd/f54sTXJMSfV6Ln/B8UrfLBKOYa+lzc6CHay3Qek+LorVSBdMVfyewFhRbH0Rbabsk4D+3PL/VjQ5gzg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.2", + "lodash": "^4.17.21", + "rxjs": "^7.8.1", + "shell-quote": "^1.8.1", + "supports-color": "^8.1.1", + "tree-kill": "^1.2.2", + "yargs": "^17.7.2" + }, + "bin": { + "conc": "dist/bin/concurrently.js", + "concurrently": "dist/bin/concurrently.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/didyoumean": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", + "dev": true + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", + "dev": true + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/electron-to-chromium": { + "version": "1.5.49", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.49.tgz", + "integrity": "sha512-ZXfs1Of8fDb6z7WEYZjXpgIRF6MEu8JdeGA0A40aZq6OQbS+eJpnnV49epZRna2DU/YsEjSQuGtQPPtvt6J65A==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/esm-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.1.0.tgz", + "integrity": "sha512-OwA6VHlemZ9xu0Ae4WjuotzJUWEBPDimGMgxHP/2OPWhKshkmlCrN2hfZaDD6E5I689OpilBkQ2/cQEy7LEwEA==" + }, + "node_modules/esrap": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esrap/-/esrap-1.2.2.tgz", + "integrity": "sha512-F2pSJklxx1BlQIQgooczXCPHmcWpn6EsP5oo73LQfonG9fIlIENQ8vMmfGXeojP9MrkzUNAfyU5vdFlR9shHAw==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15", + "@types/estree": "^1.0.1" + } + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/form-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fraction.js": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", + "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", + "dev": true, + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/immutable": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", + "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", + "dev": true + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "dev": true, + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-reference": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz", + "integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jiti": { + "version": "1.21.6", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.6.tgz", + "integrity": "sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==", + "dev": true, + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/laravel-vite-plugin": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/laravel-vite-plugin/-/laravel-vite-plugin-1.0.5.tgz", + "integrity": "sha512-Zv+to82YLBknDCZ6g3iwOv9wZ7f6EWStb9pjSm7MGe9Mfoy5ynT2ssZbGsMr1udU6rDg9HOoYEVGw5Qf+p9zbw==", + "dev": true, + "dependencies": { + "picocolors": "^1.0.0", + "vite-plugin-full-reload": "^1.1.0" + }, + "bin": { + "clean-orphaned-assets": "bin/clean.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "vite": "^5.0.0" + } + }, + "node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/locate-character": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", + "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==" + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true + }, + "node_modules/magic-string": { + "version": "0.30.12", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", + "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-conditions": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/node-conditions/-/node-conditions-1.2.0.tgz", + "integrity": "sha512-D9ciETsMr1GgWhgvcFnvA1RFGGNanKFTH919tzPEWBp8pY5p1X54j0Gusw5RIix5sDpomiZ5sZFhiBdWnEO0KA==", + "dev": true, + "engines": { + "node": "^14 || ^16 || >=18" + } + }, + "node_modules/node-releases": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", + "dev": true + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss": { + "version": "8.4.47", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", + "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.1.0", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-import": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "node_modules/postcss-js": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.0.1.tgz", + "integrity": "sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==", + "dev": true, + "dependencies": { + "camelcase-css": "^2.0.1" + }, + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.4.21" + } + }, + "node_modules/postcss-load-config": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz", + "integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "lilconfig": "^3.0.0", + "yaml": "^2.3.4" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/postcss-load-config/node_modules/lilconfig": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", + "integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/postcss-nested": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", + "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "postcss-selector-parser": "^6.1.1" + }, + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", + "dev": true, + "dependencies": { + "pify": "^2.3.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.3.tgz", + "integrity": "sha512-HBW896xR5HGmoksbi3JBDtmVzWiPAYqp7wip50hjQ67JbDz61nyoMPdqu1DvVW9asYb2M65Z20ZHsyJCMqMyDg==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.6" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.24.3", + "@rollup/rollup-android-arm64": "4.24.3", + "@rollup/rollup-darwin-arm64": "4.24.3", + "@rollup/rollup-darwin-x64": "4.24.3", + "@rollup/rollup-freebsd-arm64": "4.24.3", + "@rollup/rollup-freebsd-x64": "4.24.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.24.3", + "@rollup/rollup-linux-arm-musleabihf": "4.24.3", + "@rollup/rollup-linux-arm64-gnu": "4.24.3", + "@rollup/rollup-linux-arm64-musl": "4.24.3", + "@rollup/rollup-linux-powerpc64le-gnu": "4.24.3", + "@rollup/rollup-linux-riscv64-gnu": "4.24.3", + "@rollup/rollup-linux-s390x-gnu": "4.24.3", + "@rollup/rollup-linux-x64-gnu": "4.24.3", + "@rollup/rollup-linux-x64-musl": "4.24.3", + "@rollup/rollup-win32-arm64-msvc": "4.24.3", + "@rollup/rollup-win32-ia32-msvc": "4.24.3", + "@rollup/rollup-win32-x64-msvc": "4.24.3", + "fsevents": "~2.3.2" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/sass-embedded": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded/-/sass-embedded-1.80.4.tgz", + "integrity": "sha512-lPzKX5g79ZxohlPxh0pXTPFseWj9RfgYI0cPm14CH5ok77Ujuheq/DCp7RStvNDWS8RCQ8Ii6gJC/5WTkGyrhA==", + "dev": true, + "dependencies": { + "@bufbuild/protobuf": "^2.0.0", + "buffer-builder": "^0.2.0", + "colorjs.io": "^0.5.0", + "immutable": "^4.0.0", + "rxjs": "^7.4.0", + "supports-color": "^8.1.1", + "varint": "^6.0.0" + }, + "bin": { + "sass": "dist/bin/sass.js" + }, + "engines": { + "node": ">=16.0.0" + }, + "optionalDependencies": { + "sass-embedded-android-arm": "1.80.4", + "sass-embedded-android-arm64": "1.80.4", + "sass-embedded-android-ia32": "1.80.4", + "sass-embedded-android-riscv64": "1.80.4", + "sass-embedded-android-x64": "1.80.4", + "sass-embedded-darwin-arm64": "1.80.4", + "sass-embedded-darwin-x64": "1.80.4", + "sass-embedded-linux-arm": "1.80.4", + "sass-embedded-linux-arm64": "1.80.4", + "sass-embedded-linux-ia32": "1.80.4", + "sass-embedded-linux-musl-arm": "1.80.4", + "sass-embedded-linux-musl-arm64": "1.80.4", + "sass-embedded-linux-musl-ia32": "1.80.4", + "sass-embedded-linux-musl-riscv64": "1.80.4", + "sass-embedded-linux-musl-x64": "1.80.4", + "sass-embedded-linux-riscv64": "1.80.4", + "sass-embedded-linux-x64": "1.80.4", + "sass-embedded-win32-arm64": "1.80.4", + "sass-embedded-win32-ia32": "1.80.4", + "sass-embedded-win32-x64": "1.80.4" + } + }, + "node_modules/sass-embedded-android-arm": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-android-arm/-/sass-embedded-android-arm-1.80.4.tgz", + "integrity": "sha512-iAZ7AiKTLGxQGTkZ37c2/7YC4lkbP1o3eP/K74YaF8O+qhKTLyLOwV7OcmzIywac7dqLcNuGqhFCmFqTYpewZw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-android-arm64": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-android-arm64/-/sass-embedded-android-arm64-1.80.4.tgz", + "integrity": "sha512-htAuBmRvvN2d4smrqxZ6WBw4+OOURaoHzq5oZKqS/E35zYl5FHmrJzp4S5e26a0tEBcjca014tfb/uu9cQgnqA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-android-ia32": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-android-ia32/-/sass-embedded-android-ia32-1.80.4.tgz", + "integrity": "sha512-IIee89Jco8/ad2s/oRJTFqpLhBMzg0UXteJyZ5waZPZmkeSR/t9l67Ef1lLQVh9t9/fJ1ViTTiGYm/g/zu6UGw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-android-riscv64": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-android-riscv64/-/sass-embedded-android-riscv64-1.80.4.tgz", + "integrity": "sha512-iJM2kqmWrOeE1aUyTp3uMAG86hyAqbpbOEV7tv828fUsMRDM4uHsHtmyp2n8P2Y0Y2FnLzJpvIm3SwDXGDzT1Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-android-x64": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-android-x64/-/sass-embedded-android-x64-1.80.4.tgz", + "integrity": "sha512-vd8VrLvUoHeTcsDoIJesXLbQYZH26a8lAzXy6u4+vEuAwikF4WiXBDFrpqiv38QeD3faLeoPtksRsFbAdQqJAA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-darwin-arm64": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-darwin-arm64/-/sass-embedded-darwin-arm64-1.80.4.tgz", + "integrity": "sha512-SJz7EM1i4NXa7CT/njIWMNYJ6CvbHljDIzUAZEe3V3u1KWl/eNO3pbWAnnDN62tBppwgWx/UdDUbAKowsT6Z8w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-darwin-x64": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-darwin-x64/-/sass-embedded-darwin-x64-1.80.4.tgz", + "integrity": "sha512-J/QlBVO66DLtgALgCmM8rZ5zG0dBCIYW1eXIAnnDwC7vGkbAXMtO60M0O/2WNrAfmFfJz1hvKDLjlsxB2XGBLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-linux-arm": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-arm/-/sass-embedded-linux-arm-1.80.4.tgz", + "integrity": "sha512-vuaWhc4ebnaY1AgIWNvFv1snxmkWfvlCU7vnQf4qkn3R2Yyd2J+sjkO8o0NgMX8n5XRUSkAaYUJFCH+Nim6KgQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-linux-arm64": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-arm64/-/sass-embedded-linux-arm64-1.80.4.tgz", + "integrity": "sha512-hI6zQyrR6qJbvyEHfj8UGXNB8VyUa72jel46406AuxUnViA0RyZDSqXUF8vwVw/Hjv1LkA5ihK9dBmWNbLz1zQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-linux-ia32": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-ia32/-/sass-embedded-linux-ia32-1.80.4.tgz", + "integrity": "sha512-wcPExI8UbYrrJvGvo4v2Q+RktbCp44i3qZQ18hglPcVZOC1IzT9NPqZn0XmrqD4hmNbgsYR+picODkvqGw7iDA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-linux-musl-arm": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-arm/-/sass-embedded-linux-musl-arm-1.80.4.tgz", + "integrity": "sha512-HWo0G/9tuhj/uSEwte9KiDK2Xezrfh7nhdEH69ZIfOAqP5byTXL7o08TYagbvMAoljR43Vfna6MelV7NUX4WCw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-linux-musl-arm64": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-arm64/-/sass-embedded-linux-musl-arm64-1.80.4.tgz", + "integrity": "sha512-y8slzQ8Jjkl+53mUDkp3zxcDrTXVVxzpa+6nKh5Ue8l1YU2KdVZG1v2PoDXxE6o99B5I2TVBG8i02IsdYoL8jQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-linux-musl-ia32": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-ia32/-/sass-embedded-linux-musl-ia32-1.80.4.tgz", + "integrity": "sha512-A2WSwnomho491iCeHh3c0YRympfAoJOKr+IyxalTcRH/pjENOWZWZUt00WE2q0tTpEd2V+goWvgS5pmUGewgmg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-linux-musl-riscv64": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-riscv64/-/sass-embedded-linux-musl-riscv64-1.80.4.tgz", + "integrity": "sha512-tYQsAHZLr2mnlJQBJ8Z/n/ySIFJ9JWpsUsoLe9fYgGDaBUfItdzUnj15CChRWld8vFe/I84hb7fbCtYXrI60Jg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-linux-musl-x64": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-musl-x64/-/sass-embedded-linux-musl-x64-1.80.4.tgz", + "integrity": "sha512-NZnr+SYbWlmXx0IaSQ8oF0jYkOULp9qKWMmmZQ1mxuGQ3z7tJqFhpH3M+hYkrFNeOq+GaH+nhHGOD4ZNBxeRkg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-linux-riscv64": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-riscv64/-/sass-embedded-linux-riscv64-1.80.4.tgz", + "integrity": "sha512-h/BmU7QONa7ScvQztFp4Th4aSo3X+Olu3I+RYsaH9s7P683WT3f2w5zr+wwP1V4roM5eyKDCRJBuefT3Fkkkgw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-linux-x64": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-linux-x64/-/sass-embedded-linux-x64-1.80.4.tgz", + "integrity": "sha512-aZbZFs/X9bEmzDiBEiV4IAsKEA0zrCM+s/u2OzvrX4GRvZFJ+/XRTTvf+RTm7mgvTFgfPwCkNGVECQZ1eHh+6A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-win32-arm64": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-win32-arm64/-/sass-embedded-win32-arm64-1.80.4.tgz", + "integrity": "sha512-8JiatFi2VVFqCdJzKNDteaPC4KPmh8/giaVh7TyMcDhKjnvRLeu3v5V1egTMiwwpnQHuwzU3uqBlm/llVNR2Pw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-win32-ia32": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-win32-ia32/-/sass-embedded-win32-ia32-1.80.4.tgz", + "integrity": "sha512-SodmTD6mjxEgoq44jWMibmBQvWkCfENK/70zp4qsztcBSOggg3nYUzwG0YpraClAMXpB1xOvzrArWu9/9fguAg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-embedded-win32-x64": { + "version": "1.80.4", + "resolved": "https://registry.npmjs.org/sass-embedded-win32-x64/-/sass-embedded-win32-x64-1.80.4.tgz", + "integrity": "sha512-7+oRRwCCcnOmw152qDiC7x7SphYBo1eLB4KdyThO+7+rYRO8AftXO+kqBPTVSkM8kGp4wxCMF9auPpYBZbjsow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/sucrase": { + "version": "3.35.0", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", + "integrity": "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "glob": "^10.3.10", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/svelte": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.1.4.tgz", + "integrity": "sha512-qgHDV7AyvBZa2pbf+V0tnvWrN1LKD8LdUsBkR/SSYVVN6zXexiXnOy5Pjcjft2y/2NJJVa8ORUHFVn3oiWCLVQ==", + "dependencies": { + "@ampproject/remapping": "^2.3.0", + "@jridgewell/sourcemap-codec": "^1.5.0", + "@types/estree": "^1.0.5", + "acorn": "^8.12.1", + "acorn-typescript": "^1.4.13", + "aria-query": "^5.3.1", + "axobject-query": "^4.1.0", + "esm-env": "^1.0.0", + "esrap": "^1.2.2", + "is-reference": "^3.0.2", + "locate-character": "^3.0.0", + "magic-string": "^0.30.11", + "zimmerframe": "^1.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/tailwindcss": { + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.14.tgz", + "integrity": "sha512-IcSvOcTRcUtQQ7ILQL5quRDg7Xs93PdJEk1ZLbhhvJc7uj/OAhYOnruEiwnGgBvUtaUAJ8/mhSw1o8L2jCiENA==", + "dev": true, + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.5.3", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.3.0", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.21.0", + "lilconfig": "^2.1.0", + "micromatch": "^4.0.5", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.0.0", + "postcss": "^8.4.23", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.1", + "postcss-nested": "^6.0.1", + "postcss-selector-parser": "^6.0.11", + "resolve": "^1.22.2", + "sucrase": "^3.32.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/trix": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/trix/-/trix-2.1.8.tgz", + "integrity": "sha512-y1h5mKQcjMsZDsUOqOgyIUfw+Z31u4Fe9JqXtKGUzIC7FM9cTpxZFFWxQggwXBo18ccIKYx1Fn9toVO5mCpn9g==" + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true + }, + "node_modules/tslib": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz", + "integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==", + "dev": true + }, + "node_modules/update-browserslist-db": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", + "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/varint": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", + "integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==", + "dev": true + }, + "node_modules/vite": { + "version": "5.4.10", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.10.tgz", + "integrity": "sha512-1hvaPshuPUtxeQ0hsVH3Mud0ZanOLwVTneA1EgbAM5LhaZEqyPWGRQ7BtaMvUrTDeEaC8pxtj6a6jku3x4z6SQ==", + "dev": true, + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-plugin-full-reload": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vite-plugin-full-reload/-/vite-plugin-full-reload-1.2.0.tgz", + "integrity": "sha512-kz18NW79x0IHbxRSHm0jttP4zoO9P9gXh+n6UTwlNKnviTTEpOlum6oS9SmecrTtSr+muHEn5TUuC75UovQzcA==", + "dev": true, + "dependencies": { + "picocolors": "^1.0.0", + "picomatch": "^2.3.1" + } + }, + "node_modules/vitefu": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.0.3.tgz", + "integrity": "sha512-iKKfOMBHob2WxEJbqbJjHAkmYgvFDPhuqrO82om83S8RLk+17FtyMBfcyeH8GqD0ihShtkMW/zzJgiA51hCNCQ==", + "dev": true, + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0-beta.0" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yaml": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.0.tgz", + "integrity": "sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==", + "dev": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/zimmerframe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.2.tgz", + "integrity": "sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==" + } + } +} diff --git a/package.json b/package.json new file mode 100755 index 0000000..9a61e2c --- /dev/null +++ b/package.json @@ -0,0 +1,24 @@ +{ + "private": true, + "type": "module", + "scripts": { + "build": "vite build", + "dev": "vite" + }, + "devDependencies": { + "@sveltejs/vite-plugin-svelte": "^4.0.0", + "autoprefixer": "^10.4.20", + "axios": "^1.7.4", + "concurrently": "^9.0.1", + "laravel-vite-plugin": "^1.0", + "node-conditions": "^1.2.0", + "postcss": "^8.4.47", + "sass-embedded": "^1.80.4", + "tailwindcss": "^3.4.13", + "vite": "^5.0" + }, + "dependencies": { + "svelte": "^5.1.4", + "trix": "^2.1.8" + } +} diff --git a/phpunit.xml b/phpunit.xml new file mode 100755 index 0000000..506b9a3 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,33 @@ + + + + + tests/Unit + + + tests/Feature + + + + + app + + + + + + + + + + + + + + + + diff --git a/postcss.config.js b/postcss.config.js new file mode 100755 index 0000000..49c0612 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +}; diff --git a/public/.htaccess b/public/.htaccess new file mode 100755 index 0000000..3aec5e2 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,21 @@ + + + Options -MultiViews -Indexes + + + RewriteEngine On + + # Handle Authorization Header + RewriteCond %{HTTP:Authorization} . + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + + # Redirect Trailing Slashes If Not A Folder... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_URI} (.+)/$ + RewriteRule ^ %1 [L,R=301] + + # Send Requests To Front Controller... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php [L] + diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100755 index 0000000..e69de29 diff --git a/public/images/add-black.png b/public/images/add-black.png new file mode 100644 index 0000000..630de92 Binary files /dev/null and b/public/images/add-black.png differ diff --git a/public/images/add-blue.png b/public/images/add-blue.png new file mode 100755 index 0000000..45dcdfc Binary files /dev/null and b/public/images/add-blue.png differ diff --git a/public/images/add-yellow.png b/public/images/add-yellow.png new file mode 100644 index 0000000..0a1deeb Binary files /dev/null and b/public/images/add-yellow.png differ diff --git a/public/images/add.png b/public/images/add.png new file mode 100755 index 0000000..17c3a5b Binary files /dev/null and b/public/images/add.png differ diff --git a/public/images/arrow-left-blue.png b/public/images/arrow-left-blue.png new file mode 100755 index 0000000..840a15e Binary files /dev/null and b/public/images/arrow-left-blue.png differ diff --git a/public/images/arrow-left.png b/public/images/arrow-left.png new file mode 100755 index 0000000..8b873a8 Binary files /dev/null and b/public/images/arrow-left.png differ diff --git a/public/images/arrow-right-black.png b/public/images/arrow-right-black.png new file mode 100644 index 0000000..a64546c Binary files /dev/null and b/public/images/arrow-right-black.png differ diff --git a/public/images/arrow-right-blue.png b/public/images/arrow-right-blue.png new file mode 100755 index 0000000..9c3b6ae Binary files /dev/null and b/public/images/arrow-right-blue.png differ diff --git a/public/images/arrow-right-yellow.png b/public/images/arrow-right-yellow.png new file mode 100644 index 0000000..daf1973 Binary files /dev/null and b/public/images/arrow-right-yellow.png differ diff --git a/public/images/arrow-right.png b/public/images/arrow-right.png new file mode 100755 index 0000000..76e3d47 Binary files /dev/null and b/public/images/arrow-right.png differ diff --git a/public/images/beehive-black.png b/public/images/beehive-black.png new file mode 100644 index 0000000..8b5bfb5 Binary files /dev/null and b/public/images/beehive-black.png differ diff --git a/public/images/beehive-blue.png b/public/images/beehive-blue.png new file mode 100755 index 0000000..75f81f0 Binary files /dev/null and b/public/images/beehive-blue.png differ diff --git a/public/images/beehive-honey-svgrepo-com (2).svg b/public/images/beehive-honey-svgrepo-com (2).svg new file mode 100755 index 0000000..301f632 --- /dev/null +++ b/public/images/beehive-honey-svgrepo-com (2).svg @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/beehive-honey-svgrepo-com (3).svg b/public/images/beehive-honey-svgrepo-com (3).svg new file mode 100755 index 0000000..7b015ea --- /dev/null +++ b/public/images/beehive-honey-svgrepo-com (3).svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/beehive.png b/public/images/beehive.png new file mode 100755 index 0000000..615dedf Binary files /dev/null and b/public/images/beehive.png differ diff --git a/public/images/beekeeper.png b/public/images/beekeeper.png new file mode 100755 index 0000000..d30d351 Binary files /dev/null and b/public/images/beekeeper.png differ diff --git a/public/images/beekeper-black.png b/public/images/beekeper-black.png new file mode 100755 index 0000000..65bc597 Binary files /dev/null and b/public/images/beekeper-black.png differ diff --git a/public/images/beekeper-blue.png b/public/images/beekeper-blue.png new file mode 100755 index 0000000..7e379ec Binary files /dev/null and b/public/images/beekeper-blue.png differ diff --git a/public/images/beekeper.svg b/public/images/beekeper.svg new file mode 100755 index 0000000..597ef11 --- /dev/null +++ b/public/images/beekeper.svg @@ -0,0 +1,50 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/bees-active.svg b/public/images/bees-active.svg new file mode 100755 index 0000000..2bfba3d --- /dev/null +++ b/public/images/bees-active.svg @@ -0,0 +1,49 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/bees.svg b/public/images/bees.svg new file mode 100755 index 0000000..1e37894 --- /dev/null +++ b/public/images/bees.svg @@ -0,0 +1,49 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/composter-svgrepo-com.svg b/public/images/composter-svgrepo-com.svg new file mode 100755 index 0000000..a8383dc --- /dev/null +++ b/public/images/composter-svgrepo-com.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/honey-svgrepo-com (1).svg b/public/images/honey-svgrepo-com (1).svg new file mode 100755 index 0000000..3a9a2c1 --- /dev/null +++ b/public/images/honey-svgrepo-com (1).svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/honey-svgrepo-com (2).svg b/public/images/honey-svgrepo-com (2).svg new file mode 100755 index 0000000..34cd59e --- /dev/null +++ b/public/images/honey-svgrepo-com (2).svg @@ -0,0 +1,60 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/honey-svgrepo-com (3).svg b/public/images/honey-svgrepo-com (3).svg new file mode 100755 index 0000000..a160e87 --- /dev/null +++ b/public/images/honey-svgrepo-com (3).svg @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/honey-svgrepo-com.svg b/public/images/honey-svgrepo-com.svg new file mode 100755 index 0000000..95d455a --- /dev/null +++ b/public/images/honey-svgrepo-com.svg @@ -0,0 +1,37 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/honeycomb-black.png b/public/images/honeycomb-black.png new file mode 100644 index 0000000..e7432f6 Binary files /dev/null and b/public/images/honeycomb-black.png differ diff --git a/public/images/honeycomb-blue.png b/public/images/honeycomb-blue.png new file mode 100755 index 0000000..b9c155d Binary files /dev/null and b/public/images/honeycomb-blue.png differ diff --git a/public/images/honeycomb-yellow.png b/public/images/honeycomb-yellow.png new file mode 100644 index 0000000..ac9c3db Binary files /dev/null and b/public/images/honeycomb-yellow.png differ diff --git a/public/images/honeycomb.png b/public/images/honeycomb.png new file mode 100755 index 0000000..d617a30 Binary files /dev/null and b/public/images/honeycomb.png differ diff --git a/public/images/honeypot-active.svg b/public/images/honeypot-active.svg new file mode 100755 index 0000000..b927eae --- /dev/null +++ b/public/images/honeypot-active.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/honeypot.svg b/public/images/honeypot.svg new file mode 100755 index 0000000..05223bc --- /dev/null +++ b/public/images/honeypot.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/search.png b/public/images/search.png new file mode 100644 index 0000000..0c3b2ea Binary files /dev/null and b/public/images/search.png differ diff --git a/public/images/search.svg b/public/images/search.svg new file mode 100755 index 0000000..ee0d063 --- /dev/null +++ b/public/images/search.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/public/index.php b/public/index.php new file mode 100755 index 0000000..947d989 --- /dev/null +++ b/public/index.php @@ -0,0 +1,17 @@ +handleRequest(Request::capture()); diff --git a/public/live b/public/live new file mode 120000 index 0000000..7370ea7 --- /dev/null +++ b/public/live @@ -0,0 +1 @@ +/home/konstantinos/Projects/radical-hive/storage/lucent/live \ No newline at end of file diff --git a/public/robots.txt b/public/robots.txt new file mode 100755 index 0000000..eb05362 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: diff --git a/public/vendor/lucent/dist/assets/main-BJyanQ7P.js b/public/vendor/lucent/dist/assets/main-BJyanQ7P.js new file mode 100755 index 0000000..0a9bb68 --- /dev/null +++ b/public/vendor/lucent/dist/assets/main-BJyanQ7P.js @@ -0,0 +1,342 @@ +var AK=Object.defineProperty;var PK=(_n,Ce,ke)=>Ce in _n?AK(_n,Ce,{enumerable:!0,configurable:!0,writable:!0,value:ke}):_n[Ce]=ke;var LY=(_n,Ce,ke)=>(PK(_n,typeof Ce!="symbol"?Ce+"":Ce,ke),ke);function bind$1(_n,Ce){return function(){return _n.apply(Ce,arguments)}}const{toString:toString$1}=Object.prototype,{getPrototypeOf}=Object,kindOf=(_n=>Ce=>{const ke=toString$1.call(Ce);return _n[ke]||(_n[ke]=ke.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=_n=>(_n=_n.toLowerCase(),Ce=>kindOf(Ce)===_n),typeOfTest=_n=>Ce=>typeof Ce===_n,{isArray:isArray$2}=Array,isUndefined=typeOfTest("undefined");function isBuffer(_n){return _n!==null&&!isUndefined(_n)&&_n.constructor!==null&&!isUndefined(_n.constructor)&&isFunction$1(_n.constructor.isBuffer)&&_n.constructor.isBuffer(_n)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(_n){let Ce;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?Ce=ArrayBuffer.isView(_n):Ce=_n&&_n.buffer&&isArrayBuffer(_n.buffer),Ce}const isString$1=typeOfTest("string"),isFunction$1=typeOfTest("function"),isNumber$1=typeOfTest("number"),isObject$1=_n=>_n!==null&&typeof _n=="object",isBoolean$1=_n=>_n===!0||_n===!1,isPlainObject=_n=>{if(kindOf(_n)!=="object")return!1;const Ce=getPrototypeOf(_n);return(Ce===null||Ce===Object.prototype||Object.getPrototypeOf(Ce)===null)&&!(Symbol.toStringTag in _n)&&!(Symbol.iterator in _n)},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=_n=>isObject$1(_n)&&isFunction$1(_n.pipe),isFormData=_n=>{let Ce;return _n&&(typeof FormData=="function"&&_n instanceof FormData||isFunction$1(_n.append)&&((Ce=kindOf(_n))==="formdata"||Ce==="object"&&isFunction$1(_n.toString)&&_n.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=_n=>_n.trim?_n.trim():_n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(_n,Ce,{allOwnKeys:ke=!1}={}){if(_n===null||typeof _n>"u")return;let $n,Hn;if(typeof _n!="object"&&(_n=[_n]),isArray$2(_n))for($n=0,Hn=_n.length;$n0;)if(Hn=ke[$n],Ce===Hn.toLowerCase())return Hn;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=_n=>!isUndefined(_n)&&_n!==_global;function merge(){const{caseless:_n}=isContextDefined(this)&&this||{},Ce={},ke=($n,Hn)=>{const zn=_n&&findKey$1(Ce,Hn)||Hn;isPlainObject(Ce[zn])&&isPlainObject($n)?Ce[zn]=merge(Ce[zn],$n):isPlainObject($n)?Ce[zn]=merge({},$n):isArray$2($n)?Ce[zn]=$n.slice():Ce[zn]=$n};for(let $n=0,Hn=arguments.length;$n(forEach(Ce,(Hn,zn)=>{ke&&isFunction$1(Hn)?_n[zn]=bind$1(Hn,ke):_n[zn]=Hn},{allOwnKeys:$n}),_n),stripBOM=_n=>(_n.charCodeAt(0)===65279&&(_n=_n.slice(1)),_n),inherits=(_n,Ce,ke,$n)=>{_n.prototype=Object.create(Ce.prototype,$n),_n.prototype.constructor=_n,Object.defineProperty(_n,"super",{value:Ce.prototype}),ke&&Object.assign(_n.prototype,ke)},toFlatObject=(_n,Ce,ke,$n)=>{let Hn,zn,Un;const qn={};if(Ce=Ce||{},_n==null)return Ce;do{for(Hn=Object.getOwnPropertyNames(_n),zn=Hn.length;zn-- >0;)Un=Hn[zn],(!$n||$n(Un,_n,Ce))&&!qn[Un]&&(Ce[Un]=_n[Un],qn[Un]=!0);_n=ke!==!1&&getPrototypeOf(_n)}while(_n&&(!ke||ke(_n,Ce))&&_n!==Object.prototype);return Ce},endsWith=(_n,Ce,ke)=>{_n=String(_n),(ke===void 0||ke>_n.length)&&(ke=_n.length),ke-=Ce.length;const $n=_n.indexOf(Ce,ke);return $n!==-1&&$n===ke},toArray=_n=>{if(!_n)return null;if(isArray$2(_n))return _n;let Ce=_n.length;if(!isNumber$1(Ce))return null;const ke=new Array(Ce);for(;Ce-- >0;)ke[Ce]=_n[Ce];return ke},isTypedArray=(_n=>Ce=>_n&&Ce instanceof _n)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(_n,Ce)=>{const $n=(_n&&_n[Symbol.iterator]).call(_n);let Hn;for(;(Hn=$n.next())&&!Hn.done;){const zn=Hn.value;Ce.call(_n,zn[0],zn[1])}},matchAll=(_n,Ce)=>{let ke;const $n=[];for(;(ke=_n.exec(Ce))!==null;)$n.push(ke);return $n},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=_n=>_n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(ke,$n,Hn){return $n.toUpperCase()+Hn}),hasOwnProperty=(({hasOwnProperty:_n})=>(Ce,ke)=>_n.call(Ce,ke))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(_n,Ce)=>{const ke=Object.getOwnPropertyDescriptors(_n),$n={};forEach(ke,(Hn,zn)=>{let Un;(Un=Ce(Hn,zn,_n))!==!1&&($n[zn]=Un||Hn)}),Object.defineProperties(_n,$n)},freezeMethods=_n=>{reduceDescriptors(_n,(Ce,ke)=>{if(isFunction$1(_n)&&["arguments","caller","callee"].indexOf(ke)!==-1)return!1;const $n=_n[ke];if(isFunction$1($n)){if(Ce.enumerable=!1,"writable"in Ce){Ce.writable=!1;return}Ce.set||(Ce.set=()=>{throw Error("Can not rewrite read-only method '"+ke+"'")})}})},toObjectSet=(_n,Ce)=>{const ke={},$n=Hn=>{Hn.forEach(zn=>{ke[zn]=!0})};return isArray$2(_n)?$n(_n):$n(String(_n).split(Ce)),ke},noop$1=()=>{},toFiniteNumber=(_n,Ce)=>_n!=null&&Number.isFinite(_n=+_n)?_n:Ce,ALPHA="abcdefghijklmnopqrstuvwxyz",DIGIT="0123456789",ALPHABET={DIGIT,ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT},generateString=(_n=16,Ce=ALPHABET.ALPHA_DIGIT)=>{let ke="";const{length:$n}=Ce;for(;_n--;)ke+=Ce[Math.random()*$n|0];return ke};function isSpecCompliantForm(_n){return!!(_n&&isFunction$1(_n.append)&&_n[Symbol.toStringTag]==="FormData"&&_n[Symbol.iterator])}const toJSONObject=_n=>{const Ce=new Array(10),ke=($n,Hn)=>{if(isObject$1($n)){if(Ce.indexOf($n)>=0)return;if(!("toJSON"in $n)){Ce[Hn]=$n;const zn=isArray$2($n)?[]:{};return forEach($n,(Un,qn)=>{const Xn=ke(Un,Hn+1);!isUndefined(Xn)&&(zn[qn]=Xn)}),Ce[Hn]=void 0,zn}}return $n};return ke(_n,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=_n=>_n&&(isObject$1(_n)||isFunction$1(_n))&&isFunction$1(_n.then)&&isFunction$1(_n.catch),_setImmediate=((_n,Ce)=>_n?setImmediate:Ce?((ke,$n)=>(_global.addEventListener("message",({source:Hn,data:zn})=>{Hn===_global&&zn===ke&&$n.length&&$n.shift()()},!1),Hn=>{$n.push(Hn),_global.postMessage(ke,"*")}))(`axios@${Math.random()}`,[]):ke=>setTimeout(ke))(typeof setImmediate=="function",isFunction$1(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process<"u"&&process.nextTick||_setImmediate,utils$1={isArray:isArray$2,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString:isString$1,isNumber:isNumber$1,isBoolean:isBoolean$1,isObject:isObject$1,isPlainObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate:isDate$1,isFile,isBlob,isRegExp,isFunction:isFunction$1,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge,extend:extend$2,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$1,toFiniteNumber,findKey:findKey$1,global:_global,isContextDefined,ALPHABET,generateString,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap};function AxiosError(_n,Ce,ke,$n,Hn){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=_n,this.name="AxiosError",Ce&&(this.code=Ce),ke&&(this.config=ke),$n&&(this.request=$n),Hn&&(this.response=Hn)}utils$1.inherits(AxiosError,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$1.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const prototype$1=AxiosError.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(_n=>{descriptors[_n]={value:_n}});Object.defineProperties(AxiosError,descriptors);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError.from=(_n,Ce,ke,$n,Hn,zn)=>{const Un=Object.create(prototype$1);return utils$1.toFlatObject(_n,Un,function(Xn){return Xn!==Error.prototype},qn=>qn!=="isAxiosError"),AxiosError.call(Un,_n.message,Ce,ke,$n,Hn),Un.cause=_n,Un.name=_n.name,zn&&Object.assign(Un,zn),Un};const httpAdapter=null;function isVisitable(_n){return utils$1.isPlainObject(_n)||utils$1.isArray(_n)}function removeBrackets(_n){return utils$1.endsWith(_n,"[]")?_n.slice(0,-2):_n}function renderKey(_n,Ce,ke){return _n?_n.concat(Ce).map(function(Hn,zn){return Hn=removeBrackets(Hn),!ke&&zn?"["+Hn+"]":Hn}).join(ke?".":""):Ce}function isFlatArray(_n){return utils$1.isArray(_n)&&!_n.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function(Ce){return/^is[A-Z]/.test(Ce)});function toFormData(_n,Ce,ke){if(!utils$1.isObject(_n))throw new TypeError("target must be an object");Ce=Ce||new FormData,ke=utils$1.toFlatObject(ke,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Oo,So){return!utils$1.isUndefined(So[Oo])});const $n=ke.metaTokens,Hn=ke.visitor||to,zn=ke.dots,Un=ke.indexes,Xn=(ke.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(Ce);if(!utils$1.isFunction(Hn))throw new TypeError("visitor must be a function");function Kn(bo){if(bo===null)return"";if(utils$1.isDate(bo))return bo.toISOString();if(!Xn&&utils$1.isBlob(bo))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(bo)||utils$1.isTypedArray(bo)?Xn&&typeof Blob=="function"?new Blob([bo]):Buffer.from(bo):bo}function to(bo,Oo,So){let $o=bo;if(bo&&!So&&typeof bo=="object"){if(utils$1.endsWith(Oo,"{}"))Oo=$n?Oo:Oo.slice(0,-2),bo=JSON.stringify(bo);else if(utils$1.isArray(bo)&&isFlatArray(bo)||(utils$1.isFileList(bo)||utils$1.endsWith(Oo,"[]"))&&($o=utils$1.toArray(bo)))return Oo=removeBrackets(Oo),$o.forEach(function(xo,Io){!(utils$1.isUndefined(xo)||xo===null)&&Ce.append(Un===!0?renderKey([Oo],Io,zn):Un===null?Oo:Oo+"[]",Kn(xo))}),!1}return isVisitable(bo)?!0:(Ce.append(renderKey(So,Oo,zn),Kn(bo)),!1)}const io=[],uo=Object.assign(predicates,{defaultVisitor:to,convertValue:Kn,isVisitable});function ho(bo,Oo){if(!utils$1.isUndefined(bo)){if(io.indexOf(bo)!==-1)throw Error("Circular reference detected in "+Oo.join("."));io.push(bo),utils$1.forEach(bo,function($o,Do){(!(utils$1.isUndefined($o)||$o===null)&&Hn.call(Ce,$o,utils$1.isString(Do)?Do.trim():Do,Oo,uo))===!0&&ho($o,Oo?Oo.concat(Do):[Do])}),io.pop()}}if(!utils$1.isObject(_n))throw new TypeError("data must be an object");return ho(_n),Ce}function encode$1(_n){const Ce={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(_n).replace(/[!'()~]|%20|%00/g,function($n){return Ce[$n]})}function AxiosURLSearchParams(_n,Ce){this._pairs=[],_n&&toFormData(_n,this,Ce)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(Ce,ke){this._pairs.push([Ce,ke])};prototype.toString=function(Ce){const ke=Ce?function($n){return Ce.call(this,$n,encode$1)}:encode$1;return this._pairs.map(function(Hn){return ke(Hn[0])+"="+ke(Hn[1])},"").join("&")};function encode(_n){return encodeURIComponent(_n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(_n,Ce,ke){if(!Ce)return _n;const $n=ke&&ke.encode||encode,Hn=ke&&ke.serialize;let zn;if(Hn?zn=Hn(Ce,ke):zn=utils$1.isURLSearchParams(Ce)?Ce.toString():new AxiosURLSearchParams(Ce,ke).toString($n),zn){const Un=_n.indexOf("#");Un!==-1&&(_n=_n.slice(0,Un)),_n+=(_n.indexOf("?")===-1?"?":"&")+zn}return _n}class InterceptorManager{constructor(){this.handlers=[]}use(Ce,ke,$n){return this.handlers.push({fulfilled:Ce,rejected:ke,synchronous:$n?$n.synchronous:!1,runWhen:$n?$n.runWhen:null}),this.handlers.length-1}eject(Ce){this.handlers[Ce]&&(this.handlers[Ce]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(Ce){utils$1.forEach(this.handlers,function($n){$n!==null&&Ce($n)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",hasStandardBrowserEnv=(_n=>hasBrowserEnv&&["ReactNative","NativeScript","NS"].indexOf(_n)<0)(typeof navigator<"u"&&navigator.product),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils,...platform$1};function toURLEncodedForm(_n,Ce){return toFormData(_n,new platform.classes.URLSearchParams,Object.assign({visitor:function(ke,$n,Hn,zn){return platform.isNode&&utils$1.isBuffer(ke)?(this.append($n,ke.toString("base64")),!1):zn.defaultVisitor.apply(this,arguments)}},Ce))}function parsePropPath(_n){return utils$1.matchAll(/\w+|\[(\w*)]/g,_n).map(Ce=>Ce[0]==="[]"?"":Ce[1]||Ce[0])}function arrayToObject(_n){const Ce={},ke=Object.keys(_n);let $n;const Hn=ke.length;let zn;for($n=0;$n=ke.length;return Un=!Un&&utils$1.isArray(Hn)?Hn.length:Un,Xn?(utils$1.hasOwnProp(Hn,Un)?Hn[Un]=[Hn[Un],$n]:Hn[Un]=$n,!qn):((!Hn[Un]||!utils$1.isObject(Hn[Un]))&&(Hn[Un]=[]),Ce(ke,$n,Hn[Un],zn)&&utils$1.isArray(Hn[Un])&&(Hn[Un]=arrayToObject(Hn[Un])),!qn)}if(utils$1.isFormData(_n)&&utils$1.isFunction(_n.entries)){const ke={};return utils$1.forEachEntry(_n,($n,Hn)=>{Ce(parsePropPath($n),Hn,ke,0)}),ke}return null}function stringifySafely(_n,Ce,ke){if(utils$1.isString(_n))try{return(Ce||JSON.parse)(_n),utils$1.trim(_n)}catch($n){if($n.name!=="SyntaxError")throw $n}return(ke||JSON.stringify)(_n)}const defaults$4={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(Ce,ke){const $n=ke.getContentType()||"",Hn=$n.indexOf("application/json")>-1,zn=utils$1.isObject(Ce);if(zn&&utils$1.isHTMLForm(Ce)&&(Ce=new FormData(Ce)),utils$1.isFormData(Ce))return Hn?JSON.stringify(formDataToJSON(Ce)):Ce;if(utils$1.isArrayBuffer(Ce)||utils$1.isBuffer(Ce)||utils$1.isStream(Ce)||utils$1.isFile(Ce)||utils$1.isBlob(Ce)||utils$1.isReadableStream(Ce))return Ce;if(utils$1.isArrayBufferView(Ce))return Ce.buffer;if(utils$1.isURLSearchParams(Ce))return ke.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),Ce.toString();let qn;if(zn){if($n.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(Ce,this.formSerializer).toString();if((qn=utils$1.isFileList(Ce))||$n.indexOf("multipart/form-data")>-1){const Xn=this.env&&this.env.FormData;return toFormData(qn?{"files[]":Ce}:Ce,Xn&&new Xn,this.formSerializer)}}return zn||Hn?(ke.setContentType("application/json",!1),stringifySafely(Ce)):Ce}],transformResponse:[function(Ce){const ke=this.transitional||defaults$4.transitional,$n=ke&&ke.forcedJSONParsing,Hn=this.responseType==="json";if(utils$1.isResponse(Ce)||utils$1.isReadableStream(Ce))return Ce;if(Ce&&utils$1.isString(Ce)&&($n&&!this.responseType||Hn)){const Un=!(ke&&ke.silentJSONParsing)&&Hn;try{return JSON.parse(Ce)}catch(qn){if(Un)throw qn.name==="SyntaxError"?AxiosError.from(qn,AxiosError.ERR_BAD_RESPONSE,this,null,this.response):qn}}return Ce}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(Ce){return Ce>=200&&Ce<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],_n=>{defaults$4.headers[_n]={}});const ignoreDuplicateOf=utils$1.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=_n=>{const Ce={};let ke,$n,Hn;return _n&&_n.split(` +`).forEach(function(Un){Hn=Un.indexOf(":"),ke=Un.substring(0,Hn).trim().toLowerCase(),$n=Un.substring(Hn+1).trim(),!(!ke||Ce[ke]&&ignoreDuplicateOf[ke])&&(ke==="set-cookie"?Ce[ke]?Ce[ke].push($n):Ce[ke]=[$n]:Ce[ke]=Ce[ke]?Ce[ke]+", "+$n:$n)}),Ce},$internals=Symbol("internals");function normalizeHeader(_n){return _n&&String(_n).trim().toLowerCase()}function normalizeValue(_n){return _n===!1||_n==null?_n:utils$1.isArray(_n)?_n.map(normalizeValue):String(_n)}function parseTokens(_n){const Ce=Object.create(null),ke=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let $n;for(;$n=ke.exec(_n);)Ce[$n[1]]=$n[2];return Ce}const isValidHeaderName=_n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(_n.trim());function matchHeaderValue(_n,Ce,ke,$n,Hn){if(utils$1.isFunction($n))return $n.call(this,Ce,ke);if(Hn&&(Ce=ke),!!utils$1.isString(Ce)){if(utils$1.isString($n))return Ce.indexOf($n)!==-1;if(utils$1.isRegExp($n))return $n.test(Ce)}}function formatHeader(_n){return _n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(Ce,ke,$n)=>ke.toUpperCase()+$n)}function buildAccessors(_n,Ce){const ke=utils$1.toCamelCase(" "+Ce);["get","set","has"].forEach($n=>{Object.defineProperty(_n,$n+ke,{value:function(Hn,zn,Un){return this[$n].call(this,Ce,Hn,zn,Un)},configurable:!0})})}class AxiosHeaders{constructor(Ce){Ce&&this.set(Ce)}set(Ce,ke,$n){const Hn=this;function zn(qn,Xn,Kn){const to=normalizeHeader(Xn);if(!to)throw new Error("header name must be a non-empty string");const io=utils$1.findKey(Hn,to);(!io||Hn[io]===void 0||Kn===!0||Kn===void 0&&Hn[io]!==!1)&&(Hn[io||Xn]=normalizeValue(qn))}const Un=(qn,Xn)=>utils$1.forEach(qn,(Kn,to)=>zn(Kn,to,Xn));if(utils$1.isPlainObject(Ce)||Ce instanceof this.constructor)Un(Ce,ke);else if(utils$1.isString(Ce)&&(Ce=Ce.trim())&&!isValidHeaderName(Ce))Un(parseHeaders(Ce),ke);else if(utils$1.isHeaders(Ce))for(const[qn,Xn]of Ce.entries())zn(Xn,qn,$n);else Ce!=null&&zn(ke,Ce,$n);return this}get(Ce,ke){if(Ce=normalizeHeader(Ce),Ce){const $n=utils$1.findKey(this,Ce);if($n){const Hn=this[$n];if(!ke)return Hn;if(ke===!0)return parseTokens(Hn);if(utils$1.isFunction(ke))return ke.call(this,Hn,$n);if(utils$1.isRegExp(ke))return ke.exec(Hn);throw new TypeError("parser must be boolean|regexp|function")}}}has(Ce,ke){if(Ce=normalizeHeader(Ce),Ce){const $n=utils$1.findKey(this,Ce);return!!($n&&this[$n]!==void 0&&(!ke||matchHeaderValue(this,this[$n],$n,ke)))}return!1}delete(Ce,ke){const $n=this;let Hn=!1;function zn(Un){if(Un=normalizeHeader(Un),Un){const qn=utils$1.findKey($n,Un);qn&&(!ke||matchHeaderValue($n,$n[qn],qn,ke))&&(delete $n[qn],Hn=!0)}}return utils$1.isArray(Ce)?Ce.forEach(zn):zn(Ce),Hn}clear(Ce){const ke=Object.keys(this);let $n=ke.length,Hn=!1;for(;$n--;){const zn=ke[$n];(!Ce||matchHeaderValue(this,this[zn],zn,Ce,!0))&&(delete this[zn],Hn=!0)}return Hn}normalize(Ce){const ke=this,$n={};return utils$1.forEach(this,(Hn,zn)=>{const Un=utils$1.findKey($n,zn);if(Un){ke[Un]=normalizeValue(Hn),delete ke[zn];return}const qn=Ce?formatHeader(zn):String(zn).trim();qn!==zn&&delete ke[zn],ke[qn]=normalizeValue(Hn),$n[qn]=!0}),this}concat(...Ce){return this.constructor.concat(this,...Ce)}toJSON(Ce){const ke=Object.create(null);return utils$1.forEach(this,($n,Hn)=>{$n!=null&&$n!==!1&&(ke[Hn]=Ce&&utils$1.isArray($n)?$n.join(", "):$n)}),ke}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([Ce,ke])=>Ce+": "+ke).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(Ce){return Ce instanceof this?Ce:new this(Ce)}static concat(Ce,...ke){const $n=new this(Ce);return ke.forEach(Hn=>$n.set(Hn)),$n}static accessor(Ce){const $n=(this[$internals]=this[$internals]={accessors:{}}).accessors,Hn=this.prototype;function zn(Un){const qn=normalizeHeader(Un);$n[qn]||(buildAccessors(Hn,Un),$n[qn]=!0)}return utils$1.isArray(Ce)?Ce.forEach(zn):zn(Ce),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$1.reduceDescriptors(AxiosHeaders.prototype,({value:_n},Ce)=>{let ke=Ce[0].toUpperCase()+Ce.slice(1);return{get:()=>_n,set($n){this[ke]=$n}}});utils$1.freezeMethods(AxiosHeaders);function transformData(_n,Ce){const ke=this||defaults$4,$n=Ce||ke,Hn=AxiosHeaders.from($n.headers);let zn=$n.data;return utils$1.forEach(_n,function(qn){zn=qn.call(ke,zn,Hn.normalize(),Ce?Ce.status:void 0)}),Hn.normalize(),zn}function isCancel(_n){return!!(_n&&_n.__CANCEL__)}function CanceledError(_n,Ce,ke){AxiosError.call(this,_n??"canceled",AxiosError.ERR_CANCELED,Ce,ke),this.name="CanceledError"}utils$1.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(_n,Ce,ke){const $n=ke.config.validateStatus;!ke.status||!$n||$n(ke.status)?_n(ke):Ce(new AxiosError("Request failed with status code "+ke.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(ke.status/100)-4],ke.config,ke.request,ke))}function parseProtocol(_n){const Ce=/^([-+\w]{1,25})(:?\/\/|:)/.exec(_n);return Ce&&Ce[1]||""}function speedometer(_n,Ce){_n=_n||10;const ke=new Array(_n),$n=new Array(_n);let Hn=0,zn=0,Un;return Ce=Ce!==void 0?Ce:1e3,function(Xn){const Kn=Date.now(),to=$n[zn];Un||(Un=Kn),ke[Hn]=Xn,$n[Hn]=Kn;let io=zn,uo=0;for(;io!==Hn;)uo+=ke[io++],io=io%_n;if(Hn=(Hn+1)%_n,Hn===zn&&(zn=(zn+1)%_n),Kn-Un{ke=to,Hn=null,zn&&(clearTimeout(zn),zn=null),_n.apply(null,Kn)};return[(...Kn)=>{const to=Date.now(),io=to-ke;io>=$n?Un(Kn,to):(Hn=Kn,zn||(zn=setTimeout(()=>{zn=null,Un(Hn)},$n-io)))},()=>Hn&&Un(Hn)]}const progressEventReducer=(_n,Ce,ke=3)=>{let $n=0;const Hn=speedometer(50,250);return throttle$1(zn=>{const Un=zn.loaded,qn=zn.lengthComputable?zn.total:void 0,Xn=Un-$n,Kn=Hn(Xn),to=Un<=qn;$n=Un;const io={loaded:Un,total:qn,progress:qn?Un/qn:void 0,bytes:Xn,rate:Kn||void 0,estimated:Kn&&qn&&to?(qn-Un)/Kn:void 0,event:zn,lengthComputable:qn!=null,[Ce?"download":"upload"]:!0};_n(io)},ke)},progressEventDecorator=(_n,Ce)=>{const ke=_n!=null;return[$n=>Ce[0]({lengthComputable:ke,total:_n,loaded:$n}),Ce[1]]},asyncDecorator=_n=>(...Ce)=>utils$1.asap(()=>_n(...Ce)),isURLSameOrigin=platform.hasStandardBrowserEnv?function(){const Ce=/(msie|trident)/i.test(navigator.userAgent),ke=document.createElement("a");let $n;function Hn(zn){let Un=zn;return Ce&&(ke.setAttribute("href",Un),Un=ke.href),ke.setAttribute("href",Un),{href:ke.href,protocol:ke.protocol?ke.protocol.replace(/:$/,""):"",host:ke.host,search:ke.search?ke.search.replace(/^\?/,""):"",hash:ke.hash?ke.hash.replace(/^#/,""):"",hostname:ke.hostname,port:ke.port,pathname:ke.pathname.charAt(0)==="/"?ke.pathname:"/"+ke.pathname}}return $n=Hn(window.location.href),function(Un){const qn=utils$1.isString(Un)?Hn(Un):Un;return qn.protocol===$n.protocol&&qn.host===$n.host}}():function(){return function(){return!0}}(),cookies=platform.hasStandardBrowserEnv?{write(_n,Ce,ke,$n,Hn,zn){const Un=[_n+"="+encodeURIComponent(Ce)];utils$1.isNumber(ke)&&Un.push("expires="+new Date(ke).toGMTString()),utils$1.isString($n)&&Un.push("path="+$n),utils$1.isString(Hn)&&Un.push("domain="+Hn),zn===!0&&Un.push("secure"),document.cookie=Un.join("; ")},read(_n){const Ce=document.cookie.match(new RegExp("(^|;\\s*)("+_n+")=([^;]*)"));return Ce?decodeURIComponent(Ce[3]):null},remove(_n){this.write(_n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(_n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(_n)}function combineURLs(_n,Ce){return Ce?_n.replace(/\/?\/$/,"")+"/"+Ce.replace(/^\/+/,""):_n}function buildFullPath(_n,Ce){return _n&&!isAbsoluteURL(Ce)?combineURLs(_n,Ce):Ce}const headersToObject=_n=>_n instanceof AxiosHeaders?{..._n}:_n;function mergeConfig(_n,Ce){Ce=Ce||{};const ke={};function $n(Kn,to,io){return utils$1.isPlainObject(Kn)&&utils$1.isPlainObject(to)?utils$1.merge.call({caseless:io},Kn,to):utils$1.isPlainObject(to)?utils$1.merge({},to):utils$1.isArray(to)?to.slice():to}function Hn(Kn,to,io){if(utils$1.isUndefined(to)){if(!utils$1.isUndefined(Kn))return $n(void 0,Kn,io)}else return $n(Kn,to,io)}function zn(Kn,to){if(!utils$1.isUndefined(to))return $n(void 0,to)}function Un(Kn,to){if(utils$1.isUndefined(to)){if(!utils$1.isUndefined(Kn))return $n(void 0,Kn)}else return $n(void 0,to)}function qn(Kn,to,io){if(io in Ce)return $n(Kn,to);if(io in _n)return $n(void 0,Kn)}const Xn={url:zn,method:zn,data:zn,baseURL:Un,transformRequest:Un,transformResponse:Un,paramsSerializer:Un,timeout:Un,timeoutMessage:Un,withCredentials:Un,withXSRFToken:Un,adapter:Un,responseType:Un,xsrfCookieName:Un,xsrfHeaderName:Un,onUploadProgress:Un,onDownloadProgress:Un,decompress:Un,maxContentLength:Un,maxBodyLength:Un,beforeRedirect:Un,transport:Un,httpAgent:Un,httpsAgent:Un,cancelToken:Un,socketPath:Un,responseEncoding:Un,validateStatus:qn,headers:(Kn,to)=>Hn(headersToObject(Kn),headersToObject(to),!0)};return utils$1.forEach(Object.keys(Object.assign({},_n,Ce)),function(to){const io=Xn[to]||Hn,uo=io(_n[to],Ce[to],to);utils$1.isUndefined(uo)&&io!==qn||(ke[to]=uo)}),ke}const resolveConfig$1=_n=>{const Ce=mergeConfig({},_n);let{data:ke,withXSRFToken:$n,xsrfHeaderName:Hn,xsrfCookieName:zn,headers:Un,auth:qn}=Ce;Ce.headers=Un=AxiosHeaders.from(Un),Ce.url=buildURL(buildFullPath(Ce.baseURL,Ce.url),_n.params,_n.paramsSerializer),qn&&Un.set("Authorization","Basic "+btoa((qn.username||"")+":"+(qn.password?unescape(encodeURIComponent(qn.password)):"")));let Xn;if(utils$1.isFormData(ke)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)Un.setContentType(void 0);else if((Xn=Un.getContentType())!==!1){const[Kn,...to]=Xn?Xn.split(";").map(io=>io.trim()).filter(Boolean):[];Un.setContentType([Kn||"multipart/form-data",...to].join("; "))}}if(platform.hasStandardBrowserEnv&&($n&&utils$1.isFunction($n)&&($n=$n(Ce)),$n||$n!==!1&&isURLSameOrigin(Ce.url))){const Kn=Hn&&zn&&cookies.read(zn);Kn&&Un.set(Hn,Kn)}return Ce},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(_n){return new Promise(function(ke,$n){const Hn=resolveConfig$1(_n);let zn=Hn.data;const Un=AxiosHeaders.from(Hn.headers).normalize();let{responseType:qn,onUploadProgress:Xn,onDownloadProgress:Kn}=Hn,to,io,uo,ho,bo;function Oo(){ho&&ho(),bo&&bo(),Hn.cancelToken&&Hn.cancelToken.unsubscribe(to),Hn.signal&&Hn.signal.removeEventListener("abort",to)}let So=new XMLHttpRequest;So.open(Hn.method.toUpperCase(),Hn.url,!0),So.timeout=Hn.timeout;function $o(){if(!So)return;const xo=AxiosHeaders.from("getAllResponseHeaders"in So&&So.getAllResponseHeaders()),Vo={data:!qn||qn==="text"||qn==="json"?So.responseText:So.response,status:So.status,statusText:So.statusText,headers:xo,config:_n,request:So};settle(function(Mo){ke(Mo),Oo()},function(Mo){$n(Mo),Oo()},Vo),So=null}"onloadend"in So?So.onloadend=$o:So.onreadystatechange=function(){!So||So.readyState!==4||So.status===0&&!(So.responseURL&&So.responseURL.indexOf("file:")===0)||setTimeout($o)},So.onabort=function(){So&&($n(new AxiosError("Request aborted",AxiosError.ECONNABORTED,_n,So)),So=null)},So.onerror=function(){$n(new AxiosError("Network Error",AxiosError.ERR_NETWORK,_n,So)),So=null},So.ontimeout=function(){let Io=Hn.timeout?"timeout of "+Hn.timeout+"ms exceeded":"timeout exceeded";const Vo=Hn.transitional||transitionalDefaults;Hn.timeoutErrorMessage&&(Io=Hn.timeoutErrorMessage),$n(new AxiosError(Io,Vo.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,_n,So)),So=null},zn===void 0&&Un.setContentType(null),"setRequestHeader"in So&&utils$1.forEach(Un.toJSON(),function(Io,Vo){So.setRequestHeader(Vo,Io)}),utils$1.isUndefined(Hn.withCredentials)||(So.withCredentials=!!Hn.withCredentials),qn&&qn!=="json"&&(So.responseType=Hn.responseType),Kn&&([uo,bo]=progressEventReducer(Kn,!0),So.addEventListener("progress",uo)),Xn&&So.upload&&([io,ho]=progressEventReducer(Xn),So.upload.addEventListener("progress",io),So.upload.addEventListener("loadend",ho)),(Hn.cancelToken||Hn.signal)&&(to=xo=>{So&&($n(!xo||xo.type?new CanceledError(null,_n,So):xo),So.abort(),So=null)},Hn.cancelToken&&Hn.cancelToken.subscribe(to),Hn.signal&&(Hn.signal.aborted?to():Hn.signal.addEventListener("abort",to)));const Do=parseProtocol(Hn.url);if(Do&&platform.protocols.indexOf(Do)===-1){$n(new AxiosError("Unsupported protocol "+Do+":",AxiosError.ERR_BAD_REQUEST,_n));return}So.send(zn||null)})},composeSignals=(_n,Ce)=>{let ke=new AbortController,$n;const Hn=function(Xn){if(!$n){$n=!0,Un();const Kn=Xn instanceof Error?Xn:this.reason;ke.abort(Kn instanceof AxiosError?Kn:new CanceledError(Kn instanceof Error?Kn.message:Kn))}};let zn=Ce&&setTimeout(()=>{Hn(new AxiosError(`timeout ${Ce} of ms exceeded`,AxiosError.ETIMEDOUT))},Ce);const Un=()=>{_n&&(zn&&clearTimeout(zn),zn=null,_n.forEach(Xn=>{Xn&&(Xn.removeEventListener?Xn.removeEventListener("abort",Hn):Xn.unsubscribe(Hn))}),_n=null)};_n.forEach(Xn=>Xn&&Xn.addEventListener&&Xn.addEventListener("abort",Hn));const{signal:qn}=ke;return qn.unsubscribe=Un,[qn,()=>{zn&&clearTimeout(zn),zn=null}]},streamChunk=function*(_n,Ce){let ke=_n.byteLength;if(!Ce||ke{const zn=readBytes(_n,Ce,Hn);let Un=0,qn,Xn=Kn=>{qn||(qn=!0,$n&&$n(Kn))};return new ReadableStream({async pull(Kn){try{const{done:to,value:io}=await zn.next();if(to){Xn(),Kn.close();return}let uo=io.byteLength;if(ke){let ho=Un+=uo;ke(ho)}Kn.enqueue(new Uint8Array(io))}catch(to){throw Xn(to),to}},cancel(Kn){return Xn(Kn),zn.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(_n=>Ce=>_n.encode(Ce))(new TextEncoder):async _n=>new Uint8Array(await new Response(_n).arrayBuffer())),test=(_n,...Ce)=>{try{return!!_n(...Ce)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let _n=!1;const Ce=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return _n=!0,"half"}}).headers.has("Content-Type");return _n&&!Ce}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$1.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(_n=>_n.body)};isFetchSupported&&(_n=>{["text","arrayBuffer","blob","formData","stream"].forEach(Ce=>{!resolvers[Ce]&&(resolvers[Ce]=utils$1.isFunction(_n[Ce])?ke=>ke[Ce]():(ke,$n)=>{throw new AxiosError(`Response type '${Ce}' is not supported`,AxiosError.ERR_NOT_SUPPORT,$n)})})})(new Response);const getBodyLength=async _n=>{if(_n==null)return 0;if(utils$1.isBlob(_n))return _n.size;if(utils$1.isSpecCompliantForm(_n))return(await new Request(_n).arrayBuffer()).byteLength;if(utils$1.isArrayBufferView(_n)||utils$1.isArrayBuffer(_n))return _n.byteLength;if(utils$1.isURLSearchParams(_n)&&(_n=_n+""),utils$1.isString(_n))return(await encodeText(_n)).byteLength},resolveBodyLength=async(_n,Ce)=>{const ke=utils$1.toFiniteNumber(_n.getContentLength());return ke??getBodyLength(Ce)},fetchAdapter=isFetchSupported&&(async _n=>{let{url:Ce,method:ke,data:$n,signal:Hn,cancelToken:zn,timeout:Un,onDownloadProgress:qn,onUploadProgress:Xn,responseType:Kn,headers:to,withCredentials:io="same-origin",fetchOptions:uo}=resolveConfig$1(_n);Kn=Kn?(Kn+"").toLowerCase():"text";let[ho,bo]=Hn||zn||Un?composeSignals([Hn,zn],Un):[],Oo,So;const $o=()=>{!Oo&&setTimeout(()=>{ho&&ho.unsubscribe()}),Oo=!0};let Do;try{if(Xn&&supportsRequestStream&&ke!=="get"&&ke!=="head"&&(Do=await resolveBodyLength(to,$n))!==0){let Jo=new Request(Ce,{method:"POST",body:$n,duplex:"half"}),Mo;if(utils$1.isFormData($n)&&(Mo=Jo.headers.get("content-type"))&&to.setContentType(Mo),Jo.body){const[Go,os]=progressEventDecorator(Do,progressEventReducer(asyncDecorator(Xn)));$n=trackStream(Jo.body,DEFAULT_CHUNK_SIZE,Go,os,encodeText)}}utils$1.isString(io)||(io=io?"include":"omit"),So=new Request(Ce,{...uo,signal:ho,method:ke.toUpperCase(),headers:to.normalize().toJSON(),body:$n,duplex:"half",credentials:io});let xo=await fetch(So);const Io=supportsResponseStream&&(Kn==="stream"||Kn==="response");if(supportsResponseStream&&(qn||Io)){const Jo={};["status","statusText","headers"].forEach(ms=>{Jo[ms]=xo[ms]});const Mo=utils$1.toFiniteNumber(xo.headers.get("content-length")),[Go,os]=qn&&progressEventDecorator(Mo,progressEventReducer(asyncDecorator(qn),!0))||[];xo=new Response(trackStream(xo.body,DEFAULT_CHUNK_SIZE,Go,()=>{os&&os(),Io&&$o()},encodeText),Jo)}Kn=Kn||"text";let Vo=await resolvers[utils$1.findKey(resolvers,Kn)||"text"](xo,_n);return!Io&&$o(),bo&&bo(),await new Promise((Jo,Mo)=>{settle(Jo,Mo,{data:Vo,headers:AxiosHeaders.from(xo.headers),status:xo.status,statusText:xo.statusText,config:_n,request:So})})}catch(xo){throw $o(),xo&&xo.name==="TypeError"&&/fetch/i.test(xo.message)?Object.assign(new AxiosError("Network Error",AxiosError.ERR_NETWORK,_n,So),{cause:xo.cause||xo}):AxiosError.from(xo,xo&&xo.code,_n,So)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$1.forEach(knownAdapters,(_n,Ce)=>{if(_n){try{Object.defineProperty(_n,"name",{value:Ce})}catch{}Object.defineProperty(_n,"adapterName",{value:Ce})}});const renderReason=_n=>`- ${_n}`,isResolvedHandle=_n=>utils$1.isFunction(_n)||_n===null||_n===!1,adapters={getAdapter:_n=>{_n=utils$1.isArray(_n)?_n:[_n];const{length:Ce}=_n;let ke,$n;const Hn={};for(let zn=0;zn`adapter ${qn} `+(Xn===!1?"is not supported by the environment":"is not available in the build"));let Un=Ce?zn.length>1?`since : +`+zn.map(renderReason).join(` +`):" "+renderReason(zn[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+Un,"ERR_NOT_SUPPORT")}return $n},adapters:knownAdapters};function throwIfCancellationRequested(_n){if(_n.cancelToken&&_n.cancelToken.throwIfRequested(),_n.signal&&_n.signal.aborted)throw new CanceledError(null,_n)}function dispatchRequest(_n){return throwIfCancellationRequested(_n),_n.headers=AxiosHeaders.from(_n.headers),_n.data=transformData.call(_n,_n.transformRequest),["post","put","patch"].indexOf(_n.method)!==-1&&_n.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(_n.adapter||defaults$4.adapter)(_n).then(function($n){return throwIfCancellationRequested(_n),$n.data=transformData.call(_n,_n.transformResponse,$n),$n.headers=AxiosHeaders.from($n.headers),$n},function($n){return isCancel($n)||(throwIfCancellationRequested(_n),$n&&$n.response&&($n.response.data=transformData.call(_n,_n.transformResponse,$n.response),$n.response.headers=AxiosHeaders.from($n.response.headers))),Promise.reject($n)})}const VERSION="1.7.4",validators$1={};["object","boolean","number","function","string","symbol"].forEach((_n,Ce)=>{validators$1[_n]=function($n){return typeof $n===_n||"a"+(Ce<1?"n ":" ")+_n}});const deprecatedWarnings={};validators$1.transitional=function(Ce,ke,$n){function Hn(zn,Un){return"[Axios v"+VERSION+"] Transitional option '"+zn+"'"+Un+($n?". "+$n:"")}return(zn,Un,qn)=>{if(Ce===!1)throw new AxiosError(Hn(Un," has been removed"+(ke?" in "+ke:"")),AxiosError.ERR_DEPRECATED);return ke&&!deprecatedWarnings[Un]&&(deprecatedWarnings[Un]=!0,console.warn(Hn(Un," has been deprecated since v"+ke+" and will be removed in the near future"))),Ce?Ce(zn,Un,qn):!0}};function assertOptions(_n,Ce,ke){if(typeof _n!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const $n=Object.keys(_n);let Hn=$n.length;for(;Hn-- >0;){const zn=$n[Hn],Un=Ce[zn];if(Un){const qn=_n[zn],Xn=qn===void 0||Un(qn,zn,_n);if(Xn!==!0)throw new AxiosError("option "+zn+" must be "+Xn,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(ke!==!0)throw new AxiosError("Unknown option "+zn,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(Ce){this.defaults=Ce,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(Ce,ke){try{return await this._request(Ce,ke)}catch($n){if($n instanceof Error){let Hn;Error.captureStackTrace?Error.captureStackTrace(Hn={}):Hn=new Error;const zn=Hn.stack?Hn.stack.replace(/^.+\n/,""):"";try{$n.stack?zn&&!String($n.stack).endsWith(zn.replace(/^.+\n.+\n/,""))&&($n.stack+=` +`+zn):$n.stack=zn}catch{}}throw $n}}_request(Ce,ke){typeof Ce=="string"?(ke=ke||{},ke.url=Ce):ke=Ce||{},ke=mergeConfig(this.defaults,ke);const{transitional:$n,paramsSerializer:Hn,headers:zn}=ke;$n!==void 0&&validator.assertOptions($n,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),Hn!=null&&(utils$1.isFunction(Hn)?ke.paramsSerializer={serialize:Hn}:validator.assertOptions(Hn,{encode:validators.function,serialize:validators.function},!0)),ke.method=(ke.method||this.defaults.method||"get").toLowerCase();let Un=zn&&utils$1.merge(zn.common,zn[ke.method]);zn&&utils$1.forEach(["delete","get","head","post","put","patch","common"],bo=>{delete zn[bo]}),ke.headers=AxiosHeaders.concat(Un,zn);const qn=[];let Xn=!0;this.interceptors.request.forEach(function(Oo){typeof Oo.runWhen=="function"&&Oo.runWhen(ke)===!1||(Xn=Xn&&Oo.synchronous,qn.unshift(Oo.fulfilled,Oo.rejected))});const Kn=[];this.interceptors.response.forEach(function(Oo){Kn.push(Oo.fulfilled,Oo.rejected)});let to,io=0,uo;if(!Xn){const bo=[dispatchRequest.bind(this),void 0];for(bo.unshift.apply(bo,qn),bo.push.apply(bo,Kn),uo=bo.length,to=Promise.resolve(ke);io{if(!$n._listeners)return;let zn=$n._listeners.length;for(;zn-- >0;)$n._listeners[zn](Hn);$n._listeners=null}),this.promise.then=Hn=>{let zn;const Un=new Promise(qn=>{$n.subscribe(qn),zn=qn}).then(Hn);return Un.cancel=function(){$n.unsubscribe(zn)},Un},Ce(function(zn,Un,qn){$n.reason||($n.reason=new CanceledError(zn,Un,qn),ke($n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(Ce){if(this.reason){Ce(this.reason);return}this._listeners?this._listeners.push(Ce):this._listeners=[Ce]}unsubscribe(Ce){if(!this._listeners)return;const ke=this._listeners.indexOf(Ce);ke!==-1&&this._listeners.splice(ke,1)}static source(){let Ce;return{token:new CancelToken(function(Hn){Ce=Hn}),cancel:Ce}}}function spread(_n){return function(ke){return _n.apply(null,ke)}}function isAxiosError(_n){return utils$1.isObject(_n)&&_n.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach(([_n,Ce])=>{HttpStatusCode[Ce]=_n});function createInstance(_n){const Ce=new Axios(_n),ke=bind$1(Axios.prototype.request,Ce);return utils$1.extend(ke,Axios.prototype,Ce,{allOwnKeys:!0}),utils$1.extend(ke,Ce,null,{allOwnKeys:!0}),ke.create=function(Hn){return createInstance(mergeConfig(_n,Hn))},ke}const axios$1=createInstance(defaults$4);axios$1.Axios=Axios;axios$1.CanceledError=CanceledError;axios$1.CancelToken=CancelToken;axios$1.isCancel=isCancel;axios$1.VERSION=VERSION;axios$1.toFormData=toFormData;axios$1.AxiosError=AxiosError;axios$1.Cancel=axios$1.CanceledError;axios$1.all=function(Ce){return Promise.all(Ce)};axios$1.spread=spread;axios$1.isAxiosError=isAxiosError;axios$1.mergeConfig=mergeConfig;axios$1.AxiosHeaders=AxiosHeaders;axios$1.formToJSON=_n=>formDataToJSON(utils$1.isHTMLForm(_n)?new FormData(_n):_n);axios$1.getAdapter=adapters.getAdapter;axios$1.HttpStatusCode=HttpStatusCode;axios$1.default=axios$1;function loadHtmxFormsBehaviour(){document.querySelectorAll(".form").forEach(_n=>{initHtmxForm(_n)})}function initHtmxForm(_n){_n.addEventListener("htmx:responseError",ke=>{_n.querySelector(".form-errors").innerHTML=ke.detail.xhr.response});const Ce=_n.querySelector("form");Ce.getAttribute("hx-redirect")&&_n.addEventListener("htmx:afterOnLoad",ke=>{if(ke.detail.successful)return window.location.href=Ce.getAttribute("hx-redirect")})}loadHtmxFormsBehaviour();window.axios=axios$1;const axiosInstance=axios$1;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.axios.interceptors.request.use(function(_n){let Ce;Ce=document.querySelectorAll(".btn-spinner");for(let ke=0;ke_n;function assign(_n,Ce){for(const ke in Ce)_n[ke]=Ce[ke];return _n}function run(_n){return _n()}function blank_object(){return Object.create(null)}function run_all(_n){_n.forEach(run)}function is_function(_n){return typeof _n=="function"}function safe_not_equal(_n,Ce){return _n!=_n?Ce==Ce:_n!==Ce||_n&&typeof _n=="object"||typeof _n=="function"}let src_url_equal_anchor;function src_url_equal(_n,Ce){return _n===Ce?!0:(src_url_equal_anchor||(src_url_equal_anchor=document.createElement("a")),src_url_equal_anchor.href=Ce,_n===src_url_equal_anchor.href)}function is_empty(_n){return Object.keys(_n).length===0}function create_slot(_n,Ce,ke,$n){if(_n){const Hn=get_slot_context(_n,Ce,ke,$n);return _n[0](Hn)}}function get_slot_context(_n,Ce,ke,$n){return _n[1]&&$n?assign(ke.ctx.slice(),_n[1]($n(Ce))):ke.ctx}function get_slot_changes(_n,Ce,ke,$n){if(_n[2]&&$n){const Hn=_n[2]($n(ke));if(Ce.dirty===void 0)return Hn;if(typeof Hn=="object"){const zn=[],Un=Math.max(Ce.dirty.length,Hn.length);for(let qn=0;qn32){const Ce=[],ke=_n.ctx.length/32;for(let $n=0;$nwindow.performance.now():()=>Date.now(),raf=is_client?_n=>requestAnimationFrame(_n):noop;const tasks=new Set;function run_tasks(_n){tasks.forEach(Ce=>{Ce.c(_n)||(tasks.delete(Ce),Ce.f())}),tasks.size!==0&&raf(run_tasks)}function loop(_n){let Ce;return tasks.size===0&&raf(run_tasks),{promise:new Promise(ke=>{tasks.add(Ce={c:_n,f:ke})}),abort(){tasks.delete(Ce)}}}const globals=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function append(_n,Ce){_n.appendChild(Ce)}function get_root_for_style(_n){if(!_n)return document;const Ce=_n.getRootNode?_n.getRootNode():_n.ownerDocument;return Ce&&Ce.host?Ce:_n.ownerDocument}function append_empty_stylesheet(_n){const Ce=element("style");return Ce.textContent="/* empty */",append_stylesheet(get_root_for_style(_n),Ce),Ce.sheet}function append_stylesheet(_n,Ce){return append(_n.head||_n,Ce),Ce.sheet}function insert$1(_n,Ce,ke){_n.insertBefore(Ce,ke||null)}function detach(_n){_n.parentNode&&_n.parentNode.removeChild(_n)}function destroy_each(_n,Ce){for(let ke=0;ke<_n.length;ke+=1)_n[ke]&&_n[ke].d(Ce)}function element(_n){return document.createElement(_n)}function svg_element(_n){return document.createElementNS("http://www.w3.org/2000/svg",_n)}function text(_n){return document.createTextNode(_n)}function space$3(){return text(" ")}function empty$1(){return text("")}function listen(_n,Ce,ke,$n){return _n.addEventListener(Ce,ke,$n),()=>_n.removeEventListener(Ce,ke,$n)}function prevent_default(_n){return function(Ce){return Ce.preventDefault(),_n.call(this,Ce)}}function attr(_n,Ce,ke){ke==null?_n.removeAttribute(Ce):_n.getAttribute(Ce)!==ke&&_n.setAttribute(Ce,ke)}function set_custom_element_data(_n,Ce,ke){const $n=Ce.toLowerCase();$n in _n?_n[$n]=typeof _n[$n]=="boolean"&&ke===""?!0:ke:Ce in _n?_n[Ce]=typeof _n[Ce]=="boolean"&&ke===""?!0:ke:attr(_n,Ce,ke)}function init_binding_group(_n){let Ce;return{p(...ke){Ce=ke,Ce.forEach($n=>_n.push($n))},r(){Ce.forEach(ke=>_n.splice(_n.indexOf(ke),1))}}}function to_number(_n){return _n===""?null:+_n}function children(_n){return Array.from(_n.childNodes)}function set_data(_n,Ce){Ce=""+Ce,_n.data!==Ce&&(_n.data=Ce)}function set_input_value(_n,Ce){_n.value=Ce??""}function set_style(_n,Ce,ke,$n){ke==null?_n.style.removeProperty(Ce):_n.style.setProperty(Ce,ke,"")}function select_option(_n,Ce,ke){for(let $n=0;$n<_n.options.length;$n+=1){const Hn=_n.options[$n];if(Hn.__value===Ce){Hn.selected=!0;return}}(!ke||Ce!==void 0)&&(_n.selectedIndex=-1)}function select_value(_n){const Ce=_n.querySelector(":checked");return Ce&&Ce.__value}function toggle_class(_n,Ce,ke){_n.classList.toggle(Ce,!!ke)}function custom_event(_n,Ce,{bubbles:ke=!1,cancelable:$n=!1}={}){return new CustomEvent(_n,{detail:Ce,bubbles:ke,cancelable:$n})}function construct_svelte_component(_n,Ce){return new _n(Ce)}const managed_styles=new Map;let active=0;function hash$1(_n){let Ce=5381,ke=_n.length;for(;ke--;)Ce=(Ce<<5)-Ce^_n.charCodeAt(ke);return Ce>>>0}function create_style_information(_n,Ce){const ke={stylesheet:append_empty_stylesheet(Ce),rules:{}};return managed_styles.set(_n,ke),ke}function create_rule(_n,Ce,ke,$n,Hn,zn,Un,qn=0){const Xn=16.666/$n;let Kn=`{ +`;for(let So=0;So<=1;So+=Xn){const $o=Ce+(ke-Ce)*zn(So);Kn+=So*100+`%{${Un($o,1-$o)}} +`}const to=Kn+`100% {${Un(ke,1-ke)}} +}`,io=`__svelte_${hash$1(to)}_${qn}`,uo=get_root_for_style(_n),{stylesheet:ho,rules:bo}=managed_styles.get(uo)||create_style_information(uo,_n);bo[io]||(bo[io]=!0,ho.insertRule(`@keyframes ${io} ${to}`,ho.cssRules.length));const Oo=_n.style.animation||"";return _n.style.animation=`${Oo?`${Oo}, `:""}${io} ${$n}ms linear ${Hn}ms 1 both`,active+=1,io}function delete_rule(_n,Ce){const ke=(_n.style.animation||"").split(", "),$n=ke.filter(Ce?zn=>zn.indexOf(Ce)<0:zn=>zn.indexOf("__svelte")===-1),Hn=ke.length-$n.length;Hn&&(_n.style.animation=$n.join(", "),active-=Hn,active||clear_rules())}function clear_rules(){raf(()=>{active||(managed_styles.forEach(_n=>{const{ownerNode:Ce}=_n.stylesheet;Ce&&detach(Ce)}),managed_styles.clear())})}let current_component;function set_current_component(_n){current_component=_n}function get_current_component(){if(!current_component)throw new Error("Function called outside component initialization");return current_component}function onMount(_n){get_current_component().$$.on_mount.push(_n)}function afterUpdate(_n){get_current_component().$$.after_update.push(_n)}function onDestroy(_n){get_current_component().$$.on_destroy.push(_n)}function createEventDispatcher(){const _n=get_current_component();return(Ce,ke,{cancelable:$n=!1}={})=>{const Hn=_n.$$.callbacks[Ce];if(Hn){const zn=custom_event(Ce,ke,{cancelable:$n});return Hn.slice().forEach(Un=>{Un.call(_n,zn)}),!zn.defaultPrevented}return!0}}function setContext(_n,Ce){return get_current_component().$$.context.set(_n,Ce),Ce}function getContext$1(_n){return get_current_component().$$.context.get(_n)}function bubble(_n,Ce){const ke=_n.$$.callbacks[Ce.type];ke&&ke.slice().forEach($n=>$n.call(this,Ce))}const dirty_components=[],binding_callbacks=[];let render_callbacks=[];const flush_callbacks=[],resolved_promise=Promise.resolve();let update_scheduled=!1;function schedule_update(){update_scheduled||(update_scheduled=!0,resolved_promise.then(flush))}function add_render_callback(_n){render_callbacks.push(_n)}function add_flush_callback(_n){flush_callbacks.push(_n)}const seen_callbacks=new Set;let flushidx=0;function flush(){if(flushidx!==0)return;const _n=current_component;do{try{for(;flushidx_n.indexOf($n)===-1?Ce.push($n):ke.push($n)),ke.forEach($n=>$n()),render_callbacks=Ce}let promise;function wait(){return promise||(promise=Promise.resolve(),promise.then(()=>{promise=null})),promise}function dispatch(_n,Ce,ke){_n.dispatchEvent(custom_event(`${Ce?"intro":"outro"}${ke}`))}const outroing=new Set;let outros;function group_outros(){outros={r:0,c:[],p:outros}}function check_outros(){outros.r||run_all(outros.c),outros=outros.p}function transition_in(_n,Ce){_n&&_n.i&&(outroing.delete(_n),_n.i(Ce))}function transition_out(_n,Ce,ke,$n){if(_n&&_n.o){if(outroing.has(_n))return;outroing.add(_n),outros.c.push(()=>{outroing.delete(_n),$n&&(ke&&_n.d(1),$n())}),_n.o(Ce)}else $n&&$n()}const null_transition={duration:0};function create_bidirectional_transition(_n,Ce,ke,$n){let zn=Ce(_n,ke,{direction:"both"}),Un=$n?0:1,qn=null,Xn=null,Kn=null,to;function io(){Kn&&delete_rule(_n,Kn)}function uo(bo,Oo){const So=bo.b-Un;return Oo*=Math.abs(So),{a:Un,b:bo.b,d:So,duration:Oo,start:bo.start,end:bo.start+Oo,group:bo.group}}function ho(bo){const{delay:Oo=0,duration:So=300,easing:$o=identity,tick:Do=noop,css:xo}=zn||null_transition,Io={start:now()+Oo,b:bo};bo||(Io.group=outros,outros.r+=1),"inert"in _n&&(bo?to!==void 0&&(_n.inert=to):(to=_n.inert,_n.inert=!0)),qn||Xn?Xn=Io:(xo&&(io(),Kn=create_rule(_n,Un,bo,So,Oo,$o,xo)),bo&&Do(0,1),qn=uo(Io,So),add_render_callback(()=>dispatch(_n,bo,"start")),loop(Vo=>{if(Xn&&Vo>Xn.start&&(qn=uo(Xn,So),Xn=null,dispatch(_n,qn.b,"start"),xo&&(io(),Kn=create_rule(_n,Un,qn.b,qn.duration,0,$o,zn.css))),qn){if(Vo>=qn.end)Do(Un=qn.b,1-Un),dispatch(_n,qn.b,"end"),Xn||(qn.b?io():--qn.group.r||run_all(qn.group.c)),qn=null;else if(Vo>=qn.start){const Jo=Vo-qn.start;Un=qn.a+qn.d*$o(Jo/qn.duration),Do(Un,1-Un)}}return!!(qn||Xn)}))}return{run(bo){is_function(zn)?wait().then(()=>{zn=zn({direction:bo?"in":"out"}),ho(bo)}):ho(bo)},end(){io(),qn=Xn=null}}}function ensure_array_like(_n){return(_n==null?void 0:_n.length)!==void 0?_n:Array.from(_n)}function destroy_block(_n,Ce){_n.d(1),Ce.delete(_n.key)}function outro_and_destroy_block(_n,Ce){transition_out(_n,1,1,()=>{Ce.delete(_n.key)})}function update_keyed_each(_n,Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io){let uo=_n.length,ho=zn.length,bo=uo;const Oo={};for(;bo--;)Oo[_n[bo].key]=bo;const So=[],$o=new Map,Do=new Map,xo=[];for(bo=ho;bo--;){const Mo=io(Hn,zn,bo),Go=ke(Mo);let os=Un.get(Go);os?xo.push(()=>os.p(Mo,Ce)):(os=Kn(Go,Mo),os.c()),$o.set(Go,So[bo]=os),Go in Oo&&Do.set(Go,Math.abs(bo-Oo[Go]))}const Io=new Set,Vo=new Set;function Jo(Mo){transition_in(Mo,1),Mo.m(qn,to),Un.set(Mo.key,Mo),to=Mo.first,ho--}for(;uo&&ho;){const Mo=So[ho-1],Go=_n[uo-1],os=Mo.key,ms=Go.key;Mo===Go?(to=Mo.first,uo--,ho--):$o.has(ms)?!Un.has(os)||Io.has(os)?Jo(Mo):Vo.has(ms)?uo--:Do.get(os)>Do.get(ms)?(Vo.add(os),Jo(Mo)):(Io.add(ms),uo--):(Xn(Go,Un),uo--)}for(;uo--;){const Mo=_n[uo];$o.has(Mo.key)||Xn(Mo,Un)}for(;ho;)Jo(So[ho-1]);return run_all(xo),So}function get_spread_update(_n,Ce){const ke={},$n={},Hn={$$scope:1};let zn=_n.length;for(;zn--;){const Un=_n[zn],qn=Ce[zn];if(qn){for(const Xn in Un)Xn in qn||($n[Xn]=1);for(const Xn in qn)Hn[Xn]||(ke[Xn]=qn[Xn],Hn[Xn]=1);_n[zn]=qn}else for(const Xn in Un)Hn[Xn]=1}for(const Un in $n)Un in ke||(ke[Un]=void 0);return ke}function get_spread_object(_n){return typeof _n=="object"&&_n!==null?_n:{}}function bind(_n,Ce,ke){const $n=_n.$$.props[Ce];$n!==void 0&&(_n.$$.bound[$n]=ke,ke(_n.$$.ctx[$n]))}function create_component(_n){_n&&_n.c()}function mount_component(_n,Ce,ke){const{fragment:$n,after_update:Hn}=_n.$$;$n&&$n.m(Ce,ke),add_render_callback(()=>{const zn=_n.$$.on_mount.map(run).filter(is_function);_n.$$.on_destroy?_n.$$.on_destroy.push(...zn):run_all(zn),_n.$$.on_mount=[]}),Hn.forEach(add_render_callback)}function destroy_component(_n,Ce){const ke=_n.$$;ke.fragment!==null&&(flush_render_callbacks(ke.after_update),run_all(ke.on_destroy),ke.fragment&&ke.fragment.d(Ce),ke.on_destroy=ke.fragment=null,ke.ctx=[])}function make_dirty(_n,Ce){_n.$$.dirty[0]===-1&&(dirty_components.push(_n),schedule_update(),_n.$$.dirty.fill(0)),_n.$$.dirty[Ce/31|0]|=1<{const bo=ho.length?ho[0]:uo;return Kn.ctx&&Hn(Kn.ctx[io],Kn.ctx[io]=bo)&&(!Kn.skip_bound&&Kn.bound[io]&&Kn.bound[io](bo),to&&make_dirty(_n,io)),uo}):[],Kn.update(),to=!0,run_all(Kn.before_update),Kn.fragment=$n?$n(Kn.ctx):!1,Ce.target){if(Ce.hydrate){const io=children(Ce.target);Kn.fragment&&Kn.fragment.l(io),io.forEach(detach)}else Kn.fragment&&Kn.fragment.c();Ce.intro&&transition_in(_n.$$.fragment),mount_component(_n,Ce.target,Ce.anchor),flush()}set_current_component(Xn)}class SvelteComponent{constructor(){LY(this,"$$");LY(this,"$$set")}$destroy(){destroy_component(this,1),this.$destroy=noop}$on(Ce,ke){if(!is_function(ke))return noop;const $n=this.$$.callbacks[Ce]||(this.$$.callbacks[Ce]=[]);return $n.push(ke),()=>{const Hn=$n.indexOf(ke);Hn!==-1&&$n.splice(Hn,1)}}$set(Ce){this.$$set&&!is_empty(Ce)&&(this.$$.skip_bound=!0,this.$$set(Ce),this.$$.skip_bound=!1)}}const PUBLIC_VERSION="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(PUBLIC_VERSION);function create_if_block$Y(_n){let Ce,ke,$n,Hn,zn;return{c(){Ce=element("div"),ke=element("div"),ke.textContent="Submission Errors",$n=space$3(),Hn=element("div"),zn=text(_n[0]),attr(ke,"class","title"),attr(Hn,"class","content"),attr(Ce,"class","notice notice-error"),attr(Ce,"role","alert")},m(Un,qn){insert$1(Un,Ce,qn),append(Ce,ke),append(Ce,$n),append(Ce,Hn),append(Hn,zn)},p(Un,qn){qn&1&&set_data(zn,Un[0])},d(Un){Un&&detach(Ce)}}}function create_fragment$1t(_n){let Ce,ke=_n[0]&&create_if_block$Y(_n);return{c(){ke&&ke.c(),Ce=empty$1()},m($n,Hn){ke&&ke.m($n,Hn),insert$1($n,Ce,Hn)},p($n,[Hn]){$n[0]?ke?ke.p($n,Hn):(ke=create_if_block$Y($n),ke.c(),ke.m(Ce.parentNode,Ce)):ke&&(ke.d(1),ke=null)},i:noop,o:noop,d($n){$n&&detach(Ce),ke&&ke.d($n)}}}function instance$1t(_n,Ce,ke){let{message:$n=""}=Ce;return _n.$$set=Hn=>{"message"in Hn&&ke(0,$n=Hn.message)},[$n]}class ErrorAlert extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1t,create_fragment$1t,safe_not_equal,{message:0})}}function create_fragment$1s(_n){let Ce,ke,$n,Hn;return{c(){Ce=element("button"),ke=element("span"),$n=space$3(),Hn=text(_n[0]),attr(ke,"class","spinner-border spinner-border-sm"),attr(ke,"role","status"),attr(ke,"aria-hidden","true"),attr(Ce,"type","submit"),attr(Ce,"class","button secondary btn-spinner"),Ce.disabled=_n[1]},m(zn,Un){insert$1(zn,Ce,Un),append(Ce,ke),append(Ce,$n),append(Ce,Hn)},p(zn,[Un]){Un&1&&set_data(Hn,zn[0]),Un&2&&(Ce.disabled=zn[1])},i:noop,o:noop,d(zn){zn&&detach(Ce)}}}function instance$1s(_n,Ce,ke){let{label:$n=""}=Ce,{disabled:Hn=!1}=Ce;return _n.$$set=zn=>{"label"in zn&&ke(0,$n=zn.label),"disabled"in zn&&ke(1,Hn=zn.disabled)},[$n,Hn]}class SpinnerButton extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1s,create_fragment$1s,safe_not_equal,{label:0,disabled:1})}}function create_fragment$1r(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo,So,$o,Do,xo;return ke=new ErrorAlert({props:{message:_n[2]}}),So=new SpinnerButton({props:{label:"Register"}}),{c(){Ce=element("div"),create_component(ke.$$.fragment),$n=space$3(),Hn=element("form"),zn=element("div"),Un=element("label"),Un.textContent="Name",qn=space$3(),Xn=element("input"),Kn=space$3(),to=element("div"),io=element("label"),io.textContent="Email address",uo=space$3(),ho=element("input"),bo=space$3(),Oo=element("div"),create_component(So.$$.fragment),attr(Un,"for","name"),attr(Un,"class","form-label"),attr(Xn,"type","text"),attr(Xn,"class","form-control"),attr(Xn,"id","name"),attr(zn,"class","mb-3"),attr(io,"for","email"),attr(io,"class","form-label"),attr(ho,"type","email"),attr(ho,"class","form-control"),attr(ho,"id","email"),attr(to,"class","mb-3"),attr(Oo,"class","text-center mt-5 d-block"),attr(Ce,"class","wrapper-tiny")},m(Io,Vo){insert$1(Io,Ce,Vo),mount_component(ke,Ce,null),append(Ce,$n),append(Ce,Hn),append(Hn,zn),append(zn,Un),append(zn,qn),append(zn,Xn),set_input_value(Xn,_n[1]),append(Hn,Kn),append(Hn,to),append(to,io),append(to,uo),append(to,ho),set_input_value(ho,_n[0]),append(Hn,bo),append(Hn,Oo),mount_component(So,Oo,null),$o=!0,Do||(xo=[listen(Xn,"input",_n[4]),listen(ho,"input",_n[5]),listen(Hn,"submit",_n[3])],Do=!0)},p(Io,[Vo]){const Jo={};Vo&4&&(Jo.message=Io[2]),ke.$set(Jo),Vo&2&&Xn.value!==Io[1]&&set_input_value(Xn,Io[1]),Vo&1&&ho.value!==Io[0]&&set_input_value(ho,Io[0])},i(Io){$o||(transition_in(ke.$$.fragment,Io),transition_in(So.$$.fragment,Io),$o=!0)},o(Io){transition_out(ke.$$.fragment,Io),transition_out(So.$$.fragment,Io),$o=!1},d(Io){Io&&detach(Ce),destroy_component(ke),destroy_component(So),Do=!1,run_all(xo)}}}function instance$1r(_n,Ce,ke){const $n=getContext$1("channel");let Hn="",{email:zn=""}=Ce,Un="";function qn(to){to.preventDefault(),ke(2,Un=""),axios.post($n.lucentUrl+"/register",{name:Hn,email:zn}).then(()=>{window.location=$n.lucentUrl+"/login"}).catch(io=>{var uo;ke(2,Un=(uo=io.response)==null?void 0:uo.data.error),console.log({errorMessage:Un})})}function Xn(){Hn=this.value,ke(1,Hn)}function Kn(){zn=this.value,ke(0,zn)}return _n.$$set=to=>{"email"in to&&ke(0,zn=to.email)},[zn,Hn,Un,qn,Xn,Kn]}class Register extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1r,create_fragment$1r,safe_not_equal,{email:0})}}function create_else_block$o(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io;return Xn=new SpinnerButton({props:{label:"Login"}}),{c(){Ce=element("form"),ke=element("div"),$n=element("label"),$n.textContent="Email address",Hn=space$3(),zn=element("input"),Un=space$3(),qn=element("div"),create_component(Xn.$$.fragment),attr($n,"for","emailaddress"),attr($n,"class","form-label"),attr(zn,"type","email"),attr(zn,"class","form-control"),attr(zn,"id","emailaddress"),zn.required=!0,attr(ke,"class","mb-3"),attr(qn,"class","text-center mt-5 d-block")},m(uo,ho){insert$1(uo,Ce,ho),append(Ce,ke),append(ke,$n),append(ke,Hn),append(ke,zn),set_input_value(zn,_n[0]),append(Ce,Un),append(Ce,qn),mount_component(Xn,qn,null),Kn=!0,to||(io=[listen(zn,"input",_n[3]),listen(Ce,"submit",_n[2])],to=!0)},p(uo,ho){ho&1&&zn.value!==uo[0]&&set_input_value(zn,uo[0])},i(uo){Kn||(transition_in(Xn.$$.fragment,uo),Kn=!0)},o(uo){transition_out(Xn.$$.fragment,uo),Kn=!1},d(uo){uo&&detach(Ce),destroy_component(Xn),to=!1,run_all(io)}}}function create_if_block$X(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[1]),attr(Ce,"class","alert alert-info"),attr(Ce,"role","alert")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,Hn){Hn&2&&set_data(ke,$n[1])},i:noop,o:noop,d($n){$n&&detach(Ce)}}}function create_fragment$1q(_n){let Ce,ke,$n,Hn;const zn=[create_if_block$X,create_else_block$o],Un=[];function qn(Xn,Kn){return Xn[1]?0:1}return ke=qn(_n),$n=Un[ke]=zn[ke](_n),{c(){Ce=element("div"),$n.c(),attr(Ce,"class","wrapper-tiny")},m(Xn,Kn){insert$1(Xn,Ce,Kn),Un[ke].m(Ce,null),Hn=!0},p(Xn,[Kn]){let to=ke;ke=qn(Xn),ke===to?Un[ke].p(Xn,Kn):(group_outros(),transition_out(Un[to],1,1,()=>{Un[to]=null}),check_outros(),$n=Un[ke],$n?$n.p(Xn,Kn):($n=Un[ke]=zn[ke](Xn),$n.c()),transition_in($n,1),$n.m(Ce,null))},i(Xn){Hn||(transition_in($n),Hn=!0)},o(Xn){transition_out($n),Hn=!1},d(Xn){Xn&&detach(Ce),Un[ke].d()}}}function instance$1q(_n,Ce,ke){const $n=getContext$1("channel");let Hn="",zn="";function Un(Xn){Xn.preventDefault(),axios.post($n.lucentUrl+"/login",{email:Hn}).then(Kn=>{console.log(Kn),ke(1,zn="You will receive an email with a login link")}).catch(Kn=>{})}function qn(){Hn=this.value,ke(0,Hn)}return[Hn,zn,Un,qn]}class Login extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1q,create_fragment$1q,safe_not_equal,{})}}function cubicOut(_n){const Ce=_n-1;return Ce*Ce*Ce+1}function fly(_n,{delay:Ce=0,duration:ke=400,easing:$n=cubicOut,x:Hn=0,y:zn=0,opacity:Un=0}={}){const qn=getComputedStyle(_n),Xn=+qn.opacity,Kn=qn.transform==="none"?"":qn.transform,to=Xn*(1-Un),[io,uo]=split_css_unit(Hn),[ho,bo]=split_css_unit(zn);return{delay:Ce,duration:ke,easing:$n,css:(Oo,So)=>` + transform: ${Kn} translate(${(1-Oo)*io}${uo}, ${(1-Oo)*ho}${bo}); + opacity: ${Xn-to*So}`}}function create_if_block$W(_n){let Ce,ke,$n,Hn,zn,Un,qn;return{c(){Ce=element("div"),ke=element("div"),ke.textContent="Success",$n=space$3(),Hn=element("div"),zn=text(_n[1]),attr(ke,"class","title"),attr(Hn,"class","content"),attr(Ce,"class","notice notice-success"),attr(Ce,"role","alert")},m(Xn,Kn){insert$1(Xn,Ce,Kn),append(Ce,ke),append(Ce,$n),append(Ce,Hn),append(Hn,zn),qn=!0},p(Xn,Kn){(!qn||Kn&2)&&set_data(zn,Xn[1])},i(Xn){qn||(Xn&&add_render_callback(()=>{qn&&(Un||(Un=create_bidirectional_transition(Ce,fly,{duration:500},!0)),Un.run(1))}),qn=!0)},o(Xn){Xn&&(Un||(Un=create_bidirectional_transition(Ce,fly,{duration:500},!1)),Un.run(0)),qn=!1},d(Xn){Xn&&detach(Ce),Xn&&Un&&Un.end()}}}function create_fragment$1p(_n){let Ce,ke=_n[0]&&create_if_block$W(_n);return{c(){ke&&ke.c(),Ce=empty$1()},m($n,Hn){ke&&ke.m($n,Hn),insert$1($n,Ce,Hn)},p($n,[Hn]){$n[0]?ke?(ke.p($n,Hn),Hn&1&&transition_in(ke,1)):(ke=create_if_block$W($n),ke.c(),transition_in(ke,1),ke.m(Ce.parentNode,Ce)):ke&&(group_outros(),transition_out(ke,1,1,()=>{ke=null}),check_outros())},i($n){transition_in(ke)},o($n){transition_out(ke)},d($n){$n&&detach(Ce),ke&&ke.d($n)}}}function instance$1p(_n,Ce,ke){let $n,Hn;function zn(Un="Saved"){ke(1,$n=Un),ke(0,Hn=!0),setTimeout(function(){ke(0,Hn=!1)},2e3)}return ke(1,$n="Saved"),ke(0,Hn=!1),[Hn,$n,zn]}class SuccessAlert extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1p,create_fragment$1p,safe_not_equal,{show:2})}get show(){return this.$$.ctx[2]}}function create_fragment$1o(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo={};return Ce=new SuccessAlert({props:Oo}),_n[4](Ce),io=new SpinnerButton({props:{label:"Enter"}}),{c(){create_component(Ce.$$.fragment),ke=space$3(),$n=element("div"),Hn=element("form"),zn=element("div"),Un=element("h3"),qn=text("Login as "),Xn=text(_n[0]),Kn=space$3(),to=element("div"),create_component(io.$$.fragment),attr(zn,"class","mb-3 text-center"),attr(to,"class","text-center mt-5 d-block"),attr($n,"class","wrapper-tiny")},m(So,$o){mount_component(Ce,So,$o),insert$1(So,ke,$o),insert$1(So,$n,$o),append($n,Hn),append(Hn,zn),append(zn,Un),append(Un,qn),append(Un,Xn),append(Hn,Kn),append(Hn,to),mount_component(io,to,null),uo=!0,ho||(bo=listen(Hn,"submit",_n[2]),ho=!0)},p(So,[$o]){const Do={};Ce.$set(Do),(!uo||$o&1)&&set_data(Xn,So[0])},i(So){uo||(transition_in(Ce.$$.fragment,So),transition_in(io.$$.fragment,So),uo=!0)},o(So){transition_out(Ce.$$.fragment,So),transition_out(io.$$.fragment,So),uo=!1},d(So){So&&(detach(ke),detach($n)),_n[4](null),destroy_component(Ce,So),destroy_component(io),ho=!1,bo()}}}function instance$1o(_n,Ce,ke){const $n=getContext$1("channel");let{email:Hn}=Ce,{token:zn}=Ce,Un;function qn(Kn){Kn.preventDefault(),axios.post($n.lucentUrl+"/verify",{email:Hn,token:zn}).then(to=>{window.location=$n.lucentUrl}).catch(to=>{})}function Xn(Kn){binding_callbacks[Kn?"unshift":"push"](()=>{Un=Kn,ke(1,Un)})}return _n.$$set=Kn=>{"email"in Kn&&ke(0,Hn=Kn.email),"token"in Kn&&ke(3,zn=Kn.token)},[Hn,Un,qn,zn,Xn]}class Verify extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1o,create_fragment$1o,safe_not_equal,{email:0,token:3})}}function create_fragment$1n(_n){let Ce,ke,$n;return{c(){Ce=element("div"),ke=element("div"),$n=text(_n[2]),attr(ke,"class","avatar__letters"),attr(Ce,"class","avatar"),attr(Ce,"title",_n[0]),set_style(Ce,"background-color",_n[3][_n[4]]),set_style(Ce,"height",_n[1]+"px"),set_style(Ce,"width",_n[1]+"px"),set_style(Ce,"font-size",_n[1]/2+"px")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,ke),append(ke,$n)},p(Hn,[zn]){zn&4&&set_data($n,Hn[2]),zn&1&&attr(Ce,"title",Hn[0]),zn&2&&set_style(Ce,"height",Hn[1]+"px"),zn&2&&set_style(Ce,"width",Hn[1]+"px"),zn&2&&set_style(Ce,"font-size",Hn[1]/2+"px")},i:noop,o:noop,d(Hn){Hn&&detach(Ce)}}}function instance$1n(_n,Ce,ke){let{name:$n}=Ce,{side:Hn=48}=Ce;const zn=["#00AA55","#009FD4","#B381B3","#939393","#E3BC00","#D47500","#DC2A2A","#3ede91","#377dd4","#0256b0","#053d82","#3d026e","#b378e3","#c4065c","#543208","#d97811","#0c6b40"];let Un="";$n.split(" ").length>1?Un=$n.split(" ")[0].charAt(0).toUpperCase()+$n.split(" ")[1].charAt(0).toUpperCase():Un=$n.split(" ")[0].charAt(0).toUpperCase()+$n.split(" ")[0].charAt(1).toUpperCase();let Xn=($n.charCodeAt(1)+$n.length)%19;return _n.$$set=Kn=>{"name"in Kn&&ke(0,$n=Kn.name),"side"in Kn&&ke(1,Hn=Kn.side)},[$n,Hn,Un,zn,Xn]}class Avatar extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1n,create_fragment$1n,safe_not_equal,{name:0,side:1})}}function create_fragment$1m(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo,So,$o,Do,xo,Io,Vo,Jo,Mo,Go,os,ms;ke=new ErrorAlert({props:{message:_n[2]}});let is={};return Hn=new SuccessAlert({props:is}),_n[8](Hn),qn=new Avatar({props:{name:_n[4].name}}),ho=new SpinnerButton({props:{label:"Update Name"}}),xo=new SpinnerButton({props:{label:"Update Email"}}),{c(){Ce=element("div"),create_component(ke.$$.fragment),$n=space$3(),create_component(Hn.$$.fragment),zn=space$3(),Un=element("h3"),create_component(qn.$$.fragment),Xn=space$3(),Kn=element("form"),to=element("div"),io=element("input"),uo=space$3(),create_component(ho.$$.fragment),bo=space$3(),Oo=element("form"),So=element("div"),$o=element("input"),Do=space$3(),create_component(xo.$$.fragment),Io=space$3(),Vo=element("div"),Jo=element("a"),Mo=text(`Logout from this + device`),attr(Un,"class","header-small mb-5"),attr(io,"type","text"),attr(io,"class","form-control mb-3"),attr(io,"placeholder","Name"),io.required=!0,attr(to,"class","input-group mb-5"),attr($o,"type","email"),attr($o,"class","form-control mb-3"),attr($o,"placeholder","Email"),$o.required=!0,attr(So,"class","input-group mb-5"),attr(Jo,"class","list-group-item list-group-item-action"),attr(Jo,"href",_n[5].lucentUrl+"/logout"),attr(Vo,"class","list-group"),attr(Ce,"class","wrapper-tiny")},m(Yo,Ys){insert$1(Yo,Ce,Ys),mount_component(ke,Ce,null),append(Ce,$n),mount_component(Hn,Ce,null),append(Ce,zn),append(Ce,Un),mount_component(qn,Un,null),append(Ce,Xn),append(Ce,Kn),append(Kn,to),append(to,io),set_input_value(io,_n[0]),append(to,uo),mount_component(ho,to,null),append(Ce,bo),append(Ce,Oo),append(Oo,So),append(So,$o),set_input_value($o,_n[1]),append(So,Do),mount_component(xo,So,null),append(Ce,Io),append(Ce,Vo),append(Vo,Jo),append(Jo,Mo),Go=!0,os||(ms=[listen(io,"input",_n[9]),listen(Kn,"submit",_n[6]),listen($o,"input",_n[10]),listen(Oo,"submit",_n[7])],os=!0)},p(Yo,[Ys]){const sr={};Ys&4&&(sr.message=Yo[2]),ke.$set(sr);const Js={};Hn.$set(Js),Ys&1&&io.value!==Yo[0]&&set_input_value(io,Yo[0]),Ys&2&&$o.value!==Yo[1]&&set_input_value($o,Yo[1])},i(Yo){Go||(transition_in(ke.$$.fragment,Yo),transition_in(Hn.$$.fragment,Yo),transition_in(qn.$$.fragment,Yo),transition_in(ho.$$.fragment,Yo),transition_in(xo.$$.fragment,Yo),Go=!0)},o(Yo){transition_out(ke.$$.fragment,Yo),transition_out(Hn.$$.fragment,Yo),transition_out(qn.$$.fragment,Yo),transition_out(ho.$$.fragment,Yo),transition_out(xo.$$.fragment,Yo),Go=!1},d(Yo){Yo&&detach(Ce),destroy_component(ke),_n[8](null),destroy_component(Hn),destroy_component(qn),destroy_component(ho),destroy_component(xo),os=!1,run_all(ms)}}}function instance$1m(_n,Ce,ke){const $n=getContext$1("user"),Hn=getContext$1("channel");let zn=$n.name,Un=$n.email,qn="",Xn;function Kn(bo){bo.preventDefault(),ke(2,qn=""),axios.post(Hn.lucentUrl+"/account/update-name",{name:zn}).then(Oo=>{Xn.show()}).catch(Oo=>{var So;ke(2,qn=(So=Oo.response)==null?void 0:So.data.error),console.log({errorMessage:qn})})}function to(bo){bo.preventDefault(),ke(2,qn=""),axios.post(Hn.lucentUrl+"/account/update-email",{email:Un}).then(Oo=>{Xn.show()}).catch(Oo=>{var So;ke(2,qn=(So=Oo.response)==null?void 0:So.data.error),console.log({errorMessage:qn})})}function io(bo){binding_callbacks[bo?"unshift":"push"](()=>{Xn=bo,ke(3,Xn)})}function uo(){zn=this.value,ke(0,zn)}function ho(){Un=this.value,ke(1,Un)}return[zn,Un,qn,Xn,$n,Hn,Kn,to,io,uo,ho]}class Profile extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1m,create_fragment$1m,safe_not_equal,{})}}function create_fragment$1l(_n){let Ce,ke=_n[5].path+"";return{c(){Ce=svg_element("svg"),attr(Ce,"class","bi svelte-r4pd9j"),attr(Ce,"xmlns","http://www.w3.org/2000/svg"),attr(Ce,"width",_n[0]),attr(Ce,"height",_n[1]),attr(Ce,"viewBox",_n[5].viewBox),attr(Ce,"aria-labelledby",_n[2]),attr(Ce,"role","presentation"),attr(Ce,"stroke",_n[4]),attr(Ce,"fill",_n[3])},m($n,Hn){insert$1($n,Ce,Hn),Ce.innerHTML=ke},p($n,[Hn]){Hn&1&&attr(Ce,"width",$n[0]),Hn&2&&attr(Ce,"height",$n[1]),Hn&4&&attr(Ce,"aria-labelledby",$n[2]),Hn&16&&attr(Ce,"stroke",$n[4]),Hn&8&&attr(Ce,"fill",$n[3])},i:noop,o:noop,d($n){$n&&detach(Ce)}}}function instance$1l(_n,Ce,ke){const $n={"trash-can":{path:'',viewBox:"0 0 448 512"},"circle-chevron-down":{path:'',viewBox:"0 0 512 512"},"circle-chevron-up":{path:'',viewBox:"0 0 512 512"},ellipsis:{path:'',viewBox:"0 0 448 512"},"ellipsis-vertical":{path:'',viewBox:"0 0 128 512"},"angles-down":{path:'',viewBox:"0 0 384 512"},"angle-right":{path:'',viewBox:"0 0 256 512"},"photo-film":{path:'',viewBox:"0 0 640 512"},file:{path:'',viewBox:"0 0 384 512"},"circle-info":{path:'',viewBox:"0 0 512 512"},"table-columns":{path:'',viewBox:"0 0 512 512"},"arrow-down-a-z":{path:'',viewBox:"0 0 512 512"},"arrow-up-short-wide":{path:'',viewBox:"0 0 576 512"},"arrow-down-wide-short":{path:'',viewBox:"0 0 576 512"},filter:{path:'',viewBox:"0 0 512 512"},calendar:{path:'',viewBox:"0 0 448 512"},pencil:{path:'',viewBox:"0 0 512 512"},database:{path:'',viewBox:"0 0 448 512"},dice:{path:'',viewBox:"0 0 640 512"},"triangle-exclamation":{path:'',viewBox:"0 0 512 512"},eye:{path:'',viewBox:"0 0 576 512"},"circle-plus":{path:'',viewBox:"0 0 512 512"},"magnifying-glass":{path:'',viewBox:"0 0 512 512"},expand:{path:'',viewBox:"0 0 448 512"},compress:{path:'',viewBox:"0 0 448 512"},check:{path:'',viewBox:"0 0 448 512"},close:{path:'',viewBox:"0 0 24 24"},"arrow-left":{path:'',viewBox:"0 0 24 24"},list:{path:'',viewBox:"0 0 24 24"},"ordered-list":{path:'',viewBox:"0 0 24 24"},italic:{path:'',viewBox:"0 0 24 24"}};let{width:Hn=16}=Ce,{height:zn=16}=Ce,{icon:Un=""}=Ce,{fill:qn="currentColor"}=Ce,{stroke:Xn="currentColor"}=Ce,Kn=$n[Un];return _n.$$set=to=>{"width"in to&&ke(0,Hn=to.width),"height"in to&&ke(1,zn=to.height),"icon"in to&&ke(2,Un=to.icon),"fill"in to&&ke(3,qn=to.fill),"stroke"in to&&ke(4,Xn=to.stroke)},[Hn,zn,Un,qn,Xn,Kn]}class Icon extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1l,create_fragment$1l,safe_not_equal,{width:0,height:1,icon:2,fill:3,stroke:4})}}function create_else_block$n(_n){let Ce,ke;return Ce=new Icon({props:{icon:"close"}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_if_block$V(_n){let Ce,ke;return Ce=new Icon({props:{icon:"check"}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_fragment$1k(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn=_n[0].name+"",Kn,to,io,uo,ho,bo,Oo=_n[0].instructions+"",So,$o,Do;const xo=[create_if_block$V,create_else_block$n],Io=[];function Vo(Jo,Mo){return Jo[0].status==="success"?0:1}return $n=Vo(_n),Hn=Io[$n]=xo[$n](_n),{c(){Ce=element("div"),ke=element("div"),Hn.c(),zn=space$3(),Un=element("div"),qn=element("h4"),Kn=text(Xn),to=space$3(),io=element("details"),uo=element("summary"),uo.textContent="Instuctions",ho=space$3(),bo=element("code"),So=text(Oo),attr(ke,"class","step-icon svelte-igosv7"),attr(bo,"class","instructions svelte-igosv7"),attr(io,"class","svelte-igosv7"),set_style(Un,"width","100%"),attr(Ce,"class",$o="step step-"+_n[0].status+" svelte-igosv7")},m(Jo,Mo){insert$1(Jo,Ce,Mo),append(Ce,ke),Io[$n].m(ke,null),append(Ce,zn),append(Ce,Un),append(Un,qn),append(qn,Kn),append(Un,to),append(Un,io),append(io,uo),append(io,ho),append(io,bo),append(bo,So),Do=!0},p(Jo,[Mo]){let Go=$n;$n=Vo(Jo),$n!==Go&&(group_outros(),transition_out(Io[Go],1,1,()=>{Io[Go]=null}),check_outros(),Hn=Io[$n],Hn||(Hn=Io[$n]=xo[$n](Jo),Hn.c()),transition_in(Hn,1),Hn.m(ke,null)),(!Do||Mo&1)&&Xn!==(Xn=Jo[0].name+"")&&set_data(Kn,Xn),(!Do||Mo&1)&&Oo!==(Oo=Jo[0].instructions+"")&&set_data(So,Oo),(!Do||Mo&1&&$o!==($o="step step-"+Jo[0].status+" svelte-igosv7"))&&attr(Ce,"class",$o)},i(Jo){Do||(transition_in(Hn),Do=!0)},o(Jo){transition_out(Hn),Do=!1},d(Jo){Jo&&detach(Ce),Io[$n].d()}}}function instance$1k(_n,Ce,ke){let{step:$n}=Ce;return _n.$$set=Hn=>{"step"in Hn&&ke(0,$n=Hn.step)},[$n]}class Step extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1k,create_fragment$1k,safe_not_equal,{step:0})}}function get_each_context$r(_n,Ce,ke){const $n=_n.slice();return $n[2]=Ce[ke],$n}function create_each_block$r(_n){let Ce,ke;return Ce=new Step({props:{step:_n[2]}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&1&&(zn.step=$n[2]),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_if_block$U(_n){let Ce;return{c(){Ce=element("a"),Ce.textContent="Create the first user",attr(Ce,"href","/lucent/register"),attr(Ce,"class","bt")},m(ke,$n){insert$1(ke,Ce,$n)},d(ke){ke&&detach(Ce)}}}function create_fragment$1j(_n){let Ce,ke,$n,Hn,zn=ensure_array_like(_n[0]),Un=[];for(let Kn=0;Kntransition_out(Un[Kn],1,1,()=>{Un[Kn]=null});let Xn=_n[1]&&create_if_block$U();return{c(){Ce=element("div");for(let Kn=0;Kn{"steps"in zn&&ke(0,$n=zn.steps),"allSuccess"in zn&&ke(1,Hn=zn.allSuccess)},[$n,Hn]}let Index$2=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1j,create_fragment$1j,safe_not_equal,{steps:0,allSuccess:1})}};function create_fragment$1i(_n){let Ce,ke,$n,Hn=(_n[3].name??"Lucent Setup")+"",zn,Un,qn,Xn,Kn,to;const io=[{title:_n[0]},_n[2]];var uo=_n[4][_n[1]];function ho(bo,Oo){let So={};for(let $o=0;$o{destroy_component(So,1)}),check_outros()}uo?(Kn=construct_svelte_component(uo,ho(bo,Oo)),create_component(Kn.$$.fragment),transition_in(Kn.$$.fragment,1),mount_component(Kn,Xn,null)):Kn=null}else if(uo){const So=Oo&5?get_spread_update(io,[Oo&1&&{title:bo[0]},Oo&4&&get_spread_object(bo[2])]):{};Kn.$set(So)}},i(bo){to||(Kn&&transition_in(Kn.$$.fragment,bo),to=!0)},o(bo){Kn&&transition_out(Kn.$$.fragment,bo),to=!1},d(bo){bo&&(detach(Ce),detach(qn),detach(Xn)),Kn&&destroy_component(Kn)}}}function instance$1i(_n,Ce,ke){const $n={register:Register,login:Login,verify:Verify,profile:Profile,setup:Index$2};let{title:Hn}=Ce,{view:zn}=Ce,{user:Un}=Ce,{data:qn}=Ce,{channel:Xn}=Ce;return setContext("channel",Xn),setContext("user",Un),_n.$$set=Kn=>{"title"in Kn&&ke(0,Hn=Kn.title),"view"in Kn&&ke(1,zn=Kn.view),"user"in Kn&&ke(5,Un=Kn.user),"data"in Kn&&ke(2,qn=Kn.data),"channel"in Kn&&ke(3,Xn=Kn.channel)},[Hn,zn,qn,Xn,$n,Un]}class Account extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1i,create_fragment$1i,safe_not_equal,{title:0,view:1,user:5,data:2,channel:3})}}function toDate(_n){const Ce=Object.prototype.toString.call(_n);return _n instanceof Date||typeof _n=="object"&&Ce==="[object Date]"?new _n.constructor(+_n):typeof _n=="number"||Ce==="[object Number]"||typeof _n=="string"||Ce==="[object String]"?new Date(_n):new Date(NaN)}function constructFrom(_n,Ce){return _n instanceof Date?new _n.constructor(Ce):new Date(Ce)}const millisecondsInWeek=6048e5,millisecondsInDay=864e5,minutesInMonth=43200,minutesInDay=1440;let defaultOptions={};function getDefaultOptions(){return defaultOptions}function startOfWeek(_n,Ce){var qn,Xn,Kn,to;const ke=getDefaultOptions(),$n=(Ce==null?void 0:Ce.weekStartsOn)??((Xn=(qn=Ce==null?void 0:Ce.locale)==null?void 0:qn.options)==null?void 0:Xn.weekStartsOn)??ke.weekStartsOn??((to=(Kn=ke.locale)==null?void 0:Kn.options)==null?void 0:to.weekStartsOn)??0,Hn=toDate(_n),zn=Hn.getDay(),Un=(zn<$n?7:0)+zn-$n;return Hn.setDate(Hn.getDate()-Un),Hn.setHours(0,0,0,0),Hn}function startOfISOWeek(_n){return startOfWeek(_n,{weekStartsOn:1})}function getISOWeekYear(_n){const Ce=toDate(_n),ke=Ce.getFullYear(),$n=constructFrom(_n,0);$n.setFullYear(ke+1,0,4),$n.setHours(0,0,0,0);const Hn=startOfISOWeek($n),zn=constructFrom(_n,0);zn.setFullYear(ke,0,4),zn.setHours(0,0,0,0);const Un=startOfISOWeek(zn);return Ce.getTime()>=Hn.getTime()?ke+1:Ce.getTime()>=Un.getTime()?ke:ke-1}function startOfDay(_n){const Ce=toDate(_n);return Ce.setHours(0,0,0,0),Ce}function getTimezoneOffsetInMilliseconds(_n){const Ce=toDate(_n),ke=new Date(Date.UTC(Ce.getFullYear(),Ce.getMonth(),Ce.getDate(),Ce.getHours(),Ce.getMinutes(),Ce.getSeconds(),Ce.getMilliseconds()));return ke.setUTCFullYear(Ce.getFullYear()),+_n-+ke}function differenceInCalendarDays(_n,Ce){const ke=startOfDay(_n),$n=startOfDay(Ce),Hn=+ke-getTimezoneOffsetInMilliseconds(ke),zn=+$n-getTimezoneOffsetInMilliseconds($n);return Math.round((Hn-zn)/millisecondsInDay)}function startOfISOWeekYear(_n){const Ce=getISOWeekYear(_n),ke=constructFrom(_n,0);return ke.setFullYear(Ce,0,4),ke.setHours(0,0,0,0),startOfISOWeek(ke)}function compareAsc(_n,Ce){const ke=toDate(_n),$n=toDate(Ce),Hn=ke.getTime()-$n.getTime();return Hn<0?-1:Hn>0?1:Hn}function constructNow(_n){return constructFrom(_n,Date.now())}function isDate(_n){return _n instanceof Date||typeof _n=="object"&&Object.prototype.toString.call(_n)==="[object Date]"}function isValid(_n){if(!isDate(_n)&&typeof _n!="number")return!1;const Ce=toDate(_n);return!isNaN(Number(Ce))}function differenceInCalendarMonths(_n,Ce){const ke=toDate(_n),$n=toDate(Ce),Hn=ke.getFullYear()-$n.getFullYear(),zn=ke.getMonth()-$n.getMonth();return Hn*12+zn}function getRoundingMethod(_n){return Ce=>{const $n=(_n?Math[_n]:Math.trunc)(Ce);return $n===0?0:$n}}function differenceInMilliseconds(_n,Ce){return+toDate(_n)-+toDate(Ce)}function endOfDay(_n){const Ce=toDate(_n);return Ce.setHours(23,59,59,999),Ce}function endOfMonth(_n){const Ce=toDate(_n),ke=Ce.getMonth();return Ce.setFullYear(Ce.getFullYear(),ke+1,0),Ce.setHours(23,59,59,999),Ce}function isLastDayOfMonth(_n){const Ce=toDate(_n);return+endOfDay(Ce)==+endOfMonth(Ce)}function differenceInMonths(_n,Ce){const ke=toDate(_n),$n=toDate(Ce),Hn=compareAsc(ke,$n),zn=Math.abs(differenceInCalendarMonths(ke,$n));let Un;if(zn<1)Un=0;else{ke.getMonth()===1&&ke.getDate()>27&&ke.setDate(30),ke.setMonth(ke.getMonth()-Hn*zn);let qn=compareAsc(ke,$n)===-Hn;isLastDayOfMonth(toDate(_n))&&zn===1&&compareAsc(_n,$n)===1&&(qn=!1),Un=Hn*(zn-Number(qn))}return Un===0?0:Un}function differenceInSeconds(_n,Ce,ke){const $n=differenceInMilliseconds(_n,Ce)/1e3;return getRoundingMethod(ke==null?void 0:ke.roundingMethod)($n)}function startOfYear(_n){const Ce=toDate(_n),ke=constructFrom(_n,0);return ke.setFullYear(Ce.getFullYear(),0,1),ke.setHours(0,0,0,0),ke}const formatDistanceLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},formatDistance$1=(_n,Ce,ke)=>{let $n;const Hn=formatDistanceLocale[_n];return typeof Hn=="string"?$n=Hn:Ce===1?$n=Hn.one:$n=Hn.other.replace("{{count}}",Ce.toString()),ke!=null&&ke.addSuffix?ke.comparison&&ke.comparison>0?"in "+$n:$n+" ago":$n};function buildFormatLongFn(_n){return(Ce={})=>{const ke=Ce.width?String(Ce.width):_n.defaultWidth;return _n.formats[ke]||_n.formats[_n.defaultWidth]}}const dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})},formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative=(_n,Ce,ke,$n)=>formatRelativeLocale[_n];function buildLocalizeFn(_n){return(Ce,ke)=>{const $n=ke!=null&&ke.context?String(ke.context):"standalone";let Hn;if($n==="formatting"&&_n.formattingValues){const Un=_n.defaultFormattingWidth||_n.defaultWidth,qn=ke!=null&&ke.width?String(ke.width):Un;Hn=_n.formattingValues[qn]||_n.formattingValues[Un]}else{const Un=_n.defaultWidth,qn=ke!=null&&ke.width?String(ke.width):_n.defaultWidth;Hn=_n.values[qn]||_n.values[Un]}const zn=_n.argumentCallback?_n.argumentCallback(Ce):Ce;return Hn[zn]}}const eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ordinalNumber=(_n,Ce)=>{const ke=Number(_n),$n=ke%100;if($n>20||$n<10)switch($n%10){case 1:return ke+"st";case 2:return ke+"nd";case 3:return ke+"rd"}return ke+"th"},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:_n=>_n-1}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})};function buildMatchFn(_n){return(Ce,ke={})=>{const $n=ke.width,Hn=$n&&_n.matchPatterns[$n]||_n.matchPatterns[_n.defaultMatchWidth],zn=Ce.match(Hn);if(!zn)return null;const Un=zn[0],qn=$n&&_n.parsePatterns[$n]||_n.parsePatterns[_n.defaultParseWidth],Xn=Array.isArray(qn)?findIndex(qn,io=>io.test(Un)):findKey(qn,io=>io.test(Un));let Kn;Kn=_n.valueCallback?_n.valueCallback(Xn):Xn,Kn=ke.valueCallback?ke.valueCallback(Kn):Kn;const to=Ce.slice(Un.length);return{value:Kn,rest:to}}}function findKey(_n,Ce){for(const ke in _n)if(Object.prototype.hasOwnProperty.call(_n,ke)&&Ce(_n[ke]))return ke}function findIndex(_n,Ce){for(let ke=0;ke<_n.length;ke++)if(Ce(_n[ke]))return ke}function buildMatchPatternFn(_n){return(Ce,ke={})=>{const $n=Ce.match(_n.matchPattern);if(!$n)return null;const Hn=$n[0],zn=Ce.match(_n.parsePattern);if(!zn)return null;let Un=_n.valueCallback?_n.valueCallback(zn[0]):zn[0];Un=ke.valueCallback?ke.valueCallback(Un):Un;const qn=Ce.slice(Hn.length);return{value:Un,rest:qn}}}const matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:_n=>parseInt(_n,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:_n=>_n+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},enUS={code:"en-US",formatDistance:formatDistance$1,formatLong,formatRelative,localize,match,options:{weekStartsOn:0,firstWeekContainsDate:1}};function getDayOfYear(_n){const Ce=toDate(_n);return differenceInCalendarDays(Ce,startOfYear(Ce))+1}function getISOWeek(_n){const Ce=toDate(_n),ke=+startOfISOWeek(Ce)-+startOfISOWeekYear(Ce);return Math.round(ke/millisecondsInWeek)+1}function getWeekYear(_n,Ce){var to,io,uo,ho;const ke=toDate(_n),$n=ke.getFullYear(),Hn=getDefaultOptions(),zn=(Ce==null?void 0:Ce.firstWeekContainsDate)??((io=(to=Ce==null?void 0:Ce.locale)==null?void 0:to.options)==null?void 0:io.firstWeekContainsDate)??Hn.firstWeekContainsDate??((ho=(uo=Hn.locale)==null?void 0:uo.options)==null?void 0:ho.firstWeekContainsDate)??1,Un=constructFrom(_n,0);Un.setFullYear($n+1,0,zn),Un.setHours(0,0,0,0);const qn=startOfWeek(Un,Ce),Xn=constructFrom(_n,0);Xn.setFullYear($n,0,zn),Xn.setHours(0,0,0,0);const Kn=startOfWeek(Xn,Ce);return ke.getTime()>=qn.getTime()?$n+1:ke.getTime()>=Kn.getTime()?$n:$n-1}function startOfWeekYear(_n,Ce){var qn,Xn,Kn,to;const ke=getDefaultOptions(),$n=(Ce==null?void 0:Ce.firstWeekContainsDate)??((Xn=(qn=Ce==null?void 0:Ce.locale)==null?void 0:qn.options)==null?void 0:Xn.firstWeekContainsDate)??ke.firstWeekContainsDate??((to=(Kn=ke.locale)==null?void 0:Kn.options)==null?void 0:to.firstWeekContainsDate)??1,Hn=getWeekYear(_n,Ce),zn=constructFrom(_n,0);return zn.setFullYear(Hn,0,$n),zn.setHours(0,0,0,0),startOfWeek(zn,Ce)}function getWeek(_n,Ce){const ke=toDate(_n),$n=+startOfWeek(ke,Ce)-+startOfWeekYear(ke,Ce);return Math.round($n/millisecondsInWeek)+1}function addLeadingZeros(_n,Ce){const ke=_n<0?"-":"",$n=Math.abs(_n).toString().padStart(Ce,"0");return ke+$n}const lightFormatters={y(_n,Ce){const ke=_n.getFullYear(),$n=ke>0?ke:1-ke;return addLeadingZeros(Ce==="yy"?$n%100:$n,Ce.length)},M(_n,Ce){const ke=_n.getMonth();return Ce==="M"?String(ke+1):addLeadingZeros(ke+1,2)},d(_n,Ce){return addLeadingZeros(_n.getDate(),Ce.length)},a(_n,Ce){const ke=_n.getHours()/12>=1?"pm":"am";switch(Ce){case"a":case"aa":return ke.toUpperCase();case"aaa":return ke;case"aaaaa":return ke[0];case"aaaa":default:return ke==="am"?"a.m.":"p.m."}},h(_n,Ce){return addLeadingZeros(_n.getHours()%12||12,Ce.length)},H(_n,Ce){return addLeadingZeros(_n.getHours(),Ce.length)},m(_n,Ce){return addLeadingZeros(_n.getMinutes(),Ce.length)},s(_n,Ce){return addLeadingZeros(_n.getSeconds(),Ce.length)},S(_n,Ce){const ke=Ce.length,$n=_n.getMilliseconds(),Hn=Math.trunc($n*Math.pow(10,ke-3));return addLeadingZeros(Hn,Ce.length)}},dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters={G:function(_n,Ce,ke){const $n=_n.getFullYear()>0?1:0;switch(Ce){case"G":case"GG":case"GGG":return ke.era($n,{width:"abbreviated"});case"GGGGG":return ke.era($n,{width:"narrow"});case"GGGG":default:return ke.era($n,{width:"wide"})}},y:function(_n,Ce,ke){if(Ce==="yo"){const $n=_n.getFullYear(),Hn=$n>0?$n:1-$n;return ke.ordinalNumber(Hn,{unit:"year"})}return lightFormatters.y(_n,Ce)},Y:function(_n,Ce,ke,$n){const Hn=getWeekYear(_n,$n),zn=Hn>0?Hn:1-Hn;if(Ce==="YY"){const Un=zn%100;return addLeadingZeros(Un,2)}return Ce==="Yo"?ke.ordinalNumber(zn,{unit:"year"}):addLeadingZeros(zn,Ce.length)},R:function(_n,Ce){const ke=getISOWeekYear(_n);return addLeadingZeros(ke,Ce.length)},u:function(_n,Ce){const ke=_n.getFullYear();return addLeadingZeros(ke,Ce.length)},Q:function(_n,Ce,ke){const $n=Math.ceil((_n.getMonth()+1)/3);switch(Ce){case"Q":return String($n);case"QQ":return addLeadingZeros($n,2);case"Qo":return ke.ordinalNumber($n,{unit:"quarter"});case"QQQ":return ke.quarter($n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return ke.quarter($n,{width:"narrow",context:"formatting"});case"QQQQ":default:return ke.quarter($n,{width:"wide",context:"formatting"})}},q:function(_n,Ce,ke){const $n=Math.ceil((_n.getMonth()+1)/3);switch(Ce){case"q":return String($n);case"qq":return addLeadingZeros($n,2);case"qo":return ke.ordinalNumber($n,{unit:"quarter"});case"qqq":return ke.quarter($n,{width:"abbreviated",context:"standalone"});case"qqqqq":return ke.quarter($n,{width:"narrow",context:"standalone"});case"qqqq":default:return ke.quarter($n,{width:"wide",context:"standalone"})}},M:function(_n,Ce,ke){const $n=_n.getMonth();switch(Ce){case"M":case"MM":return lightFormatters.M(_n,Ce);case"Mo":return ke.ordinalNumber($n+1,{unit:"month"});case"MMM":return ke.month($n,{width:"abbreviated",context:"formatting"});case"MMMMM":return ke.month($n,{width:"narrow",context:"formatting"});case"MMMM":default:return ke.month($n,{width:"wide",context:"formatting"})}},L:function(_n,Ce,ke){const $n=_n.getMonth();switch(Ce){case"L":return String($n+1);case"LL":return addLeadingZeros($n+1,2);case"Lo":return ke.ordinalNumber($n+1,{unit:"month"});case"LLL":return ke.month($n,{width:"abbreviated",context:"standalone"});case"LLLLL":return ke.month($n,{width:"narrow",context:"standalone"});case"LLLL":default:return ke.month($n,{width:"wide",context:"standalone"})}},w:function(_n,Ce,ke,$n){const Hn=getWeek(_n,$n);return Ce==="wo"?ke.ordinalNumber(Hn,{unit:"week"}):addLeadingZeros(Hn,Ce.length)},I:function(_n,Ce,ke){const $n=getISOWeek(_n);return Ce==="Io"?ke.ordinalNumber($n,{unit:"week"}):addLeadingZeros($n,Ce.length)},d:function(_n,Ce,ke){return Ce==="do"?ke.ordinalNumber(_n.getDate(),{unit:"date"}):lightFormatters.d(_n,Ce)},D:function(_n,Ce,ke){const $n=getDayOfYear(_n);return Ce==="Do"?ke.ordinalNumber($n,{unit:"dayOfYear"}):addLeadingZeros($n,Ce.length)},E:function(_n,Ce,ke){const $n=_n.getDay();switch(Ce){case"E":case"EE":case"EEE":return ke.day($n,{width:"abbreviated",context:"formatting"});case"EEEEE":return ke.day($n,{width:"narrow",context:"formatting"});case"EEEEEE":return ke.day($n,{width:"short",context:"formatting"});case"EEEE":default:return ke.day($n,{width:"wide",context:"formatting"})}},e:function(_n,Ce,ke,$n){const Hn=_n.getDay(),zn=(Hn-$n.weekStartsOn+8)%7||7;switch(Ce){case"e":return String(zn);case"ee":return addLeadingZeros(zn,2);case"eo":return ke.ordinalNumber(zn,{unit:"day"});case"eee":return ke.day(Hn,{width:"abbreviated",context:"formatting"});case"eeeee":return ke.day(Hn,{width:"narrow",context:"formatting"});case"eeeeee":return ke.day(Hn,{width:"short",context:"formatting"});case"eeee":default:return ke.day(Hn,{width:"wide",context:"formatting"})}},c:function(_n,Ce,ke,$n){const Hn=_n.getDay(),zn=(Hn-$n.weekStartsOn+8)%7||7;switch(Ce){case"c":return String(zn);case"cc":return addLeadingZeros(zn,Ce.length);case"co":return ke.ordinalNumber(zn,{unit:"day"});case"ccc":return ke.day(Hn,{width:"abbreviated",context:"standalone"});case"ccccc":return ke.day(Hn,{width:"narrow",context:"standalone"});case"cccccc":return ke.day(Hn,{width:"short",context:"standalone"});case"cccc":default:return ke.day(Hn,{width:"wide",context:"standalone"})}},i:function(_n,Ce,ke){const $n=_n.getDay(),Hn=$n===0?7:$n;switch(Ce){case"i":return String(Hn);case"ii":return addLeadingZeros(Hn,Ce.length);case"io":return ke.ordinalNumber(Hn,{unit:"day"});case"iii":return ke.day($n,{width:"abbreviated",context:"formatting"});case"iiiii":return ke.day($n,{width:"narrow",context:"formatting"});case"iiiiii":return ke.day($n,{width:"short",context:"formatting"});case"iiii":default:return ke.day($n,{width:"wide",context:"formatting"})}},a:function(_n,Ce,ke){const Hn=_n.getHours()/12>=1?"pm":"am";switch(Ce){case"a":case"aa":return ke.dayPeriod(Hn,{width:"abbreviated",context:"formatting"});case"aaa":return ke.dayPeriod(Hn,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return ke.dayPeriod(Hn,{width:"narrow",context:"formatting"});case"aaaa":default:return ke.dayPeriod(Hn,{width:"wide",context:"formatting"})}},b:function(_n,Ce,ke){const $n=_n.getHours();let Hn;switch($n===12?Hn=dayPeriodEnum.noon:$n===0?Hn=dayPeriodEnum.midnight:Hn=$n/12>=1?"pm":"am",Ce){case"b":case"bb":return ke.dayPeriod(Hn,{width:"abbreviated",context:"formatting"});case"bbb":return ke.dayPeriod(Hn,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return ke.dayPeriod(Hn,{width:"narrow",context:"formatting"});case"bbbb":default:return ke.dayPeriod(Hn,{width:"wide",context:"formatting"})}},B:function(_n,Ce,ke){const $n=_n.getHours();let Hn;switch($n>=17?Hn=dayPeriodEnum.evening:$n>=12?Hn=dayPeriodEnum.afternoon:$n>=4?Hn=dayPeriodEnum.morning:Hn=dayPeriodEnum.night,Ce){case"B":case"BB":case"BBB":return ke.dayPeriod(Hn,{width:"abbreviated",context:"formatting"});case"BBBBB":return ke.dayPeriod(Hn,{width:"narrow",context:"formatting"});case"BBBB":default:return ke.dayPeriod(Hn,{width:"wide",context:"formatting"})}},h:function(_n,Ce,ke){if(Ce==="ho"){let $n=_n.getHours()%12;return $n===0&&($n=12),ke.ordinalNumber($n,{unit:"hour"})}return lightFormatters.h(_n,Ce)},H:function(_n,Ce,ke){return Ce==="Ho"?ke.ordinalNumber(_n.getHours(),{unit:"hour"}):lightFormatters.H(_n,Ce)},K:function(_n,Ce,ke){const $n=_n.getHours()%12;return Ce==="Ko"?ke.ordinalNumber($n,{unit:"hour"}):addLeadingZeros($n,Ce.length)},k:function(_n,Ce,ke){let $n=_n.getHours();return $n===0&&($n=24),Ce==="ko"?ke.ordinalNumber($n,{unit:"hour"}):addLeadingZeros($n,Ce.length)},m:function(_n,Ce,ke){return Ce==="mo"?ke.ordinalNumber(_n.getMinutes(),{unit:"minute"}):lightFormatters.m(_n,Ce)},s:function(_n,Ce,ke){return Ce==="so"?ke.ordinalNumber(_n.getSeconds(),{unit:"second"}):lightFormatters.s(_n,Ce)},S:function(_n,Ce){return lightFormatters.S(_n,Ce)},X:function(_n,Ce,ke){const $n=_n.getTimezoneOffset();if($n===0)return"Z";switch(Ce){case"X":return formatTimezoneWithOptionalMinutes($n);case"XXXX":case"XX":return formatTimezone($n);case"XXXXX":case"XXX":default:return formatTimezone($n,":")}},x:function(_n,Ce,ke){const $n=_n.getTimezoneOffset();switch(Ce){case"x":return formatTimezoneWithOptionalMinutes($n);case"xxxx":case"xx":return formatTimezone($n);case"xxxxx":case"xxx":default:return formatTimezone($n,":")}},O:function(_n,Ce,ke){const $n=_n.getTimezoneOffset();switch(Ce){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort($n,":");case"OOOO":default:return"GMT"+formatTimezone($n,":")}},z:function(_n,Ce,ke){const $n=_n.getTimezoneOffset();switch(Ce){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort($n,":");case"zzzz":default:return"GMT"+formatTimezone($n,":")}},t:function(_n,Ce,ke){const $n=Math.trunc(_n.getTime()/1e3);return addLeadingZeros($n,Ce.length)},T:function(_n,Ce,ke){const $n=_n.getTime();return addLeadingZeros($n,Ce.length)}};function formatTimezoneShort(_n,Ce=""){const ke=_n>0?"-":"+",$n=Math.abs(_n),Hn=Math.trunc($n/60),zn=$n%60;return zn===0?ke+String(Hn):ke+String(Hn)+Ce+addLeadingZeros(zn,2)}function formatTimezoneWithOptionalMinutes(_n,Ce){return _n%60===0?(_n>0?"-":"+")+addLeadingZeros(Math.abs(_n)/60,2):formatTimezone(_n,Ce)}function formatTimezone(_n,Ce=""){const ke=_n>0?"-":"+",$n=Math.abs(_n),Hn=addLeadingZeros(Math.trunc($n/60),2),zn=addLeadingZeros($n%60,2);return ke+Hn+Ce+zn}const dateLongFormatter=(_n,Ce)=>{switch(_n){case"P":return Ce.date({width:"short"});case"PP":return Ce.date({width:"medium"});case"PPP":return Ce.date({width:"long"});case"PPPP":default:return Ce.date({width:"full"})}},timeLongFormatter=(_n,Ce)=>{switch(_n){case"p":return Ce.time({width:"short"});case"pp":return Ce.time({width:"medium"});case"ppp":return Ce.time({width:"long"});case"pppp":default:return Ce.time({width:"full"})}},dateTimeLongFormatter=(_n,Ce)=>{const ke=_n.match(/(P+)(p+)?/)||[],$n=ke[1],Hn=ke[2];if(!Hn)return dateLongFormatter(_n,Ce);let zn;switch($n){case"P":zn=Ce.dateTime({width:"short"});break;case"PP":zn=Ce.dateTime({width:"medium"});break;case"PPP":zn=Ce.dateTime({width:"long"});break;case"PPPP":default:zn=Ce.dateTime({width:"full"});break}return zn.replace("{{date}}",dateLongFormatter($n,Ce)).replace("{{time}}",timeLongFormatter(Hn,Ce))},longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter},dayOfYearTokenRE=/^D+$/,weekYearTokenRE=/^Y+$/,throwTokens=["D","DD","YY","YYYY"];function isProtectedDayOfYearToken(_n){return dayOfYearTokenRE.test(_n)}function isProtectedWeekYearToken(_n){return weekYearTokenRE.test(_n)}function warnOrThrowProtectedError(_n,Ce,ke){const $n=message(_n,Ce,ke);if(console.warn($n),throwTokens.includes(_n))throw new RangeError($n)}function message(_n,Ce,ke){const $n=_n[0]==="Y"?"years":"days of the month";return`Use \`${_n.toLowerCase()}\` instead of \`${_n}\` (in \`${Ce}\`) for formatting ${$n} to the input \`${ke}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function format$1(_n,Ce,ke){var to,io,uo,ho;const $n=getDefaultOptions(),Hn=$n.locale??enUS,zn=$n.firstWeekContainsDate??((io=(to=$n.locale)==null?void 0:to.options)==null?void 0:io.firstWeekContainsDate)??1,Un=$n.weekStartsOn??((ho=(uo=$n.locale)==null?void 0:uo.options)==null?void 0:ho.weekStartsOn)??0,qn=toDate(_n);if(!isValid(qn))throw new RangeError("Invalid time value");let Xn=Ce.match(longFormattingTokensRegExp).map(bo=>{const Oo=bo[0];if(Oo==="p"||Oo==="P"){const So=longFormatters[Oo];return So(bo,Hn.formatLong)}return bo}).join("").match(formattingTokensRegExp).map(bo=>{if(bo==="''")return{isToken:!1,value:"'"};const Oo=bo[0];if(Oo==="'")return{isToken:!1,value:cleanEscapedString(bo)};if(formatters[Oo])return{isToken:!0,value:bo};if(Oo.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Oo+"`");return{isToken:!1,value:bo}});Hn.localize.preprocessor&&(Xn=Hn.localize.preprocessor(qn,Xn));const Kn={firstWeekContainsDate:zn,weekStartsOn:Un,locale:Hn};return Xn.map(bo=>{if(!bo.isToken)return bo.value;const Oo=bo.value;(isProtectedWeekYearToken(Oo)||isProtectedDayOfYearToken(Oo))&&warnOrThrowProtectedError(Oo,Ce,String(_n));const So=formatters[Oo[0]];return So(qn,Oo,Hn.localize,Kn)}).join("")}function cleanEscapedString(_n){const Ce=_n.match(escapedStringRegExp);return Ce?Ce[1].replace(doubleQuoteRegExp,"'"):_n}function formatDistance(_n,Ce,ke){const $n=getDefaultOptions(),Hn=(ke==null?void 0:ke.locale)??$n.locale??enUS,zn=2520,Un=compareAsc(_n,Ce);if(isNaN(Un))throw new RangeError("Invalid time value");const qn=Object.assign({},ke,{addSuffix:ke==null?void 0:ke.addSuffix,comparison:Un});let Xn,Kn;Un>0?(Xn=toDate(Ce),Kn=toDate(_n)):(Xn=toDate(_n),Kn=toDate(Ce));const to=differenceInSeconds(Kn,Xn),io=(getTimezoneOffsetInMilliseconds(Kn)-getTimezoneOffsetInMilliseconds(Xn))/1e3,uo=Math.round((to-io)/60);let ho;if(uo<2)return ke!=null&&ke.includeSeconds?to<5?Hn.formatDistance("lessThanXSeconds",5,qn):to<10?Hn.formatDistance("lessThanXSeconds",10,qn):to<20?Hn.formatDistance("lessThanXSeconds",20,qn):to<40?Hn.formatDistance("halfAMinute",0,qn):to<60?Hn.formatDistance("lessThanXMinutes",1,qn):Hn.formatDistance("xMinutes",1,qn):uo===0?Hn.formatDistance("lessThanXMinutes",1,qn):Hn.formatDistance("xMinutes",uo,qn);if(uo<45)return Hn.formatDistance("xMinutes",uo,qn);if(uo<90)return Hn.formatDistance("aboutXHours",1,qn);if(uo{_n&&!_n.contains(ke.target)&&!ke.defaultPrevented&&_n.dispatchEvent(new CustomEvent("click_outside",_n))};return document.addEventListener("click",Ce,!0),{destroy(){document.removeEventListener("click",Ce,!0)}}}const get_button_slot_changes=_n=>({}),get_button_slot_context=_n=>({});function fallback_block(_n){let Ce;return{c(){Ce=text("Dropdown")},m(ke,$n){insert$1(ke,Ce,$n)},d(ke){ke&&detach(Ce)}}}function create_fragment$1h(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn;const Kn=_n[6].button,to=create_slot(Kn,_n,_n[5],get_button_slot_context),io=to||fallback_block(),uo=_n[6].default,ho=create_slot(uo,_n,_n[5],null);return{c(){Ce=element("div"),ke=element("button"),io&&io.c(),$n=space$3(),Hn=element("div"),ho&&ho.c(),attr(ke,"class","button dropdown-button"),attr(ke,"type","button"),attr(ke,"aria-expanded","false"),attr(Hn,"class",zn="dropdown-menu hide orientation-"+_n[0]),attr(Ce,"class","dropdown")},m(bo,Oo){insert$1(bo,Ce,Oo),append(Ce,ke),io&&io.m(ke,null),append(Ce,$n),append(Ce,Hn),ho&&ho.m(Hn,null),_n[7](Hn),Un=!0,qn||(Xn=[listen(ke,"click",_n[1]),action_destroyer(clickOutside.call(null,Hn)),listen(Hn,"click_outside",_n[3])],qn=!0)},p(bo,[Oo]){to&&to.p&&(!Un||Oo&32)&&update_slot_base(to,Kn,bo,bo[5],Un?get_slot_changes(Kn,bo[5],Oo,get_button_slot_changes):get_all_dirty_from_scope(bo[5]),get_button_slot_context),ho&&ho.p&&(!Un||Oo&32)&&update_slot_base(ho,uo,bo,bo[5],Un?get_slot_changes(uo,bo[5],Oo,null):get_all_dirty_from_scope(bo[5]),null),(!Un||Oo&1&&zn!==(zn="dropdown-menu hide orientation-"+bo[0]))&&attr(Hn,"class",zn)},i(bo){Un||(transition_in(io,bo),transition_in(ho,bo),Un=!0)},o(bo){transition_out(io,bo),transition_out(ho,bo),Un=!1},d(bo){bo&&detach(Ce),io&&io.d(bo),ho&&ho.d(bo),_n[7](null),qn=!1,run_all(Xn)}}}function instance$1h(_n,Ce,ke){let{$$slots:$n={},$$scope:Hn}=Ce,zn,{orientation:Un="left"}=Ce;function qn(){zn.classList.remove("hide")}function Xn(){zn.classList.add("hide")}function Kn(){zn.classList.add("hide")}function to(io){binding_callbacks[io?"unshift":"push"](()=>{zn=io,ke(2,zn)})}return _n.$$set=io=>{"orientation"in io&&ke(0,Un=io.orientation),"$$scope"in io&&ke(5,Hn=io.$$scope)},[Un,qn,zn,Kn,Xn,Hn,$n,to]}class Dropdown extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1h,create_fragment$1h,safe_not_equal,{orientation:0,open:1,close:4})}get open(){return this.$$.ctx[1]}get close(){return this.$$.ctx[4]}}function get_each_context$q(_n,Ce,ke){const $n=_n.slice();return $n[7]=Ce[ke],$n}function get_each_context_1$9(_n,Ce,ke){const $n=_n.slice();return $n[7]=Ce[ke],$n}function create_if_block_1$v(_n){let Ce,ke=_n[7]+"",$n,Hn,zn;function Un(...qn){return _n[4](_n[7],...qn)}return{c(){Ce=element("button"),$n=text(ke),attr(Ce,"class","dropdown-item button")},m(qn,Xn){insert$1(qn,Ce,Xn),append(Ce,$n),Hn||(zn=listen(Ce,"click",Un),Hn=!0)},p(qn,Xn){_n=qn,Xn&2&&ke!==(ke=_n[7]+"")&&set_data($n,ke)},d(qn){qn&&detach(Ce),Hn=!1,zn()}}}function create_each_block_1$9(_n){let Ce=_n[0].roles.includes(_n[7]),ke,$n=Ce&&create_if_block_1$v(_n);return{c(){$n&&$n.c(),ke=empty$1()},m(Hn,zn){$n&&$n.m(Hn,zn),insert$1(Hn,ke,zn)},p(Hn,zn){zn&3&&(Ce=Hn[0].roles.includes(Hn[7])),Ce?$n?$n.p(Hn,zn):($n=create_if_block_1$v(Hn),$n.c(),$n.m(ke.parentNode,ke)):$n&&($n.d(1),$n=null)},d(Hn){Hn&&detach(ke),$n&&$n.d(Hn)}}}function create_if_block$T(_n){let Ce,ke=_n[7]+"",$n,Hn,zn,Un;function qn(...Xn){return _n[5](_n[7],...Xn)}return{c(){Ce=element("button"),$n=text(ke),Hn=space$3(),attr(Ce,"class","dropdown-item button")},m(Xn,Kn){insert$1(Xn,Ce,Kn),append(Ce,$n),append(Ce,Hn),zn||(Un=listen(Ce,"click",qn),zn=!0)},p(Xn,Kn){_n=Xn,Kn&2&&ke!==(ke=_n[7]+"")&&set_data($n,ke)},d(Xn){Xn&&detach(Ce),zn=!1,Un()}}}function create_each_block$q(_n){let Ce=!_n[0].roles.includes(_n[7]),ke,$n=Ce&&create_if_block$T(_n);return{c(){$n&&$n.c(),ke=empty$1()},m(Hn,zn){$n&&$n.m(Hn,zn),insert$1(Hn,ke,zn)},p(Hn,zn){zn&3&&(Ce=!Hn[0].roles.includes(Hn[7])),Ce?$n?$n.p(Hn,zn):($n=create_if_block$T(Hn),$n.c(),$n.m(ke.parentNode,ke)):$n&&($n.d(1),$n=null)},d(Hn){Hn&&detach(ke),$n&&$n.d(Hn)}}}function create_default_slot$a(_n){let Ce,ke,$n,Hn,zn,Un,qn=ensure_array_like(_n[1]),Xn=[];for(let io=0;io{$o&&(So||(So=create_bidirectional_transition(Ce,fly,{duration:200},!0)),So.run(1))}),$o=!0)},o(Do){transition_out($n.$$.fragment,Do),transition_out(Oo.$$.fragment,Do),Do&&(So||(So=create_bidirectional_transition(Ce,fly,{duration:200},!1)),So.run(0)),$o=!1},d(Do){Do&&detach(Ce),destroy_component($n),destroy_component(Oo),Do&&So&&So.end()}}}function instance$1g(_n,Ce,ke){const $n=createEventDispatcher();let{member:Hn}=Ce,{roles:zn}=Ce;function Un(to,io){to.preventDefault();let uo=Hn.roles.filter(ho=>ho!==io);$n("update",{user:Hn.id,roles:uo})}function qn(to,io){to.preventDefault();let uo=[...Hn.roles,io];console.log(Hn.roles),console.log(io),console.log(uo),$n("update",{user:Hn.id,roles:uo})}const Xn=(to,io)=>Un(io,to),Kn=(to,io)=>qn(io,to);return _n.$$set=to=>{"member"in to&&ke(0,Hn=to.member),"roles"in to&&ke(1,zn=to.roles)},[Hn,zn,Un,qn,Xn,Kn]}class MemberSettingsCard extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1g,create_fragment$1g,safe_not_equal,{member:0,roles:1})}}function get_each_context$p(_n,Ce,ke){const $n=_n.slice();return $n[15]=Ce[ke],$n}function get_each_context_1$8(_n,Ce,ke){const $n=_n.slice();return $n[18]=Ce[ke],$n}function create_each_block_1$8(_n){let Ce,ke=_n[18]+"",$n;return{c(){Ce=element("option"),$n=text(ke),Ce.__value=_n[18],set_input_value(Ce,Ce.__value)},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,$n)},p:noop,d(Hn){Hn&&detach(Ce)}}}function create_each_block$p(_n){let Ce,ke;return Ce=new MemberSettingsCard({props:{member:_n[15],roles:_n[6].roles}}),Ce.$on("update",_n[9]),Ce.$on("reinvite",_n[14]),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&1&&(zn.member=$n[15]),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_fragment$1f(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo,So,$o,Do,xo,Io,Vo,Jo,Mo,Go,os,ms,is,Yo,Ys,sr,Js;zn=new ErrorAlert({props:{message:_n[4]}});let ko={};qn=new SuccessAlert({props:ko}),_n[10](qn);let gs=ensure_array_like(_n[6].roles.filter(func$1)),xs=[];for(let Fs=0;Fstransition_out(cr[Fs],1,1,()=>{cr[Fs]=null});return{c(){Ce=element("div"),ke=element("div"),$n=element("h3"),$n.textContent="Invite people",Hn=space$3(),create_component(zn.$$.fragment),Un=space$3(),create_component(qn.$$.fragment),Xn=space$3(),Kn=element("form"),to=element("div"),io=element("label"),io.textContent="Invitee Name",uo=space$3(),ho=element("input"),bo=space$3(),Oo=element("div"),So=element("label"),So.textContent="Invitee Email Address",$o=space$3(),Do=element("input"),xo=space$3(),Io=element("div"),Vo=element("select");for(let Fs=0;Fs_n[13].call(Vo)),attr(Io,"class","me-3"),attr(Mo,"class","mt-5 d-block text-center"),attr(ke,"class","lx-card mt-5"),attr(is,"class","header-small mb-5 mt-5"),attr(ms,"class","member-list"),attr(Ce,"class","common-wrapper")},m(Fs,Br){insert$1(Fs,Ce,Br),append(Ce,ke),append(ke,$n),append(ke,Hn),mount_component(zn,ke,null),append(ke,Un),mount_component(qn,ke,null),append(ke,Xn),append(ke,Kn),append(Kn,to),append(to,io),append(to,uo),append(to,ho),set_input_value(ho,_n[1]),append(Kn,bo),append(Kn,Oo),append(Oo,So),append(Oo,$o),append(Oo,Do),set_input_value(Do,_n[2]),append(Kn,xo),append(Kn,Io),append(Io,Vo);for(let _r=0;_r_n!=="removed";function instance$1f(_n,Ce,ke){const $n=getContext$1("channel");let{users:Hn}=Ce,zn,Un,qn,Xn="",Kn;function to(Do){Do.preventDefault(),io(zn,Un,qn)}function io(Do,xo,Io){ke(4,Xn=""),axios$1.post($n.lucentUrl+"/members/invite",{name:Do,email:xo,roles:[Io]}).then(Vo=>{Kn.show("User was invited"),ke(0,Hn=[...Hn,Vo.data.user]),ke(1,zn=null),ke(2,Un=null),ke(3,qn=null)}).catch(Vo=>{var Jo,Mo;ke(4,Xn=((Mo=(Jo=Vo.response)==null?void 0:Jo.data)==null?void 0:Mo.error)??"")})}function uo(Do){Do.preventDefault(),ke(4,Xn=""),axios$1.post($n.lucentUrl+"/members/update",{id:Do.detail.user,roles:Do.detail.roles}).then(xo=>{Kn.show("Users updated"),ke(0,Hn=xo.data.users)}).catch(xo=>{var Io,Vo;ke(4,Xn=((Vo=(Io=xo.response)==null?void 0:Io.data)==null?void 0:Vo.error)??"")})}function ho(Do){binding_callbacks[Do?"unshift":"push"](()=>{Kn=Do,ke(5,Kn)})}function bo(){zn=this.value,ke(1,zn)}function Oo(){Un=this.value,ke(2,Un)}function So(){qn=select_value(this),ke(3,qn),ke(6,$n)}const $o=Do=>io(Do.detail.email,Do.detail.role);return _n.$$set=Do=>{"users"in Do&&ke(0,Hn=Do.users)},[Hn,zn,Un,qn,Xn,Kn,$n,to,io,uo,ho,bo,Oo,So,$o]}class Members extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1f,create_fragment$1f,safe_not_equal,{users:0})}}function create_fragment$1e(_n){let Ce,ke,$n;return{c(){Ce=element("div"),ke=element("div"),$n=text(_n[0]),attr(ke,"class","header-normal"),attr(Ce,"class","wrapper-normal ")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,ke),append(ke,$n)},p(Hn,[zn]){zn&1&&set_data($n,Hn[0])},i:noop,o:noop,d(Hn){Hn&&detach(Ce)}}}function instance$1e(_n,Ce,ke){let{title:$n}=Ce;return _n.$$set=Hn=>{"title"in Hn&&ke(0,$n=Hn.title)},[$n]}class NotFound extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1e,create_fragment$1e,safe_not_equal,{title:0})}}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},lodash={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */lodash.exports;(function(_n,Ce){(function(){var ke,$n="4.17.21",Hn=200,zn="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",Un="Expected a function",qn="Invalid `variable` option passed into `_.template`",Xn="__lodash_hash_undefined__",Kn=500,to="__lodash_placeholder__",io=1,uo=2,ho=4,bo=1,Oo=2,So=1,$o=2,Do=4,xo=8,Io=16,Vo=32,Jo=64,Mo=128,Go=256,os=512,ms=30,is="...",Yo=800,Ys=16,sr=1,Js=2,ko=3,gs=1/0,xs=9007199254740991,Qr=17976931348623157e292,cr=NaN,ws=4294967295,Fs=ws-1,Br=ws>>>1,_r=[["ary",Mo],["bind",So],["bindKey",$o],["curry",xo],["curryRight",Io],["flip",os],["partial",Vo],["partialRight",Jo],["rearg",Go]],ha="[object Arguments]",hs="[object Array]",Qs="[object AsyncFunction]",zo="[object Boolean]",el="[object Date]",ga="[object DOMException]",Ca="[object Error]",za="[object Function]",Il="[object GeneratorFunction]",Zs="[object Map]",Sr="[object Number]",Us="[object Null]",fs="[object Object]",dr="[object Promise]",Vr="[object Proxy]",nr="[object RegExp]",Kr="[object Set]",ra="[object String]",Ml="[object Symbol]",xa="[object Undefined]",Nl="[object WeakMap]",Zc="[object WeakSet]",cc="[object ArrayBuffer]",gc="[object DataView]",nc="[object Float32Array]",Ed="[object Float64Array]",Zl="[object Int8Array]",Vl="[object Int16Array]",Fc="[object Int32Array]",qa="[object Uint8Array]",Ya="[object Uint8ClampedArray]",kc="[object Uint16Array]",Yl="[object Uint32Array]",rd=/\b__p \+= '';/g,Al=/\b(__p \+=) '' \+/g,gd=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Rr=/&(?:amp|lt|gt|quot|#39);/g,Pl=/[&<>"']/g,Su=RegExp(Rr.source),vs=RegExp(Pl.source),Es=/<%-([\s\S]+?)%>/g,Ks=/<%([\s\S]+?)%>/g,pr=/<%=([\s\S]+?)%>/g,ia=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ka=/^\w*$/,Ma=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mr=/[\\^$.*+?()[\]{}|]/g,il=RegExp(Mr.source),Na=/^\s+/,vl=/\s/,Rc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vc=/\{\n\/\* \[wrapped with (.+)\] \*/,xc=/,? & /,zc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ad=/[()=,{}\[\]\/\s]/,Bh=/\\(\\)?/g,Vu=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ts=/\w*$/,ks=/^[-+]0x[0-9a-f]+$/i,ir=/^0b[01]+$/i,br=/^\[object .+?Constructor\]$/,Aa=/^0o[0-7]+$/i,Ba=/^(?:0|[1-9]\d*)$/,_l=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Hc=/($^)/,Ds=/['\n\r\u2028\u2029\\]/g,tl="\\ud800-\\udfff",wu="\\u0300-\\u036f",qu="\\ufe20-\\ufe2f",Md="\\u20d0-\\u20ff",bc=wu+qu+Md,nm="\\u2700-\\u27bf",Ff="a-z\\xdf-\\xf6\\xf8-\\xff",Ud="\\xac\\xb1\\xd7\\xf7",ld="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",oc="\\u2000-\\u206f",Dc=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bd="A-Z\\xc0-\\xd6\\xd8-\\xde",Nd="\\ufe0e\\ufe0f",ih=Ud+ld+oc+Dc,om="['’]",sm="["+tl+"]",fc="["+ih+"]",Td="["+bc+"]",Jd="\\d+",Em="["+nm+"]",ef="["+Ff+"]",Cu="[^"+tl+ih+Jd+nm+Ff+bd+"]",Qc="\\ud83c[\\udffb-\\udfff]",Cf="(?:"+Td+"|"+Qc+")",qm="[^"+tl+"]",Oc="(?:\\ud83c[\\udde6-\\uddff]){2}",cd="[\\ud800-\\udbff][\\udc00-\\udfff]",vd="["+bd+"]",ju="\\u200d",Xf="(?:"+ef+"|"+Cu+")",Sh="(?:"+vd+"|"+Cu+")",Zd="(?:"+om+"(?:d|ll|m|re|s|t|ve))?",ah="(?:"+om+"(?:D|LL|M|RE|S|T|VE))?",lh=Cf+"?",Bp="["+Nd+"]?",ch="(?:"+ju+"(?:"+[qm,Oc,cd].join("|")+")"+Bp+lh+")*",bp="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",kf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Fh=Bp+lh+ch,jm="(?:"+[Em,Oc,cd].join("|")+")"+Fh,Fp="(?:"+[qm+Td+"?",Td,Oc,cd,sm].join("|")+")",Eg=RegExp(om,"g"),rs=RegExp(Td,"g"),As=RegExp(Qc+"(?="+Qc+")|"+Fp+Fh,"g"),Ws=RegExp([vd+"?"+ef+"+"+Zd+"(?="+[fc,vd,"$"].join("|")+")",Sh+"+"+ah+"(?="+[fc,vd+Xf,"$"].join("|")+")",vd+"?"+Xf+"+"+Zd,vd+"+"+ah,kf,bp,Jd,jm].join("|"),"g"),rr=RegExp("["+ju+tl+bc+Nd+"]"),Fr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wa=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Nc=-1,xl={};xl[nc]=xl[Ed]=xl[Zl]=xl[Vl]=xl[Fc]=xl[qa]=xl[Ya]=xl[kc]=xl[Yl]=!0,xl[ha]=xl[hs]=xl[cc]=xl[zo]=xl[gc]=xl[el]=xl[Ca]=xl[za]=xl[Zs]=xl[Sr]=xl[fs]=xl[nr]=xl[Kr]=xl[ra]=xl[Nl]=!1;var ul={};ul[ha]=ul[hs]=ul[cc]=ul[gc]=ul[zo]=ul[el]=ul[nc]=ul[Ed]=ul[Zl]=ul[Vl]=ul[Fc]=ul[Zs]=ul[Sr]=ul[fs]=ul[nr]=ul[Kr]=ul[ra]=ul[Ml]=ul[qa]=ul[Ya]=ul[kc]=ul[Yl]=!0,ul[Ca]=ul[za]=ul[Nl]=!1;var lu={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Gl={"&":"&","<":"<",">":">",'"':""","'":"'"},Ru={"&":"&","<":"<",">":">",""":'"',"'":"'"},xf={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Hp=parseFloat,aa=parseInt,Qp=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Bu=typeof self=="object"&&self&&self.Object===Object&&self,Uo=Qp||Bu||Function("return this")(),cs=Ce&&!Ce.nodeType&&Ce,_s=cs&&!0&&_n&&!_n.nodeType&&_n,ar=_s&&_s.exports===cs,ta=ar&&Qp.process,al=function(){try{var Vs=_s&&_s.require&&_s.require("util").types;return Vs||ta&&ta.binding&&ta.binding("util")}catch{}}(),ya=al&&al.isArrayBuffer,fu=al&&al.isDate,Lr=al&&al.isMap,qc=al&&al.isRegExp,Ef=al&&al.isSet,ku=al&&al.isTypedArray;function jc(Vs,Dr,Tr){switch(Tr.length){case 0:return Vs.call(Dr);case 1:return Vs.call(Dr,Tr[0]);case 2:return Vs.call(Dr,Tr[0],Tr[1]);case 3:return Vs.call(Dr,Tr[0],Tr[1],Tr[2])}return Vs.apply(Dr,Tr)}function Tm(Vs,Dr,Tr,Fa){for(var zl=-1,_c=Vs==null?0:Vs.length;++zl<_c;){var Wc=Vs[zl];Dr(Fa,Wc,Tr(Wc),Vs)}return Fa}function El(Vs,Dr){for(var Tr=-1,Fa=Vs==null?0:Vs.length;++Tr-1}function Vp(Vs,Dr,Tr){for(var Fa=-1,zl=Vs==null?0:Vs.length;++Fa-1;);return Tr}function zp(Vs,Dr){for(var Tr=Vs.length;Tr--&&yd(Dr,Vs[Tr],0)>-1;);return Tr}function Tg(Vs,Dr){for(var Tr=Vs.length,Fa=0;Tr--;)Vs[Tr]===Dr&&++Fa;return Fa}var Ab=Eb(lu),P1=Eb(Gl);function Yf(Vs){return"\\"+xf[Vs]}function $1(Vs,Dr){return Vs==null?ke:Vs[Dr]}function jd(Vs){return rr.test(Vs)}function $m(Vs){return Fr.test(Vs)}function R1(Vs){for(var Dr,Tr=[];!(Dr=Vs.next()).done;)Tr.push(Dr.value);return Tr}function Xm(Vs){var Dr=-1,Tr=Array(Vs.size);return Vs.forEach(function(Fa,zl){Tr[++Dr]=[zl,Fa]}),Tr}function Yg(Vs,Dr){return function(Tr){return Vs(Dr(Tr))}}function Vf(Vs,Dr){for(var Tr=-1,Fa=Vs.length,zl=0,_c=[];++Tr-1}function Nu(so,co){var wo=this.__data__,Ho=Ir(wo,so);return Ho<0?(++this.size,wo.push([so,co])):wo[Ho][1]=co,this}$r.prototype.clear=Ea,$r.prototype.delete=ll,$r.prototype.get=nl,$r.prototype.has=Xa,$r.prototype.set=Nu;function zu(so){var co=-1,wo=so==null?0:so.length;for(this.clear();++co=co?so:co)),so}function td(so,co,wo,Ho,ts,Os){var Is,qs=co&io,mr=co&uo,Xr=co&ho;if(wo&&(Is=ts?wo(so,Ho,ts,Os):wo(so)),Is!==ke)return Is;if(!Vd(so))return so;var jr=$l(so);if(jr){if(Is=P0(so),!qs)return Ah(so,Is)}else{var ua=Ph(so),ja=ua==za||ua==Il;if(d1(so))return W1(so,qs);if(ua==fs||ua==ha||ja&&!ts){if(Is=mr||ja?{}:Uf(so),!qs)return mr?Ig(so,Dg(Is,so)):s1(so,Rg(Is,so))}else{if(!ul[ua])return ts?so:{};Is=ba(so,ua,qs)}}Os||(Os=new pf);var wl=Os.get(so);if(wl)return wl;Os.set(so,Is),TC(so)?so.forEach(function(Ul){Is.add(td(Ul,co,wo,Ul,so,Os))}):z2(so)&&so.forEach(function(Ul,nu){Is.set(nu,td(Ul,co,wo,nu,so,Os))});var Kl=Xr?mr?eu:rg:mr?_m:th,Pc=jr?ke:Kl(so);return El(Pc||so,function(Ul,nu){Pc&&(nu=Ul,Ul=so[nu]),$g(Is,nu,td(Ul,co,wo,nu,so,Os))}),Is}function Gf(so){var co=th(so);return function(wo){return jl(wo,so,co)}}function jl(so,co,wo){var Ho=wo.length;if(so==null)return!Ho;for(so=Uc(so);Ho--;){var ts=wo[Ho],Os=co[ts],Is=so[ts];if(Is===ke&&!(ts in so)||!Os(Is))return!1}return!0}function L1(so,co,wo){if(typeof so!="function")throw new _d(Un);return ph(function(){so.apply(ke,wo)},co)}function Bd(so,co,wo,Ho){var ts=-1,Os=cu,Is=!0,qs=so.length,mr=[],Xr=co.length;if(!qs)return mr;wo&&(co=ud(co,Ld(wo))),Ho?(Os=Vp,Is=!1):co.length>=Hn&&(Os=Mu,Is=!1,co=new Ta(co));e:for(;++tsts?0:ts+wo),Ho=Ho===ke||Ho>ts?ts:Ic(Ho),Ho<0&&(Ho+=ts),Ho=wo>Ho?0:FS(Ho);wo0&&wo(qs)?co>1?hd(qs,co-1,wo,Ho,ts):vp(ts,qs):Ho||(ts[ts.length]=qs)}return ts}var wv=hS(),ep=hS(!0);function tp(so,co){return so&&wv(so,co,th)}function fm(so,co){return so&&ep(so,co,th)}function Mb(so,co){return Qf(co,function(wo){return f1(so[wo])})}function Pf(so,co){co=z1(co,so);for(var wo=0,Ho=co.length;so!=null&&woco}function $f(so,co){return so!=null&&iu.call(so,co)}function Ly(so,co){return so!=null&&co in Uc(so)}function I1(so,co,wo){return so>=df(co,wo)&&so=120&&jr.length>=120)?new Ta(Is&&jr):ke}jr=so[0];var ua=-1,ja=qs[0];e:for(;++ua-1;)qs!==so&&qp.call(qs,mr,1),qp.call(so,mr,1);return so}function hm(so,co){for(var wo=so?co.length:0,Ho=wo-1;wo--;){var ts=co[wo];if(wo==Ho||ts!==Os){var Os=ts;K1(ts)?qp.call(so,ts,1):op(so,ts)}}return so}function Jp(so,co){return so+uf(Ju()*(co-so+1))}function wp(so,co,wo,Ho){for(var ts=-1,Os=Sd(lm((co-so)/(wo||1)),0),Is=Tr(Os);Os--;)Is[Ho?Os:++ts]=so,so+=wo;return Is}function B1(so,co){var wo="";if(!so||co<1||co>xs)return wo;do co%2&&(wo+=so),co=uf(co/2),co&&(so+=so);while(co);return wo}function Sc(so,co){return bS(i1(so,co,lp),so+"")}function F1(so){return Jm(zg(so))}function x0(so,co){var wo=zg(so);return Bv(wo,Ec(co,0,wo.length))}function nd(so,co,wo,Ho){if(!Vd(so))return so;co=z1(co,so);for(var ts=-1,Os=co.length,Is=Os-1,qs=so;qs!=null&&++tsts?0:ts+co),wo=wo>ts?ts:wo,wo<0&&(wo+=ts),ts=co>wo?0:wo-co>>>0,co>>>=0;for(var Os=Tr(ts);++Ho>>1,Is=so[Os];Is!==null&&!Cd(Is)&&(wo?Is<=co:Is=Hn){var Xr=co?null:mS(so);if(Xr)return Gg(Xr);Is=!1,ts=Mu,mr=new Ta}else mr=co?[]:qs;e:for(;++Ho=Ho?so:Fl(so,co,wo)}var tg=O0||function(so){return Uo.clearTimeout(so)};function W1(so,co){if(co)return so.slice();var wo=so.length,Ho=Ny?Ny(wo):new so.constructor(wo);return so.copy(Ho),Ho}function U1(so){var co=new so.constructor(so.byteLength);return new N1(co).set(new N1(so)),co}function T0(so,co){var wo=co?U1(so.buffer):so.buffer;return new so.constructor(wo,so.byteOffset,so.byteLength)}function Im(so){var co=new so.constructor(so.source,Ts.exec(so));return co.lastIndex=so.lastIndex,co}function md(so){return um?Uc(um.call(so)):{}}function ng(so,co){var wo=co?U1(so.buffer):so.buffer;return new so.constructor(wo,so.byteOffset,so.length)}function DO(so,co){if(so!==co){var wo=so!==ke,Ho=so===null,ts=so===so,Os=Cd(so),Is=co!==ke,qs=co===null,mr=co===co,Xr=Cd(co);if(!qs&&!Xr&&!Os&&so>co||Os&&Is&&mr&&!qs&&!Xr||Ho&&Is&&mr||!wo&&mr||!ts)return 1;if(!Ho&&!Os&&!Xr&&so=qs)return mr;var Xr=wo[Ho];return mr*(Xr=="desc"?-1:1)}}return so.index-co.index}function Hy(so,co,wo,Ho){for(var ts=-1,Os=so.length,Is=wo.length,qs=-1,mr=co.length,Xr=Sd(Os-Is,0),jr=Tr(mr+Xr),ua=!Ho;++qs1?wo[ts-1]:ke,Is=ts>2?wo[2]:ke;for(Os=so.length>3&&typeof Os=="function"?(ts--,Os):ke,Is&&gm(wo[0],wo[1],Is)&&(Os=ts<3?ke:Os,ts=1),co=Uc(co);++Ho-1?ts[Os?co[Is]:Is]:ke}}function Tv(so){return Y1(function(co){var wo=co.length,Ho=wo,ts=Ch.prototype.thru;for(so&&co.reverse();Ho--;){var Os=co[Ho];if(typeof Os!="function")throw new _d(Un);if(ts&&!Is&&$v(Os)=="wrapper")var Is=new Ch([],!0)}for(Ho=Is?Ho:wo;++Ho1&&vu.reverse(),jr&&mrqs))return!1;var Xr=Os.get(so),jr=Os.get(co);if(Xr&&jr)return Xr==co&&jr==so;var ua=-1,ja=!0,wl=wo&Oo?new Ta:ke;for(Os.set(so,co),Os.set(co,so);++ua1?"& ":"")+co[Ho],co=co.join(wo>2?", ":" "),so.replace(Rc,`{ +/* [wrapped with `+co+`] */ +`)}function gS(so){return $l(so)||bf(so)||!!(Ag&&so&&so[Ag])}function K1(so,co){var wo=typeof so;return co=co??xs,!!co&&(wo=="number"||wo!="symbol"&&Ba.test(so))&&so>-1&&so%1==0&&so0){if(++co>=Yo)return arguments[0]}else co=0;return so.apply(ke,arguments)}}function Bv(so,co){var wo=-1,Ho=so.length,ts=Ho-1;for(co=co===ke?Ho:co;++wo1?so[co-1]:ke;return wo=typeof wo=="function"?(so.pop(),wo):ke,D0(so,wo)});function Fm(so){var co=ss(so);return co.__chain__=!0,co}function _C(so,co){return co(so),so}function N0(so,co){return co(so)}var L0=Y1(function(so){var co=so.length,wo=co?so[0]:0,Ho=this.__wrapped__,ts=function(Os){return Lu(Os,so)};return co>1||this.__actions__.length||!(Ho instanceof Xc)||!K1(wo)?this.thru(ts):(Ho=Ho.slice(wo,+wo+(co?1:0)),Ho.__actions__.push({func:N0,args:[ts],thisArg:ke}),new Ch(Ho,this.__chain__).thru(function(Os){return co&&!Os.length&&Os.push(ke),Os}))});function L2(){return Fm(this)}function SC(){return new Ch(this.value(),this.__chain__)}function kS(){this.__values__===ke&&(this.__values__=BS(this.value()));var so=this.__index__>=this.__values__.length,co=so?ke:this.__values__[this.__index__++];return{done:so,value:co}}function Hm(){return this}function GO(so){for(var co,wo=this;wo instanceof n1;){var Ho=hC(wo);Ho.__index__=0,Ho.__values__=ke,co?ts.__wrapped__=Ho:co=Ho;var ts=Ho;wo=wo.__wrapped__}return ts.__wrapped__=so,co}function Rd(){var so=this.__wrapped__;if(so instanceof Xc){var co=so;return this.__actions__.length&&(co=new Xc(this)),co=co.reverse(),co.__actions__.push({func:N0,args:[Df],thisArg:ke}),new Ch(co,this.__chain__)}return this.thru(Df)}function Bg(){return E0(this.__wrapped__,this.__actions__)}var qv=Zh(function(so,co,wo){iu.call(so,wo)?++so[wo]:Nm(so,wo,1)});function Qb(so,co,wo){var Ho=$l(so)?hu:Er;return wo&&gm(so,co,wo)&&(co=ke),Ho(so,Ll(co,3))}function I0(so,co){var wo=$l(so)?Qf:hc;return wo(so,Ll(co,3))}var B0=Ev(vm),ob=Ev(Wy);function wC(so,co){return hd(jv(so,co),1)}function F0(so,co){return hd(jv(so,co),gs)}function Vb(so,co,wo){return wo=wo===ke?1:Ic(wo),hd(jv(so,co),wo)}function zb(so,co){var wo=$l(so)?El:pu;return wo(so,Ll(co,3))}function xS(so,co){var wo=$l(so)?Hf:C0;return wo(so,Ll(co,3))}var I2=Zh(function(so,co,wo){iu.call(so,wo)?so[wo].push(co):Nm(so,wo,[co])});function ES(so,co,wo,Ho){so=bu(so)?so:zg(so),wo=wo&&!Ho?Ic(wo):0;var ts=so.length;return wo<0&&(wo=Sd(ts+wo,0)),eO(so)?wo<=ts&&so.indexOf(co,wo)>-1:!!ts&&yd(so,co,wo)>-1}var B2=Sc(function(so,co,wo){var Ho=-1,ts=typeof co=="function",Os=bu(so)?Tr(so.length):[];return pu(so,function(Is){Os[++Ho]=ts?jc(co,Is,wo):np(Is,co,wo)}),Os}),KO=Zh(function(so,co,wo){Nm(so,wo,co)});function jv(so,co){var wo=$l(so)?ud:Ms;return wo(so,Ll(co,3))}function Qm(so,co,wo,Ho){return so==null?[]:($l(co)||(co=co==null?[]:[co]),wo=Ho?ke:wo,$l(wo)||(wo=wo==null?[]:[wo]),Xu(so,co,wo))}var CC=Zh(function(so,co,wo){so[wo?0:1].push(co)},function(){return[[],[]]});function Xv(so,co,wo){var Ho=$l(so)?vc:Tb,ts=arguments.length<3;return Ho(so,Ll(co,4),wo,ts,pu)}function kC(so,co,wo){var Ho=$l(so)?Am:Tb,ts=arguments.length<3;return Ho(so,Ll(co,4),wo,ts,C0)}function F2(so,co){var wo=$l(so)?Qf:hc;return wo(so,ug(Ll(co,3)))}function qy(so){var co=$l(so)?Jm:F1;return co(so)}function Wb(so,co,wo){(wo?gm(so,co,wo):co===ke)?co=1:co=Ic(co);var Ho=$l(so)?_v:x0;return Ho(so,co)}function JO(so){var co=$l(so)?Gp:H1;return co(so)}function rc(so){if(so==null)return 0;if(bu(so))return eO(so)?Wp(so):so.length;var co=Ph(so);return co==Zs||co==Kr?so.size:Po(so).length}function Vm(so,co,wo){var Ho=$l(so)?Pm:Xl;return wo&&gm(so,co,wo)&&(co=ke),Ho(so,Ll(co,3))}var Fg=Sc(function(so,co){if(so==null)return[];var wo=co.length;return wo>1&&gm(so,co[0],co[1])?co=[]:wo>2&&gm(co[0],co[1],co[2])&&(co=[co[0]]),Xu(so,hd(co,1),[])}),Yv=bv||function(){return Uo.Date.now()};function tu(so,co){if(typeof co!="function")throw new _d(Un);return so=Ic(so),function(){if(--so<1)return co.apply(this,arguments)}}function Gv(so,co,wo){return co=wo?ke:co,co=so&&co==null?so.length:co,sg(so,Mo,ke,ke,ke,ke,co)}function e_(so,co){var wo;if(typeof co!="function")throw new _d(Un);return so=Ic(so),function(){return--so>0&&(wo=co.apply(this,arguments)),so<=1&&(co=ke),wo}}var Yd=Sc(function(so,co,wo){var Ho=So;if(wo.length){var ts=Vf(wo,qh(Yd));Ho|=Vo}return sg(so,Ho,co,wo,ts)}),Hg=Sc(function(so,co,wo){var Ho=So|$o;if(wo.length){var ts=Vf(wo,qh(Hg));Ho|=Vo}return sg(co,Ho,so,wo,ts)});function sb(so,co,wo){co=wo?ke:co;var Ho=sg(so,xo,ke,ke,ke,ke,ke,co);return Ho.placeholder=sb.placeholder,Ho}function t_(so,co,wo){co=wo?ke:co;var Ho=sg(so,Io,ke,ke,ke,ke,ke,co);return Ho.placeholder=t_.placeholder,Ho}function jy(so,co,wo){var Ho,ts,Os,Is,qs,mr,Xr=0,jr=!1,ua=!1,ja=!0;if(typeof so!="function")throw new _d(Un);co=ap(co)||0,Vd(wo)&&(jr=!!wo.leading,ua="maxWait"in wo,Os=ua?Sd(ap(wo.maxWait)||0,co):Os,ja="trailing"in wo?!!wo.trailing:ja);function wl(Mf){var Dp=Ho,Tu=ts;return Ho=ts=ke,Xr=Mf,Is=so.apply(Tu,Dp),Is}function Kl(Mf){return Xr=Mf,qs=ph(nu,co),jr?wl(Mf):Is}function Pc(Mf){var Dp=Mf-mr,Tu=Mf-Xr,yx=co-Dp;return ua?df(yx,Os-Tu):yx}function Ul(Mf){var Dp=Mf-mr,Tu=Mf-Xr;return mr===ke||Dp>=co||Dp<0||ua&&Tu>=Os}function nu(){var Mf=Yv();if(Ul(Mf))return vu(Mf);qs=ph(nu,Pc(Mf))}function vu(Mf){return qs=ke,ja&&Ho?wl(Mf):(Ho=ts=ke,Is)}function nh(){qs!==ke&&tg(qs),Xr=0,Ho=mr=ts=qs=ke}function Mh(){return qs===ke?Is:vu(Yv())}function Rp(){var Mf=Yv(),Dp=Ul(Mf);if(Ho=arguments,ts=this,mr=Mf,Dp){if(qs===ke)return Kl(mr);if(ua)return tg(qs),qs=ph(nu,co),wl(mr)}return qs===ke&&(qs=ph(nu,co)),Is}return Rp.cancel=nh,Rp.flush=Mh,Rp}var Xy=Sc(function(so,co){return L1(so,1,co)}),TS=Sc(function(so,co,wo){return L1(so,ap(co)||0,wo)});function n_(so){return sg(so,os)}function Pp(so,co){if(typeof so!="function"||co!=null&&typeof co!="function")throw new _d(Un);var wo=function(){var Ho=arguments,ts=co?co.apply(this,Ho):Ho[0],Os=wo.cache;if(Os.has(ts))return Os.get(ts);var Is=so.apply(this,Ho);return wo.cache=Os.set(ts,Is)||Os,Is};return wo.cache=new(Pp.Cache||zu),wo}Pp.Cache=zu;function ug(so){if(typeof so!="function")throw new _d(Un);return function(){var co=arguments;switch(co.length){case 0:return!so.call(this);case 1:return!so.call(this,co[0]);case 2:return!so.call(this,co[0],co[1]);case 3:return!so.call(this,co[0],co[1],co[2])}return!so.apply(this,co)}}function H2(so){return e_(2,so)}var lr=Pd(function(so,co){co=co.length==1&&$l(co[0])?ud(co[0],Ld(Ll())):ud(hd(co,1),Ld(Ll()));var wo=co.length;return Sc(function(Ho){for(var ts=-1,Os=df(Ho.length,wo);++ts=co}),bf=Gs(function(){return arguments}())?Gs:function(so){return yf(so)&&iu.call(so,"callee")&&!Zp.call(so,"callee")},$l=Tr.isArray,Rh=ya?Ld(ya):xh;function bu(so){return so!=null&&ib(so.length)&&!f1(so)}function vf(so){return yf(so)&&bu(so)}function Gy(so){return so===!0||so===!1||yf(so)&&Fd(so)==zo}var d1=Rb||W0,Ky=fu?Ld(fu):Lm;function DS(so){return yf(so)&&so.nodeType===1&&!Ub(so)}function xC(so){if(so==null)return!0;if(bu(so)&&($l(so)||typeof so=="string"||typeof so.splice=="function"||d1(so)||Vg(so)||bf(so)))return!so.length;var co=Ph(so);if(co==Zs||co==Kr)return!so.size;if(Ep(so))return!Po(so).length;for(var wo in so)if(iu.call(so,wo))return!1;return!0}function r_(so,co){return mh(so,co)}function MS(so,co,wo){wo=typeof wo=="function"?wo:ke;var Ho=wo?wo(so,co):ke;return Ho===ke?mh(so,co,ke,wo):!!Ho}function NS(so){if(!yf(so))return!1;var co=Fd(so);return co==Ca||co==ga||typeof so.message=="string"&&typeof so.name=="string"&&!Ub(so)}function V2(so){return typeof so=="number"&&yl(so)}function f1(so){if(!Vd(so))return!1;var co=Fd(so);return co==za||co==Il||co==Qs||co==Vr}function EC(so){return typeof so=="number"&&so==Ic(so)}function ib(so){return typeof so=="number"&&so>-1&&so%1==0&&so<=xs}function Vd(so){var co=typeof so;return so!=null&&(co=="object"||co=="function")}function yf(so){return so!=null&&typeof so=="object"}var z2=Lr?Ld(Lr):Xd;function ym(so,co){return so===co||Hd(so,co,G1(co))}function $T(so,co,wo){return wo=typeof wo=="function"?wo:ke,Hd(so,co,G1(co),wo)}function Qg(so){return IS(so)&&so!=+so}function Zr(so){if(HO(so))throw new zl(zn);return Iy(so)}function LS(so){return so===null}function Of(so){return so==null}function IS(so){return typeof so=="number"||yf(so)&&Fd(so)==Sr}function Ub(so){if(!yf(so)||Fd(so)!=fs)return!1;var co=t1(so);if(co===null)return!0;var wo=iu.call(co,"constructor")&&co.constructor;return typeof wo=="function"&&wo instanceof wo&&Rm.call(wo)==gv}var Jy=qc?Ld(qc):Th;function Om(so){return EC(so)&&so>=-xs&&so<=xs}var TC=Ef?Ld(Ef):Kp;function eO(so){return typeof so=="string"||!$l(so)&&yf(so)&&Fd(so)==ra}function Cd(so){return typeof so=="symbol"||yf(so)&&Fd(so)==Ml}var Vg=ku?Ld(ku):Ua;function tO(so){return so===ke}function h1(so){return yf(so)&&Ph(so)==Nl}function dg(so){return yf(so)&&Fd(so)==Zc}var ma=Jc(as),ip=Jc(function(so,co){return so<=co});function BS(so){if(!so)return[];if(bu(so))return eO(so)?zf(so):Ah(so);if(Kc&&so[Kc])return R1(so[Kc]());var co=Ph(so),wo=co==Zs?Xm:co==Kr?Gg:zg;return wo(so)}function m1(so){if(!so)return so===0?so:0;if(so=ap(so),so===gs||so===-gs){var co=so<0?-1:1;return co*Qr}return so===so?so:0}function Ic(so){var co=m1(so),wo=co%1;return co===co?wo?co-wo:co:0}function FS(so){return so?Ec(Ic(so),0,ws):0}function ap(so){if(typeof so=="number")return so;if(Cd(so))return cr;if(Vd(so)){var co=typeof so.valueOf=="function"?so.valueOf():so;so=Vd(co)?co+"":co}if(typeof so!="string")return so===0?so:+so;so=Tf(so);var wo=ir.test(so);return wo||Aa.test(so)?aa(so.slice(2),wo?2:8):ks.test(so)?cr:+so}function i_(so){return kp(so,_m(so))}function W2(so){return so?Ec(Ic(so),-xs,xs):so===0?so:0}function Zu(so){return so==null?"":Wu(so)}var U2=xp(function(so,co){if(Ep(co)||bu(co)){kp(co,th(co),so);return}for(var wo in co)iu.call(co,wo)&&$g(so,wo,co[wo])}),bh=xp(function(so,co){kp(co,_m(co),so)}),Zb=xp(function(so,co,wo,Ho){kp(co,_m(co),so,Ho)}),Z2=xp(function(so,co,wo,Ho){kp(co,th(co),so,Ho)}),q2=Y1(Lu);function HS(so,co){var wo=dm(so);return co==null?wo:Rg(wo,co)}var j2=Sc(function(so,co){so=Uc(so);var wo=-1,Ho=co.length,ts=Ho>2?co[2]:ke;for(ts&&gm(co[0],co[1],ts)&&(Ho=1);++wo1),Os}),kp(so,eu(so),wo),Ho&&(wo=td(wo,io|uo|ho,A2));for(var ts=co.length;ts--;)op(wo,co[ts]);return wo});function MC(so,co){return lb(so,ug(Ll(co)))}var RT=Y1(function(so,co){return so==null?{}:Ac(so,co)});function lb(so,co){if(so==null)return{};var wo=ud(eu(so),function(Ho){return[Ho]});return co=Ll(co),gu(so,wo,function(Ho,ts){return co(Ho,ts[0])})}function K2(so,co,wo){co=z1(co,so);var Ho=-1,ts=co.length;for(ts||(ts=1,so=ke);++Hoco){var Ho=so;so=co,co=Ho}if(wo||so%1||co%1){var ts=Ju();return df(so+ts*(co-so+Hp("1e-"+((ts+"").length-1))),co)}return Jp(so,co)}var p1=j1(function(so,co,wo){return co=co.toLowerCase(),so+(wo?ty(co):co)});function ty(so){return h_(Zu(so).toLowerCase())}function ny(so){return so=Zu(so),so&&so.replace(_l,Ab).replace(rs,"")}function u_(so,co,wo){so=Zu(so),co=Wu(co);var Ho=so.length;wo=wo===ke?Ho:Ec(Ic(wo),0,Ho);var ts=wo;return wo-=co.length,wo>=0&&so.slice(wo,ts)==co}function oO(so){return so=Zu(so),so&&vs.test(so)?so.replace(Pl,P1):so}function $p(so){return so=Zu(so),so&&il.test(so)?so.replace(Mr,"\\$&"):so}var oy=j1(function(so,co,wo){return so+(wo?"-":"")+co.toLowerCase()}),sO=j1(function(so,co,wo){return so+(wo?" ":"")+co.toLowerCase()}),qb=kv("toLowerCase");function d_(so,co,wo){so=Zu(so),co=Ic(co);var Ho=co?Wp(so):0;if(!co||Ho>=co)return so;var ts=(co-Ho)/2;return Lb(uf(ts),wo)+so+Lb(lm(ts),wo)}function nx(so,co,wo){so=Zu(so),co=Ic(co);var Ho=co?Wp(so):0;return co&&Ho>>0,wo?(so=Zu(so),so&&(typeof co=="string"||co!=null&&!Jy(co))&&(co=Wu(co),!co&&jd(so))?Cp(zf(so),0,wo):so.split(co,wo)):[]}var HC=j1(function(so,co,wo){return so+(wo?" ":"")+h_(co)});function ax(so,co,wo){return so=Zu(so),wo=wo==null?0:Ec(Ic(wo),0,so.length),co=Wu(co),so.slice(wo,wo+co.length)==co}function QC(so,co,wo){var Ho=ss.templateSettings;wo&&gm(so,co,wo)&&(co=ke),so=Zu(so),co=Zb({},co,Ho,cC);var ts=Zb({},co.imports,Ho.imports,cC),Os=th(ts),Is=Od(ts,Os),qs,mr,Xr=0,jr=co.interpolate||Hc,ua="__p += '",ja=D1((co.escape||Hc).source+"|"+jr.source+"|"+(jr===pr?Vu:Hc).source+"|"+(co.evaluate||Hc).source+"|$","g"),wl="//# sourceURL="+(iu.call(co,"sourceURL")?(co.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Nc+"]")+` +`;so.replace(ja,function(Ul,nu,vu,nh,Mh,Rp){return vu||(vu=nh),ua+=so.slice(Xr,Rp).replace(Ds,Yf),nu&&(qs=!0,ua+=`' + +__e(`+nu+`) + +'`),Mh&&(mr=!0,ua+=`'; +`+Mh+`; +__p += '`),vu&&(ua+=`' + +((__t = (`+vu+`)) == null ? '' : __t) + +'`),Xr=Rp+Ul.length,Ul}),ua+=`'; +`;var Kl=iu.call(co,"variable")&&co.variable;if(!Kl)ua=`with (obj) { +`+ua+` +} +`;else if(ad.test(Kl))throw new zl(qn);ua=(mr?ua.replace(rd,""):ua).replace(Al,"$1").replace(gd,"$1;"),ua="function("+(Kl||"obj")+`) { +`+(Kl?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(qs?", __e = _.escape":"")+(mr?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+ua+`return __p +}`;var Pc=zC(function(){return _c(Os,wl+"return "+ua).apply(ke,Is)});if(Pc.source=ua,NS(Pc))throw Pc;return Pc}function lx(so){return Zu(so).toLowerCase()}function f_(so){return Zu(so).toUpperCase()}function cx(so,co,wo){if(so=Zu(so),so&&(wo||co===ke))return Tf(so);if(!so||!(co=Wu(co)))return so;var Ho=zf(so),ts=zf(co),Os=Vh(Ho,ts),Is=zp(Ho,ts)+1;return Cp(Ho,Os,Is).join("")}function VC(so,co,wo){if(so=Zu(so),so&&(wo||co===ke))return so.slice(0,b0(so)+1);if(!so||!(co=Wu(co)))return so;var Ho=zf(so),ts=zp(Ho,zf(co))+1;return Cp(Ho,0,ts).join("")}function sy(so,co,wo){if(so=Zu(so),so&&(wo||co===ke))return so.replace(Na,"");if(!so||!(co=Wu(co)))return so;var Ho=zf(so),ts=Vh(Ho,zf(co));return Cp(Ho,ts).join("")}function jS(so,co){var wo=ms,Ho=is;if(Vd(co)){var ts="separator"in co?co.separator:ts;wo="length"in co?Ic(co.length):wo,Ho="omission"in co?Wu(co.omission):Ho}so=Zu(so);var Os=so.length;if(jd(so)){var Is=zf(so);Os=Is.length}if(wo>=Os)return so;var qs=wo-Wp(Ho);if(qs<1)return Ho;var mr=Is?Cp(Is,0,qs).join(""):so.slice(0,qs);if(ts===ke)return mr+Ho;if(Is&&(qs+=mr.length-qs),Jy(ts)){if(so.slice(qs).search(ts)){var Xr,jr=mr;for(ts.global||(ts=D1(ts.source,Zu(Ts.exec(ts))+"g")),ts.lastIndex=0;Xr=ts.exec(jr);)var ua=Xr.index;mr=mr.slice(0,ua===ke?qs:ua)}}else if(so.indexOf(Wu(ts),qs)!=qs){var ja=mr.lastIndexOf(ts);ja>-1&&(mr=mr.slice(0,ja))}return mr+Ho}function XS(so){return so=Zu(so),so&&Su.test(so)?so.replace(Rr,Cs):so}var YS=j1(function(so,co,wo){return so+(wo?" ":"")+co.toUpperCase()}),h_=kv("toUpperCase");function m_(so,co,wo){return so=Zu(so),co=wo?ke:co,co===ke?$m(so)?Kg(so):A1(so):so.match(co)||[]}var zC=Sc(function(so,co){try{return jc(so,ke,co)}catch(wo){return NS(wo)?wo:new zl(wo)}}),p_=Y1(function(so,co){return El(co,function(wo){wo=Bm(wo),Nm(so,wo,Yd(so[wo],so))}),so});function g_(so){var co=so==null?0:so.length,wo=Ll();return so=co?ud(so,function(Ho){if(typeof Ho[1]!="function")throw new _d(Un);return[wo(Ho[0]),Ho[1]]}):[],Sc(function(Ho){for(var ts=-1;++tsxs)return[];var wo=ws,Ho=df(so,ws);co=Ll(co),so-=ws;for(var ts=Gc(Ho,co);++wo0||co<0)?new Xc(wo):(so<0?wo=wo.takeRight(-so):so&&(wo=wo.drop(so)),co!==ke&&(co=Ic(co),wo=co<0?wo.dropRight(-co):wo.take(co-so)),wo)},Xc.prototype.takeRightWhile=function(so){return this.reverse().takeWhile(so).reverse()},Xc.prototype.toArray=function(){return this.take(ws)},tp(Xc.prototype,function(so,co){var wo=/^(?:filter|find|map|reject)|While$/.test(co),Ho=/^(?:head|last)$/.test(co),ts=ss[Ho?"take"+(co=="last"?"Right":""):co],Os=Ho||/^find/.test(co);ts&&(ss.prototype[co]=function(){var Is=this.__wrapped__,qs=Ho?[1]:arguments,mr=Is instanceof Xc,Xr=qs[0],jr=mr||$l(Is),ua=function(nu){var vu=ts.apply(ss,vp([nu],qs));return Ho&&ja?vu[0]:vu};jr&&wo&&typeof Xr=="function"&&Xr.length!=1&&(mr=jr=!1);var ja=this.__chain__,wl=!!this.__actions__.length,Kl=Os&&!ja,Pc=mr&&!wl;if(!Os&&jr){Is=Pc?Is:new Xc(this);var Ul=so.apply(Is,qs);return Ul.__actions__.push({func:N0,args:[ua],thisArg:ke}),new Ch(Ul,ja)}return Kl&&Pc?so.apply(this,qs):(Ul=this.thru(ua),Kl?Ho?Ul.value()[0]:Ul.value():Ul)})}),El(["pop","push","shift","sort","splice","unshift"],function(so){var co=Wh[so],wo=/^(?:push|sort|unshift)$/.test(so)?"tap":"thru",Ho=/^(?:pop|shift)$/.test(so);ss.prototype[so]=function(){var ts=arguments;if(Ho&&!this.__chain__){var Os=this.value();return co.apply($l(Os)?Os:[],ts)}return this[wo](function(Is){return co.apply($l(Is)?Is:[],ts)})}}),tp(Xc.prototype,function(so,co){var wo=ss[co];if(wo){var Ho=wo.name+"";iu.call(Fu,Ho)||(Fu[Ho]=[]),Fu[Ho].push({name:co,func:wo})}}),Fu[Wl(ke,$o).name]=[{name:"wrapper",func:ke}],Xc.prototype.clone=Ov,Xc.prototype.reverse=Db,Xc.prototype.value=S0,ss.prototype.at=L0,ss.prototype.chain=L2,ss.prototype.commit=SC,ss.prototype.next=kS,ss.prototype.plant=GO,ss.prototype.reverse=Rd,ss.prototype.toJSON=ss.prototype.valueOf=ss.prototype.value=Bg,ss.prototype.first=ss.prototype.head,Kc&&(ss.prototype[Kc]=Hm),ss},Jg=v0();_s?((_s.exports=Jg)._=Jg,cs._=Jg):Uo._=Jg}).call(commonjsGlobal)})(lodash,lodash.exports);var lodashExports=lodash.exports;function create_fragment$1d(_n){let Ce,ke,$n;return{c(){Ce=element("input"),attr(Ce,"type","checkbox"),Ce.value=_n[0],attr(Ce,"class","switch"),Ce.checked=_n[1]},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"change",_n[2]),ke=!0)},p(Hn,[zn]){zn&1&&(Ce.value=Hn[0]),zn&2&&(Ce.checked=Hn[1])},i:noop,o:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function instance$1d(_n,Ce,ke){let{value:$n}=Ce,{checked:Hn=!1}=Ce;function zn(Un){bubble.call(this,_n,Un)}return _n.$$set=Un=>{"value"in Un&&ke(0,$n=Un.value),"checked"in Un&&ke(1,Hn=Un.checked)},[$n,Hn,zn]}class Switch extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1d,create_fragment$1d,safe_not_equal,{value:0,checked:1})}}function create_if_block_3$9(_n){let Ce,ke;return Ce=new Switch({props:{value:"published",checked:_n[0].status==="published"}}),Ce.$on("change",_n[1]),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&1&&(zn.checked=$n[0].status==="published"),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_if_block_2$d(_n){let Ce;return{c(){Ce=text("Trashed")},m(ke,$n){insert$1(ke,Ce,$n)},d(ke){ke&&detach(Ce)}}}function create_if_block_1$u(_n){let Ce;return{c(){Ce=text("Draft")},m(ke,$n){insert$1(ke,Ce,$n)},d(ke){ke&&detach(Ce)}}}function create_if_block$S(_n){let Ce;return{c(){Ce=text("Published")},m(ke,$n){insert$1(ke,Ce,$n)},d(ke){ke&&detach(Ce)}}}function create_fragment$1c(_n){let Ce,ke,$n,Hn=_n[0].status!=="trashed"&&create_if_block_3$9(_n);function zn(Xn,Kn){if(Xn[0].status==="published")return create_if_block$S;if(Xn[0].status==="draft")return create_if_block_1$u;if(Xn[0].status==="trashed")return create_if_block_2$d}let Un=zn(_n),qn=Un&&Un(_n);return{c(){Hn&&Hn.c(),Ce=space$3(),qn&&qn.c(),ke=empty$1()},m(Xn,Kn){Hn&&Hn.m(Xn,Kn),insert$1(Xn,Ce,Kn),qn&&qn.m(Xn,Kn),insert$1(Xn,ke,Kn),$n=!0},p(Xn,[Kn]){Xn[0].status!=="trashed"?Hn?(Hn.p(Xn,Kn),Kn&1&&transition_in(Hn,1)):(Hn=create_if_block_3$9(Xn),Hn.c(),transition_in(Hn,1),Hn.m(Ce.parentNode,Ce)):Hn&&(group_outros(),transition_out(Hn,1,1,()=>{Hn=null}),check_outros()),Un!==(Un=zn(Xn))&&(qn&&qn.d(1),qn=Un&&Un(Xn),qn&&(qn.c(),qn.m(ke.parentNode,ke)))},i(Xn){$n||(transition_in(Hn),$n=!0)},o(Xn){transition_out(Hn),$n=!1},d(Xn){Xn&&(detach(Ce),detach(ke)),Hn&&Hn.d(Xn),qn&&qn.d(Xn)}}}function instance$1c(_n,Ce,ke){let{status:$n="draft"}=Ce,{record:Hn}=Ce;function zn(Un){Un.target.checked?ke(2,$n="published"):ke(2,$n="draft")}return _n.$$set=Un=>{"status"in Un&&ke(2,$n=Un.status),"record"in Un&&ke(0,Hn=Un.record)},[Hn,zn,$n]}class StatusSelect extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1c,create_fragment$1c,safe_not_equal,{status:2,record:0})}}function create_if_block$R(_n){let Ce,ke;return Ce=new Dropdown({props:{$$slots:{button:[create_button_slot$8],default:[create_default_slot$9]},$$scope:{ctx:_n}}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&270&&(zn.$$scope={dirty:Hn,ctx:$n}),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_if_block_1$t(_n){let Ce,ke,$n,Hn;return{c(){Ce=element("a"),ke=text("Clone"),attr(Ce,"class","dropdown-item"),attr(Ce,"href",_n[4].lucentUrl)},m(zn,Un){insert$1(zn,Ce,Un),append(Ce,ke),$n||(Hn=listen(Ce,"click",_n[5]),$n=!0)},p:noop,d(zn){zn&&detach(Ce),$n=!1,Hn()}}}function create_default_slot$9(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo=!_n[3]&&create_if_block_1$t(_n);return{c(){Ce=element("h6"),Ce.textContent="Record Actions",ke=space$3(),$n=element("a"),Hn=text("Create new"),Un=space$3(),uo&&uo.c(),qn=space$3(),Xn=element("a"),Kn=text("Revisions"),attr(Ce,"class","dropdown-header"),attr($n,"class","dropdown-item"),attr($n,"href",zn=_n[4].lucentUrl+"/records/new?schema="+_n[2].name),attr(Xn,"class","dropdown-item"),attr(Xn,"href",_n[4].lucentUrl)},m(ho,bo){insert$1(ho,Ce,bo),insert$1(ho,ke,bo),insert$1(ho,$n,bo),append($n,Hn),insert$1(ho,Un,bo),uo&&uo.m(ho,bo),insert$1(ho,qn,bo),insert$1(ho,Xn,bo),append(Xn,Kn),to||(io=listen(Xn,"click",prevent_default(_n[6])),to=!0)},p(ho,bo){bo&4&&zn!==(zn=ho[4].lucentUrl+"/records/new?schema="+ho[2].name)&&attr($n,"href",zn),ho[3]?uo&&(uo.d(1),uo=null):uo?uo.p(ho,bo):(uo=create_if_block_1$t(ho),uo.c(),uo.m(qn.parentNode,qn))},d(ho){ho&&(detach(Ce),detach(ke),detach($n),detach(Un),detach(qn),detach(Xn)),uo&&uo.d(ho),to=!1,io()}}}function create_button_slot$8(_n){let Ce,ke,$n;return ke=new Icon({props:{icon:"ellipsis"}}),{c(){Ce=element("div"),create_component(ke.$$.fragment),attr(Ce,"slot","button")},m(Hn,zn){insert$1(Hn,Ce,zn),mount_component(ke,Ce,null),$n=!0},p:noop,i(Hn){$n||(transition_in(ke.$$.fragment,Hn),$n=!0)},o(Hn){transition_out(ke.$$.fragment,Hn),$n=!1},d(Hn){Hn&&detach(Ce),destroy_component(ke)}}}function create_fragment$1b(_n){let Ce,ke,$n,Hn,zn,Un=!_n[3]&&create_if_block$R(_n);function qn(Kn){_n[7](Kn)}let Xn={record:_n[0]};return _n[0].status!==void 0&&(Xn.status=_n[0].status),$n=new StatusSelect({props:Xn}),binding_callbacks.push(()=>bind($n,"status",qn)),{c(){Ce=element("div"),Un&&Un.c(),ke=space$3(),create_component($n.$$.fragment),set_style(Ce,"display","flex"),set_style(Ce,"align-items","center"),set_style(Ce,"gap","10px")},m(Kn,to){insert$1(Kn,Ce,to),Un&&Un.m(Ce,null),append(Ce,ke),mount_component($n,Ce,null),zn=!0},p(Kn,[to]){Kn[3]?Un&&(group_outros(),transition_out(Un,1,1,()=>{Un=null}),check_outros()):Un?(Un.p(Kn,to),to&8&&transition_in(Un,1)):(Un=create_if_block$R(Kn),Un.c(),transition_in(Un,1),Un.m(Ce,ke));const io={};to&1&&(io.record=Kn[0]),!Hn&&to&1&&(Hn=!0,io.status=Kn[0].status,add_flush_callback(()=>Hn=!1)),$n.$set(io)},i(Kn){zn||(transition_in(Un),transition_in($n.$$.fragment,Kn),zn=!0)},o(Kn){transition_out(Un),transition_out($n.$$.fragment,Kn),zn=!1},d(Kn){Kn&&detach(Ce),Un&&Un.d(),destroy_component($n)}}}function instance$1b(_n,Ce,ke){const $n=getContext$1("channel");let{schema:Hn}=Ce,{record:zn}=Ce,{isCreateMode:Un}=Ce,{activeContentTab:qn}=Ce;function Xn(io){io.preventDefault(),axios.post($n.lucentUrl+"/records/clone/"+zn.id).then(uo=>{window.location=$n.lucentUrl+"/records/"+uo.data.id}).catch(uo=>{})}const Kn=io=>ke(1,qn="_info");function to(io){_n.$$.not_equal(zn.status,io)&&(zn.status=io,ke(0,zn))}return _n.$$set=io=>{"schema"in io&&ke(2,Hn=io.schema),"record"in io&&ke(0,zn=io.record),"isCreateMode"in io&&ke(3,Un=io.isCreateMode),"activeContentTab"in io&&ke(1,qn=io.activeContentTab)},[zn,qn,Hn,Un,$n,Xn,Kn,to]}class EditHeader extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1b,create_fragment$1b,safe_not_equal,{schema:2,record:0,isCreateMode:3,activeContentTab:1})}}function imgurl(_n,Ce){return Ce._file.mime==="image/svg+xml"?fileurl(_n,Ce):_n.disks[Ce._file.disk]+`/thumbs/${Ce._file.path}`}function fileurl(_n,Ce){return _n.disks[Ce._file.disk]+`/${Ce._file.path}`}function htmlurl(_n,Ce,ke){let $n="",Hn=fileurl(_n,Ce);if(Ce._file.width>0){let zn=Hn;ke&&(zn=_n.disks[Ce._file.disk]+`/templates/${ke}/${Ce._file.path}`),$n=`${Ce._file.path}`}else Ce._file.mime==="image/svg+xml"?$n=`${Ce._file.path}`:$n=`${Ce._file.originalName}`;return $n}function create_if_block_1$s(_n){let Ce,ke,$n,Hn,zn;const Un=[create_if_block_2$c,create_else_block$m],qn=[];function Xn(Kn,to){return to&1&&(Ce=null),Ce==null&&(Ce=!!Kn[0]._file.mime.startsWith("image")),Ce?0:1}return ke=Xn(_n,-1),$n=qn[ke]=Un[ke](_n),{c(){$n.c(),Hn=empty$1()},m(Kn,to){qn[ke].m(Kn,to),insert$1(Kn,Hn,to),zn=!0},p(Kn,to){let io=ke;ke=Xn(Kn,to),ke===io?qn[ke].p(Kn,to):(group_outros(),transition_out(qn[io],1,1,()=>{qn[io]=null}),check_outros(),$n=qn[ke],$n?$n.p(Kn,to):($n=qn[ke]=Un[ke](Kn),$n.c()),transition_in($n,1),$n.m(Hn.parentNode,Hn))},i(Kn){zn||(transition_in($n),zn=!0)},o(Kn){transition_out($n),zn=!1},d(Kn){Kn&&detach(Hn),qn[ke].d(Kn)}}}function create_else_block$m(_n){let Ce,ke,$n,Hn,zn,Un=_n[0]._file.path.split(".").pop().toLowerCase()+"",qn,Xn,Kn,to;return ke=new Icon({props:{icon:"file",width:_n[3],height:_n[3]}}),{c(){Ce=element("a"),create_component(ke.$$.fragment),$n=space$3(),Hn=element("span"),zn=text("."),qn=text(Un),attr(Hn,"class","ms-2"),attr(Ce,"href",Xn=_n[4].lucentUrl+"/records/"+_n[0].id),attr(Ce,"title",Kn=_n[0]._file.path),attr(Ce,"class","file-preview-small"),set_style(Ce,"width",_n[2]+"px"),set_style(Ce,"height",_n[2]+"px")},m(io,uo){insert$1(io,Ce,uo),mount_component(ke,Ce,null),append(Ce,$n),append(Ce,Hn),append(Hn,zn),append(Hn,qn),to=!0},p(io,uo){const ho={};uo&8&&(ho.width=io[3]),uo&8&&(ho.height=io[3]),ke.$set(ho),(!to||uo&1)&&Un!==(Un=io[0]._file.path.split(".").pop().toLowerCase()+"")&&set_data(qn,Un),(!to||uo&1&&Xn!==(Xn=io[4].lucentUrl+"/records/"+io[0].id))&&attr(Ce,"href",Xn),(!to||uo&1&&Kn!==(Kn=io[0]._file.path))&&attr(Ce,"title",Kn),(!to||uo&4)&&set_style(Ce,"width",io[2]+"px"),(!to||uo&4)&&set_style(Ce,"height",io[2]+"px")},i(io){to||(transition_in(ke.$$.fragment,io),to=!0)},o(io){transition_out(ke.$$.fragment,io),to=!1},d(io){io&&detach(Ce),destroy_component(ke)}}}function create_if_block_2$c(_n){let Ce,ke,$n,Hn,zn,Un;return{c(){Ce=element("a"),ke=element("img"),attr(ke,"class","rounded w-100 svelte-1mb3bsz"),src_url_equal(ke.src,$n=imgurl(_n[4],_n[0]))||attr(ke,"src",$n),attr(ke,"alt",Hn=_n[0]._file.path),attr(Ce,"href",zn=_n[4].lucentUrl+"/records/"+_n[0].id),attr(Ce,"title",Un=_n[0]._file.originalName),set_style(Ce,"width",_n[2]+"px"),set_style(Ce,"height",_n[2]+"px")},m(qn,Xn){insert$1(qn,Ce,Xn),append(Ce,ke)},p(qn,Xn){Xn&1&&!src_url_equal(ke.src,$n=imgurl(qn[4],qn[0]))&&attr(ke,"src",$n),Xn&1&&Hn!==(Hn=qn[0]._file.path)&&attr(ke,"alt",Hn),Xn&1&&zn!==(zn=qn[4].lucentUrl+"/records/"+qn[0].id)&&attr(Ce,"href",zn),Xn&1&&Un!==(Un=qn[0]._file.originalName)&&attr(Ce,"title",Un),Xn&4&&set_style(Ce,"width",qn[2]+"px"),Xn&4&&set_style(Ce,"height",qn[2]+"px")},i:noop,o:noop,d(qn){qn&&detach(Ce)}}}function create_if_block$Q(_n){let Ce,ke=_n[0]._file.path+"",$n,Hn,zn;return{c(){Ce=element("a"),$n=text(ke),attr(Ce,"href",Hn=_n[4].lucentUrl+"/records/"+_n[0].id),attr(Ce,"title",zn=_n[0]._file.path),attr(Ce,"class","preview-file-filename lx-small-text text-decoration-none")},m(Un,qn){insert$1(Un,Ce,qn),append(Ce,$n)},p(Un,qn){qn&1&&ke!==(ke=Un[0]._file.path+"")&&set_data($n,ke),qn&1&&Hn!==(Hn=Un[4].lucentUrl+"/records/"+Un[0].id)&&attr(Ce,"href",Hn),qn&1&&zn!==(zn=Un[0]._file.path)&&attr(Ce,"title",zn)},d(Un){Un&&detach(Ce)}}}function create_fragment$1a(_n){let Ce,ke,$n,Hn=_n[0]&&create_if_block_1$s(_n),zn=_n[1]&&create_if_block$Q(_n);return{c(){Ce=element("div"),Hn&&Hn.c(),ke=space$3(),zn&&zn.c(),set_style(Ce,"display","flex"),set_style(Ce,"align-items","center"),set_style(Ce,"gap","5px")},m(Un,qn){insert$1(Un,Ce,qn),Hn&&Hn.m(Ce,null),append(Ce,ke),zn&&zn.m(Ce,null),$n=!0},p(Un,[qn]){Un[0]?Hn?(Hn.p(Un,qn),qn&1&&transition_in(Hn,1)):(Hn=create_if_block_1$s(Un),Hn.c(),transition_in(Hn,1),Hn.m(Ce,ke)):Hn&&(group_outros(),transition_out(Hn,1,1,()=>{Hn=null}),check_outros()),Un[1]?zn?zn.p(Un,qn):(zn=create_if_block$Q(Un),zn.c(),zn.m(Ce,null)):zn&&(zn.d(1),zn=null)},i(Un){$n||(transition_in(Hn),$n=!0)},o(Un){transition_out(Hn),$n=!1},d(Un){Un&&detach(Ce),Hn&&Hn.d(),zn&&zn.d()}}}function instance$1a(_n,Ce,ke){let{record:$n}=Ce;const Hn=getContext$1("channel");let{size:zn="small"}=Ce,{showFilename:Un=!1}=Ce,qn,Xn;return zn=="large"?(qn=256,Xn=32):zn=="medium"?(qn=128,Xn=12):zn=="small"?(qn=64,Xn=12):zn=="tiny"&&(qn=42,Xn=12),_n.$$set=Kn=>{"record"in Kn&&ke(0,$n=Kn.record),"size"in Kn&&ke(5,zn=Kn.size),"showFilename"in Kn&&ke(1,Un=Kn.showFilename)},[$n,Un,qn,Xn,Hn,zn]}class Preview extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1a,create_fragment$1a,safe_not_equal,{record:0,size:5,showFilename:1})}}function create_if_block$P(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to=_n[0]._file.path+"",io,uo,ho,bo,Oo,So,$o=_n[0]._file.originalName+"",Do,xo,Io,Vo,Jo,Mo,Go=_n[0]._file.mime+"",os,ms,is,Yo,Ys,sr,Js,ko=(_n[0]._file.size/1024).toFixed(1)+"",gs,xs,Qr,cr,ws,Fs,Br,_r=_n[0]._file.checksum+"",ha,hs,Qs,zo,el,ga,Ca;$n=new Preview({props:{record:_n[0],size:"large"}});let za=_n[0]._file.width&&create_if_block_1$r(_n);return{c(){Ce=element("div"),ke=element("div"),create_component($n.$$.fragment),Hn=space$3(),zn=element("div"),Un=element("div"),qn=element("span"),qn.textContent="Filename",Xn=space$3(),Kn=element("span"),io=text(to),uo=space$3(),ho=element("div"),bo=element("span"),bo.textContent="Original name",Oo=space$3(),So=element("span"),Do=text($o),xo=space$3(),Io=element("div"),Vo=element("span"),Vo.textContent="Mime type",Jo=space$3(),Mo=element("span"),os=text(Go),ms=space$3(),za&&za.c(),is=space$3(),Yo=element("div"),Ys=element("span"),Ys.textContent="File size",sr=space$3(),Js=element("span"),gs=text(ko),xs=text("kB"),Qr=space$3(),cr=element("div"),ws=element("span"),ws.textContent="Checksum",Fs=space$3(),Br=element("span"),ha=text(_r),hs=space$3(),Qs=element("div"),zo=element("a"),el=text("Download"),attr(qn,"class","text-muted"),attr(Un,"class","file-details-item"),attr(bo,"class","text-muted"),attr(ho,"class","file-details-item"),attr(Vo,"class","text-muted"),attr(Io,"class","file-details-item"),attr(Ys,"class","text-muted"),attr(Yo,"class","file-details-item"),attr(ws,"class","text-muted"),attr(cr,"class","file-details-item"),attr(zo,"class","button primary"),attr(zo,"target","_blank"),set_style(zo,"display","inline-flex"),attr(zo,"href",ga=fileurl(_n[2],_n[0])),attr(Qs,"class","file-details-item"),attr(zn,"class","file-details"),attr(Ce,"class","record-edit-file-preview")},m(Il,Zs){insert$1(Il,Ce,Zs),append(Ce,ke),mount_component($n,ke,null),append(Ce,Hn),append(Ce,zn),append(zn,Un),append(Un,qn),append(Un,Xn),append(Un,Kn),append(Kn,io),append(zn,uo),append(zn,ho),append(ho,bo),append(ho,Oo),append(ho,So),append(So,Do),append(zn,xo),append(zn,Io),append(Io,Vo),append(Io,Jo),append(Io,Mo),append(Mo,os),append(zn,ms),za&&za.m(zn,null),append(zn,is),append(zn,Yo),append(Yo,Ys),append(Yo,sr),append(Yo,Js),append(Js,gs),append(Js,xs),append(zn,Qr),append(zn,cr),append(cr,ws),append(cr,Fs),append(cr,Br),append(Br,ha),append(zn,hs),append(zn,Qs),append(Qs,zo),append(zo,el),Ca=!0},p(Il,Zs){const Sr={};Zs&1&&(Sr.record=Il[0]),$n.$set(Sr),(!Ca||Zs&1)&&to!==(to=Il[0]._file.path+"")&&set_data(io,to),(!Ca||Zs&1)&&$o!==($o=Il[0]._file.originalName+"")&&set_data(Do,$o),(!Ca||Zs&1)&&Go!==(Go=Il[0]._file.mime+"")&&set_data(os,Go),Il[0]._file.width?za?za.p(Il,Zs):(za=create_if_block_1$r(Il),za.c(),za.m(zn,is)):za&&(za.d(1),za=null),(!Ca||Zs&1)&&ko!==(ko=(Il[0]._file.size/1024).toFixed(1)+"")&&set_data(gs,ko),(!Ca||Zs&1)&&_r!==(_r=Il[0]._file.checksum+"")&&set_data(ha,_r),(!Ca||Zs&1&&ga!==(ga=fileurl(Il[2],Il[0])))&&attr(zo,"href",ga)},i(Il){Ca||(transition_in($n.$$.fragment,Il),Ca=!0)},o(Il){transition_out($n.$$.fragment,Il),Ca=!1},d(Il){Il&&detach(Ce),destroy_component($n),za&&za.d()}}}function create_if_block_1$r(_n){let Ce,ke,$n,Hn,zn=_n[0]._file.width+"",Un,qn,Xn=_n[0]._file.height+"",Kn;return{c(){Ce=element("div"),ke=element("span"),ke.textContent="Dimensions",$n=space$3(),Hn=element("span"),Un=text(zn),qn=text("x"),Kn=text(Xn),attr(ke,"class","text-muted"),attr(Ce,"class","file-details-item")},m(to,io){insert$1(to,Ce,io),append(Ce,ke),append(Ce,$n),append(Ce,Hn),append(Hn,Un),append(Hn,qn),append(Hn,Kn)},p(to,io){io&1&&zn!==(zn=to[0]._file.width+"")&&set_data(Un,zn),io&1&&Xn!==(Xn=to[0]._file.height+"")&&set_data(Kn,Xn)},d(to){to&&detach(Ce)}}}function create_fragment$19(_n){let Ce,ke,$n=_n[1].type==="files"&&create_if_block$P(_n);return{c(){$n&&$n.c(),Ce=empty$1()},m(Hn,zn){$n&&$n.m(Hn,zn),insert$1(Hn,Ce,zn),ke=!0},p(Hn,[zn]){Hn[1].type==="files"?$n?($n.p(Hn,zn),zn&2&&transition_in($n,1)):($n=create_if_block$P(Hn),$n.c(),transition_in($n,1),$n.m(Ce.parentNode,Ce)):$n&&(group_outros(),transition_out($n,1,1,()=>{$n=null}),check_outros())},i(Hn){ke||(transition_in($n),ke=!0)},o(Hn){transition_out($n),ke=!1},d(Hn){Hn&&detach(Ce),$n&&$n.d(Hn)}}}function instance$19(_n,Ce,ke){const $n=getContext$1("channel");let{record:Hn}=Ce,{schema:zn}=Ce;return _n.$$set=Un=>{"record"in Un&&ke(0,Hn=Un.record),"schema"in Un&&ke(1,zn=Un.schema)},[Hn,zn,$n]}class FilePreview extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$19,create_fragment$19,safe_not_equal,{record:0,schema:1})}}function get_each_context$o(_n,Ce,ke){const $n=_n.slice();return $n[9]=Ce[ke],$n}function create_if_block$O(_n){let Ce,ke=ensure_array_like(_n[1]),$n=[];for(let Hn=0;Hn1&&create_if_block$O(_n);return{c(){ke&&ke.c(),Ce=empty$1()},m($n,Hn){ke&&ke.m($n,Hn),insert$1($n,Ce,Hn)},p($n,[Hn]){$n[1].length>1?ke?ke.p($n,Hn):(ke=create_if_block$O($n),ke.c(),ke.m(Ce.parentNode,Ce)):ke&&(ke.d(1),ke=null)},i:noop,o:noop,d($n){$n&&detach(Ce),ke&&ke.d($n)}}}function instance$18(_n,Ce,ke){var uo;let{schema:$n}=Ce,{isCreateMode:Hn}=Ce,{active:zn=""}=Ce,Un=((uo=$n.groups)==null?void 0:uo.map(ho=>({label:ho,name:ho})))??[],qn={label:"Main",name:""},Xn={label:"Backlinks",name:"_graph"};Hn?Un=[qn,...Un]:Un=[qn,...Un,Xn];function Kn(ho){ho.preventDefault(),ke(0,zn="_graph")}function to(ho,bo){ho.preventDefault(),bo=="_graph"?Kn(ho):ke(0,zn=bo)}const io=(ho,bo)=>to(bo,ho.name);return _n.$$set=ho=>{"schema"in ho&&ke(3,$n=ho.schema),"isCreateMode"in ho&&ke(4,Hn=ho.isCreateMode),"active"in ho&&ke(0,zn=ho.active)},[zn,Un,to,$n,Hn,io]}class ContentTabs extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$18,create_fragment$18,safe_not_equal,{schema:3,isCreateMode:4,active:0})}}function getErrorMessage(_n,Ce){return _n&&_n[Ce]?_n[Ce].message:null}function isArray$1(_n){return Array.isArray?Array.isArray(_n):getTag(_n)==="[object Array]"}const INFINITY=1/0;function baseToString(_n){if(typeof _n=="string")return _n;let Ce=_n+"";return Ce=="0"&&1/_n==-INFINITY?"-0":Ce}function toString(_n){return _n==null?"":baseToString(_n)}function isString(_n){return typeof _n=="string"}function isNumber(_n){return typeof _n=="number"}function isBoolean(_n){return _n===!0||_n===!1||isObjectLike(_n)&&getTag(_n)=="[object Boolean]"}function isObject(_n){return typeof _n=="object"}function isObjectLike(_n){return isObject(_n)&&_n!==null}function isDefined(_n){return _n!=null}function isBlank(_n){return!_n.trim().length}function getTag(_n){return _n==null?_n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(_n)}const EXTENDED_SEARCH_UNAVAILABLE="Extended search is not available",INCORRECT_INDEX_TYPE="Incorrect 'index' type",LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY=_n=>`Invalid value for key ${_n}`,PATTERN_LENGTH_TOO_LARGE=_n=>`Pattern length exceeds max of ${_n}.`,MISSING_KEY_PROPERTY=_n=>`Missing ${_n} property in key`,INVALID_KEY_WEIGHT_VALUE=_n=>`Property 'weight' in key '${_n}' must be a positive integer`,hasOwn=Object.prototype.hasOwnProperty;class KeyStore{constructor(Ce){this._keys=[],this._keyMap={};let ke=0;Ce.forEach($n=>{let Hn=createKey($n);this._keys.push(Hn),this._keyMap[Hn.id]=Hn,ke+=Hn.weight}),this._keys.forEach($n=>{$n.weight/=ke})}get(Ce){return this._keyMap[Ce]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function createKey(_n){let Ce=null,ke=null,$n=null,Hn=1,zn=null;if(isString(_n)||isArray$1(_n))$n=_n,Ce=createKeyPath(_n),ke=createKeyId(_n);else{if(!hasOwn.call(_n,"name"))throw new Error(MISSING_KEY_PROPERTY("name"));const Un=_n.name;if($n=Un,hasOwn.call(_n,"weight")&&(Hn=_n.weight,Hn<=0))throw new Error(INVALID_KEY_WEIGHT_VALUE(Un));Ce=createKeyPath(Un),ke=createKeyId(Un),zn=_n.getFn}return{path:Ce,id:ke,weight:Hn,src:$n,getFn:zn}}function createKeyPath(_n){return isArray$1(_n)?_n:_n.split(".")}function createKeyId(_n){return isArray$1(_n)?_n.join("."):_n}function get(_n,Ce){let ke=[],$n=!1;const Hn=(zn,Un,qn)=>{if(isDefined(zn))if(!Un[qn])ke.push(zn);else{let Xn=Un[qn];const Kn=zn[Xn];if(!isDefined(Kn))return;if(qn===Un.length-1&&(isString(Kn)||isNumber(Kn)||isBoolean(Kn)))ke.push(toString(Kn));else if(isArray$1(Kn)){$n=!0;for(let to=0,io=Kn.length;to_n.score===Ce.score?_n.idx{this._keysMap[ke.id]=$n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,isString(this.docs[0])?this.docs.forEach((Ce,ke)=>{this._addString(Ce,ke)}):this.docs.forEach((Ce,ke)=>{this._addObject(Ce,ke)}),this.norm.clear())}add(Ce){const ke=this.size();isString(Ce)?this._addString(Ce,ke):this._addObject(Ce,ke)}removeAt(Ce){this.records.splice(Ce,1);for(let ke=Ce,$n=this.size();ke<$n;ke+=1)this.records[ke].i-=1}getValueForItemAtKeyId(Ce,ke){return Ce[this._keysMap[ke]]}size(){return this.records.length}_addString(Ce,ke){if(!isDefined(Ce)||isBlank(Ce))return;let $n={v:Ce,i:ke,n:this.norm.get(Ce)};this.records.push($n)}_addObject(Ce,ke){let $n={i:ke,$:{}};this.keys.forEach((Hn,zn)=>{let Un=Hn.getFn?Hn.getFn(Ce):this.getFn(Ce,Hn.path);if(isDefined(Un)){if(isArray$1(Un)){let qn=[];const Xn=[{nestedArrIndex:-1,value:Un}];for(;Xn.length;){const{nestedArrIndex:Kn,value:to}=Xn.pop();if(isDefined(to))if(isString(to)&&!isBlank(to)){let io={v:to,i:Kn,n:this.norm.get(to)};qn.push(io)}else isArray$1(to)&&to.forEach((io,uo)=>{Xn.push({nestedArrIndex:uo,value:io})})}$n.$[zn]=qn}else if(isString(Un)&&!isBlank(Un)){let qn={v:Un,n:this.norm.get(Un)};$n.$[zn]=qn}}}),this.records.push($n)}toJSON(){return{keys:this.keys,records:this.records}}}function createIndex(_n,Ce,{getFn:ke=Config.getFn,fieldNormWeight:$n=Config.fieldNormWeight}={}){const Hn=new FuseIndex({getFn:ke,fieldNormWeight:$n});return Hn.setKeys(_n.map(createKey)),Hn.setSources(Ce),Hn.create(),Hn}function parseIndex(_n,{getFn:Ce=Config.getFn,fieldNormWeight:ke=Config.fieldNormWeight}={}){const{keys:$n,records:Hn}=_n,zn=new FuseIndex({getFn:Ce,fieldNormWeight:ke});return zn.setKeys($n),zn.setIndexRecords(Hn),zn}function computeScore$1(_n,{errors:Ce=0,currentLocation:ke=0,expectedLocation:$n=0,distance:Hn=Config.distance,ignoreLocation:zn=Config.ignoreLocation}={}){const Un=Ce/_n.length;if(zn)return Un;const qn=Math.abs($n-ke);return Hn?Un+qn/Hn:qn?1:Un}function convertMaskToIndices(_n=[],Ce=Config.minMatchCharLength){let ke=[],$n=-1,Hn=-1,zn=0;for(let Un=_n.length;zn=Ce&&ke.push([$n,Hn]),$n=-1)}return _n[zn-1]&&zn-$n>=Ce&&ke.push([$n,zn-1]),ke}const MAX_BITS=32;function search(_n,Ce,ke,{location:$n=Config.location,distance:Hn=Config.distance,threshold:zn=Config.threshold,findAllMatches:Un=Config.findAllMatches,minMatchCharLength:qn=Config.minMatchCharLength,includeMatches:Xn=Config.includeMatches,ignoreLocation:Kn=Config.ignoreLocation}={}){if(Ce.length>MAX_BITS)throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS));const to=Ce.length,io=_n.length,uo=Math.max(0,Math.min($n,io));let ho=zn,bo=uo;const Oo=qn>1||Xn,So=Oo?Array(io):[];let $o;for(;($o=_n.indexOf(Ce,bo))>-1;){let Mo=computeScore$1(Ce,{currentLocation:$o,expectedLocation:uo,distance:Hn,ignoreLocation:Kn});if(ho=Math.min(Mo,ho),bo=$o+to,Oo){let Go=0;for(;Go=ms;sr-=1){let Js=sr-1,ko=ke[_n.charAt(Js)];if(Oo&&(So[Js]=+!!ko),Yo[sr]=(Yo[sr+1]<<1|1)&ko,Mo&&(Yo[sr]|=(Do[sr+1]|Do[sr])<<1|1|Do[sr+1]),Yo[sr]&Vo&&(xo=computeScore$1(Ce,{errors:Mo,currentLocation:Js,expectedLocation:uo,distance:Hn,ignoreLocation:Kn}),xo<=ho)){if(ho=xo,bo=Js,bo<=uo)break;ms=Math.max(1,2*uo-bo)}}if(computeScore$1(Ce,{errors:Mo+1,currentLocation:uo,expectedLocation:uo,distance:Hn,ignoreLocation:Kn})>ho)break;Do=Yo}const Jo={isMatch:bo>=0,score:Math.max(.001,xo)};if(Oo){const Mo=convertMaskToIndices(So,qn);Mo.length?Xn&&(Jo.indices=Mo):Jo.isMatch=!1}return Jo}function createPatternAlphabet(_n){let Ce={};for(let ke=0,$n=_n.length;ke<$n;ke+=1){const Hn=_n.charAt(ke);Ce[Hn]=(Ce[Hn]||0)|1<<$n-ke-1}return Ce}class BitapSearch{constructor(Ce,{location:ke=Config.location,threshold:$n=Config.threshold,distance:Hn=Config.distance,includeMatches:zn=Config.includeMatches,findAllMatches:Un=Config.findAllMatches,minMatchCharLength:qn=Config.minMatchCharLength,isCaseSensitive:Xn=Config.isCaseSensitive,ignoreLocation:Kn=Config.ignoreLocation}={}){if(this.options={location:ke,threshold:$n,distance:Hn,includeMatches:zn,findAllMatches:Un,minMatchCharLength:qn,isCaseSensitive:Xn,ignoreLocation:Kn},this.pattern=Xn?Ce:Ce.toLowerCase(),this.chunks=[],!this.pattern.length)return;const to=(uo,ho)=>{this.chunks.push({pattern:uo,alphabet:createPatternAlphabet(uo),startIndex:ho})},io=this.pattern.length;if(io>MAX_BITS){let uo=0;const ho=io%MAX_BITS,bo=io-ho;for(;uo{const{isMatch:$o,score:Do,indices:xo}=search(Ce,bo,Oo,{location:Hn+So,distance:zn,threshold:Un,findAllMatches:qn,minMatchCharLength:Xn,includeMatches:$n,ignoreLocation:Kn});$o&&(uo=!0),io+=Do,$o&&xo&&(to=[...to,...xo])});let ho={isMatch:uo,score:uo?io/this.chunks.length:1};return uo&&$n&&(ho.indices=to),ho}}class BaseMatch{constructor(Ce){this.pattern=Ce}static isMultiMatch(Ce){return getMatch(Ce,this.multiRegex)}static isSingleMatch(Ce){return getMatch(Ce,this.singleRegex)}search(){}}function getMatch(_n,Ce){const ke=_n.match(Ce);return ke?ke[1]:null}class ExactMatch extends BaseMatch{constructor(Ce){super(Ce)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(Ce){const ke=Ce===this.pattern;return{isMatch:ke,score:ke?0:1,indices:[0,this.pattern.length-1]}}}class InverseExactMatch extends BaseMatch{constructor(Ce){super(Ce)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(Ce){const $n=Ce.indexOf(this.pattern)===-1;return{isMatch:$n,score:$n?0:1,indices:[0,Ce.length-1]}}}class PrefixExactMatch extends BaseMatch{constructor(Ce){super(Ce)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(Ce){const ke=Ce.startsWith(this.pattern);return{isMatch:ke,score:ke?0:1,indices:[0,this.pattern.length-1]}}}class InversePrefixExactMatch extends BaseMatch{constructor(Ce){super(Ce)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(Ce){const ke=!Ce.startsWith(this.pattern);return{isMatch:ke,score:ke?0:1,indices:[0,Ce.length-1]}}}class SuffixExactMatch extends BaseMatch{constructor(Ce){super(Ce)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(Ce){const ke=Ce.endsWith(this.pattern);return{isMatch:ke,score:ke?0:1,indices:[Ce.length-this.pattern.length,Ce.length-1]}}}class InverseSuffixExactMatch extends BaseMatch{constructor(Ce){super(Ce)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(Ce){const ke=!Ce.endsWith(this.pattern);return{isMatch:ke,score:ke?0:1,indices:[0,Ce.length-1]}}}class FuzzyMatch extends BaseMatch{constructor(Ce,{location:ke=Config.location,threshold:$n=Config.threshold,distance:Hn=Config.distance,includeMatches:zn=Config.includeMatches,findAllMatches:Un=Config.findAllMatches,minMatchCharLength:qn=Config.minMatchCharLength,isCaseSensitive:Xn=Config.isCaseSensitive,ignoreLocation:Kn=Config.ignoreLocation}={}){super(Ce),this._bitapSearch=new BitapSearch(Ce,{location:ke,threshold:$n,distance:Hn,includeMatches:zn,findAllMatches:Un,minMatchCharLength:qn,isCaseSensitive:Xn,ignoreLocation:Kn})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(Ce){return this._bitapSearch.searchIn(Ce)}}class IncludeMatch extends BaseMatch{constructor(Ce){super(Ce)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(Ce){let ke=0,$n;const Hn=[],zn=this.pattern.length;for(;($n=Ce.indexOf(this.pattern,ke))>-1;)ke=$n+zn,Hn.push([$n,ke-1]);const Un=!!Hn.length;return{isMatch:Un,score:Un?0:1,indices:Hn}}}const searchers=[ExactMatch,IncludeMatch,PrefixExactMatch,InversePrefixExactMatch,InverseSuffixExactMatch,SuffixExactMatch,InverseExactMatch,FuzzyMatch],searchersLen=searchers.length,SPACE_RE=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,OR_TOKEN="|";function parseQuery(_n,Ce={}){return _n.split(OR_TOKEN).map(ke=>{let $n=ke.trim().split(SPACE_RE).filter(zn=>zn&&!!zn.trim()),Hn=[];for(let zn=0,Un=$n.length;zn!!(_n[LogicalOperator.AND]||_n[LogicalOperator.OR]),isPath=_n=>!!_n[KeyType.PATH],isLeaf=_n=>!isArray$1(_n)&&isObject(_n)&&!isExpression(_n),convertToExplicit=_n=>({[LogicalOperator.AND]:Object.keys(_n).map(Ce=>({[Ce]:_n[Ce]}))});function parse(_n,Ce,{auto:ke=!0}={}){const $n=Hn=>{let zn=Object.keys(Hn);const Un=isPath(Hn);if(!Un&&zn.length>1&&!isExpression(Hn))return $n(convertToExplicit(Hn));if(isLeaf(Hn)){const Xn=Un?Hn[KeyType.PATH]:zn[0],Kn=Un?Hn[KeyType.PATTERN]:Hn[Xn];if(!isString(Kn))throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(Xn));const to={keyId:createKeyId(Xn),pattern:Kn};return ke&&(to.searcher=createSearcher(Kn,Ce)),to}let qn={children:[],operator:zn[0]};return zn.forEach(Xn=>{const Kn=Hn[Xn];isArray$1(Kn)&&Kn.forEach(to=>{qn.children.push($n(to))})}),qn};return isExpression(_n)||(_n=convertToExplicit(_n)),$n(_n)}function computeScore(_n,{ignoreFieldNorm:Ce=Config.ignoreFieldNorm}){_n.forEach(ke=>{let $n=1;ke.matches.forEach(({key:Hn,norm:zn,score:Un})=>{const qn=Hn?Hn.weight:null;$n*=Math.pow(Un===0&&qn?Number.EPSILON:Un,(qn||1)*(Ce?1:zn))}),ke.score=$n})}function transformMatches(_n,Ce){const ke=_n.matches;Ce.matches=[],isDefined(ke)&&ke.forEach($n=>{if(!isDefined($n.indices)||!$n.indices.length)return;const{indices:Hn,value:zn}=$n;let Un={indices:Hn,value:zn};$n.key&&(Un.key=$n.key.src),$n.idx>-1&&(Un.refIndex=$n.idx),Ce.matches.push(Un)})}function transformScore(_n,Ce){Ce.score=_n.score}function format(_n,Ce,{includeMatches:ke=Config.includeMatches,includeScore:$n=Config.includeScore}={}){const Hn=[];return ke&&Hn.push(transformMatches),$n&&Hn.push(transformScore),_n.map(zn=>{const{idx:Un}=zn,qn={item:Ce[Un],refIndex:Un};return Hn.length&&Hn.forEach(Xn=>{Xn(zn,qn)}),qn})}class Fuse{constructor(Ce,ke={},$n){this.options={...Config,...ke},this.options.useExtendedSearch,this._keyStore=new KeyStore(this.options.keys),this.setCollection(Ce,$n)}setCollection(Ce,ke){if(this._docs=Ce,ke&&!(ke instanceof FuseIndex))throw new Error(INCORRECT_INDEX_TYPE);this._myIndex=ke||createIndex(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(Ce){isDefined(Ce)&&(this._docs.push(Ce),this._myIndex.add(Ce))}remove(Ce=()=>!1){const ke=[];for(let $n=0,Hn=this._docs.length;$n-1&&(Xn=Xn.slice(0,ke)),format(Xn,this._docs,{includeMatches:$n,includeScore:Hn})}_searchStringList(Ce){const ke=createSearcher(Ce,this.options),{records:$n}=this._myIndex,Hn=[];return $n.forEach(({v:zn,i:Un,n:qn})=>{if(!isDefined(zn))return;const{isMatch:Xn,score:Kn,indices:to}=ke.searchIn(zn);Xn&&Hn.push({item:zn,idx:Un,matches:[{score:Kn,value:zn,norm:qn,indices:to}]})}),Hn}_searchLogical(Ce){const ke=parse(Ce,this.options),$n=(qn,Xn,Kn)=>{if(!qn.children){const{keyId:io,searcher:uo}=qn,ho=this._findMatches({key:this._keyStore.get(io),value:this._myIndex.getValueForItemAtKeyId(Xn,io),searcher:uo});return ho&&ho.length?[{idx:Kn,item:Xn,matches:ho}]:[]}const to=[];for(let io=0,uo=qn.children.length;io{if(isDefined(qn)){let Kn=$n(ke,qn,Xn);Kn.length&&(zn[Xn]||(zn[Xn]={idx:Xn,item:qn,matches:[]},Un.push(zn[Xn])),Kn.forEach(({matches:to})=>{zn[Xn].matches.push(...to)}))}}),Un}_searchObjectList(Ce){const ke=createSearcher(Ce,this.options),{keys:$n,records:Hn}=this._myIndex,zn=[];return Hn.forEach(({$:Un,i:qn})=>{if(!isDefined(Un))return;let Xn=[];$n.forEach((Kn,to)=>{Xn.push(...this._findMatches({key:Kn,value:Un[to],searcher:ke}))}),Xn.length&&zn.push({idx:qn,item:Un,matches:Xn})}),zn}_findMatches({key:Ce,value:ke,searcher:$n}){if(!isDefined(ke))return[];let Hn=[];if(isArray$1(ke))ke.forEach(({v:zn,i:Un,n:qn})=>{if(!isDefined(zn))return;const{isMatch:Xn,score:Kn,indices:to}=$n.searchIn(zn);Xn&&Hn.push({score:Kn,key:Ce,value:zn,idx:Un,norm:qn,indices:to})});else{const{v:zn,n:Un}=ke,{isMatch:qn,score:Xn,indices:Kn}=$n.searchIn(zn);qn&&Hn.push({score:Xn,key:Ce,value:zn,norm:Un,indices:Kn})}return Hn}}Fuse.version="7.0.0";Fuse.createIndex=createIndex;Fuse.parseIndex=parseIndex;Fuse.config=Config;Fuse.parseQuery=parse;register(ExtendedSearch);function get_each_context$n(_n,Ce,ke){const $n=_n.slice();return $n[10]=Ce[ke],$n}function create_if_block$N(_n){let Ce=[],ke=new Map,$n,Hn=ensure_array_like(_n[0]);const zn=Un=>Un[10].value;for(let Un=0;Un({value:Ce,label:Ce})):Object.entries(_n).map(([Ce,ke])=>({value:Ce,label:ke}))}function instance$17(_n,Ce,ke){let $n,{field:Hn}=Ce,{value:zn}=Ce,{search:Un=""}=Ce;const qn=createEventDispatcher();function Xn(ho,bo){ho.preventDefault(),ke(3,zn=bo.value),ke(2,Un=""),qn("selected",{option:bo})}let Kn=formatOptionsForSearch(Hn.selectOptions);const to=new Fuse(Kn,{includeScore:!1,keys:["value","label"]}),io=(ho,bo)=>Xn(bo,ho),uo=(ho,bo)=>Xn(bo,ho);return _n.$$set=ho=>{"field"in ho&&ke(4,Hn=ho.field),"value"in ho&&ke(3,zn=ho.value),"search"in ho&&ke(2,Un=ho.search)},_n.$$.update=()=>{_n.$$.dirty&4&&ke(0,$n=Un===""?Kn:to.search(Un).map(ho=>ho.item))},[$n,Xn,Un,zn,Hn,io,uo]}class Selectlist extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$17,create_fragment$17,safe_not_equal,{field:4,value:3,search:2})}}function create_if_block$M(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn;function Kn(uo,ho){return ho&2&&(ke=null),ke==null&&(ke=!!Array.isArray(uo[1].selectOptions)),ke?create_if_block_1$q:create_else_block$l}let to=Kn(_n,-1),io=to(_n);return zn=new Icon({props:{width:12,height:12,icon:"close"}}),{c(){Ce=element("div"),io.c(),$n=space$3(),Hn=element("button"),create_component(zn.$$.fragment),attr(Hn,"type","button"),attr(Hn,"class","button-text"),attr(Hn,"aria-label","Close"),attr(Ce,"class","autocomplete-selected-value")},m(uo,ho){insert$1(uo,Ce,ho),io.m(Ce,null),append(Ce,$n),append(Ce,Hn),mount_component(zn,Hn,null),Un=!0,qn||(Xn=listen(Hn,"click",prevent_default(_n[9])),qn=!0)},p(uo,ho){to===(to=Kn(uo,ho))&&io?io.p(uo,ho):(io.d(1),io=to(uo),io&&(io.c(),io.m(Ce,$n)))},i(uo){Un||(transition_in(zn.$$.fragment,uo),Un=!0)},o(uo){transition_out(zn.$$.fragment,uo),Un=!1},d(uo){uo&&detach(Ce),io.d(),destroy_component(zn),qn=!1,Xn()}}}function create_else_block$l(_n){let Ce=_n[1].selectOptions[_n[0]]+"",ke;return{c(){ke=text(Ce)},m($n,Hn){insert$1($n,ke,Hn)},p($n,Hn){Hn&3&&Ce!==(Ce=$n[1].selectOptions[$n[0]]+"")&&set_data(ke,Ce)},d($n){$n&&detach(ke)}}}function create_if_block_1$q(_n){let Ce;return{c(){Ce=text(_n[0])},m(ke,$n){insert$1(ke,Ce,$n)},p(ke,$n){$n&1&&set_data(Ce,ke[0])},d(ke){ke&&detach(Ce)}}}function create_fragment$16(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo;function ho($o){_n[7]($o)}function bo($o){_n[8]($o)}let Oo={field:_n[1]};_n[0]!==void 0&&(Oo.value=_n[0]),_n[3]!==void 0&&(Oo.search=_n[3]),zn=new Selectlist({props:Oo}),binding_callbacks.push(()=>bind(zn,"value",ho)),binding_callbacks.push(()=>bind(zn,"search",bo)),zn.$on("selected",_n[4]);let So=_n[0]&&create_if_block$M(_n);return{c(){Ce=element("div"),ke=element("input"),$n=space$3(),Hn=element("div"),create_component(zn.$$.fragment),Xn=space$3(),So&&So.c(),Kn=empty$1(),attr(ke,"type","search"),attr(ke,"placeholder","Search for options"),attr(ke,"autocomplete","off"),attr(Hn,"class","autocomplete-results"),attr(Ce,"class","autocomplete")},m($o,Do){insert$1($o,Ce,Do),append(Ce,ke),set_input_value(ke,_n[3]),_n[6](ke),append(Ce,$n),append(Ce,Hn),mount_component(zn,Hn,null),insert$1($o,Xn,Do),So&&So.m($o,Do),insert$1($o,Kn,Do),to=!0,io||(uo=listen(ke,"input",_n[5]),io=!0)},p($o,[Do]){Do&8&&ke.value!==$o[3]&&set_input_value(ke,$o[3]);const xo={};Do&2&&(xo.field=$o[1]),!Un&&Do&1&&(Un=!0,xo.value=$o[0],add_flush_callback(()=>Un=!1)),!qn&&Do&8&&(qn=!0,xo.search=$o[3],add_flush_callback(()=>qn=!1)),zn.$set(xo),$o[0]?So?(So.p($o,Do),Do&1&&transition_in(So,1)):(So=create_if_block$M($o),So.c(),transition_in(So,1),So.m(Kn.parentNode,Kn)):So&&(group_outros(),transition_out(So,1,1,()=>{So=null}),check_outros())},i($o){to||(transition_in(zn.$$.fragment,$o),transition_in(So),to=!0)},o($o){transition_out(zn.$$.fragment,$o),transition_out(So),to=!1},d($o){$o&&(detach(Ce),detach(Xn),detach(Kn)),_n[6](null),destroy_component(zn),So&&So.d($o),io=!1,uo()}}}function instance$16(_n,Ce,ke){let $n,Hn,{value:zn}=Ce,{field:Un}=Ce;function qn(){$n.focus(),$n.blur()}function Xn(){Hn=this.value,ke(3,Hn)}function Kn(ho){binding_callbacks[ho?"unshift":"push"](()=>{$n=ho,ke(2,$n)})}function to(ho){zn=ho,ke(0,zn)}function io(ho){Hn=ho,ke(3,Hn)}const uo=ho=>ke(0,zn="");return _n.$$set=ho=>{"value"in ho&&ke(0,zn=ho.value),"field"in ho&&ke(1,Un=ho.field)},[zn,Un,$n,Hn,qn,Xn,Kn,to,io,uo]}class Autocomplete extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$16,create_fragment$16,safe_not_equal,{value:0,field:1})}}function create_else_block$k(_n){let Ce,ke,$n,Hn;return{c(){Ce=element("input"),attr(Ce,"type","text"),attr(Ce,"id",_n[3]),attr(Ce,"class","form-control"),attr(Ce,"autocomplete","off"),Ce.readOnly=ke=_n[1].readonly&&!_n[2],toggle_class(Ce,"is-invalid",_n[4])},m(zn,Un){insert$1(zn,Ce,Un),set_input_value(Ce,_n[0]),$n||(Hn=listen(Ce,"input",_n[7]),$n=!0)},p(zn,Un){Un&8&&attr(Ce,"id",zn[3]),Un&6&&ke!==(ke=zn[1].readonly&&!zn[2])&&(Ce.readOnly=ke),Un&1&&Ce.value!==zn[0]&&set_input_value(Ce,zn[0]),Un&16&&toggle_class(Ce,"is-invalid",zn[4])},i:noop,o:noop,d(zn){zn&&detach(Ce),$n=!1,Hn()}}}function create_if_block_1$p(_n){let Ce,ke,$n;function Hn(Un){_n[6](Un)}let zn={field:_n[1]};return _n[0]!==void 0&&(zn.value=_n[0]),Ce=new Autocomplete({props:zn}),binding_callbacks.push(()=>bind(Ce,"value",Hn)),{c(){create_component(Ce.$$.fragment)},m(Un,qn){mount_component(Ce,Un,qn),$n=!0},p(Un,qn){const Xn={};qn&2&&(Xn.field=Un[1]),!ke&&qn&1&&(ke=!0,Xn.value=Un[0],add_flush_callback(()=>ke=!1)),Ce.$set(Xn)},i(Un){$n||(transition_in(Ce.$$.fragment,Un),$n=!0)},o(Un){transition_out(Ce.$$.fragment,Un),$n=!1},d(Un){destroy_component(Ce,Un)}}}function create_if_block$L(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[4]),attr(Ce,"class","invalid-feedback d-block")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,Hn){Hn&16&&set_data(ke,$n[4])},d($n){$n&&detach(Ce)}}}function create_fragment$15(_n){let Ce,ke,$n,Hn,zn;const Un=[create_if_block_1$p,create_else_block$k],qn=[];function Xn(to,io){return to[1].selectOptions?0:1}ke=Xn(_n),$n=qn[ke]=Un[ke](_n);let Kn=_n[4]&&create_if_block$L(_n);return{c(){Ce=element("div"),$n.c(),Hn=space$3(),Kn&&Kn.c(),set_style(Ce,"position","relative")},m(to,io){insert$1(to,Ce,io),qn[ke].m(Ce,null),append(Ce,Hn),Kn&&Kn.m(Ce,null),zn=!0},p(to,[io]){let uo=ke;ke=Xn(to),ke===uo?qn[ke].p(to,io):(group_outros(),transition_out(qn[uo],1,1,()=>{qn[uo]=null}),check_outros(),$n=qn[ke],$n?$n.p(to,io):($n=qn[ke]=Un[ke](to),$n.c()),transition_in($n,1),$n.m(Ce,Hn)),to[4]?Kn?Kn.p(to,io):(Kn=create_if_block$L(to),Kn.c(),Kn.m(Ce,null)):Kn&&(Kn.d(1),Kn=null)},i(to){zn||(transition_in($n),zn=!0)},o(to){transition_out($n),zn=!1},d(to){to&&detach(Ce),qn[ke].d(),Kn&&Kn.d()}}}function instance$15(_n,Ce,ke){let $n,{field:Hn}=Ce,{value:zn}=Ce,{isCreateMode:Un}=Ce,{validationErrors:qn}=Ce,{id:Xn}=Ce;function Kn(io){zn=io,ke(0,zn)}function to(){zn=this.value,ke(0,zn)}return _n.$$set=io=>{"field"in io&&ke(1,Hn=io.field),"value"in io&&ke(0,zn=io.value),"isCreateMode"in io&&ke(2,Un=io.isCreateMode),"validationErrors"in io&&ke(5,qn=io.validationErrors),"id"in io&&ke(3,Xn=io.id)},_n.$$.update=()=>{_n.$$.dirty&34&&ke(4,$n=getErrorMessage(qn,Hn.name))},[zn,Hn,Un,Xn,$n,qn,Kn,to]}let Text$2=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$15,create_fragment$15,safe_not_equal,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}};function create_if_block$K(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[4]),attr(Ce,"class","invalid-feedback d-block")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,Hn){Hn&16&&set_data(ke,$n[4])},d($n){$n&&detach(Ce)}}}function create_fragment$14(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn=_n[1].source+"",Kn,to,io,uo,ho=_n[4]&&create_if_block$K(_n);return{c(){Ce=element("div"),ke=element("input"),Hn=space$3(),zn=element("div"),Un=text("Leave this empty to autogenerate from "),qn=element("i"),Kn=text(Xn),to=space$3(),ho&&ho.c(),attr(ke,"type","text"),attr(ke,"id",_n[3]),attr(ke,"class","form-control"),attr(ke,"autocomplete","off"),ke.readOnly=$n=_n[1].readonly&&!_n[2],toggle_class(ke,"is-invalid",_n[4]),attr(zn,"class","system-help-text light-text"),attr(Ce,"class","mb-0")},m(bo,Oo){insert$1(bo,Ce,Oo),append(Ce,ke),set_input_value(ke,_n[0]),append(Ce,Hn),append(Ce,zn),append(zn,Un),append(zn,qn),append(qn,Kn),append(Ce,to),ho&&ho.m(Ce,null),io||(uo=listen(ke,"input",_n[6]),io=!0)},p(bo,[Oo]){Oo&8&&attr(ke,"id",bo[3]),Oo&6&&$n!==($n=bo[1].readonly&&!bo[2])&&(ke.readOnly=$n),Oo&1&&ke.value!==bo[0]&&set_input_value(ke,bo[0]),Oo&16&&toggle_class(ke,"is-invalid",bo[4]),Oo&2&&Xn!==(Xn=bo[1].source+"")&&set_data(Kn,Xn),bo[4]?ho?ho.p(bo,Oo):(ho=create_if_block$K(bo),ho.c(),ho.m(Ce,null)):ho&&(ho.d(1),ho=null)},i:noop,o:noop,d(bo){bo&&detach(Ce),ho&&ho.d(),io=!1,uo()}}}function instance$14(_n,Ce,ke){let $n,{field:Hn}=Ce,{value:zn}=Ce,{isCreateMode:Un}=Ce,{validationErrors:qn}=Ce,{id:Xn}=Ce;function Kn(){zn=this.value,ke(0,zn)}return _n.$$set=to=>{"field"in to&&ke(1,Hn=to.field),"value"in to&&ke(0,zn=to.value),"isCreateMode"in to&&ke(2,Un=to.isCreateMode),"validationErrors"in to&&ke(5,qn=to.validationErrors),"id"in to&&ke(3,Xn=to.id)},_n.$$.update=()=>{_n.$$.dirty&34&&ke(4,$n=getErrorMessage(qn,Hn.name))},[zn,Hn,Un,Xn,$n,qn,Kn]}class Slug extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$14,create_fragment$14,safe_not_equal,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}}function insertEdges(_n,Ce,ke,$n,Hn=""){let zn=ke.map(qn=>({target:qn.id,source:Ce.id,sourceSchema:Ce.schema,targetSchema:qn.schema,field:$n,depth:1,rank:""})),Un=_n.edges;return Hn==="replace"&&(Un=Un.filter(qn=>qn.field!==field.name)),_n.records=lodashExports.uniqBy([..._n.records,...ke],qn=>qn.id),_n.edges=lodashExports.uniqBy([...Un,...zn],qn=>qn.source+qn.target+qn.field+qn.depth),_n}function sortByField(_n,Ce,ke,$n,Hn){if(_n===Ce)return ke;let zn=Hn.map(Xn=>Xn.id),Un=(ke==null?void 0:ke.filter(Xn=>Xn.field===$n&&Xn.depth===1&&zn.includes(Xn.target)))??[],qn=(ke==null?void 0:ke.filter(Xn=>!(Xn.field===$n&&Xn.depth===1)))??[];return Un=array_move(Un,_n,Ce),[...qn,...Un]}function array_move(_n,Ce,ke){if(ke>=_n.length)for(var $n=ke-_n.length+1;$n--;)_n.push(void 0);return _n.splice(ke,0,_n.splice(Ce,1)[0]),_n}/*! + * mustache.js - Logic-less {{mustache}} templates with JavaScript + * http://github.com/janl/mustache.js + */var objectToString=Object.prototype.toString,isArray=Array.isArray||function(Ce){return objectToString.call(Ce)==="[object Array]"};function isFunction(_n){return typeof _n=="function"}function typeStr(_n){return isArray(_n)?"array":typeof _n}function escapeRegExp(_n){return _n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function hasProperty(_n,Ce){return _n!=null&&typeof _n=="object"&&Ce in _n}function primitiveHasOwnProperty(_n,Ce){return _n!=null&&typeof _n!="object"&&_n.hasOwnProperty&&_n.hasOwnProperty(Ce)}var regExpTest=RegExp.prototype.test;function testRegExp(_n,Ce){return regExpTest.call(_n,Ce)}var nonSpaceRe=/\S/;function isWhitespace(_n){return!testRegExp(nonSpaceRe,_n)}var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function escapeHtml(_n){return String(_n).replace(/[&<>"'`=\/]/g,function(ke){return entityMap[ke]})}var whiteRe=/\s*/,spaceRe=/\s+/,equalsRe=/\s*=/,curlyRe=/\s*\}/,tagRe=/#|\^|\/|>|\{|&|=|!/;function parseTemplate(_n,Ce){if(!_n)return[];var ke=!1,$n=[],Hn=[],zn=[],Un=!1,qn=!1,Xn="",Kn=0;function to(){if(Un&&!qn)for(;zn.length;)delete Hn[zn.pop()];else zn=[];Un=!1,qn=!1}var io,uo,ho;function bo(Go){if(typeof Go=="string"&&(Go=Go.split(spaceRe,2)),!isArray(Go)||Go.length!==2)throw new Error("Invalid tags: "+Go);io=new RegExp(escapeRegExp(Go[0])+"\\s*"),uo=new RegExp("\\s*"+escapeRegExp(Go[1])),ho=new RegExp("\\s*"+escapeRegExp("}"+Go[1]))}bo(Ce||mustache.tags);for(var Oo=new Scanner(_n),So,$o,Do,xo,Io,Vo;!Oo.eos();){if(So=Oo.pos,Do=Oo.scanUntil(io),Do)for(var Jo=0,Mo=Do.length;Jo"?Io=[$o,Do,So,Oo.pos,Xn,Kn,ke]:Io=[$o,Do,So,Oo.pos],Kn++,Hn.push(Io),$o==="#"||$o==="^")$n.push(Io);else if($o==="/"){if(Vo=$n.pop(),!Vo)throw new Error('Unopened section "'+Do+'" at '+So);if(Vo[1]!==Do)throw new Error('Unclosed section "'+Vo[1]+'" at '+So)}else $o==="name"||$o==="{"||$o==="&"?qn=!0:$o==="="&&bo(Do)}if(to(),Vo=$n.pop(),Vo)throw new Error('Unclosed section "'+Vo[1]+'" at '+Oo.pos);return nestTokens(squashTokens(Hn))}function squashTokens(_n){for(var Ce=[],ke,$n,Hn=0,zn=_n.length;Hn0?$n[$n.length-1][4]:Ce;break;default:ke.push(Hn)}return Ce}function Scanner(_n){this.string=_n,this.tail=_n,this.pos=0}Scanner.prototype.eos=function(){return this.tail===""};Scanner.prototype.scan=function(Ce){var ke=this.tail.match(Ce);if(!ke||ke.index!==0)return"";var $n=ke[0];return this.tail=this.tail.substring($n.length),this.pos+=$n.length,$n};Scanner.prototype.scanUntil=function(Ce){var ke=this.tail.search(Ce),$n;switch(ke){case-1:$n=this.tail,this.tail="";break;case 0:$n="";break;default:$n=this.tail.substring(0,ke),this.tail=this.tail.substring(ke)}return this.pos+=$n.length,$n};function Context$1(_n,Ce){this.view=_n,this.cache={".":this.view},this.parent=Ce}Context$1.prototype.push=function(Ce){return new Context$1(Ce,this)};Context$1.prototype.lookup=function(Ce){var ke=this.cache,$n;if(ke.hasOwnProperty(Ce))$n=ke[Ce];else{for(var Hn=this,zn,Un,qn,Xn=!1;Hn;){if(Ce.indexOf(".")>0)for(zn=Hn.view,Un=Ce.split("."),qn=0;zn!=null&&qn"?Kn=this.renderPartial(qn,ke,$n,zn):Xn==="&"?Kn=this.unescapedValue(qn,ke):Xn==="name"?Kn=this.escapedValue(qn,ke,zn):Xn==="text"&&(Kn=this.rawValue(qn)),Kn!==void 0&&(Un+=Kn);return Un};Writer.prototype.renderSection=function(Ce,ke,$n,Hn,zn){var Un=this,qn="",Xn=ke.lookup(Ce[1]);function Kn(uo){return Un.render(uo,ke,$n,zn)}if(Xn){if(isArray(Xn))for(var to=0,io=Xn.length;to0||!$n)&&(zn[Un]=Hn+zn[Un]);return zn.join(` +`)};Writer.prototype.renderPartial=function(Ce,ke,$n,Hn){if($n){var zn=this.getConfigTags(Hn),Un=isFunction($n)?$n(Ce[1]):$n[Ce[1]];if(Un!=null){var qn=Ce[6],Xn=Ce[5],Kn=Ce[4],to=Un;Xn==0&&Kn&&(to=this.indentPartial(Un,Kn,qn));var io=this.parse(to,zn);return this.renderTokens(io,ke,$n,to,Hn)}}};Writer.prototype.unescapedValue=function(Ce,ke){var $n=ke.lookup(Ce[1]);if($n!=null)return $n};Writer.prototype.escapedValue=function(Ce,ke,$n){var Hn=this.getConfigEscape($n)||mustache.escape,zn=ke.lookup(Ce[1]);if(zn!=null)return typeof zn=="number"&&Hn===mustache.escape?String(zn):Hn(zn)};Writer.prototype.rawValue=function(Ce){return Ce[1]};Writer.prototype.getConfigTags=function(Ce){return isArray(Ce)?Ce:Ce&&typeof Ce=="object"?Ce.tags:void 0};Writer.prototype.getConfigEscape=function(Ce){if(Ce&&typeof Ce=="object"&&!isArray(Ce))return Ce.escape};var mustache={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(_n){defaultWriter.templateCache=_n},get templateCache(){return defaultWriter.templateCache}},defaultWriter=new Writer;mustache.clearCache=function(){return defaultWriter.clearCache()};mustache.parse=function(Ce,ke){return defaultWriter.parse(Ce,ke)};mustache.render=function(Ce,ke,$n,Hn){if(typeof Ce!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+typeStr(Ce)+'" was given as the first argument for mustache#render(template, view, partials)');return defaultWriter.render(Ce,ke,$n,Hn)};mustache.escape=escapeHtml;mustache.Scanner=Scanner;mustache.Context=Context$1;mustache.Writer=Writer;function previewTitle(_n,Ce,ke){let $n=_n.find(Un=>Un.name===(Ce==null?void 0:Ce.schema));if(!($n!=null&&$n.cardTitle))return noTemplate($n,Ce);let Hn=Ce.data,zn=mustache.render($n.cardTitle,Hn);return!zn||zn===""?noTemplate($n,Ce):stripHtml(zn.slice(0,300))}function noTemplate(_n,Ce){var $n;if((_n==null?void 0:_n.type)==="files")return Ce._file.path;let ke=stripHtml(Ce==null?void 0:Ce.data[($n=_n.fields.filter(Hn=>Hn.info.name==="text")[0])==null?void 0:$n.name]).slice(0,300);return ke.trim()===""?"~Untitled~":ke}function create_else_block$j(_n){let Ce;return{c(){Ce=text("New Record")},m(ke,$n){insert$1(ke,Ce,$n)},p:noop,d(ke){ke&&detach(Ce)}}}function create_if_block$J(_n){let Ce=previewTitle(_n[3].schemas,_n[1])+"",ke;return{c(){ke=text(Ce)},m($n,Hn){insert$1($n,ke,Hn)},p($n,Hn){Hn&2&&Ce!==(Ce=previewTitle($n[3].schemas,$n[1])+"")&&set_data(ke,Ce)},d($n){$n&&detach(ke)}}}function create_fragment$13(_n){let Ce,ke,$n=_n[0].label.toUpperCase()+"",Hn,zn,Un,qn;function Xn(io,uo){return io[2]?create_else_block$j:create_if_block$J}let Kn=Xn(_n),to=Kn(_n);return{c(){Ce=element("div"),ke=element("a"),Hn=text($n),Un=space$3(),qn=element("span"),to.c(),attr(ke,"class","schema-name"),attr(ke,"href",zn=_n[3].lucentUrl+"/content/"+_n[0].name),attr(qn,"class","record-title"),attr(Ce,"class","record-header")},m(io,uo){insert$1(io,Ce,uo),append(Ce,ke),append(ke,Hn),append(Ce,Un),append(Ce,qn),to.m(qn,null)},p(io,[uo]){uo&1&&$n!==($n=io[0].label.toUpperCase()+"")&&set_data(Hn,$n),uo&1&&zn!==(zn=io[3].lucentUrl+"/content/"+io[0].name)&&attr(ke,"href",zn),Kn===(Kn=Xn(io))&&to?to.p(io,uo):(to.d(1),to=Kn(io),to&&(to.c(),to.m(qn,null)))},i:noop,o:noop,d(io){io&&detach(Ce),to.d()}}}function instance$13(_n,Ce,ke){const $n=getContext$1("channel");let{schema:Hn}=Ce,{record:zn}=Ce,{isCreateMode:Un}=Ce;return _n.$$set=qn=>{"schema"in qn&&ke(0,Hn=qn.schema),"record"in qn&&ke(1,zn=qn.record),"isCreateMode"in qn&&ke(2,Un=qn.isCreateMode)},[Hn,zn,Un,$n]}class Title extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$13,create_fragment$13,safe_not_equal,{schema:0,record:1,isCreateMode:2})}}function get_each_context$m(_n,Ce,ke){const $n=_n.slice();return $n[24]=Ce[ke],$n}function create_if_block_2$b(_n){let Ce,ke,$n;return{c(){Ce=element("button"),Ce.innerHTML=` + Save`,attr(Ce,"type","button"),attr(Ce,"class","button primary ms-2 btn btn-primary btn-spinner")},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"click",_n[10]),ke=!0)},p:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function create_if_block_1$o(_n){let Ce,ke,$n;return{c(){Ce=element("button"),Ce.innerHTML=` + Create`,attr(Ce,"class","button primary btn-spinner")},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"click",_n[10]),ke=!0)},p:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function create_if_block$I(_n){let Ce,ke,$n,Hn;function zn(Xn){_n[14](Xn)}function Un(Xn){_n[15](Xn)}let qn={field:_n[24],schema:_n[2],record:_n[0],validationErrors:_n[4],isCreateMode:_n[3]};return _n[0].data!==void 0&&(qn.data=_n[0].data),_n[1]!==void 0&&(qn.graph=_n[1]),Ce=new FormField({props:qn}),binding_callbacks.push(()=>bind(Ce,"data",zn)),binding_callbacks.push(()=>bind(Ce,"graph",Un)),{c(){create_component(Ce.$$.fragment)},m(Xn,Kn){mount_component(Ce,Xn,Kn),Hn=!0},p(Xn,Kn){const to={};Kn&4&&(to.schema=Xn[2]),Kn&1&&(to.record=Xn[0]),Kn&16&&(to.validationErrors=Xn[4]),Kn&8&&(to.isCreateMode=Xn[3]),!ke&&Kn&1&&(ke=!0,to.data=Xn[0].data,add_flush_callback(()=>ke=!1)),!$n&&Kn&2&&($n=!0,to.graph=Xn[1],add_flush_callback(()=>$n=!1)),Ce.$set(to)},i(Xn){Hn||(transition_in(Ce.$$.fragment,Xn),Hn=!0)},o(Xn){transition_out(Ce.$$.fragment,Xn),Hn=!1},d(Xn){destroy_component(Ce,Xn)}}}function create_each_block$m(_n,Ce){let ke,$n,Hn,zn=Ce[5]===Ce[24].group&&create_if_block$I(Ce);return{key:_n,first:null,c(){ke=empty$1(),zn&&zn.c(),$n=empty$1(),this.first=ke},m(Un,qn){insert$1(Un,ke,qn),zn&&zn.m(Un,qn),insert$1(Un,$n,qn),Hn=!0},p(Un,qn){Ce=Un,Ce[5]===Ce[24].group?zn?(zn.p(Ce,qn),qn&32&&transition_in(zn,1)):(zn=create_if_block$I(Ce),zn.c(),transition_in(zn,1),zn.m($n.parentNode,$n)):zn&&(group_outros(),transition_out(zn,1,1,()=>{zn=null}),check_outros())},i(Un){Hn||(transition_in(zn),Hn=!0)},o(Un){transition_out(zn),Hn=!1},d(Un){Un&&(detach(ke),detach($n)),zn&&zn.d(Un)}}}function create_fragment$12(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo,So,$o,Do=[],xo=new Map,Io,Vo,Jo;function Mo(gs){_n[11](gs)}function Go(gs){_n[12](gs)}let os={schema:_n[2],isCreateMode:_n[3]};_n[0]!==void 0&&(os.record=_n[0]),_n[5]!==void 0&&(os.activeContentTab=_n[5]),$n=new EditHeader({props:os}),binding_callbacks.push(()=>bind($n,"record",Mo)),binding_callbacks.push(()=>bind($n,"activeContentTab",Go));function ms(gs,xs){if(gs[3])return create_if_block_1$o;if(gs[6])return create_if_block_2$b}let is=ms(_n),Yo=is&&is(_n);Xn=new Title({props:{schema:_n[2],record:_n[0],isCreateMode:_n[3]}}),to=new ErrorAlert({props:{message:_n[7]}});function Ys(gs){_n[13](gs)}let sr={schema:_n[2],isCreateMode:_n[3]};_n[5]!==void 0&&(sr.active=_n[5]),ho=new ContentTabs({props:sr}),binding_callbacks.push(()=>bind(ho,"active",Ys)),So=new FilePreview({props:{record:_n[0],schema:_n[2]}});let Js=ensure_array_like(_n[8]);const ko=gs=>gs[24].name;for(let gs=0;gsHn=!1)),!zn&&xs&32&&(zn=!0,Qr.activeContentTab=gs[5],add_flush_callback(()=>zn=!1)),$n.$set(Qr),is===(is=ms(gs))&&Yo?Yo.p(gs,xs):(Yo&&Yo.d(1),Yo=is&&is(gs),Yo&&(Yo.c(),Yo.m(ke,null)));const cr={};xs&4&&(cr.schema=gs[2]),xs&1&&(cr.record=gs[0]),xs&8&&(cr.isCreateMode=gs[3]),Xn.$set(cr);const ws={};xs&128&&(ws.message=gs[7]),to.$set(ws);const Fs={};xs&4&&(Fs.schema=gs[2]),xs&8&&(Fs.isCreateMode=gs[3]),!bo&&xs&32&&(bo=!0,Fs.active=gs[5],add_flush_callback(()=>bo=!1)),ho.$set(Fs);const Br={};xs&1&&(Br.record=gs[0]),xs&4&&(Br.schema=gs[2]),So.$set(Br),xs&319&&(Js=ensure_array_like(gs[8]),group_outros(),Do=update_keyed_each(Do,xs,ko,1,gs,Js,xo,uo,outro_and_destroy_block,create_each_block$m,null,get_each_context$m),check_outros())},i(gs){if(!Io){transition_in($n.$$.fragment,gs),transition_in(Xn.$$.fragment,gs),transition_in(to.$$.fragment,gs),transition_in(ho.$$.fragment,gs),transition_in(So.$$.fragment,gs);for(let xs=0;xsos.name!=="id"),Oo="_default";qn.fields.reduce((os,ms)=>ms.ui==="tab"?(Oo=ms.name,os):(os[Oo]=[...os[Oo]??[],ms.name],os),[]),onMount(()=>{So()});function So(){io={data:JSON.parse(JSON.stringify(Xn.data)),schema:Xn.schema,status:Xn.status,_sys:JSON.parse(JSON.stringify(Xn._sys)),_file:JSON.parse(JSON.stringify(Xn._file)),edges:JSON.parse(JSON.stringify(Kn.edges))}}afterUpdate(()=>{ke(6,ho=Do())});function $o(os){return ho?os.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete os.returnValue,"...")}function Do(){return to?!1:!lodashExports.isEqual(io,{data:Xn.data,schema:Xn.schema,status:Xn.status,_sys:Xn._sys,_file:Xn._file,edges:Kn.edges})}function xo(os){return os.preventDefault(),console.log("SAVE: Attempt"),ke(4,$n=null),ke(7,Hn=""),new Promise(function(ms,is){var Yo;if(!ho&&!to){ms(null);return}if(!Xn){ms(null);return}ke(1,Kn.edges=((Yo=Kn.edges)==null?void 0:Yo.filter(Ys=>!Ys._isTrashed&&Ys.source===Xn.id))??[],Kn),axios$1.post(zn.lucentUrl+"/records",{record:Xn,edges:Kn.edges,isCreateMode:to}).then(function(Ys){console.log("SAVE: SAVED INLINE"),ke(0,Xn=Ys.data.records[0]),ke(1,Kn=Ys.data),to||So(),Un("inlinesaved",{records:[Xn]}),ms(null)}).catch(function(Ys){Ys.response&&(typeof Ys.response.data.error=="string"?ke(7,Hn=Ys.response.data.error):ke(4,$n=Ys.response.data.error)),ms(null)})})}function Io(os){Xn=os,ke(0,Xn)}function Vo(os){uo=os,ke(5,uo)}function Jo(os){uo=os,ke(5,uo)}function Mo(os){_n.$$.not_equal(Xn.data,os)&&(Xn.data=os,ke(0,Xn))}function Go(os){Kn=os,ke(1,Kn)}return _n.$$set=os=>{"schema"in os&&ke(2,qn=os.schema),"record"in os&&ke(0,Xn=os.record),"graph"in os&&ke(1,Kn=os.graph),"isCreateMode"in os&&ke(3,to=os.isCreateMode)},_n.$$.update=()=>{_n.$$.dirty&16&&ke(7,Hn=$n?`Record submission failed. ${Object.entries($n).length} error(s)`:null)},ke(4,$n=null),[Xn,Kn,qn,to,$n,uo,ho,Hn,bo,$o,xo,Io,Vo,Jo,Mo,Go]}class InlineEdit extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$12,create_fragment$12,safe_not_equal,{schema:2,record:0,graph:1,isCreateMode:3})}}function get_each_context$l(_n,Ce,ke){const $n=_n.slice();return $n[11]=Ce[ke],$n}function create_if_block$H(_n){let Ce=[],ke=new Map,$n,Hn=ensure_array_like(_n[2]);const zn=qn=>qn[11].id;for(let qn=0;qn{axios.get(Hn.lucentUrl+"/records/suggestions",{params:{schema:qn.collections[0],field:"search",value:Xn,ui:"search"}}).then(Oo=>{ke(2,$n=Oo.data)}).catch(Oo=>{ke(2,$n=[]),console.log(Oo)})},500);function to(bo,Oo){bo.preventDefault(),ke(6,Un=Oo.id),zn("addFilter"),ke(6,Un="")}function io(){Xn=this.value,ke(1,Xn)}const uo=(bo,Oo)=>to(Oo,bo),ho=(bo,Oo)=>to(Oo,bo);return _n.$$set=bo=>{"value"in bo&&ke(6,Un=bo.value),"field"in bo&&ke(0,qn=bo.field)},ke(2,$n=[]),[qn,Xn,$n,Hn,Kn,to,Un,io,uo,ho]}class FilterReferenceInput extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$11,create_fragment$11,safe_not_equal,{value:6,field:0})}}function get_each_context$k(_n,Ce,ke){const $n=_n.slice();return $n[39]=Ce[ke],$n}function get_each_context_1$7(_n,Ce,ke){const $n=_n.slice();return $n[42]=Ce[ke],$n}function get_each_context_2$2(_n,Ce,ke){const $n=_n.slice();return $n[39]=Ce[ke],$n}function create_if_block_4$6(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn;ke=new Icon({props:{icon:"arrow-left"}});let Kn=ensure_array_like(_n[9]),to=[];for(let io=0;iobind(io,"value",So)),io.$on("addFilter",_n[14]),{c(){Ce=element("button"),create_component(ke.$$.fragment),$n=text(` + Back`),Hn=space$3(),zn=element("div"),Un=text("field: "),Xn=text(qn),Kn=space$3(),to=element("div"),create_component(io.$$.fragment),attr(Ce,"class","dropdown-item button"),attr(zn,"class","selected-filter"),attr(to,"class","mt-2")},m(Do,xo){insert$1(Do,Ce,xo),mount_component(ke,Ce,null),append(Ce,$n),insert$1(Do,Hn,xo),insert$1(Do,zn,xo),append(zn,Un),append(zn,Xn),insert$1(Do,Kn,xo),insert$1(Do,to,xo),mount_component(io,to,null),ho=!0,bo||(Oo=listen(Ce,"click",_n[31]),bo=!0)},p(Do,xo){(!ho||xo[0]&16)&&qn!==(qn=Do[4].label+"")&&set_data(Xn,qn);const Io={};xo[0]&16&&(Io.field=Do[4]),!uo&&xo[0]&4&&(uo=!0,Io.value=Do[2],add_flush_callback(()=>uo=!1)),io.$set(Io)},i(Do){ho||(transition_in(ke.$$.fragment,Do),transition_in(io.$$.fragment,Do),ho=!0)},o(Do){transition_out(ke.$$.fragment,Do),transition_out(io.$$.fragment,Do),ho=!1},d(Do){Do&&(detach(Ce),detach(Hn),detach(zn),detach(Kn),detach(to)),destroy_component(ke),destroy_component(io),bo=!1,Oo()}}}function create_default_slot$8(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo,So,$o,Do,xo,Io,Vo,Jo,Mo,Go,os,ms,is=!_n[3]&&create_if_block_4$6(_n),Yo=_n[3]&&!_n[5]&&create_if_block_3$8(_n),Ys=_n[3]&&_n[5]&&create_if_block_2$a(_n),sr=!_n[4]&&create_if_block_1$n(_n),Js=_n[4]&&create_if_block$G(_n);return $o=new Icon({props:{icon:"arrow-left"}}),{c(){Ce=element("div"),ke=element("button"),ke.textContent="Filter by field",$n=space$3(),Hn=element("button"),Hn.textContent="Filter by Reference",zn=space$3(),Un=element("button"),Un.textContent="Advanced filter",qn=space$3(),Xn=element("div"),is&&is.c(),Kn=space$3(),Yo&&Yo.c(),to=space$3(),Ys&&Ys.c(),io=space$3(),uo=element("div"),sr&&sr.c(),ho=space$3(),Js&&Js.c(),bo=space$3(),Oo=element("div"),So=element("button"),create_component($o.$$.fragment),Do=text(` + Back`),xo=space$3(),Io=element("form"),Vo=element("input"),Jo=space$3(),Mo=element("button"),Mo.textContent="Submit",attr(ke,"class","dropdown-item button"),attr(Hn,"class","dropdown-item button"),attr(Un,"class","dropdown-item button"),toggle_class(Ce,"hide",_n[6]!=="main"),toggle_class(Xn,"hide",_n[6]!=="byField"),toggle_class(uo,"hide",_n[6]!=="byReference"),attr(So,"class","dropdown-item button"),attr(Vo,"type","search"),attr(Vo,"class","mb-2 mt-2"),attr(Vo,"placeholder","Advanced filters"),Vo.required=!0,attr(Mo,"class","button applied-filter"),toggle_class(Oo,"hide",_n[6]!=="advanced")},m(ko,gs){insert$1(ko,Ce,gs),append(Ce,ke),append(Ce,$n),append(Ce,Hn),append(Ce,zn),append(Ce,Un),insert$1(ko,qn,gs),insert$1(ko,Xn,gs),is&&is.m(Xn,null),append(Xn,Kn),Yo&&Yo.m(Xn,null),append(Xn,to),Ys&&Ys.m(Xn,null),insert$1(ko,io,gs),insert$1(ko,uo,gs),sr&&sr.m(uo,null),append(uo,ho),Js&&Js.m(uo,null),insert$1(ko,bo,gs),insert$1(ko,Oo,gs),append(Oo,So),mount_component($o,So,null),append(So,Do),append(Oo,xo),append(Oo,Io),append(Io,Vo),set_input_value(Vo,_n[1]),append(Io,Jo),append(Io,Mo),Go=!0,os||(ms=[listen(ke,"click",_n[20]),listen(Hn,"click",_n[21]),listen(Un,"click",_n[22]),listen(So,"click",_n[33]),listen(Vo,"input",_n[34]),listen(Io,"submit",_n[8])],os=!0)},p(ko,gs){(!Go||gs[0]&64)&&toggle_class(Ce,"hide",ko[6]!=="main"),ko[3]?is&&(group_outros(),transition_out(is,1,1,()=>{is=null}),check_outros()):is?(is.p(ko,gs),gs[0]&8&&transition_in(is,1)):(is=create_if_block_4$6(ko),is.c(),transition_in(is,1),is.m(Xn,Kn)),ko[3]&&!ko[5]?Yo?(Yo.p(ko,gs),gs[0]&40&&transition_in(Yo,1)):(Yo=create_if_block_3$8(ko),Yo.c(),transition_in(Yo,1),Yo.m(Xn,to)):Yo&&(group_outros(),transition_out(Yo,1,1,()=>{Yo=null}),check_outros()),ko[3]&&ko[5]?Ys?(Ys.p(ko,gs),gs[0]&40&&transition_in(Ys,1)):(Ys=create_if_block_2$a(ko),Ys.c(),transition_in(Ys,1),Ys.m(Xn,null)):Ys&&(group_outros(),transition_out(Ys,1,1,()=>{Ys=null}),check_outros()),(!Go||gs[0]&64)&&toggle_class(Xn,"hide",ko[6]!=="byField"),ko[4]?sr&&(group_outros(),transition_out(sr,1,1,()=>{sr=null}),check_outros()):sr?(sr.p(ko,gs),gs[0]&16&&transition_in(sr,1)):(sr=create_if_block_1$n(ko),sr.c(),transition_in(sr,1),sr.m(uo,ho)),ko[4]?Js?(Js.p(ko,gs),gs[0]&16&&transition_in(Js,1)):(Js=create_if_block$G(ko),Js.c(),transition_in(Js,1),Js.m(uo,null)):Js&&(group_outros(),transition_out(Js,1,1,()=>{Js=null}),check_outros()),(!Go||gs[0]&64)&&toggle_class(uo,"hide",ko[6]!=="byReference"),gs[0]&2&&Vo.value!==ko[1]&&set_input_value(Vo,ko[1]),(!Go||gs[0]&64)&&toggle_class(Oo,"hide",ko[6]!=="advanced")},i(ko){Go||(transition_in(is),transition_in(Yo),transition_in(Ys),transition_in(sr),transition_in(Js),transition_in($o.$$.fragment,ko),Go=!0)},o(ko){transition_out(is),transition_out(Yo),transition_out(Ys),transition_out(sr),transition_out(Js),transition_out($o.$$.fragment,ko),Go=!1},d(ko){ko&&(detach(Ce),detach(qn),detach(Xn),detach(io),detach(uo),detach(bo),detach(Oo)),is&&is.d(),Yo&&Yo.d(),Ys&&Ys.d(),sr&&sr.d(),Js&&Js.d(),destroy_component($o),os=!1,run_all(ms)}}}function create_button_slot$7(_n){let Ce,ke,$n,Hn,zn;return ke=new Icon({props:{icon:"filter"}}),{c(){Ce=element("div"),create_component(ke.$$.fragment),$n=space$3(),Hn=element("span"),Hn.textContent="Filter",attr(Hn,"class","ms-1"),attr(Ce,"slot","button")},m(Un,qn){insert$1(Un,Ce,qn),mount_component(ke,Ce,null),append(Ce,$n),append(Ce,Hn),zn=!0},p:noop,i(Un){zn||(transition_in(ke.$$.fragment,Un),zn=!0)},o(Un){transition_out(ke.$$.fragment,Un),zn=!1},d(Un){Un&&detach(Ce),destroy_component(ke)}}}function create_fragment$10(_n){let Ce,ke,$n,Hn={$$slots:{button:[create_button_slot$7],default:[create_default_slot$8]},$$scope:{ctx:_n}};return ke=new Dropdown({props:Hn}),_n[35](ke),{c(){Ce=element("div"),create_component(ke.$$.fragment)},m(zn,Un){insert$1(zn,Ce,Un),mount_component(ke,Ce,null),$n=!0},p(zn,Un){const qn={};Un[0]&254|Un[1]&65536&&(qn.$$scope={dirty:Un,ctx:zn}),ke.$set(qn)},i(zn){$n||(transition_in(ke.$$.fragment,zn),$n=!0)},o(zn){transition_out(ke.$$.fragment,zn),$n=!1},d(zn){zn&&detach(Ce),_n[35](null),destroy_component(ke)}}}function instance$10(_n,Ce,ke){const $n=createEventDispatcher();let{schema:Hn}=Ce,{systemFields:zn=[]}=Ce,{operators:Un}=Ce,{inModal:qn}=Ce,{modalUrl:Xn}=Ce,Kn,to="",io=zn;Hn.type==="collection"&&(io=zn.filter(hs=>hs.files===!1));function uo(hs){hs.preventDefault();let Qs=to.split("=")[0]??"";if(!Qs)return;let zo=`filter[${Qs}]`,el=to.split("=")[1]??"";if(!el)return;const ga=new URL(Xn??window.location.href);ga.searchParams.set("skip","0"),ga.searchParams.set(zo,el),qn?$n("refresh",ga):window.location.replace(ga),os()}let ho=null,bo=null,Oo=null,So=null,$o="main",Do=null,xo=[...Hn.fields,...io].filter(hs=>{var Qs;return!["file","json","reference"].includes(((Qs=hs.info)==null?void 0:Qs.name)??hs.ui)}),Io=[...Hn.fields].filter(hs=>{var Qs;return["reference"].includes(((Qs=hs.info)==null?void 0:Qs.name)??hs.ui)});function Vo(hs,Qs){ke(3,bo=Qs),ke(7,Do=Un.filter(zo=>{var el;return zo.uis.includes((el=bo==null?void 0:bo.info)==null?void 0:el.name)||zo.uis[0]==="*"}))}function Jo(hs,Qs){ke(4,Oo=Qs),ke(5,So=Un.find(zo=>zo.name==="eq"))}function Mo(hs,Qs){ke(5,So=Qs),Qs.hasValue||Go(hs)}function Go(hs){hs.preventDefault();let Qs="",zo,el=bo??Oo;Hn.fields.find(Ca=>Ca.name===el.name)&&(el.info.name==="reference"&&So.name==="eq"?(Qs="children."+el.name+".id",zo=`filter[${Qs}]`):(Qs="data.",zo=`filter[${Qs+el.name}_${So.name}]`));const ga=new URL(Xn??window.location.href);ga.searchParams.set("skip","0"),ga.searchParams.set(zo,ho),qn?($n("refresh",ga),Kn.close()):window.location.href=ga.toString(),os()}function os(){ke(3,bo=null),ke(5,So=null),ke(6,$o="main"),ke(4,Oo=null)}const ms=hs=>ke(6,$o="byField"),is=hs=>ke(6,$o="byReference"),Yo=hs=>ke(6,$o="advanced"),Ys=hs=>ke(6,$o="main"),sr=(hs,Qs)=>Vo(Qs,hs),Js=hs=>ke(3,bo=null),ko=(hs,Qs)=>Mo(Qs,hs),gs=hs=>ke(5,So=null);function xs(){ho=this.value,ke(2,ho)}const Qr=hs=>ke(6,$o="main"),cr=(hs,Qs)=>Jo(Qs,hs),ws=hs=>ke(4,Oo=null);function Fs(hs){ho=hs,ke(2,ho)}const Br=hs=>ke(6,$o="main");function _r(){to=this.value,ke(1,to)}function ha(hs){binding_callbacks[hs?"unshift":"push"](()=>{Kn=hs,ke(0,Kn)})}return _n.$$set=hs=>{"schema"in hs&&ke(15,Hn=hs.schema),"systemFields"in hs&&ke(16,zn=hs.systemFields),"operators"in hs&&ke(17,Un=hs.operators),"inModal"in hs&&ke(18,qn=hs.inModal),"modalUrl"in hs&&ke(19,Xn=hs.modalUrl)},[Kn,to,ho,bo,Oo,So,$o,Do,uo,xo,Io,Vo,Jo,Mo,Go,Hn,zn,Un,qn,Xn,ms,is,Yo,Ys,sr,Js,ko,gs,xs,Qr,cr,ws,Fs,Br,_r,ha]}class FilterFields extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$10,create_fragment$10,safe_not_equal,{schema:15,systemFields:16,operators:17,inModal:18,modalUrl:19},null,[-1,-1])}}function create_fragment$$(_n){let Ce,ke,$n,Hn,zn,Un,qn;return{c(){Ce=element("fieldset"),ke=element("label"),$n=element("span"),Hn=text(` + Upload file + + `),zn=element("input"),attr($n,"class","spinner-border spinner-border-sm"),attr($n,"role","status"),attr($n,"aria-hidden","true"),attr(zn,"class","form-control"),attr(zn,"type","file"),attr(zn,"id","formFile"),zn.multiple=!0,attr(zn,"accept",mimeTypes),zn.disabled=_n[0],zn.hidden=!0,attr(ke,"class","button primary btn-spinner "),attr(Ce,"class","upload-button"),Ce.disabled=_n[0]},m(Xn,Kn){insert$1(Xn,Ce,Kn),append(Ce,ke),append(ke,$n),append(ke,Hn),append(ke,zn),Un||(qn=listen(zn,"input",_n[1]),Un=!0)},p(Xn,[Kn]){Kn&1&&(zn.disabled=Xn[0]),Kn&1&&(Ce.disabled=Xn[0])},i:noop,o:noop,d(Xn){Xn&&detach(Ce),Un=!1,qn()}}}let mimeTypes="";function instance$$(_n,Ce,ke){const $n=createEventDispatcher(),Hn=getContext$1("channel");let{schema:zn}=Ce,Un=[],qn=!1;function Xn(Kn){ke(0,qn=!0),Un=Kn.target.files?[...Kn.target.files]:[];let to=new FormData;to.append("schema",zn.name),Array.from(Un).forEach(function(io){to.append("files[]",io)}),$n("beforeUpload",Un),axios.post(Hn.lucentUrl+"/files/upload",to,{headers:{"Content-Type":"multipart/form-data"}}).then(io=>{io.data.error?$n("uploadError",io.data.error):$n("uploadComplete",io.data),ke(0,qn=!1)}).catch(io=>{ke(0,qn=!1),console.log(io.response.data)})}return _n.$$set=Kn=>{"schema"in Kn&&ke(2,zn=Kn.schema)},[qn,Xn,zn]}class Uploader extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$$,create_fragment$$,safe_not_equal,{schema:2})}}function get_each_context$j(_n,Ce,ke){const $n=_n.slice();return $n[18]=Ce[ke],$n}function get_each_context_1$6(_n,Ce,ke){const $n=_n.slice();return $n[18]=Ce[ke],$n}function create_each_block_1$6(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io=_n[18].label+"",uo,ho,bo,Oo;$n=new Icon({props:{icon:"arrow-up-short-wide"}});function So(...xo){return _n[10](_n[18],...xo)}qn=new Icon({props:{icon:"arrow-down-wide-short"}});function $o(...xo){return _n[11](_n[18],...xo)}function Do(...xo){return _n[12](_n[18],...xo)}return{c(){Ce=element("div"),ke=element("button"),create_component($n.$$.fragment),zn=space$3(),Un=element("button"),create_component(qn.$$.fragment),Kn=space$3(),to=element("button"),uo=text(io),attr(ke,"title","Sort Ascending"),attr(ke,"class",Hn="button button-icon "+(_n[18].name==_n[1].name&&!_n[0].startsWith("-")?"active":"")),attr(Un,"title","Sort Descending"),attr(Un,"class",Xn="button button-icon "+(_n[18].name==_n[1].name&&_n[0].startsWith("-")?"active":"")),attr(to,"title","Sort Ascending"),attr(to,"class","button"),attr(Ce,"class","dropdown-item")},m(xo,Io){insert$1(xo,Ce,Io),append(Ce,ke),mount_component($n,ke,null),append(Ce,zn),append(Ce,Un),mount_component(qn,Un,null),append(Ce,Kn),append(Ce,to),append(to,uo),ho=!0,bo||(Oo=[listen(ke,"click",So),listen(Un,"click",$o),listen(to,"click",Do)],bo=!0)},p(xo,Io){_n=xo,(!ho||Io&11&&Hn!==(Hn="button button-icon "+(_n[18].name==_n[1].name&&!_n[0].startsWith("-")?"active":"")))&&attr(ke,"class",Hn),(!ho||Io&11&&Xn!==(Xn="button button-icon "+(_n[18].name==_n[1].name&&_n[0].startsWith("-")?"active":"")))&&attr(Un,"class",Xn),(!ho||Io&8)&&io!==(io=_n[18].label+"")&&set_data(uo,io)},i(xo){ho||(transition_in($n.$$.fragment,xo),transition_in(qn.$$.fragment,xo),ho=!0)},o(xo){transition_out($n.$$.fragment,xo),transition_out(qn.$$.fragment,xo),ho=!1},d(xo){xo&&detach(Ce),destroy_component($n),destroy_component(qn),bo=!1,run_all(Oo)}}}function create_each_block$j(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io=_n[18].label+"",uo,ho,bo,Oo,So;$n=new Icon({props:{icon:"arrow-up-short-wide"}});function $o(...Io){return _n[13](_n[18],...Io)}qn=new Icon({props:{icon:"arrow-down-wide-short"}});function Do(...Io){return _n[14](_n[18],...Io)}function xo(...Io){return _n[15](_n[18],...Io)}return{c(){Ce=element("div"),ke=element("button"),create_component($n.$$.fragment),zn=space$3(),Un=element("button"),create_component(qn.$$.fragment),Kn=space$3(),to=element("button"),uo=text(io),ho=space$3(),attr(ke,"title","Sort Ascending"),attr(ke,"class",Hn="button button-icon "+(_n[18].name==_n[0]?"active":"")),attr(Un,"title","Sort Descending"),attr(Un,"class",Xn="button button-icon "+("-"+_n[18].name==_n[0]?"active":"")),attr(to,"title","Sort Ascending"),attr(to,"class","button"),attr(Ce,"class","dropdown-item")},m(Io,Vo){insert$1(Io,Ce,Vo),append(Ce,ke),mount_component($n,ke,null),append(Ce,zn),append(Ce,Un),mount_component(qn,Un,null),append(Ce,Kn),append(Ce,to),append(to,uo),append(Ce,ho),bo=!0,Oo||(So=[listen(ke,"click",$o),listen(Un,"click",Do),listen(to,"click",xo)],Oo=!0)},p(Io,Vo){_n=Io,(!bo||Vo&5&&Hn!==(Hn="button button-icon "+(_n[18].name==_n[0]?"active":"")))&&attr(ke,"class",Hn),(!bo||Vo&5&&Xn!==(Xn="button button-icon "+("-"+_n[18].name==_n[0]?"active":"")))&&attr(Un,"class",Xn),(!bo||Vo&4)&&io!==(io=_n[18].label+"")&&set_data(uo,io)},i(Io){bo||(transition_in($n.$$.fragment,Io),transition_in(qn.$$.fragment,Io),bo=!0)},o(Io){transition_out($n.$$.fragment,Io),transition_out(qn.$$.fragment,Io),bo=!1},d(Io){Io&&detach(Ce),destroy_component($n),destroy_component(qn),Oo=!1,run_all(So)}}}function create_default_slot$7(_n){let Ce,ke,$n,Hn,zn,Un=ensure_array_like(_n[3]),qn=[];for(let uo=0;uotransition_out(qn[uo],1,1,()=>{qn[uo]=null});let Kn=ensure_array_like(_n[2]),to=[];for(let uo=0;uotransition_out(to[uo],1,1,()=>{to[uo]=null});return{c(){Ce=element("div");for(let uo=0;uo{io[Oo]=null}),check_outros(),Hn=io[$n],Hn||(Hn=io[$n]=to[$n](ho),Hn.c()),transition_in(Hn,1),Hn.m(Ce,zn)),(!Kn||bo&2)&&qn!==(qn=ho[1].label+"")&&set_data(Xn,qn)},i(ho){Kn||(transition_in(Hn),Kn=!0)},o(ho){transition_out(Hn),Kn=!1},d(ho){ho&&detach(Ce),io[$n].d()}}}function create_fragment$_(_n){let Ce,ke;return Ce=new Dropdown({props:{$$slots:{button:[create_button_slot$6],default:[create_default_slot$7]},$$scope:{ctx:_n}}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,[Hn]){const zn={};Hn&8388623&&(zn.$$scope={dirty:Hn,ctx:$n}),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function instance$_(_n,Ce,ke){let $n,Hn;const zn=createEventDispatcher();let{schema:Un}=Ce,{sortParam:qn}=Ce,{sortField:Xn}=Ce,{inModal:Kn}=Ce,{modalUrl:to}=Ce,{systemFields:io=[]}=Ce;function uo(Vo){const Jo=new URL(to??window.location.href);Jo.searchParams.set("sort",Vo),Kn?zn("refresh",Jo):window.location=Jo}function ho(Vo,Jo){Vo.preventDefault();let Mo=io.map(Go=>Go.name).includes(Jo.name)?"":"data.";return uo(Mo+Jo.name)}function bo(Vo,Jo){Vo.preventDefault();let Mo=io.map(Go=>Go.name).includes(Jo.name)?"":"data.";return uo("-"+Mo+Jo.name)}const Oo=(Vo,Jo)=>ho(Jo,Vo),So=(Vo,Jo)=>bo(Jo,Vo),$o=(Vo,Jo)=>ho(Jo,Vo),Do=(Vo,Jo)=>ho(Jo,Vo),xo=(Vo,Jo)=>bo(Jo,Vo),Io=(Vo,Jo)=>ho(Jo,Vo);return _n.$$set=Vo=>{"schema"in Vo&&ke(6,Un=Vo.schema),"sortParam"in Vo&&ke(0,qn=Vo.sortParam),"sortField"in Vo&&ke(1,Xn=Vo.sortField),"inModal"in Vo&&ke(7,Kn=Vo.inModal),"modalUrl"in Vo&&ke(8,to=Vo.modalUrl),"systemFields"in Vo&&ke(9,io=Vo.systemFields)},_n.$$.update=()=>{_n.$$.dirty&64&&ke(3,$n=Un.fields.filter(Vo=>!["reference","file","json","id","rich","markdown","block"].includes(Vo.info.name))),_n.$$.dirty&512&&ke(2,Hn=io),_n.$$.dirty&576&&Un.type==="collection"&&ke(2,Hn=io.filter(Vo=>Vo.files===!1))},[qn,Xn,Hn,$n,ho,bo,Un,Kn,to,io,Oo,So,$o,Do,xo,Io]}class SortFields extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$_,create_fragment$_,safe_not_equal,{schema:6,sortParam:0,sortField:1,inModal:7,modalUrl:8,systemFields:9})}}function create_else_block$g(_n){var Kn,to;let Ce=_n[3].label+"",ke,$n,Hn=(((Kn=_n[0].find(_n[11]))==null?void 0:Kn.symbol)??"")+"",zn,Un,qn=((to=_n[0].find(_n[12]))!=null&&to.hasValue?_n[2]:"")+"",Xn;return{c(){ke=text(Ce),$n=space$3(),zn=text(Hn),Un=space$3(),Xn=text(qn)},m(io,uo){insert$1(io,ke,uo),insert$1(io,$n,uo),insert$1(io,zn,uo),insert$1(io,Un,uo),insert$1(io,Xn,uo)},p(io,uo){var ho,bo;uo&8&&Ce!==(Ce=io[3].label+"")&&set_data(ke,Ce),uo&9&&Hn!==(Hn=(((ho=io[0].find(io[11]))==null?void 0:ho.symbol)??"")+"")&&set_data(zn,Hn),uo&13&&qn!==(qn=((bo=io[0].find(io[12]))!=null&&bo.hasValue?io[2]:"")+"")&&set_data(Xn,qn)},d(io){io&&(detach(ke),detach($n),detach(zn),detach(Un),detach(Xn))}}}function create_if_block$E(_n){let Ce=_n[3].label+"",ke,$n,Hn=previewTitle(_n[4].schemas,_n[5])+"",zn;return{c(){ke=text(Ce),$n=text(" is "),zn=text(Hn)},m(Un,qn){insert$1(Un,ke,qn),insert$1(Un,$n,qn),insert$1(Un,zn,qn)},p(Un,qn){qn&8&&Ce!==(Ce=Un[3].label+"")&&set_data(ke,Ce)},d(Un){Un&&(detach(ke),detach($n),detach(zn))}}}function create_fragment$Z(_n){let Ce,ke,$n,Hn,zn,Un,qn;function Xn(io,uo){return io[3].isReference&&io[5]?create_if_block$E:create_else_block$g}let Kn=Xn(_n),to=Kn(_n);return Hn=new Icon({props:{width:12,height:12,icon:"close"}}),{c(){Ce=element("span"),to.c(),ke=space$3(),$n=element("button"),create_component(Hn.$$.fragment),attr($n,"type","button"),attr($n,"class","button-text"),attr($n,"aria-label","Close"),attr(Ce,"class","applied-filter")},m(io,uo){insert$1(io,Ce,uo),to.m(Ce,null),append(Ce,ke),append(Ce,$n),mount_component(Hn,$n,null),zn=!0,Un||(qn=listen($n,"click",prevent_default(_n[13])),Un=!0)},p(io,[uo]){Kn===(Kn=Xn(io))&&to?to.p(io,uo):(to.d(1),to=Kn(io),to&&(to.c(),to.m(Ce,ke)))},i(io){zn||(transition_in(Hn.$$.fragment,io),zn=!0)},o(io){transition_out(Hn.$$.fragment,io),zn=!1},d(io){io&&detach(Ce),to.d(),destroy_component(Hn),Un=!1,qn()}}}function extractOperator(_n){return Ce=>{if(Ce.isReference)return Ce.operator="eq",Ce;const ke=_n.split("_");return Ce.operator=ke[ke.length-1]??"eq",Ce}}function extractLabel(_n,Ce){return ke=>{let $n="";ke.isReference?$n=Ce.split(".")[1]:$n=Ce.replace("_"+ke.operator,"");const Hn=_n.fields.find(zn=>zn.name===$n);return ke.label=(Hn==null?void 0:Hn.label)??$n,ke}}function instance$Z(_n,Ce,ke){const $n=getContext$1("channel"),Hn=createEventDispatcher();let{schema:zn}=Ce,{operators:Un}=Ce,{key:qn}=Ce,{value:Xn}=Ce,{inModal:Kn}=Ce,{modalUrl:to}=Ce,{graph:io}=Ce,uo={label:"",operator:"",value:Xn,isReference:qn.startsWith("children")};uo=[extractOperator(qn),extractLabel(zn,qn)].reduce((xo,Io)=>Io(xo),uo);const ho=bo(io,Xn);function bo(xo,Io){return uo.isReference?xo.records.find(Vo=>Vo.id===Io):null}function Oo(xo){let Io=`filter[${xo}]`;const Vo=new URL(to??window.location.href);Vo.searchParams.set("skip","0"),Vo.searchParams.delete(Io),Kn?Hn("refresh",Vo):window.location.replace(Vo)}const So=xo=>xo.name===uo.operator,$o=xo=>xo.name===uo.operator,Do=()=>Oo(qn);return _n.$$set=xo=>{"schema"in xo&&ke(7,zn=xo.schema),"operators"in xo&&ke(0,Un=xo.operators),"key"in xo&&ke(1,qn=xo.key),"value"in xo&&ke(2,Xn=xo.value),"inModal"in xo&&ke(8,Kn=xo.inModal),"modalUrl"in xo&&ke(9,to=xo.modalUrl),"graph"in xo&&ke(10,io=xo.graph)},[Un,qn,Xn,uo,$n,ho,Oo,zn,Kn,to,io,So,$o,Do]}class AppliedFilter extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$Z,create_fragment$Z,safe_not_equal,{schema:7,operators:0,key:1,value:2,inModal:8,modalUrl:9,graph:10})}}function create_if_block$D(_n){let Ce,ke,$n,Hn,zn,Un,qn;return Hn=new Icon({props:{width:12,height:12,icon:"close"}}),{c(){Ce=element("span"),ke=text(`Not linked + + `),$n=element("button"),create_component(Hn.$$.fragment),attr($n,"type","button"),attr($n,"class","button-text"),attr($n,"aria-label","Close"),attr(Ce,"class","applied-filter")},m(Xn,Kn){insert$1(Xn,Ce,Kn),append(Ce,ke),append(Ce,$n),mount_component(Hn,$n,null),zn=!0,Un||(qn=listen($n,"click",prevent_default(_n[4])),Un=!0)},p:noop,i(Xn){zn||(transition_in(Hn.$$.fragment,Xn),zn=!0)},o(Xn){transition_out(Hn.$$.fragment,Xn),zn=!1},d(Xn){Xn&&detach(Ce),destroy_component(Hn),Un=!1,qn()}}}function create_fragment$Y(_n){let Ce=_n[0].searchParams.get("notlinked"),ke,$n,Hn=Ce&&create_if_block$D(_n);return{c(){Hn&&Hn.c(),ke=empty$1()},m(zn,Un){Hn&&Hn.m(zn,Un),insert$1(zn,ke,Un),$n=!0},p(zn,[Un]){Ce&&Hn.p(zn,Un)},i(zn){$n||(transition_in(Hn),$n=!0)},o(zn){transition_out(Hn),$n=!1},d(zn){zn&&detach(ke),Hn&&Hn.d(zn)}}}function instance$Y(_n,Ce,ke){getContext$1("channel");const $n=createEventDispatcher();let{inModal:Hn}=Ce,{modalUrl:zn}=Ce;const Un=new URL(zn??window.location.href);function qn(Kn){const to=new URL(zn??window.location.href);to.searchParams.set("skip","0"),to.searchParams.delete("notlinked"),Hn?$n("refresh",to):window.location.replace(to)}const Xn=()=>qn();return _n.$$set=Kn=>{"inModal"in Kn&&ke(2,Hn=Kn.inModal),"modalUrl"in Kn&&ke(3,zn=Kn.modalUrl)},[Un,qn,Hn,zn,Xn]}class AppliedFilterNotLinked extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$Y,create_fragment$Y,safe_not_equal,{inModal:2,modalUrl:3})}}function get_each_context$i(_n,Ce,ke){const $n=_n.slice();return $n[22]=Ce[ke][0],$n[23]=Ce[ke][1],$n}function create_else_block_1$2(_n){let Ce,ke,$n;return ke=new Uploader({props:{schema:_n[0]}}),ke.$on("uploadComplete",_n[13]),{c(){Ce=element("div"),create_component(ke.$$.fragment)},m(Hn,zn){insert$1(Hn,Ce,zn),mount_component(ke,Ce,null),$n=!0},p(Hn,zn){const Un={};zn&1&&(Un.schema=Hn[0]),ke.$set(Un)},i(Hn){$n||(transition_in(ke.$$.fragment,Hn),$n=!0)},o(Hn){transition_out(ke.$$.fragment,Hn),$n=!1},d(Hn){Hn&&detach(Ce),destroy_component(ke)}}}function create_if_block_4$5(_n){let Ce,ke=!_n[5]&&_n[7]&&create_if_block_5$3(_n);return{c(){ke&&ke.c(),Ce=empty$1()},m($n,Hn){ke&&ke.m($n,Hn),insert$1($n,Ce,Hn)},p($n,Hn){!$n[5]&&$n[7]?ke?ke.p($n,Hn):(ke=create_if_block_5$3($n),ke.c(),ke.m(Ce.parentNode,Ce)):ke&&(ke.d(1),ke=null)},i:noop,o:noop,d($n){$n&&detach(Ce),ke&&ke.d($n)}}}function create_if_block_5$3(_n){let Ce,ke,$n;return{c(){Ce=element("a"),ke=text("New Record"),attr(Ce,"href",$n=_n[10].lucentUrl+"/records/new?schema="+_n[0].name),attr(Ce,"class","button")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,ke)},p(Hn,zn){zn&1&&$n!==($n=Hn[10].lucentUrl+"/records/new?schema="+Hn[0].name)&&attr(Ce,"href",$n)},d(Hn){Hn&&detach(Ce)}}}function create_if_block_1$m(_n){let Ce,ke;return Ce=new Dropdown({props:{orientation:"right",$$slots:{button:[create_button_slot$5],default:[create_default_slot$6]},$$scope:{ctx:_n}}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&67109009&&(zn.$$scope={dirty:Hn,ctx:$n}),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_else_block$f(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to;return{c(){Ce=element("a"),ke=text("Export to CSV"),$n=space$3(),Hn=element("a"),zn=text("View trashed records"),qn=space$3(),Xn=element("a"),Kn=text("View unlinked records"),attr(Ce,"class","dropdown-item"),attr(Ce,"href",_n[11]),attr(Hn,"class","dropdown-item"),attr(Hn,"href",Un=_n[10].lucentUrl+"/content/"+_n[0].name+"?filter[status_in]=trashed"),attr(Xn,"class","dropdown-item"),attr(Xn,"href",to=_n[10].lucentUrl+"/content/"+_n[0].name+"?notlinked=*")},m(io,uo){insert$1(io,Ce,uo),append(Ce,ke),insert$1(io,$n,uo),insert$1(io,Hn,uo),append(Hn,zn),insert$1(io,qn,uo),insert$1(io,Xn,uo),append(Xn,Kn)},p(io,uo){uo&1&&Un!==(Un=io[10].lucentUrl+"/content/"+io[0].name+"?filter[status_in]=trashed")&&attr(Hn,"href",Un),uo&1&&to!==(to=io[10].lucentUrl+"/content/"+io[0].name+"?notlinked=*")&&attr(Xn,"href",to)},d(io){io&&(detach(Ce),detach($n),detach(Hn),detach(qn),detach(Xn))}}}function create_if_block_2$9(_n){let Ce,ke=_n[7]&&create_if_block_3$7(_n);return{c(){ke&&ke.c(),Ce=empty$1()},m($n,Hn){ke&&ke.m($n,Hn),insert$1($n,Ce,Hn)},p($n,Hn){$n[7]?ke?ke.p($n,Hn):(ke=create_if_block_3$7($n),ke.c(),ke.m(Ce.parentNode,Ce)):ke&&(ke.d(1),ke=null)},d($n){$n&&detach(Ce),ke&&ke.d($n)}}}function create_if_block_3$7(_n){let Ce,ke,$n;return{c(){Ce=element("a"),ke=text("Empty trash"),attr(Ce,"class","dropdown-item"),attr(Ce,"href",$n=_n[10].lucentUrl+"/content/"+_n[0].name+"/emptyTrash")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,ke)},p(Hn,zn){zn&1&&$n!==($n=Hn[10].lucentUrl+"/content/"+Hn[0].name+"/emptyTrash")&&attr(Ce,"href",$n)},d(Hn){Hn&&detach(Ce)}}}function create_default_slot$6(_n){let Ce;function ke(zn,Un){return zn[4].status_in==="trashed"?create_if_block_2$9:create_else_block$f}let $n=ke(_n),Hn=$n(_n);return{c(){Hn.c(),Ce=empty$1()},m(zn,Un){Hn.m(zn,Un),insert$1(zn,Ce,Un)},p(zn,Un){$n===($n=ke(zn))&&Hn?Hn.p(zn,Un):(Hn.d(1),Hn=$n(zn),Hn&&(Hn.c(),Hn.m(Ce.parentNode,Ce)))},d(zn){zn&&detach(Ce),Hn.d(zn)}}}function create_button_slot$5(_n){let Ce,ke,$n;return ke=new Icon({props:{icon:"ellipsis-vertical"}}),{c(){Ce=element("div"),create_component(ke.$$.fragment),attr(Ce,"slot","button")},m(Hn,zn){insert$1(Hn,Ce,zn),mount_component(ke,Ce,null),$n=!0},p:noop,i(Hn){$n||(transition_in(ke.$$.fragment,Hn),$n=!0)},o(Hn){transition_out(ke.$$.fragment,Hn),$n=!1},d(Hn){Hn&&detach(Ce),destroy_component(ke)}}}function create_if_block$C(_n){let Ce,ke,$n=ensure_array_like(Object.entries(_n[4])),Hn=[];for(let Un=0;Un<$n.length;Un+=1)Hn[Un]=create_each_block$i(get_each_context$i(_n,$n,Un));const zn=Un=>transition_out(Hn[Un],1,1,()=>{Hn[Un]=null});return{c(){for(let Un=0;Un0,xo,Io,Vo;$n=new SortFields({props:{schema:_n[0],sortParam:_n[1],sortField:_n[2],systemFields:_n[9],inModal:_n[5],modalUrl:_n[6]}}),$n.$on("refresh",_n[15]);function Jo(Ys){_n[16](Ys)}let Mo={systemFields:_n[9],operators:_n[3],filter:_n[4],inModal:_n[5],modalUrl:_n[6]};_n[0]!==void 0&&(Mo.schema=_n[0]),zn=new FilterFields({props:Mo}),binding_callbacks.push(()=>bind(zn,"schema",Jo)),zn.$on("refresh",_n[17]);const Go=[create_if_block_4$5,create_else_block_1$2],os=[];function ms(Ys,sr){return Ys[0].type==="collection"?0:1}io=ms(_n),uo=os[io]=Go[io](_n);let is=!_n[5]&&create_if_block_1$m(_n);So=new AppliedFilterNotLinked({props:{inModal:_n[5],modalUrl:_n[6]}}),So.$on("refresh",_n[18]);let Yo=Do&&create_if_block$C(_n);return{c(){Ce=element("div"),ke=element("div"),create_component($n.$$.fragment),Hn=space$3(),create_component(zn.$$.fragment),qn=space$3(),Xn=element("form"),Xn.innerHTML='',Kn=space$3(),to=element("div"),uo.c(),ho=space$3(),is&&is.c(),bo=space$3(),Oo=element("div"),create_component(So.$$.fragment),$o=space$3(),Yo&&Yo.c(),attr(Xn,"method","GET"),attr(ke,"class","toolbar-filters"),set_style(to,"display","flex"),set_style(to,"align-items","center"),set_style(to,"gap","4px"),attr(Ce,"class","toolbar"),attr(Oo,"class","applied-filters")},m(Ys,sr){insert$1(Ys,Ce,sr),append(Ce,ke),mount_component($n,ke,null),append(ke,Hn),mount_component(zn,ke,null),append(ke,qn),append(ke,Xn),append(Ce,Kn),append(Ce,to),os[io].m(to,null),append(to,ho),is&&is.m(to,null),insert$1(Ys,bo,sr),insert$1(Ys,Oo,sr),mount_component(So,Oo,null),append(Oo,$o),Yo&&Yo.m(Oo,null),xo=!0,Io||(Vo=listen(Xn,"submit",_n[12]),Io=!0)},p(Ys,[sr]){const Js={};sr&1&&(Js.schema=Ys[0]),sr&2&&(Js.sortParam=Ys[1]),sr&4&&(Js.sortField=Ys[2]),sr&512&&(Js.systemFields=Ys[9]),sr&32&&(Js.inModal=Ys[5]),sr&64&&(Js.modalUrl=Ys[6]),$n.$set(Js);const ko={};sr&512&&(ko.systemFields=Ys[9]),sr&8&&(ko.operators=Ys[3]),sr&16&&(ko.filter=Ys[4]),sr&32&&(ko.inModal=Ys[5]),sr&64&&(ko.modalUrl=Ys[6]),!Un&&sr&1&&(Un=!0,ko.schema=Ys[0],add_flush_callback(()=>Un=!1)),zn.$set(ko);let gs=io;io=ms(Ys),io===gs?os[io].p(Ys,sr):(group_outros(),transition_out(os[gs],1,1,()=>{os[gs]=null}),check_outros(),uo=os[io],uo?uo.p(Ys,sr):(uo=os[io]=Go[io](Ys),uo.c()),transition_in(uo,1),uo.m(to,ho)),Ys[5]?is&&(group_outros(),transition_out(is,1,1,()=>{is=null}),check_outros()):is?(is.p(Ys,sr),sr&32&&transition_in(is,1)):(is=create_if_block_1$m(Ys),is.c(),transition_in(is,1),is.m(to,null));const xs={};sr&32&&(xs.inModal=Ys[5]),sr&64&&(xs.modalUrl=Ys[6]),So.$set(xs),sr&16&&(Do=Object.entries(Ys[4]).length>0),Do?Yo?(Yo.p(Ys,sr),sr&16&&transition_in(Yo,1)):(Yo=create_if_block$C(Ys),Yo.c(),transition_in(Yo,1),Yo.m(Oo,null)):Yo&&(group_outros(),transition_out(Yo,1,1,()=>{Yo=null}),check_outros())},i(Ys){xo||(transition_in($n.$$.fragment,Ys),transition_in(zn.$$.fragment,Ys),transition_in(uo),transition_in(is),transition_in(So.$$.fragment,Ys),transition_in(Yo),xo=!0)},o(Ys){transition_out($n.$$.fragment,Ys),transition_out(zn.$$.fragment,Ys),transition_out(uo),transition_out(is),transition_out(So.$$.fragment,Ys),transition_out(Yo),xo=!1},d(Ys){Ys&&(detach(Ce),detach(bo),detach(Oo)),destroy_component($n),destroy_component(zn),os[io].d(),is&&is.d(),destroy_component(So),Yo&&Yo.d(),Io=!1,Vo()}}}function instance$X(_n,Ce,ke){const $n=getContext$1("channel"),Hn=createEventDispatcher();let{sortParam:zn}=Ce,{sortField:Un}=Ce,{schema:qn}=Ce,{operators:Xn}=Ce,{filter:Kn}=Ce,{inModal:to}=Ce,{modalUrl:io}=Ce,{isWritable:uo}=Ce,{records:ho}=Ce,{graph:bo}=Ce,{systemFields:Oo=[]}=Ce,So=new URL(window.location.href),$o=So.pathname+"/csv?"+So.searchParams.toString();function Do(os){os.preventDefault();const ms=new FormData(os.target);let is=ms.keys().next().value,Yo=ms.values().next().value;const Ys=new URL(io??window.location.href);Ys.searchParams.set("skip","0"),Ys.searchParams.set(is,Yo),to?Hn("refresh",Ys):window.location=Ys}function xo(os){ke(14,ho=os.detail)}function Io(os){bubble.call(this,_n,os)}function Vo(os){qn=os,ke(0,qn)}function Jo(os){bubble.call(this,_n,os)}function Mo(os){bubble.call(this,_n,os)}function Go(os){bubble.call(this,_n,os)}return _n.$$set=os=>{"sortParam"in os&&ke(1,zn=os.sortParam),"sortField"in os&&ke(2,Un=os.sortField),"schema"in os&&ke(0,qn=os.schema),"operators"in os&&ke(3,Xn=os.operators),"filter"in os&&ke(4,Kn=os.filter),"inModal"in os&&ke(5,to=os.inModal),"modalUrl"in os&&ke(6,io=os.modalUrl),"isWritable"in os&&ke(7,uo=os.isWritable),"records"in os&&ke(14,ho=os.records),"graph"in os&&ke(8,bo=os.graph),"systemFields"in os&&ke(9,Oo=os.systemFields)},[qn,zn,Un,Xn,Kn,to,io,uo,bo,Oo,$n,$o,Do,xo,ho,Io,Vo,Jo,Mo,Go]}class Tools extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$X,create_fragment$X,safe_not_equal,{sortParam:1,sortField:2,schema:0,operators:3,filter:4,inModal:5,modalUrl:6,isWritable:7,records:14,graph:8,systemFields:9})}}function get_each_context$h(_n,Ce,ke){const $n=_n.slice();return $n[9]=Ce[ke],$n}function create_else_block$e(_n){let Ce,ke=_n[9]+"",$n,Hn,zn,Un;function qn(...Xn){return _n[7](_n[9],...Xn)}return{c(){Ce=element("a"),$n=text(ke),attr(Ce,"class","page-link"),attr(Ce,"href",Hn=_n[2](_n[9]))},m(Xn,Kn){insert$1(Xn,Ce,Kn),append(Ce,$n),zn||(Un=listen(Ce,"click",qn),zn=!0)},p(Xn,Kn){_n=Xn,Kn&1&&ke!==(ke=_n[9]+"")&&set_data($n,ke),Kn&1&&Hn!==(Hn=_n[2](_n[9]))&&attr(Ce,"href",Hn)},d(Xn){Xn&&detach(Ce),zn=!1,Un()}}}function create_if_block$B(_n){let Ce,ke=_n[9]+"",$n;return{c(){Ce=element("span"),$n=text(ke),attr(Ce,"class","page-link active")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,$n)},p(Hn,zn){zn&1&&ke!==(ke=Hn[9]+"")&&set_data($n,ke)},d(Hn){Hn&&detach(Ce)}}}function create_each_block$h(_n){let Ce,ke;function $n(Un,qn){return Un[1]===Un[9]?create_if_block$B:create_else_block$e}let Hn=$n(_n),zn=Hn(_n);return{c(){Ce=element("li"),zn.c(),ke=space$3(),attr(Ce,"class","page-item"),toggle_class(Ce,"active",_n[1]===_n[9])},m(Un,qn){insert$1(Un,Ce,qn),zn.m(Ce,null),append(Ce,ke)},p(Un,qn){Hn===(Hn=$n(Un))&&zn?zn.p(Un,qn):(zn.d(1),zn=Hn(Un),zn&&(zn.c(),zn.m(Ce,ke))),qn&3&&toggle_class(Ce,"active",Un[1]===Un[9])},d(Un){Un&&detach(Ce),zn.d()}}}function create_fragment$W(_n){let Ce,ke=ensure_array_like(_n[0]),$n=[];for(let Hn=0;Hnto(ho,uo);return _n.$$set=uo=>{"pages"in uo&&ke(0,Hn=uo.pages),"limit"in uo&&ke(4,zn=uo.limit),"currentPage"in uo&&ke(1,Un=uo.currentPage),"inModal"in uo&&ke(5,qn=uo.inModal),"modalUrl"in uo&&ke(6,Xn=uo.modalUrl)},[Hn,Un,Kn,to,zn,qn,Xn,io]}class NavItem extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$W,create_fragment$W,safe_not_equal,{pages:0,limit:4,currentPage:1,inModal:5,modalUrl:6})}}function create_if_block$A(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to;return Hn=new NavItem({props:{pages:_n[7],currentPage:_n[6],limit:_n[2],inModal:_n[0],modalUrl:_n[1]}}),Hn.$on("refresh",_n[10]),{c(){Ce=element("li"),ke=element("a"),ke.textContent="First",$n=space$3(),create_component(Hn.$$.fragment),zn=space$3(),Un=element("li"),qn=element("a"),qn.textContent="Last",attr(ke,"href","/"),attr(ke,"class","page-link"),attr(Ce,"class","page-item disabled"),toggle_class(Ce,"disabled",_n[6]===1),attr(qn,"class","page-link"),attr(qn,"href","/"),toggle_class(qn,"disabled",_n[6]===_n[5]),attr(Un,"class","page-item")},m(io,uo){insert$1(io,Ce,uo),append(Ce,ke),insert$1(io,$n,uo),mount_component(Hn,io,uo),insert$1(io,zn,uo),insert$1(io,Un,uo),append(Un,qn),Xn=!0,Kn||(to=[listen(ke,"click",_n[9]),listen(qn,"click",_n[8])],Kn=!0)},p(io,uo){(!Xn||uo&64)&&toggle_class(Ce,"disabled",io[6]===1);const ho={};uo&128&&(ho.pages=io[7]),uo&64&&(ho.currentPage=io[6]),uo&4&&(ho.limit=io[2]),uo&1&&(ho.inModal=io[0]),uo&2&&(ho.modalUrl=io[1]),Hn.$set(ho),(!Xn||uo&96)&&toggle_class(qn,"disabled",io[6]===io[5])},i(io){Xn||(transition_in(Hn.$$.fragment,io),Xn=!0)},o(io){transition_out(Hn.$$.fragment,io),Xn=!1},d(io){io&&(detach(Ce),detach($n),detach(zn),detach(Un)),destroy_component(Hn,io),Kn=!1,run_all(to)}}}function create_fragment$V(_n){let Ce,ke,$n,Hn,zn,Un,qn=+_n[3]+1+"",Xn,Kn,to,io=(+_n[3]+_n[2]>_n[4]?_n[4]:+_n[3]+_n[2])+"",uo,ho,bo,Oo,So,$o,Do=_n[5]>1&&create_if_block$A(_n);return{c(){Ce=element("nav"),ke=element("ul"),Do&&Do.c(),$n=space$3(),Hn=element("p"),zn=text(`Showing + `),Un=element("span"),Xn=text(qn),Kn=text(` + to + `),to=element("span"),uo=text(io),ho=text(` + of + `),bo=element("span"),Oo=text(_n[4]),So=text(` + total`),attr(ke,"class","pagination"),attr(Un,"class","font-medium"),attr(to,"class","font-medium"),attr(bo,"class","font-medium"),set_style(Hn,"display","flex"),set_style(Hn,"justify-content","center"),set_style(Hn,"gap","4px")},m(xo,Io){insert$1(xo,Ce,Io),append(Ce,ke),Do&&Do.m(ke,null),insert$1(xo,$n,Io),insert$1(xo,Hn,Io),append(Hn,zn),append(Hn,Un),append(Un,Xn),append(Hn,Kn),append(Hn,to),append(to,uo),append(Hn,ho),append(Hn,bo),append(bo,Oo),append(Hn,So),$o=!0},p(xo,[Io]){xo[5]>1?Do?(Do.p(xo,Io),Io&32&&transition_in(Do,1)):(Do=create_if_block$A(xo),Do.c(),transition_in(Do,1),Do.m(ke,null)):Do&&(group_outros(),transition_out(Do,1,1,()=>{Do=null}),check_outros()),(!$o||Io&8)&&qn!==(qn=+xo[3]+1+"")&&set_data(Xn,qn),(!$o||Io&28)&&io!==(io=(+xo[3]+xo[2]>xo[4]?xo[4]:+xo[3]+xo[2])+"")&&set_data(uo,io),(!$o||Io&16)&&set_data(Oo,xo[4])},i(xo){$o||(transition_in(Do),$o=!0)},o(xo){transition_out(Do),$o=!1},d(xo){xo&&(detach(Ce),detach($n),detach(Hn)),Do&&Do.d()}}}function instance$V(_n,Ce,ke){let $n,Hn,zn;const Un=createEventDispatcher();let{inModal:qn}=Ce,{modalUrl:Xn}=Ce,{limit:Kn}=Ce,{skip:to}=Ce,{total:io}=Ce;function uo(So){So.preventDefault(),bo($n)}function ho(So){So.preventDefault(),bo(1)}function bo(So){const $o=new URL(Xn??window.location.href);let Do=So*Kn-Kn;$o.searchParams.set("skip",Do),qn?Un("refresh",$o):window.location=$o}function Oo(So){bubble.call(this,_n,So)}return _n.$$set=So=>{"inModal"in So&&ke(0,qn=So.inModal),"modalUrl"in So&&ke(1,Xn=So.modalUrl),"limit"in So&&ke(2,Kn=So.limit),"skip"in So&&ke(3,to=So.skip),"total"in So&&ke(4,io=So.total)},_n.$$.update=()=>{_n.$$.dirty&20&&ke(5,$n=Math.ceil(io/Kn)),_n.$$.dirty&12&&ke(6,Hn=Math.ceil((to-1)/Kn)+1),_n.$$.dirty&96&&ke(7,zn=lodashExports.range(Hn-3,Hn+4).filter(So=>So>0&&So<=$n))},[qn,Xn,Kn,to,io,$n,Hn,zn,uo,ho,Oo]}class Pagination extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$V,create_fragment$V,safe_not_equal,{inModal:0,modalUrl:1,limit:2,skip:3,total:4})}}function create_else_block$d(_n){let Ce,ke,$n;return{c(){Ce=element("button"),Ce.textContent="Move to trash",attr(Ce,"type","button"),attr(Ce,"class","button")},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"click",prevent_default(_n[9])),ke=!0)},p:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function create_if_block$z(_n){let Ce,ke,$n,Hn,zn,Un,qn=_n[1].hasDrafts&&create_if_block_1$l(_n);return{c(){Ce=element("button"),Ce.textContent="Publish",ke=space$3(),qn&&qn.c(),$n=space$3(),Hn=element("button"),Hn.textContent="Delete forever",attr(Ce,"type","button"),attr(Ce,"class","button"),attr(Hn,"type","button"),attr(Hn,"class","button")},m(Xn,Kn){insert$1(Xn,Ce,Kn),insert$1(Xn,ke,Kn),qn&&qn.m(Xn,Kn),insert$1(Xn,$n,Kn),insert$1(Xn,Hn,Kn),zn||(Un=[listen(Ce,"click",prevent_default(_n[7])),listen(Hn,"click",prevent_default(_n[3]))],zn=!0)},p(Xn,Kn){Xn[1].hasDrafts?qn?qn.p(Xn,Kn):(qn=create_if_block_1$l(Xn),qn.c(),qn.m($n.parentNode,$n)):qn&&(qn.d(1),qn=null)},d(Xn){Xn&&(detach(Ce),detach(ke),detach($n),detach(Hn)),qn&&qn.d(Xn),zn=!1,run_all(Un)}}}function create_if_block_1$l(_n){let Ce,ke,$n;return{c(){Ce=element("button"),Ce.textContent="Make Draft",attr(Ce,"type","button"),attr(Ce,"class","button")},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"click",prevent_default(_n[8])),ke=!0)},p:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function create_fragment$U(_n){let Ce,ke,$n=_n[0].length+"",Hn,zn,Un,qn,Xn,Kn,to,io,uo;function ho(So,$o){return So[2].status_in==="trashed"?create_if_block$z:create_else_block$d}let bo=ho(_n),Oo=bo(_n);return{c(){Ce=element("div"),ke=element("span"),Hn=text($n),zn=text(" records selected"),Un=space$3(),qn=element("button"),qn.textContent="Publish",Xn=space$3(),Kn=element("button"),Kn.textContent="Make Draft",to=space$3(),Oo.c(),attr(ke,"class","me-2"),attr(qn,"type","button"),attr(qn,"class","button"),attr(Kn,"type","button"),attr(Kn,"class","button"),set_style(Ce,"display","flex"),set_style(Ce,"align-items","center"),set_style(Ce,"gap","8px")},m(So,$o){insert$1(So,Ce,$o),append(Ce,ke),append(ke,Hn),append(ke,zn),append(Ce,Un),append(Ce,qn),append(Ce,Xn),append(Ce,Kn),append(Ce,to),Oo.m(Ce,null),io||(uo=[listen(qn,"click",prevent_default(_n[5])),listen(Kn,"click",prevent_default(_n[6]))],io=!0)},p(So,[$o]){$o&1&&$n!==($n=So[0].length+"")&&set_data(Hn,$n),bo===(bo=ho(So))&&Oo?Oo.p(So,$o):(Oo.d(1),Oo=bo(So),Oo&&(Oo.c(),Oo.m(Ce,null)))},i:noop,o:noop,d(So){So&&detach(Ce),Oo.d(),io=!1,run_all(uo)}}}function instance$U(_n,Ce,ke){const $n=getContext$1("channel");let{selected:Hn}=Ce,{schema:zn}=Ce,{filter:Un}=Ce;function qn(bo){bo.preventDefault(),axios.post($n.lucentUrl+"/records/delete",{ids:Hn.map(Oo=>Oo.id)}).then(Oo=>{window.location.reload()}).catch(Oo=>{console.log(Oo)})}function Xn(bo,Oo){axios.post($n.lucentUrl+"/records/status/"+Oo,{schemaName:zn.name,records:Hn}).then(So=>{window.location.reload()}).catch(So=>{console.log(So)})}const Kn=bo=>Xn(bo,"published"),to=bo=>Xn(bo,"draft"),io=bo=>Xn(bo,"published"),uo=bo=>Xn(bo,"draft"),ho=bo=>Xn(bo,"trashed");return _n.$$set=bo=>{"selected"in bo&&ke(0,Hn=bo.selected),"schema"in bo&&ke(1,zn=bo.schema),"filter"in bo&&ke(2,Un=bo.filter)},[Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho]}class ActionsOnSelected extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$U,create_fragment$U,safe_not_equal,{selected:0,schema:1,filter:2})}}function create_fragment$T(_n){let Ce;return{c(){Ce=text(_n[0])},m(ke,$n){insert$1(ke,Ce,$n)},p(ke,[$n]){$n&1&&set_data(Ce,ke[0])},i:noop,o:noop,d(ke){ke&&detach(Ce)}}}function instance$T(_n,Ce,ke){let{value:$n}=Ce;return _n.$$set=Hn=>{"value"in Hn&&ke(0,$n=Hn.value)},[$n]}let Checkbox$2=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$T,create_fragment$T,safe_not_equal,{value:0})}};function create_if_block$y(_n){let Ce,ke,$n,Hn;return{c(){Ce=element("div"),ke=element("span"),$n=space$3(),Hn=text(_n[0]),attr(ke,"class","color border border-2 svelte-78o2k4"),set_style(ke,"background",_n[0]),attr(Ce,"class","d-inline-flex")},m(zn,Un){insert$1(zn,Ce,Un),append(Ce,ke),append(Ce,$n),append(Ce,Hn)},p(zn,Un){Un&1&&set_style(ke,"background",zn[0]),Un&1&&set_data(Hn,zn[0])},d(zn){zn&&detach(Ce)}}}function create_fragment$S(_n){let Ce,ke=_n[0]&&create_if_block$y(_n);return{c(){ke&&ke.c(),Ce=empty$1()},m($n,Hn){ke&&ke.m($n,Hn),insert$1($n,Ce,Hn)},p($n,[Hn]){$n[0]?ke?ke.p($n,Hn):(ke=create_if_block$y($n),ke.c(),ke.m(Ce.parentNode,Ce)):ke&&(ke.d(1),ke=null)},i:noop,o:noop,d($n){$n&&detach(Ce),ke&&ke.d($n)}}}function instance$S(_n,Ce,ke){let{value:$n}=Ce;return _n.$$set=Hn=>{"value"in Hn&&ke(0,$n=Hn.value)},[$n]}let Color$1=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$S,create_fragment$S,safe_not_equal,{value:0})}};function create_if_block$x(_n){let Ce,ke,$n;return{c(){Ce=element("a"),ke=text(_n[1]),attr(Ce,"href",$n=_n[2].lucentUrl+"/records/"+_n[0].id),attr(Ce,"title",_n[1]),attr(Ce,"class","reference svelte-nbbgyi")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,ke)},p(Hn,zn){zn&2&&set_data(ke,Hn[1]),zn&1&&$n!==($n=Hn[2].lucentUrl+"/records/"+Hn[0].id)&&attr(Ce,"href",$n),zn&2&&attr(Ce,"title",Hn[1])},d(Hn){Hn&&detach(Ce)}}}function create_fragment$R(_n){var $n;let Ce,ke=(($n=_n[0])==null?void 0:$n.data)&&create_if_block$x(_n);return{c(){ke&&ke.c(),Ce=empty$1()},m(Hn,zn){ke&&ke.m(Hn,zn),insert$1(Hn,Ce,zn)},p(Hn,[zn]){var Un;(Un=Hn[0])!=null&&Un.data?ke?ke.p(Hn,zn):(ke=create_if_block$x(Hn),ke.c(),ke.m(Ce.parentNode,Ce)):ke&&(ke.d(1),ke=null)},i:noop,o:noop,d(Hn){Hn&&detach(Ce),ke&&ke.d(Hn)}}}function instance$R(_n,Ce,ke){let $n;const Hn=getContext$1("channel");let{record:zn}=Ce,{graph:Un}=Ce;return _n.$$set=qn=>{"record"in qn&&ke(0,zn=qn.record),"graph"in qn&&ke(3,Un=qn.graph)},_n.$$.update=()=>{_n.$$.dirty&1&&Hn.schemas.find(qn=>qn.name===zn.schema),_n.$$.dirty&9&&ke(1,$n=previewTitle(Hn.schemas,zn))},[zn,$n,Hn,Un]}class PreviewCardSmall extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$R,create_fragment$R,safe_not_equal,{record:0,graph:3})}}function get_each_context$g(_n,Ce,ke){const $n=_n.slice();return $n[5]=Ce[ke],$n}function create_each_block$g(_n){let Ce,ke,$n,Hn;return ke=new PreviewCardSmall({props:{schemas:_n[0],graph:_n[1],record:_n[5]}}),{c(){Ce=element("span"),create_component(ke.$$.fragment),$n=space$3(),attr(Ce,"class","reference")},m(zn,Un){insert$1(zn,Ce,Un),mount_component(ke,Ce,null),append(Ce,$n),Hn=!0},p(zn,Un){const qn={};Un&1&&(qn.schemas=zn[0]),Un&2&&(qn.graph=zn[1]),Un&4&&(qn.record=zn[5]),ke.$set(qn)},i(zn){Hn||(transition_in(ke.$$.fragment,zn),Hn=!0)},o(zn){transition_out(ke.$$.fragment,zn),Hn=!1},d(zn){zn&&detach(Ce),destroy_component(ke)}}}function create_fragment$Q(_n){let Ce,ke,$n=ensure_array_like(_n[2]),Hn=[];for(let Un=0;Un<$n.length;Un+=1)Hn[Un]=create_each_block$g(get_each_context$g(_n,$n,Un));const zn=Un=>transition_out(Hn[Un],1,1,()=>{Hn[Un]=null});return{c(){Ce=element("div");for(let Un=0;Un{"record"in Xn&&ke(3,Hn=Xn.record),"field"in Xn&&ke(4,zn=Xn.field),"schemas"in Xn&&ke(0,Un=Xn.schemas),"graph"in Xn&&ke(1,qn=Xn.graph)},_n.$$.update=()=>{var Xn;_n.$$.dirty&26&&ke(2,$n=((Xn=qn.edges)==null?void 0:Xn.filter(Kn=>Kn.field===zn.name&&Kn.source===Hn.id).map(Kn=>qn.records.find(to=>to.id===Kn.target)).filter(Kn=>!!Kn))??[])},[Un,qn,$n,Hn,zn]}let Reference$1=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$Q,create_fragment$Q,safe_not_equal,{record:3,field:4,schemas:0,graph:1})}};function create_fragment$P(_n){let Ce;return{c(){Ce=text(_n[0])},m(ke,$n){insert$1(ke,Ce,$n)},p(ke,[$n]){$n&1&&set_data(Ce,ke[0])},i:noop,o:noop,d(ke){ke&&detach(Ce)}}}function instance$P(_n,Ce,ke){let{value:$n}=Ce;return _n.$$set=Hn=>{"value"in Hn&&ke(0,$n=Hn.value)},[$n]}let Number$2=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$P,create_fragment$P,safe_not_equal,{value:0})}};function create_fragment$O(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[0]),attr(Ce,"title",_n[0]),attr(Ce,"data-bs-toggle","tooltip"),attr(Ce,"data-bs-placement","top"),attr(Ce,"class","svelte-1ft053t")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,[Hn]){Hn&1&&set_data(ke,$n[0]),Hn&1&&attr(Ce,"title",$n[0])},i:noop,o:noop,d($n){$n&&detach(Ce)}}}function instance$O(_n,Ce,ke){let{value:$n}=Ce;return _n.$$set=Hn=>{"value"in Hn&&ke(0,$n=Hn.value)},[$n]}let Text$1=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$O,create_fragment$O,safe_not_equal,{value:0})}};function create_fragment$N(_n){let Ce,ke;return{c(){Ce=element("a"),ke=text(_n[0]),attr(Ce,"href",_n[0]),attr(Ce,"target","_blank")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,[Hn]){Hn&1&&set_data(ke,$n[0]),Hn&1&&attr(Ce,"href",$n[0])},i:noop,o:noop,d($n){$n&&detach(Ce)}}}function instance$N(_n,Ce,ke){let{value:$n}=Ce;return _n.$$set=Hn=>{"value"in Hn&&ke(0,$n=Hn.value)},[$n]}let Url$1=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$N,create_fragment$N,safe_not_equal,{value:0})}};function create_fragment$M(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[0]),attr(Ce,"title",_n[0]),attr(Ce,"data-bs-toggle","tooltip"),attr(Ce,"data-bs-placement","top")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,[Hn]){Hn&1&&set_data(ke,$n[0]),Hn&1&&attr(Ce,"title",$n[0])},i:noop,o:noop,d($n){$n&&detach(Ce)}}}function instance$M(_n,Ce,ke){let{value:$n}=Ce;return _n.$$set=Hn=>{"value"in Hn&&ke(0,$n=Hn.value)},[$n]}let Date$2=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$M,create_fragment$M,safe_not_equal,{value:0})}};function create_fragment$L(_n){let Ce,ke=readableDate(_n[0])+"",$n,Hn;return{c(){Ce=element("div"),$n=text(ke),attr(Ce,"title",Hn=readableDatetime(_n[0])),attr(Ce,"data-bs-toggle","tooltip"),attr(Ce,"data-bs-placement","top")},m(zn,Un){insert$1(zn,Ce,Un),append(Ce,$n)},p(zn,[Un]){Un&1&&ke!==(ke=readableDate(zn[0])+"")&&set_data($n,ke),Un&1&&Hn!==(Hn=readableDatetime(zn[0]))&&attr(Ce,"title",Hn)},i:noop,o:noop,d(zn){zn&&detach(Ce)}}}function instance$L(_n,Ce,ke){let{value:$n}=Ce;return _n.$$set=Hn=>{"value"in Hn&&ke(0,$n=Hn.value)},[$n]}let Datetime$1=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$L,create_fragment$L,safe_not_equal,{value:0})}};function get_each_context$f(_n,Ce,ke){const $n=_n.slice();return $n[4]=Ce[ke],$n}function create_each_block$f(_n){let Ce,ke,$n,Hn;return ke=new Preview({props:{record:_n[4],size:"tiny"}}),{c(){Ce=element("div"),create_component(ke.$$.fragment),$n=space$3(),attr(Ce,"class","me-1")},m(zn,Un){insert$1(zn,Ce,Un),mount_component(ke,Ce,null),append(Ce,$n),Hn=!0},p:noop,i(zn){Hn||(transition_in(ke.$$.fragment,zn),Hn=!0)},o(zn){transition_out(ke.$$.fragment,zn),Hn=!1},d(zn){zn&&detach(Ce),destroy_component(ke)}}}function create_fragment$K(_n){let Ce,ke,$n=ensure_array_like(_n[0]),Hn=[];for(let Un=0;Un<$n.length;Un+=1)Hn[Un]=create_each_block$f(get_each_context$f(_n,$n,Un));const zn=Un=>transition_out(Hn[Un],1,1,()=>{Hn[Un]=null});return{c(){Ce=element("div");for(let Un=0;UnXn.field===Hn.name&&Xn.source===$n.id).map(Xn=>zn.records.find(Kn=>Kn.id===Xn.target));return _n.$$set=Xn=>{"record"in Xn&&ke(1,$n=Xn.record),"field"in Xn&&ke(2,Hn=Xn.field),"graph"in Xn&&ke(3,zn=Xn.graph)},[Un,$n,Hn,zn]}let File$2=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$K,create_fragment$K,safe_not_equal,{record:1,field:2,graph:3})}};function create_fragment$J(_n){let Ce,ke;return{c(){Ce=element("span"),ke=text(_n[0]),attr(Ce,"class","badge rounded-pill bg-primary bg-opacity-75"),set_style(Ce,"max-width","64px"),set_style(Ce,"overflow","hidden"),set_style(Ce,"white-space","nowrap"),set_style(Ce,"text-overflow","ellipsis"),attr(Ce,"title",_n[0]),attr(Ce,"data-bs-toggle","tooltip")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,[Hn]){Hn&1&&set_data(ke,$n[0]),Hn&1&&attr(Ce,"title",$n[0])},i:noop,o:noop,d($n){$n&&detach(Ce)}}}function instance$J(_n,Ce,ke){let{value:$n}=Ce;return _n.$$set=Hn=>{"value"in Hn&&ke(0,$n=Hn.value)},[$n]}let UUID$1=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$J,create_fragment$J,safe_not_equal,{value:0})}};function create_fragment$I(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[0]),attr(Ce,"class","svelte-1ft053t")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,[Hn]){Hn&1&&set_data(ke,$n[0])},i:noop,o:noop,d($n){$n&&detach(Ce)}}}function instance$I(_n,Ce,ke){let{value:$n}=Ce;return _n.$$set=Hn=>{"value"in Hn&&ke(0,$n=Hn.value)},[$n]}class Rich extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$I,create_fragment$I,safe_not_equal,{value:0})}}function create_fragment$H(_n){let Ce,ke,$n;var Hn=_n[4][_n[0].info.name];function zn(Un,qn){return{props:{value:Un[2].data[Un[0].name],record:Un[2],graph:Un[3],schema:Un[1],field:Un[0]}}}return Hn&&(Ce=construct_svelte_component(Hn,zn(_n))),{c(){Ce&&create_component(Ce.$$.fragment),ke=empty$1()},m(Un,qn){Ce&&mount_component(Ce,Un,qn),insert$1(Un,ke,qn),$n=!0},p(Un,[qn]){if(qn&1&&Hn!==(Hn=Un[4][Un[0].info.name])){if(Ce){group_outros();const Xn=Ce;transition_out(Xn.$$.fragment,1,0,()=>{destroy_component(Xn,1)}),check_outros()}Hn?(Ce=construct_svelte_component(Hn,zn(Un)),create_component(Ce.$$.fragment),transition_in(Ce.$$.fragment,1),mount_component(Ce,ke.parentNode,ke)):Ce=null}else if(Hn){const Xn={};qn&5&&(Xn.value=Un[2].data[Un[0].name]),qn&4&&(Xn.record=Un[2]),qn&8&&(Xn.graph=Un[3]),qn&2&&(Xn.schema=Un[1]),qn&1&&(Xn.field=Un[0]),Ce.$set(Xn)}},i(Un){$n||(Ce&&transition_in(Ce.$$.fragment,Un),$n=!0)},o(Un){Ce&&transition_out(Ce.$$.fragment,Un),$n=!1},d(Un){Un&&detach(ke),Ce&&destroy_component(Ce,Un)}}}function instance$H(_n,Ce,ke){const $n={text:Text$1,slug:Text$1,rich:Rich,textarea:Text$1,color:Color$1,checkbox:Checkbox$2,reference:Reference$1,number:Number$2,url:Url$1,date:Date$2,datetime:Datetime$1,uuid:UUID$1,file:File$2};let{field:Hn}=Ce,{schema:zn}=Ce,{record:Un}=Ce,{graph:qn}=Ce;return _n.$$set=Xn=>{"field"in Xn&&ke(0,Hn=Xn.field),"schema"in Xn&&ke(1,zn=Xn.schema),"record"in Xn&&ke(2,Un=Xn.record),"graph"in Xn&&ke(3,qn=Xn.graph)},[Hn,zn,Un,qn,$n]}class RenderField extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$H,create_fragment$H,safe_not_equal,{field:0,schema:1,record:2,graph:3})}}function getStatus(_n){return getStatusList()[_n]}function getStatusList(){return{published:{value:"published",text:"Published",bg:"success",color:"white"},trashed:{value:"trashed",text:"Trashed",bg:"danger",color:"white"},draft:{value:"draft",text:"Draft",bg:"warning",color:"dark"}}}function create_fragment$G(_n){let Ce,ke=_n[0].text+"",$n;return{c(){Ce=element("span"),$n=text(ke),attr(Ce,"class","badge text-bg-"+_n[0].bg),set_style(Ce,"max-width","84px")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,$n)},p:noop,i:noop,o:noop,d(Hn){Hn&&detach(Ce)}}}function instance$G(_n,Ce,ke){let{status:$n}=Ce,Hn=getStatus($n);return _n.$$set=zn=>{"status"in zn&&ke(1,$n=zn.status)},[Hn,$n]}class Status extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$G,create_fragment$G,safe_not_equal,{status:1})}}function usernameById(_n,Ce){var ke;return _n?((ke=_n.find($n=>$n.id===Ce))==null?void 0:ke.name)??Ce:Ce}function get_each_context$e(_n,Ce,ke){const $n=_n.slice();return $n[7]=Ce[ke],$n[9]=ke,$n}function create_each_block$e(_n){let Ce,ke,$n,Hn;return ke=new RenderField({props:{record:_n[3],schema:_n[0],graph:_n[2],field:_n[7]}}),{c(){Ce=element("td"),create_component(ke.$$.fragment),attr(Ce,"class",$n="field-ui-"+_n[7].info.name),toggle_class(Ce,"is-sort",_n[7].name===_n[5].name)},m(zn,Un){insert$1(zn,Ce,Un),mount_component(ke,Ce,null),Hn=!0},p(zn,Un){const qn={};Un&8&&(qn.record=zn[3]),Un&1&&(qn.schema=zn[0]),Un&4&&(qn.graph=zn[2]),Un&64&&(qn.field=zn[7]),ke.$set(qn),(!Hn||Un&64&&$n!==($n="field-ui-"+zn[7].info.name))&&attr(Ce,"class",$n),(!Hn||Un&96)&&toggle_class(Ce,"is-sort",zn[7].name===zn[5].name)},i(zn){Hn||(transition_in(ke.$$.fragment,zn),Hn=!0)},o(zn){transition_out(ke.$$.fragment,zn),Hn=!1},d(zn){zn&&detach(Ce),destroy_component(ke)}}}function create_if_block_4$4(_n){let Ce,ke,$n;return ke=new Status({props:{status:_n[3].status}}),{c(){Ce=element("td"),create_component(ke.$$.fragment),attr(Ce,"class","text-center"),toggle_class(Ce,"is-sort",_n[4]=="-status"||_n[4]=="status")},m(Hn,zn){insert$1(Hn,Ce,zn),mount_component(ke,Ce,null),$n=!0},p(Hn,zn){const Un={};zn&8&&(Un.status=Hn[3].status),ke.$set(Un),(!$n||zn&16)&&toggle_class(Ce,"is-sort",Hn[4]=="-status"||Hn[4]=="status")},i(Hn){$n||(transition_in(ke.$$.fragment,Hn),$n=!0)},o(Hn){transition_out(ke.$$.fragment,Hn),$n=!1},d(Hn){Hn&&detach(Ce),destroy_component(ke)}}}function create_if_block_3$6(_n){let Ce,ke,$n;return ke=new Avatar({props:{name:usernameById(_n[1],_n[3]._sys.createdBy),side:24}}),{c(){Ce=element("td"),create_component(ke.$$.fragment),attr(Ce,"class","text-center"),toggle_class(Ce,"is-sort",_n[4]=="-_sys.createdBy"||_n[4]=="_sys.createdBy")},m(Hn,zn){insert$1(Hn,Ce,zn),mount_component(ke,Ce,null),$n=!0},p(Hn,zn){const Un={};zn&10&&(Un.name=usernameById(Hn[1],Hn[3]._sys.createdBy)),ke.$set(Un),(!$n||zn&16)&&toggle_class(Ce,"is-sort",Hn[4]=="-_sys.createdBy"||Hn[4]=="_sys.createdBy")},i(Hn){$n||(transition_in(ke.$$.fragment,Hn),$n=!0)},o(Hn){transition_out(ke.$$.fragment,Hn),$n=!1},d(Hn){Hn&&detach(Ce),destroy_component(ke)}}}function create_if_block_2$8(_n){let Ce,ke,$n;return ke=new Avatar({props:{name:usernameById(_n[1],_n[3]._sys.updatedBy),side:24}}),{c(){Ce=element("td"),create_component(ke.$$.fragment),attr(Ce,"class","text-center"),toggle_class(Ce,"is-sort",_n[4]=="-_sys.updatedBy"||_n[4]=="_sys.updatedBy")},m(Hn,zn){insert$1(Hn,Ce,zn),mount_component(ke,Ce,null),$n=!0},p(Hn,zn){const Un={};zn&10&&(Un.name=usernameById(Hn[1],Hn[3]._sys.updatedBy)),ke.$set(Un),(!$n||zn&16)&&toggle_class(Ce,"is-sort",Hn[4]=="-_sys.updatedBy"||Hn[4]=="_sys.updatedBy")},i(Hn){$n||(transition_in(ke.$$.fragment,Hn),$n=!0)},o(Hn){transition_out(ke.$$.fragment,Hn),$n=!1},d(Hn){Hn&&detach(Ce),destroy_component(ke)}}}function create_if_block_1$k(_n){let Ce,ke=friendlyDate(_n[3]._sys.createdAt)+"",$n;return{c(){Ce=element("td"),$n=text(ke),toggle_class(Ce,"is-sort",_n[4]=="-_sys.createdAt"||_n[4]=="_sys.createdAt")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,$n)},p(Hn,zn){zn&8&&ke!==(ke=friendlyDate(Hn[3]._sys.createdAt)+"")&&set_data($n,ke),zn&16&&toggle_class(Ce,"is-sort",Hn[4]=="-_sys.createdAt"||Hn[4]=="_sys.createdAt")},d(Hn){Hn&&detach(Ce)}}}function create_if_block$w(_n){let Ce,ke=friendlyDate(_n[3]._sys.updatedAt)+"",$n;return{c(){Ce=element("td"),$n=text(ke),toggle_class(Ce,"is-sort",_n[4]=="-_sys.updatedAt"||_n[4]=="_sys.updatedAt")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,$n)},p(Hn,zn){zn&8&&ke!==(ke=friendlyDate(Hn[3]._sys.updatedAt)+"")&&set_data($n,ke),zn&16&&toggle_class(Ce,"is-sort",Hn[4]=="-_sys.updatedAt"||Hn[4]=="_sys.updatedAt")},d(Hn){Hn&&detach(Ce)}}}function create_fragment$F(_n){var Vo,Jo,Mo,Go,os;let Ce,ke=(Vo=_n[0].visible)==null?void 0:Vo.includes("status"),$n,Hn=(Jo=_n[0].visible)==null?void 0:Jo.includes("_sys.createdBy"),zn,Un=(Mo=_n[0].visible)==null?void 0:Mo.includes("_sys.updatedBy"),qn,Xn=(Go=_n[0].visible)==null?void 0:Go.includes("_sys.createdAt"),Kn,to=(os=_n[0].visible)==null?void 0:os.includes("_sys.updatedAt"),io,uo,ho=ensure_array_like(_n[6]),bo=[];for(let ms=0;mstransition_out(bo[ms],1,1,()=>{bo[ms]=null});let So=ke&&create_if_block_4$4(_n),$o=Hn&&create_if_block_3$6(_n),Do=Un&&create_if_block_2$8(_n),xo=Xn&&create_if_block_1$k(_n),Io=to&&create_if_block$w(_n);return{c(){for(let ms=0;ms{So=null}),check_outros()),is&1&&(Hn=(Ys=ms[0].visible)==null?void 0:Ys.includes("_sys.createdBy")),Hn?$o?($o.p(ms,is),is&1&&transition_in($o,1)):($o=create_if_block_3$6(ms),$o.c(),transition_in($o,1),$o.m(zn.parentNode,zn)):$o&&(group_outros(),transition_out($o,1,1,()=>{$o=null}),check_outros()),is&1&&(Un=(sr=ms[0].visible)==null?void 0:sr.includes("_sys.updatedBy")),Un?Do?(Do.p(ms,is),is&1&&transition_in(Do,1)):(Do=create_if_block_2$8(ms),Do.c(),transition_in(Do,1),Do.m(qn.parentNode,qn)):Do&&(group_outros(),transition_out(Do,1,1,()=>{Do=null}),check_outros()),is&1&&(Xn=(Js=ms[0].visible)==null?void 0:Js.includes("_sys.createdAt")),Xn?xo?xo.p(ms,is):(xo=create_if_block_1$k(ms),xo.c(),xo.m(Kn.parentNode,Kn)):xo&&(xo.d(1),xo=null),is&1&&(to=(ko=ms[0].visible)==null?void 0:ko.includes("_sys.updatedAt")),to?Io?Io.p(ms,is):(Io=create_if_block$w(ms),Io.c(),Io.m(io.parentNode,io)):Io&&(Io.d(1),Io=null)},i(ms){if(!uo){for(let is=0;is{"schema"in to&&ke(0,$n=to.schema),"users"in to&&ke(1,Hn=to.users),"graph"in to&&ke(2,zn=to.graph),"record"in to&&ke(3,Un=to.record),"sortParam"in to&&ke(4,qn=to.sortParam),"sortField"in to&&ke(5,Xn=to.sortField),"visibleColumns"in to&&ke(6,Kn=to.visibleColumns)},[$n,Hn,zn,Un,qn,Xn,Kn]}let RecordRow$1=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$F,create_fragment$F,safe_not_equal,{schema:0,users:1,graph:2,record:3,sortParam:4,sortField:5,visibleColumns:6})}};const toggleAll=(_n,Ce,ke)=>ke.length===Ce.length?[]:(_n.currentTarget.checked=ke.length>0,Ce),selectRecord=(_n,Ce)=>Ce.find($n=>$n.id===_n.id)?Ce.filter($n=>$n.id!==_n.id):[...Ce,_n];function create_fragment$E(_n){let Ce,ke,$n,Hn;return{c(){Ce=element("div"),ke=element("input"),attr(ke,"id","c1-13"),attr(ke,"type","checkbox"),ke.value=_n[1],ke.indeterminate=_n[0],ke.checked=_n[2],attr(Ce,"class","checkbox-wrapper")},m(zn,Un){insert$1(zn,Ce,Un),append(Ce,ke),_n[5](ke),$n||(Hn=listen(ke,"change",_n[4]),$n=!0)},p(zn,[Un]){Un&2&&(ke.value=zn[1]),Un&1&&(ke.indeterminate=zn[0]),Un&4&&(ke.checked=zn[2])},i:noop,o:noop,d(zn){zn&&detach(Ce),_n[5](null),$n=!1,Hn()}}}function instance$E(_n,Ce,ke){let $n=null,{indeterminate:Hn=!1}=Ce,{value:zn}=Ce,{checked:Un=!1}=Ce;function qn(Kn){bubble.call(this,_n,Kn)}function Xn(Kn){binding_callbacks[Kn?"unshift":"push"](()=>{$n=Kn,ke(3,$n)})}return _n.$$set=Kn=>{"indeterminate"in Kn&&ke(0,Hn=Kn.indeterminate),"value"in Kn&&ke(1,zn=Kn.value),"checked"in Kn&&ke(2,Un=Kn.checked)},[Hn,zn,Un,$n,qn,Xn]}let Checkbox$1=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$E,create_fragment$E,safe_not_equal,{indeterminate:0,value:1,checked:2})}};function get_each_context$d(_n,Ce,ke){const $n=_n.slice();return $n[17]=Ce[ke],$n}function get_each_context_1$5(_n,Ce,ke){const $n=_n.slice();return $n[20]=Ce[ke],$n}function get_each_context_2$1(_n,Ce,ke){const $n=_n.slice();return $n[23]=Ce[ke],$n}function create_if_block_5$2(_n){let Ce,ke,$n;return ke=new Checkbox$1({props:{value:"",indeterminate:_n[0].length>0&&_n[0].length<_n[3].length,checked:_n[0].length===_n[3].length}}),ke.$on("change",_n[12]),{c(){Ce=element("th"),create_component(ke.$$.fragment)},m(Hn,zn){insert$1(Hn,Ce,zn),mount_component(ke,Ce,null),$n=!0},p(Hn,zn){const Un={};zn&9&&(Un.indeterminate=Hn[0].length>0&&Hn[0].length0?"medium":"small"}});let Jo=_n[17].status==="draft"&&create_if_block_2$7(_n),Mo=_n[17]._file.width>0&&create_if_block_1$j(_n);return{c(){Ce=element("div"),create_component(ke.$$.fragment),$n=space$3(),Hn=element("div"),Jo&&Jo.c(),zn=space$3(),Un=element("a"),Xn=text(qn),io=space$3(),uo=element("span"),bo=text(ho),Oo=text("kB"),So=space$3(),Mo&&Mo.c(),$o=space$3(),Do=element("a"),xo=text("Download"),attr(Un,"href",Kn=_n[11].lucentUrl+"/records/"+_n[17].id),attr(Un,"target",to=_n[8]?"_blank":"_self"),attr(Do,"href",Io=fileurl(_n[11],_n[17])),attr(Do,"target","_blank"),attr(Ce,"class","file-table-row")},m(os,ms){insert$1(os,Ce,ms),mount_component(ke,Ce,null),append(Ce,$n),append(Ce,Hn),Jo&&Jo.m(Hn,null),append(Hn,zn),append(Hn,Un),append(Un,Xn),append(Hn,io),append(Hn,uo),append(uo,bo),append(uo,Oo),append(Hn,So),Mo&&Mo.m(Hn,null),append(Hn,$o),append(Hn,Do),append(Do,xo),Vo=!0},p(os,ms){var Yo;const is={};ms&8&&(is.record=os[17]),ms&8&&(is.size=((Yo=os[17]._file)==null?void 0:Yo.width)>0?"medium":"small"),ke.$set(is),os[17].status==="draft"?Jo?Jo.p(os,ms):(Jo=create_if_block_2$7(os),Jo.c(),Jo.m(Hn,zn)):Jo&&(Jo.d(1),Jo=null),(!Vo||ms&24)&&qn!==(qn=previewTitle(os[11].schemas,os[17],os[4])+"")&&set_data(Xn,qn),(!Vo||ms&8&&Kn!==(Kn=os[11].lucentUrl+"/records/"+os[17].id))&&attr(Un,"href",Kn),(!Vo||ms&256&&to!==(to=os[8]?"_blank":"_self"))&&attr(Un,"target",to),(!Vo||ms&8)&&ho!==(ho=(os[17]._file.size/1024).toFixed(1)+"")&&set_data(bo,ho),os[17]._file.width>0?Mo?Mo.p(os,ms):(Mo=create_if_block_1$j(os),Mo.c(),Mo.m(Hn,$o)):Mo&&(Mo.d(1),Mo=null),(!Vo||ms&8&&Io!==(Io=fileurl(os[11],os[17])))&&attr(Do,"href",Io)},i(os){Vo||(transition_in(ke.$$.fragment,os),Vo=!0)},o(os){transition_out(ke.$$.fragment,os),Vo=!1},d(os){os&&detach(Ce),destroy_component(ke),Jo&&Jo.d(),Mo&&Mo.d()}}}function create_if_block_3$5(_n){let Ce,ke=_n[17].status+"",$n;return{c(){Ce=element("span"),$n=text(ke),set_style(Ce,"text-transform","uppercase"),set_style(Ce,"font-size","10px")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,$n)},p(Hn,zn){zn&8&&ke!==(ke=Hn[17].status+"")&&set_data($n,ke)},d(Hn){Hn&&detach(Ce)}}}function create_if_block_2$7(_n){let Ce,ke=_n[17].status+"",$n;return{c(){Ce=element("span"),$n=text(ke),set_style(Ce,"text-transform","uppercase"),set_style(Ce,"font-size","10px")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,$n)},p(Hn,zn){zn&8&&ke!==(ke=Hn[17].status+"")&&set_data($n,ke)},d(Hn){Hn&&detach(Ce)}}}function create_if_block_1$j(_n){let Ce,ke=_n[17]._file.width+"x"+_n[17]._file.height,$n;return{c(){Ce=element("span"),$n=text(ke)},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,$n)},p(Hn,zn){zn&8&&ke!==(ke=Hn[17]._file.width+"x"+Hn[17]._file.height)&&set_data($n,ke)},d(Hn){Hn&&detach(Ce)}}}function create_each_block$d(_n,Ce){let ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo=Ce[9]&&create_if_block_4$3(Ce);const So=[create_if_block$v,create_else_block$c],$o=[];function Do(xo,Io){var Vo;return(Vo=xo[17]._file)!=null&&Vo.path?0:1}return Un=Do(Ce),qn=$o[Un]=So[Un](Ce),Kn=new RecordRow$1({props:{record:Ce[17],graph:Ce[4],schema:Ce[1],visibleColumns:Ce[10],sortParam:Ce[6],sortField:Ce[7],users:Ce[2]}}),uo=new Avatar({props:{name:usernameById(Ce[2],Ce[17]._sys.updatedBy),side:24}}),{key:_n,first:null,c(){ke=element("tr"),$n=element("td"),Hn=element("div"),Oo&&Oo.c(),zn=space$3(),qn.c(),Xn=space$3(),create_component(Kn.$$.fragment),to=space$3(),io=element("td"),create_component(uo.$$.fragment),ho=space$3(),attr(Hn,"class","title-td-contents"),attr($n,"class","title-td"),this.first=ke},m(xo,Io){insert$1(xo,ke,Io),append(ke,$n),append($n,Hn),Oo&&Oo.m(Hn,null),append(Hn,zn),$o[Un].m(Hn,null),append(ke,Xn),mount_component(Kn,ke,null),append(ke,to),append(ke,io),mount_component(uo,io,null),append(ke,ho),bo=!0},p(xo,Io){Ce=xo,Ce[9]?Oo?(Oo.p(Ce,Io),Io&512&&transition_in(Oo,1)):(Oo=create_if_block_4$3(Ce),Oo.c(),transition_in(Oo,1),Oo.m(Hn,zn)):Oo&&(group_outros(),transition_out(Oo,1,1,()=>{Oo=null}),check_outros());let Vo=Un;Un=Do(Ce),Un===Vo?$o[Un].p(Ce,Io):(group_outros(),transition_out($o[Vo],1,1,()=>{$o[Vo]=null}),check_outros(),qn=$o[Un],qn?qn.p(Ce,Io):(qn=$o[Un]=So[Un](Ce),qn.c()),transition_in(qn,1),qn.m(Hn,null));const Jo={};Io&8&&(Jo.record=Ce[17]),Io&16&&(Jo.graph=Ce[4]),Io&2&&(Jo.schema=Ce[1]),Io&1024&&(Jo.visibleColumns=Ce[10]),Io&64&&(Jo.sortParam=Ce[6]),Io&128&&(Jo.sortField=Ce[7]),Io&4&&(Jo.users=Ce[2]),Kn.$set(Jo);const Mo={};Io&12&&(Mo.name=usernameById(Ce[2],Ce[17]._sys.updatedBy)),uo.$set(Mo)},i(xo){bo||(transition_in(Oo),transition_in(qn),transition_in(Kn.$$.fragment,xo),transition_in(uo.$$.fragment,xo),bo=!0)},o(xo){transition_out(Oo),transition_out(qn),transition_out(Kn.$$.fragment,xo),transition_out(uo.$$.fragment,xo),bo=!1},d(xo){xo&&detach(ke),Oo&&Oo.d(),$o[Un].d(),destroy_component(Kn),destroy_component(uo)}}}function create_fragment$D(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io=[],uo=new Map,ho,bo=_n[9]&&create_if_block_5$2(_n),Oo=ensure_array_like(_n[10]),So=[];for(let Vo=0;VoVo[17].id;for(let Vo=0;Vo{bo=null}),check_outros()),Jo&1152){Oo=ensure_array_like(Vo[10]);let Mo;for(Mo=0;Mo{var Vo;return(Vo=zn.visible)==null?void 0:Vo.includes(Io.name)},Do=(Io,Vo)=>Vo.id===Io.id,xo=Io=>So(Io);return _n.$$set=Io=>{"schema"in Io&&ke(1,zn=Io.schema),"users"in Io&&ke(2,Un=Io.users),"records"in Io&&ke(3,qn=Io.records),"graph"in Io&&ke(4,Xn=Io.graph),"systemFields"in Io&&ke(5,Kn=Io.systemFields),"sortParam"in Io&&ke(6,to=Io.sortParam),"sortField"in Io&&ke(7,io=Io.sortField),"inModal"in Io&&ke(8,uo=Io.inModal),"isWritable"in Io&&ke(9,ho=Io.isWritable),"selected"in Io&&ke(0,bo=Io.selected)},_n.$$.update=()=>{_n.$$.dirty&2&&ke(10,$n=zn.fields.filter(Io=>{var Vo;return((Vo=zn.visible)==null?void 0:Vo.includes(Io.name))??[]}))},[bo,zn,Un,qn,Xn,Kn,to,io,uo,ho,$n,Hn,Oo,So,$o,Do,xo]}let Table$1=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$D,create_fragment$D,safe_not_equal,{schema:1,users:2,records:3,graph:4,systemFields:5,sortParam:6,sortField:7,inModal:8,isWritable:9,selected:0})}};function create_else_block$b(_n){let Ce,ke,$n,Hn;function zn(Xn){_n[17](Xn)}function Un(Xn){_n[18](Xn)}let qn={systemFields:_n[13],sortParam:_n[2],sortField:_n[3],operators:_n[4],filter:_n[5],graph:_n[12],inModal:_n[14],modalUrl:_n[9],isWritable:_n[15]};return _n[0]!==void 0&&(qn.schema=_n[0]),_n[1]!==void 0&&(qn.records=_n[1]),Ce=new Tools({props:qn}),binding_callbacks.push(()=>bind(Ce,"schema",zn)),binding_callbacks.push(()=>bind(Ce,"records",Un)),Ce.$on("refresh",_n[16]),{c(){create_component(Ce.$$.fragment)},m(Xn,Kn){mount_component(Ce,Xn,Kn),Hn=!0},p(Xn,Kn){const to={};Kn&8192&&(to.systemFields=Xn[13]),Kn&4&&(to.sortParam=Xn[2]),Kn&8&&(to.sortField=Xn[3]),Kn&16&&(to.operators=Xn[4]),Kn&32&&(to.filter=Xn[5]),Kn&4096&&(to.graph=Xn[12]),Kn&16384&&(to.inModal=Xn[14]),Kn&512&&(to.modalUrl=Xn[9]),Kn&32768&&(to.isWritable=Xn[15]),!ke&&Kn&1&&(ke=!0,to.schema=Xn[0],add_flush_callback(()=>ke=!1)),!$n&&Kn&2&&($n=!0,to.records=Xn[1],add_flush_callback(()=>$n=!1)),Ce.$set(to)},i(Xn){Hn||(transition_in(Ce.$$.fragment,Xn),Hn=!0)},o(Xn){transition_out(Ce.$$.fragment,Xn),Hn=!1},d(Xn){destroy_component(Ce,Xn)}}}function create_if_block$u(_n){let Ce,ke;return Ce=new ActionsOnSelected({props:{schema:_n[0],selected:_n[10],filter:_n[5]}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&1&&(zn.schema=$n[0]),Hn&1024&&(zn.selected=$n[10]),Hn&32&&(zn.filter=$n[5]),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_fragment$C(_n){let Ce,ke,$n,Hn=_n[0].label+"",zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo;const So=[create_if_block$u,create_else_block$b],$o=[];function Do(Vo,Jo){return Vo[10].length>0&&!Vo[14]&&Vo[15]?0:1}qn=Do(_n),Xn=$o[qn]=So[qn](_n);function xo(Vo){_n[19](Vo)}let Io={records:_n[1],graph:_n[12],schema:_n[0],sortParam:_n[2],sortField:_n[3],systemFields:_n[13],inModal:_n[14],users:_n[11],isWritable:_n[15]};return _n[10]!==void 0&&(Io.selected=_n[10]),to=new Table$1({props:Io}),binding_callbacks.push(()=>bind(to,"selected",xo)),bo=new Pagination({props:{limit:_n[6],skip:_n[7],total:_n[8],inModal:_n[14],modalUrl:_n[9]}}),bo.$on("refresh",_n[16]),{c(){Ce=element("div"),ke=element("div"),$n=element("h3"),zn=text(Hn),Un=space$3(),Xn.c(),Kn=space$3(),create_component(to.$$.fragment),ho=space$3(),create_component(bo.$$.fragment),attr($n,"class","header-normal mb-5 "),attr(ke,"class",uo=_n[14]?"mt-0":"mt-5"),attr(Ce,"class","")},m(Vo,Jo){insert$1(Vo,Ce,Jo),append(Ce,ke),append(ke,$n),append($n,zn),append(ke,Un),$o[qn].m(ke,null),append(ke,Kn),mount_component(to,ke,null),append(Ce,ho),mount_component(bo,Ce,null),Oo=!0},p(Vo,[Jo]){(!Oo||Jo&1)&&Hn!==(Hn=Vo[0].label+"")&&set_data(zn,Hn);let Mo=qn;qn=Do(Vo),qn===Mo?$o[qn].p(Vo,Jo):(group_outros(),transition_out($o[Mo],1,1,()=>{$o[Mo]=null}),check_outros(),Xn=$o[qn],Xn?Xn.p(Vo,Jo):(Xn=$o[qn]=So[qn](Vo),Xn.c()),transition_in(Xn,1),Xn.m(ke,Kn));const Go={};Jo&2&&(Go.records=Vo[1]),Jo&4096&&(Go.graph=Vo[12]),Jo&1&&(Go.schema=Vo[0]),Jo&4&&(Go.sortParam=Vo[2]),Jo&8&&(Go.sortField=Vo[3]),Jo&8192&&(Go.systemFields=Vo[13]),Jo&16384&&(Go.inModal=Vo[14]),Jo&2048&&(Go.users=Vo[11]),Jo&32768&&(Go.isWritable=Vo[15]),!io&&Jo&1024&&(io=!0,Go.selected=Vo[10],add_flush_callback(()=>io=!1)),to.$set(Go),(!Oo||Jo&16384&&uo!==(uo=Vo[14]?"mt-0":"mt-5"))&&attr(ke,"class",uo);const os={};Jo&64&&(os.limit=Vo[6]),Jo&128&&(os.skip=Vo[7]),Jo&256&&(os.total=Vo[8]),Jo&16384&&(os.inModal=Vo[14]),Jo&512&&(os.modalUrl=Vo[9]),bo.$set(os)},i(Vo){Oo||(transition_in(Xn),transition_in(to.$$.fragment,Vo),transition_in(bo.$$.fragment,Vo),Oo=!0)},o(Vo){transition_out(Xn),transition_out(to.$$.fragment,Vo),transition_out(bo.$$.fragment,Vo),Oo=!1},d(Vo){Vo&&detach(Ce),$o[qn].d(),destroy_component(to),destroy_component(bo)}}}function instance$C(_n,Ce,ke){const $n=getContext$1("axios");let{schema:Hn}=Ce,{users:zn}=Ce,{records:Un}=Ce,{graph:qn}=Ce,{systemFields:Xn}=Ce,{sortParam:Kn}=Ce,{sortField:to}=Ce,{operators:io}=Ce,{filter:uo}=Ce,{limit:ho}=Ce,{skip:bo}=Ce,{total:Oo}=Ce,{inModal:So}=Ce,{modalUrl:$o}=Ce,{selected:Do=[]}=Ce,{isWritable:xo=!1}=Ce;function Io(Go){const os=Go.detail;$n.get(os).then(ms=>{ke(1,Un=ms.data.records),ke(2,Kn=ms.data.sortParam),ke(3,to=ms.data.sortField),ke(4,io=ms.data.operators),ke(5,uo=ms.data.filter),ke(7,bo=ms.data.skip),ke(6,ho=ms.data.limit),ke(8,Oo=ms.data.total),ke(9,$o=ms.data.modalUrl),document.querySelector("dialog h3").scrollIntoView()}).catch(ms=>{console.log(ms)})}function Vo(Go){Hn=Go,ke(0,Hn)}function Jo(Go){Un=Go,ke(1,Un)}function Mo(Go){Do=Go,ke(10,Do)}return _n.$$set=Go=>{"schema"in Go&&ke(0,Hn=Go.schema),"users"in Go&&ke(11,zn=Go.users),"records"in Go&&ke(1,Un=Go.records),"graph"in Go&&ke(12,qn=Go.graph),"systemFields"in Go&&ke(13,Xn=Go.systemFields),"sortParam"in Go&&ke(2,Kn=Go.sortParam),"sortField"in Go&&ke(3,to=Go.sortField),"operators"in Go&&ke(4,io=Go.operators),"filter"in Go&&ke(5,uo=Go.filter),"limit"in Go&&ke(6,ho=Go.limit),"skip"in Go&&ke(7,bo=Go.skip),"total"in Go&&ke(8,Oo=Go.total),"inModal"in Go&&ke(14,So=Go.inModal),"modalUrl"in Go&&ke(9,$o=Go.modalUrl),"selected"in Go&&ke(10,Do=Go.selected),"isWritable"in Go&&ke(15,xo=Go.isWritable)},[Hn,Un,Kn,to,io,uo,ho,bo,Oo,$o,Do,zn,qn,Xn,So,xo,Io,Vo,Jo,Mo]}let Index$1=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$C,create_fragment$C,safe_not_equal,{schema:0,users:11,records:1,graph:12,systemFields:13,sortParam:2,sortField:3,operators:4,filter:5,limit:6,skip:7,total:8,inModal:14,modalUrl:9,selected:10,isWritable:15})}};function create_if_block$t(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo,So,$o,Do,xo,Io=_n[2].length>0&&create_if_block_1$i(_n);uo=new Icon({props:{icon:"close"}});const Vo=[_n[3]];function Jo(Go){_n[7](Go)}let Mo={};for(let Go=0;Gobind(Oo,"selected",Jo)),{c(){Ce=element("div"),ke=element("button"),$n=text("Insert"),zn=space$3(),Un=element("button"),qn=text("Replace"),Kn=space$3(),Io&&Io.c(),to=space$3(),io=element("button"),create_component(uo.$$.fragment),ho=space$3(),bo=element("div"),create_component(Oo.$$.fragment),attr(ke,"type","button"),attr(ke,"class","button"),ke.disabled=Hn=_n[2].length===0,attr(Un,"type","button"),attr(Un,"class","button"),Un.disabled=Xn=_n[2].length===0,attr(io,"type","button"),attr(io,"class","button close"),attr(io,"aria-label","Close"),attr(Ce,"class","dialog-header"),attr(bo,"class","dialog-body")},m(Go,os){insert$1(Go,Ce,os),append(Ce,ke),append(ke,$n),append(Ce,zn),append(Ce,Un),append(Un,qn),append(Ce,Kn),Io&&Io.m(Ce,null),append(Ce,to),append(Ce,io),mount_component(uo,io,null),insert$1(Go,ho,os),insert$1(Go,bo,os),mount_component(Oo,bo,null),$o=!0,Do||(xo=[listen(ke,"click",_n[4]),listen(Un,"click",_n[5]),listen(io,"click",prevent_default(_n[0]))],Do=!0)},p(Go,os){(!$o||os&4&&Hn!==(Hn=Go[2].length===0))&&(ke.disabled=Hn),(!$o||os&4&&Xn!==(Xn=Go[2].length===0))&&(Un.disabled=Xn),Go[2].length>0?Io?Io.p(Go,os):(Io=create_if_block_1$i(Go),Io.c(),Io.m(Ce,to)):Io&&(Io.d(1),Io=null);const ms=os&8?get_spread_update(Vo,[get_spread_object(Go[3])]):{};!So&&os&4&&(So=!0,ms.selected=Go[2],add_flush_callback(()=>So=!1)),Oo.$set(ms)},i(Go){$o||(transition_in(uo.$$.fragment,Go),transition_in(Oo.$$.fragment,Go),$o=!0)},o(Go){transition_out(uo.$$.fragment,Go),transition_out(Oo.$$.fragment,Go),$o=!1},d(Go){Go&&(detach(Ce),detach(ho),detach(bo)),Io&&Io.d(),destroy_component(uo),destroy_component(Oo),Do=!1,run_all(xo)}}}function create_if_block_1$i(_n){let Ce,ke=_n[2].length+"",$n,Hn;return{c(){Ce=element("span"),$n=text(ke),Hn=text(" records selected"),attr(Ce,"class","")},m(zn,Un){insert$1(zn,Ce,Un),append(Ce,$n),append(Ce,Hn)},p(zn,Un){Un&4&&ke!==(ke=zn[2].length+"")&&set_data($n,ke)},d(zn){zn&&detach(Ce)}}}function create_fragment$B(_n){let Ce,ke,$n=_n[3].schema&&create_if_block$t(_n);return{c(){Ce=element("dialog"),$n&&$n.c()},m(Hn,zn){insert$1(Hn,Ce,zn),$n&&$n.m(Ce,null),_n[8](Ce),ke=!0},p(Hn,[zn]){Hn[3].schema?$n?($n.p(Hn,zn),zn&8&&transition_in($n,1)):($n=create_if_block$t(Hn),$n.c(),transition_in($n,1),$n.m(Ce,null)):$n&&(group_outros(),transition_out($n,1,1,()=>{$n=null}),check_outros())},i(Hn){ke||(transition_in($n),ke=!0)},o(Hn){transition_out($n),ke=!1},d(Hn){Hn&&detach(Ce),$n&&$n.d(),_n[8](null)}}}function instance$B(_n,Ce,ke){let $n,Hn;const zn=createEventDispatcher(),Un=getContext$1("channel");let qn=[];function Xn(Oo){Oo&&Oo.preventDefault(),Hn.close(),ke(2,qn=[])}function Kn(Oo){axios$1.get(Un.lucentUrl+"/content/"+Oo).then(So=>{ke(3,$n=So.data)}).catch(So=>console.log(So))}function to(Oo){Oo.preventDefault(),zn("insert",{records:qn,action:"insert",schema:$n.schema.name})}function io(Oo){Oo.preventDefault(),zn("insert",{records:qn,action:"replace"})}function uo(Oo){Hn.showModal(),Kn(Oo)}function ho(Oo){qn=Oo,ke(2,qn)}function bo(Oo){binding_callbacks[Oo?"unshift":"push"](()=>{Hn=Oo,ke(1,Hn)})}return ke(3,$n={}),[Xn,Hn,qn,$n,to,io,uo,ho,bo]}class Dialog extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$B,create_fragment$B,safe_not_equal,{close:0,open:6})}get close(){return this.$$.ctx[0]}get open(){return this.$$.ctx[6]}}function create_fragment$A(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn;Hn=new Icon({props:{icon:"close"}});const to=_n[4].default,io=create_slot(to,_n,_n[3],null);return{c(){Ce=element("dialog"),ke=element("div"),$n=element("button"),create_component(Hn.$$.fragment),zn=space$3(),Un=element("div"),io&&io.c(),attr($n,"type","button"),attr($n,"class","button close"),attr($n,"aria-label","Close"),attr(ke,"class","dialog-header"),attr(Un,"class","dialog-body"),set_style(Un,"min-width","900px")},m(uo,ho){insert$1(uo,Ce,ho),append(Ce,ke),append(ke,$n),mount_component(Hn,$n,null),append(Ce,zn),append(Ce,Un),io&&io.m(Un,null),_n[5](Ce),qn=!0,Xn||(Kn=listen($n,"click",prevent_default(_n[0])),Xn=!0)},p(uo,[ho]){io&&io.p&&(!qn||ho&8)&&update_slot_base(io,to,uo,uo[3],qn?get_slot_changes(to,uo[3],ho,null):get_all_dirty_from_scope(uo[3]),null)},i(uo){qn||(transition_in(Hn.$$.fragment,uo),transition_in(io,uo),qn=!0)},o(uo){transition_out(Hn.$$.fragment,uo),transition_out(io,uo),qn=!1},d(uo){uo&&detach(Ce),destroy_component(Hn),io&&io.d(uo),_n[5](null),Xn=!1,Kn()}}}function instance$A(_n,Ce,ke){let{$$slots:$n={},$$scope:Hn}=Ce,zn;function Un(Kn){Kn&&Kn.preventDefault(),zn.close()}function qn(){zn.showModal()}function Xn(Kn){binding_callbacks[Kn?"unshift":"push"](()=>{zn=Kn,ke(1,zn)})}return _n.$$set=Kn=>{"$$scope"in Kn&&ke(3,Hn=Kn.$$scope)},[Un,zn,qn,Hn,$n,Xn]}class DialogRecord extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$A,create_fragment$A,safe_not_equal,{close:0,open:2})}get close(){return this.$$.ctx[0]}get open(){return this.$$.ctx[2]}}function get_each_context$c(_n,Ce,ke){const $n=_n.slice();return $n[18]=Ce[ke],$n}function get_each_context_1$4(_n,Ce,ke){const $n=_n.slice();return $n[18]=Ce[ke],$n}function create_else_block$a(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn;return zn=new Icon({props:{icon:"magnifying-glass"}}),{c(){Ce=element("div"),ke=element("button"),ke.textContent="New",$n=space$3(),Hn=element("button"),create_component(zn.$$.fragment),attr(ke,"class","button"),attr(Hn,"class","button"),set_style(Ce,"display","flex"),set_style(Ce,"align-items","center"),set_style(Ce,"gap","4px")},m(Kn,to){insert$1(Kn,Ce,to),append(Ce,ke),append(Ce,$n),append(Ce,Hn),mount_component(zn,Hn,null),Un=!0,qn||(Xn=[listen(ke,"click",_n[11]),listen(Hn,"click",_n[12])],qn=!0)},p:noop,i(Kn){Un||(transition_in(zn.$$.fragment,Kn),Un=!0)},o(Kn){transition_out(zn.$$.fragment,Kn),Un=!1},d(Kn){Kn&&detach(Ce),destroy_component(zn),qn=!1,run_all(Xn)}}}function create_if_block_1$h(_n){let Ce,ke,$n,Hn,zn;return ke=new Dropdown({props:{$$slots:{button:[create_button_slot_1],default:[create_default_slot_2]},$$scope:{ctx:_n}}}),Hn=new Dropdown({props:{$$slots:{button:[create_button_slot$4],default:[create_default_slot_1$1]},$$scope:{ctx:_n}}}),{c(){Ce=element("div"),create_component(ke.$$.fragment),$n=space$3(),create_component(Hn.$$.fragment),set_style(Ce,"display","flex"),set_style(Ce,"align-items","center"),set_style(Ce,"gap","4px")},m(Un,qn){insert$1(Un,Ce,qn),mount_component(ke,Ce,null),append(Ce,$n),mount_component(Hn,Ce,null),zn=!0},p(Un,qn){const Xn={};qn&8388609&&(Xn.$$scope={dirty:qn,ctx:Un}),ke.$set(Xn);const Kn={};qn&8388609&&(Kn.$$scope={dirty:qn,ctx:Un}),Hn.$set(Kn)},i(Un){zn||(transition_in(ke.$$.fragment,Un),transition_in(Hn.$$.fragment,Un),zn=!0)},o(Un){transition_out(ke.$$.fragment,Un),transition_out(Hn.$$.fragment,Un),zn=!1},d(Un){Un&&detach(Ce),destroy_component(ke),destroy_component(Hn)}}}function create_each_block_1$4(_n){let Ce,ke=_n[18].label+"",$n,Hn,zn,Un;function qn(...Xn){return _n[9](_n[18],...Xn)}return{c(){Ce=element("button"),$n=text(ke),Hn=space$3(),attr(Ce,"class","button")},m(Xn,Kn){insert$1(Xn,Ce,Kn),append(Ce,$n),append(Ce,Hn),zn||(Un=listen(Ce,"click",qn),zn=!0)},p(Xn,Kn){_n=Xn,Kn&1&&ke!==(ke=_n[18].label+"")&&set_data($n,ke)},d(Xn){Xn&&detach(Ce),zn=!1,Un()}}}function create_default_slot_2(_n){let Ce,ke=ensure_array_like(_n[0]),$n=[];for(let Hn=0;Hn{$n=null}),check_outros())},i(Hn){ke||(transition_in($n),ke=!0)},o(Hn){transition_out($n),ke=!1},d(Hn){Hn&&detach(Ce),$n&&$n.d(Hn)}}}function create_fragment$z(_n){let Ce,ke,$n,Hn,zn,Un,qn;const Xn=[create_if_block_1$h,create_else_block$a],Kn=[];function to(ho,bo){return ho[0].length>1?0:1}Ce=to(_n),ke=Kn[Ce]=Xn[Ce](_n);let io={$$slots:{default:[create_default_slot$5]},$$scope:{ctx:_n}};Hn=new DialogRecord({props:io}),_n[14](Hn);let uo={};return Un=new Dialog({props:uo}),_n[15](Un),Un.$on("insert",_n[6]),{c(){ke.c(),$n=space$3(),create_component(Hn.$$.fragment),zn=space$3(),create_component(Un.$$.fragment)},m(ho,bo){Kn[Ce].m(ho,bo),insert$1(ho,$n,bo),mount_component(Hn,ho,bo),insert$1(ho,zn,bo),mount_component(Un,ho,bo),qn=!0},p(ho,[bo]){let Oo=Ce;Ce=to(ho),Ce===Oo?Kn[Ce].p(ho,bo):(group_outros(),transition_out(Kn[Oo],1,1,()=>{Kn[Oo]=null}),check_outros(),ke=Kn[Ce],ke?ke.p(ho,bo):(ke=Kn[Ce]=Xn[Ce](ho),ke.c()),transition_in(ke,1),ke.m($n.parentNode,$n));const So={};bo&8388616&&(So.$$scope={dirty:bo,ctx:ho}),Hn.$set(So);const $o={};Un.$set($o)},i(ho){qn||(transition_in(ke),transition_in(Hn.$$.fragment,ho),transition_in(Un.$$.fragment,ho),qn=!0)},o(ho){transition_out(ke),transition_out(Hn.$$.fragment,ho),transition_out(Un.$$.fragment,ho),qn=!1},d(ho){ho&&(detach($n),detach(zn)),Kn[Ce].d(ho),_n[14](null),destroy_component(Hn,ho),_n[15](null),destroy_component(Un,ho)}}}function instance$z(_n,Ce,ke){const $n=createEventDispatcher(),Hn=getContext$1("channel");let{schemas:zn}=Ce,{recordId:Un}=Ce,qn,Xn,Kn;function to(Vo,Jo){Vo.preventDefault(),qn.open(Jo)}function io(Vo){Vo.preventDefault(),console.log("Save inline"),ke(3,Kn=null),Xn.close(),$n("save",{records:Vo.detail.records,after:Un})}function uo(Vo){Vo.preventDefault(),qn.close(),$n("insert",{records:Vo.detail.records,schema:Vo.detail.schema,after:Un})}function ho(Vo,Jo){Vo.preventDefault(),ke(3,Kn=null),axios$1.get(Hn.lucentUrl+"/records/newInline?schema="+Jo).then(Mo=>{ke(3,Kn=Mo.data),Xn.open()}).catch(Mo=>{console.log(Mo)})}const bo=(Vo,Jo)=>ho(Jo,Vo.name),Oo=(Vo,Jo)=>to(Jo,Vo.name),So=Vo=>ho(Vo,zn[0].name),$o=Vo=>to(Vo,zn[0].name),Do=Vo=>ke(3,Kn=null);function xo(Vo){binding_callbacks[Vo?"unshift":"push"](()=>{Xn=Vo,ke(2,Xn)})}function Io(Vo){binding_callbacks[Vo?"unshift":"push"](()=>{qn=Vo,ke(1,qn)})}return _n.$$set=Vo=>{"schemas"in Vo&&ke(0,zn=Vo.schemas),"recordId"in Vo&&ke(8,Un=Vo.recordId)},[zn,qn,Xn,Kn,to,io,uo,ho,Un,bo,Oo,So,$o,Do,xo,Io]}class ReferenceInlineButtons extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$z,create_fragment$z,safe_not_equal,{schemas:0,recordId:8})}}/**! + * Sortable 1.15.2 + * @author RubaXa + * @author owenm + * @license MIT + */function ownKeys(_n,Ce){var ke=Object.keys(_n);if(Object.getOwnPropertySymbols){var $n=Object.getOwnPropertySymbols(_n);Ce&&($n=$n.filter(function(Hn){return Object.getOwnPropertyDescriptor(_n,Hn).enumerable})),ke.push.apply(ke,$n)}return ke}function _objectSpread2(_n){for(var Ce=1;Ce=0)&&(ke[Hn]=_n[Hn]);return ke}function _objectWithoutProperties(_n,Ce){if(_n==null)return{};var ke=_objectWithoutPropertiesLoose(_n,Ce),$n,Hn;if(Object.getOwnPropertySymbols){var zn=Object.getOwnPropertySymbols(_n);for(Hn=0;Hn=0)&&Object.prototype.propertyIsEnumerable.call(_n,$n)&&(ke[$n]=_n[$n])}return ke}var version="1.15.2";function userAgent(_n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(_n)}var IE11OrLess=userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Edge=userAgent(/Edge/i),FireFox=userAgent(/firefox/i),Safari=userAgent(/safari/i)&&!userAgent(/chrome/i)&&!userAgent(/android/i),IOS=userAgent(/iP(ad|od|hone)/i),ChromeForAndroid=userAgent(/chrome/i)&&userAgent(/android/i),captureMode={capture:!1,passive:!1};function on$1(_n,Ce,ke){_n.addEventListener(Ce,ke,!IE11OrLess&&captureMode)}function off(_n,Ce,ke){_n.removeEventListener(Ce,ke,!IE11OrLess&&captureMode)}function matches(_n,Ce){if(Ce){if(Ce[0]===">"&&(Ce=Ce.substring(1)),_n)try{if(_n.matches)return _n.matches(Ce);if(_n.msMatchesSelector)return _n.msMatchesSelector(Ce);if(_n.webkitMatchesSelector)return _n.webkitMatchesSelector(Ce)}catch{return!1}return!1}}function getParentOrHost(_n){return _n.host&&_n!==document&&_n.host.nodeType?_n.host:_n.parentNode}function closest(_n,Ce,ke,$n){if(_n){ke=ke||document;do{if(Ce!=null&&(Ce[0]===">"?_n.parentNode===ke&&matches(_n,Ce):matches(_n,Ce))||$n&&_n===ke)return _n;if(_n===ke)break}while(_n=getParentOrHost(_n))}return null}var R_SPACE=/\s+/g;function toggleClass$1(_n,Ce,ke){if(_n&&Ce)if(_n.classList)_n.classList[ke?"add":"remove"](Ce);else{var $n=(" "+_n.className+" ").replace(R_SPACE," ").replace(" "+Ce+" "," ");_n.className=($n+(ke?" "+Ce:"")).replace(R_SPACE," ")}}function css$1(_n,Ce,ke){var $n=_n&&_n.style;if($n){if(ke===void 0)return document.defaultView&&document.defaultView.getComputedStyle?ke=document.defaultView.getComputedStyle(_n,""):_n.currentStyle&&(ke=_n.currentStyle),Ce===void 0?ke:ke[Ce];!(Ce in $n)&&Ce.indexOf("webkit")===-1&&(Ce="-webkit-"+Ce),$n[Ce]=ke+(typeof ke=="string"?"":"px")}}function matrix(_n,Ce){var ke="";if(typeof _n=="string")ke=_n;else do{var $n=css$1(_n,"transform");$n&&$n!=="none"&&(ke=$n+" "+ke)}while(!Ce&&(_n=_n.parentNode));var Hn=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return Hn&&new Hn(ke)}function find$1(_n,Ce,ke){if(_n){var $n=_n.getElementsByTagName(Ce),Hn=0,zn=$n.length;if(ke)for(;Hn=zn,!Un)return $n;if($n===getWindowScrollingElement())break;$n=getParentAutoScrollElement($n,!1)}return!1}function getChild(_n,Ce,ke,$n){for(var Hn=0,zn=0,Un=_n.children;zn2&&arguments[2]!==void 0?arguments[2]:{},Hn=$n.evt,zn=_objectWithoutProperties($n,_excluded);PluginManager.pluginEvent.bind(Sortable)(Ce,ke,_objectSpread2({dragEl,parentEl,ghostEl,rootEl,nextEl,lastDownEl,cloneEl,cloneHidden,dragStarted:moved,putSortable,activeSortable:Sortable.active,originalEvent:Hn,oldIndex,oldDraggableIndex,newIndex,newDraggableIndex,hideGhostForTarget:_hideGhostForTarget,unhideGhostForTarget:_unhideGhostForTarget,cloneNowHidden:function(){cloneHidden=!0},cloneNowShown:function(){cloneHidden=!1},dispatchSortableEvent:function(qn){_dispatchEvent({sortable:ke,name:qn,originalEvent:Hn})}},zn))};function _dispatchEvent(_n){dispatchEvent(_objectSpread2({putSortable,cloneEl,targetEl:dragEl,rootEl,oldIndex,oldDraggableIndex,newIndex,newDraggableIndex},_n))}var dragEl,parentEl,ghostEl,rootEl,nextEl,lastDownEl,cloneEl,cloneHidden,oldIndex,newIndex,oldDraggableIndex,newDraggableIndex,activeGroup,putSortable,awaitingDragStarted=!1,ignoreNextClick=!1,sortables=[],tapEvt,touchEvt,lastDx,lastDy,tapDistanceLeft,tapDistanceTop,moved,lastTarget,lastDirection,pastFirstInvertThresh=!1,isCircumstantialInvert=!1,targetMoveDistance,ghostRelativeParent,ghostRelativeParentInitialScroll=[],_silent=!1,savedInputChecked=[],documentExists=typeof document<"u",PositionGhostAbsolutely=IOS,CSSFloatProperty=Edge||IE11OrLess?"cssFloat":"float",supportDraggable=documentExists&&!ChromeForAndroid&&!IOS&&"draggable"in document.createElement("div"),supportCssPointerEvents=function(){if(documentExists){if(IE11OrLess)return!1;var _n=document.createElement("x");return _n.style.cssText="pointer-events:auto",_n.style.pointerEvents==="auto"}}(),_detectDirection=function(Ce,ke){var $n=css$1(Ce),Hn=parseInt($n.width)-parseInt($n.paddingLeft)-parseInt($n.paddingRight)-parseInt($n.borderLeftWidth)-parseInt($n.borderRightWidth),zn=getChild(Ce,0,ke),Un=getChild(Ce,1,ke),qn=zn&&css$1(zn),Xn=Un&&css$1(Un),Kn=qn&&parseInt(qn.marginLeft)+parseInt(qn.marginRight)+getRect(zn).width,to=Xn&&parseInt(Xn.marginLeft)+parseInt(Xn.marginRight)+getRect(Un).width;if($n.display==="flex")return $n.flexDirection==="column"||$n.flexDirection==="column-reverse"?"vertical":"horizontal";if($n.display==="grid")return $n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(zn&&qn.float&&qn.float!=="none"){var io=qn.float==="left"?"left":"right";return Un&&(Xn.clear==="both"||Xn.clear===io)?"vertical":"horizontal"}return zn&&(qn.display==="block"||qn.display==="flex"||qn.display==="table"||qn.display==="grid"||Kn>=Hn&&$n[CSSFloatProperty]==="none"||Un&&$n[CSSFloatProperty]==="none"&&Kn+to>Hn)?"vertical":"horizontal"},_dragElInRowColumn=function(Ce,ke,$n){var Hn=$n?Ce.left:Ce.top,zn=$n?Ce.right:Ce.bottom,Un=$n?Ce.width:Ce.height,qn=$n?ke.left:ke.top,Xn=$n?ke.right:ke.bottom,Kn=$n?ke.width:ke.height;return Hn===qn||zn===Xn||Hn+Un/2===qn+Kn/2},_detectNearestEmptySortable=function(Ce,ke){var $n;return sortables.some(function(Hn){var zn=Hn[expando].options.emptyInsertThreshold;if(!(!zn||lastChild(Hn))){var Un=getRect(Hn),qn=Ce>=Un.left-zn&&Ce<=Un.right+zn,Xn=ke>=Un.top-zn&&ke<=Un.bottom+zn;if(qn&&Xn)return $n=Hn}}),$n},_prepareGroup=function(Ce){function ke(zn,Un){return function(qn,Xn,Kn,to){var io=qn.options.group.name&&Xn.options.group.name&&qn.options.group.name===Xn.options.group.name;if(zn==null&&(Un||io))return!0;if(zn==null||zn===!1)return!1;if(Un&&zn==="clone")return zn;if(typeof zn=="function")return ke(zn(qn,Xn,Kn,to),Un)(qn,Xn,Kn,to);var uo=(Un?qn:Xn).options.group.name;return zn===!0||typeof zn=="string"&&zn===uo||zn.join&&zn.indexOf(uo)>-1}}var $n={},Hn=Ce.group;(!Hn||_typeof(Hn)!="object")&&(Hn={name:Hn}),$n.name=Hn.name,$n.checkPull=ke(Hn.pull,!0),$n.checkPut=ke(Hn.put),$n.revertClone=Hn.revertClone,Ce.group=$n},_hideGhostForTarget=function(){!supportCssPointerEvents&&ghostEl&&css$1(ghostEl,"display","none")},_unhideGhostForTarget=function(){!supportCssPointerEvents&&ghostEl&&css$1(ghostEl,"display","")};documentExists&&!ChromeForAndroid&&document.addEventListener("click",function(_n){if(ignoreNextClick)return _n.preventDefault(),_n.stopPropagation&&_n.stopPropagation(),_n.stopImmediatePropagation&&_n.stopImmediatePropagation(),ignoreNextClick=!1,!1},!0);var nearestEmptyInsertDetectEvent=function(Ce){if(dragEl){Ce=Ce.touches?Ce.touches[0]:Ce;var ke=_detectNearestEmptySortable(Ce.clientX,Ce.clientY);if(ke){var $n={};for(var Hn in Ce)Ce.hasOwnProperty(Hn)&&($n[Hn]=Ce[Hn]);$n.target=$n.rootEl=ke,$n.preventDefault=void 0,$n.stopPropagation=void 0,ke[expando]._onDragOver($n)}}},_checkOutsideTargetEl=function(Ce){dragEl&&dragEl.parentNode[expando]._isOutsideThisEl(Ce.target)};function Sortable(_n,Ce){if(!(_n&&_n.nodeType&&_n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(_n));this.el=_n,this.options=Ce=_extends({},Ce),_n[expando]=this;var ke={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(_n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return _detectDirection(_n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(Un,qn){Un.setData("Text",qn.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Sortable.supportPointer!==!1&&"PointerEvent"in window&&!Safari,emptyInsertThreshold:5};PluginManager.initializePlugins(this,_n,ke);for(var $n in ke)!($n in Ce)&&(Ce[$n]=ke[$n]);_prepareGroup(Ce);for(var Hn in this)Hn.charAt(0)==="_"&&typeof this[Hn]=="function"&&(this[Hn]=this[Hn].bind(this));this.nativeDraggable=Ce.forceFallback?!1:supportDraggable,this.nativeDraggable&&(this.options.touchStartThreshold=1),Ce.supportPointer?on$1(_n,"pointerdown",this._onTapStart):(on$1(_n,"mousedown",this._onTapStart),on$1(_n,"touchstart",this._onTapStart)),this.nativeDraggable&&(on$1(_n,"dragover",this),on$1(_n,"dragenter",this)),sortables.push(this.el),Ce.store&&Ce.store.get&&this.sort(Ce.store.get(this)||[]),_extends(this,AnimationStateManager())}Sortable.prototype={constructor:Sortable,_isOutsideThisEl:function(Ce){!this.el.contains(Ce)&&Ce!==this.el&&(lastTarget=null)},_getDirection:function(Ce,ke){return typeof this.options.direction=="function"?this.options.direction.call(this,Ce,ke,dragEl):this.options.direction},_onTapStart:function(Ce){if(Ce.cancelable){var ke=this,$n=this.el,Hn=this.options,zn=Hn.preventOnFilter,Un=Ce.type,qn=Ce.touches&&Ce.touches[0]||Ce.pointerType&&Ce.pointerType==="touch"&&Ce,Xn=(qn||Ce).target,Kn=Ce.target.shadowRoot&&(Ce.path&&Ce.path[0]||Ce.composedPath&&Ce.composedPath()[0])||Xn,to=Hn.filter;if(_saveInputCheckedState($n),!dragEl&&!(/mousedown|pointerdown/.test(Un)&&Ce.button!==0||Hn.disabled)&&!Kn.isContentEditable&&!(!this.nativeDraggable&&Safari&&Xn&&Xn.tagName.toUpperCase()==="SELECT")&&(Xn=closest(Xn,Hn.draggable,$n,!1),!(Xn&&Xn.animated)&&lastDownEl!==Xn)){if(oldIndex=index(Xn),oldDraggableIndex=index(Xn,Hn.draggable),typeof to=="function"){if(to.call(this,Ce,Xn,this)){_dispatchEvent({sortable:ke,rootEl:Kn,name:"filter",targetEl:Xn,toEl:$n,fromEl:$n}),pluginEvent("filter",ke,{evt:Ce}),zn&&Ce.cancelable&&Ce.preventDefault();return}}else if(to&&(to=to.split(",").some(function(io){if(io=closest(Kn,io.trim(),$n,!1),io)return _dispatchEvent({sortable:ke,rootEl:io,name:"filter",targetEl:Xn,fromEl:$n,toEl:$n}),pluginEvent("filter",ke,{evt:Ce}),!0}),to)){zn&&Ce.cancelable&&Ce.preventDefault();return}Hn.handle&&!closest(Kn,Hn.handle,$n,!1)||this._prepareDragStart(Ce,qn,Xn)}}},_prepareDragStart:function(Ce,ke,$n){var Hn=this,zn=Hn.el,Un=Hn.options,qn=zn.ownerDocument,Xn;if($n&&!dragEl&&$n.parentNode===zn){var Kn=getRect($n);if(rootEl=zn,dragEl=$n,parentEl=dragEl.parentNode,nextEl=dragEl.nextSibling,lastDownEl=$n,activeGroup=Un.group,Sortable.dragged=dragEl,tapEvt={target:dragEl,clientX:(ke||Ce).clientX,clientY:(ke||Ce).clientY},tapDistanceLeft=tapEvt.clientX-Kn.left,tapDistanceTop=tapEvt.clientY-Kn.top,this._lastX=(ke||Ce).clientX,this._lastY=(ke||Ce).clientY,dragEl.style["will-change"]="all",Xn=function(){if(pluginEvent("delayEnded",Hn,{evt:Ce}),Sortable.eventCanceled){Hn._onDrop();return}Hn._disableDelayedDragEvents(),!FireFox&&Hn.nativeDraggable&&(dragEl.draggable=!0),Hn._triggerDragStart(Ce,ke),_dispatchEvent({sortable:Hn,name:"choose",originalEvent:Ce}),toggleClass$1(dragEl,Un.chosenClass,!0)},Un.ignore.split(",").forEach(function(to){find$1(dragEl,to.trim(),_disableDraggable)}),on$1(qn,"dragover",nearestEmptyInsertDetectEvent),on$1(qn,"mousemove",nearestEmptyInsertDetectEvent),on$1(qn,"touchmove",nearestEmptyInsertDetectEvent),on$1(qn,"mouseup",Hn._onDrop),on$1(qn,"touchend",Hn._onDrop),on$1(qn,"touchcancel",Hn._onDrop),FireFox&&this.nativeDraggable&&(this.options.touchStartThreshold=4,dragEl.draggable=!0),pluginEvent("delayStart",this,{evt:Ce}),Un.delay&&(!Un.delayOnTouchOnly||ke)&&(!this.nativeDraggable||!(Edge||IE11OrLess))){if(Sortable.eventCanceled){this._onDrop();return}on$1(qn,"mouseup",Hn._disableDelayedDrag),on$1(qn,"touchend",Hn._disableDelayedDrag),on$1(qn,"touchcancel",Hn._disableDelayedDrag),on$1(qn,"mousemove",Hn._delayedDragTouchMoveHandler),on$1(qn,"touchmove",Hn._delayedDragTouchMoveHandler),Un.supportPointer&&on$1(qn,"pointermove",Hn._delayedDragTouchMoveHandler),Hn._dragStartTimer=setTimeout(Xn,Un.delay)}else Xn()}},_delayedDragTouchMoveHandler:function(Ce){var ke=Ce.touches?Ce.touches[0]:Ce;Math.max(Math.abs(ke.clientX-this._lastX),Math.abs(ke.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){dragEl&&_disableDraggable(dragEl),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var Ce=this.el.ownerDocument;off(Ce,"mouseup",this._disableDelayedDrag),off(Ce,"touchend",this._disableDelayedDrag),off(Ce,"touchcancel",this._disableDelayedDrag),off(Ce,"mousemove",this._delayedDragTouchMoveHandler),off(Ce,"touchmove",this._delayedDragTouchMoveHandler),off(Ce,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(Ce,ke){ke=ke||Ce.pointerType=="touch"&&Ce,!this.nativeDraggable||ke?this.options.supportPointer?on$1(document,"pointermove",this._onTouchMove):ke?on$1(document,"touchmove",this._onTouchMove):on$1(document,"mousemove",this._onTouchMove):(on$1(dragEl,"dragend",this),on$1(rootEl,"dragstart",this._onDragStart));try{document.selection?_nextTick(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(Ce,ke){if(awaitingDragStarted=!1,rootEl&&dragEl){pluginEvent("dragStarted",this,{evt:ke}),this.nativeDraggable&&on$1(document,"dragover",_checkOutsideTargetEl);var $n=this.options;!Ce&&toggleClass$1(dragEl,$n.dragClass,!1),toggleClass$1(dragEl,$n.ghostClass,!0),Sortable.active=this,Ce&&this._appendGhost(),_dispatchEvent({sortable:this,name:"start",originalEvent:ke})}else this._nulling()},_emulateDragOver:function(){if(touchEvt){this._lastX=touchEvt.clientX,this._lastY=touchEvt.clientY,_hideGhostForTarget();for(var Ce=document.elementFromPoint(touchEvt.clientX,touchEvt.clientY),ke=Ce;Ce&&Ce.shadowRoot&&(Ce=Ce.shadowRoot.elementFromPoint(touchEvt.clientX,touchEvt.clientY),Ce!==ke);)ke=Ce;if(dragEl.parentNode[expando]._isOutsideThisEl(Ce),ke)do{if(ke[expando]){var $n=void 0;if($n=ke[expando]._onDragOver({clientX:touchEvt.clientX,clientY:touchEvt.clientY,target:Ce,rootEl:ke}),$n&&!this.options.dragoverBubble)break}Ce=ke}while(ke=ke.parentNode);_unhideGhostForTarget()}},_onTouchMove:function(Ce){if(tapEvt){var ke=this.options,$n=ke.fallbackTolerance,Hn=ke.fallbackOffset,zn=Ce.touches?Ce.touches[0]:Ce,Un=ghostEl&&matrix(ghostEl,!0),qn=ghostEl&&Un&&Un.a,Xn=ghostEl&&Un&&Un.d,Kn=PositionGhostAbsolutely&&ghostRelativeParent&&getRelativeScrollOffset(ghostRelativeParent),to=(zn.clientX-tapEvt.clientX+Hn.x)/(qn||1)+(Kn?Kn[0]-ghostRelativeParentInitialScroll[0]:0)/(qn||1),io=(zn.clientY-tapEvt.clientY+Hn.y)/(Xn||1)+(Kn?Kn[1]-ghostRelativeParentInitialScroll[1]:0)/(Xn||1);if(!Sortable.active&&!awaitingDragStarted){if($n&&Math.max(Math.abs(zn.clientX-this._lastX),Math.abs(zn.clientY-this._lastY))<$n)return;this._onDragStart(Ce,!0)}if(ghostEl){Un?(Un.e+=to-(lastDx||0),Un.f+=io-(lastDy||0)):Un={a:1,b:0,c:0,d:1,e:to,f:io};var uo="matrix(".concat(Un.a,",").concat(Un.b,",").concat(Un.c,",").concat(Un.d,",").concat(Un.e,",").concat(Un.f,")");css$1(ghostEl,"webkitTransform",uo),css$1(ghostEl,"mozTransform",uo),css$1(ghostEl,"msTransform",uo),css$1(ghostEl,"transform",uo),lastDx=to,lastDy=io,touchEvt=zn}Ce.cancelable&&Ce.preventDefault()}},_appendGhost:function(){if(!ghostEl){var Ce=this.options.fallbackOnBody?document.body:rootEl,ke=getRect(dragEl,!0,PositionGhostAbsolutely,!0,Ce),$n=this.options;if(PositionGhostAbsolutely){for(ghostRelativeParent=Ce;css$1(ghostRelativeParent,"position")==="static"&&css$1(ghostRelativeParent,"transform")==="none"&&ghostRelativeParent!==document;)ghostRelativeParent=ghostRelativeParent.parentNode;ghostRelativeParent!==document.body&&ghostRelativeParent!==document.documentElement?(ghostRelativeParent===document&&(ghostRelativeParent=getWindowScrollingElement()),ke.top+=ghostRelativeParent.scrollTop,ke.left+=ghostRelativeParent.scrollLeft):ghostRelativeParent=getWindowScrollingElement(),ghostRelativeParentInitialScroll=getRelativeScrollOffset(ghostRelativeParent)}ghostEl=dragEl.cloneNode(!0),toggleClass$1(ghostEl,$n.ghostClass,!1),toggleClass$1(ghostEl,$n.fallbackClass,!0),toggleClass$1(ghostEl,$n.dragClass,!0),css$1(ghostEl,"transition",""),css$1(ghostEl,"transform",""),css$1(ghostEl,"box-sizing","border-box"),css$1(ghostEl,"margin",0),css$1(ghostEl,"top",ke.top),css$1(ghostEl,"left",ke.left),css$1(ghostEl,"width",ke.width),css$1(ghostEl,"height",ke.height),css$1(ghostEl,"opacity","0.8"),css$1(ghostEl,"position",PositionGhostAbsolutely?"absolute":"fixed"),css$1(ghostEl,"zIndex","100000"),css$1(ghostEl,"pointerEvents","none"),Sortable.ghost=ghostEl,Ce.appendChild(ghostEl),css$1(ghostEl,"transform-origin",tapDistanceLeft/parseInt(ghostEl.style.width)*100+"% "+tapDistanceTop/parseInt(ghostEl.style.height)*100+"%")}},_onDragStart:function(Ce,ke){var $n=this,Hn=Ce.dataTransfer,zn=$n.options;if(pluginEvent("dragStart",this,{evt:Ce}),Sortable.eventCanceled){this._onDrop();return}pluginEvent("setupClone",this),Sortable.eventCanceled||(cloneEl=clone(dragEl),cloneEl.removeAttribute("id"),cloneEl.draggable=!1,cloneEl.style["will-change"]="",this._hideClone(),toggleClass$1(cloneEl,this.options.chosenClass,!1),Sortable.clone=cloneEl),$n.cloneId=_nextTick(function(){pluginEvent("clone",$n),!Sortable.eventCanceled&&($n.options.removeCloneOnHide||rootEl.insertBefore(cloneEl,dragEl),$n._hideClone(),_dispatchEvent({sortable:$n,name:"clone"}))}),!ke&&toggleClass$1(dragEl,zn.dragClass,!0),ke?(ignoreNextClick=!0,$n._loopId=setInterval($n._emulateDragOver,50)):(off(document,"mouseup",$n._onDrop),off(document,"touchend",$n._onDrop),off(document,"touchcancel",$n._onDrop),Hn&&(Hn.effectAllowed="move",zn.setData&&zn.setData.call($n,Hn,dragEl)),on$1(document,"drop",$n),css$1(dragEl,"transform","translateZ(0)")),awaitingDragStarted=!0,$n._dragStartId=_nextTick($n._dragStarted.bind($n,ke,Ce)),on$1(document,"selectstart",$n),moved=!0,Safari&&css$1(document.body,"user-select","none")},_onDragOver:function(Ce){var ke=this.el,$n=Ce.target,Hn,zn,Un,qn=this.options,Xn=qn.group,Kn=Sortable.active,to=activeGroup===Xn,io=qn.sort,uo=putSortable||Kn,ho,bo=this,Oo=!1;if(_silent)return;function So(xs,Qr){pluginEvent(xs,bo,_objectSpread2({evt:Ce,isOwner:to,axis:ho?"vertical":"horizontal",revert:Un,dragRect:Hn,targetRect:zn,canSort:io,fromSortable:uo,target:$n,completed:Do,onMove:function(ws,Fs){return _onMove(rootEl,ke,dragEl,Hn,ws,getRect(ws),Ce,Fs)},changed:xo},Qr))}function $o(){So("dragOverAnimationCapture"),bo.captureAnimationState(),bo!==uo&&uo.captureAnimationState()}function Do(xs){return So("dragOverCompleted",{insertion:xs}),xs&&(to?Kn._hideClone():Kn._showClone(bo),bo!==uo&&(toggleClass$1(dragEl,putSortable?putSortable.options.ghostClass:Kn.options.ghostClass,!1),toggleClass$1(dragEl,qn.ghostClass,!0)),putSortable!==bo&&bo!==Sortable.active?putSortable=bo:bo===Sortable.active&&putSortable&&(putSortable=null),uo===bo&&(bo._ignoreWhileAnimating=$n),bo.animateAll(function(){So("dragOverAnimationComplete"),bo._ignoreWhileAnimating=null}),bo!==uo&&(uo.animateAll(),uo._ignoreWhileAnimating=null)),($n===dragEl&&!dragEl.animated||$n===ke&&!$n.animated)&&(lastTarget=null),!qn.dragoverBubble&&!Ce.rootEl&&$n!==document&&(dragEl.parentNode[expando]._isOutsideThisEl(Ce.target),!xs&&nearestEmptyInsertDetectEvent(Ce)),!qn.dragoverBubble&&Ce.stopPropagation&&Ce.stopPropagation(),Oo=!0}function xo(){newIndex=index(dragEl),newDraggableIndex=index(dragEl,qn.draggable),_dispatchEvent({sortable:bo,name:"change",toEl:ke,newIndex,newDraggableIndex,originalEvent:Ce})}if(Ce.preventDefault!==void 0&&Ce.cancelable&&Ce.preventDefault(),$n=closest($n,qn.draggable,ke,!0),So("dragOver"),Sortable.eventCanceled)return Oo;if(dragEl.contains(Ce.target)||$n.animated&&$n.animatingX&&$n.animatingY||bo._ignoreWhileAnimating===$n)return Do(!1);if(ignoreNextClick=!1,Kn&&!qn.disabled&&(to?io||(Un=parentEl!==rootEl):putSortable===this||(this.lastPutMode=activeGroup.checkPull(this,Kn,dragEl,Ce))&&Xn.checkPut(this,Kn,dragEl,Ce))){if(ho=this._getDirection(Ce,$n)==="vertical",Hn=getRect(dragEl),So("dragOverValid"),Sortable.eventCanceled)return Oo;if(Un)return parentEl=rootEl,$o(),this._hideClone(),So("revert"),Sortable.eventCanceled||(nextEl?rootEl.insertBefore(dragEl,nextEl):rootEl.appendChild(dragEl)),Do(!0);var Io=lastChild(ke,qn.draggable);if(!Io||_ghostIsLast(Ce,ho,this)&&!Io.animated){if(Io===dragEl)return Do(!1);if(Io&&ke===Ce.target&&($n=Io),$n&&(zn=getRect($n)),_onMove(rootEl,ke,dragEl,Hn,$n,zn,Ce,!!$n)!==!1)return $o(),Io&&Io.nextSibling?ke.insertBefore(dragEl,Io.nextSibling):ke.appendChild(dragEl),parentEl=ke,xo(),Do(!0)}else if(Io&&_ghostIsFirst(Ce,ho,this)){var Vo=getChild(ke,0,qn,!0);if(Vo===dragEl)return Do(!1);if($n=Vo,zn=getRect($n),_onMove(rootEl,ke,dragEl,Hn,$n,zn,Ce,!1)!==!1)return $o(),ke.insertBefore(dragEl,Vo),parentEl=ke,xo(),Do(!0)}else if($n.parentNode===ke){zn=getRect($n);var Jo=0,Mo,Go=dragEl.parentNode!==ke,os=!_dragElInRowColumn(dragEl.animated&&dragEl.toRect||Hn,$n.animated&&$n.toRect||zn,ho),ms=ho?"top":"left",is=isScrolledPast($n,"top","top")||isScrolledPast(dragEl,"top","top"),Yo=is?is.scrollTop:void 0;lastTarget!==$n&&(Mo=zn[ms],pastFirstInvertThresh=!1,isCircumstantialInvert=!os&&qn.invertSwap||Go),Jo=_getSwapDirection(Ce,$n,zn,ho,os?1:qn.swapThreshold,qn.invertedSwapThreshold==null?qn.swapThreshold:qn.invertedSwapThreshold,isCircumstantialInvert,lastTarget===$n);var Ys;if(Jo!==0){var sr=index(dragEl);do sr-=Jo,Ys=parentEl.children[sr];while(Ys&&(css$1(Ys,"display")==="none"||Ys===ghostEl))}if(Jo===0||Ys===$n)return Do(!1);lastTarget=$n,lastDirection=Jo;var Js=$n.nextElementSibling,ko=!1;ko=Jo===1;var gs=_onMove(rootEl,ke,dragEl,Hn,$n,zn,Ce,ko);if(gs!==!1)return(gs===1||gs===-1)&&(ko=gs===1),_silent=!0,setTimeout(_unsilent,30),$o(),ko&&!Js?ke.appendChild(dragEl):$n.parentNode.insertBefore(dragEl,ko?Js:$n),is&&scrollBy(is,0,Yo-is.scrollTop),parentEl=dragEl.parentNode,Mo!==void 0&&!isCircumstantialInvert&&(targetMoveDistance=Math.abs(Mo-getRect($n)[ms])),xo(),Do(!0)}if(ke.contains(dragEl))return Do(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){off(document,"mousemove",this._onTouchMove),off(document,"touchmove",this._onTouchMove),off(document,"pointermove",this._onTouchMove),off(document,"dragover",nearestEmptyInsertDetectEvent),off(document,"mousemove",nearestEmptyInsertDetectEvent),off(document,"touchmove",nearestEmptyInsertDetectEvent)},_offUpEvents:function(){var Ce=this.el.ownerDocument;off(Ce,"mouseup",this._onDrop),off(Ce,"touchend",this._onDrop),off(Ce,"pointerup",this._onDrop),off(Ce,"touchcancel",this._onDrop),off(document,"selectstart",this)},_onDrop:function(Ce){var ke=this.el,$n=this.options;if(newIndex=index(dragEl),newDraggableIndex=index(dragEl,$n.draggable),pluginEvent("drop",this,{evt:Ce}),parentEl=dragEl&&dragEl.parentNode,newIndex=index(dragEl),newDraggableIndex=index(dragEl,$n.draggable),Sortable.eventCanceled){this._nulling();return}awaitingDragStarted=!1,isCircumstantialInvert=!1,pastFirstInvertThresh=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),_cancelNextTick(this.cloneId),_cancelNextTick(this._dragStartId),this.nativeDraggable&&(off(document,"drop",this),off(ke,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Safari&&css$1(document.body,"user-select",""),css$1(dragEl,"transform",""),Ce&&(moved&&(Ce.cancelable&&Ce.preventDefault(),!$n.dropBubble&&Ce.stopPropagation()),ghostEl&&ghostEl.parentNode&&ghostEl.parentNode.removeChild(ghostEl),(rootEl===parentEl||putSortable&&putSortable.lastPutMode!=="clone")&&cloneEl&&cloneEl.parentNode&&cloneEl.parentNode.removeChild(cloneEl),dragEl&&(this.nativeDraggable&&off(dragEl,"dragend",this),_disableDraggable(dragEl),dragEl.style["will-change"]="",moved&&!awaitingDragStarted&&toggleClass$1(dragEl,putSortable?putSortable.options.ghostClass:this.options.ghostClass,!1),toggleClass$1(dragEl,this.options.chosenClass,!1),_dispatchEvent({sortable:this,name:"unchoose",toEl:parentEl,newIndex:null,newDraggableIndex:null,originalEvent:Ce}),rootEl!==parentEl?(newIndex>=0&&(_dispatchEvent({rootEl:parentEl,name:"add",toEl:parentEl,fromEl:rootEl,originalEvent:Ce}),_dispatchEvent({sortable:this,name:"remove",toEl:parentEl,originalEvent:Ce}),_dispatchEvent({rootEl:parentEl,name:"sort",toEl:parentEl,fromEl:rootEl,originalEvent:Ce}),_dispatchEvent({sortable:this,name:"sort",toEl:parentEl,originalEvent:Ce})),putSortable&&putSortable.save()):newIndex!==oldIndex&&newIndex>=0&&(_dispatchEvent({sortable:this,name:"update",toEl:parentEl,originalEvent:Ce}),_dispatchEvent({sortable:this,name:"sort",toEl:parentEl,originalEvent:Ce})),Sortable.active&&((newIndex==null||newIndex===-1)&&(newIndex=oldIndex,newDraggableIndex=oldDraggableIndex),_dispatchEvent({sortable:this,name:"end",toEl:parentEl,originalEvent:Ce}),this.save()))),this._nulling()},_nulling:function(){pluginEvent("nulling",this),rootEl=dragEl=parentEl=ghostEl=nextEl=cloneEl=lastDownEl=cloneHidden=tapEvt=touchEvt=moved=newIndex=newDraggableIndex=oldIndex=oldDraggableIndex=lastTarget=lastDirection=putSortable=activeGroup=Sortable.dragged=Sortable.ghost=Sortable.clone=Sortable.active=null,savedInputChecked.forEach(function(Ce){Ce.checked=!0}),savedInputChecked.length=lastDx=lastDy=0},handleEvent:function(Ce){switch(Ce.type){case"drop":case"dragend":this._onDrop(Ce);break;case"dragenter":case"dragover":dragEl&&(this._onDragOver(Ce),_globalDragOver(Ce));break;case"selectstart":Ce.preventDefault();break}},toArray:function(){for(var Ce=[],ke,$n=this.el.children,Hn=0,zn=$n.length,Un=this.options;HnHn.right+zn||_n.clientY>$n.bottom&&_n.clientX>$n.left:_n.clientY>Hn.bottom+zn||_n.clientX>$n.right&&_n.clientY>$n.top}function _getSwapDirection(_n,Ce,ke,$n,Hn,zn,Un,qn){var Xn=$n?_n.clientY:_n.clientX,Kn=$n?ke.height:ke.width,to=$n?ke.top:ke.left,io=$n?ke.bottom:ke.right,uo=!1;if(!Un){if(qn&&targetMoveDistanceto+Kn*zn/2:Xnio-targetMoveDistance)return-lastDirection}else if(Xn>to+Kn*(1-Hn)/2&&Xnio-Kn*zn/2)?Xn>to+Kn/2?1:-1:0}function _getInsertDirection(_n){return index(dragEl){Un[to]=null}),check_outros(),ke=Un[Ce],ke?ke.p(Xn,Kn):(ke=Un[Ce]=zn[Ce](Xn),ke.c()),transition_in(ke,1),ke.m($n.parentNode,$n))},i(Xn){Hn||(transition_in(ke),Hn=!0)},o(Xn){transition_out(ke),Hn=!1},d(Xn){Xn&&detach($n),Un[Ce].d(Xn)}}}function instance$y(_n,Ce,ke){let{$$slots:$n={},$$scope:Hn}=Ce,{sortableClass:zn=""}=Ce,{isTable:Un=!1}=Ce,{sortableInstance:qn}=Ce;const Xn=createEventDispatcher();let Kn;onMount(()=>{let uo={animation:150,easing:"cubic-bezier(1, 0, 0, 1)",direction:"vertical",onUpdate(ho){Xn("update",{source:ho.oldIndex,target:ho.newIndex})}};ke(3,qn=Sortable.create(Kn,uo))});function to(uo){binding_callbacks[uo?"unshift":"push"](()=>{Kn=uo,ke(2,Kn)})}function io(uo){binding_callbacks[uo?"unshift":"push"](()=>{Kn=uo,ke(2,Kn)})}return _n.$$set=uo=>{"sortableClass"in uo&&ke(0,zn=uo.sortableClass),"isTable"in uo&&ke(1,Un=uo.isTable),"sortableInstance"in uo&&ke(3,qn=uo.sortableInstance),"$$scope"in uo&&ke(4,Hn=uo.$$scope)},[zn,Un,Kn,qn,Hn,$n,to,io]}class Sortable_1 extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$y,create_fragment$y,safe_not_equal,{sortableClass:0,isTable:1,sortableInstance:3})}}function create_if_block_2$6(_n){let Ce,ke,$n;return ke=new Preview({props:{record:_n[5],size:"small"}}),{c(){Ce=element("div"),create_component(ke.$$.fragment),attr(Ce,"class","image")},m(Hn,zn){insert$1(Hn,Ce,zn),mount_component(ke,Ce,null),$n=!0},p:noop,i(Hn){$n||(transition_in(ke.$$.fragment,Hn),$n=!0)},o(Hn){transition_out(ke.$$.fragment,Hn),$n=!1},d(Hn){Hn&&detach(Ce),destroy_component(ke)}}}function create_if_block_1$g(_n){let Ce,ke;return Ce=new Status({props:{status:_n[0].status}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&1&&(zn.status=$n[0].status),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_if_block$q(_n){let Ce,ke,$n,Hn,zn,Un;return $n=new Icon({props:{icon:"trash-can"}}),{c(){Ce=element("div"),ke=element("button"),create_component($n.$$.fragment),attr(ke,"class","button"),attr(Ce,"class","reference-action")},m(qn,Xn){insert$1(qn,Ce,Xn),append(Ce,ke),mount_component($n,ke,null),Hn=!0,zn||(Un=listen(ke,"click",_n[6]),zn=!0)},p:noop,i(qn){Hn||(transition_in($n.$$.fragment,qn),Hn=!0)},o(qn){transition_out($n.$$.fragment,qn),Hn=!1},d(qn){qn&&detach(Ce),destroy_component($n),zn=!1,Un()}}}function create_fragment$x(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo=_n[3].label+"",ho,bo,Oo,So,$o=_n[5]&&create_if_block_2$6(_n),Do=_n[0].status==="draft"&&create_if_block_1$g(_n),xo=_n[1]&&create_if_block$q(_n);return{c(){Ce=element("div"),ke=element("div"),$o&&$o.c(),$n=space$3(),Hn=element("div"),zn=element("div"),Un=element("a"),qn=text(_n[4]),Kn=space$3(),to=element("small"),io=text("from "),ho=text(uo),bo=space$3(),Do&&Do.c(),Oo=space$3(),xo&&xo.c(),attr(Un,"class","record-title"),attr(Un,"href",Xn=_n[2].lucentUrl+"/records/"+_n[0].id),attr(to,"class","d-block"),attr(Hn,"class","title"),set_style(ke,"display","flex"),set_style(ke,"align-items","center"),set_style(ke,"gap","10px"),attr(Ce,"class","preview-reference")},m(Io,Vo){insert$1(Io,Ce,Vo),append(Ce,ke),$o&&$o.m(ke,null),append(ke,$n),append(ke,Hn),append(Hn,zn),append(zn,Un),append(Un,qn),append(zn,Kn),append(zn,to),append(to,io),append(to,ho),append(to,bo),Do&&Do.m(to,null),append(Ce,Oo),xo&&xo.m(Ce,null),So=!0},p(Io,[Vo]){Io[5]&&$o.p(Io,Vo),(!So||Vo&1&&Xn!==(Xn=Io[2].lucentUrl+"/records/"+Io[0].id))&&attr(Un,"href",Xn),Io[0].status==="draft"?Do?(Do.p(Io,Vo),Vo&1&&transition_in(Do,1)):(Do=create_if_block_1$g(Io),Do.c(),transition_in(Do,1),Do.m(to,null)):Do&&(group_outros(),transition_out(Do,1,1,()=>{Do=null}),check_outros()),Io[1]?xo?(xo.p(Io,Vo),Vo&2&&transition_in(xo,1)):(xo=create_if_block$q(Io),xo.c(),transition_in(xo,1),xo.m(Ce,null)):xo&&(group_outros(),transition_out(xo,1,1,()=>{xo=null}),check_outros())},i(Io){So||(transition_in($o),transition_in(Do),transition_in(xo),So=!0)},o(Io){transition_out($o),transition_out(Do),transition_out(xo),So=!1},d(Io){Io&&detach(Ce),$o&&$o.d(),Do&&Do.d(),xo&&xo.d()}}}function instance$x(_n,Ce,ke){const $n=createEventDispatcher(),Hn=getContext$1("channel");let{graph:zn}=Ce,{record:Un}=Ce,{hasDelete:qn=!1}=Ce,Xn=Hn.schemas.find(ho=>ho.name===Un.schema),Kn=previewTitle(Hn.schemas,Un);const to=zn.edges.find(ho=>ho.source===Un.id&&ho.field===Xn.cardImage);let io=zn.records.find(ho=>ho.id===(to==null?void 0:to.target));function uo(ho){ho.preventDefault(),$n("remove",Un.id)}return _n.$$set=ho=>{"graph"in ho&&ke(7,zn=ho.graph),"record"in ho&&ke(0,Un=ho.record),"hasDelete"in ho&&ke(1,qn=ho.hasDelete)},[Un,qn,Hn,Xn,Kn,io,uo,zn]}class PreviewReference extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$x,create_fragment$x,safe_not_equal,{graph:7,record:0,hasDelete:1})}}function get_each_context$b(_n,Ce,ke){const $n=_n.slice();return $n[11]=Ce[ke],$n}function create_if_block_1$f(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[2]),attr(Ce,"class","invalid-feedback d-block mb-3")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,Hn){Hn&4&&set_data(ke,$n[2])},d($n){$n&&detach(Ce)}}}function create_if_block$p(_n){let Ce,ke;return Ce=new Sortable_1({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[create_default_slot$4]},$$scope:{ctx:_n}}}),Ce.$on("update",_n[5]),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&16387&&(zn.$$scope={dirty:Hn,ctx:$n}),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_each_block$b(_n,Ce){let ke,$n,Hn,zn;return $n=new PreviewReference({props:{graph:Ce[0],record:Ce[11],hasDelete:!0}}),$n.$on("remove",Ce[4]),{key:_n,first:null,c(){ke=element("div"),create_component($n.$$.fragment),Hn=space$3(),this.first=ke},m(Un,qn){insert$1(Un,ke,qn),mount_component($n,ke,null),append(ke,Hn),zn=!0},p(Un,qn){Ce=Un;const Xn={};qn&1&&(Xn.graph=Ce[0]),qn&2&&(Xn.record=Ce[11]),$n.$set(Xn)},i(Un){zn||(transition_in($n.$$.fragment,Un),zn=!0)},o(Un){transition_out($n.$$.fragment,Un),zn=!1},d(Un){Un&&detach(ke),destroy_component($n)}}}function create_default_slot$4(_n){let Ce=[],ke=new Map,$n,Hn,zn=ensure_array_like(_n[1]);const Un=qn=>qn[11].id;for(let qn=0;qn0&&create_if_block$p(_n);return{c(){qn&&qn.c(),Ce=space$3(),ke=element("div"),create_component($n.$$.fragment),Hn=space$3(),Xn&&Xn.c(),zn=empty$1(),attr(ke,"class","inline-card-wrapper")},m(Kn,to){qn&&qn.m(Kn,to),insert$1(Kn,Ce,to),insert$1(Kn,ke,to),mount_component($n,ke,null),insert$1(Kn,Hn,to),Xn&&Xn.m(Kn,to),insert$1(Kn,zn,to),Un=!0},p(Kn,[to]){Kn[2]?qn?qn.p(Kn,to):(qn=create_if_block_1$f(Kn),qn.c(),qn.m(Ce.parentNode,Ce)):qn&&(qn.d(1),qn=null),Kn[1].length>0?Xn?(Xn.p(Kn,to),to&2&&transition_in(Xn,1)):(Xn=create_if_block$p(Kn),Xn.c(),transition_in(Xn,1),Xn.m(zn.parentNode,zn)):Xn&&(group_outros(),transition_out(Xn,1,1,()=>{Xn=null}),check_outros())},i(Kn){Un||(transition_in($n.$$.fragment,Kn),transition_in(Xn),Un=!0)},o(Kn){transition_out($n.$$.fragment,Kn),transition_out(Xn),Un=!1},d(Kn){Kn&&(detach(Ce),detach(ke),detach(Hn),detach(zn)),qn&&qn.d(Kn),destroy_component($n),Xn&&Xn.d(Kn)}}}function instance$w(_n,Ce,ke){let $n,Hn;const zn=getContext$1("channel");let{record:Un}=Ce,{field:qn}=Ce,{graph:Xn}=Ce,{validationErrors:Kn}=Ce,to=zn.schemas.filter(bo=>qn.collections.includes(bo.name));function io(bo){bo.preventDefault(),ke(0,Xn.edges=Xn.edges.filter(Oo=>!(Oo.target===bo.detail&&Oo.field===qn.name)),Xn)}function uo(bo){ke(0,Xn.edges=sortByField(bo.detail.source,bo.detail.target,Xn.edges,qn.name,Hn),Xn)}function ho(bo){bo.preventDefault(),ke(0,Xn=insertEdges(Xn,Un,bo.detail.records,qn.name,bo.detail.action))}return _n.$$set=bo=>{"record"in bo&&ke(7,Un=bo.record),"field"in bo&&ke(8,qn=bo.field),"graph"in bo&&ke(0,Xn=bo.graph),"validationErrors"in bo&&ke(9,Kn=bo.validationErrors)},_n.$$.update=()=>{_n.$$.dirty&768&&ke(2,$n=getErrorMessage(Kn,qn.name)),_n.$$.dirty&385&&ke(1,Hn=Xn.edges.filter(bo=>bo.field===qn.name).map(bo=>Xn.records.find(Oo=>Oo.id===bo.target&&Un.id===bo.source)).filter(bo=>!!(bo!=null&&bo.id))??[])},[Xn,Hn,$n,to,io,uo,ho,Un,qn,Kn]}class Reference extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$w,create_fragment$w,safe_not_equal,{record:7,field:8,graph:0,validationErrors:9})}}function create_if_block$o(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[4]),attr(Ce,"class","invalid-feedback d-block")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,Hn){Hn&16&&set_data(ke,$n[4])},d($n){$n&&detach(Ce)}}}function create_fragment$v(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io=_n[4]&&create_if_block$o(_n);return{c(){Ce=element("div"),ke=element("div"),$n=element("input"),zn=space$3(),Un=element("input"),Xn=space$3(),io&&io.c(),attr($n,"type","color"),attr($n,"id",_n[3]),set_style($n,"border","none"),set_style($n,"background","transparent"),set_style($n,"padding","0"),set_style($n,"width","64px"),$n.disabled=Hn=_n[1].readonly&&!_n[2],attr(Un,"type","text"),attr(Un,"id",_n[3]),attr(Un,"class","form-control"),Un.readOnly=qn=_n[1].readonly&&!_n[2],toggle_class(Un,"is-invalid",_n[4]),set_style(ke,"display","flex"),set_style(ke,"align-items","center"),set_style(ke,"gap","10px"),attr(Ce,"class","mb-0")},m(uo,ho){insert$1(uo,Ce,ho),append(Ce,ke),append(ke,$n),set_input_value($n,_n[0]),append(ke,zn),append(ke,Un),set_input_value(Un,_n[0]),append(Ce,Xn),io&&io.m(Ce,null),Kn||(to=[listen($n,"input",_n[6]),listen(Un,"input",_n[7])],Kn=!0)},p(uo,[ho]){ho&8&&attr($n,"id",uo[3]),ho&6&&Hn!==(Hn=uo[1].readonly&&!uo[2])&&($n.disabled=Hn),ho&1&&set_input_value($n,uo[0]),ho&8&&attr(Un,"id",uo[3]),ho&6&&qn!==(qn=uo[1].readonly&&!uo[2])&&(Un.readOnly=qn),ho&1&&Un.value!==uo[0]&&set_input_value(Un,uo[0]),ho&16&&toggle_class(Un,"is-invalid",uo[4]),uo[4]?io?io.p(uo,ho):(io=create_if_block$o(uo),io.c(),io.m(Ce,null)):io&&(io.d(1),io=null)},i:noop,o:noop,d(uo){uo&&detach(Ce),io&&io.d(),Kn=!1,run_all(to)}}}function instance$v(_n,Ce,ke){let $n,{field:Hn}=Ce,{value:zn}=Ce,{isCreateMode:Un}=Ce,{validationErrors:qn}=Ce,{id:Xn}=Ce;function Kn(){zn=this.value,ke(0,zn)}function to(){zn=this.value,ke(0,zn)}return _n.$$set=io=>{"field"in io&&ke(1,Hn=io.field),"value"in io&&ke(0,zn=io.value),"isCreateMode"in io&&ke(2,Un=io.isCreateMode),"validationErrors"in io&&ke(5,qn=io.validationErrors),"id"in io&&ke(3,Xn=io.id)},_n.$$.update=()=>{_n.$$.dirty&34&&ke(4,$n=getErrorMessage(qn,Hn.name))},[zn,Hn,Un,Xn,$n,qn,Kn,to]}class Color extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$v,create_fragment$v,safe_not_equal,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}}function create_if_block_1$e(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io;return Kn=init_binding_group(_n[7][0]),{c(){Ce=element("div"),ke=element("input"),zn=space$3(),Un=element("label"),qn=text("Don't Know"),attr(ke,"class","form-check-input"),attr(ke,"id",$n=_n[1]+"-3"),attr(ke,"type","radio"),ke.__value=null,set_input_value(ke,ke.__value),ke.disabled=Hn=_n[2].readonly&&!_n[3],toggle_class(ke,"is-invalid",_n[4]),attr(Un,"class","form-check-label"),attr(Un,"for",Xn=_n[1]+"-3"),attr(Ce,"class","form-check form-check-inline"),Kn.p(ke)},m(uo,ho){insert$1(uo,Ce,ho),append(Ce,ke),ke.checked=ke.__value===_n[0],append(Ce,zn),append(Ce,Un),append(Un,qn),to||(io=listen(ke,"change",_n[9]),to=!0)},p(uo,ho){ho&2&&$n!==($n=uo[1]+"-3")&&attr(ke,"id",$n),ho&12&&Hn!==(Hn=uo[2].readonly&&!uo[3])&&(ke.disabled=Hn),ho&1&&(ke.checked=ke.__value===uo[0]),ho&16&&toggle_class(ke,"is-invalid",uo[4]),ho&2&&Xn!==(Xn=uo[1]+"-3")&&attr(Un,"for",Xn)},d(uo){uo&&detach(Ce),Kn.r(),to=!1,io()}}}function create_if_block$n(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[4]),attr(Ce,"class","invalid-feedback d-block")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,Hn){Hn&16&&set_data(ke,$n[4])},d($n){$n&&detach(Ce)}}}function create_fragment$u(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo,So,$o,Do,xo,Io,Vo,Jo,Mo,Go,os=_n[2].nullable&&create_if_block_1$e(_n),ms=_n[4]&&create_if_block$n(_n);return Jo=init_binding_group(_n[7][0]),{c(){Ce=element("div"),ke=element("div"),$n=element("input"),Un=space$3(),qn=element("label"),Xn=text("Yes"),to=space$3(),io=element("div"),uo=element("input"),Oo=space$3(),So=element("label"),$o=text("No"),xo=space$3(),os&&os.c(),Io=space$3(),ms&&ms.c(),Vo=empty$1(),attr($n,"class","form-check-input"),attr($n,"type","radio"),attr($n,"id",Hn=_n[1]+"-1"),$n.__value=!0,set_input_value($n,$n.__value),$n.disabled=zn=_n[2].readonly&&!_n[3],toggle_class($n,"is-invalid",_n[4]),attr(qn,"class","form-check-label"),attr(qn,"for",Kn=_n[1]+"-1"),attr(ke,"class","form-check form-check-inline"),attr(uo,"class","form-check-input"),attr(uo,"type","radio"),attr(uo,"id",ho=_n[1]+"-2"),uo.__value=!1,set_input_value(uo,uo.__value),uo.disabled=bo=_n[2].readonly&&!_n[3],toggle_class(uo,"is-invalid",_n[4]),attr(So,"class","form-check-label"),attr(So,"for",Do=_n[1]+"-2"),attr(io,"class","form-check form-check-inline"),attr(Ce,"class","field-checkbox"),Jo.p($n,uo)},m(is,Yo){insert$1(is,Ce,Yo),append(Ce,ke),append(ke,$n),$n.checked=$n.__value===_n[0],append(ke,Un),append(ke,qn),append(qn,Xn),append(Ce,to),append(Ce,io),append(io,uo),uo.checked=uo.__value===_n[0],append(io,Oo),append(io,So),append(So,$o),append(Ce,xo),os&&os.m(Ce,null),insert$1(is,Io,Yo),ms&&ms.m(is,Yo),insert$1(is,Vo,Yo),Mo||(Go=[listen($n,"change",_n[6]),listen(uo,"change",_n[8])],Mo=!0)},p(is,[Yo]){Yo&2&&Hn!==(Hn=is[1]+"-1")&&attr($n,"id",Hn),Yo&12&&zn!==(zn=is[2].readonly&&!is[3])&&($n.disabled=zn),Yo&1&&($n.checked=$n.__value===is[0]),Yo&16&&toggle_class($n,"is-invalid",is[4]),Yo&2&&Kn!==(Kn=is[1]+"-1")&&attr(qn,"for",Kn),Yo&2&&ho!==(ho=is[1]+"-2")&&attr(uo,"id",ho),Yo&12&&bo!==(bo=is[2].readonly&&!is[3])&&(uo.disabled=bo),Yo&1&&(uo.checked=uo.__value===is[0]),Yo&16&&toggle_class(uo,"is-invalid",is[4]),Yo&2&&Do!==(Do=is[1]+"-2")&&attr(So,"for",Do),is[2].nullable?os?os.p(is,Yo):(os=create_if_block_1$e(is),os.c(),os.m(Ce,null)):os&&(os.d(1),os=null),is[4]?ms?ms.p(is,Yo):(ms=create_if_block$n(is),ms.c(),ms.m(Vo.parentNode,Vo)):ms&&(ms.d(1),ms=null)},i:noop,o:noop,d(is){is&&(detach(Ce),detach(Io),detach(Vo)),os&&os.d(),ms&&ms.d(is),Jo.r(),Mo=!1,run_all(Go)}}}function instance$u(_n,Ce,ke){let $n,{id:Hn}=Ce,{field:zn}=Ce,{value:Un}=Ce,{isCreateMode:qn}=Ce,{validationErrors:Xn}=Ce;const Kn=[[]];function to(){Un=this.__value,ke(0,Un)}function io(){Un=this.__value,ke(0,Un)}function uo(){Un=this.__value,ke(0,Un)}return _n.$$set=ho=>{"id"in ho&&ke(1,Hn=ho.id),"field"in ho&&ke(2,zn=ho.field),"value"in ho&&ke(0,Un=ho.value),"isCreateMode"in ho&&ke(3,qn=ho.isCreateMode),"validationErrors"in ho&&ke(5,Xn=ho.validationErrors)},_n.$$.update=()=>{_n.$$.dirty&36&&ke(4,$n=getErrorMessage(Xn,zn.name))},[Un,Hn,zn,qn,$n,Xn,to,Kn,io,uo]}class Checkbox extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$u,create_fragment$u,safe_not_equal,{id:1,field:2,value:0,isCreateMode:3,validationErrors:5})}}function create_if_block$m(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[4]),attr(Ce,"class","invalid-feedback d-block")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,Hn){Hn&16&&set_data(ke,$n[4])},d($n){$n&&detach(Ce)}}}function create_fragment$t(_n){let Ce,ke,$n,Hn,zn,Un,qn=_n[4]&&create_if_block$m(_n);return{c(){Ce=element("div"),ke=element("input"),Hn=space$3(),qn&&qn.c(),attr(ke,"type","number"),attr(ke,"id",_n[3]),attr(ke,"class","form-control"),attr(ke,"autocomplete","off"),ke.readOnly=$n=_n[1].readonly&&!_n[2],toggle_class(ke,"is-invalid",_n[4]),attr(Ce,"class","mb-0")},m(Xn,Kn){insert$1(Xn,Ce,Kn),append(Ce,ke),set_input_value(ke,_n[0]),append(Ce,Hn),qn&&qn.m(Ce,null),zn||(Un=[listen(ke,"change",_n[5]),listen(ke,"input",_n[7])],zn=!0)},p(Xn,[Kn]){Kn&8&&attr(ke,"id",Xn[3]),Kn&6&&$n!==($n=Xn[1].readonly&&!Xn[2])&&(ke.readOnly=$n),Kn&1&&to_number(ke.value)!==Xn[0]&&set_input_value(ke,Xn[0]),Kn&16&&toggle_class(ke,"is-invalid",Xn[4]),Xn[4]?qn?qn.p(Xn,Kn):(qn=create_if_block$m(Xn),qn.c(),qn.m(Ce,null)):qn&&(qn.d(1),qn=null)},i:noop,o:noop,d(Xn){Xn&&detach(Ce),qn&&qn.d(),zn=!1,run_all(Un)}}}function instance$t(_n,Ce,ke){let $n,{field:Hn}=Ce,{value:zn}=Ce,{validationErrors:Un}=Ce,{isCreateMode:qn}=Ce,{id:Xn}=Ce;function Kn(uo){const ho=uo.currentTarget.value,bo=to(ho);ke(0,zn=isNaN(bo)?null:bo)}function to(uo){return parseFloat(uo).toFixed(Hn.decimals)}function io(){zn=to_number(this.value),ke(0,zn)}return _n.$$set=uo=>{"field"in uo&&ke(1,Hn=uo.field),"value"in uo&&ke(0,zn=uo.value),"validationErrors"in uo&&ke(6,Un=uo.validationErrors),"isCreateMode"in uo&&ke(2,qn=uo.isCreateMode),"id"in uo&&ke(3,Xn=uo.id)},_n.$$.update=()=>{_n.$$.dirty&66&&ke(4,$n=getErrorMessage(Un,Hn.name))},[zn,Hn,qn,Xn,$n,Kn,Un,io]}let Number$1=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$t,create_fragment$t,safe_not_equal,{field:1,value:0,validationErrors:6,isCreateMode:2,id:3})}};function create_if_block$l(_n){let Ce,ke=_n[1].help+"",$n;return{c(){Ce=element("small"),$n=text(ke),attr(Ce,"class","text-primary opacity-50")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,$n)},p(Hn,zn){zn&2&&ke!==(ke=Hn[1].help+"")&&set_data($n,ke)},d(Hn){Hn&&detach(Ce)}}}function create_fragment$s(_n){let Ce,ke,$n,Hn=_n[1].label+"",zn,Un,qn,Xn,Kn=_n[1].name+"",to,io,uo,ho,bo,Oo,So,$o=_n[1].help&&create_if_block$l(_n);return{c(){Ce=element("div"),ke=element("div"),$n=element("label"),zn=text(Hn),Un=space$3(),qn=element("a"),Xn=element("code"),to=text(Kn),uo=space$3(),ho=element("input"),bo=space$3(),$o&&$o.c(),attr($n,"for",_n[4]),attr($n,"class","form-label"),attr(Xn,"class","text-primary opacity-50"),attr(qn,"class","text-decoration-none"),attr(qn,"href",io=_n[3]+"/schemas/"+_n[2].name+"/fields/edit/"+_n[1].name),attr(ke,"class","d-flex justify-content-between"),attr(ho,"type","url"),attr(ho,"id",_n[4]),attr(ho,"class","form-control"),attr(ho,"placeholder","https://www.example.com"),attr(Ce,"class","mb-0")},m(Do,xo){insert$1(Do,Ce,xo),append(Ce,ke),append(ke,$n),append($n,zn),append(ke,Un),append(ke,qn),append(qn,Xn),append(Xn,to),append(Ce,uo),append(Ce,ho),set_input_value(ho,_n[0]),append(Ce,bo),$o&&$o.m(Ce,null),Oo||(So=listen(ho,"input",_n[5]),Oo=!0)},p(Do,[xo]){xo&2&&Hn!==(Hn=Do[1].label+"")&&set_data(zn,Hn),xo&2&&Kn!==(Kn=Do[1].name+"")&&set_data(to,Kn),xo&6&&io!==(io=Do[3]+"/schemas/"+Do[2].name+"/fields/edit/"+Do[1].name)&&attr(qn,"href",io),xo&1&&ho.value!==Do[0]&&set_input_value(ho,Do[0]),Do[1].help?$o?$o.p(Do,xo):($o=create_if_block$l(Do),$o.c(),$o.m(Ce,null)):$o&&($o.d(1),$o=null)},i:noop,o:noop,d(Do){Do&&detach(Ce),$o&&$o.d(),Oo=!1,So()}}}function instance$s(_n,Ce,ke){const $n=getContext$1("channelurl");let{field:Hn}=Ce,{value:zn}=Ce,{schema:Un}=Ce,qn=lodashExports.uniqueId();function Xn(){zn=this.value,ke(0,zn)}return _n.$$set=Kn=>{"field"in Kn&&ke(1,Hn=Kn.field),"value"in Kn&&ke(0,zn=Kn.value),"schema"in Kn&&ke(2,Un=Kn.schema)},[zn,Hn,Un,$n,qn,Xn]}class Url extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$s,create_fragment$s,safe_not_equal,{field:1,value:0,schema:2})}}var HOOKS=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],defaults$2={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(_n){return typeof console<"u"&&console.warn(_n)},getWeek:function(_n){var Ce=new Date(_n.getTime());Ce.setHours(0,0,0,0),Ce.setDate(Ce.getDate()+3-(Ce.getDay()+6)%7);var ke=new Date(Ce.getFullYear(),0,4);return 1+Math.round(((Ce.getTime()-ke.getTime())/864e5-3+(ke.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},english={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(_n){var Ce=_n%100;if(Ce>3&&Ce<21)return"th";switch(Ce%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},pad=function(_n,Ce){return Ce===void 0&&(Ce=2),("000"+_n).slice(Ce*-1)},int=function(_n){return _n===!0?1:0};function debounce(_n,Ce){var ke;return function(){var $n=this,Hn=arguments;clearTimeout(ke),ke=setTimeout(function(){return _n.apply($n,Hn)},Ce)}}var arrayify=function(_n){return _n instanceof Array?_n:[_n]};function toggleClass(_n,Ce,ke){if(ke===!0)return _n.classList.add(Ce);_n.classList.remove(Ce)}function createElement(_n,Ce,ke){var $n=window.document.createElement(_n);return Ce=Ce||"",ke=ke||"",$n.className=Ce,ke!==void 0&&($n.textContent=ke),$n}function clearNode(_n){for(;_n.firstChild;)_n.removeChild(_n.firstChild)}function findParent(_n,Ce){if(Ce(_n))return _n;if(_n.parentNode)return findParent(_n.parentNode,Ce)}function createNumberInput(_n,Ce){var ke=createElement("div","numInputWrapper"),$n=createElement("input","numInput "+_n),Hn=createElement("span","arrowUp"),zn=createElement("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?$n.type="number":($n.type="text",$n.pattern="\\d*"),Ce!==void 0)for(var Un in Ce)$n.setAttribute(Un,Ce[Un]);return ke.appendChild($n),ke.appendChild(Hn),ke.appendChild(zn),ke}function getEventTarget(_n){try{if(typeof _n.composedPath=="function"){var Ce=_n.composedPath();return Ce[0]}return _n.target}catch{return _n.target}}var doNothing=function(){},monthToStr=function(_n,Ce,ke){return ke.months[Ce?"shorthand":"longhand"][_n]},revFormat={D:doNothing,F:function(_n,Ce,ke){_n.setMonth(ke.months.longhand.indexOf(Ce))},G:function(_n,Ce){_n.setHours((_n.getHours()>=12?12:0)+parseFloat(Ce))},H:function(_n,Ce){_n.setHours(parseFloat(Ce))},J:function(_n,Ce){_n.setDate(parseFloat(Ce))},K:function(_n,Ce,ke){_n.setHours(_n.getHours()%12+12*int(new RegExp(ke.amPM[1],"i").test(Ce)))},M:function(_n,Ce,ke){_n.setMonth(ke.months.shorthand.indexOf(Ce))},S:function(_n,Ce){_n.setSeconds(parseFloat(Ce))},U:function(_n,Ce){return new Date(parseFloat(Ce)*1e3)},W:function(_n,Ce,ke){var $n=parseInt(Ce),Hn=new Date(_n.getFullYear(),0,2+($n-1)*7,0,0,0,0);return Hn.setDate(Hn.getDate()-Hn.getDay()+ke.firstDayOfWeek),Hn},Y:function(_n,Ce){_n.setFullYear(parseFloat(Ce))},Z:function(_n,Ce){return new Date(Ce)},d:function(_n,Ce){_n.setDate(parseFloat(Ce))},h:function(_n,Ce){_n.setHours((_n.getHours()>=12?12:0)+parseFloat(Ce))},i:function(_n,Ce){_n.setMinutes(parseFloat(Ce))},j:function(_n,Ce){_n.setDate(parseFloat(Ce))},l:doNothing,m:function(_n,Ce){_n.setMonth(parseFloat(Ce)-1)},n:function(_n,Ce){_n.setMonth(parseFloat(Ce)-1)},s:function(_n,Ce){_n.setSeconds(parseFloat(Ce))},u:function(_n,Ce){return new Date(parseFloat(Ce))},w:doNothing,y:function(_n,Ce){_n.setFullYear(2e3+parseFloat(Ce))}},tokenRegex={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},formats={Z:function(_n){return _n.toISOString()},D:function(_n,Ce,ke){return Ce.weekdays.shorthand[formats.w(_n,Ce,ke)]},F:function(_n,Ce,ke){return monthToStr(formats.n(_n,Ce,ke)-1,!1,Ce)},G:function(_n,Ce,ke){return pad(formats.h(_n,Ce,ke))},H:function(_n){return pad(_n.getHours())},J:function(_n,Ce){return Ce.ordinal!==void 0?_n.getDate()+Ce.ordinal(_n.getDate()):_n.getDate()},K:function(_n,Ce){return Ce.amPM[int(_n.getHours()>11)]},M:function(_n,Ce){return monthToStr(_n.getMonth(),!0,Ce)},S:function(_n){return pad(_n.getSeconds())},U:function(_n){return _n.getTime()/1e3},W:function(_n,Ce,ke){return ke.getWeek(_n)},Y:function(_n){return pad(_n.getFullYear(),4)},d:function(_n){return pad(_n.getDate())},h:function(_n){return _n.getHours()%12?_n.getHours()%12:12},i:function(_n){return pad(_n.getMinutes())},j:function(_n){return _n.getDate()},l:function(_n,Ce){return Ce.weekdays.longhand[_n.getDay()]},m:function(_n){return pad(_n.getMonth()+1)},n:function(_n){return _n.getMonth()+1},s:function(_n){return _n.getSeconds()},u:function(_n){return _n.getTime()},w:function(_n){return _n.getDay()},y:function(_n){return String(_n.getFullYear()).substring(2)}},createDateFormatter=function(_n){var Ce=_n.config,ke=Ce===void 0?defaults$2:Ce,$n=_n.l10n,Hn=$n===void 0?english:$n,zn=_n.isMobile,Un=zn===void 0?!1:zn;return function(qn,Xn,Kn){var to=Kn||Hn;return ke.formatDate!==void 0&&!Un?ke.formatDate(qn,Xn,to):Xn.split("").map(function(io,uo,ho){return formats[io]&&ho[uo-1]!=="\\"?formats[io](qn,to,ke):io!=="\\"?io:""}).join("")}},createDateParser=function(_n){var Ce=_n.config,ke=Ce===void 0?defaults$2:Ce,$n=_n.l10n,Hn=$n===void 0?english:$n;return function(zn,Un,qn,Xn){if(!(zn!==0&&!zn)){var Kn=Xn||Hn,to,io=zn;if(zn instanceof Date)to=new Date(zn.getTime());else if(typeof zn!="string"&&zn.toFixed!==void 0)to=new Date(zn);else if(typeof zn=="string"){var uo=Un||(ke||defaults$2).dateFormat,ho=String(zn).trim();if(ho==="today")to=new Date,qn=!0;else if(ke&&ke.parseDate)to=ke.parseDate(zn,uo);else if(/Z$/.test(ho)||/GMT$/.test(ho))to=new Date(zn);else{for(var bo=void 0,Oo=[],So=0,$o=0,Do="";SoMath.min(Ce,ke)&&_n=0?new Date:new Date(ke.config.minDate.getTime()),Ks=getDefaultHours(ke.config);Es.setHours(Ks.hours,Ks.minutes,Ks.seconds,Es.getMilliseconds()),ke.selectedDates=[Es],ke.latestSelectedDateObj=Es}vs!==void 0&&vs.type!=="blur"&&Su(vs);var pr=ke._input.value;io(),Rr(),ke._input.value!==pr&&ke._debouncedChange()}function Kn(vs,Es){return vs%12+12*int(Es===ke.l10n.amPM[1])}function to(vs){switch(vs%24){case 0:case 12:return 12;default:return vs%12}}function io(){if(!(ke.hourElement===void 0||ke.minuteElement===void 0)){var vs=(parseInt(ke.hourElement.value.slice(-2),10)||0)%24,Es=(parseInt(ke.minuteElement.value,10)||0)%60,Ks=ke.secondElement!==void 0?(parseInt(ke.secondElement.value,10)||0)%60:0;ke.amPM!==void 0&&(vs=Kn(vs,ke.amPM.textContent));var pr=ke.config.minTime!==void 0||ke.config.minDate&&ke.minDateHasTime&&ke.latestSelectedDateObj&&compareDates(ke.latestSelectedDateObj,ke.config.minDate,!0)===0,ia=ke.config.maxTime!==void 0||ke.config.maxDate&&ke.maxDateHasTime&&ke.latestSelectedDateObj&&compareDates(ke.latestSelectedDateObj,ke.config.maxDate,!0)===0;if(ke.config.maxTime!==void 0&&ke.config.minTime!==void 0&&ke.config.minTime>ke.config.maxTime){var ka=calculateSecondsSinceMidnight(ke.config.minTime.getHours(),ke.config.minTime.getMinutes(),ke.config.minTime.getSeconds()),Ma=calculateSecondsSinceMidnight(ke.config.maxTime.getHours(),ke.config.maxTime.getMinutes(),ke.config.maxTime.getSeconds()),Mr=calculateSecondsSinceMidnight(vs,Es,Ks);if(Mr>Ma&&Mr=12)]),ke.secondElement!==void 0&&(ke.secondElement.value=pad(Ks)))}function bo(vs){var Es=getEventTarget(vs),Ks=parseInt(Es.value)+(vs.delta||0);(Ks/1e3>1||vs.key==="Enter"&&!/[^\d]/.test(Ks.toString()))&&Qs(Ks)}function Oo(vs,Es,Ks,pr){if(Es instanceof Array)return Es.forEach(function(ia){return Oo(vs,ia,Ks,pr)});if(vs instanceof Array)return vs.forEach(function(ia){return Oo(ia,Es,Ks,pr)});vs.addEventListener(Es,Ks,pr),ke._handlers.push({remove:function(){return vs.removeEventListener(Es,Ks,pr)}})}function So(){Ya("onChange")}function $o(){if(ke.config.wrap&&["open","close","toggle","clear"].forEach(function(Ks){Array.prototype.forEach.call(ke.element.querySelectorAll("[data-"+Ks+"]"),function(pr){return Oo(pr,"click",ke[Ks])})}),ke.isMobile){Fc();return}var vs=debounce(Il,50);if(ke._debouncedChange=debounce(So,DEBOUNCED_CHANGE_MS),ke.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&Oo(ke.daysContainer,"mouseover",function(Ks){ke.config.mode==="range"&&za(getEventTarget(Ks))}),Oo(ke._input,"keydown",Ca),ke.calendarContainer!==void 0&&Oo(ke.calendarContainer,"keydown",Ca),!ke.config.inline&&!ke.config.static&&Oo(window,"resize",vs),window.ontouchstart!==void 0?Oo(window.document,"touchstart",hs):Oo(window.document,"mousedown",hs),Oo(window.document,"focus",hs,{capture:!0}),ke.config.clickOpens===!0&&(Oo(ke._input,"focus",ke.open),Oo(ke._input,"click",ke.open)),ke.daysContainer!==void 0&&(Oo(ke.monthNav,"click",Pl),Oo(ke.monthNav,["keyup","increment"],bo),Oo(ke.daysContainer,"click",xa)),ke.timeContainer!==void 0&&ke.minuteElement!==void 0&&ke.hourElement!==void 0){var Es=function(Ks){return getEventTarget(Ks).select()};Oo(ke.timeContainer,["increment"],Xn),Oo(ke.timeContainer,"blur",Xn,{capture:!0}),Oo(ke.timeContainer,"click",xo),Oo([ke.hourElement,ke.minuteElement],["focus","click"],Es),ke.secondElement!==void 0&&Oo(ke.secondElement,"focus",function(){return ke.secondElement&&ke.secondElement.select()}),ke.amPM!==void 0&&Oo(ke.amPM,"click",function(Ks){Xn(Ks)})}ke.config.allowInput&&Oo(ke._input,"blur",ga)}function Do(vs,Es){var Ks=vs!==void 0?ke.parseDate(vs):ke.latestSelectedDateObj||(ke.config.minDate&&ke.config.minDate>ke.now?ke.config.minDate:ke.config.maxDate&&ke.config.maxDate1),ke.calendarContainer.appendChild(vs);var ia=ke.config.appendTo!==void 0&&ke.config.appendTo.nodeType!==void 0;if((ke.config.inline||ke.config.static)&&(ke.calendarContainer.classList.add(ke.config.inline?"inline":"static"),ke.config.inline&&(!ia&&ke.element.parentNode?ke.element.parentNode.insertBefore(ke.calendarContainer,ke._input.nextSibling):ke.config.appendTo!==void 0&&ke.config.appendTo.appendChild(ke.calendarContainer)),ke.config.static)){var ka=createElement("div","flatpickr-wrapper");ke.element.parentNode&&ke.element.parentNode.insertBefore(ka,ke.element),ka.appendChild(ke.element),ke.altInput&&ka.appendChild(ke.altInput),ka.appendChild(ke.calendarContainer)}!ke.config.static&&!ke.config.inline&&(ke.config.appendTo!==void 0?ke.config.appendTo:window.document.body).appendChild(ke.calendarContainer)}function Jo(vs,Es,Ks,pr){var ia=zo(Es,!0),ka=createElement("span",vs,Es.getDate().toString());return ka.dateObj=Es,ka.$i=pr,ka.setAttribute("aria-label",ke.formatDate(Es,ke.config.ariaDateFormat)),vs.indexOf("hidden")===-1&&compareDates(Es,ke.now)===0&&(ke.todayDateElem=ka,ka.classList.add("today"),ka.setAttribute("aria-current","date")),ia?(ka.tabIndex=-1,Yl(Es)&&(ka.classList.add("selected"),ke.selectedDateElem=ka,ke.config.mode==="range"&&(toggleClass(ka,"startRange",ke.selectedDates[0]&&compareDates(Es,ke.selectedDates[0],!0)===0),toggleClass(ka,"endRange",ke.selectedDates[1]&&compareDates(Es,ke.selectedDates[1],!0)===0),vs==="nextMonthDay"&&ka.classList.add("inRange")))):ka.classList.add("flatpickr-disabled"),ke.config.mode==="range"&&rd(Es)&&!Yl(Es)&&ka.classList.add("inRange"),ke.weekNumbers&&ke.config.showMonths===1&&vs!=="prevMonthDay"&&pr%7===6&&ke.weekNumbers.insertAdjacentHTML("beforeend",""+ke.config.getWeek(Es)+""),Ya("onDayCreate",ka),ka}function Mo(vs){vs.focus(),ke.config.mode==="range"&&za(vs)}function Go(vs){for(var Es=vs>0?0:ke.config.showMonths-1,Ks=vs>0?ke.config.showMonths:-1,pr=Es;pr!=Ks;pr+=vs)for(var ia=ke.daysContainer.children[pr],ka=vs>0?0:ia.children.length-1,Ma=vs>0?ia.children.length:-1,Mr=ka;Mr!=Ma;Mr+=vs){var il=ia.children[Mr];if(il.className.indexOf("hidden")===-1&&zo(il.dateObj))return il}}function os(vs,Es){for(var Ks=vs.className.indexOf("Month")===-1?vs.dateObj.getMonth():ke.currentMonth,pr=Es>0?ke.config.showMonths:-1,ia=Es>0?1:-1,ka=Ks-ke.currentMonth;ka!=pr;ka+=ia)for(var Ma=ke.daysContainer.children[ka],Mr=Ks-ke.currentMonth===ka?vs.$i+Es:Es<0?Ma.children.length-1:0,il=Ma.children.length,Na=Mr;Na>=0&&Na0?il:-1);Na+=ia){var vl=Ma.children[Na];if(vl.className.indexOf("hidden")===-1&&zo(vl.dateObj)&&Math.abs(vs.$i-Na)>=Math.abs(Es))return Mo(vl)}ke.changeMonth(ia),ms(Go(ia),0)}function ms(vs,Es){var Ks=zn(),pr=el(Ks||document.body),ia=vs!==void 0?vs:pr?Ks:ke.selectedDateElem!==void 0&&el(ke.selectedDateElem)?ke.selectedDateElem:ke.todayDateElem!==void 0&&el(ke.todayDateElem)?ke.todayDateElem:Go(Es>0?1:-1);ia===void 0?ke._input.focus():pr?os(ia,Es):Mo(ia)}function is(vs,Es){for(var Ks=(new Date(vs,Es,1).getDay()-ke.l10n.firstDayOfWeek+7)%7,pr=ke.utils.getDaysInMonth((Es-1+12)%12,vs),ia=ke.utils.getDaysInMonth(Es,vs),ka=window.document.createDocumentFragment(),Ma=ke.config.showMonths>1,Mr=Ma?"prevMonthDay hidden":"prevMonthDay",il=Ma?"nextMonthDay hidden":"nextMonthDay",Na=pr+1-Ks,vl=0;Na<=pr;Na++,vl++)ka.appendChild(Jo("flatpickr-day "+Mr,new Date(vs,Es-1,Na),Na,vl));for(Na=1;Na<=ia;Na++,vl++)ka.appendChild(Jo("flatpickr-day",new Date(vs,Es,Na),Na,vl));for(var Rc=ia+1;Rc<=42-Ks&&(ke.config.showMonths===1||vl%7!==0);Rc++,vl++)ka.appendChild(Jo("flatpickr-day "+il,new Date(vs,Es+1,Rc%ia),Rc,vl));var Vc=createElement("div","dayContainer");return Vc.appendChild(ka),Vc}function Yo(){if(ke.daysContainer!==void 0){clearNode(ke.daysContainer),ke.weekNumbers&&clearNode(ke.weekNumbers);for(var vs=document.createDocumentFragment(),Es=0;Es1||ke.config.monthSelectorType!=="dropdown")){var vs=function(pr){return ke.config.minDate!==void 0&&ke.currentYear===ke.config.minDate.getFullYear()&&prke.config.maxDate.getMonth())};ke.monthsDropdownContainer.tabIndex=-1,ke.monthsDropdownContainer.innerHTML="";for(var Es=0;Es<12;Es++)if(vs(Es)){var Ks=createElement("option","flatpickr-monthDropdown-month");Ks.value=new Date(ke.currentYear,Es).getMonth().toString(),Ks.textContent=monthToStr(Es,ke.config.shorthandCurrentMonth,ke.l10n),Ks.tabIndex=-1,ke.currentMonth===Es&&(Ks.selected=!0),ke.monthsDropdownContainer.appendChild(Ks)}}}function sr(){var vs=createElement("div","flatpickr-month"),Es=window.document.createDocumentFragment(),Ks;ke.config.showMonths>1||ke.config.monthSelectorType==="static"?Ks=createElement("span","cur-month"):(ke.monthsDropdownContainer=createElement("select","flatpickr-monthDropdown-months"),ke.monthsDropdownContainer.setAttribute("aria-label",ke.l10n.monthAriaLabel),Oo(ke.monthsDropdownContainer,"change",function(Ma){var Mr=getEventTarget(Ma),il=parseInt(Mr.value,10);ke.changeMonth(il-ke.currentMonth),Ya("onMonthChange")}),Ys(),Ks=ke.monthsDropdownContainer);var pr=createNumberInput("cur-year",{tabindex:"-1"}),ia=pr.getElementsByTagName("input")[0];ia.setAttribute("aria-label",ke.l10n.yearAriaLabel),ke.config.minDate&&ia.setAttribute("min",ke.config.minDate.getFullYear().toString()),ke.config.maxDate&&(ia.setAttribute("max",ke.config.maxDate.getFullYear().toString()),ia.disabled=!!ke.config.minDate&&ke.config.minDate.getFullYear()===ke.config.maxDate.getFullYear());var ka=createElement("div","flatpickr-current-month");return ka.appendChild(Ks),ka.appendChild(pr),Es.appendChild(ka),vs.appendChild(Es),{container:vs,yearElement:ia,monthElement:Ks}}function Js(){clearNode(ke.monthNav),ke.monthNav.appendChild(ke.prevMonthNav),ke.config.showMonths&&(ke.yearElements=[],ke.monthElements=[]);for(var vs=ke.config.showMonths;vs--;){var Es=sr();ke.yearElements.push(Es.yearElement),ke.monthElements.push(Es.monthElement),ke.monthNav.appendChild(Es.container)}ke.monthNav.appendChild(ke.nextMonthNav)}function ko(){return ke.monthNav=createElement("div","flatpickr-months"),ke.yearElements=[],ke.monthElements=[],ke.prevMonthNav=createElement("span","flatpickr-prev-month"),ke.prevMonthNav.innerHTML=ke.config.prevArrow,ke.nextMonthNav=createElement("span","flatpickr-next-month"),ke.nextMonthNav.innerHTML=ke.config.nextArrow,Js(),Object.defineProperty(ke,"_hidePrevMonthArrow",{get:function(){return ke.__hidePrevMonthArrow},set:function(vs){ke.__hidePrevMonthArrow!==vs&&(toggleClass(ke.prevMonthNav,"flatpickr-disabled",vs),ke.__hidePrevMonthArrow=vs)}}),Object.defineProperty(ke,"_hideNextMonthArrow",{get:function(){return ke.__hideNextMonthArrow},set:function(vs){ke.__hideNextMonthArrow!==vs&&(toggleClass(ke.nextMonthNav,"flatpickr-disabled",vs),ke.__hideNextMonthArrow=vs)}}),ke.currentYearElement=ke.yearElements[0],Al(),ke.monthNav}function gs(){ke.calendarContainer.classList.add("hasTime"),ke.config.noCalendar&&ke.calendarContainer.classList.add("noCalendar");var vs=getDefaultHours(ke.config);ke.timeContainer=createElement("div","flatpickr-time"),ke.timeContainer.tabIndex=-1;var Es=createElement("span","flatpickr-time-separator",":"),Ks=createNumberInput("flatpickr-hour",{"aria-label":ke.l10n.hourAriaLabel});ke.hourElement=Ks.getElementsByTagName("input")[0];var pr=createNumberInput("flatpickr-minute",{"aria-label":ke.l10n.minuteAriaLabel});if(ke.minuteElement=pr.getElementsByTagName("input")[0],ke.hourElement.tabIndex=ke.minuteElement.tabIndex=-1,ke.hourElement.value=pad(ke.latestSelectedDateObj?ke.latestSelectedDateObj.getHours():ke.config.time_24hr?vs.hours:to(vs.hours)),ke.minuteElement.value=pad(ke.latestSelectedDateObj?ke.latestSelectedDateObj.getMinutes():vs.minutes),ke.hourElement.setAttribute("step",ke.config.hourIncrement.toString()),ke.minuteElement.setAttribute("step",ke.config.minuteIncrement.toString()),ke.hourElement.setAttribute("min",ke.config.time_24hr?"0":"1"),ke.hourElement.setAttribute("max",ke.config.time_24hr?"23":"12"),ke.hourElement.setAttribute("maxlength","2"),ke.minuteElement.setAttribute("min","0"),ke.minuteElement.setAttribute("max","59"),ke.minuteElement.setAttribute("maxlength","2"),ke.timeContainer.appendChild(Ks),ke.timeContainer.appendChild(Es),ke.timeContainer.appendChild(pr),ke.config.time_24hr&&ke.timeContainer.classList.add("time24hr"),ke.config.enableSeconds){ke.timeContainer.classList.add("hasSeconds");var ia=createNumberInput("flatpickr-second");ke.secondElement=ia.getElementsByTagName("input")[0],ke.secondElement.value=pad(ke.latestSelectedDateObj?ke.latestSelectedDateObj.getSeconds():vs.seconds),ke.secondElement.setAttribute("step",ke.minuteElement.getAttribute("step")),ke.secondElement.setAttribute("min","0"),ke.secondElement.setAttribute("max","59"),ke.secondElement.setAttribute("maxlength","2"),ke.timeContainer.appendChild(createElement("span","flatpickr-time-separator",":")),ke.timeContainer.appendChild(ia)}return ke.config.time_24hr||(ke.amPM=createElement("span","flatpickr-am-pm",ke.l10n.amPM[int((ke.latestSelectedDateObj?ke.hourElement.value:ke.config.defaultHour)>11)]),ke.amPM.title=ke.l10n.toggleTitle,ke.amPM.tabIndex=-1,ke.timeContainer.appendChild(ke.amPM)),ke.timeContainer}function xs(){ke.weekdayContainer?clearNode(ke.weekdayContainer):ke.weekdayContainer=createElement("div","flatpickr-weekdays");for(var vs=ke.config.showMonths;vs--;){var Es=createElement("div","flatpickr-weekdaycontainer");ke.weekdayContainer.appendChild(Es)}return Qr(),ke.weekdayContainer}function Qr(){if(ke.weekdayContainer){var vs=ke.l10n.firstDayOfWeek,Es=__spreadArrays(ke.l10n.weekdays.shorthand);vs>0&&vs + `+Es.join("")+` + + `}}function cr(){ke.calendarContainer.classList.add("hasWeeks");var vs=createElement("div","flatpickr-weekwrapper");vs.appendChild(createElement("span","flatpickr-weekday",ke.l10n.weekAbbreviation));var Es=createElement("div","flatpickr-weeks");return vs.appendChild(Es),{weekWrapper:vs,weekNumbers:Es}}function ws(vs,Es){Es===void 0&&(Es=!0);var Ks=Es?vs:vs-ke.currentMonth;Ks<0&&ke._hidePrevMonthArrow===!0||Ks>0&&ke._hideNextMonthArrow===!0||(ke.currentMonth+=Ks,(ke.currentMonth<0||ke.currentMonth>11)&&(ke.currentYear+=ke.currentMonth>11?1:-1,ke.currentMonth=(ke.currentMonth+12)%12,Ya("onYearChange"),Ys()),Yo(),Ya("onMonthChange"),Al())}function Fs(vs,Es){if(vs===void 0&&(vs=!0),Es===void 0&&(Es=!0),ke.input.value="",ke.altInput!==void 0&&(ke.altInput.value=""),ke.mobileInput!==void 0&&(ke.mobileInput.value=""),ke.selectedDates=[],ke.latestSelectedDateObj=void 0,Es===!0&&(ke.currentYear=ke._initialDate.getFullYear(),ke.currentMonth=ke._initialDate.getMonth()),ke.config.enableTime===!0){var Ks=getDefaultHours(ke.config),pr=Ks.hours,ia=Ks.minutes,ka=Ks.seconds;ho(pr,ia,ka)}ke.redraw(),vs&&Ya("onChange")}function Br(){ke.isOpen=!1,ke.isMobile||(ke.calendarContainer!==void 0&&ke.calendarContainer.classList.remove("open"),ke._input!==void 0&&ke._input.classList.remove("active")),Ya("onClose")}function _r(){ke.config!==void 0&&Ya("onDestroy");for(var vs=ke._handlers.length;vs--;)ke._handlers[vs].remove();if(ke._handlers=[],ke.mobileInput)ke.mobileInput.parentNode&&ke.mobileInput.parentNode.removeChild(ke.mobileInput),ke.mobileInput=void 0;else if(ke.calendarContainer&&ke.calendarContainer.parentNode)if(ke.config.static&&ke.calendarContainer.parentNode){var Es=ke.calendarContainer.parentNode;if(Es.lastChild&&Es.removeChild(Es.lastChild),Es.parentNode){for(;Es.firstChild;)Es.parentNode.insertBefore(Es.firstChild,Es);Es.parentNode.removeChild(Es)}}else ke.calendarContainer.parentNode.removeChild(ke.calendarContainer);ke.altInput&&(ke.input.type="text",ke.altInput.parentNode&&ke.altInput.parentNode.removeChild(ke.altInput),delete ke.altInput),ke.input&&(ke.input.type=ke.input._type,ke.input.classList.remove("flatpickr-input"),ke.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(Ks){try{delete ke[Ks]}catch{}})}function ha(vs){return ke.calendarContainer.contains(vs)}function hs(vs){if(ke.isOpen&&!ke.config.inline){var Es=getEventTarget(vs),Ks=ha(Es),pr=Es===ke.input||Es===ke.altInput||ke.element.contains(Es)||vs.path&&vs.path.indexOf&&(~vs.path.indexOf(ke.input)||~vs.path.indexOf(ke.altInput)),ia=!pr&&!Ks&&!ha(vs.relatedTarget),ka=!ke.config.ignoredFocusElements.some(function(Ma){return Ma.contains(Es)});ia&&ka&&(ke.config.allowInput&&ke.setDate(ke._input.value,!1,ke.config.altInput?ke.config.altFormat:ke.config.dateFormat),ke.timeContainer!==void 0&&ke.minuteElement!==void 0&&ke.hourElement!==void 0&&ke.input.value!==""&&ke.input.value!==void 0&&Xn(),ke.close(),ke.config&&ke.config.mode==="range"&&ke.selectedDates.length===1&&ke.clear(!1))}}function Qs(vs){if(!(!vs||ke.config.minDate&&vske.config.maxDate.getFullYear())){var Es=vs,Ks=ke.currentYear!==Es;ke.currentYear=Es||ke.currentYear,ke.config.maxDate&&ke.currentYear===ke.config.maxDate.getFullYear()?ke.currentMonth=Math.min(ke.config.maxDate.getMonth(),ke.currentMonth):ke.config.minDate&&ke.currentYear===ke.config.minDate.getFullYear()&&(ke.currentMonth=Math.max(ke.config.minDate.getMonth(),ke.currentMonth)),Ks&&(ke.redraw(),Ya("onYearChange"),Ys())}}function zo(vs,Es){var Ks;Es===void 0&&(Es=!0);var pr=ke.parseDate(vs,void 0,Es);if(ke.config.minDate&&pr&&compareDates(pr,ke.config.minDate,Es!==void 0?Es:!ke.minDateHasTime)<0||ke.config.maxDate&&pr&&compareDates(pr,ke.config.maxDate,Es!==void 0?Es:!ke.maxDateHasTime)>0)return!1;if(!ke.config.enable&&ke.config.disable.length===0)return!0;if(pr===void 0)return!1;for(var ia=!!ke.config.enable,ka=(Ks=ke.config.enable)!==null&&Ks!==void 0?Ks:ke.config.disable,Ma=0,Mr=void 0;Ma=Mr.from.getTime()&&pr.getTime()<=Mr.to.getTime())return ia}return!ia}function el(vs){return ke.daysContainer!==void 0?vs.className.indexOf("hidden")===-1&&vs.className.indexOf("flatpickr-disabled")===-1&&ke.daysContainer.contains(vs):!1}function ga(vs){var Es=vs.target===ke._input,Ks=ke._input.value.trimEnd()!==gd();Es&&Ks&&!(vs.relatedTarget&&ha(vs.relatedTarget))&&ke.setDate(ke._input.value,!0,vs.target===ke.altInput?ke.config.altFormat:ke.config.dateFormat)}function Ca(vs){var Es=getEventTarget(vs),Ks=ke.config.wrap?_n.contains(Es):Es===ke._input,pr=ke.config.allowInput,ia=ke.isOpen&&(!pr||!Ks),ka=ke.config.inline&&Ks&&!pr;if(vs.keyCode===13&&Ks){if(pr)return ke.setDate(ke._input.value,!0,Es===ke.altInput?ke.config.altFormat:ke.config.dateFormat),ke.close(),Es.blur();ke.open()}else if(ha(Es)||ia||ka){var Ma=!!ke.timeContainer&&ke.timeContainer.contains(Es);switch(vs.keyCode){case 13:Ma?(vs.preventDefault(),Xn(),Ml()):xa(vs);break;case 27:vs.preventDefault(),Ml();break;case 8:case 46:Ks&&!ke.config.allowInput&&(vs.preventDefault(),ke.clear());break;case 37:case 39:if(!Ma&&!Ks){vs.preventDefault();var Mr=zn();if(ke.daysContainer!==void 0&&(pr===!1||Mr&&el(Mr))){var il=vs.keyCode===39?1:-1;vs.ctrlKey?(vs.stopPropagation(),ws(il),ms(Go(1),0)):ms(void 0,il)}}else ke.hourElement&&ke.hourElement.focus();break;case 38:case 40:vs.preventDefault();var Na=vs.keyCode===40?1:-1;ke.daysContainer&&Es.$i!==void 0||Es===ke.input||Es===ke.altInput?vs.ctrlKey?(vs.stopPropagation(),Qs(ke.currentYear-Na),ms(Go(1),0)):Ma||ms(void 0,Na*7):Es===ke.currentYearElement?Qs(ke.currentYear-Na):ke.config.enableTime&&(!Ma&&ke.hourElement&&ke.hourElement.focus(),Xn(vs),ke._debouncedChange());break;case 9:if(Ma){var vl=[ke.hourElement,ke.minuteElement,ke.secondElement,ke.amPM].concat(ke.pluginElements).filter(function(xc){return xc}),Rc=vl.indexOf(Es);if(Rc!==-1){var Vc=vl[Rc+(vs.shiftKey?-1:1)];vs.preventDefault(),(Vc||ke._input).focus()}}else!ke.config.noCalendar&&ke.daysContainer&&ke.daysContainer.contains(Es)&&vs.shiftKey&&(vs.preventDefault(),ke._input.focus());break}}if(ke.amPM!==void 0&&Es===ke.amPM)switch(vs.key){case ke.l10n.amPM[0].charAt(0):case ke.l10n.amPM[0].charAt(0).toLowerCase():ke.amPM.textContent=ke.l10n.amPM[0],io(),Rr();break;case ke.l10n.amPM[1].charAt(0):case ke.l10n.amPM[1].charAt(0).toLowerCase():ke.amPM.textContent=ke.l10n.amPM[1],io(),Rr();break}(Ks||ha(Es))&&Ya("onKeyDown",vs)}function za(vs,Es){if(Es===void 0&&(Es="flatpickr-day"),!(ke.selectedDates.length!==1||vs&&(!vs.classList.contains(Es)||vs.classList.contains("flatpickr-disabled")))){for(var Ks=vs?vs.dateObj.getTime():ke.days.firstElementChild.dateObj.getTime(),pr=ke.parseDate(ke.selectedDates[0],void 0,!0).getTime(),ia=Math.min(Ks,ke.selectedDates[0].getTime()),ka=Math.max(Ks,ke.selectedDates[0].getTime()),Ma=!1,Mr=0,il=0,Na=ia;Naia&&NaMr)?Mr=Na:Na>pr&&(!il||Na ."+Es));vl.forEach(function(Rc){var Vc=Rc.dateObj,xc=Vc.getTime(),zc=Mr>0&&xc0&&xc>il;if(zc){Rc.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ad){Rc.classList.remove(ad)});return}else if(Ma&&!zc)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ad){Rc.classList.remove(ad)}),vs!==void 0&&(vs.classList.add(Ks<=ke.selectedDates[0].getTime()?"startRange":"endRange"),prKs&&xc===pr&&Rc.classList.add("endRange"),xc>=Mr&&(il===0||xc<=il)&&isBetween(xc,pr,Ks)&&Rc.classList.add("inRange"))})}}function Il(){ke.isOpen&&!ke.config.static&&!ke.config.inline&&Vr()}function Zs(vs,Es){if(Es===void 0&&(Es=ke._positionElement),ke.isMobile===!0){if(vs){vs.preventDefault();var Ks=getEventTarget(vs);Ks&&Ks.blur()}ke.mobileInput!==void 0&&(ke.mobileInput.focus(),ke.mobileInput.click()),Ya("onOpen");return}else if(ke._input.disabled||ke.config.inline)return;var pr=ke.isOpen;ke.isOpen=!0,pr||(ke.calendarContainer.classList.add("open"),ke._input.classList.add("active"),Ya("onOpen"),Vr(Es)),ke.config.enableTime===!0&&ke.config.noCalendar===!0&&ke.config.allowInput===!1&&(vs===void 0||!ke.timeContainer.contains(vs.relatedTarget))&&setTimeout(function(){return ke.hourElement.select()},50)}function Sr(vs){return function(Es){var Ks=ke.config["_"+vs+"Date"]=ke.parseDate(Es,ke.config.dateFormat),pr=ke.config["_"+(vs==="min"?"max":"min")+"Date"];Ks!==void 0&&(ke[vs==="min"?"minDateHasTime":"maxDateHasTime"]=Ks.getHours()>0||Ks.getMinutes()>0||Ks.getSeconds()>0),ke.selectedDates&&(ke.selectedDates=ke.selectedDates.filter(function(ia){return zo(ia)}),!ke.selectedDates.length&&vs==="min"&&uo(Ks),Rr()),ke.daysContainer&&(ra(),Ks!==void 0?ke.currentYearElement[vs]=Ks.getFullYear().toString():ke.currentYearElement.removeAttribute(vs),ke.currentYearElement.disabled=!!pr&&Ks!==void 0&&pr.getFullYear()===Ks.getFullYear())}}function Us(){var vs=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],Es=__assign(__assign({},JSON.parse(JSON.stringify(_n.dataset||{}))),Ce),Ks={};ke.config.parseDate=Es.parseDate,ke.config.formatDate=Es.formatDate,Object.defineProperty(ke.config,"enable",{get:function(){return ke.config._enable},set:function(vl){ke.config._enable=nc(vl)}}),Object.defineProperty(ke.config,"disable",{get:function(){return ke.config._disable},set:function(vl){ke.config._disable=nc(vl)}});var pr=Es.mode==="time";if(!Es.dateFormat&&(Es.enableTime||pr)){var ia=flatpickr.defaultConfig.dateFormat||defaults$2.dateFormat;Ks.dateFormat=Es.noCalendar||pr?"H:i"+(Es.enableSeconds?":S":""):ia+" H:i"+(Es.enableSeconds?":S":"")}if(Es.altInput&&(Es.enableTime||pr)&&!Es.altFormat){var ka=flatpickr.defaultConfig.altFormat||defaults$2.altFormat;Ks.altFormat=Es.noCalendar||pr?"h:i"+(Es.enableSeconds?":S K":" K"):ka+(" h:i"+(Es.enableSeconds?":S":"")+" K")}Object.defineProperty(ke.config,"minDate",{get:function(){return ke.config._minDate},set:Sr("min")}),Object.defineProperty(ke.config,"maxDate",{get:function(){return ke.config._maxDate},set:Sr("max")});var Ma=function(vl){return function(Rc){ke.config[vl==="min"?"_minTime":"_maxTime"]=ke.parseDate(Rc,"H:i:S")}};Object.defineProperty(ke.config,"minTime",{get:function(){return ke.config._minTime},set:Ma("min")}),Object.defineProperty(ke.config,"maxTime",{get:function(){return ke.config._maxTime},set:Ma("max")}),Es.mode==="time"&&(ke.config.noCalendar=!0,ke.config.enableTime=!0),Object.assign(ke.config,Ks,Es);for(var Mr=0;Mr-1?ke.config[Na]=arrayify(il[Na]).map(Un).concat(ke.config[Na]):typeof Es[Na]>"u"&&(ke.config[Na]=il[Na])}Es.altInputClass||(ke.config.altInputClass=fs().className+" "+ke.config.altInputClass),Ya("onParseConfig")}function fs(){return ke.config.wrap?_n.querySelector("[data-input]"):_n}function dr(){typeof ke.config.locale!="object"&&typeof flatpickr.l10ns[ke.config.locale]>"u"&&ke.config.errorHandler(new Error("flatpickr: invalid locale "+ke.config.locale)),ke.l10n=__assign(__assign({},flatpickr.l10ns.default),typeof ke.config.locale=="object"?ke.config.locale:ke.config.locale!=="default"?flatpickr.l10ns[ke.config.locale]:void 0),tokenRegex.D="("+ke.l10n.weekdays.shorthand.join("|")+")",tokenRegex.l="("+ke.l10n.weekdays.longhand.join("|")+")",tokenRegex.M="("+ke.l10n.months.shorthand.join("|")+")",tokenRegex.F="("+ke.l10n.months.longhand.join("|")+")",tokenRegex.K="("+ke.l10n.amPM[0]+"|"+ke.l10n.amPM[1]+"|"+ke.l10n.amPM[0].toLowerCase()+"|"+ke.l10n.amPM[1].toLowerCase()+")";var vs=__assign(__assign({},Ce),JSON.parse(JSON.stringify(_n.dataset||{})));vs.time_24hr===void 0&&flatpickr.defaultConfig.time_24hr===void 0&&(ke.config.time_24hr=ke.l10n.time_24hr),ke.formatDate=createDateFormatter(ke),ke.parseDate=createDateParser({config:ke.config,l10n:ke.l10n})}function Vr(vs){if(typeof ke.config.position=="function")return void ke.config.position(ke,vs);if(ke.calendarContainer!==void 0){Ya("onPreCalendarPosition");var Es=vs||ke._positionElement,Ks=Array.prototype.reduce.call(ke.calendarContainer.children,function(_l,Hc){return _l+Hc.offsetHeight},0),pr=ke.calendarContainer.offsetWidth,ia=ke.config.position.split(" "),ka=ia[0],Ma=ia.length>1?ia[1]:null,Mr=Es.getBoundingClientRect(),il=window.innerHeight-Mr.bottom,Na=ka==="above"||ka!=="below"&&ilKs,vl=window.pageYOffset+Mr.top+(Na?-Ks-2:Es.offsetHeight+2);if(toggleClass(ke.calendarContainer,"arrowTop",!Na),toggleClass(ke.calendarContainer,"arrowBottom",Na),!ke.config.inline){var Rc=window.pageXOffset+Mr.left,Vc=!1,xc=!1;Ma==="center"?(Rc-=(pr-Mr.width)/2,Vc=!0):Ma==="right"&&(Rc-=pr-Mr.width,xc=!0),toggleClass(ke.calendarContainer,"arrowLeft",!Vc&&!xc),toggleClass(ke.calendarContainer,"arrowCenter",Vc),toggleClass(ke.calendarContainer,"arrowRight",xc);var zc=window.document.body.offsetWidth-(window.pageXOffset+Mr.right),ad=Rc+pr>window.document.body.offsetWidth,Bh=zc+pr>window.document.body.offsetWidth;if(toggleClass(ke.calendarContainer,"rightMost",ad),!ke.config.static)if(ke.calendarContainer.style.top=vl+"px",!ad)ke.calendarContainer.style.left=Rc+"px",ke.calendarContainer.style.right="auto";else if(!Bh)ke.calendarContainer.style.left="auto",ke.calendarContainer.style.right=zc+"px";else{var Vu=nr();if(Vu===void 0)return;var Ts=window.document.body.offsetWidth,ks=Math.max(0,Ts/2-pr/2),ir=".flatpickr-calendar.centerMost:before",br=".flatpickr-calendar.centerMost:after",Aa=Vu.cssRules.length,Ba="{left:"+Mr.left+"px;right:auto;}";toggleClass(ke.calendarContainer,"rightMost",!1),toggleClass(ke.calendarContainer,"centerMost",!0),Vu.insertRule(ir+","+br+Ba,Aa),ke.calendarContainer.style.left=ks+"px",ke.calendarContainer.style.right="auto"}}}}function nr(){for(var vs=null,Es=0;Eske.currentMonth+ke.config.showMonths-1)&&ke.config.mode!=="range";if(ke.selectedDateElem=pr,ke.config.mode==="single")ke.selectedDates=[ia];else if(ke.config.mode==="multiple"){var Ma=Yl(ia);Ma?ke.selectedDates.splice(parseInt(Ma),1):ke.selectedDates.push(ia)}else ke.config.mode==="range"&&(ke.selectedDates.length===2&&ke.clear(!1,!1),ke.latestSelectedDateObj=ia,ke.selectedDates.push(ia),compareDates(ia,ke.selectedDates[0],!0)!==0&&ke.selectedDates.sort(function(vl,Rc){return vl.getTime()-Rc.getTime()}));if(io(),ka){var Mr=ke.currentYear!==ia.getFullYear();ke.currentYear=ia.getFullYear(),ke.currentMonth=ia.getMonth(),Mr&&(Ya("onYearChange"),Ys()),Ya("onMonthChange")}if(Al(),Yo(),Rr(),!ka&&ke.config.mode!=="range"&&ke.config.showMonths===1?Mo(pr):ke.selectedDateElem!==void 0&&ke.hourElement===void 0&&ke.selectedDateElem&&ke.selectedDateElem.focus(),ke.hourElement!==void 0&&ke.hourElement!==void 0&&ke.hourElement.focus(),ke.config.closeOnSelect){var il=ke.config.mode==="single"&&!ke.config.enableTime,Na=ke.config.mode==="range"&&ke.selectedDates.length===2&&!ke.config.enableTime;(il||Na)&&Ml()}So()}}var Nl={locale:[dr,Qr],showMonths:[Js,qn,xs],minDate:[Do],maxDate:[Do],positionElement:[Vl],clickOpens:[function(){ke.config.clickOpens===!0?(Oo(ke._input,"focus",ke.open),Oo(ke._input,"click",ke.open)):(ke._input.removeEventListener("focus",ke.open),ke._input.removeEventListener("click",ke.open))}]};function Zc(vs,Es){if(vs!==null&&typeof vs=="object"){Object.assign(ke.config,vs);for(var Ks in vs)Nl[Ks]!==void 0&&Nl[Ks].forEach(function(pr){return pr()})}else ke.config[vs]=Es,Nl[vs]!==void 0?Nl[vs].forEach(function(pr){return pr()}):HOOKS.indexOf(vs)>-1&&(ke.config[vs]=arrayify(Es));ke.redraw(),Rr(!0)}function cc(vs,Es){var Ks=[];if(vs instanceof Array)Ks=vs.map(function(pr){return ke.parseDate(pr,Es)});else if(vs instanceof Date||typeof vs=="number")Ks=[ke.parseDate(vs,Es)];else if(typeof vs=="string")switch(ke.config.mode){case"single":case"time":Ks=[ke.parseDate(vs,Es)];break;case"multiple":Ks=vs.split(ke.config.conjunction).map(function(pr){return ke.parseDate(pr,Es)});break;case"range":Ks=vs.split(ke.l10n.rangeSeparator).map(function(pr){return ke.parseDate(pr,Es)});break}else ke.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(vs)));ke.selectedDates=ke.config.allowInvalidPreload?Ks:Ks.filter(function(pr){return pr instanceof Date&&zo(pr,!1)}),ke.config.mode==="range"&&ke.selectedDates.sort(function(pr,ia){return pr.getTime()-ia.getTime()})}function gc(vs,Es,Ks){if(Es===void 0&&(Es=!1),Ks===void 0&&(Ks=ke.config.dateFormat),vs!==0&&!vs||vs instanceof Array&&vs.length===0)return ke.clear(Es);cc(vs,Ks),ke.latestSelectedDateObj=ke.selectedDates[ke.selectedDates.length-1],ke.redraw(),Do(void 0,Es),uo(),ke.selectedDates.length===0&&ke.clear(!1),Rr(Es),Es&&Ya("onChange")}function nc(vs){return vs.slice().map(function(Es){return typeof Es=="string"||typeof Es=="number"||Es instanceof Date?ke.parseDate(Es,void 0,!0):Es&&typeof Es=="object"&&Es.from&&Es.to?{from:ke.parseDate(Es.from,void 0),to:ke.parseDate(Es.to,void 0)}:Es}).filter(function(Es){return Es})}function Ed(){ke.selectedDates=[],ke.now=ke.parseDate(ke.config.now)||new Date;var vs=ke.config.defaultDate||((ke.input.nodeName==="INPUT"||ke.input.nodeName==="TEXTAREA")&&ke.input.placeholder&&ke.input.value===ke.input.placeholder?null:ke.input.value);vs&&cc(vs,ke.config.dateFormat),ke._initialDate=ke.selectedDates.length>0?ke.selectedDates[0]:ke.config.minDate&&ke.config.minDate.getTime()>ke.now.getTime()?ke.config.minDate:ke.config.maxDate&&ke.config.maxDate.getTime()0&&(ke.latestSelectedDateObj=ke.selectedDates[0]),ke.config.minTime!==void 0&&(ke.config.minTime=ke.parseDate(ke.config.minTime,"H:i")),ke.config.maxTime!==void 0&&(ke.config.maxTime=ke.parseDate(ke.config.maxTime,"H:i")),ke.minDateHasTime=!!ke.config.minDate&&(ke.config.minDate.getHours()>0||ke.config.minDate.getMinutes()>0||ke.config.minDate.getSeconds()>0),ke.maxDateHasTime=!!ke.config.maxDate&&(ke.config.maxDate.getHours()>0||ke.config.maxDate.getMinutes()>0||ke.config.maxDate.getSeconds()>0)}function Zl(){if(ke.input=fs(),!ke.input){ke.config.errorHandler(new Error("Invalid input element specified"));return}ke.input._type=ke.input.type,ke.input.type="text",ke.input.classList.add("flatpickr-input"),ke._input=ke.input,ke.config.altInput&&(ke.altInput=createElement(ke.input.nodeName,ke.config.altInputClass),ke._input=ke.altInput,ke.altInput.placeholder=ke.input.placeholder,ke.altInput.disabled=ke.input.disabled,ke.altInput.required=ke.input.required,ke.altInput.tabIndex=ke.input.tabIndex,ke.altInput.type="text",ke.input.setAttribute("type","hidden"),!ke.config.static&&ke.input.parentNode&&ke.input.parentNode.insertBefore(ke.altInput,ke.input.nextSibling)),ke.config.allowInput||ke._input.setAttribute("readonly","readonly"),Vl()}function Vl(){ke._positionElement=ke.config.positionElement||ke._input}function Fc(){var vs=ke.config.enableTime?ke.config.noCalendar?"time":"datetime-local":"date";ke.mobileInput=createElement("input",ke.input.className+" flatpickr-mobile"),ke.mobileInput.tabIndex=1,ke.mobileInput.type=vs,ke.mobileInput.disabled=ke.input.disabled,ke.mobileInput.required=ke.input.required,ke.mobileInput.placeholder=ke.input.placeholder,ke.mobileFormatStr=vs==="datetime-local"?"Y-m-d\\TH:i:S":vs==="date"?"Y-m-d":"H:i:S",ke.selectedDates.length>0&&(ke.mobileInput.defaultValue=ke.mobileInput.value=ke.formatDate(ke.selectedDates[0],ke.mobileFormatStr)),ke.config.minDate&&(ke.mobileInput.min=ke.formatDate(ke.config.minDate,"Y-m-d")),ke.config.maxDate&&(ke.mobileInput.max=ke.formatDate(ke.config.maxDate,"Y-m-d")),ke.input.getAttribute("step")&&(ke.mobileInput.step=String(ke.input.getAttribute("step"))),ke.input.type="hidden",ke.altInput!==void 0&&(ke.altInput.type="hidden");try{ke.input.parentNode&&ke.input.parentNode.insertBefore(ke.mobileInput,ke.input.nextSibling)}catch{}Oo(ke.mobileInput,"change",function(Es){ke.setDate(getEventTarget(Es).value,!1,ke.mobileFormatStr),Ya("onChange"),Ya("onClose")})}function qa(vs){if(ke.isOpen===!0)return ke.close();ke.open(vs)}function Ya(vs,Es){if(ke.config!==void 0){var Ks=ke.config[vs];if(Ks!==void 0&&Ks.length>0)for(var pr=0;Ks[pr]&&pr=0&&compareDates(vs,ke.selectedDates[1])<=0}function Al(){ke.config.noCalendar||ke.isMobile||!ke.monthNav||(ke.yearElements.forEach(function(vs,Es){var Ks=new Date(ke.currentYear,ke.currentMonth,1);Ks.setMonth(ke.currentMonth+Es),ke.config.showMonths>1||ke.config.monthSelectorType==="static"?ke.monthElements[Es].textContent=monthToStr(Ks.getMonth(),ke.config.shorthandCurrentMonth,ke.l10n)+" ":ke.monthsDropdownContainer.value=Ks.getMonth().toString(),vs.value=Ks.getFullYear().toString()}),ke._hidePrevMonthArrow=ke.config.minDate!==void 0&&(ke.currentYear===ke.config.minDate.getFullYear()?ke.currentMonth<=ke.config.minDate.getMonth():ke.currentYearke.config.maxDate.getMonth():ke.currentYear>ke.config.maxDate.getFullYear()))}function gd(vs){var Es=vs||(ke.config.altInput?ke.config.altFormat:ke.config.dateFormat);return ke.selectedDates.map(function(Ks){return ke.formatDate(Ks,Es)}).filter(function(Ks,pr,ia){return ke.config.mode!=="range"||ke.config.enableTime||ia.indexOf(Ks)===pr}).join(ke.config.mode!=="range"?ke.config.conjunction:ke.l10n.rangeSeparator)}function Rr(vs){vs===void 0&&(vs=!0),ke.mobileInput!==void 0&&ke.mobileFormatStr&&(ke.mobileInput.value=ke.latestSelectedDateObj!==void 0?ke.formatDate(ke.latestSelectedDateObj,ke.mobileFormatStr):""),ke.input.value=gd(ke.config.dateFormat),ke.altInput!==void 0&&(ke.altInput.value=gd(ke.config.altFormat)),vs!==!1&&Ya("onValueUpdate")}function Pl(vs){var Es=getEventTarget(vs),Ks=ke.prevMonthNav.contains(Es),pr=ke.nextMonthNav.contains(Es);Ks||pr?ws(Ks?-1:1):ke.yearElements.indexOf(Es)>=0?Es.select():Es.classList.contains("arrowUp")?ke.changeYear(ke.currentYear+1):Es.classList.contains("arrowDown")&&ke.changeYear(ke.currentYear-1)}function Su(vs){vs.preventDefault();var Es=vs.type==="keydown",Ks=getEventTarget(vs),pr=Ks;ke.amPM!==void 0&&Ks===ke.amPM&&(ke.amPM.textContent=ke.l10n.amPM[int(ke.amPM.textContent===ke.l10n.amPM[0])]);var ia=parseFloat(pr.getAttribute("min")),ka=parseFloat(pr.getAttribute("max")),Ma=parseFloat(pr.getAttribute("step")),Mr=parseInt(pr.value,10),il=vs.delta||(Es?vs.which===38?1:-1:0),Na=Mr+Ma*il;if(typeof pr.value<"u"&&pr.value.length===2){var vl=pr===ke.hourElement,Rc=pr===ke.minuteElement;Naka&&(Na=pr===ke.hourElement?Na-ka-int(!ke.amPM):ia,Rc&&Io(void 0,1,ke.hourElement)),ke.amPM&&vl&&(Ma===1?Na+Mr===23:Math.abs(Na-Mr)>Ma)&&(ke.amPM.textContent=ke.l10n.amPM[int(ke.amPM.textContent===ke.l10n.amPM[0])]),pr.value=pad(Na)}}return Hn(),ke}function _flatpickr(_n,Ce){for(var ke=Array.prototype.slice.call(_n).filter(function(Un){return Un instanceof HTMLElement}),$n=[],Hn=0;Hn{(!Hn.readonly||qn)&&flatpickr(Kn,to)});function io(){zn=this.value,ke(0,zn)}function uo(ho){binding_callbacks[ho?"unshift":"push"](()=>{Kn=ho,ke(4,Kn)})}return _n.$$set=ho=>{"field"in ho&&ke(1,Hn=ho.field),"value"in ho&&ke(0,zn=ho.value),"id"in ho&&ke(2,Un=ho.id),"isCreateMode"in ho&&ke(3,qn=ho.isCreateMode),"validationErrors"in ho&&ke(6,Xn=ho.validationErrors)},_n.$$.update=()=>{_n.$$.dirty&66&&ke(5,$n=getErrorMessage(Xn,Hn.name))},[zn,Hn,Un,qn,Kn,$n,Xn,io,uo]}let Date$1=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$r,create_fragment$r,safe_not_equal,{field:1,value:0,id:2,isCreateMode:3,validationErrors:6})}};var byteToHex=[];for(var i$2=0;i$2<256;++i$2)byteToHex.push((i$2+256).toString(16).slice(1));function unsafeStringify(_n,Ce=0){return(byteToHex[_n[Ce+0]]+byteToHex[_n[Ce+1]]+byteToHex[_n[Ce+2]]+byteToHex[_n[Ce+3]]+"-"+byteToHex[_n[Ce+4]]+byteToHex[_n[Ce+5]]+"-"+byteToHex[_n[Ce+6]]+byteToHex[_n[Ce+7]]+"-"+byteToHex[_n[Ce+8]]+byteToHex[_n[Ce+9]]+"-"+byteToHex[_n[Ce+10]]+byteToHex[_n[Ce+11]]+byteToHex[_n[Ce+12]]+byteToHex[_n[Ce+13]]+byteToHex[_n[Ce+14]]+byteToHex[_n[Ce+15]]).toLowerCase()}var getRandomValues,rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}var randomUUID=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const native={randomUUID};function v4(_n,Ce,ke){if(native.randomUUID&&!Ce&&!_n)return native.randomUUID();_n=_n||{};var $n=_n.random||(_n.rng||rng)();return $n[6]=$n[6]&15|64,$n[8]=$n[8]&63|128,unsafeStringify($n)}function create_if_block_1$d(_n){let Ce,ke,$n,Hn,zn;return ke=new Icon({props:{icon:"dice"}}),{c(){Ce=element("button"),create_component(ke.$$.fragment),attr(Ce,"class","btn btn-primary ms-2"),attr(Ce,"title","Generate a new UUIDv4")},m(Un,qn){insert$1(Un,Ce,qn),mount_component(ke,Ce,null),$n=!0,Hn||(zn=listen(Ce,"click",_n[4]),Hn=!0)},p:noop,i(Un){$n||(transition_in(ke.$$.fragment,Un),$n=!0)},o(Un){transition_out(ke.$$.fragment,Un),$n=!1},d(Un){Un&&detach(Ce),destroy_component(ke),Hn=!1,zn()}}}function create_if_block$j(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[2]),attr(Ce,"class","invalid-feedback d-block")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,Hn){Hn&4&&set_data(ke,$n[2])},d($n){$n&&detach(Ce)}}}function create_fragment$q(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn=!_n[3]&&create_if_block_1$d(_n),to=_n[2]&&create_if_block$j(_n);return{c(){Ce=element("div"),ke=element("div"),$n=element("input"),Hn=space$3(),Kn&&Kn.c(),zn=space$3(),to&&to.c(),attr($n,"type","text"),attr($n,"id",_n[1]),attr($n,"class","form-control"),attr($n,"autocomplete","off"),$n.readOnly=_n[3],toggle_class($n,"is-invalid",_n[2]),attr(ke,"class","d-flex justify-content-between"),attr(Ce,"class","mb-0")},m(io,uo){insert$1(io,Ce,uo),append(Ce,ke),append(ke,$n),set_input_value($n,_n[0]),append(ke,Hn),Kn&&Kn.m(ke,null),append(Ce,zn),to&&to.m(Ce,null),Un=!0,qn||(Xn=listen($n,"input",_n[8]),qn=!0)},p(io,[uo]){(!Un||uo&2)&&attr($n,"id",io[1]),uo&1&&$n.value!==io[0]&&set_input_value($n,io[0]),(!Un||uo&4)&&toggle_class($n,"is-invalid",io[2]),io[3]||Kn.p(io,uo),io[2]?to?to.p(io,uo):(to=create_if_block$j(io),to.c(),to.m(Ce,null)):to&&(to.d(1),to=null)},i(io){Un||(transition_in(Kn),Un=!0)},o(io){transition_out(Kn),Un=!1},d(io){io&&detach(Ce),Kn&&Kn.d(),to&&to.d(),qn=!1,Xn()}}}function instance$q(_n,Ce,ke){let $n;getContext$1("channelurl");let{validationErrors:Hn}=Ce,{field:zn}=Ce,{value:Un}=Ce,{id:qn}=Ce,{isCreateMode:Xn}=Ce,Kn=zn.readonly&&!Xn;function to(uo){uo.preventDefault(),ke(0,Un=v4())}function io(){Un=this.value,ke(0,Un)}return _n.$$set=uo=>{"validationErrors"in uo&&ke(5,Hn=uo.validationErrors),"field"in uo&&ke(6,zn=uo.field),"value"in uo&&ke(0,Un=uo.value),"id"in uo&&ke(1,qn=uo.id),"isCreateMode"in uo&&ke(7,Xn=uo.isCreateMode)},_n.$$.update=()=>{_n.$$.dirty&96&&ke(2,$n=getErrorMessage(Hn,zn.name))},[Un,qn,$n,Kn,to,Hn,zn,Xn,io]}class UUID extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$q,create_fragment$q,safe_not_equal,{validationErrors:5,field:6,value:0,id:1,isCreateMode:7})}}function get_each_context$a(_n,Ce,ke){const $n=_n.slice();return $n[12]=Ce[ke],$n}function create_if_block_2$5(_n){let Ce,ke;return Ce=new Status({props:{status:_n[0].status}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&1&&(zn.status=$n[0].status),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_if_block_1$c(_n){let Ce,ke,$n;return ke=new Dropdown({props:{$$slots:{button:[create_button_slot$3],default:[create_default_slot$3]},$$scope:{ctx:_n}}}),{c(){Ce=element("div"),create_component(ke.$$.fragment),attr(Ce,"class","reference-action")},m(Hn,zn){insert$1(Hn,Ce,zn),mount_component(ke,Ce,null),$n=!0},p(Hn,zn){const Un={};zn&32768&&(Un.$$scope={dirty:zn,ctx:Hn}),ke.$set(Un)},i(Hn){$n||(transition_in(ke.$$.fragment,Hn),$n=!0)},o(Hn){transition_out(ke.$$.fragment,Hn),$n=!1},d(Hn){Hn&&detach(Ce),destroy_component(ke)}}}function create_each_block$a(_n){let Ce,ke,$n;function Hn(...zn){return _n[10](_n[12],...zn)}return{c(){Ce=element("button"),Ce.textContent=`${_n[12]}`,attr(Ce,"class","dropdown-item button")},m(zn,Un){insert$1(zn,Ce,Un),ke||($n=listen(Ce,"click",Hn),ke=!0)},p(zn,Un){_n=zn},d(zn){zn&&detach(Ce),ke=!1,$n()}}}function create_default_slot$3(_n){let Ce,ke,$n,Hn,zn,Un=ensure_array_like(_n[6]),qn=[];for(let Xn=0;Xn{Vo=null}),check_outros()),Go[2]?Jo?(Jo.p(Go,os),os&4&&transition_in(Jo,1)):(Jo=create_if_block_1$c(Go),Jo.c(),transition_in(Jo,1),Jo.m(Do,xo)):Jo&&(group_outros(),transition_out(Jo,1,1,()=>{Jo=null}),check_outros()),Go[1]?Mo?(Mo.p(Go,os),os&2&&transition_in(Mo,1)):(Mo=create_if_block$i(Go),Mo.c(),transition_in(Mo,1),Mo.m(Do,null)):Mo&&(group_outros(),transition_out(Mo,1,1,()=>{Mo=null}),check_outros())},i(Go){Io||(transition_in(Hn.$$.fragment,Go),transition_in(Vo),transition_in(Jo),transition_in(Mo),Io=!0)},o(Go){transition_out(Hn.$$.fragment,Go),transition_out(Vo),transition_out(Jo),transition_out(Mo),Io=!1},d(Go){Go&&detach(Ce),destroy_component(Hn),Vo&&Vo.d(),Jo&&Jo.d(),Mo&&Mo.d()}}}function instance$p(_n,Ce,ke){const $n=createEventDispatcher(),Hn=getContext$1("channel");let{record:zn}=Ce,{hasDelete:Un=!1}=Ce,{hasInsert:qn=!1}=Ce,Xn=Hn.schemas.find(Oo=>Oo.name===zn.schema),Kn=previewTitle(Hn.schemas,zn),to=Object.keys(Hn.imageFilters);function io(Oo){Oo.preventDefault(),$n("remove",zn.id)}function uo(Oo,So){Oo.preventDefault();let $o=htmlurl(Hn,zn,So),Do=So?`/templates/${So}/${zn._file.path}`:`/${zn._file.path}`;$n("editor-insert",{html:$o,url:Hn.filesUrl+Do,originalUrl:Hn.filesUrl+"/"+zn._file.path,record:zn})}const ho=Oo=>uo(Oo,null),bo=(Oo,So)=>uo(So,Oo);return _n.$$set=Oo=>{"record"in Oo&&ke(0,zn=Oo.record),"hasDelete"in Oo&&ke(1,Un=Oo.hasDelete),"hasInsert"in Oo&&ke(2,qn=Oo.hasInsert)},[zn,Un,qn,Hn,Xn,Kn,to,io,uo,ho,bo]}class PreviewFile extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$p,create_fragment$p,safe_not_equal,{record:0,hasDelete:1,hasInsert:2})}}function get_each_context$9(_n,Ce,ke){const $n=_n.slice();return $n[14]=Ce[ke],$n}function get_each_context_1$3(_n,Ce,ke){const $n=_n.slice();return $n[17]=Ce[ke],$n}function create_else_block$8(_n){let Ce,ke;return Ce=new Dropdown({props:{$$slots:{button:[create_button_slot$2],default:[create_default_slot_1]},$$scope:{ctx:_n}}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&1048576&&(zn.$$scope={dirty:Hn,ctx:$n}),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_if_block_1$b(_n){let Ce,ke,$n;return{c(){Ce=element("button"),Ce.textContent="Browse",attr(Ce,"class","button")},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"click",_n[10]),ke=!0)},p:noop,i:noop,o:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function create_each_block_1$3(_n){let Ce,ke,$n;function Hn(...zn){return _n[11](_n[17],...zn)}return{c(){Ce=element("a"),Ce.textContent=`${_n[17].label}`,attr(Ce,"class","dropdown-item"),attr(Ce,"href","/")},m(zn,Un){insert$1(zn,Ce,Un),ke||($n=listen(Ce,"click",Hn),ke=!0)},p(zn,Un){_n=zn},d(zn){zn&&detach(Ce),ke=!1,$n()}}}function create_default_slot_1(_n){let Ce,ke=ensure_array_like(_n[3]),$n=[];for(let Hn=0;Hnqn[14].id;for(let qn=0;qn0&&create_if_block$h(_n),uo={};return Un=new Dialog({props:uo}),_n[12](Un),Un.$on("insert",_n[7]),{c(){Ce=element("div"),$n.c(),Hn=space$3(),io&&io.c(),zn=space$3(),create_component(Un.$$.fragment),attr(Ce,"class","mb-0")},m(ho,bo){insert$1(ho,Ce,bo),Kn[ke].m(Ce,null),insert$1(ho,Hn,bo),io&&io.m(ho,bo),insert$1(ho,zn,bo),mount_component(Un,ho,bo),qn=!0},p(ho,[bo]){let Oo=ke;ke=to(ho),ke===Oo?Kn[ke].p(ho,bo):(group_outros(),transition_out(Kn[Oo],1,1,()=>{Kn[Oo]=null}),check_outros(),$n=Kn[ke],$n?$n.p(ho,bo):($n=Kn[ke]=Xn[ke](ho),$n.c()),transition_in($n,1),$n.m(Ce,null)),ho[2].length>0?io?(io.p(ho,bo),bo&4&&transition_in(io,1)):(io=create_if_block$h(ho),io.c(),transition_in(io,1),io.m(zn.parentNode,zn)):io&&(group_outros(),transition_out(io,1,1,()=>{io=null}),check_outros());const So={};Un.$set(So)},i(ho){qn||(transition_in($n),transition_in(io),transition_in(Un.$$.fragment,ho),qn=!0)},o(ho){transition_out($n),transition_out(io),transition_out(Un.$$.fragment,ho),qn=!1},d(ho){ho&&(detach(Ce),detach(Hn),detach(zn)),Kn[ke].d(),io&&io.d(ho),_n[12](null),destroy_component(Un,ho)}}}function instance$o(_n,Ce,ke){let $n;const Hn=getContext$1("channel");let{field:zn}=Ce,{record:Un}=Ce,{graph:qn}=Ce,Xn,Kn=Hn.schemas.filter($o=>zn.collections.includes($o.name));function to($o){$o.preventDefault(),ke(8,qn.edges=qn.edges.filter(Do=>!(Do.target===$o.detail&&Do.field===zn.name)),qn)}function io($o,Do){$o.preventDefault(),Xn.open(Do)}async function uo($o){ke(8,qn.edges=await sortByField($o.detail.source,$o.detail.target,qn.edges,zn.name,$n),qn)}function ho($o){$o.preventDefault(),Xn.close(),ke(8,qn=insertEdges(qn,Un,$o.detail.records,zn.name,$o.detail.action))}const bo=$o=>io($o,Kn[0].name),Oo=($o,Do)=>io(Do,$o.name);function So($o){binding_callbacks[$o?"unshift":"push"](()=>{Xn=$o,ke(1,Xn)})}return _n.$$set=$o=>{"field"in $o&&ke(0,zn=$o.field),"record"in $o&&ke(9,Un=$o.record),"graph"in $o&&ke(8,qn=$o.graph)},_n.$$.update=()=>{_n.$$.dirty&769&&ke(2,$n=(qn==null?void 0:qn.edges.filter($o=>$o.field===zn.name).map($o=>qn.records.find(Do=>Do.id===$o.target&&Un.id===$o.source)).filter($o=>!!($o!=null&&$o.id)))??[])},[zn,Xn,$n,Kn,to,io,uo,ho,qn,Un,bo,Oo,So]}let File$1=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$o,create_fragment$o,safe_not_equal,{field:0,record:9,graph:8})}};function create_if_block$g(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[5]),attr(Ce,"class","invalid-feedback d-block")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,Hn){Hn&32&&set_data(ke,$n[5])},d($n){$n&&detach(Ce)}}}function create_fragment$n(_n){let Ce,ke,$n,Hn,zn,Un,qn=_n[5]&&create_if_block$g(_n);return{c(){Ce=element("div"),ke=element("textarea"),Hn=space$3(),qn&&qn.c(),attr(ke,"id",_n[3]),attr(ke,"class","form-control svelte-1er4ovm"),attr(ke,"rows","2"),ke.readOnly=$n=_n[1].readonly&&!_n[2],toggle_class(ke,"is-invalid",_n[5]),attr(Ce,"class","mb-0")},m(Xn,Kn){insert$1(Xn,Ce,Kn),append(Ce,ke),set_input_value(ke,_n[0]),_n[8](ke),append(Ce,Hn),qn&&qn.m(Ce,null),zn||(Un=[listen(ke,"input",_n[7]),listen(ke,"input",resize),listen(ke,"focus",resize)],zn=!0)},p(Xn,[Kn]){Kn&8&&attr(ke,"id",Xn[3]),Kn&6&&$n!==($n=Xn[1].readonly&&!Xn[2])&&(ke.readOnly=$n),Kn&1&&set_input_value(ke,Xn[0]),Kn&32&&toggle_class(ke,"is-invalid",Xn[5]),Xn[5]?qn?qn.p(Xn,Kn):(qn=create_if_block$g(Xn),qn.c(),qn.m(Ce,null)):qn&&(qn.d(1),qn=null)},i:noop,o:noop,d(Xn){Xn&&detach(Ce),_n[8](null),qn&&qn.d(),zn=!1,run_all(Un)}}}function resize(_n){let Ce;_n.target?Ce=_n.target:Ce=_n,Ce.style.overflow="hidden",Ce.style.height="1px",Ce.style.height=+Ce.scrollHeight+"px"}function instance$n(_n,Ce,ke){let $n,{field:Hn}=Ce,{value:zn}=Ce,{isCreateMode:Un}=Ce,{validationErrors:qn}=Ce,Xn,{id:Kn}=Ce;onMount(()=>{resize(Xn)});function to(){zn=this.value,ke(0,zn)}function io(uo){binding_callbacks[uo?"unshift":"push"](()=>{Xn=uo,ke(4,Xn)})}return _n.$$set=uo=>{"field"in uo&&ke(1,Hn=uo.field),"value"in uo&&ke(0,zn=uo.value),"isCreateMode"in uo&&ke(2,Un=uo.isCreateMode),"validationErrors"in uo&&ke(6,qn=uo.validationErrors),"id"in uo&&ke(3,Kn=uo.id)},_n.$$.update=()=>{_n.$$.dirty&66&&ke(5,$n=getErrorMessage(qn,Hn.name))},[zn,Hn,Un,Kn,Xn,$n,qn,to,io]}class Textarea extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$n,create_fragment$n,safe_not_equal,{field:1,value:0,isCreateMode:2,validationErrors:6,id:3})}}function create_if_block$f(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[6]),attr(Ce,"class","invalid-feedback d-block")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,Hn){Hn&64&&set_data(ke,$n[6])},d($n){$n&&detach(Ce)}}}function create_fragment$m(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn=_n[6]&&create_if_block$f(_n);return{c(){Ce=element("div"),ke=element("input"),Hn=space$3(),zn=element("span"),zn.textContent=`Dates are displayed according to your timezone: ${_n[7]}`,Un=space$3(),Kn&&Kn.c(),attr(ke,"type","text"),attr(ke,"id",_n[3]),attr(ke,"class","form-control"),attr(ke,"autocomplete","off"),ke.readOnly=$n=_n[1].readonly&&!_n[2],toggle_class(ke,"is-invalid",_n[6]),attr(zn,"class","system-help-text"),attr(Ce,"class","mb-0")},m(to,io){insert$1(to,Ce,io),append(Ce,ke),set_input_value(ke,_n[0]),_n[10](ke),append(Ce,Hn),append(Ce,zn),append(Ce,Un),Kn&&Kn.m(Ce,null),_n[11](Ce),qn||(Xn=listen(ke,"input",_n[9]),qn=!0)},p(to,[io]){io&8&&attr(ke,"id",to[3]),io&6&&$n!==($n=to[1].readonly&&!to[2])&&(ke.readOnly=$n),io&1&&ke.value!==to[0]&&set_input_value(ke,to[0]),io&64&&toggle_class(ke,"is-invalid",to[6]),to[6]?Kn?Kn.p(to,io):(Kn=create_if_block$f(to),Kn.c(),Kn.m(Ce,null)):Kn&&(Kn.d(1),Kn=null)},i:noop,o:noop,d(to){to&&detach(Ce),_n[10](null),Kn&&Kn.d(),_n[11](null),qn=!1,Xn()}}}function instance$m(_n,Ce,ke){let $n,{field:Hn}=Ce,{value:zn}=Ce,{isCreateMode:Un}=Ce,{validationErrors:qn}=Ce;const Xn=Intl.DateTimeFormat().resolvedOptions().timeZone;let{id:Kn}=Ce,to,io,uo={appendTo:to,static:!0,allowInput:!0,altInput:!0,altFormat:"Y-m-d H:i:S",dateFormat:"Z",enableTime:!0,time_24hr:!0,enableSeconds:!0};Hn.min&&(uo.minDate=Hn.min),Hn.max&&(uo.maxDate=Hn.max),onMount(()=>{(!Hn.readonly||Un)&&flatpickr(io,uo)});function ho(){zn=this.value,ke(0,zn)}function bo(So){binding_callbacks[So?"unshift":"push"](()=>{io=So,ke(5,io)})}function Oo(So){binding_callbacks[So?"unshift":"push"](()=>{to=So,ke(4,to)})}return _n.$$set=So=>{"field"in So&&ke(1,Hn=So.field),"value"in So&&ke(0,zn=So.value),"isCreateMode"in So&&ke(2,Un=So.isCreateMode),"validationErrors"in So&&ke(8,qn=So.validationErrors),"id"in So&&ke(3,Kn=So.id)},_n.$$.update=()=>{_n.$$.dirty&258&&ke(6,$n=getErrorMessage(qn,Hn.name))},[zn,Hn,Un,Kn,to,io,$n,Xn,qn,ho,bo,Oo]}class Datetime extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$m,create_fragment$m,safe_not_equal,{field:1,value:0,isCreateMode:2,validationErrors:8,id:3})}}var tinymce$1={exports:{}};(function(_n){(function(){var Ce=function(Mn){if(Mn===null)return"null";if(Mn===void 0)return"undefined";var Vn=typeof Mn;return Vn==="object"&&(Array.prototype.isPrototypeOf(Mn)||Mn.constructor&&Mn.constructor.name==="Array")?"array":Vn==="object"&&(String.prototype.isPrototypeOf(Mn)||Mn.constructor&&Mn.constructor.name==="String")?"string":Vn},ke=function(Mn){return["undefined","boolean","number","string","function","xml","null"].indexOf(Mn)!==-1},$n=function(Mn,Vn){var Wn=Array.prototype.slice.call(Mn);return Wn.sort(Vn)},Hn=function(Mn,Vn){return zn(function(Wn,jn){return Mn.eq(Vn(Wn),Vn(jn))})},zn=function(Mn){return{eq:Mn}},Un=zn(function(Mn,Vn){return Mn===Vn}),qn=Un,Xn=function(Mn){return zn(function(Vn,Wn){if(Vn.length!==Wn.length)return!1;for(var jn=Vn.length,Gn=0;Gn{var jn;return Wn(Mn,Vn.prototype)?!0:((jn=Mn.constructor)===null||jn===void 0?void 0:jn.name)===Vn.name},bo=Mn=>{const Vn=typeof Mn;return Mn===null?"null":Vn==="object"&&Array.isArray(Mn)?"array":Vn==="object"&&ho(Mn,String,(Wn,jn)=>jn.isPrototypeOf(Wn))?"string":Vn},Oo=Mn=>Vn=>bo(Vn)===Mn,So=Mn=>Vn=>typeof Vn===Mn,$o=Mn=>Vn=>Mn===Vn,Do=(Mn,Vn)=>Io(Mn)&&ho(Mn,Vn,(Wn,jn)=>uo(Wn)===jn),xo=Oo("string"),Io=Oo("object"),Vo=Mn=>Do(Mn,Object),Jo=Oo("array"),Mo=$o(null),Go=So("boolean"),os=$o(void 0),ms=Mn=>Mn==null,is=Mn=>!ms(Mn),Yo=So("function"),Ys=So("number"),sr=(Mn,Vn)=>{if(Jo(Mn)){for(let Wn=0,jn=Mn.length;Wn{},ko=(Mn,Vn)=>(...Wn)=>Mn(Vn.apply(null,Wn)),gs=(Mn,Vn)=>Wn=>Mn(Vn(Wn)),xs=Mn=>()=>Mn,Qr=Mn=>Mn,cr=(Mn,Vn)=>Mn===Vn;function ws(Mn,...Vn){return(...Wn)=>{const jn=Vn.concat(Wn);return Mn.apply(null,jn)}}const Fs=Mn=>Vn=>!Mn(Vn),Br=Mn=>()=>{throw new Error(Mn)},_r=Mn=>Mn(),ha=Mn=>{Mn()},hs=xs(!1),Qs=xs(!0);class zo{constructor(Vn,Wn){this.tag=Vn,this.value=Wn}static some(Vn){return new zo(!0,Vn)}static none(){return zo.singletonNone}fold(Vn,Wn){return this.tag?Wn(this.value):Vn()}isSome(){return this.tag}isNone(){return!this.tag}map(Vn){return this.tag?zo.some(Vn(this.value)):zo.none()}bind(Vn){return this.tag?Vn(this.value):zo.none()}exists(Vn){return this.tag&&Vn(this.value)}forall(Vn){return!this.tag||Vn(this.value)}filter(Vn){return!this.tag||Vn(this.value)?this:zo.none()}getOr(Vn){return this.tag?this.value:Vn}or(Vn){return this.tag?this:Vn}getOrThunk(Vn){return this.tag?this.value:Vn()}orThunk(Vn){return this.tag?this:Vn()}getOrDie(Vn){if(this.tag)return this.value;throw new Error(Vn??"Called getOrDie on None")}static from(Vn){return is(Vn)?zo.some(Vn):zo.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Vn){this.tag&&Vn(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}zo.singletonNone=new zo(!1);const el=Array.prototype.slice,ga=Array.prototype.indexOf,Ca=Array.prototype.push,za=(Mn,Vn)=>ga.call(Mn,Vn),Il=(Mn,Vn)=>{const Wn=za(Mn,Vn);return Wn===-1?zo.none():zo.some(Wn)},Zs=(Mn,Vn)=>za(Mn,Vn)>-1,Sr=(Mn,Vn)=>{for(let Wn=0,jn=Mn.length;Wn{const Wn=Mn.length,jn=new Array(Wn);for(let Gn=0;Gn{for(let Wn=0,jn=Mn.length;Wn{for(let Wn=Mn.length-1;Wn>=0;Wn--){const jn=Mn[Wn];Vn(jn,Wn)}},Vr=(Mn,Vn)=>{const Wn=[],jn=[];for(let Gn=0,no=Mn.length;Gn{const Wn=[];for(let jn=0,Gn=Mn.length;jn(dr(Mn,(jn,Gn)=>{Wn=Vn(Wn,jn,Gn)}),Wn),ra=(Mn,Vn,Wn)=>(fs(Mn,(jn,Gn)=>{Wn=Vn(Wn,jn,Gn)}),Wn),Ml=(Mn,Vn,Wn)=>{for(let jn=0,Gn=Mn.length;jnMl(Mn,Vn,hs),Nl=(Mn,Vn)=>{for(let Wn=0,jn=Mn.length;Wn{const Vn=[];for(let Wn=0,jn=Mn.length;WnZc(Us(Mn,Vn)),gc=(Mn,Vn)=>{for(let Wn=0,jn=Mn.length;Wn{const Vn=el.call(Mn,0);return Vn.reverse(),Vn},Ed=(Mn,Vn)=>nr(Mn,Wn=>!Zs(Vn,Wn)),Zl=(Mn,Vn)=>{const Wn={};for(let jn=0,Gn=Mn.length;jn{const Wn=el.call(Mn,0);return Wn.sort(Vn),Wn},Fc=(Mn,Vn)=>Vn>=0&&VnFc(Mn,0),Ya=Mn=>Fc(Mn,Mn.length-1),kc=Yo(Array.from)?Array.from:Mn=>el.call(Mn),Yl=(Mn,Vn)=>{for(let Wn=0;Wn{const Wn=[],jn=Yo(Vn)?Gn=>Sr(Wn,no=>Vn(no,Gn)):Gn=>Zs(Wn,Gn);for(let Gn=0,no=Mn.length;Gn{const Wn=Al(Mn);for(let jn=0,Gn=Wn.length;jnSu(Mn,(Wn,jn)=>({k:jn,v:Vn(Wn,jn)})),Su=(Mn,Vn)=>{const Wn={};return Rr(Mn,(jn,Gn)=>{const no=Vn(jn,Gn);Wn[no.k]=no.v}),Wn},vs=Mn=>(Vn,Wn)=>{Mn[Wn]=Vn},Es=(Mn,Vn,Wn,jn)=>{Rr(Mn,(Gn,no)=>{(Vn(Gn,no)?Wn:jn)(Gn,no)})},Ks=(Mn,Vn)=>{const Wn={},jn={};return Es(Mn,Vn,vs(Wn),vs(jn)),{t:Wn,f:jn}},pr=(Mn,Vn)=>{const Wn={};return Es(Mn,Vn,vs(Wn),Js),Wn},ia=(Mn,Vn)=>{const Wn=[];return Rr(Mn,(jn,Gn)=>{Wn.push(Vn(jn,Gn))}),Wn},ka=Mn=>ia(Mn,Qr),Ma=(Mn,Vn)=>Mr(Mn,Vn)?zo.from(Mn[Vn]):zo.none(),Mr=(Mn,Vn)=>gd.call(Mn,Vn),il=(Mn,Vn)=>Mr(Mn,Vn)&&Mn[Vn]!==void 0&&Mn[Vn]!==null,Na=(Mn,Vn,Wn=io)=>to(Wn).eq(Mn,Vn),vl=Mn=>{const Vn={};return fs(Mn,Wn=>{Vn[Wn]={}}),Al(Vn)},Rc=Mn=>Mn.length!==void 0,Vc=Array.isArray,xc=Mn=>{if(Vc(Mn))return Mn;{const Vn=[];for(let Wn=0,jn=Mn.length;Wn{if(!Mn)return!1;if(Wn=Wn||Mn,Rc(Mn)){for(let jn=0,Gn=Mn.length;jn{const Wn=[];return zc(Mn,(jn,Gn)=>{Wn.push(Vn(jn,Gn,Mn))}),Wn},Bh=(Mn,Vn)=>{const Wn=[];return zc(Mn,(jn,Gn)=>{(!Vn||Vn(jn,Gn,Mn))&&Wn.push(jn)}),Wn},Vu=(Mn,Vn)=>{if(Mn){for(let Wn=0,jn=Mn.length;Wn{let Gn=os(Wn)?Mn[0]:Wn;for(let no=0;no{for(let jn=0,Gn=Mn.length;jnMn[Mn.length-1],br=Mn=>{let Vn=!1,Wn;return(...jn)=>(Vn||(Vn=!0,Wn=Mn.apply(null,jn)),Wn)},Aa=(Mn,Vn,Wn,jn)=>{const Gn=Mn.isiOS()&&/ipad/i.test(Wn)===!0,no=Mn.isiOS()&&!Gn,ao=Mn.isiOS()||Mn.isAndroid(),po=ao||jn("(pointer:coarse)"),vo=Gn||!no&&ao&&jn("(min-device-width:768px)"),Ao=no||ao&&!vo,Fo=Vn.isSafari()&&Mn.isiOS()&&/safari/i.test(Wn)===!1,Qo=!Ao&&!vo&&!Fo;return{isiPad:xs(Gn),isiPhone:xs(no),isTablet:xs(vo),isPhone:xs(Ao),isTouch:xs(po),isAndroid:Mn.isAndroid,isiOS:Mn.isiOS,isWebView:xs(Fo),isDesktop:xs(Qo)}},Ba=(Mn,Vn)=>{for(let Wn=0;Wn{const Wn=Ba(Mn,Vn);if(!Wn)return{major:0,minor:0};const jn=Gn=>Number(Vn.replace(Wn,"$"+Gn));return tl(jn(1),jn(2))},Hc=(Mn,Vn)=>{const Wn=String(Vn).toLowerCase();return Mn.length===0?Ds():_l(Mn,Wn)},Ds=()=>tl(0,0),tl=(Mn,Vn)=>({major:Mn,minor:Vn}),wu={nu:tl,detect:Hc,unknown:Ds},qu=(Mn,Vn)=>Yl(Vn.brands,Wn=>{const jn=Wn.brand.toLowerCase();return xa(Mn,Gn=>{var no;return jn===((no=Gn.brand)===null||no===void 0?void 0:no.toLowerCase())}).map(Gn=>({current:Gn.name,version:wu.nu(parseInt(Wn.version,10),0)}))}),Md=(Mn,Vn)=>{const Wn=String(Vn).toLowerCase();return xa(Mn,jn=>jn.search(Wn))},bc=(Mn,Vn)=>Md(Mn,Vn).map(Wn=>{const jn=wu.detect(Wn.versionRegexes,Vn);return{current:Wn.name,version:jn}}),nm=(Mn,Vn)=>Md(Mn,Vn).map(Wn=>{const jn=wu.detect(Wn.versionRegexes,Vn);return{current:Wn.name,version:jn}}),Ff=(Mn,Vn)=>Mn.substring(Vn),Ud=(Mn,Vn,Wn)=>Vn===""||Mn.length>=Vn.length&&Mn.substr(Wn,Wn+Vn.length)===Vn,ld=(Mn,Vn)=>Dc(Mn,Vn)?Ff(Mn,Vn.length):Mn,oc=(Mn,Vn,Wn=0,jn)=>{const Gn=Mn.indexOf(Vn,Wn);return Gn!==-1?os(jn)?!0:Gn+Vn.length<=jn:!1},Dc=(Mn,Vn)=>Ud(Mn,Vn,0),bd=(Mn,Vn)=>Ud(Mn,Vn,Mn.length-Vn.length),Nd=Mn=>Vn=>Vn.replace(Mn,""),ih=Nd(/^\s+|\s+$/g),om=Nd(/^\s+/g),sm=Nd(/\s+$/g),fc=Mn=>Mn.length>0,Td=Mn=>!fc(Mn),Jd=(Mn,Vn)=>Vn<=0?"":new Array(Vn+1).join(Mn),Em=(Mn,Vn=10)=>{const Wn=parseInt(Mn,Vn);return isNaN(Wn)?zo.none():zo.some(Wn)},ef=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Cu=Mn=>Vn=>oc(Vn,Mn),Qc=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:Mn=>oc(Mn,"edge/")&&oc(Mn,"chrome")&&oc(Mn,"safari")&&oc(Mn,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ef],search:Mn=>oc(Mn,"chrome")&&!oc(Mn,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:Mn=>oc(Mn,"msie")||oc(Mn,"trident")},{name:"Opera",versionRegexes:[ef,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Cu("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Cu("firefox")},{name:"Safari",versionRegexes:[ef,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:Mn=>(oc(Mn,"safari")||oc(Mn,"mobile/"))&&oc(Mn,"applewebkit")}],Cf=[{name:"Windows",search:Cu("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:Mn=>oc(Mn,"iphone")||oc(Mn,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Cu("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Cu("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Cu("linux"),versionRegexes:[]},{name:"Solaris",search:Cu("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Cu("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Cu("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],qm={browsers:xs(Qc),oses:xs(Cf)},Oc="Edge",cd="Chromium",vd="IE",ju="Opera",Xf="Firefox",Sh="Safari",Zd=()=>ah({current:void 0,version:wu.unknown()}),ah=Mn=>{const Vn=Mn.current,Wn=Mn.version,jn=Gn=>()=>Vn===Gn;return{current:Vn,version:Wn,isEdge:jn(Oc),isChromium:jn(cd),isIE:jn(vd),isOpera:jn(ju),isFirefox:jn(Xf),isSafari:jn(Sh)}},lh={unknown:Zd,nu:ah,edge:xs(Oc),chromium:xs(cd),ie:xs(vd),opera:xs(ju),firefox:xs(Xf),safari:xs(Sh)},Bp="Windows",ch="iOS",bp="Android",kf="Linux",Fh="macOS",jm="Solaris",Fp="FreeBSD",Eg="ChromeOS",rs=()=>As({current:void 0,version:wu.unknown()}),As=Mn=>{const Vn=Mn.current,Wn=Mn.version,jn=Gn=>()=>Vn===Gn;return{current:Vn,version:Wn,isWindows:jn(Bp),isiOS:jn(ch),isAndroid:jn(bp),isMacOS:jn(Fh),isLinux:jn(kf),isSolaris:jn(jm),isFreeBSD:jn(Fp),isChromeOS:jn(Eg)}},Ws={unknown:rs,nu:As,windows:xs(Bp),ios:xs(ch),android:xs(bp),linux:xs(kf),macos:xs(Fh),solaris:xs(jm),freebsd:xs(Fp),chromeos:xs(Eg)},Fr={detect:(Mn,Vn,Wn)=>{const jn=qm.browsers(),Gn=qm.oses(),no=Vn.bind(vo=>qu(jn,vo)).orThunk(()=>bc(jn,Mn)).fold(lh.unknown,lh.nu),ao=nm(Gn,Mn).fold(Ws.unknown,Ws.nu),po=Aa(ao,no,Mn,Wn);return{browser:no,os:ao,deviceType:po}}},Wa=Mn=>window.matchMedia(Mn).matches;let Nc=br(()=>Fr.detect(navigator.userAgent,zo.from(navigator.userAgentData),Wa));const xl=()=>Nc(),ul=navigator.userAgent,lu=xl(),Gl=lu.browser,Ru=lu.os,xf=lu.deviceType,Hp=ul.indexOf("Windows Phone")!==-1,aa={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:Gl.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!Gl.isIE(),windowsPhone:Hp,browser:{current:Gl.current,version:Gl.version,isChromium:Gl.isChromium,isEdge:Gl.isEdge,isFirefox:Gl.isFirefox,isIE:Gl.isIE,isOpera:Gl.isOpera,isSafari:Gl.isSafari},os:{current:Ru.current,version:Ru.version,isAndroid:Ru.isAndroid,isChromeOS:Ru.isChromeOS,isFreeBSD:Ru.isFreeBSD,isiOS:Ru.isiOS,isLinux:Ru.isLinux,isMacOS:Ru.isMacOS,isSolaris:Ru.isSolaris,isWindows:Ru.isWindows},deviceType:{isDesktop:xf.isDesktop,isiPad:xf.isiPad,isiPhone:xf.isiPhone,isPhone:xf.isPhone,isTablet:xf.isTablet,isTouch:xf.isTouch,isWebView:xf.isWebView}},Qp=/^\s*|\s*$/g,Bu=Mn=>ms(Mn)?"":(""+Mn).replace(Qp,""),Uo=(Mn,Vn)=>Vn?Vn==="array"&&Vc(Mn)?!0:typeof Mn===Vn:Mn!==void 0,cs=(Mn,Vn,Wn={})=>{const jn=xo(Mn)?Mn.split(Vn||","):Mn||[];let Gn=jn.length;for(;Gn--;)Wn[jn[Gn]]={};return Wn},_s=Mr,ar=(Mn,...Vn)=>{for(let Wn=0;WnVn.call(jn,Gn,no,Wn)===!1?!1:(ta(Gn,Vn,Wn,jn),!0)))},Lr={trim:Bu,isArray:Vc,is:Uo,toArray:xc,makeMap:cs,each:zc,map:ad,grep:Bh,inArray:Vu,hasOwn:_s,extend:ar,walk:ta,resolve:(Mn,Vn=window)=>{const Wn=Mn.split(".");for(let jn=0,Gn=Wn.length;jnJo(Mn)?Mn:Mn===""?[]:ad(Mn.split(Vn||","),Bu),_addCacheSuffix:Mn=>{const Vn=aa.cacheSuffix;return Vn&&(Mn+=(Mn.indexOf("?")===-1?"?":"&")+Vn),Mn}},qc=(Mn,Vn,Wn=cr)=>Mn.exists(jn=>Wn(jn,Vn)),Ef=(Mn,Vn,Wn=cr)=>jc(Mn,Vn,Wn).getOr(Mn.isNone()&&Vn.isNone()),ku=Mn=>{const Vn=[],Wn=jn=>{Vn.push(jn)};for(let jn=0;jnMn.isSome()&&Vn.isSome()?zo.some(Wn(Mn.getOrDie(),Vn.getOrDie())):zo.none(),Tm=(Mn,Vn,Wn,jn)=>Mn.isSome()&&Vn.isSome()&&Wn.isSome()?zo.some(jn(Mn.getOrDie(),Vn.getOrDie(),Wn.getOrDie())):zo.none(),El=(Mn,Vn)=>Mn?zo.some(Vn):zo.none(),Hf=typeof window<"u"?window:Function("return this;")(),hu=(Mn,Vn)=>{let Wn=Vn??Hf;for(let jn=0;jn{const Wn=Mn.split(".");return hu(Wn,Vn)},cu=(Mn,Vn)=>Qf(Mn,Vn),Vp=(Mn,Vn)=>{const Wn=cu(Mn,Vn);if(Wn==null)throw new Error(Mn+" not available on this browser");return Wn},ud=Object.getPrototypeOf,vp=Mn=>Vp("HTMLElement",Mn),vc=Mn=>{const Vn=Qf("ownerDocument.defaultView",Mn);return Io(Mn)&&(vp(Vn).prototype.isPrototypeOf(Mn)||/^HTML\w*Element$/.test(ud(Mn).constructor.name))},Am=8,Pm=9,uh=11,Hh=1,A1=3,ql=Mn=>Mn.dom.nodeName.toLowerCase(),dd=Mn=>Mn.dom.nodeType,yd=Mn=>Vn=>dd(Vn)===Mn,mv=Mn=>dd(Mn)===Am||ql(Mn)==="#comment",Du=Mn=>lf(Mn)&&vc(Mn.dom),lf=yd(Hh),qd=yd(A1),Eb=yd(Pm),Tb=yd(uh),Qh=Mn=>Vn=>lf(Vn)&&ql(Vn)===Mn,Xg=(Mn,Vn,Wn)=>{if(xo(Wn)||Go(Wn)||Ys(Wn))Mn.setAttribute(Vn,Wn+"");else throw console.error("Invalid call to Attribute.set. Key ",Vn,":: Value ",Wn,":: Element ",Mn),new Error("Attribute value was not simple")},Gc=(Mn,Vn,Wn)=>{Xg(Mn.dom,Vn,Wn)},im=(Mn,Vn)=>{const Wn=Mn.dom;Rr(Vn,(jn,Gn)=>{Xg(Wn,Gn,jn)})},Tf=(Mn,Vn)=>{const Wn=Mn.dom.getAttribute(Vn);return Wn===null?void 0:Wn},Ld=(Mn,Vn)=>zo.from(Tf(Mn,Vn)),Od=(Mn,Vn)=>{const Wn=Mn.dom;return Wn&&Wn.hasAttribute?Wn.hasAttribute(Vn):!1},Mu=(Mn,Vn)=>{Mn.dom.removeAttribute(Vn)},Vh=Mn=>{const Vn=Mn.dom.attributes;return Vn==null||Vn.length===0},zp=Mn=>ra(Mn.dom.attributes,(Vn,Wn)=>(Vn[Wn.name]=Wn.value,Vn),{}),Tg=(Mn,Vn)=>{const Wn=Tf(Mn,Vn);return Wn===void 0||Wn===""?[]:Wn.split(" ")},Ab=(Mn,Vn,Wn)=>{const Gn=Tg(Mn,Vn).concat([Wn]);return Gc(Mn,Vn,Gn.join(" ")),!0},P1=(Mn,Vn,Wn)=>{const jn=nr(Tg(Mn,Vn),Gn=>Gn!==Wn);return jn.length>0?Gc(Mn,Vn,jn.join(" ")):Mu(Mn,Vn),!1},Yf=Mn=>Mn.dom.classList!==void 0,$1=Mn=>Tg(Mn,"class"),jd=(Mn,Vn)=>Ab(Mn,"class",Vn),$m=(Mn,Vn)=>P1(Mn,"class",Vn),R1=(Mn,Vn)=>Zs($1(Mn),Vn)?$m(Mn,Vn):jd(Mn,Vn),Xm=(Mn,Vn)=>{Yf(Mn)?Mn.dom.classList.add(Vn):jd(Mn,Vn)},Yg=Mn=>{(Yf(Mn)?Mn.dom.classList:$1(Mn)).length===0&&Mu(Mn,"class")},Vf=(Mn,Vn)=>{Yf(Mn)?Mn.dom.classList.remove(Vn):$m(Mn,Vn),Yg(Mn)},Gg=(Mn,Vn)=>{const Wn=Yf(Mn)?Mn.dom.classList.toggle(Vn):R1(Mn,Vn);return Yg(Mn),Wn},yp=(Mn,Vn)=>Yf(Mn)&&Mn.dom.classList.contains(Vn),p0=(Mn,Vn)=>{const jn=(Vn||document).createElement("div");if(jn.innerHTML=Mn,!jn.hasChildNodes()||jn.childNodes.length>1){const Gn="HTML does not have a single root node";throw console.error(Gn,Mn),new Error(Gn)}return zf(jn.childNodes[0])},g0=(Mn,Vn)=>{const jn=(Vn||document).createElement(Mn);return zf(jn)},Wp=(Mn,Vn)=>{const jn=(Vn||document).createTextNode(Mn);return zf(jn)},zf=Mn=>{if(Mn==null)throw new Error("Node cannot be null or undefined");return{dom:Mn}},Cs={fromHtml:p0,fromTag:g0,fromText:Wp,fromDom:zf,fromPoint:(Mn,Vn,Wn)=>zo.from(Mn.dom.elementFromPoint(Vn,Wn)).map(zf)},Up=(Mn,Vn)=>{const Wn=[],jn=no=>(Wn.push(no),Vn(no));let Gn=Vn(Mn);do Gn=Gn.bind(jn);while(Gn.isSome());return Wn},zh=(Mn,Vn)=>{const Wn=Mn.dom;if(Wn.nodeType!==Hh)return!1;{const jn=Wn;if(jn.matches!==void 0)return jn.matches(Vn);if(jn.msMatchesSelector!==void 0)return jn.msMatchesSelector(Vn);if(jn.webkitMatchesSelector!==void 0)return jn.webkitMatchesSelector(Vn);if(jn.mozMatchesSelector!==void 0)return jn.mozMatchesSelector(Vn);throw new Error("Browser lacks native selectors")}},Kg=Mn=>Mn.nodeType!==Hh&&Mn.nodeType!==Pm&&Mn.nodeType!==uh||Mn.childElementCount===0,v0=(Mn,Vn)=>{const Wn=Vn===void 0?document:Vn.dom;return Kg(Wn)?[]:Us(Wn.querySelectorAll(Mn),Cs.fromDom)},Jg=(Mn,Vn)=>{const Wn=Vn===void 0?document:Vn.dom;return Kg(Wn)?zo.none():zo.from(Wn.querySelector(Mn)).map(Cs.fromDom)},Vs=(Mn,Vn)=>Mn.dom===Vn.dom,Dr=(Mn,Vn)=>{const Wn=Mn.dom,jn=Vn.dom;return Wn===jn?!1:Wn.contains(jn)},Tr=Mn=>Cs.fromDom(Mn.dom.ownerDocument),Fa=Mn=>Eb(Mn)?Mn:Tr(Mn),zl=Mn=>Cs.fromDom(Fa(Mn).dom.documentElement),_c=Mn=>Cs.fromDom(Fa(Mn).dom.defaultView),Wc=Mn=>zo.from(Mn.dom.parentNode).map(Cs.fromDom),Uc=Mn=>zo.from(Mn.dom.parentElement).map(Cs.fromDom),D1=(Mn,Vn)=>{const Wn=Yo(Vn)?Vn:hs;let jn=Mn.dom;const Gn=[];for(;jn.parentNode!==null&&jn.parentNode!==void 0;){const no=jn.parentNode,ao=Cs.fromDom(no);if(Gn.push(ao),Wn(ao)===!0)break;jn=no}return Gn},pv=Mn=>{const Vn=Wn=>nr(Wn,jn=>!Vs(Mn,jn));return Wc(Mn).map(Ku).map(Vn).getOr([])},_d=Mn=>zo.from(Mn.dom.previousSibling).map(Cs.fromDom),Wh=Mn=>zo.from(Mn.dom.nextSibling).map(Cs.fromDom),y0=Mn=>nc(Up(Mn,_d)),Id=Mn=>Up(Mn,Wh),Ku=Mn=>Us(Mn.dom.childNodes,Cs.fromDom),Rm=(Mn,Vn)=>{const Wn=Mn.dom.childNodes;return zo.from(Wn[Vn]).map(Cs.fromDom)},iu=Mn=>Rm(Mn,0),am=Mn=>Rm(Mn,Mn.dom.childNodes.length-1),Af=Mn=>Mn.dom.childNodes.length,e1=Mn=>Mn.dom.hasChildNodes(),gv=Mn=>{const Vn=Mn.dom.head;if(Vn==null)throw new Error("Head is not available yet");return Cs.fromDom(Vn)},M1=Mn=>Tb(Mn)&&is(Mn.dom.host),Pb=Yo(Element.prototype.attachShadow)&&Yo(Node.prototype.getRootNode),Op=xs(Pb),Wf=Pb?Mn=>Cs.fromDom(Mn.dom.getRootNode()):Fa,N1=Mn=>M1(Mn)?Mn:gv(Fa(Mn)),Ny=Mn=>M1(Mn)?Mn:Cs.fromDom(Fa(Mn).dom.body),t1=Mn=>{const Vn=Wf(Mn);return M1(Vn)?zo.some(Vn):zo.none()},$b=Mn=>Cs.fromDom(Mn.dom.host),Zp=Mn=>{if(Op()&&is(Mn.target)){const Vn=Cs.fromDom(Mn.target);if(lf(Vn)&&qp(Vn)&&Mn.composed&&Mn.composedPath){const Wn=Mn.composedPath();if(Wn)return qa(Wn)}}return zo.from(Mn.target)},qp=Mn=>is(Mn.dom.shadowRoot),Ag=Mn=>{const Vn=qd(Mn)?Mn.dom.parentNode:Mn.dom;if(Vn==null||Vn.ownerDocument===null)return!1;const Wn=Vn.ownerDocument;return t1(Cs.fromDom(Vn)).fold(()=>Wn.body.contains(Vn),gs(Ag,$b))};var Kc=(Mn,Vn,Wn,jn,Gn)=>Mn(Wn,jn)?zo.some(Wn):Yo(Gn)&&Gn(Wn)?zo.none():Vn(Wn,jn,Gn);const au=(Mn,Vn,Wn)=>{let jn=Mn.dom;const Gn=Yo(Wn)?Wn:hs;for(;jn.parentNode;){jn=jn.parentNode;const no=Cs.fromDom(jn);if(Vn(no))return zo.some(no);if(Gn(no))break}return zo.none()},cf=(Mn,Vn,Wn)=>Kc((Gn,no)=>no(Gn),au,Mn,Vn,Wn),O0=(Mn,Vn)=>{const Wn=Mn.dom;return Wn.parentNode?bv(Cs.fromDom(Wn.parentNode),jn=>!Vs(Mn,jn)&&Vn(jn)):zo.none()},bv=(Mn,Vn)=>{const Wn=Gn=>Vn(Cs.fromDom(Gn));return xa(Mn.dom.childNodes,Wn).map(Cs.fromDom)},tf=(Mn,Vn)=>{const Wn=jn=>{for(let Gn=0;Gnau(Mn,jn=>zh(jn,Vn),Wn),uf=(Mn,Vn)=>Jg(Vn,Mn),cm=(Mn,Vn,Wn)=>Kc((Gn,no)=>zh(Gn,no),lm,Mn,Vn,Wn),Rb=Mn=>cm(Mn,"[contenteditable]"),yl=(Mn,Vn=!1)=>Ag(Mn)?Mn.dom.isContentEditable:Rb(Mn).fold(xs(Vn),Wn=>dh(Wn)==="true"),dh=Mn=>Mn.dom.contentEditable,jp=Mn=>Mn.style!==void 0&&Yo(Mn.style.getPropertyValue),Sd=(Mn,Vn,Wn)=>{if(!xo(Wn))throw console.error("Invalid call to CSS.set. Property ",Vn,":: Value ",Wn,":: Element ",Mn),new Error("CSS value must be a string: "+Wn);jp(Mn)&&Mn.style.setProperty(Vn,Wn)},df=(Mn,Vn)=>{jp(Mn)&&Mn.style.removeProperty(Vn)},vv=(Mn,Vn,Wn)=>{const jn=Mn.dom;Sd(jn,Vn,Wn)},ff=(Mn,Vn)=>{const Wn=Mn.dom;Rr(Vn,(jn,Gn)=>{Sd(Wn,Gn,jn)})},Ju=(Mn,Vn)=>{const Wn=Mn.dom,Gn=window.getComputedStyle(Wn).getPropertyValue(Vn);return Gn===""&&!Ag(Mn)?wh(Wn,Vn):Gn},wh=(Mn,Vn)=>jp(Mn)?Mn.style.getPropertyValue(Vn):"",fd=(Mn,Vn)=>{const Wn=Mn.dom,jn=wh(Wn,Vn);return zo.from(jn).filter(Gn=>Gn.length>0)},Ym=Mn=>{const Vn={},Wn=Mn.dom;if(jp(Wn))for(let jn=0;jn{const Wn=Mn.dom;df(Wn,Vn),qc(Ld(Mn,"style").map(ih),"")&&Mu(Mn,"style")},xu=Mn=>Mn.dom.offsetWidth,ed=(Mn,Vn)=>{Wc(Mn).each(jn=>{jn.dom.insertBefore(Vn.dom,Mn.dom)})},fh=(Mn,Vn)=>{Wh(Mn).fold(()=>{Wc(Mn).each(Gn=>{Fu(Gn,Vn)})},jn=>{ed(jn,Vn)})},Gm=(Mn,Vn)=>{iu(Mn).fold(()=>{Fu(Mn,Vn)},jn=>{Mn.dom.insertBefore(Vn.dom,jn.dom)})},Fu=(Mn,Vn)=>{Mn.dom.appendChild(Vn.dom)},_0=(Mn,Vn)=>{ed(Mn,Vn),Fu(Vn,Mn)},yv=(Mn,Vn)=>{fs(Vn,(Wn,jn)=>{const Gn=jn===0?Mn:Vn[jn-1];fh(Gn,Wn)})},Lc=(Mn,Vn)=>{fs(Vn,Wn=>{Fu(Mn,Wn)})},Dm=Mn=>{Mn.dom.textContent="",fs(Ku(Mn),Vn=>{sc(Vn)})},sc=Mn=>{const Vn=Mn.dom;Vn.parentNode!==null&&Vn.parentNode.removeChild(Vn)},hf=Mn=>{const Vn=Ku(Mn);Vn.length>0&&yv(Mn,Vn),sc(Mn)},um=(Mn,Vn)=>{const jn=(Vn||document).createElement("div");return jn.innerHTML=Mn,Ku(Cs.fromDom(jn))},Km=Mn=>Us(Mn,Cs.fromDom),ss=Mn=>Mn.dom.innerHTML,dm=(Mn,Vn)=>{const jn=Tr(Mn).dom,Gn=Cs.fromDom(jn.createDocumentFragment()),no=um(Vn,jn);Lc(Gn,no),Dm(Mn),Fu(Mn,Gn)},n1=Mn=>{const Vn=Cs.fromTag("div"),Wn=Cs.fromDom(Mn.dom.cloneNode(!0));return Fu(Vn,Wn),ss(Vn)},Ch=(Mn,Vn,Wn,jn,Gn,no,ao)=>({target:Mn,x:Vn,y:Wn,stop:jn,prevent:Gn,kill:no,raw:ao}),Xc=Mn=>{const Vn=Cs.fromDom(Zp(Mn).getOr(Mn.target)),Wn=()=>Mn.stopPropagation(),jn=()=>Mn.preventDefault(),Gn=ko(jn,Wn);return Ch(Vn,Mn.clientX,Mn.clientY,Wn,jn,Gn,Mn)},Ov=(Mn,Vn)=>Wn=>{Mn(Wn)&&Vn(Xc(Wn))},Db=(Mn,Vn,Wn,jn,Gn)=>{const no=Ov(Wn,jn);return Mn.dom.addEventListener(Vn,no,Gn),{unbind:ws(Mm,Mn,Vn,no,Gn)}},S0=(Mn,Vn,Wn,jn)=>Db(Mn,Vn,Wn,jn,!1),Mm=(Mn,Vn,Wn,jn)=>{Mn.dom.removeEventListener(Vn,Wn,jn)},Eo=(Mn,Vn)=>({left:Mn,top:Vn,translate:(jn,Gn)=>Eo(Mn+jn,Vn+Gn)}),Bo=Eo,Ko=Mn=>{const Vn=Mn.getBoundingClientRect();return Bo(Vn.left,Vn.top)},Ss=(Mn,Vn)=>Mn!==void 0?Mn:Vn!==void 0?Vn:0,Rs=Mn=>{const Vn=Mn.dom.ownerDocument,Wn=Vn.body,jn=Vn.defaultView,Gn=Vn.documentElement;if(Wn===Mn.dom)return Bo(Wn.offsetLeft,Wn.offsetTop);const no=Ss(jn==null?void 0:jn.pageYOffset,Gn.scrollTop),ao=Ss(jn==null?void 0:jn.pageXOffset,Gn.scrollLeft),po=Ss(Gn.clientTop,Wn.clientTop),vo=Ss(Gn.clientLeft,Wn.clientLeft);return $r(Mn).translate(ao-vo,no-po)},$r=Mn=>{const Vn=Mn.dom,jn=Vn.ownerDocument.body;return jn===Vn?Bo(jn.offsetLeft,jn.offsetTop):Ag(Mn)?Ko(Vn):Bo(0,0)},Ea=Mn=>{const Vn=Mn!==void 0?Mn.dom:document,Wn=Vn.body.scrollLeft||Vn.documentElement.scrollLeft,jn=Vn.body.scrollTop||Vn.documentElement.scrollTop;return Bo(Wn,jn)},ll=(Mn,Vn,Wn)=>{const Gn=(Wn!==void 0?Wn.dom:document).defaultView;Gn&&Gn.scrollTo(Mn,Vn)},nl=(Mn,Vn)=>{xl().browser.isSafari()&&Yo(Mn.dom.scrollIntoViewIfNeeded)?Mn.dom.scrollIntoViewIfNeeded(!1):Mn.dom.scrollIntoView(Vn)},Xa=Mn=>{const Vn=Mn===void 0?window:Mn;return xl().browser.isFirefox()?zo.none():zo.from(Vn.visualViewport)},Nu=(Mn,Vn,Wn,jn)=>({x:Mn,y:Vn,width:Wn,height:jn,right:Mn+Wn,bottom:Vn+jn}),zu=Mn=>{const Vn=Mn===void 0?window:Mn,Wn=Vn.document,jn=Ea(Cs.fromDom(Wn));return Xa(Vn).fold(()=>{const Gn=Vn.document.documentElement,no=Gn.clientWidth,ao=Gn.clientHeight;return Nu(jn.left,jn.top,no,ao)},Gn=>Nu(Math.max(Gn.pageLeft,jn.left),Math.max(Gn.pageTop,jn.top),Gn.width,Gn.height))},kh=(Mn,Vn)=>nr(Ku(Mn),Vn),Sp=(Mn,Vn)=>{let Wn=[];return fs(Ku(Mn),jn=>{Vn(jn)&&(Wn=Wn.concat([jn])),Wn=Wn.concat(Sp(jn,Vn))}),Wn},mf=(Mn,Vn)=>v0(Vn,Mn),fS=(Mn,Vn,Wn)=>lm(Mn,Vn,Wn).isSome();class mu{constructor(Vn,Wn){this.node=Vn,this.rootNode=Wn,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}current(){return this.node}next(Vn){return this.node=this.findSibling(this.node,"firstChild","nextSibling",Vn),this.node}prev(Vn){return this.node=this.findSibling(this.node,"lastChild","previousSibling",Vn),this.node}prev2(Vn){return this.node=this.findPreviousNode(this.node,Vn),this.node}findSibling(Vn,Wn,jn,Gn){if(Vn){if(!Gn&&Vn[Wn])return Vn[Wn];if(Vn!==this.rootNode){let no=Vn[jn];if(no)return no;for(let ao=Vn.parentNode;ao&&ao!==this.rootNode;ao=ao.parentNode)if(no=ao[jn],no)return no}}}findPreviousNode(Vn,Wn){if(Vn){const jn=Vn.previousSibling;if(this.rootNode&&jn===this.rootNode)return;if(jn){if(!Wn){for(let no=jn.lastChild;no;no=no.lastChild)if(!no.lastChild)return no}return jn}const Gn=Vn.parentNode;if(Gn&&Gn!==this.rootNode)return Gn}}}const Ta=Mn=>Vn=>!!Vn&&Vn.nodeType===Mn,Xp=Mn=>!!Mn&&!Object.getPrototypeOf(Mn),Oa=Ta(1),pf=Mn=>Oa(Mn)&&Du(Cs.fromDom(Mn)),$O=Mn=>Oa(Mn)&&Mn.namespaceURI==="http://www.w3.org/2000/svg",Yp=Mn=>{const Vn=Mn.toLowerCase();return Wn=>is(Wn)&&Wn.nodeName.toLowerCase()===Vn},Ad=Mn=>{const Vn=Mn.map(Wn=>Wn.toLowerCase());return Wn=>{if(Wn&&Wn.nodeName){const jn=Wn.nodeName.toLowerCase();return Zs(Vn,jn)}return!1}},Pg=(Mn,Vn)=>{const Wn=Vn.toLowerCase().split(" ");return jn=>{if(Oa(jn)){const Gn=jn.ownerDocument.defaultView;if(Gn)for(let no=0;noVn=>Oa(Vn)&&Vn.hasAttribute(Mn),nf=(Mn,Vn)=>Wn=>Oa(Wn)&&Wn.getAttribute(Mn)===Vn,Jm=Mn=>Oa(Mn)&&Mn.hasAttribute("data-mce-bogus"),_v=Mn=>Oa(Mn)&&Mn.getAttribute("data-mce-bogus")==="all",Gp=Mn=>Oa(Mn)&&Mn.tagName==="TABLE",Sv=Mn=>Vn=>!!(pf(Vn)&&(Vn.contentEditable===Mn||Vn.getAttribute("data-mce-contenteditable")===Mn)),$g=Ad(["textarea","input"]),Ir=Ta(3),RO=Ta(4),Rg=Ta(7),Dg=Ta(8),Nm=Ta(9),Lu=Ta(11),Ec=Yp("br"),td=Yp("img"),Gf=Sv("true"),jl=Sv("false"),L1=Ad(["td","th"]),Bd=Ad(["td","th","caption"]),pu=Ad(["video","audio","object","embed"]),C0=Yp("li"),Er=Yp("details"),Kf=Yp("summary"),k0="\uFEFF",hc=" ",hd=Mn=>Mn===k0,wv=Mn=>Mn.replace(/\uFEFF/g,""),tp=((Mn,Vn)=>{const Wn=no=>{if(!Mn(no))throw new Error("Can only get "+Vn+" value of a "+Vn+" node");return jn(no).getOr("")},jn=no=>Mn(no)?zo.from(no.dom.nodeValue):zo.none();return{get:Wn,getOption:jn,set:(no,ao)=>{if(!Mn(no))throw new Error("Can only set raw "+Vn+" value of a "+Vn+" node");no.dom.nodeValue=ao}}})(qd,"text"),fm=Mn=>tp.get(Mn),Mb=Mn=>tp.getOption(Mn),Pf=(Mn,Vn)=>tp.set(Mn,Vn),Tc=["td","th"],Fd=["thead","tbody","tfoot"],Mg=["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"],$f=["li","dd","dt"],Ly=["ul","ol","dl"],I1=["pre","script","textarea","style"],Ng=Mn=>{let Vn;return Wn=>(Vn=Vn||Zl(Mn,Qs),Mr(Vn,ql(Wn)))},hh=Mn=>ql(Mn)==="table",np=Mn=>lf(Mn)&&ql(Mn)==="br",Gs=Ng(Mg),xh=Ng(Ly),Lm=Ng($f),mh=Ng(Fd),Eh=Ng(Tc),Xd=Ng(I1),Hd=Mn=>{const Vn=[];let Wn=Mn.dom;for(;Wn;)Vn.push(Cs.fromDom(Wn)),Wn=Wn.lastChild;return Vn},Iy=Mn=>{const Vn=mf(Mn,"br"),Wn=nr(Hd(Mn).slice(-1),np);Vn.length===Wn.length&&fs(Wn,sc)},Th=()=>{const Mn=Cs.fromTag("br");return Gc(Mn,"data-mce-bogus","1"),Mn},Kp=Mn=>{Dm(Mn),Fu(Mn,Th())},Ua=(Mn,Vn)=>{am(Mn).each(Wn=>{_d(Wn).each(jn=>{Vn.isBlock(ql(Mn))&&np(Wn)&&Vn.isBlock(ql(jn))&&sc(Wn)})})},_o=k0,Po=hd,Xo=wv,as=Mn=>Mn.insertContent(_o,{preserve_zwsp:!0}),Ms=Oa,vr=Ir,zr=Mn=>(vr(Mn)&&(Mn=Mn.parentNode),Ms(Mn)&&Mn.hasAttribute("data-mce-caret")),Jr=Mn=>vr(Mn)&&Po(Mn.data),La=Mn=>zr(Mn)||Jr(Mn),Ol=Mn=>Mn.firstChild!==Mn.lastChild||!Ec(Mn.firstChild),Xu=(Mn,Vn)=>{var Wn;const Gn=((Wn=Mn.ownerDocument)!==null&&Wn!==void 0?Wn:document).createTextNode(_o),no=Mn.parentNode;if(Vn){const ao=Mn.previousSibling;if(vr(ao)){if(La(ao))return ao;if(hm(ao))return ao.splitText(ao.data.length-1)}no==null||no.insertBefore(Gn,Mn)}else{const ao=Mn.nextSibling;if(vr(ao)){if(La(ao))return ao;if(Jf(ao))return ao.splitText(1),ao}Mn.nextSibling?no==null||no.insertBefore(Gn,Mn.nextSibling):no==null||no.appendChild(Gn)}return Gn},Ac=Mn=>{const Vn=Mn.container();return Ir(Vn)?Vn.data.charAt(Mn.offset())===_o||Mn.isAtStart()&&Jr(Vn.previousSibling):!1},gu=Mn=>{const Vn=Mn.container();return Ir(Vn)?Vn.data.charAt(Mn.offset()-1)===_o||Mn.isAtEnd()&&Jr(Vn.nextSibling):!1},Uh=(Mn,Vn,Wn)=>{var jn;const no=((jn=Vn.ownerDocument)!==null&&jn!==void 0?jn:document).createElement(Mn);no.setAttribute("data-mce-caret",Wn?"before":"after"),no.setAttribute("data-mce-bogus","all"),no.appendChild(Th().dom);const ao=Vn.parentNode;return Wn?ao==null||ao.insertBefore(no,Vn):Vn.nextSibling?ao==null||ao.insertBefore(no,Vn.nextSibling):ao==null||ao.appendChild(no),no},Jf=Mn=>vr(Mn)&&Mn.data[0]===_o,hm=Mn=>vr(Mn)&&Mn.data[Mn.data.length-1]===_o,Jp=Mn=>{var Vn;const Wn=Mn.getElementsByTagName("br"),jn=Wn[Wn.length-1];Jm(jn)&&((Vn=jn.parentNode)===null||Vn===void 0||Vn.removeChild(jn))},wp=Mn=>Mn&&Mn.hasAttribute("data-mce-caret")?(Jp(Mn),Mn.removeAttribute("data-mce-caret"),Mn.removeAttribute("data-mce-bogus"),Mn.removeAttribute("style"),Mn.removeAttribute("data-mce-style"),Mn.removeAttribute("_moz_abspos"),Mn):null,B1=Mn=>zr(Mn.startContainer),Sc=Gf,F1=jl,x0=Ec,nd=Ir,mm=Ad(["script","style","textarea"]),Nb=Ad(["img","input","textarea","hr","iframe","video","audio","object","embed"]),H1=Ad(["table"]),Fl=La,Xl=Mn=>Fl(Mn)?!1:nd(Mn)?!mm(Mn.parentNode):Nb(Mn)||x0(Mn)||H1(Mn)||Rf(Mn),Qd=Mn=>Oa(Mn)&&Mn.getAttribute("unselectable")==="true",Rf=Mn=>!Qd(Mn)&&F1(Mn),Cv=(Mn,Vn)=>{for(let Wn=Mn.parentNode;Wn&&Wn!==Vn;Wn=Wn.parentNode){if(Rf(Wn))return!1;if(Sc(Wn))return!0}return!0},eg=Mn=>Rf(Mn)?!ra(kc(Mn.getElementsByTagName("*")),(Vn,Wn)=>Vn||Sc(Wn),!1):!1,Wu=Mn=>Nb(Mn)||eg(Mn),pm=(Mn,Vn)=>Xl(Mn)&&Cv(Mn,Vn),op=/^[ \t\r\n]*$/,Q1=Mn=>op.test(Mn),o1=Mn=>{for(const Vn of Mn)if(!hd(Vn))return!1;return!0},E0=Mn=>" \f \v".indexOf(Mn)!==-1,Lg=Mn=>Mn===` +`||Mn==="\r",lC=(Mn,Vn)=>Vn=0?Lg(Mn[Vn]):!1,V1=(Mn,Vn=4,Wn=!0,jn=!0)=>{const Gn=Jd(" ",Vn),no=Mn.replace(/\t/g,Gn);return ra(no,(po,vo)=>E0(vo)||vo===hc?po.pcIsSpace||po.str===""&&Wn||po.str.length===no.length-1&&jn||lC(no,po.str.length+1)?{pcIsSpace:!1,str:po.str+hc}:{pcIsSpace:!0,str:po.str+" "}:{pcIsSpace:Lg(vo),str:po.str+vo},{pcIsSpace:!1,str:""}).str},By=(Mn,Vn)=>{const Wn=Cs.fromDom(Vn),jn=Cs.fromDom(Mn);return fS(jn,"pre,code",ws(Vs,Wn))},z1=(Mn,Vn)=>Ir(Mn)&&Q1(Mn.data)&&!By(Mn,Vn),Pd=Mn=>Oa(Mn)&&Mn.nodeName==="A"&&!Mn.hasAttribute("href")&&(Mn.hasAttribute("name")||Mn.hasAttribute("id")),Cp=(Mn,Vn)=>Xl(Mn)&&!z1(Mn,Vn)||Pd(Mn)||tg(Mn),tg=w0("data-mce-bookmark"),W1=w0("data-mce-bogus"),U1=nf("data-mce-bogus","all"),T0=Mn=>Uc(Cs.fromDom(Mn)).exists(Vn=>!yl(Vn)),Im=(Mn,Vn)=>{let Wn=0;if(Cp(Mn,Mn))return!1;{let jn=Mn.firstChild;if(!jn)return!0;const Gn=new mu(jn,Mn);do{if(Vn){if(U1(jn)){jn=Gn.next(!0);continue}if(W1(jn)){jn=Gn.next();continue}}if(Gf(jn)&&T0(jn))return!1;if(Ec(jn)){Wn++,jn=Gn.next();continue}if(Cp(jn,Mn))return!1;jn=Gn.next()}while(jn);return Wn<=1}},md=(Mn,Vn=!0)=>Im(Mn.dom,Vn),ng=Mn=>Mn.toLowerCase()==="svg",DO=Mn=>ng(Mn.nodeName),Fy=Mn=>(Mn==null?void 0:Mn.nodeName)==="svg"?"svg":"html",Hy=["svg"],Z1=()=>{let Mn=[];const Vn=()=>Mn[Mn.length-1];return{track:no=>{DO(no)&&Mn.push(no);let ao=Vn();return ao&&!ao.contains(no)&&(Mn.pop(),ao=Vn()),Fy(ao)},current:()=>Fy(Vn()),reset:()=>{Mn=[]}}},Ah="data-mce-block",kp=Mn=>nr(Al(Mn),Vn=>!/[A-Z]/.test(Vn)),s1=Mn=>Us(kp(Mn),Vn=>`${Vn}:`+Us(Hy,Wn=>`not(${Wn} ${Vn})`).join(":")).join(","),Ig=(Mn,Vn)=>is(Vn.querySelector(Mn))?(Vn.setAttribute(Ah,"true"),Vn.getAttribute("data-mce-selected")==="inline-boundary"&&Vn.removeAttribute("data-mce-selected"),!0):(Vn.removeAttribute(Ah),!1),Zh=(Mn,Vn)=>{const Wn=s1(Mn.getTransparentElements()),jn=s1(Mn.getBlockElements());return nr(Vn.querySelectorAll(Wn),Gn=>Ig(jn,Gn))},xp=(Mn,Vn)=>{var Wn;const jn=Vn?"lastChild":"firstChild";for(let Gn=Mn[jn];Gn;Gn=Gn[jn])if(md(Cs.fromDom(Gn))){(Wn=Gn.parentNode)===null||Wn===void 0||Wn.removeChild(Gn);return}},q1=(Mn,Vn)=>{const Wn=document.createRange(),jn=Mn.parentNode;if(jn){Wn.setStartBefore(Mn),Wn.setEndBefore(Vn);const Gn=Wn.extractContents();xp(Gn,!0),Wn.setStartAfter(Vn),Wn.setEndAfter(Mn);const no=Wn.extractContents();xp(no,!1),md(Cs.fromDom(Gn))||jn.insertBefore(Gn,Mn),md(Cs.fromDom(Vn))||jn.insertBefore(Vn,Mn),md(Cs.fromDom(no))||jn.insertBefore(no,Mn),jn.removeChild(Mn)}},hS=(Mn,Vn,Wn)=>{const jn=Mn.getBlockElements(),Gn=Cs.fromDom(Vn),no=po=>ql(po)in jn,ao=po=>Vs(po,Gn);fs(Km(Wn),po=>{au(po,no,ao).each(vo=>{const Ao=kh(po,Fo=>no(Fo)&&!Mn.isValidChild(ql(vo),ql(Fo)));if(Ao.length>0){const Fo=Uc(vo);fs(Ao,Qo=>{au(Qo,no,ao).each(qo=>{q1(qo.dom,Qo.dom)})}),Fo.each(Qo=>Zh(Mn,Qo.dom))}})})},MO=(Mn,Vn,Wn)=>{fs([...Wn,...Wl(Mn,Vn)?[Vn]:[]],jn=>fs(mf(Cs.fromDom(jn),jn.nodeName.toLowerCase()),Gn=>{Qa(Mn,Gn.dom)&&hf(Gn)}))},kv=(Mn,Vn)=>{const Wn=Zh(Mn,Vn);hS(Mn,Vn,Wn),MO(Mn,Vn,Wn)},j1=(Mn,Vn)=>{if(Tv(Mn,Vn)){const Wn=s1(Mn.getBlockElements());Ig(Wn,Vn)}},xv=(Mn,Vn,Wn)=>{const jn=no=>Vs(no,Cs.fromDom(Vn)),Gn=D1(Cs.fromDom(Wn),jn);Fc(Gn,Gn.length-2).filter(lf).fold(()=>kv(Mn,Vn),no=>kv(Mn,no.dom))},NO=Mn=>Mn.hasAttribute(Ah),Ev=(Mn,Vn)=>Mr(Mn.getTransparentElements(),Vn),Tv=(Mn,Vn)=>Oa(Vn)&&Ev(Mn,Vn.nodeName),Wl=(Mn,Vn)=>Tv(Mn,Vn)&&NO(Vn),Qa=(Mn,Vn)=>Tv(Mn,Vn)&&!NO(Vn),og=(Mn,Vn)=>Vn.type===1&&Ev(Mn,Vn.name)&&xo(Vn.attr(Ah)),Av=xl().browser,Lb=Mn=>xa(Mn,lf),T2=Mn=>Av.isFirefox()&&ql(Mn)==="table"?Lb(Ku(Mn)).filter(Vn=>ql(Vn)==="caption").bind(Vn=>Lb(Id(Vn)).map(Wn=>{const jn=Wn.dom.offsetTop,Gn=Vn.dom.offsetTop,no=Vn.dom.offsetHeight;return jn<=Gn?-no:0})).getOr(0):0,LO=(Mn,Vn)=>Mn.children&&Zs(Mn.children,Vn),Jc=(Mn,Vn,Wn)=>{let jn=0,Gn=0;const no=Mn.ownerDocument;if(Wn=Wn||Mn,Vn){if(Wn===Mn&&Vn.getBoundingClientRect&&Ju(Cs.fromDom(Mn),"position")==="static"){const po=Vn.getBoundingClientRect();return jn=po.left+(no.documentElement.scrollLeft||Mn.scrollLeft)-no.documentElement.clientLeft,Gn=po.top+(no.documentElement.scrollTop||Mn.scrollTop)-no.documentElement.clientTop,{x:jn,y:Gn}}let ao=Vn;for(;ao&&ao!==Wn&&ao.nodeType&&!LO(ao,Wn);){const po=ao;jn+=po.offsetLeft||0,Gn+=po.offsetTop||0,ao=po.offsetParent}for(ao=Vn.parentNode;ao&&ao!==Wn&&ao.nodeType&&!LO(ao,Wn);)jn-=ao.scrollLeft||0,Gn-=ao.scrollTop||0,ao=ao.parentNode;Gn+=T2(Cs.fromDom(Vn))}return{x:jn,y:Gn}},IO=(Mn,Vn={})=>{let Wn=0;const jn={},Gn=Cs.fromDom(Mn),no=Fa(Gn),ao=Ls=>{Vn.referrerPolicy=Ls},po=Ls=>{Vn.contentCssCors=Ls},vo=Ls=>{Fu(N1(Gn),Ls)},Ao=Ls=>{const zs=N1(Gn);uf(zs,"#"+Ls).each(sc)},Fo=Ls=>Ma(jn,Ls).getOrThunk(()=>({id:"mce-u"+Wn++,passed:[],failed:[],count:0})),Qo=Ls=>new Promise((zs,Hs)=>{let tr;const Pr=Lr._addCacheSuffix(Ls),Ur=Fo(Pr);jn[Pr]=Ur,Ur.count++;const fa=(wa,Va)=>{fs(wa,ha),Ur.status=Va,Ur.passed=[],Ur.failed=[],tr&&(tr.onload=null,tr.onerror=null,tr=null)},yr=()=>fa(Ur.passed,2),fr=()=>fa(Ur.failed,3);if(zs&&Ur.passed.push(zs),Hs&&Ur.failed.push(Hs),Ur.status===1)return;if(Ur.status===2){yr();return}if(Ur.status===3){fr();return}Ur.status=1;const Ar=Cs.fromTag("link",no.dom);im(Ar,{rel:"stylesheet",type:"text/css",id:Ur.id}),Vn.contentCssCors&&Gc(Ar,"crossOrigin","anonymous"),Vn.referrerPolicy&&Gc(Ar,"referrerpolicy",Vn.referrerPolicy),tr=Ar.dom,tr.onload=yr,tr.onerror=fr,vo(Ar),Gc(Ar,"href",Pr)}),qo=(Ls,zs)=>{const Hs=Fo(Ls);jn[Ls]=Hs,Hs.count++;const tr=Cs.fromTag("style",no.dom);im(tr,{rel:"stylesheet",type:"text/css",id:Hs.id}),tr.dom.innerHTML=zs,vo(tr)},ds=Ls=>Promise.allSettled(Us(Ls,Hs=>Qo(Hs).then(xs(Hs)))).then(Hs=>{const tr=Vr(Hs,Pr=>Pr.status==="fulfilled");return tr.fail.length>0?Promise.reject(Us(tr.fail,Pr=>Pr.reason)):Us(tr.pass,Pr=>Pr.value)}),bs=Ls=>{const zs=Lr._addCacheSuffix(Ls);Ma(jn,zs).each(Hs=>{--Hs.count===0&&(delete jn[zs],Ao(Hs.id))})};return{load:Qo,loadRawCss:qo,loadAll:ds,unload:bs,unloadRawCss:Ls=>{Ma(jn,Ls).each(zs=>{--zs.count===0&&(delete jn[Ls],Ao(zs.id))})},unloadAll:Ls=>{fs(Ls,zs=>{bs(zs)})},_setReferrerPolicy:ao,_setContentCssCors:po}},mS=(()=>{const Mn=new WeakMap;return{forElement:(Wn,jn)=>{const no=Wf(Wn).dom;return zo.from(Mn.get(no)).getOrThunk(()=>{const ao=IO(no,jn);return Mn.set(no,ao),ao})}}})(),wr=Mn=>Mn.nodeName.toLowerCase()==="span",sg=(Mn,Vn,Wn)=>is(Mn)&&(Cp(Mn,Vn)||Wn.isInline(Mn.nodeName.toLowerCase())),cC=(Mn,Vn,Wn)=>{const jn=new mu(Mn,Vn).prev(!1),Gn=new mu(Mn,Vn).next(!1),no=os(jn)||sg(jn,Vn,Wn),ao=os(Gn)||sg(Gn,Vn,Wn);return no&&ao},Pv=Mn=>wr(Mn)&&Mn.getAttribute("data-mce-type")==="bookmark",A2=(Mn,Vn,Wn)=>Ir(Mn)&&Mn.data.length>0&&cC(Mn,Vn,Wn),A0=Mn=>Oa(Mn)?Mn.childNodes.length>0:!1,pS=Mn=>Lu(Mn)||Nm(Mn),X1=(Mn,Vn,Wn,jn)=>{var Gn;const no=jn||Vn;if(Oa(Vn)&&Pv(Vn))return Vn;const ao=Vn.childNodes;for(let po=ao.length-1;po>=0;po--)X1(Mn,ao[po],Wn,no);if(Oa(Vn)){const po=Vn.childNodes;po.length===1&&Pv(po[0])&&((Gn=Vn.parentNode)===null||Gn===void 0||Gn.insertBefore(po[0],Vn))}return!pS(Vn)&&!Cp(Vn,no)&&!A0(Vn)&&!A2(Vn,no,Wn)&&Mn.remove(Vn),Vn},Y1=Lr.makeMap,rg=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,eu=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ig=/[<>&\"\']/g,$v=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,qh={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},Ll={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},Rv={"<":"<",">":">","&":"&",""":'"',"'":"'"},G1=Mn=>{const Vn=Cs.fromTag("div").dom;return Vn.innerHTML=Mn,Vn.textContent||Vn.innerText||Mn},Ib=(Mn,Vn)=>{const Wn={};if(Mn){const jn=Mn.split(",");Vn=Vn||10;for(let Gn=0;GnMn.replace(Vn?rg:eu,Wn=>Ll[Wn]||Wn),uC=Mn=>(""+Mn).replace(ig,Vn=>Ll[Vn]||Vn),Ph=(Mn,Vn)=>Mn.replace(Vn?rg:eu,Wn=>Wn.length>1?"&#"+((Wn.charCodeAt(0)-55296)*1024+(Wn.charCodeAt(1)-56320)+65536)+";":Ll[Wn]||"&#"+Wn.charCodeAt(0)+";"),r1=(Mn,Vn,Wn)=>{const jn=Wn||BO;return Mn.replace(Vn?rg:eu,Gn=>Ll[Gn]||jn[Gn]||Gn)},P0={encodeRaw:Vy,encodeAllRaw:uC,encodeNumeric:Ph,encodeNamed:r1,getEncodeFunc:(Mn,Vn)=>{const Wn=Ib(Vn)||BO,jn=(ao,po)=>ao.replace(po?rg:eu,vo=>Ll[vo]!==void 0?Ll[vo]:Wn[vo]!==void 0?Wn[vo]:vo.length>1?"&#"+((vo.charCodeAt(0)-55296)*1024+(vo.charCodeAt(1)-56320)+65536)+";":"&#"+vo.charCodeAt(0)+";"),Gn=(ao,po)=>r1(ao,po,Wn),no=Y1(Mn.replace(/\+/g,","));return no.named&&no.numeric?jn:no.named?Vn?Gn:r1:no.numeric?Ph:Vy},decode:Mn=>Mn.replace($v,(Vn,Wn)=>Wn?(Wn.charAt(0).toLowerCase()==="x"?Wn=parseInt(Wn.substr(1),16):Wn=parseInt(Wn,10),Wn>65535?(Wn-=65536,String.fromCharCode(55296+(Wn>>10),56320+(Wn&1023))):qh[Wn]||String.fromCharCode(Wn)):Rv[Vn]||BO[Vn]||G1(Vn))},Uf=(Mn,Vn)=>(Mn=Lr.trim(Mn),Mn?Mn.split(Vn||" "):[]),ba=Mn=>new RegExp("^"+Mn.replace(/([?+*])/g,".$1")+"$"),P2=Mn=>{const Vn=/^(~)?(.+)$/;return cc(Uf(Mn,","),Wn=>{const jn=Vn.exec(Wn);if(jn){const Gn=jn[1]==="~",no=Gn?"span":"div",ao=jn[2];return[{inline:Gn,cloneName:no,name:ao}]}else return[]})},gS=Mn=>{let Vn,Wn,jn;if(Vn="id accesskey class dir lang style tabindex title role",Wn="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",jn="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment",Mn!=="html4"){const no="a ins del canvas map";Vn+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",Wn+=" article aside details dialog figure main header footer hgroup section nav "+no,jn+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen svg"}Mn!=="html5-strict"&&(Vn+=" xml:lang",jn=[jn,"acronym applet basefont big font strike tt"].join(" "),Wn=[Wn,"center dir isindex noframes"].join(" "));const Gn=[Wn,jn].join(" ");return{globalAttributes:Vn,blockContent:Wn,phrasingContent:jn,flowContent:Gn}},K1=Mn=>{const{globalAttributes:Vn,phrasingContent:Wn,flowContent:jn}=gS(Mn),Gn={},no=(vo,Ao,Fo)=>{Gn[vo]={attributes:Zl(Ao,xs({})),attributesOrder:Ao,children:Zl(Fo,xs({}))}},ao=(vo,Ao="",Fo="")=>{const Qo=Uf(Fo),qo=Uf(vo);let ds=qo.length;const bs=Uf([Vn,Ao].join(" "));for(;ds--;)no(qo[ds],bs.slice(),Qo)},po=(vo,Ao)=>{const Fo=Uf(vo),Qo=Uf(Ao);let qo=Fo.length;for(;qo--;){const ds=Gn[Fo[qo]];for(let bs=0,ls=Qo.length;bs{ao(Fo,"",Wn)}),fs(Uf("center dir isindex noframes"),Fo=>{ao(Fo,"",jn)})),ao("html","manifest","head body"),ao("head","","base command link meta noscript script style title"),ao("title hr noscript br"),ao("base","href target"),ao("link","href rel media hreflang type sizes hreflang"),ao("meta","name http-equiv content charset"),ao("style","media type scoped"),ao("script","src async defer type charset"),ao("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",jn),ao("dd div","",jn),ao("address dt caption","",Mn==="html4"?Wn:jn),ao("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",Wn),ao("blockquote","cite",jn),ao("ol","reversed start type","li"),ao("ul","","li"),ao("li","value",jn),ao("dl","","dt dd"),ao("a","href target rel media hreflang type",Mn==="html4"?Wn:jn),ao("q","cite",Wn),ao("ins del","cite datetime",jn),ao("img","src sizes srcset alt usemap ismap width height"),ao("iframe","src name width height",jn),ao("embed","src type width height"),ao("object","data type typemustmatch name usemap form width height",[jn,"param"].join(" ")),ao("param","name value"),ao("map","name",[jn,"area"].join(" ")),ao("area","alt coords shape href target rel media hreflang type"),ao("table","border","caption colgroup thead tfoot tbody tr"+(Mn==="html4"?" col":"")),ao("colgroup","span","col"),ao("col","span"),ao("tbody thead tfoot","","tr"),ao("tr","","td th"),ao("td","colspan rowspan headers",jn),ao("th","colspan rowspan headers scope abbr",jn),ao("form","accept-charset action autocomplete enctype method name novalidate target",jn),ao("fieldset","disabled form name",[jn,"legend"].join(" ")),ao("label","form for",Wn),ao("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),ao("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value",Mn==="html4"?jn:Wn),ao("select","disabled form multiple name required size","option optgroup"),ao("optgroup","disabled label","option"),ao("option","disabled label selected value"),ao("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),ao("menu","type label",[jn,"li"].join(" ")),ao("noscript","",jn),Mn!=="html4"&&(ao("wbr"),ao("ruby","",[Wn,"rt rp"].join(" ")),ao("figcaption","",jn),ao("mark rt rp bdi","",Wn),ao("summary","",[Wn,"h1 h2 h3 h4 h5 h6"].join(" ")),ao("canvas","width height",jn),ao("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[jn,"track source"].join(" ")),ao("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[jn,"track source"].join(" ")),ao("picture","","img source"),ao("source","src srcset type media sizes"),ao("track","kind src srclang label default"),ao("datalist","",[Wn,"option"].join(" ")),ao("article section nav aside main header footer","",jn),ao("hgroup","","h1 h2 h3 h4 h5 h6"),ao("figure","",[jn,"figcaption"].join(" ")),ao("time","datetime",Wn),ao("dialog","open",jn),ao("command","type label icon disabled checked radiogroup command"),ao("output","for form name",Wn),ao("progress","value max",Wn),ao("meter","value min max low high optimum",Wn),ao("details","open",[jn,"summary"].join(" ")),ao("keygen","autofocus challenge disabled form keytype name"),no("svg","id tabindex lang xml:space class style x y width height viewBox preserveAspectRatio zoomAndPan transform".split(" "),[])),Mn!=="html5-strict"&&(po("script","language xml:space"),po("style","xml:space"),po("object","declare classid code codebase codetype archive standby align border hspace vspace"),po("embed","align name hspace vspace"),po("param","valuetype type"),po("a","charset name rev shape coords"),po("br","clear"),po("applet","codebase archive code object alt name width height align hspace vspace"),po("img","name longdesc align border hspace vspace"),po("iframe","longdesc frameborder marginwidth marginheight scrolling align"),po("font basefont","size color face"),po("input","usemap align"),po("select"),po("textarea"),po("h1 h2 h3 h4 h5 h6 div p legend caption","align"),po("ul","type compact"),po("li","type"),po("ol dl menu dir","compact"),po("pre","width xml:space"),po("hr","align noshade size width"),po("isindex","prompt"),po("table","summary width frame rules cellspacing cellpadding align bgcolor"),po("col","width align char charoff valign"),po("colgroup","width align char charoff valign"),po("thead","align char charoff valign"),po("tr","align char charoff valign bgcolor"),po("th","axis align char charoff valign nowrap bgcolor width height"),po("form","accept"),po("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),po("tfoot","align char charoff valign"),po("tbody","align char charoff valign"),po("area","nohref"),po("body","background bgcolor text link vlink alink")),Mn!=="html4"&&(po("input button select textarea","autofocus"),po("input textarea","placeholder"),po("a","download"),po("link script img","crossorigin"),po("img","loading"),po("iframe","sandbox seamless allow allowfullscreen loading")),Mn!=="html4"&&fs([Gn.video,Gn.audio],vo=>{delete vo.children.audio,delete vo.children.video}),fs(Uf("a form meter progress dfn"),vo=>{Gn[vo]&&delete Gn[vo].children[vo]}),delete Gn.caption.children.table,delete Gn.script,Gn},gm=Mn=>Mn==="-"?"remove":"add",J1=Mn=>{const Vn=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;return cc(Uf(Mn,","),Wn=>{const jn=Vn.exec(Wn);if(jn){const Gn=jn[1],no=Gn?gm(Gn):"replace",ao=jn[2],po=Uf(jn[3],"|");return[{operation:no,name:ao,validChildren:po}]}else return[]})},Dv=(Mn,Vn)=>{const Wn=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/,jn=/[*?+]/,{attributes:Gn,attributesOrder:no}=Vn;return fs(Uf(Mn,"|"),ao=>{const po=Wn.exec(ao);if(po){const vo={},Ao=po[1],Fo=po[2].replace(/[\\:]:/g,":"),Qo=po[3],qo=po[4];if(Ao==="!"&&(Vn.attributesRequired=Vn.attributesRequired||[],Vn.attributesRequired.push(Fo),vo.required=!0),Ao==="-"){delete Gn[Fo],no.splice(Lr.inArray(no,Fo),1);return}if(Qo&&(Qo==="="?(Vn.attributesDefault=Vn.attributesDefault||[],Vn.attributesDefault.push({name:Fo,value:qo}),vo.defaultValue=qo):Qo==="~"?(Vn.attributesForced=Vn.attributesForced||[],Vn.attributesForced.push({name:Fo,value:qo}),vo.forcedValue=qo):Qo==="<"&&(vo.validValues=Lr.makeMap(qo,"?"))),jn.test(Fo)){const ds=vo;Vn.attributePatterns=Vn.attributePatterns||[],ds.pattern=ba(Fo),Vn.attributePatterns.push(ds)}else Gn[Fo]||no.push(Fo),Gn[Fo]=vo}})},$0=(Mn,Vn)=>{Rr(Mn.attributes,(Wn,jn)=>{Vn.attributes[jn]=Wn}),Vn.attributesOrder.push(...Mn.attributesOrder)},Mv=(Mn,Vn)=>{const Wn=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/;return cc(Uf(Vn,","),jn=>{const Gn=Wn.exec(jn);if(Gn){const no=Gn[1],ao=Gn[2],po=Gn[3],vo=Gn[4],Ao=Gn[5],Fo={attributes:{},attributesOrder:[]};if(Mn.each(Qo=>$0(Qo,Fo)),no==="#"?Fo.paddEmpty=!0:no==="-"&&(Fo.removeEmpty=!0),vo==="!"&&(Fo.removeEmptyAttrs=!0),Ao&&Dv(Ao,Fo),po&&(Fo.outputName=ao),ao==="@")if(Mn.isNone())Mn=zo.some(Fo);else return[];return[po?{name:ao,element:Fo,aliasName:po}:{name:ao,element:Fo}]}else return[]})},HO={},Ep=Lr.makeMap,ag=Lr.each,Nv=Lr.extend,Tp=Lr.explode,QO=(Mn,Vn={})=>{const Wn=Ep(Mn," ",Ep(Mn.toUpperCase()," "));return Nv(Wn,Vn)},dC=Mn=>QO("td th li dt dd figcaption caption details summary",Mn.getTextBlockElements()),Lv=(Mn,Vn)=>{if(Mn){const Wn={};return xo(Mn)&&(Mn={"*":Mn}),ag(Mn,(jn,Gn)=>{Wn[Gn]=Wn[Gn.toUpperCase()]=Vn==="map"?Ep(jn,/[, ]/):Tp(jn,/[, ]/)}),Wn}else return},i1=(Mn={})=>{var Vn;const Wn={},jn={};let Gn=[];const no={},ao={},po=(Sl,Mc,ru)=>{const Kd=Mn[Sl];if(Kd)return Ep(Kd,/[, ]/,Ep(Kd.toUpperCase(),/[, ]/));{let xd=HO[Sl];return xd||(xd=QO(Mc,ru),HO[Sl]=xd),xd}},vo=(Vn=Mn.schema)!==null&&Vn!==void 0?Vn:"html5",Ao=K1(vo);Mn.verify_html===!1&&(Mn.valid_elements="*[*]");const Fo=Lv(Mn.valid_styles),Qo=Lv(Mn.invalid_styles,"map"),qo=Lv(Mn.valid_classes,"map"),ds=po("whitespace_elements","pre script noscript style textarea video audio iframe object code"),bs=po("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),ls=po("void_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),ys=po("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),Ls="td th iframe video audio object script code",zs=po("non_empty_elements",Ls+" pre svg",ls),Hs=po("move_caret_before_on_enter_elements",Ls+" table",ls),tr="h1 h2 h3 h4 h5 h6",Pr=po("text_block_elements",tr+" p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),Ur=po("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary html body multicol listing",Pr),fa=po("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),yr=po("transparent_elements","a ins del canvas map"),fr=po("wrap_block_elements","pre "+tr);ag("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),Sl=>{ao[Sl]=new RegExp("]*>","gi")});const Ar=Sl=>{const Mc=zo.from(Wn["@"]),ru=/[*?+]/;fs(Mv(Mc,Sl??""),({name:Kd,element:xd,aliasName:wg})=>{if(wg&&(Wn[wg]=xd),ru.test(Kd)){const dv=xd;dv.pattern=ba(Kd),Gn.push(dv)}else Wn[Kd]=xd})},wa=Sl=>{Gn=[],fs(Al(Wn),Mc=>{delete Wn[Mc]}),Ar(Sl)},Va=Sl=>{delete HO.text_block_elements,delete HO.block_elements,fs(P2(Sl??""),({inline:Mc,name:ru,cloneName:Kd})=>{if(jn[ru]=jn[Kd],no[ru]=Kd,zs[ru.toUpperCase()]={},zs[ru]={},Mc||(Ur[ru.toUpperCase()]={},Ur[ru]={}),!Wn[ru]){let xd=Wn[Kd];xd=Nv({},xd),delete xd.removeEmptyAttrs,delete xd.removeEmpty,Wn[ru]=xd}Rr(jn,(xd,wg)=>{xd[Kd]&&(jn[wg]=xd=Nv({},jn[wg]),xd[ru]=xd[Kd])})})},Tl=Sl=>{fs(J1(Sl??""),({operation:Mc,name:ru,validChildren:Kd})=>{const xd=Mc==="replace"?{"#comment":{}}:jn[ru];fs(Kd,wg=>{Mc==="remove"?delete xd[wg]:xd[wg]={}}),jn[ru]=xd})},tc=Sl=>{const Mc=Wn[Sl];if(Mc)return Mc;let ru=Gn.length;for(;ru--;){const Kd=Gn[ru];if(Kd.pattern.test(Sl))return Kd}};Mn.valid_elements?(wa(Mn.valid_elements),ag(Ao,(Sl,Mc)=>{jn[Mc]=Sl.children})):(ag(Ao,(Sl,Mc)=>{Wn[Mc]={attributes:Sl.attributes,attributesOrder:Sl.attributesOrder},jn[Mc]=Sl.children}),ag(Uf("strong/b em/i"),Sl=>{const Mc=Uf(Sl,"/");Wn[Mc[1]].outputName=Mc[0]}),ag(fa,(Sl,Mc)=>{Wn[Mc]&&(Mn.padd_empty_block_inline_children&&(Wn[Mc].paddInEmptyBlock=!0),Wn[Mc].removeEmpty=!0)}),ag(Uf("ol ul blockquote a table tbody"),Sl=>{Wn[Sl]&&(Wn[Sl].removeEmpty=!0)}),ag(Uf("p h1 h2 h3 h4 h5 h6 th td pre div address caption li summary"),Sl=>{Wn[Sl]&&(Wn[Sl].paddEmpty=!0)}),ag(Uf("span"),Sl=>{Wn[Sl].removeEmptyAttrs=!0})),delete Wn.svg,Va(Mn.custom_elements),Tl(Mn.valid_children),Ar(Mn.extended_valid_elements),Tl("+ol[ul|ol],+ul[ul|ol]"),ag({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(Sl,Mc)=>{Wn[Mc]&&(Wn[Mc].parentsRequired=Uf(Sl))}),Mn.invalid_elements&&ag(Tp(Mn.invalid_elements),Sl=>{Wn[Sl]&&delete Wn[Sl]}),tc("span")||Ar("span[!data-mce-type|*]");const uu=xs(Fo),Qu=xs(Qo),Wd=xs(qo),Jh=xs(ys),_u=xs(Ur),ea=xs(Pr),pa=xs(fa),$c=xs(Object.seal(ls)),ac=xs(bs),Pa=xs(zs),ml=xs(Hs),Yr=xs(ds),pl=xs(yr),pc=xs(fr),Pu=xs(Object.seal(ao)),du=(Sl,Mc)=>{const ru=jn[Sl.toLowerCase()];return!!(ru&&ru[Mc.toLowerCase()])},Oh=(Sl,Mc)=>{const ru=tc(Sl);if(ru)if(Mc){if(ru.attributes[Mc])return!0;const Kd=ru.attributePatterns;if(Kd){let xd=Kd.length;for(;xd--;)if(Kd[xd].pattern.test(Mc))return!0}}else return!0;return!1},h0=Sl=>Mr(_u(),Sl),Ay=Sl=>!Dc(Sl,"#")&&Oh(Sl)&&!h0(Sl),Ip=Sl=>Mr(pc(),Sl)||Ay(Sl),Sb=xs(no);return{type:vo,children:jn,elements:Wn,getValidStyles:uu,getValidClasses:Wd,getBlockElements:_u,getInvalidStyles:Qu,getVoidElements:$c,getTextBlockElements:ea,getTextInlineElements:pa,getBoolAttrs:Jh,getElementRule:tc,getSelfClosingElements:ac,getNonEmptyElements:Pa,getMoveCaretBeforeOnEnterElements:ml,getWhitespaceElements:Yr,getTransparentElements:pl,getSpecialElements:Pu,isValidChild:du,isValid:Oh,isBlock:h0,isInline:Ay,isWrapper:Ip,getCustomElements:Sb,addValidElements:Ar,setValidElements:wa,addCustomElements:Va,addValidChildren:Tl}},fC=Mn=>({value:Iv(Mn)}),Iv=Mn=>ld(Mn,"#").toUpperCase(),eb=Mn=>{const Vn=Mn.toString(16);return(Vn.length===1?"0"+Vn:Vn).toUpperCase()},Ap=Mn=>{const Vn=eb(Mn.red)+eb(Mn.green)+eb(Mn.blue);return fC(Vn)},ph=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,bS=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,vS=(Mn,Vn,Wn,jn)=>({red:Mn,green:Vn,blue:Wn,alpha:jn}),yS=(Mn,Vn,Wn,jn)=>{const Gn=parseInt(Mn,10),no=parseInt(Vn,10),ao=parseInt(Wn,10),po=parseFloat(jn);return vS(Gn,no,ao,po)},Bv=Mn=>{if(Mn==="transparent")return zo.some(vS(0,0,0,0));const Vn=ph.exec(Mn);if(Vn!==null)return zo.some(yS(Vn[1],Vn[2],Vn[3],"1"));const Wn=bS.exec(Mn);return Wn!==null?zo.some(yS(Wn[1],Wn[2],Wn[3],Wn[4])):zo.none()},bm=Mn=>`rgba(${Mn.red},${Mn.green},${Mn.blue},${Mn.alpha})`,Bm=Mn=>Bv(Mn).map(Ap).map(Vn=>"#"+Vn.value).getOr(Mn),a1=(Mn={},Vn)=>{const Wn=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,jn=/\s*([^:]+):\s*([^;]+);?/g,Gn=/\s+$/,no={};let ao,po;const vo=k0;Vn&&(ao=Vn.getValidStyles(),po=Vn.getInvalidStyles());const Ao=(`\\" \\' \\; \\: ; : `+vo).split(" ");for(let Qo=0;Qo{const qo={};let ds=!1;const bs=Mn.url_converter,ls=Mn.url_converter_scope||Fo,ys=(yr,fr,Ar)=>{const wa=qo[yr+"-top"+fr];if(!wa)return;const Va=qo[yr+"-right"+fr];if(!Va)return;const Tl=qo[yr+"-bottom"+fr];if(!Tl)return;const tc=qo[yr+"-left"+fr];if(!tc)return;const uu=[wa,Va,Tl,tc];let Qu=uu.length-1;for(;Qu--&&uu[Qu]===uu[Qu+1];);Qu>-1&&Ar||(qo[yr+fr]=Qu===-1?uu[0]:uu.join(" "),delete qo[yr+"-top"+fr],delete qo[yr+"-right"+fr],delete qo[yr+"-bottom"+fr],delete qo[yr+"-left"+fr])},Ls=yr=>{const fr=qo[yr];if(!fr)return;const Ar=fr.indexOf(",")>-1?[fr]:fr.split(" ");let wa=Ar.length;for(;wa--;)if(Ar[wa]!==Ar[0])return!1;return qo[yr]=Ar[0],!0},zs=(yr,fr,Ar,wa)=>{Ls(fr)&&Ls(Ar)&&Ls(wa)&&(qo[yr]=qo[fr]+" "+qo[Ar]+" "+qo[wa],delete qo[fr],delete qo[Ar],delete qo[wa])},Hs=yr=>(ds=!0,no[yr]),tr=(yr,fr)=>(ds&&(yr=yr.replace(/\uFEFF[0-9]/g,Ar=>no[Ar])),fr||(yr=yr.replace(/\\([\'\";:])/g,"$1")),yr),Pr=yr=>String.fromCharCode(parseInt(yr.slice(1),16)),Ur=yr=>yr.replace(/\\[0-9a-f]+/gi,Pr),fa=(yr,fr,Ar,wa,Va,Tl)=>{if(Va=Va||Tl,Va)return Va=tr(Va),"'"+Va.replace(/\'/g,"\\'")+"'";if(fr=tr(fr||Ar||wa||""),!Mn.allow_script_urls){const tc=fr.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(tc)||!Mn.allow_svg_data_urls&&/^data:image\/svg/i.test(tc))return""}return bs&&(fr=bs.call(ls,fr,"style")),"url('"+fr.replace(/\'/g,"\\'")+"')"};if(Qo){Qo=Qo.replace(/[\u0000-\u001F]/g,""),Qo=Qo.replace(/\\[\"\';:\uFEFF]/g,Hs).replace(/\"[^\"]+\"|\'[^\']+\'/g,fr=>fr.replace(/[;:]/g,Hs));let yr;for(;yr=jn.exec(Qo);){jn.lastIndex=yr.index+yr[0].length;let fr=yr[1].replace(Gn,"").toLowerCase(),Ar=yr[2].replace(Gn,"");if(fr&&Ar){if(fr=Ur(fr),Ar=Ur(Ar),fr.indexOf(vo)!==-1||fr.indexOf('"')!==-1||!Mn.allow_script_urls&&(fr==="behavior"||/expression\s*\(|\/\*|\*\//.test(Ar)))continue;fr==="font-weight"&&Ar==="700"?Ar="bold":(fr==="color"||fr==="background-color")&&(Ar=Ar.toLowerCase()),xo(Mn.force_hex_color)&&Mn.force_hex_color!=="off"&&Bv(Ar).each(wa=>{(Mn.force_hex_color==="always"||wa.alpha===1)&&(Ar=Bm(bm(wa)))}),Ar=Ar.replace(Wn,fa),qo[fr]=ds?tr(Ar,!0):Ar}}ys("border","",!0),ys("border","-width"),ys("border","-color"),ys("border","-style"),ys("padding",""),ys("margin",""),zs("border","border-width","border-style","border-color"),qo.border==="medium none"&&delete qo.border,qo["border-image"]==="none"&&delete qo["border-image"]}return qo},serialize:(Qo,qo)=>{let ds="";const bs=(ys,Ls)=>{const zs=Ls[ys];if(zs)for(let Hs=0,tr=zs.length;Hs0?" ":"")+Pr+": "+Ur+";")}},ls=(ys,Ls)=>{if(!po||!Ls)return!0;let zs=po["*"];return zs&&zs[ys]?!1:(zs=po[Ls],!(zs&&zs[ys]))};return qo&&ao?(bs("*",ao),bs(qo,ao)):Rr(Qo,(ys,Ls)=>{ys&&ls(Ls,qo)&&(ds+=(ds.length>0?" ":"")+Ls+": "+ys+";")}),ds}};return Fo},VO={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},hC=Mn=>Mn instanceof Event||Yo(Mn.initEvent),mC=Mn=>Mn.isDefaultPrevented===Qs||Mn.isDefaultPrevented===hs,OS=Mn=>ms(Mn.preventDefault)||hC(Mn),Fv=(Mn,Vn)=>{const Wn=Vn??{};for(const jn in Mn)Mr(VO,jn)||(Wn[jn]=Mn[jn]);return is(Mn.composedPath)&&(Wn.composedPath=()=>Mn.composedPath()),is(Mn.getModifierState)&&(Wn.getModifierState=jn=>Mn.getModifierState(jn)),is(Mn.getTargetRanges)&&(Wn.getTargetRanges=()=>Mn.getTargetRanges()),Wn},Hv=(Mn,Vn,Wn,jn)=>{var Gn;const no=Fv(Vn,jn);return no.type=Mn,ms(no.target)&&(no.target=(Gn=no.srcElement)!==null&&Gn!==void 0?Gn:Wn),OS(Vn)&&(no.preventDefault=()=>{no.defaultPrevented=!0,no.isDefaultPrevented=Qs,Yo(Vn.preventDefault)&&Vn.preventDefault()},no.stopPropagation=()=>{no.cancelBubble=!0,no.isPropagationStopped=Qs,Yo(Vn.stopPropagation)&&Vn.stopPropagation()},no.stopImmediatePropagation=()=>{no.isImmediatePropagationStopped=Qs,no.stopPropagation()},mC(no)||(no.isDefaultPrevented=no.defaultPrevented===!0?Qs:hs,no.isPropagationStopped=no.cancelBubble===!0?Qs:hs,no.isImmediatePropagationStopped=hs)),no},zO="mce-data-",$2=/^(?:mouse|contextmenu)|click/,WO=(Mn,Vn,Wn,jn)=>{Mn.addEventListener(Vn,Wn,jn||!1)},Qv=(Mn,Vn,Wn,jn)=>{Mn.removeEventListener(Vn,Wn,jn||!1)},R2=Mn=>is(Mn)&&$2.test(Mn.type),zy=(Mn,Vn)=>{const Wn=Hv(Mn.type,Mn,document,Vn);if(R2(Mn)&&os(Mn.pageX)&&!os(Mn.clientX)){const jn=Wn.target.ownerDocument||document,Gn=jn.documentElement,no=jn.body,ao=Wn;ao.pageX=Mn.clientX+(Gn&&Gn.scrollLeft||no&&no.scrollLeft||0)-(Gn&&Gn.clientLeft||no&&no.clientLeft||0),ao.pageY=Mn.clientY+(Gn&&Gn.scrollTop||no&&no.scrollTop||0)-(Gn&&Gn.clientTop||no&&no.clientTop||0)}return Wn},_S=(Mn,Vn,Wn)=>{const jn=Mn.document,Gn={type:"ready"};if(Wn.domLoaded){Vn(Gn);return}const no=()=>jn.readyState==="complete"||jn.readyState==="interactive"&&jn.body,ao=()=>{Qv(Mn,"DOMContentLoaded",ao),Qv(Mn,"load",ao),Wn.domLoaded||(Wn.domLoaded=!0,Vn(Gn)),Mn=null};no()?ao():WO(Mn,"DOMContentLoaded",ao),Wn.domLoaded||WO(Mn,"load",ao)};class vm{constructor(){this.domLoaded=!1,this.events={},this.count=1,this.expando=zO+(+new Date).toString(32),this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}bind(Vn,Wn,jn,Gn){const no=this;let ao;const po=window,vo=qo=>{no.executeHandlers(zy(qo||po.event),Ao)};if(!Vn||Ir(Vn)||Dg(Vn))return jn;let Ao;Vn[no.expando]?Ao=Vn[no.expando]:(Ao=no.count++,Vn[no.expando]=Ao,no.events[Ao]={}),Gn=Gn||Vn;const Fo=Wn.split(" ");let Qo=Fo.length;for(;Qo--;){let qo=Fo[Qo],ds=vo,bs=!1,ls=!1;if(qo==="DOMContentLoaded"&&(qo="ready"),no.domLoaded&&qo==="ready"&&Vn.readyState==="complete"){jn.call(Gn,zy({type:qo}));continue}!no.hasFocusIn&&(qo==="focusin"||qo==="focusout")&&(bs=!0,ls=qo==="focusin"?"focus":"blur",ds=ys=>{const Ls=zy(ys||po.event);Ls.type=Ls.type==="focus"?"focusin":"focusout",no.executeHandlers(Ls,Ao)}),ao=no.events[Ao][qo],ao?qo==="ready"&&no.domLoaded?jn(zy({type:qo})):ao.push({func:jn,scope:Gn}):(no.events[Ao][qo]=ao=[{func:jn,scope:Gn}],ao.fakeName=ls,ao.capture=bs,ao.nativeHandler=ds,qo==="ready"?_S(Vn,ds,no):WO(Vn,ls||qo,ds,bs))}return Vn=ao=null,jn}unbind(Vn,Wn,jn){if(!Vn||Ir(Vn)||Dg(Vn))return this;const Gn=Vn[this.expando];if(Gn){let no=this.events[Gn];if(Wn){const ao=Wn.split(" ");let po=ao.length;for(;po--;){const vo=ao[po],Ao=no[vo];if(Ao){if(jn){let Fo=Ao.length;for(;Fo--;)if(Ao[Fo].func===jn){const Qo=Ao.nativeHandler,qo=Ao.fakeName,ds=Ao.capture,bs=Ao.slice(0,Fo).concat(Ao.slice(Fo+1));bs.nativeHandler=Qo,bs.fakeName=qo,bs.capture=ds,no[vo]=bs}}(!jn||Ao.length===0)&&(delete no[vo],Qv(Vn,Ao.fakeName||vo,Ao.nativeHandler,Ao.capture))}}}else Rr(no,(ao,po)=>{Qv(Vn,ao.fakeName||po,ao.nativeHandler,ao.capture)}),no={};for(const ao in no)if(Mr(no,ao))return this;delete this.events[Gn];try{delete Vn[this.expando]}catch{Vn[this.expando]=null}}return this}fire(Vn,Wn,jn){return this.dispatch(Vn,Wn,jn)}dispatch(Vn,Wn,jn){if(!Vn||Ir(Vn)||Dg(Vn))return this;const Gn=zy({type:Wn,target:Vn},jn);do{const no=Vn[this.expando];no&&this.executeHandlers(Gn,no),Vn=Vn.parentNode||Vn.ownerDocument||Vn.defaultView||Vn.parentWindow}while(Vn&&!Gn.isPropagationStopped());return this}clean(Vn){if(!Vn||Ir(Vn)||Dg(Vn))return this;if(Vn[this.expando]&&this.unbind(Vn),Vn.getElementsByTagName||(Vn=Vn.document),Vn&&Vn.getElementsByTagName){this.unbind(Vn);const Wn=Vn.getElementsByTagName("*");let jn=Wn.length;for(;jn--;)Vn=Wn[jn],Vn[this.expando]&&this.unbind(Vn)}return this}destroy(){this.events={}}cancel(Vn){return Vn&&(Vn.preventDefault(),Vn.stopImmediatePropagation()),!1}executeHandlers(Vn,Wn){const jn=this.events[Wn],Gn=jn&&jn[Vn.type];if(Gn)for(let no=0,ao=Gn.length;no{ms(Wn)||Wn===""?Mu(Mn,Vn):Gc(Mn,Vn,Wn)},tb=Mn=>Mn.replace(/[A-Z]/g,Vn=>"-"+Vn.toLowerCase()),l1=(Mn,Vn)=>{let Wn=0;if(Mn)for(let jn=Mn.nodeType,Gn=Mn.previousSibling;Gn;Gn=Gn.previousSibling){const no=Gn.nodeType;Vn&&Ir(Gn)&&(no===jn||!Gn.data.length)||(Wn++,jn=no)}return Wn},wS=(Mn,Vn)=>{const Wn=Tf(Vn,"style"),jn=Mn.serialize(Mn.parse(Wn),ql(Vn));ZO(Vn,UO,jn)},Vv=(Mn,Vn)=>Ys(Mn)?Mr(TT,Vn)?Mn+"":Mn+"px":Mn,qO=(Mn,Vn,Wn)=>{const jn=tb(Vn);ms(Wn)||Wn===""?_p(Mn,jn):vv(Mn,jn,Vv(Wn,jn))},pC=(Mn,Vn,Wn)=>{const jn=Vn.keep_values,Gn={set:(ao,po,vo)=>{const Ao=Cs.fromDom(ao);Yo(Vn.url_converter)&&is(po)&&(po=Vn.url_converter.call(Vn.url_converter_scope||Wn(),String(po),vo,ao));const Fo="data-mce-"+vo;ZO(Ao,Fo,po),ZO(Ao,vo,po)},get:(ao,po)=>{const vo=Cs.fromDom(ao);return Tf(vo,"data-mce-"+po)||Tf(vo,po)}},no={style:{set:(ao,po)=>{const vo=Cs.fromDom(ao);jn&&ZO(vo,UO,po),Mu(vo,"style"),xo(po)&&ff(vo,Mn.parse(po))},get:ao=>{const po=Cs.fromDom(ao),vo=Tf(po,UO)||Tf(po,"style");return Mn.serialize(Mn.parse(vo),ql(po))}}};return jn&&(no.href=no.src=Gn),no},Eu=(Mn,Vn={})=>{const Wn={},jn=window,Gn={};let no=0;const ao=!0,po=!0,vo=mS.forElement(Cs.fromDom(Mn),{contentCssCors:Vn.contentCssCors,referrerPolicy:Vn.referrerPolicy}),Ao=[],Fo=Vn.schema?Vn.schema:i1({}),Qo=a1({url_converter:Vn.url_converter,url_converter_scope:Vn.url_converter_scope,force_hex_color:Vn.force_hex_color},Vn.schema),qo=Vn.ownEvents?new vm:vm.Event,ds=Fo.getBlockElements(),bs=or=>xo(or)?Mr(ds,or):Oa(or)&&(Mr(ds,or.nodeName)||Wl(Fo,or)),ls=or=>or&&Mn&&xo(or)?Mn.getElementById(or):or,ys=or=>{const ur=ls(or);return is(ur)?Cs.fromDom(ur):null},Ls=(or,ur,Gr="")=>{let Wr;const Ha=ys(or);if(is(Ha)&&lf(Ha)){const Jl=wT[ur];Jl&&Jl.get?Wr=Jl.get(Ha.dom,ur):Wr=Tf(Ha,ur)}return is(Wr)?Wr:Gr},zs=or=>{const ur=ls(or);return ms(ur)?[]:ur.attributes},Hs=(or,ur,Gr)=>{pa(or,Wr=>{if(Oa(Wr)){const Ha=Cs.fromDom(Wr),Jl=Gr===""?null:Gr,pd=Tf(Ha,ur),gp=wT[ur];gp&&gp.set?gp.set(Ha.dom,Jl,ur):ZO(Ha,ur,Jl),pd!==Jl&&Vn.onSetAttrib&&Vn.onSetAttrib({attrElm:Ha.dom,attrName:ur,attrValue:Jl})}})},tr=(or,ur)=>or.cloneNode(ur),Pr=()=>Vn.root_element||Mn.body,Ur=or=>{const ur=zu(or);return{x:ur.x,y:ur.y,w:ur.width,h:ur.height}},fa=(or,ur)=>Jc(Mn.body,ls(or),ur),yr=(or,ur,Gr)=>{pa(or,Wr=>{const Ha=Cs.fromDom(Wr);qO(Ha,ur,Gr),Vn.update_styles&&wS(Qo,Ha)})},fr=(or,ur)=>{pa(or,Gr=>{const Wr=Cs.fromDom(Gr);Rr(ur,(Ha,Jl)=>{qO(Wr,Jl,Ha)}),Vn.update_styles&&wS(Qo,Wr)})},Ar=(or,ur,Gr)=>{const Wr=ls(or);if(!(ms(Wr)||!pf(Wr)&&!$O(Wr)))return Gr?Ju(Cs.fromDom(Wr),tb(ur)):(ur=ur.replace(/-(\D)/g,(Ha,Jl)=>Jl.toUpperCase()),ur==="float"&&(ur="cssFloat"),Wr.style?Wr.style[ur]:void 0)},wa=or=>{const ur=ls(or);if(!ur)return{w:0,h:0};let Gr=Ar(ur,"width"),Wr=Ar(ur,"height");return(!Gr||Gr.indexOf("px")===-1)&&(Gr="0"),(!Wr||Wr.indexOf("px")===-1)&&(Wr="0"),{w:parseInt(Gr,10)||ur.offsetWidth||ur.clientWidth,h:parseInt(Wr,10)||ur.offsetHeight||ur.clientHeight}},Va=or=>{const ur=ls(or),Gr=fa(ur),Wr=wa(ur);return{x:Gr.x,y:Gr.y,w:Wr.w,h:Wr.h}},Tl=(or,ur)=>{if(!or)return!1;const Gr=Jo(or)?or:[or];return Sr(Gr,Wr=>zh(Cs.fromDom(Wr),ur))},tc=(or,ur,Gr,Wr)=>{const Ha=[];let Jl=ls(or);Wr=Wr===void 0;const pd=Gr||(Pr().nodeName!=="BODY"?Pr().parentNode:null);if(xo(ur))if(ur==="*")ur=Oa;else{const gp=ur;ur=em=>Tl(em,gp)}for(;Jl&&!(Jl===pd||ms(Jl.nodeType)||Nm(Jl)||Lu(Jl));){if(!ur||ur(Jl))if(Wr)Ha.push(Jl);else return[Jl];Jl=Jl.parentNode}return Wr?Ha:null},uu=(or,ur,Gr)=>{const Wr=tc(or,ur,Gr,!1);return Wr&&Wr.length>0?Wr[0]:null},Qu=(or,ur,Gr)=>{let Wr=ur;if(or){xo(ur)&&(Wr=Ha=>Tl(Ha,ur));for(let Ha=or[Gr];Ha;Ha=Ha[Gr])if(Yo(Wr)&&Wr(Ha))return Ha}return null},Wd=(or,ur)=>Qu(or,ur,"nextSibling"),Jh=(or,ur)=>Qu(or,ur,"previousSibling"),_u=or=>Yo(or.querySelectorAll),ea=(or,ur)=>{var Gr,Wr;const Ha=(Wr=(Gr=ls(ur))!==null&&Gr!==void 0?Gr:Vn.root_element)!==null&&Wr!==void 0?Wr:Mn;return _u(Ha)?kc(Ha.querySelectorAll(or)):[]},pa=function(or,ur,Gr){const Wr=Gr??this;if(Jo(or)){const Ha=[];return Wy(or,(Jl,pd)=>{const gp=ls(Jl);gp&&Ha.push(ur.call(Wr,gp,pd))}),Ha}else{const Ha=ls(or);return Ha?ur.call(Wr,Ha):!1}},$c=(or,ur)=>{pa(or,Gr=>{Rr(ur,(Wr,Ha)=>{Hs(Gr,Ha,Wr)})})},ac=(or,ur)=>{pa(or,Gr=>{const Wr=Cs.fromDom(Gr);dm(Wr,ur)})},Pa=(or,ur,Gr,Wr,Ha)=>pa(or,Jl=>{const pd=xo(ur)?Mn.createElement(ur):ur;return is(Gr)&&$c(pd,Gr),Wr&&(!xo(Wr)&&Wr.nodeType?pd.appendChild(Wr):xo(Wr)&&ac(pd,Wr)),Ha?pd:Jl.appendChild(pd)}),ml=(or,ur,Gr)=>Pa(Mn.createElement(or),or,ur,Gr,!0),Yr=P0.decode,pl=P0.encodeAllRaw,pc=(or,ur,Gr="")=>{let Wr="<"+or;for(const Ha in ur)il(ur,Ha)&&(Wr+=" "+Ha+'="'+pl(ur[Ha])+'"');return Td(Gr)&&Mr(Fo.getVoidElements(),or)?Wr+" />":Wr+">"+Gr+""},Pu=or=>{const ur=Mn.createElement("div"),Gr=Mn.createDocumentFragment();Gr.appendChild(ur),or&&(ur.innerHTML=or);let Wr;for(;Wr=ur.firstChild;)Gr.appendChild(Wr);return Gr.removeChild(ur),Gr},du=(or,ur)=>pa(or,Gr=>{const Wr=Cs.fromDom(Gr);return ur&&fs(Ku(Wr),Ha=>{qd(Ha)&&Ha.dom.length===0?sc(Ha):ed(Wr,Ha)}),sc(Wr),Wr.dom}),Oh=or=>pa(or,ur=>{const Gr=ur.attributes;for(let Wr=Gr.length-1;Wr>=0;Wr--)ur.removeAttributeNode(Gr.item(Wr))}),h0=or=>Qo.parse(or),Ay=(or,ur)=>Qo.serialize(or,ur),Ip=or=>{if(Ry!==Eu.DOM&&Mn===document){if(Wn[or])return;Wn[or]=!0}let ur=Mn.getElementById("mceDefaultStyles");if(!ur){ur=Mn.createElement("style"),ur.id="mceDefaultStyles",ur.type="text/css";const Gr=Mn.head;Gr.firstChild?Gr.insertBefore(ur,Gr.firstChild):Gr.appendChild(ur)}ur.styleSheet?ur.styleSheet.cssText+=or:ur.appendChild(Mn.createTextNode(or))},Sb=or=>{or||(or=""),fs(or.split(","),ur=>{Gn[ur]=!0,vo.load(ur).catch(Js)})},Sl=(or,ur,Gr)=>{pa(or,Wr=>{if(Oa(Wr)){const Ha=Cs.fromDom(Wr),Jl=ur.split(" ");fs(Jl,pd=>{is(Gr)?(Gr?Xm:Vf)(Ha,pd):Gg(Ha,pd)})}})},Mc=(or,ur)=>{Sl(or,ur,!0)},ru=(or,ur)=>{Sl(or,ur,!1)},Kd=(or,ur)=>{const Gr=ys(or),Wr=ur.split(" ");return is(Gr)&&gc(Wr,Ha=>yp(Gr,Ha))},xd=or=>{pa(or,ur=>_p(Cs.fromDom(ur),"display"))},wg=or=>{pa(or,ur=>vv(Cs.fromDom(ur),"display","none"))},dv=or=>{const ur=ys(or);return is(ur)&&qc(fd(ur,"display"),"none")},AO=or=>(or||"mce_")+no++,oC=or=>{const ur=ys(or);return is(ur)?Oa(ur.dom)?ur.dom.outerHTML:n1(ur):""},C2=(or,ur)=>{pa(or,Gr=>{Oa(Gr)&&(Gr.outerHTML=ur)})},n3=(or,ur)=>{const Gr=ls(ur);return pa(or,Wr=>{const Ha=Gr==null?void 0:Gr.parentNode,Jl=Gr==null?void 0:Gr.nextSibling;return Ha&&(Jl?Ha.insertBefore(Wr,Jl):Ha.appendChild(Wr)),Wr})},sC=(or,ur,Gr)=>pa(ur,Wr=>{var Ha;const Jl=Jo(ur)?or.cloneNode(!0):or;return Gr&&Wy(SS(Wr.childNodes),pd=>{Jl.appendChild(pd)}),(Ha=Wr.parentNode)===null||Ha===void 0||Ha.replaceChild(Jl,Wr),Wr}),vT=(or,ur)=>{if(or.nodeName!==ur.toUpperCase()){const Gr=ml(ur);return Wy(zs(or),Wr=>{Hs(Gr,Wr.nodeName,Ls(or,Wr.nodeName))}),sC(Gr,or,!0),Gr}else return or},k2=(or,ur)=>{let Gr=or;for(;Gr;){let Wr=ur;for(;Wr&&Gr!==Wr;)Wr=Wr.parentNode;if(Gr===Wr)break;Gr=Gr.parentNode}return!Gr&&or.ownerDocument?or.ownerDocument.documentElement:Gr},lS=or=>{if(Oa(or)){const ur=or.nodeName.toLowerCase()==="a"&&!Ls(or,"href")&&Ls(or,"id");if(Ls(or,"name")||Ls(or,"data-mce-bookmark")||ur)return!0}return!1},fv=(or,ur,Gr)=>{let Wr=0;if(lS(or))return!1;const Ha=or.firstChild;if(Ha){const Jl=new mu(Ha,or),pd=Fo?Fo.getWhitespaceElements():{},gp=ur||(Fo?Fo.getNonEmptyElements():null);let em=Ha;do{if(Oa(em)){const uS=em.getAttribute("data-mce-bogus");if(uS){em=Jl.next(uS==="all");continue}const wb=em.nodeName.toLowerCase();if(gp&&gp[wb]){if(wb==="br"){Wr++,em=Jl.next();continue}return!1}if(lS(em))return!1}if(Dg(em)||Ir(em)&&!Q1(em.data)&&(!(Gr!=null&&Gr.includeZwsp)||!o1(em.data))||Ir(em)&&em.parentNode&&pd[em.parentNode.nodeName]&&Q1(em.data))return!1;em=Jl.next()}while(em)}return Wr<=1},Py=()=>Mn.createRange(),yT=(or,ur,Gr)=>{let Wr=Py(),Ha,Jl;if(or&&ur&&or.parentNode&&ur.parentNode){const pd=or.parentNode;return Wr.setStart(pd,l1(or)),Wr.setEnd(ur.parentNode,l1(ur)),Ha=Wr.extractContents(),Wr=Py(),Wr.setStart(ur.parentNode,l1(ur)+1),Wr.setEnd(pd,l1(or)+1),Jl=Wr.extractContents(),pd.insertBefore(X1(Ry,Ha,Fo),or),Gr?pd.insertBefore(Gr,or):pd.insertBefore(ur,or),pd.insertBefore(X1(Ry,Jl,Fo),or),du(or),Gr||ur}else return},x2=(or,ur,Gr,Wr)=>{if(Jo(or)){let Ha=or.length;const Jl=[];for(;Ha--;)Jl[Ha]=x2(or[Ha],ur,Gr,Wr);return Jl}else return Vn.collect&&(or===Mn||or===jn)&&Ao.push([or,ur,Gr,Wr]),qo.bind(or,ur,Gr,Wr||Ry)},OT=(or,ur,Gr)=>{if(Jo(or)){let Wr=or.length;const Ha=[];for(;Wr--;)Ha[Wr]=OT(or[Wr],ur,Gr);return Ha}else{if(Ao.length>0&&(or===Mn||or===jn)){let Wr=Ao.length;for(;Wr--;){const[Ha,Jl,pd]=Ao[Wr];or===Ha&&(!ur||ur===Jl)&&(!Gr||Gr===pd)&&qo.unbind(Ha,Jl,pd)}}return qo.unbind(or,ur,Gr)}},$y=(or,ur,Gr)=>qo.dispatch(or,ur,Gr),o3=(or,ur,Gr)=>qo.dispatch(or,ur,Gr),_T=or=>{if(or&&pf(or)){const ur=or.getAttribute("data-mce-contenteditable");return ur&&ur!=="inherit"?ur:or.contentEditable!=="inherit"?or.contentEditable:null}else return null},Ry={doc:Mn,settings:Vn,win:jn,files:Gn,stdMode:ao,boxModel:po,styleSheetLoader:vo,boundEvents:Ao,styles:Qo,schema:Fo,events:qo,isBlock:bs,root:null,clone:tr,getRoot:Pr,getViewPort:Ur,getRect:Va,getSize:wa,getParent:uu,getParents:tc,get:ls,getNext:Wd,getPrev:Jh,select:ea,is:Tl,add:Pa,create:ml,createHTML:pc,createFragment:Pu,remove:du,setStyle:yr,getStyle:Ar,setStyles:fr,removeAllAttribs:Oh,setAttrib:Hs,setAttribs:$c,getAttrib:Ls,getPos:fa,parseStyle:h0,serializeStyle:Ay,addStyle:Ip,loadCSS:Sb,addClass:Mc,removeClass:ru,hasClass:Kd,toggleClass:Sl,show:xd,hide:wg,isHidden:dv,uniqueId:AO,setHTML:ac,getOuterHTML:oC,setOuterHTML:C2,decode:Yr,encode:pl,insertAfter:n3,replace:sC,rename:vT,findCommonAncestor:k2,run:pa,getAttribs:zs,isEmpty:fv,createRng:Py,nodeIndex:l1,split:yT,bind:x2,unbind:OT,fire:o3,dispatch:$y,getContentEditable:_T,getContentEditableParent:or=>{const ur=Pr();let Gr=null;for(let Wr=or;Wr&&Wr!==ur&&(Gr=_T(Wr),Gr===null);Wr=Wr.parentNode);return Gr},isEditable:or=>{if(is(or)){const ur=Oa(or)?or:or.parentElement;return is(ur)&&pf(ur)&&yl(Cs.fromDom(ur))}else return!1},destroy:()=>{if(Ao.length>0){let or=Ao.length;for(;or--;){const[ur,Gr,Wr]=Ao[or];qo.unbind(ur,Gr,Wr)}}Rr(Gn,(or,ur)=>{vo.unload(ur),delete Gn[ur]})},isChildOf:(or,ur)=>or===ur||ur.contains(or),dumpRng:or=>"startContainer: "+or.startContainer.nodeName+", startOffset: "+or.startOffset+", endContainer: "+or.endContainer.nodeName+", endOffset: "+or.endOffset},wT=pC(Qo,Vn,xs(Ry));return Ry};Eu.DOM=Eu(document),Eu.nodeIndex=l1;const lg=Eu.DOM,$d=0,gC=1,Yu=2,R0=3;class of{constructor(Vn={}){this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=!1,this.settings=Vn}_setReferrerPolicy(Vn){this.settings.referrerPolicy=Vn}loadScript(Vn){return new Promise((Wn,jn)=>{const Gn=lg;let no;const ao=()=>{Gn.remove(Ao),no&&(no.onerror=no.onload=no=null)},po=()=>{ao(),Wn()},vo=()=>{ao(),jn("Failed to load script: "+Vn)},Ao=Gn.uniqueId();no=document.createElement("script"),no.id=Ao,no.type="text/javascript",no.src=Lr._addCacheSuffix(Vn),this.settings.referrerPolicy&&Gn.setAttrib(no,"referrerpolicy",this.settings.referrerPolicy),no.onload=po,no.onerror=vo,(document.getElementsByTagName("head")[0]||document.body).appendChild(no)})}isDone(Vn){return this.states[Vn]===Yu}markDone(Vn){this.states[Vn]=Yu}add(Vn){const Wn=this;return Wn.queue.push(Vn),Wn.states[Vn]===void 0&&(Wn.states[Vn]=$d),new Promise((Gn,no)=>{Wn.scriptLoadedCallbacks[Vn]||(Wn.scriptLoadedCallbacks[Vn]=[]),Wn.scriptLoadedCallbacks[Vn].push({resolve:Gn,reject:no})})}load(Vn){return this.add(Vn)}remove(Vn){delete this.states[Vn],delete this.scriptLoadedCallbacks[Vn]}loadQueue(){const Vn=this.queue;return this.queue=[],this.loadScripts(Vn)}loadScripts(Vn){const Wn=this,jn=(vo,Ao)=>{Ma(Wn.scriptLoadedCallbacks,Ao).each(Fo=>{fs(Fo,Qo=>Qo[vo](Ao))}),delete Wn.scriptLoadedCallbacks[Ao]},Gn=vo=>{const Ao=nr(vo,Fo=>Fo.status==="rejected");return Ao.length>0?Promise.reject(cc(Ao,({reason:Fo})=>Jo(Fo)?Fo:[Fo])):Promise.resolve()},no=vo=>Promise.allSettled(Us(vo,Ao=>Wn.states[Ao]===Yu?(jn("resolve",Ao),Promise.resolve()):Wn.states[Ao]===R0?(jn("reject",Ao),Promise.reject(Ao)):(Wn.states[Ao]=gC,Wn.loadScript(Ao).then(()=>{Wn.states[Ao]=Yu,jn("resolve",Ao);const Fo=Wn.queue;return Fo.length>0?(Wn.queue=[],no(Fo).then(Gn)):Promise.resolve()},()=>(Wn.states[Ao]=R0,jn("reject",Ao),Promise.reject(Ao)))))),ao=vo=>(Wn.loading=!0,no(vo).then(Ao=>{Wn.loading=!1;const Fo=Wn.queueLoadedCallbacks.shift();return zo.from(Fo).each(ha),Gn(Ao)})),po=vl(Vn);return Wn.loading?new Promise((vo,Ao)=>{Wn.queueLoadedCallbacks.push(()=>{ao(po).then(vo,Ao)})}):ao(po)}}of.ScriptLoader=new of;const od=Mn=>{let Vn=Mn;return{get:()=>Vn,set:Gn=>{Vn=Gn}}},sp=(Mn,Vn)=>{const Wn=Mn.indexOf(Vn);return Wn!==-1&&Mn.indexOf(Vn,Wn+1)>Wn},CS=Mn=>Io(Mn)&&Mr(Mn,"raw"),Df=Mn=>Jo(Mn)&&Mn.length>1,Uy={},zv=od("en"),c1=()=>Ma(Uy,zv.get()),cg={getData:()=>Pl(Uy,Mn=>({...Mn})),setCode:Mn=>{Mn&&zv.set(Mn)},getCode:()=>zv.get(),add:(Mn,Vn)=>{let Wn=Uy[Mn];Wn||(Uy[Mn]=Wn={});const jn=Us(Al(Vn),Gn=>Gn.toLowerCase());Rr(Vn,(Gn,no)=>{const ao=no.toLowerCase();ao!==no&&sp(jn,ao)?(Mr(Vn,ao)||(Wn[ao]=Gn),Wn[no]=Gn):Wn[ao]=Gn})},translate:Mn=>{const Vn=c1().getOr({}),Wn=ao=>Yo(ao)?Object.prototype.toString.call(ao):jn(ao)?"":""+ao,jn=ao=>ao===""||ao===null||ao===void 0,Gn=ao=>{const po=Wn(ao);return Mr(Vn,po)?Wn(Vn[po]):Ma(Vn,po.toLowerCase()).map(Wn).getOr(po)},no=ao=>ao.replace(/{context:\w+}$/,"");if(jn(Mn))return"";if(CS(Mn))return Wn(Mn.raw);if(Df(Mn)){const ao=Mn.slice(1),po=Gn(Mn[0]).replace(/\{([0-9]+)\}/g,(vo,Ao)=>Mr(ao,Ao)?Wn(ao[Ao]):vo);return no(po)}return no(Gn(Mn))},isRtl:()=>c1().bind(Mn=>Ma(Mn,"_dir")).exists(Mn=>Mn==="rtl"),hasCode:Mn=>Mr(Uy,Mn)},$h=()=>{const Mn=[],Vn={},Wn={},jn=[],Gn=(ls,ys)=>{const Ls=nr(jn,zs=>zs.name===ls&&zs.state===ys);fs(Ls,zs=>zs.resolve())},no=ls=>Mr(Vn,ls),ao=ls=>Mr(Wn,ls),po=ls=>{if(Wn[ls])return Wn[ls].instance},vo=(ls,ys)=>{const Ls=cg.getCode(),zs=","+(ys||"")+",";!Ls||ys&&zs.indexOf(","+Ls+",")===-1||of.ScriptLoader.add(Vn[ls]+"/langs/"+Ls+".js")},Ao=(ls,ys)=>{$h.languageLoad!==!1&&(no(ls)?vo(ls,ys):bs(ls,"loaded").then(()=>vo(ls,ys)))},Fo=(ls,ys)=>(Mn.push(ys),Wn[ls]={instance:ys},Gn(ls,"added"),ys),Qo=ls=>{delete Vn[ls],delete Wn[ls]},qo=(ls,ys)=>xo(ys)?xo(ls)?{prefix:"",resource:ys,suffix:""}:{prefix:ls.prefix,resource:ys,suffix:ls.suffix}:ys,ds=(ls,ys)=>{if(Vn[ls])return Promise.resolve();let Ls=xo(ys)?ys:ys.prefix+ys.resource+ys.suffix;Ls.indexOf("/")!==0&&Ls.indexOf("://")===-1&&(Ls=$h.baseURL+"/"+Ls),Vn[ls]=Ls.substring(0,Ls.lastIndexOf("/"));const zs=()=>(Gn(ls,"loaded"),Promise.resolve());return Wn[ls]?zs():of.ScriptLoader.add(Ls).then(zs)},bs=(ls,ys="added")=>ys==="added"&&ao(ls)||ys==="loaded"&&no(ls)?Promise.resolve():new Promise(Ls=>{jn.push({name:ls,state:ys,resolve:Ls})});return{items:Mn,urls:Vn,lookup:Wn,get:po,requireLangPack:Ao,add:Fo,remove:Qo,createUrl:qo,load:ds,waitFor:bs}};$h.languageLoad=!0,$h.baseURL="",$h.PluginManager=$h(),$h.ThemeManager=$h(),$h.ModelManager=$h();const M2=Mn=>{const Vn=od(zo.none()),Wn=()=>Vn.get().each(Mn);return{clear:()=>{Wn(),Vn.set(zo.none())},isSet:()=>Vn.get().isSome(),get:()=>Vn.get(),set:po=>{Wn(),Vn.set(zo.some(po))}}},N2=Mn=>{const Vn=od(zo.none()),Wn=()=>Vn.get().each(po=>clearInterval(po));return{clear:()=>{Wn(),Vn.set(zo.none())},isSet:()=>Vn.get().isSome(),get:()=>Vn.get(),set:po=>{Wn(),Vn.set(zo.some(setInterval(po,Mn)))}}},Fb=()=>{const Mn=M2(Js);return{...Mn,on:Wn=>Mn.get().each(Wn)}},Zy=(Mn,Vn)=>{let Wn=null;return{cancel:()=>{Mo(Wn)||(clearTimeout(Wn),Wn=null)},throttle:(...no)=>{Mo(Wn)&&(Wn=setTimeout(()=>{Wn=null,Mn.apply(null,no)},Vn))}}},jO=(Mn,Vn)=>{let Wn=null;const jn=()=>{Mo(Wn)||(clearTimeout(Wn),Wn=null)};return{cancel:jn,throttle:(...no)=>{jn(),Wn=setTimeout(()=>{Wn=null,Mn.apply(null,no)},Vn)}}},XO=xs("mce-annotation"),u1=xs("data-mce-annotation"),Uv=xs("data-mce-annotation-uid"),Hb=xs("data-mce-annotation-active"),D0=xs("data-mce-annotation-classes"),M0=xs("data-mce-annotation-attrs"),vC=Mn=>Vn=>Vs(Vn,Mn),wd=(Mn,Vn)=>{const Wn=Mn.selection.getRng(),jn=Cs.fromDom(Wn.startContainer),Gn=Cs.fromDom(Mn.getBody()),no=Vn.fold(()=>"."+XO(),vo=>`[${u1()}="${vo}"]`),ao=Rm(jn,Wn.startOffset).getOr(jn);return cm(ao,no,vC(Gn)).bind(vo=>Ld(vo,`${Uv()}`).bind(Ao=>Ld(vo,`${u1()}`).map(Fo=>{const Qo=OC(Mn,Ao);return{uid:Ao,name:Fo,elements:Qo}})))},yC=Mn=>lf(Mn)&&yp(Mn,XO()),Zv=(Mn,Vn)=>Od(Mn,"data-mce-bogus")||fS(Mn,'[data-mce-bogus="all"]',vC(Vn)),OC=(Mn,Vn)=>{const Wn=Cs.fromDom(Mn.getBody()),jn=mf(Wn,`[${Uv()}="${Vn}"]`);return nr(jn,Gn=>!Zv(Gn,Wn))},YO=(Mn,Vn)=>{const Wn=Cs.fromDom(Mn.getBody()),jn=mf(Wn,`[${u1()}="${Vn}"]`),Gn={};return fs(jn,no=>{if(!Zv(no,Wn)){const ao=Tf(no,Uv()),po=Ma(Gn,ao).getOr([]);Gn[ao]=po.concat([no])}}),Gn},gh=(Mn,Vn)=>{const Wn=od({}),jn=()=>({listeners:[],previous:Fb()}),Gn=(Qo,qo)=>{no(Qo,ds=>(qo(ds),ds))},no=(Qo,qo)=>{const ds=Wn.get(),bs=Ma(ds,Qo).getOrThunk(jn),ls=qo(bs);ds[Qo]=ls,Wn.set(ds)},ao=(Qo,qo,ds)=>{Gn(Qo,bs=>{fs(bs.listeners,ls=>ls(!0,Qo,{uid:qo,nodes:Us(ds,ys=>ys.dom)}))})},po=Qo=>{Gn(Qo,qo=>{fs(qo.listeners,ds=>ds(!1,Qo))})},vo=(Qo,qo)=>{fs(OC(Mn,Qo),ds=>{qo?Gc(ds,Hb(),"true"):Mu(ds,Hb())})},Ao=jO(()=>{const Qo=Vl(Vn.getNames());fs(Qo,qo=>{no(qo,ds=>{const bs=ds.previous.get();return wd(Mn,zo.some(qo)).fold(()=>{bs.each(ls=>{po(qo),ds.previous.clear(),vo(ls,!1)})},({uid:ls,name:ys,elements:Ls})=>{qc(bs,ls)||(bs.each(zs=>vo(zs,!1)),ao(ys,ls,Ls),ds.previous.set(ls),vo(ls,!0))}),{previous:ds.previous,listeners:ds.listeners}})})},30);return Mn.on("remove",()=>{Ao.cancel()}),Mn.on("NodeChange",()=>{Ao.throttle()}),{addListener:(Qo,qo)=>{no(Qo,ds=>({previous:ds.previous,listeners:ds.listeners.concat([qo])}))}}},Fm=(Mn,Vn)=>{const Wn=u1(),jn=no=>zo.from(no.attr(Wn)).bind(Vn.lookup),Gn=no=>{var ao,po;no.attr(Uv(),null),no.attr(u1(),null),no.attr(Hb(),null);const vo=zo.from(no.attr(M0())).map(qo=>qo.split(",")).getOr([]),Ao=zo.from(no.attr(D0())).map(qo=>qo.split(",")).getOr([]);fs(vo,qo=>no.attr(qo,null));const Fo=(po=(ao=no.attr("class"))===null||ao===void 0?void 0:ao.split(" "))!==null&&po!==void 0?po:[],Qo=Ed(Fo,[XO()].concat(Ao));no.attr("class",Qo.length>0?Qo.join(" "):null),no.attr(D0(),null),no.attr(M0(),null)};Mn.serializer.addTempAttr(Hb()),Mn.serializer.addAttributeFilter(Wn,no=>{for(const ao of no)jn(ao).each(po=>{po.persistent===!1&&(ao.name==="span"?ao.unwrap():Gn(ao))})})},_C=()=>{const Mn={};return{register:(Gn,no)=>{Mn[Gn]={name:Gn,settings:no}},lookup:Gn=>Ma(Mn,Gn).map(no=>no.settings),getNames:()=>Al(Mn)}};let N0=0;const L0=Mn=>{const Wn=new Date().getTime(),jn=Math.floor(Math.random()*1e9);return N0++,Mn+"_"+jn+N0+String(Wn)},L2=(Mn,Vn)=>{fs(Vn,Wn=>{Xm(Mn,Wn)})},SC=(Mn,Vn)=>{fs(Vn,Wn=>{Vf(Mn,Wn)})},kS=(Mn,Vn)=>Cs.fromDom(Mn.dom.cloneNode(Vn)),Hm=Mn=>kS(Mn,!1),GO=Mn=>kS(Mn,!0),Rd=(Mn,Vn)=>{const Wn=Cs.fromTag(Vn),jn=zp(Mn);return im(Wn,jn),Wn},Bg=(Mn,Vn)=>{const Wn=Rd(Mn,Vn);fh(Mn,Wn);const jn=Ku(Mn);return Lc(Wn,jn),sc(Mn),Wn},qv=(Mn,Vn,Wn=hs)=>{const jn=new mu(Mn,Vn),Gn=no=>{let ao;do ao=jn[no]();while(ao&&!Ir(ao)&&!Wn(ao));return zo.from(ao).filter(Ir)};return{current:()=>zo.from(jn.current()).filter(Ir),next:()=>Gn("next"),prev:()=>Gn("prev"),prev2:()=>Gn("prev2")}},Qb=(Mn,Vn)=>{const Wn=Vn||(ao=>Mn.isBlock(ao)||Ec(ao)||jl(ao)),jn=(ao,po,vo,Ao)=>{if(Ir(ao)){const Fo=Ao(ao,po,ao.data);if(Fo!==-1)return zo.some({container:ao,offset:Fo})}return vo().bind(Fo=>jn(Fo.container,Fo.offset,vo,Ao))};return{backwards:(ao,po,vo,Ao)=>{const Fo=qv(ao,Ao??Mn.getRoot(),Wn);return jn(ao,po,()=>Fo.prev().map(Qo=>({container:Qo,offset:Qo.length})),vo).getOrNull()},forwards:(ao,po,vo,Ao)=>{const Fo=qv(ao,Ao??Mn.getRoot(),Wn);return jn(ao,po,()=>Fo.next().map(Qo=>({container:Qo,offset:0})),vo).getOrNull()}}},I0=Math.round,B0=Mn=>Mn?{left:I0(Mn.left),top:I0(Mn.top),bottom:I0(Mn.bottom),right:I0(Mn.right),width:I0(Mn.width),height:I0(Mn.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0},ob=(Mn,Vn)=>(Mn=B0(Mn),Vn||(Mn.left=Mn.left+Mn.width),Mn.right=Mn.left,Mn.width=0,Mn),wC=(Mn,Vn)=>Mn.left===Vn.left&&Mn.top===Vn.top&&Mn.bottom===Vn.bottom&&Mn.right===Vn.right,F0=(Mn,Vn,Wn)=>Mn>=0&&Mn<=Math.min(Vn.height,Wn.height)/2,Vb=(Mn,Vn)=>{const Wn=Math.min(Vn.height/2,Mn.height/2);return Mn.bottom-WnVn.bottom?!1:F0(Vn.top-Mn.bottom,Mn,Vn)},zb=(Mn,Vn)=>Mn.top>Vn.bottom?!0:Mn.bottomVn>=Mn.left&&Vn<=Mn.right&&Wn>=Mn.top&&Wn<=Mn.bottom,I2=Mn=>ra(Mn,(Vn,Wn)=>Vn.fold(()=>zo.some(Wn),jn=>{const Gn=Math.min(Wn.left,jn.left),no=Math.min(Wn.top,jn.top),ao=Math.max(Wn.right,jn.right),po=Math.max(Wn.bottom,jn.bottom);return zo.some({top:no,right:ao,bottom:po,left:Gn,width:ao-Gn,height:po-no})}),zo.none()),ES=(Mn,Vn,Wn)=>{const jn=Math.max(Math.min(Vn,Mn.left+Mn.width),Mn.left),Gn=Math.max(Math.min(Wn,Mn.top+Mn.height),Mn.top);return Math.sqrt((Vn-jn)*(Vn-jn)+(Wn-Gn)*(Wn-Gn))},B2=(Mn,Vn)=>Math.max(0,Math.min(Mn.bottom,Vn.bottom)-Math.max(Mn.top,Vn.top)),KO=(Mn,Vn,Wn)=>Math.min(Math.max(Mn,Vn),Wn),jv=Mn=>{const Vn=Mn.startContainer,Wn=Mn.startOffset;return Vn===Mn.endContainer&&Vn.hasChildNodes()&&Mn.endOffset===Wn+1?Vn.childNodes[Wn]:null},Qm=(Mn,Vn)=>{if(Oa(Mn)&&Mn.hasChildNodes()){const Wn=Mn.childNodes,jn=KO(Vn,0,Wn.length-1);return Wn[jn]}else return Mn},CC=(Mn,Vn)=>{if(!(Vn<0&&Oa(Mn)&&Mn.hasChildNodes()))return Qm(Mn,Vn)},Xv=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),kC=Mn=>xo(Mn)&&Mn.charCodeAt(0)>=768&&Xv.test(Mn),F2=(...Mn)=>Vn=>{for(let Wn=0;WnVn=>{for(let Wn=0;WnMn?Mn.createRange():Eu.DOM.createRng(),sb=Mn=>xo(Mn)&&/[\r\n\t ]/.test(Mn),t_=Mn=>!!Mn.setStart&&!!Mn.setEnd,jy=Mn=>{const Vn=Mn.startContainer,Wn=Mn.startOffset;if(sb(Mn.toString())&&Yv(Vn.parentNode)&&Ir(Vn)){const jn=Vn.data;if(sb(jn[Wn-1])||sb(jn[Wn+1]))return!0}return!1},Xy=Mn=>{const Vn=Mn.ownerDocument,Wn=Hg(Vn),jn=Vn.createTextNode(hc),Gn=Mn.parentNode;Gn.insertBefore(jn,Mn),Wn.setStart(jn,0),Wn.setEnd(jn,1);const no=B0(Wn.getBoundingClientRect());return Gn.removeChild(jn),no},TS=Mn=>{const Vn=Mn.startContainer,Wn=Mn.endContainer,jn=Mn.startOffset,Gn=Mn.endOffset;if(Vn===Wn&&Ir(Wn)&&jn===0&&Gn===1){const no=Mn.cloneRange();return no.setEndAfter(Wn),Pp(no)}else return null},n_=Mn=>Mn.left===0&&Mn.right===0&&Mn.top===0&&Mn.bottom===0,Pp=Mn=>{var Vn;let Wn;const jn=Mn.getClientRects();return jn.length>0?Wn=B0(jn[0]):Wn=B0(Mn.getBoundingClientRect()),!t_(Mn)&&Gv(Mn)&&n_(Wn)?Xy(Mn):n_(Wn)&&t_(Mn)&&(Vn=TS(Mn))!==null&&Vn!==void 0?Vn:Wn},ug=(Mn,Vn)=>{const Wn=ob(Mn,Vn);return Wn.width=1,Wn.right=Wn.left+1,Wn},H2=Mn=>{const Vn=[],Wn=ao=>{ao.height!==0&&(Vn.length>0&&wC(ao,Vn[Vn.length-1])||Vn.push(ao))},jn=(ao,po)=>{const vo=Hg(ao.ownerDocument);if(po0&&(vo.setStart(ao,po-1),vo.setEnd(ao,po),jy(vo)||Wn(ug(Pp(vo),!1))),po{const jn=()=>(tu(Mn),Vn===0),Gn=()=>tu(Mn)?Vn>=Mn.data.length:Vn>=Mn.childNodes.length,no=()=>{const Fo=Hg(Mn.ownerDocument);return Fo.setStart(Mn,Vn),Fo.setEnd(Mn,Vn),Fo},ao=()=>(Wn||(Wn=H2(lr(Mn,Vn))),Wn),po=()=>ao().length>0,vo=Fo=>Fo&&Mn===Fo.container()&&Vn===Fo.offset(),Ao=Fo=>Yd(Mn,Fo?Vn-1:Vn);return{container:xs(Mn),offset:xs(Vn),toRange:no,getClientRects:ao,isVisible:po,isAtStart:jn,isAtEnd:Gn,isEqual:vo,getNode:Ao}};lr.fromRangeStart=Mn=>lr(Mn.startContainer,Mn.startOffset),lr.fromRangeEnd=Mn=>lr(Mn.endContainer,Mn.endOffset),lr.after=Mn=>lr(Mn.parentNode,e_(Mn)+1),lr.before=Mn=>lr(Mn.parentNode,e_(Mn)),lr.isAbove=(Mn,Vn)=>jc(qa(Vn.getClientRects()),Ya(Mn.getClientRects()),Vb).getOr(!1),lr.isBelow=(Mn,Vn)=>jc(Ya(Vn.getClientRects()),qa(Mn.getClientRects()),zb).getOr(!1),lr.isAtStart=Mn=>Mn?Mn.isAtStart():!1,lr.isAtEnd=Mn=>Mn?Mn.isAtEnd():!1,lr.isTextPosition=Mn=>Mn?Ir(Mn.container()):!1,lr.isElementPosition=Mn=>!lr.isTextPosition(Mn);const H0=(Mn,Vn)=>{Ir(Vn)&&Vn.data.length===0&&Mn.remove(Vn)},Q0=(Mn,Vn,Wn)=>{Vn.insertNode(Wn),H0(Mn,Wn.previousSibling),H0(Mn,Wn.nextSibling)},rp=(Mn,Vn,Wn)=>{const jn=zo.from(Wn.firstChild),Gn=zo.from(Wn.lastChild);Vn.insertNode(Wn),jn.each(no=>H0(Mn,no.previousSibling)),Gn.each(no=>H0(Mn,no.nextSibling))},AS=(Mn,Vn,Wn)=>{Lu(Wn)?rp(Mn,Vn,Wn):Q0(Mn,Vn,Wn)},Uu=Ir,o_=Jm,rb=Eu.nodeIndex,PS=Mn=>{const Vn=Mn.parentNode;return o_(Vn)?PS(Vn):Vn},s_=Mn=>Mn?Ts(Mn.childNodes,(Vn,Wn)=>(o_(Wn)&&Wn.nodeName!=="BR"?Vn=Vn.concat(s_(Wn)):Vn.push(Wn),Vn),[]):[],$S=(Mn,Vn)=>{let Wn=Mn;for(;(Wn=Wn.previousSibling)&&Uu(Wn);)Vn+=Wn.data.length;return Vn},Yy=Mn=>Vn=>Mn===Vn,Kv=Mn=>{let Vn,Wn;Vn=s_(PS(Mn)),Wn=ks(Vn,Yy(Mn),Mn),Vn=Vn.slice(0,Wn+1);const jn=Ts(Vn,(Gn,no,ao)=>(Uu(no)&&Uu(Vn[ao-1])&&Gn++,Gn),0);return Vn=Bh(Vn,Ad([Mn.nodeName])),Wn=ks(Vn,Yy(Mn),Mn),Wn-jn},RS=Mn=>(Uu(Mn)?"text()":Mn.nodeName.toLowerCase())+"["+Kv(Mn)+"]",Q2=(Mn,Vn,Wn)=>{const jn=[];for(let Gn=Vn.parentNode;Gn&&Gn!==Mn;Gn=Gn.parentNode)jn.push(Gn);return jn},Dd=(Mn,Vn)=>{let Wn=[],jn=Vn.container(),Gn=Vn.offset(),no;if(Uu(jn))no=$S(jn,Gn);else{const po=jn.childNodes;Gn>=po.length?(no="after",Gn=po.length-1):no="before",jn=po[Gn]}Wn.push(RS(jn));let ao=Q2(Mn,jn);return ao=Bh(ao,Fs(Jm)),Wn=Wn.concat(ad(ao,po=>RS(po))),Wn.reverse().join("/")+","+no},gf=(Mn,Vn,Wn)=>{let jn=s_(Mn);return jn=Bh(jn,(Gn,no)=>!Uu(Gn)||!Uu(jn[no-1])),jn=Bh(jn,Ad([Vn])),jn[Wn]},eh=(Mn,Vn)=>{let Wn=Mn,jn=0;for(;Uu(Wn);){const Gn=Wn.data.length;if(Vn>=jn&&Vn<=jn+Gn){Mn=Wn,Vn=Vn-jn;break}if(!Uu(Wn.nextSibling)){Mn=Wn,Vn=Gn;break}jn+=Gn,Wn=Wn.nextSibling}return Uu(Mn)&&Vn>Mn.data.length&&(Vn=Mn.data.length),lr(Mn,Vn)},bf=(Mn,Vn)=>{if(!Vn)return null;const Wn=Vn.split(","),jn=Wn[0].split("/"),Gn=Wn.length>1?Wn[1]:"before",no=Ts(jn,(ao,po)=>{const vo=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(po);return vo?(vo[1]==="text()"&&(vo[1]="#text"),gf(ao,vo[1],parseInt(vo[2],10))):null},Mn);if(!no)return null;if(!Uu(no)&&no.parentNode){let ao;return Gn==="after"?ao=rb(no)+1:ao=rb(no),lr(no.parentNode,ao)}return eh(no,parseInt(Gn,10))},$l=jl,Rh=(Mn,Vn,Wn)=>{let jn=Mn(Vn.data.slice(0,Wn)).length;for(let Gn=Vn.previousSibling;Gn&&Ir(Gn);Gn=Gn.previousSibling)jn+=Mn(Gn.data).length;return jn},bu=(Mn,Vn,Wn,jn,Gn)=>{const no=Gn?jn.startContainer:jn.endContainer;let ao=Gn?jn.startOffset:jn.endOffset;const po=[],vo=Mn.getRoot();if(Ir(no))po.push(Wn?Rh(Vn,no,ao):ao);else{let Ao=0;const Fo=no.childNodes;ao>=Fo.length&&Fo.length&&(Ao=1,ao=Math.max(0,Fo.length-1)),po.push(Mn.nodeIndex(Fo[ao],Wn)+Ao)}for(let Ao=no;Ao&&Ao!==vo;Ao=Ao.parentNode)po.push(Mn.nodeIndex(Ao,Wn));return po},vf=(Mn,Vn,Wn,jn)=>{const Gn=Vn.dom,no=bu(Gn,Mn,Wn,jn,!0),ao=Vn.isForward(),po=B1(jn)?{isFakeCaret:!0}:{};if(Vn.isCollapsed())return{start:no,forward:ao,...po};{const vo=bu(Gn,Mn,Wn,jn,!1);return{start:no,end:vo,forward:ao,...po}}},Gy=(Mn,Vn,Wn)=>{let jn=0;return Lr.each(Mn.select(Vn),Gn=>{if(Gn.getAttribute("data-mce-bogus")!=="all"){if(Gn===Wn)return!1;jn++;return}}),jn},d1=(Mn,Vn)=>{let Wn=Vn?Mn.startContainer:Mn.endContainer,jn=Vn?Mn.startOffset:Mn.endOffset;if(Oa(Wn)&&Wn.nodeName==="TR"){const Gn=Wn.childNodes;Wn=Gn[Math.min(Vn?jn:jn-1,Gn.length-1)],Wn&&(jn=Vn?0:Wn.childNodes.length,Vn?Mn.setStart(Wn,jn):Mn.setEnd(Wn,jn))}},Ky=Mn=>(d1(Mn,!0),d1(Mn,!1),Mn),DS=(Mn,Vn)=>{if(Oa(Mn)&&(Mn=Qm(Mn,Vn),$l(Mn)))return Mn;if(La(Mn)){Ir(Mn)&&zr(Mn)&&(Mn=Mn.parentNode);let Wn=Mn.previousSibling;if($l(Wn)||(Wn=Mn.nextSibling,$l(Wn)))return Wn}},xC=Mn=>DS(Mn.startContainer,Mn.startOffset)||DS(Mn.endContainer,Mn.endOffset),r_=(Mn,Vn,Wn)=>{const jn=Wn.getNode(),Gn=Wn.getRng();if(jn.nodeName==="IMG"||$l(jn)){const ao=jn.nodeName;return{name:ao,index:Gy(Wn.dom,ao,jn)}}const no=xC(Gn);if(no){const ao=no.tagName;return{name:ao,index:Gy(Wn.dom,ao,no)}}return vf(Mn,Wn,Vn,Gn)},MS=Mn=>{const Vn=Mn.getRng();return{start:Dd(Mn.dom.getRoot(),lr.fromRangeStart(Vn)),end:Dd(Mn.dom.getRoot(),lr.fromRangeEnd(Vn)),forward:Mn.isForward()}},NS=Mn=>({rng:Mn.getRng(),forward:Mn.isForward()}),V2=(Mn,Vn,Wn)=>{const jn={"data-mce-type":"bookmark",id:Vn,style:"overflow:hidden;line-height:0px"};return Wn?Mn.create("span",jn,""):Mn.create("span",jn)},f1=(Mn,Vn)=>{const Wn=Mn.dom;let jn=Mn.getRng();const Gn=Wn.uniqueId(),no=Mn.isCollapsed(),ao=Mn.getNode(),po=ao.nodeName,vo=Mn.isForward();if(po==="IMG")return{name:po,index:Gy(Wn,po,ao)};const Ao=Ky(jn.cloneRange());if(!no){Ao.collapse(!1);const Qo=V2(Wn,Gn+"_end",Vn);AS(Wn,Ao,Qo)}jn=Ky(jn),jn.collapse(!0);const Fo=V2(Wn,Gn+"_start",Vn);return AS(Wn,jn,Fo),Mn.moveToBookmark({id:Gn,keep:!0,forward:vo}),{id:Gn,forward:vo}},EC=(Mn,Vn,Wn=!1)=>Vn===2?r_(Xo,Wn,Mn):Vn===3?MS(Mn):Vn?NS(Mn):f1(Mn,!1),ib=ws(r_,Qr,!0),Vd=Mn=>{const Vn=no=>no(Mn),Wn=xs(Mn),jn=()=>Gn,Gn={tag:!0,inner:Mn,fold:(no,ao)=>ao(Mn),isValue:Qs,isError:hs,map:no=>ym.value(no(Mn)),mapError:jn,bind:Vn,exists:Vn,forall:Vn,getOr:Wn,or:jn,getOrThunk:Wn,orThunk:jn,getOrDie:Wn,each:no=>{no(Mn)},toOptional:()=>zo.some(Mn)};return Gn},yf=Mn=>{const Vn=()=>Wn,Wn={tag:!1,inner:Mn,fold:(jn,Gn)=>jn(Mn),isValue:hs,isError:Qs,map:Vn,mapError:jn=>ym.error(jn(Mn)),bind:Vn,exists:hs,forall:Qs,getOr:Qr,or:Qr,getOrThunk:_r,orThunk:_r,getOrDie:Br(String(Mn)),each:Js,toOptional:zo.none};return Wn},ym={value:Vd,error:yf,fromOption:(Mn,Vn)=>Mn.fold(()=>yf(Vn),Vd)},Qg={generate:Mn=>{if(!Jo(Mn))throw new Error("cases must be an array");if(Mn.length===0)throw new Error("there must be at least one case");const Vn=[],Wn={};return fs(Mn,(jn,Gn)=>{const no=Al(jn);if(no.length!==1)throw new Error("one and only one name per case");const ao=no[0],po=jn[ao];if(Wn[ao]!==void 0)throw new Error("duplicate key detected:"+ao);if(ao==="cata")throw new Error("cannot have a case named cata (sorry)");if(!Jo(po))throw new Error("case arguments must be an array");Vn.push(ao),Wn[ao]=(...vo)=>{const Ao=vo.length;if(Ao!==po.length)throw new Error("Wrong number of arguments to case "+ao+". Expected "+po.length+" ("+po+"), got "+Ao);return{fold:(...Qo)=>{if(Qo.length!==Mn.length)throw new Error("Wrong number of arguments to fold. Expected "+Mn.length+", got "+Qo.length);return Qo[Gn].apply(null,vo)},match:Qo=>{const qo=Al(Qo);if(Vn.length!==qo.length)throw new Error("Wrong number of arguments to match. Expected: "+Vn.join(",")+` +Actual: `+qo.join(","));if(!gc(Vn,bs=>Zs(qo,bs)))throw new Error("Not all branches were specified when using match. Specified: "+qo.join(", ")+` +Required: `+Vn.join(", "));return Qo[ao].apply(null,vo)},log:Qo=>{console.log(Qo,{constructors:Vn,constructor:ao,params:vo})}}}}),Wn}};Qg.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const Zr=Mn=>{const Vn=[],Wn=[];return fs(Mn,jn=>{jn.fold(Gn=>{Vn.push(Gn)},Gn=>{Wn.push(Gn)})}),{errors:Vn,values:Wn}},LS=Mn=>Mn.type==="inline-command"||Mn.type==="inline-format",Of=Mn=>Mn.type==="block-command"||Mn.type==="block-format",IS=Mn=>{const Vn=jn=>ym.error({message:jn,pattern:Mn}),Wn=(jn,Gn,no)=>{if(Mn.format!==void 0){let ao;if(Jo(Mn.format)){if(!gc(Mn.format,xo))return Vn(jn+" pattern has non-string items in the `format` array");ao=Mn.format}else if(xo(Mn.format))ao=[Mn.format];else return Vn(jn+" pattern has non-string `format` parameter");return ym.value(Gn(ao))}else return Mn.cmd!==void 0?xo(Mn.cmd)?ym.value(no(Mn.cmd,Mn.value)):Vn(jn+" pattern has non-string `cmd` parameter"):Vn(jn+" pattern is missing both `format` and `cmd` parameters")};if(!Io(Mn))return Vn("Raw pattern is not an object");if(!xo(Mn.start))return Vn("Raw pattern is missing `start` parameter");if(Mn.end!==void 0){if(!xo(Mn.end))return Vn("Inline pattern has non-string `end` parameter");if(Mn.start.length===0&&Mn.end.length===0)return Vn("Inline pattern has empty `start` and `end` parameters");let jn=Mn.start,Gn=Mn.end;return Gn.length===0&&(Gn=jn,jn=""),Wn("Inline",no=>({type:"inline-format",start:jn,end:Gn,format:no}),(no,ao)=>({type:"inline-command",start:jn,end:Gn,cmd:no,value:ao}))}else return Mn.replacement!==void 0?xo(Mn.replacement)?Mn.start.length===0?Vn("Replacement pattern has empty `start` parameter"):ym.value({type:"inline-command",start:"",end:Mn.start,cmd:"mceInsertContent",value:Mn.replacement}):Vn("Replacement pattern has non-string `replacement` parameter"):Mn.start.length===0?Vn("Block pattern has empty `start` parameter"):Wn("Block",jn=>({type:"block-format",start:Mn.start,format:jn[0]}),(jn,Gn)=>({type:"block-command",start:Mn.start,cmd:jn,value:Gn}))},Ub=Mn=>nr(Mn,Of),Jy=Mn=>nr(Mn,LS),Om=(Mn,Vn)=>({inlinePatterns:Jy(Mn),blockPatterns:Ub(Mn),dynamicPatternsLookup:Vn}),TC=Mn=>{const Vn=Zr(Us(Mn,IS));return fs(Vn.errors,Wn=>console.error(Wn.message,Wn.pattern)),Vn.values},eO=Mn=>Vn=>{const Wn=Mn(Vn);return TC(Wn)},Cd=xl().deviceType,Vg=Cd.isTouch(),tO=Eu.DOM,h1=Mn=>{const Vn=Mn.indexOf("=")>0?Mn.split(/[;,](?![^=;,]*(?:[;,]|$))/):Mn.split(",");return ra(Vn,(Wn,jn)=>{const Gn=jn.split("="),no=Gn[0],ao=Gn.length>1?Gn[1]:no;return Wn[ih(no)]=ih(ao),Wn},{})},dg=Mn=>Do(Mn,RegExp),ma=Mn=>Vn=>Vn.options.get(Mn),ip=Mn=>xo(Mn)||Io(Mn),BS=(Mn,Vn="")=>Wn=>{const jn=xo(Wn);if(jn)if(Wn.indexOf("=")!==-1){const Gn=h1(Wn);return{value:Ma(Gn,Mn.id).getOr(Vn),valid:jn}}else return{value:Wn,valid:jn};else return{valid:!1,message:"Must be a string."}},m1=Mn=>{const Vn=Mn.options.register;Vn("id",{processor:"string",default:Mn.id}),Vn("selector",{processor:"string"}),Vn("target",{processor:"object"}),Vn("suffix",{processor:"string"}),Vn("cache_suffix",{processor:"string"}),Vn("base_url",{processor:"string"}),Vn("referrer_policy",{processor:"string",default:""}),Vn("language_load",{processor:"boolean",default:!0}),Vn("inline",{processor:"boolean",default:!1}),Vn("iframe_attrs",{processor:"object",default:{}}),Vn("doctype",{processor:"string",default:""}),Vn("document_base_url",{processor:"string",default:Mn.documentBaseUrl}),Vn("body_id",{processor:BS(Mn,"tinymce"),default:"tinymce"}),Vn("body_class",{processor:BS(Mn),default:""}),Vn("content_security_policy",{processor:"string",default:""}),Vn("br_in_pre",{processor:"boolean",default:!0}),Vn("forced_root_block",{processor:Wn=>{const jn=xo(Wn)&&fc(Wn);return jn?{value:Wn,valid:jn}:{valid:!1,message:"Must be a non-empty string."}},default:"p"}),Vn("forced_root_block_attrs",{processor:"object",default:{}}),Vn("newline_behavior",{processor:Wn=>{const jn=Zs(["block","linebreak","invert","default"],Wn);return jn?{value:Wn,valid:jn}:{valid:!1,message:"Must be one of: block, linebreak, invert or default."}},default:"default"}),Vn("br_newline_selector",{processor:"string",default:".mce-toc h2,figcaption,caption"}),Vn("no_newline_selector",{processor:"string",default:""}),Vn("keep_styles",{processor:"boolean",default:!0}),Vn("end_container_on_empty_block",{processor:Wn=>Go(Wn)?{valid:!0,value:Wn}:xo(Wn)?{valid:!0,value:Wn}:{valid:!1,message:"Must be boolean or a string"},default:"blockquote"}),Vn("font_size_style_values",{processor:"string",default:"xx-small,x-small,small,medium,large,x-large,xx-large"}),Vn("font_size_legacy_values",{processor:"string",default:"xx-small,small,medium,large,x-large,xx-large,300%"}),Vn("font_size_classes",{processor:"string",default:""}),Vn("automatic_uploads",{processor:"boolean",default:!0}),Vn("images_reuse_filename",{processor:"boolean",default:!1}),Vn("images_replace_blob_uris",{processor:"boolean",default:!0}),Vn("icons",{processor:"string",default:""}),Vn("icons_url",{processor:"string",default:""}),Vn("images_upload_url",{processor:"string",default:""}),Vn("images_upload_base_path",{processor:"string",default:""}),Vn("images_upload_credentials",{processor:"boolean",default:!1}),Vn("images_upload_handler",{processor:"function"}),Vn("language",{processor:"string",default:"en"}),Vn("language_url",{processor:"string",default:""}),Vn("entity_encoding",{processor:"string",default:"named"}),Vn("indent",{processor:"boolean",default:!0}),Vn("indent_before",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),Vn("indent_after",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),Vn("indent_use_margin",{processor:"boolean",default:!1}),Vn("indentation",{processor:"string",default:"40px"}),Vn("content_css",{processor:Wn=>{const jn=Wn===!1||xo(Wn)||sr(Wn,xo);return jn?xo(Wn)?{value:Us(Wn.split(","),ih),valid:jn}:Jo(Wn)?{value:Wn,valid:jn}:Wn===!1?{value:[],valid:jn}:{value:Wn,valid:jn}:{valid:!1,message:"Must be false, a string or an array of strings."}},default:ZS(Mn)?[]:["default"]}),Vn("content_style",{processor:"string"}),Vn("content_css_cors",{processor:"boolean",default:!1}),Vn("font_css",{processor:Wn=>{const jn=xo(Wn)||sr(Wn,xo);return jn?{value:Jo(Wn)?Wn:Us(Wn.split(","),ih),valid:jn}:{valid:!1,message:"Must be a string or an array of strings."}},default:[]}),Vn("inline_boundaries",{processor:"boolean",default:!0}),Vn("inline_boundaries_selector",{processor:"string",default:"a[href],code,span.mce-annotation"}),Vn("object_resizing",{processor:Wn=>{const jn=Go(Wn)||xo(Wn);return jn?Wn===!1||Cd.isiPhone()||Cd.isiPad()?{value:"",valid:jn}:{value:Wn===!0?"table,img,figure.image,div,video,iframe":Wn,valid:jn}:{valid:!1,message:"Must be boolean or a string"}},default:!Vg}),Vn("resize_img_proportional",{processor:"boolean",default:!0}),Vn("event_root",{processor:"object"}),Vn("service_message",{processor:"string"}),Vn("theme",{processor:Wn=>Wn===!1||xo(Wn)||Yo(Wn),default:"silver"}),Vn("theme_url",{processor:"string"}),Vn("formats",{processor:"object"}),Vn("format_empty_lines",{processor:"boolean",default:!1}),Vn("format_noneditable_selector",{processor:"string",default:""}),Vn("preview_styles",{processor:Wn=>{const jn=Wn===!1||xo(Wn);return jn?{value:Wn===!1?"":Wn,valid:jn}:{valid:!1,message:"Must be false or a string"}},default:"font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"}),Vn("custom_ui_selector",{processor:"string",default:""}),Vn("hidden_input",{processor:"boolean",default:!0}),Vn("submit_patch",{processor:"boolean",default:!0}),Vn("encoding",{processor:"string"}),Vn("add_form_submit_trigger",{processor:"boolean",default:!0}),Vn("add_unload_trigger",{processor:"boolean",default:!0}),Vn("custom_undo_redo_levels",{processor:"number",default:0}),Vn("disable_nodechange",{processor:"boolean",default:!1}),Vn("readonly",{processor:"boolean",default:!1}),Vn("editable_root",{processor:"boolean",default:!0}),Vn("plugins",{processor:"string[]",default:[]}),Vn("external_plugins",{processor:"object"}),Vn("forced_plugins",{processor:"string[]"}),Vn("model",{processor:"string",default:Mn.hasPlugin("rtc")?"plugin":"dom"}),Vn("model_url",{processor:"string"}),Vn("block_unsupported_drop",{processor:"boolean",default:!0}),Vn("visual",{processor:"boolean",default:!0}),Vn("visual_table_class",{processor:"string",default:"mce-item-table"}),Vn("visual_anchor_class",{processor:"string",default:"mce-item-anchor"}),Vn("iframe_aria_text",{processor:"string",default:"Rich Text Area. Press ALT-0 for help."}),Vn("setup",{processor:"function"}),Vn("init_instance_callback",{processor:"function"}),Vn("url_converter",{processor:"function",default:Mn.convertURL}),Vn("url_converter_scope",{processor:"object",default:Mn}),Vn("urlconverter_callback",{processor:"function"}),Vn("allow_conditional_comments",{processor:"boolean",default:!1}),Vn("allow_html_data_urls",{processor:"boolean",default:!1}),Vn("allow_svg_data_urls",{processor:"boolean"}),Vn("allow_html_in_named_anchor",{processor:"boolean",default:!1}),Vn("allow_script_urls",{processor:"boolean",default:!1}),Vn("allow_unsafe_link_target",{processor:"boolean",default:!1}),Vn("convert_fonts_to_spans",{processor:"boolean",default:!0,deprecated:!0}),Vn("fix_list_elements",{processor:"boolean",default:!1}),Vn("preserve_cdata",{processor:"boolean",default:!1}),Vn("remove_trailing_brs",{processor:"boolean",default:!0}),Vn("pad_empty_with_br",{processor:"boolean",default:!1}),Vn("inline_styles",{processor:"boolean",default:!0,deprecated:!0}),Vn("element_format",{processor:"string",default:"html"}),Vn("entities",{processor:"string"}),Vn("schema",{processor:"string",default:"html5"}),Vn("convert_urls",{processor:"boolean",default:!0}),Vn("relative_urls",{processor:"boolean",default:!0}),Vn("remove_script_host",{processor:"boolean",default:!0}),Vn("custom_elements",{processor:"string"}),Vn("extended_valid_elements",{processor:"string"}),Vn("invalid_elements",{processor:"string"}),Vn("invalid_styles",{processor:ip}),Vn("valid_children",{processor:"string"}),Vn("valid_classes",{processor:ip}),Vn("valid_elements",{processor:"string"}),Vn("valid_styles",{processor:ip}),Vn("verify_html",{processor:"boolean",default:!0}),Vn("auto_focus",{processor:Wn=>xo(Wn)||Wn===!0}),Vn("browser_spellcheck",{processor:"boolean",default:!1}),Vn("protect",{processor:"array"}),Vn("images_file_types",{processor:"string",default:"jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp"}),Vn("deprecation_warnings",{processor:"boolean",default:!0}),Vn("a11y_advanced_options",{processor:"boolean",default:!1}),Vn("api_key",{processor:"string"}),Vn("paste_block_drop",{processor:"boolean",default:!1}),Vn("paste_data_images",{processor:"boolean",default:!0}),Vn("paste_preprocess",{processor:"function"}),Vn("paste_postprocess",{processor:"function"}),Vn("paste_webkit_styles",{processor:"string",default:"none"}),Vn("paste_remove_styles_if_webkit",{processor:"boolean",default:!0}),Vn("paste_merge_formats",{processor:"boolean",default:!0}),Vn("smart_paste",{processor:"boolean",default:!0}),Vn("paste_as_text",{processor:"boolean",default:!1}),Vn("paste_tab_spaces",{processor:"number",default:4}),Vn("text_patterns",{processor:Wn=>sr(Wn,Io)||Wn===!1?{value:TC(Wn===!1?[]:Wn),valid:!0}:{valid:!1,message:"Must be an array of objects or false."},default:[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}]}),Vn("text_patterns_lookup",{processor:Wn=>Yo(Wn)?{value:eO(Wn),valid:!0}:{valid:!1,message:"Must be a single function"},default:Wn=>[]}),Vn("noneditable_class",{processor:"string",default:"mceNonEditable"}),Vn("editable_class",{processor:"string",default:"mceEditable"}),Vn("noneditable_regexp",{processor:Wn=>sr(Wn,dg)?{value:Wn,valid:!0}:dg(Wn)?{value:[Wn],valid:!0}:{valid:!1,message:"Must be a RegExp or an array of RegExp."},default:[]}),Vn("table_tab_navigation",{processor:"boolean",default:!0}),Vn("highlight_on_focus",{processor:"boolean",default:!1}),Vn("xss_sanitization",{processor:"boolean",default:!0}),Vn("details_initial_state",{processor:Wn=>{const jn=Zs(["inherited","collapsed","expanded"],Wn);return jn?{value:Wn,valid:jn}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),Vn("details_serialized_state",{processor:Wn=>{const jn=Zs(["inherited","collapsed","expanded"],Wn);return jn?{value:Wn,valid:jn}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),Vn("init_content_sync",{processor:"boolean",default:!1}),Vn("newdocument_content",{processor:"string",default:""}),Vn("force_hex_color",{processor:Wn=>{const jn=["always","rgb_only","off"],Gn=Zs(jn,Wn);return Gn?{value:Wn,valid:Gn}:{valid:!1,message:`Must be one of: ${jn.join(", ")}.`}},default:"off"}),Vn("sandbox_iframes",{processor:"boolean",default:!1}),Vn("convert_unsafe_embeds",{processor:"boolean",default:!1}),Mn.on("ScriptsLoaded",()=>{Vn("directionality",{processor:"string",default:cg.isRtl()?"rtl":void 0}),Vn("placeholder",{processor:"string",default:tO.getAttrib(Mn.getElement(),"placeholder")})})},Ic=ma("iframe_attrs"),FS=ma("doctype"),ap=ma("document_base_url"),i_=ma("body_id"),W2=ma("body_class"),Zu=ma("content_security_policy"),U2=ma("br_in_pre"),bh=ma("forced_root_block"),Zb=ma("forced_root_block_attrs"),Z2=ma("newline_behavior"),q2=ma("br_newline_selector"),HS=ma("no_newline_selector"),j2=ma("keep_styles"),AC=ma("end_container_on_empty_block"),PC=ma("automatic_uploads"),nO=ma("images_reuse_filename"),$C=ma("images_replace_blob_uris"),QS=ma("icons"),V0=ma("icons_url"),X2=ma("images_upload_url"),Y2=ma("images_upload_base_path"),VS=ma("images_upload_credentials"),zS=ma("images_upload_handler"),ab=ma("content_css_cors"),Hl=ma("referrer_policy"),WS=ma("language"),Dh=ma("language_url"),a_=ma("indent_use_margin"),th=ma("indentation"),_m=ma("content_css"),l_=ma("content_style"),RC=ma("font_css"),G2=ma("directionality"),DC=ma("inline_boundaries_selector"),Jv=ma("object_resizing"),MC=ma("resize_img_proportional"),RT=ma("placeholder"),lb=ma("event_root"),K2=ma("service_message"),ey=ma("theme"),J2=ma("theme_url"),c_=ma("model"),US=ma("model_url"),z0=ma("inline_boundaries"),ex=ma("formats"),NC=ma("preview_styles"),LC=ma("format_empty_lines"),zg=ma("format_noneditable_selector"),IC=ma("custom_ui_selector"),ZS=ma("inline"),tx=ma("hidden_input"),BC=ma("submit_patch"),p1=ma("add_form_submit_trigger"),ty=ma("add_unload_trigger"),ny=ma("custom_undo_redo_levels"),u_=ma("disable_nodechange"),oO=ma("readonly"),$p=ma("editable_root"),oy=ma("content_css_cors"),sO=ma("plugins"),qb=ma("external_plugins"),d_=ma("block_unsupported_drop"),nx=ma("visual"),ox=ma("visual_table_class"),FC=ma("visual_anchor_class"),sx=ma("iframe_aria_text"),qS=ma("setup"),rx=ma("init_instance_callback"),ix=ma("urlconverter_callback"),HC=ma("auto_focus"),ax=ma("browser_spellcheck"),QC=ma("protect"),lx=ma("paste_block_drop"),f_=ma("paste_data_images"),cx=ma("paste_preprocess"),VC=ma("paste_postprocess"),sy=ma("newdocument_content"),jS=ma("paste_webkit_styles"),XS=ma("paste_remove_styles_if_webkit"),YS=ma("paste_merge_formats"),h_=ma("smart_paste"),m_=ma("paste_as_text"),zC=ma("paste_tab_spaces"),p_=ma("allow_html_data_urls"),g_=ma("text_patterns"),ux=ma("text_patterns_lookup"),rO=ma("noneditable_class"),WC=ma("editable_class"),dx=ma("noneditable_regexp"),GS=ma("preserve_cdata"),lp=ma("highlight_on_focus"),jb=ma("xss_sanitization"),fx=ma("init_content_sync"),KS=Mn=>Mn.options.isSet("text_patterns_lookup"),hx=Mn=>Lr.explode(Mn.options.get("font_size_style_values")),mx=Mn=>Lr.explode(Mn.options.get("font_size_classes")),JS=Mn=>Mn.options.get("encoding")==="xml",UC=Mn=>Lr.explode(Mn.options.get("images_file_types")),ew=ma("table_tab_navigation"),Zf=ma("details_initial_state"),DT=ma("details_serialized_state"),ry=ma("force_hex_color"),b_=ma("sandbox_iframes"),tw=Oa,nw=Ir,ZC=Mn=>{const Vn=Mn.parentNode;Vn&&Vn.removeChild(Mn)},qC=Mn=>{const Vn=Xo(Mn);return{count:Mn.length-Vn.length,text:Vn}},cb=Mn=>{let Vn;for(;(Vn=Mn.data.lastIndexOf(_o))!==-1;)Mn.deleteData(Vn,1)},W0=(Mn,Vn)=>(_f(Mn),Vn),px=(Mn,Vn)=>{const Wn=qC(Mn.data.substr(0,Vn.offset())),jn=qC(Mn.data.substr(Vn.offset()));return(Wn.text+jn.text).length>0?(cb(Mn),lr(Mn,Vn.offset()-Wn.count)):Vn},gx=(Mn,Vn)=>{const Wn=Vn.container(),jn=Il(kc(Wn.childNodes),Mn).map(Gn=>Gnnw(Mn)&&Vn.container()===Mn?px(Mn,Vn):W0(Mn,Vn),ow=(Mn,Vn)=>Vn.container()===Mn.parentNode?gx(Mn,Vn):W0(Mn,Vn),jC=(Mn,Vn)=>lr.isTextPosition(Vn)?iO(Mn,Vn):ow(Mn,Vn),_f=Mn=>{tw(Mn)&&La(Mn)&&(Ol(Mn)?Mn.removeAttribute("data-mce-caret"):ZC(Mn)),nw(Mn)&&(cb(Mn),Mn.data.length===0&&ZC(Mn))},XC=jl,sw=pu,MT=L1,iy="*[contentEditable=false],video,audio,embed,object",bx=(Mn,Vn,Wn)=>{const jn=ob(Vn.getBoundingClientRect(),Wn);let Gn,no;if(Mn.tagName==="BODY"){const po=Mn.ownerDocument.documentElement;Gn=Mn.scrollLeft||po.scrollLeft,no=Mn.scrollTop||po.scrollTop}else{const po=Mn.getBoundingClientRect();Gn=Mn.scrollLeft-po.left,no=Mn.scrollTop-po.top}jn.left+=Gn,jn.right+=Gn,jn.top+=no,jn.bottom+=no,jn.width=1;let ao=Vn.offsetWidth-Vn.clientWidth;return ao>0&&(Wn&&(ao*=-1),jn.left+=ao,jn.right+=ao),jn},YC=Mn=>{var Vn,Wn;const jn=mf(Cs.fromDom(Mn),iy);for(let Gn=0;Gn{const Gn=Fb();let no,ao;const po=bh(Mn),vo=Mn.dom,Ao=(ls,ys)=>{let Ls;if(Fo(),MT(ys))return null;if(Wn(ys)){const zs=Uh(po,ys,ls),Hs=bx(Vn,ys,ls);vo.setStyle(zs,"top",Hs.top),ao=zs;const tr=vo.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});vo.setStyles(tr,{...Hs}),vo.add(Vn,tr),Gn.set({caret:tr,element:ys,before:ls}),ls&&vo.addClass(tr,"mce-visual-caret-before"),Qo(),Ls=ys.ownerDocument.createRange(),Ls.setStart(zs,0),Ls.setEnd(zs,0)}else return ao=Xu(ys,ls),Ls=ys.ownerDocument.createRange(),v_(ao.nextSibling)?(Ls.setStart(ao,0),Ls.setEnd(ao,0)):(Ls.setStart(ao,1),Ls.setEnd(ao,1)),Ls;return Ls},Fo=()=>{YC(Vn),ao&&(_f(ao),ao=null),Gn.on(ls=>{vo.remove(ls.caret),Gn.clear()}),no&&(clearInterval(no),no=void 0)},Qo=()=>{no=setInterval(()=>{Gn.on(ls=>{jn()?vo.toggleClass(ls.caret,"mce-visual-caret-hidden"):vo.addClass(ls.caret,"mce-visual-caret-hidden")})},500)};return{show:Ao,hide:Fo,getCss:()=>".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}",reposition:()=>{Gn.on(ls=>{const ys=bx(Vn,ls.element,ls.before);vo.setStyles(ls.caret,{...ys})})},destroy:()=>clearInterval(no)}},aO=()=>aa.browser.isFirefox(),v_=Mn=>XC(Mn)||sw(Mn),ay=Mn=>(v_(Mn)||Gp(Mn)&&aO())&&Uc(Cs.fromDom(Mn)).exists(yl),vx=Gf,Xb=jl,GC=pu,Yb=Pg("display","block table table-cell table-caption list-item"),Gb=La,so=zr,co=Oa,wo=Ir,Ho=Xl,ts=Mn=>Mn>0,Os=Mn=>Mn<0,Is=(Mn,Vn)=>{let Wn;for(;Wn=Mn(Vn);)if(!so(Wn))return Wn;return null},qs=(Mn,Vn,Wn,jn,Gn)=>{const no=new mu(Mn,jn),ao=Xb(Mn)||so(Mn);let po;if(Os(Vn)){if(ao&&(po=Is(no.prev.bind(no),!0),Wn(po)))return po;for(;po=Is(no.prev.bind(no),Gn);)if(Wn(po))return po}if(ts(Vn)){if(ao&&(po=Is(no.next.bind(no),!0),Wn(po)))return po;for(;po=Is(no.next.bind(no),Gn);)if(Wn(po))return po}return null},mr=(Mn,Vn)=>{const Wn=Gn=>vx(Gn.dom),jn=Gn=>Gn.dom===Vn;return au(Cs.fromDom(Mn),Wn,jn).map(Gn=>Gn.dom).getOr(Vn)},Xr=(Mn,Vn)=>{for(;Mn&&Mn!==Vn;){if(Yb(Mn))return Mn;Mn=Mn.parentNode}return null},jr=(Mn,Vn,Wn)=>Xr(Mn.container(),Wn)===Xr(Vn.container(),Wn),ua=(Mn,Vn)=>{if(!Vn)return zo.none();const Wn=Vn.container(),jn=Vn.offset();return co(Wn)?zo.from(Wn.childNodes[jn+Mn]):zo.none()},ja=(Mn,Vn)=>{var Wn;const Gn=((Wn=Vn.ownerDocument)!==null&&Wn!==void 0?Wn:document).createRange();return Mn?(Gn.setStartBefore(Vn),Gn.setEndBefore(Vn)):(Gn.setStartAfter(Vn),Gn.setEndAfter(Vn)),Gn},wl=(Mn,Vn,Wn)=>Xr(Vn,Mn)===Xr(Wn,Mn),Kl=(Mn,Vn,Wn)=>{const jn=Mn?"previousSibling":"nextSibling";let Gn=Wn;for(;Gn&&Gn!==Vn;){let no=Gn[jn];if(no&&Gb(no)&&(no=no[jn]),Xb(no)||GC(no)){if(wl(Vn,no,Gn))return no;break}if(Ho(no))break;Gn=Gn.parentNode}return null},Pc=ws(ja,!0),Ul=ws(ja,!1),nu=(Mn,Vn,Wn)=>{let jn;const Gn=ws(Kl,!0,Vn),no=ws(Kl,!1,Vn),ao=Wn.startContainer,po=Wn.startOffset;if(zr(ao)){const vo=wo(ao)?ao.parentNode:ao,Ao=vo.getAttribute("data-mce-caret");if(Ao==="before"&&(jn=vo.nextSibling,ay(jn)))return Pc(jn);if(Ao==="after"&&(jn=vo.previousSibling,ay(jn)))return Ul(jn)}if(!Wn.collapsed)return Wn;if(Ir(ao)){if(Gb(ao)){if(Mn===1){if(jn=no(ao),jn)return Pc(jn);if(jn=Gn(ao),jn)return Ul(jn)}if(Mn===-1){if(jn=Gn(ao),jn)return Ul(jn);if(jn=no(ao),jn)return Pc(jn)}return Wn}if(hm(ao)&&po>=ao.data.length-1)return Mn===1&&(jn=no(ao),jn)?Pc(jn):Wn;if(Jf(ao)&&po<=1)return Mn===-1&&(jn=Gn(ao),jn)?Ul(jn):Wn;if(po===ao.data.length)return jn=no(ao),jn?Pc(jn):Wn;if(po===0)return jn=Gn(ao),jn?Ul(jn):Wn}return Wn},vu=(Mn,Vn)=>ua(Mn?0:-1,Vn).filter(Xb),nh=(Mn,Vn,Wn)=>{const jn=nu(Mn,Vn,Wn);return Mn===-1?lr.fromRangeStart(jn):lr.fromRangeEnd(jn)},Mh=Mn=>zo.from(Mn.getNode()).map(Cs.fromDom),Rp=Mn=>zo.from(Mn.getNode(!0)).map(Cs.fromDom),Mf=(Mn,Vn)=>{let Wn=Vn;for(;Wn=Mn(Wn);)if(Wn.isVisible())return Wn;return Wn},Dp=(Mn,Vn)=>{const Wn=jr(Mn,Vn);return!Wn&&Ec(Mn.getNode())?!0:Wn};var Tu;(function(Mn){Mn[Mn.Backwards=-1]="Backwards",Mn[Mn.Forwards=1]="Forwards"})(Tu||(Tu={}));const yx=jl,U0=Ir,NT=Oa,KC=Ec,ly=Xl,jh=Wu,y_=pm,iw=(Mn,Vn)=>{const Wn=[];let jn=Mn;for(;jn&&jn!==Vn;)Wn.push(jn),jn=jn.parentNode;return Wn},O_=(Mn,Vn)=>Mn.hasChildNodes()&&Vn{if(ts(Mn)){if(ly(Vn.previousSibling)&&!U0(Vn.previousSibling))return lr.before(Vn);if(U0(Vn))return lr(Vn,0)}if(Os(Mn)){if(ly(Vn.nextSibling)&&!U0(Vn.nextSibling))return lr.after(Vn);if(U0(Vn))return lr(Vn,Vn.data.length)}return Os(Mn)?KC(Vn)?lr.before(Vn):lr.after(Vn):lr.before(Vn)},__=(Mn,Vn)=>{const Wn=Vn.nextSibling;return Wn&&ly(Wn)?U0(Wn)?lr(Wn,0):lr.before(Wn):lO(Tu.Forwards,lr.after(Vn),Mn)},lO=(Mn,Vn,Wn)=>{let jn,Gn,no,ao;if(!NT(Wn)||!Vn)return null;if(Vn.isEqual(lr.after(Wn))&&Wn.lastChild){if(ao=lr.after(Wn.lastChild),Os(Mn)&&ly(Wn.lastChild)&&NT(Wn.lastChild))return KC(Wn.lastChild)?lr.before(Wn.lastChild):ao}else ao=Vn;const po=ao.container();let vo=ao.offset();if(U0(po)){if(Os(Mn)&&vo>0)return lr(po,--vo);if(ts(Mn)&&vo0&&(Gn=O_(po,vo-1),ly(Gn)))return!jh(Gn)&&(no=qs(Gn,Mn,y_,Gn),no)?U0(no)?lr(no,no.data.length):lr.after(no):U0(Gn)?lr(Gn,Gn.data.length):lr.before(Gn);if(ts(Mn)&&vo({next:Vn=>lO(Tu.Forwards,Vn,Mn),prev:Vn=>lO(Tu.Backwards,Vn,Mn)}),h3=(Mn,Vn,Wn)=>{const jn=Mn?lr.before(Wn):lr.after(Wn);return vh(Mn,Vn,jn)},m3=Mn=>Ec(Mn)?lr.before(Mn):lr.after(Mn),cy=Mn=>lr.isTextPosition(Mn)?Mn.offset()===0:Xl(Mn.getNode()),S_=Mn=>{if(lr.isTextPosition(Mn)){const Vn=Mn.container();return Mn.offset()===Vn.data.length}else return Xl(Mn.getNode(!0))},JC=(Mn,Vn)=>!lr.isTextPosition(Mn)&&!lr.isTextPosition(Vn)&&Mn.getNode()===Vn.getNode(!0),Kb=Mn=>!lr.isTextPosition(Mn)&&Ec(Mn.getNode()),_x=(Mn,Vn,Wn)=>Mn?!JC(Vn,Wn)&&!Kb(Vn)&&S_(Vn)&&cy(Wn):!JC(Wn,Vn)&&cy(Vn)&&S_(Wn),vh=(Mn,Vn,Wn)=>{const jn=ub(Vn);return zo.from(Mn?jn.next(Wn):jn.prev(Wn))},Z0=(Mn,Vn,Wn)=>vh(Mn,Vn,Wn).bind(jn=>jr(Wn,jn,Vn)&&_x(Mn,Wn,jn)?vh(Mn,Vn,jn):zo.some(jn)),g1=(Mn,Vn,Wn,jn)=>Z0(Mn,Vn,Wn).bind(Gn=>jn(Gn)?g1(Mn,Vn,Gn,jn):zo.some(Gn)),w_=(Mn,Vn)=>{const Wn=Mn?Vn.firstChild:Vn.lastChild;return Ir(Wn)?zo.some(lr(Wn,Mn?0:Wn.data.length)):Wn?Xl(Wn)?zo.some(Mn?lr.before(Wn):m3(Wn)):h3(Mn,Vn,Wn):zo.none()},Sm=ws(vh,!0),cp=ws(vh,!1),zm=ws(w_,!0),b1=ws(w_,!1),ek="_mce_caret",fg=Mn=>Oa(Mn)&&Mn.id===ek,cO=(Mn,Vn)=>{let Wn=Vn;for(;Wn&&Wn!==Mn;){if(fg(Wn))return Wn;Wn=Wn.parentNode}return null},Sx=Mn=>xo(Mn.start),p3=Mn=>Mr(Mn,"rng"),LT=Mn=>Mr(Mn,"id"),aw=Mn=>Mr(Mn,"name"),IT=Mn=>Lr.isArray(Mn.start),lw=Mn=>!aw(Mn)&&Go(Mn.forward)?Mn.forward:!0,tk=(Mn,Vn)=>(Oa(Vn)&&Mn.isBlock(Vn)&&!Vn.innerHTML&&(Vn.innerHTML='
'),Vn),g3=(Mn,Vn)=>{const Wn=zo.from(bf(Mn.getRoot(),Vn.start)),jn=zo.from(bf(Mn.getRoot(),Vn.end));return jc(Wn,jn,(Gn,no)=>{const ao=Mn.createRng();return ao.setStart(Gn.container(),Gn.offset()),ao.setEnd(no.container(),no.offset()),{range:ao,forward:lw(Vn)}})},BT=(Mn,Vn)=>{var Wn;const Gn=((Wn=Mn.ownerDocument)!==null&&Wn!==void 0?Wn:document).createTextNode(_o);Mn.appendChild(Gn),Vn.setStart(Gn,0),Vn.setEnd(Gn,0)},b3=Mn=>!Mn.hasChildNodes(),$N=(Mn,Vn)=>b1(Mn).fold(hs,Wn=>(Vn.setStart(Wn.container(),Wn.offset()),Vn.setEnd(Wn.container(),Wn.offset()),!0)),FT=(Mn,Vn,Wn)=>b3(Vn)&&cO(Mn,Vn)?(BT(Vn,Wn),!0):!1,uc=(Mn,Vn,Wn,jn)=>{const Gn=Wn[Vn?"start":"end"],no=Mn.getRoot();if(Gn){let ao=no,po=Gn[0];for(let vo=Gn.length-1;ao&&vo>=1;vo--){const Ao=ao.childNodes;if(FT(no,ao,jn))return!0;if(Gn[vo]>Ao.length-1)return FT(no,ao,jn)?!0:$N(ao,jn);ao=Ao[Gn[vo]]}Ir(ao)&&(po=Math.min(Gn[0],ao.data.length)),Oa(ao)&&(po=Math.min(Gn[0],ao.childNodes.length)),Vn?jn.setStart(ao,po):jn.setEnd(ao,po)}return!0},db=Mn=>Ir(Mn)&&Mn.data.length>0,uO=(Mn,Vn,Wn)=>{const jn=Mn.get(Wn.id+"_"+Vn),Gn=jn==null?void 0:jn.parentNode,no=Wn.keep;if(jn&&Gn){let ao,po;if(Vn==="start"?no?jn.hasChildNodes()?(ao=jn.firstChild,po=1):db(jn.nextSibling)?(ao=jn.nextSibling,po=0):db(jn.previousSibling)?(ao=jn.previousSibling,po=jn.previousSibling.data.length):(ao=Gn,po=Mn.nodeIndex(jn)+1):(ao=Gn,po=Mn.nodeIndex(jn)):no?jn.hasChildNodes()?(ao=jn.firstChild,po=1):db(jn.previousSibling)?(ao=jn.previousSibling,po=jn.previousSibling.data.length):(ao=Gn,po=Mn.nodeIndex(jn)):(ao=Gn,po=Mn.nodeIndex(jn)),!no){const vo=jn.previousSibling,Ao=jn.nextSibling;Lr.each(Lr.grep(jn.childNodes),Qo=>{Ir(Qo)&&(Qo.data=Qo.data.replace(/\uFEFF/g,""))});let Fo;for(;Fo=Mn.get(Wn.id+"_"+Vn);)Mn.remove(Fo,!0);if(Ir(Ao)&&Ir(vo)&&!aa.browser.isOpera()){const Qo=vo.data.length;vo.appendData(Ao.data),Mn.remove(Ao),ao=vo,po=Qo}}return zo.some(lr(ao,po))}else return zo.none()},wx=(Mn,Vn)=>{const Wn=Mn.createRng();return uc(Mn,!0,Vn,Wn)&&uc(Mn,!1,Vn,Wn)?zo.some({range:Wn,forward:lw(Vn)}):zo.none()},HT=(Mn,Vn)=>{const Wn=uO(Mn,"start",Vn),jn=uO(Mn,"end",Vn);return jc(Wn,jn.or(Wn),(Gn,no)=>{const ao=Mn.createRng();return ao.setStart(tk(Mn,Gn.container()),Gn.offset()),ao.setEnd(tk(Mn,no.container()),no.offset()),{range:ao,forward:lw(Vn)}})},cw=(Mn,Vn)=>zo.from(Mn.select(Vn.name)[Vn.index]).map(Wn=>{const jn=Mn.createRng();return jn.selectNode(Wn),{range:jn,forward:!0}}),v3=(Mn,Vn)=>{const Wn=Mn.dom;if(Vn){if(IT(Vn))return wx(Wn,Vn);if(Sx(Vn))return g3(Wn,Vn);if(LT(Vn))return HT(Wn,Vn);if(aw(Vn))return cw(Wn,Vn);if(p3(Vn))return zo.some({range:Vn.rng,forward:lw(Vn)})}return zo.none()},C_=(Mn,Vn,Wn)=>EC(Mn,Vn,Wn),nk=(Mn,Vn)=>{v3(Mn,Vn).each(({range:Wn,forward:jn})=>{Mn.setRng(Wn,jn)})},hg=Mn=>Oa(Mn)&&Mn.tagName==="SPAN"&&Mn.getAttribute("data-mce-type")==="bookmark",ok=(Mn=>Vn=>Mn===Vn)(hc),k_=Mn=>Mn!==""&&` \f +\r \v`.indexOf(Mn)!==-1,uy=Mn=>!k_(Mn)&&!ok(Mn)&&!hd(Mn),sk=Mn=>{const Vn=[];if(Mn)for(let Wn=0;Wncc(Mn,Vn=>{const Wn=jv(Vn);return Wn?[Cs.fromDom(Wn)]:[]}),dO=Mn=>sk(Mn).length>1,y3=Mn=>nr(rk(Mn),Eh),QT=Mn=>mf(Mn,"td[data-mce-selected],th[data-mce-selected]"),O3=(Mn,Vn)=>{const Wn=QT(Vn);return Wn.length>0?Wn:y3(Mn)},x_=Mn=>O3(sk(Mn.selection.getSel()),Cs.fromDom(Mn.getBody())),q0=(Mn,Vn)=>lm(Mn,"table",Vn),_3=Mn=>{const Vn=Mn.startContainer,Wn=Mn.startOffset;return Ir(Vn)?Wn===0?zo.some(Cs.fromDom(Vn)):zo.none():zo.from(Vn.childNodes[Wn]).map(Cs.fromDom)},S3=Mn=>{const Vn=Mn.endContainer,Wn=Mn.endOffset;return Ir(Vn)?Wn===Vn.data.length?zo.some(Cs.fromDom(Vn)):zo.none():zo.from(Vn.childNodes[Wn-1]).map(Cs.fromDom)},VT=Mn=>iu(Mn).fold(xs([Mn]),Vn=>[Mn].concat(VT(Vn))),Cx=Mn=>am(Mn).fold(xs([Mn]),Vn=>ql(Vn)==="br"?_d(Vn).map(Wn=>[Mn].concat(Cx(Wn))).getOr([]):[Mn].concat(Cx(Vn))),kx=(Mn,Vn)=>jc(_3(Vn),S3(Vn),(Wn,jn)=>{const Gn=xa(VT(Mn),ws(Vs,Wn)),no=xa(Cx(Mn),ws(Vs,jn));return Gn.isSome()&&no.isSome()}).getOr(!1),xx=(Mn,Vn,Wn,jn)=>{const Gn=Wn,no=new mu(Wn,Gn),ao=pr(Mn.schema.getMoveCaretBeforeOnEnterElements(),(vo,Ao)=>!Zs(["td","th","table"],Ao.toLowerCase()));let po=Wn;do{if(Ir(po)&&Lr.trim(po.data).length!==0){jn?Vn.setStart(po,0):Vn.setEnd(po,po.data.length);return}if(ao[po.nodeName]){jn?Vn.setStartBefore(po):po.nodeName==="BR"?Vn.setEndBefore(po):Vn.setEndAfter(po);return}}while(po=jn?no.next():no.prev());Gn.nodeName==="BODY"&&(jn?Vn.setStart(Gn,0):Vn.setEnd(Gn,Gn.childNodes.length))},ik=Mn=>{const Vn=Mn.selection.getSel();return is(Vn)&&Vn.rangeCount>0},dy=(Mn,Vn)=>{const Wn=x_(Mn);Wn.length>0?fs(Wn,jn=>{const Gn=jn.dom,no=Mn.dom.createRng();no.setStartBefore(Gn),no.setEndAfter(Gn),Vn(no,!0)}):Vn(Mn.selection.getRng(),!1)},zT=(Mn,Vn,Wn)=>{const jn=f1(Mn,Vn);Wn(jn),Mn.moveToBookmark(jn)},uw=Mn=>Ys(Mn==null?void 0:Mn.nodeType),Ex=Mn=>Oa(Mn)&&!hg(Mn)&&!fg(Mn)&&!Jm(Mn),w3=(Mn,Vn)=>{if(Ex(Vn)&&!/^(TD|TH)$/.test(Vn.nodeName)){const Wn=Mn.getAttrib(Vn,"data-mce-selected"),jn=parseInt(Wn,10);return!isNaN(jn)&&jn>0}else return!1},dw=(Mn,Vn,Wn)=>{const{selection:jn,dom:Gn}=Mn,no=jn.getNode(),ao=jl(no);zT(jn,!0,()=>{Vn()}),ao&&jl(no)&&Gn.isChildOf(no,Mn.getBody())?Mn.selection.select(no):Wn(jn.getStart())&&C3(Gn,jn)},C3=(Mn,Vn)=>{var Wn,jn;const Gn=Vn.getRng(),{startContainer:no,startOffset:ao}=Gn,po=Vn.getNode();if(!w3(Mn,po)&&Oa(no)){const vo=no.childNodes,Ao=Mn.getRoot();let Fo;if(ao{if(Mn){const jn=Vn?"nextSibling":"previousSibling";for(Mn=Mn[jn];Mn;Mn=Mn[jn])if(Oa(Mn)||!sf(Mn))return Mn}},Nf=(Mn,Vn)=>!!Mn.getTextBlockElements()[Vn.nodeName.toLowerCase()]||Wl(Mn,Vn),j0=(Mn,Vn,Wn)=>Mn.schema.isValidChild(Vn,Wn),sf=(Mn,Vn=!1)=>{if(is(Mn)&&Ir(Mn)){const Wn=Vn?Mn.data.replace(/ /g," "):Mn.data;return Q1(Wn)}else return!1},Wg=Mn=>is(Mn)&&Ir(Mn)&&Mn.length===0,ak=(Mn,Vn)=>{const Wn="[data-mce-cef-wrappable]",jn=zg(Mn),Gn=Td(jn)?Wn:`${Wn},${jn}`;return zh(Cs.fromDom(Vn),Gn)},fw=(Mn,Vn)=>{const Wn=Mn.dom;return Ex(Vn)&&Wn.getContentEditable(Vn)==="false"&&ak(Mn,Vn)&&Wn.select('[contenteditable="true"]',Vn).length===0},fb=(Mn,Vn)=>Yo(Mn)?Mn(Vn):(is(Vn)&&(Mn=Mn.replace(/%(\w+)/g,(Wn,jn)=>Vn[jn]||Wn)),Mn),lk=(Mn,Vn)=>(Mn=Mn||"",Vn=Vn||"",Mn=""+(Mn.nodeName||Mn),Vn=""+(Vn.nodeName||Vn),Mn.toLowerCase()===Vn.toLowerCase()),ck=(Mn,Vn)=>{if(ms(Mn))return null;{let Wn=String(Mn);return(Vn==="color"||Vn==="backgroundColor")&&(Wn=Bm(Wn)),Vn==="fontWeight"&&Mn===700&&(Wn="bold"),Vn==="fontFamily"&&(Wn=Wn.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),Wn}},E_=(Mn,Vn,Wn)=>{const jn=Mn.getStyle(Vn,Wn);return ck(jn,Wn)},WT=(Mn,Vn)=>{let Wn;return Mn.getParent(Vn,jn=>Oa(jn)?(Wn=Mn.getStyle(jn,"text-decoration"),!!Wn&&Wn!=="none"):!1),Wn},hw=(Mn,Vn,Wn)=>Mn.getParents(Vn,Wn,Mn.getRoot()),Tx=(Mn,Vn,Wn)=>{const jn=Mn.formatter.get(Vn);return is(jn)&&Sr(jn,Wn)},Ax=(Mn,Vn)=>Tx(Mn,Vn,jn=>{const Gn=no=>Yo(no)||no.length>1&&no.charAt(0)==="%";return Sr(["styles","attributes"],no=>Ma(jn,no).exists(ao=>{const po=Jo(ao)?ao:ka(ao);return Sr(po,Gn)}))}),k3=(Mn,Vn,Wn)=>{const jn=["inline","block","selector","attributes","styles","classes"],Gn=no=>pr(no,(ao,po)=>Sr(jn,vo=>vo===po));return Tx(Mn,Vn,no=>{const ao=Gn(no);return Tx(Mn,Wn,po=>{const vo=Gn(po);return Na(ao,vo)})})},hb=Mn=>il(Mn,"block"),uk=Mn=>hb(Mn)&&Mn.wrapper===!0,T_=Mn=>hb(Mn)&&Mn.wrapper!==!0,Nh=Mn=>il(Mn,"selector"),Sf=Mn=>il(Mn,"inline"),dk=Mn=>Nh(Mn)&&Sf(Mn)&&qc(Ma(Mn,"mixed"),!0),mw=Mn=>Nh(Mn)&&Mn.expand!==!1&&!Sf(Mn),fk=Mn=>{const Vn=[];let Wn=Mn;for(;Wn;){if(Ir(Wn)&&Wn.data!==_o||Wn.childNodes.length>1)return[];Oa(Wn)&&Vn.push(Wn),Wn=Wn.firstChild}return Vn},pw=Mn=>fk(Mn).length>0,gw=Mn=>fg(Mn.dom)&&pw(Mn.dom),A_=hg,UT=hw,bw=sf,ZT=Nf,qT=Mn=>Ec(Mn)&&Mn.getAttribute("data-mce-bogus")&&!Mn.nextSibling,jT=(Mn,Vn)=>{let Wn=Vn;for(;Wn;){if(Oa(Wn)&&Mn.getContentEditable(Wn))return Mn.getContentEditable(Wn)==="false"?Wn:Vn;Wn=Wn.parentNode}return Vn},Ug=(Mn,Vn,Wn,jn)=>{const Gn=Vn.data;if(Mn){for(let no=Wn;no>0;no--)if(jn(Gn.charAt(no-1)))return no}else for(let no=Wn;noUg(Mn,Vn,Wn,jn=>ok(jn)||k_(jn)),v1=(Mn,Vn,Wn)=>Ug(Mn,Vn,Wn,uy),up=(Mn,Vn,Wn,jn,Gn,no)=>{let ao;const po=Mn.getParent(Wn,Mn.isBlock)||Vn,vo=(Fo,Qo,qo)=>{const ds=Qb(Mn),bs=Gn?ds.backwards:ds.forwards;return zo.from(bs(Fo,Qo,(ls,ys)=>A_(ls.parentNode)?-1:(ao=ls,qo(Gn,ls,ys)),po))};return vo(Wn,jn,Xh).bind(Fo=>no?vo(Fo.container,Fo.offset+(Gn?-1:0),v1):zo.some(Fo)).orThunk(()=>ao?zo.some({container:ao,offset:Gn?0:ao.length}):zo.none())},vw=(Mn,Vn,Wn,jn,Gn)=>{const no=jn[Gn];Ir(jn)&&Td(jn.data)&&no&&(jn=no);const ao=UT(Mn,jn);for(let po=0;po{var Gn;let no=Wn;const ao=Mn.getRoot(),po=Vn[0];if(hb(po)&&(no=po.wrapper?null:Mn.getParent(Wn,po.block,ao)),!no){const vo=(Gn=Mn.getParent(Wn,"LI,TD,TH,SUMMARY"))!==null&&Gn!==void 0?Gn:ao;no=Mn.getParent(Ir(Wn)?Wn.parentNode:Wn,Ao=>Ao!==ao&&ZT(Mn.schema,Ao),vo)}if(no&&hb(po)&&po.wrapper&&(no=UT(Mn,no,"ul,ol").reverse()[0]||no),!no)for(no=Wn;no&&no[jn]&&!Mn.isBlock(no[jn])&&(no=no[jn],!lk(no,"br")););return no||Wn},XT=(Mn,Vn,Wn,jn)=>{const Gn=Wn.parentNode;return is(Wn[jn])?!1:Gn===Vn||ms(Gn)||Mn.isBlock(Gn)?!0:XT(Mn,Vn,Gn,jn)},yw=(Mn,Vn,Wn,jn,Gn)=>{let no=Wn;const ao=Gn?"previousSibling":"nextSibling",po=Mn.getRoot();if(Ir(Wn)&&!bw(Wn)&&(Gn?jn>0:jnA_(Mn.parentNode)||A_(Mn),X0=(Mn,Vn,Wn,jn=!1)=>{let{startContainer:Gn,startOffset:no,endContainer:ao,endOffset:po}=Vn;const vo=Wn[0];return Oa(Gn)&&Gn.hasChildNodes()&&(Gn=Qm(Gn,no),Ir(Gn)&&(no=0)),Oa(ao)&&ao.hasChildNodes()&&(ao=Qm(ao,Vn.collapsed?po:po-1),Ir(ao)&&(po=ao.data.length)),Gn=jT(Mn,Gn),ao=jT(Mn,ao),x3(Gn)&&(Gn=A_(Gn)?Gn:Gn.parentNode,Vn.collapsed?Gn=Gn.previousSibling||Gn:Gn=Gn.nextSibling||Gn,Ir(Gn)&&(no=Vn.collapsed?Gn.length:0)),x3(ao)&&(ao=A_(ao)?ao:ao.parentNode,Vn.collapsed?ao=ao.nextSibling||ao:ao=ao.previousSibling||ao,Ir(ao)&&(po=Vn.collapsed?0:ao.length)),Vn.collapsed&&(up(Mn,Mn.getRoot(),Gn,no,!0,jn).each(({container:Qo,offset:qo})=>{Gn=Qo,no=qo}),up(Mn,Mn.getRoot(),ao,po,!1,jn).each(({container:Qo,offset:qo})=>{ao=Qo,po=qo})),(Sf(vo)||vo.block_expand)&&((!Sf(vo)||!Ir(Gn)||no===0)&&(Gn=yw(Mn,Wn,Gn,no,!0)),(!Sf(vo)||!Ir(ao)||po===ao.data.length)&&(ao=yw(Mn,Wn,ao,po,!1))),mw(vo)&&(Gn=vw(Mn,Wn,Vn,Gn,"previousSibling"),ao=vw(Mn,Wn,Vn,ao,"nextSibling")),(hb(vo)||Nh(vo))&&(Gn=hk(Mn,Wn,Gn,"previousSibling"),ao=hk(Mn,Wn,ao,"nextSibling"),hb(vo)&&(Mn.isBlock(Gn)||(Gn=yw(Mn,Wn,Gn,no,!0)),Mn.isBlock(ao)||(ao=yw(Mn,Wn,ao,po,!1)))),Oa(Gn)&&Gn.parentNode&&(no=Mn.nodeIndex(Gn),Gn=Gn.parentNode),Oa(ao)&&ao.parentNode&&(po=Mn.nodeIndex(ao)+1,ao=ao.parentNode),{startContainer:Gn,startOffset:no,endContainer:ao,endOffset:po}},Ow=(Mn,Vn,Wn)=>{var jn;const Gn=Vn.startOffset,no=Qm(Vn.startContainer,Gn),ao=Vn.endOffset,po=Qm(Vn.endContainer,ao-1),vo=ys=>{const Ls=ys[0];Ir(Ls)&&Ls===no&&Gn>=Ls.data.length&&ys.splice(0,1);const zs=ys[ys.length-1];return ao===0&&ys.length>0&&zs===po&&Ir(zs)&&ys.splice(ys.length-1,1),ys},Ao=(ys,Ls,zs)=>{const Hs=[];for(;ys&&ys!==zs;ys=ys[Ls])Hs.push(ys);return Hs},Fo=(ys,Ls)=>Mn.getParent(ys,zs=>zs.parentNode===Ls,Ls),Qo=(ys,Ls,zs)=>{const Hs=zs?"nextSibling":"previousSibling";for(let tr=ys,Pr=tr.parentNode;tr&&tr!==Ls;tr=Pr){Pr=tr.parentNode;const Ur=Ao(tr===ys?tr:tr[Hs],Hs);Ur.length&&(zs||Ur.reverse(),Wn(vo(Ur)))}};if(no===po)return Wn(vo([no]));const qo=(jn=Mn.findCommonAncestor(no,po))!==null&&jn!==void 0?jn:Mn.getRoot();if(Mn.isChildOf(no,po))return Qo(no,qo,!0);if(Mn.isChildOf(po,no))return Qo(po,qo);const ds=Fo(no,qo)||no,bs=Fo(po,qo)||po;Qo(no,ds,!0);const ls=Ao(ds===no?ds:ds.nextSibling,"nextSibling",bs===po?bs.nextSibling:bs);ls.length&&Wn(vo(ls)),Qo(po,bs)},Px=['pre[class*=language-][contenteditable="false"]',"figure.image","div[data-ephox-embed-iri]","div.tiny-pageembed","div.mce-toc","div[data-mce-toc]"],YT=Mn=>qd(Mn)&&fm(Mn)===_o,GT=(Mn,Vn,Wn,jn)=>Wc(Vn).fold(()=>"skipping",Gn=>jn==="br"||YT(Vn)?"valid":yC(Vn)?"existing":fg(Vn.dom)?"caret":Sr(Px,no=>zh(Vn,no))?"valid-block":!j0(Mn,Wn,jn)||!j0(Mn,ql(Gn),Wn)?"invalid-child":"valid"),$x=(Mn,Vn)=>{const Wn=X0(Mn.dom,Vn,[{inline:"span"}]);Vn.setStart(Wn.startContainer,Wn.startOffset),Vn.setEnd(Wn.endContainer,Wn.endOffset),Mn.selection.setRng(Vn)},mk=(Mn,Vn,Wn,jn,Gn,no)=>{const{uid:ao=Vn,...po}=Wn;Xm(Mn,XO()),Gc(Mn,`${Uv()}`,ao),Gc(Mn,`${u1()}`,jn);const{attributes:vo={},classes:Ao=[]}=Gn(ao,po);if(im(Mn,vo),L2(Mn,Ao),no){Ao.length>0&&Gc(Mn,`${D0()}`,Ao.join(","));const Fo=Al(vo);Fo.length>0&&Gc(Mn,`${M0()}`,Fo.join(","))}},Au=Mn=>{Vf(Mn,XO()),Mu(Mn,`${Uv()}`),Mu(Mn,`${u1()}`),Mu(Mn,`${Hb()}`);const Vn=Ld(Mn,`${M0()}`).map(jn=>jn.split(",")).getOr([]),Wn=Ld(Mn,`${D0()}`).map(jn=>jn.split(",")).getOr([]);fs(Vn,jn=>Mu(Mn,jn)),SC(Mn,Wn),Mu(Mn,`${D0()}`),Mu(Mn,`${M0()}`)},Y0=(Mn,Vn,Wn,jn,Gn)=>{const no=Cs.fromTag("span",Mn);return mk(no,Vn,Wn,jn,Gn,!1),no},KT=(Mn,Vn,Wn,jn,Gn,no)=>{const ao=[],po=Y0(Mn.getDoc(),Wn,no,jn,Gn),vo=Fb(),Ao=()=>{vo.clear()},Fo=()=>vo.get().getOrThunk(()=>{const bs=Hm(po);return ao.push(bs),vo.set(bs),bs}),Qo=bs=>{fs(bs,qo)},qo=bs=>{switch(GT(Mn,bs,"span",ql(bs))){case"invalid-child":{Ao();const ys=Ku(bs);Qo(ys),Ao();break}case"valid-block":{Ao(),mk(bs,Wn,no,jn,Gn,!0);break}case"valid":{const ys=Fo();_0(bs,ys);break}}},ds=bs=>{const ls=Us(bs,Cs.fromDom);Qo(ls)};return Ow(Mn.dom,Vn,bs=>{Ao(),ds(bs)}),ao},Rx=(Mn,Vn,Wn,jn)=>{Mn.undoManager.transact(()=>{const Gn=Mn.selection,no=Gn.getRng(),ao=x_(Mn).length>0,po=L0("mce-annotation");if(no.collapsed&&!ao&&$x(Mn,no),Gn.getRng().collapsed&&!ao){const vo=Y0(Mn.getDoc(),po,jn,Vn,Wn.decorate);dm(vo,hc),Gn.getRng().insertNode(vo.dom),Gn.select(vo.dom)}else zT(Gn,!1,()=>{dy(Mn,vo=>{KT(Mn,vo,po,Vn,Wn.decorate,jn)})})})},Dx=Mn=>{const Vn=_C();Fm(Mn,Vn);const Wn=gh(Mn,Vn),jn=Qh("span"),Gn=no=>{fs(no,ao=>{jn(ao)?hf(ao):Au(ao)})};return{register:(no,ao)=>{Vn.register(no,ao)},annotate:(no,ao)=>{Vn.lookup(no).each(po=>{Rx(Mn,no,po,ao)})},annotationChanged:(no,ao)=>{Wn.addListener(no,ao)},remove:no=>{wd(Mn,zo.some(no)).each(({elements:ao})=>{const po=Mn.selection.getBookmark();Gn(ao),Mn.selection.moveToBookmark(po)})},removeAll:no=>{const ao=Mn.selection.getBookmark();Rr(YO(Mn,no),(po,vo)=>{Gn(po)}),Mn.selection.moveToBookmark(ao)},getAll:no=>{const ao=YO(Mn,no);return Pl(ao,po=>Us(po,vo=>vo.dom))}}},fO=Mn=>({getBookmark:ws(C_,Mn),moveToBookmark:ws(nk,Mn)});fO.isBookmarkNode=hg;const Mx=(Mn,Vn,Wn)=>Wn.collapsed?!1:Sr(Wn.getClientRects(),jn=>xS(jn,Mn,Vn)),Nx=(Mn,Vn)=>Mn.dispatch("PreProcess",Vn),E3=(Mn,Vn)=>Mn.dispatch("PostProcess",Vn),P_=Mn=>{Mn.dispatch("remove")},$_=Mn=>{Mn.dispatch("detach")},Lx=(Mn,Vn)=>{Mn.dispatch("SwitchMode",{mode:Vn})},Ix=(Mn,Vn,Wn,jn,Gn)=>{Mn.dispatch("ObjectResizeStart",{target:Vn,width:Wn,height:jn,origin:Gn})},y1=(Mn,Vn,Wn,jn,Gn)=>{Mn.dispatch("ObjectResized",{target:Vn,width:Wn,height:jn,origin:Gn})},fy=Mn=>{Mn.dispatch("PreInit")},T3=Mn=>{Mn.dispatch("PostRender")},_w=Mn=>{Mn.dispatch("Init")},A3=(Mn,Vn)=>{Mn.dispatch("PlaceholderToggle",{state:Vn})},Mp=(Mn,Vn,Wn)=>{Mn.dispatch(Vn,Wn)},Yh=(Mn,Vn,Wn,jn)=>{Mn.dispatch("FormatApply",{format:Vn,node:Wn,vars:jn})},hO=(Mn,Vn,Wn,jn)=>{Mn.dispatch("FormatRemove",{format:Vn,node:Wn,vars:jn})},RN=(Mn,Vn)=>Mn.dispatch("BeforeSetContent",Vn),JT=(Mn,Vn)=>Mn.dispatch("SetContent",Vn),P3=(Mn,Vn)=>Mn.dispatch("BeforeGetContent",Vn),ic=(Mn,Vn)=>Mn.dispatch("GetContent",Vn),Bx=(Mn,Vn)=>{Mn.dispatch("AutocompleterStart",Vn)},eA=(Mn,Vn)=>{Mn.dispatch("AutocompleterUpdate",Vn)},Fx=Mn=>{Mn.dispatch("AutocompleterEnd")},$3=(Mn,Vn,Wn)=>Mn.dispatch("PastePreProcess",{content:Vn,internal:Wn}),R3=(Mn,Vn,Wn)=>Mn.dispatch("PastePostProcess",{node:Vn,internal:Wn}),tA=(Mn,Vn)=>Mn.dispatch("PastePlainTextToggle",{state:Vn}),D3=(Mn,Vn)=>Mn.dispatch("EditableRootStateChange",{state:Vn}),va={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:Mn=>Mn.shiftKey||Mn.ctrlKey||Mn.altKey||va.metaKeyPressed(Mn),metaKeyPressed:Mn=>aa.os.isMacOS()||aa.os.isiOS()?Mn.metaKey:Mn.ctrlKey&&!Mn.altKey},hy="data-mce-selected",nA="table,img,figure.image,hr,video,span.mce-preview-object,details",Sw=Math.abs,ww=Math.round,M3={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},DN=Mn=>Mn.type==="longpress"||Mn.type.indexOf("touch")===0,MN=(Mn,Vn)=>{const Wn=Vn.dom,jn=Vn.getDoc(),Gn=document,no=Vn.getBody();let ao,po,vo,Ao,Fo,Qo,qo,ds,bs,ls,ys,Ls,zs,Hs,tr,Pr,Ur;const fa=Yr=>is(Yr)&&(td(Yr)||Wn.is(Yr,"figure.image")),yr=Yr=>pu(Yr)||Wn.hasClass(Yr,"mce-preview-object"),fr=(Yr,pl)=>{if(DN(Yr)){const pc=Yr.touches[0];return fa(Yr.target)&&!Mx(pc.clientX,pc.clientY,pl)}else return fa(Yr.target)&&!Mx(Yr.clientX,Yr.clientY,pl)},Ar=Yr=>{const pl=Yr.target;fr(Yr,Vn.selection.getRng())&&!Yr.isDefaultPrevented()&&Vn.selection.select(pl)},wa=Yr=>Wn.hasClass(Yr,"mce-preview-object")&&is(Yr.firstElementChild)?[Yr,Yr.firstElementChild]:Wn.is(Yr,"figure.image")?[Yr.querySelector("img")]:[Yr],Va=Yr=>{const pl=Jv(Vn);return!pl||Yr.getAttribute("data-mce-resize")==="false"||Yr===Vn.getBody()?!1:Wn.hasClass(Yr,"mce-preview-object")&&is(Yr.firstElementChild)?zh(Cs.fromDom(Yr.firstElementChild),pl):zh(Cs.fromDom(Yr),pl)},Tl=Yr=>yr(Yr)?Wn.create("img",{src:aa.transparentSrc}):Yr.cloneNode(!0),tc=(Yr,pl,pc)=>{if(is(pc)){const Pu=wa(Yr);fs(Pu,du=>{du.style[pl]||!Vn.schema.isValid(du.nodeName.toLowerCase(),pl)?Wn.setStyle(du,pl,pc):Wn.setAttrib(du,pl,""+pc)})}},uu=(Yr,pl,pc)=>{tc(Yr,"width",pl),tc(Yr,"height",pc)},Qu=Yr=>{let pl,pc,Pu,du,Oh;pl=Yr.screenX-Qo,pc=Yr.screenY-qo,Hs=pl*Ao[2]+ls,tr=pc*Ao[3]+ys,Hs=Hs<5?5:Hs,tr=tr<5?5:tr,(fa(ao)||yr(ao))&&MC(Vn)!==!1?Pu=!va.modifierPressed(Yr):Pu=va.modifierPressed(Yr),Pu&&(Sw(pl)>Sw(pc)?(tr=ww(Hs*Ls),Hs=ww(tr/Ls)):(Hs=ww(tr/Ls),tr=ww(Hs*Ls))),uu(po,Hs,tr),du=Ao.startPos.x+pl,Oh=Ao.startPos.y+pc,du=du>0?du:0,Oh=Oh>0?Oh:0,Wn.setStyles(vo,{left:du,top:Oh,display:"block"}),vo.innerHTML=Hs+" × "+tr,Ao[2]<0&&po.clientWidth<=Hs&&Wn.setStyle(po,"left",ds+(ls-Hs)),Ao[3]<0&&po.clientHeight<=tr&&Wn.setStyle(po,"top",bs+(ys-tr)),pl=no.scrollWidth-Pr,pc=no.scrollHeight-Ur,pl+pc!==0&&Wn.setStyles(vo,{left:du-pl,top:Oh-pc}),zs||(Ix(Vn,ao,ls,ys,"corner-"+Ao.name),zs=!0)},Wd=()=>{const Yr=zs;zs=!1,Yr&&(tc(ao,"width",Hs),tc(ao,"height",tr)),Wn.unbind(jn,"mousemove",Qu),Wn.unbind(jn,"mouseup",Wd),Gn!==jn&&(Wn.unbind(Gn,"mousemove",Qu),Wn.unbind(Gn,"mouseup",Wd)),Wn.remove(po),Wn.remove(vo),Wn.remove(Fo),Jh(ao),Yr&&(y1(Vn,ao,Hs,tr,"corner-"+Ao.name),Wn.setAttrib(ao,"style",Wn.getAttrib(ao,"style"))),Vn.nodeChanged()},Jh=Yr=>{ac();const pl=Wn.getPos(Yr,no),pc=pl.x,Pu=pl.y,du=Yr.getBoundingClientRect(),Oh=du.width||du.right-du.left,h0=du.height||du.bottom-du.top;ao!==Yr&&(ea(),ao=Yr,Hs=tr=0);const Ay=Vn.dispatch("ObjectSelected",{target:Yr});Va(Yr)&&!Ay.isDefaultPrevented()?Rr(M3,(Ip,Sb)=>{const Sl=ru=>{const Kd=wa(ao)[0];Qo=ru.screenX,qo=ru.screenY,ls=Kd.clientWidth,ys=Kd.clientHeight,Ls=ys/ls,Ao=Ip,Ao.name=Sb,Ao.startPos={x:Oh*Ip[0]+pc,y:h0*Ip[1]+Pu},Pr=no.scrollWidth,Ur=no.scrollHeight,Fo=Wn.add(no,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),Wn.setStyles(Fo,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),po=Tl(ao),Wn.addClass(po,"mce-clonedresizable"),Wn.setAttrib(po,"data-mce-bogus","all"),po.contentEditable="false",Wn.setStyles(po,{left:pc,top:Pu,margin:0}),uu(po,Oh,h0),po.removeAttribute(hy),no.appendChild(po),Wn.bind(jn,"mousemove",Qu),Wn.bind(jn,"mouseup",Wd),Gn!==jn&&(Wn.bind(Gn,"mousemove",Qu),Wn.bind(Gn,"mouseup",Wd)),vo=Wn.add(no,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},ls+" × "+ys)};let Mc=Wn.get("mceResizeHandle"+Sb);Mc&&Wn.remove(Mc),Mc=Wn.add(no,"div",{id:"mceResizeHandle"+Sb,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+Sb+"-resize; margin:0; padding:0"}),Wn.bind(Mc,"mousedown",ru=>{ru.stopImmediatePropagation(),ru.preventDefault(),Sl(ru)}),Ip.elm=Mc,Wn.setStyles(Mc,{left:Oh*Ip[0]+pc-Mc.offsetWidth/2,top:h0*Ip[1]+Pu-Mc.offsetHeight/2})}):ea(!1)},_u=Zy(Jh,0),ea=(Yr=!0)=>{_u.cancel(),ac(),ao&&Yr&&ao.removeAttribute(hy),Rr(M3,(pl,pc)=>{const Pu=Wn.get("mceResizeHandle"+pc);Pu&&(Wn.unbind(Pu),Wn.remove(Pu))})},pa=(Yr,pl)=>Wn.isChildOf(Yr,pl),$c=Yr=>{if(zs||Vn.removed||Vn.composing)return;const pl=Yr.type==="mousedown"?Yr.target:Mn.getNode(),pc=cm(Cs.fromDom(pl),nA).map(du=>du.dom).filter(du=>Wn.isEditable(du.parentElement)||du.nodeName==="IMG"&&Wn.isEditable(du)).getOrUndefined(),Pu=is(pc)?Wn.getAttrib(pc,hy,"1"):"1";if(fs(Wn.select(`img[${hy}],hr[${hy}]`),du=>{du.removeAttribute(hy)}),is(pc)&&pa(pc,no)&&Vn.hasFocus()){Pa();const du=Mn.getStart(!0);if(pa(du,pc)&&pa(Mn.getEnd(!0),pc)){Wn.setAttrib(pc,hy,Pu),_u.throttle(pc);return}}ea()},ac=()=>{Rr(M3,Yr=>{Yr.elm&&(Wn.unbind(Yr.elm),delete Yr.elm)})},Pa=()=>{try{Vn.getDoc().execCommand("enableObjectResizing",!1,"false")}catch{}};return Vn.on("init",()=>{Pa(),Vn.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",$c),Vn.on("keyup compositionend",Yr=>{ao&&ao.nodeName==="TABLE"&&$c(Yr)}),Vn.on("hide blur",ea),Vn.on("contextmenu longpress",Ar,!0)}),Vn.on("remove",ac),{isResizable:Va,showResizeRect:Jh,hideResizeRect:ea,updateResizeRect:$c,destroy:()=>{_u.cancel(),ao=po=Fo=null}}},uH=(Mn,Vn)=>{Vn.fold(Wn=>{Mn.setStartBefore(Wn.dom)},(Wn,jn)=>{Mn.setStart(Wn.dom,jn)},Wn=>{Mn.setStartAfter(Wn.dom)})},N3=(Mn,Vn)=>{Vn.fold(Wn=>{Mn.setEndBefore(Wn.dom)},(Wn,jn)=>{Mn.setEnd(Wn.dom,jn)},Wn=>{Mn.setEndAfter(Wn.dom)})},oA=(Mn,Vn,Wn)=>{const jn=Mn.document.createRange();return uH(jn,Vn),N3(jn,Wn),jn},Ja=(Mn,Vn,Wn,jn,Gn)=>{const no=Mn.document.createRange();return no.setStart(Vn.dom,Wn),no.setEnd(jn.dom,Gn),no},G0=Qg.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),sA=(Mn,Vn,Wn)=>Vn(Cs.fromDom(Wn.startContainer),Wn.startOffset,Cs.fromDom(Wn.endContainer),Wn.endOffset),L3=(Mn,Vn)=>Vn.match({domRange:Wn=>({ltr:xs(Wn),rtl:zo.none}),relative:(Wn,jn)=>({ltr:br(()=>oA(Mn,Wn,jn)),rtl:br(()=>zo.some(oA(Mn,jn,Wn)))}),exact:(Wn,jn,Gn,no)=>({ltr:br(()=>Ja(Mn,Wn,jn,Gn,no)),rtl:br(()=>zo.some(Ja(Mn,Gn,no,Wn,jn)))})}),Cw=(Mn,Vn)=>{const Wn=Vn.ltr();return Wn.collapsed?Vn.rtl().filter(Gn=>Gn.collapsed===!1).map(Gn=>G0.rtl(Cs.fromDom(Gn.endContainer),Gn.endOffset,Cs.fromDom(Gn.startContainer),Gn.startOffset)).getOrThunk(()=>sA(Mn,G0.ltr,Wn)):sA(Mn,G0.ltr,Wn)},I3=(Mn,Vn)=>{const Wn=L3(Mn,Vn);return Cw(Mn,Wn)};G0.ltr,G0.rtl;const Hx={create:(Mn,Vn,Wn,jn)=>({start:Mn,soffset:Vn,finish:Wn,foffset:jn})},iA=(Mn,Vn,Wn)=>{var jn,Gn;return zo.from((Gn=(jn=Mn.dom).caretPositionFromPoint)===null||Gn===void 0?void 0:Gn.call(jn,Vn,Wn)).bind(no=>{if(no.offsetNode===null)return zo.none();const ao=Mn.dom.createRange();return ao.setStart(no.offsetNode,no.offset),ao.collapse(),zo.some(ao)})},pk=(Mn,Vn,Wn)=>{var jn,Gn;return zo.from((Gn=(jn=Mn.dom).caretRangeFromPoint)===null||Gn===void 0?void 0:Gn.call(jn,Vn,Wn))},B3=document.caretPositionFromPoint?iA:document.caretRangeFromPoint?pk:zo.none,F3=(Mn,Vn,Wn)=>{const jn=Cs.fromDom(Mn.document);return B3(jn,Vn,Wn).map(Gn=>Hx.create(Cs.fromDom(Gn.startContainer),Gn.startOffset,Cs.fromDom(Gn.endContainer),Gn.endOffset))},R_=Qg.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Qx=(Mn,Vn,Wn,jn)=>Mn.fold(Vn,Wn,jn),aA=Mn=>Mn.fold(Qr,Qr,Qr),H3=R_.before,Q3=R_.on,gk=R_.after,Jb={before:H3,on:Q3,after:gk,cata:Qx,getStart:aA},bk=Qg.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Bc=Mn=>bk.exact(Mn.start,Mn.soffset,Mn.finish,Mn.foffset),V3=Mn=>Mn.match({domRange:Vn=>Cs.fromDom(Vn.startContainer),relative:(Vn,Wn)=>Jb.getStart(Vn),exact:(Vn,Wn,jn,Gn)=>Vn}),K0=bk.domRange,e0=bk.relative,vk=bk.exact,mg=Mn=>{const Vn=V3(Mn);return _c(Vn)},yk=Hx.create,J0={domRange:K0,relative:e0,exact:vk,exactFromRange:Bc,getWin:mg,range:yk},D_=(Mn,Vn)=>{const Wn=ql(Mn);return Wn==="input"?Jb.after(Mn):Zs(["br","img"],Wn)?Vn===0?Jb.before(Mn):Jb.after(Mn):Jb.on(Mn,Vn)},kw=(Mn,Vn)=>{const Wn=Mn.fold(Jb.before,D_,Jb.after),jn=Vn.fold(Jb.before,D_,Jb.after);return J0.relative(Wn,jn)},Vx=(Mn,Vn,Wn,jn)=>{const Gn=D_(Mn,Vn),no=D_(Wn,jn);return J0.relative(Gn,no)},z3=Mn=>Mn.match({domRange:Vn=>{const Wn=Cs.fromDom(Vn.startContainer),jn=Cs.fromDom(Vn.endContainer);return Vx(Wn,Vn.startOffset,jn,Vn.endOffset)},relative:kw,exact:Vx}),zx=(Mn,Vn)=>{const jn=document.createDocumentFragment();return fs(Mn,Gn=>{jn.appendChild(Gn.dom)}),Cs.fromDom(jn)},W3=Mn=>{const Vn=J0.getWin(Mn).dom,Wn=(Gn,no,ao,po)=>Ja(Vn,Gn,no,ao,po),jn=z3(Mn);return I3(Vn,jn).match({ltr:Wn,rtl:Wn})},dc=(Mn,Vn,Wn)=>F3(Mn,Vn,Wn),pg=(Mn,Vn,Wn)=>{const jn=_c(Cs.fromDom(Wn));return dc(jn.dom,Mn,Vn).map(Gn=>{const no=Wn.createRange();return no.setStart(Gn.start.dom,Gn.soffset),no.setEnd(Gn.finish.dom,Gn.foffset),no}).getOrUndefined()},ev=(Mn,Vn)=>is(Mn)&&is(Vn)&&Mn.startContainer===Vn.startContainer&&Mn.startOffset===Vn.startOffset&&Mn.endContainer===Vn.endContainer&&Mn.endOffset===Vn.endOffset,U3=(Mn,Vn,Wn)=>{let jn=Mn;for(;jn&&jn!==Vn;){if(Wn(jn))return jn;jn=jn.parentNode}return null},M_=(Mn,Vn,Wn)=>U3(Mn,Vn,Wn)!==null,wc=(Mn,Vn,Wn)=>M_(Mn,Vn,jn=>jn.nodeName===Wn),Z3=(Mn,Vn)=>La(Mn)&&!M_(Mn,Vn,fg),Wx=(Mn,Vn,Wn)=>{const jn=Vn.parentNode;if(jn){const Gn=new mu(Vn,Mn.getParent(jn,Mn.isBlock)||Mn.getRoot());let no;for(;no=Gn[Wn?"prev":"next"]();)if(Ec(no))return!0}return!1},eo=(Mn,Vn)=>{var Wn;return((Wn=Mn.previousSibling)===null||Wn===void 0?void 0:Wn.nodeName)===Vn},ro=(Mn,Vn)=>{let Wn=Vn;for(;Wn&&Wn!==Mn;){if(jl(Wn))return!0;Wn=Wn.parentNode}return!1},fo=(Mn,Vn,Wn,jn,Gn)=>{const no=Mn.getRoot(),ao=Mn.schema.getNonEmptyElements(),po=Gn.parentNode;let vo,Ao;if(!po)return zo.none();const Fo=Mn.getParent(po,Mn.isBlock)||no;if(jn&&Ec(Gn)&&Vn&&Mn.isEmpty(Fo))return zo.some(lr(po,Mn.nodeIndex(Gn)));const Qo=new mu(Gn,Fo);for(;Ao=Qo[jn?"prev":"next"]();){if(Mn.getContentEditableParent(Ao)==="false"||Z3(Ao,no))return zo.none();if(Ir(Ao)&&Ao.data.length>0)return wc(Ao,no,"A")?zo.none():zo.some(lr(Ao,jn?Ao.data.length:0));if(Mn.isBlock(Ao)||ao[Ao.nodeName.toLowerCase()])return zo.none();vo=Ao}return Dg(vo)?zo.none():Wn&&vo?zo.some(lr(vo,0)):zo.none()},go=(Mn,Vn,Wn,jn)=>{const Gn=Mn.getRoot();let no,ao=!1,po=Wn?jn.startContainer:jn.endContainer,vo=Wn?jn.startOffset:jn.endOffset;const Ao=Oa(po)&&vo===po.childNodes.length,Fo=Mn.schema.getNonEmptyElements();let Qo=Wn;if(La(po))return zo.none();if(Oa(po)&&vo>po.childNodes.length-1&&(Qo=!1),Nm(po)&&(po=Gn,vo=0),po===Gn){if(Qo&&(no=po.childNodes[vo>0?vo-1:0],no&&(La(no)||Fo[no.nodeName]||Gp(no))))return zo.none();if(po.hasChildNodes()){if(vo=Math.min(!Qo&&vo>0?vo-1:vo,po.childNodes.length-1),po=po.childNodes[vo],vo=Ir(po)&&Ao?po.data.length:0,!Vn&&po===Gn.lastChild&&Gp(po)||ro(Gn,po)||La(po)||Er(po))return zo.none();if(po.hasChildNodes()&&!Gp(po)){no=po;const qo=new mu(po,Gn);do{if(jl(no)||La(no)){ao=!1;break}if(Ir(no)&&no.data.length>0){vo=Qo?0:no.data.length,po=no,ao=!0;break}if(Fo[no.nodeName.toLowerCase()]&&!Bd(no)){vo=Mn.nodeIndex(no),po=no.parentNode,Qo||vo++,ao=!0;break}}while(no=Qo?qo.next():qo.prev())}}}return Vn&&(Ir(po)&&vo===0&&fo(Mn,Ao,Vn,!0,po).each(qo=>{po=qo.container(),vo=qo.offset(),ao=!0}),Oa(po)&&(no=po.childNodes[vo],no||(no=po.childNodes[vo-1]),no&&Ec(no)&&!eo(no,"A")&&!Wx(Mn,no,!1)&&!Wx(Mn,no,!0)&&fo(Mn,Ao,Vn,!0,no).each(qo=>{po=qo.container(),vo=qo.offset(),ao=!0}))),Qo&&!Vn&&Ir(po)&&vo===po.data.length&&fo(Mn,Ao,Vn,!1,po).each(qo=>{po=qo.container(),vo=qo.offset(),ao=!0}),ao&&po?zo.some(lr(po,vo)):zo.none()},To=(Mn,Vn)=>{const Wn=Vn.collapsed,jn=Vn.cloneRange(),Gn=lr.fromRangeStart(Vn);return go(Mn,Wn,!0,jn).each(no=>{(!Wn||!lr.isAbove(Gn,no))&&jn.setStart(no.container(),no.offset())}),Wn||go(Mn,Wn,!1,jn).each(no=>{jn.setEnd(no.container(),no.offset())}),Wn&&jn.collapse(!0),ev(Vn,jn)?zo.none():zo.some(jn)},No=(Mn,Vn)=>Mn.splitText(Vn),Zo=Mn=>{let Vn=Mn.startContainer,Wn=Mn.startOffset,jn=Mn.endContainer,Gn=Mn.endOffset;if(Vn===jn&&Ir(Vn)){if(Wn>0&&WnWn){Gn=Gn-Wn;const no=No(jn,Gn).previousSibling;Vn=jn=no,Gn=no.data.length,Wn=0}else Gn=0}else if(Ir(Vn)&&Wn>0&&Wn0&&Gn({walk:(no,ao)=>Ow(Mn,no,ao),split:Zo,expand:(no,ao={type:"word"})=>{if(ao.type==="word"){const po=X0(Mn,no,[{inline:"span"}]),vo=Mn.createRng();return vo.setStart(po.startContainer,po.startOffset),vo.setEnd(po.endContainer,po.endOffset),vo}return no},normalize:no=>To(Mn,no).fold(hs,ao=>(no.setStart(ao.startContainer,ao.startOffset),no.setEnd(ao.endContainer,ao.endOffset),!0))});ns.compareRanges=ev,ns.getCaretRangeFromPoint=pg,ns.getSelectedNode=jv,ns.getNode=Qm;const $s=((Mn,Vn)=>{const Wn=(po,vo)=>{if(!Ys(vo)&&!vo.match(/^[0-9]+$/))throw new Error(Mn+".set accepts only positive integer values. Value was "+vo);const Ao=po.dom;jp(Ao)&&(Ao.style[Mn]=vo+"px")},jn=po=>{const vo=Vn(po);if(vo<=0||vo===null){const Ao=Ju(po,Mn);return parseFloat(Ao)||0}return vo},Gn=jn,no=(po,vo)=>ra(vo,(Ao,Fo)=>{const Qo=Ju(po,Fo),qo=Qo===void 0?0:parseInt(Qo,10);return isNaN(qo)?Ao:Ao+qo},0);return{set:Wn,get:jn,getOuter:Gn,aggregate:no,max:(po,vo,Ao)=>{const Fo=no(po,Ao);return vo>Fo?vo-Fo:0}}})("height",Mn=>{const Vn=Mn.dom;return Ag(Mn)?Vn.getBoundingClientRect().height:Vn.offsetHeight}),js=Mn=>$s.get(Mn),Nr=()=>Cs.fromDom(document),la=(Mn,Vn)=>Mn.view(Vn).fold(xs([]),jn=>{const Gn=Mn.owner(jn),no=la(Mn,Gn);return[jn].concat(no)}),sa=(Mn,Vn)=>{const Wn=Vn.owner(Mn);return la(Vn,Wn)};var Cr=Object.freeze({__proto__:null,view:Mn=>{var Vn;return(Mn.dom===document?zo.none():zo.from((Vn=Mn.dom.defaultView)===null||Vn===void 0?void 0:Vn.frameElement)).map(Cs.fromDom)},owner:Mn=>Fa(Mn)});const Ra=Mn=>{const Vn=Nr(),Wn=Ea(Vn),jn=sa(Mn,Cr),Gn=$r(Mn),no=Kr(jn,(ao,po)=>{const vo=$r(po);return{left:ao.left+vo.left,top:ao.top+vo.top}},{left:0,top:0});return Bo(no.left+Gn.left+Wn.left,no.top+Gn.top+Wn.top)},dl=Mn=>ql(Mn)==="textarea",Bl=(Mn,Vn)=>Mn.dispatch("ScrollIntoView",Vn).isDefaultPrevented(),Gu=(Mn,Vn)=>{Mn.dispatch("AfterScrollIntoView",Vn)},qf=(Mn,Vn)=>{const Wn=Ku(Mn);if(Wn.length===0||dl(Mn))return{element:Mn,offset:Vn};if(Vn{const Wn=Rs(Mn),jn=js(Mn);return{element:Mn,bottom:Wn.top+jn,height:jn,pos:Wn,cleanup:Vn}},dp=(Mn,Vn)=>{const Wn=qf(Mn,Vn),jn=Cs.fromHtml(''+_o+"");return ed(Wn.element,jn),zd(jn,()=>sc(jn))},mO=Mn=>zd(Cs.fromDom(Mn),Js),pO=(Mn,Vn,Wn,jn)=>{wm(Mn,(Gn,no)=>Ok(Mn,Vn,Wn,jn),Wn)},Ux=(Mn,Vn,Wn,jn,Gn)=>{const no={elm:jn.element.dom,alignToTop:Gn};if(Bl(Mn,no))return;const ao=Ea(Vn).top;Wn(Mn,Vn,ao,jn,Gn),Gu(Mn,no)},Ok=(Mn,Vn,Wn,jn)=>{const Gn=Cs.fromDom(Mn.getBody()),no=Cs.fromDom(Mn.getDoc());xu(Gn);const ao=dp(Cs.fromDom(Wn.startContainer),Wn.startOffset);Ux(Mn,no,Vn,ao,jn),ao.cleanup()},yu=(Mn,Vn,Wn,jn)=>{const Gn=Cs.fromDom(Mn.getDoc());Ux(Mn,Gn,Wn,mO(Vn),jn)},wm=(Mn,Vn,Wn)=>{const jn=Wn.startContainer,Gn=Wn.startOffset,no=Wn.endContainer,ao=Wn.endOffset;Vn(Cs.fromDom(jn),Cs.fromDom(no));const po=Mn.dom.createRng();po.setStart(jn,Gn),po.setEnd(no,ao),Mn.selection.setRng(Wn)},Lh=(Mn,Vn,Wn,jn,Gn)=>{const no=Vn.pos;if(jn)ll(no.left,no.top,Gn);else{const ao=no.top-Wn+Vn.height;ll(-Mn.getBody().getBoundingClientRect().left,ao,Gn)}},gg=(Mn,Vn,Wn,jn,Gn,no)=>{const ao=jn+Wn,po=Gn.pos.top,vo=Gn.bottom,Ao=vo-po>=jn;poao?Lh(Mn,Gn,jn,Ao?no!==!1:no===!0,Vn):vo>ao&&!Ao&&Lh(Mn,Gn,jn,no===!0,Vn)},Np=(Mn,Vn,Wn,jn,Gn)=>{const no=_c(Vn).dom.innerHeight;gg(Mn,Vn,Wn,no,jn,Gn)},my=(Mn,Vn,Wn,jn,Gn)=>{const no=_c(Vn).dom.innerHeight;gg(Mn,Vn,Wn,no,jn,Gn);const ao=Ra(jn.element),po=zu(window);ao.toppo.bottom&&nl(jn.element,Gn===!0)},Wm=(Mn,Vn,Wn)=>pO(Mn,Np,Vn,Wn),Zx=(Mn,Vn,Wn)=>yu(Mn,Vn,Np,Wn),xw=(Mn,Vn,Wn)=>pO(Mn,my,Vn,Wn),t0=(Mn,Vn,Wn)=>yu(Mn,Vn,my,Wn),Gh=(Mn,Vn,Wn)=>{(Mn.inline?Zx:t0)(Mn,Vn,Wn)},Ew=(Mn,Vn,Wn)=>{(Mn.inline?Wm:xw)(Mn,Vn,Wn)},lA=(Mn,Vn=!1)=>Mn.dom.focus({preventScroll:Vn}),cA=Mn=>{const Vn=Wf(Mn).dom;return Mn.dom===Vn.activeElement},N_=(Mn=Nr())=>zo.from(Mn.dom.activeElement).map(Cs.fromDom),uA=Mn=>N_(Wf(Mn)).filter(Vn=>Mn.dom.contains(Vn.dom)),_k=(Mn,Vn)=>{const Wn=qd(Vn)?fm(Vn).length:Ku(Vn).length+1;return Mn>Wn?Wn:Mn<0?0:Mn},dA=Mn=>J0.range(Mn.start,_k(Mn.soffset,Mn.start),Mn.finish,_k(Mn.foffset,Mn.finish)),gO=(Mn,Vn)=>!Xp(Vn.dom)&&(Dr(Mn,Vn)||Vs(Mn,Vn)),NN=Mn=>Vn=>gO(Mn,Vn.start)&&gO(Mn,Vn.finish),dH=Mn=>Mn.inline||aa.browser.isFirefox(),fH=Mn=>J0.range(Cs.fromDom(Mn.startContainer),Mn.startOffset,Cs.fromDom(Mn.endContainer),Mn.endOffset),hH=Mn=>{const Vn=Mn.getSelection();return(!Vn||Vn.rangeCount===0?zo.none():zo.from(Vn.getRangeAt(0))).map(fH)},mH=Mn=>{const Vn=_c(Mn);return hH(Vn.dom).filter(NN(Mn))},LN=(Mn,Vn)=>zo.from(Vn).filter(NN(Mn)).map(dA),IN=Mn=>{const Vn=document.createRange();try{return Vn.setStart(Mn.start.dom,Mn.soffset),Vn.setEnd(Mn.finish.dom,Mn.foffset),zo.some(Vn)}catch{return zo.none()}},Sk=Mn=>{const Vn=dH(Mn)?mH(Cs.fromDom(Mn.getBody())):zo.none();Mn.bookmark=Vn.isSome()?Vn:Mn.bookmark},q3=Mn=>(Mn.bookmark?Mn.bookmark:zo.none()).bind(Wn=>LN(Cs.fromDom(Mn.getBody()),Wn)).bind(IN),pH=Mn=>{q3(Mn).each(Vn=>Mn.selection.setRng(Vn))},FN={isEditorUIElement:Mn=>{const Vn=Mn.className.toString();return Vn.indexOf("tox-")!==-1||Vn.indexOf("mce-")!==-1}},HN=(Mn,Vn)=>(Ys(Vn)||(Vn=0),setTimeout(Mn,Vn)),QN=(Mn,Vn)=>(Ys(Vn)||(Vn=0),setInterval(Mn,Vn)),O1={setEditorTimeout:(Mn,Vn,Wn)=>HN(()=>{Mn.removed||Vn()},Wn),setEditorInterval:(Mn,Vn,Wn)=>{const jn=QN(()=>{Mn.removed?clearInterval(jn):Vn()},Wn);return jn}},gH=Mn=>Mn.type==="nodechange"&&Mn.selectionChange,bH=(Mn,Vn)=>{const Wn=()=>{Vn.throttle()};Eu.DOM.bind(document,"mouseup",Wn),Mn.on("remove",()=>{Eu.DOM.unbind(document,"mouseup",Wn)})},vH=(Mn,Vn)=>{Mn.on("mouseup touchend",Wn=>{Vn.throttle()})},yH=(Mn,Vn)=>{vH(Mn,Vn),Mn.on("keyup NodeChange AfterSetSelectionRange",Wn=>{gH(Wn)||Sk(Mn)})},fA=Mn=>{const Vn=Zy(()=>{Sk(Mn)},0);Mn.on("init",()=>{Mn.inline&&bH(Mn,Vn),yH(Mn,Vn)}),Mn.on("remove",()=>{Vn.cancel()})};let Tw;const hA=Eu.DOM,VN=Mn=>Oa(Mn)&&FN.isEditorUIElement(Mn),mA=Mn=>{const Vn=Mn.classList;return Vn!==void 0?Vn.contains("tox-edit-area")||Vn.contains("tox-edit-area__iframe")||Vn.contains("mce-content-body"):!1},pA=(Mn,Vn)=>{const Wn=IC(Mn);return hA.getParent(Vn,Gn=>VN(Gn)||(Wn?Mn.dom.is(Gn,Wn):!1))!==null},j3=Mn=>{try{const Vn=Wf(Cs.fromDom(Mn.getElement()));return N_(Vn).fold(()=>document.body,Wn=>Wn.dom)}catch{return document.body}},OH=(Mn,Vn)=>{const Wn=Vn.editor;fA(Wn);const jn=(Gn,no)=>{if(lp(Gn)&&Gn.inline!==!0){const ao=Cs.fromDom(Gn.getContainer());no(ao,"tox-edit-focus")}};Wn.on("focusin",()=>{const Gn=Mn.focusedEditor;mA(j3(Wn))&&jn(Wn,Xm),Gn!==Wn&&(Gn&&Gn.dispatch("blur",{focusedEditor:Wn}),Mn.setActive(Wn),Mn.focusedEditor=Wn,Wn.dispatch("focus",{blurredEditor:Gn}),Wn.focus(!0))}),Wn.on("focusout",()=>{O1.setEditorTimeout(Wn,()=>{const Gn=Mn.focusedEditor;(!mA(j3(Wn))||Gn!==Wn)&&jn(Wn,Vf),!pA(Wn,j3(Wn))&&Gn===Wn&&(Wn.dispatch("blur",{focusedEditor:null}),Mn.focusedEditor=null)})}),Tw||(Tw=Gn=>{const no=Mn.activeEditor;no&&Zp(Gn).each(ao=>{const po=ao;po.ownerDocument===document&&po!==document.body&&!pA(no,po)&&Mn.focusedEditor===no&&(no.dispatch("blur",{focusedEditor:null}),Mn.focusedEditor=null)})},hA.bind(document,"focusin",Tw))},_H=(Mn,Vn)=>{Mn.focusedEditor===Vn.editor&&(Mn.focusedEditor=null),!Mn.activeEditor&&Tw&&(hA.unbind(document,"focusin",Tw),Tw=null)},SH=Mn=>{Mn.on("AddEditor",ws(OH,Mn)),Mn.on("RemoveEditor",ws(_H,Mn))},wH=(Mn,Vn)=>Mn.dom.getParent(Vn,Wn=>Mn.dom.getContentEditable(Wn)==="true"),CH=Mn=>Mn.collapsed?zo.from(Qm(Mn.startContainer,Mn.startOffset)).map(Cs.fromDom):zo.none(),kH=(Mn,Vn)=>CH(Vn).bind(Wn=>mh(Wn)?zo.some(Wn):Dr(Mn,Wn)?zo.none():zo.some(Mn)),zN=(Mn,Vn)=>{kH(Cs.fromDom(Mn.getBody()),Vn).bind(Wn=>zm(Wn.dom)).fold(()=>{Mn.selection.normalize()},Wn=>Mn.selection.setRng(Wn.toRange()))},X3=Mn=>{if(Mn.setActive)try{Mn.setActive()}catch{Mn.focus()}else Mn.focus()},xH=Mn=>cA(Mn)||uA(Mn).isSome(),EH=Mn=>is(Mn.iframeElement)&&cA(Cs.fromDom(Mn.iframeElement)),gA=Mn=>{const Vn=Mn.getBody();return Vn&&xH(Cs.fromDom(Vn))},WN=Mn=>{const Vn=Wf(Cs.fromDom(Mn.getElement()));return N_(Vn).filter(Wn=>!mA(Wn.dom)&&pA(Mn,Wn.dom)).isSome()},L_=Mn=>Mn.inline?gA(Mn):EH(Mn),UN=Mn=>L_(Mn)||WN(Mn),TH=Mn=>{const Vn=Mn.selection,Wn=Mn.getBody();let jn=Vn.getRng();Mn.quirks.refreshContentEditable(),is(Mn.bookmark)&&!L_(Mn)&&q3(Mn).each(no=>{Mn.selection.setRng(no),jn=no});const Gn=wH(Mn,Vn.getNode());if(Gn&&Mn.dom.isChildOf(Gn,Wn)){X3(Gn),zN(Mn,jn),Y3(Mn);return}Mn.inline||(aa.browser.isOpera()||X3(Wn),Mn.getWin().focus()),(aa.browser.isFirefox()||Mn.inline)&&(X3(Wn),zN(Mn,jn)),Y3(Mn)},Y3=Mn=>Mn.editorManager.setActive(Mn),AH=(Mn,Vn)=>{Mn.removed||(Vn?Y3(Mn):TH(Mn))},ZN=(Mn,Vn)=>Vn.collapsed?Mn.isEditable(Vn.startContainer):Mn.isEditable(Vn.startContainer)&&Mn.isEditable(Vn.endContainer),qN=(Mn,Vn,Wn,jn,Gn)=>{const no=Wn?Vn.startContainer:Vn.endContainer,ao=Wn?Vn.startOffset:Vn.endOffset;return zo.from(no).map(Cs.fromDom).map(po=>!jn||!Vn.collapsed?Rm(po,Gn(po,ao)).getOr(po):po).bind(po=>lf(po)?zo.some(po):Wc(po).filter(lf)).map(po=>po.dom).getOr(Mn)},G3=(Mn,Vn,Wn=!1)=>qN(Mn,Vn,!0,Wn,(jn,Gn)=>Math.min(Af(jn),Gn)),jN=(Mn,Vn,Wn=!1)=>qN(Mn,Vn,!1,Wn,(jn,Gn)=>Gn>0?Gn-1:Gn),K3=(Mn,Vn)=>{const Wn=Mn;for(;Mn&&Ir(Mn)&&Mn.length===0;)Mn=Vn?Mn.nextSibling:Mn.previousSibling;return Mn||Wn},XN=(Mn,Vn)=>{if(!Vn)return Mn;let Wn=Vn.startContainer,jn=Vn.endContainer;const Gn=Vn.startOffset,no=Vn.endOffset;let ao=Vn.commonAncestorContainer;Vn.collapsed||(Wn===jn&&no-Gn<2&&Wn.hasChildNodes()&&(ao=Wn.childNodes[Gn]),Ir(Wn)&&Ir(jn)&&(Wn.length===Gn?Wn=K3(Wn.nextSibling,!0):Wn=Wn.parentNode,no===0?jn=K3(jn.previousSibling,!1):jn=jn.parentNode,Wn&&Wn===jn&&(ao=Wn)));const po=Ir(ao)?ao.parentNode:ao;return pf(po)?po:Mn},PH=(Mn,Vn,Wn,jn)=>{const Gn=[],no=Mn.getRoot(),ao=Mn.getParent(Wn||G3(no,Vn,Vn.collapsed),Mn.isBlock),po=Mn.getParent(jn||jN(no,Vn,Vn.collapsed),Mn.isBlock);if(ao&&ao!==no&&Gn.push(ao),ao&&po&&ao!==po){let vo;const Ao=new mu(ao,no);for(;(vo=Ao.next())&&vo!==po;)Mn.isBlock(vo)&&Gn.push(vo)}return po&&ao!==po&&po!==no&&Gn.push(po),Gn},$H=(Mn,Vn,Wn)=>zo.from(Vn).bind(jn=>zo.from(jn.parentNode).map(Gn=>{const no=Mn.nodeIndex(jn),ao=Mn.createRng();return ao.setStart(Gn,no),ao.setEnd(Gn,no+1),Wn&&(xx(Mn,ao,jn,!0),xx(Mn,ao,jn,!1)),ao})),J3=(Mn,Vn)=>Us(Vn,Wn=>{const jn=Mn.dispatch("GetSelectionRange",{range:Wn});return jn.range!==Wn?jn.range:Wn}),RH=Mn=>ql(Mn)==="img"?1:Mb(Mn).fold(()=>Ku(Mn).length,Vn=>Vn.length),DH=Mn=>Mb(Mn).filter(Vn=>Vn.trim().length!==0||Vn.indexOf(hc)>-1).isSome(),MH=Mn=>Du(Mn)&&Tf(Mn,"contenteditable")==="false",NH=["img","br"],YN=Mn=>DH(Mn)||Zs(NH,ql(Mn))||MH(Mn),LH=Mn=>tf(Mn,YN),IH=Mn=>BH(Mn,YN),BH=(Mn,Vn)=>{const Wn=jn=>{const Gn=Ku(jn);for(let no=Gn.length-1;no>=0;no--){const ao=Gn[no];if(Vn(ao))return zo.some(ao);const po=Wn(ao);if(po.isSome())return po}return zo.none()};return Wn(Mn)},GN="[data-mce-autocompleter]",FH=(Mn,Vn)=>{if(KN(Cs.fromDom(Mn.getBody())).isNone()){const Wn=Cs.fromHtml('',Mn.getDoc());Fu(Wn,Cs.fromDom(Vn.extractContents())),Vn.insertNode(Wn.dom),Wc(Wn).each(jn=>jn.dom.normalize()),IH(Wn).map(jn=>{Mn.selection.setCursorLocation(jn.dom,RH(jn))})}},HH=Mn=>cm(Mn,GN),KN=Mn=>uf(Mn,GN),QH=(Mn,Vn)=>KN(Vn).each(Wn=>{const jn=Mn.selection.getBookmark();hf(Wn),Mn.selection.moveToBookmark(jn)}),VH={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},bA=(Mn,Vn,Wn)=>{const jn=Wn?"lastChild":"firstChild",Gn=Wn?"prev":"next";if(Mn[jn])return Mn[jn];if(Mn!==Vn){let no=Mn[Gn];if(no)return no;for(let ao=Mn.parent;ao&&ao!==Vn;ao=ao.parent)if(no=ao[Gn],no)return no}},zH=Mn=>{var Vn;const Wn=(Vn=Mn.value)!==null&&Vn!==void 0?Vn:"";if(!Q1(Wn))return!1;const jn=Mn.parent;return!(jn&&(jn.name!=="span"||jn.attr("style"))&&/^[ ]+$/.test(Wn))},Za=Mn=>{const Vn=Mn.name==="a"&&!Mn.attr("href")&&Mn.attr("id");return Mn.attr("name")||Mn.attr("id")&&!Mn.firstChild||Mn.attr("data-mce-bookmark")||Vn};class fp{static create(Vn,Wn){const jn=new fp(Vn,VH[Vn]||1);return Wn&&Rr(Wn,(Gn,no)=>{jn.attr(no,Gn)}),jn}constructor(Vn,Wn){this.name=Vn,this.type=Wn,Wn===1&&(this.attributes=[],this.attributes.map={})}replace(Vn){const Wn=this;return Vn.parent&&Vn.remove(),Wn.insert(Vn,Wn),Wn.remove(),Wn}attr(Vn,Wn){const jn=this;if(!xo(Vn))return is(Vn)&&Rr(Vn,(no,ao)=>{jn.attr(ao,no)}),jn;const Gn=jn.attributes;if(Gn){if(Wn!==void 0){if(Wn===null){if(Vn in Gn.map){delete Gn.map[Vn];let no=Gn.length;for(;no--;)if(Gn[no].name===Vn)return Gn.splice(no,1),jn}return jn}if(Vn in Gn.map){let no=Gn.length;for(;no--;)if(Gn[no].name===Vn){Gn[no].value=Wn;break}}else Gn.push({name:Vn,value:Wn});return Gn.map[Vn]=Wn,jn}return Gn.map[Vn]}}clone(){const Vn=this,Wn=new fp(Vn.name,Vn.type),jn=Vn.attributes;if(jn){const Gn=[];Gn.map={};for(let no=0,ao=jn.length;noxo(Mn.nodeValue)&&Mn.nodeValue.includes(_o),vA=Mn=>`${Mn.length===0?"":`${Us(Mn,Vn=>`[${Vn}]`).join(",")},`}[data-mce-bogus="all"]`,WH=(Mn,Vn)=>Vn.querySelectorAll(vA(Mn)),t5=Mn=>document.createTreeWalker(Mn,NodeFilter.SHOW_COMMENT,Vn=>e5(Vn)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP),n5=Mn=>document.createTreeWalker(Mn,NodeFilter.SHOW_TEXT,Vn=>{if(e5(Vn)){const Wn=Vn.parentNode;return Wn&&Mr(JN,Wn.nodeName)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}else return NodeFilter.FILTER_SKIP}),UH=Mn=>t5(Mn).nextNode()!==null,ZH=Mn=>n5(Mn).nextNode()!==null,yA=(Mn,Vn)=>Vn.querySelector(vA(Mn))!==null,o5=(Mn,Vn)=>{fs(WH(Mn,Vn),Wn=>{const jn=Cs.fromDom(Wn);Tf(jn,"data-mce-bogus")==="all"?sc(jn):fs(Mn,Gn=>{Od(jn,Gn)&&Mu(jn,Gn)})})},qH=Mn=>{let Vn=Mn.nextNode();for(;Vn!==null;)Vn.nodeValue=null,Vn=Mn.nextNode()},jH=ko(qH,t5),Cl=ko(qH,n5),s5=(Mn,Vn)=>{const Wn=[{condition:ws(yA,Vn),action:ws(o5,Vn)},{condition:UH,action:jH},{condition:ZH,action:Cl}];let jn=Mn,Gn=!1;return fs(Wn,({condition:no,action:ao})=>{no(jn)&&(Gn||(jn=Mn.cloneNode(!0),Gn=!0),ao(jn))}),jn},Rl=Mn=>{const Vn=mf(Mn,"[data-mce-bogus]");fs(Vn,Wn=>{Tf(Wn,"data-mce-bogus")==="all"?sc(Wn):np(Wn)?(ed(Wn,Cs.fromText(k0)),sc(Wn)):hf(Wn)})},eR=Mn=>{const Vn=mf(Mn,"input");fs(Vn,Wn=>{Mu(Wn,"name")})},IY=(Mn,Vn)=>{const Wn=bh(Mn),jn=new RegExp(`^(<${Wn}[^>]*>( | |\\s| |
|)<\\/${Wn}>[\r +]*|
[\r +]*)$`);return Vn.replace(jn,"")},BY=(Mn,Vn)=>{const Wn=Mn.getDoc(),jn=Wf(Cs.fromDom(Mn.getBody())),Gn=Cs.fromTag("div",Wn);Gc(Gn,"data-mce-bogus","all"),ff(Gn,{position:"fixed",left:"-9999999px",top:"0"}),dm(Gn,Vn.innerHTML),Rl(Gn),eR(Gn);const no=Ny(jn);Fu(no,Gn);const ao=Xo(Gn.dom.innerText);return sc(Gn),ao},XH=(Mn,Vn,Wn)=>{let jn;return Vn.format==="raw"?jn=Lr.trim(Xo(s5(Wn,Mn.serializer.getTempAttrs()).innerHTML)):Vn.format==="text"?jn=BY(Mn,Wn):Vn.format==="tree"?jn=Mn.serializer.serialize(Wn,Vn):jn=IY(Mn,Mn.serializer.serialize(Wn,Vn)),Vn.format!=="text"&&!Xd(Cs.fromDom(Wn))&&xo(jn)?Lr.trim(jn):jn},FY=(Mn,Vn)=>zo.from(Mn.getBody()).fold(xs(Vn.format==="tree"?new fp("body",11):""),Wn=>XH(Mn,Vn,Wn)),YH=Lr.makeMap,r5=Mn=>{const Vn=[];Mn=Mn||{};const Wn=Mn.indent,jn=YH(Mn.indent_before||""),Gn=YH(Mn.indent_after||""),no=P0.getEncodeFunc(Mn.entity_encoding||"raw",Mn.entities),ao=Mn.element_format!=="xhtml";return{start:(po,vo,Ao)=>{if(Wn&&jn[po]&&Vn.length>0){const Fo=Vn[Vn.length-1];Fo.length>0&&Fo!==` +`&&Vn.push(` +`)}if(Vn.push("<",po),vo)for(let Fo=0,Qo=vo.length;Fo0){const Fo=Vn[Vn.length-1];Fo.length>0&&Fo!==` +`&&Vn.push(` +`)}},end:po=>{let vo;Vn.push(""),Wn&&Gn[po]&&Vn.length>0&&(vo=Vn[Vn.length-1],vo.length>0&&vo!==` +`&&Vn.push(` +`))},text:(po,vo)=>{po.length>0&&(Vn[Vn.length]=vo?po:no(po))},cdata:po=>{Vn.push("")},comment:po=>{Vn.push("")},pi:(po,vo)=>{vo?Vn.push(""):Vn.push(""),Wn&&Vn.push(` +`)},doctype:po=>{Vn.push("",Wn?` +`:"")},reset:()=>{Vn.length=0},getContent:()=>Vn.join("").replace(/\n$/,"")}},I_=(Mn={},Vn=i1())=>{const Wn=r5(Mn);return Mn.validate="validate"in Mn?Mn.validate:!0,{serialize:Gn=>{const no=Mn.validate,ao={3:vo=>{var Ao;Wn.text((Ao=vo.value)!==null&&Ao!==void 0?Ao:"",vo.raw)},8:vo=>{var Ao;Wn.comment((Ao=vo.value)!==null&&Ao!==void 0?Ao:"")},7:vo=>{Wn.pi(vo.name,vo.value)},10:vo=>{var Ao;Wn.doctype((Ao=vo.value)!==null&&Ao!==void 0?Ao:"")},4:vo=>{var Ao;Wn.cdata((Ao=vo.value)!==null&&Ao!==void 0?Ao:"")},11:vo=>{let Ao=vo;if(Ao=Ao.firstChild)do po(Ao);while(Ao=Ao.next)}};Wn.reset();const po=vo=>{var Ao;const Fo=ao[vo.type];if(Fo)Fo(vo);else{const Qo=vo.name,qo=Qo in Vn.getVoidElements();let ds=vo.attributes;if(no&&ds&&ds.length>1){const bs=[];bs.map={};const ls=Vn.getElementRule(vo.name);if(ls){for(let ys=0,Ls=ls.attributesOrder.length;ys{ol.add(Vn)});const i5=["font","text-decoration","text-emphasis"],tR=(Mn,Vn)=>Al(Mn.parseStyle(Mn.getAttrib(Vn,"style"))),GH=Mn=>ol.has(Mn),qx=(Mn,Vn)=>gc(tR(Mn,Vn),Wn=>!GH(Wn)),a5=Mn=>nr(Mn,Vn=>Sr(i5,Wn=>Dc(Vn,Wn))),KH=(Mn,Vn,Wn)=>{const jn=tR(Mn,Vn),Gn=tR(Mn,Wn),no=ao=>{var po,vo;const Ao=(po=Mn.getStyle(Vn,ao))!==null&&po!==void 0?po:"",Fo=(vo=Mn.getStyle(Wn,ao))!==null&&vo!==void 0?vo:"";return fc(Ao)&&fc(Fo)&&Ao!==Fo};return Sr(jn,ao=>{const po=vo=>Sr(vo,Ao=>Ao===ao);if(!po(Gn)&&po(i5)){const vo=a5(Gn);return Sr(vo,no)}else return no(ao)})},l5=(Mn,Vn,Wn)=>zo.from(Wn.container()).filter(Ir).exists(jn=>{const Gn=Mn?0:-1;return Vn(jn.data.charAt(Wn.offset()+Gn))}),nR=ws(l5,!0,k_),OA=ws(l5,!1,k_),JH=Mn=>{const Vn=Mn.container();return Ir(Vn)&&(Vn.data.length===0||Po(Vn.data)&&fO.isBookmarkNode(Vn.parentNode))},Aw=(Mn,Vn)=>Wn=>ua(Mn?0:-1,Wn).filter(Vn).isSome(),e9=Mn=>td(Mn)&&Ju(Cs.fromDom(Mn),"display")==="block",c5=Mn=>jl(Mn)&&!_v(Mn),t9=Aw(!0,e9),n9=Aw(!1,e9),jx=Aw(!0,pu),wk=Aw(!1,pu),u5=Aw(!0,Gp),Ql=Aw(!1,Gp),bO=Aw(!0,c5),tv=Aw(!1,c5),d5=Mn=>Mn.slice(0,-1),f5=(Mn,Vn,Wn)=>Dr(Vn,Mn)?d5(D1(Mn,jn=>Wn(jn)||Vs(jn,Vn))):[],oR=(Mn,Vn)=>f5(Mn,Vn,hs),py=(Mn,Vn)=>[Mn].concat(oR(Mn,Vn)),_A=(Mn,Vn,Wn)=>g1(Mn,Vn,Wn,JH),o9=Mn=>Vn=>Mn.isBlock(ql(Vn)),sR=(Mn,Vn,Wn)=>xa(py(Cs.fromDom(Vn.container()),Mn),o9(Wn)),h5=(Mn,Vn,Wn,jn)=>_A(Mn,Vn.dom,Wn).forall(Gn=>sR(Vn,Wn,jn).fold(()=>!jr(Gn,Wn,Vn.dom),no=>!jr(Gn,Wn,Vn.dom)&&Dr(no,Cs.fromDom(Gn.container())))),m5=(Mn,Vn,Wn,jn)=>sR(Vn,Wn,jn).fold(()=>_A(Mn,Vn.dom,Wn).forall(Gn=>!jr(Gn,Wn,Vn.dom)),Gn=>_A(Mn,Gn.dom,Wn).isNone()),rR=ws(m5,!1),p5=ws(m5,!0),s9=ws(h5,!1),r9=ws(h5,!0),i9=Mn=>Mh(Mn).exists(np),SA=(Mn,Vn,Wn,jn)=>{const Gn=nr(py(Cs.fromDom(Wn.container()),Vn),ao=>jn.isBlock(ql(ao))),no=qa(Gn).getOr(Vn);return vh(Mn,no.dom,Wn).filter(i9)},Xx=(Mn,Vn,Wn)=>Mh(Vn).exists(np)||SA(!0,Mn,Vn,Wn).isSome(),Yx=(Mn,Vn,Wn)=>Rp(Vn).exists(np)||SA(!1,Mn,Vn,Wn).isSome(),a9=ws(SA,!1),l9=ws(SA,!0),g5=Mn=>lr.isTextPosition(Mn)&&!Mn.isAtStart()&&!Mn.isAtEnd(),b5=(Mn,Vn,Wn)=>{const jn=nr(py(Cs.fromDom(Vn.container()),Mn),Gn=>Wn.isBlock(ql(Gn)));return qa(jn).getOr(Mn)},v5=(Mn,Vn,Wn)=>g5(Vn)?OA(Vn):OA(Vn)||cp(b5(Mn,Vn,Wn).dom,Vn).exists(OA),y5=(Mn,Vn,Wn)=>g5(Vn)?nR(Vn):nR(Vn)||Sm(b5(Mn,Vn,Wn).dom,Vn).exists(nR),c9=Mn=>Zs(["pre","pre-wrap"],Mn),iR=Mn=>Mh(Mn).bind(Vn=>cf(Vn,lf)).exists(Vn=>c9(Ju(Vn,"white-space"))),O5=(Mn,Vn)=>cp(Mn.dom,Vn).isNone(),u9=(Mn,Vn)=>Sm(Mn.dom,Vn).isNone(),d9=(Mn,Vn,Wn)=>O5(Mn,Vn)||u9(Mn,Vn)||rR(Mn,Vn,Wn)||p5(Mn,Vn,Wn)||Yx(Mn,Vn,Wn)||Xx(Mn,Vn,Wn),Pw=Mn=>is(Mn)&&jl(Mn)&&Yb(Mn),_5=(Mn,Vn)=>Wn=>Pw(new mu(Wn,Mn)[Vn]()),S5=(Mn,Vn)=>{const Wn=Sm(Mn.dom,Vn).getOr(Vn),jn=_5(Mn.dom,"next");return Vn.isAtEnd()&&(jn(Vn.container())||jn(Wn.container()))},f9=(Mn,Vn)=>{const Wn=cp(Mn.dom,Vn).getOr(Vn),jn=_5(Mn.dom,"prev");return Vn.isAtStart()&&(jn(Vn.container())||jn(Wn.container()))},w5=(Mn,Vn,Wn)=>iR(Vn)?!1:d9(Mn,Vn,Wn)||v5(Mn,Vn,Wn)||y5(Mn,Vn,Wn),Ck=(Mn,Vn,Wn)=>iR(Vn)?!1:rR(Mn,Vn,Wn)||s9(Mn,Vn,Wn)||Yx(Mn,Vn,Wn)||v5(Mn,Vn,Wn)||f9(Mn,Vn),C5=Mn=>{const Vn=Mn.container(),Wn=Mn.offset();return Ir(Vn)&&WniR(Vn)?!1:p5(Mn,Vn,Wn)||r9(Mn,Vn,Wn)||Xx(Mn,Vn,Wn)||y5(Mn,Vn,Wn)||S5(Mn,Vn),wA=(Mn,Vn,Wn)=>Ck(Mn,Vn,Wn)||kk(Mn,C5(Vn),Wn),hp=(Mn,Vn)=>ok(Mn.charAt(Vn)),k5=(Mn,Vn)=>k_(Mn.charAt(Vn)),h9=Mn=>{const Vn=Mn.container();return Ir(Vn)&&oc(Vn.data,hc)},m9=Mn=>{const Vn=Mn.split("");return Us(Vn,(Wn,jn)=>ok(Wn)&&jn>0&&jn{const Gn=Vn.data,no=lr(Vn,0);return!Wn&&hp(Gn,0)&&!wA(Mn,no,jn)?(Vn.data=" "+Gn.slice(1),!0):Wn&&k5(Gn,0)&&Ck(Mn,no,jn)?(Vn.data=hc+Gn.slice(1),!0):!1},p9=Mn=>{const Vn=Mn.data,Wn=m9(Vn);return Wn!==Vn?(Mn.data=Wn,!0):!1},B_=(Mn,Vn,Wn,jn)=>{const Gn=Vn.data,no=lr(Vn,Gn.length-1);return!Wn&&hp(Gn,Gn.length-1)&&!wA(Mn,no,jn)?(Vn.data=Gn.slice(0,-1)+" ",!0):Wn&&k5(Gn,Gn.length-1)&&kk(Mn,no,jn)?(Vn.data=Gn.slice(0,-1)+hc,!0):!1},g9=(Mn,Vn,Wn)=>{const jn=Vn.container();if(!Ir(jn))return zo.none();if(h9(Vn)){const Gn=x5(Mn,jn,!1,Wn)||p9(jn)||B_(Mn,jn,!1,Wn);return El(Gn,Vn)}else if(wA(Mn,Vn,Wn)){const Gn=x5(Mn,jn,!0,Wn)||B_(Mn,jn,!0,Wn);return El(Gn,Vn)}else return zo.none()},b9=Mn=>{const Vn=Cs.fromDom(Mn.getBody());Mn.selection.isCollapsed()&&g9(Vn,lr.fromRangeStart(Mn.selection.getRng()),Mn.schema).each(Wn=>{Mn.selection.setRng(Wn.toRange())})},kd=(Mn,Vn,Wn,jn)=>{if(Wn===0)return;const Gn=Cs.fromDom(Mn),no=au(Gn,Ao=>jn.isBlock(ql(Ao))).getOr(Gn),ao=Mn.data.slice(Vn,Vn+Wn),po=Vn+Wn>=Mn.data.length&&kk(no,lr(Mn,Mn.data.length),jn),vo=Vn===0&&Ck(no,lr(Mn,0),jn);Mn.replaceData(Vn,Wn,V1(ao,4,vo,po))},$w=(Mn,Vn,Wn)=>{const jn=Mn.data.slice(Vn),Gn=jn.length-om(jn).length;kd(Mn,Vn,Gn,Wn)},E5=(Mn,Vn,Wn)=>{const jn=Mn.data.slice(0,Vn),Gn=jn.length-sm(jn).length;kd(Mn,Vn-Gn,Gn,Wn)},yh=(Mn,Vn,Wn,jn,Gn=!0)=>{const no=sm(Mn.data).length,ao=Gn?Mn:Vn,po=Gn?Vn:Mn;return Gn?ao.appendData(po.data):ao.insertData(0,po.data),sc(Cs.fromDom(po)),jn&&$w(ao,no,Wn),ao},v9=(Mn,Vn)=>{const Wn=Mn.container(),jn=Mn.offset();return!lr.isTextPosition(Mn)&&Wn===Vn.parentNode&&jn>lr.before(Vn).offset()},y9=(Mn,Vn)=>v9(Vn,Mn)?lr(Vn.container(),Vn.offset()-1):Vn,vO=Mn=>Ir(Mn)?lr(Mn,0):lr.before(Mn),ou=Mn=>Ir(Mn)?lr(Mn,Mn.data.length):lr.after(Mn),aR=Mn=>Xl(Mn.previousSibling)?zo.some(ou(Mn.previousSibling)):Mn.previousSibling?b1(Mn.previousSibling):zo.none(),lR=Mn=>Xl(Mn.nextSibling)?zo.some(vO(Mn.nextSibling)):Mn.nextSibling?zm(Mn.nextSibling):zo.none(),O9=(Mn,Vn)=>zo.from(Vn.previousSibling?Vn.previousSibling:Vn.parentNode).bind(Wn=>cp(Mn,lr.before(Wn))).orThunk(()=>Sm(Mn,lr.after(Vn))),_9=(Mn,Vn)=>Sm(Mn,lr.after(Vn)).orThunk(()=>cp(Mn,lr.before(Vn))),S9=(Mn,Vn)=>aR(Vn).orThunk(()=>lR(Vn)).orThunk(()=>O9(Mn,Vn)),Zg=(Mn,Vn)=>lR(Vn).orThunk(()=>aR(Vn)).orThunk(()=>_9(Mn,Vn)),nv=(Mn,Vn,Wn)=>Mn?Zg(Vn,Wn):S9(Vn,Wn),w9=(Mn,Vn,Wn)=>nv(Mn,Vn,Wn).map(ws(y9,Wn)),CA=(Mn,Vn,Wn)=>{Wn.fold(()=>{Mn.focus()},jn=>{Mn.selection.setRng(jn.toRange(),Vn)})},cR=Mn=>Vn=>Vn.dom===Mn,C9=(Mn,Vn)=>Vn&&Mr(Mn.schema.getBlockElements(),ql(Vn)),k9=(Mn,Vn)=>{if(md(Mn)){const Wn=Cs.fromHtml('
');return Vn?fs(Ku(Mn),jn=>{gw(jn)||sc(jn)}):Dm(Mn),Fu(Mn,Wn),zo.some(lr.before(Wn.dom))}else return zo.none()},Gx=(Mn,Vn,Wn,jn)=>{const Gn=_d(Mn).filter(qd),no=Wh(Mn).filter(qd);return sc(Mn),Tm(Gn,no,Vn,(ao,po,vo)=>{const Ao=ao.dom,Fo=po.dom,Qo=Ao.data.length;return yh(Ao,Fo,Wn,jn),vo.container()===Fo?lr(Ao,Qo):vo}).orThunk(()=>(jn&&(Gn.each(ao=>E5(ao.dom,ao.dom.length,Wn)),no.each(ao=>$w(ao.dom,0,Wn))),Vn))},kA=(Mn,Vn)=>Mr(Mn.schema.getTextInlineElements(),ql(Vn)),yO=(Mn,Vn,Wn,jn=!0,Gn=!1)=>{const no=w9(Vn,Mn.getBody(),Wn.dom),ao=au(Wn,ws(C9,Mn),cR(Mn.getBody())),po=Gx(Wn,no,Mn.schema,kA(Mn,Wn));Mn.dom.isEmpty(Mn.getBody())?(Mn.setContent(""),Mn.selection.setCursorLocation()):ao.bind(vo=>k9(vo,Gn)).fold(()=>{jn&&CA(Mn,Vn,po)},vo=>{jn&&CA(Mn,Vn,zo.some(vo))})},x9=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,ov=Mn=>x9.test(Mn),Rw=(Mn,Vn)=>zh(Cs.fromDom(Vn),DC(Mn))&&!Wl(Mn.schema,Vn)&&Mn.dom.isEditable(Vn),T5=Mn=>{var Vn;return Eu.DOM.getStyle(Mn,"direction",!0)==="rtl"||ov((Vn=Mn.textContent)!==null&&Vn!==void 0?Vn:"")},mb=(Mn,Vn,Wn)=>nr(Eu.DOM.getParents(Wn.container(),"*",Vn),Mn),n0=(Mn,Vn,Wn)=>{const jn=mb(Mn,Vn,Wn);return zo.from(jn[jn.length-1])},o0=(Mn,Vn,Wn)=>{const jn=Xr(Vn,Mn),Gn=Xr(Wn,Mn);return is(jn)&&jn===Gn},E9=Mn=>Ac(Mn)||gu(Mn),mc=(Mn,Vn)=>{const Wn=Vn.container(),jn=Vn.offset();return Mn?Jr(Wn)?Ir(Wn.nextSibling)?lr(Wn.nextSibling,0):lr.after(Wn):Ac(Vn)?lr(Wn,jn+1):Vn:Jr(Wn)?Ir(Wn.previousSibling)?lr(Wn.previousSibling,Wn.previousSibling.data.length):lr.before(Wn):gu(Vn)?lr(Wn,jn-1):Vn},Dw=ws(mc,!0),Kx=ws(mc,!1),uR=(Mn,Vn)=>{const Wn=jn=>jn.stopImmediatePropagation();Mn.on("beforeinput input",Wn,!0),Mn.getDoc().execCommand(Vn),Mn.off("beforeinput input",Wn)},dR=Mn=>{Mn.execCommand("delete")},Jx=Mn=>uR(Mn,"Delete"),T9=Mn=>uR(Mn,"ForwardDelete"),fR=Mn=>Vn=>qc(Wc(Vn),Mn,Vs),A9=Mn=>Gs(Mn)||Lm(Mn),eE=(Mn,Vn)=>Dr(Mn,Vn)?cf(Vn,A9,fR(Mn)):zo.none(),xA=(Mn,Vn=!0)=>{Mn.dom.isEmpty(Mn.getBody())&&Mn.setContent("",{no_selection:!Vn})},EA=(Mn,Vn,Wn)=>jc(zm(Wn),b1(Wn),(jn,Gn)=>{const no=mc(!0,jn),ao=mc(!1,Gn),po=mc(!1,Vn);return Mn?Sm(Wn,po).exists(vo=>vo.isEqual(ao)&&Vn.isEqual(no)):cp(Wn,po).exists(vo=>vo.isEqual(no)&&Vn.isEqual(ao))}).getOr(!0),hR=Mn=>(mv(Mn)?_d(Mn):am(Mn)).bind(hR).orThunk(()=>zo.some(Mn)),tE=(Mn,Vn,Wn,jn=!0)=>{var Gn;Vn.deleteContents();const no=hR(Wn).getOr(Wn),ao=Cs.fromDom((Gn=Mn.dom.getParent(no.dom,Mn.dom.isBlock))!==null&&Gn!==void 0?Gn:Wn.dom);if(ao.dom===Mn.getBody()?xA(Mn,jn):md(ao)&&(Kp(ao),jn&&Mn.selection.setCursorLocation(ao.dom,0)),!Vs(Wn,ao)){const po=qc(Wc(ao),Wn)?[]:pv(ao);fs(po.concat(Ku(Wn)),vo=>{!Vs(vo,ao)&&!Dr(vo,ao)&&md(vo)&&sc(vo)})}},P9=(Mn,Vn,Wn)=>au(Mn,Vn,Wn).isSome(),$9=(Mn,Vn)=>O0(Mn,Vn).isSome(),A5=(Mn,Vn)=>tf(Mn,Vn).isSome(),R9=Mn=>Vn=>Vs(Mn,Vn),mR=Mn=>mf(Mn,"td,th"),pR=(Mn,Vn)=>q0(Cs.fromDom(Mn),Vn),D9=Mn=>jc(Mn.startTable,Mn.endTable,(Vn,Wn)=>{const jn=A5(Vn,no=>Vs(no,Wn)),Gn=A5(Wn,no=>Vs(no,Vn));return!jn&&!Gn?Mn:{...Mn,startTable:jn?zo.none():Mn.startTable,endTable:Gn?zo.none():Mn.endTable,isSameTable:!1,isMultiTable:!1}}).getOr(Mn),M9=Mn=>D9(Mn),P5=(Mn,Vn)=>{const Wn=pR(Mn.startContainer,Vn),jn=pR(Mn.endContainer,Vn),Gn=Wn.isSome(),no=jn.isSome(),ao=jc(Wn,jn,Vs).getOr(!1);return M9({startTable:Wn,endTable:jn,isStartInTable:Gn,isEndInTable:no,isSameTable:ao,isMultiTable:!ao&&Gn&&no})},TA=(Mn,Vn)=>({start:Mn,end:Vn}),N9=(Mn,Vn,Wn)=>({rng:Mn,table:Vn,cells:Wn}),nE=Qg.generate([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),oE=(Mn,Vn)=>cm(Cs.fromDom(Mn),"td,th",Vn),$5=Mn=>!Vs(Mn.start,Mn.end),gR=(Mn,Vn)=>q0(Mn.start,Vn).bind(Wn=>q0(Mn.end,Vn).bind(jn=>El(Vs(Wn,jn),Wn))),_1=(Mn,Vn)=>!$5(Mn)&&gR(Mn,Vn).exists(Wn=>{const jn=Wn.dom.rows;return jn.length===1&&jn[0].cells.length===1}),L9=(Mn,Vn)=>{const Wn=oE(Mn.startContainer,Vn),jn=oE(Mn.endContainer,Vn);return jc(Wn,jn,TA)},R5=Mn=>Vn=>q0(Vn,Mn).bind(Wn=>Ya(mR(Wn)).map(jn=>TA(Vn,jn))),bR=Mn=>Vn=>q0(Vn,Mn).bind(Wn=>qa(mR(Wn)).map(jn=>TA(jn,Vn))),sE=Mn=>Vn=>gR(Vn,Mn).map(Wn=>N9(Vn,Wn,mR(Wn))),vR=(Mn,Vn,Wn,jn)=>{if(Wn.collapsed||!Mn.forall($5))return zo.none();if(Vn.isSameTable){const Gn=Mn.bind(sE(jn));return zo.some({start:Gn,end:Gn})}else{const Gn=oE(Wn.startContainer,jn),no=oE(Wn.endContainer,jn),ao=Gn.bind(R5(jn)).bind(sE(jn)),po=no.bind(bR(jn)).bind(sE(jn));return zo.some({start:ao,end:po})}},yR=(Mn,Vn)=>Nl(Mn,Wn=>Vs(Wn,Vn)),OR=Mn=>jc(yR(Mn.cells,Mn.rng.start),yR(Mn.cells,Mn.rng.end),(Vn,Wn)=>Mn.cells.slice(Vn,Wn+1)),I9=(Mn,Vn,Wn)=>Mn.exists(jn=>_1(jn,Wn)&&kx(jn.start,Vn)),AA=(Mn,Vn)=>{const{startTable:Wn,endTable:jn}=Vn,Gn=Mn.cloneRange();return Wn.each(no=>Gn.setStartAfter(no.dom)),jn.each(no=>Gn.setEndBefore(no.dom)),Gn},D5=(Mn,Vn,Wn,jn)=>vR(Mn,Vn,Wn,jn).bind(({start:Gn,end:no})=>Gn.or(no)).bind(Gn=>{const{isSameTable:no}=Vn,ao=OR(Gn).getOr([]);if(no&&Gn.cells.length===ao.length)return zo.some(nE.fullTable(Gn.table));if(ao.length>0){if(no)return zo.some(nE.partialTable(ao,zo.none()));{const po=AA(Wn,Vn);return zo.some(nE.partialTable(ao,zo.some({...Vn,rng:po})))}}else return zo.none()}),s0=(Mn,Vn,Wn,jn)=>vR(Mn,Vn,Wn,jn).bind(({start:Gn,end:no})=>{const ao=Gn.bind(OR).getOr([]),po=no.bind(OR).getOr([]);if(ao.length>0&&po.length>0){const vo=AA(Wn,Vn);return zo.some(nE.multiTable(ao,po,vo))}else return zo.none()}),B9=(Mn,Vn)=>{const Wn=R9(Mn),jn=L9(Vn,Wn),Gn=P5(Vn,Wn);return I9(jn,Vn,Wn)?jn.map(no=>nE.singleCellTable(Vn,no.start)):Gn.isMultiTable?s0(jn,Gn,Vn,Wn):D5(jn,Gn,Vn,Wn)},M5=Mn=>fs(Mn,Vn=>{Mu(Vn,"contenteditable"),Kp(Vn)}),HY=(Mn,Vn)=>zo.from(Mn.dom.getParent(Vn,Mn.dom.isBlock)).map(Cs.fromDom),_R=(Mn,Vn,Wn)=>{Wn.each(jn=>{Vn?sc(jn):(Kp(jn),Mn.selection.setCursorLocation(jn.dom,0))})},SR=(Mn,Vn,Wn,jn)=>{const Gn=Wn.cloneRange();jn?(Gn.setStart(Wn.startContainer,Wn.startOffset),Gn.setEndAfter(Vn.dom.lastChild)):(Gn.setStartBefore(Vn.dom.firstChild),Gn.setEnd(Wn.endContainer,Wn.endOffset)),qg(Mn,Gn,Vn,!1).each(no=>no())},Mw=Mn=>{const Vn=x_(Mn),Wn=Cs.fromDom(Mn.selection.getNode());L1(Wn.dom)&&md(Wn)?Mn.selection.setCursorLocation(Wn.dom,0):Mn.selection.collapse(!0),Vn.length>1&&Sr(Vn,jn=>Vs(jn,Wn))&&Gc(Wn,"data-mce-selected","1")},N5=(Mn,Vn,Wn)=>zo.some(()=>{const jn=Mn.selection.getRng(),Gn=Wn.bind(({rng:no,isStartInTable:ao})=>{const po=HY(Mn,ao?no.endContainer:no.startContainer);no.deleteContents(),_R(Mn,ao,po.filter(md));const vo=ao?Vn[0]:Vn[Vn.length-1];return SR(Mn,vo,jn,ao),md(vo)?zo.none():zo.some(ao?Vn.slice(1):Vn.slice(0,-1))}).getOr(Vn);M5(Gn),Mw(Mn)}),xk=(Mn,Vn,Wn,jn)=>zo.some(()=>{const Gn=Mn.selection.getRng(),no=Vn[0],ao=Wn[Wn.length-1];SR(Mn,no,Gn,!0),SR(Mn,ao,Gn,!1);const po=md(no)?Vn:Vn.slice(1),vo=md(ao)?Wn:Wn.slice(0,-1);M5(po.concat(vo)),jn.deleteContents(),Mw(Mn)}),qg=(Mn,Vn,Wn,jn=!0)=>zo.some(()=>{tE(Mn,Vn,Wn,jn)}),rE=(Mn,Vn)=>zo.some(()=>yO(Mn,!1,Vn)),Iu=(Mn,Vn,Wn)=>B9(Vn,Wn).bind(jn=>jn.fold(ws(qg,Mn),ws(rE,Mn),ws(N5,Mn),ws(xk,Mn))),iE=(Mn,Vn)=>Ek(Mn,Vn),L5=(Mn,Vn,Wn,jn)=>aE(Vn,jn).fold(()=>Iu(Mn,Vn,Wn),Gn=>iE(Mn,Gn)),I5=(Mn,Vn,Wn)=>{const jn=Cs.fromDom(Mn.getBody()),Gn=Mn.selection.getRng();return Wn.length!==0?N5(Mn,Wn,zo.none()):L5(Mn,jn,Gn,Vn)},PA=(Mn,Vn)=>xa(py(Vn,Mn),Eh),aE=(Mn,Vn)=>xa(py(Vn,Mn),Qh("caption")),wR=(Mn,Vn,Wn,jn,Gn)=>Z0(Wn,Mn.getBody(),Gn).bind(no=>PA(Vn,Cs.fromDom(no.getNode())).bind(ao=>Vs(ao,jn)?zo.none():zo.some(Js))),Ek=(Mn,Vn)=>zo.some(()=>{Kp(Vn),Mn.selection.setCursorLocation(Vn.dom,0)}),$A=(Mn,Vn,Wn,jn)=>zm(Mn.dom).bind(Gn=>b1(Mn.dom).map(no=>Vn?Wn.isEqual(Gn)&&jn.isEqual(no):Wn.isEqual(no)&&jn.isEqual(Gn))).getOr(!0),CR=(Mn,Vn)=>Ek(Mn,Vn),B5=(Mn,Vn,Wn)=>aE(Mn,Cs.fromDom(Wn.getNode())).fold(()=>zo.some(Js),jn=>El(!Vs(jn,Vn),Js)),F5=(Mn,Vn,Wn,jn,Gn)=>Z0(Wn,Mn.getBody(),Gn).fold(()=>zo.some(Js),no=>$A(jn,Wn,Gn,no)?CR(Mn,jn):B5(Vn,jn,no)),H5=(Mn,Vn,Wn,jn)=>{const Gn=lr.fromRangeStart(Mn.selection.getRng());return PA(Wn,jn).bind(no=>md(no)?Ek(Mn,no):wR(Mn,Wn,Vn,no,Gn))},Q5=(Mn,Vn,Wn,jn)=>{const Gn=lr.fromRangeStart(Mn.selection.getRng());return md(jn)?Ek(Mn,jn):F5(Mn,Wn,Vn,jn,Gn)},kR=(Mn,Vn)=>Mn?u5(Vn):Ql(Vn),Tk=(Mn,Vn)=>{const Wn=lr.fromRangeStart(Mn.selection.getRng());return kR(Vn,Wn)||vh(Vn,Mn.getBody(),Wn).exists(jn=>kR(Vn,jn))},V5=(Mn,Vn,Wn)=>{const jn=Cs.fromDom(Mn.getBody());return aE(jn,Wn).fold(()=>H5(Mn,Vn,jn,Wn).orThunk(()=>El(Tk(Mn,Vn),Js)),Gn=>Q5(Mn,Vn,jn,Gn))},lE=(Mn,Vn)=>{const Wn=Cs.fromDom(Mn.selection.getStart(!0)),jn=x_(Mn);return Mn.selection.isCollapsed()&&jn.length===0?V5(Mn,Vn,Wn):I5(Mn,Wn,jn)},Nw=(Mn,Vn)=>{let Wn=Vn;for(;Wn&&Wn!==Mn;){if(Gf(Wn)||jl(Wn))return Wn;Wn=Wn.parentNode}return null},F9=["data-ephox-","data-mce-","data-alloy-","data-snooker-","_"],z5=Lr.each,RA=Mn=>{const Vn=Mn.dom,Wn=new Set(Mn.serializer.getTempAttrs()),jn=(no,ao)=>{if(no.nodeName!==ao.nodeName||no.nodeType!==ao.nodeType)return!1;const po=Ao=>{const Fo={};return z5(Vn.getAttribs(Ao),Qo=>{const qo=Qo.nodeName.toLowerCase();qo!=="style"&&!Gn(qo)&&(Fo[qo]=Vn.getAttrib(Ao,qo))}),Fo},vo=(Ao,Fo)=>{for(const Qo in Ao)if(Mr(Ao,Qo)){const qo=Fo[Qo];if(os(qo)||Ao[Qo]!==qo)return!1;delete Fo[Qo]}for(const Qo in Fo)if(Mr(Fo,Qo))return!1;return!0};return Oa(no)&&Oa(ao)&&(!vo(po(no),po(ao))||!vo(Vn.parseStyle(Vn.getAttrib(no,"style")),Vn.parseStyle(Vn.getAttrib(ao,"style"))))?!1:!hg(no)&&!hg(ao)},Gn=no=>Sr(F9,ao=>Dc(no,ao))||Wn.has(no);return{compare:jn,isAttributeInternal:Gn}},xR=Mn=>["h1","h2","h3","h4","h5","h6"].includes(Mn.name),DA=Mn=>Mn.name==="summary",W5=(Mn,Vn)=>{let Wn=Mn;for(;Wn=Wn.walk();)Vn(Wn)},ER=(Mn,Vn,Wn,jn)=>{const Gn=Wn.name;for(let no=0,ao=Mn.length;no{const jn={nodes:{},attributes:{}};return Wn.firstChild&&W5(Wn,Gn=>{ER(Mn,Vn,Gn,jn)}),jn},TR=(Mn,Vn)=>{const Wn=(jn,Gn)=>{Rr(jn,no=>{const ao=kc(no.nodes);fs(no.filter.callbacks,po=>{for(let vo=ao.length-1;vo>=0;vo--){const Ao=ao[vo];(!(Gn?Ao.attr(no.filter.name)!==void 0:Ao.name===no.filter.name)||ms(Ao.parent))&&ao.splice(vo,1)}ao.length>0&&po(ao,no.filter.name,Vn)})})};Wn(Mn.nodes,!1),Wn(Mn.attributes,!0)},AR=(Mn,Vn,Wn,jn={})=>{const Gn=U5(Mn,Vn,Wn);TR(Gn,jn)},MA=(Mn,Vn,Wn,jn)=>{if((Mn.pad_empty_with_br||Vn.insert)&&Wn(jn)){const no=new fp("br",1);Vn.insert&&no.attr("data-mce-bogus","1"),jn.empty().append(no)}else jn.empty().append(new fp("#text",3)).value=hc},Z5=Mn=>{var Vn;return PR(Mn,"#text")&&((Vn=Mn==null?void 0:Mn.firstChild)===null||Vn===void 0?void 0:Vn.value)===hc},PR=(Mn,Vn)=>{const Wn=Mn==null?void 0:Mn.firstChild;return is(Wn)&&Wn===Mn.lastChild&&Wn.name===Vn},q5=(Mn,Vn)=>{const Wn=Mn.getElementRule(Vn.name);return(Wn==null?void 0:Wn.paddEmpty)===!0},Ak=(Mn,Vn,Wn,jn)=>jn.isEmpty(Vn,Wn,Gn=>q5(Mn,Gn)),$R=(Mn,Vn)=>is(Mn)&&(Vn(Mn)||Mn.name==="br"),j5=Mn=>{let Vn;for(let Wn=Mn;Wn;Wn=Wn.parent){const jn=Wn.attr("contenteditable");if(jn==="false")break;jn==="true"&&(Vn=Wn)}return zo.from(Vn)},NA=(Mn,Vn,Wn=Mn.parent)=>{if(Vn.getSpecialElements()[Mn.name])Mn.empty().remove();else{const jn=Mn.children();for(const Gn of jn)Wn&&!Vn.isValidChild(Wn.name,Gn.name)&&NA(Gn,Vn,Wn);Mn.unwrap()}},LA=(Mn,Vn,Wn,jn=Js)=>{const Gn=Vn.getTextBlockElements(),no=Vn.getNonEmptyElements(),ao=Vn.getWhitespaceElements(),po=Lr.makeMap("tr,td,th,tbody,thead,tfoot,table,summary"),vo=new Set,Ao=Fo=>Fo!==Wn&&!po[Fo.name];for(let Fo=0;Fo1)if(IA(Vn,Qo,qo))NA(Qo,Vn);else{ls.reverse(),ds=ls[0].clone(),jn(ds);let ys=ds;for(let Ls=0;Ls0?(bs=ls[Ls].clone(),jn(bs),ys.append(bs)):bs=ys;for(let zs=ls[Ls].firstChild;zs&&zs!==ls[Ls+1];){const Hs=zs.next;bs.append(zs),zs=Hs}ys=bs}Ak(Vn,no,ao,ds)?qo.insert(Qo,ls[0],!0):(qo.insert(ds,ls[0],!0),qo.insert(Qo,ds)),qo=ls[0],(Ak(Vn,no,ao,qo)||PR(qo,"br"))&&qo.empty().remove()}else if(Qo.parent){if(Qo.name==="li"){let ys=Qo.prev;if(ys&&(ys.name==="ul"||ys.name==="ol")){ys.append(Qo);continue}if(ys=Qo.next,ys&&(ys.name==="ul"||ys.name==="ol")&&ys.firstChild){ys.insert(Qo,ys.firstChild,!0);continue}const Ls=new fp("ul",1);jn(Ls),Qo.wrap(Ls);continue}if(Vn.isValidChild(Qo.parent.name,"div")&&Vn.isValidChild("div",Qo.name)){const ys=new fp("div",1);jn(ys),Qo.wrap(ys)}else NA(Qo,Vn)}}},X5=(Mn,Vn)=>{let Wn=Mn;for(;Wn;){if(Wn.name===Vn)return!0;Wn=Wn.parent}return!1},IA=(Mn,Vn,Wn=Vn.parent)=>Wn?Mn.children[Vn.name]&&!Mn.isValidChild(Wn.name,Vn.name)||Vn.name==="a"&&X5(Wn,"a")?!0:DA(Wn)&&xR(Vn)?!((Wn==null?void 0:Wn.firstChild)===Vn&&(Wn==null?void 0:Wn.lastChild)===Vn):!1:!1,Y5=(Mn,Vn,Wn,jn)=>{const Gn=document.createRange();return Gn.setStart(Mn,Vn),Gn.setEnd(Wn,jn),Gn},RR=Mn=>{const Vn=lr.fromRangeStart(Mn),Wn=lr.fromRangeEnd(Mn),jn=Mn.commonAncestorContainer;return vh(!1,jn,Wn).map(Gn=>!jr(Vn,Wn,jn)&&jr(Vn,Gn,jn)?Y5(Vn.container(),Vn.offset(),Gn.container(),Gn.offset()):Mn).getOr(Mn)},Pk=Mn=>Mn.collapsed?Mn:RR(Mn),BA=Mn=>is(Mn.firstChild)&&Mn.firstChild===Mn.lastChild,FA=Mn=>Mn.name==="br"||Mn.value===hc,G5=(Mn,Vn)=>Mn.getBlockElements()[Vn.name]&&BA(Vn)&&FA(Vn.firstChild),HA=(Mn,Vn)=>{const Wn=Mn.getNonEmptyElements();return is(Vn)&&(Vn.isEmpty(Wn)||G5(Mn,Vn))},DR=(Mn,Vn)=>{let Wn=Vn.firstChild,jn=Vn.lastChild;return Wn&&Wn.name==="meta"&&(Wn=Wn.next),jn&&jn.attr("id")==="mce_marker"&&(jn=jn.prev),HA(Mn,jn)&&(jn=jn==null?void 0:jn.prev),!Wn||Wn!==jn?!1:Wn.name==="ul"||Wn.name==="ol"},cE=Mn=>{var Vn,Wn;const jn=Mn.firstChild,Gn=Mn.lastChild;return jn&&jn.nodeName==="META"&&((Vn=jn.parentNode)===null||Vn===void 0||Vn.removeChild(jn)),Gn&&Gn.id==="mce_marker"&&((Wn=Gn.parentNode)===null||Wn===void 0||Wn.removeChild(Gn)),Mn},MR=(Mn,Vn,Wn)=>{const jn=Vn.serialize(Wn),Gn=Mn.createFragment(jn);return cE(Gn)},K5=Mn=>{var Vn;return nr((Vn=Mn==null?void 0:Mn.childNodes)!==null&&Vn!==void 0?Vn:[],Wn=>Wn.nodeName==="LI")},$k=Mn=>Mn.data===hc||Ec(Mn),NR=Mn=>is(Mn==null?void 0:Mn.firstChild)&&Mn.firstChild===Mn.lastChild&&$k(Mn.firstChild),LR=Mn=>!Mn.firstChild||NR(Mn),uE=Mn=>Mn.length>0&&LR(Mn[Mn.length-1])?Mn.slice(0,-1):Mn,gy=(Mn,Vn)=>{const Wn=Mn.getParent(Vn,Mn.isBlock);return Wn&&Wn.nodeName==="LI"?Wn:null},J5=(Mn,Vn)=>!!gy(Mn,Vn),H9=(Mn,Vn)=>{const Wn=Vn.cloneRange(),jn=Vn.cloneRange();return Wn.setStartBefore(Mn),jn.setEndAfter(Mn),[Wn.cloneContents(),jn.cloneContents()]},eL=(Mn,Vn)=>{const Wn=lr.before(Mn),Gn=ub(Vn).next(Wn);return Gn?Gn.toRange():null},IR=(Mn,Vn)=>{const Wn=lr.after(Mn),Gn=ub(Vn).prev(Wn);return Gn?Gn.toRange():null},Q9=(Mn,Vn,Wn,jn)=>{const Gn=H9(Mn,jn),no=Mn.parentNode;return no&&(no.insertBefore(Gn[0],Mn),Lr.each(Vn,ao=>{no.insertBefore(ao,Mn)}),no.insertBefore(Gn[1],Mn),no.removeChild(Mn)),IR(Vn[Vn.length-1],Wn)},QY=(Mn,Vn,Wn)=>{const jn=Mn.parentNode;return jn&&Lr.each(Vn,Gn=>{jn.insertBefore(Gn,Mn)}),eL(Mn,Wn)},V9=(Mn,Vn,Wn,jn)=>(jn.insertAfter(Vn.reverse(),Mn),IR(Vn[0],Wn)),BR=(Mn,Vn,Wn,jn)=>{const Gn=MR(Vn,Mn,jn),no=gy(Vn,Wn.startContainer),ao=uE(K5(Gn.firstChild)),po=1,vo=2,Ao=Vn.getRoot(),Fo=Qo=>{const qo=lr.fromRangeStart(Wn),ds=ub(Vn.getRoot()),bs=Qo===po?ds.prev(qo):ds.next(qo),ls=bs==null?void 0:bs.getNode();return ls?gy(Vn,ls)!==no:!0};return no?Fo(po)?QY(no,ao,Ao):Fo(vo)?V9(no,ao,Ao,Vn):Q9(no,ao,Ao,Wn):null},sv=["pre"],FR=(Mn,Vn,Wn,jn)=>{var Gn;const no=Vn.firstChild,ao=Vn.lastChild,po=ao.attr("data-mce-type")==="bookmark"?ao.prev:ao,vo=no===po,Ao=Zs(sv,no.name);if(vo&&Ao){const Fo=no.attr("contenteditable")!=="false",Qo=((Gn=Mn.getParent(Wn,Mn.isBlock))===null||Gn===void 0?void 0:Gn.nodeName.toLowerCase())===no.name,qo=zo.from(Nw(jn,Wn)).forall(Gf);return Fo&&Qo&&qo}else return!1},Rk=L1,HR=(Mn,Vn,Wn)=>{if(is(Wn)){const jn=Mn.getParent(Vn.endContainer,Rk);return Wn===jn&&kx(Cs.fromDom(Wn),Vn)}else return!1},z9=(Mn,Vn,Wn)=>{var jn;if(Wn.getAttribute("data-mce-bogus")==="all")(jn=Wn.parentNode)===null||jn===void 0||jn.insertBefore(Mn.dom.createFragment(Vn),Wn);else{const Gn=Wn.firstChild,no=Wn.lastChild;!Gn||Gn===no&&Gn.nodeName==="BR"?Mn.dom.setHTML(Wn,Vn):Mn.selection.setContent(Vn,{no_events:!0})}},tL=(Mn,Vn,Wn)=>{zo.from(Mn.getParent(Vn,"td,th")).map(Cs.fromDom).each(jn=>Ua(jn,Wn))},W9=(Mn,Vn)=>{const Wn=Mn.schema.getTextInlineElements(),jn=Mn.dom;if(Vn){const Gn=Mn.getBody(),no=RA(Mn);Lr.each(jn.select("*[data-mce-fragment]"),ao=>{if(is(Wn[ao.nodeName.toLowerCase()])&&qx(jn,ao)){for(let vo=ao.parentElement;is(vo)&&vo!==Gn&&!KH(jn,ao,vo);vo=vo.parentElement)if(no.compare(vo,ao)){jn.remove(ao,!0);break}}})}},nL=Mn=>{let Vn=Mn;for(;Vn=Vn.walk();)Vn.type===1&&Vn.attr("data-mce-fragment","1")},QR=Mn=>{Lr.each(Mn.getElementsByTagName("*"),Vn=>{Vn.removeAttribute("data-mce-fragment")})},U9=Mn=>!!Mn.getAttribute("data-mce-fragment"),oL=(Mn,Vn)=>is(Vn)&&!Mn.schema.getVoidElements()[Vn.nodeName],Z9=(Mn,Vn)=>{var Wn,jn,Gn;let no;const ao=Mn.dom,po=Mn.selection;if(!Vn)return;po.scrollIntoView(Vn);const vo=Nw(Mn.getBody(),Vn);if(vo&&ao.getContentEditable(vo)==="false"){ao.remove(Vn),po.select(vo);return}let Ao=ao.createRng();const Fo=Vn.previousSibling;if(Ir(Fo)){Ao.setStart(Fo,(jn=(Wn=Fo.nodeValue)===null||Wn===void 0?void 0:Wn.length)!==null&&jn!==void 0?jn:0);const ds=Vn.nextSibling;Ir(ds)&&(Fo.appendData(ds.data),(Gn=ds.parentNode)===null||Gn===void 0||Gn.removeChild(ds))}else Ao.setStartBefore(Vn),Ao.setEndBefore(Vn);const Qo=ds=>{let bs=lr.fromRangeStart(ds);return bs=ub(Mn.getBody()).next(bs),bs==null?void 0:bs.toRange()},qo=ao.getParent(Vn,ao.isBlock);if(ao.remove(Vn),qo&&ao.isEmpty(qo)){const ds=Rk(qo);Dm(Cs.fromDom(qo)),Ao.setStart(qo,0),Ao.setEnd(qo,0),!ds&&!U9(qo)&&(no=Qo(Ao))?(Ao=no,ao.remove(qo)):ao.add(qo,ao.create("br",ds?{}:{"data-mce-bogus":"1"}))}po.setRng(Ao)},dE=Mn=>{const Vn=Mn.dom,Wn=Pk(Mn.selection.getRng());Mn.selection.setRng(Wn);const jn=Vn.getParent(Wn.startContainer,Rk);HR(Vn,Wn,jn)?qg(Mn,Wn,Cs.fromDom(jn)):Wn.startContainer===Wn.endContainer&&Wn.endOffset-Wn.startOffset===1&&Ir(Wn.startContainer.childNodes[Wn.startOffset])?Wn.deleteContents():Mn.getDoc().execCommand("Delete",!1)},sL=Mn=>{for(let Vn=Mn;Vn;Vn=Vn.walk())if(Vn.attr("id")==="mce_marker")return zo.some(Vn);return zo.none()},q9=(Mn,Vn,Wn)=>{var jn;return Sr(Wn.children(),xR)&&((jn=Mn.getParent(Vn,Mn.isBlock))===null||jn===void 0?void 0:jn.nodeName)==="SUMMARY"},rL=(Mn,Vn,Wn)=>{var jn,Gn;const no=Mn.selection,ao=Mn.dom,po=Mn.parser,vo=Wn.merge,Ao=I_({validate:!0},Mn.schema),Fo='';Wn.preserve_zwsp||(Vn=Xo(Vn)),Vn.indexOf("{$caret}")===-1&&(Vn+="{$caret}"),Vn=Vn.replace(/\{\$caret\}/,Fo);let Qo=no.getRng();const qo=Qo.startContainer,ds=Mn.getBody();qo===ds&&no.isCollapsed()&&ao.isBlock(ds.firstChild)&&oL(Mn,ds.firstChild)&&ao.isEmpty(ds.firstChild)&&(Qo=ao.createRng(),Qo.setStart(ds.firstChild,0),Qo.setEnd(ds.firstChild,0),no.setRng(Qo)),no.isCollapsed()||dE(Mn);const bs=no.getNode(),ls={context:bs.nodeName.toLowerCase(),data:Wn.data,insert:!0},ys=po.parse(Vn,ls);if(Wn.paste===!0&&DR(Mn.schema,ys)&&J5(ao,bs))return Qo=BR(Ao,ao,no.getRng(),ys),Qo&&no.setRng(Qo),Vn;Wn.paste===!0&&FR(ao,ys,bs,Mn.getBody())&&((jn=ys.firstChild)===null||jn===void 0||jn.unwrap()),nL(ys);let Ls=ys.lastChild;if(Ls&&Ls.attr("id")==="mce_marker"){const zs=Ls;for(Ls=Ls.prev;Ls;Ls=Ls.walk(!0))if(Ls.type===3||!ao.isBlock(Ls.name)){Ls.parent&&Mn.schema.isValidChild(Ls.parent.name,"span")&&Ls.parent.insert(zs,Ls,Ls.name==="br");break}}if(Mn._selectionOverrides.showBlockCaretContainer(bs),!ls.invalid&&!q9(ao,bs,ys))Vn=Ao.serialize(ys),z9(Mn,Vn,bs);else{Mn.selection.setContent(Fo);let zs=no.getNode(),Hs;const tr=Mn.getBody();for(Nm(zs)?zs=Hs=tr:Hs=zs;Hs&&Hs!==tr;)zs=Hs,Hs=Hs.parentNode;Vn=zs===tr?tr.innerHTML:ao.getOuterHTML(zs);const Pr=po.parse(Vn),Ur=sL(Pr),fa=Ur.bind(j5).getOr(Pr);Ur.each(wa=>wa.replace(ys));const yr=ys.children(),fr=(Gn=ys.parent)!==null&&Gn!==void 0?Gn:Pr;ys.unwrap();const Ar=nr(yr,wa=>IA(Mn.schema,wa,fr));LA(Ar,Mn.schema,fa),AR(po.getNodeFilters(),po.getAttributeFilters(),Pr),Vn=Ao.serialize(Pr),zs===tr?ao.setHTML(tr,Vn):ao.setOuterHTML(zs,Vn)}return W9(Mn,vo),Z9(Mn,ao.get("mce_marker")),QR(Mn.getBody()),tL(ao,no.getStart(),Mn.schema),xv(Mn.schema,Mn.getBody(),no.getStart()),Vn},QA=Mn=>Mn instanceof fp,j9=Mn=>{L_(Mn)&&zm(Mn.getBody()).each(Vn=>{const Wn=Vn.getNode(),jn=Gp(Wn)?zm(Wn).getOr(Vn):Vn;Mn.selection.setRng(jn.toRange())})},VR=(Mn,Vn,Wn)=>{Mn.dom.setHTML(Mn.getBody(),Vn),Wn!==!0&&j9(Mn)},X9=(Mn,Vn,Wn,jn)=>{if(Wn=Xo(Wn),Wn.length===0||/^\s+$/.test(Wn)){const Gn='
';Vn.nodeName==="TABLE"?Wn=""+Gn+"":/^(UL|OL)$/.test(Vn.nodeName)&&(Wn="
  • "+Gn+"
  • ");const no=bh(Mn);return Mn.schema.isValidChild(Vn.nodeName.toLowerCase(),no.toLowerCase())?(Wn=Gn,Wn=Mn.dom.createHTML(no,Zb(Mn),Wn)):Wn||(Wn=Gn),VR(Mn,Wn,jn.no_selection),{content:Wn,html:Wn}}else{jn.format!=="raw"&&(Wn=I_({validate:!1},Mn.schema).serialize(Mn.parser.parse(Wn,{isRootContent:!0,insert:!0})));const Gn=Xd(Cs.fromDom(Vn))?Wn:Lr.trim(Wn);return VR(Mn,Gn,jn.no_selection),{content:Gn,html:Gn}}},Y9=(Mn,Vn,Wn,jn)=>{AR(Mn.parser.getNodeFilters(),Mn.parser.getAttributeFilters(),Wn);const Gn=I_({validate:!1},Mn.schema).serialize(Wn),no=Xo(Xd(Cs.fromDom(Vn))?Gn:Lr.trim(Gn));return VR(Mn,no,jn.no_selection),{content:Wn,html:no}},iL=(Mn,Vn,Wn)=>zo.from(Mn.getBody()).map(jn=>QA(Vn)?Y9(Mn,jn,Vn,Wn):X9(Mn,jn,Vn,Wn)).getOr({content:Vn,html:QA(Wn.content)?"":Wn.content}),aL=Mn=>Yo(Mn)?Mn:hs,zR=(Mn,Vn,Wn)=>{let jn=Mn.dom;const Gn=aL(Wn);for(;jn.parentNode;){jn=jn.parentNode;const no=Cs.fromDom(jn),ao=Vn(no);if(ao.isSome())return ao;if(Gn(no))break}return zo.none()},OO=(Mn,Vn,Wn)=>{const jn=Vn(Mn),Gn=aL(Wn);return jn.orThunk(()=>Gn(Mn)?zo.none():zR(Mn,Vn,Gn))},WR=lk,lL=(Mn,Vn,Wn)=>{const jn=Mn.formatter.get(Wn);if(jn)for(let Gn=0;Gn{const no=Mn.dom.getRoot();if(Vn===no)return!1;const ao=Mn.dom.getParent(Vn,po=>lL(Mn,po,Wn)?!0:po.parentNode===no||!!by(Mn,po,Wn,jn,!0));return!!by(Mn,ao,Wn,jn,Gn)},fE=(Mn,Vn,Wn)=>Sf(Wn)&&WR(Vn,Wn.inline)||hb(Wn)&&WR(Vn,Wn.block)?!0:Nh(Wn)?Oa(Vn)&&Mn.is(Vn,Wn.selector):!1,UR=(Mn,Vn,Wn,jn,Gn,no)=>{const ao=Wn[jn],po=jn==="attributes";if(Yo(Wn.onmatch))return Wn.onmatch(Vn,Wn,jn);if(ao){if(Rc(ao)){for(let vo=0;vo{const no=Mn.formatter.get(Wn),ao=Mn.dom;if(no&&Oa(Vn))for(let po=0;po{if(jn)return Dk(Mn,jn,Vn,Wn,Gn);if(jn=Mn.selection.getNode(),Dk(Mn,jn,Vn,Wn,Gn))return!0;const no=Mn.selection.getStart();return!!(no!==jn&&Dk(Mn,no,Vn,Wn,Gn))},G9=(Mn,Vn,Wn)=>{const jn=[],Gn={},no=Mn.selection.getStart();return Mn.dom.getParent(no,ao=>{for(let po=0;po{const Wn=Gn=>Vs(Gn,Cs.fromDom(Mn.getBody())),jn=(Gn,no)=>by(Mn,Gn.dom,no)?zo.some(no):zo.none();return zo.from(Mn.selection.getStart(!0)).bind(Gn=>OO(Cs.fromDom(Gn),no=>Yl(Vn,ao=>jn(no,ao)),Wn)).getOrNull()},cL=(Mn,Vn)=>{const Wn=Mn.formatter.get(Vn),jn=Mn.dom;if(Wn&&Mn.selection.isEditable()){const Gn=Mn.selection.getStart(),no=hw(jn,Gn);for(let ao=Wn.length-1;ao>=0;ao--){const po=Wn[ao];if(!Nh(po))return!0;for(let vo=no.length-1;vo>=0;vo--)if(jn.is(no[vo],po.selector))return!0}}return!1},uL=(Mn,Vn,Wn)=>ra(Wn,(jn,Gn)=>{const no=Ax(Mn,Gn);return Mn.formatter.matchNode(Vn,Gn,{},no)?jn.concat([Gn]):jn},[]),Mk=_o,zA=(Mn,Vn)=>Mn.importNode(Vn,!0),ZR=Mn=>{if(Mn){const Vn=new mu(Mn,Mn);for(let Wn=Vn.current();Wn;Wn=Vn.next())if(Ir(Wn))return Wn}return null},qR=Mn=>{const Vn=Cs.fromTag("span");return im(Vn,{id:ek,"data-mce-bogus":"1","data-mce-type":"format-caret"}),Mn&&Fu(Vn,Cs.fromText(Mk)),Vn},dL=Mn=>{const Vn=ZR(Mn);return Vn&&Vn.data.charAt(0)===Mk&&Vn.deleteData(0,1),Vn},jR=(Mn,Vn,Wn)=>{const jn=Mn.dom,Gn=Mn.selection;if(pw(Vn))yO(Mn,!1,Cs.fromDom(Vn),Wn,!0);else{const no=Gn.getRng(),ao=jn.getParent(Vn,jn.isBlock),po=no.startContainer,vo=no.startOffset,Ao=no.endContainer,Fo=no.endOffset,Qo=dL(Vn);jn.remove(Vn,!0),po===Qo&&vo>0&&no.setStart(Qo,vo-1),Ao===Qo&&Fo>0&&no.setEnd(Qo,Fo-1),ao&&jn.isEmpty(ao)&&Kp(Cs.fromDom(ao)),Gn.setRng(no)}},XR=(Mn,Vn,Wn)=>{const jn=Mn.dom,Gn=Mn.selection;if(Vn)jR(Mn,Vn,Wn);else if(Vn=cO(Mn.getBody(),Gn.getStart()),!Vn)for(;Vn=jn.get(ek);)jR(Mn,Vn,Wn)},WA=(Mn,Vn,Wn)=>{var jn,Gn;const no=Mn.dom,ao=no.getParent(Wn,ws(Nf,Mn.schema));ao&&no.isEmpty(ao)?(jn=Wn.parentNode)===null||jn===void 0||jn.replaceChild(Vn,Wn):(Iy(Cs.fromDom(Wn)),no.isEmpty(Wn)?(Gn=Wn.parentNode)===null||Gn===void 0||Gn.replaceChild(Vn,Wn):no.insertAfter(Vn,Wn))},YR=(Mn,Vn)=>(Mn.appendChild(Vn),Vn),UA=(Mn,Vn)=>{var Wn;const jn=Kr(Mn,(no,ao)=>YR(no,ao.cloneNode(!1)),Vn),Gn=(Wn=jn.ownerDocument)!==null&&Wn!==void 0?Wn:document;return YR(jn,Gn.createTextNode(Mk))},K9=(Mn,Vn,Wn,jn,Gn,no)=>{const ao=Mn.formatter,po=Mn.dom,vo=nr(Al(ao.get()),Qo=>Qo!==jn&&!oc(Qo,"removeformat")),Ao=uL(Mn,Wn,vo);if(nr(Ao,Qo=>!k3(Mn,Qo,jn)).length>0){const Qo=Wn.cloneNode(!1);return po.add(Vn,Qo),ao.remove(jn,Gn,Qo,no),po.remove(Qo),zo.some(Qo)}else return zo.none()},J9=(Mn,Vn,Wn)=>{let jn;const Gn=Mn.selection,no=Mn.formatter.get(Vn);if(!no)return;const ao=Gn.getRng();let po=ao.startOffset;const Ao=ao.startContainer.nodeValue;jn=cO(Mn.getBody(),Gn.getStart());const Fo=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(Ao&&po>0&&po{const Gn=Mn.dom,no=Mn.selection;let ao=!1;const po=Mn.formatter.get(Vn);if(!po)return;const vo=no.getRng(),Ao=vo.startContainer,Fo=vo.startOffset;let Qo=Ao;Ir(Ao)&&(Fo!==Ao.data.length&&(ao=!0),Qo=Qo.parentNode);const qo=[];let ds;for(;Qo;){if(by(Mn,Qo,Vn,Wn,jn)){ds=Qo;break}Qo.nextSibling&&(ao=!0),qo.push(Qo),Qo=Qo.parentNode}if(ds)if(ao){const bs=no.getBookmark();vo.collapse(!0);let ls=X0(Gn,vo,po,!0);ls=Zo(ls),Mn.formatter.remove(Vn,Wn,ls,jn),no.moveToBookmark(bs)}else{const bs=cO(Mn.getBody(),ds),ls=is(bs)?Gn.getParents(ds.parentNode,Qs,bs):[],ys=qR(!1).dom;WA(Mn,ys,bs??ds);const Ls=K9(Mn,ys,ds,Vn,Wn,jn),zs=UA([...qo,...Ls.toArray(),...ls],ys);bs&&jR(Mn,bs,is(bs)),no.setCursorLocation(zs,1),Gn.isEmpty(ds)&&Gn.remove(ds)}},GR=(Mn,Vn,Wn)=>{const jn=Mn.selection,Gn=Mn.getBody();XR(Mn,null,Wn),(Vn===8||Vn===46)&&jn.isCollapsed()&&jn.getStart().innerHTML===Mk&&XR(Mn,cO(Gn,jn.getStart()),!0),(Vn===37||Vn===39)&&XR(Mn,cO(Gn,jn.getStart()),!0)},hL=Mn=>Ir(Mn)&&bd(Mn.data,hc),eQ=Mn=>{Mn.on("mouseup keydown",Vn=>{GR(Mn,Vn.keyCode,hL(Mn.selection.getRng().endContainer))})},mL=Mn=>{const Vn=qR(!1),Wn=UA(Mn,Vn.dom);return{caretContainer:Vn,caretPosition:lr(Wn,0)}},pL=(Mn,Vn)=>{const{caretContainer:Wn,caretPosition:jn}=mL(Vn);return ed(Cs.fromDom(Mn),Wn),sc(Cs.fromDom(Mn)),jn},ZA=(Mn,Vn)=>{const{caretContainer:Wn,caretPosition:jn}=mL(Vn);return Mn.insertNode(Wn.dom),jn},vy=(Mn,Vn)=>{if(fg(Vn.dom))return!1;const Wn=Mn.schema.getTextInlineElements();return Mr(Wn,ql(Vn))&&!fg(Vn.dom)&&!Jm(Vn.dom)},hE={},qA=Ad(["pre"]),wf=(Mn,Vn)=>{hE[Mn]||(hE[Mn]=[]),hE[Mn].push(Vn)},KR=(Mn,Vn)=>{Mr(hE,Mn)&&fs(hE[Mn],Wn=>{Wn(Vn)})};wf("pre",Mn=>{const Vn=Mn.selection.getRng(),Wn=Gn=>no=>{const ao=no.previousSibling;return qA(ao)&&Zs(Gn,ao)},jn=(Gn,no)=>{const ao=Cs.fromDom(no),po=Fa(ao).dom;sc(ao),Lc(Cs.fromDom(Gn),[Cs.fromTag("br",po),Cs.fromTag("br",po),...Ku(ao)])};if(!Vn.collapsed){const Gn=Mn.selection.getSelectedBlocks(),no=nr(nr(Gn,qA),Wn(Gn));fs(no,ao=>{jn(ao.previousSibling,ao)})}});const jA=["fontWeight","fontStyle","color","fontSize","fontFamily"],_O=Mn=>Io(Mn.styles)&&Sr(Al(Mn.styles),Vn=>Zs(jA,Vn)),gL=Mn=>xa(Mn,Vn=>Sf(Vn)&&Vn.inline==="span"&&_O(Vn)),JR=(Mn,Vn)=>{const Wn=Mn.get(Vn);return Jo(Wn)?gL(Wn):zo.none()},Nk=(Mn,Vn)=>cp(Vn,lr.fromRangeStart(Mn)).isNone(),bL=(Mn,Vn)=>Sm(Vn,lr.fromRangeEnd(Mn)).exists(Wn=>!Ec(Wn.getNode())||Sm(Vn,Wn).isSome())===!1,vL=Mn=>Vn=>C0(Vn)&&Mn.isEditable(Vn),Lk=Mn=>{const Vn=Mn.getSelectedBlocks(),Wn=Mn.getRng();if(Mn.isCollapsed())return[];if(Vn.length===1)return Nk(Wn,Vn[0])&&bL(Wn,Vn[0])?Vn:[];{const jn=qa(Vn).filter(ao=>Nk(Wn,ao)).toArray(),Gn=Ya(Vn).filter(ao=>bL(Wn,ao)).toArray(),no=Vn.slice(1,-1);return jn.concat(no).concat(Gn)}},tQ=Mn=>nr(Lk(Mn),vL(Mn.dom)),F_=Mn=>nr(Mn.getSelectedBlocks(),vL(Mn.dom)),eD=Lr.each,yy=Mn=>Oa(Mn)&&!hg(Mn)&&!fg(Mn)&&!Jm(Mn),S1=(Mn,Vn)=>{for(let Wn=Mn;Wn;Wn=Wn[Vn]){if(Ir(Wn)&&fc(Wn.data))return Mn;if(Oa(Wn)&&!hg(Wn))return Wn}return Mn},mE=(Mn,Vn,Wn)=>{const jn=RA(Mn),Gn=pf(Vn)&&Mn.dom.isEditable(Vn),no=pf(Wn)&&Mn.dom.isEditable(Wn);if(Gn&&no){const ao=S1(Vn,"previousSibling"),po=S1(Wn,"nextSibling");if(jn.compare(ao,po)){for(let vo=ao.nextSibling;vo&&vo!==po;){const Ao=vo;vo=vo.nextSibling,ao.appendChild(Ao)}return Mn.dom.remove(po),Lr.each(Lr.grep(po.childNodes),vo=>{ao.appendChild(vo)}),ao}}return Wn},XA=(Mn,Vn,Wn,jn)=>{var Gn;if(jn&&Vn.merge_siblings!==!1){const no=(Gn=mE(Mn,da(jn),jn))!==null&&Gn!==void 0?Gn:jn;mE(Mn,no,da(no,!0))}},nQ=(Mn,Vn,Wn)=>{if(Vn.clear_child_styles){const jn=Vn.links?"*:not(a)":"*";eD(Mn.select(jn,Wn),Gn=>{yy(Gn)&&Mn.isEditable(Gn)&&eD(Vn.styles,(no,ao)=>{Mn.setStyle(Gn,ao,"")})})}},tD=(Mn,Vn,Wn)=>{eD(Mn.childNodes,jn=>{yy(jn)&&(Vn(jn)&&Wn(jn),jn.hasChildNodes()&&tD(jn,Vn,Wn))})},YA=(Mn,Vn)=>{Vn.nodeName==="SPAN"&&Mn.getAttribs(Vn).length===0&&Mn.remove(Vn,!0)},yL=(Mn,Vn)=>Wn=>!!(Wn&&E_(Mn,Wn,Vn)),pb=(Mn,Vn,Wn)=>jn=>{Mn.setStyle(jn,Vn,Wn),jn.getAttribute("style")===""&&jn.removeAttribute("style"),YA(Mn,jn)},Oy=Qg.generate([{keep:[]},{rename:["name"]},{removed:[]}]),OL=/^(src|href|style)$/,pE=Lr.each,Ik=lk,Iw=Mn=>/^(TR|TH|TD)$/.test(Mn.nodeName),GA=(Mn,Vn,Wn)=>Mn.isChildOf(Vn,Wn)&&Vn!==Wn&&!Mn.isBlock(Wn),_L=(Mn,Vn,Wn)=>{let jn=Vn[Wn?"startContainer":"endContainer"],Gn=Vn[Wn?"startOffset":"endOffset"];if(Oa(jn)){const no=jn.childNodes.length-1;!Wn&&Gn&&Gn--,jn=jn.childNodes[Gn>no?no:Gn]}return Ir(jn)&&Wn&&Gn>=jn.data.length&&(jn=new mu(jn,Mn.getBody()).next()||jn),Ir(jn)&&!Wn&&Gn===0&&(jn=new mu(jn,Mn.getBody()).prev()||jn),jn},nD=(Mn,Vn)=>{const Wn=Vn?"firstChild":"lastChild",jn=Mn[Wn];return Iw(Mn)&&jn?Mn.nodeName==="TR"&&jn[Wn]||jn:Mn},oD=(Mn,Vn,Wn,jn)=>{var Gn;const no=Mn.create(Wn,jn);return(Gn=Vn.parentNode)===null||Gn===void 0||Gn.insertBefore(no,Vn),no.appendChild(Vn),no},SL=(Mn,Vn,Wn,jn,Gn)=>{const no=Cs.fromDom(Vn),ao=Cs.fromDom(Mn.create(jn,Gn)),po=Wn?Id(no):y0(no);return Lc(ao,po),Wn?(ed(no,ao),Gm(ao,no)):(fh(no,ao),Fu(ao,no)),ao.dom},oQ=(Mn,Vn)=>Vn.links&&Mn.nodeName==="A",wL=(Mn,Vn,Wn)=>{const jn=Vn.parentNode;let Gn;const no=Mn.dom,ao=bh(Mn);hb(Wn)&&jn===no.getRoot()&&(!Wn.list_block||!Ik(Vn,Wn.list_block))&&fs(kc(Vn.childNodes),po=>{j0(Mn,ao,po.nodeName.toLowerCase())?Gn?Gn.appendChild(po):(Gn=oD(no,po,ao),no.setAttribs(Gn,Zb(Mn))):Gn=null}),!(dk(Wn)&&!Ik(Wn.inline,Vn))&&no.remove(Vn,!0)},Bk=(Mn,Vn,Wn)=>Ys(Mn)?{name:Vn,value:null}:{name:Mn,value:fb(Vn,Wn)},CL=(Mn,Vn)=>{Mn.getAttrib(Vn,"style")===""&&(Vn.removeAttribute("style"),Vn.removeAttribute("data-mce-style"))},sD=(Mn,Vn,Wn,jn,Gn)=>{let no=!1;pE(Wn.styles,(ao,po)=>{const{name:vo,value:Ao}=Bk(po,ao,jn),Fo=ck(Ao,vo);(Wn.remove_similar||Mo(Ao)||!Oa(Gn)||Ik(E_(Mn,Gn,vo),Fo))&&Mn.setStyle(Vn,vo,""),no=!0}),no&&CL(Mn,Vn)},rD=(Mn,Vn,Wn)=>{Vn==="removeformat"?fs(F_(Mn.selection),jn=>{fs(jA,Gn=>Mn.dom.setStyle(jn,Gn,"")),CL(Mn.dom,jn)}):JR(Mn.formatter,Vn).each(jn=>{fs(F_(Mn.selection),Gn=>sD(Mn.dom,Gn,jn,Wn,null))})},kL=(Mn,Vn,Wn,jn,Gn)=>{const no=Mn.dom,ao=RA(Mn),po=Mn.schema;if(Sf(Vn)&&Ev(po,Vn.inline)&&Wl(po,jn)&&jn.parentElement===Mn.getBody())return wL(Mn,jn,Vn),Oy.removed();if(!Vn.ceFalseOverride&&jn&&no.getContentEditableParent(jn)==="false"||jn&&!fE(no,jn,Vn)&&!oQ(jn,Vn))return Oy.keep();const vo=jn,Ao=Vn.preserve_attributes;if(Sf(Vn)&&Vn.remove==="all"&&Jo(Ao)){const Fo=nr(no.getAttribs(vo),Qo=>Zs(Ao,Qo.name.toLowerCase()));if(no.removeAllAttribs(vo),fs(Fo,Qo=>no.setAttrib(vo,Qo.name,Qo.value)),Fo.length>0)return Oy.rename("span")}if(Vn.remove!=="all"){sD(no,vo,Vn,Wn,Gn),pE(Vn.attributes,(Qo,qo)=>{const{name:ds,value:bs}=Bk(qo,Qo,Wn);if(Vn.remove_similar||Mo(bs)||!Oa(Gn)||Ik(no.getAttrib(Gn,ds),bs)){if(ds==="class"){const ls=no.getAttrib(vo,ds);if(ls){let ys="";if(fs(ls.split(/\s+/),Ls=>{/mce\-\w+/.test(Ls)&&(ys+=(ys?" ":"")+Ls)}),ys){no.setAttrib(vo,ds,ys);return}}}if(OL.test(ds)&&vo.removeAttribute("data-mce-"+ds),ds==="style"&&Ad(["li"])(vo)&&no.getStyle(vo,"list-style-type")==="none"){vo.removeAttribute(ds),no.setStyle(vo,"list-style-type","none");return}ds==="class"&&vo.removeAttribute("className"),vo.removeAttribute(ds)}}),pE(Vn.classes,Qo=>{Qo=fb(Qo,Wn),(!Oa(Gn)||no.hasClass(Gn,Qo))&&no.removeClass(vo,Qo)});const Fo=no.getAttribs(vo);for(let Qo=0;Qo{let no;return Vn.parentNode&&fs(hw(Mn.dom,Vn.parentNode).reverse(),ao=>{if(!no&&Oa(ao)&&ao.id!=="_start"&&ao.id!=="_end"){const po=by(Mn,ao,Wn,jn,Gn);po&&po.split!==!1&&(no=ao)}}),no},EL=(Mn,Vn,Wn,jn)=>kL(Mn,Vn,Wn,jn,jn).fold(xs(jn),Gn=>(Mn.dom.createFragment().appendChild(jn),Mn.dom.rename(jn,Gn)),xs(null)),sQ=(Mn,Vn,Wn,jn,Gn,no,ao,po)=>{var vo,Ao;let Fo,Qo;const qo=Mn.dom;if(Wn){const ds=Wn.parentNode;for(let bs=jn.parentNode;bs&&bs!==ds;bs=bs.parentNode){let ls=qo.clone(bs,!1);for(let ys=0;ys{const no=Mn.formatter.get(Vn),ao=no[0],po=Mn.dom,vo=Mn.selection,Ao=ls=>{const ys=xL(Mn,ls,Vn,Wn,Gn);return sQ(Mn,no,ys,ls,ls,!0,ao,Wn)},Fo=ls=>hg(ls)&&Oa(ls)&&(ls.id==="_start"||ls.id==="_end"),Qo=ls=>Sr(no,ys=>gE(Mn,ys,Wn,ls,ls)),qo=ls=>{const ys=kc(ls.childNodes),zs=Qo(ls)||Sr(no,Pr=>fE(po,ls,Pr)),Hs=ls.parentNode;if(!zs&&is(Hs)&&mw(ao)&&Qo(Hs),ao.deep&&ys.length)for(let Pr=0;Pr{Oa(ls)&&Mn.dom.getStyle(ls,"text-decoration")===Pr&&ls.parentNode&&WT(po,ls.parentNode)===Pr&&gE(Mn,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:Pr}},void 0,ls)})},ds=ls=>{const ys=po.get(ls?"_start":"_end");if(ys){let Ls=ys[ls?"firstChild":"lastChild"];return Fo(Ls)&&(Ls=Ls[ls?"firstChild":"lastChild"]),Ir(Ls)&&Ls.data.length===0&&(Ls=ls?ys.previousSibling||ys.nextSibling:ys.nextSibling||ys.previousSibling),po.remove(ys,!0),Ls}else return null},bs=ls=>{let ys,Ls,zs=X0(po,ls,no,ls.collapsed);if(ao.split){if(zs=Zo(zs),ys=_L(Mn,zs,!0),Ls=_L(Mn,zs),ys!==Ls){if(ys=nD(ys,!0),Ls=nD(Ls,!1),GA(po,ys,Ls)){const tr=zo.from(ys.firstChild).getOr(ys);Ao(SL(po,tr,!0,"span",{id:"_start","data-mce-type":"bookmark"})),ds(!0);return}if(GA(po,Ls,ys)){const tr=zo.from(Ls.lastChild).getOr(Ls);Ao(SL(po,tr,!1,"span",{id:"_end","data-mce-type":"bookmark"})),ds(!1);return}ys=oD(po,ys,"span",{id:"_start","data-mce-type":"bookmark"}),Ls=oD(po,Ls,"span",{id:"_end","data-mce-type":"bookmark"});const Hs=po.createRng();Hs.setStartAfter(ys),Hs.setEndBefore(Ls),Ow(po,Hs,tr=>{fs(tr,Pr=>{!hg(Pr)&&!hg(Pr.parentNode)&&Ao(Pr)})}),Ao(ys),Ao(Ls),ys=ds(!0),Ls=ds()}else ys=Ls=Ao(ys);zs.startContainer=ys.parentNode?ys.parentNode:ys,zs.startOffset=po.nodeIndex(ys),zs.endContainer=Ls.parentNode?Ls.parentNode:Ls,zs.endOffset=po.nodeIndex(Ls)+1}Ow(po,zs,Hs=>{fs(Hs,qo)})};if(jn){if(uw(jn)){const ls=po.createRng();ls.setStartBefore(jn),ls.setEndAfter(jn),bs(ls)}else bs(jn);hO(Mn,Vn,jn,Wn);return}!vo.isCollapsed()||!Sf(ao)||x_(Mn).length?(dw(Mn,()=>dy(Mn,bs),ls=>Sf(ao)&&VA(Mn,Vn,Wn,ls)),Mn.nodeChanged()):fL(Mn,Vn,Wn,Gn),rD(Mn,Vn,Wn),hO(Mn,Vn,jn,Wn)},TL=(Mn,Vn,Wn,jn,Gn)=>{(jn||Mn.selection.isEditable())&&rQ(Mn,Vn,Wn,jn,Gn)},gE=(Mn,Vn,Wn,jn,Gn)=>kL(Mn,Vn,Wn,jn,Gn).fold(hs,no=>(Mn.dom.rename(jn,no),!0),Qs),AL=Lr.each,iQ=(Mn,Vn,Wn,jn)=>{const Gn=no=>{if(pf(no)&&Oa(no.parentNode)&&Mn.isEditable(no)){const ao=WT(Mn,no.parentNode);Mn.getStyle(no,"color")&&ao?Mn.setStyle(no,"text-decoration",ao):Mn.getStyle(no,"text-decoration")===ao&&Mn.setStyle(no,"text-decoration",null)}};Vn.styles&&(Vn.styles.color||Vn.styles.textDecoration)&&(Lr.walk(jn,Gn,"childNodes"),Gn(jn))},aQ=(Mn,Vn,Wn,jn)=>{if(Vn.styles&&Vn.styles.backgroundColor){const Gn=yL(Mn,"fontSize");tD(jn,no=>Gn(no)&&Mn.isEditable(no),pb(Mn,"backgroundColor",fb(Vn.styles.backgroundColor,Wn)))}},lQ=(Mn,Vn,Wn,jn)=>{if(Sf(Vn)&&(Vn.inline==="sub"||Vn.inline==="sup")){const Gn=yL(Mn,"fontSize");tD(jn,ao=>Gn(ao)&&Mn.isEditable(ao),pb(Mn,"fontSize",""));const no=nr(Mn.select(Vn.inline==="sup"?"sub":"sup",jn),Mn.isEditable);Mn.remove(no,!0)}},cQ=(Mn,Vn,Wn,jn)=>{AL(Vn,Gn=>{Sf(Gn)&&AL(Mn.dom.select(Gn.inline,jn),no=>{yy(no)&&gE(Mn,Gn,Wn,no,Gn.exact?no:null)}),nQ(Mn.dom,Gn,jn)})},uQ=(Mn,Vn,Wn,jn,Gn)=>{const no=Gn.parentNode;by(Mn,no,Wn,jn)&&gE(Mn,Vn,jn,Gn)||Vn.merge_with_parents&&no&&Mn.dom.getParent(no,ao=>by(Mn,ao,Wn,jn)?(gE(Mn,Vn,jn,Gn),!0):!1)},KA=Lr.each,dQ=(Mn,Vn,Wn,jn)=>{if(LC(Mn)&&Sf(Vn)&&Wn.parentNode){const Gn=dC(Mn.schema),no=$9(Cs.fromDom(Wn),ao=>fg(ao.dom));return il(Gn,jn)&&md(Cs.fromDom(Wn.parentNode),!1)&&!no}else return!1},PL=(Mn,Vn,Wn,jn)=>{if(KA(Wn.styles,(Gn,no)=>{Mn.setStyle(Vn,no,fb(Gn,jn))}),Wn.styles){const Gn=Mn.getAttrib(Vn,"style");Gn&&Mn.setAttrib(Vn,"data-mce-style",Gn)}},$L=(Mn,Vn,Wn,jn)=>{const Gn=Mn.formatter.get(Vn),no=Gn[0],ao=!jn&&Mn.selection.isCollapsed(),po=Mn.dom,vo=Mn.selection,Ao=(bs,ls=no)=>{Yo(ls.onformat)&&ls.onformat(bs,ls,Wn,jn),PL(po,bs,ls,Wn),KA(ls.attributes,(ys,Ls)=>{po.setAttrib(bs,Ls,fb(ys,Wn))}),KA(ls.classes,ys=>{const Ls=fb(ys,Wn);po.hasClass(bs,Ls)||po.addClass(bs,Ls)})},Fo=(bs,ls)=>{let ys=!1;return KA(bs,Ls=>Nh(Ls)?po.getContentEditable(ls)==="false"&&!Ls.ceFalseOverride||is(Ls.collapsed)&&Ls.collapsed!==ao?!0:po.is(ls,Ls.selector)&&!fg(ls)?(Ao(ls,Ls),ys=!0,!1):!0:!1),ys},Qo=bs=>{if(xo(bs)){const ls=po.create(bs);return Ao(ls),ls}else return null},qo=(bs,ls,ys)=>{const Ls=[];let zs=!0;const Hs=no.inline||no.block,tr=Qo(Hs),Pr=yr=>uk(no)&&by(Mn,yr,Vn,Wn),Ur=(yr,fr,Ar)=>{const wa=T_(no)&&Nf(Mn.schema,yr)&&j0(Mn,fr,Hs);return Ar&&wa},fa=(yr,fr,Ar,wa)=>{const Va=yr.nodeName.toLowerCase(),Tl=j0(Mn,Hs,Va)&&j0(Mn,fr,Hs),tc=!ys&&Ir(yr)&&Po(yr.data),uu=fg(yr),Qu=!Sf(no)||!bs.isBlock(yr);return(Ar||wa)&&Tl&&!tc&&!uu&&Qu};Ow(bs,ls,yr=>{let fr;const Ar=wa=>{let Va=!1,Tl=zs,tc=!1;const uu=wa.parentNode,Qu=uu.nodeName.toLowerCase(),Wd=bs.getContentEditable(wa);is(Wd)&&(Tl=zs,zs=Wd==="true",Va=!0,tc=fw(Mn,wa));const Jh=zs&&!Va;if(Ec(wa)&&!dQ(Mn,no,wa,Qu)){fr=null,hb(no)&&bs.remove(wa);return}if(Pr(wa)){fr=null;return}if(Ur(wa,Qu,Jh)){const _u=bs.rename(wa,Hs);Ao(_u),Ls.push(_u),fr=null;return}if(Nh(no)){let _u=Fo(Gn,wa);if(!_u&&is(uu)&&mw(no)&&(_u=Fo(Gn,uu)),!Sf(no)||_u){fr=null;return}}is(tr)&&fa(wa,Qu,Jh,tc)?(fr||(fr=bs.clone(tr,!1),uu.insertBefore(fr,wa),Ls.push(fr)),tc&&Va&&(zs=Tl),fr.appendChild(wa)):(fr=null,fs(kc(wa.childNodes),Ar),Va&&(zs=Tl),fr=null)};fs(yr,Ar)}),no.links===!0&&fs(Ls,yr=>{const fr=Ar=>{Ar.nodeName==="A"&&Ao(Ar,no),fs(kc(Ar.childNodes),fr)};fr(yr)}),fs(Ls,yr=>{const fr=Va=>{let Tl=0;return fs(Va.childNodes,tc=>{!Wg(tc)&&!hg(tc)&&Tl++}),Tl},Ar=Va=>xa(Va.childNodes,Ex).filter(tc=>bs.getContentEditable(tc)!=="false"&&fE(bs,tc,no)).map(tc=>{const uu=bs.clone(tc,!1);return Ao(uu),bs.replace(uu,Va,!0),bs.remove(tc,!0),uu}).getOr(Va),wa=fr(yr);if((Ls.length>1||!bs.isBlock(yr))&&wa===0){bs.remove(yr,!0);return}(Sf(no)||hb(no)&&no.wrapper)&&(!no.exact&&wa===1&&(yr=Ar(yr)),cQ(Mn,Gn,Wn,yr),uQ(Mn,no,Vn,Wn,yr),aQ(bs,no,Wn,yr),iQ(bs,no,Wn,yr),lQ(bs,no,Wn,yr),XA(Mn,no,Wn,yr))})},ds=uw(jn)?jn:vo.getNode();if(po.getContentEditable(ds)==="false"&&!fw(Mn,ds)){jn=ds,Fo(Gn,jn),Yh(Mn,Vn,jn,Wn);return}if(no){if(jn)if(uw(jn)){if(!Fo(Gn,jn)){const bs=po.createRng();bs.setStartBefore(jn),bs.setEndAfter(jn),qo(po,X0(po,bs,Gn),!0)}}else qo(po,jn,!0);else!ao||!Sf(no)||x_(Mn).length?(vo.setRng(Pk(vo.getRng())),dw(Mn,()=>{dy(Mn,(bs,ls)=>{const ys=ls?bs:X0(po,bs,Gn);qo(po,ys,!1)})},Qs),Mn.nodeChanged()):J9(Mn,Vn,Wn),JR(Mn.formatter,Vn).each(bs=>{fs(tQ(Mn.selection),ls=>PL(po,ls,bs,Wn))});KR(Vn,Mn)}Yh(Mn,Vn,jn,Wn)},RL=(Mn,Vn,Wn,jn)=>{(jn||Mn.selection.isEditable())&&$L(Mn,Vn,Wn,jn)},Bw=Mn=>Mr(Mn,"vars"),fQ=(Mn,Vn)=>{Mn.set({}),Vn.on("NodeChange",Wn=>{iD(Vn,Wn.element,Mn.get())}),Vn.on("FormatApply FormatRemove",Wn=>{const jn=zo.from(Wn.node).map(Gn=>uw(Gn)?Gn:Gn.startContainer).bind(Gn=>Oa(Gn)?zo.some(Gn):zo.from(Gn.parentElement)).getOrThunk(()=>DL(Vn));iD(Vn,jn,Mn.get())})},DL=Mn=>Mn.selection.getStart(),ML=(Mn,Vn,Wn,jn,Gn)=>Ml(Vn,po=>{const vo=Mn.formatter.matchNode(po,Wn,Gn??{},jn);return!os(vo)},po=>lL(Mn,po,Wn)?!0:jn?!1:is(Mn.formatter.matchNode(po,Wn,Gn,!0))),NL=(Mn,Vn)=>{const Wn=Vn??DL(Mn);return nr(hw(Mn.dom,Wn),jn=>Oa(jn)&&!Jm(jn))},iD=(Mn,Vn,Wn)=>{const jn=NL(Mn,Vn);Rr(Wn,(Gn,no)=>{const ao=po=>{const vo=ML(Mn,jn,no,po.similar,Bw(po)?po.vars:void 0),Ao=vo.isSome();if(po.state.get()!==Ao){po.state.set(Ao);const Fo=vo.getOr(Vn);Bw(po)?po.callback(Ao,{node:Fo,format:no,parents:jn}):fs(po.callbacks,Qo=>Qo(Ao,{node:Fo,format:no,parents:jn}))}};fs([Gn.withSimilar,Gn.withoutSimilar],ao),fs(Gn.withVars,ao)})},hQ=(Mn,Vn,Wn,jn,Gn,no)=>{const ao=Vn.get();fs(Wn.split(","),po=>{const vo=Ma(ao,po).getOrThunk(()=>{const Fo={withSimilar:{state:od(!1),similar:!0,callbacks:[]},withoutSimilar:{state:od(!1),similar:!1,callbacks:[]},withVars:[]};return ao[po]=Fo,Fo}),Ao=()=>{const Fo=NL(Mn);return ML(Mn,Fo,po,Gn,no).isSome()};if(os(no)){const Fo=Gn?vo.withSimilar:vo.withoutSimilar;Fo.callbacks.push(jn),Fo.callbacks.length===1&&Fo.state.set(Ao())}else vo.withVars.push({state:od(Ao()),similar:Gn,vars:no,callback:jn})}),Vn.set(ao)},mQ=(Mn,Vn,Wn)=>{const jn=Mn.get();fs(Vn.split(","),Gn=>Ma(jn,Gn).each(no=>{jn[Gn]={withSimilar:{...no.withSimilar,callbacks:nr(no.withSimilar.callbacks,ao=>ao!==Wn)},withoutSimilar:{...no.withoutSimilar,callbacks:nr(no.withoutSimilar.callbacks,ao=>ao!==Wn)},withVars:nr(no.withVars,ao=>ao.callback!==Wn)}})),Mn.set(jn)},pQ=(Mn,Vn,Wn,jn,Gn,no)=>(hQ(Mn,Vn,Wn,jn,Gn,no),{unbind:()=>mQ(Vn,Wn,jn)}),gQ=(Mn,Vn,Wn,jn)=>{const Gn=Mn.formatter.get(Vn);Gn&&(VA(Mn,Vn,Wn,jn)&&(!("toggle"in Gn[0])||Gn[0].toggle)?TL(Mn,Vn,Wn,jn):RL(Mn,Vn,Wn,jn))},LL=Lr.explode,IL=()=>{const Mn={};return{addFilter:(Gn,no)=>{fs(LL(Gn),ao=>{Mr(Mn,ao)||(Mn[ao]={name:ao,callbacks:[]}),Mn[ao].callbacks.push(no)})},getFilters:()=>ka(Mn),removeFilter:(Gn,no)=>{fs(LL(Gn),ao=>{if(Mr(Mn,ao))if(is(no)){const po=Mn[ao],vo=nr(po.callbacks,Ao=>Ao!==no);vo.length>0?po.callbacks=vo:delete Mn[ao]}else delete Mn[ao]})}}},bQ=(Mn,Vn)=>{fs(Vn,Wn=>{Mn.attr(Wn,null)})},vQ=(Mn,Vn,Wn)=>{Mn.addNodeFilter("font",jn=>{fs(jn,Gn=>{const no=Vn.parse(Gn.attr("style")),ao=Gn.attr("color"),po=Gn.attr("face"),vo=Gn.attr("size");ao&&(no.color=ao),po&&(no["font-family"]=po),vo&&Em(vo).each(Ao=>{no["font-size"]=Wn[Ao-1]}),Gn.name="span",Gn.attr("style",Vn.serialize(no)),bQ(Gn,["color","face","size"])})})},yQ=(Mn,Vn,Wn)=>{Mn.addNodeFilter("strike",jn=>{const Gn=Vn.type!=="html4";fs(jn,no=>{if(Gn)no.name="s";else{const ao=Wn.parse(no.attr("style"));ao["text-decoration"]="line-through",no.name="span",no.attr("style",Wn.serialize(ao))}})})},OQ=(Mn,Vn,Wn)=>{var jn;const Gn=a1();Vn.convert_fonts_to_spans&&vQ(Mn,Gn,Lr.explode((jn=Vn.font_size_legacy_values)!==null&&jn!==void 0?jn:"")),yQ(Mn,Wn,Gn)},aD=(Mn,Vn,Wn)=>{Vn.inline_styles&&OQ(Mn,Vn,Wn)},lD=(Mn,Vn,Wn)=>{Vn.addNodeFilter("br",(jn,Gn,no)=>{const ao=Lr.extend({},Wn.getBlockElements()),po=Wn.getNonEmptyElements(),vo=Wn.getWhitespaceElements();ao.body=1;const Ao=Fo=>Fo.name in ao||og(Wn,Fo);for(let Fo=0,Qo=jn.length;Fofetch(Mn).then(Vn=>Vn.ok?Vn.blob():Promise.reject()).catch(()=>Promise.reject({message:`Cannot convert ${Mn} to Blob. Resource might not exist or is inaccessible.`,uriType:"blob"})),bE=Mn=>{const Vn=/([a-z0-9+\/=\s]+)/i.exec(Mn);return Vn?Vn[1]:""},JA=Mn=>{const[Vn,...Wn]=Mn.split(","),jn=Wn.join(","),Gn=/data:([^/]+\/[^;]+)(;.+)?/.exec(Vn);if(Gn){const no=Gn[2]===";base64",ao=no?bE(jn):decodeURIComponent(jn);return zo.some({type:Gn[1],data:ao,base64Encoded:no})}else return zo.none()},Fk=(Mn,Vn,Wn=!0)=>{let jn=Vn;if(Wn)try{jn=atob(Vn)}catch{return zo.none()}const Gn=new Uint8Array(jn.length);for(let no=0;nonew Promise((Vn,Wn)=>{JA(Mn).bind(({type:jn,data:Gn,base64Encoded:no})=>Fk(jn,Gn,no)).fold(()=>Wn("Invalid data URI"),Vn)}),BL=Mn=>Dc(Mn,"blob:")?VY(Mn):Dc(Mn,"data:")?vE(Mn):Promise.reject("Unknown URI format"),_Q=Mn=>new Promise((Vn,Wn)=>{const jn=new FileReader;jn.onloadend=()=>{Vn(jn.result)},jn.onerror=()=>{var Gn;Wn((Gn=jn.error)===null||Gn===void 0?void 0:Gn.message)},jn.readAsDataURL(Mn)});let SQ=0;const zY=Mn=>"blobid"+SQ++,FL=(Mn,Vn,Wn)=>JA(Mn).bind(({data:jn,type:Gn,base64Encoded:no})=>{if(Vn&&!no)return zo.none();{const ao=no?jn:btoa(jn);return Wn(ao,Gn)}}),HL=(Mn,Vn,Wn)=>{const jn=Mn.create(zY(),Vn,Wn);return Mn.add(jn),jn},wQ=(Mn,Vn,Wn=!1)=>FL(Vn,Wn,(jn,Gn)=>zo.from(Mn.getByData(jn,Gn)).orThunk(()=>Fk(Gn,jn).map(no=>HL(Mn,no,jn)))),CQ=(Mn,Vn)=>{const Wn=()=>Promise.reject("Invalid data URI");if(Dc(Vn,"blob:")){const jn=Mn.getByUri(Vn);return is(jn)?Promise.resolve(jn):BL(Vn).then(Gn=>_Q(Gn).then(no=>FL(no,!1,ao=>zo.some(HL(Mn,Gn,ao))).getOrThunk(Wn)))}else return Dc(Vn,"data:")?wQ(Mn,Vn).fold(Wn,jn=>Promise.resolve(jn)):Promise.reject("Unknown image data format")},QL=Mn=>is(Mn.attr("data-mce-bogus")),kQ=Mn=>Mn.attr("src")===aa.transparentSrc||is(Mn.attr("data-mce-placeholder")),VL=(Mn,Vn)=>{const{blob_cache:Wn}=Vn;if(Wn){const jn=Gn=>{const no=Gn.attr("src");kQ(Gn)||QL(Gn)||ms(no)||wQ(Wn,no,!0).each(ao=>{Gn.attr("src",ao.blobUri())})};Mn.addAttributeFilter("src",Gn=>fs(Gn,jn))}},cD=(Mn,Vn)=>Dc(Mn,`${Vn}/`),eP=(Mn,Vn,Wn,jn,Gn)=>{let no;os(Mn)?no="iframe":cD(Mn,"image")?no="img":cD(Mn,"video")?no="video":cD(Mn,"audio")?no="audio":no="iframe";const ao=new fp(no,1);return ao.attr(no==="audio"?{src:Vn}:{src:Vn,width:Wn,height:jn}),(no==="audio"||no==="video")&&ao.attr("controls",""),no==="iframe"&&Gn&&ao.attr("sandbox",""),ao},zL=(Mn,Vn)=>{const Wn=Mn.schema;Vn.remove_trailing_brs&&lD(Vn,Mn,Wn),Mn.addAttributeFilter("href",Gn=>{let no=Gn.length;const ao=vo=>vo.split(" ").filter(Fo=>Fo.length>0).concat(["noopener"]).sort().join(" "),po=vo=>{const Ao=vo?Lr.trim(vo):"";return/\b(noopener)\b/g.test(Ao)?Ao:ao(Ao)};if(!Vn.allow_unsafe_link_target)for(;no--;){const vo=Gn[no];vo.name==="a"&&vo.attr("target")==="_blank"&&vo.attr("rel",po(vo.attr("rel")))}}),Vn.allow_html_in_named_anchor||Mn.addAttributeFilter("id,name",Gn=>{let no=Gn.length,ao,po,vo,Ao;for(;no--;)if(Ao=Gn[no],Ao.name==="a"&&Ao.firstChild&&!Ao.attr("href"))for(vo=Ao.parent,ao=Ao.lastChild;ao&&vo;)po=ao.prev,vo.insert(ao,Ao),ao=po}),Vn.fix_list_elements&&Mn.addNodeFilter("ul,ol",Gn=>{let no=Gn.length,ao,po;for(;no--;)if(ao=Gn[no],po=ao.parent,po&&(po.name==="ul"||po.name==="ol"))if(ao.prev&&ao.prev.name==="li")ao.prev.append(ao);else{const vo=new fp("li",1);vo.attr("style","list-style-type: none"),ao.wrap(vo)}});const jn=Wn.getValidClasses();Vn.validate&&jn&&Mn.addAttributeFilter("class",Gn=>{var no;let ao=Gn.length;for(;ao--;){const po=Gn[ao],vo=(no=po.attr("class"))!==null&&no!==void 0?no:"",Ao=Lr.explode(vo," ");let Fo="";for(let Qo=0;Qofs(Gn,no=>{no.replace(eP(no.attr("type"),no.name==="object"?no.attr("data"):no.attr("src"),no.attr("width"),no.attr("height"),Vn.sandbox_iframes))})),Vn.sandbox_iframes&&Mn.addNodeFilter("iframe",Gn=>fs(Gn,no=>no.attr("sandbox","")))},{entries:jf,setPrototypeOf:xQ,isFrozen:WY,getPrototypeOf:UY,getOwnPropertyDescriptor:ZY}=Object;let{freeze:Lf,seal:w1,create:H_}=Object,{apply:_y,construct:uD}=typeof Reflect<"u"&&Reflect;_y||(_y=function(Vn,Wn,jn){return Vn.apply(Wn,jn)}),Lf||(Lf=function(Vn){return Vn}),w1||(w1=function(Vn){return Vn}),uD||(uD=function(Vn,Wn){return new Vn(...Wn)});const EQ=i0(Array.prototype.forEach),Hk=i0(Array.prototype.pop),Sy=i0(Array.prototype.push),SO=i0(String.prototype.toLowerCase),tP=i0(String.prototype.toString),dD=i0(String.prototype.match),r0=i0(String.prototype.replace),WL=i0(String.prototype.indexOf),TQ=i0(String.prototype.trim),gb=i0(RegExp.prototype.test),Qk=AQ(TypeError);function i0(Mn){return function(Vn){for(var Wn=arguments.length,jn=new Array(Wn>1?Wn-1:0),Gn=1;Gn/gm),GL=w1(/\${[\w\W]*}/gm),KL=w1(/^data-[\-\w.\u00B7-\uFFFF]/),JL=w1(/^aria-[\-\w]+$/),eI=w1(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),PQ=w1(/^(?:\w+script|data):/i),$Q=w1(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),oP=w1(/^html$/i);var zk=Object.freeze({__proto__:null,MUSTACHE_EXPR:XL,ERB_EXPR:YL,TMPLIT_EXPR:GL,DATA_ATTR:KL,ARIA_ATTR:JL,IS_ALLOWED_URI:eI,IS_SCRIPT_OR_DATA:PQ,ATTR_WHITESPACE:$Q,DOCTYPE_NAME:oP});const tI=()=>typeof window>"u"?null:window,nI=function(Vn,Wn){if(typeof Vn!="object"||typeof Vn.createPolicy!="function")return null;let jn=null;const Gn="data-tt-policy-suffix";Wn&&Wn.hasAttribute(Gn)&&(jn=Wn.getAttribute(Gn));const no="dompurify"+(jn?"#"+jn:"");try{return Vn.createPolicy(no,{createHTML(ao){return ao},createScriptURL(ao){return ao}})}catch{return console.warn("TrustedTypes policy "+no+" could not be created."),null}};function OE(){let Mn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tI();const Vn=ec=>OE(ec);if(Vn.version="3.0.5",Vn.removed=[],!Mn||!Mn.document||Mn.document.nodeType!==9)return Vn.isSupported=!1,Vn;const Wn=Mn.document,jn=Wn.currentScript;let{document:Gn}=Mn;const{DocumentFragment:no,HTMLTemplateElement:ao,Node:po,Element:vo,NodeFilter:Ao,NamedNodeMap:Fo=Mn.NamedNodeMap||Mn.MozNamedAttrMap,HTMLFormElement:Qo,DOMParser:qo,trustedTypes:ds}=Mn,bs=vo.prototype,ls=nP(bs,"cloneNode"),ys=nP(bs,"nextSibling"),Ls=nP(bs,"childNodes"),zs=nP(bs,"parentNode");if(typeof ao=="function"){const ec=Gn.createElement("template");ec.content&&ec.content.ownerDocument&&(Gn=ec.content.ownerDocument)}let Hs,tr="";const{implementation:Pr,createNodeIterator:Ur,createDocumentFragment:fa,getElementsByTagName:yr}=Gn,{importNode:fr}=Wn;let Ar={};Vn.isSupported=typeof jf=="function"&&typeof zs=="function"&&Pr&&Pr.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:wa,ERB_EXPR:Va,TMPLIT_EXPR:Tl,DATA_ATTR:tc,ARIA_ATTR:uu,IS_SCRIPT_OR_DATA:Qu,ATTR_WHITESPACE:Wd}=zk;let{IS_ALLOWED_URI:Jh}=zk,_u=null;const ea=Ou({},[...fD,...hD,...Fw,...mD,...qL]);let pa=null;const $c=Ou({},[...pD,...gD,...jL,...yE]);let ac=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Pa=null,ml=null,Yr=!0,pl=!0,pc=!1,Pu=!0,du=!1,Oh=!1,h0=!1,Ay=!1,Ip=!1,Sb=!1,Sl=!1,Mc=!0,ru=!1;const Kd="user-content-";let xd=!0,wg=!1,dv={},AO=null;const oC=Ou({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let C2=null;const n3=Ou({},["audio","video","img","source","image","track"]);let sC=null;const vT=Ou({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),k2="http://www.w3.org/1998/Math/MathML",lS="http://www.w3.org/2000/svg",fv="http://www.w3.org/1999/xhtml";let Py=fv,yT=!1,x2=null;const OT=Ou({},[k2,lS,fv],tP);let $y;const o3=["application/xhtml+xml","text/html"],_T="text/html";let xm,cS=null;const s3=Gn.createElement("form"),r3=function(hr){return hr instanceof RegExp||hr instanceof Function},ST=function(hr){if(!(cS&&cS===hr)){if((!hr||typeof hr!="object")&&(hr={}),hr=Vk(hr),$y=o3.indexOf(hr.PARSER_MEDIA_TYPE)===-1?$y=_T:$y=hr.PARSER_MEDIA_TYPE,xm=$y==="application/xhtml+xml"?tP:SO,_u="ALLOWED_TAGS"in hr?Ou({},hr.ALLOWED_TAGS,xm):ea,pa="ALLOWED_ATTR"in hr?Ou({},hr.ALLOWED_ATTR,xm):$c,x2="ALLOWED_NAMESPACES"in hr?Ou({},hr.ALLOWED_NAMESPACES,tP):OT,sC="ADD_URI_SAFE_ATTR"in hr?Ou(Vk(vT),hr.ADD_URI_SAFE_ATTR,xm):vT,C2="ADD_DATA_URI_TAGS"in hr?Ou(Vk(n3),hr.ADD_DATA_URI_TAGS,xm):n3,AO="FORBID_CONTENTS"in hr?Ou({},hr.FORBID_CONTENTS,xm):oC,Pa="FORBID_TAGS"in hr?Ou({},hr.FORBID_TAGS,xm):{},ml="FORBID_ATTR"in hr?Ou({},hr.FORBID_ATTR,xm):{},dv="USE_PROFILES"in hr?hr.USE_PROFILES:!1,Yr=hr.ALLOW_ARIA_ATTR!==!1,pl=hr.ALLOW_DATA_ATTR!==!1,pc=hr.ALLOW_UNKNOWN_PROTOCOLS||!1,Pu=hr.ALLOW_SELF_CLOSE_IN_ATTR!==!1,du=hr.SAFE_FOR_TEMPLATES||!1,Oh=hr.WHOLE_DOCUMENT||!1,Ip=hr.RETURN_DOM||!1,Sb=hr.RETURN_DOM_FRAGMENT||!1,Sl=hr.RETURN_TRUSTED_TYPE||!1,Ay=hr.FORCE_BODY||!1,Mc=hr.SANITIZE_DOM!==!1,ru=hr.SANITIZE_NAMED_PROPS||!1,xd=hr.KEEP_CONTENT!==!1,wg=hr.IN_PLACE||!1,Jh=hr.ALLOWED_URI_REGEXP||eI,Py=hr.NAMESPACE||fv,ac=hr.CUSTOM_ELEMENT_HANDLING||{},hr.CUSTOM_ELEMENT_HANDLING&&r3(hr.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ac.tagNameCheck=hr.CUSTOM_ELEMENT_HANDLING.tagNameCheck),hr.CUSTOM_ELEMENT_HANDLING&&r3(hr.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ac.attributeNameCheck=hr.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),hr.CUSTOM_ELEMENT_HANDLING&&typeof hr.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ac.allowCustomizedBuiltInElements=hr.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),du&&(pl=!1),Sb&&(Ip=!0),dv&&(_u=Ou({},[...qL]),pa=[],dv.html===!0&&(Ou(_u,fD),Ou(pa,pD)),dv.svg===!0&&(Ou(_u,hD),Ou(pa,gD),Ou(pa,yE)),dv.svgFilters===!0&&(Ou(_u,Fw),Ou(pa,gD),Ou(pa,yE)),dv.mathMl===!0&&(Ou(_u,mD),Ou(pa,jL),Ou(pa,yE))),hr.ADD_TAGS&&(_u===ea&&(_u=Vk(_u)),Ou(_u,hr.ADD_TAGS,xm)),hr.ADD_ATTR&&(pa===$c&&(pa=Vk(pa)),Ou(pa,hr.ADD_ATTR,xm)),hr.ADD_URI_SAFE_ATTR&&Ou(sC,hr.ADD_URI_SAFE_ATTR,xm),hr.FORBID_CONTENTS&&(AO===oC&&(AO=Vk(AO)),Ou(AO,hr.FORBID_CONTENTS,xm)),xd&&(_u["#text"]=!0),Oh&&Ou(_u,["html","head","body"]),_u.table&&(Ou(_u,["tbody"]),delete Pa.tbody),hr.TRUSTED_TYPES_POLICY){if(typeof hr.TRUSTED_TYPES_POLICY.createHTML!="function")throw Qk('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof hr.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Qk('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Hs=hr.TRUSTED_TYPES_POLICY,tr=Hs.createHTML("")}else Hs===void 0&&(Hs=nI(ds,jn)),Hs!==null&&typeof tr=="string"&&(tr=Hs.createHTML(""));Lf&&Lf(hr),cS=hr}},Ry=Ou({},["mi","mo","mn","ms","mtext"]),wT=Ou({},["foreignobject","desc","title","annotation-xml"]),or=Ou({},["title","style","font","a","script"]),ur=Ou({},hD);Ou(ur,Fw),Ou(ur,UL);const Gr=Ou({},mD);Ou(Gr,ZL);const Wr=function(hr){let Da=zs(hr);(!Da||!Da.tagName)&&(Da={namespaceURI:Py,tagName:"template"});const sl=SO(hr.tagName),af=SO(Da.tagName);return x2[hr.namespaceURI]?hr.namespaceURI===lS?Da.namespaceURI===fv?sl==="svg":Da.namespaceURI===k2?sl==="svg"&&(af==="annotation-xml"||Ry[af]):!!ur[sl]:hr.namespaceURI===k2?Da.namespaceURI===fv?sl==="math":Da.namespaceURI===lS?sl==="math"&&wT[af]:!!Gr[sl]:hr.namespaceURI===fv?Da.namespaceURI===lS&&!wT[af]||Da.namespaceURI===k2&&!Ry[af]?!1:!Gr[sl]&&(or[sl]||!ur[sl]):!!($y==="application/xhtml+xml"&&x2[hr.namespaceURI]):!1},Ha=function(hr){Sy(Vn.removed,{element:hr});try{hr.parentNode.removeChild(hr)}catch{hr.remove()}},Jl=function(hr,Da){try{Sy(Vn.removed,{attribute:Da.getAttributeNode(hr),from:Da})}catch{Sy(Vn.removed,{attribute:null,from:Da})}if(Da.removeAttribute(hr),hr==="is"&&!pa[hr])if(Ip||Sb)try{Ha(Da)}catch{}else try{Da.setAttribute(hr,"")}catch{}},pd=function(hr){let Da,sl;if(Ay)hr=""+hr;else{const Cb=dD(hr,/^[\r\n\t ]+/);sl=Cb&&Cb[0]}$y==="application/xhtml+xml"&&Py===fv&&(hr=''+hr+"");const af=Hs?Hs.createHTML(hr):hr;if(Py===fv)try{Da=new qo().parseFromString(af,$y)}catch{}if(!Da||!Da.documentElement){Da=Pr.createDocument(Py,"template",null);try{Da.documentElement.innerHTML=yT?tr:af}catch{}}const Zm=Da.body||Da.documentElement;return hr&&sl&&Zm.insertBefore(Gn.createTextNode(sl),Zm.childNodes[0]||null),Py===fv?yr.call(Da,Oh?"html":"body")[0]:Oh?Da.documentElement:Zm},gp=function(hr){return Ur.call(hr.ownerDocument||hr,hr,Ao.SHOW_ELEMENT|Ao.SHOW_COMMENT|Ao.SHOW_TEXT,null,!1)},em=function(hr){return hr instanceof Qo&&(typeof hr.nodeName!="string"||typeof hr.textContent!="string"||typeof hr.removeChild!="function"||!(hr.attributes instanceof Fo)||typeof hr.removeAttribute!="function"||typeof hr.setAttribute!="function"||typeof hr.namespaceURI!="string"||typeof hr.insertBefore!="function"||typeof hr.hasChildNodes!="function")},uS=function(hr){return typeof po=="object"?hr instanceof po:hr&&typeof hr=="object"&&typeof hr.nodeType=="number"&&typeof hr.nodeName=="string"},wb=function(hr,Da,sl){Ar[hr]&&EQ(Ar[hr],af=>{af.call(Vn,Da,sl,cS)})},i3=function(hr){let Da;if(wb("beforeSanitizeElements",hr,null),em(hr))return Ha(hr),!0;const sl=xm(hr.nodeName);if(wb("uponSanitizeElement",hr,{tagName:sl,allowedTags:_u}),hr.hasChildNodes()&&!uS(hr.firstElementChild)&&(!uS(hr.content)||!uS(hr.content.firstElementChild))&&gb(/<[/\w]/g,hr.innerHTML)&&gb(/<[/\w]/g,hr.textContent))return Ha(hr),!0;if(!_u[sl]||Pa[sl]){if(!Pa[sl]&&xN(sl)&&(ac.tagNameCheck instanceof RegExp&&gb(ac.tagNameCheck,sl)||ac.tagNameCheck instanceof Function&&ac.tagNameCheck(sl)))return!1;if(xd&&!AO[sl]){const af=zs(hr)||hr.parentNode,Zm=Ls(hr)||hr.childNodes;if(Zm&&af){const Cb=Zm.length;for(let _h=Cb-1;_h>=0;--_h)af.insertBefore(ls(Zm[_h],!0),ys(hr))}}return Ha(hr),!0}return hr instanceof vo&&!Wr(hr)||(sl==="noscript"||sl==="noembed"||sl==="noframes")&&gb(/<\/no(script|embed|frames)/i,hr.innerHTML)?(Ha(hr),!0):(du&&hr.nodeType===3&&(Da=hr.textContent,Da=r0(Da,wa," "),Da=r0(Da,Va," "),Da=r0(Da,Tl," "),hr.textContent!==Da&&(Sy(Vn.removed,{element:hr.cloneNode()}),hr.textContent=Da)),wb("afterSanitizeElements",hr,null),!1)},kN=function(hr,Da,sl){if(Mc&&(Da==="id"||Da==="name")&&(sl in Gn||sl in s3))return!1;if(!(pl&&!ml[Da]&&gb(tc,Da))){if(!(Yr&&gb(uu,Da))){if(!pa[Da]||ml[Da]){if(!(xN(hr)&&(ac.tagNameCheck instanceof RegExp&&gb(ac.tagNameCheck,hr)||ac.tagNameCheck instanceof Function&&ac.tagNameCheck(hr))&&(ac.attributeNameCheck instanceof RegExp&&gb(ac.attributeNameCheck,Da)||ac.attributeNameCheck instanceof Function&&ac.attributeNameCheck(Da))||Da==="is"&&ac.allowCustomizedBuiltInElements&&(ac.tagNameCheck instanceof RegExp&&gb(ac.tagNameCheck,sl)||ac.tagNameCheck instanceof Function&&ac.tagNameCheck(sl))))return!1}else if(!sC[Da]){if(!gb(Jh,r0(sl,Wd,""))){if(!((Da==="src"||Da==="xlink:href"||Da==="href")&&hr!=="script"&&WL(sl,"data:")===0&&C2[hr])){if(!(pc&&!gb(Qu,r0(sl,Wd,"")))){if(sl)return!1}}}}}}return!0},xN=function(hr){return hr.indexOf("-")>0},tH=function(hr){let Da,sl,af,Zm;wb("beforeSanitizeAttributes",hr,null);const{attributes:Cb}=hr;if(!Cb)return;const _h={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:pa};for(Zm=Cb.length;Zm--;){Da=Cb[Zm];const{name:kb,namespaceURI:EN}=Da;sl=kb==="value"?Da.value:TQ(Da.value);const oH=sl;if(af=xm(kb),_h.attrName=af,_h.attrValue=sl,_h.keepAttr=!0,_h.forceKeepAttr=void 0,wb("uponSanitizeAttribute",hr,_h),sl=_h.attrValue,_h.forceKeepAttr)continue;if(!_h.keepAttr){Jl(kb,hr);continue}if(!Pu&&gb(/\/>/i,sl)){Jl(kb,hr);continue}du&&(sl=r0(sl,wa," "),sl=r0(sl,Va," "),sl=r0(sl,Tl," "));const a3=xm(hr.nodeName);if(!kN(a3,af,sl)){Jl(kb,hr);continue}if(ru&&(af==="id"||af==="name")&&(Jl(kb,hr),sl=Kd+sl),Hs&&typeof ds=="object"&&typeof ds.getAttributeType=="function"&&!EN)switch(ds.getAttributeType(a3,af)){case"TrustedHTML":{sl=Hs.createHTML(sl);break}case"TrustedScriptURL":{sl=Hs.createScriptURL(sl);break}}if(sl!==oH)try{EN?hr.setAttributeNS(EN,kb,sl):hr.setAttribute(kb,sl)}catch{Jl(kb,hr)}}wb("afterSanitizeAttributes",hr,null)},nH=function ec(hr){let Da;const sl=gp(hr);for(wb("beforeSanitizeShadowDOM",hr,null);Da=sl.nextNode();)wb("uponSanitizeShadowNode",Da,null),!i3(Da)&&(Da.content instanceof no&&ec(Da.content),tH(Da));wb("afterSanitizeShadowDOM",hr,null)};return Vn.sanitize=function(ec){let hr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Da,sl,af,Zm;if(yT=!ec,yT&&(ec=""),typeof ec!="string"&&!uS(ec))if(typeof ec.toString=="function"){if(ec=ec.toString(),typeof ec!="string")throw Qk("dirty is not a string, aborting")}else throw Qk("toString is not a function");if(!Vn.isSupported)return ec;if(h0||ST(hr),Vn.removed=[],typeof ec=="string"&&(wg=!1),wg){if(ec.nodeName){const kb=xm(ec.nodeName);if(!_u[kb]||Pa[kb])throw Qk("root node is forbidden and cannot be sanitized in-place")}}else if(ec instanceof po)Da=pd(""),sl=Da.ownerDocument.importNode(ec,!0),sl.nodeType===1&&sl.nodeName==="BODY"||sl.nodeName==="HTML"?Da=sl:Da.appendChild(sl);else{if(!Ip&&!du&&!Oh&&ec.indexOf("<")===-1)return Hs&&Sl?Hs.createHTML(ec):ec;if(Da=pd(ec),!Da)return Ip?null:Sl?tr:""}Da&&Ay&&Ha(Da.firstChild);const Cb=gp(wg?ec:Da);for(;af=Cb.nextNode();)i3(af)||(af.content instanceof no&&nH(af.content),tH(af));if(wg)return ec;if(Ip){if(Sb)for(Zm=fa.call(Da.ownerDocument);Da.firstChild;)Zm.appendChild(Da.firstChild);else Zm=Da;return(pa.shadowroot||pa.shadowrootmode)&&(Zm=fr.call(Wn,Zm,!0)),Zm}let _h=Oh?Da.outerHTML:Da.innerHTML;return Oh&&_u["!doctype"]&&Da.ownerDocument&&Da.ownerDocument.doctype&&Da.ownerDocument.doctype.name&&gb(oP,Da.ownerDocument.doctype.name)&&(_h=" +`+_h),du&&(_h=r0(_h,wa," "),_h=r0(_h,Va," "),_h=r0(_h,Tl," ")),Hs&&Sl?Hs.createHTML(_h):_h},Vn.setConfig=function(ec){ST(ec),h0=!0},Vn.clearConfig=function(){cS=null,h0=!1},Vn.isValidAttribute=function(ec,hr,Da){cS||ST({});const sl=xm(ec),af=xm(hr);return kN(sl,af,Da)},Vn.addHook=function(ec,hr){typeof hr=="function"&&(Ar[ec]=Ar[ec]||[],Sy(Ar[ec],hr))},Vn.removeHook=function(ec){if(Ar[ec])return Hk(Ar[ec])},Vn.removeHooks=function(ec){Ar[ec]&&(Ar[ec]=[])},Vn.removeAllHooks=function(){Ar={}},Vn}var oI=OE();const sI=Lr.each,Q_=Lr.trim,bD=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],rI={ftp:21,http:80,https:443,mailto:25},_E=["img","video"],iI=(Mn,Vn)=>is(Mn)?!Mn:is(Vn)?!Zs(_E,Vn):!0,vD=Mn=>{try{return decodeURIComponent(Mn)}catch{return unescape(Mn)}},yD=(Mn,Vn,Wn)=>{const jn=vD(Vn).replace(/\s/g,"");return Mn.allow_script_urls?!1:/((java|vb)script|mhtml):/i.test(jn)?!0:Mn.allow_html_data_urls?!1:/^data:image\//i.test(jn)?iI(Mn.allow_svg_data_urls,Wn)&&/^data:image\/svg\+xml/i.test(jn):/^data:/i.test(jn)};class bb{static parseDataUri(Vn){let Wn;const jn=decodeURIComponent(Vn).split(","),Gn=/data:([^;]+)/.exec(jn[0]);return Gn&&(Wn=Gn[1]),{type:Wn,data:jn[1]}}static isDomSafe(Vn,Wn,jn={}){if(jn.allow_script_urls)return!0;{const Gn=P0.decode(Vn).replace(/[\s\u0000-\u001F]+/g,"");return!yD(jn,Gn,Wn)}}static getDocumentBaseUrl(Vn){var Wn;let jn;return Vn.protocol.indexOf("http")!==0&&Vn.protocol!=="file:"?jn=(Wn=Vn.href)!==null&&Wn!==void 0?Wn:"":jn=Vn.protocol+"//"+Vn.host+Vn.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(jn)&&(jn=jn.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(jn)||(jn+="/")),jn}constructor(Vn,Wn={}){this.path="",this.directory="",Vn=Q_(Vn),this.settings=Wn;const jn=Wn.base_uri,Gn=this;if(/^([\w\-]+):([^\/]{2})/i.test(Vn)||/^\s*#/.test(Vn)){Gn.source=Vn;return}const no=Vn.indexOf("//")===0;if(Vn.indexOf("/")===0&&!no&&(Vn=(jn&&jn.protocol||"http")+"://mce_host"+Vn),!/^[\w\-]*:?\/\//.test(Vn)){const po=jn?jn.path:new bb(document.location.href).directory;if((jn==null?void 0:jn.protocol)==="")Vn="//mce_host"+Gn.toAbsPath(po,Vn);else{const vo=/([^#?]*)([#?]?.*)/.exec(Vn);vo&&(Vn=(jn&&jn.protocol||"http")+"://mce_host"+Gn.toAbsPath(po,vo[1])+vo[2])}}Vn=Vn.replace(/@@/g,"(mce_at)");const ao=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(Vn);ao&&sI(bD,(po,vo)=>{let Ao=ao[vo];Ao&&(Ao=Ao.replace(/\(mce_at\)/g,"@@")),Gn[po]=Ao}),jn&&(Gn.protocol||(Gn.protocol=jn.protocol),Gn.userInfo||(Gn.userInfo=jn.userInfo),!Gn.port&&Gn.host==="mce_host"&&(Gn.port=jn.port),(!Gn.host||Gn.host==="mce_host")&&(Gn.host=jn.host),Gn.source=""),no&&(Gn.protocol="")}setPath(Vn){const Wn=/^(.*?)\/?(\w+)?$/.exec(Vn);Wn&&(this.path=Wn[0],this.directory=Wn[1],this.file=Wn[2]),this.source="",this.getURI()}toRelative(Vn){if(Vn==="./")return Vn;const Wn=new bb(Vn,{base_uri:this});if(Wn.host!=="mce_host"&&this.host!==Wn.host&&Wn.host||this.port!==Wn.port||this.protocol!==Wn.protocol&&Wn.protocol!=="")return Wn.getURI();const jn=this.getURI(),Gn=Wn.getURI();if(jn===Gn||jn.charAt(jn.length-1)==="/"&&jn.substr(0,jn.length-1)===Gn)return jn;let no=this.toRelPath(this.path,Wn.path);return Wn.query&&(no+="?"+Wn.query),Wn.anchor&&(no+="#"+Wn.anchor),no}toAbsolute(Vn,Wn){const jn=new bb(Vn,{base_uri:this});return jn.getURI(Wn&&this.isSameOrigin(jn))}isSameOrigin(Vn){if(this.host==Vn.host&&this.protocol==Vn.protocol){if(this.port==Vn.port)return!0;const Wn=this.protocol?rI[this.protocol]:null;if(Wn&&(this.port||Wn)==(Vn.port||Wn))return!0}return!1}toRelPath(Vn,Wn){let jn=0,Gn="",no,ao;const po=Vn.substring(0,Vn.lastIndexOf("/")).split("/"),vo=Wn.split("/");if(po.length>=vo.length){for(no=0,ao=po.length;no=vo.length||po[no]!==vo[no]){jn=no+1;break}}if(po.length=po.length||po[no]!==vo[no]){jn=no+1;break}}if(jn===1)return Wn;for(no=0,ao=po.length-(jn-1);no{Qo&&po.push(Qo)});const vo=[];for(let Qo=ao.length-1;Qo>=0;Qo--)if(!(ao[Qo].length===0||ao[Qo]===".")){if(ao[Qo]===".."){jn++;continue}if(jn>0){jn--;continue}vo.push(ao[Qo])}const Ao=po.length-jn;let Fo;return Ao<=0?Fo=nc(vo).join("/"):Fo=po.slice(0,Ao).join("/")+"/"+nc(vo).join("/"),Fo.indexOf("/")!==0&&(Fo="/"+Fo),Gn&&Fo.lastIndexOf("/")!==Fo.length-1&&(Fo+=Gn),Fo}getURI(Vn=!1){let Wn;return(!this.source||Vn)&&(Wn="",Vn||(this.protocol?Wn+=this.protocol+"://":Wn+="//",this.userInfo&&(Wn+=this.userInfo+"@"),this.host&&(Wn+=this.host),this.port&&(Wn+=":"+this.port)),this.path&&(Wn+=this.path),this.query&&(Wn+="?"+this.query),this.anchor&&(Wn+="#"+this.anchor),this.source=Wn),this.source}}const RQ=Lr.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),OD="data-mce-type";let aI=0;const sP=(Mn,Vn,Wn,jn,Gn)=>{var no,ao,po,vo;const Ao=Vn.validate,Fo=Wn.getSpecialElements();Mn.nodeType===Am&&!Vn.allow_conditional_comments&&/^\[if/i.test((no=Mn.nodeValue)!==null&&no!==void 0?no:"")&&(Mn.nodeValue=" "+Mn.nodeValue);const Qo=(ao=Gn==null?void 0:Gn.tagName)!==null&&ao!==void 0?ao:Mn.nodeName.toLowerCase();if(jn!=="html"&&Wn.isValid(jn)){is(Gn)&&(Gn.allowedTags[Qo]=!0);return}if(Mn.nodeType!==Hh||Qo==="body")return;const qo=Cs.fromDom(Mn),ds=Od(qo,OD),bs=Tf(qo,"data-mce-bogus");if(!ds&&xo(bs)){bs==="all"?sc(qo):hf(qo);return}const ls=Wn.getElementRule(Qo);if(Ao&&!ls){Mr(Fo,Qo)?sc(qo):hf(qo);return}else is(Gn)&&(Gn.allowedTags[Qo]=!0);if(Ao&&ls&&!ds){if(fs((po=ls.attributesForced)!==null&&po!==void 0?po:[],ys=>{Gc(qo,ys.name,ys.value==="{$uid}"?`mce_${aI++}`:ys.value)}),fs((vo=ls.attributesDefault)!==null&&vo!==void 0?vo:[],ys=>{Od(qo,ys.name)||Gc(qo,ys.name,ys.value==="{$uid}"?`mce_${aI++}`:ys.value)}),ls.attributesRequired&&!Sr(ls.attributesRequired,ys=>Od(qo,ys))){hf(qo);return}if(ls.removeEmptyAttrs&&Vh(qo)){hf(qo);return}ls.outputName&&ls.outputName!==Qo&&Bg(qo,ls.outputName)}},DQ=(Mn,Vn,Wn,jn,Gn)=>{const no=Mn.tagName.toLowerCase(),{attrName:ao,attrValue:po}=Gn;Gn.keepAttr=_D(Vn,Wn,jn,no,ao,po),Gn.keepAttr?(Gn.allowedAttributes[ao]=!0,cI(ao,Wn)&&(Gn.attrValue=ao),Vn.allow_svg_data_urls&&Dc(po,"data:image/svg+xml")&&(Gn.forceKeepAttr=!0)):lI(Mn,ao)&&(Gn.forceKeepAttr=!0)},_D=(Mn,Vn,Wn,jn,Gn,no)=>Wn!=="html"&&!ng(jn)?!0:!(Gn in RQ&&yD(Mn,no,jn))&&(!Mn.validate||Vn.isValid(jn,Gn)||Dc(Gn,"data-")||Dc(Gn,"aria-")),lI=(Mn,Vn)=>Mn.hasAttribute(OD)&&(Vn==="id"||Vn==="class"||Vn==="style"),cI=(Mn,Vn)=>Mn in Vn.getBoolAttrs(),MQ=(Mn,Vn,Wn,jn)=>{const{attributes:Gn}=Mn;for(let no=Gn.length-1;no>=0;no--){const ao=Gn[no],po=ao.name,vo=ao.value;!_D(Vn,Wn,jn,Mn.tagName.toLowerCase(),po,vo)&&!lI(Mn,po)?Mn.removeAttribute(po):cI(po,Wn)&&Mn.setAttribute(po,po)}},NQ=(Mn,Vn,Wn)=>{const jn=oI();return jn.addHook("uponSanitizeElement",(Gn,no)=>{sP(Gn,Mn,Vn,Wn.track(Gn),no)}),jn.addHook("uponSanitizeAttribute",(Gn,no)=>{DQ(Gn,Mn,Vn,Wn.current(),no)}),jn},LQ=(Mn,Vn)=>{const jn={...{IN_PLACE:!0,ALLOW_UNKNOWN_PROTOCOLS:!0,ALLOWED_TAGS:["#comment","#cdata-section","body"],ALLOWED_ATTR:[]}};return jn.PARSER_MEDIA_TYPE=Vn,Mn.allow_script_urls?jn.ALLOWED_URI_REGEXP=/.*/:Mn.allow_html_data_urls&&(jn.ALLOWED_URI_REGEXP=/^(?!(\w+script|mhtml):)/i),jn},IQ=Mn=>{const Vn=["type","href","role","arcrole","title","show","actuate","label","from","to"].map(jn=>`xlink:${jn}`),Wn={IN_PLACE:!0,USE_PROFILES:{html:!0,svg:!0,svgFilters:!0},ALLOWED_ATTR:Vn};return oI().sanitize(Mn,Wn),Mn.innerHTML},BQ=(Mn,Vn)=>{const Wn=Z1();if(Mn.sanitize){const jn=NQ(Mn,Vn,Wn);return{sanitizeHtmlElement:(no,ao)=>{jn.sanitize(no,LQ(Mn,ao)),jn.removed=[],Wn.reset()},sanitizeNamespaceElement:IQ}}else return{sanitizeHtmlElement:(no,ao)=>{const po=document.createNodeIterator(no,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_TEXT);let vo;for(;vo=po.nextNode();){const Ao=Wn.track(vo);sP(vo,Mn,Vn,Ao),Oa(vo)&&MQ(vo,Mn,Vn,Ao)}Wn.reset()},sanitizeNamespaceElement:Js}},uI=Lr.makeMap,dI=Lr.extend,SE=(Mn,Vn,Wn,jn)=>{const Gn=Mn.name,no=Gn in Wn&&Gn!=="title"&&Gn!=="textarea"&&Gn!=="noscript",ao=Vn.childNodes;for(let po=0,vo=ao.length;po{const jn=[];for(let Gn=Mn,no=Gn;Gn;no=Gn,Gn=Gn.walk()){const ao=Gn;fs(Vn,po=>po(ao)),ms(ao.parent)&&ao!==Mn?Gn=no:jn.push(ao)}for(let Gn=jn.length-1;Gn>=0;Gn--){const no=jn[Gn];fs(Wn,ao=>ao(no))}},FQ=(Mn,Vn,Wn,jn)=>{const Gn=Wn.validate,no=Vn.getNonEmptyElements(),ao=Vn.getWhitespaceElements(),po=dI(uI("script,style,head,html,body,title,meta,param"),Vn.getBlockElements()),vo=dC(Vn),Ao=/[ \t\r\n]+/g,Fo=/^[ \t\r\n]+/,Qo=/[ \t\r\n]+$/,qo=zs=>{let Hs=zs.parent;for(;is(Hs);){if(Hs.name in ao)return!0;Hs=Hs.parent}return!1},ds=zs=>{let Hs=zs;for(;is(Hs);){if(Hs.name in vo)return Ak(Vn,no,ao,Hs);Hs=Hs.parent}return!1},bs=zs=>zs.name in po||og(Vn,zs)||ng(zs.name)&&zs.parent===Mn,ls=(zs,Hs)=>{const tr=Hs?zs.prev:zs.next;return is(tr)||ms(zs.parent)?!1:bs(zs.parent)&&(zs.parent!==Mn||jn.isRootContent===!0)};return[zs=>{var Hs;if(zs.type===3&&!qo(zs)){let tr=(Hs=zs.value)!==null&&Hs!==void 0?Hs:"";tr=tr.replace(Ao," "),($R(zs.prev,bs)||ls(zs,!0))&&(tr=tr.replace(Fo,"")),tr.length===0?zs.remove():zs.value=tr}},zs=>{var Hs;if(zs.type===1){const tr=Vn.getElementRule(zs.name);if(Gn&&tr){const Pr=Ak(Vn,no,ao,zs);tr.paddInEmptyBlock&&Pr&&ds(zs)?MA(Wn,jn,bs,zs):tr.removeEmpty&&Pr?bs(zs)?zs.remove():zs.unwrap():tr.paddEmpty&&(Pr||Z5(zs))&&MA(Wn,jn,bs,zs)}}else if(zs.type===3&&!qo(zs)){let tr=(Hs=zs.value)!==null&&Hs!==void 0?Hs:"";(zs.next&&bs(zs.next)||ls(zs,!1))&&(tr=tr.replace(Qo,"")),tr.length===0?zs.remove():zs.value=tr}}]},rP=(Mn,Vn)=>{var Wn;const jn=(Wn=Vn.forced_root_block)!==null&&Wn!==void 0?Wn:Mn.forced_root_block;return jn===!1?"":jn===!0?"p":jn},a0=(Mn={},Vn=i1())=>{const Wn=IL(),jn=IL(),Gn={validate:!0,root_name:"body",sanitize:!0,...Mn},no=new DOMParser,ao=BQ(Gn,Vn),po=(Hs,tr,Pr="html")=>{const Ur=Pr==="xhtml"?"application/xhtml+xml":"text/html",fa=Mr(Vn.getSpecialElements(),tr.toLowerCase()),yr=fa?`<${tr}>${Hs}`:Hs,fr=Pr==="xhtml"?`${yr}`:`${yr}`,Ar=no.parseFromString(fr,Ur).body;return ao.sanitizeHtmlElement(Ar,Ur),fa?Ar.firstChild:Ar},vo=Wn.addFilter,Ao=Wn.getFilters,Fo=Wn.removeFilter,Qo=jn.addFilter,qo=jn.getFilters,ds=jn.removeFilter,bs=(Hs,tr)=>{IA(Vn,Hs)&&tr.push(Hs)},ls=(Hs,tr)=>{const Pr=xo(tr.attr(OD)),Ur=tr.type===1&&!Mr(Hs,tr.name)&&!og(Vn,tr)&&!ng(tr.name);return tr.type===3||Ur&&!Pr},ys=(Hs,tr)=>{const Pr=dI(uI("script,style,head,html,body,title,meta,param"),Vn.getBlockElements()),Ur=/^[ \t\r\n]+/,fa=/[ \t\r\n]+$/;let yr=Hs.firstChild,fr=null;const Ar=wa=>{var Va,Tl;wa&&(yr=wa.firstChild,yr&&yr.type===3&&(yr.value=(Va=yr.value)===null||Va===void 0?void 0:Va.replace(Ur,"")),yr=wa.lastChild,yr&&yr.type===3&&(yr.value=(Tl=yr.value)===null||Tl===void 0?void 0:Tl.replace(fa,"")))};if(Vn.isValidChild(Hs.name,tr.toLowerCase())){for(;yr;){const wa=yr.next;ls(Pr,yr)?(fr||(fr=new fp(tr,1),fr.attr(Gn.forced_root_block_attrs),Hs.insert(fr,yr)),fr.append(yr)):(Ar(fr),fr=null),yr=wa}Ar(fr)}},zs={schema:Vn,addAttributeFilter:Qo,getAttributeFilters:qo,removeAttributeFilter:ds,addNodeFilter:vo,getNodeFilters:Ao,removeNodeFilter:Fo,parse:(Hs,tr={})=>{var Pr;const Ur=Gn.validate,fa=(Pr=tr.context)!==null&&Pr!==void 0?Pr:Gn.root_name,yr=po(Hs,fa,tr.format);kv(Vn,yr);const fr=new fp(fa,11);SE(fr,yr,Vn.getSpecialElements(),ao.sanitizeNamespaceElement),yr.innerHTML="";const[Ar,wa]=FQ(fr,Vn,Gn,tr),Va=[],Tl=Ur?Wd=>bs(Wd,Va):Js,tc={nodes:{},attributes:{}},uu=Wd=>ER(Ao(),qo(),Wd,tc);if(mp(fr,[Ar,uu],[wa,Tl]),Va.reverse(),Ur&&Va.length>0)if(tr.context){const{pass:Wd,fail:Jh}=Vr(Va,_u=>_u.parent===fr);LA(Jh,Vn,fr,uu),tr.invalid=Wd.length>0}else LA(Va,Vn,fr,uu);const Qu=rP(Gn,tr);return Qu&&(fr.name==="body"||tr.isRootContent)&&ys(fr,Qu),tr.invalid||TR(tc,tr),fr}};return zL(zs,Gn),aD(zs,Gn,Vn),zs},fI=Mn=>QA(Mn)?I_({validate:!1}).serialize(Mn):Mn,bg=(Mn,Vn,Wn)=>{const jn=fI(Mn),Gn=Vn(jn);if(Gn.isDefaultPrevented())return Gn;if(QA(Mn))if(Gn.content!==jn){const no=a0({validate:!1,forced_root_block:!1,...Wn}).parse(Gn.content,{context:Mn.name});return{...Gn,content:no}}else return{...Gn,content:Mn};else return Gn},V_=(Mn,Vn)=>{if(Vn.no_events)return ym.value(Vn);{const Wn=P3(Mn,Vn);return Wn.isDefaultPrevented()?ym.error(ic(Mn,{content:"",...Wn}).content):ym.value(Wn)}},SD=(Mn,Vn,Wn)=>Wn.no_events?Vn:bg(Vn,Gn=>ic(Mn,{...Wn,content:Gn}),{sanitize:jb(Mn),sandbox_iframes:b_(Mn)}).content,wD=(Mn,Vn)=>{if(Vn.no_events)return ym.value(Vn);{const Wn=bg(Vn.content,jn=>RN(Mn,{...Vn,content:jn}),{sanitize:jb(Mn),sandbox_iframes:b_(Mn)});return Wn.isDefaultPrevented()?(JT(Mn,Wn),ym.error(void 0)):ym.value(Wn)}},iP=(Mn,Vn,Wn)=>{Wn.no_events||JT(Mn,{...Wn,content:Vn})},CD=(Mn,Vn,Wn)=>({element:Mn,width:Vn,rows:Wn}),kD=(Mn,Vn)=>({element:Mn,cells:Vn}),wE=(Mn,Vn)=>({x:Mn,y:Vn}),aP=(Mn,Vn)=>Ld(Mn,Vn).bind(Em).getOr(1),HQ=(Mn,Vn,Wn,jn,Gn)=>{const no=aP(Gn,"rowspan"),ao=aP(Gn,"colspan"),po=Mn.rows;for(let vo=Wn;vo{const jn=Mn.rows;return!!(jn[Wn]?jn[Wn].cells:[])[Vn]},QQ=(Mn,Vn,Wn)=>{for(;hI(Mn,Vn,Wn);)Vn++;return Vn},lP=Mn=>ra(Mn,(Vn,Wn)=>Wn.cells.length>Vn?Wn.cells.length:Vn,0),cP=(Mn,Vn)=>{const Wn=Mn.rows;for(let jn=0;jn{const no=[],ao=Mn.rows;for(let po=Wn;po<=Gn;po++){const vo=ao[po].cells,Ao=Vn{const jn=Vn.x,Gn=Vn.y,no=Wn.x,ao=Wn.y,po=Gn{const Wn=Hm(Mn.element),jn=Cs.fromTag("tbody");return Lc(jn,Vn),Fu(Wn,jn),Wn},xD=Mn=>Us(Mn.rows,Vn=>{const Wn=Us(Vn.cells,Gn=>{const no=GO(Gn);return Mu(no,"colspan"),Mu(no,"rowspan"),no}),jn=Hm(Vn.element);return Lc(jn,Wn),jn}),zQ=Mn=>{const Vn=CD(Hm(Mn),0,[]);return fs(mf(Mn,"tr"),(Wn,jn)=>{fs(mf(Wn,"td,th"),(Gn,no)=>{HQ(Vn,QQ(Vn,no,jn),jn,Wn,Gn)})}),CD(Vn.element,lP(Vn.rows),Vn.rows)},uP=Mn=>wy(Mn,xD(Mn)),ED=(Mn,Vn,Wn)=>cP(Mn,Vn).bind(jn=>cP(Mn,Wn).map(Gn=>VQ(Mn,jn,Gn))),pI=Mn=>xa(Mn,Vn=>ql(Vn)==="ul"||ql(Vn)==="ol"),gI=(Mn,Vn)=>xa(Mn,Wn=>ql(Wn)==="li"&&kx(Wn,Vn)).fold(xs([]),Wn=>pI(Mn).map(jn=>{const Gn=Cs.fromTag(ql(jn)),no=pr(Ym(jn),(ao,po)=>Dc(po,"list-style"));return ff(Gn,no),[Cs.fromTag("li"),Gn]}).getOr([])),bI=(Mn,Vn)=>{const Wn=ra(Vn,(jn,Gn)=>(Fu(Gn,jn),Gn),Mn);return Vn.length>0?zx([Wn]):Wn},WQ=Mn=>Lm(Mn)?Wc(Mn).filter(xh).fold(xs([]),Vn=>[Mn,Vn]):xh(Mn)?[Mn]:[],UQ=(Mn,Vn,Wn)=>{const jn=Cs.fromDom(Vn.commonAncestorContainer),Gn=py(jn,Mn),no=nr(Gn,vo=>Wn.isWrapper(ql(vo))),ao=gI(Gn,Vn),po=no.concat(ao.length?ao:WQ(jn));return Us(po,Hm)},vI=()=>zx([]),ZQ=(Mn,Vn,Wn)=>bI(Cs.fromDom(Vn.cloneContents()),UQ(Mn,Vn,Wn)),qQ=(Mn,Vn)=>lm(Vn,"table",ws(Vs,Mn)),yI=(Mn,Vn)=>qQ(Mn,Vn[0]).bind(Wn=>{const jn=Vn[0],Gn=Vn[Vn.length-1],no=zQ(Wn);return ED(no,jn,Gn).map(ao=>zx([uP(ao)]))}).getOrThunk(vI),jQ=(Mn,Vn,Wn)=>Vn.length>0&&Vn[0].collapsed?vI():ZQ(Mn,Vn[0],Wn),XQ=(Mn,Vn,Wn)=>{const jn=O3(Vn,Mn);return jn.length>0?yI(Mn,jn):jQ(Mn,Vn,Wn)},dP=(Mn,Vn)=>Vn>=0&&VnXo(Mn.innerText),AD=Mn=>Mn.map(Vn=>Vn.nodeName).getOr("div").toLowerCase(),PD=Mn=>zo.from(Mn.selection.getRng()).map(Vn=>{var Wn;const jn=zo.from(Mn.dom.getParent(Vn.commonAncestorContainer,Mn.dom.isBlock)),Gn=Mn.getBody(),no=AD(jn),ao=Cs.fromDom(Vn.cloneContents());Rl(ao),eR(ao);const po=Mn.dom.add(Gn,no,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},ao.dom),vo=TD(po),Ao=Xo((Wn=po.textContent)!==null&&Wn!==void 0?Wn:"");if(Mn.dom.remove(po),dP(Ao,0)||dP(Ao,Ao.length-1)){const Fo=jn.getOr(Gn),Qo=TD(Fo),qo=Qo.indexOf(vo);if(qo===-1)return vo;{const ds=dP(Qo,qo-1),bs=dP(Qo,qo+vo.length);return(ds?" ":"")+vo+(bs?" ":"")}}else return vo}).getOr(""),OI=(Mn,Vn)=>{const Wn=Mn.selection.getRng(),jn=Mn.dom.create("body"),Gn=Mn.selection.getSel(),no=J3(Mn,sk(Gn)),ao=Vn.contextual?XQ(Cs.fromDom(Mn.getBody()),no,Mn.schema).dom:Wn.cloneContents();return ao&&jn.appendChild(ao),Mn.selection.serializer.serialize(jn,Vn)},$D=(Mn,Vn)=>{if(Vn.format==="text")return PD(Mn);{const Wn=OI(Mn,Vn);return Vn.format==="tree"?Wn:Mn.selection.isCollapsed()?"":Wn}},_I=(Mn,Vn)=>({...Mn,format:Vn,get:!0,selection:!0,getInner:!0}),SI=(Mn,Vn,Wn={})=>{const jn=_I(Wn,Vn);return V_(Mn,jn).fold(Qr,Gn=>{const no=$D(Mn,Gn);return SD(Mn,no,Gn)})},CE=0,RD=1,DD=2,wI=(Mn,Vn)=>{const Wn=Mn.length+Vn.length+2,jn=new Array(Wn),Gn=new Array(Wn),no=(Fo,Qo,qo)=>({start:Fo,end:Qo,diag:qo}),ao=(Fo,Qo,qo,ds,bs)=>{const ls=vo(Fo,Qo,qo,ds);if(ls===null||ls.start===Qo&&ls.diag===Qo-ds||ls.end===Fo&&ls.diag===Fo-qo){let ys=Fo,Ls=qo;for(;ysds-qo?(bs.push([DD,Mn[ys]]),++ys):(bs.push([RD,Vn[Ls]]),++Ls)}else{ao(Fo,ls.start,qo,ls.start-ls.diag,bs);for(let ys=ls.start;ys{let bs=Fo;for(;bs-Qo{const bs=Qo-Fo,ls=ds-qo;if(bs===0||ls===0)return null;const ys=bs-ls,Ls=ls+bs,zs=(Ls%2===0?Ls:Ls+1)/2;jn[1+zs]=Fo,Gn[1+zs]=Qo+1;let Hs,tr,Pr,Ur,fa;for(Hs=0;Hs<=zs;++Hs){for(tr=-Hs;tr<=Hs;tr+=2){for(Pr=tr+zs,tr===-Hs||tr!==Hs&&jn[Pr-1]=Fo&&fa>=qo&&Mn[Ur]===Vn[fa];)Gn[Pr]=Ur--,fa--;if(ys%2===0&&-Hs<=tr&&tr<=Hs&&Gn[Pr]<=jn[Pr+ys])return po(Gn[Pr],tr+Fo-qo,Qo,ds)}}return null},Ao=[];return ao(0,Mn.length,0,Vn.length,Ao),Ao},CI=Mn=>Oa(Mn)?Mn.outerHTML:Ir(Mn)?P0.encodeRaw(Mn.data,!1):Dg(Mn)?"":"",MD=Mn=>{let Vn;const Wn=document.createElement("div"),jn=document.createDocumentFragment();for(Mn&&(Wn.innerHTML=Mn);Vn=Wn.firstChild;)jn.appendChild(Vn);return jn},YQ=(Mn,Vn,Wn)=>{const jn=MD(Vn);if(Mn.hasChildNodes()&&Wn{if(Mn.hasChildNodes()&&Vn{let Wn=0;fs(Mn,jn=>{jn[0]===CE?Wn++:jn[0]===RD?(YQ(Vn,jn[1],Wn),Wn++):jn[0]===DD&&fP(Vn,Wn)})},KQ=(Mn,Vn)=>nr(Us(kc(Mn.childNodes),ko(Xo,CI)),Wn=>Wn.length>0),JQ=(Mn,Vn)=>{const Wn=Us(kc(Vn.childNodes),CI);return GQ(wI(Wn,Mn),Vn),Vn},kI=br(()=>document.implementation.createHTMLDocument("undo")),xI=Mn=>Mn.querySelector("iframe")!==null,eV=Mn=>({type:"fragmented",fragments:Mn,content:"",bookmark:null,beforeBookmark:null}),tV=Mn=>({type:"complete",fragments:null,content:Mn,bookmark:null,beforeBookmark:null}),hP=Mn=>{const Vn=Mn.serializer.getTempAttrs(),Wn=s5(Mn.getBody(),Vn);return xI(Wn)?eV(KQ(Wn)):tV(Xo(Wn.innerHTML))},ND=(Mn,Vn,Wn)=>{const jn=Wn?Vn.beforeBookmark:Vn.bookmark;Vn.type==="fragmented"?JQ(Vn.fragments,Mn.getBody()):Mn.setContent(Vn.content,{format:"raw",no_selection:is(jn)&&IT(jn)?!jn.isFakeCaret:!0}),jn&&(Mn.selection.moveToBookmark(jn),Mn.selection.scrollIntoView())},LD=Mn=>Mn.type==="fragmented"?Mn.fragments.join(""):Mn.content,ID=Mn=>{const Vn=Cs.fromTag("body",kI());return dm(Vn,LD(Mn)),fs(mf(Vn,"*[data-mce-bogus]"),hf),ss(Vn)},qY=(Mn,Vn)=>LD(Mn)===LD(Vn),nV=(Mn,Vn)=>ID(Mn)===ID(Vn),BD=(Mn,Vn)=>!Mn||!Vn?!1:qY(Mn,Vn)?!0:nV(Mn,Vn),FD=Mn=>Mn.get()===0,mP=(Mn,Vn,Wn)=>{FD(Wn)&&(Mn.typing=Vn)},EI=(Mn,Vn)=>{Mn.typing&&(mP(Mn,!1,Vn),Mn.add())},oV=Mn=>{Mn.typing&&(Mn.typing=!1,Mn.add())},sV=(Mn,Vn,Wn)=>{FD(Vn)&&Wn.set(ib(Mn.selection))},TI=(Mn,Vn,Wn,jn,Gn,no,ao)=>{const po=hP(Mn),vo=Lr.extend(no||{},po);if(!FD(jn)||Mn.removed)return null;const Ao=Vn.data[Wn.get()];if(Mn.dispatch("BeforeAddUndo",{level:vo,lastLevel:Ao,originalEvent:ao}).isDefaultPrevented()||Ao&&BD(Ao,vo))return null;Vn.data[Wn.get()]&&Gn.get().each(qo=>{Vn.data[Wn.get()].beforeBookmark=qo});const Fo=ny(Mn);if(Fo&&Vn.data.length>Fo){for(let qo=0;qo0?(Mn.setDirty(!0),Mn.dispatch("AddUndo",Qo),Mn.dispatch("change",Qo)):Mn.dispatch("AddUndo",Qo),vo},rV=(Mn,Vn,Wn)=>{Vn.data=[],Wn.set(0),Vn.typing=!1,Mn.dispatch("ClearUndos")},iV=(Mn,Vn,Wn,jn,Gn)=>{if(Vn.transact(jn)){const no=Vn.data[Wn.get()].bookmark,ao=Vn.data[Wn.get()-1];ND(Mn,ao,!0),Vn.transact(Gn)&&(Vn.data[Wn.get()-1].beforeBookmark=no)}},aV=(Mn,Vn,Wn)=>{let jn;return Vn.get(){let Gn;return Vn.typing&&(Vn.add(),Vn.typing=!1,mP(Vn,!1,Wn)),jn.get()>0&&(jn.set(jn.get()-1),Gn=Vn.data[jn.get()],ND(Mn,Gn,!0),Mn.setDirty(!0),Mn.dispatch("Undo",{level:Gn})),Gn},cV=Mn=>{Mn.clear(),Mn.add()},jY=(Mn,Vn,Wn)=>Wn.get()>0||Vn.typing&&Vn.data[0]&&!BD(hP(Mn),Vn.data[0]),XY=(Mn,Vn)=>Vn.get()(EI(Mn,Vn),Mn.beforeChange(),Mn.ignore(Wn),Mn.add()),dV=(Mn,Vn)=>{try{Mn.set(Mn.get()+1),Vn()}finally{Mn.set(Mn.get()-1)}},YY=(Mn,Vn)=>{const Wn=Mn.dom,jn=is(Vn)?Vn:Mn.getBody();fs(Wn.select("table,a",jn),Gn=>{switch(Gn.nodeName){case"TABLE":const no=ox(Mn),ao=Wn.getAttrib(Gn,"border");(!ao||ao==="0")&&Mn.hasVisual?Wn.addClass(Gn,no):Wn.removeClass(Gn,no);break;case"A":if(!Wn.getAttrib(Gn,"href")){const po=Wn.getAttrib(Gn,"name")||Gn.id,vo=FC(Mn);po&&Mn.hasVisual?Wn.addClass(Gn,vo):Wn.removeClass(Gn,vo)}break}}),Mn.dispatch("VisualAid",{element:Vn,hasVisual:Mn.hasVisual})},AI=Mn=>({init:{bindEvents:Js},undoManager:{beforeChange:(Vn,Wn)=>sV(Mn,Vn,Wn),add:(Vn,Wn,jn,Gn,no,ao)=>TI(Mn,Vn,Wn,jn,Gn,no,ao),undo:(Vn,Wn,jn)=>lV(Mn,Vn,Wn,jn),redo:(Vn,Wn)=>aV(Mn,Vn,Wn),clear:(Vn,Wn)=>rV(Mn,Vn,Wn),reset:Vn=>cV(Vn),hasUndo:(Vn,Wn)=>jY(Mn,Vn,Wn),hasRedo:(Vn,Wn)=>XY(Vn,Wn),transact:(Vn,Wn,jn)=>uV(Vn,Wn,jn),ignore:(Vn,Wn)=>dV(Vn,Wn),extra:(Vn,Wn,jn,Gn)=>iV(Mn,Vn,Wn,jn,Gn)},formatter:{match:(Vn,Wn,jn,Gn)=>VA(Mn,Vn,Wn,jn,Gn),matchAll:(Vn,Wn)=>G9(Mn,Vn,Wn),matchNode:(Vn,Wn,jn,Gn)=>by(Mn,Vn,Wn,jn,Gn),canApply:Vn=>cL(Mn,Vn),closest:Vn=>Lw(Mn,Vn),apply:(Vn,Wn,jn)=>RL(Mn,Vn,Wn,jn),remove:(Vn,Wn,jn,Gn)=>TL(Mn,Vn,Wn,jn,Gn),toggle:(Vn,Wn,jn)=>gQ(Mn,Vn,Wn,jn),formatChanged:(Vn,Wn,jn,Gn,no)=>pQ(Mn,Vn,Wn,jn,Gn,no)},editor:{getContent:Vn=>FY(Mn,Vn),setContent:(Vn,Wn)=>iL(Mn,Vn,Wn),insertContent:(Vn,Wn)=>rL(Mn,Vn,Wn),addVisual:Vn=>YY(Mn,Vn)},selection:{getContent:(Vn,Wn)=>SI(Mn,Vn,Wn)},autocompleter:{addDecoration:Vn=>FH(Mn,Vn),removeDecoration:()=>QH(Mn,Cs.fromDom(Mn.getBody()))},raw:{getModel:()=>zo.none()}}),Gd=Mn=>{const Vn=Ao=>Io(Ao)?Ao:{},{init:Wn,undoManager:jn,formatter:Gn,editor:no,selection:ao,autocompleter:po,raw:vo}=Mn;return{init:{bindEvents:Wn.bindEvents},undoManager:{beforeChange:jn.beforeChange,add:jn.add,undo:jn.undo,redo:jn.redo,clear:jn.clear,reset:jn.reset,hasUndo:jn.hasUndo,hasRedo:jn.hasRedo,transact:(Ao,Fo,Qo)=>jn.transact(Qo),ignore:(Ao,Fo)=>jn.ignore(Fo),extra:(Ao,Fo,Qo,qo)=>jn.extra(Qo,qo)},formatter:{match:(Ao,Fo,Qo,qo)=>Gn.match(Ao,Vn(Fo),qo),matchAll:Gn.matchAll,matchNode:Gn.matchNode,canApply:Ao=>Gn.canApply(Ao),closest:Ao=>Gn.closest(Ao),apply:(Ao,Fo,Qo)=>Gn.apply(Ao,Vn(Fo)),remove:(Ao,Fo,Qo,qo)=>Gn.remove(Ao,Vn(Fo)),toggle:(Ao,Fo,Qo)=>Gn.toggle(Ao,Vn(Fo)),formatChanged:(Ao,Fo,Qo,qo,ds)=>Gn.formatChanged(Fo,Qo,qo,ds)},editor:{getContent:Ao=>no.getContent(Ao),setContent:(Ao,Fo)=>({content:no.setContent(Ao,Fo),html:""}),insertContent:(Ao,Fo)=>(no.insertContent(Ao),""),addVisual:no.addVisual},selection:{getContent:(Ao,Fo)=>ao.getContent(Fo)},autocompleter:{addDecoration:po.addDecoration,removeDecoration:po.removeDecoration},raw:{getModel:()=>zo.some(vo.getRawModel())}}},HD=()=>{const Mn=xs(null),Vn=xs("");return{init:{bindEvents:Js},undoManager:{beforeChange:Js,add:Mn,undo:Mn,redo:Mn,clear:Js,reset:Js,hasUndo:hs,hasRedo:hs,transact:Mn,ignore:Js,extra:Js},formatter:{match:hs,matchAll:xs([]),matchNode:xs(void 0),canApply:hs,closest:Vn,apply:Js,remove:Js,toggle:Js,formatChanged:xs({unbind:Js})},editor:{getContent:Vn,setContent:xs({content:"",html:""}),insertContent:xs(""),addVisual:Js},selection:{getContent:Vn},autocompleter:{addDecoration:Js,removeDecoration:Js},raw:{getModel:xs(zo.none())}}},wO=Mn=>Mr(Mn.plugins,"rtc"),fV=Mn=>Ma(Mn.plugins,"rtc").bind(Vn=>zo.from(Vn.setup)),hV=Mn=>{const Vn=Mn;return fV(Mn).fold(()=>(Vn.rtcInstance=AI(Mn),zo.none()),Wn=>(Vn.rtcInstance=HD(),zo.some(()=>Wn().then(jn=>(Vn.rtcInstance=Gd(jn),jn.rtc.isRemote)))))},z_=Mn=>Mn.rtcInstance?Mn.rtcInstance:AI(Mn),oh=Mn=>{const Vn=Mn.rtcInstance;if(Vn)return Vn;throw new Error("Failed to get RTC instance not yet initialized.")},GY=(Mn,Vn,Wn)=>{oh(Mn).undoManager.beforeChange(Vn,Wn)},Cm=(Mn,Vn,Wn,jn,Gn,no,ao)=>oh(Mn).undoManager.add(Vn,Wn,jn,Gn,no,ao),PI=(Mn,Vn,Wn,jn)=>oh(Mn).undoManager.undo(Vn,Wn,jn),$I=(Mn,Vn,Wn)=>oh(Mn).undoManager.redo(Vn,Wn),RI=(Mn,Vn,Wn)=>{oh(Mn).undoManager.clear(Vn,Wn)},mV=(Mn,Vn)=>{oh(Mn).undoManager.reset(Vn)},pV=(Mn,Vn,Wn)=>oh(Mn).undoManager.hasUndo(Vn,Wn),pP=(Mn,Vn,Wn)=>oh(Mn).undoManager.hasRedo(Vn,Wn),gV=(Mn,Vn,Wn,jn)=>oh(Mn).undoManager.transact(Vn,Wn,jn),QD=(Mn,Vn,Wn)=>{oh(Mn).undoManager.ignore(Vn,Wn)},bV=(Mn,Vn,Wn,jn,Gn)=>{oh(Mn).undoManager.extra(Vn,Wn,jn,Gn)},DI=(Mn,Vn,Wn,jn,Gn)=>oh(Mn).formatter.match(Vn,Wn,jn,Gn),MI=(Mn,Vn,Wn)=>oh(Mn).formatter.matchAll(Vn,Wn),VD=(Mn,Vn,Wn,jn,Gn)=>oh(Mn).formatter.matchNode(Vn,Wn,jn,Gn),NI=(Mn,Vn)=>oh(Mn).formatter.canApply(Vn),zD=(Mn,Vn)=>oh(Mn).formatter.closest(Vn),vV=(Mn,Vn,Wn,jn)=>{oh(Mn).formatter.apply(Vn,Wn,jn)},yV=(Mn,Vn,Wn,jn,Gn)=>{oh(Mn).formatter.remove(Vn,Wn,jn,Gn)},OV=(Mn,Vn,Wn,jn)=>{oh(Mn).formatter.toggle(Vn,Wn,jn)},vb=(Mn,Vn,Wn,jn,Gn,no)=>oh(Mn).formatter.formatChanged(Vn,Wn,jn,Gn,no),_V=(Mn,Vn)=>z_(Mn).editor.getContent(Vn),SV=(Mn,Vn,Wn)=>z_(Mn).editor.setContent(Vn,Wn),wV=(Mn,Vn,Wn)=>z_(Mn).editor.insertContent(Vn,Wn),CV=(Mn,Vn,Wn)=>oh(Mn).selection.getContent(Vn,Wn),kV=(Mn,Vn)=>oh(Mn).editor.addVisual(Vn),WD=Mn=>oh(Mn).init.bindEvents(),xV=(Mn,Vn)=>oh(Mn).autocompleter.addDecoration(Vn),EV=Mn=>oh(Mn).autocompleter.removeDecoration(),TV=(Mn,Vn={})=>{const Wn=Vn.format?Vn.format:"html";return CV(Mn,Wn,Vn)},kE=Mn=>Mn.dom.length===0?(sc(Mn),zo.none()):zo.some(Mn),AV=(Mn,Vn)=>Mn.filter(Wn=>fO.isBookmarkNode(Wn.dom)).bind(Vn?Wh:_d),PV=(Mn,Vn,Wn,jn,Gn)=>{const no=Mn.dom,ao=Vn.dom,po=jn?no.length:ao.length;jn?(yh(no,ao,Gn,!1,!jn),Wn.setStart(ao,po)):(yh(ao,no,Gn,!1,!jn),Wn.setEnd(ao,po))},LI=(Mn,Vn,Wn)=>{Wc(Mn).each(jn=>{const Gn=Mn.dom;Vn&&Ck(jn,lr(Gn,0),Wn)?$w(Gn,0,Wn):!Vn&&kk(jn,lr(Gn,Gn.length),Wn)&&E5(Gn,Gn.length,Wn)})},gP=(Mn,Vn,Wn,jn,Gn)=>{Mn.bind(no=>((jn?E5:$w)(no.dom,jn?no.dom.length:0,Gn),Vn.filter(qd).map(po=>PV(no,po,Wn,jn,Gn)))).orThunk(()=>AV(Vn,jn).or(Vn).filter(qd).map(ao=>LI(ao,jn,Gn)))},$V=(Mn,Vn,Wn)=>{const jn=zo.from(Vn.firstChild).map(Cs.fromDom),Gn=zo.from(Vn.lastChild).map(Cs.fromDom);Mn.deleteContents(),Mn.insertNode(Vn);const no=jn.bind(_d).filter(qd).bind(kE),ao=Gn.bind(Wh).filter(qd).bind(kE);gP(no,jn,Mn,!0,Wn),gP(ao,Gn,Mn,!1,Wn),Mn.collapse(!1)},RV=(Mn,Vn)=>({format:"html",...Mn,set:!0,selection:!0,content:Vn}),KY=(Mn,Vn)=>{if(Vn.format!=="raw"){const Wn=Mn.selection.getRng(),jn=Mn.dom.getParent(Wn.commonAncestorContainer,Mn.dom.isBlock),Gn=jn?{context:jn.nodeName.toLowerCase()}:{},no=Mn.parser.parse(Vn.content,{forced_root_block:!1,...Gn,...Vn});return I_({validate:!1},Mn.schema).serialize(no)}else return Vn.content},DV=(Mn,Vn,Wn={})=>{const jn=RV(Wn,Vn);wD(Mn,jn).each(Gn=>{const no=KY(Mn,Gn),ao=Mn.selection.getRng();$V(ao,ao.createContextualFragment(no),Mn.schema),Mn.selection.setRng(ao),Ew(Mn,ao),iP(Mn,no,Gn)})},II=(Mn,Vn,Wn)=>{if(Mr(Mn,Vn)){const jn=nr(Mn[Vn],Gn=>Gn!==Wn);jn.length===0?delete Mn[Vn]:Mn[Vn]=jn}};var BI=(Mn,Vn)=>{let Wn,jn;const Gn=(po,vo)=>xa(vo,Ao=>Mn.is(Ao,po)),no=po=>Mn.getParents(po,void 0,Mn.getRoot()),ao=()=>{Wn={},jn={},Vn.on("NodeChange",po=>{const vo=po.element,Ao=no(vo),Fo={};Rr(Wn,(Qo,qo)=>{Gn(qo,Ao).each(ds=>{jn[qo]||(fs(Qo,bs=>{bs(!0,{node:ds,selector:qo,parents:Ao})}),jn[qo]=Qo),Fo[qo]=Qo})}),Rr(jn,(Qo,qo)=>{Fo[qo]||(delete jn[qo],fs(Qo,ds=>{ds(!1,{node:vo,selector:qo,parents:Ao})}))})})};return{selectorChangedWithUnbind:(po,vo)=>(Wn||ao(),Wn[po]||(Wn[po]=[]),Wn[po].push(vo),Gn(po,no(Vn.selection.getStart())).each(()=>{jn[po]=Wn[po]}),{unbind:()=>{II(Wn,po,vo),II(jn,po,vo)}})}};const UD=Mn=>!!(Mn&&Mn.ownerDocument)&&Dr(Cs.fromDom(Mn.ownerDocument),Cs.fromDom(Mn)),MV=Mn=>Mn?UD(Mn.startContainer)&&UD(Mn.endContainer):!1,W_=(Mn,Vn,Wn,jn)=>{let Gn,no;const{selectorChangedWithUnbind:ao}=BI(Mn,jn),po=(ea,pa)=>{const $c=Mn.createRng();is(ea)&&is(pa)?($c.setStart(ea,pa),$c.setEnd(ea,pa),tr($c),Ls(!1)):(xx(Mn,$c,jn.getBody(),!0),tr($c))},vo=ea=>TV(jn,ea),Ao=(ea,pa)=>DV(jn,ea,pa),Fo=ea=>G3(jn.getBody(),Hs(),ea),Qo=ea=>jN(jn.getBody(),Hs(),ea),qo=(ea,pa)=>Jh.getBookmark(ea,pa),ds=ea=>Jh.moveToBookmark(ea),bs=(ea,pa)=>($H(Mn,ea,pa).each(tr),ea),ls=()=>{const ea=Hs(),pa=zs();return!ea||ea.item?!1:ea.compareEndPoints?ea.compareEndPoints("StartToEnd",ea)===0:!pa||ea.collapsed},ys=()=>{const ea=Hs(),pa=jn.getBody().querySelectorAll('[data-mce-selected="1"]');return pa.length>0?gc(pa,$c=>Mn.isEditable($c.parentElement)):ZN(Mn,ea)},Ls=ea=>{const pa=Hs();pa.collapse(!!ea),tr(pa)},zs=()=>Vn.getSelection?Vn.getSelection():Vn.document.selection,Hs=()=>{let ea;const pa=(ac,Pa,ml)=>{try{return Pa.compareBoundaryPoints(ac,ml)}catch{return-1}},$c=Vn.document;if(is(jn.bookmark)&&!L_(jn)){const ac=q3(jn);if(ac.isSome())return ac.map(Pa=>J3(jn,[Pa])[0]).getOr($c.createRange())}try{const ac=zs();ac&&!Xp(ac.anchorNode)&&(ac.rangeCount>0?ea=ac.getRangeAt(0):ea=$c.createRange(),ea=J3(jn,[ea])[0])}catch{}if(ea||(ea=$c.createRange()),Nm(ea.startContainer)&&ea.collapsed){const ac=Mn.getRoot();ea.setStart(ac,0),ea.setEnd(ac,0)}return Gn&&no&&(pa(ea.START_TO_START,ea,Gn)===0&&pa(ea.END_TO_END,ea,Gn)===0?ea=no:(Gn=null,no=null)),ea},tr=(ea,pa)=>{if(!MV(ea))return;const $c=zs();if(ea=jn.dispatch("SetSelectionRange",{range:ea,forward:pa}).range,$c){no=ea;try{$c.removeAllRanges(),$c.addRange(ea)}catch{}pa===!1&&$c.extend&&($c.collapse(ea.endContainer,ea.endOffset),$c.extend(ea.startContainer,ea.startOffset)),Gn=$c.rangeCount>0?$c.getRangeAt(0):null}if(!ea.collapsed&&ea.startContainer===ea.endContainer&&($c!=null&&$c.setBaseAndExtent)&&ea.endOffset-ea.startOffset<2&&ea.startContainer.hasChildNodes()){const Pa=ea.startContainer.childNodes[ea.startOffset];Pa&&Pa.nodeName==="IMG"&&($c.setBaseAndExtent(ea.startContainer,ea.startOffset,ea.endContainer,ea.endOffset),($c.anchorNode!==ea.startContainer||$c.focusNode!==ea.endContainer)&&$c.setBaseAndExtent(Pa,0,Pa,1))}jn.dispatch("AfterSetSelectionRange",{range:ea,forward:pa})},Pr=ea=>(Ao(Mn.getOuterHTML(ea)),ea),Ur=()=>XN(jn.getBody(),Hs()),fa=(ea,pa)=>PH(Mn,Hs(),ea,pa),yr=()=>{const ea=zs(),pa=ea==null?void 0:ea.anchorNode,$c=ea==null?void 0:ea.focusNode;if(!ea||!pa||!$c||Xp(pa)||Xp($c))return!0;const ac=Mn.createRng(),Pa=Mn.createRng();try{ac.setStart(pa,ea.anchorOffset),ac.collapse(!0),Pa.setStart($c,ea.focusOffset),Pa.collapse(!0)}catch{return!0}return ac.compareBoundaryPoints(ac.START_TO_START,Pa)<=0},Wd={dom:Mn,win:Vn,serializer:Wn,editor:jn,expand:(ea={type:"word"})=>tr(ns(Mn).expand(Hs(),ea)),collapse:Ls,setCursorLocation:po,getContent:vo,setContent:Ao,getBookmark:qo,moveToBookmark:ds,select:bs,isCollapsed:ls,isEditable:ys,isForward:yr,setNode:Pr,getNode:Ur,getSel:zs,setRng:tr,getRng:Hs,getStart:Fo,getEnd:Qo,getSelectedBlocks:fa,normalize:()=>{const ea=Hs(),pa=zs();if(!dO(pa)&&ik(jn)){const $c=To(Mn,ea);return $c.each(ac=>{tr(ac,yr())}),$c.getOr(ea)}return ea},selectorChanged:(ea,pa)=>(ao(ea,pa),Wd),selectorChangedWithUnbind:ao,getScrollContainer:()=>{let ea,pa=Mn.getRoot();for(;pa&&pa.nodeName!=="BODY";){if(pa.scrollHeight>pa.clientHeight){ea=pa;break}pa=pa.parentNode}return ea},scrollIntoView:(ea,pa)=>{is(ea)?Gh(jn,ea,pa):Ew(jn,Hs(),pa)},placeCaretAt:(ea,pa)=>tr(pg(ea,pa,jn.getDoc())),getBoundingClientRect:()=>{const ea=Hs();return ea.collapsed?lr.fromRangeStart(ea).getClientRects()[0]:ea.getBoundingClientRect()},destroy:()=>{Vn=Gn=no=null,_u.destroy()}},Jh=fO(Wd),_u=MN(Wd,jn);return Wd.bookmarkManager=Jh,Wd.controlSelection=_u,Wd},Wk=(Mn,Vn,Wn)=>{Mn.addAttributeFilter("data-mce-tabindex",(jn,Gn)=>{let no=jn.length;for(;no--;){const ao=jn[no];ao.attr("tabindex",ao.attr("data-mce-tabindex")),ao.attr(Gn,null)}}),Mn.addAttributeFilter("src,href,style",(jn,Gn)=>{const no="data-mce-"+Gn,ao=Vn.url_converter,po=Vn.url_converter_scope;let vo=jn.length;for(;vo--;){const Ao=jn[vo];let Fo=Ao.attr(no);Fo!==void 0?(Ao.attr(Gn,Fo.length>0?Fo:null),Ao.attr(no,null)):(Fo=Ao.attr(Gn),Gn==="style"?Fo=Wn.serializeStyle(Wn.parseStyle(Fo),Ao.name):ao&&(Fo=ao.call(po,Fo,Gn,Ao.name)),Ao.attr(Gn,Fo.length>0?Fo:null))}}),Mn.addAttributeFilter("class",jn=>{let Gn=jn.length;for(;Gn--;){const no=jn[Gn];let ao=no.attr("class");ao&&(ao=ao.replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),no.attr("class",ao.length>0?ao:null))}}),Mn.addAttributeFilter("data-mce-type",(jn,Gn,no)=>{let ao=jn.length;for(;ao--;){const po=jn[ao];po.attr("data-mce-type")==="bookmark"&&!no.cleanup&&(zo.from(po.firstChild).exists(Ao=>{var Fo;return!Po((Fo=Ao.value)!==null&&Fo!==void 0?Fo:"")})?po.unwrap():po.remove())}}),Mn.addNodeFilter("script,style",(jn,Gn)=>{var no;const ao=vo=>vo.replace(/()/g,` +`).replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"");let po=jn.length;for(;po--;){const vo=jn[po],Ao=vo.firstChild,Fo=(no=Ao==null?void 0:Ao.value)!==null&&no!==void 0?no:"";if(Gn==="script"){const Qo=vo.attr("type");Qo&&vo.attr("type",Qo==="mce-no/type"?null:Qo.replace(/^mce\-/,"")),Vn.element_format==="xhtml"&&Ao&&Fo.length>0&&(Ao.value=`// `)}else Vn.element_format==="xhtml"&&Ao&&Fo.length>0&&(Ao.value=``)}}),Mn.addNodeFilter("#comment",jn=>{let Gn=jn.length;for(;Gn--;){const no=jn[Gn],ao=no.value;Vn.preserve_cdata&&(ao==null?void 0:ao.indexOf("[CDATA["))===0?(no.name="#cdata",no.type=4,no.value=Wn.decode(ao.replace(/^\[CDATA\[|\]\]$/g,""))):(ao==null?void 0:ao.indexOf("mce:protected "))===0&&(no.name="#text",no.type=3,no.raw=!0,no.value=unescape(ao).substr(14))}}),Mn.addNodeFilter("xml:namespace,input",(jn,Gn)=>{let no=jn.length;for(;no--;){const ao=jn[no];ao.type===7?ao.remove():ao.type===1&&Gn==="input"&&!ao.attr("type")&&ao.attr("type","text")}}),Mn.addAttributeFilter("data-mce-type",jn=>{fs(jn,Gn=>{Gn.attr("data-mce-type")==="format-caret"&&(Gn.isEmpty(Mn.schema.getNonEmptyElements())?Gn.remove():Gn.unwrap())})}),Mn.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-block,data-mce-type,data-mce-resize,data-mce-placeholder",(jn,Gn)=>{let no=jn.length;for(;no--;)jn[no].attr(Gn,null)}),Vn.remove_trailing_brs&&lD(Vn,Mn,Mn.schema)},xE=Mn=>{const Vn=jn=>(jn==null?void 0:jn.name)==="br",Wn=Mn.lastChild;if(Vn(Wn)){const jn=Wn.prev;Vn(jn)&&(Wn.remove(),jn.remove())}},FI=(Mn,Vn,Wn)=>{let jn;const Gn=Mn.dom;let no=Vn.cloneNode(!0);const ao=document.implementation;if(ao.createHTMLDocument){const po=ao.createHTMLDocument("");Lr.each(no.nodeName==="BODY"?no.childNodes:[no],vo=>{po.body.appendChild(po.importNode(vo,!0))}),no.nodeName!=="BODY"?no=po.body.firstChild:no=po.body,jn=Gn.doc,Gn.doc=po}return Nx(Mn,{...Wn,node:no}),jn&&(Gn.doc=jn),no},HI=(Mn,Vn)=>is(Mn)&&Mn.hasEventListeners("PreProcess")&&!Vn.no_events,NV=(Mn,Vn,Wn)=>HI(Mn,Wn)?FI(Mn,Vn,Wn):Vn,QI=(Mn,Vn,Wn)=>{Lr.inArray(Vn,Wn)===-1&&(Mn.addAttributeFilter(Wn,(jn,Gn)=>{let no=jn.length;for(;no--;)jn[no].attr(Gn,null)}),Vn.push(Wn))},LV=(Mn,Vn,Wn)=>!Vn.no_events&&Mn?E3(Mn,{...Vn,content:Wn}).content:Wn,IV=(Mn,Vn,Wn)=>{const jn=Xo(Wn.getInner?Vn.innerHTML:Mn.getOuterHTML(Vn));return Wn.selection||Xd(Cs.fromDom(Vn))?jn:Lr.trim(jn)},BV=(Mn,Vn,Wn)=>{const jn=Wn.selection?{forced_root_block:!1,...Wn}:Wn,Gn=Mn.parse(Vn,jn);return xE(Gn),Gn},FV=(Mn,Vn,Wn)=>I_(Mn,Vn).serialize(Wn),VI=(Mn,Vn,Wn,jn,Gn)=>{const no=FV(Vn,Wn,jn);return LV(Mn,Gn,no)},HV=(Mn,Vn)=>{const Wn=["data-mce-selected"],jn={entity_encoding:"named",remove_trailing_brs:!0,pad_empty_with_br:!1,...Mn},Gn=Vn&&Vn.dom?Vn.dom:Eu.DOM,no=Vn&&Vn.schema?Vn.schema:i1(jn),ao=a0(jn,no);Wk(ao,jn,Gn);const po=(vo,Ao={})=>{const Fo={format:"html",...Ao},Qo=NV(Vn,vo,Fo),qo=IV(Gn,Qo,Fo),ds=BV(ao,qo,Fo);return Fo.format==="tree"?ds:VI(Vn,jn,no,ds,Fo)};return{schema:no,addNodeFilter:ao.addNodeFilter,addAttributeFilter:ao.addAttributeFilter,serialize:po,addRules:no.addValidElements,setRules:no.setValidElements,addTempAttr:ws(QI,ao,Wn),getTempAttrs:xs(Wn),getNodeFilters:ao.getNodeFilters,getAttributeFilters:ao.getAttributeFilters,removeNodeFilter:ao.removeNodeFilter,removeAttributeFilter:ao.removeAttributeFilter}},zI=(Mn,Vn)=>{const Wn=HV(Mn,Vn);return{schema:Wn.schema,addNodeFilter:Wn.addNodeFilter,addAttributeFilter:Wn.addAttributeFilter,serialize:Wn.serialize,addRules:Wn.addRules,setRules:Wn.setRules,addTempAttr:Wn.addTempAttr,getTempAttrs:Wn.getTempAttrs,getNodeFilters:Wn.getNodeFilters,getAttributeFilters:Wn.getAttributeFilters,removeNodeFilter:Wn.removeNodeFilter,removeAttributeFilter:Wn.removeAttributeFilter}},EE="html",WI=(Mn,Vn)=>({...Mn,format:Vn,get:!0,getInner:!0}),UI=(Mn,Vn={})=>{const Wn=Vn.format?Vn.format:EE,jn=WI(Vn,Wn);return V_(Mn,jn).fold(Qr,Gn=>{const no=_V(Mn,Gn);return SD(Mn,no,Gn)})},QV="html",VV=(Mn,Vn)=>({format:QV,...Mn,set:!0,content:Vn}),ZD=(Mn,Vn,Wn={})=>{const jn=VV(Wn,Vn);return wD(Mn,jn).map(Gn=>{const no=SV(Mn,Gn.content,Gn);return iP(Mn,no.html,Gn),no.content}).getOr(Vn)},ZI="autoresize_on_init,content_editable_state,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,tabfocus_elements,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_enable_default_filters,paste_filter_drop,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),zV="template_cdate_classes,template_mdate_classes,template_selected_content_classes,template_preview_replace_values,template_replace_values,templates,template_cdate_format,template_mdate_format".split(","),WV="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),qI=[{name:"template",replacedWith:"Advanced Template"},{name:"rtc"}],jI=(Mn,Vn)=>{const Wn=nr(Vn,jn=>Mr(Mn,jn));return Vl(Wn)},JY=Mn=>{const Vn=jI(Mn,ZI),Wn=Mn.forced_root_block;return(Wn===!1||Wn==="")&&Vn.push("forced_root_block (false only)"),Vl(Vn)},rv=Mn=>jI(Mn,zV),bP=(Mn,Vn)=>{const Wn=Lr.makeMap(Mn.plugins," "),Gn=nr(Vn,no=>Mr(Wn,no));return Vl(Gn)},UV=Mn=>bP(Mn,WV),ZV=Mn=>bP(Mn,qI.map(Vn=>Vn.name)),qV=(Mn,Vn)=>{const Wn=JY(Mn),jn=UV(Vn),Gn=jn.length>0,no=Wn.length>0,ao=Vn.theme==="mobile";if(Gn||no||ao){const po=` +- `,vo=ao?` + +Themes:${po}mobile`:"",Ao=Gn?` + +Plugins:${po}${jn.join(po)}`:"",Fo=no?` + +Options:${po}${Wn.join(po)}`:"";console.warn("The following deprecated features are currently enabled and have been removed in TinyMCE 6.0. These features will no longer work and should be removed from the TinyMCE configuration. See https://www.tiny.cloud/docs/tinymce/6/migration-from-5x/ for more information."+vo+Ao+Fo)}},jV=Mn=>xa(qI,Vn=>Vn.name===Mn).fold(()=>Mn,Vn=>Vn.replacedWith?`${Mn}, replaced by ${Vn.replacedWith}`:Mn),su=(Mn,Vn)=>{const Wn=rv(Mn),jn=ZV(Vn),Gn=jn.length>0,no=Wn.length>0;if(Gn||no){const ao=` +- `,po=Gn?` + +Plugins:${ao}${jn.map(jV).join(ao)}`:"",vo=no?` + +Options:${ao}${Wn.join(ao)}`:"";console.warn("The following deprecated features are currently enabled but will be removed soon."+po+vo)}},eG=(Mn,Vn)=>{qV(Mn,Vn),su(Mn,Vn)},vP=Eu.DOM,XV=Mn=>{vP.setStyle(Mn.id,"display",Mn.orgDisplay)},sd=Mn=>zo.from(Mn).each(Vn=>Vn.destroy()),YV=Mn=>{const Vn=Mn;Vn.contentAreaContainer=Vn.formElement=Vn.container=Vn.editorContainer=null,Vn.bodyElement=Vn.contentDocument=Vn.contentWindow=null,Vn.iframeElement=Vn.targetElm=null;const Wn=Mn.selection;if(Wn){const jn=Wn.dom;Vn.selection=Wn.win=Wn.dom=jn.doc=null}},TE=Mn=>{const Vn=Mn.formElement;Vn&&(Vn._mceOldSubmit&&(Vn.submit=Vn._mceOldSubmit,delete Vn._mceOldSubmit),vP.unbind(Vn,"submit reset",Mn.formEventDelegate))},GV=Mn=>{if(!Mn.removed){const{_selectionOverrides:Vn,editorUpload:Wn}=Mn,jn=Mn.getBody(),Gn=Mn.getElement();jn&&Mn.save({is_removing:!0}),Mn.removed=!0,Mn.unbindAllNativeEvents(),Mn.hasHiddenInput&&is(Gn==null?void 0:Gn.nextSibling)&&vP.remove(Gn.nextSibling),P_(Mn),Mn.editorManager.remove(Mn),!Mn.inline&&jn&&XV(Mn),$_(Mn),vP.remove(Mn.getContainer()),sd(Vn),sd(Wn),Mn.destroy()}},KV=(Mn,Vn)=>{const{selection:Wn,dom:jn}=Mn;if(!Mn.destroyed){if(!Vn&&!Mn.removed){Mn.remove();return}Vn||(Mn.editorManager.off("beforeunload",Mn._beforeUnload),Mn.theme&&Mn.theme.destroy&&Mn.theme.destroy(),sd(Wn),sd(jn)),TE(Mn),YV(Mn),Mn.destroyed=!0}},AE=(()=>{const Mn={};return{add:(Gn,no)=>{Mn[Gn]=no},get:Gn=>Mn[Gn]?Mn[Gn]:{icons:{}},has:Gn=>Mr(Mn,Gn)}})(),yb=$h.ModelManager,vg=(Mn,Vn)=>Vn.dom[Mn],Uk=(Mn,Vn)=>parseInt(Ju(Vn,Mn),10),U_=ws(vg,"clientWidth"),Cy=ws(vg,"clientHeight"),PE=ws(Uk,"margin-top"),qD=ws(Uk,"margin-left"),jD=Mn=>Mn.dom.getBoundingClientRect(),XI=(Mn,Vn,Wn)=>{const jn=U_(Mn),Gn=Cy(Mn);return Vn>=0&&Wn>=0&&Vn<=jn&&Wn<=Gn},YI=(Mn,Vn,Wn,jn)=>{const Gn=jD(Vn),no=Mn?Gn.left+Vn.dom.clientLeft+qD(Vn):0,ao=Mn?Gn.top+Vn.dom.clientTop+PE(Vn):0,po=Wn-no,vo=jn-ao;return{x:po,y:vo}},JV=(Mn,Vn,Wn)=>{const jn=Cs.fromDom(Mn.getBody()),Gn=Mn.inline?jn:zl(jn),no=YI(Mn.inline,Gn,Vn,Wn);return XI(Gn,no.x,no.y)},ez=Mn=>zo.from(Mn).map(Cs.fromDom),GI=Mn=>{const Vn=Mn.inline?Mn.getBody():Mn.getContentAreaContainer();return ez(Vn).map(Ag).getOr(!1)};var KI=()=>{const Mn=()=>{throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:Mn,close:Mn,getArgs:Mn}};const XD=Mn=>{const Vn=[],Wn=()=>{const qo=Mn.theme;return qo&&qo.getNotificationManagerImpl?qo.getNotificationManagerImpl():KI()},jn=()=>zo.from(Vn[0]),Gn=(qo,ds)=>qo.type===ds.type&&qo.text===ds.text&&!qo.progressBar&&!qo.timeout&&!ds.progressBar&&!ds.timeout,no=()=>{fs(Vn,qo=>{qo.reposition()})},ao=qo=>{Vn.push(qo)},po=qo=>{Nl(Vn,ds=>ds===qo).each(ds=>{Vn.splice(ds,1)})},vo=(qo,ds=!0)=>Mn.removed||!GI(Mn)?{}:(ds&&Mn.dispatch("BeforeOpenNotification",{notification:qo}),xa(Vn,bs=>Gn(Wn().getArgs(bs),qo)).getOrThunk(()=>{Mn.editorManager.setActive(Mn);const bs=Wn().open(qo,()=>{po(bs),no(),UN(Mn)&&jn().fold(()=>Mn.focus(),ls=>lA(Cs.fromDom(ls.getEl())))});return ao(bs),no(),Mn.dispatch("OpenNotification",{notification:{...bs}}),bs})),Ao=()=>{jn().each(qo=>{Wn().close(qo),po(qo),no()})},Fo=xs(Vn);return(qo=>{qo.on("SkinLoaded",()=>{const ds=K2(qo);ds&&vo({text:ds,type:"warning",timeout:0},!1),no()}),qo.on("show ResizeEditor ResizeWindow NodeChange",()=>{requestAnimationFrame(no)}),qo.on("remove",()=>{fs(Vn.slice(),ds=>{Wn().close(ds)})})})(Mn),{open:vo,close:Ao,getNotifications:Fo}},Hw=$h.PluginManager,CO=$h.ThemeManager;var nG=()=>{const Mn=()=>{throw new Error("Theme did not provide a WindowManager implementation.")};return{open:Mn,openUrl:Mn,alert:Mn,confirm:Mn,close:Mn}};const JI=Mn=>{let Vn=[];const Wn=()=>{const ls=Mn.theme;return ls&&ls.getWindowManagerImpl?ls.getWindowManagerImpl():nG()},jn=(ls,ys)=>(...Ls)=>ys?ys.apply(ls,Ls):void 0,Gn=ls=>{Mn.dispatch("OpenWindow",{dialog:ls})},no=ls=>{Mn.dispatch("CloseWindow",{dialog:ls})},ao=ls=>{Vn.push(ls),Gn(ls)},po=ls=>{no(ls),Vn=nr(Vn,ys=>ys!==ls),Vn.length===0&&Mn.focus()},vo=()=>zo.from(Vn[Vn.length-1]),Ao=ls=>{Mn.editorManager.setActive(Mn),Sk(Mn),Mn.ui.show();const ys=ls();return ao(ys),ys},Fo=(ls,ys)=>Ao(()=>Wn().open(ls,ys,po)),Qo=ls=>Ao(()=>Wn().openUrl(ls,po)),qo=(ls,ys,Ls)=>{const zs=Wn();zs.alert(ls,jn(Ls||zs,ys))},ds=(ls,ys,Ls)=>{const zs=Wn();zs.confirm(ls,jn(Ls||zs,ys))},bs=()=>{vo().each(ls=>{Wn().close(ls),po(ls)})};return Mn.on("remove",()=>{fs(Vn,ls=>{Wn().close(ls)})}),{open:Fo,openUrl:Qo,alert:qo,confirm:ds,close:bs}},tz=(Mn,Vn)=>{Mn.notificationManager.open({type:"error",text:Vn})},yP=(Mn,Vn)=>{Mn._skinLoaded?tz(Mn,Vn):Mn.on("SkinLoaded",()=>{tz(Mn,Vn)})},nz=(Mn,Vn)=>{yP(Mn,cg.translate(["Failed to upload image: {0}",Vn]))},C1=(Mn,Vn,Wn)=>{Mp(Mn,Vn,{message:Wn}),console.error(Wn)},OP=(Mn,Vn,Wn)=>Wn?`Failed to load ${Mn}: ${Wn} from url ${Vn}`:`Failed to load ${Mn} url: ${Vn}`,oG=(Mn,Vn,Wn)=>{C1(Mn,"PluginLoadError",OP("plugin",Vn,Wn))},oz=(Mn,Vn,Wn)=>{C1(Mn,"IconsLoadError",OP("icons",Vn,Wn))},$E=(Mn,Vn,Wn)=>{C1(Mn,"LanguageLoadError",OP("language",Vn,Wn))},sz=(Mn,Vn,Wn)=>{C1(Mn,"ThemeLoadError",OP("theme",Vn,Wn))},eB=(Mn,Vn,Wn)=>{C1(Mn,"ModelLoadError",OP("model",Vn,Wn))},tB=(Mn,Vn,Wn)=>{const jn=cg.translate(["Failed to initialize plugin: {0}",Vn]);Mp(Mn,"PluginLoadError",{message:jn}),RE(jn,Wn),yP(Mn,jn)},RE=(Mn,...Vn)=>{const Wn=window.console;Wn&&(Wn.error?Wn.error(Mn,...Vn):Wn.log(Mn,...Vn))},rz=Mn=>/^[a-z0-9\-]+$/i.test(Mn),YD=Mn=>"content/"+Mn+"/content.css",Z_=Mn=>tinymce.Resource.has(YD(Mn)),iz=Mn=>nB(Mn,_m(Mn)),az=Mn=>nB(Mn,RC(Mn)),nB=(Mn,Vn)=>{const Wn=Mn.editorManager.baseURL+"/skins/content",Gn=`content${Mn.editorManager.suffix}.css`;return Us(Vn,no=>Z_(no)?no:rz(no)&&!Mn.inline?`${Wn}/${no}/${Gn}`:Mn.documentBaseURI.toAbsolute(no))},lz=Mn=>{Mn.contentCSS=Mn.contentCSS.concat(iz(Mn),az(Mn))},cz=Mn=>Mn?kc(Mn.getElementsByTagName("img")):[],uz=(Mn,Vn)=>{const Wn={};return{findAll:(Gn,no=Qs)=>{const ao=nr(cz(Gn),vo=>{const Ao=vo.src;return vo.hasAttribute("data-mce-bogus")||vo.hasAttribute("data-mce-placeholder")||!Ao||Ao===aa.transparentSrc?!1:Dc(Ao,"blob:")?!Mn.isUploaded(Ao)&&no(vo):Dc(Ao,"data:")?no(vo):!1}),po=Us(ao,vo=>{const Ao=vo.src;if(Mr(Wn,Ao))return Wn[Ao].then(Fo=>xo(Fo)?Fo:{image:vo,blobInfo:Fo.blobInfo});{const Fo=CQ(Vn,Ao).then(Qo=>(delete Wn[Ao],{image:vo,blobInfo:Qo})).catch(Qo=>(delete Wn[Ao],Qo));return Wn[Ao]=Fo,Fo}});return Promise.all(po)}}},oB=()=>{let Wn={};const jn=(qo,ds)=>({status:qo,resultUri:ds}),Gn=qo=>qo in Wn;return{hasBlobUri:Gn,getResultUri:qo=>{const ds=Wn[qo];return ds?ds.resultUri:null},isPending:qo=>Gn(qo)?Wn[qo].status===1:!1,isUploaded:qo=>Gn(qo)?Wn[qo].status===2:!1,markPending:qo=>{Wn[qo]=jn(1,null)},markUploaded:(qo,ds)=>{Wn[qo]=jn(2,ds)},removeFailed:qo=>{delete Wn[qo]},destroy:()=>{Wn={}}}};let dz=0;const fz=()=>{const Mn=()=>Math.round(Math.random()*4294967295).toString(36);return"s"+new Date().getTime().toString(36)+Mn()+Mn()+Mn()},_P=Mn=>Mn+dz+++fz(),hz=()=>{let Mn=[];const Vn=Qo=>({"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"})[Qo.toLowerCase()]||"dat",Wn=(Qo,qo,ds,bs,ls)=>{if(xo(Qo))return jn({id:Qo,name:bs,filename:ls,blob:qo,base64:ds});if(Io(Qo))return jn(Qo);throw new Error("Unknown input type")},jn=Qo=>{if(!Qo.blob||!Qo.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");const qo=Qo.id||_P("blobid"),ds=Qo.name||qo,bs=Qo.blob;return{id:xs(qo),name:xs(ds),filename:xs(Qo.filename||ds+"."+Vn(bs.type)),blob:xs(bs),base64:xs(Qo.base64),blobUri:xs(Qo.blobUri||URL.createObjectURL(bs)),uri:xs(Qo.uri)}},Gn=Qo=>{ao(Qo.id())||Mn.push(Qo)},no=Qo=>xa(Mn,Qo).getOrUndefined(),ao=Qo=>no(qo=>qo.id()===Qo);return{create:Wn,add:Gn,get:ao,getByUri:Qo=>no(qo=>qo.blobUri()===Qo),getByData:(Qo,qo)=>no(ds=>ds.base64()===Qo&&ds.blob().type===qo),findFirst:no,removeByUri:Qo=>{Mn=nr(Mn,qo=>qo.blobUri()===Qo?(URL.revokeObjectURL(qo.blobUri()),!1):!0)},destroy:()=>{fs(Mn,Qo=>{URL.revokeObjectURL(Qo.blobUri())}),Mn=[]}}},mz=(Mn,Vn)=>{const Wn={},jn=(ls,ys)=>ls?ls.replace(/\/$/,"")+"/"+ys.replace(/^\//,""):ys,Gn=(ls,ys)=>new Promise((Ls,zs)=>{const Hs=new XMLHttpRequest;Hs.open("POST",Vn.url),Hs.withCredentials=Vn.credentials,Hs.upload.onprogress=Pr=>{ys(Pr.loaded/Pr.total*100)},Hs.onerror=()=>{zs("Image upload failed due to a XHR Transport error. Code: "+Hs.status)},Hs.onload=()=>{if(Hs.status<200||Hs.status>=300){zs("HTTP Error: "+Hs.status);return}const Pr=JSON.parse(Hs.responseText);if(!Pr||!xo(Pr.location)){zs("Invalid JSON: "+Hs.responseText);return}Ls(jn(Vn.basePath,Pr.location))};const tr=new FormData;tr.append("file",ls.blob(),ls.filename()),Hs.send(tr)}),no=Yo(Vn.handler)?Vn.handler:Gn,ao=()=>new Promise(ls=>{ls([])}),po=(ls,ys)=>({url:ys,blobInfo:ls,status:!0}),vo=(ls,ys)=>({url:"",blobInfo:ls,status:!1,error:ys}),Ao=(ls,ys)=>{Lr.each(Wn[ls],Ls=>{Ls(ys)}),delete Wn[ls]},Fo=(ls,ys,Ls)=>(Mn.markPending(ls.blobUri()),new Promise(zs=>{let Hs,tr;try{const Pr=()=>{Hs&&(Hs.close(),tr=Js)},Ur=yr=>{Pr(),Mn.markUploaded(ls.blobUri(),yr),Ao(ls.blobUri(),po(ls,yr)),zs(po(ls,yr))},fa=yr=>{Pr(),Mn.removeFailed(ls.blobUri()),Ao(ls.blobUri(),vo(ls,yr)),zs(vo(ls,yr))};tr=yr=>{yr<0||yr>100||zo.from(Hs).orThunk(()=>zo.from(Ls).map(_r)).each(fr=>{Hs=fr,fr.progressBar.value(yr)})},ys(ls,tr).then(Ur,yr=>{fa(xo(yr)?{message:yr}:yr)})}catch(Pr){zs(vo(ls,Pr))}})),Qo=ls=>ls===Gn,qo=ls=>{const ys=ls.blobUri();return new Promise(Ls=>{Wn[ys]=Wn[ys]||[],Wn[ys].push(Ls)})},ds=(ls,ys)=>(ls=Lr.grep(ls,Ls=>!Mn.isUploaded(Ls.blobUri())),Promise.all(Lr.map(ls,Ls=>Mn.isPending(Ls.blobUri())?qo(Ls):Fo(Ls,no,ys))));return{upload:(ls,ys)=>!Vn.url&&Qo(no)?ao():ds(ls,ys)}},pz=Mn=>()=>Mn.notificationManager.open({text:Mn.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0}),Zk=(Mn,Vn)=>mz(Vn,{url:X2(Mn),basePath:Y2(Mn),credentials:VS(Mn),handler:zS(Mn)}),gz=Mn=>{const Vn=oB(),Wn=Zk(Mn,Vn);return{upload:(jn,Gn=!0)=>Wn.upload(jn,Gn?pz(Mn):void 0)}},GD=(Mn,Vn)=>Mn.dom.isEmpty(Vn.dom)&&is(Mn.schema.getTextBlockElements()[ql(Vn)]),bz=Mn=>Vn=>{GD(Mn,Vn)&&Fu(Vn,Cs.fromHtml('
    '))},vz=Mn=>{const Vn=hz();let Wn,jn;const Gn=oB(),no=[],ao=Hs=>tr=>Mn.selection?Hs(tr):[],po=Hs=>Hs+(Hs.indexOf("?")===-1?"?":"&")+new Date().getTime(),vo=(Hs,tr,Pr)=>{let Ur=0;do Ur=Hs.indexOf(tr,Ur),Ur!==-1&&(Hs=Hs.substring(0,Ur)+Pr+Hs.substr(Ur+tr.length),Ur+=Pr.length-tr.length+1);while(Ur!==-1);return Hs},Ao=(Hs,tr,Pr)=>{const Ur=`src="${Pr}"${Pr===aa.transparentSrc?' data-mce-placeholder="1"':""}`;return Hs=vo(Hs,`src="${tr}"`,Ur),Hs=vo(Hs,'data-mce-src="'+tr+'"','data-mce-src="'+Pr+'"'),Hs},Fo=(Hs,tr)=>{fs(Mn.undoManager.data,Pr=>{Pr.type==="fragmented"?Pr.fragments=Us(Pr.fragments,Ur=>Ao(Ur,Hs,tr)):Pr.content=Ao(Pr.content,Hs,tr)})},Qo=(Hs,tr)=>{const Pr=Mn.convertURL(tr,"src");Fo(Hs.src,tr),im(Cs.fromDom(Hs),{src:nO(Mn)?po(tr):tr,"data-mce-src":Pr})},qo=()=>(Wn||(Wn=Zk(Mn,Gn)),ys().then(ao(Hs=>{const tr=Us(Hs,Pr=>Pr.blobInfo);return Wn.upload(tr,pz(Mn)).then(ao(Pr=>{const Ur=[];let fa=!1;const yr=Us(Pr,(fr,Ar)=>{const{blobInfo:wa,image:Va}=Hs[Ar];let Tl=!1;return fr.status&&$C(Mn)?(fr.url&&!oc(Va.src,fr.url)&&(fa=!0),Vn.removeByUri(Va.src),wO(Mn)||Qo(Va,fr.url)):fr.error&&(fr.error.remove&&(Fo(Va.src,aa.transparentSrc),Ur.push(Va),Tl=!0),nz(Mn,fr.error.message)),{element:Va,status:fr.status,uploadUri:fr.url,blobInfo:wa,removed:Tl}});return Ur.length>0&&!wO(Mn)?Mn.undoManager.transact(()=>{fs(Km(Ur),fr=>{const Ar=Wc(fr);sc(fr),Ar.each(bz(Mn)),Vn.removeByUri(fr.dom.src)})}):fa&&Mn.undoManager.dispatchChange(),yr}))}))),ds=()=>PC(Mn)?qo():Promise.resolve([]),bs=Hs=>gc(no,tr=>tr(Hs)),ls=Hs=>{no.push(Hs)},ys=()=>(jn||(jn=uz(Gn,Vn)),jn.findAll(Mn.getBody(),bs).then(ao(Hs=>{const tr=nr(Hs,Pr=>xo(Pr)?(yP(Mn,Pr),!1):Pr.uriType!=="blob");return wO(Mn)||fs(tr,Pr=>{Fo(Pr.image.src,Pr.blobInfo.blobUri()),Pr.image.src=Pr.blobInfo.blobUri(),Pr.image.removeAttribute("data-mce-src")}),tr}))),Ls=()=>{Vn.destroy(),Gn.destroy(),jn=Wn=null},zs=Hs=>Hs.replace(/src="(blob:[^"]+)"/g,(tr,Pr)=>{const Ur=Gn.getResultUri(Pr);if(Ur)return'src="'+Ur+'"';let fa=Vn.getByUri(Pr);return fa||(fa=ra(Mn.editorManager.get(),(yr,fr)=>yr||fr.editorUpload&&fr.editorUpload.blobCache.getByUri(Pr),void 0)),fa?'src="data:'+fa.blob().type+";base64,"+fa.base64()+'"':tr});return Mn.on("SetContent",()=>{PC(Mn)?ds():ys()}),Mn.on("RawSaveContent",Hs=>{Hs.content=zs(Hs.content)}),Mn.on("GetContent",Hs=>{Hs.source_view||Hs.format==="raw"||Hs.format==="tree"||(Hs.content=zs(Hs.content))}),Mn.on("PostRender",()=>{Mn.parser.addNodeFilter("img",Hs=>{fs(Hs,tr=>{const Pr=tr.attr("src");if(!Pr||Vn.getByUri(Pr))return;const Ur=Gn.getResultUri(Pr);Ur&&tr.attr("src",Ur)})})}),{blobCache:Vn,addFilter:ls,uploadImages:qo,uploadImagesAuto:ds,scanForImages:ys,destroy:Ls}},yz=Mn=>{const Vn=Mn.dom,Wn=Mn.schema.type,jn={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"left"},inherit:!1,preview:!1},{selector:"img,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"},{selector:"table",collapsed:!1,styles:{marginLeft:"0px",marginRight:"auto"},onformat:Gn=>{Vn.setStyle(Gn,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"},{selector:".mce-preview-object",ceFalseOverride:!0,styles:{display:"table",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{marginLeft:"auto",marginRight:"auto"},preview:!1}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"},{selector:"table",collapsed:!1,styles:{marginRight:"0px",marginLeft:"auto"},onformat:Gn=>{Vn.setStyle(Gn,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"right"},preview:!1}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"justify"},inherit:!1,preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:(()=>{const Gn={inline:"span",styles:{textDecoration:"line-through"},exact:!0},no={inline:"strike",remove:"all",preserve_attributes:["class","style"]},ao={inline:"s",remove:"all",preserve_attributes:["class","style"]};return Wn!=="html4"?[ao,Gn,no]:[Gn,ao,no]})(),forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:(Gn,no,ao)=>Oa(Gn)&&Gn.hasAttribute("href"),onformat:(Gn,no,ao)=>{Lr.each(ao,(po,vo)=>{Vn.setAttrib(Gn,vo,po)})}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":Gn=>{var no;return(no=Gn==null?void 0:Gn.customValue)!==null&&no!==void 0?no:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return Lr.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),Gn=>{jn[Gn]={block:Gn,remove:"all"}}),jn},sB={remove_similar:!0,inherit:!1},l0={selector:"td,th",...sB},Qw={tablecellbackgroundcolor:{styles:{backgroundColor:"%value"},...l0},tablecellverticalalign:{styles:{"vertical-align":"%value"},...l0},tablecellbordercolor:{styles:{borderColor:"%value"},...l0},tablecellclass:{classes:["%value"],...l0},tableclass:{selector:"table",classes:["%value"],...sB},tablecellborderstyle:{styles:{borderStyle:"%value"},...l0},tablecellborderwidth:{styles:{borderWidth:"%value"},...l0}},SP=xs(Qw),wP=Mn=>{const Vn={},Wn=ao=>is(ao)?Vn[ao]:Vn,jn=ao=>Mr(Vn,ao),Gn=(ao,po)=>{ao&&(xo(ao)?(Jo(po)||(po=[po]),fs(po,vo=>{os(vo.deep)&&(vo.deep=!Nh(vo)),os(vo.split)&&(vo.split=!Nh(vo)||Sf(vo)),os(vo.remove)&&Nh(vo)&&!Sf(vo)&&(vo.remove="none"),Nh(vo)&&Sf(vo)&&(vo.mixed=!0,vo.block_expand=!0),xo(vo.classes)&&(vo.classes=vo.classes.split(/\s+/))}),Vn[ao]=po):Rr(ao,(vo,Ao)=>{Gn(Ao,vo)}))},no=ao=>(ao&&Vn[ao]&&delete Vn[ao],Vn);return Gn(yz(Mn)),Gn(SP()),Gn(ex(Mn)),{get:Wn,has:jn,register:Gn,unregister:no}},ky=Lr.each,Um=Eu.DOM,qk=Mn=>is(Mn)&&Io(Mn),DE=(Mn,Vn)=>{const Wn=Vn&&Vn.schema||i1({}),jn=(vo,Ao)=>{Ao.classes.length>0&&Um.addClass(vo,Ao.classes.join(" ")),Um.setAttribs(vo,Ao.attrs)},Gn=vo=>{const Ao=xo(vo)?{name:vo,classes:[],attrs:{}}:vo,Fo=Um.create(Ao.name);return jn(Fo,Ao),Fo},no=(vo,Ao)=>{const Fo=Wn.getElementRule(vo.nodeName.toLowerCase()),Qo=Fo==null?void 0:Fo.parentsRequired;return Qo&&Qo.length?Ao&&Zs(Qo,Ao)?Ao:Qo[0]:!1},ao=(vo,Ao,Fo)=>{let Qo;const qo=Ao[0],ds=qk(qo)?qo.name:void 0,bs=no(vo,ds);if(bs)ds===bs?(Qo=qo,Ao=Ao.slice(1)):Qo=bs;else if(qo)Qo=qo,Ao=Ao.slice(1);else if(!Fo)return vo;const ls=Qo?Gn(Qo):Um.create("div");ls.appendChild(vo),Fo&&Lr.each(Fo,Ls=>{const zs=Gn(Ls);ls.insertBefore(zs,vo)});const ys=qk(Qo)?Qo.siblings:void 0;return ao(ls,Ao,ys)},po=Um.create("div");if(Mn.length>0){const vo=Mn[0],Ao=Gn(vo),Fo=qk(vo)?vo.siblings:void 0;po.appendChild(ao(Ao,Mn.slice(1),Fo))}return po},rB=Mn=>{Mn=Lr.trim(Mn);let Vn="div";const Wn={name:Vn,classes:[],attrs:{},selector:Mn};return Mn!=="*"&&(Vn=Mn.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(jn,Gn,no,ao,po)=>{switch(Gn){case"#":Wn.attrs.id=no;break;case".":Wn.classes.push(no);break;case":":Lr.inArray("checked disabled enabled read-only required".split(" "),no)!==-1&&(Wn.attrs[no]=no);break}if(ao==="["){const vo=po.match(/([\w\-]+)(?:\=\"([^\"]+))?/);vo&&(Wn.attrs[vo[1]]=vo[2])}return""})),Wn.name=Vn||"div",Wn},KD=Mn=>xo(Mn)?(Mn=Mn.split(/\s*,\s*/)[0],Mn=Mn.replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Lr.map(Mn.split(/(?:>|\s+(?![^\[\]]+\]))/),Vn=>{const Wn=Lr.map(Vn.split(/(?:~\+|~|\+)/),rB),jn=Wn.pop();return Wn.length&&(jn.siblings=Wn),jn}).reverse()):[],JD=(Mn,Vn)=>{let Wn="",jn=NC(Mn);if(jn==="")return"";const Gn=qo=>xo(qo)?qo.replace(/%(\w+)/g,""):"",no=(qo,ds)=>Um.getStyle(ds??Mn.getBody(),qo,!0);if(xo(Vn)){const qo=Mn.formatter.get(Vn);if(!qo)return"";Vn=qo[0]}if("preview"in Vn){const qo=Vn.preview;if(qo===!1)return"";jn=qo||jn}let ao=Vn.block||Vn.inline||"span",po;const vo=KD(Vn.selector);vo.length>0?(vo[0].name||(vo[0].name=ao),ao=Vn.selector,po=DE(vo,Mn)):po=DE([ao],Mn);const Ao=Um.select(ao,po)[0]||po.firstChild;ky(Vn.styles,(qo,ds)=>{const bs=Gn(qo);bs&&Um.setStyle(Ao,ds,bs)}),ky(Vn.attributes,(qo,ds)=>{const bs=Gn(qo);bs&&Um.setAttrib(Ao,ds,bs)}),ky(Vn.classes,qo=>{const ds=Gn(qo);Um.hasClass(Ao,ds)||Um.addClass(Ao,ds)}),Mn.dispatch("PreviewFormats"),Um.setStyles(po,{position:"absolute",left:-65535}),Mn.getBody().appendChild(po);const Fo=no("fontSize"),Qo=/px$/.test(Fo)?parseInt(Fo,10):0;return ky(jn.split(" "),qo=>{let ds=no(qo,Ao);if(!(qo==="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(ds)&&(ds=no(qo),Bm(ds).toLowerCase()==="#ffffff"))&&!(qo==="color"&&Bm(ds).toLowerCase()==="#000000")){if(qo==="font-size"&&/em|%$/.test(ds)){if(Qo===0)return;ds=parseFloat(ds)/(/%$/.test(ds)?100:1)*Qo+"px"}qo==="border"&&ds&&(Wn+="padding:0 2px;"),Wn+=qo+":"+ds+";"}}),Mn.dispatch("AfterPreviewFormats"),Um.remove(po),Wn},iB=Mn=>{Mn.addShortcut("meta+b","","Bold"),Mn.addShortcut("meta+i","","Italic"),Mn.addShortcut("meta+u","","Underline");for(let Vn=1;Vn<=6;Vn++)Mn.addShortcut("access+"+Vn,"",["FormatBlock",!1,"h"+Vn]);Mn.addShortcut("access+7","",["FormatBlock",!1,"p"]),Mn.addShortcut("access+8","",["FormatBlock",!1,"div"]),Mn.addShortcut("access+9","",["FormatBlock",!1,"address"])},eM=Mn=>{const Vn=wP(Mn),Wn=od({});return iB(Mn),eQ(Mn),wO(Mn)||fQ(Wn,Mn),{get:Vn.get,has:Vn.has,register:Vn.register,unregister:Vn.unregister,apply:(jn,Gn,no)=>{vV(Mn,jn,Gn,no)},remove:(jn,Gn,no,ao)=>{yV(Mn,jn,Gn,no,ao)},toggle:(jn,Gn,no)=>{OV(Mn,jn,Gn,no)},match:(jn,Gn,no,ao)=>DI(Mn,jn,Gn,no,ao),closest:jn=>zD(Mn,jn),matchAll:(jn,Gn)=>MI(Mn,jn,Gn),matchNode:(jn,Gn,no,ao)=>VD(Mn,jn,Gn,no,ao),canApply:jn=>NI(Mn,jn),formatChanged:(jn,Gn,no,ao)=>vb(Mn,Wn,jn,Gn,no,ao),getCssText:ws(JD,Mn)}},Vw=Mn=>{switch(Mn.toLowerCase()){case"undo":case"redo":case"mcefocus":return!0;default:return!1}},aB=(Mn,Vn,Wn)=>{const jn=od(!1),Gn=vo=>{mP(Vn,!1,Wn),Vn.add({},vo)};Mn.on("init",()=>{Vn.add()}),Mn.on("BeforeExecCommand",vo=>{const Ao=vo.command;Vw(Ao)||(EI(Vn,Wn),Vn.beforeChange())}),Mn.on("ExecCommand",vo=>{const Ao=vo.command;Vw(Ao)||Gn(vo)}),Mn.on("ObjectResizeStart cut",()=>{Vn.beforeChange()}),Mn.on("SaveContent ObjectResized blur",Gn),Mn.on("dragend",Gn),Mn.on("keyup",vo=>{const Ao=vo.keyCode;if(vo.isDefaultPrevented())return;const Fo=aa.os.isMacOS()&&vo.key==="Meta";(Ao>=33&&Ao<=36||Ao>=37&&Ao<=40||Ao===45||vo.ctrlKey||Fo)&&(Gn(),Mn.nodeChanged()),(Ao===46||Ao===8)&&Mn.nodeChanged(),jn.get()&&Vn.typing&&!BD(hP(Mn),Vn.data[0])&&(Mn.isDirty()||Mn.setDirty(!0),Mn.dispatch("TypingUndo"),jn.set(!1),Mn.nodeChanged())}),Mn.on("keydown",vo=>{const Ao=vo.keyCode;if(vo.isDefaultPrevented())return;if(Ao>=33&&Ao<=36||Ao>=37&&Ao<=40||Ao===45){Vn.typing&&Gn(vo);return}const Fo=vo.ctrlKey&&!vo.altKey||vo.metaKey;if((Ao<16||Ao>20)&&Ao!==224&&Ao!==91&&!Vn.typing&&!Fo){Vn.beforeChange(),mP(Vn,!0,Wn),Vn.add({},vo),jn.set(!0);return}(aa.os.isMacOS()?vo.metaKey:vo.ctrlKey&&!vo.altKey)&&Vn.beforeChange()}),Mn.on("mousedown",vo=>{Vn.typing&&Gn(vo)});const no=vo=>vo.inputType==="insertReplacementText",ao=vo=>vo.inputType==="insertText"&&vo.data===null,po=vo=>vo.inputType==="insertFromPaste"||vo.inputType==="insertFromDrop";Mn.on("input",vo=>{vo.inputType&&(no(vo)||ao(vo)||po(vo))&&Gn(vo)}),Mn.on("AddUndo Undo Redo ClearUndos",vo=>{vo.isDefaultPrevented()||Mn.nodeChanged()})},lB=Mn=>{Mn.addShortcut("meta+z","","Undo"),Mn.addShortcut("meta+y,meta+shift+z","","Redo")},tM=Mn=>{const Vn=Fb(),Wn=od(0),jn=od(0),Gn={data:[],typing:!1,beforeChange:()=>{GY(Mn,Wn,Vn)},add:(no,ao)=>Cm(Mn,Gn,jn,Wn,Vn,no,ao),dispatchChange:()=>{Mn.setDirty(!0);const no=hP(Mn);no.bookmark=ib(Mn.selection),Mn.dispatch("change",{level:no,lastLevel:Fc(Gn.data,jn.get()).getOrUndefined()})},undo:()=>PI(Mn,Gn,Wn,jn),redo:()=>$I(Mn,jn,Gn.data),clear:()=>{RI(Mn,Gn,jn)},reset:()=>{mV(Mn,Gn)},hasUndo:()=>pV(Mn,Gn,jn),hasRedo:()=>pP(Mn,Gn,jn),transact:no=>gV(Mn,Gn,Wn,no),ignore:no=>{QD(Mn,Wn,no)},extra:(no,ao)=>{bV(Mn,Gn,jn,no,ao)}};return wO(Mn)||aB(Mn,Gn,Wn),lB(Mn),Gn},CP=[9,27,va.HOME,va.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,va.DOWN,va.UP,va.LEFT,va.RIGHT].concat(aa.browser.isFirefox()?[224]:[]),nM="data-mce-placeholder",oM=Mn=>Mn.type==="keydown"||Mn.type==="keyup",sM=Mn=>{const Vn=Mn.keyCode;return Vn===va.BACKSPACE||Vn===va.DELETE},cB=Mn=>{if(oM(Mn)){const Vn=Mn.keyCode;return!sM(Mn)&&(va.metaKeyPressed(Mn)||Mn.altKey||Vn>=112&&Vn<=123||Zs(CP,Vn))}else return!1},kO=Mn=>oM(Mn)&&!(sM(Mn)||Mn.type==="keyup"&&Mn.keyCode===229),q_=(Mn,Vn,Wn)=>{if(md(Cs.fromDom(Vn),!1)){const jn=Vn.firstElementChild;return jn?Mn.getStyle(Vn.firstElementChild,"padding-left")||Mn.getStyle(Vn.firstElementChild,"padding-right")?!1:Wn===jn.nodeName.toLowerCase():!0}else return!1},c0=Mn=>{var Vn;const Wn=Mn.dom,jn=bh(Mn),Gn=(Vn=RT(Mn))!==null&&Vn!==void 0?Vn:"",no=(ao,po)=>{if(cB(ao))return;const vo=Mn.getBody(),Ao=kO(ao)?!1:q_(Wn,vo,jn);(Wn.getAttrib(vo,nM)!==""!==Ao||po)&&(Wn.setAttrib(vo,nM,Ao?Gn:null),Wn.setAttrib(vo,"aria-placeholder",Ao?Gn:null),A3(Mn,Ao),Mn.on(Ao?"keydown":"keyup",no),Mn.off(Ao?"keyup":"keydown",no))};fc(Gn)&&Mn.on("init",ao=>{no(ao,!0),Mn.on("change SetContent ExecCommand",no),Mn.on("paste",po=>O1.setEditorTimeout(Mn,()=>no(po)))})},Oz=(Mn,Vn)=>({block:Mn,position:Vn}),_z=(Mn,Vn)=>({from:Mn,to:Vn}),rM=(Mn,Vn)=>{const Wn=Cs.fromDom(Mn),jn=Cs.fromDom(Vn.container());return eE(Wn,jn).map(Gn=>Oz(Gn,Vn))},Sz=Mn=>!Vs(Mn.from.block,Mn.to.block),uB=(Mn,Vn)=>cf(Vn,Gn=>Eh(Gn)||Gf(Gn.dom),Gn=>Vs(Gn,Mn)).filter(lf).getOr(Mn),wz=(Mn,Vn)=>{const Wn=Cs.fromDom(Mn);return Vs(uB(Wn,Vn.from.block),uB(Wn,Vn.to.block))},Cz=Mn=>jl(Mn.from.block.dom)===!1&&jl(Mn.to.block.dom)===!1,kz=Mn=>{const Vn=Wn=>Gs(Wn)||NO(Wn.dom);return Vn(Mn.from.block)&&Vn(Mn.to.block)},xz=(Mn,Vn,Wn)=>Ec(Wn.position.getNode())&&!md(Wn.block)?w_(!1,Wn.block.dom).bind(jn=>jn.isEqual(Wn.position)?vh(Vn,Mn,jn).bind(Gn=>rM(Mn,Gn)):zo.some(Wn)).getOr(Wn):Wn,Ez=(Mn,Vn,Wn)=>{const jn=rM(Mn,lr.fromRangeStart(Wn)),Gn=jn.bind(no=>vh(Vn,Mn,no.position).bind(ao=>rM(Mn,ao).map(po=>xz(Mn,Vn,po))));return jc(jn,Gn,_z).filter(no=>Sz(no)&&wz(Mn,no)&&Cz(no)&&kz(no))},Tz=(Mn,Vn,Wn)=>Wn.collapsed?Ez(Mn,Vn,Wn):zo.none(),Az=(Mn,Vn)=>{const Wn=Ku(Mn);return Nl(Wn,jn=>Vn.isBlock(ql(jn))).fold(xs(Wn),jn=>Wn.slice(0,jn))},kP=(Mn,Vn)=>{const Wn=Az(Mn,Vn);return fs(Wn,sc),Wn},xP=(Mn,Vn)=>{const Wn=py(Vn,Mn);return xa(Wn.reverse(),jn=>md(jn)).each(sc)},dB=Mn=>nr(y0(Mn),Vn=>!md(Vn)).length===0,Pz=(Mn,Vn,Wn,jn,Gn)=>{if(md(Wn))return Kp(Wn),zm(Wn.dom);dB(Gn)&&md(Vn)&&ed(Gn,Cs.fromTag("br"));const no=cp(Wn.dom,lr.before(Gn.dom));return fs(kP(Vn,jn),ao=>{ed(Gn,ao)}),xP(Mn,Vn),no},$z=(Mn,Vn)=>Mn.isInline(ql(Vn)),fB=(Mn,Vn,Wn,jn)=>{if(md(Wn)){if(md(Vn)){const ao=Kr((po=>{const vo=(Ao,Fo)=>iu(Ao).fold(()=>Fo,Qo=>$z(jn,Qo)?vo(Qo,Fo.concat(Hm(Qo))):Fo);return vo(po,[])})(Wn),(po,vo)=>(_0(po,vo),vo),Th());Dm(Vn),Fu(Vn,ao)}return sc(Wn),zm(Vn.dom)}const Gn=b1(Wn.dom);return fs(kP(Vn,jn),no=>{Fu(Wn,no)}),xP(Mn,Vn),Gn},hB=(Mn,Vn)=>{const Wn=py(Vn,Mn);return zo.from(Wn[Wn.length-1])},iM=(Mn,Vn)=>Dr(Vn,Mn)?hB(Vn,Mn):zo.none(),aM=(Mn,Vn)=>{w_(Mn,Vn.dom).bind(Wn=>zo.from(Wn.getNode())).map(Cs.fromDom).filter(np).each(sc)},lM=(Mn,Vn,Wn,jn)=>(aM(!0,Vn),aM(!1,Wn),iM(Vn,Wn).fold(ws(fB,Mn,Vn,Wn,jn),ws(Pz,Mn,Vn,Wn,jn))),EP=(Mn,Vn,Wn,jn,Gn)=>Vn?lM(Mn,jn,Wn,Gn):lM(Mn,Wn,jn,Gn),cM=(Mn,Vn)=>{const Wn=Cs.fromDom(Mn.getBody());return Tz(Wn.dom,Vn,Mn.selection.getRng()).map(Gn=>()=>{EP(Wn,Vn,Gn.from.block,Gn.to.block,Mn.schema).each(no=>{Mn.selection.setRng(no.toRange())})})},Rz=(Mn,Vn,Wn)=>{const jn=Vn.getRng();return jc(eE(Mn,Cs.fromDom(jn.startContainer)),eE(Mn,Cs.fromDom(jn.endContainer)),(Gn,no)=>Vs(Gn,no)?zo.none():zo.some(()=>{jn.deleteContents(),EP(Mn,!0,Gn,no,Wn).each(ao=>{Vn.setRng(ao.toRange())})})).getOr(zo.none())},iv=(Mn,Vn)=>{const Wn=Cs.fromDom(Vn),jn=ws(Vs,Mn);return au(Wn,Eh,jn).isSome()},u0=(Mn,Vn)=>iv(Mn,Vn.startContainer)||iv(Mn,Vn.endContainer),TP=(Mn,Vn)=>{const Wn=cp(Mn.dom,lr.fromRangeStart(Vn)).isNone(),jn=Sm(Mn.dom,lr.fromRangeEnd(Vn)).isNone();return!u0(Mn,Vn)&&Wn&&jn},mB=Mn=>zo.some(()=>{Mn.setContent(""),Mn.selection.setCursorLocation()}),AP=Mn=>{const Vn=Cs.fromDom(Mn.getBody()),Wn=Mn.selection.getRng();return TP(Vn,Wn)?mB(Mn):Rz(Vn,Mn.selection,Mn.schema)},PP=(Mn,Vn)=>Mn.selection.isCollapsed()?zo.none():AP(Mn),xy=(Mn,Vn,Wn,jn,Gn)=>zo.from(Vn._selectionOverrides.showCaret(Mn,Wn,jn,Gn)),pB=Mn=>{const Vn=Mn.ownerDocument.createRange();return Vn.selectNode(Mn),Vn},jk=(Mn,Vn)=>Mn.dispatch("BeforeObjectSelected",{target:Vn}).isDefaultPrevented()?zo.none():zo.some(pB(Vn)),gB=(Mn,Vn,Wn)=>{const jn=nu(1,Mn.getBody(),Vn),Gn=lr.fromRangeStart(jn),no=Gn.getNode();if(v_(no))return xy(1,Mn,no,!Gn.isAtEnd(),!1);const ao=Gn.getNode(!0);if(v_(ao))return xy(1,Mn,ao,!1,!1);const po=Nw(Mn.dom.getRoot(),Gn.getNode());return v_(po)?xy(1,Mn,po,!1,Wn):zo.none()},$P=(Mn,Vn,Wn)=>Vn.collapsed?gB(Mn,Vn,Wn).getOr(Vn):Vn,RP=Mn=>bO(Mn)||jx(Mn),uM=Mn=>tv(Mn)||wk(Mn),Dz=(Mn,Vn)=>{Ir(Vn)&&Vn.data.length===0&&Mn.remove(Vn)},bB=(Mn,Vn,Wn,jn,Gn,no)=>{xy(jn,Mn,no.getNode(!Gn),Gn,!0).each(ao=>{if(Vn.collapsed){const po=Vn.cloneRange();Gn?po.setEnd(ao.startContainer,ao.startOffset):po.setStart(ao.endContainer,ao.endOffset),po.deleteContents()}else Vn.deleteContents();Mn.selection.setRng(ao)}),Dz(Mn.dom,Wn)},Mz=(Mn,Vn)=>{const Wn=Mn.selection.getRng();if(!Ir(Wn.commonAncestorContainer))return zo.none();const jn=Vn?Tu.Forwards:Tu.Backwards,Gn=ub(Mn.getBody()),no=ws(Mf,Vn?Gn.next:Gn.prev),ao=Vn?RP:uM,po=nh(jn,Mn.getBody(),Wn),vo=no(po),Ao=vo&&mc(Vn,vo);if(!Ao||!Dp(po,Ao))return zo.none();if(ao(Ao))return zo.some(()=>bB(Mn,Wn,po.getNode(),jn,Vn,Ao));const Fo=no(Ao);return Fo&&ao(Fo)&&Dp(Ao,Fo)?zo.some(()=>bB(Mn,Wn,po.getNode(),jn,Vn,Fo)):zo.none()},dM=(Mn,Vn)=>Mz(Mn,Vn),DP=(Mn,Vn)=>{const Wn=Mn.getBody();return Vn?zm(Wn).filter(bO):b1(Wn).filter(tv)},fM=Mn=>{const Vn=Mn.selection.getRng();return!Vn.collapsed&&(DP(Mn,!0).exists(Wn=>Wn.isEqual(lr.fromRangeStart(Vn)))||DP(Mn,!1).exists(Wn=>Wn.isEqual(lr.fromRangeEnd(Vn))))},Nz=Mn=>is(Mn)&&(Eh(Cs.fromDom(Mn))||Lm(Cs.fromDom(Mn))),yg=Qg.generate([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Lz=(Mn,Vn)=>{const Wn=Vn.getNode(!Mn),jn=Mn?"after":"before";return Oa(Wn)&&Wn.getAttribute("data-mce-caret")===jn},Iz=(Mn,Vn,Wn,jn,Gn)=>{const no=ao=>Gn.isInline(ao.nodeName.toLowerCase())&&!jr(Wn,jn,Mn);return vu(!Vn,Wn).fold(()=>vu(Vn,jn).fold(hs,no),no)},vB=(Mn,Vn,Wn,jn)=>{const Gn=jn.getNode(!Vn);return eE(Cs.fromDom(Mn),Cs.fromDom(Wn.getNode())).map(no=>md(no)?yg.remove(no.dom):yg.moveToElement(Gn)).orThunk(()=>zo.some(yg.moveToElement(Gn)))},yB=(Mn,Vn,Wn,jn)=>vh(Vn,Mn,Wn).bind(Gn=>Nz(Gn.getNode())||Iz(Mn,Vn,Wn,Gn,jn)?zo.none():Vn&&jl(Gn.getNode())||!Vn&&jl(Gn.getNode(!0))?vB(Mn,Vn,Wn,Gn):Vn&&tv(Wn)||!Vn&&bO(Wn)?zo.some(yg.moveToPosition(Gn)):zo.none()),Bz=(Mn,Vn)=>ms(Vn)?zo.none():Mn&&jl(Vn.nextSibling)?zo.some(yg.moveToElement(Vn.nextSibling)):!Mn&&jl(Vn.previousSibling)?zo.some(yg.moveToElement(Vn.previousSibling)):zo.none(),Fz=(Mn,Vn,Wn)=>Wn.fold(jn=>zo.some(yg.remove(jn)),jn=>zo.some(yg.moveToElement(jn)),jn=>jr(Vn,jn,Mn)?zo.none():zo.some(yg.moveToPosition(jn))),Hz=(Mn,Vn,Wn,jn)=>Lz(Vn,Wn)?Bz(Vn,Wn.getNode(!Vn)).orThunk(()=>yB(Mn,Vn,Wn,jn)):yB(Mn,Vn,Wn,jn).bind(Gn=>Fz(Mn,Wn,Gn)),MP=(Mn,Vn,Wn,jn)=>{const Gn=nu(Vn?1:-1,Mn,Wn),no=lr.fromRangeStart(Gn),ao=Cs.fromDom(Mn);return!Vn&&tv(no)?zo.some(yg.remove(no.getNode(!0))):Vn&&bO(no)?zo.some(yg.remove(no.getNode())):!Vn&&bO(no)&&Yx(ao,no,jn)?a9(ao,no,jn).map(po=>yg.remove(po.getNode())):Vn&&tv(no)&&Xx(ao,no,jn)?l9(ao,no,jn).map(po=>yg.remove(po.getNode())):Hz(Mn,Vn,no,jn)},hM=(Mn,Vn)=>Wn=>(Mn._selectionOverrides.hideFakeCaret(),yO(Mn,Vn,Cs.fromDom(Wn)),!0),Qz=(Mn,Vn)=>Wn=>{const jn=Vn?lr.before(Wn):lr.after(Wn);return Mn.selection.setRng(jn.toRange()),!0},Vz=Mn=>Vn=>(Mn.selection.setRng(Vn.toRange()),!0),OB=(Mn,Vn)=>zo.from(Nw(Mn.getBody(),Vn)),zz=(Mn,Vn)=>{const Wn=Mn.selection.getNode();return OB(Mn,Wn).filter(jl).fold(()=>MP(Mn.getBody(),Vn,Mn.selection.getRng(),Mn.schema).map(jn=>()=>jn.fold(hM(Mn,Vn),Qz(Mn,Vn),Vz(Mn))),()=>zo.some(Js))},_B=Mn=>{fs(mf(Mn,".mce-offscreen-selection"),sc)},Wz=(Mn,Vn)=>{const Wn=Mn.selection.getNode();return jl(Wn)&&!L1(Wn)?OB(Mn,Wn.parentNode).filter(jl).fold(()=>zo.some(()=>{_B(Cs.fromDom(Mn.getBody())),yO(Mn,Vn,Cs.fromDom(Mn.selection.getNode())),xA(Mn)}),()=>zo.some(Js)):fM(Mn)?zo.some(()=>{tE(Mn,Mn.selection.getRng(),Cs.fromDom(Mn.getBody()))}):zo.none()},SB=Mn=>{const Vn=Mn.dom,Wn=Mn.selection,jn=Nw(Mn.getBody(),Wn.getNode());if(Gf(jn)&&Vn.isBlock(jn)&&Vn.isEmpty(jn)){const Gn=Vn.create("br",{"data-mce-bogus":"1"});Vn.setHTML(jn,""),jn.appendChild(Gn),Wn.setRng(lr.before(Gn).toRange())}return!0},ME=(Mn,Vn)=>Mn.selection.isCollapsed()?zz(Mn,Vn):Wz(Mn,Vn),Uz=(Mn,Vn)=>{const Wn=lr.fromRangeStart(Mn.selection.getRng());return vh(Vn,Mn.getBody(),Wn).filter(jn=>Vn?t9(jn):n9(jn)).bind(jn=>ua(Vn?0:-1,jn)).map(jn=>()=>Mn.selection.select(jn))},mM=(Mn,Vn)=>Mn.selection.isCollapsed()?Uz(Mn,Vn):zo.none(),Xk=Ir,wB=Mn=>Xk(Mn)&&Mn.data[0]===_o,CB=Mn=>Xk(Mn)&&Mn.data[Mn.data.length-1]===_o,kB=Mn=>{var Vn;return((Vn=Mn.ownerDocument)!==null&&Vn!==void 0?Vn:document).createTextNode(_o)},Zz=Mn=>{var Vn;if(Xk(Mn.previousSibling))return CB(Mn.previousSibling)||Mn.previousSibling.appendData(_o),Mn.previousSibling;if(Xk(Mn))return wB(Mn)||Mn.insertData(0,_o),Mn;{const Wn=kB(Mn);return(Vn=Mn.parentNode)===null||Vn===void 0||Vn.insertBefore(Wn,Mn),Wn}},NP=Mn=>{var Vn,Wn;if(Xk(Mn.nextSibling))return wB(Mn.nextSibling)||Mn.nextSibling.insertData(0,_o),Mn.nextSibling;if(Xk(Mn))return CB(Mn)||Mn.appendData(_o),Mn;{const jn=kB(Mn);return Mn.nextSibling?(Vn=Mn.parentNode)===null||Vn===void 0||Vn.insertBefore(jn,Mn.nextSibling):(Wn=Mn.parentNode)===null||Wn===void 0||Wn.appendChild(jn),jn}},zw=(Mn,Vn)=>Mn?Zz(Vn):NP(Vn),qz=ws(zw,!0),jz=ws(zw,!1),NE=(Mn,Vn)=>Ir(Mn.container())?zw(Vn,Mn.container()):zw(Vn,Mn.getNode()),xB=(Mn,Vn)=>{const Wn=Vn.get();return Wn&&Mn.container()===Wn&&Jr(Wn)},pM=(Mn,Vn)=>Vn.fold(Wn=>{_f(Mn.get());const jn=qz(Wn);return Mn.set(jn),zo.some(lr(jn,jn.length-1))},Wn=>zm(Wn).map(jn=>{if(xB(jn,Mn)){const Gn=Mn.get();return lr(Gn,1)}else{_f(Mn.get());const Gn=NE(jn,!0);return Mn.set(Gn),lr(Gn,1)}}),Wn=>b1(Wn).map(jn=>{if(xB(jn,Mn)){const Gn=Mn.get();return lr(Gn,Gn.length-1)}else{_f(Mn.get());const Gn=NE(jn,!1);return Mn.set(Gn),lr(Gn,Gn.length-1)}}),Wn=>{_f(Mn.get());const jn=jz(Wn);return Mn.set(jn),zo.some(lr(jn,1))}),EB=(Mn,Vn)=>{for(let Wn=0;Wn{const Wn=Xr(Vn,Mn);return Wn||Mn},Xz=(Mn,Vn,Wn)=>{const jn=Dw(Wn),Gn=TB(Vn,jn.container());return n0(Mn,Gn,jn).fold(()=>Sm(Gn,jn).bind(ws(n0,Mn,Gn)).map(no=>Lp.before(no)),zo.none)},Yz=(Mn,Vn)=>cO(Mn,Vn)===null,AB=(Mn,Vn,Wn)=>n0(Mn,Vn,Wn).filter(ws(Yz,Vn)),Gz=(Mn,Vn,Wn)=>{const jn=Kx(Wn);return AB(Mn,Vn,jn).bind(Gn=>cp(Gn,jn).isNone()?zo.some(Lp.start(Gn)):zo.none())},Kz=(Mn,Vn,Wn)=>{const jn=Dw(Wn);return AB(Mn,Vn,jn).bind(Gn=>Sm(Gn,jn).isNone()?zo.some(Lp.end(Gn)):zo.none())},Jz=(Mn,Vn,Wn)=>{const jn=Kx(Wn),Gn=TB(Vn,jn.container());return n0(Mn,Gn,jn).fold(()=>cp(Gn,jn).bind(ws(n0,Mn,Gn)).map(no=>Lp.after(no)),zo.none)},eW=Mn=>!T5(LE(Mn)),Kh=(Mn,Vn,Wn)=>EB([Xz,Gz,Kz,Jz],[Mn,Vn,Wn]).filter(eW),LE=Mn=>Mn.fold(Qr,Qr,Qr,Qr),gM=Mn=>Mn.fold(xs("before"),xs("start"),xs("end"),xs("after")),IE=Mn=>Mn.fold(Lp.before,Lp.before,Lp.after,Lp.after),bM=Mn=>Mn.fold(Lp.start,Lp.start,Lp.end,Lp.end),PB=(Mn,Vn)=>gM(Mn)===gM(Vn)&&LE(Mn)===LE(Vn),tW=(Mn,Vn,Wn,jn,Gn,no)=>jc(n0(Vn,Wn,jn),n0(Vn,Wn,Gn),(ao,po)=>ao!==po&&o0(Wn,ao,po)?Lp.after(Mn?ao:po):no).getOr(no),$B=(Mn,Vn)=>Mn.fold(Qs,Wn=>!PB(Wn,Vn)),nW=(Mn,Vn,Wn,jn,Gn)=>{const no=mc(Mn,Gn);return vh(Mn,Wn,no).map(ws(mc,Mn)).fold(()=>jn.map(IE),vo=>Kh(Vn,Wn,vo).map(ws(tW,Mn,Vn,Wn,no,vo)).filter(ws($B,jn))).filter(eW)},oW=(Mn,Vn)=>Mn?Vn.fold(ko(zo.some,Lp.start),zo.none,ko(zo.some,Lp.after),zo.none):Vn.fold(zo.none,ko(zo.some,Lp.before),zo.none,ko(zo.some,Lp.end)),sW=(Mn,Vn,Wn,jn)=>{const Gn=mc(Mn,jn),no=Kh(Vn,Wn,Gn);return Kh(Vn,Wn,Gn).bind(ws(oW,Mn)).orThunk(()=>nW(Mn,Vn,Wn,no,jn))},Yk=Mn=>Yo(Mn.selection.getSel().modify),vM=(Mn,Vn,Wn)=>{const jn=Mn?1:-1;return Vn.setRng(lr(Wn.container(),Wn.offset()+jn).toRange()),Vn.getSel().modify("move",Mn?"forward":"backward","word"),!0},RB=(Mn,Vn)=>{const Wn=Vn.selection.getRng(),jn=Mn?lr.fromRangeEnd(Wn):lr.fromRangeStart(Wn);return Yk(Vn)?Mn&&Ac(jn)?vM(!0,Vn.selection,jn):!Mn&&gu(jn)?vM(!1,Vn.selection,jn):!1:!1};var av;(function(Mn){Mn[Mn.Br=0]="Br",Mn[Mn.Block=1]="Block",Mn[Mn.Wrap=2]="Wrap",Mn[Mn.Eol=3]="Eol"})(av||(av={}));const Gk=(Mn,Vn)=>Mn===Tu.Backwards?nc(Vn):Vn,rW=(Mn,Vn,Wn)=>Mn===Tu.Forwards?Vn.next(Wn):Vn.prev(Wn),iW=(Mn,Vn,Wn,jn)=>Ec(jn.getNode(Vn===Tu.Forwards))?av.Br:jr(Wn,jn)===!1?av.Block:av.Wrap,DB=(Mn,Vn,Wn,jn)=>{const Gn=ub(Wn);let no=jn;const ao=[];for(;no;){const po=rW(Vn,Gn,no);if(!po)break;if(Ec(po.getNode(!1)))return Vn===Tu.Forwards?{positions:Gk(Vn,ao).concat([po]),breakType:av.Br,breakAt:zo.some(po)}:{positions:Gk(Vn,ao),breakType:av.Br,breakAt:zo.some(po)};if(!po.isVisible()){no=po;continue}if(Mn(no,po)){const vo=iW(Wn,Vn,no,po);return{positions:Gk(Vn,ao),breakType:vo,breakAt:zo.some(po)}}ao.push(po),no=po}return{positions:Gk(Vn,ao),breakType:av.Eol,breakAt:zo.none()}},aW=(Mn,Vn,Wn,jn)=>Vn(Wn,jn).breakAt.map(Gn=>{const no=Vn(Wn,Gn).positions;return Mn===Tu.Backwards?no.concat(Gn):[Gn].concat(no)}).getOr([]),MB=(Mn,Vn)=>ra(Mn,(Wn,jn)=>Wn.fold(()=>zo.some(jn),Gn=>jc(qa(Gn.getClientRects()),qa(jn.getClientRects()),(no,ao)=>{const po=Math.abs(Vn-no.left);return Math.abs(Vn-ao.left)<=po?jn:Gn}).or(Wn)),zo.none()),yM=(Mn,Vn)=>qa(Vn.getClientRects()).bind(Wn=>MB(Mn,Wn.left)),Og=ws(DB,lr.isAbove,-1),BE=ws(DB,lr.isBelow,1),NB=ws(aW,-1,Og),j_=ws(aW,1,BE),OM=(Mn,Vn)=>Og(Mn,Vn).breakAt.isNone(),LB=(Mn,Vn)=>BE(Mn,Vn).breakAt.isNone(),LP=Mn=>zm(Mn).map(Vn=>[Vn].concat(BE(Mn,Vn).positions)).getOr([]),lW=Mn=>b1(Mn).map(Vn=>Og(Mn,Vn).positions.concat(Vn)).getOr([]),cW=(Mn,Vn)=>yM(NB(Mn,Vn),Vn),uW=(Mn,Vn)=>yM(j_(Mn,Vn),Vn),dW=jl,IB=(Mn,Vn)=>Math.abs(Mn.left-Vn),BB=(Mn,Vn)=>Math.abs(Mn.right-Vn),xO=Mn=>il(Mn,"node"),FB=(Mn,Vn)=>Ts(Mn,(Wn,jn)=>{const Gn=Math.min(IB(Wn,Vn),BB(Wn,Vn)),no=Math.min(IB(jn,Vn),BB(jn,Vn));return no===Gn&&xO(jn)&&dW(jn.node)||no{const Vn=Wn=>Us(Wn,jn=>{const Gn=B0(jn);return Gn.node=Mn,Gn});if(Oa(Mn))return Vn(Mn.getClientRects());if(Ir(Mn)){const Wn=Mn.ownerDocument.createRange();return Wn.setStart(Mn,0),Wn.setEnd(Mn,Mn.data.length),Vn(Wn.getClientRects())}else return[]},HB=Mn=>cc(Mn,fW);var FE;(function(Mn){Mn[Mn.Up=-1]="Up",Mn[Mn.Down=1]="Down"})(FE||(FE={}));const hW=(Mn,Vn,Wn,jn)=>{let Gn=jn;for(;Gn=qs(Gn,Mn,pm,Vn);)if(Wn(Gn))return},IP=(Mn,Vn,Wn,jn,Gn,no)=>{let ao=0;const po=[],vo=Qo=>{let qo=HB([Qo]);Mn===-1&&(qo=qo.reverse());for(let ds=0;ds0&&Vn(bs,ir(po))&&ao++,bs.line=ao,Gn(bs))return!0;po.push(bs)}}return!1},Ao=ir(no.getClientRects());if(!Ao)return po;const Fo=no.getNode();return Fo&&(vo(Fo),hW(Mn,jn,vo,Fo)),po},_M=(Mn,Vn)=>Vn.line>Mn,SM=(Mn,Vn)=>Vn.line===Mn,QB=ws(IP,FE.Up,Vb,zb),VB=ws(IP,FE.Down,zb,Vb),wM=Mn=>ir(Mn.getClientRects()),mW=(Mn,Vn,Wn,jn)=>{const Gn=ub(Vn);let no,ao,po,vo;const Ao=[];let Fo=0;Mn===1?(no=Gn.next,ao=zb,po=Vb,vo=lr.after(jn)):(no=Gn.prev,ao=Vb,po=zb,vo=lr.before(jn));const Qo=wM(vo);do{if(!vo.isVisible())continue;const qo=wM(vo);if(po(qo,Qo))continue;Ao.length>0&&ao(qo,ir(Ao))&&Fo++;const ds=B0(qo);if(ds.position=vo,ds.line=Fo,Wn(ds))return Ao;Ao.push(ds)}while(vo=no(vo));return Ao},Kk=Mn=>Vn=>_M(Mn,Vn),Jk=Mn=>Vn=>SM(Mn,Vn),Ey=(Mn,Vn)=>{Mn.selection.setRng(Vn),Ew(Mn,Mn.selection.getRng())},BP=(Mn,Vn,Wn)=>zo.some($P(Mn,Vn,Wn)),CM=(Mn,Vn,Wn,jn,Gn,no)=>{const ao=Vn===Tu.Forwards,po=ub(Mn.getBody()),vo=ws(Mf,ao?po.next:po.prev),Ao=ao?jn:Gn;if(!Wn.collapsed){const bs=jv(Wn);if(no(bs))return xy(Vn,Mn,bs,Vn===Tu.Backwards,!1);if(fM(Mn)){const ls=Wn.cloneRange();return ls.collapse(Vn===Tu.Backwards),zo.from(ls)}}const Fo=nh(Vn,Mn.getBody(),Wn);if(Ao(Fo))return jk(Mn,Fo.getNode(!ao));let Qo=vo(Fo);const qo=B1(Wn);if(Qo)Qo=mc(ao,Qo);else return qo?zo.some(Wn):zo.none();if(Ao(Qo))return xy(Vn,Mn,Qo.getNode(!ao),ao,!1);const ds=vo(Qo);return ds&&Ao(ds)&&Dp(Qo,ds)?xy(Vn,Mn,ds.getNode(!ao),ao,!1):qo?BP(Mn,Qo.toRange(),!1):zo.none()},kM=(Mn,Vn,Wn,jn,Gn,no)=>{const ao=nh(Vn,Mn.getBody(),Wn),po=ir(ao.getClientRects()),vo=Vn===FE.Down,Ao=Mn.getBody();if(!po)return zo.none();if(fM(Mn)){const ys=vo?lr.fromRangeEnd(Wn):lr.fromRangeStart(Wn);return(vo?uW:cW)(Ao,ys).orThunk(()=>zo.from(ys)).map(zs=>zs.toRange())}const Qo=(vo?VB:QB)(Ao,Kk(1),ao),qo=nr(Qo,Jk(1)),ds=po.left,bs=FB(qo,ds);if(bs&&no(bs.node)){const ys=Math.abs(ds-bs.left),Ls=Math.abs(ds-bs.right);return xy(Vn,Mn,bs.node,ys$P(Mn,ys.toRange(),!1)):zo.none()},e2=(Mn,Vn)=>{const Wn=Mn.selection.getRng(),jn=Vn?lr.fromRangeEnd(Wn):lr.fromRangeStart(Wn),Gn=mr(jn.container(),Mn.getBody());if(Vn){const no=BE(Gn,jn);return Ya(no.positions)}else{const no=Og(Gn,jn);return qa(no.positions)}},FP=(Mn,Vn,Wn)=>e2(Mn,Vn).filter(Wn).exists(jn=>(Mn.selection.setRng(jn.toRange()),!0)),X_=(Mn,Vn)=>{const Wn=Mn.dom.createRng();Wn.setStart(Vn.container(),Vn.offset()),Wn.setEnd(Vn.container(),Vn.offset()),Mn.selection.setRng(Wn)},zB=(Mn,Vn)=>{Mn?Vn.setAttribute("data-mce-selected","inline-boundary"):Vn.removeAttribute("data-mce-selected")},xM=(Mn,Vn,Wn)=>pM(Vn,Wn).map(jn=>(X_(Mn,jn),Wn)),pW=(Mn,Vn,Wn)=>{const jn=lr.fromRangeStart(Mn);if(Mn.collapsed)return jn;{const Gn=lr.fromRangeEnd(Mn);return Wn?cp(Vn,Gn).getOr(Gn):Sm(Vn,jn).getOr(jn)}},gW=(Mn,Vn,Wn)=>{const jn=Mn.getBody(),Gn=pW(Mn.selection.getRng(),jn,Wn),no=ws(Rw,Mn);return sW(Wn,no,jn,Gn).bind(po=>xM(Mn,Vn,po))},WB=(Mn,Vn,Wn)=>{const jn=Us(mf(Cs.fromDom(Vn.getRoot()),'*[data-mce-selected="inline-boundary"]'),ao=>ao.dom),Gn=nr(jn,Mn),no=nr(Wn,Mn);fs(Ed(Gn,no),ws(zB,!1)),fs(Ed(no,Gn),ws(zB,!0))},bW=(Mn,Vn)=>{const Wn=Vn.get();if(Mn.selection.isCollapsed()&&!Mn.composing&&Wn){const jn=lr.fromRangeStart(Mn.selection.getRng());lr.isTextPosition(jn)&&!E9(jn)&&(X_(Mn,jC(Wn,jn)),Vn.set(null))}},UB=(Mn,Vn,Wn,jn)=>{if(Vn.selection.isCollapsed()){const Gn=nr(jn,Mn);fs(Gn,no=>{const ao=lr.fromRangeStart(Vn.selection.getRng());Kh(Mn,Vn.getBody(),ao).bind(po=>xM(Vn,Wn,po))})}},vW=(Mn,Vn,Wn)=>z0(Mn)?gW(Mn,Vn,Wn).isSome():!1,ZB=(Mn,Vn,Wn)=>z0(Vn)?RB(Mn,Vn):!1,yW=Mn=>{const Vn=od(null),Wn=ws(Rw,Mn);return Mn.on("NodeChange",jn=>{z0(Mn)&&(WB(Wn,Mn.dom,jn.parents),bW(Mn,Vn),UB(Wn,Mn,Vn,jn.parents))}),Vn},OW=ws(ZB,!0),_W=ws(ZB,!1),HP=(Mn,Vn,Wn)=>{if(z0(Mn)){const jn=e2(Mn,Vn).getOrThunk(()=>{const Gn=Mn.selection.getRng();return Vn?lr.fromRangeEnd(Gn):lr.fromRangeStart(Gn)});return Kh(ws(Rw,Mn),Mn.getBody(),jn).exists(Gn=>{const no=IE(Gn);return pM(Wn,no).exists(ao=>(X_(Mn,ao),!0))})}else return!1},SW=(Mn,Vn)=>{const Wn=document.createRange();return Wn.setStart(Mn.container(),Mn.offset()),Wn.setEnd(Vn.container(),Vn.offset()),Wn},wW=Mn=>jc(zm(Mn),b1(Mn),(Vn,Wn)=>{const jn=mc(!0,Vn),Gn=mc(!1,Wn);return Sm(Mn,jn).forall(no=>no.isEqual(Gn))}).getOr(!0),qB=(Mn,Vn)=>Wn=>pM(Vn,Wn).map(jn=>()=>X_(Mn,jn)),EM=(Mn,Vn,Wn,jn)=>{const Gn=Mn.getBody(),no=ws(Rw,Mn);Mn.undoManager.ignore(()=>{Mn.selection.setRng(SW(Wn,jn)),Jx(Mn),Kh(no,Gn,lr.fromRangeStart(Mn.selection.getRng())).map(bM).bind(qB(Mn,Vn)).each(ha)}),Mn.nodeChanged()},CW=(Mn,Vn)=>{const Wn=Xr(Vn,Mn);return Wn||Mn},Ww=(Mn,Vn,Wn,jn)=>{const Gn=CW(Mn.getBody(),jn.container()),no=ws(Rw,Mn),ao=Kh(no,Gn,jn);return ao.bind(vo=>Wn?vo.fold(xs(zo.some(bM(vo))),zo.none,xs(zo.some(IE(vo))),zo.none):vo.fold(zo.none,xs(zo.some(IE(vo))),zo.none,xs(zo.some(bM(vo))))).map(qB(Mn,Vn)).getOrThunk(()=>{const vo=Z0(Wn,Gn,jn),Ao=vo.bind(Fo=>Kh(no,Gn,Fo));return jc(ao,Ao,()=>n0(no,Gn,jn).bind(Fo=>wW(Fo)?zo.some(()=>{yO(Mn,Wn,Cs.fromDom(Fo))}):zo.none())).getOrThunk(()=>Ao.bind(()=>vo.map(Fo=>()=>{Wn?EM(Mn,Vn,jn,Fo):EM(Mn,Vn,Fo,jn)})))})},QP=(Mn,Vn,Wn)=>{if(Mn.selection.isCollapsed()&&z0(Mn)){const jn=lr.fromRangeStart(Mn.selection.getRng());return Ww(Mn,Vn,Wn,jn)}return zo.none()},TM=Mn=>Af(Mn)>1,AM=(Mn,Vn)=>{const Wn=Cs.fromDom(Mn.getBody()),jn=Cs.fromDom(Mn.selection.getStart()),Gn=py(jn,Wn);return Nl(Gn,Vn).fold(xs(Gn),no=>Gn.slice(0,no))},PM=Mn=>Af(Mn)===1,Y_=Mn=>AM(Mn,Vn=>Mn.schema.isBlock(ql(Vn))||TM(Vn)),jB=Mn=>AM(Mn,Vn=>Mn.schema.isBlock(ql(Vn))),k1=(Mn,Vn)=>{const Wn=ws(vy,Mn);return cc(Vn,jn=>Wn(jn)?[jn.dom]:[])},G_=Mn=>{const Vn=jB(Mn);return k1(Mn,Vn)},$M=(Mn,Vn,Wn,jn)=>{const Gn=k1(Vn,jn);if(Gn.length===0)yO(Vn,Mn,Wn);else{const no=pL(Wn.dom,Gn);Vn.selection.setRng(no.toRange())}},kW=(Mn,Vn)=>{const Wn=nr(Y_(Mn),PM);return Ya(Wn).bind(jn=>{const Gn=lr.fromRangeStart(Mn.selection.getRng());return EA(Vn,Gn,jn.dom)&&!gw(jn)?zo.some(()=>$M(Vn,Mn,jn,Wn)):zo.none()})},XB=(Mn,Vn)=>{const Wn=Vn.parentElement;return Ec(Vn)&&!Mo(Wn)&&Mn.dom.isEmpty(Wn)},xW=Mn=>gw(Cs.fromDom(Mn)),YB=(Mn,Vn)=>{const Wn=Mn.selection.getStart(),jn=XB(Mn,Wn)||xW(Wn)?pL(Wn,Vn):ZA(Mn.selection.getRng(),Vn);Mn.selection.setRng(jn.toRange())},EW=(Mn,Vn)=>{const Wn=Ed(Vn,G_(Mn));Wn.length>0&&YB(Mn,Wn)},GB=Mn=>Ir(Mn.startContainer),TW=Mn=>Mn.startOffset===0&&GB(Mn),KB=(Mn,Vn)=>{const Wn=Vn.startContainer.parentElement;return!Mo(Wn)&&vy(Mn,Cs.fromDom(Wn))},AW=Mn=>{const Vn=Mn.startContainer.parentNode,Wn=Mn.endContainer.parentNode;return!Mo(Vn)&&!Mo(Wn)&&Vn.isEqualNode(Wn)},PW=Mn=>{const Vn=Mn.endContainer;return Mn.endOffset===(Ir(Vn)?Vn.length:Vn.childNodes.length)},t2=Mn=>AW(Mn)&&PW(Mn),RM=Mn=>!Mn.endContainer.isEqualNode(Mn.commonAncestorContainer),JB=Mn=>t2(Mn)||RM(Mn),eF=Mn=>{const Vn=Mn.selection.getRng();return TW(Vn)&&KB(Mn,Vn)&&JB(Vn)},DM=Mn=>{if(eF(Mn)){const Vn=G_(Mn);return zo.some(()=>{Jx(Mn),EW(Mn,Vn)})}else return zo.none()},MM=(Mn,Vn)=>Mn.selection.isCollapsed()?kW(Mn,Vn):DM(Mn),$W=(Mn,Vn)=>P9(Mn,Wn=>fg(Wn.dom),Wn=>Vn.isBlock(ql(Wn))),RW=Mn=>$W(Cs.fromDom(Mn.selection.getStart()),Mn.schema),DW=Mn=>{const Vn=Mn.selection.getRng();return Vn.collapsed&&(GB(Vn)||Mn.dom.isEmpty(Vn.startContainer))&&!RW(Mn)},HE=Mn=>(DW(Mn)&&YB(Mn,[]),!0),NM=(Mn,Vn,Wn)=>is(Wn)?zo.some(()=>{Mn._selectionOverrides.hideFakeCaret(),yO(Mn,Vn,Cs.fromDom(Wn))}):zo.none(),MW=(Mn,Vn)=>{const Wn=Vn?jx:wk,jn=Vn?Tu.Forwards:Tu.Backwards,Gn=nh(jn,Mn.getBody(),Mn.selection.getRng());return Wn(Gn)?NM(Mn,Vn,Gn.getNode(!Vn)):zo.from(mc(Vn,Gn)).filter(no=>Wn(no)&&Dp(Gn,no)).bind(no=>NM(Mn,Vn,no.getNode(!Vn)))},tF=(Mn,Vn)=>{const Wn=Mn.selection.getNode();return pu(Wn)?NM(Mn,Vn,Wn):zo.none()},LM=(Mn,Vn)=>Mn.selection.isCollapsed()?MW(Mn,Vn):tF(Mn,Vn),NW=Mn=>cf(Mn,Vn=>Gf(Vn.dom)||jl(Vn.dom)).exists(Vn=>Gf(Vn.dom)),_g=Mn=>Em(Mn??"").getOr(0),nF=(Mn,Vn)=>{const Wn=Mn||hh(Vn)?"margin":"padding",jn=Ju(Vn,"direction")==="rtl"?"-right":"-left";return Wn+jn},IM=(Mn,Vn,Wn,jn,Gn,no)=>{const ao=nF(Wn,Cs.fromDom(no)),po=_g(Mn.getStyle(no,ao));if(Vn==="outdent"){const vo=Math.max(0,po-jn);Mn.setStyle(no,ao,vo?vo+Gn:"")}else{const vo=po+jn+Gn;Mn.setStyle(no,ao,vo)}},oF=(Mn,Vn)=>gc(Vn,Wn=>{const jn=nF(a_(Mn),Wn),Gn=fd(Wn,jn).map(_g).getOr(0);return Mn.dom.getContentEditable(Wn.dom)!=="false"&&Gn>0}),VP=Mn=>{const Vn=rF(Mn);return!Mn.mode.isReadOnly()&&(Vn.length>1||oF(Mn,Vn))},sF=Mn=>xh(Mn)||Lm(Mn),LW=Mn=>Wc(Mn).exists(sF),rF=Mn=>nr(Km(Mn.selection.getSelectedBlocks()),Vn=>!sF(Vn)&&!LW(Vn)&&NW(Vn)),iF=(Mn,Vn)=>{var Wn,jn;const{dom:Gn}=Mn,no=th(Mn),ao=(jn=(Wn=/[a-z%]+$/i.exec(no))===null||Wn===void 0?void 0:Wn[0])!==null&&jn!==void 0?jn:"px",po=_g(no),vo=a_(Mn);fs(rF(Mn),Ao=>{IM(Gn,Vn,vo,po,ao,Ao.dom)})},IW=Mn=>iF(Mn,"indent"),BM=Mn=>iF(Mn,"outdent"),aF=Mn=>{if(Mn.selection.isCollapsed()&&VP(Mn)){const Vn=Mn.dom,Wn=Mn.selection.getRng(),jn=lr.fromRangeStart(Wn),Gn=Vn.getParent(Wn.startContainer,Vn.isBlock);if(Gn!==null&&rR(Cs.fromDom(Gn),jn,Mn.schema))return zo.some(()=>BM(Mn))}return zo.none()},lF=(Mn,Vn,Wn)=>Yl([aF,ME,dM,(jn,Gn)=>QP(jn,Vn,Gn),cM,lE,mM,LM,PP,MM],jn=>jn(Mn,Wn)).filter(jn=>Mn.selection.isEditable()),QE=(Mn,Vn)=>{lF(Mn,Vn,!1).fold(()=>{Mn.selection.isEditable()&&(Jx(Mn),xA(Mn))},ha)},EO=(Mn,Vn)=>{lF(Mn,Vn,!0).fold(()=>{Mn.selection.isEditable()&&T9(Mn)},ha)},Uw=(Mn,Vn)=>{Mn.addCommand("delete",()=>{QE(Mn,Vn)}),Mn.addCommand("forwardDelete",()=>{EO(Mn,Vn)})},VE=5,FM=400,zP=Mn=>Mn.touches===void 0||Mn.touches.length!==1?zo.none():zo.some(Mn.touches[0]),cF=(Mn,Vn)=>{const Wn=Math.abs(Mn.clientX-Vn.x),jn=Math.abs(Mn.clientY-Vn.y);return Wn>VE||jn>VE},BW=Mn=>{const Vn=Fb(),Wn=od(!1),jn=jO(Gn=>{Mn.dispatch("longpress",{...Gn,type:"longpress"}),Wn.set(!0)},FM);Mn.on("touchstart",Gn=>{zP(Gn).each(no=>{jn.cancel();const ao={x:no.clientX,y:no.clientY,target:Gn.target};jn.throttle(Gn),Wn.set(!1),Vn.set(ao)})},!0),Mn.on("touchmove",Gn=>{jn.cancel(),zP(Gn).each(no=>{Vn.on(ao=>{cF(no,ao)&&(Vn.clear(),Wn.set(!1),Mn.dispatch("longpresscancel"))})})},!0),Mn.on("touchend touchcancel",Gn=>{jn.cancel(),Gn.type!=="touchcancel"&&Vn.get().filter(no=>no.target.isEqualNode(Gn.target)).each(()=>{Wn.get()?Gn.preventDefault():Mn.dispatch("tap",{...Gn,type:"tap"})})},!0)},WP=(Mn,Vn)=>Mr(Mn,Vn.nodeName),uF=(Mn,Vn)=>Ir(Vn)?!0:Oa(Vn)?!WP(Mn.getBlockElements(),Vn)&&!hg(Vn)&&!Wl(Mn,Vn)&&!DO(Vn):!1,FW=(Mn,Vn,Wn)=>Sr(oR(Cs.fromDom(Wn),Cs.fromDom(Vn)),jn=>WP(Mn,jn.dom)),HW=(Mn,Vn)=>{if(Ir(Vn)){if(Vn.data.length===0)return!0;if(/^\s+$/.test(Vn.data))return!Vn.nextSibling||WP(Mn,Vn.nextSibling)||DO(Vn.nextSibling)}return!1},dF=Mn=>Mn.dom.create(bh(Mn),Zb(Mn)),QW=Mn=>{const Vn=Mn.dom,Wn=Mn.selection,jn=Mn.schema,Gn=jn.getBlockElements(),no=Wn.getStart(),ao=Mn.getBody();let po,vo,Ao=!1;const Fo=bh(Mn);if(!no||!Oa(no))return;const Qo=ao.nodeName.toLowerCase();if(!jn.isValidChild(Qo,Fo.toLowerCase())||FW(Gn,ao,no))return;const qo=Wn.getRng(),{startContainer:ds,startOffset:bs,endContainer:ls,endOffset:ys}=qo,Ls=L_(Mn);let zs=ao.firstChild;for(;zs;)if(Oa(zs)&&j1(jn,zs),uF(jn,zs)){if(HW(Gn,zs)){vo=zs,zs=zs.nextSibling,Vn.remove(vo);continue}po||(po=dF(Mn),ao.insertBefore(po,zs),Ao=!0),vo=zs,zs=zs.nextSibling,po.appendChild(vo)}else po=null,zs=zs.nextSibling;Ao&&Ls&&(qo.setStart(ds,bs),qo.setEnd(ls,ys),Wn.setRng(qo),Mn.nodeChanged())},fF=(Mn,Vn,Wn)=>{const jn=Cs.fromDom(dF(Mn)),Gn=Th();Fu(jn,Gn),Wn(Vn,jn);const no=document.createRange();return no.setStartBefore(Gn.dom),no.setEndBefore(Gn.dom),no},VW=Mn=>{Mn.on("NodeChange",ws(QW,Mn))},HM=Mn=>Vn=>(" "+Vn.attr("class")+" ").indexOf(Mn)!==-1,hF=(Mn,Vn,Wn)=>function(jn){const Gn=arguments,no=Gn[Gn.length-2],ao=no>0?Vn.charAt(no-1):"";if(ao==='"')return jn;if(ao===">"){const po=Vn.lastIndexOf("<",no);if(po!==-1&&Vn.substring(po,no).indexOf('contenteditable="false"')!==-1)return jn}return''+Mn.dom.encode(typeof Gn[1]=="string"?Gn[1]:Gn[0])+""},sG=(Mn,Vn,Wn)=>{let jn=Vn.length,Gn=Wn.content;if(Wn.format!=="raw"){for(;jn--;)Gn=Gn.replace(Vn[jn],hF(Mn,Gn,rO(Mn)));Wn.content=Gn}},rG=(Mn,Vn)=>gc(Mn,Wn=>{const jn=Vn.match(Wn);return jn!==null&&jn[0].length===Vn.length}),iG=Mn=>{const Vn="contenteditable",Wn=" "+Lr.trim(WC(Mn))+" ",jn=" "+Lr.trim(rO(Mn))+" ",Gn=HM(Wn),no=HM(jn),ao=dx(Mn);ao.length>0&&Mn.on("BeforeSetContent",po=>{sG(Mn,ao,po)}),Mn.parser.addAttributeFilter("class",po=>{let vo=po.length;for(;vo--;){const Ao=po[vo];Gn(Ao)?Ao.attr(Vn,"true"):no(Ao)&&Ao.attr(Vn,"false")}}),Mn.serializer.addAttributeFilter(Vn,po=>{let vo=po.length;for(;vo--;){const Ao=po[vo];if(!Gn(Ao)&&!no(Ao))continue;const Fo=Ao.attr("data-mce-content");ao.length>0&&Fo?rG(ao,Fo)?(Ao.name="#text",Ao.type=3,Ao.raw=!0,Ao.value=Fo):Ao.remove():Ao.attr(Vn,null)}})},zW=Mn=>uf(Cs.fromDom(Mn.getBody()),"*[data-mce-caret]").map(Vn=>Vn.dom).getOrNull(),WW=(Mn,Vn)=>{Vn.hasAttribute("data-mce-caret")&&(wp(Vn),Mn.selection.setRng(Mn.selection.getRng()),Mn.selection.scrollIntoView(Vn))},aG=(Mn,Vn)=>{const Wn=zW(Mn);if(Wn){if(Vn.type==="compositionstart"){Vn.preventDefault(),Vn.stopPropagation(),WW(Mn,Wn);return}Ol(Wn)&&(WW(Mn,Wn),Mn.undoManager.add())}},UW=Mn=>{Mn.on("keyup compositionstart",ws(aG,Mn))},mF=jl,lG=(Mn,Vn,Wn)=>CM(Vn,Mn,Wn,bO,tv,mF),ZW=(Mn,Vn,Wn)=>kM(Vn,Mn,Wn,no=>bO(no)||u5(no),no=>tv(no)||Ql(no),mF),jg=Mn=>{const Vn=Mn.dom.create(bh(Mn));return Vn.innerHTML='
    ',Vn},QM=(Mn,Vn,Wn)=>{const jn=ub(Mn.getBody()),Gn=ws(Mf,Vn===1?jn.next:jn.prev);if(Wn.collapsed){const no=Mn.dom.getParent(Wn.startContainer,"PRE");if(!no)return;if(!Gn(lr.fromRangeStart(Wn))){const po=Cs.fromDom(jg(Mn));Vn===1?fh(Cs.fromDom(no),po):ed(Cs.fromDom(no),po),Mn.selection.select(po.dom,!0),Mn.selection.collapse()}}},zE=(Mn,Vn)=>{const Wn=Vn?Tu.Forwards:Tu.Backwards,jn=Mn.selection.getRng();return lG(Wn,Mn,jn).orThunk(()=>(QM(Mn,Wn,jn),zo.none()))},qW=(Mn,Vn)=>{const Wn=Vn?1:-1,jn=Mn.selection.getRng();return ZW(Wn,Mn,jn).orThunk(()=>(QM(Mn,Wn,jn),zo.none()))},pF=(Mn,Vn)=>{const Wn=Vn?Mn.getEnd(!0):Mn.getStart(!0);return T5(Wn)?!Vn:Vn},VM=(Mn,Vn)=>zE(Mn,pF(Mn.selection,Vn)).exists(Wn=>(Ey(Mn,Wn),!0)),UP=(Mn,Vn)=>qW(Mn,Vn).exists(Wn=>(Ey(Mn,Wn),!0)),gF=(Mn,Vn)=>FP(Mn,Vn,Vn?tv:bO),ZP=(Mn,Vn)=>DP(Mn,!Vn).map(Wn=>{const jn=Wn.toRange(),Gn=Mn.selection.getRng();return Vn?jn.setStart(Gn.startContainer,Gn.startOffset):jn.setEnd(Gn.endContainer,Gn.endOffset),jn}).exists(Wn=>(Ey(Mn,Wn),!0)),bF=Mn=>Zs(["figcaption"],ql(Mn)),jW=(Mn,Vn,Wn)=>{const jn=ws(Vs,Vn);return cf(Cs.fromDom(Mn.container()),Gn=>Wn.isBlock(ql(Gn)),jn).filter(bF)},XW=(Mn,Vn,Wn)=>Vn?LB(Mn.dom,Wn):OM(Mn.dom,Wn),YW=(Mn,Vn)=>{const Wn=Cs.fromDom(Mn.getBody()),jn=lr.fromRangeStart(Mn.selection.getRng());return jW(jn,Wn,Mn.schema).exists(()=>{if(XW(Wn,Vn,jn)){const no=fF(Mn,Wn,Vn?Fu:Gm);return Mn.selection.setRng(no),!0}else return!1})},qP=(Mn,Vn)=>Mn.selection.isCollapsed()?YW(Mn,Vn):!1,GW=(Mn,Vn,Wn)=>{const jn=Mn.selection.getRng(),Gn=lr.fromRangeStart(jn);return Mn.getBody().firstChild===Vn&&OM(Wn,Gn)?(Mn.execCommand("InsertNewBlockBefore"),!0):!1},KW=(Mn,Vn)=>{const Wn=Mn.selection.getRng(),jn=lr.fromRangeStart(Wn);return Mn.getBody().lastChild===Vn&&LB(Vn,jn)?(Mn.execCommand("InsertNewBlockAfter"),!0):!1},cG=(Mn,Vn)=>Vn?zo.from(Mn.dom.getParent(Mn.selection.getNode(),"details")).map(Wn=>KW(Mn,Wn)).getOr(!1):zo.from(Mn.dom.getParent(Mn.selection.getNode(),"summary")).bind(Wn=>zo.from(Mn.dom.getParent(Wn,"details")).map(jn=>GW(Mn,jn,Wn))).getOr(!1),vF=(Mn,Vn)=>cG(Mn,Vn),zM={shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0},uG=Mn=>Us(Mn,Vn=>({...zM,...Vn})),JW=Mn=>Us(Mn,Vn=>({...zM,...Vn})),yF=(Mn,Vn)=>Vn.keyCode===Mn.keyCode&&Vn.shiftKey===Mn.shiftKey&&Vn.altKey===Mn.altKey&&Vn.ctrlKey===Mn.ctrlKey&&Vn.metaKey===Mn.metaKey,eU=(Mn,Vn)=>cc(uG(Mn),Wn=>yF(Wn,Vn)?[Wn]:[]),WM=(Mn,Vn)=>cc(JW(Mn),Wn=>yF(Wn,Vn)?[Wn]:[]),cl=(Mn,...Vn)=>()=>Mn.apply(null,Vn),n2=(Mn,Vn)=>xa(eU(Mn,Vn),Wn=>Wn.action()),UM=(Mn,Vn)=>Yl(WM(Mn,Vn),Wn=>Wn.action()),OF=(Mn,Vn)=>{const Wn=Vn?Tu.Forwards:Tu.Backwards,jn=Mn.selection.getRng();return CM(Mn,Wn,jn,jx,wk,pu).exists(Gn=>(Ey(Mn,Gn),!0))},_F=(Mn,Vn)=>{const Wn=Vn?1:-1,jn=Mn.selection.getRng();return kM(Mn,Wn,jn,jx,wk,pu).exists(Gn=>(Ey(Mn,Gn),!0))},jP=(Mn,Vn)=>FP(Mn,Vn,Vn?wk:jx),SF=Qg.generate([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),WE={...SF,none:Mn=>SF.none(Mn)},tU=(Mn,Vn)=>Ob(Mn,Vn,Qs),Ob=(Mn,Vn,Wn)=>cc(Ku(Mn),jn=>zh(jn,Vn)?Wn(jn)?[jn]:[]:Ob(jn,Vn,Wn)),wF=(Mn,Vn,Wn=hs)=>{if(Wn(Vn))return zo.none();if(Zs(Mn,ql(Vn)))return zo.some(Vn);const jn=Gn=>zh(Gn,"table")||Wn(Gn);return lm(Vn,Mn.join(","),jn)},CF=(Mn,Vn)=>wF(["td","th"],Mn,Vn),fG=Mn=>tU(Mn,"th,td"),nU=(Mn,Vn)=>cm(Mn,"table",Vn),kF=(Mn,Vn,Wn,jn,Gn=Qs)=>{const no=jn===1;if(!no&&Wn<=0)return WE.first(Mn[0]);if(no&&Wn>=Mn.length-1)return WE.last(Mn[Mn.length-1]);{const ao=Wn+jn,po=Mn[ao];return Gn(po)?WE.middle(Vn,po):kF(Mn,Vn,ao,jn,Gn)}},oU=(Mn,Vn)=>nU(Mn,Vn).bind(Wn=>{const jn=fG(Wn);return Nl(jn,no=>Vs(Mn,no)).map(no=>({index:no,all:jn}))}),sU=(Mn,Vn,Wn)=>oU(Mn,Wn).fold(()=>WE.none(Mn),Gn=>kF(Gn.all,Mn,Gn.index,1,Vn)),XP=(Mn,Vn,Wn)=>oU(Mn,Wn).fold(()=>WE.none(),Gn=>kF(Gn.all,Mn,Gn.index,-1,Vn)),rU=(Mn,Vn)=>({left:Mn.left-Vn,top:Mn.top-Vn,right:Mn.right+Vn*2,bottom:Mn.bottom+Vn*2,width:Mn.width+Vn,height:Mn.height+Vn}),ZM=(Mn,Vn)=>cc(Vn,Wn=>{const jn=rU(B0(Wn.getBoundingClientRect()),-1);return[{x:jn.left,y:Mn(jn),cell:Wn},{x:jn.right,y:Mn(jn),cell:Wn}]}),xF=(Mn,Vn,Wn)=>ra(Mn,(jn,Gn)=>jn.fold(()=>zo.some(Gn),no=>{const ao=Math.sqrt(Math.abs(no.x-Vn)+Math.abs(no.y-Wn)),po=Math.sqrt(Math.abs(Gn.x-Vn)+Math.abs(Gn.y-Wn));return zo.some(po{const no=mf(Cs.fromDom(Wn),"td,th,caption").map(po=>po.dom),ao=nr(ZM(Mn,no),po=>Vn(po,Gn));return xF(ao,jn,Gn).map(po=>po.cell)},EF=Mn=>Mn.bottom,iU=Mn=>Mn.top,aU=(Mn,Vn)=>Mn.yMn.y>Vn,cU=ws(qM,EF,aU),YP=ws(qM,iU,lU),uU=(Mn,Vn)=>qa(Vn.getClientRects()).bind(Wn=>cU(Mn,Wn.left,Wn.top)).bind(Wn=>yM(lW(Wn),Vn)),dU=(Mn,Vn)=>Ya(Vn.getClientRects()).bind(Wn=>YP(Mn,Wn.left,Wn.top)).bind(Wn=>yM(LP(Wn),Vn)),fU=(Mn,Vn,Wn)=>Wn.breakAt.exists(jn=>Mn(Vn,jn).breakAt.isSome()),jM=Mn=>Mn.breakType===av.Wrap&&Mn.positions.length===0,hU=Mn=>Mn.breakType===av.Br&&Mn.positions.length===1,TF=(Mn,Vn,Wn)=>{const jn=Mn(Vn,Wn);return jM(jn)||!Ec(Wn.getNode())&&hU(jn)?!fU(Mn,Vn,jn):jn.breakAt.isNone()},AF=ws(TF,Og),mU=ws(TF,BE),pU=(Mn,Vn,Wn)=>{const jn=lr.fromRangeStart(Vn);return w_(!Mn,Wn).exists(Gn=>Gn.isEqual(jn))},gU=(Mn,Vn,Wn,jn)=>{const Gn=Mn.selection.getRng(),no=Vn?1:-1;return aO()&&pU(Vn,Gn,Wn)?(xy(no,Mn,Wn,!Vn,!1).each(ao=>{Ey(Mn,ao)}),!0):!1},bU=(Mn,Vn,Wn)=>uU(Vn,Wn).orThunk(()=>qa(Wn.getClientRects()).bind(jn=>MB(NB(Mn,lr.before(Vn)),jn.left))).getOr(lr.before(Vn)),vU=(Mn,Vn,Wn)=>dU(Vn,Wn).orThunk(()=>qa(Wn.getClientRects()).bind(jn=>MB(j_(Mn,lr.after(Vn)),jn.left))).getOr(lr.after(Vn)),PF=(Mn,Vn)=>{const Wn=Vn.getNode(Mn);return Gp(Wn)?zo.some(Wn):zo.none()},XM=(Mn,Vn,Wn)=>{Vn.undoManager.transact(()=>{const jn=Mn?fh:ed,Gn=fF(Vn,Cs.fromDom(Wn),jn);Ey(Vn,Gn)})},$F=(Mn,Vn,Wn)=>{const jn=PF(!!Vn,Wn),Gn=Vn===!1;jn.fold(()=>Ey(Mn,Wn.toRange()),no=>w_(Gn,Mn.getBody()).filter(ao=>ao.isEqual(Wn)).fold(()=>Ey(Mn,Wn.toRange()),ao=>XM(Vn,Mn,no)))},RF=(Mn,Vn,Wn,jn)=>{const Gn=Mn.selection.getRng(),no=lr.fromRangeStart(Gn),ao=Mn.getBody();if(!Vn&&AF(jn,no)){const po=bU(ao,Wn,no);return $F(Mn,Vn,po),!0}else if(Vn&&mU(jn,no)){const po=vU(ao,Wn,no);return $F(Mn,Vn,po),!0}else return!1},DF=(Mn,Vn,Wn)=>zo.from(Mn.dom.getParent(Mn.selection.getNode(),"td,th")).bind(jn=>zo.from(Mn.dom.getParent(jn,"table")).map(Gn=>Wn(Mn,Vn,Gn,jn))).getOr(!1),MF=(Mn,Vn)=>DF(Mn,Vn,gU),YM=(Mn,Vn)=>DF(Mn,Vn,RF),yU=Mn=>{const Vn=J0.exact(Mn,0,Mn,0);return W3(Vn)},NF=(Mn,Vn,Wn)=>Wn.fold(zo.none,zo.none,(jn,Gn)=>LH(Gn).map(no=>yU(no)),jn=>(Mn.execCommand("mceTableInsertRowAfter"),LF(Mn,Vn,jn))),LF=(Mn,Vn,Wn)=>NF(Mn,Vn,sU(Wn,yl)),sh=(Mn,Vn,Wn)=>NF(Mn,Vn,XP(Wn,yl)),IF=(Mn,Vn)=>{const Wn=["table","li","dl"],jn=Cs.fromDom(Mn.getBody()),Gn=po=>{const vo=ql(po);return Vs(po,jn)||Zs(Wn,vo)},no=Mn.selection.getRng(),ao=Cs.fromDom(Vn?no.endContainer:no.startContainer);return CF(ao,Gn).map(po=>(nU(po,Gn).each(Fo=>{Mn.model.table.clearSelectedCells(Fo.dom)}),Mn.selection.collapse(!Vn),(Vn?LF:sh)(Mn,Gn,po).each(Fo=>{Mn.selection.setRng(Fo)}),!0)).getOr(!1)},OU=(Mn,Vn,Wn)=>{const jn=aa.os.isMacOS()||aa.os.isiOS();n2([{keyCode:va.RIGHT,action:cl(VM,Mn,!0)},{keyCode:va.LEFT,action:cl(VM,Mn,!1)},{keyCode:va.UP,action:cl(UP,Mn,!1)},{keyCode:va.DOWN,action:cl(UP,Mn,!0)},...jn?[{keyCode:va.UP,action:cl(ZP,Mn,!1),metaKey:!0,shiftKey:!0},{keyCode:va.DOWN,action:cl(ZP,Mn,!0),metaKey:!0,shiftKey:!0}]:[],{keyCode:va.RIGHT,action:cl(MF,Mn,!0)},{keyCode:va.LEFT,action:cl(MF,Mn,!1)},{keyCode:va.UP,action:cl(YM,Mn,!1)},{keyCode:va.DOWN,action:cl(YM,Mn,!0)},{keyCode:va.UP,action:cl(YM,Mn,!1)},{keyCode:va.UP,action:cl(vF,Mn,!1)},{keyCode:va.DOWN,action:cl(vF,Mn,!0)},{keyCode:va.RIGHT,action:cl(OF,Mn,!0)},{keyCode:va.LEFT,action:cl(OF,Mn,!1)},{keyCode:va.UP,action:cl(_F,Mn,!1)},{keyCode:va.DOWN,action:cl(_F,Mn,!0)},{keyCode:va.RIGHT,action:cl(vW,Mn,Vn,!0)},{keyCode:va.LEFT,action:cl(vW,Mn,Vn,!1)},{keyCode:va.RIGHT,ctrlKey:!jn,altKey:jn,action:cl(OW,Mn,Vn)},{keyCode:va.LEFT,ctrlKey:!jn,altKey:jn,action:cl(_W,Mn,Vn)},{keyCode:va.UP,action:cl(qP,Mn,!1)},{keyCode:va.DOWN,action:cl(qP,Mn,!0)}],Wn).each(Gn=>{Wn.preventDefault()})},_U=(Mn,Vn)=>{Mn.on("keydown",Wn=>{Wn.isDefaultPrevented()||OU(Mn,Vn,Wn)})},d0=(Mn,Vn)=>({container:Mn,offset:Vn}),o2=Eu.DOM,UE=Mn=>Vn=>Mn===Vn?-1:0,K_=Mn=>Vn=>Mn.isBlock(Vn)||Zs(["BR","IMG","HR","INPUT"],Vn.nodeName)||Mn.getContentEditable(Vn)==="false",ZE=(Mn,Vn,Wn)=>{if(Ir(Mn)&&Vn>=0)return zo.some(d0(Mn,Vn));{const jn=Qb(o2);return zo.from(jn.backwards(Mn,Vn,UE(Mn),Wn)).map(Gn=>d0(Gn.container,Gn.container.data.length))}},BF=(Mn,Vn,Wn)=>{if(Ir(Mn)&&Vn>=Mn.length)return zo.some(d0(Mn,Vn));{const jn=Qb(o2);return zo.from(jn.forwards(Mn,Vn,UE(Mn),Wn)).map(Gn=>d0(Gn.container,0))}},qE=(Mn,Vn,Wn)=>{if(!Ir(Mn))return zo.none();const jn=Mn.data;if(Vn>=0&&Vn<=jn.length)return zo.some(d0(Mn,Vn));{const Gn=Qb(o2);return zo.from(Gn.backwards(Mn,Vn,UE(Mn),Wn)).bind(no=>{const ao=no.container.data;return qE(no.container,Vn+ao.length,Wn)})}},GP=(Mn,Vn,Wn)=>{if(!Ir(Mn))return zo.none();const jn=Mn.data;if(Vn<=jn.length)return zo.some(d0(Mn,Vn));{const Gn=Qb(o2);return zo.from(Gn.forwards(Mn,Vn,UE(Mn),Wn)).bind(no=>GP(no.container,Vn-jn.length,Wn))}},jE=(Mn,Vn,Wn,jn,Gn)=>{const no=Qb(Mn,K_(Mn));return zo.from(no.backwards(Vn,Wn,jn,Gn))},FF=Mn=>Mn.collapsed&&Ir(Mn.startContainer),XE=Mn=>Xo(Mn.toString().replace(/\u00A0/g," ")),YE=Mn=>Mn!==""&&`  \f +\r \v`.indexOf(Mn)!==-1,Zw=(Mn,Vn)=>Mn.substring(Vn.length),GE=(Mn,Vn,Wn)=>{let jn;const Gn=Wn.charAt(0);for(jn=Vn-1;jn>=0;jn--){const no=Mn.charAt(jn);if(YE(no))return zo.none();if(Gn===no&&oc(Mn,Wn,jn,Vn))break}return zo.some(jn)},f0=(Mn,Vn,Wn,jn=0)=>{if(!FF(Vn))return zo.none();const Gn={text:"",offset:0},no=(po,vo,Ao)=>(Gn.text=Ao+Gn.text,Gn.offset+=vo,GE(Gn.text,Gn.offset,Wn).getOr(vo)),ao=Mn.getParent(Vn.startContainer,Mn.isBlock)||Mn.getRoot();return jE(Mn,Vn.startContainer,Vn.startOffset,no,ao).bind(po=>{const vo=Vn.cloneRange();if(vo.setStart(po.container,po.offset),vo.setEnd(Vn.endContainer,Vn.endOffset),vo.collapsed)return zo.none();const Ao=XE(vo);return Ao.lastIndexOf(Wn)!==0||Zw(Ao,Wn).lengthHH(Cs.fromDom(Vn.startContainer)).fold(()=>f0(Mn,Vn,Wn,jn),Gn=>{const no=Mn.createRng();no.selectNode(Gn.dom);const ao=XE(no);return zo.some({range:no,text:Zw(ao,Wn),trigger:Wn})}),HF=Mn=>Mn.nodeType===A1,QF=Mn=>Mn.nodeType===Hh,VF=Mn=>{if(HF(Mn))return d0(Mn,Mn.data.length);{const Vn=Mn.childNodes;return Vn.length>0?VF(Vn[Vn.length-1]):d0(Mn,Vn.length)}},GM=(Mn,Vn)=>{const Wn=Mn.childNodes;return Wn.length>0&&Vn0&&QF(Mn)&&Wn.length===Vn?VF(Wn[Wn.length-1]):d0(Mn,Vn)},SU=(Mn,Vn)=>{var Wn;const jn=(Wn=Mn.getParent(Vn.container,Mn.isBlock))!==null&&Wn!==void 0?Wn:Mn.getRoot();return jE(Mn,Vn.container,Vn.offset,(Gn,no)=>no===0?-1:no,jn).filter(Gn=>{const no=Gn.container.data.charAt(Gn.offset-1);return!YE(no)}).isSome()},wU=Mn=>Vn=>{const Wn=GM(Vn.startContainer,Vn.startOffset);return!SU(Mn,Wn)},KE=(Mn,Vn,Wn)=>Yl(Wn.triggers,jn=>s2(Mn,Vn,jn)),CU=(Mn,Vn)=>{const Wn=Vn(),jn=Mn.selection.getRng();return KE(Mn.dom,jn,Wn).bind(Gn=>zF(Mn,Vn,Gn))},zF=(Mn,Vn,Wn,jn={})=>{var Gn;const no=Vn(),po=(Gn=Mn.selection.getRng().startContainer.nodeValue)!==null&&Gn!==void 0?Gn:"",vo=nr(no.lookupByTrigger(Wn.trigger),Fo=>Wn.text.length>=Fo.minChars&&Fo.matches.getOrThunk(()=>wU(Mn.dom))(Wn.range,po,Wn.text));if(vo.length===0)return zo.none();const Ao=Promise.all(Us(vo,Fo=>Fo.fetch(Wn.text,Fo.maxResults,jn).then(qo=>({matchText:Wn.text,items:qo,columns:Fo.columns,onAction:Fo.onAction,highlightOn:Fo.highlightOn}))));return zo.some({lookupData:Ao,context:Wn})};var lv;(function(Mn){Mn[Mn.Error=0]="Error",Mn[Mn.Value=1]="Value"})(lv||(lv={}));const KM=(Mn,Vn,Wn)=>Mn.stype===lv.Error?Vn(Mn.serror):Wn(Mn.svalue),kU=Mn=>{const Vn=[],Wn=[];return fs(Mn,jn=>{KM(jn,Gn=>Wn.push(Gn),Gn=>Vn.push(Gn))}),{values:Vn,errors:Wn}},xU=(Mn,Vn)=>Mn.stype===lv.Error?{stype:lv.Error,serror:Vn(Mn.serror)}:Mn,EU=(Mn,Vn)=>Mn.stype===lv.Value?{stype:lv.Value,svalue:Vn(Mn.svalue)}:Mn,TU=(Mn,Vn)=>Mn.stype===lv.Value?Vn(Mn.svalue):Mn,AU=(Mn,Vn)=>Mn.stype===lv.Error?Vn(Mn.serror):Mn,WF=Mn=>({stype:lv.Value,svalue:Mn}),UF=Mn=>({stype:lv.Error,serror:Mn}),km={fromResult:Mn=>Mn.fold(UF,WF),toResult:Mn=>KM(Mn,ym.error,ym.value),svalue:WF,partition:kU,serror:UF,bind:TU,bindError:AU,map:EU,mapError:xU,fold:KM},KP=Mn=>Io(Mn)&&Al(Mn).length>100?" removed due to size":JSON.stringify(Mn,null,2),ZF=Mn=>{const Vn=Mn.length>10?Mn.slice(0,10).concat([{path:[],getErrorInfo:xs("... (only showing first ten failures)")}]):Mn;return Us(Vn,Wn=>"Failed path: ("+Wn.path.join(" > ")+`) +`+Wn.getErrorInfo())},JE=(Mn,Vn)=>km.serror([{path:Mn,getErrorInfo:Vn}]),PU=(Mn,Vn,Wn)=>JE(Mn,()=>'Could not find valid *required* value for "'+Vn+'" in '+KP(Wn)),$U=(Mn,Vn)=>JE(Mn,()=>'Choice schema did not contain choice key: "'+Vn+'"'),RU=(Mn,Vn,Wn)=>JE(Mn,()=>'The chosen schema: "'+Wn+'" did not exist in branches: '+KP(Vn)),DU=(Mn,Vn)=>JE(Mn,xs(Vn)),qF=(Mn,Vn,Wn,jn)=>Ma(Wn,jn).fold(()=>RU(Mn,Wn,jn),no=>no.extract(Mn.concat(["branch: "+jn]),Vn)),MU=(Mn,Vn)=>({extract:(Gn,no)=>Ma(no,Mn).fold(()=>$U(Gn,Mn),po=>qF(Gn,no,Vn,po)),toString:()=>"chooseOn("+Mn+"). Possible values: "+Al(Vn)}),jF=(Mn,Vn)=>Vn,NU=(Mn,Vn)=>Vo(Mn)&&Vo(Vn)?eT(Mn,Vn):Vn,JM=Mn=>(...Vn)=>{if(Vn.length===0)throw new Error("Can't merge zero objects");const Wn={};for(let jn=0;jn({tag:"required",process:{}}),IU=Mn=>({tag:"defaultedThunk",process:Mn}),e4=Mn=>IU(xs(Mn)),BU=()=>({tag:"option",process:{}}),FU=(Mn,Vn)=>Mn.length>0?km.svalue(eT(Vn,LU.apply(void 0,Mn))):km.svalue(Vn),t4=Mn=>ko(km.serror,Zc)(Mn),YF={consolidateObj:(Mn,Vn)=>{const Wn=km.partition(Mn);return Wn.errors.length>0?t4(Wn.errors):FU(Wn.values,Vn)},consolidateArr:Mn=>{const Vn=km.partition(Mn);return Vn.errors.length>0?t4(Vn.errors):km.svalue(Vn.values)}},HU=(Mn,Vn,Wn,jn)=>({tag:"field",key:Mn,newKey:Vn,presence:Wn,prop:jn}),QU=(Mn,Vn)=>({tag:"custom",newKey:Mn,instantiator:Vn}),GF=(Mn,Vn,Wn)=>{switch(Mn.tag){case"field":return Vn(Mn.key,Mn.newKey,Mn.presence,Mn.prop);case"custom":return Wn(Mn.newKey,Mn.instantiator)}},JP=Mn=>{const Vn=(jn,Gn)=>km.bindError(Mn(Gn),no=>DU(jn,no)),Wn=xs("val");return{extract:Vn,toString:Wn}},KF=JP(km.svalue),VU=(Mn,Vn,Wn,jn)=>Ma(Vn,Wn).fold(()=>PU(Mn,Wn,Vn),jn),JF=(Mn,Vn,Wn,jn)=>{const Gn=Ma(Mn,Vn).getOrThunk(()=>Wn(Mn));return jn(Gn)},zU=(Mn,Vn,Wn)=>Wn(Ma(Mn,Vn)),WU=(Mn,Vn,Wn,jn)=>{const Gn=Ma(Mn,Vn).map(no=>no===!0?Wn(Mn):no);return jn(Gn)},UU=(Mn,Vn,Wn,jn,Gn)=>{const no=po=>Gn.extract(Vn.concat([jn]),po),ao=po=>po.fold(()=>km.svalue(zo.none()),vo=>{const Ao=Gn.extract(Vn.concat([jn]),vo);return km.map(Ao,zo.some)});switch(Mn.tag){case"required":return VU(Vn,Wn,jn,no);case"defaultedThunk":return JF(Wn,jn,Mn.process,no);case"option":return zU(Wn,jn,ao);case"defaultedOptionThunk":return WU(Wn,jn,Mn.process,ao);case"mergeWithThunk":return JF(Wn,jn,xs({}),po=>{const vo=eT(Mn.process(Wn),po);return no(vo)})}},ZU=(Mn,Vn,Wn)=>{const jn={},Gn=[];for(const no of Wn)GF(no,(ao,po,vo,Ao)=>{const Fo=UU(vo,Mn,Vn,ao,Ao);km.fold(Fo,Qo=>{Gn.push(...Qo)},Qo=>{jn[po]=Qo})},(ao,po)=>{jn[ao]=po(Vn)});return Gn.length>0?km.serror(Gn):km.svalue(jn)},n4=Mn=>({extract:(jn,Gn)=>ZU(jn,Gn,Mn),toString:()=>`obj{ +`+Us(Mn,Gn=>GF(Gn,(no,ao,po,vo)=>no+" -> "+vo.toString(),(no,ao)=>"state("+no+")")).join(` +`)+"}"}),e6=Mn=>({extract:(jn,Gn)=>{const no=Us(Gn,(ao,po)=>Mn.extract(jn.concat(["["+po+"]"]),ao));return YF.consolidateArr(no)},toString:()=>"array("+Mn.toString()+")"}),bG=Mn=>JP(Vn=>Mn(Vn).fold(km.serror,km.svalue)),qU=(Mn,Vn,Wn)=>{const jn=Vn.extract([Mn],Wn);return km.mapError(jn,Gn=>({input:Wn,errors:Gn}))},e$=(Mn,Vn,Wn)=>km.toResult(qU(Mn,Vn,Wn)),t6=Mn=>`Errors: +`+ZF(Mn.errors).join(` +`)+` + +Input object: `+KP(Mn.input),o4=(Mn,Vn)=>MU(Mn,Pl(Vn,n4)),jU=xs(KF),tT=(Mn,Vn)=>JP(Wn=>{const jn=typeof Wn;return Mn(Wn)?km.svalue(Wn):km.serror(`Expected type: ${Vn} but got: ${jn}`)}),n6=tT(Ys,"number"),t$=tT(xo,"string"),XU=tT(Go,"boolean"),s4=tT(Yo,"function"),r2=HU,o6=QU,r4=Mn=>bG(Vn=>Zs(Mn,Vn)?ym.value(Vn):ym.error(`Unsupported value: "${Vn}", choose one of "${Mn.join(", ")}".`)),s6=(Mn,Vn)=>r2(Mn,Mn,XF(),Vn),r6=Mn=>s6(Mn,t$),i6=Mn=>s6(Mn,s4),a6=(Mn,Vn)=>r2(Mn,Mn,XF(),e6(Vn)),i4=(Mn,Vn)=>r2(Mn,Mn,BU(),Vn),n$=Mn=>i4(Mn,t$),YU=Mn=>i4(Mn,s4),GU=(Mn,Vn)=>r2(Mn,Mn,e4(Vn),jU()),i2=(Mn,Vn,Wn)=>r2(Mn,Mn,e4(Vn),Wn),rh=(Mn,Vn)=>i2(Mn,Vn,n6),Ty=(Mn,Vn)=>i2(Mn,Vn,t$),l6=(Mn,Vn,Wn)=>i2(Mn,Vn,r4(Wn)),c6=(Mn,Vn)=>i2(Mn,Vn,XU),a4=(Mn,Vn)=>i2(Mn,Vn,s4),KU=(Mn,Vn,Wn)=>i2(Mn,Vn,e6(Wn)),JU=r6("type"),eZ=i6("fetch"),o$=i6("onAction"),a2=a4("onSetup",()=>Js),vG=n$("text"),tZ=n$("icon"),nZ=n$("tooltip"),cv=n$("label"),oZ=c6("active",!1),sZ=c6("enabled",!0),l4=c6("primary",!1),rZ=Mn=>GU("columns",Mn),qw=Mn=>Ty("type",Mn),u6=n4([JU,r6("trigger"),rh("minChars",1),rZ(1),rh("maxResults",10),YU("matches"),eZ,o$,KU("highlightOn",[],t$)]),iZ=Mn=>e$("Autocompleter",u6,{trigger:Mn.ch,...Mn}),c4=[sZ,nZ,tZ,vG,a2],d6=[oZ].concat(c4),f6=[a4("predicate",hs),l6("scope","node",["node","editor"]),l6("position","selection",["node","selection","line"])],h6=c4.concat([qw("contextformbutton"),l4,o$,o6("original",Qr)]),u4=d6.concat([qw("contextformbutton"),l4,o$,o6("original",Qr)]),d4=c4.concat([qw("contextformbutton")]),f4=d6.concat([qw("contextformtogglebutton")]),aZ=o4("type",{contextformbutton:h6,contextformtogglebutton:u4});n4([qw("contextform"),a4("initValue",xs("")),cv,a6("commands",aZ),i4("launch",o4("type",{contextformbutton:d4,contextformtogglebutton:f4}))].concat(f6));const lZ=Mn=>{const Vn=Mn.ui.registry.getAll().popups,Wn=Pl(Vn,ao=>iZ(ao).fold(po=>{throw new Error(t6(po))},Qr)),jn=vl(ia(Wn,ao=>ao.trigger)),Gn=ka(Wn);return{dataset:Wn,triggers:jn,lookupByTrigger:ao=>nr(Gn,po=>po.trigger===ao)}},cZ=(Mn,Vn)=>{const Wn=jO(Vn.load,50);Mn.on("keypress compositionend",jn=>{jn.which!==27&&Wn.throttle()}),Mn.on("keydown",jn=>{const Gn=jn.which;Gn===8?Wn.throttle():Gn===27&&Vn.cancelIfNecessary()}),Mn.on("remove",Wn.cancel)},uZ=Mn=>{const Vn=Fb(),Wn=od(!1),jn=Vn.isSet,Gn=()=>{jn()&&(EV(Mn),Fx(Mn),Wn.set(!1),Vn.clear())},no=Ao=>{jn()||(xV(Mn,Ao.range),Vn.set({trigger:Ao.trigger,matchLength:Ao.text.length}))},ao=br(()=>lZ(Mn)),po=Ao=>Vn.get().map(Fo=>s2(Mn.dom,Mn.selection.getRng(),Fo.trigger).bind(Qo=>zF(Mn,ao,Qo,Ao))).getOrThunk(()=>CU(Mn,ao)),vo=Ao=>{po(Ao).fold(Gn,Fo=>{no(Fo.context),Fo.lookupData.then(Qo=>{Vn.get().map(qo=>{const ds=Fo.context;qo.trigger===ds.trigger&&(ds.text.length-qo.matchLength>=10?Gn():(Vn.set({...qo,matchLength:ds.text.length}),Wn.get()?eA(Mn,{lookupData:Qo}):(Wn.set(!0),Bx(Mn,{lookupData:Qo}))))})})})};Mn.addCommand("mceAutocompleterReload",(Ao,Fo)=>{const Qo=Io(Fo)?Fo.fetchOptions:{};vo(Qo)}),Mn.addCommand("mceAutocompleterClose",Gn),cZ(Mn,{cancelIfNecessary:Gn,load:vo})},p6=xl().browser.isSafari(),g6=Mn=>Kp(Cs.fromDom(Mn)),h4=(Mn,Vn)=>{var Wn;return Mn.startOffset===0&&Mn.endOffset===((Wn=Vn.textContent)===null||Wn===void 0?void 0:Wn.length)},s$=(Mn,Vn)=>zo.from(Mn.getParent(Vn.container(),"details")),r$=(Mn,Vn)=>s$(Mn,Vn).isSome(),dZ=(Mn,Vn)=>{const Wn=zo.from(Mn.getParent(Vn.startContainer,"details")),jn=zo.from(Mn.getParent(Vn.endContainer,"details"));if(Wn.isSome()||jn.isSome()){const Gn=Wn.bind(no=>zo.from(Mn.select("summary",no)[0]));return zo.some({startSummary:Gn,startDetails:Wn,endDetails:jn})}else return zo.none()},fZ=(Mn,Vn)=>zm(Vn).exists(Wn=>Wn.isEqual(Mn)),hZ=(Mn,Vn)=>b1(Vn).exists(Wn=>Ec(Wn.getNode())&&cp(Vn,Wn).exists(jn=>jn.isEqual(Mn))||Wn.isEqual(Mn)),mZ=(Mn,Vn)=>Vn.startSummary.exists(Wn=>fZ(Mn,Wn)),pZ=(Mn,Vn)=>Vn.startSummary.exists(Wn=>hZ(Mn,Wn)),b6=(Mn,Vn)=>Vn.startDetails.exists(Wn=>cp(Wn,Mn).forall(jn=>Vn.startSummary.exists(Gn=>!Gn.contains(Mn.container())&&Gn.contains(jn.container())))),m4=(Mn,Vn,Wn)=>Wn.startDetails.exists(jn=>Sm(Mn,Vn).forall(Gn=>!jn.contains(Gn.container()))),p4=(Mn,Vn)=>{const Wn=Vn.getNode();os(Wn)||Mn.selection.setCursorLocation(Wn,Vn.offset())},g4=(Mn,Vn,Wn)=>{const jn=Mn.dom.getParent(Vn.container(),"details");if(jn&&!jn.open){const Gn=Mn.dom.select("summary",jn)[0];Gn&&(Wn?zm(Gn):b1(Gn)).each(ao=>p4(Mn,ao))}else p4(Mn,Vn)},gZ=(Mn,Vn)=>{const Wn=vo=>vo.contains(Mn.startContainer),jn=vo=>vo.contains(Mn.endContainer),Gn=Vn.startSummary.exists(Wn),no=Vn.startSummary.exists(jn),ao=Vn.startDetails.forall(vo=>Vn.endDetails.forall(Ao=>vo!==Ao));return(Gn||no)&&!(Gn&&no)||ao},v6=(Mn,Vn,Wn)=>{const{dom:jn,selection:Gn}=Mn,no=Mn.getBody();if(Wn==="character"){const ao=lr.fromRangeStart(Gn.getRng()),po=jn.getParent(ao.container(),jn.isBlock),vo=s$(jn,ao),Ao=po&&jn.isEmpty(po),Fo=Mo(po==null?void 0:po.previousSibling),Qo=Mo(po==null?void 0:po.nextSibling);return Ao&&(Vn?Qo:Fo)&&Z0(!Vn,no,ao).exists(bs=>r$(jn,bs)&&!Ef(vo,s$(jn,bs)))?!0:Z0(Vn,no,ao).fold(hs,qo=>{const ds=s$(jn,qo);if(r$(jn,qo)&&!Ef(vo,ds)){if(Vn||g4(Mn,qo,!1),po&&Ao){if(Vn&&Fo)return!0;if(!Vn&&Qo)return!0;g4(Mn,qo,Vn),Mn.dom.remove(po)}return!0}else return!1})}else return!1},bZ=(Mn,Vn,Wn,jn)=>{const no=Mn.selection.getRng(),ao=lr.fromRangeStart(no),po=Mn.getBody();return jn==="selection"?gZ(no,Vn):Wn?pZ(ao,Vn)||m4(po,ao,Vn):mZ(ao,Vn)||b6(ao,Vn)},i$=(Mn,Vn,Wn)=>dZ(Mn.dom,Mn.selection.getRng()).fold(()=>v6(Mn,Vn,Wn),jn=>bZ(Mn,jn,Vn,Wn)||v6(Mn,Vn,Wn)),y6=(Mn,Vn,Wn)=>{const jn=Mn.selection,Gn=jn.getNode(),no=jn.getRng(),ao=lr.fromRangeStart(no);return Kf(Gn)?(Wn==="selection"&&h4(no,Gn)||EA(Vn,ao,Gn)?g6(Gn):Mn.undoManager.transact(()=>{const po=jn.getSel();let{anchorNode:vo,anchorOffset:Ao,focusNode:Fo,focusOffset:Qo}=po??{};const qo=()=>{is(vo)&&is(Ao)&&is(Fo)&&is(Qo)&&(po==null||po.setBaseAndExtent(vo,Ao,Fo,Qo))},ds=()=>{vo=po==null?void 0:po.anchorNode,Ao=po==null?void 0:po.anchorOffset,Fo=po==null?void 0:po.focusNode,Qo=po==null?void 0:po.focusOffset},bs=(ys,Ls)=>{fs(ys.childNodes,zs=>{uw(zs)&&Ls.appendChild(zs)})},ls=Mn.dom.create("span",{"data-mce-bogus":"1"});bs(Gn,ls),Gn.appendChild(ls),qo(),(Wn==="word"||Wn==="line")&&(po==null||po.modify("extend",Vn?"right":"left",Wn)),!jn.isCollapsed()&&h4(jn.getRng(),ls)?g6(Gn):(Mn.execCommand(Vn?"ForwardDelete":"Delete"),ds(),bs(ls,Gn),qo()),Mn.dom.remove(ls)}),!0):!1},J_=(Mn,Vn,Wn)=>i$(Mn,Vn,Wn)||p6&&y6(Mn,Vn,Wn)?zo.some(Js):zo.none(),O6=Mn=>(Vn,Wn,jn={})=>{const Gn=Vn.getBody(),no={bubbles:!0,composed:!0,data:null,isComposing:!1,detail:0,view:null,target:Gn,currentTarget:Gn,eventPhase:Event.AT_TARGET,originalTarget:Gn,explicitOriginalTarget:Gn,isTrusted:!1,srcElement:Gn,cancelable:!1,preventDefault:Js,inputType:Wn},ao=Fv(new InputEvent(Mn));return Vn.dispatch(Mn,{...ao,...no,...jn})},nT=O6("input"),b4=O6("beforeinput"),vZ=xl(),yZ=vZ.os,_6=yZ.isMacOS()||yZ.isiOS(),OZ=vZ.browser.isFirefox(),_Z=(Mn,Vn,Wn)=>{const jn=Wn.keyCode===va.BACKSPACE?"deleteContentBackward":"deleteContentForward",Gn=Mn.selection.isCollapsed(),no=Gn?"character":"selection",ao=po=>Gn?po?"word":"line":"selection";UM([{keyCode:va.BACKSPACE,action:cl(aF,Mn)},{keyCode:va.BACKSPACE,action:cl(ME,Mn,!1)},{keyCode:va.DELETE,action:cl(ME,Mn,!0)},{keyCode:va.BACKSPACE,action:cl(dM,Mn,!1)},{keyCode:va.DELETE,action:cl(dM,Mn,!0)},{keyCode:va.BACKSPACE,action:cl(QP,Mn,Vn,!1)},{keyCode:va.DELETE,action:cl(QP,Mn,Vn,!0)},{keyCode:va.BACKSPACE,action:cl(lE,Mn,!1)},{keyCode:va.DELETE,action:cl(lE,Mn,!0)},{keyCode:va.BACKSPACE,action:cl(J_,Mn,!1,no)},{keyCode:va.DELETE,action:cl(J_,Mn,!0,no)},..._6?[{keyCode:va.BACKSPACE,altKey:!0,action:cl(J_,Mn,!1,ao(!0))},{keyCode:va.DELETE,altKey:!0,action:cl(J_,Mn,!0,ao(!0))},{keyCode:va.BACKSPACE,metaKey:!0,action:cl(J_,Mn,!1,ao(!1))}]:[{keyCode:va.BACKSPACE,ctrlKey:!0,action:cl(J_,Mn,!1,ao(!0))},{keyCode:va.DELETE,ctrlKey:!0,action:cl(J_,Mn,!0,ao(!0))}],{keyCode:va.BACKSPACE,action:cl(mM,Mn,!1)},{keyCode:va.DELETE,action:cl(mM,Mn,!0)},{keyCode:va.BACKSPACE,action:cl(LM,Mn,!1)},{keyCode:va.DELETE,action:cl(LM,Mn,!0)},{keyCode:va.BACKSPACE,action:cl(PP,Mn,!1)},{keyCode:va.DELETE,action:cl(PP,Mn,!0)},{keyCode:va.BACKSPACE,action:cl(cM,Mn,!1)},{keyCode:va.DELETE,action:cl(cM,Mn,!0)},{keyCode:va.BACKSPACE,action:cl(MM,Mn,!1)},{keyCode:va.DELETE,action:cl(MM,Mn,!0)}],Wn).filter(po=>Mn.selection.isEditable()).each(po=>{Wn.preventDefault(),b4(Mn,jn).isDefaultPrevented()||(po(),nT(Mn,jn))})},yG=(Mn,Vn,Wn)=>n2([{keyCode:va.BACKSPACE,action:cl(SB,Mn)},{keyCode:va.DELETE,action:cl(SB,Mn)},..._6?[{keyCode:va.BACKSPACE,altKey:!0,action:cl(HE,Mn)},{keyCode:va.DELETE,altKey:!0,action:cl(HE,Mn)},...Wn?[{keyCode:OZ?224:91,action:cl(HE,Mn)}]:[]]:[{keyCode:va.BACKSPACE,ctrlKey:!0,action:cl(HE,Mn)},{keyCode:va.DELETE,ctrlKey:!0,action:cl(HE,Mn)}]],Vn),SZ=(Mn,Vn)=>{let Wn=!1;Mn.on("keydown",jn=>{Wn=jn.keyCode===va.BACKSPACE,jn.isDefaultPrevented()||_Z(Mn,Vn,jn)}),Mn.on("keyup",jn=>{jn.isDefaultPrevented()||yG(Mn,jn,Wn),Wn=!1})},rf=Mn=>{for(;Mn;){if(Oa(Mn)||Ir(Mn)&&Mn.data&&/[\r\n\s]/.test(Mn.data))return Mn;Mn=Mn.nextSibling}return null},eS=(Mn,Vn)=>{const Wn=Mn.dom,jn=Mn.schema.getMoveCaretBeforeOnEnterElements();if(!Vn)return;if(/^(LI|DT|DD)$/.test(Vn.nodeName)){const no=rf(Vn.firstChild);no&&/^(UL|OL|DL)$/.test(no.nodeName)&&Vn.insertBefore(Wn.doc.createTextNode(hc),Vn.firstChild)}const Gn=Wn.createRng();if(Vn.normalize(),Vn.hasChildNodes()){const no=new mu(Vn,Vn);let ao=Vn,po;for(;po=no.current();){if(Ir(po)){Gn.setStart(po,0),Gn.setEnd(po,0);break}if(jn[po.nodeName.toLowerCase()]){Gn.setStartBefore(po),Gn.setEndBefore(po);break}ao=po,po=no.next()}po||(Gn.setStart(ao,0),Gn.setEnd(ao,0))}else Ec(Vn)?Vn.nextSibling&&Wn.isBlock(Vn.nextSibling)?(Gn.setStartBefore(Vn),Gn.setEndBefore(Vn)):(Gn.setStartAfter(Vn),Gn.setEndAfter(Vn)):(Gn.setStart(Vn,0),Gn.setEnd(Vn,0));Mn.selection.setRng(Gn),Ew(Mn,Gn)},x1=(Mn,Vn)=>{const Wn=Mn.getRoot();let jn,Gn=Vn;for(;Gn!==Wn&&Gn&&Mn.getContentEditable(Gn)!=="false";){if(Mn.getContentEditable(Gn)==="true"){jn=Gn;break}Gn=Gn.parentNode}return Gn!==Wn?jn:Wn},a$=Mn=>zo.from(Mn.dom.getParent(Mn.selection.getStart(!0),Mn.dom.isBlock)),S6=Mn=>a$(Mn).fold(xs(""),Vn=>Vn.nodeName.toUpperCase()),wZ=Mn=>a$(Mn).filter(Vn=>Lm(Cs.fromDom(Vn))).isSome(),l2=Mn=>{Mn.innerHTML='
    '},y4=(Mn,Vn,Wn)=>{const jn=Mn.dom;zo.from(Wn.style).map(jn.parseStyle).each(vo=>{const Fo={...Ym(Cs.fromDom(Vn)),...vo};jn.setStyles(Vn,Fo)});const Gn=zo.from(Wn.class).map(vo=>vo.split(/\s+/)),no=zo.from(Vn.className).map(vo=>nr(vo.split(/\s+/),Ao=>Ao!==""));jc(Gn,no,(vo,Ao)=>{const Fo=nr(Ao,qo=>!Zs(vo,qo)),Qo=[...vo,...Fo];jn.setAttrib(Vn,"class",Qo.join(" "))});const ao=["style","class"],po=pr(Wn,(vo,Ao)=>!Zs(ao,Ao));jn.setAttribs(Vn,po)},c2=(Mn,Vn)=>{if(bh(Mn).toLowerCase()===Vn.tagName.toLowerCase()){const jn=Zb(Mn);y4(Mn,Vn,jn)}},O4=(Mn,Vn,Wn,jn,Gn=!0,no,ao)=>{const po=Mn.dom,vo=Mn.schema,Ao=bh(Mn),Fo=Wn?Wn.nodeName.toUpperCase():"";let Qo=Vn;const qo=vo.getTextInlineElements();let ds;no||Fo==="TABLE"||Fo==="HR"?ds=po.create(no||Ao,ao||{}):ds=Wn.cloneNode(!1);let bs=ds;if(!Gn)po.setAttrib(ds,"style",null),po.setAttrib(ds,"class",null);else do if(qo[Qo.nodeName]){if(fg(Qo)||hg(Qo))continue;const ls=Qo.cloneNode(!1);po.setAttrib(ls,"id",""),ds.hasChildNodes()?(ls.appendChild(ds.firstChild),ds.appendChild(ls)):(bs=ls,ds.appendChild(ls))}while((Qo=Qo.parentNode)&&Qo!==jn);return c2(Mn,ds),l2(bs),ds},CZ=(Mn,Vn)=>Mn.dom.getParent(Vn,Er),kZ=(Mn,Vn,Wn)=>{let jn=Vn;for(;jn&&jn!==Mn&&Mo(jn.nextSibling);){const Gn=jn.parentElement;if(!Gn||!Wn(Gn))return Er(Gn);jn=Gn}return!1},xZ=(Mn,Vn,Wn)=>!Vn&&Wn.nodeName.toLowerCase()===bh(Mn)&&Mn.dom.isEmpty(Wn)&&kZ(Mn.getBody(),Wn,jn=>Mr(Mn.schema.getTextBlockElements(),jn.nodeName.toLowerCase())),EZ=(Mn,Vn,Wn)=>{var jn,Gn,no;const ao=Vn(bh(Mn)),po=CZ(Mn,Wn);po&&(Mn.dom.insertAfter(ao,po),eS(Mn,ao),((no=(Gn=(jn=Wn.parentElement)===null||jn===void 0?void 0:jn.childNodes)===null||Gn===void 0?void 0:Gn.length)!==null&&no!==void 0?no:0)>1&&Mn.dom.remove(Wn))},TZ=(Mn,Vn)=>Mn.firstChild&&Mn.firstChild.nodeName===Vn,w6=Mn=>{var Vn;return((Vn=Mn.parentNode)===null||Vn===void 0?void 0:Vn.firstChild)===Mn},C6=(Mn,Vn)=>{const Wn=Mn==null?void 0:Mn.parentNode;return is(Wn)&&Wn.nodeName===Vn},k6=Mn=>is(Mn)&&/^(OL|UL|LI)$/.test(Mn.nodeName),_4=Mn=>is(Mn)&&/^(LI|DT|DD)$/.test(Mn.nodeName),AZ=Mn=>k6(Mn)&&k6(Mn.parentNode),l$=Mn=>{const Vn=Mn.parentNode;return _4(Vn)?Vn:Mn},oT=(Mn,Vn,Wn)=>{let jn=Mn[Wn?"firstChild":"lastChild"];for(;jn&&!Oa(jn);)jn=jn[Wn?"nextSibling":"previousSibling"];return jn===Vn},S4=Mn=>ra(ia(Ym(Cs.fromDom(Mn)),(Vn,Wn)=>`${Wn}: ${Vn};`),(Vn,Wn)=>Vn+Wn,""),PZ=(Mn,Vn,Wn,jn,Gn)=>{const no=Mn.dom,ao=Mn.selection.getRng(),po=Wn.parentNode;if(Wn===Mn.getBody()||!po)return;AZ(Wn)&&(Gn="LI");const vo=_4(jn)?S4(jn):void 0;let Ao=_4(jn)&&vo?Vn(Gn,{style:S4(jn)}):Vn(Gn);if(oT(Wn,jn,!0)&&oT(Wn,jn,!1))if(C6(Wn,"LI")){const Fo=l$(Wn);no.insertAfter(Ao,Fo),w6(Wn)?no.remove(Fo):no.remove(Wn)}else no.replace(Ao,Wn);else if(oT(Wn,jn,!0))C6(Wn,"LI")?(no.insertAfter(Ao,l$(Wn)),Ao.appendChild(no.doc.createTextNode(" ")),Ao.appendChild(Wn)):po.insertBefore(Ao,Wn),no.remove(jn);else if(oT(Wn,jn,!1))no.insertAfter(Ao,l$(Wn)),no.remove(jn);else{Wn=l$(Wn);const Fo=ao.cloneRange();Fo.setStartAfter(jn),Fo.setEndAfter(Wn);const Qo=Fo.extractContents();if(Gn==="LI"&&TZ(Qo,"LI")){const qo=nr(Us(Ao.children,Cs.fromDom),Fs(Qh("br")));Ao=Qo.firstChild,no.insertAfter(Qo,Wn),fs(qo,ds=>Gm(Cs.fromDom(Ao),ds)),vo&&Ao.setAttribute("style",vo)}else no.insertAfter(Qo,Wn),no.insertAfter(Ao,Wn);no.remove(jn)}eS(Mn,Ao)},$Z=Mn=>{fs(Sp(Cs.fromDom(Mn),qd),Vn=>{const Wn=Vn.dom;Wn.nodeValue=Xo(Wn.data)})},OG=(Mn,Vn)=>{const Wn=Mn.dom.getParent(Vn,"ol,ul,dl");return Wn!==null&&Mn.dom.getContentEditableParent(Wn)==="false"},w4=(Mn,Vn)=>Vn&&Vn.nodeName==="A"&&Mn.isEmpty(Vn),C4=(Mn,Vn)=>Mn.nodeName===Vn||Mn.previousSibling&&Mn.previousSibling.nodeName===Vn,k4=(Mn,Vn)=>is(Vn)&&Mn.isBlock(Vn)&&!/^(TD|TH|CAPTION|FORM)$/.test(Vn.nodeName)&&!/^(fixed|absolute)/i.test(Vn.style.position)&&Mn.isEditable(Vn.parentNode)&&Mn.getContentEditable(Vn)!=="false",RZ=(Mn,Vn,Wn)=>{var jn;const Gn=[];if(!Wn)return;let no=Wn;for(;no=no.firstChild;){if(Mn.isBlock(no))return;Oa(no)&&!Vn[no.nodeName.toLowerCase()]&&Gn.push(no)}let ao=Gn.length;for(;ao--;)no=Gn[ao],(!no.hasChildNodes()||no.firstChild===no.lastChild&&((jn=no.firstChild)===null||jn===void 0?void 0:jn.nodeValue)===""||w4(Mn,no))&&Mn.remove(no)},c$=(Mn,Vn,Wn)=>Ir(Vn)?Mn?Wn===1&&Vn.data.charAt(Wn-1)===_o?0:Wn:Wn===Vn.data.length-1&&Vn.data.charAt(Wn)===_o?Vn.data.length:Wn:Wn,DZ=Mn=>{const Vn=Mn.cloneRange();return Vn.setStart(Mn.startContainer,c$(!0,Mn.startContainer,Mn.startOffset)),Vn.setEnd(Mn.endContainer,c$(!1,Mn.endContainer,Mn.endOffset)),Vn},x6=Mn=>{let Vn=Mn;do Ir(Vn)&&(Vn.data=Vn.data.replace(/^[\r\n]+/,"")),Vn=Vn.firstChild;while(Vn)},MZ=(Mn,Vn,Wn,jn,Gn)=>{var no,ao;const po=Mn.dom,vo=(no=x1(po,jn))!==null&&no!==void 0?no:po.getRoot();let Ao=po.getParent(jn,po.isBlock);if(!Ao||!k4(po,Ao)){if(Ao=Ao||vo,!Ao.hasChildNodes()){const ds=po.create(Vn);return c2(Mn,ds),Ao.appendChild(ds),Wn.setStart(ds,0),Wn.setEnd(ds,0),ds}let Fo=jn;for(;Fo&&Fo.parentNode!==Ao;)Fo=Fo.parentNode;let Qo;for(;Fo&&!po.isBlock(Fo);)Qo=Fo,Fo=Fo.previousSibling;const qo=(ao=Qo==null?void 0:Qo.parentElement)===null||ao===void 0?void 0:ao.nodeName;if(Qo&&qo&&Mn.schema.isValidChild(qo,Vn.toLowerCase())){const ds=Qo.parentNode,bs=po.create(Vn);for(c2(Mn,bs),ds.insertBefore(bs,Qo),Fo=Qo;Fo&&!po.isBlock(Fo);){const ls=Fo.nextSibling;bs.appendChild(Fo),Fo=ls}Wn.setStart(jn,Gn),Wn.setEnd(jn,Gn)}}return jn},NZ=(Mn,Vn)=>{Vn.normalize();const Wn=Vn.lastChild;(!Wn||Oa(Wn)&&/^(left|right)$/gi.test(Mn.getStyle(Wn,"float",!0)))&&Mn.add(Vn,"br")},_G=(Mn,Vn)=>{const Wn=AC(Mn);return ms(Vn)?!1:xo(Wn)?Zs(Lr.explode(Wn),Vn.nodeName.toLowerCase()):Wn},E6={insert:(Mn,Vn)=>{let Wn,jn,Gn,no,ao=!1;const po=Mn.dom,vo=Mn.schema,Ao=vo.getNonEmptyElements(),Fo=Mn.selection.getRng(),Qo=bh(Mn),qo=Cs.fromDom(Fo.startContainer),ds=Rm(qo,Fo.startOffset),bs=ds.exists(Ar=>Du(Ar)&&!yl(Ar)),ls=Fo.collapsed&&bs,ys=(Ar,wa)=>O4(Mn,Wn,Ur,Pr,j2(Mn),Ar,wa),Ls=Ar=>{const wa=c$(Ar,Wn,jn);if(Ir(Wn)&&(Ar?wa>0:wa{let Ar;return/^(H[1-6]|PRE|FIGURE)$/.test(Gn)&&fa!=="HGROUP"?Ar=ys(Qo):Ar=ys(),_G(Mn,no)&&k4(po,no)&&po.isEmpty(Ur,void 0,{includeZwsp:!0})?Ar=po.split(no,Ur):po.insertAfter(Ar,Ur),eS(Mn,Ar),Ar};To(po,Fo).each(Ar=>{Fo.setStart(Ar.startContainer,Ar.startOffset),Fo.setEnd(Ar.endContainer,Ar.endOffset)}),Wn=Fo.startContainer,jn=Fo.startOffset;const Hs=!!(Vn&&Vn.shiftKey),tr=!!(Vn&&Vn.ctrlKey);Oa(Wn)&&Wn.hasChildNodes()&&!ls&&(ao=jn>Wn.childNodes.length-1,Wn=Wn.childNodes[Math.min(jn,Wn.childNodes.length-1)]||Wn,ao&&Ir(Wn)?jn=Wn.data.length:jn=0);const Pr=x1(po,Wn);if(!Pr||OG(Mn,Wn))return;Hs||(Wn=MZ(Mn,Qo,Fo,Wn,jn));let Ur=po.getParent(Wn,po.isBlock)||po.getRoot();no=is(Ur==null?void 0:Ur.parentNode)?po.getParent(Ur.parentNode,po.isBlock):null,Gn=Ur?Ur.nodeName.toUpperCase():"";const fa=no?no.nodeName.toUpperCase():"";if(fa==="LI"&&!tr){const Ar=no;Ur=Ar,no=Ar.parentNode,Gn=fa}if(Oa(no)&&xZ(Mn,Hs,Ur))return EZ(Mn,ys,Ur);if(/^(LI|DT|DD)$/.test(Gn)&&Oa(no)&&po.isEmpty(Ur)){PZ(Mn,ys,no,Ur,Qo);return}if(!ls&&(Ur===Mn.getBody()||!k4(po,Ur)))return;const yr=Ur.parentNode;let fr;if(ls)fr=ys(Qo),ds.fold(()=>{Fu(qo,Cs.fromDom(fr))},Ar=>{ed(Ar,Cs.fromDom(fr))}),Mn.selection.setCursorLocation(fr,0);else if(zr(Ur))fr=wp(Ur),po.isEmpty(Ur)&&l2(Ur),c2(Mn,fr),eS(Mn,fr);else if(Ls(!1))fr=zs();else if(Ls(!0)&&yr){fr=yr.insertBefore(ys(),Ur);const Ar=e1(Cs.fromDom(Fo.startContainer))&&Fo.collapsed;eS(Mn,C4(Ur,"HR")||Ar?fr:Ur)}else{const Ar=DZ(Fo).cloneRange();Ar.setEndAfter(Ur);const wa=Ar.extractContents();$Z(wa),x6(wa),fr=wa.firstChild,po.insertAfter(wa,Ur),RZ(po,Ao,fr),NZ(po,Ur),po.isEmpty(Ur)&&l2(Ur),fr.normalize(),po.isEmpty(fr)?(po.remove(fr),zs()):(c2(Mn,fr),eS(Mn,fr))}po.setAttrib(fr,"id",""),Mn.dispatch("NewBlock",{newBlock:fr})},fakeEventName:"insertParagraph"},LZ=(Mn,Vn,Wn)=>{const jn=new mu(Vn,Wn);let Gn;const no=Mn.getNonEmptyElements();for(;Gn=jn.next();)if(no[Gn.nodeName.toLowerCase()]||Ir(Gn)&&Gn.length>0)return!0;return!1},T6=(Mn,Vn,Wn)=>{const jn=Mn.dom.createRng();Wn?(jn.setStartBefore(Vn),jn.setEndBefore(Vn)):(jn.setStartAfter(Vn),jn.setEndAfter(Vn)),Mn.selection.setRng(jn),Ew(Mn,jn)},IZ=(Mn,Vn)=>{const Wn=Mn.selection,jn=Mn.dom,Gn=Wn.getRng();let no,ao=!1;To(jn,Gn).each(ds=>{Gn.setStart(ds.startContainer,ds.startOffset),Gn.setEnd(ds.endContainer,ds.endOffset)});let po=Gn.startOffset,vo=Gn.startContainer;if(Oa(vo)&&vo.hasChildNodes()){const ds=po>vo.childNodes.length-1;vo=vo.childNodes[Math.min(po,vo.childNodes.length-1)]||vo,ds&&Ir(vo)?po=vo.data.length:po=0}let Ao=jn.getParent(vo,jn.isBlock);const Fo=Ao&&Ao.parentNode?jn.getParent(Ao.parentNode,jn.isBlock):null,Qo=Fo?Fo.nodeName.toUpperCase():"",qo=!!(Vn&&Vn.ctrlKey);Qo==="LI"&&!qo&&(Ao=Fo),Ir(vo)&&po>=vo.data.length&&(LZ(Mn.schema,vo,Ao||jn.getRoot())||(no=jn.create("br"),Gn.insertNode(no),Gn.setStartAfter(no),Gn.setEndAfter(no),ao=!0)),no=jn.create("br"),AS(jn,Gn,no),T6(Mn,no,ao),Mn.undoManager.add()},BZ=(Mn,Vn)=>{const Wn=Cs.fromTag("br");ed(Cs.fromDom(Vn),Wn),Mn.undoManager.add()},FZ=(Mn,Vn)=>{HZ(Mn.getBody(),Vn)||fh(Cs.fromDom(Vn),Cs.fromTag("br"));const Wn=Cs.fromTag("br");fh(Cs.fromDom(Vn),Wn),T6(Mn,Wn.dom,!1),Mn.undoManager.add()},u$=Mn=>Ec(Mn.getNode()),HZ=(Mn,Vn)=>u$(lr.after(Vn))?!0:Sm(Mn,lr.after(Vn)).map(Wn=>Ec(Wn.getNode())).getOr(!1),A6=Mn=>Mn&&Mn.nodeName==="A"&&"href"in Mn,x4=Mn=>Mn.fold(hs,A6,A6,hs),E4=Mn=>{const Vn=ws(Rw,Mn),Wn=lr.fromRangeStart(Mn.selection.getRng());return Kh(Vn,Mn.getBody(),Wn).filter(x4)},QZ=(Mn,Vn)=>{Vn.fold(Js,ws(BZ,Mn),ws(FZ,Mn),Js)},VZ={insert:(Mn,Vn)=>{const Wn=E4(Mn);Wn.isSome()?Wn.each(ws(QZ,Mn)):IZ(Mn,Vn)},fakeEventName:"insertLineBreak"},P6=(Mn,Vn)=>a$(Mn).filter(Wn=>Vn.length>0&&zh(Cs.fromDom(Wn),Vn)).isSome(),zZ=Mn=>P6(Mn,q2(Mn)),wG=Mn=>P6(Mn,HS(Mn)),E1=Qg.generate([{br:[]},{block:[]},{none:[]}]),uv=(Mn,Vn)=>wG(Mn),$6=Mn=>(Vn,Wn)=>wZ(Vn)===Mn,T4=(Mn,Vn)=>(Wn,jn)=>S6(Wn)===Mn.toUpperCase()===Vn,WZ=Mn=>{const Vn=x1(Mn.dom,Mn.selection.getStart());return ms(Vn)},sT=Mn=>T4("pre",Mn),UZ=()=>T4("summary",!0),d$=Mn=>(Vn,Wn)=>U2(Vn)===Mn,ZZ=(Mn,Vn)=>zZ(Mn),f$=(Mn,Vn)=>Vn,qZ=Mn=>{const Vn=bh(Mn),Wn=x1(Mn.dom,Mn.selection.getStart());return is(Wn)&&Mn.schema.isValidChild(Wn.nodeName,Vn)},A4=Mn=>{const Vn=Mn.selection.getRng(),Wn=Cs.fromDom(Vn.startContainer),Gn=Rm(Wn,Vn.startOffset).map(no=>Du(no)&&!yl(no));return Vn.collapsed&&Gn.getOr(!0)},T1=(Mn,Vn)=>(Wn,jn)=>ra(Mn,(no,ao)=>no&&ao(Wn,jn),!0)?zo.some(Vn):zo.none(),h$=(Mn,Vn)=>EB([T1([uv],E1.none()),T1([sT(!0),WZ],E1.none()),T1([UZ()],E1.br()),T1([sT(!0),d$(!1),f$],E1.br()),T1([sT(!0),d$(!1)],E1.block()),T1([sT(!0),d$(!0),f$],E1.block()),T1([sT(!0),d$(!0)],E1.br()),T1([$6(!0),f$],E1.br()),T1([$6(!0)],E1.block()),T1([ZZ],E1.br()),T1([f$],E1.br()),T1([qZ],E1.block()),T1([A4],E1.block())],[Mn,!!(Vn&&Vn.shiftKey)]).getOr(E1.none()),m$=(Mn,Vn,Wn)=>{Vn.selection.isCollapsed()||dR(Vn),!(is(Wn)&&b4(Vn,Mn.fakeEventName).isDefaultPrevented())&&(Mn.insert(Vn,Wn),is(Wn)&&nT(Vn,Mn.fakeEventName))},R6=(Mn,Vn)=>{const Wn=()=>m$(VZ,Mn,Vn),jn=()=>m$(E6,Mn,Vn),Gn=h$(Mn,Vn);switch(Z2(Mn)){case"linebreak":Gn.fold(Wn,Wn,Js);break;case"block":Gn.fold(jn,jn,Js);break;case"invert":Gn.fold(jn,Wn,Js);break;default:Gn.fold(Wn,jn,Js);break}},D6=xl(),jZ=D6.os.isiOS()&&D6.browser.isSafari(),M6=(Mn,Vn)=>{Vn.isDefaultPrevented()||(Vn.preventDefault(),oV(Mn.undoManager),Mn.undoManager.transact(()=>{R6(Mn,Vn)}))},N6=Mn=>{if(!Mn.collapsed)return!1;const Vn=Mn.startContainer;if(Ir(Vn)){const Wn=/^[\uAC00-\uD7AF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uD7B0-\uD7FF]$/,jn=Vn.data.charAt(Mn.startOffset-1);return Wn.test(jn)}else return!1},XZ=Mn=>{let Vn=zo.none();const Wn=Gn=>{Vn=zo.some(Gn.selection.getBookmark()),Gn.undoManager.add()},jn=(Gn,no)=>{Gn.undoManager.undo(),Vn.fold(Js,ao=>Gn.selection.moveToBookmark(ao)),M6(Gn,no),Vn=zo.none()};Mn.on("keydown",Gn=>{Gn.keyCode===va.ENTER&&(jZ&&N6(Mn.selection.getRng())?Wn(Mn):M6(Mn,Gn))}),Mn.on("keyup",Gn=>{Gn.keyCode===va.ENTER&&Vn.each(()=>jn(Mn,Gn))})},L6=(Mn,Vn,Wn)=>{const jn=aa.os.isMacOS()||aa.os.isiOS();n2([{keyCode:va.END,action:cl(gF,Mn,!0)},{keyCode:va.HOME,action:cl(gF,Mn,!1)},...jn?[]:[{keyCode:va.HOME,action:cl(ZP,Mn,!1),ctrlKey:!0,shiftKey:!0},{keyCode:va.END,action:cl(ZP,Mn,!0),ctrlKey:!0,shiftKey:!0}],{keyCode:va.END,action:cl(jP,Mn,!0)},{keyCode:va.HOME,action:cl(jP,Mn,!1)},{keyCode:va.END,action:cl(HP,Mn,!0,Vn)},{keyCode:va.HOME,action:cl(HP,Mn,!1,Vn)}],Wn).each(Gn=>{Wn.preventDefault()})},I6=(Mn,Vn)=>{Mn.on("keydown",Wn=>{Wn.isDefaultPrevented()||L6(Mn,Vn,Wn)})},YZ=Mn=>{Mn.on("input",Vn=>{Vn.isComposing||b9(Mn)})},GZ=xl(),P4=(Mn,Vn,Wn)=>{n2([{keyCode:va.PAGE_UP,action:cl(HP,Mn,!1,Vn)},{keyCode:va.PAGE_DOWN,action:cl(HP,Mn,!0,Vn)}],Wn)},B6=Mn=>Mn.stopImmediatePropagation(),F6=Mn=>Mn.keyCode===va.PAGE_UP||Mn.keyCode===va.PAGE_DOWN,rT=(Mn,Vn,Wn)=>{Wn&&!Mn.get()?Vn.on("NodeChange",B6,!0):!Wn&&Mn.get()&&Vn.off("NodeChange",B6),Mn.set(Wn)},KZ=(Mn,Vn)=>{if(GZ.os.isMacOS())return;const Wn=od(!1);Mn.on("keydown",jn=>{F6(jn)&&rT(Wn,Mn,!0)}),Mn.on("keyup",jn=>{jn.isDefaultPrevented()||P4(Mn,Vn,jn),F6(jn)&&Wn.get()&&(rT(Wn,Mn,!1),Mn.nodeChanged())})},$4=Mn=>{Mn.on("beforeinput",Vn=>{(!Mn.selection.isEditable()||Sr(Vn.getTargetRanges(),Wn=>!ZN(Mn.dom,Wn)))&&Vn.preventDefault()})},p$=(Mn,Vn)=>{const Wn=Vn.container(),jn=Vn.offset();return Ir(Wn)?(Wn.insertData(jn,Mn),zo.some(lr(Wn,jn+Mn.length))):Mh(Vn).map(Gn=>{const no=Cs.fromText(Mn);return Vn.isAtEnd()?fh(Gn,no):ed(Gn,no),lr(no.dom,Mn.length)})},R4=ws(p$,hc),H6=ws(p$," "),CG=(Mn,Vn,Wn)=>w5(Mn,Vn,Wn)?R4(Vn):H6(Vn),tS=Mn=>Vn=>Vn.fold(Wn=>cp(Mn.dom,lr.before(Wn)),Wn=>zm(Wn),Wn=>b1(Wn),Wn=>Sm(Mn.dom,lr.after(Wn))),JZ=(Mn,Vn,Wn)=>jn=>w5(Mn,jn,Wn)?R4(Vn):H6(Vn),Q6=Mn=>Vn=>{Mn.selection.setRng(Vn.toRange()),Mn.nodeChanged()},eq=(Mn,Vn)=>Mn.isEditable(Mn.getParent(Vn,"summary")),g$=Mn=>{const Vn=lr.fromRangeStart(Mn.selection.getRng()),Wn=Cs.fromDom(Mn.getBody());if(Mn.selection.isCollapsed()){const jn=ws(Rw,Mn),Gn=lr.fromRangeStart(Mn.selection.getRng());return Kh(jn,Mn.getBody(),Gn).bind(tS(Wn)).map(no=>()=>JZ(Wn,Vn,Mn.schema)(no).each(Q6(Mn)))}else return zo.none()},V6=Mn=>{const Vn=()=>{const Wn=Cs.fromDom(Mn.getBody());Mn.selection.isCollapsed()||Mn.getDoc().execCommand("Delete");const jn=lr.fromRangeStart(Mn.selection.getRng());CG(Wn,jn,Mn.schema).each(Q6(Mn))};return El(aa.browser.isFirefox()&&Mn.selection.isEditable()&&eq(Mn.dom,Mn.selection.getRng().startContainer),Vn)},z6=(Mn,Vn)=>{UM([{keyCode:va.SPACEBAR,action:cl(g$,Mn)},{keyCode:va.SPACEBAR,action:cl(V6,Mn)}],Vn).each(Wn=>{Vn.preventDefault(),b4(Mn,"insertText",{data:" "}).isDefaultPrevented()||(Wn(),nT(Mn,"insertText",{data:" "}))})},tq=Mn=>{Mn.on("keydown",Vn=>{Vn.isDefaultPrevented()||z6(Mn,Vn)})},W6=Mn=>ew(Mn)?[{keyCode:va.TAB,action:cl(IF,Mn,!0)},{keyCode:va.TAB,shiftKey:!0,action:cl(IF,Mn,!1)}]:[],nq=(Mn,Vn)=>{n2([...W6(Mn)],Vn).each(Wn=>{Vn.preventDefault()})},oq=Mn=>{Mn.on("keydown",Vn=>{Vn.isDefaultPrevented()||nq(Mn,Vn)})},sq=Mn=>{if(Mn.addShortcut("Meta+P","","mcePrint"),uZ(Mn),wO(Mn))return od(null);{const Vn=yW(Mn);return $4(Mn),UW(Mn),_U(Mn,Vn),SZ(Mn,Vn),XZ(Mn),tq(Mn),YZ(Mn),oq(Mn),I6(Mn,Vn),KZ(Mn,Vn),Vn}};class U6{constructor(Vn){this.lastPath=[],this.editor=Vn;let Wn;const jn=this;"onselectionchange"in Vn.getDoc()||Vn.on("NodeChange click mouseup keyup focus",Gn=>{const no=Vn.selection.getRng(),ao={startContainer:no.startContainer,startOffset:no.startOffset,endContainer:no.endContainer,endOffset:no.endOffset};(Gn.type==="nodechange"||!ev(ao,Wn))&&Vn.dispatch("SelectionChange"),Wn=ao}),Vn.on("contextmenu",()=>{Vn.dispatch("SelectionChange")}),Vn.on("SelectionChange",()=>{const Gn=Vn.selection.getStart(!0);Gn&&ik(Vn)&&!jn.isSameElementPath(Gn)&&Vn.dom.isChildOf(Gn,Vn.getBody())&&Vn.nodeChanged({selectionChange:!0})}),Vn.on("mouseup",Gn=>{!Gn.isDefaultPrevented()&&ik(Vn)&&(Vn.selection.getNode().nodeName==="IMG"?O1.setEditorTimeout(Vn,()=>{Vn.nodeChanged()}):Vn.nodeChanged())})}nodeChanged(Vn={}){const Wn=this.editor.selection;let jn;if(this.editor.initialized&&Wn&&!u_(this.editor)&&!this.editor.mode.isReadOnly()){const Gn=this.editor.getBody();jn=Wn.getStart(!0)||Gn,(jn.ownerDocument!==this.editor.getDoc()||!this.editor.dom.isChildOf(jn,Gn))&&(jn=Gn);const no=[];this.editor.dom.getParent(jn,ao=>ao===Gn?!0:(no.push(ao),!1)),this.editor.dispatch("NodeChange",{...Vn,element:jn,parents:no})}}isSameElementPath(Vn){let Wn;const jn=this.editor,Gn=nc(jn.dom.getParents(Vn,Qs,jn.getBody()));if(Gn.length===this.lastPath.length){for(Wn=Gn.length;Wn>=0&&Gn[Wn]===this.lastPath[Wn];Wn--);if(Wn===-1)return this.lastPath=Gn,!0}return this.lastPath=Gn,!1}}const b$=L0("image"),rq=Mn=>{const Vn=Mn;return zo.from(Vn[b$])},D4=(Mn,Vn)=>{const Wn=Mn;Wn[b$]=Vn},v$=L0("event"),y$=Mn=>{const Vn=Mn;return zo.from(Vn[v$])},iT=Mn=>Vn=>{const Wn=Vn;Wn[v$]=Mn},Z6=(Mn,Vn)=>iT(Vn)(Mn),q6=iT(0),iq=iT(2),O$=iT(1),lq=(Mn=>Vn=>{const Wn=Vn;return zo.from(Wn[v$]).exists(jn=>jn===Mn)})(0),cq=()=>Object.freeze({length:0,item:Mn=>null}),_$=L0("mode"),uq=Mn=>{const Vn=Mn;return zo.from(Vn[_$])},S$=Mn=>Vn=>{const Wn=Vn;Wn[_$]=Mn},j6=(Mn,Vn)=>S$(Vn)(Mn),X6=S$(0),M4=S$(2),Y6=S$(1),G6=Mn=>Vn=>{const Wn=Vn;return zo.from(Wn[_$]).exists(jn=>jn===Mn)},jw=G6(0),K6=G6(1),dq=(Mn,Vn)=>({...Vn,get length(){return Vn.length},add:(Wn,jn)=>{if(jw(Mn))if(xo(Wn)){if(!os(jn))return Vn.add(Wn,jn)}else return Vn.add(Wn);return null},remove:Wn=>{jw(Mn)&&Vn.remove(Wn)},clear:()=>{jw(Mn)&&Vn.clear()}}),fq=["none","copy","link","move"],hq=["none","copy","copyLink","copyMove","link","linkMove","move","all","uninitialized"],N4=()=>{const Mn=new window.DataTransfer;let Vn="move",Wn="all";const jn={get dropEffect(){return Vn},set dropEffect(Gn){Zs(fq,Gn)&&(Vn=Gn)},get effectAllowed(){return Wn},set effectAllowed(Gn){lq(jn)&&Zs(hq,Gn)&&(Wn=Gn)},get items(){return dq(jn,Mn.items)},get files(){return K6(jn)?cq():Mn.files},get types(){return Mn.types},setDragImage:(Gn,no,ao)=>{jw(jn)&&(D4(jn,{image:Gn,x:no,y:ao}),Mn.setDragImage(Gn,no,ao))},getData:Gn=>K6(jn)?"":Mn.getData(Gn),setData:(Gn,no)=>{jw(jn)&&Mn.setData(Gn,no)},clearData:Gn=>{jw(jn)&&Mn.clearData(Gn)}};return X6(jn),jn},u2=Mn=>{const Vn=N4(),Wn=uq(Mn);return M4(Mn),q6(Vn),Vn.dropEffect=Mn.dropEffect,Vn.effectAllowed=Mn.effectAllowed,rq(Mn).each(jn=>Vn.setDragImage(jn.image,jn.x,jn.y)),fs(Mn.types,jn=>{jn!=="Files"&&Vn.setData(jn,Mn.getData(jn))}),fs(Mn.files,jn=>Vn.items.add(jn)),y$(Mn).each(jn=>{Z6(Vn,jn)}),Wn.each(jn=>{j6(Mn,jn),j6(Vn,jn)}),Vn},mq=Mn=>{const Vn=Mn.getData("text/html");return Vn===""?zo.none():zo.some(Vn)},J6=(Mn,Vn)=>Mn.setData("text/html",Vn),L4="x-tinymce/html",w$=xs(L4),I4="",pq=Mn=>I4+Mn,e7=Mn=>Mn.replace(I4,""),t7=Mn=>Mn.indexOf(I4)!==-1,gq=Mn=>!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(Mn),kG=(Mn,Vn)=>{let Wn="<"+Mn;const jn=ia(Vn,(Gn,no)=>no+'="'+P0.encodeAllRaw(Gn)+'"');return jn.length&&(Wn+=" "+jn.join(" ")),Wn+">"},C$=(Mn,Vn,Wn)=>{const jn=Mn.split(/\n\n/),Gn=kG(Vn,Wn),no="",ao=Us(jn,vo=>vo.split(/\n/).join("
    ")),po=vo=>Gn+vo+no;return ao.length===1?ao[0]:Us(ao,po).join("")},n7="%MCEPASTEBIN%",bq=(Mn,Vn)=>{const{dom:Wn,selection:jn}=Mn,Gn=Mn.getBody();Vn.set(jn.getRng());const no=Wn.add(Mn.getBody(),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n7);aa.browser.isFirefox()&&Wn.setStyle(no,"left",Wn.getStyle(Gn,"direction",!0)==="rtl"?65535:-65535),Wn.bind(no,"beforedeactivate focusin focusout",ao=>{ao.stopPropagation()}),no.focus(),jn.select(no,!0)},vq=(Mn,Vn)=>{const Wn=Mn.dom;if(B4(Mn)){let jn;const Gn=Vn.get();for(;jn=B4(Mn);)Wn.remove(jn),Wn.unbind(jn);Gn&&Mn.selection.setRng(Gn)}Vn.set(null)},B4=Mn=>Mn.dom.get("mcepastebin"),yq=Mn=>is(Mn)&&Mn.id==="mcepastebin",Oq=Mn=>{const Vn=Mn.dom,Wn=(ao,po)=>{ao.appendChild(po),Vn.remove(po,!0)},[jn,...Gn]=nr(Mn.getBody().childNodes,yq);fs(Gn,ao=>{Wn(jn,ao)});const no=Vn.select("div[id=mcepastebin]",jn);for(let ao=no.length-1;ao>=0;ao--){const po=Vn.create("div");jn.insertBefore(po,no[ao]),Wn(po,no[ao])}return jn?jn.innerHTML:""},o7=Mn=>Mn===n7,_q=Mn=>{const Vn=od(null);return{create:()=>bq(Mn,Vn),remove:()=>vq(Mn,Vn),getEl:()=>B4(Mn),getHtml:()=>Oq(Mn),getLastRng:Vn.get}},s7=(Mn,Vn)=>(Lr.each(Vn,Wn=>{Do(Wn,RegExp)?Mn=Mn.replace(Wn,""):Mn=Mn.replace(Wn[0],Wn[1])}),Mn),Sq=Mn=>{const Vn=i1(),Wn=a0({},Vn);let jn="";const Gn=Vn.getVoidElements(),no=Lr.makeMap("script noscript style textarea video audio iframe object"," "),ao=Vn.getBlockElements(),po=vo=>{const Ao=vo.name,Fo=vo;if(Ao==="br"){jn+=` +`;return}if(Ao!=="wbr"){if(Gn[Ao]&&(jn+=" "),no[Ao]){jn+=" ";return}if(vo.type===3&&(jn+=vo.value),!(vo.name in Vn.getVoidElements())){let Qo=vo.firstChild;if(Qo)do po(Qo);while(Qo=Qo.next)}ao[Ao]&&Fo.next&&(jn+=` +`,Ao==="p"&&(jn+=` +`))}};return Mn=s7(Mn,[//g]),po(Wn.parse(Mn)),jn},r7=Mn=>(Mn=s7(Mn,[/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig,/|/g,[/( ?)\u00a0<\/span>( ?)/g,(Wn,jn,Gn)=>!jn&&!Gn?" ":hc],/
    /g,/
    $/i]),Mn),wq=Mn=>{let Vn=0;return()=>Mn+Vn++},Cq=Mn=>{const Vn=Mn.toLowerCase(),Wn={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"};return Lr.hasOwn(Wn,Vn)?"image/"+Wn[Vn]:"image/"+Vn},Hu=(Mn,Vn)=>{const Wn=a0({sanitize:jb(Mn),sandbox_iframes:b_(Mn)},Mn.schema);Wn.addNodeFilter("meta",Gn=>{Lr.each(Gn,no=>{no.remove()})});const jn=Wn.parse(Vn,{forced_root_block:!1,isRootContent:!0});return I_({validate:!0},Mn.schema).serialize(jn)},i7=(Mn,Vn)=>({content:Mn,cancelled:Vn}),a7=(Mn,Vn,Wn)=>{const jn=Mn.dom.create("div",{style:"display:none"},Vn),Gn=R3(Mn,jn,Wn);return i7(Gn.node.innerHTML,Gn.isDefaultPrevented())},kq=(Mn,Vn,Wn)=>{const jn=$3(Mn,Vn,Wn),Gn=Hu(Mn,jn.content);return Mn.hasEventListeners("PastePostProcess")&&!jn.isDefaultPrevented()?a7(Mn,Gn,Wn):i7(Gn,jn.isDefaultPrevented())},F4=(Mn,Vn,Wn)=>kq(Mn,Vn,Wn),k$=(Mn,Vn)=>(Mn.insertContent(Vn,{merge:YS(Mn),paste:!0}),!0),H4=Mn=>/^https?:\/\/[\w\-\/+=.,!;:&%@^~(){}?#]+$/i.test(Mn),xq=(Mn,Vn)=>H4(Vn)&&Sr(UC(Mn),Wn=>bd(Vn.toLowerCase(),`.${Wn.toLowerCase()}`)),l7=(Mn,Vn,Wn)=>(Mn.undoManager.extra(()=>{Wn(Mn,Vn)},()=>{Mn.insertContent('')}),!0),Q4=(Mn,Vn,Wn)=>(Mn.undoManager.extra(()=>{Wn(Mn,Vn)},()=>{Mn.execCommand("mceInsertLink",!1,Vn)}),!0),Eq=(Mn,Vn,Wn)=>!Mn.selection.isCollapsed()&&H4(Vn)?Q4(Mn,Vn,Wn):!1,Tq=(Mn,Vn,Wn)=>xq(Mn,Vn)?l7(Mn,Vn,Wn):!1,Aq=(Mn,Vn)=>{Lr.each([Eq,Tq,k$],Wn=>!Wn(Mn,Vn,k$))},c7=(Mn,Vn,Wn)=>{Wn||!h_(Mn)?k$(Mn,Vn):Aq(Mn,Vn)},Pq=wq("mceclip"),$q=Mn=>{const Vn=N4();return J6(Vn,Mn),M4(Vn),Vn},Xw=(Mn,Vn,Wn,jn,Gn)=>{const no=F4(Mn,Vn,Wn);if(!no.cancelled){const ao=no.content,po=()=>c7(Mn,ao,jn);Gn?b4(Mn,"insertFromPaste",{dataTransfer:$q(ao)}).isDefaultPrevented()||(po(),nT(Mn,"insertFromPaste")):po()}},x$=(Mn,Vn,Wn,jn)=>{const Gn=Wn||t7(Vn);Xw(Mn,e7(Vn),Gn,!1,jn)},nS=(Mn,Vn,Wn)=>{const jn=Mn.dom.encode(Vn).replace(/\r\n/g,` +`),Gn=V1(jn,zC(Mn)),no=C$(Gn,bh(Mn),Zb(Mn));Xw(Mn,no,!1,!0,Wn)},d2=Mn=>{const Vn={};if(Mn&&Mn.types)for(let Wn=0;WnVn in Mn&&Mn[Vn].length>0,u7=Mn=>oS(Mn,"text/html")||oS(Mn,"text/plain"),f2=(Mn,Vn)=>{const Wn=Vn.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return is(Wn)?Mn.dom.encode(Wn[1]):void 0},Rq=(Mn,Vn,Wn,jn)=>{const Gn=Pq(),no=nO(Mn)&&is(Wn.name),ao=no?f2(Mn,Wn.name):Gn,po=no?Wn.name:void 0,vo=Vn.create(Gn,Wn,jn,ao,po);return Vn.add(vo),vo},V4=(Mn,Vn)=>{JA(Vn.uri).each(({data:Wn,type:jn,base64Encoded:Gn})=>{const no=Gn?Wn:btoa(Wn),ao=Vn.file,po=Mn.editorUpload.blobCache,vo=po.getByData(no,jn),Ao=vo??Rq(Mn,po,ao,no);x$(Mn,``,!1,!0)})},Dq=Mn=>Mn.type==="paste",d7=Mn=>Promise.all(Us(Mn,Vn=>_Q(Vn).then(Wn=>({file:Vn,uri:Wn})))),f7=Mn=>{const Vn=UC(Mn);return Wn=>Dc(Wn.type,"image/")&&Sr(Vn,jn=>Cq(jn)===Wn.type)},z4=(Mn,Vn)=>{const Wn=Vn.items?cc(kc(Vn.items),Gn=>Gn.kind==="file"?[Gn.getAsFile()]:[]):[],jn=Vn.files?kc(Vn.files):[];return nr(Wn.length>0?Wn:jn,f7(Mn))},W4=(Mn,Vn,Wn)=>{const jn=Dq(Vn)?Vn.clipboardData:Vn.dataTransfer;if(f_(Mn)&&jn){const Gn=z4(Mn,jn);if(Gn.length>0)return Vn.preventDefault(),d7(Gn).then(no=>{Wn&&Mn.selection.setRng(Wn),fs(no,ao=>{V4(Mn,ao)})}),!0}return!1},Mq=Mn=>{var Vn,Wn;return aa.os.isAndroid()&&((Wn=(Vn=Mn.clipboardData)===null||Vn===void 0?void 0:Vn.items)===null||Wn===void 0?void 0:Wn.length)===0},Nq=Mn=>va.metaKeyPressed(Mn)&&Mn.keyCode===86||Mn.shiftKey&&Mn.keyCode===45,E$=(Mn,Vn,Wn,jn,Gn)=>{let no=r7(Wn);const ao=oS(Vn,w$())||t7(Wn),po=!ao&&gq(no),vo=H4(no);(o7(no)||!no.length||po&&!vo)&&(jn=!0),(jn||vo)&&(oS(Vn,"text/plain")&&po?no=Vn["text/plain"]:no=Sq(no)),!o7(no)&&(jn?nS(Mn,no,Gn):x$(Mn,no,ao,Gn))},Lq=(Mn,Vn,Wn)=>{let jn;const Gn=()=>Vn.getLastRng()||Mn.selection.getRng();Mn.on("keydown",no=>{Nq(no)&&!no.isDefaultPrevented()&&(jn=no.shiftKey&&no.keyCode===86)}),Mn.on("paste",no=>{if(no.isDefaultPrevented()||Mq(no))return;const ao=Wn.get()==="text"||jn;jn=!1;const po=d2(no.clipboardData);!u7(po)&&W4(Mn,no,Gn())||(oS(po,"text/html")?(no.preventDefault(),E$(Mn,po,po["text/html"],ao,!0)):oS(po,"text/plain")&&oS(po,"text/uri-list")?(no.preventDefault(),E$(Mn,po,po["text/plain"],ao,!0)):(Vn.create(),O1.setEditorTimeout(Mn,()=>{const vo=Vn.getHtml();Vn.remove(),E$(Mn,po,vo,ao,!1)},0)))})},h7=Mn=>{const Vn=Gn=>Dc(Gn,"webkit-fake-url"),Wn=Gn=>Dc(Gn,"data:"),jn=Gn=>{var no;return((no=Gn.data)===null||no===void 0?void 0:no.paste)===!0};Mn.parser.addNodeFilter("img",(Gn,no,ao)=>{if(!f_(Mn)&&jn(ao))for(const po of Gn){const vo=po.attr("src");xo(vo)&&!po.attr("data-mce-object")&&vo!==aa.transparentSrc&&(Vn(vo)||!p_(Mn)&&Wn(vo))&&po.remove()}})},U4=(Mn,Vn,Wn)=>{Lq(Mn,Vn,Wn),h7(Mn)},m7=(Mn,Vn)=>{Vn.get()==="text"?(Vn.set("html"),tA(Mn,!1)):(Vn.set("text"),tA(Mn,!0)),Mn.focus()},Iq=(Mn,Vn)=>{Mn.addCommand("mceTogglePlainTextPaste",()=>{m7(Mn,Vn)}),Mn.addCommand("mceInsertClipboardContent",(Wn,jn)=>{jn.html&&x$(Mn,jn.html,jn.internal,!1),jn.text&&nS(Mn,jn.text,!1)})},Bq=(Mn,Vn,Wn)=>{if(Mn)try{return Mn.clearData(),Mn.setData("text/html",Vn),Mn.setData("text/plain",Wn),Mn.setData(w$(),Vn),!0}catch{return!1}else return!1},p7=(Mn,Vn,Wn,jn)=>{Bq(Mn.clipboardData,Vn.html,Vn.text)?(Mn.preventDefault(),jn()):Wn(Vn.html,jn)},Z4=Mn=>(Vn,Wn)=>{const{dom:jn,selection:Gn}=Mn,no=jn.create("div",{contenteditable:"false","data-mce-bogus":"all"}),ao=jn.create("div",{contenteditable:"true"},Vn);jn.setStyles(no,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),no.appendChild(ao),jn.add(Mn.getBody(),no);const po=Gn.getRng();ao.focus();const vo=jn.createRng();vo.selectNodeContents(ao),Gn.setRng(vo),O1.setEditorTimeout(Mn,()=>{Gn.setRng(po),jn.remove(no),Wn()},0)},T$=Mn=>({html:pq(Mn.selection.getContent({contextual:!0})),text:Mn.selection.getContent({format:"text"})}),Fq=Mn=>!!Mn.dom.getParent(Mn.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",Mn.getBody()),q4=Mn=>!Mn.selection.isCollapsed()||Fq(Mn),g7=Mn=>Vn=>{!Vn.isDefaultPrevented()&&q4(Mn)&&Mn.selection.isEditable()&&p7(Vn,T$(Mn),Z4(Mn),()=>{if(aa.browser.isChromium()||aa.browser.isFirefox()){const Wn=Mn.selection.getRng();O1.setEditorTimeout(Mn,()=>{Mn.selection.setRng(Wn),Mn.execCommand("Delete")},0)}else Mn.execCommand("Delete")})},Hq=Mn=>Vn=>{!Vn.isDefaultPrevented()&&q4(Mn)&&p7(Vn,T$(Mn),Z4(Mn),Js)},b7=Mn=>{Mn.on("cut",g7(Mn)),Mn.on("copy",Hq(Mn))},v7=(Mn,Vn)=>{var Wn,jn;return ns.getCaretRangeFromPoint((Wn=Vn.clientX)!==null&&Wn!==void 0?Wn:0,(jn=Vn.clientY)!==null&&jn!==void 0?jn:0,Mn.getDoc())},Qq=Mn=>{const Vn=Mn["text/plain"];return Vn?Vn.indexOf("file://")===0:!1},y7=(Mn,Vn)=>{Mn.focus(),Vn&&Mn.selection.setRng(Vn)},Vq=Mn=>Sr(Mn.files,Vn=>/^image\//.test(Vn.type)),zq=(Mn,Vn,Wn,jn)=>{const Gn=Mn.getParent(Wn,ao=>Wl(Vn,ao));if(!Mo(Mn.getParent(Wn,"summary")))return!0;if(Gn&&Mr(jn,"text/html")){const ao=new DOMParser().parseFromString(jn["text/html"],"text/html").body;return!Mo(ao.querySelector(Gn.nodeName.toLowerCase()))}else return!1},A$=Mn=>{Mn.on("input",Vn=>{const Wn=jn=>Mo(jn.querySelector("summary"));if(Vn.inputType==="deleteByDrag"){const jn=nr(Mn.dom.select("details"),Wn);fs(jn,Gn=>{Ec(Gn.firstChild)&&Gn.firstChild.remove();const no=Mn.dom.create("summary");no.appendChild(Th().dom),Gn.prepend(no)})}})},Wq=(Mn,Vn)=>{lx(Mn)&&Mn.on("dragend dragover draggesture dragdrop drop drag",Wn=>{Wn.preventDefault(),Wn.stopPropagation()}),f_(Mn)||Mn.on("drop",Wn=>{const jn=Wn.dataTransfer;jn&&Vq(jn)&&Wn.preventDefault()}),Mn.on("drop",Wn=>{if(Wn.isDefaultPrevented())return;const jn=v7(Mn,Wn);if(ms(jn))return;const Gn=d2(Wn.dataTransfer),no=oS(Gn,w$());if((!u7(Gn)||Qq(Gn))&&W4(Mn,Wn,jn))return;const ao=Gn[w$()],po=ao||Gn["text/html"]||Gn["text/plain"],vo=zq(Mn.dom,Mn.schema,jn.startContainer,Gn),Ao=Vn.get();Ao&&!vo||po&&(Wn.preventDefault(),O1.setEditorTimeout(Mn,()=>{Mn.undoManager.transact(()=>{(ao||Ao&&vo)&&Mn.execCommand("Delete"),y7(Mn,jn);const Fo=r7(po);Gn["text/html"]?x$(Mn,Fo,no,!0):nS(Mn,Fo,!0)})}))}),Mn.on("dragstart",Wn=>{Vn.set(!0)}),Mn.on("dragover dragend",Wn=>{f_(Mn)&&!Vn.get()&&(Wn.preventDefault(),y7(Mn,v7(Mn,Wn))),Wn.type==="dragend"&&Vn.set(!1)}),A$(Mn)},O7=Mn=>{const Vn=Gn=>no=>{Gn(Mn,no)},Wn=cx(Mn);Yo(Wn)&&Mn.on("PastePreProcess",Vn(Wn));const jn=VC(Mn);Yo(jn)&&Mn.on("PastePostProcess",Vn(jn))},Uq=(Mn,Vn)=>{Mn.on("PastePreProcess",Wn=>{Wn.content=Vn(Mn,Wn.content,Wn.internal)})},Zq=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,j4=Mn=>Lr.trim(Mn).replace(Zq,Bm).toLowerCase(),_7=(Mn,Vn,Wn)=>{const jn=jS(Mn);if(Wn||jn==="all"||!XS(Mn))return Vn;const Gn=jn?jn.split(/[, ]/):[];if(Gn&&jn!=="none"){const no=Mn.dom,ao=Mn.selection.getNode();Vn=Vn.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,(po,vo,Ao,Fo)=>{const Qo=no.parseStyle(no.decode(Ao)),qo={};for(let bs=0;bs]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return Vn=Vn.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,(no,ao,po,vo)=>ao+' style="'+po+'"'+vo),Vn},qq=Mn=>{(aa.browser.isChromium()||aa.browser.isSafari())&&Uq(Mn,_7)},jq=Mn=>{const Vn=od(!1),Wn=od(m_(Mn)?"text":"html"),jn=_q(Mn);qq(Mn),Iq(Mn,Wn),O7(Mn),Mn.on("PreInit",()=>{b7(Mn),Wq(Mn,Vn),U4(Mn,jn,Wn)})},Xq=Mn=>{Mn.on("click",Vn=>{Mn.dom.getParent(Vn.target,"details")&&Vn.preventDefault()})},Yq=Mn=>{Mn.parser.addNodeFilter("details",Vn=>{const Wn=Zf(Mn);fs(Vn,jn=>{Wn==="expanded"?jn.attr("open","open"):Wn==="collapsed"&&jn.attr("open",null)})}),Mn.serializer.addNodeFilter("details",Vn=>{const Wn=DT(Mn);fs(Vn,jn=>{Wn==="expanded"?jn.attr("open","open"):Wn==="collapsed"&&jn.attr("open",null)})})},Gq=Mn=>{Xq(Mn),Yq(Mn)},S7=Ec,w7=Ir,Kq=Mn=>jl(Mn.dom),Jq=Mn=>Gf(Mn.dom),C7=Mn=>Vn=>Vs(Cs.fromDom(Mn),Vn),ej=(Mn,Vn,Wn)=>cf(Cs.fromDom(Mn),jn=>Jq(jn)||Wn.isBlock(ql(jn)),C7(Vn)).getOr(Cs.fromDom(Vn)).dom,k7=(Mn,Vn)=>cf(Cs.fromDom(Mn),Kq,C7(Vn)),x7=(Mn,Vn,Wn)=>{const jn=new mu(Mn,Vn),Gn=Wn?jn.next.bind(jn):jn.prev.bind(jn);let no=Mn;for(let ao=Wn?Mn:Gn();ao&&!S7(ao);ao=Gn())Xl(ao)&&(no=ao);return no},tj=(Mn,Vn,Wn)=>{const Gn=lr.fromRangeStart(Mn).getNode(),no=ej(Gn,Vn,Wn),ao=x7(Gn,no,!1),po=x7(Gn,no,!0),vo=document.createRange();return k7(ao,no).fold(()=>{w7(ao)?vo.setStart(ao,0):vo.setStartBefore(ao)},Ao=>vo.setStartBefore(Ao.dom)),k7(po,no).fold(()=>{w7(po)?vo.setEnd(po,po.data.length):vo.setEndAfter(po)},Ao=>vo.setEndAfter(Ao.dom)),vo},E7=Mn=>{const Vn=tj(Mn.selection.getRng(),Mn.getBody(),Mn.schema);Mn.selection.setRng(Pk(Vn))},T7=Mn=>{Mn.on("mousedown",Vn=>{Vn.detail>=3&&(Vn.preventDefault(),E7(Mn))})};var h2;(function(Mn){Mn.Before="before",Mn.After="after"})(h2||(h2={}));const nj=(Mn,Vn)=>Math.abs(Mn.left-Vn),oj=(Mn,Vn)=>Math.abs(Mn.right-Vn),sj=(Mn,Vn)=>Mn>=Vn.top&&Mn<=Vn.bottom,rj=(Mn,Vn)=>Mn.topVn.top,ij=(Mn,Vn)=>{const Wn=B2(Mn,Vn)/Math.min(Mn.height,Vn.height);return rj(Mn,Vn)&&Wn>.5},aj=(Mn,Vn)=>{const Wn=nr(Mn,jn=>sj(Vn,jn));return I2(Wn).fold(()=>[[],Mn],jn=>{const{pass:Gn,fail:no}=Vr(Mn,ao=>ij(ao,jn));return[Gn,no]})},P$=(Mn,Vn)=>({node:Mn.node,position:nj(Mn,Vn)Vn>Mn.left&&Vn{const Gn=Qo=>Xl(Qo.node)?zo.some(Qo):Oa(Qo.node)?X4(kc(Qo.node.childNodes),Vn,Wn,!1):zo.none(),no=(Qo,qo,ds)=>Gn(qo).filter(bs=>Math.abs(ds(Qo,Vn,Wn)-ds(bs,Vn,Wn))<2&&Ir(bs.node)),ao=(Qo,qo)=>{const ds=Vl(Qo,(bs,ls)=>qo(bs,Vn,Wn)-qo(ls,Vn,Wn));return Yl(ds,Gn).map(bs=>jn&&!Ir(bs.node)&&ds.length>1?no(bs,ds[1],qo).getOr(bs):bs)},[po,vo]=aj(HB(Mn),Wn),{pass:Ao,fail:Fo}=Vr(vo,Qo=>Qo.topao(Fo,ES)).orThunk(()=>ao(Ao,ES))},P7=(Mn,Vn,Wn,jn)=>{const Gn=(no,ao)=>{const po=Ao=>Oa(Ao)&&Ao.classList.contains("mce-drag-container"),vo=nr(no.dom.childNodes,Fs(po));return ao.fold(()=>X4(vo,Wn,jn,!0),Ao=>{const Fo=nr(vo,Qo=>Qo!==Ao.dom);return X4(Fo,Wn,jn,!0)}).orThunk(()=>(Vs(no,Mn)?zo.none():Uc(no)).bind(Fo=>Gn(Fo,zo.some(no))))};return Gn(Vn,zo.none())},$7=(Mn,Vn,Wn)=>{const jn=Cs.fromDom(Mn),Gn=Fa(jn),ao=Cs.fromPoint(Gn,Vn,Wn).filter(po=>Dr(jn,po)).getOr(jn);return P7(jn,ao,Vn,Wn)},$$=(Mn,Vn,Wn)=>$7(Mn,Vn,Wn).filter(jn=>ay(jn.node)).map(jn=>P$(jn,Vn)),R7=Mn=>{var Vn,Wn;const jn=Mn.getBoundingClientRect(),Gn=Mn.ownerDocument,no=Gn.documentElement,ao=Gn.defaultView;return{top:jn.top+((Vn=ao==null?void 0:ao.scrollY)!==null&&Vn!==void 0?Vn:0)-no.clientTop,left:jn.left+((Wn=ao==null?void 0:ao.scrollX)!==null&&Wn!==void 0?Wn:0)-no.clientLeft}},D7=Mn=>Mn.inline?R7(Mn.getBody()):{left:0,top:0},lj=Mn=>{const Vn=Mn.getBody();return Mn.inline?{left:Vn.scrollLeft,top:Vn.scrollTop}:{left:0,top:0}},M7=Mn=>{const Vn=Mn.getBody(),Wn=Mn.getDoc().documentElement,jn={left:Vn.scrollLeft,top:Vn.scrollTop},Gn={left:Vn.scrollLeft||Wn.scrollLeft,top:Vn.scrollTop||Wn.scrollTop};return Mn.inline?jn:Gn},cj=(Mn,Vn)=>{if(Vn.target.ownerDocument!==Mn.getDoc()){const Wn=R7(Mn.getContentAreaContainer()),jn=M7(Mn);return{left:Vn.pageX-Wn.left+jn.left,top:Vn.pageY-Wn.top+jn.top}}return{left:Vn.pageX,top:Vn.pageY}},N7=(Mn,Vn,Wn)=>({pageX:Wn.left-Mn.left+Vn.left,pageY:Wn.top-Mn.top+Vn.top}),uj=(Mn,Vn)=>N7(D7(Mn),lj(Mn),cj(Mn,Vn)),L7=Mn=>({target:Mn,srcElement:Mn}),dj=(Mn,Vn,Wn,jn)=>({...Vn,dataTransfer:jn,type:Mn,...L7(Wn)}),aT=(Mn,Vn,Wn)=>{const jn=Br("Function not supported on simulated event.");return{bubbles:!0,cancelBubble:!1,cancelable:!0,composed:!1,currentTarget:null,defaultPrevented:!1,eventPhase:0,isTrusted:!0,returnValue:!1,timeStamp:0,type:Mn,composedPath:jn,initEvent:jn,preventDefault:Js,stopImmediatePropagation:Js,stopPropagation:Js,AT_TARGET:window.Event.AT_TARGET,BUBBLING_PHASE:window.Event.BUBBLING_PHASE,CAPTURING_PHASE:window.Event.CAPTURING_PHASE,NONE:window.Event.NONE,altKey:!1,button:0,buttons:0,clientX:0,clientY:0,ctrlKey:!1,metaKey:!1,movementX:0,movementY:0,offsetX:0,offsetY:0,pageX:0,pageY:0,relatedTarget:null,screenX:0,screenY:0,shiftKey:!1,x:0,y:0,detail:0,view:null,which:0,initUIEvent:jn,initMouseEvent:jn,getModifierState:jn,dataTransfer:Wn,...L7(Vn)}},fj=(Mn,Vn)=>{const Wn=u2(Mn);return Vn==="dragstart"?(q6(Wn),X6(Wn)):Vn==="drop"?(iq(Wn),M4(Wn)):(O$(Wn),Y6(Wn)),Wn},hj=(Mn,Vn,Wn,jn)=>{const Gn=fj(Wn,Mn);return os(jn)?aT(Mn,Vn,Gn):dj(Mn,jn,Vn,Gn)},lT=32,mj=100,R$=8,D$=16,I7=jl,pj=F2(I7,Gf),M$=(Mn,Vn,Wn)=>I7(Wn)&&Wn!==Vn&&Mn.isEditable(Wn.parentElement),B7=(Mn,Vn,Wn)=>ms(Vn)||Vn===Wn||Mn.dom.isChildOf(Vn,Wn)?!1:Mn.dom.isEditable(Vn),F7=(Mn,Vn,Wn,jn)=>{const Gn=Mn.dom,no=Vn.cloneNode(!0);Gn.setStyles(no,{width:Wn,height:jn}),Gn.setAttrib(no,"data-mce-selected",null);const ao=Gn.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return Gn.setStyles(ao,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:Wn,height:jn}),Gn.setStyles(no,{margin:0,boxSizing:"border-box"}),ao.appendChild(no),ao},gj=(Mn,Vn)=>{Mn.parentNode!==Vn&&Vn.appendChild(Mn)},N$=(Mn,Vn)=>Wn=>()=>{const jn=Mn==="left"?Wn.scrollX:Wn.scrollY;Wn.scroll({[Mn]:jn+Vn,behavior:"smooth"})},H7=N$("left",-lT),bj=N$("left",lT),Q7=N$("top",-lT),L$=N$("top",lT),Y4=(Mn,Vn,Wn,jn,Gn,no,ao,po,vo,Ao,Fo,Qo)=>{let qo=0,ds=0;Mn.style.left=Vn.pageX+"px",Mn.style.top=Vn.pageY+"px",Vn.pageX+Wn>Gn&&(qo=Vn.pageX+Wn-Gn),Vn.pageY+jn>no&&(ds=Vn.pageY+jn-no),Mn.style.width=Wn-qo+"px",Mn.style.height=jn-ds+"px";const bs=vo.clientHeight,ls=vo.clientWidth,ys=ao+vo.getBoundingClientRect().top,Ls=po+vo.getBoundingClientRect().left;Fo.on(zs=>{zs.intervalId.clear(),zs.dragging&&Qo&&(ao+R$>=bs?zs.intervalId.set(L$(Ao)):ao-R$<=0?zs.intervalId.set(Q7(Ao)):po+R$>=ls?zs.intervalId.set(bj(Ao)):po-R$<=0?zs.intervalId.set(H7(Ao)):ys+D$>=window.innerHeight?zs.intervalId.set(L$(window)):ys-D$<=0?zs.intervalId.set(Q7(window)):Ls+D$>=window.innerWidth?zs.intervalId.set(bj(window)):Ls-D$<=0&&zs.intervalId.set(H7(window)))})},cT=Mn=>{Mn&&Mn.parentNode&&Mn.parentNode.removeChild(Mn)},vj=(Mn,Vn)=>{const Wn=Mn.getParent(Vn.parentNode,Mn.isBlock);cT(Vn),Wn&&Wn!==Mn.getRoot()&&Mn.isEmpty(Wn)&&Kp(Cs.fromDom(Wn))},yj=Mn=>Mn.button===0,V7=(Mn,Vn)=>({pageX:Vn.pageX-Mn.relX,pageY:Vn.pageY+5}),Oj=(Mn,Vn)=>Wn=>{if(yj(Wn)){const jn=xa(Vn.dom.getParents(Wn.target),pj).getOr(null);if(is(jn)&&M$(Vn.dom,Vn.getBody(),jn)){const Gn=Vn.dom.getPos(jn),no=Vn.getBody(),ao=Vn.getDoc().documentElement;Mn.set({element:jn,dataTransfer:N4(),dragging:!1,screenX:Wn.screenX,screenY:Wn.screenY,maxX:(Vn.inline?no.scrollWidth:ao.offsetWidth)-2,maxY:(Vn.inline?no.scrollHeight:ao.offsetHeight)-2,relX:Wn.pageX-Gn.x,relY:Wn.pageY-Gn.y,width:jn.offsetWidth,height:jn.offsetHeight,ghost:F7(Vn,jn,jn.offsetWidth,jn.offsetHeight),intervalId:N2(mj)})}}},G4=(Mn,Vn,Wn)=>{Mn._selectionOverrides.hideFakeCaret(),$$(Mn.getBody(),Vn,Wn).fold(()=>Mn.selection.placeCaretAt(Vn,Wn),jn=>{const Gn=Mn._selectionOverrides.showCaret(1,jn.node,jn.position===h2.Before,!1);Gn?Mn.selection.setRng(Gn):Mn.selection.placeCaretAt(Vn,Wn)})},m2=(Mn,Vn,Wn,jn,Gn)=>{Vn==="dragstart"&&J6(jn,Mn.dom.getOuterHTML(Wn));const no=hj(Vn,Wn,jn,Gn);return Mn.dispatch(Vn,no)},_j=(Mn,Vn)=>{const Wn=Zy((Gn,no)=>G4(Vn,Gn,no),0);Vn.on("remove",Wn.cancel);const jn=Mn;return Gn=>Mn.on(no=>{const ao=Math.max(Math.abs(Gn.screenX-no.screenX),Math.abs(Gn.screenY-no.screenY));if(!no.dragging&&ao>10){const po=m2(Vn,"dragstart",no.element,no.dataTransfer,Gn);if(is(po.dataTransfer)&&(no.dataTransfer=po.dataTransfer),po.isDefaultPrevented())return;no.dragging=!0,Vn.focus()}if(no.dragging){const po=Gn.currentTarget===Vn.getDoc().documentElement,vo=V7(no,uj(Vn,Gn));gj(no.ghost,Vn.getBody()),Y4(no.ghost,vo,no.width,no.height,no.maxX,no.maxY,Gn.clientY,Gn.clientX,Vn.getContentAreaContainer(),Vn.getWin(),jn,po),Wn.throttle(Gn.clientX,Gn.clientY)}})},Sj=Mn=>{const Vn=Mn.getSel();if(is(Vn)){const jn=Vn.getRangeAt(0).startContainer;return Ir(jn)?jn.parentNode:jn}else return null},z7=(Mn,Vn)=>Wn=>{Mn.on(jn=>{var Gn;if(jn.intervalId.clear(),jn.dragging){if(B7(Vn,Sj(Vn.selection),jn.element)){const no=(Gn=Vn.getDoc().elementFromPoint(Wn.clientX,Wn.clientY))!==null&&Gn!==void 0?Gn:Vn.getBody();m2(Vn,"drop",no,jn.dataTransfer,Wn).isDefaultPrevented()||Vn.undoManager.transact(()=>{vj(Vn.dom,jn.element),mq(jn.dataTransfer).each(po=>Vn.insertContent(po)),Vn._selectionOverrides.hideFakeCaret()})}m2(Vn,"dragend",Vn.getBody(),jn.dataTransfer,Wn)}}),U7(Mn)},W7=(Mn,Vn,Wn)=>{Mn.on(jn=>{jn.intervalId.clear(),jn.dragging&&Wn.fold(()=>m2(Vn,"dragend",jn.element,jn.dataTransfer),Gn=>m2(Vn,"dragend",jn.element,jn.dataTransfer,Gn))}),U7(Mn)},xG=(Mn,Vn)=>Wn=>W7(Mn,Vn,zo.some(Wn)),U7=Mn=>{Mn.on(Vn=>{Vn.intervalId.clear(),cT(Vn.ghost)}),Mn.clear()},wj=Mn=>{const Vn=Fb(),Wn=Eu.DOM,jn=document,Gn=Oj(Vn,Mn),no=_j(Vn,Mn),ao=z7(Vn,Mn),po=xG(Vn,Mn);Mn.on("mousedown",Gn),Mn.on("mousemove",no),Mn.on("mouseup",ao),Wn.bind(jn,"mousemove",no),Wn.bind(jn,"mouseup",po),Mn.on("remove",()=>{Wn.unbind(jn,"mousemove",no),Wn.unbind(jn,"mouseup",po)}),Mn.on("keydown",vo=>{vo.keyCode===va.ESC&&W7(Vn,Mn,zo.none())})},Cj=Mn=>{const Vn=Gn=>{if(!Gn.isDefaultPrevented()){const no=Gn.dataTransfer;no&&(Zs(no.types,"Files")||no.files.length>0)&&(Gn.preventDefault(),Gn.type==="drop"&&yP(Mn,"Dropped file type is not supported"))}},Wn=Gn=>{pA(Mn,Gn.target)&&Vn(Gn)},jn=()=>{const Gn=Eu.DOM,no=Mn.dom,ao=document,po=Mn.inline?Mn.getBody():Mn.getDoc(),vo=["drop","dragover"];fs(vo,Ao=>{Gn.bind(ao,Ao,Wn),no.bind(po,Ao,Vn)}),Mn.on("remove",()=>{fs(vo,Ao=>{Gn.unbind(ao,Ao,Wn),no.unbind(po,Ao,Vn)})})};Mn.on("init",()=>{O1.setEditorTimeout(Mn,jn,0)})},Z7=Mn=>{wj(Mn),d_(Mn)&&Cj(Mn)},kj=Mn=>{const Vn=Zy(()=>{if(!Mn.removed&&Mn.getBody().contains(document.activeElement)){const Wn=Mn.selection.getRng();if(Wn.collapsed){const jn=$P(Mn,Wn,!1);Mn.selection.setRng(jn)}}},0);Mn.on("focus",()=>{Vn.throttle()}),Mn.on("blur",()=>{Vn.cancel()})},q7=Mn=>{Mn.on("init",()=>{Mn.on("focusin",Vn=>{const Wn=Vn.target;if(pu(Wn)){const jn=Nw(Mn.getBody(),Wn),Gn=jl(jn)?jn:Wn;Mn.selection.getNode()!==Gn&&jk(Mn,Gn).each(no=>Mn.selection.setRng(no))}})})},uT=jl,j7=(Mn,Vn)=>Nw(Mn.getBody(),Vn),xj=Mn=>{const Vn=Mn.selection,Wn=Mn.dom,jn=Mn.getBody(),Gn=rw(Mn,jn,Wn.isBlock,()=>L_(Mn)),no="sel-"+Wn.uniqueId(),ao="data-mce-selected";let po;const vo=fa=>is(fa)&&Wn.hasClass(fa,"mce-offscreen-selection"),Ao=fa=>fa!==jn&&(uT(fa)||pu(fa))&&Wn.isChildOf(fa,jn)&&Wn.isEditable(fa.parentNode),Fo=fa=>{fa&&Vn.setRng(fa)},Qo=(fa,yr,fr,Ar=!0)=>Mn.dispatch("ShowCaret",{target:yr,direction:fa,before:fr}).isDefaultPrevented()?null:(Ar&&Vn.scrollIntoView(yr,fa===-1),Gn.show(fr,yr)),qo=fa=>{fa.hasAttribute("data-mce-caret")&&(wp(fa),Vn.scrollIntoView(fa))},ds=()=>{Mn.on("click",yr=>{Wn.isEditable(yr.target)||(yr.preventDefault(),Mn.focus())}),Mn.on("blur NewBlock",tr),Mn.on("ResizeWindow FullscreenStateChanged",Gn.reposition),Mn.on("tap",yr=>{const fr=yr.target,Ar=j7(Mn,fr);uT(Ar)?(yr.preventDefault(),jk(Mn,Ar).each(Hs)):Ao(fr)&&jk(Mn,fr).each(Hs)},!0),Mn.on("mousedown",yr=>{const fr=yr.target;if(fr!==jn&&fr.nodeName!=="HTML"&&!Wn.isChildOf(fr,jn)||!JV(Mn,yr.clientX,yr.clientY))return;tr(),Ur();const Ar=j7(Mn,fr);uT(Ar)?(yr.preventDefault(),jk(Mn,Ar).each(Hs)):$$(jn,yr.clientX,yr.clientY).each(wa=>{yr.preventDefault();const Va=Qo(1,wa.node,wa.position===h2.Before,!1);Fo(Va),pf(Ar)?Ar.focus():Mn.getBody().focus()})}),Mn.on("keypress",yr=>{va.modifierPressed(yr)||uT(Vn.getNode())&&yr.preventDefault()}),Mn.on("GetSelectionRange",yr=>{let fr=yr.range;if(po){if(!po.parentNode){po=null;return}fr=fr.cloneRange(),fr.selectNode(po),yr.range=fr}}),Mn.on("SetSelectionRange",yr=>{yr.range=ys(yr.range);const fr=Hs(yr.range,yr.forward);fr&&(yr.range=fr)});const fa=yr=>Oa(yr)&&yr.id==="mcepastebin";Mn.on("AfterSetSelectionRange",yr=>{const fr=yr.range,Ar=fr.startContainer.parentElement;!ls(fr)&&!fa(Ar)&&Ur(),vo(Ar)||tr()}),Z7(Mn),kj(Mn),q7(Mn)},bs=fa=>La(fa)||Jf(fa)||hm(fa),ls=fa=>bs(fa.startContainer)||bs(fa.endContainer),ys=fa=>{const yr=Mn.schema.getVoidElements(),fr=Wn.createRng(),Ar=fa.startContainer,wa=fa.startOffset,Va=fa.endContainer,Tl=fa.endOffset;return Mr(yr,Ar.nodeName.toLowerCase())?wa===0?fr.setStartBefore(Ar):fr.setStartAfter(Ar):fr.setStart(Ar,wa),Mr(yr,Va.nodeName.toLowerCase())?Tl===0?fr.setEndBefore(Va):fr.setEndAfter(Va):fr.setEnd(Va,Tl),fr},Ls=(fa,yr)=>{const fr=Cs.fromDom(Mn.getBody()),Ar=Mn.getDoc(),wa=uf(fr,"#"+no).getOrThunk(()=>{const tc=Cs.fromHtml('
    ',Ar);return Gc(tc,"id",no),Fu(fr,tc),tc}),Va=Wn.createRng();Dm(wa),Lc(wa,[Cs.fromText(hc,Ar),Cs.fromDom(yr),Cs.fromText(hc,Ar)]),Va.setStart(wa.dom.firstChild,1),Va.setEnd(wa.dom.lastChild,0),ff(wa,{top:Wn.getPos(fa,Mn.getBody()).y+"px"}),lA(wa);const Tl=Vn.getSel();return Tl&&(Tl.removeAllRanges(),Tl.addRange(Va)),Va},zs=fa=>{const yr=fa.cloneNode(!0),fr=Mn.dispatch("ObjectSelected",{target:fa,targetClone:yr});if(fr.isDefaultPrevented())return null;const Ar=Ls(fa,fr.targetClone),wa=Cs.fromDom(fa);return fs(mf(Cs.fromDom(Mn.getBody()),`*[${ao}]`),Va=>{Vs(wa,Va)||Mu(Va,ao)}),Wn.getAttrib(fa,ao)||fa.setAttribute(ao,"1"),po=fa,Ur(),Ar},Hs=(fa,yr)=>{if(!fa)return null;if(fa.collapsed){if(!ls(fa)){const Va=yr?1:-1,Tl=nh(Va,jn,fa),tc=Tl.getNode(!yr);if(is(tc)){if(ay(tc))return Qo(Va,tc,yr?!Tl.isAtEnd():!1,!1);if(Jr(tc)&&jl(tc.nextSibling)){const Qu=Wn.createRng();return Qu.setStart(tc,0),Qu.setEnd(tc,0),Qu}}const uu=Tl.getNode(yr);if(is(uu)){if(ay(uu))return Qo(Va,uu,yr?!1:!Tl.isAtEnd(),!1);if(Jr(uu)&&jl(uu.previousSibling)){const Qu=Wn.createRng();return Qu.setStart(uu,1),Qu.setEnd(uu,1),Qu}}}return null}let fr=fa.startContainer,Ar=fa.startOffset;const wa=fa.endOffset;if(Ir(fr)&&Ar===0&&uT(fr.parentNode)&&(fr=fr.parentNode,Ar=Wn.nodeIndex(fr),fr=fr.parentNode),!Oa(fr))return null;if(wa===Ar+1&&fr===fa.endContainer){const Va=fr.childNodes[Ar];if(Ao(Va))return zs(Va)}return null},tr=()=>{po&&po.removeAttribute(ao),uf(Cs.fromDom(Mn.getBody()),"#"+no).each(sc),po=null},Pr=()=>{Gn.destroy(),po=null},Ur=()=>{Gn.hide()};return wO(Mn)||ds(),{showCaret:Qo,showBlockCaretContainer:qo,hideFakeCaret:Ur,destroy:Pr}},Ej=(Mn,Vn)=>{let Wn=Vn;for(let jn=Mn.previousSibling;Ir(jn);jn=jn.previousSibling)Wn+=jn.data.length;return Wn},X7=(Mn,Vn,Wn,jn,Gn)=>{if(Ir(Wn)&&(jn<0||jn>Wn.data.length))return[];const no=Gn&&Ir(Wn)?[Ej(Wn,jn)]:[jn];let ao=Wn;for(;ao!==Vn&&ao.parentNode;)no.push(Mn.nodeIndex(ao,Gn)),ao=ao.parentNode;return ao===Vn?no.reverse():[]},I$=(Mn,Vn,Wn,jn,Gn,no,ao=!1)=>{const po=X7(Mn,Vn,Wn,jn,ao),vo=X7(Mn,Vn,Gn,no,ao);return{start:po,end:vo}},Tj=(Mn,Vn)=>{const Wn=Vn.slice(),jn=Wn.pop();return Ys(jn)?ra(Wn,(no,ao)=>no.bind(po=>zo.from(po.childNodes[ao])),zo.some(Mn)).bind(no=>Ir(no)&&(jn<0||jn>no.data.length)?zo.none():zo.some({node:no,offset:jn})):zo.none()},Y7=(Mn,Vn)=>Tj(Mn,Vn.start).bind(({node:Wn,offset:jn})=>Tj(Mn,Vn.end).map(({node:Gn,offset:no})=>{const ao=document.createRange();return ao.setStart(Wn,jn),ao.setEnd(Gn,no),ao})),G7=(Mn,Vn,Wn,jn=!1)=>I$(Mn,Vn,Wn.startContainer,Wn.startOffset,Wn.endContainer,Wn.endOffset,jn),p2=(Mn,Vn,Wn)=>{if(Vn&&Mn.isEmpty(Vn)&&!Wn(Vn)){const jn=Vn.parentNode;Mn.remove(Vn,Ir(Vn.firstChild)&&Q1(Vn.firstChild.data)),p2(Mn,jn,Wn)}},g2=(Mn,Vn,Wn,jn=!0)=>{const Gn=Vn.startContainer.parentNode,no=Vn.endContainer.parentNode;Vn.deleteContents(),jn&&!Wn(Vn.startContainer)&&(Ir(Vn.startContainer)&&Vn.startContainer.data.length===0&&Mn.remove(Vn.startContainer),Ir(Vn.endContainer)&&Vn.endContainer.data.length===0&&Mn.remove(Vn.endContainer),p2(Mn,Gn,Wn),Gn!==no&&p2(Mn,no,Wn))},K4=(Mn,Vn)=>zo.from(Mn.dom.getParent(Vn.startContainer,Mn.dom.isBlock)),K7=(Mn,Vn,Wn)=>{const jn=Mn.dynamicPatternsLookup({text:Wn,block:Vn});return{...Mn,blockPatterns:Ub(jn).concat(Mn.blockPatterns),inlinePatterns:Jy(jn).concat(Mn.inlinePatterns)}},J7=(Mn,Vn,Wn,jn)=>{const Gn=Mn.createRng();return Gn.setStart(Vn,0),Gn.setEnd(Wn,jn),Gn.toString()},e8=Mn=>/^\s[^\s]/.test(Mn),dT=(Mn,Vn,Wn)=>{BF(Vn,0,Vn).each(Gn=>{const no=Gn.container;GP(no,Wn.start.length,Vn).each(vo=>{const Ao=Mn.createRng();Ao.setStart(no,0),Ao.setEnd(vo.container,vo.offset),g2(Mn,Ao,Fo=>Fo===Vn)});const ao=Cs.fromDom(no),po=fm(ao);e8(po)&&Pf(ao,po.slice(1))})},t8=(Mn,Vn)=>{const Wn=Mn.dom,jn=Vn.pattern,Gn=Y7(Wn.getRoot(),Vn.range).getOrDie("Unable to resolve path range"),no=(ao,po)=>{const vo=po.get(ao);return Jo(vo)&&qa(vo).exists(Ao=>Mr(Ao,"block"))};return K4(Mn,Gn).each(ao=>{jn.type==="block-format"?no(jn.format,Mn.formatter)&&Mn.undoManager.transact(()=>{dT(Mn.dom,ao,jn),Mn.formatter.apply(jn.format)}):jn.type==="block-command"&&Mn.undoManager.transact(()=>{dT(Mn.dom,ao,jn),Mn.execCommand(jn.cmd,!1,jn.value)})}),!0},n8=Mn=>Vl(Mn,(Vn,Wn)=>Wn.start.length-Vn.start.length),Aj=(Mn,Vn)=>{const Wn=n8(Mn),jn=Vn.replace(hc," ");return xa(Wn,Gn=>Vn.indexOf(Gn.start)===0||jn.indexOf(Gn.start)===0)},Pj=(Mn,Vn,Wn,jn)=>{var Gn;const no=Mn.dom,ao=bh(Mn);if(!no.is(Vn,ao))return[];const po=(Gn=Vn.textContent)!==null&&Gn!==void 0?Gn:"";return Aj(Wn.blockPatterns,po).map(vo=>Lr.trim(po).length===vo.start.length?[]:[{pattern:vo,range:I$(no,no.getRoot(),Vn,0,Vn,0,jn)}]).getOr([])},o8=(Mn,Vn)=>{if(Vn.length===0)return;const Wn=Mn.selection.getBookmark();fs(Vn,jn=>t8(Mn,jn)),Mn.selection.moveToBookmark(Wn)},s8=(Mn,Vn)=>Mn.create("span",{"data-mce-type":"bookmark",id:Vn}),B$=(Mn,Vn)=>{const Wn=Mn.createRng();return Wn.setStartAfter(Vn.start),Wn.setEndBefore(Vn.end),Wn},r8=(Mn,Vn,Wn)=>{const jn=Y7(Mn.getRoot(),Wn).getOrDie("Unable to resolve path range"),Gn=jn.startContainer,no=jn.endContainer,ao=jn.endOffset===0?no:no.splitText(jn.endOffset),po=jn.startOffset===0?Gn:Gn.splitText(jn.startOffset),vo=po.parentNode,Ao=ao.parentNode;return{prefix:Vn,end:Ao.insertBefore(s8(Mn,Vn+"-end"),ao),start:vo.insertBefore(s8(Mn,Vn+"-start"),po)}},F$=(Mn,Vn,Wn)=>{p2(Mn,Mn.get(Vn.prefix+"-end"),Wn),p2(Mn,Mn.get(Vn.prefix+"-start"),Wn)},J4=Mn=>Mn.start.length===0,$j=Mn=>(Vn,Wn)=>{const Gn=Vn.data.substring(0,Wn),no=Gn.lastIndexOf(Mn.charAt(Mn.length-1)),ao=Gn.lastIndexOf(Mn);return ao!==-1?ao+Mn.length:no!==-1?no+1:-1},i8=(Mn,Vn,Wn,jn)=>{const Gn=Vn.start;return jE(Mn,jn.container,jn.offset,$j(Gn),Wn).bind(ao=>{var po,vo;const Ao=(vo=(po=Wn.textContent)===null||po===void 0?void 0:po.indexOf(Gn))!==null&&vo!==void 0?vo:-1;if(Ao!==-1&&ao.offset>=Ao+Gn.length){const Qo=Mn.createRng();return Qo.setStart(ao.container,ao.offset-Gn.length),Qo.setEnd(ao.container,ao.offset),zo.some(Qo)}else{const Qo=ao.offset-Gn.length;return qE(ao.container,Qo,Wn).map(qo=>{const ds=Mn.createRng();return ds.setStart(qo.container,qo.offset),ds.setEnd(ao.container,ao.offset),ds}).filter(qo=>qo.toString()===Gn).orThunk(()=>i8(Mn,Vn,Wn,d0(ao.container,0)))}})},Rj=(Mn,Vn,Wn,jn,Gn,no=!1)=>{if(Vn.start.length===0&&!no){const ao=Mn.createRng();return ao.setStart(Wn,jn),ao.setEnd(Wn,jn),zo.some(ao)}return ZE(Wn,jn,Gn).bind(ao=>i8(Mn,Vn,Gn,ao).bind(vo=>{var Ao;if(no){if(vo.endContainer===ao.container&&vo.endOffset===ao.offset)return zo.none();if(ao.offset===0&&((Ao=vo.endContainer.textContent)===null||Ao===void 0?void 0:Ao.length)===vo.endOffset)return zo.none()}return zo.some(vo)}))},Dj=(Mn,Vn,Wn,jn)=>{const Gn=Mn.dom,no=Gn.getRoot(),ao=Wn.pattern,po=Wn.position.container,vo=Wn.position.offset;return qE(po,vo-Wn.pattern.end.length,Vn).bind(Ao=>{const Fo=I$(Gn,no,Ao.container,Ao.offset,po,vo,jn);if(J4(ao))return zo.some({matches:[{pattern:ao,startRng:Fo,endRng:Fo}],position:Ao});{const Qo=H$(Mn,Wn.remainingPatterns,Ao.container,Ao.offset,Vn,jn),qo=Qo.getOr({matches:[],position:Ao}),ds=qo.position;return Rj(Gn,ao,ds.container,ds.offset,Vn,Qo.isNone()).map(ls=>{const ys=G7(Gn,no,ls,jn);return{matches:qo.matches.concat([{pattern:ao,startRng:ys,endRng:Fo}]),position:d0(ls.startContainer,ls.startOffset)}})}})},H$=(Mn,Vn,Wn,jn,Gn,no)=>{const ao=Mn.dom;return ZE(Wn,jn,ao.getRoot()).bind(po=>{const vo=J7(ao,Gn,Wn,jn);for(let Ao=0;Ao0)return H$(Mn,Vn,Wn,jn-1,Gn,no);if(qo.isSome())return qo}return zo.none()})},eN=(Mn,Vn,Wn)=>{Mn.selection.setRng(Wn),Vn.type==="inline-format"?fs(Vn.format,jn=>{Mn.formatter.apply(jn)}):Mn.execCommand(Vn.cmd,!1,Vn.value)},a8=(Mn,Vn,Wn,jn)=>{const Gn=B$(Mn.dom,Wn);g2(Mn.dom,Gn,jn),eN(Mn,Vn,Gn)},tN=(Mn,Vn,Wn,jn,Gn)=>{const no=Mn.dom,ao=B$(no,jn),po=B$(no,Wn);g2(no,po,Gn),g2(no,ao,Gn);const vo={prefix:Wn.prefix,start:Wn.end,end:jn.start},Ao=B$(no,vo);eN(Mn,Vn,Ao)},nN=(Mn,Vn)=>{const Wn=L0("mce_textpattern"),jn=Kr(Vn,(Gn,no)=>{const ao=r8(Mn,Wn+`_end${Gn.length}`,no.endRng);return Gn.concat([{...no,endMarker:ao}])},[]);return Kr(jn,(Gn,no)=>{const ao=jn.length-Gn.length-1,po=J4(no.pattern)?no.endMarker:r8(Mn,Wn+`_start${ao}`,no.startRng);return Gn.concat([{...no,startMarker:po}])},[])},Mj=Mn=>Vl(Mn,(Vn,Wn)=>Wn.end.length-Vn.end.length),oN=(Mn,Vn)=>{const Wn=gc(Mn,jn=>Sr(Vn,Gn=>jn.pattern.start===Gn.pattern.start&&jn.pattern.end===Gn.pattern.end));return Mn.length===Vn.length?Wn?Mn:Vn:Mn.length>Vn.length?Mn:Vn},l8=(Mn,Vn,Wn,jn,Gn,no)=>{const ao=H$(Mn,Gn.inlinePatterns,Wn,jn,Vn,no).fold(()=>[],vo=>vo.matches),po=H$(Mn,Mj(Gn.inlinePatterns),Wn,jn,Vn,no).fold(()=>[],vo=>vo.matches);return oN(ao,po)},c8=(Mn,Vn)=>{if(Vn.length===0)return;const Wn=Mn.dom,jn=Mn.selection.getBookmark(),Gn=nN(Wn,Vn);fs(Gn,no=>{const ao=Wn.getParent(no.startMarker.start,Wn.isBlock),po=vo=>vo===ao;J4(no.pattern)?a8(Mn,no.pattern,no.endMarker,po):tN(Mn,no.pattern,no.startMarker,no.endMarker,po),F$(Wn,no.endMarker,po),F$(Wn,no.startMarker,po)}),Mn.selection.moveToBookmark(jn)},u8=(Mn,Vn)=>{const Wn=Mn.selection.getRng();return K4(Mn,Wn).map(jn=>{var Gn;const no=Math.max(0,Wn.startOffset),ao=K7(Vn,jn,(Gn=jn.textContent)!==null&&Gn!==void 0?Gn:""),po=l8(Mn,jn,Wn.startContainer,no,ao,!0),vo=Pj(Mn,jn,ao,!0);return vo.length>0||po.length>0?(Mn.undoManager.add(),Mn.undoManager.extra(()=>{Mn.execCommand("mceInsertNewLine")},()=>{as(Mn),c8(Mn,po),o8(Mn,vo);const Ao=Mn.selection.getRng(),Fo=ZE(Ao.startContainer,Ao.startOffset,Mn.dom.getRoot());Mn.execCommand("mceInsertNewLine"),Fo.each(Qo=>{const qo=Qo.container;qo.data.charAt(Qo.offset-1)===k0&&(qo.deleteData(Qo.offset-1,1),p2(Mn.dom,qo.parentNode,ds=>ds===Mn.dom.getRoot()))})}),!0):!1}).getOr(!1)},Nj=(Mn,Vn)=>{const Wn=Mn.selection.getRng();K4(Mn,Wn).map(jn=>{const Gn=Math.max(0,Wn.startOffset-1),no=J7(Mn.dom,jn,Wn.startContainer,Gn),ao=K7(Vn,jn,no),po=l8(Mn,jn,Wn.startContainer,Gn,ao,!1);po.length>0&&Mn.undoManager.transact(()=>{c8(Mn,po)})})},d8=(Mn,Vn,Wn)=>{for(let jn=0;jnd8(Mn,Vn,(Wn,jn)=>Wn===jn.keyCode&&!va.modifierPressed(jn)),Ij=(Mn,Vn)=>d8(Mn,Vn,(Wn,jn)=>Wn.charCodeAt(0)===jn.charCode),Bj=Mn=>{const Vn=[",",".",";",":","!","?"],Wn=[32],jn=()=>Om(g_(Mn),ux(Mn)),Gn=()=>KS(Mn);Mn.on("keydown",ao=>{if(ao.keyCode===13&&!va.modifierPressed(ao)&&Mn.selection.isCollapsed()){const po=jn();(po.inlinePatterns.length>0||po.blockPatterns.length>0||Gn())&&u8(Mn,po)&&ao.preventDefault()}},!0);const no=()=>{if(Mn.selection.isCollapsed()){const ao=jn();(ao.inlinePatterns.length>0||Gn())&&Nj(Mn,ao)}};Mn.on("keyup",ao=>{Lj(Wn,ao)&&no()}),Mn.on("keypress",ao=>{Ij(Vn,ao)&&O1.setEditorTimeout(Mn,no)})},Fj=Mn=>{Bj(Mn)},Hj=Mn=>{const Vn=Lr.each,Wn=va.BACKSPACE,jn=va.DELETE,Gn=Mn.dom,no=Mn.selection,ao=Mn.parser,po=aa.browser,vo=po.isFirefox(),Ao=po.isChromium()||po.isSafari(),Fo=aa.deviceType.isiPhone()||aa.deviceType.isiPad(),Qo=aa.os.isMacOS()||aa.os.isiOS(),qo=(Pa,ml)=>{try{Mn.getDoc().execCommand(Pa,!1,String(ml))}catch{}},ds=Pa=>Pa.isDefaultPrevented(),bs=()=>{const Pa=Yr=>{const pl=Gn.create("body"),pc=Yr.cloneContents();return pl.appendChild(pc),no.serializer.serialize(pl,{format:"html"})},ml=Yr=>{const pl=Pa(Yr),pc=Gn.createRng();pc.selectNode(Mn.getBody());const Pu=Pa(pc);return pl===Pu};Mn.on("keydown",Yr=>{const pl=Yr.keyCode;if(!ds(Yr)&&(pl===jn||pl===Wn)&&Mn.selection.isEditable()){const pc=Mn.selection.isCollapsed(),Pu=Mn.getBody();if(pc&&!md(Cs.fromDom(Pu))||!pc&&!ml(Mn.selection.getRng()))return;Yr.preventDefault(),Mn.setContent(""),Pu.firstChild&&Gn.isBlock(Pu.firstChild)?Mn.selection.setCursorLocation(Pu.firstChild,0):Mn.selection.setCursorLocation(Pu,0),Mn.nodeChanged()}})},ls=()=>{Mn.shortcuts.add("meta+a",null,"SelectAll")},ys=()=>{Mn.inline||Gn.bind(Mn.getDoc(),"mousedown mouseup",Pa=>{let ml;if(Pa.target===Mn.getDoc().documentElement)if(ml=no.getRng(),Mn.getBody().focus(),Pa.type==="mousedown"){if(La(ml.startContainer))return;no.placeCaretAt(Pa.clientX,Pa.clientY)}else no.setRng(ml)})},Ls=()=>{Mn.on("keydown",Pa=>{if(!ds(Pa)&&Pa.keyCode===Wn){if(!Mn.getBody().getElementsByTagName("hr").length)return;if(no.isCollapsed()&&no.getRng().startOffset===0){const ml=no.getNode(),Yr=ml.previousSibling;if(ml.nodeName==="HR"){Gn.remove(ml),Pa.preventDefault();return}Yr&&Yr.nodeName&&Yr.nodeName.toLowerCase()==="hr"&&(Gn.remove(Yr),Pa.preventDefault())}}})},zs=()=>{Range.prototype.getClientRects||Mn.on("mousedown",Pa=>{if(!ds(Pa)&&Pa.target.nodeName==="HTML"){const ml=Mn.getBody();ml.blur(),O1.setEditorTimeout(Mn,()=>{ml.focus()})}})},Hs=()=>{const Pa=FC(Mn);Mn.on("click",ml=>{const Yr=ml.target;/^(IMG|HR)$/.test(Yr.nodeName)&&Gn.isEditable(Yr)&&(ml.preventDefault(),Mn.selection.select(Yr),Mn.nodeChanged()),Yr.nodeName==="A"&&Gn.hasClass(Yr,Pa)&&Yr.childNodes.length===0&&Gn.isEditable(Yr.parentNode)&&(ml.preventDefault(),no.select(Yr))})},tr=()=>{const Pa=()=>{const Yr=Gn.getAttribs(no.getStart().cloneNode(!1));return()=>{const pl=no.getStart();pl!==Mn.getBody()&&(Gn.setAttrib(pl,"style",null),Vn(Yr,pc=>{pl.setAttributeNode(pc.cloneNode(!0))}))}},ml=()=>!no.isCollapsed()&&Gn.getParent(no.getStart(),Gn.isBlock)!==Gn.getParent(no.getEnd(),Gn.isBlock);Mn.on("keypress",Yr=>{let pl;return!ds(Yr)&&(Yr.keyCode===8||Yr.keyCode===46)&&ml()?(pl=Pa(),Mn.getDoc().execCommand("delete",!1),pl(),Yr.preventDefault(),!1):!0}),Gn.bind(Mn.getDoc(),"cut",Yr=>{if(!ds(Yr)&&ml()){const pl=Pa();O1.setEditorTimeout(Mn,()=>{pl()})}})},Pr=()=>{Mn.on("keydown",Pa=>{if(!ds(Pa)&&Pa.keyCode===Wn&&no.isCollapsed()&&no.getRng().startOffset===0){const ml=no.getNode().previousSibling;if(ml&&ml.nodeName&&ml.nodeName.toLowerCase()==="table")return Pa.preventDefault(),!1}return!0})},Ur=()=>{Mn.on("keydown",Pa=>{if(ds(Pa)||Pa.keyCode!==va.BACKSPACE)return;let ml=no.getRng();const Yr=ml.startContainer,pl=ml.startOffset,pc=Gn.getRoot();let Pu=Yr;if(!(!ml.collapsed||pl!==0)){for(;Pu.parentNode&&Pu.parentNode.firstChild===Pu&&Pu.parentNode!==pc;)Pu=Pu.parentNode;Pu.nodeName==="BLOCKQUOTE"&&(Mn.formatter.toggle("blockquote",void 0,Pu),ml=Gn.createRng(),ml.setStart(Yr,0),ml.setEnd(Yr,0),no.setRng(ml))}})},fa=()=>{const Pa=()=>{qo("StyleWithCSS",!1),qo("enableInlineTableEditing",!1),Jv(Mn)||qo("enableObjectResizing",!1)};oO(Mn)||Mn.on("BeforeExecCommand mousedown",Pa)},yr=()=>{const Pa=()=>{Vn(Gn.select("a:not([data-mce-block])"),ml=>{var Yr;let pl=ml.parentNode;const pc=Gn.getRoot();if((pl==null?void 0:pl.lastChild)===ml){for(;pl&&!Gn.isBlock(pl);){if(((Yr=pl.parentNode)===null||Yr===void 0?void 0:Yr.lastChild)!==pl||pl===pc)return;pl=pl.parentNode}Gn.add(pl,"br",{"data-mce-bogus":1})}})};Mn.on("SetContent ExecCommand",ml=>{(ml.type==="setcontent"||ml.command==="mceInsertLink")&&Pa()})},fr=()=>{Mn.on("init",()=>{qo("DefaultParagraphSeparator",bh(Mn))})},Ar=Pa=>{const ml=Pa.getBody(),Yr=Pa.selection.getRng();return Yr.startContainer===Yr.endContainer&&Yr.startContainer===ml&&Yr.startOffset===0&&Yr.endOffset===ml.childNodes.length},wa=()=>{Mn.on("keyup focusin mouseup",Pa=>{!va.modifierPressed(Pa)&&!Ar(Mn)&&no.normalize()},!0)},Va=()=>{Mn.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},Tl=()=>{Mn.inline||Mn.on("keydown",()=>{document.activeElement===document.body&&Mn.getWin().focus()})},tc=()=>{Mn.inline||(Mn.contentStyles.push("body {min-height: 150px}"),Mn.on("click",Pa=>{let ml;Pa.target.nodeName==="HTML"&&(ml=Mn.selection.getRng(),Mn.getBody().focus(),Mn.selection.setRng(ml),Mn.selection.normalize(),Mn.nodeChanged())}))},uu=()=>{Qo&&Mn.on("keydown",Pa=>{va.metaKeyPressed(Pa)&&!Pa.shiftKey&&(Pa.keyCode===37||Pa.keyCode===39)&&(Pa.preventDefault(),Mn.selection.getSel().modify("move",Pa.keyCode===37?"backward":"forward","lineboundary"))})},Qu=()=>{Mn.on("click",Pa=>{let ml=Pa.target;do if(ml.tagName==="A"){Pa.preventDefault();return}while(ml=ml.parentNode)}),Mn.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},Wd=()=>{Mn.on("init",()=>{Mn.dom.bind(Mn.getBody(),"submit",Pa=>{Pa.preventDefault()})})},Jh=()=>{ao.addNodeFilter("br",Pa=>{let ml=Pa.length;for(;ml--;)Pa[ml].attr("class")==="Apple-interchange-newline"&&Pa[ml].remove()})},_u=Js,ea=()=>{if(!vo||Mn.removed)return!1;const Pa=Mn.selection.getSel();return!Pa||!Pa.rangeCount||Pa.rangeCount===0},pa=()=>{Ao&&(ys(),Hs(),Wd(),ls(),Fo&&(Tl(),tc(),Qu())),vo&&(zs(),fa(),Va(),uu())},$c=()=>{Mn.on("drop",Pa=>{var ml;const Yr=(ml=Pa.dataTransfer)===null||ml===void 0?void 0:ml.getData("text/html");xo(Yr)&&/^]*>$/.test(Yr)&&Mn.dispatch("dragend",new window.DragEvent("dragend",Pa))})},ac=()=>{Ur(),bs(),aa.windowsPhone||wa(),Ao&&(ys(),Hs(),fr(),Wd(),Pr(),Jh(),Fo?(Tl(),tc(),Qu()):ls()),vo&&(Ls(),zs(),tr(),fa(),yr(),Va(),uu(),Pr(),$c())};return wO(Mn)?pa():ac(),{refreshContentEditable:_u,isHidden:ea}},Q$=Eu.DOM,Qj=(Mn,Vn)=>{const Wn=Cs.fromDom(Mn.getBody()),jn=N1(Wf(Wn)),Gn=Cs.fromTag("style");Gc(Gn,"type","text/css"),Fu(Gn,Cs.fromText(Vn)),Fu(jn,Gn),Mn.on("remove",()=>{sc(Gn)})},sN=Mn=>Mn.inline?Mn.getElement().nodeName.toLowerCase():void 0,rN=Mn=>pr(Mn,Vn=>os(Vn)===!1),f8=Mn=>{const Vn=Mn.options.get,Wn=Mn.editorUpload.blobCache;return rN({allow_conditional_comments:Vn("allow_conditional_comments"),allow_html_data_urls:Vn("allow_html_data_urls"),allow_svg_data_urls:Vn("allow_svg_data_urls"),allow_html_in_named_anchor:Vn("allow_html_in_named_anchor"),allow_script_urls:Vn("allow_script_urls"),allow_unsafe_link_target:Vn("allow_unsafe_link_target"),convert_unsafe_embeds:Vn("convert_unsafe_embeds"),convert_fonts_to_spans:Vn("convert_fonts_to_spans"),fix_list_elements:Vn("fix_list_elements"),font_size_legacy_values:Vn("font_size_legacy_values"),forced_root_block:Vn("forced_root_block"),forced_root_block_attrs:Vn("forced_root_block_attrs"),preserve_cdata:Vn("preserve_cdata"),inline_styles:Vn("inline_styles"),root_name:sN(Mn),sandbox_iframes:Vn("sandbox_iframes"),sanitize:Vn("xss_sanitization"),validate:!0,blob_cache:Wn,document:Mn.getDoc()})},h8=Mn=>{const Vn=Mn.options.get;return rN({custom_elements:Vn("custom_elements"),extended_valid_elements:Vn("extended_valid_elements"),invalid_elements:Vn("invalid_elements"),invalid_styles:Vn("invalid_styles"),schema:Vn("schema"),valid_children:Vn("valid_children"),valid_classes:Vn("valid_classes"),valid_elements:Vn("valid_elements"),valid_styles:Vn("valid_styles"),verify_html:Vn("verify_html"),padd_empty_block_inline_children:Vn("format_empty_lines")})},Vj=Mn=>{const Vn=Mn.options.get;return{...f8(Mn),...h8(Mn),...rN({remove_trailing_brs:Vn("remove_trailing_brs"),pad_empty_with_br:Vn("pad_empty_with_br"),url_converter:Vn("url_converter"),url_converter_scope:Vn("url_converter_scope"),element_format:Vn("element_format"),entities:Vn("entities"),entity_encoding:Vn("entity_encoding"),indent:Vn("indent"),indent_after:Vn("indent_after"),indent_before:Vn("indent_before")})}},zj=Mn=>{const Vn=a0(f8(Mn),Mn.schema);return Vn.addAttributeFilter("src,href,style,tabindex",(Wn,jn)=>{const Gn=Mn.dom,no="data-mce-"+jn;let ao=Wn.length;for(;ao--;){const po=Wn[ao];let vo=po.attr(jn);if(vo&&!po.attr(no)){if(vo.indexOf("data:")===0||vo.indexOf("blob:")===0)continue;jn==="style"?(vo=Gn.serializeStyle(Gn.parseStyle(vo),po.name),vo.length||(vo=null),po.attr(no,vo),po.attr(jn,vo)):jn==="tabindex"?(po.attr(no,vo),po.attr(jn,null)):po.attr(no,Mn.convertURL(vo,jn,po.name))}}}),Vn.addNodeFilter("script",Wn=>{let jn=Wn.length;for(;jn--;){const Gn=Wn[jn],no=Gn.attr("type")||"no/type";no.indexOf("mce-")!==0&&Gn.attr("type","mce-"+no)}}),GS(Mn)&&Vn.addNodeFilter("#cdata",Wn=>{var jn;let Gn=Wn.length;for(;Gn--;){const no=Wn[Gn];no.type=8,no.name="#comment",no.value="[CDATA["+Mn.dom.encode((jn=no.value)!==null&&jn!==void 0?jn:"")+"]]"}}),Vn.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",Wn=>{let jn=Wn.length;const Gn=Mn.schema.getNonEmptyElements();for(;jn--;){const no=Wn[jn];no.isEmpty(Gn)&&no.getAll("br").length===0&&no.append(new fp("br",1))}}),Vn},Wj=Mn=>{const Vn=HC(Mn);Vn&&O1.setEditorTimeout(Mn,()=>{let Wn;Vn===!0?Wn=Mn:Wn=Mn.editorManager.get(Vn),Wn&&!Wn.destroyed&&(Wn.focus(),Wn.selection.scrollIntoView())},100)},V$=Mn=>{const Vn=Mn.dom.getRoot();!Mn.inline&&(!ik(Mn)||Mn.selection.getStart(!0)===Vn)&&zm(Vn).each(Wn=>{const jn=Wn.getNode(),Gn=Gp(jn)?zm(jn).getOr(Wn):Wn;Mn.selection.setRng(Gn.toRange())})},Uj=Mn=>{Mn.bindPendingEventDelegates(),Mn.initialized=!0,_w(Mn),Mn.focus(!0),V$(Mn),Mn.nodeChanged({initial:!0});const Vn=rx(Mn);Yo(Vn)&&Vn.call(Mn,Mn),Wj(Mn)},iN=Mn=>Mn.inline?Mn.ui.styleSheetLoader:Mn.dom.styleSheetLoader,Zj=(Mn,Vn,Wn)=>{const{pass:jn,fail:Gn}=Vr(Vn,po=>tinymce.Resource.has(YD(po))),ao=[...jn.map(po=>{const vo=tinymce.Resource.get(YD(po));return xo(vo)?Promise.resolve(iN(Mn).loadRawCss(po,vo)):Promise.resolve()}),iN(Mn).loadAll(Gn)];return Mn.inline?ao:ao.concat([Mn.ui.styleSheetLoader.loadAll(Wn)])},m8=Mn=>{const Vn=iN(Mn),Wn=RC(Mn),jn=Mn.contentCSS,Gn=()=>{Vn.unloadAll(jn),Mn.inline||Mn.ui.styleSheetLoader.unloadAll(Wn)},no=()=>{Mn.removed?Gn():Mn.on("remove",Gn)};if(Mn.contentStyles.length>0){let vo="";Lr.each(Mn.contentStyles,Ao=>{vo+=Ao+`\r +`}),Mn.dom.addStyle(vo)}const ao=Promise.all(Zj(Mn,jn,Wn)).then(no).catch(no),po=l_(Mn);return po&&Qj(Mn,po),ao},qj=Mn=>{const Vn=Mn.getDoc(),Wn=Mn.getBody();fy(Mn),ax(Mn)||(Vn.body.spellcheck=!1,Q$.setAttrib(Wn,"spellcheck","false")),Mn.quirks=Hj(Mn),T3(Mn);const jn=G2(Mn);jn!==void 0&&(Wn.dir=jn);const Gn=QC(Mn);Gn&&Mn.on("BeforeSetContent",no=>{Lr.each(Gn,ao=>{no.content=no.content.replace(ao,po=>"")})}),Mn.on("SetContent",()=>{Mn.addVisual(Mn.getBody())}),Mn.on("compositionstart compositionend",no=>{Mn.composing=no.type==="compositionstart"})},jj=Mn=>{wO(Mn)||Mn.load({initial:!0,format:"html"}),Mn.startContent=Mn.getContent({format:"raw"})},aN=Mn=>{Mn.removed!==!0&&(jj(Mn),Uj(Mn))},Xj=Mn=>{let Vn=!1;const Wn=setTimeout(()=>{Vn||Mn.setProgressState(!0)},500);return()=>{clearTimeout(Wn),Vn=!0,Mn.setProgressState(!1)}},p8=Mn=>{const Vn=Mn.getElement();let Wn=Mn.getDoc();Mn.inline&&(Q$.addClass(Vn,"mce-content-body"),Mn.contentDocument=Wn=document,Mn.contentWindow=window,Mn.bodyElement=Vn,Mn.contentAreaContainer=Vn);const jn=Mn.getBody();jn.disabled=!0,Mn.readonly=oO(Mn),Mn._editableRoot=$p(Mn),!Mn.readonly&&Mn.hasEditableRoot()&&(Mn.inline&&Q$.getStyle(jn,"position",!0)==="static"&&(jn.style.position="relative"),jn.contentEditable="true"),jn.disabled=!1,Mn.editorUpload=vz(Mn),Mn.schema=i1(h8(Mn)),Mn.dom=Eu(Wn,{keep_values:!0,url_converter:Mn.convertURL,url_converter_scope:Mn,update_styles:!0,root_element:Mn.inline?Mn.getBody():null,collect:Mn.inline,schema:Mn.schema,contentCssCors:ab(Mn),referrerPolicy:Hl(Mn),onSetAttrib:ao=>{Mn.dispatch("SetAttrib",ao)},force_hex_color:ry(Mn)}),Mn.parser=zj(Mn),Mn.serializer=zI(Vj(Mn),Mn),Mn.selection=W_(Mn.dom,Mn.getWin(),Mn.serializer,Mn),Mn.annotator=Dx(Mn),Mn.formatter=eM(Mn),Mn.undoManager=tM(Mn),Mn._nodeChangeDispatcher=new U6(Mn),Mn._selectionOverrides=xj(Mn),BW(Mn),Gq(Mn),iG(Mn),wO(Mn)||(T7(Mn),Fj(Mn));const Gn=sq(Mn);Uw(Mn,Gn),VW(Mn),c0(Mn),jq(Mn);const no=hV(Mn);qj(Mn),no.fold(()=>{const ao=Xj(Mn);m8(Mn).then(()=>{aN(Mn),ao()})},ao=>{Mn.setProgressState(!0),m8(Mn).then(()=>{ao().then(po=>{Mn.setProgressState(!1),aN(Mn),WD(Mn)},po=>{Mn.notificationManager.open({type:"error",text:String(po)}),aN(Mn),WD(Mn)})})})},g8=Qs,Yj=(Mn,Vn,Wn)=>S0(Mn,Vn,g8,Wn),z$=Eu.DOM,Gj=(Mn,Vn,Wn,jn)=>{const Gn=Cs.fromTag("iframe");return jn.each(no=>Gc(Gn,"tabindex",no)),im(Gn,Wn),im(Gn,{id:Mn+"_ifr",frameBorder:"0",allowTransparency:"true",title:Vn}),Xm(Gn,"tox-edit-area__iframe"),Gn},Kj=Mn=>{let Vn=FS(Mn)+"";ap(Mn)!==Mn.documentBaseUrl&&(Vn+=''),Vn+='';const Wn=i_(Mn),jn=W2(Mn),Gn=Mn.translate(sx(Mn));return Zu(Mn)&&(Vn+=''),Vn+=`
    `,Vn},b8=(Mn,Vn)=>{const Wn=Mn.translate("Rich Text Area"),jn=Ld(Cs.fromDom(Mn.getElement()),"tabindex").bind(Em),Gn=Gj(Mn.id,Wn,Ic(Mn),jn).dom;Gn.onload=()=>{Gn.onload=null,Mn.dispatch("load")},Mn.contentAreaContainer=Vn.iframeContainer,Mn.iframeElement=Gn,Mn.iframeHTML=Kj(Mn),z$.add(Vn.iframeContainer,Gn)},fT=Mn=>{const Vn=Mn.iframeElement,Wn=()=>{Mn.contentDocument=Vn.contentDocument,p8(Mn)};if(fx(Mn)||aa.browser.isFirefox()){const jn=Mn.getDoc();jn.open(),jn.write(Mn.iframeHTML),jn.close(),Wn()}else{const jn=Yj(Cs.fromDom(Vn),"load",()=>{jn.unbind(),Wn()});Vn.srcdoc=Mn.iframeHTML}},Jj=(Mn,Vn)=>{b8(Mn,Vn),Vn.editorContainer&&(Vn.editorContainer.style.display=Mn.orgDisplay,Mn.hidden=z$.isHidden(Vn.editorContainer)),Mn.getElement().style.display="none",z$.setAttrib(Mn.id,"aria-hidden","true"),Mn.getElement().style.visibility=Mn.orgVisibility,fT(Mn)},lN=Eu.DOM,eX=(Mn,Vn,Wn)=>{const jn=Hw.get(Wn),Gn=Hw.urls[Wn]||Mn.documentBaseUrl.replace(/\/$/,"");if(Wn=Lr.trim(Wn),jn&&Lr.inArray(Vn,Wn)===-1){if(Mn.plugins[Wn])return;try{const no=jn(Mn,Gn)||{};Mn.plugins[Wn]=no,Yo(no.init)&&(no.init(Mn,Gn),Vn.push(Wn))}catch(no){tB(Mn,Wn,no)}}},tX=Mn=>Mn.replace(/^\-/,""),nX=Mn=>{const Vn=[];fs(sO(Mn),Wn=>{eX(Mn,Vn,tX(Wn))})},oX=Mn=>{const Vn=Lr.trim(QS(Mn)),Wn=Mn.ui.registry.getAll().icons,jn={...AE.get("default").icons,...AE.get(Vn).icons};Rr(jn,(Gn,no)=>{Mr(Wn,no)||Mn.ui.registry.addIcon(no,Gn)})},v8=Mn=>{const Vn=ey(Mn);if(xo(Vn)){const Wn=CO.get(Vn);Mn.theme=Wn(Mn,CO.urls[Vn])||{},Yo(Mn.theme.init)&&Mn.theme.init(Mn,CO.urls[Vn]||Mn.documentBaseUrl.replace(/\/$/,""))}else Mn.theme={}},sX=Mn=>{const Vn=c_(Mn),Wn=yb.get(Vn);Mn.model=Wn(Mn,yb.urls[Vn])},y8=Mn=>{const Vn=Mn.theme.renderUI;return Vn?Vn():_8(Mn)},rX=Mn=>{const Vn=Mn.getElement(),jn=ey(Mn)(Mn,Vn);return jn.editorContainer.nodeType&&(jn.editorContainer.id=jn.editorContainer.id||Mn.id+"_parent"),jn.iframeContainer&&jn.iframeContainer.nodeType&&(jn.iframeContainer.id=jn.iframeContainer.id||Mn.id+"_iframecontainer"),jn.height=jn.iframeHeight?jn.iframeHeight:Vn.offsetHeight,jn},O8=(Mn,Vn)=>({editorContainer:Mn,iframeContainer:Vn,api:{}}),iX=Mn=>{const Vn=lN.create("div");return lN.insertAfter(Vn,Mn),O8(Vn,Vn)},_8=Mn=>{const Vn=Mn.getElement();return Mn.inline?O8(null):iX(Vn)},aX=Mn=>{const Vn=Mn.getElement();return Mn.orgDisplay=Vn.style.display,xo(ey(Mn))?y8(Mn):Yo(ey(Mn))?rX(Mn):_8(Mn)},lX=(Mn,Vn)=>{const Wn={show:zo.from(Vn.show).getOr(Js),hide:zo.from(Vn.hide).getOr(Js),isEnabled:zo.from(Vn.isEnabled).getOr(Qs),setEnabled:jn=>{Mn.mode.isReadOnly()||zo.from(Vn.setEnabled).each(Gn=>Gn(jn))}};Mn.ui={...Mn.ui,...Wn}},cX=async Mn=>{Mn.dispatch("ScriptsLoaded"),oX(Mn),v8(Mn),sX(Mn),nX(Mn);const Vn=await aX(Mn);lX(Mn,zo.from(Vn.api).getOr({})),Mn.editorContainer=Vn.editorContainer,lz(Mn),Mn.inline?p8(Mn):Jj(Mn,{editorContainer:Vn.editorContainer,iframeContainer:Vn.iframeContainer})},Yw=Eu.DOM,S8=Mn=>Mn.charAt(0)==="-",w8=(Mn,Vn)=>{const Wn=WS(Vn),jn=Dh(Vn);if(!cg.hasCode(Wn)&&Wn!=="en"){const Gn=fc(jn)?jn:`${Vn.editorManager.baseURL}/langs/${Wn}.js`;Mn.add(Gn).catch(()=>{$E(Vn,Gn,Wn)})}},cN=(Mn,Vn)=>{const Wn=ey(Mn);if(xo(Wn)&&!S8(Wn)&&!Mr(CO.urls,Wn)){const jn=J2(Mn),Gn=jn?Mn.documentBaseURI.toAbsolute(jn):`themes/${Wn}/theme${Vn}.js`;CO.load(Wn,Gn).catch(()=>{sz(Mn,Gn,Wn)})}},C8=(Mn,Vn)=>{const Wn=c_(Mn);if(Wn!=="plugin"&&!Mr(yb.urls,Wn)){const jn=US(Mn),Gn=xo(jn)?Mn.documentBaseURI.toAbsolute(jn):`models/${Wn}/model${Vn}.js`;yb.load(Wn,Gn).catch(()=>{eB(Mn,Gn,Wn)})}},k8=Mn=>zo.from(V0(Mn)).filter(fc).map(Vn=>({url:Vn,name:zo.none()})),x8=(Mn,Vn,Wn)=>zo.from(Vn).filter(jn=>fc(jn)&&!AE.has(jn)).map(jn=>({url:`${Mn.editorManager.baseURL}/icons/${jn}/icons${Wn}.js`,name:zo.some(jn)})),uX=(Mn,Vn,Wn)=>{const jn=x8(Vn,"default",Wn),Gn=k8(Vn).orThunk(()=>x8(Vn,QS(Vn),""));fs(ku([jn,Gn]),no=>{Mn.add(no.url).catch(()=>{oz(Vn,no.url,no.name.getOrUndefined())})})},dX=(Mn,Vn)=>{const Wn=(jn,Gn)=>{Hw.load(jn,Gn).catch(()=>{oG(Mn,Gn,jn)})};Rr(qb(Mn),(jn,Gn)=>{Wn(Gn,jn),Mn.options.set("plugins",sO(Mn).concat(Gn))}),fs(sO(Mn),jn=>{jn=Lr.trim(jn),jn&&!Hw.urls[jn]&&!S8(jn)&&Wn(jn,`plugins/${jn}/plugin${Vn}.js`)})},E8=Mn=>{const Vn=ey(Mn);return!xo(Vn)||is(CO.get(Vn))},T8=Mn=>{const Vn=c_(Mn);return is(yb.get(Vn))},fX=(Mn,Vn)=>{const Wn=of.ScriptLoader,jn=()=>{!Mn.removed&&E8(Mn)&&T8(Mn)&&cX(Mn)};cN(Mn,Vn),C8(Mn,Vn),w8(Wn,Mn),uX(Wn,Mn,Vn),dX(Mn,Vn),Wn.loadQueue().then(jn,jn)},hX=(Mn,Vn)=>mS.forElement(Mn,{contentCssCors:oy(Vn),referrerPolicy:Hl(Vn)}),uN=Mn=>{const Vn=Mn.id;cg.setCode(WS(Mn));const Wn=()=>{Yw.unbind(window,"ready",Wn),Mn.render()};if(!vm.Event.domLoaded){Yw.bind(window,"ready",Wn);return}if(!Mn.getElement())return;const jn=Cs.fromDom(Mn.getElement()),Gn=zp(jn);Mn.on("remove",()=>{dr(jn.dom.attributes,ao=>Mu(jn,ao.name)),im(jn,Gn)}),Mn.ui.styleSheetLoader=hX(jn,Mn),ZS(Mn)?Mn.inline=!0:(Mn.orgVisibility=Mn.getElement().style.visibility,Mn.getElement().style.visibility="hidden");const no=Mn.getElement().form||Yw.getParent(Vn,"form");no&&(Mn.formElement=no,tx(Mn)&&!$g(Mn.getElement())&&(Yw.insertAfter(Yw.create("input",{type:"hidden",name:Vn}),Vn),Mn.hasHiddenInput=!0),Mn.formEventDelegate=ao=>{Mn.dispatch(ao.type,ao)},Yw.bind(no,"submit reset",Mn.formEventDelegate),Mn.on("reset",()=>{Mn.resetContent()}),BC(Mn)&&!no.submit.nodeType&&!no.submit.length&&!no._mceOldSubmit&&(no._mceOldSubmit=no.submit,no.submit=()=>(Mn.editorManager.triggerSave(),Mn.setDirty(!1),no._mceOldSubmit(no)))),Mn.windowManager=JI(Mn),Mn.notificationManager=XD(Mn),JS(Mn)&&Mn.on("GetContent",ao=>{ao.save&&(ao.content=Yw.encode(ao.content))}),p1(Mn)&&Mn.on("submit",()=>{Mn.initialized&&Mn.save()}),ty(Mn)&&(Mn._beforeUnload=()=>{Mn.initialized&&!Mn.destroyed&&!Mn.isHidden()&&Mn.save({format:"raw",no_events:!0,set_dirty:!1})},Mn.editorManager.on("BeforeUnload",Mn._beforeUnload)),Mn.editorManager.add(Mn),fX(Mn,Mn.suffix)},W$=(Mn,Vn)=>{Mn._editableRoot!==Vn&&(Mn._editableRoot=Vn,Mn.readonly||(Mn.getBody().contentEditable=String(Mn.hasEditableRoot()),Mn.nodeChanged()),D3(Mn,Vn))},U$=Mn=>Mn._editableRoot,TO=(Mn,Vn)=>({sections:xs(Mn),options:xs(Vn)}),hT=xl().deviceType,Gw=hT.isPhone(),A8=hT.isTablet(),mT=Mn=>{if(ms(Mn))return[];{const Vn=Jo(Mn)?Mn:Mn.split(/[ ,]/),Wn=Us(Vn,ih);return nr(Wn,fc)}},mX=(Mn,Vn)=>{const Wn=Ks(Vn,(jn,Gn)=>Zs(Mn,Gn));return TO(Wn.t,Wn.f)},P8=(Mn,Vn,Wn={})=>{const jn=Mn.sections(),Gn=Ma(jn,Vn).getOr({});return Lr.extend({},Wn,Gn)},dN=(Mn,Vn)=>Mr(Mn.sections(),Vn),fN=(Mn,Vn)=>dN(Mn,Vn)?Mn.sections()[Vn]:{},Z$=(Mn,Vn)=>({...{table_grid:!1,object_resizing:!1,resize:!1,toolbar_mode:Ma(Mn,"toolbar_mode").getOr("scrolling"),toolbar_sticky:!1},...Vn?{menubar:!1}:{}}),sS=(Mn,Vn)=>{var Wn;const jn=(Wn=Vn.external_plugins)!==null&&Wn!==void 0?Wn:{};return Mn&&Mn.external_plugins?Lr.extend({},Mn.external_plugins,jn):jn},Kw=(Mn,Vn)=>[...mT(Mn),...mT(Vn)],$8=(Mn,Vn,Wn,jn)=>Mn&&dN(Vn,"mobile")?jn:Wn,pX=(Mn,Vn,Wn,jn)=>{const Gn=mT(Wn.forced_plugins),no=mT(jn.plugins),ao=fN(Vn,"mobile"),po=ao.plugins?mT(ao.plugins):no,vo=$8(Mn,Vn,no,po),Ao=Kw(Gn,vo);return Lr.extend(jn,{forced_plugins:Gn,plugins:Ao})},gX=(Mn,Vn)=>Mn&&dN(Vn,"mobile"),bX=(Mn,Vn,Wn,jn,Gn)=>{var no;const ao=Mn?{mobile:Z$((no=Gn.mobile)!==null&&no!==void 0?no:{},Vn)}:{},po=mX(["mobile"],eT(ao,Gn)),vo=Lr.extend(Wn,jn,po.options(),gX(Mn,po)?P8(po,"mobile"):{},{external_plugins:sS(jn,po.options())});return pX(Mn,po,jn,vo)},vX=(Mn,Vn)=>bX(Gw||A8,Gw,Vn,Mn,Vn),yX=(Mn,Vn)=>kV(Mn,Vn),OX=Mn=>{const Vn=(jn,Gn)=>{Mn.formatter.toggle(jn,Gn),Mn.nodeChanged()},Wn=jn=>()=>{fs("left,center,right,justify".split(","),Gn=>{jn!==Gn&&Mn.formatter.remove("align"+Gn)}),jn!=="none"&&Vn("align"+jn)};Mn.editorCommands.addCommands({JustifyLeft:Wn("left"),JustifyCenter:Wn("center"),JustifyRight:Wn("right"),JustifyFull:Wn("justify"),JustifyNone:Wn("none")})},R8=Mn=>{const Vn=Wn=>()=>{const jn=Mn.selection,Gn=jn.isCollapsed()?[Mn.dom.getParent(jn.getNode(),Mn.dom.isBlock)]:jn.getSelectedBlocks();return Sr(Gn,no=>is(Mn.formatter.matchNode(no,Wn)))};Mn.editorCommands.addCommands({JustifyLeft:Vn("alignleft"),JustifyCenter:Vn("aligncenter"),JustifyRight:Vn("alignright"),JustifyFull:Vn("alignjustify")},"state")},_X=Mn=>{OX(Mn),R8(Mn)},SX=Mn=>{Mn.editorCommands.addCommands({"Cut,Copy,Paste":Vn=>{const Wn=Mn.getDoc();let jn;try{Wn.execCommand(Vn)}catch{jn=!0}if(Vn==="paste"&&!Wn.queryCommandEnabled(Vn)&&(jn=!0),jn||!Wn.queryCommandSupported(Vn)){let Gn=Mn.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");(aa.os.isMacOS()||aa.os.isiOS())&&(Gn=Gn.replace(/Ctrl\+/g,"⌘+")),Mn.notificationManager.open({text:Gn,type:"error"})}}})},wX=(Mn,Vn,Wn,jn)=>{const Gn=Cs.fromDom(Mn.getRoot());return Ck(Gn,lr.fromRangeStart(Vn),jn)?Wn=Wn.replace(/^ /," "):Wn=Wn.replace(/^ /," "),kk(Gn,lr.fromRangeEnd(Vn),jn)?Wn=Wn.replace(/( | )()?$/," "):Wn=Wn.replace(/ ()?$/," "),Wn},EG=Mn=>{if(typeof Mn!="string"){const Vn=Lr.extend({paste:Mn.paste,data:{paste:Mn.paste}},Mn);return{content:Mn.content,details:Vn}}return{content:Mn,details:{}}},CX=(Mn,Vn)=>{const Wn=Mn.selection,jn=Mn.dom;return/^ | $/.test(Vn)?wX(jn,Wn.getRng(),Vn,Mn.schema):Vn},b2=(Mn,Vn)=>{if(Mn.selection.isEditable()){const{content:Wn,details:jn}=EG(Vn);wD(Mn,{...jn,content:CX(Mn,Wn),format:"html",set:!1,selection:!0}).each(Gn=>{const no=wV(Mn,Gn.content,jn);iP(Mn,no,Gn),Mn.addVisual()})}},kX=Mn=>{Mn.editorCommands.addCommands({mceCleanup:()=>{const Vn=Mn.selection.getBookmark();Mn.setContent(Mn.getContent()),Mn.selection.moveToBookmark(Vn)},insertImage:(Vn,Wn,jn)=>{b2(Mn,Mn.dom.createHTML("img",{src:jn}))},insertHorizontalRule:()=>{Mn.execCommand("mceInsertContent",!1,"
    ")},insertText:(Vn,Wn,jn)=>{b2(Mn,Mn.dom.encode(jn))},insertHTML:(Vn,Wn,jn)=>{b2(Mn,jn)},mceInsertContent:(Vn,Wn,jn)=>{b2(Mn,jn)},mceSetContent:(Vn,Wn,jn)=>{Mn.setContent(jn)},mceReplaceContent:(Vn,Wn,jn)=>{Mn.execCommand("mceInsertContent",!1,jn.replace(/\{\$selection\}/g,Mn.selection.getContent({format:"text"})))},mceNewDocument:()=>{Mn.setContent(sy(Mn))}})},xX={"font-size":"size","font-family":"face"},D8=Qh("font"),EX=(Mn,Vn,Wn)=>{const jn=no=>fd(no,Mn).orThunk(()=>D8(no)?Ma(xX,Mn).bind(ao=>Ld(no,ao)):zo.none()),Gn=no=>Vs(Cs.fromDom(Vn),no);return OO(Cs.fromDom(Wn),no=>jn(no),Gn)},M8=Mn=>Mn.replace(/[\'\"\\]/g,"").replace(/,\s+/g,","),TX=(Mn,Vn)=>zo.from(Eu.DOM.getStyle(Vn,Mn,!0)),q$=Mn=>(Vn,Wn)=>zo.from(Wn).map(Cs.fromDom).filter(lf).bind(jn=>EX(Mn,Vn,jn.dom).or(TX(Mn,jn.dom))).getOr(""),AX=q$("font-size"),PX=ko(M8,q$("font-family")),$X=Mn=>zm(Mn.getBody()).bind(Vn=>{const Wn=Vn.container();return zo.from(Ir(Wn)?Wn.parentNode:Wn)}),RX=Mn=>zo.from(Mn.selection.getRng()).bind(Vn=>{const Wn=Mn.getBody();return Vn.startContainer===Wn&&Vn.startOffset===0?zo.none():zo.from(Mn.selection.getStart(!0))}),N8=(Mn,Vn)=>RX(Mn).orThunk(ws($X,Mn)).map(Cs.fromDom).filter(lf).bind(Vn),pT=(Mn,Vn)=>N8(Mn,gs(zo.some,Vn)),hN=(Mn,Vn)=>{if(/^[0-9.]+$/.test(Vn)){const Wn=parseInt(Vn,10);if(Wn>=1&&Wn<=7){const jn=hx(Mn),Gn=mx(Mn);return Gn.length>0?Gn[Wn-1]||Vn:jn[Wn-1]||Vn}else return Vn}else return Vn},mN=Mn=>{const Vn=Mn.split(/\s*,\s*/);return Us(Vn,Wn=>Wn.indexOf(" ")!==-1&&!(Dc(Wn,'"')||Dc(Wn,"'"))?`'${Wn}'`:Wn).join(",")},DX=(Mn,Vn)=>{const Wn=hN(Mn,Vn);Mn.formatter.toggle("fontname",{value:mN(Wn)}),Mn.nodeChanged()},TG=Mn=>pT(Mn,Vn=>PX(Mn.getBody(),Vn.dom)).getOr(""),AG=(Mn,Vn)=>{Mn.formatter.toggle("fontsize",{value:hN(Mn,Vn)}),Mn.nodeChanged()},MX=Mn=>pT(Mn,Vn=>AX(Mn.getBody(),Vn.dom)).getOr(""),L8=Mn=>pT(Mn,Vn=>{const Wn=Cs.fromDom(Mn.getBody()),jn=OO(Vn,no=>fd(no,"line-height"),ws(Vs,Wn)),Gn=()=>{const no=parseFloat(Ju(Vn,"line-height")),ao=parseFloat(Ju(Vn,"font-size"));return String(no/ao)};return jn.getOrThunk(Gn)}).getOr(""),NX=(Mn,Vn)=>{Mn.formatter.toggle("lineheight",{value:String(Vn)}),Mn.nodeChanged()},LX=Mn=>{const Vn=(Wn,jn)=>{Mn.formatter.toggle(Wn,jn),Mn.nodeChanged()};Mn.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":Wn=>{Vn(Wn)},"ForeColor,HiliteColor":(Wn,jn,Gn)=>{Vn(Wn,{value:Gn})},BackColor:(Wn,jn,Gn)=>{Vn("hilitecolor",{value:Gn})},FontName:(Wn,jn,Gn)=>{DX(Mn,Gn)},FontSize:(Wn,jn,Gn)=>{AG(Mn,Gn)},LineHeight:(Wn,jn,Gn)=>{NX(Mn,Gn)},Lang:(Wn,jn,Gn)=>{var no;Vn(Wn,{value:Gn.code,customValue:(no=Gn.customCode)!==null&&no!==void 0?no:null})},RemoveFormat:Wn=>{Mn.formatter.remove(Wn)},mceBlockQuote:()=>{Vn("blockquote")},FormatBlock:(Wn,jn,Gn)=>{Vn(xo(Gn)?Gn:"p")},mceToggleFormat:(Wn,jn,Gn)=>{Vn(Gn)}})},IX=Mn=>{const Vn=Wn=>Mn.formatter.match(Wn);Mn.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":Wn=>Vn(Wn),mceBlockQuote:()=>Vn("blockquote")},"state"),Mn.editorCommands.addQueryValueHandler("FontName",()=>TG(Mn)),Mn.editorCommands.addQueryValueHandler("FontSize",()=>MX(Mn)),Mn.editorCommands.addQueryValueHandler("LineHeight",()=>L8(Mn))},PG=Mn=>{LX(Mn),IX(Mn)},$G=Mn=>{Mn.editorCommands.addCommands({mceAddUndoLevel:()=>{Mn.undoManager.add()},mceEndUndoLevel:()=>{Mn.undoManager.add()},Undo:()=>{Mn.undoManager.undo()},Redo:()=>{Mn.undoManager.redo()}})},I8=Mn=>{Mn.editorCommands.addCommands({Indent:()=>{IW(Mn)},Outdent:()=>{BM(Mn)}}),Mn.editorCommands.addCommands({Outdent:()=>VP(Mn)},"state")},B8=Mn=>{const Vn=(Wn,jn,Gn)=>{const no=xo(Gn)?{href:Gn}:Gn,ao=Mn.dom.getParent(Mn.selection.getNode(),"a");Io(no)&&xo(no.href)&&(no.href=no.href.replace(/ /g,"%20"),(!ao||!no.href)&&Mn.formatter.remove("link"),no.href&&Mn.formatter.apply("link",no,ao))};Mn.editorCommands.addCommands({unlink:()=>{if(Mn.selection.isEditable()){if(Mn.selection.isCollapsed()){const Wn=Mn.dom.getParent(Mn.selection.getStart(),"a");Wn&&Mn.dom.remove(Wn,!0);return}Mn.formatter.remove("link")}},mceInsertLink:Vn,createLink:Vn})},BX=Mn=>{Mn.editorCommands.addCommands({"InsertUnorderedList,InsertOrderedList":Vn=>{Mn.getDoc().execCommand(Vn);const Wn=Mn.dom.getParent(Mn.selection.getNode(),"ol,ul");if(Wn){const jn=Wn.parentNode;if(jn&&/^(H[1-6]|P|ADDRESS|PRE)$/.test(jn.nodeName)){const Gn=Mn.selection.getBookmark();Mn.dom.split(jn,Wn),Mn.selection.moveToBookmark(Gn)}}}})},FX=Mn=>{Mn.editorCommands.addCommands({"InsertUnorderedList,InsertOrderedList":Vn=>{const Wn=Mn.dom.getParent(Mn.selection.getNode(),"ul,ol");return Wn&&(Vn==="insertunorderedlist"&&Wn.tagName==="UL"||Vn==="insertorderedlist"&&Wn.tagName==="OL")}},"state")},HX=Mn=>{BX(Mn),FX(Mn)},RG=(Mn,Vn,Wn,jn)=>{const Gn=Mn.dom,no=po=>Gn.isBlock(po)&&po.parentElement===Wn,ao=no(Vn)?Vn:Gn.getParent(jn,no,Wn);return zo.from(ao).map(Cs.fromDom)},QX=(Mn,Vn)=>{const Wn=Mn.dom,jn=Mn.selection.getRng(),Gn=Vn?Mn.selection.getStart():Mn.selection.getEnd(),no=Vn?jn.startContainer:jn.endContainer,ao=x1(Wn,no);if(!ao||!ao.isContentEditable)return;const po=Vn?ed:fh,vo=bh(Mn);RG(Mn,Gn,ao,no).each(Ao=>{const Fo=O4(Mn,no,Ao.dom,ao,!1,vo);po(Ao,Cs.fromDom(Fo)),Mn.selection.setCursorLocation(Fo,0),Mn.dispatch("NewBlock",{newBlock:Fo}),nT(Mn,"insertParagraph")})},DG=Mn=>QX(Mn,!0),VX=Mn=>QX(Mn,!1),MG=Mn=>{Mn.editorCommands.addCommands({InsertNewBlockBefore:()=>{DG(Mn)},InsertNewBlockAfter:()=>{VX(Mn)}})},zX=Mn=>{Mn.editorCommands.addCommands({insertParagraph:()=>{m$(E6,Mn)},mceInsertNewLine:(Vn,Wn,jn)=>{R6(Mn,jn)},InsertLineBreak:(Vn,Wn,jn)=>{m$(VZ,Mn)}})},Jw=Mn=>{Mn.editorCommands.addCommands({mceSelectNodeDepth:(Vn,Wn,jn)=>{let Gn=0;Mn.dom.getParent(Mn.selection.getNode(),no=>Oa(no)&&Gn++===jn?(Mn.selection.select(no),!1):!0,Mn.getBody())},mceSelectNode:(Vn,Wn,jn)=>{Mn.selection.select(jn)},selectAll:()=>{const Vn=Mn.dom.getParent(Mn.selection.getStart(),Gf);if(Vn){const Wn=Mn.dom.createRng();Wn.selectNodeContents(Vn),Mn.selection.setRng(Wn)}}})},pN=Mn=>{Mn.editorCommands.addCommands({mceRemoveNode:(Vn,Wn,jn)=>{const Gn=jn??Mn.selection.getNode();if(Gn!==Mn.getBody()){const no=Mn.selection.getBookmark();Mn.dom.remove(Gn,!0),Mn.selection.moveToBookmark(no)}},mcePrint:()=>{Mn.getWin().print()},mceFocus:(Vn,Wn,jn)=>{AH(Mn,jn===!0)},mceToggleVisualAid:()=>{Mn.hasVisual=!Mn.hasVisual,Mn.addVisual()}})},j$=Mn=>{_X(Mn),SX(Mn),$G(Mn),Jw(Mn),kX(Mn),B8(Mn),I8(Mn),MG(Mn),zX(Mn),HX(Mn),PG(Mn),pN(Mn)},F8=["toggleview"],gN=Mn=>Zs(F8,Mn.toLowerCase());class bN{constructor(Vn){this.commands={state:{},exec:{},value:{}},this.editor=Vn}execCommand(Vn,Wn=!1,jn,Gn){const no=this.editor,ao=Vn.toLowerCase(),po=Gn==null?void 0:Gn.skip_focus;if(no.removed||(ao!=="mcefocus"&&(!/^(mceAddUndoLevel|mceEndUndoLevel)$/i.test(ao)&&!po?no.focus():pH(no)),no.dispatch("BeforeExecCommand",{command:Vn,ui:Wn,value:jn}).isDefaultPrevented()))return!1;const Ao=this.commands.exec[ao];return Yo(Ao)?(Ao(ao,Wn,jn),no.dispatch("ExecCommand",{command:Vn,ui:Wn,value:jn}),!0):!1}queryCommandState(Vn){if(!gN(Vn)&&this.editor.quirks.isHidden()||this.editor.removed)return!1;const Wn=Vn.toLowerCase(),jn=this.commands.state[Wn];return Yo(jn)?jn(Wn):!1}queryCommandValue(Vn){if(!gN(Vn)&&this.editor.quirks.isHidden()||this.editor.removed)return"";const Wn=Vn.toLowerCase(),jn=this.commands.value[Wn];return Yo(jn)?jn(Wn):""}addCommands(Vn,Wn="exec"){const jn=this.commands;Rr(Vn,(Gn,no)=>{fs(no.toLowerCase().split(","),ao=>{jn[Wn][ao]=Gn})})}addCommand(Vn,Wn,jn){const Gn=Vn.toLowerCase();this.commands.exec[Gn]=(no,ao,po)=>Wn.call(jn??this.editor,ao,po)}queryCommandSupported(Vn){const Wn=Vn.toLowerCase();return!!this.commands.exec[Wn]}addQueryStateHandler(Vn,Wn,jn){this.commands.state[Vn.toLowerCase()]=()=>Wn.call(jn??this.editor)}addQueryValueHandler(Vn,Wn,jn){this.commands.value[Vn.toLowerCase()]=()=>Wn.call(jn??this.editor)}}const eC="data-mce-contenteditable",WX=(Mn,Vn,Wn)=>{yp(Mn,Vn)&&!Wn?Vf(Mn,Vn):Wn&&Xm(Mn,Vn)},vN=(Mn,Vn,Wn)=>{try{Mn.getDoc().execCommand(Vn,!1,String(Wn))}catch{}},X$=(Mn,Vn)=>{Mn.dom.contentEditable=Vn?"true":"false"},rS=Mn=>{fs(mf(Mn,'*[contenteditable="true"]'),Vn=>{Gc(Vn,eC,"true"),X$(Vn,!1)})},UX=Mn=>{fs(mf(Mn,`*[${eC}="true"]`),Vn=>{Mu(Vn,eC),X$(Vn,!0)})},H8=Mn=>{zo.from(Mn.selection.getNode()).each(Vn=>{Vn.removeAttribute("data-mce-selected")})},ZX=Mn=>{Mn.selection.setRng(Mn.selection.getRng())},Y$=(Mn,Vn)=>{const Wn=Cs.fromDom(Mn.getBody());WX(Wn,"mce-content-readonly",Vn),Vn?(Mn.selection.controlSelection.hideResizeRect(),Mn._selectionOverrides.hideFakeCaret(),H8(Mn),Mn.readonly=!0,X$(Wn,!1),rS(Wn)):(Mn.readonly=!1,Mn.hasEditableRoot()&&X$(Wn,!0),UX(Wn),vN(Mn,"StyleWithCSS",!1),vN(Mn,"enableInlineTableEditing",!1),vN(Mn,"enableObjectResizing",!1),UN(Mn)&&Mn.focus(),ZX(Mn),Mn.nodeChanged())},tC=Mn=>Mn.readonly,Q8=Mn=>{Mn.parser.addAttributeFilter("contenteditable",Vn=>{tC(Mn)&&fs(Vn,Wn=>{Wn.attr(eC,Wn.attr("contenteditable")),Wn.attr("contenteditable","false")})}),Mn.serializer.addAttributeFilter(eC,Vn=>{tC(Mn)&&fs(Vn,Wn=>{Wn.attr("contenteditable",Wn.attr(eC))})}),Mn.serializer.addTempAttr(eC)},qX=Mn=>{Mn.serializer?Q8(Mn):Mn.on("PreInit",()=>{Q8(Mn)})},V8=Mn=>Mn.type==="click",jX=["copy"],XX=Mn=>Zs(jX,Mn.type),YX=(Mn,Vn)=>cm(Vn,"a",jn=>Vs(jn,Cs.fromDom(Mn.getBody()))).bind(jn=>Ld(jn,"href")),yN=(Mn,Vn)=>{if(V8(Vn)&&!va.metaKeyPressed(Vn)){const Wn=Cs.fromDom(Vn.target);YX(Mn,Wn).each(jn=>{if(Vn.preventDefault(),/^#/.test(jn)){const Gn=Mn.dom.select(`${jn},[name="${ld(jn,"#")}"]`);Gn.length&&Mn.selection.scrollIntoView(Gn[0],!0)}else window.open(jn,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")})}else XX(Vn)&&Mn.dispatch(Vn.type,Vn)},GX=Mn=>{Mn.on("ShowCaret",Vn=>{tC(Mn)&&Vn.preventDefault()}),Mn.on("ObjectSelected",Vn=>{tC(Mn)&&Vn.preventDefault()})},KX=Lr.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," ");class If{static isNative(Vn){return!!KX[Vn.toLowerCase()]}constructor(Vn){this.bindings={},this.settings=Vn||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||hs}fire(Vn,Wn){return this.dispatch(Vn,Wn)}dispatch(Vn,Wn){const jn=Vn.toLowerCase(),Gn=Hv(jn,Wn??{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(Gn);const no=this.bindings[jn];if(no)for(let ao=0,po=no.length;ao{this.toggleEvent(vo,!1),delete this.bindings[vo]}),this;if(ao){if(!Wn)ao.length=0;else{const po=Vr(ao,vo=>vo.func===Wn);ao=po.fail,this.bindings[no]=ao,fs(po.pass,vo=>{vo.removed=!0})}ao.length||(this.toggleEvent(Vn,!1),delete this.bindings[no])}}}else Rr(this.bindings,(jn,Gn)=>{this.toggleEvent(Gn,!1)}),this.bindings={};return this}once(Vn,Wn,jn){return this.on(Vn,Wn,jn,{once:!0})}has(Vn){Vn=Vn.toLowerCase();const Wn=this.bindings[Vn];return!(!Wn||Wn.length===0)}}const gT=Mn=>(Mn._eventDispatcher||(Mn._eventDispatcher=new If({scope:Mn,toggleEvent:(Vn,Wn)=>{If.isNative(Vn)&&Mn.toggleNativeEvent&&Mn.toggleNativeEvent(Vn,Wn)}})),Mn._eventDispatcher),ON={fire(Mn,Vn,Wn){return this.dispatch(Mn,Vn,Wn)},dispatch(Mn,Vn,Wn){const jn=this;if(jn.removed&&Mn!=="remove"&&Mn!=="detach")return Hv(Mn.toLowerCase(),Vn??{},jn);const Gn=gT(jn).dispatch(Mn,Vn);if(Wn!==!1&&jn.parent){let no=jn.parent();for(;no&&!Gn.isPropagationStopped();)no.dispatch(Mn,Gn,!1),no=no.parent?no.parent():void 0}return Gn},on(Mn,Vn,Wn){return gT(this).on(Mn,Vn,Wn)},off(Mn,Vn){return gT(this).off(Mn,Vn)},once(Mn,Vn){return gT(this).once(Mn,Vn)},hasEventListeners(Mn){return gT(this).has(Mn)}},v2=Eu.DOM;let iS;const y2=(Mn,Vn)=>{if(Vn==="selectionchange")return Mn.getDoc();if(!Mn.inline&&/^(?:mouse|touch|click|contextmenu|drop|dragover|dragend)/.test(Vn))return Mn.getDoc().documentElement;const Wn=lb(Mn);return Wn?(Mn.eventRoot||(Mn.eventRoot=v2.select(Wn)[0]),Mn.eventRoot):Mn.getBody()},JX=Mn=>!Mn.hidden&&!tC(Mn),z8=(Mn,Vn,Wn)=>{JX(Mn)?Mn.dispatch(Vn,Wn):tC(Mn)&&yN(Mn,Wn)},W8=(Mn,Vn)=>{if(Mn.delegates||(Mn.delegates={}),Mn.delegates[Vn]||Mn.removed)return;const Wn=y2(Mn,Vn);if(lb(Mn)){if(iS||(iS={},Mn.editorManager.on("removeEditor",()=>{Mn.editorManager.activeEditor||iS&&(Rr(iS,(Gn,no)=>{Mn.dom.unbind(y2(Mn,no))}),iS=null)})),iS[Vn])return;const jn=Gn=>{const no=Gn.target,ao=Mn.editorManager.get();let po=ao.length;for(;po--;){const vo=ao[po].getBody();(vo===no||v2.isChildOf(no,vo))&&z8(ao[po],Vn,Gn)}};iS[Vn]=jn,v2.bind(Wn,Vn,jn)}else{const jn=Gn=>{z8(Mn,Vn,Gn)};v2.bind(Wn,Vn,jn),Mn.delegates[Vn]=jn}},U8={...ON,bindPendingEventDelegates(){const Mn=this;Lr.each(Mn._pendingNativeEvents,Vn=>{W8(Mn,Vn)})},toggleNativeEvent(Mn,Vn){const Wn=this;Mn==="focus"||Mn==="blur"||Wn.removed||(Vn?Wn.initialized?W8(Wn,Mn):Wn._pendingNativeEvents?Wn._pendingNativeEvents.push(Mn):Wn._pendingNativeEvents=[Mn]:Wn.initialized&&Wn.delegates&&(Wn.dom.unbind(y2(Wn,Mn),Mn,Wn.delegates[Mn]),delete Wn.delegates[Mn]))},unbindAllNativeEvents(){const Mn=this,Vn=Mn.getBody(),Wn=Mn.dom;Mn.delegates&&(Rr(Mn.delegates,(jn,Gn)=>{Mn.dom.unbind(y2(Mn,Gn),Gn,jn)}),delete Mn.delegates),!Mn.inline&&Vn&&Wn&&(Vn.onload=null,Wn.unbind(Mn.getWin()),Wn.unbind(Mn.getDoc())),Wn&&(Wn.unbind(Vn),Wn.unbind(Mn.getContainer()))}},eY=Mn=>xo(Mn)?{value:Mn.split(/[ ,]/),valid:!0}:sr(Mn,xo)?{value:Mn,valid:!0}:{valid:!1,message:"The value must be a string[] or a comma/space separated string."},tY=Mn=>{const Vn=(()=>{switch(Mn){case"array":return Jo;case"boolean":return Go;case"function":return Yo;case"number":return Ys;case"object":return Io;case"string":return xo;case"string[]":return eY;case"object[]":return Wn=>sr(Wn,Io);case"regexp":return Wn=>Do(Wn,RegExp);default:return Qs}})();return Wn=>_b(Wn,Vn,`The value must be a ${Mn}.`)},nY=Mn=>xo(Mn.processor),Z8=(Mn,Vn)=>{const Wn=Td(Vn.message)?"":`. ${Vn.message}`;return Mn+Wn},nC=Mn=>Mn.valid,_b=(Mn,Vn,Wn="")=>{const jn=Vn(Mn);return Go(jn)?jn?{value:Mn,valid:!0}:{valid:!1,message:Wn}:jn},oY=(Mn,Vn,Wn)=>{if(!os(Vn)){const jn=_b(Vn,Wn);if(nC(jn))return jn.value;console.error(Z8(`Invalid default value passed for the "${Mn}" option`,jn))}},sY=(Mn,Vn)=>{const Wn={},jn={},Gn=(Qo,qo,ds)=>{const bs=_b(qo,ds);return nC(bs)?(jn[Qo]=bs.value,!0):(console.warn(Z8(`Invalid value passed for the ${Qo} option`,bs)),!1)},no=(Qo,qo)=>{const ds=nY(qo)?tY(qo.processor):qo.processor,bs=oY(Qo,qo.default,ds);Wn[Qo]={...qo,default:bs,processor:ds},Ma(jn,Qo).orThunk(()=>Ma(Vn,Qo)).each(ys=>Gn(Qo,ys,ds))},ao=Qo=>Mr(Wn,Qo);return{register:no,isRegistered:ao,get:Qo=>Ma(jn,Qo).orThunk(()=>Ma(Wn,Qo).map(qo=>qo.default)).getOrUndefined(),set:(Qo,qo)=>{if(ao(Qo)){const ds=Wn[Qo];return ds.immutable?(console.error(`"${Qo}" is an immutable option and cannot be updated`),!1):Gn(Qo,qo,ds.processor)}else return console.warn(`"${Qo}" is not a registered option. Ensure the option has been registered before setting a value.`),!1},unset:Qo=>{const qo=ao(Qo);return qo&&delete jn[Qo],qo},isSet:Qo=>Mr(jn,Qo)}},rY=["design","readonly"],q8=(Mn,Vn,Wn,jn)=>{const Gn=Wn[Vn.get()],no=Wn[jn];try{no.activate()}catch(ao){console.error(`problem while activating editor mode ${jn}:`,ao);return}Gn.deactivate(),Gn.editorReadOnly!==no.editorReadOnly&&Y$(Mn,no.editorReadOnly),Vn.set(jn),Lx(Mn,jn)},iY=(Mn,Vn,Wn,jn)=>{if(jn!==Wn.get()){if(!Mr(Vn,jn))throw new Error(`Editor mode '${jn}' is invalid`);Mn.initialized?q8(Mn,Wn,Vn,jn):Mn.on("init",()=>q8(Mn,Wn,Vn,jn))}},aY=(Mn,Vn,Wn)=>{if(Zs(rY,Vn))throw new Error(`Cannot override default mode ${Vn}`);return{...Mn,[Vn]:{...Wn,deactivate:()=>{try{Wn.deactivate()}catch(jn){console.error(`problem while deactivating editor mode ${Vn}:`,jn)}}}}},lY=Mn=>{const Vn=od("design"),Wn=od({design:{activate:Js,deactivate:Js,editorReadOnly:!1},readonly:{activate:Js,deactivate:Js,editorReadOnly:!0}});return qX(Mn),GX(Mn),{isReadOnly:()=>tC(Mn),set:jn=>iY(Mn,Wn.get(),Vn,jn),get:()=>Vn.get(),register:(jn,Gn)=>{Wn.set(aY(Wn.get(),jn,Gn))}}},_N=Lr.each,SN=Lr.explode,NG={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},j8=Lr.makeMap("alt,ctrl,shift,meta,access"),cY=Mn=>Mn in j8,uY=Mn=>{const Vn={},Wn=aa.os.isMacOS()||aa.os.isiOS();_N(SN(Mn.toLowerCase(),"+"),no=>{cY(no)?Vn[no]=!0:/^[0-9]{2,}$/.test(no)?Vn.keyCode=parseInt(no,10):(Vn.charCode=no.charCodeAt(0),Vn.keyCode=NG[no]||no.toUpperCase().charCodeAt(0))});const jn=[Vn.keyCode];let Gn;for(Gn in j8)Vn[Gn]?jn.push(Gn):Vn[Gn]=!1;return Vn.id=jn.join(","),Vn.access&&(Vn.alt=!0,Wn?Vn.ctrl=!0:Vn.shift=!0),Vn.meta&&(Wn?Vn.meta=!0:(Vn.ctrl=!0,Vn.meta=!1)),Vn};class X8{constructor(Vn){this.shortcuts={},this.pendingPatterns=[],this.editor=Vn;const Wn=this;Vn.on("keyup keypress keydown",jn=>{(Wn.hasModifier(jn)||Wn.isFunctionKey(jn))&&!jn.isDefaultPrevented()&&(_N(Wn.shortcuts,Gn=>{Wn.matchShortcut(jn,Gn)&&(Wn.pendingPatterns=Gn.subpatterns.slice(0),jn.type==="keydown"&&Wn.executeShortcutAction(Gn))}),Wn.matchShortcut(jn,Wn.pendingPatterns[0])&&(Wn.pendingPatterns.length===1&&jn.type==="keydown"&&Wn.executeShortcutAction(Wn.pendingPatterns[0]),Wn.pendingPatterns.shift()))})}add(Vn,Wn,jn,Gn){const no=this,ao=no.normalizeCommandFunc(jn);return _N(SN(Lr.trim(Vn)),po=>{const vo=no.createShortcut(po,Wn,ao,Gn);no.shortcuts[vo.id]=vo}),!0}remove(Vn){const Wn=this.createShortcut(Vn);return this.shortcuts[Wn.id]?(delete this.shortcuts[Wn.id],!0):!1}normalizeCommandFunc(Vn){const Wn=this,jn=Vn;return typeof jn=="string"?()=>{Wn.editor.execCommand(jn,!1,null)}:Lr.isArray(jn)?()=>{Wn.editor.execCommand(jn[0],jn[1],jn[2])}:jn}createShortcut(Vn,Wn,jn,Gn){const no=Lr.map(SN(Vn,">"),uY);return no[no.length-1]=Lr.extend(no[no.length-1],{func:jn,scope:Gn||this.editor}),Lr.extend(no[0],{desc:this.editor.translate(Wn),subpatterns:no.slice(1)})}hasModifier(Vn){return Vn.altKey||Vn.ctrlKey||Vn.metaKey}isFunctionKey(Vn){return Vn.type==="keydown"&&Vn.keyCode>=112&&Vn.keyCode<=123}matchShortcut(Vn,Wn){return!Wn||Wn.ctrl!==Vn.ctrlKey||Wn.meta!==Vn.metaKey||Wn.alt!==Vn.altKey||Wn.shift!==Vn.shiftKey?!1:Vn.keyCode===Wn.keyCode||Vn.charCode&&Vn.charCode===Wn.charCode?(Vn.preventDefault(),!0):!1}executeShortcutAction(Vn){return Vn.func?Vn.func.call(Vn.scope):null}}const dY=()=>{const Mn={},Vn={},Wn={},jn={},Gn={},no={},ao={},po={},vo=(Fo,Qo)=>(qo,ds)=>{Fo[qo.toLowerCase()]={...ds,type:Qo}},Ao=(Fo,Qo)=>jn[Fo.toLowerCase()]=Qo;return{addButton:vo(Mn,"button"),addGroupToolbarButton:vo(Mn,"grouptoolbarbutton"),addToggleButton:vo(Mn,"togglebutton"),addMenuButton:vo(Mn,"menubutton"),addSplitButton:vo(Mn,"splitbutton"),addMenuItem:vo(Vn,"menuitem"),addNestedMenuItem:vo(Vn,"nestedmenuitem"),addToggleMenuItem:vo(Vn,"togglemenuitem"),addAutocompleter:vo(Wn,"autocompleter"),addContextMenu:vo(Gn,"contextmenu"),addContextToolbar:vo(no,"contexttoolbar"),addContextForm:vo(no,"contextform"),addSidebar:vo(ao,"sidebar"),addView:vo(po,"views"),addIcon:Ao,getAll:()=>({buttons:Mn,menuItems:Vn,icons:jn,popups:Wn,contextMenus:Gn,contextToolbars:no,sidebars:ao,views:po})}},fY=()=>{const Mn=dY();return{addAutocompleter:Mn.addAutocompleter,addButton:Mn.addButton,addContextForm:Mn.addContextForm,addContextMenu:Mn.addContextMenu,addContextToolbar:Mn.addContextToolbar,addIcon:Mn.addIcon,addMenuButton:Mn.addMenuButton,addMenuItem:Mn.addMenuItem,addNestedMenuItem:Mn.addNestedMenuItem,addSidebar:Mn.addSidebar,addSplitButton:Mn.addSplitButton,addToggleButton:Mn.addToggleButton,addGroupToolbarButton:Mn.addGroupToolbarButton,addToggleMenuItem:Mn.addToggleMenuItem,addView:Mn.addView,getAll:Mn.getAll}},O2=Eu.DOM,Y8=Lr.extend,hY=Lr.each;class G${constructor(Vn,Wn,jn){this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.composing=!1,this.destroyed=!1,this.hasHiddenInput=!1,this.iframeElement=null,this.initialized=!1,this.readonly=!1,this.removed=!1,this.startContent="",this._pendingNativeEvents=[],this._skinLoaded=!1,this._editableRoot=!0,this.editorManager=jn,this.documentBaseUrl=jn.documentBaseURL,Y8(this,U8);const Gn=this;this.id=Vn,this.hidden=!1;const no=vX(jn.defaultOptions,Wn);this.options=sY(Gn,no),m1(Gn);const ao=this.options.get;ao("deprecation_warnings")&&eG(Wn,no);const po=ao("suffix");po&&(jn.suffix=po),this.suffix=jn.suffix;const vo=ao("base_url");vo&&jn._setBaseUrl(vo),this.baseUri=jn.baseURI;const Ao=Hl(Gn);Ao&&(of.ScriptLoader._setReferrerPolicy(Ao),Eu.DOM.styleSheetLoader._setReferrerPolicy(Ao));const Fo=oy(Gn);is(Fo)&&Eu.DOM.styleSheetLoader._setContentCssCors(Fo),$h.languageLoad=ao("language_load"),$h.baseURL=jn.baseURL,this.setDirty(!1),this.documentBaseURI=new bb(ap(Gn),{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=ZS(Gn),this.hasVisual=nx(Gn),this.shortcuts=new X8(this),this.editorCommands=new bN(this),j$(this);const Qo=ao("cache_suffix");Qo&&(aa.cacheSuffix=Qo.replace(/^[\?\&]+/,"")),this.ui={registry:fY(),styleSheetLoader:void 0,show:Js,hide:Js,setEnabled:Js,isEnabled:Qs},this.mode=lY(Gn),jn.dispatch("SetupEditor",{editor:this});const qo=qS(Gn);Yo(qo)&&qo.call(Gn,Gn)}render(){uN(this)}focus(Vn){this.execCommand("mceFocus",!1,Vn)}hasFocus(){return L_(this)}translate(Vn){return cg.translate(Vn)}getParam(Vn,Wn,jn){const Gn=this.options;return Gn.isRegistered(Vn)||(is(jn)?Gn.register(Vn,{processor:jn,default:Wn}):Gn.register(Vn,{processor:Qs,default:Wn})),!Gn.isSet(Vn)&&!os(Wn)?Wn:Gn.get(Vn)}hasPlugin(Vn,Wn){return Zs(sO(this),Vn)?Wn?Hw.get(Vn)!==void 0:!0:!1}nodeChanged(Vn){this._nodeChangeDispatcher.nodeChanged(Vn)}addCommand(Vn,Wn,jn){this.editorCommands.addCommand(Vn,Wn,jn)}addQueryStateHandler(Vn,Wn,jn){this.editorCommands.addQueryStateHandler(Vn,Wn,jn)}addQueryValueHandler(Vn,Wn,jn){this.editorCommands.addQueryValueHandler(Vn,Wn,jn)}addShortcut(Vn,Wn,jn,Gn){this.shortcuts.add(Vn,Wn,jn,Gn)}execCommand(Vn,Wn,jn,Gn){return this.editorCommands.execCommand(Vn,Wn,jn,Gn)}queryCommandState(Vn){return this.editorCommands.queryCommandState(Vn)}queryCommandValue(Vn){return this.editorCommands.queryCommandValue(Vn)}queryCommandSupported(Vn){return this.editorCommands.queryCommandSupported(Vn)}show(){const Vn=this;Vn.hidden&&(Vn.hidden=!1,Vn.inline?Vn.getBody().contentEditable="true":(O2.show(Vn.getContainer()),O2.hide(Vn.id)),Vn.load(),Vn.dispatch("show"))}hide(){const Vn=this;Vn.hidden||(Vn.save(),Vn.inline?(Vn.getBody().contentEditable="false",Vn===Vn.editorManager.focusedEditor&&(Vn.editorManager.focusedEditor=null)):(O2.hide(Vn.getContainer()),O2.setStyle(Vn.id,"display",Vn.orgDisplay)),Vn.hidden=!0,Vn.dispatch("hide"))}isHidden(){return this.hidden}setProgressState(Vn,Wn){this.dispatch("ProgressState",{state:Vn,time:Wn})}load(Vn={}){const Wn=this,jn=Wn.getElement();if(Wn.removed)return"";if(jn){const Gn={...Vn,load:!0},no=$g(jn)?jn.value:jn.innerHTML,ao=Wn.setContent(no,Gn);return Gn.no_events||Wn.dispatch("LoadContent",{...Gn,element:jn}),ao}else return""}save(Vn={}){const Wn=this;let jn=Wn.getElement();if(!jn||!Wn.initialized||Wn.removed)return"";const Gn={...Vn,save:!0,element:jn};let no=Wn.getContent(Gn);const ao={...Gn,content:no};if(ao.no_events||Wn.dispatch("SaveContent",ao),ao.format==="raw"&&Wn.dispatch("RawSaveContent",ao),no=ao.content,$g(jn))jn.value=no;else{(Vn.is_removing||!Wn.inline)&&(jn.innerHTML=no);const po=O2.getParent(Wn.id,"form");po&&hY(po.elements,vo=>vo.name===Wn.id?(vo.value=no,!1):!0)}return ao.element=Gn.element=jn=null,ao.set_dirty!==!1&&Wn.setDirty(!1),no}setContent(Vn,Wn){return ZD(this,Vn,Wn)}getContent(Vn){return UI(this,Vn)}insertContent(Vn,Wn){Wn&&(Vn=Y8({content:Vn},Wn)),this.execCommand("mceInsertContent",!1,Vn)}resetContent(Vn){Vn===void 0?ZD(this,this.startContent,{format:"raw"}):ZD(this,Vn),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()}isDirty(){return!this.isNotDirty}setDirty(Vn){const Wn=!this.isNotDirty;this.isNotDirty=!Vn,Vn&&Vn!==Wn&&this.dispatch("dirty")}getContainer(){const Vn=this;return Vn.container||(Vn.container=Vn.editorContainer||O2.get(Vn.id+"_parent")),Vn.container}getContentAreaContainer(){return this.contentAreaContainer}getElement(){return this.targetElm||(this.targetElm=O2.get(this.id)),this.targetElm}getWin(){const Vn=this;if(!Vn.contentWindow){const Wn=Vn.iframeElement;Wn&&(Vn.contentWindow=Wn.contentWindow)}return Vn.contentWindow}getDoc(){const Vn=this;if(!Vn.contentDocument){const Wn=Vn.getWin();Wn&&(Vn.contentDocument=Wn.document)}return Vn.contentDocument}getBody(){var Vn,Wn;const jn=this.getDoc();return(Wn=(Vn=this.bodyElement)!==null&&Vn!==void 0?Vn:jn==null?void 0:jn.body)!==null&&Wn!==void 0?Wn:null}convertURL(Vn,Wn,jn){const Gn=this,no=Gn.options.get,ao=ix(Gn);if(Yo(ao))return ao.call(Gn,Vn,jn,!0,Wn);if(!no("convert_urls")||jn==="link"||Io(jn)&&jn.nodeName==="LINK"||Vn.indexOf("file:")===0||Vn.length===0)return Vn;const po=new bb(Vn);return po.protocol!=="http"&&po.protocol!=="https"&&po.protocol!==""?Vn:no("relative_urls")?Gn.documentBaseURI.toRelative(Vn):(Vn=Gn.documentBaseURI.toAbsolute(Vn,no("remove_script_host")),Vn)}addVisual(Vn){yX(this,Vn)}setEditableRoot(Vn){W$(this,Vn)}hasEditableRoot(){return U$(this)}remove(){GV(this)}destroy(Vn){KV(this,Vn)}uploadImages(){return this.editorUpload.uploadImages()}_scanForImages(){return this.editorUpload.scanForImages()}}const _2=Eu.DOM,K$=Lr.each;let G8=!1,J$,Sg=[];const e3=Mn=>{const Vn=Mn.type;K$(aS.get(),Wn=>{switch(Vn){case"scroll":Wn.dispatch("ScrollWindow",Mn);break;case"resize":Wn.dispatch("ResizeWindow",Mn);break}})},K8=Mn=>{if(Mn!==G8){const Vn=Eu.DOM;Mn?(Vn.bind(window,"resize",e3),Vn.bind(window,"scroll",e3)):(Vn.unbind(window,"resize",e3),Vn.unbind(window,"scroll",e3)),G8=Mn}},J8=Mn=>{const Vn=Sg;return Sg=nr(Sg,Wn=>Mn!==Wn),aS.activeEditor===Mn&&(aS.activeEditor=Sg.length>0?Sg[0]:null),aS.focusedEditor===Mn&&(aS.focusedEditor=null),Vn.length!==Sg.length},mY=Mn=>{Mn&&Mn.initialized&&!(Mn.getContainer()||Mn.getBody()).parentNode&&(J8(Mn),Mn.unbindAllNativeEvents(),Mn.destroy(!0),Mn.removed=!0)},pY=document.compatMode!=="CSS1Compat",aS={...ON,baseURI:null,baseURL:null,defaultOptions:{},documentBaseURL:null,suffix:null,majorVersion:"6",minorVersion:"8.4",releaseDate:"2024-06-19",i18n:cg,activeEditor:null,focusedEditor:null,setup(){const Mn=this;let Vn="",Wn="",jn=bb.getDocumentBaseUrl(document.location);/^[^:]+:\/\/\/?[^\/]+\//.test(jn)&&(jn=jn.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(jn)||(jn+="/"));const Gn=window.tinymce||window.tinyMCEPreInit;if(Gn)Vn=Gn.base||Gn.baseURL,Wn=Gn.suffix;else{const no=document.getElementsByTagName("script");for(let ao=0;ao{$h.PluginManager.urls[no]=Gn})},init(Mn){const Vn=this;let Wn;const jn=Lr.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),Gn=(Fo,Qo)=>Fo.inline&&Qo.tagName.toLowerCase()in jn,no=Fo=>{let Qo=Fo.id;return Qo||(Qo=Ma(Fo,"name").filter(qo=>!_2.get(qo)).getOrThunk(_2.uniqueId),Fo.setAttribute("id",Qo)),Qo},ao=Fo=>{const Qo=Mn[Fo];if(Qo)return Qo.apply(Vn,[])},po=Fo=>aa.browser.isIE()||aa.browser.isEdge()?(RE("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tiny.cloud/docs/tinymce/6/support/#supportedwebbrowsers"),[]):pY?(RE("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[]):xo(Fo.selector)?_2.select(Fo.selector):is(Fo.target)?[Fo.target]:[];let vo=Fo=>{Wn=Fo};const Ao=()=>{let Fo=0;const Qo=[];let qo;const ds=(bs,ls,ys)=>{const Ls=new G$(bs,ls,Vn);Qo.push(Ls),Ls.on("init",()=>{++Fo===qo.length&&vo(Qo)}),Ls.targetElm=Ls.targetElm||ys,Ls.render()};_2.unbind(window,"ready",Ao),ao("onpageload"),qo=rd(po(Mn)),Lr.each(qo,bs=>{mY(Vn.get(bs.id))}),qo=Lr.grep(qo,bs=>!Vn.get(bs.id)),qo.length===0?vo([]):K$(qo,bs=>{Gn(Mn,bs)?RE("Could not initialize inline editor on invalid inline target element",bs):ds(no(bs),Mn,bs)})};return _2.bind(window,"ready",Ao),new Promise(Fo=>{Wn?Fo(Wn):vo=Qo=>{Fo(Qo)}})},get(Mn){return arguments.length===0?Sg.slice(0):xo(Mn)?xa(Sg,Vn=>Vn.id===Mn).getOr(null):Ys(Mn)&&Sg[Mn]?Sg[Mn]:null},add(Mn){const Vn=this,Wn=Vn.get(Mn.id);return Wn===Mn||(Wn===null&&Sg.push(Mn),K8(!0),Vn.activeEditor=Mn,Vn.dispatch("AddEditor",{editor:Mn}),J$||(J$=jn=>{const Gn=Vn.dispatch("BeforeUnload");if(Gn.returnValue)return jn.preventDefault(),jn.returnValue=Gn.returnValue,Gn.returnValue},window.addEventListener("beforeunload",J$))),Mn},createEditor(Mn,Vn){return this.add(new G$(Mn,Vn,this))},remove(Mn){const Vn=this;let Wn;if(!Mn){for(let jn=Sg.length-1;jn>=0;jn--)Vn.remove(Sg[jn]);return}if(xo(Mn)){K$(_2.select(Mn),jn=>{Wn=Vn.get(jn.id),Wn&&Vn.remove(Wn)});return}return Wn=Mn,Mo(Vn.get(Wn.id))?null:(J8(Wn)&&Vn.dispatch("RemoveEditor",{editor:Wn}),Sg.length===0&&window.removeEventListener("beforeunload",J$),Wn.remove(),K8(Sg.length>0),Wn)},execCommand(Mn,Vn,Wn){var jn;const Gn=this,no=Io(Wn)?(jn=Wn.id)!==null&&jn!==void 0?jn:Wn.index:Wn;switch(Mn){case"mceAddEditor":{if(!Gn.get(no)){const ao=Wn.options;new G$(no,ao,Gn).render()}return!0}case"mceRemoveEditor":{const ao=Gn.get(no);return ao&&ao.remove(),!0}case"mceToggleEditor":{const ao=Gn.get(no);return ao?(ao.isHidden()?ao.show():ao.hide(),!0):(Gn.execCommand("mceAddEditor",!1,Wn),!0)}}return Gn.activeEditor?Gn.activeEditor.execCommand(Mn,Vn,Wn):!1},triggerSave:()=>{K$(Sg,Mn=>{Mn.save()})},addI18n:(Mn,Vn)=>{cg.add(Mn,Vn)},translate:Mn=>cg.translate(Mn),setActive(Mn){const Vn=this.activeEditor;this.activeEditor!==Mn&&(Vn&&Vn.dispatch("deactivate",{relatedTarget:Mn}),Mn.dispatch("activate",{relatedTarget:Vn})),this.activeEditor=Mn},_setBaseUrl(Mn){this.baseURL=new bb(this.documentBaseURL).toAbsolute(Mn.replace(/\/+$/,"")),this.baseURI=new bb(this.baseURL)}};aS.setup();const gY=(()=>{const Mn=Fb(),Vn=no=>({items:no,types:Al(no),getType:ao=>Ma(no,ao).getOrUndefined()}),Wn=no=>{Mn.set(no)},jn=()=>Mn.get().getOrUndefined(),Gn=Mn.clear;return{FakeClipboardItem:Vn,write:Wn,read:jn,clear:Gn}})(),wN=Math.min,S2=Math.max,t3=Math.round,eH=(Mn,Vn,Wn)=>{let jn=Vn.x,Gn=Vn.y;const no=Mn.w,ao=Mn.h,po=Vn.w,vo=Vn.h,Ao=(Wn||"").split("");return Ao[0]==="b"&&(Gn+=vo),Ao[1]==="r"&&(jn+=po),Ao[0]==="c"&&(Gn+=t3(vo/2)),Ao[1]==="c"&&(jn+=t3(po/2)),Ao[3]==="b"&&(Gn-=ao),Ao[4]==="r"&&(jn-=no),Ao[3]==="c"&&(Gn-=t3(ao/2)),Ao[4]==="c"&&(jn-=t3(no/2)),w2(jn,Gn,no,ao)},bY=(Mn,Vn,Wn,jn)=>{for(let Gn=0;Gn=Wn.x&&no.x+no.w<=Wn.w+Wn.x&&no.y>=Wn.y&&no.y+no.h<=Wn.h+Wn.y)return jn[Gn]}return null},vY=(Mn,Vn,Wn)=>w2(Mn.x-Vn,Mn.y-Wn,Mn.w+Vn*2,Mn.h+Wn*2),yY=(Mn,Vn)=>{const Wn=S2(Mn.x,Vn.x),jn=S2(Mn.y,Vn.y),Gn=wN(Mn.x+Mn.w,Vn.x+Vn.w),no=wN(Mn.y+Mn.h,Vn.y+Vn.h);return Gn-Wn<0||no-jn<0?null:w2(Wn,jn,Gn-Wn,no-jn)},OY=(Mn,Vn,Wn)=>{let jn=Mn.x,Gn=Mn.y,no=Mn.x+Mn.w,ao=Mn.y+Mn.h;const po=Vn.x+Vn.w,vo=Vn.y+Vn.h,Ao=S2(0,Vn.x-jn),Fo=S2(0,Vn.y-Gn),Qo=S2(0,no-po),qo=S2(0,ao-vo);return jn+=Ao,Gn+=Fo,Wn&&(no+=Ao,ao+=Fo,jn-=Qo,Gn-=qo),no-=Qo,ao-=qo,w2(jn,Gn,no-jn,ao-Gn)},w2=(Mn,Vn,Wn,jn)=>({x:Mn,y:Vn,w:Wn,h:jn}),SY={inflate:vY,relativePosition:eH,findBestRelativePosition:bY,intersect:yY,clamp:OY,create:w2,fromClientRect:Mn=>w2(Mn.left,Mn.top,Mn.width,Mn.height)},wY=(Mn,Vn,Wn=1e3)=>{let jn=!1,Gn=null;const no=Ao=>(...Fo)=>{jn||(jn=!0,Gn!==null&&(clearTimeout(Gn),Gn=null),Ao.apply(null,Fo))},ao=no(Mn),po=no(Vn);return{start:(...Ao)=>{!jn&&Gn===null&&(Gn=setTimeout(()=>po.apply(null,Ao),Wn))},resolve:ao,reject:po}},CY=(()=>{const Mn={},Vn={},Wn={};return{load:(vo,Ao)=>{const Fo=`Script at URL "${Ao}" failed to load`,Qo=`Script at URL "${Ao}" did not call \`tinymce.Resource.add('${vo}', data)\` within 1 second`;if(Mn[vo]!==void 0)return Mn[vo];{const qo=new Promise((ds,bs)=>{const ls=wY(ds,bs);Vn[vo]=ls.resolve,of.ScriptLoader.loadScript(Ao).then(()=>ls.start(Qo),()=>ls.reject(Fo))});return Mn[vo]=qo,qo}},add:(vo,Ao)=>{Vn[vo]!==void 0&&(Vn[vo](Ao),delete Vn[vo]),Mn[vo]=Promise.resolve(Ao),Wn[vo]=Ao},has:vo=>vo in Wn,get:vo=>Wn[vo],unload:vo=>{delete Mn[vo]}}})(),kY=()=>(()=>{let Mn={},Vn=[];const Wn={getItem:jn=>{const Gn=Mn[jn];return Gn||null},setItem:(jn,Gn)=>{Vn.push(jn),Mn[jn]=String(Gn)},key:jn=>Vn[jn],removeItem:jn=>{Vn=Vn.filter(Gn=>Gn===jn),delete Mn[jn]},clear:()=>{Vn=[],Mn={}},length:0};return Object.defineProperty(Wn,"length",{get:()=>Vn.length,configurable:!1,enumerable:!1}),Wn})();let bT;try{const Mn="__storage_test__";bT=window.localStorage,bT.setItem(Mn,Mn),bT.removeItem(Mn)}catch{bT=kY()}var xY=bT;const EY={geom:{Rect:SY},util:{Delay:O1,Tools:Lr,VK:va,URI:bb,EventDispatcher:If,Observable:ON,I18n:cg,LocalStorage:xY,ImageUploader:gz},dom:{EventUtils:vm,TreeWalker:mu,TextSeeker:Qb,DOMUtils:Eu,ScriptLoader:of,RangeUtils:ns,Serializer:zI,StyleSheetLoader:IO,ControlSelection:MN,BookmarkManager:fO,Selection:W_,Event:vm.Event},html:{Styles:a1,Entities:P0,Node:fp,Schema:i1,DomParser:a0,Writer:r5,Serializer:I_},Env:aa,AddOnManager:$h,Annotator:Dx,Formatter:eM,UndoManager:tM,EditorCommands:bN,WindowManager:JI,NotificationManager:XD,EditorObservable:U8,Shortcuts:X8,Editor:G$,FocusManager:FN,EditorManager:aS,DOM:Eu.DOM,ScriptLoader:of.ScriptLoader,PluginManager:Hw,ThemeManager:CO,ModelManager:yb,IconManager:AE,Resource:CY,FakeClipboard:gY,trim:Lr.trim,isArray:Lr.isArray,is:Lr.is,toArray:Lr.toArray,makeMap:Lr.makeMap,each:Lr.each,map:Lr.map,grep:Lr.grep,inArray:Lr.inArray,extend:Lr.extend,walk:Lr.walk,resolve:Lr.resolve,explode:Lr.explode,_addCacheSuffix:Lr._addCacheSuffix},CN=Lr.extend(aS,EY),BG=Mn=>{try{_n.exports=Mn}catch{}};(Mn=>{window.tinymce=Mn,window.tinyMCE=Mn})(CN),BG(CN)})()})(tinymce$1);(function(){var _n=tinymce.util.Tools.resolve("tinymce.ModelManager");const Ce=(eo,ro,fo)=>{var go;return fo(eo,ro.prototype)?!0:((go=eo.constructor)===null||go===void 0?void 0:go.name)===ro.name},ke=eo=>{const ro=typeof eo;return eo===null?"null":ro==="object"&&Array.isArray(eo)?"array":ro==="object"&&Ce(eo,String,(fo,go)=>go.isPrototypeOf(fo))?"string":ro},$n=eo=>ro=>ke(ro)===eo,Hn=eo=>ro=>typeof ro===eo,zn=eo=>ro=>eo===ro,Un=$n("string"),qn=$n("object"),Xn=$n("array"),Kn=zn(null),to=Hn("boolean"),io=zn(void 0),uo=eo=>eo==null,ho=eo=>!uo(eo),bo=Hn("function"),Oo=Hn("number"),So=()=>{},$o=(eo,ro)=>(...fo)=>eo(ro.apply(null,fo)),Do=(eo,ro)=>fo=>eo(ro(fo)),xo=eo=>()=>eo,Io=eo=>eo,Vo=(eo,ro)=>eo===ro;function Jo(eo,...ro){return(...fo)=>{const go=ro.concat(fo);return eo.apply(null,go)}}const Mo=eo=>ro=>!eo(ro),Go=eo=>()=>{throw new Error(eo)},os=eo=>eo(),ms=xo(!1),is=xo(!0);class Yo{constructor(ro,fo){this.tag=ro,this.value=fo}static some(ro){return new Yo(!0,ro)}static none(){return Yo.singletonNone}fold(ro,fo){return this.tag?fo(this.value):ro()}isSome(){return this.tag}isNone(){return!this.tag}map(ro){return this.tag?Yo.some(ro(this.value)):Yo.none()}bind(ro){return this.tag?ro(this.value):Yo.none()}exists(ro){return this.tag&&ro(this.value)}forall(ro){return!this.tag||ro(this.value)}filter(ro){return!this.tag||ro(this.value)?this:Yo.none()}getOr(ro){return this.tag?this.value:ro}or(ro){return this.tag?this:ro}getOrThunk(ro){return this.tag?this.value:ro()}orThunk(ro){return this.tag?this:ro()}getOrDie(ro){if(this.tag)return this.value;throw new Error(ro??"Called getOrDie on None")}static from(ro){return ho(ro)?Yo.some(ro):Yo.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(ro){this.tag&&ro(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Yo.singletonNone=new Yo(!1);const Ys=Array.prototype.slice,sr=Array.prototype.indexOf,Js=Array.prototype.push,ko=(eo,ro)=>sr.call(eo,ro),gs=(eo,ro)=>ko(eo,ro)>-1,xs=(eo,ro)=>{for(let fo=0,go=eo.length;fo{const fo=[];for(let go=0;go{const fo=eo.length,go=new Array(fo);for(let To=0;To{for(let fo=0,go=eo.length;fo{for(let fo=eo.length-1;fo>=0;fo--){const go=eo[fo];ro(go,fo)}},Br=(eo,ro)=>{const fo=[],go=[];for(let To=0,No=eo.length;To{const fo=[];for(let go=0,To=eo.length;go(Fs(eo,(go,To)=>{fo=ro(fo,go,To)}),fo),hs=(eo,ro,fo)=>(ws(eo,(go,To)=>{fo=ro(fo,go,To)}),fo),Qs=(eo,ro,fo)=>{for(let go=0,To=eo.length;goQs(eo,ro,ms),el=(eo,ro)=>{for(let fo=0,go=eo.length;fo{const ro=[];for(let fo=0,go=eo.length;foga(cr(eo,ro)),za=(eo,ro)=>{for(let fo=0,go=eo.length;fo{const ro=Ys.call(eo,0);return ro.reverse(),ro},Zs=(eo,ro)=>{const fo={};for(let go=0,To=eo.length;go{const fo=Ys.call(eo,0);return fo.sort(ro),fo},Us=(eo,ro)=>ro>=0&&roUs(eo,0),dr=eo=>Us(eo,eo.length-1),Vr=(eo,ro)=>{for(let fo=0;fo{const fo=nr(eo);for(let go=0,To=fo.length;goxa(eo,(fo,go)=>({k:go,v:ro(fo,go)})),xa=(eo,ro)=>{const fo={};return ra(eo,(go,To)=>{const No=ro(go,To);fo[No.k]=No.v}),fo},Nl=eo=>(ro,fo)=>{eo[fo]=ro},Zc=(eo,ro,fo,go)=>{ra(eo,(To,No)=>{(ro(To,No)?fo:go)(To,No)})},cc=(eo,ro)=>{const fo={};return Zc(eo,ro,Nl(fo),So),fo},gc=(eo,ro)=>{const fo=[];return ra(eo,(go,To)=>{fo.push(ro(go,To))}),fo},nc=eo=>gc(eo,Io),Ed=(eo,ro)=>Zl(eo,ro)?Yo.from(eo[ro]):Yo.none(),Zl=(eo,ro)=>Kr.call(eo,ro),Vl=(eo,ro)=>Zl(eo,ro)&&eo[ro]!==void 0&&eo[ro]!==null,Fc=eo=>{for(const ro in eo)if(Kr.call(eo,ro))return!1;return!0},qa=typeof window<"u"?window:Function("return this;")(),Ya=(eo,ro)=>{let fo=ro??qa;for(let go=0;go{const fo=eo.split(".");return Ya(fo,ro)},Yl=(eo,ro)=>kc(eo,ro),rd=(eo,ro)=>{const fo=Yl(eo,ro);if(fo==null)throw new Error(eo+" not available on this browser");return fo},Al=Object.getPrototypeOf,gd=eo=>rd("HTMLElement",eo),Rr=eo=>{const ro=kc("ownerDocument.defaultView",eo);return qn(eo)&&(gd(ro).prototype.isPrototypeOf(eo)||/^HTML\w*Element$/.test(Al(eo).constructor.name))},Pl=8,Su=9,vs=11,Es=1,Ks=3,pr=eo=>eo.dom.nodeName.toLowerCase(),ia=eo=>eo.dom.nodeType,ka=eo=>ro=>ia(ro)===eo,Ma=eo=>ia(eo)===Pl||pr(eo)==="#comment",Mr=eo=>il(eo)&&Rr(eo.dom),il=ka(Es),Na=ka(Ks),vl=ka(Su),Rc=ka(vs),Vc=eo=>ro=>il(ro)&&pr(ro)===eo,xc=(eo,ro,fo)=>{if(Un(fo)||to(fo)||Oo(fo))eo.setAttribute(ro,fo+"");else throw console.error("Invalid call to Attribute.set. Key ",ro,":: Value ",fo,":: Element ",eo),new Error("Attribute value was not simple")},zc=(eo,ro,fo)=>{xc(eo.dom,ro,fo)},ad=(eo,ro)=>{const fo=eo.dom;ra(ro,(go,To)=>{xc(fo,To,go)})},Bh=(eo,ro)=>{ra(ro,(fo,go)=>{fo.fold(()=>{ks(eo,go)},To=>{xc(eo.dom,go,To)})})},Vu=(eo,ro)=>{const fo=eo.dom.getAttribute(ro);return fo===null?void 0:fo},Ts=(eo,ro)=>Yo.from(Vu(eo,ro)),ks=(eo,ro)=>{eo.dom.removeAttribute(ro)},ir=eo=>hs(eo.dom.attributes,(ro,fo)=>(ro[fo.name]=fo.value,ro),{}),br=(eo,ro)=>{const go=(ro||document).createElement("div");if(go.innerHTML=eo,!go.hasChildNodes()||go.childNodes.length>1){const To="HTML does not have a single root node";throw console.error(To,eo),new Error(To)}return _l(go.childNodes[0])},Aa=(eo,ro)=>{const go=(ro||document).createElement(eo);return _l(go)},Ba=(eo,ro)=>{const go=(ro||document).createTextNode(eo);return _l(go)},_l=eo=>{if(eo==null)throw new Error("Node cannot be null or undefined");return{dom:eo}},Ds={fromHtml:br,fromTag:Aa,fromText:Ba,fromDom:_l,fromPoint:(eo,ro,fo)=>Yo.from(eo.dom.elementFromPoint(ro,fo)).map(_l)},tl=(eo,ro)=>{const fo=eo.dom;if(fo.nodeType!==Es)return!1;{const go=fo;if(go.matches!==void 0)return go.matches(ro);if(go.msMatchesSelector!==void 0)return go.msMatchesSelector(ro);if(go.webkitMatchesSelector!==void 0)return go.webkitMatchesSelector(ro);if(go.mozMatchesSelector!==void 0)return go.mozMatchesSelector(ro);throw new Error("Browser lacks native selectors")}},wu=eo=>eo.nodeType!==Es&&eo.nodeType!==Su&&eo.nodeType!==vs||eo.childElementCount===0,qu=(eo,ro)=>{const fo=ro===void 0?document:ro.dom;return wu(fo)?[]:cr(fo.querySelectorAll(eo),Ds.fromDom)},Md=(eo,ro)=>{const fo=ro===void 0?document:ro.dom;return wu(fo)?Yo.none():Yo.from(fo.querySelector(eo)).map(Ds.fromDom)},bc=(eo,ro)=>eo.dom===ro.dom,nm=(eo,ro)=>{const fo=eo.dom,go=ro.dom;return fo===go?!1:fo.contains(go)},Ff=tl,Ud=eo=>Ds.fromDom(eo.dom.ownerDocument),ld=eo=>vl(eo)?eo:Ud(eo),oc=eo=>Ds.fromDom(ld(eo).dom.documentElement),Dc=eo=>Ds.fromDom(ld(eo).dom.defaultView),bd=eo=>Yo.from(eo.dom.parentNode).map(Ds.fromDom),Nd=eo=>Yo.from(eo.dom.parentElement).map(Ds.fromDom),ih=(eo,ro)=>{const fo=bo(ro)?ro:ms;let go=eo.dom;const To=[];for(;go.parentNode!==null&&go.parentNode!==void 0;){const No=go.parentNode,Zo=Ds.fromDom(No);if(To.push(Zo),fo(Zo)===!0)break;go=No}return To},om=eo=>Yo.from(eo.dom.previousSibling).map(Ds.fromDom),sm=eo=>Yo.from(eo.dom.nextSibling).map(Ds.fromDom),fc=eo=>cr(eo.dom.childNodes,Ds.fromDom),Td=(eo,ro)=>{const fo=eo.dom.childNodes;return Yo.from(fo[ro]).map(Ds.fromDom)},Jd=eo=>Td(eo,0),Em=(eo,ro)=>{bd(eo).each(go=>{go.dom.insertBefore(ro.dom,eo.dom)})},ef=(eo,ro)=>{sm(eo).fold(()=>{bd(eo).each(To=>{Qc(To,ro)})},go=>{Em(go,ro)})},Cu=(eo,ro)=>{Jd(eo).fold(()=>{Qc(eo,ro)},go=>{eo.dom.insertBefore(ro.dom,go.dom)})},Qc=(eo,ro)=>{eo.dom.appendChild(ro.dom)},Cf=(eo,ro,fo)=>{Td(eo,fo).fold(()=>{Qc(eo,ro)},go=>{Em(go,ro)})},qm=(eo,ro)=>{Em(eo,ro),Qc(ro,eo)},Oc=(eo,ro)=>{ws(ro,(fo,go)=>{const To=go===0?eo:ro[go-1];ef(To,fo)})},cd=(eo,ro)=>{ws(ro,fo=>{Qc(eo,fo)})},vd=eo=>{eo.dom.textContent="",ws(fc(eo),ro=>{ju(ro)})},ju=eo=>{const ro=eo.dom;ro.parentNode!==null&&ro.parentNode.removeChild(ro)},Xf=eo=>{const ro=fc(eo);ro.length>0&&Oc(eo,ro),ju(eo)},Sh=(eo,ro)=>Ds.fromDom(eo.dom.cloneNode(ro)),Zd=eo=>Sh(eo,!1),ah=eo=>Sh(eo,!0),lh=(eo,ro)=>{const fo=Ds.fromTag(ro),go=ir(eo);return ad(fo,go),fo},Bp=(eo,ro)=>{const fo=lh(eo,ro),go=fc(ah(eo));return cd(fo,go),fo},ch=(eo,ro)=>{const fo=lh(eo,ro);ef(eo,fo);const go=fc(eo);return cd(fo,go),ju(eo),fo},bp=["tfoot","thead","tbody","colgroup"],kf=eo=>gs(bp,eo),Fh=(eo,ro)=>({rows:eo,columns:ro}),jm=(eo,ro)=>({row:eo,column:ro}),Fp=(eo,ro,fo)=>({element:eo,rowspan:ro,colspan:fo}),Eg=(eo,ro,fo,go)=>({element:eo,rowspan:ro,colspan:fo,isNew:go}),rs=(eo,ro,fo,go,To,No)=>({element:eo,rowspan:ro,colspan:fo,row:go,column:To,isLocked:No}),As=(eo,ro,fo)=>({element:eo,cells:ro,section:fo}),Ws=(eo,ro,fo,go)=>({element:eo,cells:ro,section:fo,isNew:go}),rr=(eo,ro,fo)=>({element:eo,isNew:ro,isLocked:fo}),Fr=(eo,ro,fo,go)=>({element:eo,cells:ro,section:fo,isNew:go}),Wa=(eo,ro,fo,go)=>({startRow:eo,startCol:ro,finishRow:fo,finishCol:go}),Nc=(eo,ro,fo)=>({element:eo,colspan:ro,column:fo}),xl=(eo,ro)=>({element:eo,columns:ro}),ul=eo=>Rc(eo)&&ho(eo.dom.host),lu=bo(Element.prototype.attachShadow)&&bo(Node.prototype.getRootNode),Gl=xo(lu),Ru=lu?eo=>Ds.fromDom(eo.dom.getRootNode()):ld,xf=eo=>{const ro=Ru(eo);return ul(ro)?Yo.some(ro):Yo.none()},Hp=eo=>Ds.fromDom(eo.dom.host),aa=eo=>{if(Gl()&&ho(eo.target)){const ro=Ds.fromDom(eo.target);if(il(ro)&&Qp(ro)&&eo.composed&&eo.composedPath){const fo=eo.composedPath();if(fo)return fs(fo)}}return Yo.from(eo.target)},Qp=eo=>ho(eo.dom.shadowRoot),Bu=eo=>{const ro=Na(eo)?eo.dom.parentNode:eo.dom;if(ro==null||ro.ownerDocument===null)return!1;const fo=ro.ownerDocument;return xf(Ds.fromDom(ro)).fold(()=>fo.body.contains(ro),Do(Bu,Hp))},Uo=()=>cs(Ds.fromDom(document)),cs=eo=>{const ro=eo.dom.body;if(ro==null)throw new Error("Body is not available yet");return Ds.fromDom(ro)},_s=(eo,ro,fo)=>_r(ih(eo,fo),ro),ar=(eo,ro)=>_r(fc(eo),ro),ta=(eo,ro)=>{let fo=[];return ws(fc(eo),go=>{ro(go)&&(fo=fo.concat([go])),fo=fo.concat(ta(go,ro))}),fo},al=(eo,ro,fo)=>_s(eo,go=>tl(go,ro),fo),ya=(eo,ro)=>ar(eo,fo=>tl(fo,ro)),fu=(eo,ro)=>qu(ro,eo);var Lr=(eo,ro,fo,go,To)=>eo(fo,go)?Yo.some(fo):bo(To)&&To(fo)?Yo.none():ro(fo,go,To);const qc=(eo,ro,fo)=>{let go=eo.dom;const To=bo(fo)?fo:ms;for(;go.parentNode;){go=go.parentNode;const No=Ds.fromDom(go);if(ro(No))return Yo.some(No);if(To(No))break}return Yo.none()},Ef=(eo,ro,fo)=>Lr((To,No)=>No(To),qc,eo,ro,fo),ku=(eo,ro)=>{const fo=To=>ro(Ds.fromDom(To));return zo(eo.dom.childNodes,fo).map(Ds.fromDom)},jc=(eo,ro)=>{const fo=go=>{for(let To=0;Toqc(eo,go=>tl(go,ro),fo),El=(eo,ro)=>ku(eo,fo=>tl(fo,ro)),Hf=(eo,ro)=>Md(ro,eo),hu=(eo,ro,fo)=>Lr((To,No)=>tl(To,No),Tm,eo,ro,fo),Qf=(eo,ro,fo=Vo)=>eo.exists(go=>fo(go,ro)),cu=eo=>{const ro=[],fo=go=>{ro.push(go)};for(let go=0;goeo!=null?ro(eo):Yo.none(),ud=(eo,ro)=>eo?Yo.some(ro):Yo.none(),vp=(eo,ro,fo)=>ro===""||eo.length>=ro.length&&eo.substr(fo,fo+ro.length)===ro,vc=(eo,ro,fo=0,go)=>{const To=eo.indexOf(ro,fo);return To!==-1?io(go)?!0:To+ro.length<=go:!1},Am=(eo,ro)=>vp(eo,ro,0),Pm=(eo,ro)=>vp(eo,ro,eo.length-ro.length),Hh=(eo=>ro=>ro.replace(eo,""))(/^\s+|\s+$/g),A1=eo=>eo.length>0,ql=eo=>{const ro=parseFloat(eo);return isNaN(ro)?Yo.none():Yo.some(ro)},dd=eo=>eo.style!==void 0&&bo(eo.style.getPropertyValue),yd=(eo,ro,fo)=>{if(!Un(fo))throw console.error("Invalid call to CSS.set. Property ",ro,":: Value ",fo,":: Element ",eo),new Error("CSS value must be a string: "+fo);dd(eo)&&eo.style.setProperty(ro,fo)},mv=(eo,ro)=>{dd(eo)&&eo.style.removeProperty(ro)},Du=(eo,ro,fo)=>{const go=eo.dom;yd(go,ro,fo)},lf=(eo,ro)=>{const fo=eo.dom;ra(ro,(go,To)=>{yd(fo,To,go)})},qd=(eo,ro)=>{const fo=eo.dom,To=window.getComputedStyle(fo).getPropertyValue(ro);return To===""&&!Bu(eo)?Eb(fo,ro):To},Eb=(eo,ro)=>dd(eo)?eo.style.getPropertyValue(ro):"",Tb=(eo,ro)=>{const fo=eo.dom,go=Eb(fo,ro);return Yo.from(go).filter(To=>To.length>0)},Qh=(eo,ro)=>{const fo=eo.dom;mv(fo,ro),Qf(Ts(eo,"style").map(Hh),"")&&ks(eo,"style")},Xg=(eo,ro)=>{const fo=eo.dom,go=ro.dom;dd(fo)&&dd(go)&&(go.style.cssText=fo.style.cssText)},Gc=(eo,ro,fo=0)=>Ts(eo,ro).map(go=>parseInt(go,10)).getOr(fo),im=(eo,ro)=>Gc(eo,ro,1),Tf=eo=>Vc("col")(eo)?Gc(eo,"span",1)>1:im(eo,"colspan")>1,Ld=eo=>im(eo,"rowspan")>1,Od=(eo,ro)=>parseInt(qd(eo,ro),10),Mu=xo(10),Vh=xo(10),zp=(eo,ro)=>Tg(eo,ro,is),Tg=(eo,ro,fo)=>Ca(fc(eo),go=>tl(go,ro)?fo(go)?[go]:[]:Tg(go,ro,fo)),Ab=(eo,ro,fo=ms)=>{if(fo(ro))return Yo.none();if(gs(eo,pr(ro)))return Yo.some(ro);const go=To=>tl(To,"table")||fo(To);return Tm(ro,eo.join(","),go)},P1=(eo,ro)=>Ab(["td","th"],eo,ro),Yf=eo=>zp(eo,"th,td"),$1=eo=>tl(eo,"colgroup")?ya(eo,"col"):Ca(R1(eo),ro=>ya(ro,"col")),jd=(eo,ro)=>hu(eo,"table",ro),$m=eo=>zp(eo,"tr"),R1=eo=>jd(eo).fold(xo([]),ro=>ya(ro,"colgroup")),Xm=(eo,ro)=>cr(eo,fo=>{if(pr(fo)==="colgroup"){const go=cr($1(fo),To=>{const No=Gc(To,"span",1);return Fp(To,1,No)});return As(fo,go,"colgroup")}else{const go=cr(Yf(fo),To=>{const No=Gc(To,"rowspan",1),Zo=Gc(To,"colspan",1);return Fp(To,No,Zo)});return As(fo,go,ro(fo))}}),Yg=eo=>bd(eo).map(ro=>{const fo=pr(ro);return kf(fo)?fo:"tbody"}).getOr("tbody"),Vf=eo=>{const ro=$m(eo),go=[...R1(eo),...ro];return Xm(go,Yg)},Gg=(eo,ro)=>Xm(eo,()=>ro),yp=eo=>{let ro=!1,fo;return(...go)=>(ro||(ro=!0,fo=eo.apply(null,go)),fo)},p0=(eo,ro,fo,go)=>{const To=eo.isiOS()&&/ipad/i.test(fo)===!0,No=eo.isiOS()&&!To,Zo=eo.isiOS()||eo.isAndroid(),ns=Zo||go("(pointer:coarse)"),ps=To||!No&&Zo&&go("(min-device-width:768px)"),$s=No||Zo&&!ps,js=ro.isSafari()&&eo.isiOS()&&/safari/i.test(fo)===!1,Nr=!$s&&!ps&&!js;return{isiPad:xo(To),isiPhone:xo(No),isTablet:xo(ps),isPhone:xo($s),isTouch:xo(ns),isAndroid:eo.isAndroid,isiOS:eo.isiOS,isWebView:xo(js),isDesktop:xo(Nr)}},g0=(eo,ro)=>{for(let fo=0;fo{const fo=g0(eo,ro);if(!fo)return{major:0,minor:0};const go=To=>Number(ro.replace(fo,"$"+To));return Cs(go(1),go(2))},zf=(eo,ro)=>{const fo=String(ro).toLowerCase();return eo.length===0?b0():Wp(eo,fo)},b0=()=>Cs(0,0),Cs=(eo,ro)=>({major:eo,minor:ro}),Up={nu:Cs,detect:zf,unknown:b0},zh=(eo,ro)=>Vr(ro.brands,fo=>{const go=fo.brand.toLowerCase();return zo(eo,To=>{var No;return go===((No=To.brand)===null||No===void 0?void 0:No.toLowerCase())}).map(To=>({current:To.name,version:Up.nu(parseInt(fo.version,10),0)}))}),Kg=(eo,ro)=>{const fo=String(ro).toLowerCase();return zo(eo,go=>go.search(fo))},v0=(eo,ro)=>Kg(eo,ro).map(fo=>{const go=Up.detect(fo.versionRegexes,ro);return{current:fo.name,version:go}}),Jg=(eo,ro)=>Kg(eo,ro).map(fo=>{const go=Up.detect(fo.versionRegexes,ro);return{current:fo.name,version:go}}),Vs=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Dr=eo=>ro=>vc(ro,eo),Tr=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:eo=>vc(eo,"edge/")&&vc(eo,"chrome")&&vc(eo,"safari")&&vc(eo,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Vs],search:eo=>vc(eo,"chrome")&&!vc(eo,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:eo=>vc(eo,"msie")||vc(eo,"trident")},{name:"Opera",versionRegexes:[Vs,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Dr("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Dr("firefox")},{name:"Safari",versionRegexes:[Vs,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:eo=>(vc(eo,"safari")||vc(eo,"mobile/"))&&vc(eo,"applewebkit")}],Fa=[{name:"Windows",search:Dr("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:eo=>vc(eo,"iphone")||vc(eo,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Dr("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Dr("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Dr("linux"),versionRegexes:[]},{name:"Solaris",search:Dr("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Dr("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Dr("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],zl={browsers:xo(Tr),oses:xo(Fa)},_c="Edge",Wc="Chromium",Uc="IE",D1="Opera",pv="Firefox",_d="Safari",Wh=()=>y0({current:void 0,version:Up.unknown()}),y0=eo=>{const ro=eo.current,fo=eo.version,go=To=>()=>ro===To;return{current:ro,version:fo,isEdge:go(_c),isChromium:go(Wc),isIE:go(Uc),isOpera:go(D1),isFirefox:go(pv),isSafari:go(_d)}},Id={unknown:Wh,nu:y0,edge:xo(_c),chromium:xo(Wc),ie:xo(Uc),opera:xo(D1),firefox:xo(pv),safari:xo(_d)},Ku="Windows",Rm="iOS",iu="Android",am="Linux",Af="macOS",e1="Solaris",gv="FreeBSD",M1="ChromeOS",Pb=()=>Op({current:void 0,version:Up.unknown()}),Op=eo=>{const ro=eo.current,fo=eo.version,go=To=>()=>ro===To;return{current:ro,version:fo,isWindows:go(Ku),isiOS:go(Rm),isAndroid:go(iu),isMacOS:go(Af),isLinux:go(am),isSolaris:go(e1),isFreeBSD:go(gv),isChromeOS:go(M1)}},Wf={unknown:Pb,nu:Op,windows:xo(Ku),ios:xo(Rm),android:xo(iu),linux:xo(am),macos:xo(Af),solaris:xo(e1),freebsd:xo(gv),chromeos:xo(M1)},Ny={detect:(eo,ro,fo)=>{const go=zl.browsers(),To=zl.oses(),No=ro.bind(ps=>zh(go,ps)).orThunk(()=>v0(go,eo)).fold(Id.unknown,Id.nu),Zo=Jg(To,eo).fold(Wf.unknown,Wf.nu),ns=p0(Zo,No,eo,fo);return{browser:No,os:Zo,deviceType:ns}}},t1=eo=>window.matchMedia(eo).matches;let $b=yp(()=>Ny.detect(navigator.userAgent,Yo.from(navigator.userAgentData),t1));const Zp=()=>$b(),qp=(eo,ro)=>{const fo=(ns,ps)=>{if(!Oo(ps)&&!ps.match(/^[0-9]+$/))throw new Error(eo+".set accepts only positive integer values. Value was "+ps);const $s=ns.dom;dd($s)&&($s.style[eo]=ps+"px")},go=ns=>{const ps=ro(ns);if(ps<=0||ps===null){const $s=qd(ns,eo);return parseFloat($s)||0}return ps},To=go,No=(ns,ps)=>hs(ps,($s,js)=>{const Nr=qd(ns,js),la=Nr===void 0?0:parseInt(Nr,10);return isNaN(la)?$s:$s+la},0);return{set:fo,get:go,getOuter:To,aggregate:No,max:(ns,ps,$s)=>{const js=No(ns,$s);return ps>js?ps-js:0}}},Ag=(eo,ro)=>ql(eo).getOr(ro),Kc=(eo,ro,fo)=>Ag(qd(eo,ro),fo),au=(eo,ro,fo,go)=>{const To=Kc(eo,`padding-${fo}`,0),No=Kc(eo,`padding-${go}`,0),Zo=Kc(eo,`border-${fo}-width`,0),ns=Kc(eo,`border-${go}-width`,0);return ro-To-No-Zo-ns},cf=(eo,ro)=>{const fo=eo.dom,go=fo.getBoundingClientRect().width||fo.offsetWidth;return ro==="border-box"?go:au(eo,go,"left","right")},O0=eo=>Kc(eo,"height",eo.dom.offsetHeight),bv=eo=>Kc(eo,"width",eo.dom.offsetWidth),tf=eo=>cf(eo,"content-box"),lm=qp("width",eo=>eo.dom.offsetWidth),uf=eo=>lm.get(eo),cm=eo=>lm.getOuter(eo),Rb=tf,yl=bv,dh=(eo,ro,fo)=>{const go=eo.cells,To=go.slice(0,ro),No=go.slice(ro),Zo=To.concat(fo).concat(No);return df(eo,Zo)},jp=(eo,ro,fo)=>dh(eo,ro,[fo]),Sd=(eo,ro,fo)=>{const go=eo.cells;go[ro]=fo},df=(eo,ro)=>Fr(eo.element,ro,eo.section,eo.isNew),vv=(eo,ro)=>{const fo=eo.cells,go=cr(fo,ro);return Fr(eo.element,go,eo.section,eo.isNew)},ff=(eo,ro)=>eo.cells[ro],Ju=(eo,ro)=>ff(eo,ro).element,wh=eo=>eo.cells.length,fd=eo=>{const ro=Br(eo,fo=>fo.section==="colgroup");return{rows:ro.fail,cols:ro.pass}},Ym=(eo,ro,fo)=>{const go=cr(eo.cells,fo);return Fr(ro(eo.element),go,eo.section,!0)},_p="data-snooker-locked-cols",xu=eo=>Ts(eo,_p).bind(ro=>Yo.from(ro.match(/\d+/g))).map(ro=>Zs(ro,is)),ed=eo=>{const ro=hs(fd(eo).rows,(go,To)=>(ws(To.cells,(No,Zo)=>{No.isLocked&&(go[Zo]=!0)}),go),{}),fo=gc(ro,(go,To)=>parseInt(To,10));return Sr(fo)},fh=(eo,ro)=>eo+","+ro,Gm=(eo,ro,fo)=>Yo.from(eo.access[fh(ro,fo)]),Fu=(eo,ro,fo)=>{const go=_0(eo,To=>fo(ro,To.element));return go.length>0?Yo.some(go[0]):Yo.none()},_0=(eo,ro)=>{const fo=Ca(eo.all,go=>go.cells);return _r(fo,ro)},yv=eo=>{const ro={};let fo=0;return ws(eo.cells,go=>{const To=go.colspan;Qr(To,No=>{const Zo=fo+No;ro[Zo]=Nc(go.element,To,Zo)}),fo+=To}),ro},Lc=eo=>{const ro={},fo=[],To=fs(eo).map(sa=>sa.element).bind(jd).bind(xu).getOr({});let No=0,Zo=0,ns=0;const{pass:ps,fail:$s}=Br(eo,sa=>sa.section==="colgroup");ws($s,sa=>{const xr=[];ws(sa.cells,ca=>{let Cr=0;for(;ro[fh(ns,Cr)]!==void 0;)Cr++;const Ra=Vl(To,Cr.toString()),dl=rs(ca.element,ca.rowspan,ca.colspan,ns,Cr,Ra);for(let Bl=0;Bl{const xr=yv(sa);return{colgroups:[xl(sa.element,nc(xr))],columns:xr}}).getOrThunk(()=>({colgroups:[],columns:{}}));return{grid:Fh(No,Zo),access:ro,all:fo,columns:js,colgroups:Nr}},ss={fromTable:eo=>{const ro=Vf(eo);return Lc(ro)},generate:Lc,getAt:Gm,findItem:Fu,filterItems:_0,justCells:eo=>Ca(eo.all,ro=>ro.cells),justColumns:eo=>nc(eo.columns),hasColumns:eo=>nr(eo.columns).length>0,getColumnAt:(eo,ro)=>Yo.from(eo.columns[ro])},dm=(eo,ro=is)=>{const fo=eo.grid,go=Qr(fo.columns,Io),To=Qr(fo.rows,Io);return cr(go,No=>n1(()=>Ca(To,$s=>ss.getAt(eo,$s,No).filter(js=>js.column===No).toArray()),$s=>$s.colspan===1&&ro($s.element),()=>ss.getAt(eo,0,No)))},n1=(eo,ro,fo)=>{const go=eo();return zo(go,ro).orThunk(()=>Yo.from(go[0]).orThunk(fo)).map(Zo=>Zo.element)},Ch=eo=>{const ro=eo.grid,fo=Qr(ro.rows,Io),go=Qr(ro.columns,Io);return cr(fo,To=>n1(()=>Ca(go,ps=>ss.getAt(eo,To,ps).filter($s=>$s.row===To).fold(xo([]),$s=>[$s])),ps=>ps.rowspan===1,()=>ss.getAt(eo,To,0)))},Xc=(eo,ro)=>{if(ro<0||ro>=eo.length-1)return Yo.none();const fo=eo[ro].fold(()=>{const To=Il(eo.slice(0,ro));return Vr(To,(No,Zo)=>No.map(ns=>({value:ns,delta:Zo+1})))},To=>Yo.some({value:To,delta:0})),go=eo[ro+1].fold(()=>{const To=eo.slice(ro+1);return Vr(To,(No,Zo)=>No.map(ns=>({value:ns,delta:Zo+1})))},To=>Yo.some({value:To,delta:1}));return fo.bind(To=>go.map(No=>{const Zo=No.delta+To.delta;return Math.abs(No.value-To.value)/Zo}))},Ov=(eo,ro)=>fo=>Db(fo)==="rtl"?ro:eo,Db=eo=>qd(eo,"direction")==="rtl"?"rtl":"ltr",S0=qp("height",eo=>{const ro=eo.dom;return Bu(eo)?ro.getBoundingClientRect().height:ro.offsetHeight}),Mm=eo=>S0.get(eo),Eo=eo=>S0.getOuter(eo),Bo=O0,Ko=(eo,ro)=>({left:eo,top:ro,translate:(go,To)=>Ko(eo+go,ro+To)}),Ss=Ko,Rs=eo=>{const ro=eo.getBoundingClientRect();return Ss(ro.left,ro.top)},$r=(eo,ro)=>eo!==void 0?eo:ro!==void 0?ro:0,Ea=eo=>{const ro=eo.dom.ownerDocument,fo=ro.body,go=ro.defaultView,To=ro.documentElement;if(fo===eo.dom)return Ss(fo.offsetLeft,fo.offsetTop);const No=$r(go==null?void 0:go.pageYOffset,To.scrollTop),Zo=$r(go==null?void 0:go.pageXOffset,To.scrollLeft),ns=$r(To.clientTop,fo.clientTop),ps=$r(To.clientLeft,fo.clientLeft);return ll(eo).translate(Zo-ps,No-ns)},ll=eo=>{const ro=eo.dom,go=ro.ownerDocument.body;return go===ro?Ss(go.offsetLeft,go.offsetTop):Bu(eo)?Rs(ro):Ss(0,0)},nl=(eo,ro)=>({row:eo,y:ro}),Xa=(eo,ro)=>({col:eo,x:ro}),Nu=eo=>Ea(eo).left+cm(eo),zu=eo=>Ea(eo).left,kh=(eo,ro)=>Xa(eo,zu(ro)),Sp=(eo,ro)=>Xa(eo,Nu(ro)),mf=eo=>Ea(eo).top,fS=(eo,ro)=>nl(eo,mf(ro)),mu=(eo,ro)=>nl(eo,mf(ro)+Eo(ro)),Ta=(eo,ro,fo)=>{if(fo.length===0)return[];const go=cr(fo.slice(1),(No,Zo)=>No.map(ns=>eo(Zo,ns))),To=fo[fo.length-1].map(No=>ro(fo.length-1,No));return go.concat([To])},Xp=eo=>-eo,Oa={delta:Io,positions:eo=>Ta(fS,mu,eo),edge:mf},Yp=Ov({delta:Io,edge:zu,positions:eo=>Ta(kh,Sp,eo)},{delta:Xp,edge:Nu,positions:eo=>Ta(Sp,kh,eo)}),Ad={delta:(eo,ro)=>Yp(ro).delta(eo,ro),positions:(eo,ro)=>Yp(ro).positions(eo,ro),edge:eo=>Yp(eo).edge(eo)},Pg={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},w0=(()=>{const eo="[0-9]+",fo="[eE]"+("[+-]?"+eo),go="\\.",To=ns=>`(?:${ns})?`,Zo=`[+-]?(?:${["Infinity",eo+go+To(eo)+To(fo),go+eo+To(fo),eo+To(fo)].join("|")})`;return new RegExp(`^(${Zo})(.*)$`)})(),nf=(eo,ro)=>xs(ro,fo=>xs(Pg[fo],go=>eo===go)),Jm=(eo,ro)=>Yo.from(w0.exec(eo)).bind(go=>{const To=Number(go[1]),No=go[2];return nf(No,ro)?Yo.some({value:To,unit:No}):Yo.none()}),_v=/(\d+(\.\d+)?)%/,Gp=/(\d+(\.\d+)?)px|em/,Sv=Vc("col"),$g=(eo,ro,fo)=>{const go=Nd(eo).getOrThunk(()=>cs(Ud(eo)));return ro(eo)/fo(go)*100},Ir=(eo,ro)=>{Du(eo,"width",ro+"px")},RO=(eo,ro)=>{Du(eo,"width",ro+"%")},Rg=(eo,ro)=>{Du(eo,"height",ro+"px")},Dg=eo=>Bo(eo)+"px",Nm=(eo,ro,fo,go)=>{const To=jd(eo).map(No=>{const Zo=fo(No);return Math.floor(ro/100*Zo)}).getOr(ro);return go(eo,To),To},Lu=(eo,ro,fo,go)=>{const To=parseFloat(eo);return Pm(eo,"%")&&pr(ro)!=="table"?Nm(ro,To,fo,go):To},Ec=eo=>{const ro=Dg(eo);return ro?Lu(ro,eo,Mm,Rg):Mm(eo)},td=(eo,ro,fo)=>{const go=fo(eo),To=im(eo,ro);return go/To},Gf=(eo,ro)=>Tb(eo,ro).orThunk(()=>Ts(eo,ro).map(fo=>fo+"px")),jl=eo=>Gf(eo,"width"),L1=eo=>Gf(eo,"height"),Bd=eo=>$g(eo,uf,Rb),pu=eo=>Sv(eo)?uf(eo):yl(eo),C0=eo=>td(eo,"rowspan",Ec),Er=eo=>jl(eo).bind(fo=>Jm(fo,["fixed","relative","empty"])),Kf=(eo,ro,fo)=>{Du(eo,"width",ro+fo)},k0=eo=>uf(eo)+"px",hc=eo=>$g(eo,uf,Rb)+"%",hd=eo=>jl(eo).exists(ro=>_v.test(ro)),wv=eo=>jl(eo).exists(ro=>Gp.test(ro)),ep=eo=>jl(eo).isNone(),tp=xo(_v),fm=Vc("col"),Mb=eo=>jl(eo).getOrThunk(()=>pu(eo)+"px"),Pf=eo=>L1(eo).getOrThunk(()=>C0(eo)+"px"),Tc=eo=>cr(ss.justColumns(eo),ro=>Yo.from(ro.element)),Fd=eo=>{const ro=Zp().browser,fo=ro.isChromium()||ro.isFirefox();return fm(eo)?fo:!0},Mg=(eo,ro,fo,go,To,No)=>eo.filter(go).fold(()=>No(Xc(fo,ro)),Zo=>To(Zo)),$f=(eo,ro,fo,go)=>{const To=dm(eo),No=ss.hasColumns(eo)?Tc(eo):To,Zo=[Yo.some(Ad.edge(ro))].concat(cr(Ad.positions(To,ro),ps=>ps.map($s=>$s.x))),ns=Mo(Tf);return cr(No,(ps,$s)=>Mg(ps,$s,Zo,ns,js=>{if(Fd(js))return fo(js);{const Nr=Vp(To[$s],Io);return Mg(Nr,$s,Zo,ns,la=>go(Yo.some(uf(la))),go)}},go))},Ly=eo=>eo.map(ro=>ro+"px").getOr(""),I1=(eo,ro)=>$f(eo,ro,Mb,Ly),Ng=(eo,ro,fo)=>$f(eo,ro,Bd,go=>go.fold(()=>fo.minCellWidth(),To=>To/fo.pixelWidth()*100)),hh=(eo,ro,fo)=>$f(eo,ro,pu,go=>go.getOrThunk(fo.minCellWidth)),np=(eo,ro,fo,go,To)=>{const No=Ch(eo),Zo=[Yo.some(fo.edge(ro))].concat(cr(fo.positions(No,ro),ns=>ns.map(ps=>ps.y)));return cr(No,(ns,ps)=>Mg(ns,ps,Zo,Mo(Ld),go,To))},Gs=(eo,ro,fo)=>np(eo,ro,fo,C0,go=>go.getOrThunk(Vh)),xh=(eo,ro,fo)=>np(eo,ro,fo,Pf,Ly),Lm=(eo,ro)=>()=>Bu(eo)?ro(eo):parseFloat(Tb(eo,"width").getOr("0")),mh=eo=>{const ro=Lm(eo,uf),fo=xo(0);return{width:ro,pixelWidth:ro,getWidths:(To,No)=>hh(To,eo,No),getCellDelta:fo,singleColumnWidth:xo([0]),minCellWidth:fo,setElementWidth:So,adjustTableWidth:So,isRelative:!0,label:"none"}},Eh=eo=>{const ro=Lm(eo,ps=>parseFloat(hc(ps))),fo=Lm(eo,uf);return{width:ro,pixelWidth:fo,getWidths:(ps,$s)=>Ng(ps,eo,$s),getCellDelta:ps=>ps/fo()*100,singleColumnWidth:(ps,$s)=>[100-ps],minCellWidth:()=>Mu()/fo()*100,setElementWidth:RO,adjustTableWidth:ps=>{const $s=ro(),js=ps/100*$s,Nr=$s+js;RO(eo,Nr)},isRelative:!0,label:"percent"}},Xd=eo=>{const ro=Lm(eo,uf);return{width:ro,pixelWidth:ro,getWidths:(Zo,ns)=>hh(Zo,eo,ns),getCellDelta:Io,singleColumnWidth:(Zo,ns)=>[Math.max(Mu(),Zo+ns)-Zo],minCellWidth:Mu,setElementWidth:Ir,adjustTableWidth:Zo=>{const ns=ro()+Zo;Ir(eo,ns)},isRelative:!1,label:"pixel"}},Hd=(eo,ro)=>tp().exec(ro)!==null?Eh(eo):Xd(eo),Th={getTableSize:eo=>jl(eo).fold(()=>mh(eo),fo=>Hd(eo,fo)),pixelSize:Xd,percentageSize:Eh,noneSize:mh},Kp=(eo,ro,fo,go,To,No)=>({minRow:eo,minCol:ro,maxRow:fo,maxCol:go,allCells:To,selectedCells:No}),Ua=(eo,ro)=>{const fo=eo.grid.columns;let To=eo.grid.rows,No=fo,Zo=0,ns=0;const ps=[],$s=[];return ra(eo.access,js=>{if(ps.push(js),ro(js)){$s.push(js);const Nr=js.row,la=Nr+js.rowspan-1,sa=js.column,xr=sa+js.colspan-1;NrZo&&(Zo=la),sans&&(ns=xr)}}),Kp(To,No,Zo,ns,ps,$s)},_o=(eo,ro,fo)=>{const go=eo[fo].element,To=Ds.fromTag("td");Qc(To,Ds.fromTag("br")),(ro?Qc:Cu)(go,To)},Po=(eo,ro,fo,go)=>{const To=_r(eo,ns=>ns.section!=="colgroup"),No=ro.grid.columns,Zo=ro.grid.rows;for(let ns=0;nsfo.maxRow||$sfo.maxCol||(ss.getAt(ro,ns,$s).filter(go).isNone()?_o(To,ps,ns):ps=!0)}},Xo=(eo,ro,fo,go)=>{ra(fo.columns,Zo=>{(Zo.columnro.maxCol)&&ju(Zo.element)});const To=_r(zp(eo,"tr"),Zo=>Zo.dom.childElementCount===0);ws(To,ju),(ro.minCol===ro.maxCol||ro.minRow===ro.maxRow)&&ws(zp(eo,"th,td"),Zo=>{ks(Zo,"rowspan"),ks(Zo,"colspan")}),ks(eo,_p),ks(eo,"data-snooker-col-series"),Th.getTableSize(eo).adjustTableWidth(go)},as=(eo,ro,fo,go)=>{if(go.minCol===0&&ro.grid.columns===go.maxCol+1)return 0;const To=hh(ro,eo,fo),No=hs(To,($s,js)=>$s+js,0),ps=hs(To.slice(go.minCol,go.maxCol+1),($s,js)=>$s+js,0)/No*fo.pixelWidth()-fo.pixelWidth();return fo.getCellDelta(ps)},Ms=(eo,ro)=>{const fo=la=>tl(la.element,ro),go=ah(eo),To=Vf(go),No=Th.getTableSize(eo),Zo=ss.generate(To),ns=Ua(Zo,fo),ps="th:not("+ro+"),td:not("+ro+")",$s=Tg(go,"th,td",la=>tl(la,ps));ws($s,ju),Po(To,Zo,ns,fo);const js=ss.fromTable(eo),Nr=as(eo,js,No,ns);return Xo(go,ns,Zo,Nr),go},vr=" ",Jr=((eo,ro)=>{const fo=No=>{if(!eo(No))throw new Error("Can only get "+ro+" value of a "+ro+" node");return go(No).getOr("")},go=No=>eo(No)?Yo.from(No.dom.nodeValue):Yo.none();return{get:fo,getOption:go,set:(No,Zo)=>{if(!eo(No))throw new Error("Can only set raw "+ro+" value of a "+ro+" node");No.dom.nodeValue=Zo}}})(Na,"text"),La=eo=>Jr.get(eo),Ol=eo=>Jr.getOption(eo),Xu=(eo,ro)=>Jr.set(eo,ro),Ac=eo=>pr(eo)==="img"?1:Ol(eo).fold(()=>fc(eo).length,ro=>ro.length),gu=eo=>Ol(eo).filter(ro=>ro.trim().length!==0||ro.indexOf(vr)>-1).isSome(),Uh=eo=>Mr(eo)&&Vu(eo,"contenteditable")==="false",Jf=["img","br"],hm=eo=>gu(eo)||gs(Jf,pr(eo))||Uh(eo),Jp=eo=>jc(eo,hm),wp=eo=>B1(eo,hm),B1=(eo,ro)=>{const fo=go=>{const To=fc(go);for(let No=To.length-1;No>=0;No--){const Zo=To[No];if(ro(Zo))return Yo.some(Zo);const ns=fo(Zo);if(ns.isSome())return ns}return Yo.none()};return fo(eo)},Sc={scope:["row","col"]},F1=eo=>()=>{const ro=Ds.fromTag("td",eo.dom);return Qc(ro,Ds.fromTag("br",eo.dom)),ro},x0=eo=>()=>Ds.fromTag("col",eo.dom),nd=eo=>()=>Ds.fromTag("colgroup",eo.dom),mm=eo=>()=>Ds.fromTag("tr",eo.dom),Nb=(eo,ro,fo)=>{const go=Bp(eo,ro);return ra(fo,(To,No)=>{To===null?ks(go,No):zc(go,No,To)}),go},H1=eo=>eo,Fl=(eo,ro,fo)=>Jp(eo).map(To=>{const No=fo.join(","),Zo=al(To,No,ns=>bc(ns,eo));return ha(Zo,(ns,ps)=>{const $s=Zd(ps);return Qc(ns,$s),$s},ro)}).getOr(ro),Xl=(eo,ro)=>{ra(Sc,(fo,go)=>Ts(eo,go).filter(To=>gs(fo,To)).each(To=>zc(ro,go,To)))},Qd=(eo,ro,fo)=>{const go=(Zo,ns)=>{Xg(Zo.element,ns),Qh(ns,"height"),Zo.colspan!==1&&Qh(ns,"width")},To=Zo=>{const ns=Ds.fromTag(pr(Zo.element),ro.dom),ps=fo.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),$s=ps.length>0?Fl(Zo.element,ns,ps):ns;return Qc($s,Ds.fromTag("br")),go(Zo,ns),Xl(Zo.element,ns),eo(Zo.element,ns),ns};return{col:Zo=>{const ns=Ds.fromTag(pr(Zo.element),ro.dom);return go(Zo,ns),eo(Zo.element,ns),ns},colgroup:nd(ro),row:mm(ro),cell:To,replace:Nb,colGap:x0(ro),gap:F1(ro)}},Rf=eo=>({col:x0(eo),colgroup:nd(eo),row:mm(eo),cell:F1(eo),replace:H1,colGap:x0(eo),gap:F1(eo)}),Cv=(eo,ro)=>{const go=document.createElement("div");return go.innerHTML=eo,fc(Ds.fromDom(go))},eg=eo=>cr(eo,Ds.fromDom),Wu=eo=>ro=>ro.options.get(eo),pm="100%",op=eo=>{var ro;const fo=eo.dom,go=(ro=fo.getParent(eo.selection.getStart(),fo.isBlock))!==null&&ro!==void 0?ro:eo.getBody();return Rb(Ds.fromDom(go))+"px"},Q1=(eo,ro)=>U1(eo)||!Im(eo)?ro:W1(eo)?{...ro,width:op(eo)}:{...ro,width:pm},o1=(eo,ro)=>U1(eo)||Im(eo)?ro:W1(eo)?{...ro,width:op(eo)}:{...ro,width:pm},E0=eo=>{const ro=eo.options.register;ro("table_clone_elements",{processor:"string[]"}),ro("table_use_colgroups",{processor:"boolean",default:!0}),ro("table_header_type",{processor:fo=>{const go=gs(["section","cells","sectionCells","auto"],fo);return go?{value:fo,valid:go}:{valid:!1,message:"Must be one of: section, cells, sectionCells or auto."}},default:"section"}),ro("table_sizing_mode",{processor:"string",default:"auto"}),ro("table_default_attributes",{processor:"object",default:{border:"1"}}),ro("table_default_styles",{processor:"object",default:{"border-collapse":"collapse"}}),ro("table_column_resizing",{processor:fo=>{const go=gs(["preservetable","resizetable"],fo);return go?{value:fo,valid:go}:{valid:!1,message:"Must be preservetable, or resizetable."}},default:"preservetable"}),ro("table_resize_bars",{processor:"boolean",default:!0}),ro("table_style_by_css",{processor:"boolean",default:!0}),ro("table_merge_content_on_paste",{processor:"boolean",default:!0})},Lg=eo=>Yo.from(eo.options.get("table_clone_elements")),lC=eo=>{const ro=eo.options.get("object_resizing");return gs(ro.split(","),"table")},V1=Wu("table_header_type"),By=Wu("table_column_resizing"),z1=eo=>By(eo)==="preservetable",Pd=eo=>By(eo)==="resizetable",Cp=Wu("table_sizing_mode"),tg=eo=>Cp(eo)==="relative",W1=eo=>Cp(eo)==="fixed",U1=eo=>Cp(eo)==="responsive",T0=Wu("table_resize_bars"),Im=Wu("table_style_by_css"),md=Wu("table_merge_content_on_paste"),ng=eo=>{const ro=eo.options,fo=ro.get("table_default_attributes");return ro.isSet("table_default_attributes")?fo:o1(eo,fo)},DO=eo=>{const ro=eo.options,fo=ro.get("table_default_styles");return ro.isSet("table_default_styles")?fo:Q1(eo,fo)},Fy=Wu("table_use_colgroups"),Hy=eo=>hu(eo,"[contenteditable]"),Z1=(eo,ro=!1)=>Bu(eo)?eo.dom.isContentEditable:Hy(eo).fold(xo(ro),fo=>Ah(fo)==="true"),Ah=eo=>eo.dom.contentEditable,kp=eo=>Ds.fromDom(eo.getBody()),s1=eo=>ro=>bc(ro,kp(eo)),Ig=eo=>{ks(eo,"data-mce-style");const ro=fo=>ks(fo,"data-mce-style");ws(Yf(eo),ro),ws($1(eo),ro),ws($m(eo),ro)},Zh=eo=>Ds.fromDom(eo.selection.getStart()),xp=eo=>eo.getBoundingClientRect().width,q1=eo=>eo.getBoundingClientRect().height,hS=(eo,ro)=>{const fo=eo.dom.getStyle(ro,"width")||eo.dom.getAttrib(ro,"width");return Yo.from(fo).filter(A1)},MO=eo=>/^(\d+(\.\d+)?)%$/.test(eo),kv=eo=>/^(\d+(\.\d+)?)px$/.test(eo),j1=eo=>Ef(eo,Vc("table")).exists(Z1),xv=(eo,ro)=>{const fo=ro.column,go=ro.column+ro.colspan-1,To=ro.row,No=ro.row+ro.rowspan-1;return fo<=eo.finishCol&&go>=eo.startCol&&To<=eo.finishRow&&No>=eo.startRow},NO=(eo,ro)=>ro.column>=eo.startCol&&ro.column+ro.colspan-1<=eo.finishCol&&ro.row>=eo.startRow&&ro.row+ro.rowspan-1<=eo.finishRow,Ev=(eo,ro)=>{let fo=!0;const go=Jo(NO,ro);for(let To=ro.startRow;To<=ro.finishRow;To++)for(let No=ro.startCol;No<=ro.finishCol;No++)fo=fo&&ss.getAt(eo,To,No).exists(go);return fo?Yo.some(ro):Yo.none()},Tv=(eo,ro)=>Wa(Math.min(eo.row,ro.row),Math.min(eo.column,ro.column),Math.max(eo.row+eo.rowspan-1,ro.row+ro.rowspan-1),Math.max(eo.column+eo.colspan-1,ro.column+ro.colspan-1)),Wl=(eo,ro,fo)=>{const go=ss.findItem(eo,ro,bc),To=ss.findItem(eo,fo,bc);return go.bind(No=>To.map(Zo=>Tv(No,Zo)))},Qa=(eo,ro,fo)=>Wl(eo,ro,fo).bind(go=>Ev(eo,go)),og=(eo,ro,fo,go)=>ss.findItem(eo,ro,bc).bind(To=>{const No=fo>0?To.row+To.rowspan-1:To.row,Zo=go>0?To.column+To.colspan-1:To.column;return ss.getAt(eo,No+fo,Zo+go).map(ps=>ps.element)}),Av=(eo,ro,fo)=>Wl(eo,ro,fo).map(go=>{const To=ss.filterItems(eo,Jo(xv,go));return cr(To,No=>No.element)}),Lb=(eo,ro)=>{const fo=(go,To)=>nm(To,go);return ss.findItem(eo,ro,fo).map(go=>go.element)},T2=(eo,ro,fo)=>jd(eo).bind(go=>{const To=Qy(go);return og(To,eo,ro,fo)}),LO=(eo,ro,fo)=>{const go=Qy(eo);return Av(go,ro,fo)},Jc=(eo,ro,fo,go,To)=>{const No=Qy(eo),Zo=bc(eo,fo)?Yo.some(ro):Lb(No,ro),ns=bc(eo,To)?Yo.some(go):Lb(No,go);return Zo.bind(ps=>ns.bind($s=>Av(No,ps,$s)))},IO=(eo,ro,fo)=>{const go=Qy(eo);return Qa(go,ro,fo)},Qy=ss.fromTable;var mS=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],wr=()=>{const eo=$s=>Ds.fromDom($s.dom.cloneNode(!1)),ro=$s=>ld($s).dom,fo=$s=>il($s)?pr($s)==="body"?!0:gs(mS,pr($s)):!1,go=$s=>il($s)?gs(["br","img","hr","input"],pr($s)):!1,To=$s=>il($s)&&Vu($s,"contenteditable")==="false",No=($s,js)=>$s.dom.compareDocumentPosition(js.dom),Zo=($s,js)=>{const Nr=ir($s);ad(js,Nr)},ns=$s=>{const js=pr($s);return gs(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],js)},ps=$s=>il($s)?Ts($s,"lang"):Yo.none();return{up:xo({selector:Tm,closest:hu,predicate:qc,all:ih}),down:xo({selector:fu,predicate:ta}),styles:xo({get:qd,getRaw:Tb,set:Du,remove:Qh}),attrs:xo({get:Vu,set:zc,remove:ks,copyTo:Zo}),insert:xo({before:Em,after:ef,afterAll:Oc,append:Qc,appendAll:cd,prepend:Cu,wrap:qm}),remove:xo({unwrap:Xf,remove:ju}),create:xo({nu:Ds.fromTag,clone:eo,text:Ds.fromText}),query:xo({comparePosition:No,prevSibling:om,nextSibling:sm}),property:xo({children:fc,name:pr,parent:bd,document:ro,isText:Na,isComment:Ma,isElement:il,isSpecial:ns,getLanguage:ps,getText:La,setText:Xu,isBoundary:fo,isEmptyTag:go,isNonEditable:To}),eq:bc,is:Ff}};const sg=(eo,ro,fo,go)=>{const To=fo[0],No=fo.slice(1);return go(eo,ro,To,No)},cC=(eo,ro,fo)=>fo.length>0?sg(eo,ro,fo,Pv):Yo.none(),Pv=(eo,ro,fo,go)=>{const To=ro(eo,fo);return ha(go,(No,Zo)=>{const ns=ro(eo,Zo);return A2(eo,No,ns)},To)},A2=(eo,ro,fo)=>ro.bind(go=>fo.filter(Jo(eo.eq,go))),A0=(eo,ro)=>Jo(eo.eq,ro),pS=(eo,ro,fo,go=ms)=>{const To=[ro].concat(eo.up().all(ro)),No=[fo].concat(eo.up().all(fo)),Zo=js=>el(js,go).fold(()=>js,la=>js.slice(0,la+1)),ns=Zo(To),ps=Zo(No),$s=zo(ns,js=>xs(ps,A0(eo,js)));return{firstpath:ns,secondpath:ps,shared:$s}},X1=cC,Y1=pS,rg=wr(),eu=(eo,ro)=>X1(rg,(fo,go)=>eo(go),ro),ig=(eo,ro,fo)=>Y1(rg,eo,ro,fo),$v=eo=>Tm(eo,"table"),qh=(eo,ro,fo)=>{const go=To=>No=>fo!==void 0&&fo(No)||bc(No,To);return bc(eo,ro)?Yo.some({boxes:Yo.some([eo]),start:eo,finish:ro}):$v(eo).bind(To=>$v(ro).bind(No=>{if(bc(To,No))return Yo.some({boxes:LO(To,eo,ro),start:eo,finish:ro});if(nm(To,No)){const Zo=al(ro,"td,th",go(To)),ns=Zo.length>0?Zo[Zo.length-1]:ro;return Yo.some({boxes:Jc(To,eo,To,ro,No),start:eo,finish:ns})}else if(nm(No,To)){const Zo=al(eo,"td,th",go(No)),ns=Zo.length>0?Zo[Zo.length-1]:eo;return Yo.some({boxes:Jc(No,eo,To,ro,No),start:eo,finish:ns})}else return ig(eo,ro).shared.bind(Zo=>hu(Zo,"table",fo).bind(ns=>{const ps=al(ro,"td,th",go(ns)),$s=ps.length>0?ps[ps.length-1]:ro,js=al(eo,"td,th",go(ns)),Nr=js.length>0?js[js.length-1]:eo;return Yo.some({boxes:Jc(ns,eo,To,ro,No),start:Nr,finish:$s})}))}))},Ll=(eo,ro)=>{const fo=fu(eo,ro);return fo.length>0?Yo.some(fo):Yo.none()},Rv=(eo,ro)=>zo(eo,fo=>tl(fo,ro)),G1=(eo,ro,fo)=>Hf(eo,ro).bind(go=>Hf(eo,fo).bind(To=>eu($v,[go,To]).map(No=>({first:go,last:To,table:No})))),Ib=(eo,ro)=>Tm(eo,"table").bind(fo=>Hf(fo,ro).bind(go=>qh(go,eo).bind(To=>To.boxes.map(No=>({boxes:No,start:To.start,finish:To.finish}))))),BO=(eo,ro,fo,go,To)=>Rv(eo,To).bind(No=>T2(No,ro,fo).bind(Zo=>Ib(Zo,go))),Vy=(eo,ro)=>Ll(eo,ro),uC=(eo,ro,fo)=>G1(eo,ro,fo).bind(go=>{const To=ps=>bc(eo,ps),No="thead,tfoot,tbody,table",Zo=Tm(go.first,No,To),ns=Tm(go.last,No,To);return Zo.bind(ps=>ns.bind($s=>bc(ps,$s)?IO(go.table,go.first,go.last):Yo.none()))}),Ph=Io,r1=eo=>{const ro=(go,To)=>Ts(go,To).exists(No=>parseInt(No,10)>1),fo=go=>ro(go,"rowspan")||ro(go,"colspan");return eo.length>0&&za(eo,fo)?Yo.some(eo):Yo.none()},ET=(eo,ro,fo)=>ro.length<=1?Yo.none():uC(eo,fo.firstSelectedSelector,fo.lastSelectedSelector).map(go=>({bounds:go,cells:ro})),FO="data-mce-selected",P0="td["+FO+"],th["+FO+"]",Uf="["+FO+"]",ba="data-mce-first-selected",P2="td["+ba+"],th["+ba+"]",gS="data-mce-last-selected",K1="td["+gS+"],th["+gS+"]",gm=Uf,J1={selected:FO,selectedSelector:P0,firstSelected:ba,firstSelectedSelector:P2,lastSelected:gS,lastSelectedSelector:K1},Dv=(eo,ro,fo)=>({element:fo,mergable:ET(ro,eo,J1),unmergable:r1(eo),selection:Ph(eo)}),$0=(eo,ro,fo)=>({element:eo,clipboard:ro,generators:fo}),Mv=(eo,ro,fo,go)=>({selection:Ph(eo),clipboard:fo,generators:go}),HO=eo=>jd(eo).bind(ro=>Vy(ro,J1.firstSelectedSelector)).fold(xo(eo),ro=>ro[0]),Ep=eo=>(ro,fo)=>{const go=pr(ro),To=go==="col"||go==="colgroup"?HO(ro):ro;return hu(To,eo,fo)},ag=Ep("th,td,caption"),Nv=Ep("th,td"),Tp=eo=>eg(eo.model.table.getSelectedCells()),QO=eo=>_r(Tp(eo),ro=>tl(ro,J1.selectedSelector)),dC=eo=>jd(eo[0]).map(ro=>{const fo=Ms(ro,gm);return Ig(fo),[fo]}),Lv=(eo,ro)=>cr(ro,fo=>eo.selection.serializer.serialize(fo.dom,{})).join(""),i1=eo=>cr(eo,ro=>ro.dom.innerText).join(""),fC=(eo,ro)=>{eo.on("BeforeGetContent",fo=>{const go=To=>{fo.preventDefault(),dC(To).each(No=>{fo.content=fo.format==="text"?i1(No):Lv(eo,No)})};if(fo.selection===!0){const To=QO(eo);To.length>=1&&go(To)}}),eo.on("BeforeSetContent",fo=>{if(fo.selection===!0&&fo.paste===!0){const go=Tp(eo);fs(go).each(To=>{jd(To).each(No=>{const Zo=_r(Cv(fo.content),ps=>pr(ps)!=="meta"),ns=Vc("table");if(md(eo)&&Zo.length===1&&ns(Zo[0])){fo.preventDefault();const ps=Ds.fromDom(eo.getDoc()),$s=Rf(ps),js=$0(To,Zo[0],$s);ro.pasteCells(No,js).each(()=>{eo.focus()})}})})}})},Iv=(eo,ro)=>({element:eo,offset:ro}),eb=(eo,ro,fo)=>eo.property().isText(ro)&&eo.property().getText(ro).trim().length===0||eo.property().isComment(ro)?fo(ro).bind(go=>eb(eo,go,fo).orThunk(()=>Yo.some(go))):Yo.none(),Ap=(eo,ro)=>eo.property().isText(ro)?eo.property().getText(ro).length:eo.property().children(ro).length,ph=(eo,ro)=>{const fo=eb(eo,ro,eo.query().prevSibling).getOr(ro);if(eo.property().isText(fo))return Iv(fo,Ap(eo,fo));const go=eo.property().children(fo);return go.length>0?ph(eo,go[go.length-1]):Iv(fo,Ap(eo,fo))},bS=ph,vS=wr(),yS=eo=>bS(vS,eo),Bv=(eo,ro)=>{Tf(eo)||Er(eo).each(go=>{const To=go.value/2;Kf(eo,To,go.unit),Kf(ro,To,go.unit)})},bm=eo=>cr(eo,xo(0)),Bm=(eo,ro,fo,go,To)=>To(eo.slice(0,ro)).concat(go).concat(To(eo.slice(fo))),a1=eo=>(ro,fo,go,To)=>{if(eo(go)){const No=Math.max(To,ro[fo]-Math.abs(go)),Zo=Math.abs(No-ro[fo]);return go>=0?Zo:-Zo}else return go},VO=a1(eo=>eo<0),hC=a1(is),mC=()=>{const eo=(ns,ps,$s,js,Nr)=>{const la=VO(ns,ps,js,Nr);return Bm(ns,ps,$s+1,[la,0],bm)},ro=(ns,ps,$s,js)=>{const Nr=(100+$s)/100,la=Math.max(js,(ns[ps]+$s)/Nr);return cr(ns,(sa,xr)=>(xr===ps?la:sa/Nr)-sa)},fo=(ns,ps,$s,js,Nr,la)=>la?ro(ns,ps,js,Nr):eo(ns,ps,$s,js,Nr);return{resizeTable:(ns,ps)=>ns(ps),clampTableDelta:VO,calcLeftEdgeDeltas:fo,calcMiddleDeltas:(ns,ps,$s,js,Nr,la,sa)=>fo(ns,$s,js,Nr,la,sa),calcRightEdgeDeltas:(ns,ps,$s,js,Nr,la)=>{if(la)return ro(ns,$s,js,Nr);{const sa=VO(ns,$s,js,Nr);return bm(ns.slice(0,$s)).concat([sa])}},calcRedestributedWidths:(ns,ps,$s,js)=>{if(js){const la=(ps+$s)/ps,sa=cr(ns,xr=>xr/la);return{delta:la*100-100,newSizes:sa}}else return{delta:$s,newSizes:ns}}}},OS=()=>{const eo=(Zo,ns,ps,$s,js)=>{const Nr=$s>=0?ps:ns,la=hC(Zo,Nr,$s,js);return Bm(Zo,ns,ps+1,[la,-la],bm)};return{resizeTable:(Zo,ns,ps)=>{ps&&Zo(ns)},clampTableDelta:(Zo,ns,ps,$s,js)=>{if(js){if(ps>=0)return ps;{const Nr=hs(Zo,(la,sa)=>la+sa-$s,0);return Math.max(-Nr,ps)}}else return VO(Zo,ns,ps,$s)},calcLeftEdgeDeltas:eo,calcMiddleDeltas:(Zo,ns,ps,$s,js,Nr)=>eo(Zo,ps,$s,js,Nr),calcRightEdgeDeltas:(Zo,ns,ps,$s,js,Nr)=>{if(Nr)return bm(Zo);{const la=$s/Zo.length;return cr(Zo,xo(la))}},calcRedestributedWidths:(Zo,ns,ps,$s)=>({delta:0,newSizes:Zo})}},Fv=eo=>ss.fromTable(eo).grid,Hv=Vc("th"),zO=eo=>za(eo,ro=>Hv(ro.element)),$2=(eo,ro)=>eo&&ro?"sectionCells":eo?"section":"cells",WO=eo=>{const ro=eo.section==="thead",fo=Qf(Qv(eo.cells),"th");return eo.section==="tfoot"?{type:"footer"}:ro||fo?{type:"header",subType:$2(ro,fo)}:{type:"body"}},Qv=eo=>{const ro=_r(eo,fo=>Hv(fo.element));return ro.length===0?Yo.some("td"):ro.length===eo.length?Yo.some("th"):Yo.none()},R2=eo=>{const ro=cr(eo,To=>WO(To).type),fo=gs(ro,"header"),go=gs(ro,"footer");if(!fo&&!go)return Yo.some("body");{const To=gs(ro,"body");return fo&&!To&&!go?Yo.some("header"):!fo&&!To&&go?Yo.some("footer"):Yo.none()}},zy=eo=>Vr(eo.all,ro=>{const fo=WO(ro);return fo.type==="header"?Yo.from(fo.subType):Yo.none()}),_S=(eo,ro,fo)=>rr(fo(eo.element,ro),!0,eo.isLocked),vm=(eo,ro)=>eo.section!==ro?Fr(eo.element,eo.cells,ro,eo.isNew):eo,Wy=()=>({transformRow:vm,transformCell:(eo,ro,fo)=>{const go=fo(eo.element,ro),To=pr(go)!=="td"?ch(go,"td"):go;return rr(To,eo.isNew,eo.isLocked)}}),SS=()=>({transformRow:vm,transformCell:_S}),UO=()=>({transformRow:(eo,ro)=>vm(eo,ro==="thead"?"tbody":ro),transformCell:_S}),tb={getTableSectionType:(eo,ro)=>{const fo=ss.fromTable(eo);switch(zy(fo).getOr(ro)){case"section":return Wy();case"sectionCells":return SS();case"cells":return UO()}},section:Wy,sectionCells:SS,cells:UO,fallback:()=>({transformRow:Io,transformCell:_S})},l1=(eo,ro,fo,go)=>{fo===go?ks(eo,ro):zc(eo,ro,fo)},wS=(eo,ro,fo)=>{dr(ya(eo,ro)).fold(()=>Cu(eo,fo),go=>ef(go,fo))},Vv=(eo,ro)=>{const fo=El(eo,ro).getOrThunk(()=>{const go=Ds.fromTag(ro,Ud(eo).dom);return ro==="thead"?wS(eo,"caption,colgroup",go):ro==="colgroup"?wS(eo,"caption",go):Qc(eo,go),go});return vd(fo),fo},qO=(eo,ro)=>{const fo=[],go=[],To=sa=>cr(sa,xr=>{xr.isNew&&fo.push(xr.element);const ca=xr.element;return vd(ca),ws(xr.cells,Cr=>{Cr.isNew&&go.push(Cr.element),l1(Cr.element,"colspan",Cr.colspan,1),l1(Cr.element,"rowspan",Cr.rowspan,1),Qc(ca,Cr.element)}),ca}),No=sa=>Ca(sa,xr=>cr(xr.cells,ca=>(l1(ca.element,"span",ca.colspan,1),ca.element))),Zo=(sa,xr)=>{const ca=Vv(eo,xr),Ra=(xr==="colgroup"?No:To)(sa);cd(ca,Ra)},ns=sa=>{El(eo,sa).each(ju)},ps=(sa,xr)=>{sa.length>0?Zo(sa,xr):ns(xr)},$s=[],js=[],Nr=[],la=[];return ws(ro,sa=>{switch(sa.section){case"thead":$s.push(sa);break;case"tbody":js.push(sa);break;case"tfoot":Nr.push(sa);break;case"colgroup":la.push(sa);break}}),ps(la,"colgroup"),ps($s,"thead"),ps(js,"tbody"),ps(Nr,"tfoot"),{newRows:fo,newCells:go}},pC=eo=>cr(eo,ro=>{const fo=Zd(ro.element);return ws(ro.cells,go=>{const To=ah(go.element);l1(To,"colspan",go.colspan,1),l1(To,"rowspan",go.rowspan,1),Qc(fo,To)}),fo}),Eu=(eo,ro)=>cr(eo,fo=>ff(fo,ro)),lg=(eo,ro)=>eo[ro],$d=(eo,ro)=>{if(eo.length===0)return 0;const fo=eo[0];return el(eo,To=>!ro(fo.element,To.element)).getOr(eo.length)},gC=(eo,ro,fo,go)=>{const To=lg(eo,ro),No=To.section==="colgroup",Zo=$d(To.cells.slice(fo),go),ns=No?1:$d(Eu(eo.slice(ro),fo),go);return{colspan:Zo,rowspan:ns}},Yu=(eo,ro)=>{const fo=cr(eo,To=>cr(To.cells,ms)),go=(To,No,Zo,ns)=>{for(let ps=To;ps{const Zo=Ca(To.cells,(ns,ps)=>{if(fo[No][ps]===!1){const $s=gC(eo,No,ps,ro);return go(No,ps,$s.rowspan,$s.colspan),[Eg(ns.element,$s.rowspan,$s.colspan,ns.isNew)]}else return[]});return Ws(To.element,Zo,To.section,To.isNew)})},R0=(eo,ro,fo)=>{const go=[];ws(eo.colgroups,To=>{const No=[];for(let Zo=0;Zorr(ps.element,fo,!1)).getOrThunk(()=>rr(ro.colGap(),!0,!1));No.push(ns)}go.push(Fr(To.element,No,"colgroup",fo))});for(let To=0;Torr(js.element,fo,js.isLocked)).getOrThunk(()=>rr(ro.gap(),!0,!1));No.push($s)}const Zo=eo.all[To],ns=Fr(Zo.element,No,Zo.section,fo);go.push(ns)}return go},of=(eo,ro)=>R0(eo,ro,!1),od=eo=>Yu(eo,bc),sp=(eo,ro)=>Vr(eo.all,fo=>zo(fo.cells,go=>bc(ro,go.element))),CS=(eo,ro,fo)=>{const go=cr(ro.selection,No=>P1(No).bind(Zo=>sp(eo,Zo)).filter(fo)),To=cu(go);return ud(To.length>0,To)},Df=(eo,ro,fo,go,To)=>(No,Zo,ns,ps)=>{const $s=ss.fromTable(No),js=Yo.from(ps==null?void 0:ps.section).getOrThunk(tb.fallback);return ro($s,Zo).map(la=>{const sa=of($s,ns),xr=eo(sa,la,bc,To(ns),js),ca=ed(xr.grid),Cr=od(xr.grid);return{info:la,grid:Cr,cursor:xr.cursor,lockedColumns:ca}}).bind(la=>{const sa=qO(No,la.grid),xr=Yo.from(ps==null?void 0:ps.sizing).getOrThunk(()=>Th.getTableSize(No)),ca=Yo.from(ps==null?void 0:ps.resize).getOrThunk(OS);return fo(No,la.grid,la.info,{sizing:xr,resize:ca,section:js}),go(No),ks(No,_p),la.lockedColumns.length>0&&zc(No,_p,la.lockedColumns.join(",")),Yo.some({cursor:la.cursor,newRows:sa.newRows,newCells:sa.newCells})})},Uy=(eo,ro)=>P1(ro.element).bind(fo=>sp(eo,fo).map(go=>({...go,generators:ro.generators,clipboard:ro.clipboard}))),zv=(eo,ro)=>CS(eo,ro,is).map(fo=>({cells:fo,generators:ro.generators,clipboard:ro.clipboard})),c1=(eo,ro)=>ro.mergable,Wv=(eo,ro)=>ro.unmergable,Bb=(eo,ro)=>CS(eo,ro,is),nb=(eo,ro)=>CS(eo,ro,fo=>!fo.isLocked),D2=(eo,ro)=>sp(eo,ro).exists(fo=>!fo.isLocked),bC=(eo,ro)=>za(ro,fo=>D2(eo,fo)),AT=(eo,ro)=>c1(eo,ro).filter(fo=>bC(eo,fo.cells)),PT=(eo,ro)=>Wv(eo,ro).filter(fo=>bC(eo,fo)),cg=(eo,ro,fo,go)=>{const To=fd(eo).rows;if(To.length===0)return eo;for(let No=ro.startRow;No<=ro.finishRow;No++)for(let Zo=ro.startCol;Zo<=ro.finishCol;Zo++){const ns=To[No],ps=ff(ns,Zo).isLocked;Sd(ns,Zo,rr(go(),!1,ps))}return eo},$h=(eo,ro,fo,go)=>{const To=fd(eo).rows;let No=!0;for(let Zo=0;Zohs(eo,(fo,go)=>xs(fo,To=>ro(To.element,go.element))?fo:fo.concat([go]),[]),N2=(eo,ro,fo,go)=>(ro>0&&ro{const No=To.cells[ro-1];let Zo=0;const ns=go();for(;To.cells.length>ro+Zo&&fo(No.element,To.cells[ro+Zo].element);)Sd(To,ro+Zo,rr(ns,!0,To.cells[ro+Zo].isLocked)),Zo++}),eo),Fb=(eo,ro,fo,go)=>{const To=fd(eo).rows;if(ro>0&&ro{let ps=Yo.none();for(let $s=ro;$s{Sd(Nr,js,rr(xr,!0,la.isLocked))}))}})}return eo},Zy=eo=>{const ro=No=>No(eo),fo=xo(eo),go=()=>To,To={tag:!0,inner:eo,fold:(No,Zo)=>Zo(eo),isValue:is,isError:ms,map:No=>u1.value(No(eo)),mapError:go,bind:ro,exists:ro,forall:ro,getOr:fo,or:go,getOrThunk:fo,orThunk:go,getOrDie:fo,each:No=>{No(eo)},toOptional:()=>Yo.some(eo)};return To},jO=eo=>{const ro=()=>fo,fo={tag:!1,inner:eo,fold:(go,To)=>go(eo),isValue:ms,isError:is,map:ro,mapError:go=>u1.error(go(eo)),bind:ro,exists:ms,forall:is,getOr:Io,or:Io,getOrThunk:os,orThunk:os,getOrDie:Go(String(eo)),each:So,toOptional:Yo.none};return fo},u1={value:Zy,error:jO,fromOption:(eo,ro)=>eo.fold(()=>jO(ro),Zy)},Uv=(eo,ro,fo)=>{if(eo.row>=ro.length||eo.column>wh(ro[0]))return u1.error("invalid start address out of table bounds, row: "+eo.row+", column: "+eo.column);const go=ro.slice(eo.row),To=go[0].cells.slice(eo.column),No=wh(fo[0]),Zo=fo.length;return u1.value({rowDelta:go.length-Zo,colDelta:To.length-No})},Hb=(eo,ro)=>{const fo=wh(eo[0]),go=wh(ro[0]);return{rowDelta:0,colDelta:fo-go}},D0=(eo,ro)=>{const fo=eo.length,go=ro.length;return{rowDelta:fo-go,colDelta:0}},M0=(eo,ro,fo,go)=>{const To=ro.section==="colgroup"?fo.col:fo.cell;return Qr(eo,No=>rr(To(),!0,go(No)))},vC=(eo,ro,fo,go)=>{const To=eo[eo.length-1];return eo.concat(Qr(ro,()=>{const No=To.section==="colgroup"?fo.colgroup:fo.row,Zo=Ym(To,No,Io),ns=M0(Zo.cells.length,Zo,fo,ps=>Zl(go,ps.toString()));return df(Zo,ns)}))},wd=(eo,ro,fo,go)=>cr(eo,To=>{const No=M0(ro,To,fo,ms);return dh(To,go,No)}),yC=(eo,ro,fo)=>cr(eo,go=>hs(fo,(To,No)=>{const Zo=M0(1,go,ro,is)[0];return jp(To,No,Zo)},go)),Zv=(eo,ro,fo)=>{const go=ro.colDelta<0?wd:Io,To=ro.rowDelta<0?vC:Io,No=ed(eo),Zo=wh(eo[0]),ns=xs(No,js=>js===Zo-1),ps=go(eo,Math.abs(ro.colDelta),fo,ns?Zo-1:Zo),$s=ed(ps);return To(ps,Math.abs(ro.rowDelta),fo,Zs($s,is))},OC=(eo,ro,fo,go)=>{const To=ff(eo[ro],fo),No=Jo(go,To.element),Zo=eo[ro];return eo.length>1&&wh(Zo)>1&&(fo>0&&No(Ju(Zo,fo-1))||fo0&&No(Ju(eo[ro-1],fo))||ro{const Zo=eo.row,ns=eo.column,ps=fo.length,$s=wh(fo[0]),js=Zo+ps,Nr=ns+$s+No.length,la=Zs(No,is);for(let sa=Zo;sa{const go=wh(ro[0]),To=fd(ro).cols.length+eo.row,No=Qr(go-eo.column,ns=>ns+eo.column),Zo=zo(No,ns=>za(fo,ps=>ps!==ns)).getOr(go-1);return{row:To,column:Zo}},Fm=(eo,ro,fo)=>_r(fo,go=>go>=eo.column&&go<=wh(ro[0])+eo.column),_C=(eo,ro,fo,go,To)=>{const No=ed(ro),Zo=gh(eo,ro,No),ns=fd(fo).rows,ps=Fm(Zo,ns,No);return Uv(Zo,ro,ns).map(js=>{const Nr={...js,colDelta:js.colDelta-ps.length},la=Zv(ro,Nr,go),sa=ed(la),xr=Fm(Zo,ns,sa);return YO(Zo,la,ns,go,To,xr)})},N0=(eo,ro,fo,go,To)=>{N2(ro,eo,To,go.cell);const No=D0(fo,ro),Zo=Zv(fo,No,go),ns=D0(ro,Zo),ps=Zv(ro,ns,go);return cr(ps,($s,js)=>dh($s,eo,Zo[js].cells))},L0=(eo,ro,fo,go,To)=>{Fb(ro,eo,To,go.cell);const No=ed(ro),Zo=Hb(ro,fo),ns={...Zo,colDelta:Zo.colDelta-No.length},ps=Zv(ro,ns,go),{cols:$s,rows:js}=fd(ps),Nr=ed(ps),la=Hb(fo,ro),sa={...la,colDelta:la.colDelta+Nr.length},xr=yC(fo,go,Nr),ca=Zv(xr,sa,go);return[...$s,...js.slice(0,eo),...ca,...js.slice(eo,js.length)]},L2=(eo,ro,fo,go)=>Ym(eo,To=>go(To,fo),ro),SC=(eo,ro,fo,go,To)=>{const{rows:No,cols:Zo}=fd(eo),ns=No.slice(0,ro),ps=No.slice(ro),$s=L2(No[fo],(js,Nr)=>ro>0&&ro{if(fo==="colgroup"||!go){const ns=ff(eo,To);return rr(Zo(ns.element,No),!0,!1)}else return ff(eo,ro)},Hm=(eo,ro,fo,go,To)=>cr(eo,No=>{const Zo=ro>0&&roCa(eo,fo=>{const go=fo.cells,To=ha(ro,(No,Zo)=>Zo>=0&&Zo0?[Fr(fo.element,To,fo.section,fo.isNew)]:[]}),Rd=(eo,ro,fo)=>{const{rows:go,cols:To}=fd(eo);return[...To,...go.slice(0,ro),...go.slice(fo+1)]},Bg=(eo,ro,fo,go)=>Ju(eo[ro],fo)!==void 0&&ro>0&&go(Ju(eo[ro-1],fo),Ju(eo[ro],fo)),qv=(eo,ro,fo)=>ro>0&&fo(Ju(eo,ro-1),Ju(eo,ro)),Qb=(eo,ro,fo,go)=>Bg(eo,ro,fo,go)||qv(eo[ro],fo,go),I0=(eo,ro)=>za(ro,Io)&&zO(eo.cells)?is:(go,To,No)=>!(pr(go.element)==="th"&&ro[No]),B0=(eo,ro)=>za(ro,Io)&&zO(eo)?is:(go,To,No)=>!(pr(go.element)==="th"&&ro[To]),ob=(eo,ro,fo,go)=>{const To=Zo=>Zo==="row"?Ld(ro):Tf(ro),No=Zo=>To(Zo)?`${Zo}group`:Zo;return eo?Hv(ro)?No(fo):null:go&&Hv(ro)?No(fo==="row"?"col":"row"):null},wC=(eo,ro)=>(fo,go,To)=>Yo.some(ob(eo,fo.element,"col",ro[To])),F0=(eo,ro)=>(fo,go)=>Yo.some(ob(eo,fo.element,"row",ro[go])),Vb=(eo,ro,fo)=>rr(fo(eo.element,ro),!0,eo.isLocked),zb=(eo,ro,fo,go,To,No,Zo)=>{const ns=ps=>xs(ro,$s=>fo(ps.element,$s.element));return cr(eo,(ps,$s)=>vv(ps,(js,Nr)=>{if(ns(js)){const la=Zo(js,$s,Nr)?To(js,fo,go):js;return No(la,$s,Nr).each(sa=>{Bh(la.element,{scope:Yo.from(sa)})}),la}else return js}))},xS=(eo,ro,fo)=>Ca(eo,(go,To)=>Qb(eo,To,ro,fo)?[]:[ff(go,ro)]),I2=(eo,ro,fo)=>{const go=eo[ro];return Ca(go.cells,(To,No)=>Qb(eo,ro,No,fo)?[]:[To])},ES=(eo,ro,fo,go,To)=>{const No=fd(eo).rows,Zo=Ca(ro,js=>xS(No,js,go)),ns=cr(No,js=>zO(js.cells)),ps=B0(Zo,ns),$s=F0(fo,ns);return zb(eo,Zo,go,To,Vb,$s,ps)},B2=(eo,ro,fo,go,To,No,Zo)=>{const{cols:ns,rows:ps}=fd(eo),$s=ps[ro[0]],js=Ca(ro,Cr=>I2(ps,Cr,To)),Nr=cr($s.cells,(Cr,Ra)=>zO(xS(ps,Ra,To))),la=[...ps];ws(ro,Cr=>{la[Cr]=Zo.transformRow(ps[Cr],fo)});const sa=[...ns,...la],xr=I0($s,Nr),ca=wC(go,Nr);return zb(sa,js,To,No,Zo.transformCell,ca,xr)},KO=(eo,ro,fo,go)=>{const To=fd(eo).rows,No=cr(ro,Zo=>ff(To[Zo.row],Zo.column));return zb(eo,No,fo,go,Vb,Yo.none,is)},Qm={generate:eo=>{if(!Xn(eo))throw new Error("cases must be an array");if(eo.length===0)throw new Error("there must be at least one case");const ro=[],fo={};return ws(eo,(go,To)=>{const No=nr(go);if(No.length!==1)throw new Error("one and only one name per case");const Zo=No[0],ns=go[Zo];if(fo[Zo]!==void 0)throw new Error("duplicate key detected:"+Zo);if(Zo==="cata")throw new Error("cannot have a case named cata (sorry)");if(!Xn(ns))throw new Error("case arguments must be an array");ro.push(Zo),fo[Zo]=(...ps)=>{const $s=ps.length;if($s!==ns.length)throw new Error("Wrong number of arguments to case "+Zo+". Expected "+ns.length+" ("+ns+"), got "+$s);return{fold:(...Nr)=>{if(Nr.length!==eo.length)throw new Error("Wrong number of arguments to fold. Expected "+eo.length+", got "+Nr.length);return Nr[To].apply(null,ps)},match:Nr=>{const la=nr(Nr);if(ro.length!==la.length)throw new Error("Wrong number of arguments to match. Expected: "+ro.join(",")+` +Actual: `+la.join(","));if(!za(ro,xr=>gs(la,xr)))throw new Error("Not all branches were specified when using match. Specified: "+la.join(", ")+` +Required: `+ro.join(", "));return Nr[Zo].apply(null,ps)},log:Nr=>{console.log(Nr,{constructors:ro,constructor:Zo,params:ps})}}}}),fo}},Xv={...Qm.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])},kC=(eo,ro)=>eo.length===0?Xv.none():eo.length===1?Xv.only(0):ro===0?Xv.left(0,1):ro===eo.length-1?Xv.right(ro-1,ro):ro>0&&ro{const No=eo.slice(0),Zo=kC(eo,ro),ns=xo(cr(No,xo(0))),ps=la=>go.singleColumnWidth(No[la],fo),$s=(la,sa)=>To.calcLeftEdgeDeltas(No,la,sa,fo,go.minCellWidth(),go.isRelative),js=(la,sa,xr)=>To.calcMiddleDeltas(No,la,sa,xr,fo,go.minCellWidth(),go.isRelative),Nr=(la,sa)=>To.calcRightEdgeDeltas(No,la,sa,fo,go.minCellWidth(),go.isRelative);return Zo.fold(ns,ps,$s,js,Nr)},qy=(eo,ro,fo)=>{let go=0;for(let To=eo;To{const fo=ss.justCells(eo);return cr(fo,go=>{const To=qy(go.column,go.column+go.colspan,ro);return{element:go.element,width:To,colspan:go.colspan}})},JO=(eo,ro)=>{const fo=ss.justColumns(eo);return cr(fo,(go,To)=>({element:go.element,width:ro[To],colspan:go.colspan}))},rc=(eo,ro)=>{const fo=ss.justCells(eo);return cr(fo,go=>{const To=qy(go.row,go.row+go.rowspan,ro);return{element:go.element,height:To,rowspan:go.rowspan}})},Vm=(eo,ro)=>cr(eo.all,(fo,go)=>({element:fo.element,height:ro[go]})),Fg=eo=>ha(eo,(ro,fo)=>ro+fo,0),Yv=(eo,ro)=>ss.hasColumns(eo)?JO(eo,ro):Wb(eo,ro),tu=(eo,ro,fo)=>{const go=Yv(eo,ro);ws(go,To=>{fo.setElementWidth(To.element,To.width)})},Gv=(eo,ro,fo,go,To)=>{const No=ss.fromTable(eo),Zo=To.getCellDelta(ro),ns=To.getWidths(No,To),ps=fo===No.grid.columns-1,$s=go.clampTableDelta(ns,fo,Zo,To.minCellWidth(),ps),js=F2(ns,fo,$s,To,go),Nr=cr(js,(la,sa)=>la+ns[sa]);tu(No,Nr,To),go.resizeTable(To.adjustTableWidth,$s,ps)},e_=(eo,ro,fo,go)=>{const To=ss.fromTable(eo),No=Gs(To,eo,go),Zo=cr(No,(js,Nr)=>fo===Nr?Math.max(ro+js,Vh()):js),ns=rc(To,Zo),ps=Vm(To,Zo);ws(ps,js=>{Rg(js.element,js.height)}),ws(ns,js=>{Rg(js.element,js.height)});const $s=Fg(Zo);Rg(eo,$s)},Yd=(eo,ro,fo,go,To)=>{const No=ss.generate(ro),Zo=go.getWidths(No,go),ns=go.pixelWidth(),{newSizes:ps,delta:$s}=To.calcRedestributedWidths(Zo,ns,fo.pixelDelta,go.isRelative);tu(No,ps,go),go.adjustTableWidth($s)},Hg=(eo,ro,fo,go)=>{const To=ss.generate(ro),No=go.getWidths(To,go);tu(To,No,go)},sb=eo=>hs(eo,(fo,go)=>xs(fo,No=>No.column===go.column)?fo:fo.concat([go]),[]).sort((fo,go)=>fo.column-go.column),t_=Vc("col"),jy=Vc("colgroup"),Xy=eo=>pr(eo)==="tr"||jy(eo),TS=eo=>{const ro=Gc(eo,"colspan",1),fo=Gc(eo,"rowspan",1);return{element:eo,colspan:ro,rowspan:fo}},n_=(eo,ro=TS)=>{const fo=ns=>t_(ns.element)?eo.col(ns):eo.cell(ns),go=ns=>jy(ns.element)?eo.colgroup(ns):eo.row(ns),To=ns=>{if(Xy(ns))return go({element:ns});{const ps=ns,$s=fo(ro(ps));return No=Yo.some({item:ps,replacement:$s}),$s}};let No=Yo.none();return{getOrInit:(ns,ps)=>No.fold(()=>To(ns),$s=>ps(ns,$s.item)?$s.replacement:To(ns))}},Pp=eo=>ro=>{const fo=[],go=(Zo,ns)=>zo(fo,ps=>ns(ps.item,Zo)),To=Zo=>{const ns=eo==="td"?{scope:null}:{},ps=ro.replace(Zo,eo,ns);return fo.push({item:Zo,sub:ps}),ps};return{replaceOrInit:(Zo,ns)=>{if(Xy(Zo)||t_(Zo))return Zo;{const ps=Zo;return go(ps,ns).fold(()=>To(ps),$s=>ns(Zo,$s.item)?$s.sub:To(ps))}}}},ug=eo=>Ts(eo,"scope").map(ro=>ro.substr(0,3)),lr={modification:n_,transform:Pp,merging:eo=>({unmerge:go=>{const To=ug(go);return To.each(No=>zc(go,"scope",No)),()=>{const No=eo.cell({element:go,colspan:1,rowspan:1});return Qh(No,"width"),Qh(go,"width"),To.each(Zo=>zc(No,"scope",Zo)),No}},merge:go=>{const To=()=>{const No=cu(cr(go,ug));if(No.length===0)return Yo.none();{const Zo=No[0],ns=["row","col"];return xs(No,$s=>$s!==Zo&&gs(ns,$s))?Yo.none():Yo.from(Zo)}};return Qh(go[0],"width"),To().fold(()=>ks(go[0],"scope"),No=>zc(go[0],"scope",No+"group")),xo(go[0])}})},H0=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Q0=(eo,ro)=>{const fo=eo.property().name(ro);return gs(["ol","ul"],fo)},rp=(eo,ro)=>{const fo=eo.property().name(ro);return gs(H0,fo)},AS=(eo,ro)=>gs(["br","img","hr","input"],eo.property().name(ro)),Uu=wr(),o_=eo=>rp(Uu,eo),rb=eo=>Q0(Uu,eo),PS=eo=>AS(Uu,eo),s_=eo=>{const ro=Vc("br"),fo=ps=>za(ps,$s=>ro($s)||Na($s)&&La($s).trim().length===0),go=ps=>pr(ps)==="li"||qc(ps,rb).isSome(),To=ps=>sm(ps).map($s=>o_($s)?!0:PS($s)?pr($s)!=="img":!1).getOr(!1),No=ps=>wp(ps).bind($s=>{const js=To($s);return bd($s).map(Nr=>js===!0||go(Nr)||ro($s)||o_(Nr)&&!bc(ps,Nr)?[]:[Ds.fromTag("br")])}).getOr([]),ns=(()=>{const ps=Ca(eo,$s=>{const js=fc($s);return fo(js)?[]:js.concat(No($s))});return ps.length===0?[Ds.fromTag("br")]:ps})();vd(eo[0]),cd(eo[0],ns)},$S=eo=>Z1(eo,!0),Yy=eo=>{Yf(eo).length===0&&ju(eo)},Kv=(eo,ro)=>({grid:eo,cursor:ro}),RS=eo=>Vr(eo,ro=>Vr(ro.cells,fo=>{const go=fo.element;return ud($S(go),go)})),Q2=(eo,ro,fo)=>{var go,To;const No=fd(eo).rows;return Yo.from((To=(go=No[ro])===null||go===void 0?void 0:go.cells[fo])===null||To===void 0?void 0:To.element).filter($S).orThunk(()=>RS(No))},Dd=(eo,ro,fo)=>{const go=Q2(eo,ro,fo);return Kv(eo,go)},gf=eo=>hs(eo,(fo,go)=>xs(fo,No=>No.row===go.row)?fo:fo.concat([go]),[]).sort((fo,go)=>fo.row-go.row),eh=(eo,ro,fo,go)=>{const To=ro[0].row,No=gf(ro),Zo=ha(No,(ns,ps)=>({grid:SC(ns.grid,To,ps.row+ns.delta,fo,go.getOrInit),delta:ns.delta+1}),{grid:eo,delta:0}).grid;return Dd(Zo,To,ro[0].column)},bf=(eo,ro,fo,go)=>{const To=gf(ro),No=To[To.length-1],Zo=No.row+No.rowspan,ns=ha(To,(ps,$s)=>SC(ps,Zo,$s.row,fo,go.getOrInit),eo);return Dd(ns,Zo,ro[0].column)},$l=(eo,ro,fo,go)=>{const To=ro.details,No=sb(To),Zo=No[0].column,ns=ha(No,(ps,$s)=>({grid:Hm(ps.grid,Zo,$s.column+ps.delta,fo,go.getOrInit),delta:ps.delta+1}),{grid:eo,delta:0}).grid;return Dd(ns,To[0].row,Zo)},Rh=(eo,ro,fo,go)=>{const To=ro.details,No=To[To.length-1],Zo=No.column+No.colspan,ns=sb(To),ps=ha(ns,($s,js)=>Hm($s,Zo,js.column,fo,go.getOrInit),eo);return Dd(ps,To[0].row,Zo)},bu=(eo,ro,fo,go)=>{const To=sb(ro),No=cr(To,ns=>ns.column),Zo=ES(eo,No,!0,fo,go.replaceOrInit);return Dd(Zo,ro[0].row,ro[0].column)},vf=(eo,ro,fo,go)=>{const To=KO(eo,ro,fo,go.replaceOrInit);return Dd(To,ro[0].row,ro[0].column)},Gy=(eo,ro,fo,go)=>{const To=sb(ro),No=cr(To,ns=>ns.column),Zo=ES(eo,No,!1,fo,go.replaceOrInit);return Dd(Zo,ro[0].row,ro[0].column)},d1=(eo,ro,fo,go)=>{const To=KO(eo,ro,fo,go.replaceOrInit);return Dd(To,ro[0].row,ro[0].column)},Ky=(eo,ro)=>(fo,go,To,No,Zo)=>{const ns=gf(go),ps=cr(ns,js=>js.row),$s=B2(fo,ps,eo,ro,To,No.replaceOrInit,Zo);return Dd($s,go[0].row,go[0].column)},DS=Ky("thead",!0),xC=Ky("tbody",!1),r_=Ky("tfoot",!1),MS=(eo,ro,fo,go)=>{const To=sb(ro.details),No=GO(eo,cr(To,ns=>ns.column)),Zo=No.length>0?No[0].cells.length-1:0;return Dd(No,To[0].row,Math.min(To[0].column,Zo))},NS=(eo,ro,fo,go)=>{const To=gf(ro),No=Rd(eo,To[0].row,To[To.length-1].row),Zo=No.length>0?No.length-1:0;return Dd(No,Math.min(ro[0].row,Zo),ro[0].column)},V2=(eo,ro,fo,go)=>{const To=ro.cells;s_(To);const No=cg(eo,ro.bounds,fo,go.merge(To));return Kv(No,Yo.from(To[0]))},f1=(eo,ro,fo,go)=>{const No=ha(ro,(Zo,ns)=>$h(Zo,ns,fo,go.unmerge(ns)),eo);return Kv(No,Yo.from(ro[0]))},EC=(eo,ro,fo,go)=>{const No=((ps,$s)=>{const js=ss.fromTable(ps);return R0(js,$s,!0)})(ro.clipboard,ro.generators),Zo=jm(ro.row,ro.column);return _C(Zo,eo,No,ro.generators,fo).fold(()=>Kv(eo,Yo.some(ro.element)),ps=>Dd(ps,ro.row,ro.column))},ib=(eo,ro,fo)=>{const go=Gg(eo,fo.section),To=ss.generate(go);return R0(To,ro,!0)},Vd=(eo,ro,fo,go)=>{const To=fd(eo).rows,No=ro.cells[0].column,Zo=To[ro.cells[0].row],ns=ib(ro.clipboard,ro.generators,Zo),ps=N0(No,eo,ns,ro.generators,fo);return Dd(ps,ro.cells[0].row,ro.cells[0].column)},yf=(eo,ro,fo,go)=>{const To=fd(eo).rows,No=ro.cells[ro.cells.length-1].column+ro.cells[ro.cells.length-1].colspan,Zo=To[ro.cells[0].row],ns=ib(ro.clipboard,ro.generators,Zo),ps=N0(No,eo,ns,ro.generators,fo);return Dd(ps,ro.cells[0].row,ro.cells[0].column)},z2=(eo,ro,fo,go)=>{const To=fd(eo).rows,No=ro.cells[0].row,Zo=To[No],ns=ib(ro.clipboard,ro.generators,Zo),ps=L0(No,eo,ns,ro.generators,fo);return Dd(ps,ro.cells[0].row,ro.cells[0].column)},ym=(eo,ro,fo,go)=>{const To=fd(eo).rows,No=ro.cells[ro.cells.length-1].row+ro.cells[ro.cells.length-1].rowspan,Zo=To[ro.cells[0].row],ns=ib(ro.clipboard,ro.generators,Zo),ps=L0(No,eo,ns,ro.generators,fo);return Dd(ps,ro.cells[0].row,ro.cells[0].column)},$T=(eo,ro)=>{const fo=ss.fromTable(eo);return Bb(fo,ro).bind(To=>{const No=To[To.length-1],Zo=To[0].column,ns=No.column+No.colspan,ps=ga(cr(fo.all,$s=>_r($s.cells,js=>js.column>=Zo&&js.column{const fo=ss.fromTable(eo);return Bb(fo,ro).bind(Qv).getOr("")},Zr=(eo,ro)=>{const fo=ss.fromTable(eo);return Bb(fo,ro).bind(To=>{const No=To[To.length-1],Zo=To[0].row,ns=No.row+No.rowspan,ps=fo.all.slice(Zo,ns);return R2(ps)}).getOr("")},LS=(eo,ro,fo,go)=>Hg(eo,ro,fo,go.sizing),Of=(eo,ro,fo,go)=>Yd(eo,ro,fo,go.sizing,go.resize),IS=(eo,ro)=>xs(ro,fo=>fo.column===0&&fo.isLocked),Ub=(eo,ro)=>xs(ro,fo=>fo.column+fo.colspan>=eo.grid.columns&&fo.isLocked),Jy=(eo,ro)=>{const fo=dm(eo),go=sb(ro);return hs(go,(To,No)=>{const ns=fo[No.column].map(cm).getOr(0);return To+ns},0)},Om=eo=>(ro,fo)=>Bb(ro,fo).filter(go=>!(eo?IS:Ub)(ro,go)).map(go=>({details:go,pixelDelta:Jy(ro,go)})),TC=(eo,ro)=>nb(eo,ro).map(fo=>({details:fo,pixelDelta:-Jy(eo,fo)})),eO=eo=>(ro,fo)=>zv(ro,fo).filter(go=>!(eo?IS:Ub)(ro,go.cells)),Cd=lr.transform("th"),Vg=lr.transform("td"),tO=Df(eh,Bb,So,So,lr.modification),h1=Df(bf,Bb,So,So,lr.modification),dg=Df($l,Om(!0),Of,So,lr.modification),ma=Df(Rh,Om(!1),Of,So,lr.modification),ip=Df(MS,TC,Of,Yy,lr.modification),BS=Df(NS,Bb,So,Yy,lr.modification),m1=Df(bu,nb,So,So,Cd),Ic=Df(Gy,nb,So,So,Vg),FS=Df(DS,nb,So,So,Cd),ap=Df(xC,nb,So,So,Vg),i_=Df(r_,nb,So,So,Vg),W2=Df(vf,nb,So,So,Cd),Zu=Df(d1,nb,So,So,Vg),U2=Df(V2,AT,LS,So,lr.merging),bh=Df(f1,PT,LS,So,lr.merging),Zb=Df(EC,Uy,LS,So,lr.modification),Z2=Df(Vd,eO(!0),So,So,lr.modification),q2=Df(yf,eO(!1),So,So,lr.modification),HS=Df(z2,zv,So,So,lr.modification),j2=Df(ym,zv,So,So,lr.modification),AC=$T,PC=Qg,nO=Zr,$C=(eo,ro)=>eo.dispatch("NewRow",{node:ro}),QS=(eo,ro)=>eo.dispatch("NewCell",{node:ro}),V0=(eo,ro,fo)=>{eo.dispatch("TableModified",{...fo,table:ro})},X2=(eo,ro,fo,go,To)=>{eo.dispatch("TableSelectionChange",{cells:ro,start:fo,finish:go,otherCells:To})},Y2=eo=>{eo.dispatch("TableSelectionClear")},VS=(eo,ro,fo,go,To)=>{eo.dispatch("ObjectResizeStart",{target:ro,width:fo,height:go,origin:To})},zS=(eo,ro,fo,go,To)=>{eo.dispatch("ObjectResized",{target:ro,width:fo,height:go,origin:To})},ab={structure:!1,style:!0},Hl={structure:!0,style:!1},WS={structure:!0,style:!0},Dh=(eo,ro)=>tg(eo)?Th.percentageSize(ro):W1(eo)?Th.pixelSize(ro):Th.getTableSize(ro),a_=(eo,ro,fo)=>{const go=Wm=>pr(kp(Wm))==="table",To=Wm=>!go(eo)||Fv(Wm).rows>1,No=Wm=>!go(eo)||Fv(Wm).columns>1,Zo=Lg(eo),ns=Pd(eo)?So:Bv,ps=Wm=>{switch(V1(eo)){case"section":return tb.section();case"sectionCells":return tb.sectionCells();case"cells":return tb.cells();default:return tb.getTableSectionType(Wm,"section")}},$s=(Wm,Zx)=>Zx.cursor.fold(()=>{const xw=Yf(Wm);return fs(xw).filter(Bu).map(t0=>{fo.clearSelectedCells(Wm.dom);const Gh=eo.dom.createRng();return Gh.selectNode(t0.dom),eo.selection.setRng(Gh),zc(t0,"data-mce-selected","1"),Gh})},xw=>{const t0=yS(xw),Gh=eo.dom.createRng();return Gh.setStart(t0.element.dom,t0.offset),Gh.setEnd(t0.element.dom,t0.offset),eo.selection.setRng(Gh),fo.clearSelectedCells(Wm.dom),Yo.some(Gh)}),js=(Wm,Zx,xw,t0)=>(Gh,Ew,lA=!1)=>{Ig(Gh);const cA=Ds.fromDom(eo.getDoc()),N_=Qd(xw,cA,Zo),uA={sizing:Dh(eo,Gh),resize:Pd(eo)?mC():OS(),section:ps(Gh)};return Zx(Gh)?Wm(Gh,Ew,N_,uA).bind(_k=>{ro.refresh(Gh.dom),ws(_k.newRows,gO=>{$C(eo,gO.dom)}),ws(_k.newCells,gO=>{QS(eo,gO.dom)});const dA=$s(Gh,_k);return Bu(Gh)&&(Ig(Gh),lA||V0(eo,Gh.dom,t0)),dA.map(gO=>({rng:gO,effect:t0}))}):Yo.none()},Nr=js(BS,To,So,Hl),la=js(ip,No,So,Hl),sa=js(tO,is,So,Hl),xr=js(h1,is,So,Hl),ca=js(dg,is,ns,Hl),Cr=js(ma,is,ns,Hl),Ra=js(U2,is,So,Hl),dl=js(bh,is,So,Hl),Bl=js(Z2,is,So,Hl),Gu=js(q2,is,So,Hl),qf=js(HS,is,So,Hl),zd=js(j2,is,So,Hl),dp=js(Zb,is,So,WS),mO=js(W2,is,So,Hl),pO=js(Zu,is,So,Hl),Ux=js(m1,is,So,Hl),Ok=js(Ic,is,So,Hl),yu=js(FS,is,So,Hl),wm=js(ap,is,So,Hl),Lh=js(i_,is,So,Hl);return{deleteRow:Nr,deleteColumn:la,insertRowsBefore:sa,insertRowsAfter:xr,insertColumnsBefore:ca,insertColumnsAfter:Cr,mergeCells:Ra,unmergeCells:dl,pasteColsBefore:Bl,pasteColsAfter:Gu,pasteRowsBefore:qf,pasteRowsAfter:zd,pasteCells:dp,makeCellsHeader:mO,unmakeCellsHeader:pO,makeColumnsHeader:Ux,unmakeColumnsHeader:Ok,makeRowsHeader:yu,makeRowsBody:wm,makeRowsFooter:Lh,getTableRowType:nO,getTableCellType:PC,getTableColType:AC}},th=(eo,ro,fo)=>{const go=Gc(eo,ro,1);fo===1||go<=1?ks(eo,ro):zc(eo,ro,Math.min(fo,go))},_m=(eo,ro)=>fo=>{const go=fo.column+fo.colspan-1,To=fo.column;return go>=eo&&To{if(ss.hasColumns(eo)){const go=_r(ss.justColumns(eo),_m(ro,fo)),To=cr(go,Zo=>{const ns=ah(Zo.element);return th(ns,"span",fo-ro),ns}),No=Ds.fromTag("colgroup");return cd(No,To),[No]}else return[]},RC=(eo,ro,fo)=>cr(eo.all,go=>{const To=_r(go.cells,_m(ro,fo)),No=cr(To,ns=>{const ps=ah(ns.element);return th(ps,"colspan",fo-ro),ps}),Zo=Ds.fromTag("tr");return cd(Zo,No),Zo}),G2=(eo,ro)=>{const fo=ss.fromTable(eo);return nb(fo,ro).map(To=>{const No=To[To.length-1],Zo=To[0].column,ns=No.column+No.colspan,ps=l_(fo,Zo,ns),$s=RC(fo,Zo,ns);return[...ps,...$s]})},DC=(eo,ro,fo)=>{const go=ss.fromTable(eo);return Bb(go,ro).bind(No=>{const Zo=R0(go,fo,!1),ps=fd(Zo).rows.slice(No[0].row,No[No.length-1].row+No[No.length-1].rowspan),$s=Ca(ps,Nr=>{const la=_r(Nr.cells,sa=>!sa.isLocked);return la.length>0?[{...Nr,cells:la}]:[]}),js=od($s);return ud(js.length>0,js)}).map(No=>pC(No))},Jv=Qm.generate([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),MC=(eo,ro,fo)=>{const go=fo.substring(0,fo.length-eo.length),To=parseFloat(go);return go===To.toString()?ro(To):Jv.invalid(fo)},lb={...Jv,from:eo=>Pm(eo,"%")?MC("%",Jv.percent,eo):Pm(eo,"px")?MC("px",Jv.pixels,eo):Jv.invalid(eo)},K2=(eo,ro)=>cr(eo,fo=>lb.from(fo).fold(()=>fo,To=>To/ro*100+"%",To=>To+"%")),ey=(eo,ro,fo)=>{const go=fo/ro;return cr(eo,To=>lb.from(To).fold(()=>To,Zo=>Zo*go+"px",Zo=>Zo/100*fo+"px"))},J2=(eo,ro)=>{const fo=eo.fold(()=>xo(""),go=>{const To=go/ro;return xo(To+"px")},()=>{const go=100/ro;return xo(go+"%")});return Qr(ro,fo)},c_=(eo,ro,fo)=>eo.fold(()=>ro,go=>ey(ro,fo,go),go=>K2(ro,fo)),US=(eo,ro,fo)=>{const go=lb.from(fo),To=za(eo,No=>No==="0px")?J2(go,eo.length):c_(go,eo,ro);return LC(To)},z0=(eo,ro)=>eo.length===0?ro:ha(eo,(fo,go)=>lb.from(go).fold(xo(0),Io,Io)+fo,0),ex=(eo,ro)=>{const fo=Math.floor(eo);return{value:fo+ro,remainder:eo-fo}},NC=(eo,ro)=>lb.from(eo).fold(xo(eo),fo=>fo+ro+"px",fo=>fo+ro+"%"),LC=eo=>{if(eo.length===0)return eo;const ro=ha(eo,(go,To)=>{const No=lb.from(To).fold(()=>({value:To,remainder:0}),Zo=>ex(Zo,"px"),Zo=>({value:Zo+"%",remainder:0}));return{output:[No.value].concat(go.output),remainder:go.remainder+No.remainder}},{output:[],remainder:0}),fo=ro.output;return fo.slice(0,fo.length-1).concat([NC(fo[fo.length-1],Math.round(ro.remainder))])},zg=lb.from,IC=(eo,ro,fo)=>{ws(ro,go=>{const To=eo.slice(go.column,go.colspan+go.column),No=z0(To,Mu());Du(go.element,"width",No+fo)})},ZS=(eo,ro,fo)=>{ws(ro,(go,To)=>{const No=z0([eo[To]],Mu());Du(go.element,"width",No+fo)})},tx=(eo,ro,fo,go)=>{ws(fo,To=>{const No=eo.slice(To.row,To.rowspan+To.row),Zo=z0(No,Vh());Du(To.element,"height",Zo+go)}),ws(ro,(To,No)=>{Du(To.element,"height",eo[No])})},BC=eo=>zg(eo).fold(xo("px"),xo("px"),xo("%")),p1=(eo,ro,fo)=>{const go=ss.fromTable(eo),To=go.all,No=ss.justCells(go),Zo=ss.justColumns(go);ro.each(ns=>{const ps=BC(ns),$s=uf(eo),js=I1(go,eo),Nr=US(js,$s,ns);ss.hasColumns(go)?ZS(Nr,Zo,ps):IC(Nr,No,ps),Du(eo,"width",ns)}),fo.each(ns=>{const ps=BC(ns),$s=Mm(eo),js=xh(go,eo,Oa),Nr=US(js,$s,ns);tx(Nr,To,No,ps),Du(eo,"height",ns)})},ty=hd,ny=wv,u_=ep,oO=eo=>{ks(eo,"width")},$p=eo=>{const ro=hc(eo);p1(eo,Yo.some(ro),Yo.none()),oO(eo)},oy=eo=>{const ro=k0(eo);p1(eo,Yo.some(ro),Yo.none()),oO(eo)},sO=eo=>{Qh(eo,"width");const ro=$1(eo),fo=ro.length>0?ro:Yf(eo);ws(fo,go=>{Qh(go,"width"),oO(go)}),oO(eo)},qb={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},d_=()=>Ds.fromTag("th"),nx=()=>Ds.fromTag("td"),ox=()=>Ds.fromTag("col"),FC=(eo,ro,fo,go)=>{const To=Ds.fromTag("tr");for(let No=0;No{const ro=Ds.fromTag("colgroup");return Qr(eo,()=>Qc(ro,ox())),ro},qS=(eo,ro,fo,go)=>Qr(eo,To=>FC(ro,fo,go,To)),rx=(eo,ro,fo,go,To,No=qb)=>{const Zo=Ds.fromTag("table"),ns=To!=="cells";lf(Zo,No.styles),ad(Zo,No.attributes),No.colGroups&&Qc(Zo,sx(ro));const ps=Math.min(eo,fo);if(ns&&fo>0){const sa=Ds.fromTag("thead");Qc(Zo,sa);const ca=qS(fo,ro,To==="sectionCells"?ps:0,go);cd(sa,ca)}const $s=Ds.fromTag("tbody");Qc(Zo,$s);const js=ns?eo-ps:eo,la=qS(js,ro,ns?0:fo,go);return cd($s,la),Zo},ix=eo=>eo.dom.innerHTML,HC=eo=>{const ro=Ds.fromTag("div"),fo=Ds.fromDom(eo.dom.cloneNode(!0));return Qc(ro,fo),ix(ro)},ax=(eo,ro)=>{eo.selection.select(ro.dom,!0),eo.selection.collapse(!0)},QC=(eo,ro)=>{Hf(ro,"td,th").each(Jo(ax,eo))},lx=(eo,ro)=>{ws(fu(ro,"tr"),fo=>{$C(eo,fo.dom),ws(fu(fo,"th,td"),go=>{QS(eo,go.dom)})})},f_=eo=>Un(eo)&&eo.indexOf("%")!==-1,cx=(eo,ro,fo,go,To)=>{const No=DO(eo),Zo={styles:No,attributes:ng(eo),colGroups:Fy(eo)};return eo.undoManager.ignore(()=>{const ns=rx(fo,ro,To,go,V1(eo),Zo);zc(ns,"data-mce-id","__mce");const ps=HC(ns);eo.insertContent(ps),eo.addVisual()}),Hf(kp(eo),'table[data-mce-id="__mce"]').map(ns=>(W1(eo)?oy(ns):U1(eo)?sO(ns):(tg(eo)||f_(No.width))&&$p(ns),Ig(ns),ks(ns,"data-mce-id"),lx(eo,ns),QC(eo,ns),ns.dom)).getOrNull()},VC=(eo,ro,fo,go={})=>{const To=No=>Oo(No)&&No>0;if(To(ro)&&To(fo)){const No=go.headerRows||0,Zo=go.headerColumns||0;return cx(eo,fo,ro,Zo,No)}else return console.error("Invalid values for mceInsertTable - rows and columns values are required to insert a table."),null};var sy=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const jS="x-tinymce/dom-table-",XS=jS+"rows",YS=jS+"columns",h_=eo=>{const ro=sy.FakeClipboardItem(eo);sy.write([ro])},m_=eo=>{var ro;const fo=(ro=sy.read())!==null&&ro!==void 0?ro:[];return Vr(fo,go=>Yo.from(go.getType(eo)))},zC=eo=>{m_(eo).isSome()&&sy.clear()},p_=eo=>{eo.fold(ux,ro=>h_({[XS]:ro}))},g_=()=>m_(XS),ux=()=>zC(XS),rO=eo=>{eo.fold(dx,ro=>h_({[YS]:ro}))},WC=()=>m_(YS),dx=()=>zC(YS),GS=eo=>ag(Zh(eo),s1(eo)).filter(j1),lp=eo=>Nv(Zh(eo),s1(eo)).filter(j1),jb=(eo,ro)=>{const fo=s1(eo),go=()=>GS(eo).each(Cr=>{jd(Cr,fo).filter(Mo(fo)).each(Ra=>{const dl=Ds.fromText("");if(ef(Ra,dl),ju(Ra),eo.dom.isEmpty(eo.getBody()))eo.setContent(""),eo.selection.setCursorLocation();else{const Bl=eo.dom.createRng();Bl.setStart(dl.dom,0),Bl.setEnd(dl.dom,0),eo.selection.setRng(Bl),eo.nodeChanged()}})}),To=Cr=>GS(eo).each(Ra=>{U1(eo)||W1(eo)||tg(eo)||jd(Ra,fo).each(Bl=>{Cr==="relative"&&!ty(Bl)?$p(Bl):Cr==="fixed"&&!ny(Bl)?oy(Bl):Cr==="responsive"&&!u_(Bl)&&sO(Bl),Ig(Bl),V0(eo,Bl.dom,Hl)})}),No=Cr=>jd(Cr,fo),Zo=Cr=>lp(eo).bind(Ra=>No(Ra).map(dl=>Cr(dl,Ra))),ns=(Cr,Ra)=>{Zo(dl=>{eo.formatter.toggle("tableclass",{value:Ra},dl.dom),V0(eo,dl.dom,ab)})},ps=(Cr,Ra)=>{Zo(dl=>{const Bl=Tp(eo),qf=za(Bl,zd=>eo.formatter.match("tablecellclass",{value:Ra},zd.dom))?eo.formatter.remove:eo.formatter.apply;ws(Bl,zd=>qf("tablecellclass",{value:Ra},zd.dom)),V0(eo,dl.dom,ab)})},$s=()=>{GS(eo).each(Cr=>{jd(Cr,fo).each(Ra=>{El(Ra,"caption").fold(()=>{const dl=Ds.fromTag("caption");Qc(dl,Ds.fromText("Caption")),Cf(Ra,dl,0),eo.selection.setCursorLocation(dl.dom,0)},dl=>{Vc("caption")(Cr)&&Md("td",Ra).each(Bl=>eo.selection.setCursorLocation(Bl.dom,0)),ju(dl)}),V0(eo,Ra.dom,Hl)})})},js=Cr=>{eo.focus()},Nr=(Cr,Ra=!1)=>Zo((dl,Bl)=>{const Gu=Dv(Tp(eo),dl,Bl);Cr(dl,Gu,Ra).each(js)}),la=()=>Zo((Cr,Ra)=>{const dl=Dv(Tp(eo),Cr,Ra),Bl=Qd(So,Ds.fromDom(eo.getDoc()),Yo.none());return DC(Cr,dl,Bl)}),sa=()=>Zo((Cr,Ra)=>{const dl=Dv(Tp(eo),Cr,Ra);return G2(Cr,dl)}),xr=(Cr,Ra)=>Ra().each(dl=>{const Bl=cr(dl,Gu=>ah(Gu));Zo((Gu,qf)=>{const zd=Rf(Ds.fromDom(eo.getDoc())),dp=Mv(Tp(eo),qf,Bl,zd);Cr(Gu,dp).each(js)})}),ca=Cr=>(Ra,dl)=>Ed(dl,"type").each(Bl=>{Nr(Cr(Bl),dl.no_events)});ra({mceTableSplitCells:()=>Nr(ro.unmergeCells),mceTableMergeCells:()=>Nr(ro.mergeCells),mceTableInsertRowBefore:()=>Nr(ro.insertRowsBefore),mceTableInsertRowAfter:()=>Nr(ro.insertRowsAfter),mceTableInsertColBefore:()=>Nr(ro.insertColumnsBefore),mceTableInsertColAfter:()=>Nr(ro.insertColumnsAfter),mceTableDeleteCol:()=>Nr(ro.deleteColumn),mceTableDeleteRow:()=>Nr(ro.deleteRow),mceTableCutCol:()=>sa().each(Cr=>{rO(Cr),Nr(ro.deleteColumn)}),mceTableCutRow:()=>la().each(Cr=>{p_(Cr),Nr(ro.deleteRow)}),mceTableCopyCol:()=>sa().each(Cr=>rO(Cr)),mceTableCopyRow:()=>la().each(Cr=>p_(Cr)),mceTablePasteColBefore:()=>xr(ro.pasteColsBefore,WC),mceTablePasteColAfter:()=>xr(ro.pasteColsAfter,WC),mceTablePasteRowBefore:()=>xr(ro.pasteRowsBefore,g_),mceTablePasteRowAfter:()=>xr(ro.pasteRowsAfter,g_),mceTableDelete:go,mceTableCellToggleClass:ps,mceTableToggleClass:ns,mceTableToggleCaption:$s,mceTableSizingMode:(Cr,Ra)=>To(Ra),mceTableCellType:ca(Cr=>Cr==="th"?ro.makeCellsHeader:ro.unmakeCellsHeader),mceTableColType:ca(Cr=>Cr==="th"?ro.makeColumnsHeader:ro.unmakeColumnsHeader),mceTableRowType:ca(Cr=>{switch(Cr){case"header":return ro.makeRowsHeader;case"footer":return ro.makeRowsFooter;default:return ro.makeRowsBody}})},(Cr,Ra)=>eo.addCommand(Ra,Cr)),eo.addCommand("mceInsertTable",(Cr,Ra)=>{VC(eo,Ra.rows,Ra.columns,Ra.options)}),eo.addCommand("mceTableApplyCellStyle",(Cr,Ra)=>{const dl=qf=>"tablecell"+qf.toLowerCase().replace("-","");if(!qn(Ra))return;const Bl=_r(Tp(eo),j1);if(Bl.length===0)return;const Gu=cc(Ra,(qf,zd)=>eo.formatter.has(dl(zd))&&Un(qf));Fc(Gu)||(ra(Gu,(qf,zd)=>{const dp=dl(zd);ws(Bl,mO=>{qf===""?eo.formatter.remove(dp,{value:null},mO.dom,!0):eo.formatter.apply(dp,{value:qf},mO.dom)})}),No(Bl[0]).each(qf=>V0(eo,qf.dom,ab)))})},fx=(eo,ro)=>{const fo=s1(eo),go=To=>Nv(Zh(eo)).bind(No=>jd(No,fo).map(Zo=>{const ns=Dv(Tp(eo),Zo,No);return To(Zo,ns)})).getOr("");ra({mceTableRowType:()=>go(ro.getTableRowType),mceTableCellType:()=>go(ro.getTableCellType),mceTableColType:()=>go(ro.getTableColType)},(To,No)=>eo.addQueryValueHandler(No,To))},KS=Qm.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),hx=(eo,ro,fo,go)=>eo.fold(ro,fo,go),mx=eo=>eo.fold(Io,Io,Io),JS=KS.before,UC=KS.on,ew=KS.after,Zf={before:JS,on:UC,after:ew,cata:hx,getStart:mx},ry={create:(eo,ro)=>({selection:eo,kill:ro})},b_=(eo,ro)=>{const fo=eo.document.createRange();return fo.selectNode(ro.dom),fo},tw=(eo,ro)=>{const fo=eo.document.createRange();return nw(fo,ro),fo},nw=(eo,ro)=>eo.selectNodeContents(ro.dom),ZC=(eo,ro)=>{ro.fold(fo=>{eo.setStartBefore(fo.dom)},(fo,go)=>{eo.setStart(fo.dom,go)},fo=>{eo.setStartAfter(fo.dom)})},qC=(eo,ro)=>{ro.fold(fo=>{eo.setEndBefore(fo.dom)},(fo,go)=>{eo.setEnd(fo.dom,go)},fo=>{eo.setEndAfter(fo.dom)})},cb=(eo,ro,fo)=>{const go=eo.document.createRange();return ZC(go,ro),qC(go,fo),go},W0=(eo,ro,fo,go,To)=>{const No=eo.document.createRange();return No.setStart(ro.dom,fo),No.setEnd(go.dom,To),No},px=eo=>({left:eo.left,top:eo.top,right:eo.right,bottom:eo.bottom,width:eo.width,height:eo.height}),gx=eo=>{const ro=eo.getClientRects(),fo=ro.length>0?ro[0]:eo.getBoundingClientRect();return fo.width>0||fo.height>0?Yo.some(fo).map(px):Yo.none()},iO=Qm.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),ow=(eo,ro,fo)=>ro(Ds.fromDom(fo.startContainer),fo.startOffset,Ds.fromDom(fo.endContainer),fo.endOffset),jC=(eo,ro)=>ro.match({domRange:fo=>({ltr:xo(fo),rtl:Yo.none}),relative:(fo,go)=>({ltr:yp(()=>cb(eo,fo,go)),rtl:yp(()=>Yo.some(cb(eo,go,fo)))}),exact:(fo,go,To,No)=>({ltr:yp(()=>W0(eo,fo,go,To,No)),rtl:yp(()=>Yo.some(W0(eo,To,No,fo,go)))})}),_f=(eo,ro)=>{const fo=ro.ltr();return fo.collapsed?ro.rtl().filter(To=>To.collapsed===!1).map(To=>iO.rtl(Ds.fromDom(To.endContainer),To.endOffset,Ds.fromDom(To.startContainer),To.startOffset)).getOrThunk(()=>ow(eo,iO.ltr,fo)):ow(eo,iO.ltr,fo)},XC=(eo,ro)=>{const fo=jC(eo,ro);return _f(eo,fo)},sw=(eo,ro)=>XC(eo,ro).match({ltr:(go,To,No,Zo)=>{const ns=eo.document.createRange();return ns.setStart(go.dom,To),ns.setEnd(No.dom,Zo),ns},rtl:(go,To,No,Zo)=>{const ns=eo.document.createRange();return ns.setStart(No.dom,Zo),ns.setEnd(go.dom,To),ns}});iO.ltr,iO.rtl;const iy={create:(eo,ro,fo,go)=>({start:eo,soffset:ro,finish:fo,foffset:go})},YC={create:(eo,ro,fo,go)=>({start:Zf.on(eo,ro),finish:Zf.on(fo,go)})},rw=(eo,ro)=>{const fo=sw(eo,ro);return iy.create(Ds.fromDom(fo.startContainer),fo.startOffset,Ds.fromDom(fo.endContainer),fo.endOffset)},aO=YC.create,v_=(eo,ro,fo,go,To,No,Zo)=>bc(fo,To)&&go===No?Yo.none():hu(fo,"td,th",ro).bind(ns=>hu(To,"td,th",ro).bind(ps=>ay(eo,ro,ns,ps,Zo))),ay=(eo,ro,fo,go,To)=>bc(fo,go)?Yo.none():qh(fo,go,ro).bind(No=>{const Zo=No.boxes.getOr([]);return Zo.length>1?(To(eo,Zo,No.start,No.finish),Yo.some(ry.create(Yo.some(aO(fo,0,fo,Ac(fo))),!0))):Yo.none()}),vx=(eo,ro,fo,go,To)=>{const No=Zo=>(To.clearBeforeUpdate(fo),To.selectRange(fo,Zo.boxes,Zo.start,Zo.finish),Zo.boxes);return BO(go,eo,ro,To.firstSelectedSelector,To.lastSelectedSelector).map(No)},Xb=(eo,ro)=>({item:eo,mode:ro}),GC=(eo,ro,fo,go=Yb)=>eo.property().parent(ro).map(To=>Xb(To,go)),Yb=(eo,ro,fo,go=Gb)=>fo.sibling(eo,ro).map(To=>Xb(To,go)),Gb=(eo,ro,fo,go=Gb)=>{const To=eo.property().children(ro);return fo.first(To).map(Zo=>Xb(Zo,go))},so=[{current:GC,next:Yb,fallback:Yo.none()},{current:Yb,next:Gb,fallback:Yo.some(GC)},{current:Gb,next:Gb,fallback:Yo.some(Yb)}],co=(eo,ro,fo,go,To=so)=>zo(To,Zo=>Zo.current===fo).bind(Zo=>Zo.current(eo,ro,go,Zo.next).orThunk(()=>Zo.fallback.bind(ns=>co(eo,ro,ns,go)))),ts={left:()=>({sibling:(fo,go)=>fo.query().prevSibling(go),first:fo=>fo.length>0?Yo.some(fo[fo.length-1]):Yo.none()}),right:()=>({sibling:(fo,go)=>fo.query().nextSibling(go),first:fo=>fo.length>0?Yo.some(fo[0]):Yo.none()})},Os=(eo,ro,fo,go,To,No)=>co(eo,ro,go,To).bind(ns=>No(ns.item)?Yo.none():fo(ns.item)?Yo.some(ns.item):Os(eo,ns.item,fo,ns.mode,To,No)),Is=(eo,ro,fo,go)=>Os(eo,ro,fo,Yb,ts.left(),go),qs=(eo,ro,fo,go)=>Os(eo,ro,fo,Yb,ts.right(),go),mr=eo=>ro=>eo.property().children(ro).length===0,Xr=(eo,ro,fo)=>ua(eo,ro,mr(eo),fo),jr=(eo,ro,fo)=>ja(eo,ro,mr(eo),fo),ua=Is,ja=qs,wl=wr(),Kl=(eo,ro)=>Xr(wl,eo,ro),Pc=(eo,ro)=>jr(wl,eo,ro),Ul=(eo,ro,fo)=>ua(wl,eo,ro,fo),nu=(eo,ro,fo)=>ja(wl,eo,ro,fo),vu=(eo,ro,fo)=>qc(eo,ro,fo).isSome(),nh=Qm.generate([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Mh=(eo,ro,fo)=>{const go=eo.getRect(ro),To=eo.getRect(fo);return To.right>go.left&&To.lefthu(eo,"tr"),Tu={...nh,verify:(eo,ro,fo,go,To,No,Zo)=>hu(go,"td,th",Zo).bind(ns=>hu(ro,"td,th",Zo).map(ps=>bc(ns,ps)?bc(go,ns)&&Ac(ns)===To?No(ps):nh.none("in same cell"):eu(Rp,[ns,ps]).fold(()=>Mh(eo,ps,ns)?nh.success():No(ps),$s=>No(ps)))).getOr(nh.none("default")),cata:(eo,ro,fo,go,To)=>eo.fold(ro,fo,go,To)},yx=(eo,ro,fo,go)=>({parent:eo,children:ro,element:fo,index:go}),U0=eo=>bd(eo).bind(ro=>{const fo=fc(ro);return NT(fo,eo).map(go=>yx(ro,fo,eo,go))}),NT=(eo,ro)=>el(eo,Jo(bc,ro)),KC=Vc("br"),ly=(eo,ro,fo)=>ro(eo,fo).bind(go=>Na(go)&&La(go).trim().length===0?ly(go,ro,fo):Yo.some(go)),jh=(eo,ro,fo)=>fo.traverse(ro).orThunk(()=>ly(ro,fo.gather,eo)).map(fo.relative),y_=(eo,ro)=>Td(eo,ro).filter(KC).orThunk(()=>Td(eo,ro-1).filter(KC)),iw=(eo,ro,fo,go)=>y_(ro,fo).bind(To=>go.traverse(To).fold(()=>ly(To,go.gather,eo).map(go.relative),No=>U0(No).map(Zo=>Zf.on(Zo.parent,Zo.index)))),O_=(eo,ro,fo,go)=>(KC(ro)?jh(eo,ro,go):iw(eo,ro,fo,go)).map(No=>({start:No,finish:No})),Ox=eo=>Tu.cata(eo,ro=>Yo.none(),()=>Yo.none(),ro=>Yo.some(Iv(ro,0)),ro=>Yo.some(Iv(ro,Ac(ro)))),__=(eo,ro)=>({left:eo.left,top:eo.top+ro,right:eo.right,bottom:eo.bottom+ro}),lO=(eo,ro)=>({left:eo.left,top:eo.top-ro,right:eo.right,bottom:eo.bottom-ro}),ub=(eo,ro,fo)=>({left:eo.left+ro,top:eo.top+fo,right:eo.right+ro,bottom:eo.bottom+fo}),h3=eo=>eo.top,m3=eo=>eo.bottom,cy=(eo,ro,fo)=>fo>=0&&fo0?eo.getRangedRect(ro,fo-1,ro,fo):Yo.none(),S_=eo=>({left:eo.left,top:eo.top,right:eo.right,bottom:eo.bottom}),JC=(eo,ro)=>Yo.some(eo.getRect(ro)),Kb=(eo,ro,fo)=>il(ro)?JC(eo,ro).map(S_):Na(ro)?cy(eo,ro,fo).map(S_):Yo.none(),_x=(eo,ro)=>il(ro)?JC(eo,ro).map(S_):Na(ro)?eo.getRangedRect(ro,0,ro,Ac(ro)).map(S_):Yo.none(),vh=5,Z0=100,g1=Qm.generate([{none:[]},{retry:["caret"]}]),w_=(eo,ro)=>eo.leftro.right,Sm=(eo,ro,fo)=>Ef(ro,o_).fold(ms,go=>_x(eo,go).exists(To=>w_(fo,To))),cp=(eo,ro,fo,go,To)=>{const No=__(To,vh);return Math.abs(fo.bottom-go.bottom)<1||fo.top>To.bottom?g1.retry(No):fo.top===To.bottom?g1.retry(__(To,1)):Sm(eo,ro,To)?g1.retry(ub(No,vh,0)):g1.none()},b1={point:h3,adjuster:(eo,ro,fo,go,To)=>{const No=lO(To,vh);return Math.abs(fo.top-go.top)<1||fo.bottomeo.elementFromPoint(ro,fo).filter(go=>pr(go)==="table").isSome(),cO=(eo,ro,fo,go,To)=>Sx(eo,ro,fo,ro.move(go,vh),To),Sx=(eo,ro,fo,go,To)=>To===0?Yo.some(go):fg(eo,go.left,ro.point(go))?cO(eo,ro,fo,go,To-1):eo.situsFromPoint(go.left,ro.point(go)).bind(No=>No.start.fold(Yo.none,Zo=>_x(eo,Zo).bind(ns=>ro.adjuster(eo,Zo,ns,fo,go).fold(Yo.none,ps=>Sx(eo,ro,fo,ps,To-1))).orThunk(()=>Yo.some(go)),Yo.none)),p3=(eo,ro,fo)=>eo.point(ro)>fo.getInnerHeight()?Yo.some(eo.point(ro)-fo.getInnerHeight()):eo.point(ro)<0?Yo.some(-eo.point(ro)):Yo.none(),LT=(eo,ro,fo)=>{const go=eo.move(fo,vh),To=Sx(ro,eo,fo,go,Z0).getOr(go);return p3(eo,To,ro).fold(()=>ro.situsFromPoint(To.left,eo.point(To)),No=>(ro.scrollBy(0,No),ro.situsFromPoint(To.left,eo.point(To)-No)))},aw={tryUp:Jo(LT,b1),tryDown:Jo(LT,ek),getJumpSize:xo(vh)},IT=20,lw=(eo,ro,fo)=>eo.getSelection().bind(go=>O_(ro,go.finish,go.foffset,fo).fold(()=>Yo.some(Iv(go.finish,go.foffset)),To=>{const No=eo.fromSitus(To),Zo=Tu.verify(eo,go.finish,go.foffset,No.finish,No.foffset,fo.failure,ro);return Ox(Zo)})),tk=(eo,ro,fo,go,To,No)=>No===0?Yo.none():b3(eo,ro,fo,go,To).bind(Zo=>{const ns=eo.fromSitus(Zo),ps=Tu.verify(eo,fo,go,ns.finish,ns.foffset,To.failure,ro);return Tu.cata(ps,()=>Yo.none(),()=>Yo.some(Zo),$s=>bc(fo,$s)&&go===0?g3(eo,fo,go,lO,To):tk(eo,ro,$s,0,To,No-1),$s=>bc(fo,$s)&&go===Ac($s)?g3(eo,fo,go,__,To):tk(eo,ro,$s,Ac($s),To,No-1))}),g3=(eo,ro,fo,go,To)=>Kb(eo,ro,fo).bind(No=>BT(eo,To,go(No,aw.getJumpSize()))),BT=(eo,ro,fo)=>{const go=Zp().browser;return go.isChromium()||go.isSafari()||go.isFirefox()?ro.retry(eo,fo):Yo.none()},b3=(eo,ro,fo,go,To)=>Kb(eo,fo,go).bind(No=>BT(eo,To,No)),$N=(eo,ro,fo)=>lw(eo,ro,fo).bind(go=>tk(eo,ro,go.element,go.offset,fo,IT).map(eo.fromSitus)),FT=(eo,ro)=>vu(eo,fo=>bd(fo).exists(go=>bc(go,ro))),uc=(eo,ro,fo,go,To)=>hu(go,"td,th",ro).bind(No=>hu(No,"table",ro).bind(Zo=>FT(To,Zo)?$N(eo,ro,fo).bind(ns=>hu(ns.finish,"td,th",ro).map(ps=>({start:No,finish:ps,range:ns}))):Yo.none())),db=(eo,ro,fo,go,To,No)=>No(go,ro).orThunk(()=>uc(eo,ro,fo,go,To).map(Zo=>{const ns=Zo.range;return ry.create(Yo.some(aO(ns.start,ns.soffset,ns.finish,ns.foffset)),!0)})),uO=(eo,ro)=>hu(eo,"tr",ro).bind(fo=>hu(fo,"table",ro).bind(go=>{const To=fu(go,"tr");return bc(fo,To[0])?Ul(go,No=>wp(No).isSome(),ro).map(No=>{const Zo=Ac(No);return ry.create(Yo.some(aO(No,Zo,No,Zo)),!0)}):Yo.none()})),wx=(eo,ro)=>hu(eo,"tr",ro).bind(fo=>hu(fo,"table",ro).bind(go=>{const To=fu(go,"tr");return bc(fo,To[To.length-1])?nu(go,No=>Jp(No).isSome(),ro).map(No=>ry.create(Yo.some(aO(No,0,No,0)),!0)):Yo.none()})),HT=(eo,ro,fo,go,To,No,Zo)=>uc(eo,fo,go,To,No).bind(ns=>ay(ro,fo,ns.start,ns.finish,Zo)),cw=eo=>{let ro=eo;return{get:()=>ro,set:To=>{ro=To}}},v3=eo=>{const ro=cw(Yo.none()),fo=()=>ro.get().each(eo);return{clear:()=>{fo(),ro.set(Yo.none())},isSet:()=>ro.get().isSome(),get:()=>ro.get(),set:ns=>{fo(),ro.set(Yo.some(ns))}}},C_=()=>{const eo=v3(So);return{...eo,on:fo=>eo.get().each(fo)}},nk=(eo,ro)=>hu(eo,"td,th",ro),hg=eo=>Nd(eo).exists(Z1),cH=(eo,ro,fo,go)=>{const To=C_(),No=To.clear,Zo=js=>{To.on(Nr=>{go.clearBeforeUpdate(ro),nk(js.target,fo).each(la=>{qh(Nr,la,fo).each(sa=>{const xr=sa.boxes.getOr([]);if(xr.length===1){const ca=xr[0],Cr=Ah(ca)==="false",Ra=Qf(Hy(js.target),ca,bc);Cr&&Ra&&(go.selectRange(ro,xr,ca,ca),eo.selectContents(ca))}else xr.length>1&&(go.selectRange(ro,xr,sa.start,sa.finish),eo.selectContents(la))})})})};return{clearstate:No,mousedown:js=>{go.clear(ro),nk(js.target,fo).filter(hg).each(To.set)},mouseover:js=>{Zo(js)},mouseup:js=>{Zo(js),No()}}},ok={traverse:sm,gather:Pc,relative:Zf.before,retry:aw.tryDown,failure:Tu.failedDown},k_={traverse:om,gather:Kl,relative:Zf.before,retry:aw.tryUp,failure:Tu.failedUp},uy=eo=>ro=>ro===eo,sk=uy(38),rk=uy(40),dO=eo=>eo>=37&&eo<=40,y3={isBackward:uy(37),isForward:uy(39)},QT={isBackward:uy(39),isForward:uy(37)},O3=eo=>{const ro=eo!==void 0?eo.dom:document,fo=ro.body.scrollLeft||ro.documentElement.scrollLeft,go=ro.body.scrollTop||ro.documentElement.scrollTop;return Ss(fo,go)},x_=(eo,ro,fo)=>{const To=(fo!==void 0?fo.dom:document).defaultView;To&&To.scrollBy(eo,ro)},q0=Qm.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),_3=eo=>q0.exact(eo.start,eo.soffset,eo.finish,eo.foffset),S3=eo=>eo.match({domRange:ro=>Ds.fromDom(ro.startContainer),relative:(ro,fo)=>Zf.getStart(ro),exact:(ro,fo,go,To)=>ro}),VT=q0.domRange,Cx=q0.relative,kx=q0.exact,xx=eo=>{const ro=S3(eo);return Dc(ro)},ik=iy.create,dy={domRange:VT,relative:Cx,exact:kx,exactFromRange:_3,getWin:xx,range:ik},zT=(eo,ro,fo)=>{var go,To;return Yo.from((To=(go=eo.dom).caretPositionFromPoint)===null||To===void 0?void 0:To.call(go,ro,fo)).bind(No=>{if(No.offsetNode===null)return Yo.none();const Zo=eo.dom.createRange();return Zo.setStart(No.offsetNode,No.offset),Zo.collapse(),Yo.some(Zo)})},uw=(eo,ro,fo)=>{var go,To;return Yo.from((To=(go=eo.dom).caretRangeFromPoint)===null||To===void 0?void 0:To.call(go,ro,fo))},Ex=document.caretPositionFromPoint?zT:document.caretRangeFromPoint?uw:Yo.none,w3=(eo,ro,fo)=>{const go=Ds.fromDom(eo.document);return Ex(go,ro,fo).map(To=>iy.create(Ds.fromDom(To.startContainer),To.startOffset,Ds.fromDom(To.endContainer),To.endOffset))},dw=(eo,ro)=>{const fo=pr(eo);return fo==="input"?Zf.after(eo):gs(["br","img"],fo)?ro===0?Zf.before(eo):Zf.after(eo):Zf.on(eo,ro)},C3=(eo,ro)=>{const fo=eo.fold(Zf.before,dw,Zf.after),go=ro.fold(Zf.before,dw,Zf.after);return dy.relative(fo,go)},da=(eo,ro,fo,go)=>{const To=dw(eo,ro),No=dw(fo,go);return dy.relative(To,No)},Nf=(eo,ro,fo,go)=>{const No=Ud(eo).dom.createRange();return No.setStart(eo.dom,ro),No.setEnd(fo.dom,go),No},j0=(eo,ro,fo,go)=>{const To=Nf(eo,ro,fo,go),No=bc(eo,fo)&&ro===go;return To.collapsed&&!No},sf=eo=>Yo.from(eo.getSelection()),Wg=(eo,ro)=>{sf(eo).each(fo=>{fo.removeAllRanges(),fo.addRange(ro)})},ak=(eo,ro,fo,go,To)=>{const No=W0(eo,ro,fo,go,To);Wg(eo,No)},fw=(eo,ro,fo,go,To,No)=>{ro.collapse(fo.dom,go),ro.extend(To.dom,No)},fb=(eo,ro)=>XC(eo,ro).match({ltr:(fo,go,To,No)=>{ak(eo,fo,go,To,No)},rtl:(fo,go,To,No)=>{sf(eo).each(Zo=>{if(Zo.setBaseAndExtent)Zo.setBaseAndExtent(fo.dom,go,To.dom,No);else if(Zo.extend)try{fw(eo,Zo,fo,go,To,No)}catch{ak(eo,To,No,fo,go)}else ak(eo,To,No,fo,go)})}}),lk=(eo,ro,fo,go,To)=>{const No=da(ro,fo,go,To);fb(eo,No)},ck=(eo,ro,fo)=>{const go=C3(ro,fo);fb(eo,go)},E_=eo=>{if(eo.rangeCount>0){const ro=eo.getRangeAt(0),fo=eo.getRangeAt(eo.rangeCount-1);return Yo.some(iy.create(Ds.fromDom(ro.startContainer),ro.startOffset,Ds.fromDom(fo.endContainer),fo.endOffset))}else return Yo.none()},WT=eo=>{if(eo.anchorNode===null||eo.focusNode===null)return E_(eo);{const ro=Ds.fromDom(eo.anchorNode),fo=Ds.fromDom(eo.focusNode);return j0(ro,eo.anchorOffset,fo,eo.focusOffset)?Yo.some(iy.create(ro,eo.anchorOffset,fo,eo.focusOffset)):E_(eo)}},hw=(eo,ro,fo=!0)=>{const To=(fo?tw:b_)(eo,ro);Wg(eo,To)},Tx=eo=>sf(eo).filter(ro=>ro.rangeCount>0).bind(WT),Ax=eo=>Tx(eo).map(ro=>dy.exact(ro.start,ro.soffset,ro.finish,ro.foffset)),k3=(eo,ro)=>{const fo=sw(eo,ro);return gx(fo)},hb=(eo,ro,fo)=>w3(eo,ro,fo),uk=eo=>{sf(eo).each(ro=>ro.removeAllRanges())},T_=eo=>({elementFromPoint:(Cr,Ra)=>Ds.fromPoint(Ds.fromDom(eo.document),Cr,Ra),getRect:Cr=>Cr.dom.getBoundingClientRect(),getRangedRect:(Cr,Ra,dl,Bl)=>{const Gu=dy.exact(Cr,Ra,dl,Bl);return k3(eo,Gu)},getSelection:()=>Ax(eo).map(Cr=>rw(eo,Cr)),fromSitus:Cr=>{const Ra=dy.relative(Cr.start,Cr.finish);return rw(eo,Ra)},situsFromPoint:(Cr,Ra)=>hb(eo,Cr,Ra).map(dl=>YC.create(dl.start,dl.soffset,dl.finish,dl.foffset)),clearSelection:()=>{uk(eo)},collapseSelection:(Cr=!1)=>{Ax(eo).each(Ra=>Ra.fold(dl=>dl.collapse(Cr),(dl,Bl)=>{const Gu=Cr?dl:Bl;ck(eo,Gu,Gu)},(dl,Bl,Gu,qf)=>{const zd=Cr?dl:Gu,dp=Cr?Bl:qf;lk(eo,zd,dp,zd,dp)}))},setSelection:Cr=>{lk(eo,Cr.start,Cr.soffset,Cr.finish,Cr.foffset)},setRelativeSelection:(Cr,Ra)=>{ck(eo,Cr,Ra)},selectNode:Cr=>{hw(eo,Cr,!1)},selectContents:Cr=>{hw(eo,Cr)},getInnerHeight:()=>eo.innerHeight,getScrollY:()=>O3(Ds.fromDom(eo.document)).top,scrollBy:(Cr,Ra)=>{x_(Cr,Ra,Ds.fromDom(eo.document))}}),Nh=(eo,ro)=>({rows:eo,cols:ro}),Sf=(eo,ro,fo,go)=>{const To=T_(eo),No=cH(To,ro,fo,go);return{clearstate:No.clearstate,mousedown:No.mousedown,mouseover:No.mouseover,mouseup:No.mouseup}},dk=eo=>Ef(eo,Mr).exists(Z1),mw=(eo,ro)=>dk(eo)||dk(ro),fk=(eo,ro,fo,go)=>{const To=T_(eo),No=()=>(go.clear(ro),Yo.none());return{keydown:(ps,$s,js,Nr,la,sa)=>{const xr=ps.raw,ca=xr.which,Cr=xr.shiftKey===!0;return Ll(ro,go.selectedSelector).fold(()=>(dO(ca)&&!Cr&&go.clearBeforeUpdate(ro),dO(ca)&&Cr&&!mw($s,Nr)?Yo.none:rk(ca)&&Cr?Jo(HT,To,ro,fo,ok,Nr,$s,go.selectRange):sk(ca)&&Cr?Jo(HT,To,ro,fo,k_,Nr,$s,go.selectRange):rk(ca)?Jo(db,To,fo,ok,Nr,$s,wx):sk(ca)?Jo(db,To,fo,k_,Nr,$s,uO):Yo.none),dl=>{const Bl=Gu=>()=>Vr(Gu,zd=>vx(zd.rows,zd.cols,ro,dl,go)).fold(()=>G1(ro,go.firstSelectedSelector,go.lastSelectedSelector).map(zd=>{const dp=rk(ca)||sa.isForward(ca)?Zf.after:Zf.before;return To.setRelativeSelection(Zf.on(zd.first,0),dp(zd.table)),go.clear(ro),ry.create(Yo.none(),!0)}),zd=>Yo.some(ry.create(Yo.none(),!0)));return dO(ca)&&Cr&&!mw($s,Nr)?Yo.none:rk(ca)&&Cr?Bl([Nh(1,0)]):sk(ca)&&Cr?Bl([Nh(-1,0)]):sa.isBackward(ca)&&Cr?Bl([Nh(0,-1),Nh(-1,0)]):sa.isForward(ca)&&Cr?Bl([Nh(0,1),Nh(1,0)]):dO(ca)&&!Cr?No:Yo.none})()},keyup:(ps,$s,js,Nr,la)=>Ll(ro,go.selectedSelector).fold(()=>{const sa=ps.raw,xr=sa.which;return sa.shiftKey===!0&&dO(xr)&&mw($s,Nr)?v_(ro,fo,$s,js,Nr,la,go.selectRange):Yo.none()},Yo.none)}},pw=(eo,ro,fo,go)=>{const To=T_(eo);return(No,Zo)=>{go.clearBeforeUpdate(ro),qh(No,Zo,fo).each(ns=>{const ps=ns.boxes.getOr([]);go.selectRange(ro,ps,ns.start,ns.finish),To.selectContents(Zo),To.collapseSelection()})}},gw=(eo,ro)=>{const fo=Vu(eo,ro);return fo===void 0||fo===""?[]:fo.split(" ")},A_=(eo,ro,fo)=>{const To=gw(eo,ro).concat([fo]);return zc(eo,ro,To.join(" ")),!0},UT=(eo,ro,fo)=>{const go=_r(gw(eo,ro),To=>To!==fo);return go.length>0?zc(eo,ro,go.join(" ")):ks(eo,ro),!1},bw=eo=>eo.dom.classList!==void 0,ZT=eo=>gw(eo,"class"),qT=(eo,ro)=>A_(eo,"class",ro),jT=(eo,ro)=>UT(eo,"class",ro),Ug=(eo,ro)=>{bw(eo)?eo.dom.classList.add(ro):qT(eo,ro)},Xh=eo=>{(bw(eo)?eo.dom.classList:ZT(eo)).length===0&&ks(eo,"class")},v1=(eo,ro)=>{bw(eo)?eo.dom.classList.remove(ro):jT(eo,ro),Xh(eo)},up=(eo,ro)=>bw(eo)&&eo.dom.classList.contains(ro),vw=(eo,ro)=>{ws(ro,fo=>{v1(eo,fo)})},hk=eo=>ro=>{Ug(ro,eo)},XT=eo=>ro=>{vw(ro,eo)},X0={byClass:eo=>{const ro=hk(eo.selected),fo=XT([eo.selected,eo.lastSelected,eo.firstSelected]),go=No=>{const Zo=fu(No,eo.selectedSelector);ws(Zo,fo)};return{clearBeforeUpdate:go,clear:go,selectRange:(No,Zo,ns,ps)=>{go(No),ws(Zo,ro),Ug(ns,eo.firstSelected),Ug(ps,eo.lastSelected)},selectedSelector:eo.selectedSelector,firstSelectedSelector:eo.firstSelectedSelector,lastSelectedSelector:eo.lastSelectedSelector}},byAttr:(eo,ro,fo)=>{const go=ps=>{ks(ps,eo.selected),ks(ps,eo.firstSelected),ks(ps,eo.lastSelected)},To=ps=>{zc(ps,eo.selected,"1")},No=ps=>{Zo(ps),fo()},Zo=ps=>{const $s=fu(ps,`${eo.selectedSelector},${eo.firstSelectedSelector},${eo.lastSelectedSelector}`);ws($s,go)};return{clearBeforeUpdate:Zo,clear:No,selectRange:(ps,$s,js,Nr)=>{No(ps),ws($s,To),zc(js,eo.firstSelected,"1"),zc(Nr,eo.lastSelected,"1"),ro($s,js,Nr)},selectedSelector:eo.selectedSelector,firstSelectedSelector:eo.firstSelectedSelector,lastSelectedSelector:eo.lastSelectedSelector}}},Ow=(eo,ro,fo,go)=>{switch(eo.tag){case"none":return ro();case"single":return go(eo.element);case"multiple":return fo(eo.elements)}},Px=()=>({tag:"none"}),YT=eo=>({tag:"multiple",elements:eo}),GT=eo=>({tag:"single",element:eo}),$x=(eo,ro,fo)=>({get:()=>Vy(eo(),fo).fold(()=>ro().fold(Px,GT),YT)}),mk=(eo,ro)=>{const fo=eo.slice(0,ro[ro.length-1].row+1),go=od(fo);return Ca(go,To=>{const No=To.cells.slice(0,ro[ro.length-1].column+1);return cr(No,Zo=>Zo.element)})},Au=(eo,ro)=>{const fo=eo.slice(ro[0].row+ro[0].rowspan-1,eo.length),go=od(fo);return Ca(go,To=>{const No=To.cells.slice(ro[0].column+ro[0].colspan-1,To.cells.length);return cr(No,Zo=>Zo.element)})},Y0=(eo,ro,fo)=>{const go=ss.fromTable(eo);return Bb(go,ro).map(No=>{const Zo=R0(go,fo,!1),{rows:ns}=fd(Zo),ps=mk(ns,No),$s=Au(ns,No);return{upOrLeftCells:ps,downOrRightCells:$s}})},KT=(eo,ro,fo,go,To,No,Zo)=>({target:eo,x:ro,y:fo,stop:go,prevent:To,kill:No,raw:Zo}),Rx=eo=>{const ro=Ds.fromDom(aa(eo).getOr(eo.target)),fo=()=>eo.stopPropagation(),go=()=>eo.preventDefault(),To=$o(go,fo);return KT(ro,eo.clientX,eo.clientY,fo,go,To,eo)},Dx=(eo,ro)=>fo=>{eo(fo)&&ro(Rx(fo))},fO=(eo,ro,fo,go,To)=>{const No=Dx(fo,go);return eo.dom.addEventListener(ro,No,To),{unbind:Jo(Nx,eo,ro,No,To)}},Mx=(eo,ro,fo,go)=>fO(eo,ro,fo,go,!1),Nx=(eo,ro,fo,go)=>{eo.dom.removeEventListener(ro,fo,go)},E3=is,P_=(eo,ro,fo)=>Mx(eo,ro,E3,fo),$_=Rx,Lx=eo=>!up(Ds.fromDom(eo.target),"ephox-snooker-resizer-bar"),Ix=(eo,ro)=>{const fo=$x(()=>Ds.fromDom(eo.getBody()),()=>Nv(Zh(eo),s1(eo)),J1.selectedSelector),go=(ps,$s,js)=>{jd($s).each(la=>{const sa=Lg(eo),xr=Qd(So,Ds.fromDom(eo.getDoc()),sa),ca=Tp(eo),Cr=Y0(la,{selection:ca},xr);X2(eo,ps,$s,js,Cr)})},To=()=>Y2(eo),No=X0.byAttr(J1,go,To);return eo.on("init",ps=>{const $s=eo.getWin(),js=kp(eo),Nr=s1(eo),la=()=>{const yu=eo.selection,wm=Ds.fromDom(yu.getStart()),Lh=Ds.fromDom(yu.getEnd());eu(jd,[wm,Lh]).fold(()=>No.clear(js),So)},sa=Sf($s,js,Nr,No),xr=fk($s,js,Nr,No),ca=pw($s,js,Nr,No),Cr=yu=>yu.raw.shiftKey===!0;eo.on("TableSelectorChange",yu=>ca(yu.start,yu.finish));const Ra=(yu,wm)=>{Cr(yu)&&(wm.kill&&yu.kill(),wm.selection.each(Lh=>{const gg=dy.relative(Lh.start,Lh.finish),Np=sw($s,gg);eo.selection.setRng(Np)}))},dl=yu=>{const wm=$_(yu);if(wm.raw.shiftKey&&dO(wm.raw.which)){const Lh=eo.selection.getRng(),gg=Ds.fromDom(Lh.startContainer),Np=Ds.fromDom(Lh.endContainer);xr.keyup(wm,gg,Lh.startOffset,Np,Lh.endOffset).each(my=>{Ra(wm,my)})}},Bl=yu=>{const wm=$_(yu);ro.hide();const Lh=eo.selection.getRng(),gg=Ds.fromDom(Lh.startContainer),Np=Ds.fromDom(Lh.endContainer),my=Ov(y3,QT)(Ds.fromDom(eo.selection.getStart()));xr.keydown(wm,gg,Lh.startOffset,Np,Lh.endOffset,my).each(Wm=>{Ra(wm,Wm)}),ro.show()},Gu=yu=>yu.button===0,qf=yu=>yu.buttons===void 0?!0:(yu.buttons&1)!==0,zd=yu=>{sa.clearstate()},dp=yu=>{Gu(yu)&&Lx(yu)&&sa.mousedown($_(yu))},mO=yu=>{qf(yu)&&Lx(yu)&&sa.mouseover($_(yu))},pO=yu=>{Gu(yu)&&Lx(yu)&&sa.mouseup($_(yu))},Ok=(()=>{const yu=cw(Ds.fromDom(js)),wm=cw(0);return{touchEnd:gg=>{const Np=Ds.fromDom(gg.target);if(Vc("td")(Np)||Vc("th")(Np)){const my=yu.get(),Wm=wm.get();bc(my,Np)&&gg.timeStamp-Wm<300&&(gg.preventDefault(),ca(Np,Np))}yu.set(Np),wm.set(gg.timeStamp)}}})();eo.on("dragstart",zd),eo.on("mousedown",dp),eo.on("mouseover",mO),eo.on("mouseup",pO),eo.on("touchend",Ok.touchEnd),eo.on("keyup",dl),eo.on("keydown",Bl),eo.on("NodeChange",la)}),eo.on("PreInit",()=>{eo.serializer.addTempAttr(J1.firstSelected),eo.serializer.addTempAttr(J1.lastSelected)}),{getSelectedCells:()=>Ow(fo.get(),xo([]),ps=>cr(ps,$s=>$s.dom),ps=>[ps.dom]),clearSelectedCells:ps=>No.clear(Ds.fromDom(ps))}},y1=eo=>{let ro=[];return{bind:No=>{if(No===void 0)throw new Error("Event bind error: undefined handler");ro.push(No)},unbind:No=>{ro=_r(ro,Zo=>Zo!==No)},trigger:(...No)=>{const Zo={};ws(eo,(ns,ps)=>{Zo[ns]=No[ps]}),ws(ro,ns=>{ns(Zo)})}}},fy=eo=>{const ro=Ml(eo,go=>({bind:go.bind,unbind:go.unbind})),fo=Ml(eo,go=>go.trigger);return{registry:ro,trigger:fo}},T3=(eo,ro)=>{let fo=null;const go=()=>{Kn(fo)||(clearTimeout(fo),fo=null)};return{cancel:go,throttle:(...No)=>{go(),fo=setTimeout(()=>{fo=null,eo.apply(null,No)},ro)}}},_w=eo=>eo.slice(0).sort(),A3=(eo,ro)=>{throw new Error("All required keys ("+_w(eo).join(", ")+") were not specified. Specified keys were: "+_w(ro).join(", ")+".")},Mp=eo=>{throw new Error("Unsupported keys for object: "+_w(eo).join(", "))},Yh=(eo,ro)=>{if(!Xn(ro))throw new Error("The "+eo+" fields must be an array. Was: "+ro+".");ws(ro,fo=>{if(!Un(fo))throw new Error("The value "+fo+" in the "+eo+" fields was not a string.")})},hO=(eo,ro)=>{throw new Error("All values need to be of type: "+ro+". Keys ("+_w(eo).join(", ")+") were not.")},RN=eo=>{const ro=_w(eo);zo(ro,(go,To)=>To{throw new Error("The field: "+go+" occurs more than once in the combined fields: ["+ro.join(", ")+"].")})},JT=(eo,ro)=>P3(eo,ro,{validate:bo,label:"function"}),P3=(eo,ro,fo)=>{if(ro.length===0)throw new Error("You must specify at least one required field.");return Yh("required",ro),RN(ro),go=>{const To=nr(go);za(ro,ns=>gs(To,ns))||A3(ro,To),eo(ro,To);const Zo=_r(ro,ns=>!fo.validate(go[ns],ns));return Zo.length>0&&hO(Zo,fo.label),go}},ic=(eo,ro)=>{const fo=_r(ro,go=>!gs(eo,go));fo.length>0&&Mp(fo)},Bx=eo=>JT(ic,eo),eA=Bx(["compare","extract","mutate","sink"]),Fx=Bx(["element","start","stop","destroy"]),$3=Bx(["forceDrop","drop","move","delayDrop"]),R3=()=>{let eo=Yo.none();const ro=()=>{eo=Yo.none()},fo=(No,Zo)=>{const ns=eo.map(ps=>No.compare(ps,Zo));return eo=Yo.some(Zo),ns},go=(No,Zo)=>{Zo.extract(No).each(ps=>{fo(Zo,ps).each(js=>{To.trigger.move(js)})})},To=fy({move:y1(["info"])});return{onEvent:go,reset:ro,events:To.registry}},tA=()=>{const eo=fy({move:y1(["info"])});return{onEvent:So,reset:So,events:eo.registry}},D3=()=>{const eo=tA(),ro=R3();let fo=eo;return{on:()=>{fo.reset(),fo=ro},off:()=>{fo.reset(),fo=eo},isOn:()=>fo===ro,onEvent:(ns,ps)=>{fo.onEvent(ns,ps)},events:ro.events}},va=(eo,ro,fo)=>{let go=!1;const To=fy({start:y1([]),stop:y1([])}),No=D3(),Zo=()=>{xr.stop(),No.isOn()&&(No.off(),To.trigger.stop())},ns=T3(Zo,200),ps=Cr=>{xr.start(Cr),No.on(),To.trigger.start()},$s=Cr=>{ns.cancel(),No.onEvent(Cr,ro)};No.events.move.bind(Cr=>{ro.mutate(eo,Cr.info)});const js=()=>{go=!0},Nr=()=>{go=!1},la=()=>go,sa=Cr=>(...Ra)=>{go&&Cr.apply(null,Ra)},xr=ro.sink($3({forceDrop:Zo,drop:sa(Zo),move:sa($s),delayDrop:sa(ns.throttle)}),fo),ca=()=>{xr.destroy()};return{element:xr.element,go:ps,on:js,off:Nr,isActive:la,destroy:ca,events:To.registry}},hy=eo=>{const ro=eo.replace(/\./g,"-");return{resolve:go=>ro+"-"+go}},Sw=hy("ephox-dragster").resolve,ww=eo=>{const ro={layerClass:Sw("blocker"),...eo},fo=Ds.fromTag("div");return zc(fo,"role","presentation"),lf(fo,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Ug(fo,Sw("blocker")),Ug(fo,ro.layerClass),{element:xo(fo),destroy:()=>{ju(fo)}}};var N3=eA({compare:(eo,ro)=>Ss(ro.left-eo.left,ro.top-eo.top),extract:eo=>Yo.some(Ss(eo.x,eo.y)),sink:(eo,ro)=>{const fo=ww(ro),go=P_(fo.element(),"mousedown",eo.forceDrop),To=P_(fo.element(),"mouseup",eo.drop),No=P_(fo.element(),"mousemove",eo.move),Zo=P_(fo.element(),"mouseout",eo.delayDrop),ns=()=>{fo.destroy(),To.unbind(),No.unbind(),Zo.unbind(),go.unbind()},ps=js=>{Qc(js,fo.element())},$s=()=>{ju(fo.element())};return Fx({element:fo.element,start:ps,stop:$s,destroy:ns})},mutate:(eo,ro)=>{eo.mutate(ro.left,ro.top)}});const oA=(eo,ro={})=>{var fo;const go=(fo=ro.mode)!==null&&fo!==void 0?fo:N3;return va(eo,go,ro)},G0=hy("ephox-snooker").resolve,sA=()=>{const eo=fy({drag:y1(["xDelta","yDelta"])});return{mutate:(fo,go)=>{eo.trigger.drag(fo,go)},events:eo.registry}},L3=()=>{const eo=fy({drag:y1(["xDelta","yDelta","target"])});let ro=Yo.none();const fo=sA();return fo.events.drag.bind(No=>{ro.each(Zo=>{eo.trigger.drag(No.xDelta,No.yDelta,Zo)})}),{assign:No=>{ro=Yo.some(No)},get:()=>ro,mutate:fo.mutate,events:eo.registry}},Cw=(eo,ro,fo,go,To)=>{const No=Ds.fromTag("div");return lf(No,{position:"absolute",left:ro-go/2+"px",top:fo+"px",height:To+"px",width:go+"px"}),ad(No,{"data-column":eo,role:"presentation"}),No},I3=(eo,ro,fo,go,To)=>{const No=Ds.fromTag("div");return lf(No,{position:"absolute",left:ro+"px",top:fo-To/2+"px",height:To+"px",width:go+"px"}),ad(No,{"data-row":eo,role:"presentation"}),No},rA=G0("resizer-bar"),Hx=G0("resizer-rows"),iA=G0("resizer-cols"),pk=7,B3=(eo,ro)=>Ca(eo.all,(fo,go)=>ro(fo.element)?[go]:[]),F3=(eo,ro)=>{const fo=[];return Qr(eo.grid.columns,go=>{ss.getColumnAt(eo,go).map(No=>No.element).forall(ro)&&fo.push(go)}),_r(fo,go=>{const To=ss.filterItems(eo,No=>No.column===go);return za(To,No=>ro(No.element))})},R_=eo=>{const ro=fu(eo.parent(),"."+rA);ws(ro,ju)},Qx=(eo,ro,fo)=>{const go=eo.origin();ws(ro,To=>{To.each(No=>{const Zo=fo(go,No);Ug(Zo,rA),Qc(eo.parent(),Zo)})})},aA=(eo,ro,fo,go)=>{Qx(eo,ro,(To,No)=>{const Zo=Cw(No.col,No.x-To.left,fo.top-To.top,pk,go);return Ug(Zo,iA),Zo})},H3=(eo,ro,fo,go)=>{Qx(eo,ro,(To,No)=>{const Zo=I3(No.row,fo.left-To.left,No.y-To.top,go,pk);return Ug(Zo,Hx),Zo})},Q3=(eo,ro,fo,go,To)=>{const No=Ea(fo),Zo=ro.isResizable,ns=go.length>0?Oa.positions(go,fo):[],ps=ns.length>0?B3(eo,Zo):[],$s=_r(ns,(sa,xr)=>xs(ps,ca=>xr===ca));H3(ro,$s,No,cm(fo));const js=To.length>0?Ad.positions(To,fo):[],Nr=js.length>0?F3(eo,Zo):[],la=_r(js,(sa,xr)=>xs(Nr,ca=>xr===ca));aA(ro,la,No,Eo(fo))},gk=(eo,ro)=>{if(R_(eo),eo.isResizable(ro)){const fo=ss.fromTable(ro),go=Ch(fo),To=dm(fo);Q3(fo,eo,ro,go,To)}},Jb=(eo,ro)=>{const fo=fu(eo.parent(),"."+rA);ws(fo,ro)},bk=eo=>{Jb(eo,ro=>{Du(ro,"display","none")})},Bc=eo=>{Jb(eo,ro=>{Du(ro,"display","block")})},V3=eo=>up(eo,Hx),K0=eo=>up(eo,iA),e0=G0("resizer-bar-dragging"),vk=eo=>{const ro=L3(),fo=oA(ro,{});let go=Yo.none();const To=(xr,ca)=>Yo.from(Vu(xr,ca));ro.events.drag.bind(xr=>{To(xr.target,"data-row").each(ca=>{const Cr=Od(xr.target,"top");Du(xr.target,"top",Cr+xr.yDelta+"px")}),To(xr.target,"data-column").each(ca=>{const Cr=Od(xr.target,"left");Du(xr.target,"left",Cr+xr.xDelta+"px")})});const No=(xr,ca)=>{const Cr=Od(xr,ca),Ra=Gc(xr,"data-initial-"+ca,0);return Cr-Ra};fo.events.stop.bind(()=>{ro.get().each(xr=>{go.each(ca=>{To(xr,"data-row").each(Cr=>{const Ra=No(xr,"top");ks(xr,"data-initial-top"),sa.trigger.adjustHeight(ca,Ra,parseInt(Cr,10))}),To(xr,"data-column").each(Cr=>{const Ra=No(xr,"left");ks(xr,"data-initial-left"),sa.trigger.adjustWidth(ca,Ra,parseInt(Cr,10))}),gk(eo,ca)})})});const Zo=(xr,ca)=>{sa.trigger.startAdjust(),ro.assign(xr),zc(xr,"data-initial-"+ca,Od(xr,ca)),Ug(xr,e0),Du(xr,"opacity","0.2"),fo.go(eo.parent())},ns=P_(eo.parent(),"mousedown",xr=>{V3(xr.target)&&Zo(xr.target,"top"),K0(xr.target)&&Zo(xr.target,"left")}),ps=xr=>bc(xr,eo.view()),$s=xr=>hu(xr,"table",ps).filter(Z1),js=P_(eo.view(),"mouseover",xr=>{$s(xr.target).fold(()=>{Bu(xr.target)&&R_(eo)},ca=>{fo.isActive()&&(go=Yo.some(ca),gk(eo,ca))})}),Nr=()=>{ns.unbind(),js.unbind(),fo.destroy(),R_(eo)},la=xr=>{gk(eo,xr)},sa=fy({adjustHeight:y1(["table","delta","row"]),adjustWidth:y1(["table","delta","column"]),startAdjust:y1([])});return{destroy:Nr,refresh:la,on:fo.on,off:fo.off,hideBars:Jo(bk,eo),showBars:Jo(Bc,eo),events:sa.registry}},yk={create:(eo,ro,fo)=>{const go=Oa,To=Ad,No=vk(eo),Zo=fy({beforeResize:y1(["table","type"]),afterResize:y1(["table","type"]),startDrag:y1([])});return No.events.adjustHeight.bind(ns=>{const ps=ns.table;Zo.trigger.beforeResize(ps,"row");const $s=go.delta(ns.delta,ps);e_(ps,$s,ns.row,go),Zo.trigger.afterResize(ps,"row")}),No.events.startAdjust.bind(ns=>{Zo.trigger.startDrag()}),No.events.adjustWidth.bind(ns=>{const ps=ns.table;Zo.trigger.beforeResize(ps,"col");const $s=To.delta(ns.delta,ps),js=fo(ps);Gv(ps,$s,ns.column,ro,js),Zo.trigger.afterResize(ps,"col")}),{on:No.on,off:No.off,refreshBars:No.refresh,hideBars:No.hideBars,showBars:No.showBars,destroy:No.destroy,events:Zo.registry}}},Vx={only:(eo,ro)=>{const fo=vl(eo)?oc(eo):eo;return{parent:xo(fo),view:xo(eo),origin:xo(Ss(0,0)),isResizable:ro}},detached:(eo,ro,fo)=>{const go=()=>Ea(ro);return{parent:xo(ro),view:xo(eo),origin:go,isResizable:fo}},body:(eo,ro,fo)=>({parent:xo(ro),view:xo(eo),origin:xo(Ss(0,0)),isResizable:fo})},z3=()=>{const eo=Ds.fromTag("div");return lf(eo,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Qc(Uo(),eo),eo},zx=(eo,ro)=>eo.inline?Vx.body(Ds.fromDom(eo.getBody()),z3(),ro):Vx.only(Ds.fromDom(eo.getDoc()),ro),W3=(eo,ro)=>{eo.inline&&ju(ro.parent())},dc=eo=>ho(eo)&&eo.nodeName==="TABLE",pg="bar-",ev=eo=>Vu(eo,"data-mce-resize")!=="false",U3=eo=>{const ro=ss.fromTable(eo);ss.hasColumns(ro)||ws(Yf(eo),fo=>{const go=qd(fo,"width");Du(fo,"width",go),ks(fo,"width")})},M_=eo=>{const ro=C_(),fo=C_(),go=C_();let To,No;const Zo=xr=>Dh(eo,xr),ns=()=>z1(eo)?OS():mC(),ps=xr=>Fv(xr).columns,$s=(xr,ca,Cr)=>{const Ra=Pm(ca,"e");if(No===""&&$p(xr),Cr!==To&&No!==""){Du(xr,"width",No);const dl=ns(),Bl=Zo(xr),Gu=z1(eo)||Ra?ps(xr)-1:0;Gv(xr,Cr-To,Gu,dl,Bl)}else if(MO(No)){const dl=parseFloat(No.replace("%","")),Bl=Cr*dl/To;Du(xr,"width",Bl+"%")}kv(No)&&U3(xr)},js=()=>{fo.on(xr=>{xr.destroy()}),go.on(xr=>{W3(eo,xr)})};return eo.on("init",()=>{const xr=zx(eo,ev);if(go.set(xr),lC(eo)&&T0(eo)){const ca=ns(),Cr=yk.create(xr,ca,Zo);Cr.on(),Cr.events.startDrag.bind(Ra=>{ro.set(eo.selection.getRng())}),Cr.events.beforeResize.bind(Ra=>{const dl=Ra.table.dom;VS(eo,dl,xp(dl),q1(dl),pg+Ra.type)}),Cr.events.afterResize.bind(Ra=>{const dl=Ra.table,Bl=dl.dom;Ig(dl),ro.on(Gu=>{eo.selection.setRng(Gu),eo.focus()}),zS(eo,Bl,xp(Bl),q1(Bl),pg+Ra.type),eo.undoManager.add()}),fo.set(Cr)}}),eo.on("ObjectResizeStart",xr=>{const ca=xr.target;if(dc(ca)){const Cr=Ds.fromDom(ca);ws(eo.dom.select(".mce-clonedresizable"),Ra=>{eo.dom.addClass(Ra,"mce-"+By(eo)+"-columns")}),!ny(Cr)&&W1(eo)?oy(Cr):!ty(Cr)&&tg(eo)&&$p(Cr),u_(Cr)&&Am(xr.origin,pg)&&$p(Cr),To=xr.width,No=U1(eo)?"":hS(eo,ca).getOr("")}}),eo.on("ObjectResized",xr=>{const ca=xr.target;if(dc(ca)){const Cr=Ds.fromDom(ca),Ra=xr.origin;Am(Ra,"corner-")&&$s(Cr,Ra,xr.width),Ig(Cr),V0(eo,Cr.dom,ab)}}),eo.on("SwitchMode",()=>{fo.on(xr=>{eo.mode.isReadOnly()?xr.hideBars():xr.showBars()})}),eo.on("dragstart dragend",xr=>{fo.on(ca=>{xr.type==="dragstart"?(ca.hideBars(),ca.off()):(ca.on(),ca.showBars())})}),eo.on("remove",()=>{js()}),{refresh:xr=>{fo.on(ca=>ca.refreshBars(Ds.fromDom(xr)))},hide:()=>{fo.on(xr=>xr.hideBars())},show:()=>{fo.on(xr=>xr.showBars())}}},wc=eo=>{E0(eo);const ro=M_(eo),fo=Ix(eo,ro),go=a_(eo,ro,fo);return jb(eo,go),fx(eo,go),fC(eo,go),{getSelectedCells:fo.getSelectedCells,clearSelectedCells:fo.clearSelectedCells}},Z3=eo=>({table:wc(eo)});var Wx=()=>{_n.add("dom",Z3)};Wx()})();tinymce.IconManager.add("default",{icons:{"accessibility-check":'',"accordion-toggle":'',accordion:'',"action-next":'',"action-prev":'',addtag:'',"ai-prompt":'',ai:'',"align-center":'',"align-justify":'',"align-left":'',"align-none":'',"align-right":'',"arrow-left":'',"arrow-right":'',bold:'',bookmark:'',"border-style":'',"border-width":'',brightness:'',browse:'',cancel:'',"cell-background-color":'',"cell-border-color":'',"change-case":'',"character-count":'',"checklist-rtl":'',checklist:'',checkmark:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',close:'',"code-sample":'',"color-levels":'',"color-picker":'',"color-swatch-remove-color":'',"color-swatch":'',"comment-add":'',comment:'',contrast:'',copy:'',crop:'',"cut-column":'',"cut-row":'',cut:'',"document-properties":'',drag:'',"duplicate-column":'',"duplicate-row":'',duplicate:'',"edit-block":'',"edit-image":'',"embed-page":'',embed:'',emoji:'',export:'',fill:'',"flip-horizontally":'',"flip-vertically":'',footnote:'',"format-painter":'',format:'',fullscreen:'',gallery:'',gamma:'',help:'',"highlight-bg-color":'',home:'',"horizontal-rule":'',"image-options":'',image:'',indent:'',info:'',"insert-character":'',"insert-time":'',invert:'',italic:'',language:'',"line-height":'',line:'',link:'',"list-bull-circle":'',"list-bull-default":'',"list-bull-square":'',"list-num-default-rtl":'',"list-num-default":'',"list-num-lower-alpha-rtl":'',"list-num-lower-alpha":'',"list-num-lower-greek-rtl":'',"list-num-lower-greek":'',"list-num-lower-roman-rtl":'',"list-num-lower-roman":'',"list-num-upper-alpha-rtl":'',"list-num-upper-alpha":'',"list-num-upper-roman-rtl":'',"list-num-upper-roman":'',lock:'',ltr:'',minus:'',"more-drawer":'',"new-document":'',"new-tab":'',"non-breaking":'',notice:'',"ordered-list-rtl":'',"ordered-list":'',orientation:'',outdent:'',"page-break":'',paragraph:'',"paste-column-after":'',"paste-column-before":'',"paste-row-after":'',"paste-row-before":'',"paste-text":'',paste:'',"permanent-pen":'',plus:'',preferences:'',preview:'',print:'',quote:'',redo:'',reload:'',"remove-formatting":'',remove:'',"resize-handle":'',resize:'',"restore-draft":'',"rotate-left":'',"rotate-right":'',rtl:'',save:'',search:'',"select-all":'',selected:'',send:'',settings:'',sharpen:'',sourcecode:'',"spell-check":'',"strike-through":'',subscript:'',superscript:'',"table-caption":'',"table-cell-classes":'',"table-cell-properties":'',"table-cell-select-all":'',"table-cell-select-inner":'',"table-classes":'',"table-delete-column":'',"table-delete-row":'',"table-delete-table":'',"table-insert-column-after":'',"table-insert-column-before":'',"table-insert-row-above":'',"table-insert-row-after":'',"table-left-header":'',"table-merge-cells":'',"table-row-numbering-rtl":'',"table-row-numbering":'',"table-row-properties":'',"table-split-cells":'',"table-top-header":'',table:'',"template-add":'',template:'',"temporary-placeholder":'',"text-color":'',"text-size-decrease":'',"text-size-increase":'',toc:'',translate:'',typography:'',underline:'',undo:'',unlink:'',unlock:'',"unordered-list":'',unselected:'',upload:'',user:'',"vertical-align":'',visualblocks:'',visualchars:'',warning:'',"zoom-in":'',"zoom-out":''}});(function(){const _n=Object.getPrototypeOf,Ce=(Qn,Zn,Yn)=>{var Jn;return Yn(Qn,Zn.prototype)?!0:((Jn=Qn.constructor)===null||Jn===void 0?void 0:Jn.name)===Zn.name},ke=Qn=>{const Zn=typeof Qn;return Qn===null?"null":Zn==="object"&&Array.isArray(Qn)?"array":Zn==="object"&&Ce(Qn,String,(Yn,Jn)=>Jn.isPrototypeOf(Yn))?"string":Zn},$n=Qn=>Zn=>ke(Zn)===Qn,Hn=Qn=>Zn=>typeof Zn===Qn,zn=Qn=>Zn=>Qn===Zn,Un=(Qn,Zn)=>Xn(Qn)&&Ce(Qn,Zn,(Yn,Jn)=>_n(Yn)===Jn),qn=$n("string"),Xn=$n("object"),Kn=Qn=>Un(Qn,Object),to=$n("array"),io=zn(null),uo=Hn("boolean"),ho=zn(void 0),bo=Qn=>Qn==null,Oo=Qn=>!bo(Qn),So=Hn("function"),$o=Hn("number"),Do=(Qn,Zn)=>{if(to(Qn)){for(let Yn=0,Jn=Qn.length;Yn{},Io=Qn=>()=>Qn(),Vo=(Qn,Zn)=>(...Yn)=>Qn(Zn.apply(null,Yn)),Jo=(Qn,Zn)=>Yn=>Qn(Zn(Yn)),Mo=Qn=>()=>Qn,Go=Qn=>Qn,os=(Qn,Zn)=>Qn===Zn;function ms(Qn,...Zn){return(...Yn)=>{const Jn=Zn.concat(Yn);return Qn.apply(null,Jn)}}const is=Qn=>Zn=>!Qn(Zn),Yo=Qn=>()=>{throw new Error(Qn)},Ys=Qn=>Qn(),sr=Mo(!1),Js=Mo(!0);class ko{constructor(Zn,Yn){this.tag=Zn,this.value=Yn}static some(Zn){return new ko(!0,Zn)}static none(){return ko.singletonNone}fold(Zn,Yn){return this.tag?Yn(this.value):Zn()}isSome(){return this.tag}isNone(){return!this.tag}map(Zn){return this.tag?ko.some(Zn(this.value)):ko.none()}bind(Zn){return this.tag?Zn(this.value):ko.none()}exists(Zn){return this.tag&&Zn(this.value)}forall(Zn){return!this.tag||Zn(this.value)}filter(Zn){return!this.tag||Zn(this.value)?this:ko.none()}getOr(Zn){return this.tag?this.value:Zn}or(Zn){return this.tag?this:Zn}getOrThunk(Zn){return this.tag?this.value:Zn()}orThunk(Zn){return this.tag?this:Zn()}getOrDie(Zn){if(this.tag)return this.value;throw new Error(Zn??"Called getOrDie on None")}static from(Zn){return Oo(Zn)?ko.some(Zn):ko.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Zn){this.tag&&Zn(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}ko.singletonNone=new ko(!1);const gs=Array.prototype.slice,xs=Array.prototype.indexOf,Qr=Array.prototype.push,cr=(Qn,Zn)=>xs.call(Qn,Zn),ws=(Qn,Zn)=>{const Yn=cr(Qn,Zn);return Yn===-1?ko.none():ko.some(Yn)},Fs=(Qn,Zn)=>cr(Qn,Zn)>-1,Br=(Qn,Zn)=>{for(let Yn=0,Jn=Qn.length;Yn{const Yn=[];for(let Jn=0;Jn{const Yn=[];for(let Jn=0;Jn{const Yn=Qn.length,Jn=new Array(Yn);for(let oo=0;oo{for(let Yn=0,Jn=Qn.length;Yn{for(let Yn=Qn.length-1;Yn>=0;Yn--){const Jn=Qn[Yn];Zn(Jn,Yn)}},el=(Qn,Zn)=>{const Yn=[],Jn=[];for(let oo=0,lo=Qn.length;oo{const Yn=[];for(let Jn=0,oo=Qn.length;Jn(zo(Qn,(Jn,oo)=>{Yn=Zn(Yn,Jn,oo)}),Yn),za=(Qn,Zn,Yn)=>(Qs(Qn,(Jn,oo)=>{Yn=Zn(Yn,Jn,oo)}),Yn),Il=(Qn,Zn,Yn)=>{for(let Jn=0,oo=Qn.length;JnIl(Qn,Zn,sr),Sr=(Qn,Zn)=>{for(let Yn=0,Jn=Qn.length;Yn{const Zn=[];for(let Yn=0,Jn=Qn.length;YnUs(hs(Qn,Zn)),dr=(Qn,Zn)=>{for(let Yn=0,Jn=Qn.length;Yn{const Zn=gs.call(Qn,0);return Zn.reverse(),Zn},nr=(Qn,Zn)=>ga(Qn,Yn=>!Fs(Zn,Yn)),Kr=(Qn,Zn)=>{const Yn={};for(let Jn=0,oo=Qn.length;Jn[Qn],Ml=(Qn,Zn)=>{const Yn=gs.call(Qn,0);return Yn.sort(Zn),Yn},xa=(Qn,Zn)=>Zn>=0&&Znxa(Qn,0),Zc=Qn=>xa(Qn,Qn.length-1),cc=So(Array.from)?Array.from:Qn=>gs.call(Qn),gc=(Qn,Zn)=>{for(let Yn=0;Yn{const Yn=nc(Qn);for(let Jn=0,oo=Yn.length;JnFc(Qn,(Yn,Jn)=>({k:Jn,v:Zn(Yn,Jn)})),Fc=(Qn,Zn)=>{const Yn={};return Zl(Qn,(Jn,oo)=>{const lo=Zn(Jn,oo);Yn[lo.k]=lo.v}),Yn},qa=Qn=>(Zn,Yn)=>{Qn[Yn]=Zn},Ya=(Qn,Zn,Yn,Jn)=>{Zl(Qn,(oo,lo)=>{(Zn(oo,lo)?Yn:Jn)(oo,lo)})},kc=(Qn,Zn)=>{const Yn={},Jn={};return Ya(Qn,Zn,qa(Yn),qa(Jn)),{t:Yn,f:Jn}},Yl=(Qn,Zn)=>{const Yn={};return Ya(Qn,Zn,qa(Yn),xo),Yn},rd=(Qn,Zn)=>{const Yn=[];return Zl(Qn,(Jn,oo)=>{Yn.push(Zn(Jn,oo))}),Yn},Al=(Qn,Zn)=>{const Yn=nc(Qn);for(let Jn=0,oo=Yn.length;Jnrd(Qn,Go),Rr=(Qn,Zn)=>Pl(Qn,Zn)?ko.from(Qn[Zn]):ko.none(),Pl=(Qn,Zn)=>Ed.call(Qn,Zn),Su=(Qn,Zn)=>Pl(Qn,Zn)&&Qn[Zn]!==void 0&&Qn[Zn]!==null,vs=(Qn,Zn,Yn=os)=>Qn.exists(Jn=>Yn(Jn,Zn)),Es=(Qn,Zn,Yn=os)=>ia(Qn,Zn,Yn).getOr(Qn.isNone()&&Zn.isNone()),Ks=Qn=>{const Zn=[],Yn=Jn=>{Zn.push(Jn)};for(let Jn=0;Jn{const Zn=[];for(let Yn=0;YnQn.isSome()&&Zn.isSome()?ko.some(Yn(Qn.getOrDie(),Zn.getOrDie())):ko.none(),ka=(Qn,Zn,Yn,Jn)=>Qn.isSome()&&Zn.isSome()&&Yn.isSome()?ko.some(Jn(Qn.getOrDie(),Zn.getOrDie(),Yn.getOrDie())):ko.none(),Ma=(Qn,Zn)=>Qn!=null?ko.some(Zn(Qn)):ko.none(),Mr=(Qn,Zn)=>Qn?ko.some(Zn):ko.none(),il=(Qn,Zn)=>Qn+Zn,Na=(Qn,Zn)=>Qn.substring(Zn),vl=(Qn,Zn,Yn)=>Zn===""||Qn.length>=Zn.length&&Qn.substr(Yn,Yn+Zn.length)===Zn,Rc=(Qn,Zn)=>zc(Qn,Zn)?Na(Qn,Zn.length):Qn,Vc=(Qn,Zn)=>ad(Qn,Zn)?Qn:il(Qn,Zn),xc=(Qn,Zn,Yn=0,Jn)=>{const oo=Qn.indexOf(Zn,Yn);return oo!==-1?ho(Jn)?!0:oo+Zn.length<=Jn:!1},zc=(Qn,Zn)=>vl(Qn,Zn,0),ad=(Qn,Zn)=>vl(Qn,Zn,Qn.length-Zn.length),Vu=(Qn=>Zn=>Zn.replace(Qn,""))(/^\s+|\s+$/g),Ts=Qn=>Qn.length>0,ks=Qn=>!Ts(Qn),ir=Qn=>Qn.style!==void 0&&So(Qn.style.getPropertyValue),br=(Qn,Zn)=>{const Jn=(Zn||document).createElement("div");if(Jn.innerHTML=Qn,!Jn.hasChildNodes()||Jn.childNodes.length>1){const oo="HTML does not have a single root node";throw console.error(oo,Qn),new Error(oo)}return _l(Jn.childNodes[0])},Aa=(Qn,Zn)=>{const Jn=(Zn||document).createElement(Qn);return _l(Jn)},Ba=(Qn,Zn)=>{const Jn=(Zn||document).createTextNode(Qn);return _l(Jn)},_l=Qn=>{if(Qn==null)throw new Error("Node cannot be null or undefined");return{dom:Qn}},Ds={fromHtml:br,fromTag:Aa,fromText:Ba,fromDom:_l,fromPoint:(Qn,Zn,Yn)=>ko.from(Qn.dom.elementFromPoint(Zn,Yn)).map(_l)},tl=typeof window<"u"?window:Function("return this;")(),wu=(Qn,Zn)=>{let Yn=Zn??tl;for(let Jn=0;Jn{const Yn=Qn.split(".");return wu(Yn,Zn)},Md=(Qn,Zn)=>qu(Qn,Zn),bc=(Qn,Zn)=>{const Yn=Md(Qn,Zn);if(Yn==null)throw new Error(Qn+" not available on this browser");return Yn},nm=Object.getPrototypeOf,Ff=Qn=>bc("HTMLElement",Qn),Ud=Qn=>{const Zn=qu("ownerDocument.defaultView",Qn);return Xn(Qn)&&(Ff(Zn).prototype.isPrototypeOf(Qn)||/^HTML\w*Element$/.test(nm(Qn).constructor.name))},ld=9,oc=11,Dc=1,bd=3,Nd=Qn=>Qn.dom.nodeName.toLowerCase(),ih=Qn=>Qn.dom.nodeType,om=Qn=>Zn=>ih(Zn)===Qn,sm=Qn=>fc(Qn)&&Ud(Qn.dom),fc=om(Dc),Td=om(bd),Jd=om(ld),Em=om(oc),ef=Qn=>Zn=>fc(Zn)&&Nd(Zn)===Qn,Cu=(Qn,Zn)=>{const Yn=Qn.dom;if(Yn.nodeType!==Dc)return!1;{const Jn=Yn;if(Jn.matches!==void 0)return Jn.matches(Zn);if(Jn.msMatchesSelector!==void 0)return Jn.msMatchesSelector(Zn);if(Jn.webkitMatchesSelector!==void 0)return Jn.webkitMatchesSelector(Zn);if(Jn.mozMatchesSelector!==void 0)return Jn.mozMatchesSelector(Zn);throw new Error("Browser lacks native selectors")}},Qc=Qn=>Qn.nodeType!==Dc&&Qn.nodeType!==ld&&Qn.nodeType!==oc||Qn.childElementCount===0,Cf=(Qn,Zn)=>{const Yn=Zn===void 0?document:Zn.dom;return Qc(Yn)?[]:hs(Yn.querySelectorAll(Qn),Ds.fromDom)},qm=(Qn,Zn)=>{const Yn=Zn===void 0?document:Zn.dom;return Qc(Yn)?ko.none():ko.from(Yn.querySelector(Qn)).map(Ds.fromDom)},Oc=(Qn,Zn)=>Qn.dom===Zn.dom,cd=(Qn,Zn)=>{const Yn=Qn.dom,Jn=Zn.dom;return Yn===Jn?!1:Yn.contains(Jn)},vd=Qn=>Ds.fromDom(Qn.dom.ownerDocument),ju=Qn=>Jd(Qn)?Qn:vd(Qn),Xf=Qn=>Ds.fromDom(ju(Qn).dom.documentElement),Sh=Qn=>Ds.fromDom(ju(Qn).dom.defaultView),Zd=Qn=>ko.from(Qn.dom.parentNode).map(Ds.fromDom),ah=Qn=>Zd(Qn),lh=Qn=>ko.from(Qn.dom.parentElement).map(Ds.fromDom),Bp=(Qn,Zn)=>{const Yn=So(Zn)?Zn:sr;let Jn=Qn.dom;const oo=[];for(;Jn.parentNode!==null&&Jn.parentNode!==void 0;){const lo=Jn.parentNode,mo=Ds.fromDom(lo);if(oo.push(mo),Yn(mo)===!0)break;Jn=lo}return oo},ch=Qn=>ko.from(Qn.dom.offsetParent).map(Ds.fromDom),bp=Qn=>ko.from(Qn.dom.nextSibling).map(Ds.fromDom),kf=Qn=>hs(Qn.dom.childNodes,Ds.fromDom),Fh=(Qn,Zn)=>{const Yn=Qn.dom.childNodes;return ko.from(Yn[Zn]).map(Ds.fromDom)},jm=Qn=>Fh(Qn,0),Fp=(Qn,Zn)=>({element:Qn,offset:Zn}),Eg=(Qn,Zn)=>{const Yn=kf(Qn);return Yn.length>0&&ZnEm(Qn)&&Oo(Qn.dom.host),As=So(Element.prototype.attachShadow)&&So(Node.prototype.getRootNode),Ws=Mo(As),rr=As?Qn=>Ds.fromDom(Qn.dom.getRootNode()):ju,Fr=Qn=>rs(Qn)?Qn:Ds.fromDom(ju(Qn).dom.body),Wa=Qn=>Nc(Qn).isSome(),Nc=Qn=>{const Zn=rr(Qn);return rs(Zn)?ko.some(Zn):ko.none()},xl=Qn=>Ds.fromDom(Qn.dom.host),ul=Qn=>{if(Ws()&&Oo(Qn.target)){const Zn=Ds.fromDom(Qn.target);if(fc(Zn)&&lu(Zn)&&Qn.composed&&Qn.composedPath){const Yn=Qn.composedPath();if(Yn)return Nl(Yn)}}return ko.from(Qn.target)},lu=Qn=>Oo(Qn.dom.shadowRoot),Gl=Qn=>{const Zn=Td(Qn)?Qn.dom.parentNode:Qn.dom;if(Zn==null||Zn.ownerDocument===null)return!1;const Yn=Zn.ownerDocument;return Nc(Ds.fromDom(Zn)).fold(()=>Yn.body.contains(Zn),Jo(Gl,xl))},Ru=()=>xf(Ds.fromDom(document)),xf=Qn=>{const Zn=Qn.dom.body;if(Zn==null)throw new Error("Body is not available yet");return Ds.fromDom(Zn)},Hp=(Qn,Zn,Yn)=>{if(qn(Yn)||uo(Yn)||$o(Yn))Qn.setAttribute(Zn,Yn+"");else throw console.error("Invalid call to Attribute.set. Key ",Zn,":: Value ",Yn,":: Element ",Qn),new Error("Attribute value was not simple")},aa=(Qn,Zn,Yn)=>{Hp(Qn.dom,Zn,Yn)},Qp=(Qn,Zn)=>{const Yn=Qn.dom;Zl(Zn,(Jn,oo)=>{Hp(Yn,oo,Jn)})},Bu=(Qn,Zn)=>{const Yn=Qn.dom.getAttribute(Zn);return Yn===null?void 0:Yn},Uo=(Qn,Zn)=>ko.from(Bu(Qn,Zn)),cs=(Qn,Zn)=>{const Yn=Qn.dom;return Yn&&Yn.hasAttribute?Yn.hasAttribute(Zn):!1},_s=(Qn,Zn)=>{Qn.dom.removeAttribute(Zn)},ar=Qn=>za(Qn.dom.attributes,(Zn,Yn)=>(Zn[Yn.name]=Yn.value,Zn),{}),ta=(Qn,Zn,Yn)=>{if(!qn(Yn))throw console.error("Invalid call to CSS.set. Property ",Zn,":: Value ",Yn,":: Element ",Qn),new Error("CSS value must be a string: "+Yn);ir(Qn)&&Qn.style.setProperty(Zn,Yn)},al=(Qn,Zn)=>{ir(Qn)&&Qn.style.removeProperty(Zn)},ya=(Qn,Zn,Yn)=>{const Jn=Qn.dom;ta(Jn,Zn,Yn)},fu=(Qn,Zn)=>{const Yn=Qn.dom;Zl(Zn,(Jn,oo)=>{ta(Yn,oo,Jn)})},Lr=(Qn,Zn)=>{const Yn=Qn.dom;Zl(Zn,(Jn,oo)=>{Jn.fold(()=>{al(Yn,oo)},lo=>{ta(Yn,oo,lo)})})},qc=(Qn,Zn)=>{const Yn=Qn.dom,oo=window.getComputedStyle(Yn).getPropertyValue(Zn);return oo===""&&!Gl(Qn)?Ef(Yn,Zn):oo},Ef=(Qn,Zn)=>ir(Qn)?Qn.style.getPropertyValue(Zn):"",ku=(Qn,Zn)=>{const Yn=Qn.dom,Jn=Ef(Yn,Zn);return ko.from(Jn).filter(oo=>oo.length>0)},jc=Qn=>{const Zn={},Yn=Qn.dom;if(ir(Yn))for(let Jn=0;Jn{const Jn=Ds.fromTag(Qn);return ya(Jn,Zn,Yn),ku(Jn,Zn).isSome()},El=(Qn,Zn)=>{const Yn=Qn.dom;al(Yn,Zn),vs(Uo(Qn,"style").map(Vu),"")&&_s(Qn,"style")},Hf=Qn=>Qn.dom.offsetWidth,hu=(Qn,Zn)=>{const Yn=(yo,Co)=>{if(!$o(Co)&&!Co.match(/^[0-9]+$/))throw new Error(Qn+".set accepts only positive integer values. Value was "+Co);const Ro=yo.dom;ir(Ro)&&(Ro.style[Qn]=Co+"px")},Jn=yo=>{const Co=Zn(yo);if(Co<=0||Co===null){const Ro=qc(yo,Qn);return parseFloat(Ro)||0}return Co},oo=Jn,lo=(yo,Co)=>za(Co,(Ro,Lo)=>{const Wo=qc(yo,Lo),jo=Wo===void 0?0:parseInt(Wo,10);return isNaN(jo)?Ro:Ro+jo},0);return{set:Yn,get:Jn,getOuter:oo,aggregate:lo,max:(yo,Co,Ro)=>{const Lo=lo(yo,Ro);return Co>Lo?Co-Lo:0}}},Qf=hu("height",Qn=>{const Zn=Qn.dom;return Gl(Qn)?Zn.getBoundingClientRect().height:Zn.offsetHeight}),cu=Qn=>Qf.get(Qn),Vp=Qn=>Qf.getOuter(Qn),ud=(Qn,Zn)=>{const Yn=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],Jn=Qf.max(Qn,Zn,Yn);ya(Qn,"max-height",Jn+"px")},vp=(Qn,Zn)=>({left:Qn,top:Zn,translate:(Jn,oo)=>vp(Qn+Jn,Zn+oo)}),vc=vp,Am=Qn=>{const Zn=Qn.getBoundingClientRect();return vc(Zn.left,Zn.top)},Pm=(Qn,Zn)=>Qn!==void 0?Qn:Zn!==void 0?Zn:0,uh=Qn=>{const Zn=Qn.dom.ownerDocument,Yn=Zn.body,Jn=Zn.defaultView,oo=Zn.documentElement;if(Yn===Qn.dom)return vc(Yn.offsetLeft,Yn.offsetTop);const lo=Pm(Jn==null?void 0:Jn.pageYOffset,oo.scrollTop),mo=Pm(Jn==null?void 0:Jn.pageXOffset,oo.scrollLeft),yo=Pm(oo.clientTop,Yn.clientTop),Co=Pm(oo.clientLeft,Yn.clientLeft);return Hh(Qn).translate(mo-Co,lo-yo)},Hh=Qn=>{const Zn=Qn.dom,Jn=Zn.ownerDocument.body;return Jn===Zn?vc(Jn.offsetLeft,Jn.offsetTop):Gl(Qn)?Am(Zn):vc(0,0)},A1=hu("width",Qn=>Qn.dom.offsetWidth),ql=(Qn,Zn)=>A1.set(Qn,Zn),dd=Qn=>A1.get(Qn),yd=Qn=>A1.getOuter(Qn),mv=(Qn,Zn)=>{const Yn=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],Jn=A1.max(Qn,Zn,Yn);ya(Qn,"max-width",Jn+"px")},Du=Qn=>{let Zn=!1,Yn;return(...Jn)=>(Zn||(Zn=!0,Yn=Qn.apply(null,Jn)),Yn)},lf=(Qn,Zn,Yn,Jn)=>{const oo=Qn.isiOS()&&/ipad/i.test(Yn)===!0,lo=Qn.isiOS()&&!oo,mo=Qn.isiOS()||Qn.isAndroid(),yo=mo||Jn("(pointer:coarse)"),Co=oo||!lo&&mo&&Jn("(min-device-width:768px)"),Ro=lo||mo&&!Co,Lo=Zn.isSafari()&&Qn.isiOS()&&/safari/i.test(Yn)===!1,Wo=!Ro&&!Co&&!Lo;return{isiPad:Mo(oo),isiPhone:Mo(lo),isTablet:Mo(Co),isPhone:Mo(Ro),isTouch:Mo(yo),isAndroid:Qn.isAndroid,isiOS:Qn.isiOS,isWebView:Mo(Lo),isDesktop:Mo(Wo)}},qd=(Qn,Zn)=>{for(let Yn=0;Yn{const Yn=qd(Qn,Zn);if(!Yn)return{major:0,minor:0};const Jn=oo=>Number(Zn.replace(Yn,"$"+oo));return Xg(Jn(1),Jn(2))},Tb=(Qn,Zn)=>{const Yn=String(Zn).toLowerCase();return Qn.length===0?Qh():Eb(Qn,Yn)},Qh=()=>Xg(0,0),Xg=(Qn,Zn)=>({major:Qn,minor:Zn}),Gc={nu:Xg,detect:Tb,unknown:Qh},im=(Qn,Zn)=>gc(Zn.brands,Yn=>{const Jn=Yn.brand.toLowerCase();return Zs(Qn,oo=>{var lo;return Jn===((lo=oo.brand)===null||lo===void 0?void 0:lo.toLowerCase())}).map(oo=>({current:oo.name,version:Gc.nu(parseInt(Yn.version,10),0)}))}),Tf=(Qn,Zn)=>{const Yn=String(Zn).toLowerCase();return Zs(Qn,Jn=>Jn.search(Yn))},Ld=(Qn,Zn)=>Tf(Qn,Zn).map(Yn=>{const Jn=Gc.detect(Yn.versionRegexes,Zn);return{current:Yn.name,version:Jn}}),Od=(Qn,Zn)=>Tf(Qn,Zn).map(Yn=>{const Jn=Gc.detect(Yn.versionRegexes,Zn);return{current:Yn.name,version:Jn}}),Mu=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Vh=Qn=>Zn=>xc(Zn,Qn),zp=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:Qn=>xc(Qn,"edge/")&&xc(Qn,"chrome")&&xc(Qn,"safari")&&xc(Qn,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Mu],search:Qn=>xc(Qn,"chrome")&&!xc(Qn,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:Qn=>xc(Qn,"msie")||xc(Qn,"trident")},{name:"Opera",versionRegexes:[Mu,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Vh("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Vh("firefox")},{name:"Safari",versionRegexes:[Mu,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:Qn=>(xc(Qn,"safari")||xc(Qn,"mobile/"))&&xc(Qn,"applewebkit")}],Tg=[{name:"Windows",search:Vh("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:Qn=>xc(Qn,"iphone")||xc(Qn,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Vh("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Vh("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Vh("linux"),versionRegexes:[]},{name:"Solaris",search:Vh("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Vh("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Vh("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ab={browsers:Mo(zp),oses:Mo(Tg)},P1="Edge",Yf="Chromium",$1="IE",jd="Opera",$m="Firefox",R1="Safari",Xm=()=>Yg({current:void 0,version:Gc.unknown()}),Yg=Qn=>{const Zn=Qn.current,Yn=Qn.version,Jn=oo=>()=>Zn===oo;return{current:Zn,version:Yn,isEdge:Jn(P1),isChromium:Jn(Yf),isIE:Jn($1),isOpera:Jn(jd),isFirefox:Jn($m),isSafari:Jn(R1)}},Vf={unknown:Xm,nu:Yg,edge:Mo(P1),chromium:Mo(Yf),ie:Mo($1),opera:Mo(jd),firefox:Mo($m),safari:Mo(R1)},Gg="Windows",yp="iOS",p0="Android",g0="Linux",Wp="macOS",zf="Solaris",b0="FreeBSD",Cs="ChromeOS",Up=()=>zh({current:void 0,version:Gc.unknown()}),zh=Qn=>{const Zn=Qn.current,Yn=Qn.version,Jn=oo=>()=>Zn===oo;return{current:Zn,version:Yn,isWindows:Jn(Gg),isiOS:Jn(yp),isAndroid:Jn(p0),isMacOS:Jn(Wp),isLinux:Jn(g0),isSolaris:Jn(zf),isFreeBSD:Jn(b0),isChromeOS:Jn(Cs)}},Kg={unknown:Up,nu:zh,windows:Mo(Gg),ios:Mo(yp),android:Mo(p0),linux:Mo(g0),macos:Mo(Wp),solaris:Mo(zf),freebsd:Mo(b0),chromeos:Mo(Cs)},Jg={detect:(Qn,Zn,Yn)=>{const Jn=Ab.browsers(),oo=Ab.oses(),lo=Zn.bind(Co=>im(Jn,Co)).orThunk(()=>Ld(Jn,Qn)).fold(Vf.unknown,Vf.nu),mo=Od(oo,Qn).fold(Kg.unknown,Kg.nu),yo=lf(mo,lo,Qn,Yn);return{browser:lo,os:mo,deviceType:yo}}},Vs=Qn=>window.matchMedia(Qn).matches;let Dr=Du(()=>Jg.detect(navigator.userAgent,ko.from(navigator.userAgentData),Vs));const Tr=()=>Dr(),Fa=(Qn,Zn,Yn,Jn,oo,lo,mo)=>({target:Qn,x:Zn,y:Yn,stop:Jn,prevent:oo,kill:lo,raw:mo}),zl=Qn=>{const Zn=Ds.fromDom(ul(Qn).getOr(Qn.target)),Yn=()=>Qn.stopPropagation(),Jn=()=>Qn.preventDefault(),oo=Vo(Jn,Yn);return Fa(Zn,Qn.clientX,Qn.clientY,Yn,Jn,oo,Qn)},_c=(Qn,Zn)=>Yn=>{Qn(Yn)&&Zn(zl(Yn))},Wc=(Qn,Zn,Yn,Jn,oo)=>{const lo=_c(Yn,Jn);return Qn.dom.addEventListener(Zn,lo,oo),{unbind:ms(pv,Qn,Zn,lo,oo)}},Uc=(Qn,Zn,Yn,Jn)=>Wc(Qn,Zn,Yn,Jn,!1),D1=(Qn,Zn,Yn,Jn)=>Wc(Qn,Zn,Yn,Jn,!0),pv=(Qn,Zn,Yn,Jn)=>{Qn.dom.removeEventListener(Zn,Yn,Jn)},_d=(Qn,Zn)=>{Zd(Qn).each(Jn=>{Jn.dom.insertBefore(Zn.dom,Qn.dom)})},Wh=(Qn,Zn)=>{bp(Qn).fold(()=>{Zd(Qn).each(oo=>{Id(oo,Zn)})},Jn=>{_d(Jn,Zn)})},y0=(Qn,Zn)=>{jm(Qn).fold(()=>{Id(Qn,Zn)},Jn=>{Qn.dom.insertBefore(Zn.dom,Jn.dom)})},Id=(Qn,Zn)=>{Qn.dom.appendChild(Zn.dom)},Ku=(Qn,Zn,Yn)=>{Fh(Qn,Yn).fold(()=>{Id(Qn,Zn)},Jn=>{_d(Jn,Zn)})},Rm=(Qn,Zn)=>{Qs(Zn,Yn=>{Id(Qn,Yn)})},iu=Qn=>{Qn.dom.textContent="",Qs(kf(Qn),Zn=>{am(Zn)})},am=Qn=>{const Zn=Qn.dom;Zn.parentNode!==null&&Zn.parentNode.removeChild(Zn)},Af=Qn=>{const Zn=Qn!==void 0?Qn.dom:document,Yn=Zn.body.scrollLeft||Zn.documentElement.scrollLeft,Jn=Zn.body.scrollTop||Zn.documentElement.scrollTop;return vc(Yn,Jn)},e1=(Qn,Zn,Yn)=>{const oo=(Yn!==void 0?Yn.dom:document).defaultView;oo&&oo.scrollTo(Qn,Zn)},gv=Qn=>{const Zn=Qn===void 0?window:Qn;return Tr().browser.isFirefox()?ko.none():ko.from(Zn.visualViewport)},M1=(Qn,Zn,Yn,Jn)=>({x:Qn,y:Zn,width:Yn,height:Jn,right:Qn+Yn,bottom:Zn+Jn}),Pb=Qn=>{const Zn=Qn===void 0?window:Qn,Yn=Zn.document,Jn=Af(Ds.fromDom(Yn));return gv(Zn).fold(()=>{const oo=Zn.document.documentElement,lo=oo.clientWidth,mo=oo.clientHeight;return M1(Jn.left,Jn.top,lo,mo)},oo=>M1(Math.max(oo.pageLeft,Jn.left),Math.max(oo.pageTop,Jn.top),oo.width,oo.height))},Op=()=>Ds.fromDom(document),Wf=(Qn,Zn)=>Qn.view(Zn).fold(Mo([]),Jn=>{const oo=Qn.owner(Jn),lo=Wf(Qn,oo);return[Jn].concat(lo)}),N1=(Qn,Zn)=>{const Yn=Zn.owner(Qn),Jn=Wf(Zn,Yn);return ko.some(Jn)};var $b=Object.freeze({__proto__:null,view:Qn=>{var Zn;return(Qn.dom===document?ko.none():ko.from((Zn=Qn.dom.defaultView)===null||Zn===void 0?void 0:Zn.frameElement)).map(Ds.fromDom)},owner:Qn=>vd(Qn)});const Zp=Qn=>{const Zn=Op(),Yn=Af(Zn);return N1(Qn,$b).fold(ms(uh,Qn),oo=>{const lo=Hh(Qn),mo=Ca(oo,(yo,Co)=>{const Ro=Hh(Co);return{left:yo.left+Ro.left,top:yo.top+Ro.top}},{left:0,top:0});return vc(mo.left+lo.left+Yn.left,mo.top+lo.top+Yn.top)})},qp=(Qn,Zn,Yn)=>({point:Qn,width:Zn,height:Yn}),Ag=(Qn,Zn,Yn,Jn)=>({x:Qn,y:Zn,width:Yn,height:Jn}),Kc=(Qn,Zn,Yn,Jn)=>({x:Qn,y:Zn,width:Yn,height:Jn,right:Qn+Yn,bottom:Zn+Jn}),au=Qn=>{const Zn=uh(Qn),Yn=yd(Qn),Jn=Vp(Qn);return Kc(Zn.left,Zn.top,Yn,Jn)},cf=Qn=>{const Zn=Zp(Qn),Yn=yd(Qn),Jn=Vp(Qn);return Kc(Zn.left,Zn.top,Yn,Jn)},O0=(Qn,Zn)=>{const Yn=Math.max(Qn.x,Zn.x),Jn=Math.max(Qn.y,Zn.y),oo=Math.min(Qn.right,Zn.right),lo=Math.min(Qn.bottom,Zn.bottom),mo=oo-Yn,yo=lo-Jn;return Kc(Yn,Jn,mo,yo)},bv=(Qn,Zn)=>za(Zn,(Yn,Jn)=>O0(Yn,Jn),Qn),tf=()=>Pb(window);var lm=tinymce.util.Tools.resolve("tinymce.ThemeManager");const uf=Qn=>{const Zn=lo=>lo(Qn),Yn=Mo(Qn),Jn=()=>oo,oo={tag:!0,inner:Qn,fold:(lo,mo)=>mo(Qn),isValue:Js,isError:sr,map:lo=>yl.value(lo(Qn)),mapError:Jn,bind:Zn,exists:Zn,forall:Zn,getOr:Yn,or:Jn,getOrThunk:Yn,orThunk:Jn,getOrDie:Yn,each:lo=>{lo(Qn)},toOptional:()=>ko.some(Qn)};return oo},cm=Qn=>{const Zn=()=>Yn,Yn={tag:!1,inner:Qn,fold:(Jn,oo)=>Jn(Qn),isValue:sr,isError:Js,map:Zn,mapError:Jn=>yl.error(Jn(Qn)),bind:Zn,exists:sr,forall:Js,getOr:Go,or:Go,getOrThunk:Ys,orThunk:Ys,getOrDie:Yo(String(Qn)),each:xo,toOptional:ko.none};return Yn},yl={value:uf,error:cm,fromOption:(Qn,Zn)=>Qn.fold(()=>cm(Zn),uf)};var dh;(function(Qn){Qn[Qn.Error=0]="Error",Qn[Qn.Value=1]="Value"})(dh||(dh={}));const jp=(Qn,Zn,Yn)=>Qn.stype===dh.Error?Zn(Qn.serror):Yn(Qn.svalue),Sd=Qn=>{const Zn=[],Yn=[];return Qs(Qn,Jn=>{jp(Jn,oo=>Yn.push(oo),oo=>Zn.push(oo))}),{values:Zn,errors:Yn}},df=(Qn,Zn)=>Qn.stype===dh.Error?{stype:dh.Error,serror:Zn(Qn.serror)}:Qn,vv=(Qn,Zn)=>Qn.stype===dh.Value?{stype:dh.Value,svalue:Zn(Qn.svalue)}:Qn,ff=(Qn,Zn)=>Qn.stype===dh.Value?Zn(Qn.svalue):Qn,Ju=(Qn,Zn)=>Qn.stype===dh.Error?Zn(Qn.serror):Qn,wh=Qn=>({stype:dh.Value,svalue:Qn}),fd=Qn=>({stype:dh.Error,serror:Qn}),xu={fromResult:Qn=>Qn.fold(fd,wh),toResult:Qn=>jp(Qn,yl.error,yl.value),svalue:wh,partition:Sd,serror:fd,bind:ff,bindError:Ju,map:vv,mapError:df,fold:jp},ed=(Qn,Zn,Yn,Jn)=>({tag:"field",key:Qn,newKey:Zn,presence:Yn,prop:Jn}),fh=(Qn,Zn)=>({tag:"custom",newKey:Qn,instantiator:Zn}),Gm=(Qn,Zn,Yn)=>{switch(Qn.tag){case"field":return Zn(Qn.key,Qn.newKey,Qn.presence,Qn.prop);case"custom":return Yn(Qn.newKey,Qn.instantiator)}},Fu=(Qn,Zn)=>Zn,_0=(Qn,Zn)=>Kn(Qn)&&Kn(Zn)?Lc(Qn,Zn):Zn,yv=Qn=>(...Zn)=>{if(Zn.length===0)throw new Error("Can't merge zero objects");const Yn={};for(let Jn=0;Jn({tag:"required",process:{}}),hf=Qn=>({tag:"defaultedThunk",process:Qn}),um=Qn=>hf(Mo(Qn)),Km=()=>({tag:"option",process:{}}),ss=Qn=>({tag:"mergeWithThunk",process:Qn}),dm=Qn=>ss(Mo(Qn)),n1=(Qn,Zn)=>Qn.length>0?xu.svalue(Lc(Zn,Dm.apply(void 0,Qn))):xu.svalue(Zn),Ch=Qn=>Vo(xu.serror,Us)(Qn),Db={consolidateObj:(Qn,Zn)=>{const Yn=xu.partition(Qn);return Yn.errors.length>0?Ch(Yn.errors):n1(Yn.values,Zn)},consolidateArr:Qn=>{const Zn=xu.partition(Qn);return Zn.errors.length>0?Ch(Zn.errors):xu.svalue(Zn.values)}},S0=Qn=>Xn(Qn)&&nc(Qn).length>100?" removed due to size":JSON.stringify(Qn,null,2),Mm=Qn=>{const Zn=Qn.length>10?Qn.slice(0,10).concat([{path:[],getErrorInfo:Mo("... (only showing first ten failures)")}]):Qn;return hs(Zn,Yn=>"Failed path: ("+Yn.path.join(" > ")+`) +`+Yn.getErrorInfo())},Eo=(Qn,Zn)=>xu.serror([{path:Qn,getErrorInfo:Zn}]),Bo=(Qn,Zn,Yn)=>Eo(Qn,()=>'Could not find valid *required* value for "'+Zn+'" in '+S0(Yn)),Ko=(Qn,Zn)=>Eo(Qn,()=>'Choice schema did not contain choice key: "'+Zn+'"'),Ss=(Qn,Zn,Yn)=>Eo(Qn,()=>'The chosen schema: "'+Yn+'" did not exist in branches: '+S0(Zn)),Rs=(Qn,Zn)=>Eo(Qn,()=>"There are unsupported fields: ["+Zn.join(", ")+"] specified"),$r=(Qn,Zn)=>Eo(Qn,Mo(Zn)),Ea=Qn=>{const Zn=(Jn,oo)=>xu.bindError(Qn(oo),lo=>$r(Jn,lo)),Yn=Mo("val");return{extract:Zn,toString:Yn}},ll=Ea(xu.svalue),nl=(Qn,Zn,Yn,Jn)=>Rr(Zn,Yn).fold(()=>Bo(Qn,Yn,Zn),Jn),Xa=(Qn,Zn,Yn,Jn)=>{const oo=Rr(Qn,Zn).getOrThunk(()=>Yn(Qn));return Jn(oo)},Nu=(Qn,Zn,Yn)=>Yn(Rr(Qn,Zn)),zu=(Qn,Zn,Yn,Jn)=>{const oo=Rr(Qn,Zn).map(lo=>lo===!0?Yn(Qn):lo);return Jn(oo)},kh=(Qn,Zn,Yn,Jn,oo)=>{const lo=yo=>oo.extract(Zn.concat([Jn]),yo),mo=yo=>yo.fold(()=>xu.svalue(ko.none()),Co=>{const Ro=oo.extract(Zn.concat([Jn]),Co);return xu.map(Ro,ko.some)});switch(Qn.tag){case"required":return nl(Zn,Yn,Jn,lo);case"defaultedThunk":return Xa(Yn,Jn,Qn.process,lo);case"option":return Nu(Yn,Jn,mo);case"defaultedOptionThunk":return zu(Yn,Jn,Qn.process,mo);case"mergeWithThunk":return Xa(Yn,Jn,Mo({}),yo=>{const Co=Lc(Qn.process(Yn),yo);return lo(Co)})}},Sp=(Qn,Zn,Yn)=>{const Jn={},oo=[];for(const lo of Yn)Gm(lo,(mo,yo,Co,Ro)=>{const Lo=kh(Co,Qn,Zn,mo,Ro);xu.fold(Lo,Wo=>{oo.push(...Wo)},Wo=>{Jn[yo]=Wo})},(mo,yo)=>{Jn[mo]=yo(Zn)});return oo.length>0?xu.serror(oo):xu.svalue(Jn)},mf=Qn=>({extract:(Jn,oo)=>Qn().extract(Jn,oo),toString:()=>Qn().toString()}),fS=Qn=>nc(Yl(Qn,Oo)),mu=Qn=>{const Zn=Ta(Qn),Yn=Ca(Qn,(oo,lo)=>Gm(lo,mo=>Lc(oo,{[mo]:!0}),Mo(oo)),{});return{extract:(oo,lo)=>{const mo=uo(lo)?[]:fS(lo),yo=ga(mo,Co=>!Su(Yn,Co));return yo.length===0?Zn.extract(oo,lo):Rs(oo,yo)},toString:Zn.toString}},Ta=Qn=>({extract:(Jn,oo)=>Sp(Jn,oo,Qn),toString:()=>`obj{ +`+hs(Qn,oo=>Gm(oo,(lo,mo,yo,Co)=>lo+" -> "+Co.toString(),(lo,mo)=>"state("+lo+")")).join(` +`)+"}"}),Xp=Qn=>({extract:(Jn,oo)=>{const lo=hs(oo,(mo,yo)=>Qn.extract(Jn.concat(["["+yo+"]"]),mo));return Db.consolidateArr(lo)},toString:()=>"array("+Qn.toString()+")"}),Oa=(Qn,Zn)=>{const Yn=Zn!==void 0?Zn:Go;return{extract:(lo,mo)=>{const yo=[];for(const Co of Qn){const Ro=Co.extract(lo,mo);if(Ro.stype===dh.Value)return{stype:dh.Value,svalue:Yn(Ro.svalue)};yo.push(Ro)}return Db.consolidateArr(yo)},toString:()=>"oneOf("+hs(Qn,lo=>lo.toString()).join(", ")+")"}},pf=(Qn,Zn)=>{const Yn=(lo,mo)=>Xp(Ea(Qn)).extract(lo,mo);return{extract:(lo,mo)=>{const yo=nc(mo),Co=Yn(lo,yo);return xu.bind(Co,Ro=>{const Lo=hs(Ro,Wo=>ed(Wo,Wo,sc(),Zn));return Ta(Lo).extract(lo,mo)})},toString:()=>"setOf("+Zn.toString()+")"}},$O=(Qn,Zn)=>{const Yn=Du(Zn);return{extract:(lo,mo)=>Yn().extract(lo,mo),toString:()=>Yn().toString()}},Yp=Vo(Xp,Ta),Ad=Mo(ll),Pg=(Qn,Zn)=>Ea(Yn=>{const Jn=typeof Yn;return Qn(Yn)?xu.svalue(Yn):xu.serror(`Expected type: ${Zn} but got: ${Jn}`)}),w0=Pg($o,"number"),nf=Pg(qn,"string"),Jm=Pg(uo,"boolean"),_v=Pg(So,"function"),Gp=Qn=>{if(Object(Qn)!==Qn)return!0;switch({}.toString.call(Qn).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(Qn).every(Zn=>Gp(Qn[Zn]));default:return!1}},Sv=Ea(Qn=>Gp(Qn)?xu.svalue(Qn):xu.serror("Expected value to be acceptable for sending via postMessage")),$g=(Qn,Zn,Yn,Jn)=>Rr(Yn,Jn).fold(()=>Ss(Qn,Yn,Jn),lo=>lo.extract(Qn.concat(["branch: "+Jn]),Zn)),Ir=(Qn,Zn)=>({extract:(oo,lo)=>Rr(lo,Qn).fold(()=>Ko(oo,Qn),yo=>$g(oo,lo,Zn,yo)),toString:()=>"chooseOn("+Qn+"). Possible values: "+nc(Zn)}),RO=()=>Xp(ll),Rg=Qn=>Ea(Zn=>Qn(Zn).fold(xu.serror,xu.svalue)),Dg=(Qn,Zn)=>pf(Yn=>xu.fromResult(Qn(Yn)),Zn),Nm=(Qn,Zn,Yn)=>{const Jn=Zn.extract([Qn],Yn);return xu.mapError(Jn,oo=>({input:Yn,errors:oo}))},Lu=(Qn,Zn,Yn)=>xu.toResult(Nm(Qn,Zn,Yn)),Ec=Qn=>Qn.fold(Zn=>{throw new Error(Gf(Zn))},Go),td=(Qn,Zn,Yn)=>Ec(Lu(Qn,Zn,Yn)),Gf=Qn=>`Errors: +`+Mm(Qn.errors).join(` +`)+` + +Input object: `+S0(Qn.input),jl=(Qn,Zn)=>Ir(Qn,Vl(Zn,Ta)),L1=(Qn,Zn)=>$O(Qn,Zn),Bd=ed,pu=fh,C0=Qn=>Rg(Zn=>Fs(Qn,Zn)?yl.value(Zn):yl.error(`Unsupported value: "${Zn}", choose one of "${Qn.join(", ")}".`)),Er=Qn=>Bd(Qn,Qn,sc(),Ad()),Kf=(Qn,Zn)=>Bd(Qn,Qn,sc(),Zn),k0=Qn=>Kf(Qn,w0),hc=Qn=>Kf(Qn,nf),hd=(Qn,Zn)=>Bd(Qn,Qn,sc(),C0(Zn)),wv=Qn=>Kf(Qn,Jm),ep=Qn=>Kf(Qn,_v),tp=(Qn,Zn)=>Bd(Qn,Qn,Km(),Ea(Yn=>xu.serror("The field: "+Qn+" is forbidden. "+Zn))),fm=(Qn,Zn)=>Bd(Qn,Qn,sc(),Ta(Zn)),Mb=(Qn,Zn)=>Bd(Qn,Qn,sc(),Yp(Zn)),Pf=(Qn,Zn)=>Bd(Qn,Qn,sc(),Xp(Zn)),Tc=Qn=>Bd(Qn,Qn,Km(),Ad()),Fd=(Qn,Zn)=>Bd(Qn,Qn,Km(),Zn),Mg=Qn=>Fd(Qn,w0),$f=Qn=>Fd(Qn,nf),Ly=(Qn,Zn)=>Fd(Qn,C0(Zn)),I1=Qn=>Fd(Qn,_v),Ng=(Qn,Zn)=>Fd(Qn,Xp(Zn)),hh=(Qn,Zn)=>Fd(Qn,Ta(Zn)),np=(Qn,Zn)=>Fd(Qn,mu(Zn)),Gs=(Qn,Zn)=>Bd(Qn,Qn,um(Zn),Ad()),xh=(Qn,Zn,Yn)=>Bd(Qn,Qn,um(Zn),Yn),Lm=(Qn,Zn)=>xh(Qn,Zn,w0),mh=(Qn,Zn)=>xh(Qn,Zn,nf),Eh=(Qn,Zn,Yn)=>xh(Qn,Zn,C0(Yn)),Xd=(Qn,Zn)=>xh(Qn,Zn,Jm),Hd=(Qn,Zn)=>xh(Qn,Zn,_v),Iy=(Qn,Zn)=>xh(Qn,Zn,Sv),Th=(Qn,Zn,Yn)=>xh(Qn,Zn,Xp(Yn)),Kp=(Qn,Zn,Yn)=>xh(Qn,Zn,Ta(Yn)),Ua=Qn=>{let Zn=Qn;return{get:()=>Zn,set:oo=>{Zn=oo}}},Po={generate:Qn=>{if(!to(Qn))throw new Error("cases must be an array");if(Qn.length===0)throw new Error("there must be at least one case");const Zn=[],Yn={};return Qs(Qn,(Jn,oo)=>{const lo=nc(Jn);if(lo.length!==1)throw new Error("one and only one name per case");const mo=lo[0],yo=Jn[mo];if(Yn[mo]!==void 0)throw new Error("duplicate key detected:"+mo);if(mo==="cata")throw new Error("cannot have a case named cata (sorry)");if(!to(yo))throw new Error("case arguments must be an array");Zn.push(mo),Yn[mo]=(...Co)=>{const Ro=Co.length;if(Ro!==yo.length)throw new Error("Wrong number of arguments to case "+mo+". Expected "+yo.length+" ("+yo+"), got "+Ro);return{fold:(...Wo)=>{if(Wo.length!==Qn.length)throw new Error("Wrong number of arguments to fold. Expected "+Qn.length+", got "+Wo.length);return Wo[oo].apply(null,Co)},match:Wo=>{const jo=nc(Wo);if(Zn.length!==jo.length)throw new Error("Wrong number of arguments to match. Expected: "+Zn.join(",")+` +Actual: `+jo.join(","));if(!dr(Zn,us=>Fs(jo,us)))throw new Error("Not all branches were specified when using match. Specified: "+jo.join(", ")+` +Required: `+Zn.join(", "));return Wo[mo].apply(null,Co)},log:Wo=>{console.log(Wo,{constructors:Zn,constructor:mo,params:Co})}}}}),Yn}};Po.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const Xo=Qn=>{const Zn=[],Yn=[];return Qs(Qn,Jn=>{Jn.fold(oo=>{Zn.push(oo)},oo=>{Yn.push(oo)})}),{errors:Zn,values:Yn}},as=(Qn,Zn)=>{const Yn={};return Zl(Qn,(Jn,oo)=>{Fs(Zn,oo)||(Yn[oo]=Jn)}),Yn},Ms=(Qn,Zn)=>({[Qn]:Zn}),vr=Qn=>{const Zn={};return Qs(Qn,Yn=>{Zn[Yn.key]=Yn.value}),Zn},zr=(Qn,Zn)=>as(Qn,Zn),Jr=(Qn,Zn)=>Ms(Qn,Zn),La=Qn=>vr(Qn),Ol=(Qn,Zn)=>Qn.length===0?yl.value(Zn):yl.value(Lc(Zn,Dm.apply(void 0,Qn))),Xu=Qn=>yl.error(Us(Qn)),Ac=(Qn,Zn)=>{const Yn=Xo(Qn);return Yn.errors.length>0?Xu(Yn.errors):Ol(Yn.values,Zn)},gu=Qn=>So(Qn)?Qn:sr,Uh=(Qn,Zn,Yn)=>{let Jn=Qn.dom;const oo=gu(Yn);for(;Jn.parentNode;){Jn=Jn.parentNode;const lo=Ds.fromDom(Jn),mo=Zn(lo);if(mo.isSome())return mo;if(oo(lo))break}return ko.none()},Jf=(Qn,Zn,Yn)=>{const Jn=Zn(Qn),oo=gu(Yn);return Jn.orThunk(()=>oo(Qn)?ko.none():Uh(Qn,Zn,oo))},hm=(Qn,Zn)=>Oc(Qn.element,Zn.event.target),Jp={can:Js,abort:sr,run:xo},wp=Qn=>{if(!Su(Qn,"can")&&!Su(Qn,"abort")&&!Su(Qn,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(Qn,null,2)+" does not have can, abort, or run!");return{...Jp,...Qn}},B1=(Qn,Zn)=>(...Yn)=>za(Qn,(Jn,oo)=>Jn&&Zn(oo).apply(void 0,Yn),!0),Sc=(Qn,Zn)=>(...Yn)=>za(Qn,(Jn,oo)=>Jn||Zn(oo).apply(void 0,Yn),!1),F1=Qn=>So(Qn)?{can:Js,abort:sr,run:Qn}:Qn,x0=Qn=>{const Zn=B1(Qn,oo=>oo.can),Yn=Sc(Qn,oo=>oo.abort);return{can:Zn,abort:Yn,run:(...oo)=>{Qs(Qn,lo=>{lo.run.apply(void 0,oo)})}}},nd=Mo,mm=nd("touchstart"),Nb=nd("touchmove"),H1=nd("touchend"),Fl=nd("touchcancel"),Xl=nd("mousedown"),Qd=nd("mousemove"),Rf=nd("mouseout"),Cv=nd("mouseup"),eg=nd("mouseover"),Wu=nd("focusin"),pm=nd("focusout"),op=nd("keydown"),Q1=nd("keyup"),o1=nd("input"),E0=nd("change"),Lg=nd("click"),lC=nd("transitioncancel"),V1=nd("transitionend"),By=nd("transitionstart"),z1=nd("selectstart"),Pd=Qn=>Mo("alloy."+Qn),Cp={tap:Pd("tap")},tg=Pd("focus"),W1=Pd("blur.post"),U1=Pd("paste.post"),T0=Pd("receive"),Im=Pd("execute"),md=Pd("focus.item"),ng=Cp.tap,DO=Pd("longpress"),Fy=Pd("sandbox.close"),Hy=Pd("typeahead.cancel"),Z1=Pd("system.init"),Ah=Pd("system.touchmove"),kp=Pd("system.touchend"),s1=Pd("system.scroll"),Ig=Pd("system.resize"),Zh=Pd("system.attached"),xp=Pd("system.detached"),q1=Pd("system.dismissRequested"),hS=Pd("system.repositionRequested"),MO=Pd("focusmanager.shifted"),kv=Pd("slotcontainer.visibility"),j1=Pd("system.external.element.scroll"),xv=Pd("change.tab"),NO=Pd("dismiss.tab"),Ev=Pd("highlight"),Tv=Pd("dehighlight"),Wl=(Qn,Zn)=>{Lb(Qn,Qn.element,Zn,{})},Qa=(Qn,Zn,Yn)=>{Lb(Qn,Qn.element,Zn,Yn)},og=Qn=>{Wl(Qn,Im())},Av=(Qn,Zn,Yn)=>{Lb(Qn,Zn,Yn,{})},Lb=(Qn,Zn,Yn,Jn)=>{const oo={target:Zn,...Jn};Qn.getSystem().triggerEvent(Yn,Zn,oo)},T2=(Qn,Zn,Yn,Jn)=>{const oo={...Jn,target:Zn};Qn.getSystem().triggerEvent(Yn,Zn,oo)},LO=(Qn,Zn,Yn,Jn)=>{Qn.getSystem().triggerEvent(Yn,Zn,Jn.event)},Jc=Qn=>La(Qn),IO=(Qn,Zn)=>({key:Qn,value:wp({abort:Zn})}),Qy=(Qn,Zn)=>({key:Qn,value:wp({can:Zn})}),mS=Qn=>({key:Qn,value:wp({run:(Zn,Yn)=>{Yn.event.prevent()}})}),wr=(Qn,Zn)=>({key:Qn,value:wp({run:Zn})}),sg=(Qn,Zn,Yn)=>({key:Qn,value:wp({run:(Jn,oo)=>{Zn.apply(void 0,[Jn,oo].concat(Yn))}})}),cC=Qn=>Zn=>wr(Qn,Zn),Pv=Qn=>Zn=>({key:Qn,value:wp({run:(Yn,Jn)=>{hm(Yn,Jn)&&Zn(Yn,Jn)}})}),A2=(Qn,Zn)=>wr(Qn,(Yn,Jn)=>{Yn.getSystem().getByUid(Zn).each(oo=>{LO(oo,oo.element,Qn,Jn)})}),A0=(Qn,Zn,Yn)=>{const Jn=Zn.partUids[Yn];return A2(Qn,Jn)},pS=(Qn,Zn)=>wr(Qn,(Yn,Jn)=>{const oo=Jn.event,lo=Yn.getSystem().getByDom(oo.target).getOrThunk(()=>Jf(oo.target,yo=>Yn.getSystem().getByDom(yo).toOptional(),sr).getOr(Yn));Zn(Yn,lo,Jn)}),X1=Qn=>wr(Qn,(Zn,Yn)=>{Yn.cut()}),Y1=Qn=>wr(Qn,(Zn,Yn)=>{Yn.stop()}),rg=(Qn,Zn)=>Pv(Qn)(Zn),eu=Pv(Zh()),ig=Pv(xp()),$v=Pv(Z1()),qh=cC(Im()),Ll=(Qn,Zn)=>{const Jn=(Zn||document).createElement("div");return Jn.innerHTML=Qn,kf(Ds.fromDom(Jn))},Rv=Qn=>Qn.dom.innerHTML,G1=(Qn,Zn)=>{const Jn=vd(Qn).dom,oo=Ds.fromDom(Jn.createDocumentFragment()),lo=Ll(Zn,Jn);Rm(oo,lo),iu(Qn),Id(Qn,oo)},Ib=Qn=>{const Zn=Ds.fromTag("div"),Yn=Ds.fromDom(Qn.dom.cloneNode(!0));return Id(Zn,Yn),Rv(Zn)},BO=(Qn,Zn)=>Ds.fromDom(Qn.dom.cloneNode(Zn)),Vy=Qn=>BO(Qn,!1),uC=Qn=>BO(Qn,!0),Ph=Qn=>{if(rs(Qn))return"#shadow-root";{const Zn=Vy(Qn);return Ib(Zn)}},r1=Qn=>Ph(Qn),ET=(Qn,Zn,Yn)=>Oc(Zn,Qn.element)&&!Oc(Zn,Yn),FO=Jc([Qy(tg(),(Qn,Zn)=>{const Yn=Zn.event,Jn=Yn.originator,oo=Yn.target;return ET(Qn,Jn,oo)?(console.warn(tg()+` did not get interpreted by the desired target. +Originator: `+r1(Jn)+` +Target: `+r1(oo)+` +Check the `+tg()+" event handlers"),!1):!0})]);var P0=Object.freeze({__proto__:null,events:FO});let Uf=0;const ba=Qn=>{const Yn=new Date().getTime(),Jn=Math.floor(Math.random()*1e9);return Uf++,Qn+"_"+Jn+Uf+String(Yn)},P2=Mo("alloy-id-"),gS=Mo("data-alloy-id"),K1=P2(),gm=gS(),J1=(Qn,Zn)=>{const Yn=ba(K1+Qn);return Dv(Zn,Yn),Yn},Dv=(Qn,Zn)=>{Object.defineProperty(Qn.dom,gm,{value:Zn,writable:!0})},$0=Qn=>{const Zn=fc(Qn)?Qn.dom[gm]:null;return ko.from(Zn)},Mv=Qn=>ba(Qn),HO=Go,Ep=Qn=>{const Zn=oo=>`The component must be in a context to execute: ${oo}`+(Qn?` +`+r1(Qn().element)+" is not in context.":""),Yn=oo=>()=>{throw new Error(Zn(oo))},Jn=oo=>()=>{console.warn(Zn(oo))};return{debugInfo:Mo("fake"),triggerEvent:Jn("triggerEvent"),triggerFocus:Jn("triggerFocus"),triggerEscape:Jn("triggerEscape"),broadcast:Jn("broadcast"),broadcastOn:Jn("broadcastOn"),broadcastEvent:Jn("broadcastEvent"),build:Yn("build"),buildOrPatch:Yn("buildOrPatch"),addToWorld:Yn("addToWorld"),removeFromWorld:Yn("removeFromWorld"),addToGui:Yn("addToGui"),removeFromGui:Yn("removeFromGui"),getByUid:Yn("getByUid"),getByDom:Yn("getByDom"),isConnected:sr}},ag=Ep(),Nv=(Qn,Zn,Yn)=>{const Jn=Yn.toString(),oo=Jn.indexOf(")")+1,lo=Jn.indexOf("("),mo=Jn.substring(lo+1,oo-1).split(/,\s*/);return Qn.toFunctionAnnotation=()=>({name:Zn,parameters:Tp(mo.slice(0,1).concat(mo.slice(3)))}),Qn},Tp=Qn=>hs(Qn,Zn=>ad(Zn,"/*")?Zn.substring(0,Zn.length-2):Zn),QO=(Qn,Zn)=>{const Yn=Qn.toString(),Jn=Yn.indexOf(")")+1,oo=Yn.indexOf("("),lo=Yn.substring(oo+1,Jn-1).split(/,\s*/);return Qn.toFunctionAnnotation=()=>({name:Zn,parameters:Tp(lo)}),Qn},dC=(Qn,Zn)=>{const Yn=Zn.toString(),Jn=Yn.indexOf(")")+1,oo=Yn.indexOf("("),lo=Yn.substring(oo+1,Jn-1).split(/,\s*/);return Qn.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:Tp(lo.slice(1))}),Qn},Lv=ba("alloy-premade"),i1=Qn=>(Object.defineProperty(Qn.element.dom,Lv,{value:Qn.uid,writable:!0}),Jr(Lv,Qn)),fC=Qn=>Pl(Qn.dom,Lv),Iv=Qn=>Rr(Qn,Lv),eb=Qn=>dC((Zn,...Yn)=>Qn(Zn.getApis(),Zn,...Yn),Qn),Ap={init:()=>ph({readState:Mo("No State required")})},ph=Qn=>Qn,bS=(Qn,Zn)=>{const Yn=hs(Zn,oo=>hh(oo.name(),[Er("config"),Gs("state",Ap)])),Jn=Lu("component.behaviours",Ta(Yn),Qn.behaviours).fold(oo=>{throw new Error(Gf(oo)+` +Complete spec: +`+JSON.stringify(Qn,null,2))},Go);return{list:Zn,data:Vl(Jn,oo=>{const lo=oo.map(mo=>({config:mo.config,state:mo.state.init(mo.config)}));return Mo(lo)})}},vS=Qn=>Qn.list,yS=Qn=>Qn.data,Bv=(Qn,Zn)=>{const Yn={};return Zl(Qn,(Jn,oo)=>{Zl(Jn,(lo,mo)=>{const yo=Rr(Yn,mo).getOr([]);Yn[mo]=yo.concat([Zn(oo,lo)])})}),Yn},bm=Qn=>({classes:ho(Qn.classes)?[]:Qn.classes,attributes:ho(Qn.attributes)?{}:Qn.attributes,styles:ho(Qn.styles)?{}:Qn.styles}),Bm=(Qn,Zn)=>({...Qn,attributes:{...Qn.attributes,...Zn.attributes},styles:{...Qn.styles,...Zn.styles},classes:Qn.classes.concat(Zn.classes)}),a1=(Qn,Zn,Yn,Jn)=>{const oo={...Zn};Qs(Yn,Lo=>{oo[Lo.name()]=Lo.exhibit(Qn,Jn)});const lo=Bv(oo,(Lo,Wo)=>({name:Lo,modification:Wo})),mo=Lo=>Ca(Lo,(Wo,jo)=>({...jo.modification,...Wo}),{}),yo=Ca(lo.classes,(Lo,Wo)=>Wo.modification.concat(Lo),[]),Co=mo(lo.attributes),Ro=mo(lo.styles);return bm({classes:yo,attributes:Co,styles:Ro})},VO=(Qn,Zn,Yn,Jn)=>{try{const oo=Ml(Yn,(lo,mo)=>{const yo=lo[Zn],Co=mo[Zn],Ro=Jn.indexOf(yo),Lo=Jn.indexOf(Co);if(Ro===-1)throw new Error("The ordering for "+Qn+" does not have an entry for "+yo+`. +Order specified: `+JSON.stringify(Jn,null,2));if(Lo===-1)throw new Error("The ordering for "+Qn+" does not have an entry for "+Co+`. +Order specified: `+JSON.stringify(Jn,null,2));return Ro({handler:Qn,purpose:Zn}),mC=(Qn,Zn)=>({cHandler:Qn,purpose:Zn}),OS=(Qn,Zn)=>mC(ms.apply(void 0,[Qn.handler].concat(Zn)),Qn.purpose),Fv=Qn=>Qn.cHandler,Hv=(Qn,Zn)=>({name:Qn,handler:Zn}),zO=(Qn,Zn)=>{const Yn={};return Qs(Qn,Jn=>{Yn[Jn.name()]=Jn.handlers(Zn)}),Yn},$2=(Qn,Zn,Yn)=>{const Jn={...Yn,...zO(Zn,Qn)};return Bv(Jn,Hv)},WO=(Qn,Zn,Yn,Jn)=>{const oo=$2(Qn,Yn,Jn);return _S(oo,Zn)},Qv=Qn=>{const Zn=F1(Qn);return(Yn,Jn,...oo)=>{const lo=[Yn,Jn].concat(oo);Zn.abort.apply(void 0,lo)?Jn.stop():Zn.can.apply(void 0,lo)&&Zn.run.apply(void 0,lo)}},R2=(Qn,Zn)=>yl.error(["The event ("+Qn+`) has more than one behaviour that listens to it. +When this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]). +The behaviours that can trigger it are: `+JSON.stringify(hs(Zn,Yn=>Yn.name),null,2)]),zy=(Qn,Zn,Yn)=>{const Jn=Zn[Yn];return Jn?VO("Event: "+Yn,"name",Qn,Jn).map(oo=>{const lo=hs(oo,mo=>mo.handler);return x0(lo)}):R2(Yn,Qn)},_S=(Qn,Zn)=>{const Yn=rd(Qn,(Jn,oo)=>(Jn.length===1?yl.value(Jn[0].handler):zy(Jn,Zn,oo)).map(mo=>{const yo=Qv(mo),Co=Jn.length>1?ga(Zn[oo],Ro=>Br(Jn,Lo=>Lo.name===Ro)).join(" > "):Jn[0].name;return Jr(oo,hC(yo,Co))}));return Ac(Yn,{})},vm="alloy.base.behaviour",Wy=Ta([Bd("dom","dom",sc(),Ta([Er("tag"),Gs("styles",{}),Gs("classes",[]),Gs("attributes",{}),Tc("value"),Tc("innerHtml")])),Er("components"),Er("uid"),Gs("events",{}),Gs("apis",{}),Bd("eventOrder","eventOrder",dm({[Im()]:["disabling",vm,"toggling","typeaheadevents"],[tg()]:[vm,"focusing","keying"],[Z1()]:[vm,"disabling","toggling","representing"],[o1()]:[vm,"representing","streaming","invalidating"],[xp()]:[vm,"representing","item-events","tooltipping"],[Xl()]:["focusing",vm,"item-type-events"],[mm()]:["focusing",vm,"item-type-events"],[eg()]:["item-type-events","tooltipping"],[T0()]:["receiving","reflecting","tooltipping"]}),Ad()),Tc("domModification")]),SS=Qn=>Lu("custom.definition",Wy,Qn),UO=Qn=>({...Qn.dom,uid:Qn.uid,domChildren:hs(Qn.components,Zn=>Zn.element)}),TT=Qn=>Qn.domModification.fold(()=>bm({}),bm),ZO=Qn=>Qn.events,tb=(Qn,Zn)=>{const Yn=Bu(Qn,Zn);return Yn===void 0||Yn===""?[]:Yn.split(" ")},l1=(Qn,Zn,Yn)=>{const oo=tb(Qn,Zn).concat([Yn]);return aa(Qn,Zn,oo.join(" ")),!0},wS=(Qn,Zn,Yn)=>{const Jn=ga(tb(Qn,Zn),oo=>oo!==Yn);return Jn.length>0?aa(Qn,Zn,Jn.join(" ")):_s(Qn,Zn),!1},Vv=Qn=>Qn.dom.classList!==void 0,qO=Qn=>tb(Qn,"class"),pC=(Qn,Zn)=>l1(Qn,"class",Zn),Eu=(Qn,Zn)=>wS(Qn,"class",Zn),lg=(Qn,Zn)=>Fs(qO(Qn),Zn)?Eu(Qn,Zn):pC(Qn,Zn),$d=(Qn,Zn)=>{Vv(Qn)?Qn.dom.classList.add(Zn):pC(Qn,Zn)},gC=Qn=>{(Vv(Qn)?Qn.dom.classList:qO(Qn)).length===0&&_s(Qn,"class")},Yu=(Qn,Zn)=>{Vv(Qn)?Qn.dom.classList.remove(Zn):Eu(Qn,Zn),gC(Qn)},R0=(Qn,Zn)=>{const Yn=Vv(Qn)?Qn.dom.classList.toggle(Zn):lg(Qn,Zn);return gC(Qn),Yn},of=(Qn,Zn)=>Vv(Qn)&&Qn.dom.classList.contains(Zn),od=(Qn,Zn)=>{Qs(Zn,Yn=>{$d(Qn,Yn)})},sp=(Qn,Zn)=>{Qs(Zn,Yn=>{Yu(Qn,Yn)})},CS=(Qn,Zn)=>{Qs(Zn,Yn=>{R0(Qn,Yn)})},Df=(Qn,Zn)=>dr(Zn,Yn=>of(Qn,Yn)),Uy=Qn=>{const Zn=Qn.dom.classList,Yn=new Array(Zn.length);for(let Jn=0;JnVv(Qn)?Uy(Qn):qO(Qn),c1=Qn=>Qn.dom.value,Wv=(Qn,Zn)=>{if(Zn===void 0)throw new Error("Value.set was undefined");Qn.dom.value=Zn},Bb=(Qn,Zn,Yn)=>Fh(Qn,Zn).map(oo=>{if(Yn.exists(mo=>!Oc(mo,oo))){const mo=Yn.map(Nd).getOr("span"),yo=Ds.fromTag(mo);return _d(oo,yo),yo}else return oo}),nb=(Qn,Zn,Yn)=>{Yn.fold(()=>Id(Qn,Zn),Jn=>{Oc(Jn,Zn)||(_d(Jn,Zn),am(Jn))})},D2=(Qn,Zn,Yn)=>{const Jn=hs(Zn,Yn),oo=kf(Qn);return Qs(oo.slice(Jn.length),am),Jn},bC=(Qn,Zn,Yn,Jn)=>{const oo=Fh(Qn,Zn),lo=Jn(Yn,oo),mo=Bb(Qn,Zn,oo);return nb(Qn,lo.element,mo),lo},AT=(Qn,Zn,Yn)=>D2(Qn,Zn,(Jn,oo)=>bC(Qn,oo,Jn,Yn)),PT=(Qn,Zn)=>D2(Qn,Zn,(Yn,Jn)=>{const oo=Fh(Qn,Jn);return nb(Qn,Yn,oo),Yn}),cg=(Qn,Zn)=>{const Yn=nc(Qn),Jn=nc(Zn),oo=nr(Jn,Yn),lo=kc(Qn,(mo,yo)=>!Pl(Zn,yo)||mo!==Zn[yo]).t;return{toRemove:oo,toSet:lo}},$h=(Qn,Zn)=>{const{class:Yn,style:Jn,...oo}=ar(Zn),{toSet:lo,toRemove:mo}=cg(Qn.attributes,oo),yo=()=>{Qs(mo,Xs=>_s(Zn,Xs)),Qp(Zn,lo)},Co=jc(Zn),{toSet:Ro,toRemove:Lo}=cg(Qn.styles,Co),Wo=()=>{Qs(Lo,Xs=>El(Zn,Xs)),fu(Zn,Ro)},jo=zv(Zn),es=nr(jo,Qn.classes),us=nr(Qn.classes,jo),Ps=()=>{od(Zn,us),sp(Zn,es)},er=Xs=>{G1(Zn,Xs)},Bs=()=>{const Xs=Qn.domChildren;PT(Zn,Xs)},Ns=()=>{const Xs=Zn,Hr=Qn.value.getOrUndefined();Hr!==c1(Xs)&&Wv(Xs,Hr??"")};return yo(),Ps(),Wo(),Qn.innerHtml.fold(Bs,er),Ns(),Zn},M2=Qn=>{const Zn=Ds.fromTag(Qn.tag);Qp(Zn,Qn.attributes),od(Zn,Qn.classes),fu(Zn,Qn.styles),Qn.innerHtml.each(Jn=>G1(Zn,Jn));const Yn=Qn.domChildren;return Rm(Zn,Yn),Qn.value.each(Jn=>{Wv(Zn,Jn)}),Zn},N2=(Qn,Zn)=>{try{const Yn=$h(Qn,Zn);return ko.some(Yn)}catch{return ko.none()}},Fb=Qn=>Qn.innerHtml.isSome()&&Qn.domChildren.length>0,Zy=(Qn,Zn)=>{const Yn=oo=>Nd(oo)===Qn.tag&&!Fb(Qn)&&!fC(oo),Jn=Zn.filter(Yn).bind(oo=>N2(Qn,oo)).getOrThunk(()=>M2(Qn));return Dv(Jn,Qn.uid),Jn},jO=Qn=>{const Zn=Rr(Qn,"behaviours").getOr({});return fs(nc(Zn),Yn=>{const Jn=Zn[Yn];return Oo(Jn)?[Jn.me]:[]})},XO=(Qn,Zn)=>bS(Qn,Zn),u1=Qn=>{const Zn=jO(Qn);return XO(Qn,Zn)},Uv=(Qn,Zn,Yn)=>{const Jn=UO(Qn),oo=TT(Qn),lo={"alloy.base.modification":oo},mo=Zn.length>0?a1(Yn,lo,Zn,Jn):oo;return Bm(Jn,mo)},Hb=(Qn,Zn,Yn)=>{const Jn={"alloy.base.behaviour":ZO(Qn)};return WO(Yn,Qn.eventOrder,Zn,Jn).getOrDie()},D0=(Qn,Zn)=>{const Yn=()=>Xs,Jn=Ua(ag),oo=Ec(SS(Qn)),lo=u1(Qn),mo=vS(lo),yo=yS(lo),Co=Uv(oo,mo,yo),Ro=Zy(Co,Zn),Lo=Hb(oo,mo,yo),Wo=Ua(oo.components),jo=Hr=>{Jn.set(Hr)},es=()=>{Jn.set(Ep(Yn))},us=()=>{const Hr=kf(Ro),kr=fs(Hr,Or=>Jn.get().getByDom(Or).fold(()=>[],ra));Wo.set(kr)},Ps=Hr=>{const kr=yo;return(So(kr[Hr.name()])?kr[Hr.name()]:()=>{throw new Error("Could not find "+Hr.name()+" in "+JSON.stringify(Qn,null,2))})()},er=Hr=>So(yo[Hr.name()]),Bs=()=>oo.apis,Ns=Hr=>yo[Hr]().map(kr=>kr.state.readState()).getOr("not enabled"),Xs={uid:Qn.uid,getSystem:Jn.get,config:Ps,hasConfigured:er,spec:Qn,readState:Ns,getApis:Bs,connect:jo,disconnect:es,element:Ro,syncComponents:us,components:Wo.get,events:Lo};return Xs},M0=(Qn,Zn)=>{const Yn=Rr(Qn,"components").getOr([]);return Zn.fold(()=>hs(Yn,gh),Jn=>hs(Yn,(oo,lo)=>YO(oo,Fh(Jn,lo))))},vC=(Qn,Zn)=>{const{events:Yn,...Jn}=HO(Qn),oo=M0(Jn,Zn),lo={...Jn,events:{...P0,...Yn},components:oo};return yl.value(D0(lo,Zn))},wd=Qn=>{const Zn=Ds.fromText(Qn);return yC({element:Zn})},yC=Qn=>{const Zn=td("external.component",mu([Er("element"),Tc("uid")]),Qn),Yn=Ua(Ep()),Jn=yo=>{Yn.set(yo)},oo=()=>{Yn.set(Ep(()=>mo))},lo=Zn.uid.getOrThunk(()=>Mv("external"));Dv(Zn.element,lo);const mo={uid:lo,getSystem:Yn.get,config:ko.none,hasConfigured:sr,connect:Jn,disconnect:oo,getApis:()=>({}),element:Zn.element,spec:Qn,readState:Mo("No state"),syncComponents:xo,components:Mo([]),events:{}};return i1(mo)},Zv=Mv,OC=Qn=>Pl(Qn,"uid"),YO=(Qn,Zn)=>Iv(Qn).getOrThunk(()=>{const Yn=OC(Qn)?Qn:{uid:Zv(""),...Qn};return vC(Yn,Zn).getOrDie()}),gh=Qn=>YO(Qn,ko.none()),Fm=i1;var _C=(Qn,Zn,Yn,Jn,oo)=>Qn(Yn,Jn)?ko.some(Yn):So(oo)&&oo(Yn)?ko.none():Zn(Yn,Jn,oo);const N0=(Qn,Zn,Yn)=>{let Jn=Qn.dom;const oo=So(Yn)?Yn:sr;for(;Jn.parentNode;){Jn=Jn.parentNode;const lo=Ds.fromDom(Jn);if(Zn(lo))return ko.some(lo);if(oo(lo))break}return ko.none()},L0=(Qn,Zn,Yn)=>_C((oo,lo)=>lo(oo),N0,Qn,Zn,Yn),L2=(Qn,Zn)=>{const Yn=oo=>Zn(Ds.fromDom(oo));return Zs(Qn.dom.childNodes,Yn).map(Ds.fromDom)},SC=(Qn,Zn)=>{const Yn=Jn=>{for(let oo=0;ooL0(Qn,Zn,Yn).isSome(),Hm=(Qn,Zn,Yn)=>N0(Qn,Jn=>Cu(Jn,Zn),Yn),GO=(Qn,Zn)=>L2(Qn,Yn=>Cu(Yn,Zn)),Rd=(Qn,Zn)=>qm(Zn,Qn),Bg=(Qn,Zn,Yn)=>_C((oo,lo)=>Cu(oo,lo),Hm,Qn,Zn,Yn),qv="aria-controls",Qb=Qn=>L0(Qn,Yn=>{if(!fc(Yn))return!1;const Jn=Bu(Yn,"id");return Jn!==void 0&&Jn.indexOf(qv)>-1}).bind(Yn=>{const Jn=Bu(Yn,"id"),oo=rr(Yn);return Rd(oo,`[${qv}="${Jn}"]`)}),I0=()=>{const Qn=ba(qv);return{id:Qn,link:Jn=>{aa(Jn,qv,Qn)},unlink:Jn=>{_s(Jn,qv)}}},B0=(Qn,Zn)=>Qb(Zn).exists(Yn=>ob(Qn,Yn)),ob=(Qn,Zn)=>kS(Zn,Yn=>Oc(Yn,Qn.element),sr)||B0(Qn,Zn),wC="unknown";var F0;(function(Qn){Qn[Qn.STOP=0]="STOP",Qn[Qn.NORMAL=1]="NORMAL",Qn[Qn.LOGGING=2]="LOGGING"})(F0||(F0={}));const Vb=Ua({}),zb=(Qn,Zn)=>{const Yn=[],Jn=new Date().getTime();return{logEventCut:(oo,lo,mo)=>{Yn.push({outcome:"cut",target:lo,purpose:mo})},logEventStopped:(oo,lo,mo)=>{Yn.push({outcome:"stopped",target:lo,purpose:mo})},logNoParent:(oo,lo,mo)=>{Yn.push({outcome:"no-parent",target:lo,purpose:mo})},logEventNoHandlers:(oo,lo)=>{Yn.push({outcome:"no-handlers-left",target:lo})},logEventResponse:(oo,lo,mo)=>{Yn.push({outcome:"response",purpose:mo,target:lo})},write:()=>{const oo=new Date().getTime();Fs(["mousemove","mouseover","mouseout",Z1()],Qn)||console.log(Qn,{event:Qn,time:oo-Jn,target:Zn.dom,sequence:hs(Yn,lo=>Fs(["cut","stopped","response"],lo.outcome)?"{"+lo.purpose+"} "+lo.outcome+" at ("+r1(lo.target)+")":lo.outcome)})}}},xS=(Qn,Zn,Yn)=>{switch(Rr(Vb.get(),Qn).orThunk(()=>{const oo=nc(Vb.get());return gc(oo,lo=>Qn.indexOf(lo)>-1?ko.some(Vb.get()[lo]):ko.none())}).getOr(F0.NORMAL)){case F0.NORMAL:return Yn(jv());case F0.LOGGING:{const oo=zb(Qn,Zn),lo=Yn(oo);return oo.write(),lo}case F0.STOP:return!0}},I2=["alloy/data/Fields","alloy/debugging/Debugging"],ES=()=>{const Qn=new Error;if(Qn.stack!==void 0){const Zn=Qn.stack.split(` +`);return Zs(Zn,Yn=>Yn.indexOf("alloy")>0&&!Br(I2,Jn=>Yn.indexOf(Jn)>-1)).getOr(wC)}else return wC},B2={logEventCut:xo,logEventStopped:xo,logNoParent:xo,logEventNoHandlers:xo,logEventResponse:xo,write:xo},KO=(Qn,Zn,Yn)=>xS(Qn,Zn,Yn),jv=Mo(B2),Qm=Mo([Er("menu"),Er("selectedMenu")]),CC=Mo([Er("item"),Er("selectedItem")]);Mo(Ta(CC().concat(Qm())));const Xv=Mo(Ta(CC())),kC=fm("initSize",[Er("numColumns"),Er("numRows")]),F2=()=>Kf("markers",Xv()),qy=()=>fm("markers",[Er("backgroundMenu")].concat(Qm()).concat(CC())),Wb=Qn=>fm("markers",hs(Qn,Er)),JO=(Qn,Zn,Yn)=>(ES(),Bd(Zn,Zn,Yn,Rg(Jn=>yl.value((...oo)=>Jn.apply(void 0,oo))))),rc=Qn=>JO("onHandler",Qn,um(xo)),Vm=Qn=>JO("onKeyboardHandler",Qn,um(ko.none)),Fg=Qn=>JO("onHandler",Qn,sc()),Yv=Qn=>JO("onKeyboardHandler",Qn,sc()),tu=(Qn,Zn)=>pu(Qn,Mo(Zn)),Gv=Qn=>pu(Qn,Go),e_=Mo(kC),Yd=(Qn,Zn,Yn,Jn,oo,lo,mo,yo=!1)=>({x:Qn,y:Zn,bubble:Yn,direction:Jn,placement:oo,restriction:lo,label:`${mo}-${oo}`,alwaysFit:yo}),Hg=Po.generate([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),sb=(Qn,Zn,Yn,Jn,oo,lo,mo,yo,Co)=>Qn.fold(Zn,Yn,Jn,oo,lo,mo,yo,Co),t_=(Qn,Zn,Yn,Jn)=>Qn.fold(Zn,Zn,Jn,Jn,Zn,Jn,Yn,Yn),jy=(Qn,Zn,Yn,Jn)=>Qn.fold(Zn,Jn,Zn,Jn,Yn,Yn,Zn,Jn),Xy=Hg.southeast,TS=Hg.southwest,n_=Hg.northeast,Pp=Hg.northwest,ug=Hg.south,H2=Hg.north,lr=Hg.east,H0=Hg.west,Q0=(Qn,Zn,Yn,Jn)=>{const oo=Qn+Zn;return oo>Jn?Yn:ooMath.min(Math.max(Qn,Zn),Yn),AS=(Qn,Zn)=>{switch(Zn){case 1:return Qn.x;case 0:return Qn.x+Qn.width;case 2:return Qn.y;case 3:return Qn.y+Qn.height}},Uu=(Qn,Zn)=>Kr(["left","right","top","bottom"],Yn=>Rr(Zn,Yn).map(Jn=>AS(Qn,Jn))),o_=(Qn,Zn,Yn)=>{const Jn=(Co,Ro)=>Zn[Co].map(Lo=>{const Wo=Co==="top"||Co==="bottom",jo=Wo?Yn.top:Yn.left,us=(Co==="left"||Co==="top"?Math.max:Math.min)(Lo,Ro)+jo;return Wo?rp(us,Qn.y,Qn.bottom):rp(us,Qn.x,Qn.right)}).getOr(Ro),oo=Jn("left",Qn.x),lo=Jn("top",Qn.y),mo=Jn("right",Qn.right),yo=Jn("bottom",Qn.bottom);return Kc(oo,lo,mo-oo,yo-lo)},rb="layout",PS=Qn=>Qn.x,s_=(Qn,Zn)=>Qn.x+Qn.width/2-Zn.width/2,$S=(Qn,Zn)=>Qn.x+Qn.width-Zn.width,Yy=(Qn,Zn)=>Qn.y-Zn.height,Kv=Qn=>Qn.y+Qn.height,RS=(Qn,Zn)=>Qn.y+Qn.height/2-Zn.height/2,Q2=Qn=>Qn.x+Qn.width,Dd=(Qn,Zn)=>Qn.x-Zn.width,gf=(Qn,Zn,Yn)=>Yd(PS(Qn),Kv(Qn),Yn.southeast(),Xy(),"southeast",Uu(Qn,{left:1,top:3}),rb),eh=(Qn,Zn,Yn)=>Yd($S(Qn,Zn),Kv(Qn),Yn.southwest(),TS(),"southwest",Uu(Qn,{right:0,top:3}),rb),bf=(Qn,Zn,Yn)=>Yd(PS(Qn),Yy(Qn,Zn),Yn.northeast(),n_(),"northeast",Uu(Qn,{left:1,bottom:2}),rb),$l=(Qn,Zn,Yn)=>Yd($S(Qn,Zn),Yy(Qn,Zn),Yn.northwest(),Pp(),"northwest",Uu(Qn,{right:0,bottom:2}),rb),Rh=(Qn,Zn,Yn)=>Yd(s_(Qn,Zn),Yy(Qn,Zn),Yn.north(),H2(),"north",Uu(Qn,{bottom:2}),rb),bu=(Qn,Zn,Yn)=>Yd(s_(Qn,Zn),Kv(Qn),Yn.south(),ug(),"south",Uu(Qn,{top:3}),rb),vf=(Qn,Zn,Yn)=>Yd(Q2(Qn),RS(Qn,Zn),Yn.east(),lr(),"east",Uu(Qn,{left:0}),rb),Gy=(Qn,Zn,Yn)=>Yd(Dd(Qn,Zn),RS(Qn,Zn),Yn.west(),H0(),"west",Uu(Qn,{right:1}),rb),d1=()=>[gf,eh,bf,$l,bu,Rh,vf,Gy],Ky=()=>[eh,gf,$l,bf,bu,Rh,vf,Gy],DS=()=>[bf,$l,gf,eh,Rh,bu],xC=()=>[$l,bf,eh,gf,Rh,bu],r_=()=>[gf,eh,bf,$l,bu,Rh],MS=()=>[eh,gf,$l,bf,bu,Rh],NS=(Qn,Zn)=>Zn.universal?Qn:ga(Qn,Yn=>Fs(Zn.channels,Yn));var f1=Object.freeze({__proto__:null,events:Qn=>Jc([wr(T0(),(Zn,Yn)=>{const Jn=Qn.channels,oo=nc(Jn),lo=Yn,mo=NS(oo,lo);Qs(mo,yo=>{const Co=Jn[yo],Ro=Co.schema,Lo=td("channel["+yo+`] data +Receiver: `+r1(Zn.element),Ro,lo.data);Co.onReceive(Zn,Lo)})})])}),EC=[Kf("channels",Dg(yl.value,mu([Fg("onReceive"),Gs("schema",Ad())])))];const ib=(Qn,Zn,Yn)=>qh(Jn=>{Yn(Jn,Qn,Zn)}),Vd=(Qn,Zn,Yn)=>$v((Jn,oo)=>{Yn(Jn,Qn,Zn)}),yf=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=mu(Qn),yo=hh(Zn,[np("config",Qn)]);return Qg(mo,yo,Zn,Yn,Jn,oo,lo)},z2=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=Qn,yo=hh(Zn,[Fd("config",Qn)]);return Qg(mo,yo,Zn,Yn,Jn,oo,lo)},ym=(Qn,Zn,Yn)=>Nv((oo,...lo)=>{const mo=[oo].concat(lo);return oo.config({name:Mo(Qn)}).fold(()=>{throw new Error("We could not find any behaviour configuration for: "+Qn+". Using API: "+Yn)},yo=>{const Co=Array.prototype.slice.call(mo,1);return Zn.apply(void 0,[oo,yo.config,yo.state].concat(Co))})},Yn,Zn),$T=Qn=>({key:Qn,value:void 0}),Qg=(Qn,Zn,Yn,Jn,oo,lo,mo)=>{const yo=Wo=>Su(Wo,Yn)?Wo[Yn]():ko.none(),Co=Vl(oo,(Wo,jo)=>ym(Yn,Wo,jo)),Lo={...Vl(lo,(Wo,jo)=>QO(Wo,jo)),...Co,revoke:ms($T,Yn),config:Wo=>{const jo=td(Yn+"-config",Qn,Wo);return{key:Yn,value:{config:jo,me:Lo,configAsRaw:Du(()=>td(Yn+"-config",Qn,Wo)),initialConfig:Wo,state:mo}}},schema:Mo(Zn),exhibit:(Wo,jo)=>ia(yo(Wo),Rr(Jn,"exhibit"),(es,us)=>us(jo,es.config,es.state)).getOrThunk(()=>bm({})),name:Mo(Yn),handlers:Wo=>yo(Wo).map(jo=>Rr(Jn,"events").getOr(()=>({}))(jo.config,jo.state)).getOr({})};return Lo},Zr=Qn=>La(Qn),LS=mu([Er("fields"),Er("name"),Gs("active",{}),Gs("apis",{}),Gs("state",Ap),Gs("extra",{})]),Of=Qn=>{const Zn=td("Creating behaviour: "+Qn.name,LS,Qn);return yf(Zn.fields,Zn.name,Zn.active,Zn.apis,Zn.extra,Zn.state)},IS=mu([Er("branchKey"),Er("branches"),Er("name"),Gs("active",{}),Gs("apis",{}),Gs("state",Ap),Gs("extra",{})]),Ub=Qn=>{const Zn=td("Creating behaviour: "+Qn.name,IS,Qn);return z2(jl(Zn.branchKey,Zn.branches),Zn.name,Zn.active,Zn.apis,Zn.extra,Zn.state)},Jy=Mo(void 0),Om=Of({fields:EC,name:"receiving",active:f1});var eO=Object.freeze({__proto__:null,exhibit:(Qn,Zn)=>bm({classes:[],styles:Zn.useFixed()?{}:{position:"relative"}})});const Cd=(Qn,Zn=!1)=>Qn.dom.focus({preventScroll:Zn}),Vg=Qn=>Qn.dom.blur(),tO=Qn=>{const Zn=rr(Qn).dom;return Qn.dom===Zn.activeElement},h1=(Qn=Op())=>ko.from(Qn.dom.activeElement).map(Ds.fromDom),dg=Qn=>h1(rr(Qn)).filter(Zn=>Qn.dom.contains(Zn.dom)),ma=(Qn,Zn)=>{const Yn=rr(Zn),Jn=h1(Yn).bind(lo=>{const mo=yo=>Oc(lo,yo);return mo(Zn)?ko.some(Zn):SC(Zn,mo)}),oo=Qn(Zn);return Jn.each(lo=>{h1(Yn).filter(mo=>Oc(mo,lo)).fold(()=>{Cd(lo)},xo)}),oo},ip=(Qn,Zn,Yn,Jn,oo)=>{const lo=mo=>mo+"px";return{position:Qn,left:Zn.map(lo),top:Yn.map(lo),right:Jn.map(lo),bottom:oo.map(lo)}},BS=Qn=>({...Qn,position:ko.some(Qn.position)}),m1=(Qn,Zn)=>{Lr(Qn,BS(Zn))},Ic=Po.generate([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),FS=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=Zn.rect,yo=mo.x-Yn,Co=mo.y-Jn,Ro=mo.width,Lo=mo.height,Wo=oo-(yo+Ro),jo=lo-(Co+Lo),es=ko.some(yo),us=ko.some(Co),Ps=ko.some(Wo),er=ko.some(jo),Bs=ko.none();return sb(Zn.direction,()=>ip(Qn,es,us,Bs,Bs),()=>ip(Qn,Bs,us,Ps,Bs),()=>ip(Qn,es,Bs,Bs,er),()=>ip(Qn,Bs,Bs,Ps,er),()=>ip(Qn,es,us,Bs,Bs),()=>ip(Qn,es,Bs,Bs,er),()=>ip(Qn,es,us,Bs,Bs),()=>ip(Qn,Bs,us,Ps,Bs))},ap=(Qn,Zn)=>Qn.fold(()=>{const Yn=Zn.rect;return ip("absolute",ko.some(Yn.x),ko.some(Yn.y),ko.none(),ko.none())},(Yn,Jn,oo,lo)=>FS("absolute",Zn,Yn,Jn,oo,lo),(Yn,Jn,oo,lo)=>FS("fixed",Zn,Yn,Jn,oo,lo)),i_=(Qn,Zn)=>{const Yn=ms(Zp,Zn),Jn=Qn.fold(Yn,Yn,()=>{const mo=Af();return Zp(Zn).translate(-mo.left,-mo.top)}),oo=yd(Zn),lo=Vp(Zn);return Kc(Jn.left,Jn.top,oo,lo)},W2=(Qn,Zn)=>Zn.fold(()=>Qn.fold(tf,tf,Kc),Yn=>Qn.fold(Mo(Yn),Mo(Yn),()=>{const Jn=Zu(Qn,Yn.x,Yn.y);return Kc(Jn.left,Jn.top,Yn.width,Yn.height)})),Zu=(Qn,Zn,Yn)=>{const Jn=vc(Zn,Yn),oo=()=>{const lo=Af();return Jn.translate(-lo.left,-lo.top)};return Qn.fold(Mo(Jn),Mo(Jn),oo)},U2=(Qn,Zn,Yn,Jn)=>Qn.fold(Zn,Yn,Jn);Ic.none;const bh=Ic.relative,Zb=Ic.fixed,Z2=(Qn,Zn)=>({anchorBox:Qn,origin:Zn}),q2=(Qn,Zn)=>Z2(Qn,Zn),HS="data-alloy-placement",j2=(Qn,Zn)=>{aa(Qn,HS,Zn)},AC=Qn=>Uo(Qn,HS),PC=Qn=>_s(Qn,HS),nO=Po.generate([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),$C=(Qn,Zn)=>{const{x:Yn,y:Jn,right:oo,bottom:lo}=Zn,{x:mo,y:yo,right:Co,bottom:Ro,width:Lo,height:Wo}=Qn,jo=mo>=Yn&&mo<=oo,es=yo>=Jn&&yo<=lo,us=jo&&es,Ps=Co<=oo&&Co>=Yn,er=Ro<=lo&&Ro>=Jn,Bs=Ps&&er,Ns=Math.min(Lo,mo>=Yn?oo-mo:Co-Yn),Xs=Math.min(Wo,yo>=Jn?lo-yo:Ro-Jn);return{originInBounds:us,sizeInBounds:Bs,visibleW:Ns,visibleH:Xs}},QS=(Qn,Zn)=>{const{x:Yn,y:Jn,right:oo,bottom:lo}=Zn,{x:mo,y:yo,width:Co,height:Ro}=Qn,Lo=Math.max(Yn,oo-Co),Wo=Math.max(Jn,lo-Ro),jo=rp(mo,Yn,Lo),es=rp(yo,Jn,Wo),us=Math.min(jo+Co,oo)-jo,Ps=Math.min(es+Ro,lo)-es;return Kc(jo,es,us,Ps)},V0=(Qn,Zn,Yn)=>{const Jn=Mo(Zn.bottom-Yn.y),oo=Mo(Yn.bottom-Zn.y),lo=t_(Qn,oo,oo,Jn),mo=Mo(Zn.right-Yn.x),yo=Mo(Yn.right-Zn.x);return{maxWidth:jy(Qn,yo,yo,mo),maxHeight:lo}},X2=(Qn,Zn,Yn,Jn)=>{const oo=Qn.bubble,lo=oo.offset,mo=o_(Jn,Qn.restriction,lo),yo=Qn.x+lo.left,Co=Qn.y+lo.top,Ro=Kc(yo,Co,Zn,Yn),{originInBounds:Lo,sizeInBounds:Wo,visibleW:jo,visibleH:es}=$C(Ro,mo),us=Lo&&Wo,Ps=us?Ro:QS(Ro,mo),er=Ps.width>0&&Ps.height>0,{maxWidth:Bs,maxHeight:Ns}=V0(Qn.direction,Ps,Jn),Xs={rect:Ps,maxHeight:Ns,maxWidth:Bs,direction:Qn.direction,placement:Qn.placement,classes:{on:oo.classesOn,off:oo.classesOff},layout:Qn.label,testY:Co};return us||Qn.alwaysFit?nO.fit(Xs):nO.nofit(Xs,jo,es,er)},Y2=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=Jn.width,yo=Jn.height,Co=(Lo,Wo,jo,es,us)=>{const Ps=Lo(Yn,Jn,oo,Qn,lo),er=X2(Ps,mo,yo,lo);return er.fold(Mo(er),(Bs,Ns,Xs,Hr)=>(us===Hr?Xs>es||Ns>jo:!us&&Hr)?er:nO.nofit(Wo,jo,es,us))};return za(Zn,(Lo,Wo)=>{const jo=ms(Co,Wo);return Lo.fold(Mo(Lo),jo)},nO.nofit({rect:Yn,maxHeight:Jn.height,maxWidth:Jn.width,direction:Xy(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:Yn.y},-1,-1,!1)).fold(Go,Go)},VS=Qn=>{const Zn=Ua(ko.none()),Yn=()=>Zn.get().each(Qn);return{clear:()=>{Yn(),Zn.set(ko.none())},isSet:()=>Zn.get().isSome(),get:()=>Zn.get(),set:yo=>{Yn(),Zn.set(ko.some(yo))}}},zS=()=>VS(Qn=>Qn.destroy()),ab=()=>VS(Qn=>Qn.unbind()),Hl=()=>{const Qn=VS(xo);return{...Qn,on:Yn=>Qn.get().each(Yn)}},WS=Js,Dh=(Qn,Zn,Yn)=>Uc(Qn,Zn,WS,Yn),a_=(Qn,Zn,Yn)=>D1(Qn,Zn,WS,Yn),th=zl,_m=["top","bottom","right","left"],l_="data-alloy-transition-timer",RC=(Qn,Zn)=>Df(Qn,Zn.classes),G2=(Qn,Zn,Yn)=>Yn.exists(Jn=>{const oo=Qn.mode;return oo==="all"?!0:Jn[oo]!==Zn[oo]}),DC=(Qn,Zn)=>{const Yn=Jn=>parseFloat(Jn).toFixed(3);return Al(Zn,(Jn,oo)=>{const lo=Qn[oo].map(Yn),mo=Jn.map(Yn);return!Es(lo,mo)}).isSome()},Jv=Qn=>{const Zn=lo=>{const yo=qc(Qn,lo).split(/\s*,\s*/);return ga(yo,Ts)},Yn=lo=>{if(qn(lo)&&/^[\d.]+/.test(lo)){const mo=parseFloat(lo);return ad(lo,"ms")?mo:mo*1e3}else return 0},Jn=Zn("transition-delay"),oo=Zn("transition-duration");return za(oo,(lo,mo,yo)=>{const Co=Yn(Jn[yo])+Yn(mo);return Math.max(lo,Co)},0)},MC=(Qn,Zn)=>{const Yn=ab(),Jn=ab();let oo;const lo=Ro=>{var Lo;const Wo=(Lo=Ro.raw.pseudoElement)!==null&&Lo!==void 0?Lo:"";return Oc(Ro.target,Qn)&&ks(Wo)&&Fs(_m,Ro.raw.propertyName)},mo=Ro=>{if(bo(Ro)||lo(Ro)){Yn.clear(),Jn.clear();const Lo=Ro==null?void 0:Ro.raw.type;(bo(Lo)||Lo===V1())&&(clearTimeout(oo),_s(Qn,l_),sp(Qn,Zn.classes))}},yo=Dh(Qn,By(),Ro=>{lo(Ro)&&(yo.unbind(),Yn.set(Dh(Qn,V1(),mo)),Jn.set(Dh(Qn,lC(),mo)))}),Co=Jv(Qn);requestAnimationFrame(()=>{oo=setTimeout(mo,Co+17),aa(Qn,l_,oo)})},RT=(Qn,Zn)=>{od(Qn,Zn.classes),Uo(Qn,l_).each(Yn=>{clearTimeout(parseInt(Yn,10)),_s(Qn,l_)}),MC(Qn,Zn)},lb=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=G2(Jn,oo,lo);if(mo||RC(Qn,Jn)){ya(Qn,"position",Yn.position);const yo=i_(Zn,Qn),Co=ap(Zn,{...oo,rect:yo}),Ro=Kr(_m,Lo=>Co[Lo]);DC(Yn,Ro)&&(Lr(Qn,Ro),mo&&RT(Qn,Jn),Hf(Qn))}else sp(Qn,Jn.classes)},K2=Qn=>({width:yd(Qn),height:Vp(Qn)}),ey=(Qn,Zn,Yn,Jn)=>{El(Zn,"max-height"),El(Zn,"max-width");const oo=K2(Zn);return Y2(Zn,Jn.preference,Qn,oo,Yn,Jn.bounds)},J2=(Qn,Zn)=>{const Yn=Zn.classes;sp(Qn,Yn.off),od(Qn,Yn.on)},c_=(Qn,Zn,Yn)=>{const Jn=Yn.maxHeightFunction;Jn(Qn,Zn.maxHeight)},US=(Qn,Zn,Yn)=>{const Jn=Yn.maxWidthFunction;Jn(Qn,Zn.maxWidth)},z0=(Qn,Zn,Yn)=>{const Jn=ap(Yn.origin,Zn);Yn.transition.each(oo=>{lb(Qn,Yn.origin,Jn,oo,Zn,Yn.lastPlacement)}),m1(Qn,Jn)},ex=(Qn,Zn)=>{j2(Qn,Zn.placement)},NC=(Qn,Zn)=>{ud(Qn,Math.floor(Zn))},LC=Mo((Qn,Zn)=>{NC(Qn,Zn),fu(Qn,{"overflow-x":"hidden","overflow-y":"auto"})}),zg=Mo((Qn,Zn)=>{NC(Qn,Zn)}),IC=(Qn,Zn,Yn)=>Qn[Zn]===void 0?Yn:Qn[Zn],ZS=(Qn,Zn,Yn,Jn,oo,lo,mo,yo)=>{const Co=IC(mo,"maxHeightFunction",LC()),Ro=IC(mo,"maxWidthFunction",xo),Lo=Qn.anchorBox,Wo=Qn.origin,jo={bounds:W2(Wo,lo),origin:Wo,preference:Jn,maxHeightFunction:Co,maxWidthFunction:Ro,lastPlacement:oo,transition:yo};return tx(Lo,Zn,Yn,jo)},tx=(Qn,Zn,Yn,Jn)=>{const oo=ey(Qn,Zn,Yn,Jn);return z0(Zn,oo,Jn),ex(Zn,oo),J2(Zn,oo),c_(Zn,oo,Jn),US(Zn,oo,Jn),{layout:oo.layout,placement:oo.placement}},BC=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],p1=(Qn,Zn,Yn,Jn=1)=>{const oo=Qn*Jn,lo=Zn*Jn,mo=Co=>Rr(Yn,Co).getOr([]),yo=(Co,Ro,Lo)=>{const Wo=nr(BC,Lo);return{offset:vc(Co,Ro),classesOn:fs(Lo,mo),classesOff:fs(Wo,mo)}};return{southeast:()=>yo(-Qn,Zn,["top","alignLeft"]),southwest:()=>yo(Qn,Zn,["top","alignRight"]),south:()=>yo(-Qn/2,Zn,["top","alignCentre"]),northeast:()=>yo(-Qn,-Zn,["bottom","alignLeft"]),northwest:()=>yo(Qn,-Zn,["bottom","alignRight"]),north:()=>yo(-Qn/2,-Zn,["bottom","alignCentre"]),east:()=>yo(Qn,-Zn/2,["valignCentre","left"]),west:()=>yo(-Qn,-Zn/2,["valignCentre","right"]),insetNortheast:()=>yo(oo,lo,["top","alignLeft","inset"]),insetNorthwest:()=>yo(-oo,lo,["top","alignRight","inset"]),insetNorth:()=>yo(-oo/2,lo,["top","alignCentre","inset"]),insetSoutheast:()=>yo(oo,-lo,["bottom","alignLeft","inset"]),insetSouthwest:()=>yo(-oo,-lo,["bottom","alignRight","inset"]),insetSouth:()=>yo(-oo/2,-lo,["bottom","alignCentre","inset"]),insetEast:()=>yo(-oo,-lo/2,["valignCentre","right","inset"]),insetWest:()=>yo(oo,-lo/2,["valignCentre","left","inset"])}},ty=()=>p1(0,0,{}),ny=Go,u_=(Qn,Zn)=>Yn=>oO(Yn)==="rtl"?Zn:Qn,oO=Qn=>qc(Qn,"direction")==="rtl"?"rtl":"ltr";var $p;(function(Qn){Qn.TopToBottom="toptobottom",Qn.BottomToTop="bottomtotop"})($p||($p={}));const oy="data-alloy-vertical-dir",sO=Qn=>kS(Qn,Zn=>fc(Zn)&&Bu(Zn,"data-alloy-vertical-dir")===$p.BottomToTop),qb=()=>hh("layouts",[Er("onLtr"),Er("onRtl"),Tc("onBottomLtr"),Tc("onBottomRtl")]),d_=(Qn,Zn,Yn,Jn,oo,lo,mo)=>{const yo=mo.map(sO).getOr(!1),Co=Zn.layouts.map(es=>es.onLtr(Qn)),Ro=Zn.layouts.map(es=>es.onRtl(Qn)),Lo=yo?Zn.layouts.bind(es=>es.onBottomLtr.map(us=>us(Qn))).or(Co).getOr(oo):Co.getOr(Yn),Wo=yo?Zn.layouts.bind(es=>es.onBottomRtl.map(us=>us(Qn))).or(Ro).getOr(lo):Ro.getOr(Jn);return u_(Lo,Wo)(Qn)},nx=(Qn,Zn,Yn)=>{const Jn=Zn.hotspot,oo=i_(Yn,Jn.element),lo=d_(Qn.element,Zn,r_(),MS(),DS(),xC(),ko.some(Zn.hotspot.element));return ko.some(ny({anchorBox:oo,bubble:Zn.bubble.getOr(ty()),overrides:Zn.overrides,layouts:lo}))};var ox=[Er("hotspot"),Tc("bubble"),Gs("overrides",{}),qb(),tu("placement",nx)];const FC=(Qn,Zn,Yn)=>{const Jn=Zu(Yn,Zn.x,Zn.y),oo=Kc(Jn.left,Jn.top,Zn.width,Zn.height),lo=d_(Qn.element,Zn,d1(),Ky(),d1(),Ky(),ko.none());return ko.some(ny({anchorBox:oo,bubble:Zn.bubble,overrides:Zn.overrides,layouts:lo}))};var sx=[Er("x"),Er("y"),Gs("height",0),Gs("width",0),Gs("bubble",ty()),Gs("overrides",{}),qb(),tu("placement",FC)];const qS=Po.generate([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),rx=Qn=>Qn.fold(Go,(Zn,Yn,Jn)=>Zn.translate(-Yn,-Jn)),ix=Qn=>Qn.fold(Go,Go),HC=Qn=>za(Qn,(Zn,Yn)=>Zn.translate(Yn.left,Yn.top),vc(0,0)),ax=Qn=>{const Zn=hs(Qn,rx);return HC(Zn)},QC=Qn=>{const Zn=hs(Qn,ix);return HC(Zn)},lx=qS.screen,f_=qS.absolute,cx=(Qn,Zn,Yn)=>{const Jn=Sh(Yn.root).dom,oo=lo=>{const mo=vd(lo),yo=vd(Qn.element);return Oc(mo,yo)};return ko.from(Jn.frameElement).map(Ds.fromDom).filter(oo).map(uh)},VC=(Qn,Zn,Yn)=>{const Jn=vd(Qn.element),oo=Af(Jn),lo=cx(Qn,Zn,Yn).getOr(oo);return f_(lo,oo.left,oo.top)},sy=(Qn,Zn,Yn,Jn)=>{const oo=lx(vc(Qn,Zn));return ko.some(qp(oo,Yn,Jn))},jS=(Qn,Zn,Yn,Jn,oo)=>Qn.map(lo=>{const mo=[Zn,lo.point],yo=U2(Jn,()=>QC(mo),()=>QC(mo),()=>ax(mo)),Co=Ag(yo.left,yo.top,lo.width,lo.height),Ro=Yn.showAbove?DS():r_(),Lo=Yn.showAbove?xC():MS(),Wo=d_(oo,Yn,Ro,Lo,Ro,Lo,ko.none());return ny({anchorBox:Co,bubble:Yn.bubble.getOr(ty()),overrides:Yn.overrides,layouts:Wo})}),XS=(Qn,Zn,Yn)=>{const Jn=VC(Qn,Yn,Zn);return Zn.node.filter(Gl).bind(oo=>{const lo=oo.dom.getBoundingClientRect(),mo=sy(lo.left,lo.top,lo.width,lo.height),yo=Zn.node.getOr(Qn.element);return jS(mo,Jn,Zn,Yn,yo)})};var YS=[Er("node"),Er("root"),Tc("bubble"),qb(),Gs("overrides",{}),Gs("showAbove",!1),tu("placement",XS)];const h_="\uFEFF",m_=" ",p_={create:(Qn,Zn,Yn,Jn)=>({start:Qn,soffset:Zn,finish:Yn,foffset:Jn})},g_=Po.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),ux=(Qn,Zn,Yn,Jn)=>Qn.fold(Zn,Yn,Jn),rO=Qn=>Qn.fold(Go,Go,Go),WC=g_.before,dx=g_.on,GS=g_.after,lp={before:WC,on:dx,after:GS,cata:ux,getStart:rO},jb=Po.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),fx=Qn=>jb.exact(Qn.start,Qn.soffset,Qn.finish,Qn.foffset),KS=Qn=>Qn.match({domRange:Zn=>Ds.fromDom(Zn.startContainer),relative:(Zn,Yn)=>lp.getStart(Zn),exact:(Zn,Yn,Jn,oo)=>Zn}),hx=jb.domRange,mx=jb.relative,JS=jb.exact,UC=Qn=>{const Zn=KS(Qn);return Sh(Zn)},ew=p_.create,Zf={domRange:hx,relative:mx,exact:JS,exactFromRange:fx,getWin:UC,range:ew},DT=(Qn,Zn)=>{Zn.fold(Yn=>{Qn.setStartBefore(Yn.dom)},(Yn,Jn)=>{Qn.setStart(Yn.dom,Jn)},Yn=>{Qn.setStartAfter(Yn.dom)})},ry=(Qn,Zn)=>{Zn.fold(Yn=>{Qn.setEndBefore(Yn.dom)},(Yn,Jn)=>{Qn.setEnd(Yn.dom,Jn)},Yn=>{Qn.setEndAfter(Yn.dom)})},b_=(Qn,Zn,Yn)=>{const Jn=Qn.document.createRange();return DT(Jn,Zn),ry(Jn,Yn),Jn},tw=(Qn,Zn,Yn,Jn,oo)=>{const lo=Qn.document.createRange();return lo.setStart(Zn.dom,Yn),lo.setEnd(Jn.dom,oo),lo},nw=Qn=>({left:Qn.left,top:Qn.top,right:Qn.right,bottom:Qn.bottom,width:Qn.width,height:Qn.height}),ZC=Qn=>{const Zn=Qn.getClientRects(),Yn=Zn.length>0?Zn[0]:Qn.getBoundingClientRect();return Yn.width>0||Yn.height>0?ko.some(Yn).map(nw):ko.none()},qC=Qn=>{const Zn=Qn.getBoundingClientRect();return Zn.width>0||Zn.height>0?ko.some(Zn).map(nw):ko.none()},cb=Po.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),W0=(Qn,Zn,Yn)=>Zn(Ds.fromDom(Yn.startContainer),Yn.startOffset,Ds.fromDom(Yn.endContainer),Yn.endOffset),px=(Qn,Zn)=>Zn.match({domRange:Yn=>({ltr:Mo(Yn),rtl:ko.none}),relative:(Yn,Jn)=>({ltr:Du(()=>b_(Qn,Yn,Jn)),rtl:Du(()=>ko.some(b_(Qn,Jn,Yn)))}),exact:(Yn,Jn,oo,lo)=>({ltr:Du(()=>tw(Qn,Yn,Jn,oo,lo)),rtl:Du(()=>ko.some(tw(Qn,oo,lo,Yn,Jn)))})}),gx=(Qn,Zn)=>{const Yn=Zn.ltr();return Yn.collapsed?Zn.rtl().filter(oo=>oo.collapsed===!1).map(oo=>cb.rtl(Ds.fromDom(oo.endContainer),oo.endOffset,Ds.fromDom(oo.startContainer),oo.startOffset)).getOrThunk(()=>W0(Qn,cb.ltr,Yn)):W0(Qn,cb.ltr,Yn)},iO=(Qn,Zn)=>{const Yn=px(Qn,Zn);return gx(Qn,Yn)},ow=(Qn,Zn)=>iO(Qn,Zn).match({ltr:(Jn,oo,lo,mo)=>{const yo=Qn.document.createRange();return yo.setStart(Jn.dom,oo),yo.setEnd(lo.dom,mo),yo},rtl:(Jn,oo,lo,mo)=>{const yo=Qn.document.createRange();return yo.setStart(lo.dom,mo),yo.setEnd(Jn.dom,oo),yo}});cb.ltr,cb.rtl;const jC=(Qn,Zn,Yn)=>ga(Bp(Qn,Yn),Zn),_f=(Qn,Zn)=>Cf(Zn,Qn),XC=(Qn,Zn,Yn,Jn)=>{const lo=vd(Qn).dom.createRange();return lo.setStart(Qn.dom,Zn),lo.setEnd(Yn.dom,Jn),lo},sw=(Qn,Zn,Yn,Jn)=>{const oo=XC(Qn,Zn,Yn,Jn),lo=Oc(Qn,Yn)&&Zn===Jn;return oo.collapsed&&!lo},MT=Qn=>ko.from(Qn.getSelection()),iy=Qn=>{if(Qn.rangeCount>0){const Zn=Qn.getRangeAt(0),Yn=Qn.getRangeAt(Qn.rangeCount-1);return ko.some(p_.create(Ds.fromDom(Zn.startContainer),Zn.startOffset,Ds.fromDom(Yn.endContainer),Yn.endOffset))}else return ko.none()},bx=Qn=>{if(Qn.anchorNode===null||Qn.focusNode===null)return iy(Qn);{const Zn=Ds.fromDom(Qn.anchorNode),Yn=Ds.fromDom(Qn.focusNode);return sw(Zn,Qn.anchorOffset,Yn,Qn.focusOffset)?ko.some(p_.create(Zn,Qn.anchorOffset,Yn,Qn.focusOffset)):iy(Qn)}},YC=Qn=>MT(Qn).filter(Zn=>Zn.rangeCount>0).bind(bx),rw=(Qn,Zn)=>{const Yn=ow(Qn,Zn);return ZC(Yn)},aO=(Qn,Zn)=>{const Yn=ow(Qn,Zn);return qC(Yn)},ay=((Qn,Zn)=>{const Yn=lo=>{if(!Qn(lo))throw new Error("Can only get "+Zn+" value of a "+Zn+" node");return Jn(lo).getOr("")},Jn=lo=>Qn(lo)?ko.from(lo.dom.nodeValue):ko.none();return{get:Yn,getOption:Jn,set:(lo,mo)=>{if(!Qn(lo))throw new Error("Can only set raw "+Zn+" value of a "+Zn+" node");lo.dom.nodeValue=mo}}})(Td,"text"),vx=Qn=>ay.get(Qn),Xb=(Qn,Zn)=>({element:Qn,offset:Zn}),GC=(Qn,Zn)=>{const Yn=kf(Qn);if(Yn.length===0)return Xb(Qn,Zn);if(ZnTd(Qn)?Xb(Qn,Zn):GC(Qn,Zn),Gb=Qn=>Qn.foffset!==void 0,so=(Qn,Zn)=>Zn.getSelection.getOrThunk(()=>()=>YC(Qn))().map(Jn=>{if(Gb(Jn)){const oo=Yb(Jn.start,Jn.soffset),lo=Yb(Jn.finish,Jn.foffset);return Zf.range(oo.element,oo.offset,lo.element,lo.offset)}else return Jn}),co=(Qn,Zn,Yn)=>{const Jn=Sh(Zn.root).dom,oo=VC(Qn,Yn,Zn),lo=so(Jn,Zn).bind(Co=>{if(Gb(Co))return aO(Jn,Zf.exactFromRange(Co)).orThunk(()=>{const Lo=Ds.fromText(h_);_d(Co.start,Lo);const Wo=rw(Jn,Zf.exact(Lo,0,Lo,1));return am(Lo),Wo}).bind(Lo=>sy(Lo.left,Lo.top,Lo.width,Lo.height));{const Ro=Vl(Co,Wo=>Wo.dom.getBoundingClientRect()),Lo={left:Math.min(Ro.firstCell.left,Ro.lastCell.left),right:Math.max(Ro.firstCell.right,Ro.lastCell.right),top:Math.min(Ro.firstCell.top,Ro.lastCell.top),bottom:Math.max(Ro.firstCell.bottom,Ro.lastCell.bottom)};return sy(Lo.left,Lo.top,Lo.right-Lo.left,Lo.bottom-Lo.top)}}),yo=so(Jn,Zn).bind(Co=>Gb(Co)?fc(Co.start)?ko.some(Co.start):lh(Co.start):ko.some(Co.firstCell)).getOr(Qn.element);return jS(lo,oo,Zn,Yn,yo)};var wo=[Tc("getSelection"),Er("root"),Tc("bubble"),qb(),Gs("overrides",{}),Gs("showAbove",!1),tu("placement",co)];const Ho="link-layout",ts=Qn=>Qn.x+Qn.width,Os=(Qn,Zn)=>Qn.x-Zn.width,Is=(Qn,Zn)=>Qn.y-Zn.height+Qn.height,qs=Qn=>Qn.y,mr=(Qn,Zn,Yn)=>Yd(ts(Qn),qs(Qn),Yn.southeast(),Xy(),"southeast",Uu(Qn,{left:0,top:2}),Ho),Xr=(Qn,Zn,Yn)=>Yd(Os(Qn,Zn),qs(Qn),Yn.southwest(),TS(),"southwest",Uu(Qn,{right:1,top:2}),Ho),jr=(Qn,Zn,Yn)=>Yd(ts(Qn),Is(Qn,Zn),Yn.northeast(),n_(),"northeast",Uu(Qn,{left:0,bottom:3}),Ho),ua=(Qn,Zn,Yn)=>Yd(Os(Qn,Zn),Is(Qn,Zn),Yn.northwest(),Pp(),"northwest",Uu(Qn,{right:1,bottom:3}),Ho),ja=()=>[mr,Xr,jr,ua],wl=()=>[Xr,mr,ua,jr],Kl=(Qn,Zn,Yn)=>{const Jn=i_(Yn,Zn.item.element),oo=d_(Qn.element,Zn,ja(),wl(),ja(),wl(),ko.none());return ko.some(ny({anchorBox:Jn,bubble:ty(),overrides:Zn.overrides,layouts:oo}))};var Pc=[Er("item"),qb(),Gs("overrides",{}),tu("placement",Kl)],Ul=jl("type",{selection:wo,node:YS,hotspot:ox,submenu:Pc,makeshift:sx});const nu=[Pf("classes",nf),Eh("mode","all",["all","layout","placement"])],vu=[Gs("useFixed",sr),Tc("getBounds")],nh=[Kf("anchor",Ul),hh("transition",nu)],Mh=()=>{const Qn=document.documentElement;return Zb(0,0,Qn.clientWidth,Qn.clientHeight)},Rp=Qn=>{const Zn=uh(Qn.element),Yn=Qn.element.dom.getBoundingClientRect();return bh(Zn.left,Zn.top,Yn.width,Yn.height)},Mf=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=q2(Zn.anchorBox,Qn);return ZS(mo,Jn.element,Zn.bubble,Zn.layouts,oo,Yn,Zn.overrides,lo)},Dp=(Qn,Zn,Yn,Jn,oo)=>{const lo=ko.none();Tu(Qn,Zn,Yn,Jn,oo,lo)},Tu=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=td("placement.info",Ta(nh),oo),yo=mo.anchor,Co=Jn.element,Ro=Yn.get(Jn.uid);ma(()=>{ya(Co,"position","fixed");const Lo=ku(Co,"visibility");ya(Co,"visibility","hidden");const Wo=Zn.useFixed()?Mh():Rp(Qn);yo.placement(Qn,yo,Wo).each(jo=>{const es=lo.orThunk(()=>Zn.getBounds.map(Ys)),us=Mf(Wo,jo,es,Jn,Ro,mo.transition);Yn.set(Jn.uid,us)}),Lo.fold(()=>{El(Co,"visibility")},jo=>{ya(Co,"visibility",jo)}),ku(Co,"left").isNone()&&ku(Co,"top").isNone()&&ku(Co,"right").isNone()&&ku(Co,"bottom").isNone()&&vs(ku(Co,"position"),"fixed")&&El(Co,"position")},Co)};var NT=Object.freeze({__proto__:null,position:Dp,positionWithinBounds:Tu,getMode:(Qn,Zn,Yn)=>Zn.useFixed()?"fixed":"absolute",reset:(Qn,Zn,Yn,Jn)=>{const oo=Jn.element;Qs(["position","left","right","top","bottom"],lo=>El(oo,lo)),PC(oo),Yn.clear(Jn.uid)}}),ly=Object.freeze({__proto__:null,init:()=>{let Qn={};return ph({readState:()=>Qn,clear:oo=>{Oo(oo)?delete Qn[oo]:Qn={}},set:(oo,lo)=>{Qn[oo]=lo},get:oo=>Rr(Qn,oo)})}});const jh=Of({fields:vu,name:"positioning",active:eO,apis:NT,state:ly}),y_=Qn=>Qn.getSystem().isConnected(),iw=Qn=>{Wl(Qn,xp());const Zn=Qn.components();Qs(Zn,iw)},O_=Qn=>{const Zn=Qn.components();Qs(Zn,O_),Wl(Qn,Zh())},Ox=(Qn,Zn)=>{Qn.getSystem().addToWorld(Zn),Gl(Qn.element)&&O_(Zn)},__=Qn=>{iw(Qn),Qn.getSystem().removeFromWorld(Qn)},lO=(Qn,Zn)=>{Id(Qn.element,Zn.element)},ub=Qn=>{Qs(Qn.components(),Zn=>am(Zn.element)),iu(Qn.element),Qn.syncComponents()},h3=(Qn,Zn,Yn)=>{const Jn=Qn.components();ub(Qn);const oo=Yn(Zn),lo=nr(Jn,oo);Qs(lo,mo=>{iw(mo),Qn.getSystem().removeFromWorld(mo)}),Qs(oo,mo=>{y_(mo)?lO(Qn,mo):(Qn.getSystem().addToWorld(mo),lO(Qn,mo),Gl(Qn.element)&&O_(mo))}),Qn.syncComponents()},m3=(Qn,Zn,Yn)=>{const Jn=Qn.components(),oo=fs(Zn,yo=>Iv(yo).toArray());Qs(Jn,yo=>{Fs(oo,yo)||__(yo)});const lo=Yn(Zn),mo=nr(Jn,lo);Qs(mo,yo=>{y_(yo)&&__(yo)}),Qs(lo,yo=>{y_(yo)||Ox(Qn,yo)}),Qn.syncComponents()},cy=(Qn,Zn)=>{S_(Qn,Zn,Id)},S_=(Qn,Zn,Yn)=>{Qn.getSystem().addToWorld(Zn),Yn(Qn.element,Zn.element),Gl(Qn.element)&&O_(Zn),Qn.syncComponents()},JC=Qn=>{iw(Qn),am(Qn.element),Qn.getSystem().removeFromWorld(Qn)},Kb=Qn=>{const Zn=Zd(Qn.element).bind(Yn=>Qn.getSystem().getByDom(Yn).toOptional());JC(Qn),Zn.each(Yn=>{Yn.syncComponents()})},_x=Qn=>{const Zn=Qn.components();Qs(Zn,JC),iu(Qn.element),Qn.syncComponents()},vh=(Qn,Zn)=>{g1(Qn,Zn,Id)},Z0=(Qn,Zn)=>{g1(Qn,Zn,Wh)},g1=(Qn,Zn,Yn)=>{Yn(Qn,Zn.element);const Jn=kf(Zn.element);Qs(Jn,oo=>{Zn.getByDom(oo).each(O_)})},w_=Qn=>{const Zn=kf(Qn.element);Qs(Zn,Yn=>{Qn.getByDom(Yn).each(iw)}),am(Qn.element)},Sm=(Qn,Zn,Yn,Jn)=>{Yn.get().each(mo=>{_x(Qn)});const oo=Zn.getAttachPoint(Qn);cy(oo,Qn);const lo=Qn.getSystem().build(Jn);return cy(Qn,lo),Yn.set(lo),lo},cp=(Qn,Zn,Yn,Jn)=>{const oo=Sm(Qn,Zn,Yn,Jn);return Zn.onOpen(Qn,oo),oo},zm=(Qn,Zn,Yn,Jn)=>Yn.get().map(()=>Sm(Qn,Zn,Yn,Jn)),b1=(Qn,Zn,Yn,Jn,oo)=>{aw(Qn,Zn),cp(Qn,Zn,Yn,Jn),oo(),lw(Qn,Zn)},ek=(Qn,Zn,Yn)=>{Yn.get().each(Jn=>{_x(Qn),Kb(Qn),Zn.onClose(Qn,Jn),Yn.clear()})},fg=(Qn,Zn,Yn)=>Yn.isOpen(),cO=(Qn,Zn,Yn,Jn)=>fg(Qn,Zn,Yn)&&Yn.get().exists(oo=>Zn.isPartOf(Qn,oo,Jn)),Sx=(Qn,Zn,Yn)=>Yn.get(),p3=(Qn,Zn,Yn,Jn)=>{ku(Qn.element,Zn).fold(()=>{_s(Qn.element,Yn)},oo=>{aa(Qn.element,Yn,oo)}),ya(Qn.element,Zn,Jn)},LT=(Qn,Zn,Yn)=>{Uo(Qn.element,Yn).fold(()=>El(Qn.element,Zn),Jn=>ya(Qn.element,Zn,Jn))},aw=(Qn,Zn,Yn)=>{const Jn=Zn.getAttachPoint(Qn);ya(Qn.element,"position",jh.getMode(Jn)),p3(Qn,"visibility",Zn.cloakVisibilityAttr,"hidden")},IT=Qn=>Br(["top","left","right","bottom"],Zn=>ku(Qn,Zn).isSome()),lw=(Qn,Zn,Yn)=>{IT(Qn.element)||El(Qn.element,"position"),LT(Qn,"visibility",Zn.cloakVisibilityAttr)};var tk=Object.freeze({__proto__:null,cloak:aw,decloak:lw,open:cp,openWhileCloaked:b1,close:ek,isOpen:fg,isPartOf:cO,getState:Sx,setContent:zm}),BT=Object.freeze({__proto__:null,events:(Qn,Zn)=>Jc([wr(Fy(),(Yn,Jn)=>{ek(Yn,Qn,Zn)})])}),b3=[rc("onOpen"),rc("onClose"),Er("isPartOf"),Er("getAttachPoint"),Gs("cloakVisibilityAttr","data-precloak-visibility")],FT=Object.freeze({__proto__:null,init:()=>{const Qn=Hl(),Zn=Mo("not-implemented");return ph({readState:Zn,isOpen:Qn.isSet,clear:Qn.clear,set:Qn.set,get:Qn.get})}});const uc=Of({fields:b3,name:"sandboxing",active:BT,apis:tk,state:FT}),db=Mo("dismiss.popups"),uO=Mo("reposition.popups"),wx=Mo("mouse.released"),HT=mu([Gs("isExtraPart",sr),hh("fireEventInstead",[Gs("event",q1())])]),cw=Qn=>{const Zn=td("Dismissal",HT,Qn);return{[db()]:{schema:mu([Er("target")]),onReceive:(Yn,Jn)=>{uc.isOpen(Yn)&&(uc.isPartOf(Yn,Jn.target)||Zn.isExtraPart(Yn,Jn.target)||Zn.fireEventInstead.fold(()=>uc.close(Yn),lo=>Wl(Yn,lo.event)))}}}},v3=mu([hh("fireEventInstead",[Gs("event",hS())]),ep("doReposition")]),C_=Qn=>{const Zn=td("Reposition",v3,Qn);return{[uO()]:{onReceive:Yn=>{uc.isOpen(Yn)&&Zn.fireEventInstead.fold(()=>Zn.doReposition(Yn),Jn=>Wl(Yn,Jn.event))}}}},nk=(Qn,Zn,Yn)=>{Zn.store.manager.onLoad(Qn,Zn,Yn)},hg=(Qn,Zn,Yn)=>{Zn.store.manager.onUnload(Qn,Zn,Yn)};var uy=Object.freeze({__proto__:null,onLoad:nk,onUnload:hg,setValue:(Qn,Zn,Yn,Jn)=>{Zn.store.manager.setValue(Qn,Zn,Yn,Jn)},getValue:(Qn,Zn,Yn)=>Zn.store.manager.getValue(Qn,Zn,Yn),getState:(Qn,Zn,Yn)=>Yn}),rk=Object.freeze({__proto__:null,events:(Qn,Zn)=>{const Yn=Qn.resetOnDom?[eu((Jn,oo)=>{nk(Jn,Qn,Zn)}),ig((Jn,oo)=>{hg(Jn,Qn,Zn)})]:[Vd(Qn,Zn,nk)];return Jc(Yn)}});const dO=()=>{const Qn=Ua(null),Zn=()=>({mode:"memory",value:Qn.get()}),Yn=()=>Qn.get()===null,Jn=()=>{Qn.set(null)};return ph({set:Qn.set,get:Qn.get,isNotSet:Yn,clear:Jn,readState:Zn})},y3=()=>ph({readState:xo}),QT=()=>{const Qn=Ua({}),Zn=Ua({});return ph({readState:()=>({mode:"dataset",dataByValue:Qn.get(),dataByText:Zn.get()}),lookup:mo=>Rr(Qn.get(),mo).orThunk(()=>Rr(Zn.get(),mo)),update:mo=>{const yo=Qn.get(),Co=Zn.get(),Ro={},Lo={};Qs(mo,Wo=>{Ro[Wo.value]=Wo,Rr(Wo,"meta").each(jo=>{Rr(jo,"text").each(es=>{Lo[es]=Wo})})}),Qn.set({...yo,...Ro}),Zn.set({...Co,...Lo})},clear:()=>{Qn.set({}),Zn.set({})}})};var x_=Object.freeze({__proto__:null,memory:dO,dataset:QT,manual:y3,init:Qn=>Qn.store.manager.state(Qn)});const q0=(Qn,Zn,Yn,Jn)=>{const oo=Zn.store;Yn.update([Jn]),oo.setValue(Qn,Jn),Zn.onSetValue(Qn,Jn)},_3=(Qn,Zn,Yn)=>{const Jn=Zn.store,oo=Jn.getDataKey(Qn);return Yn.lookup(oo).getOrThunk(()=>Jn.getFallbackEntry(oo))},S3=(Qn,Zn,Yn)=>{Zn.store.initialValue.each(oo=>{q0(Qn,Zn,Yn,oo)})},VT=(Qn,Zn,Yn)=>{Yn.clear()};var Cx=[Tc("initialValue"),Er("getFallbackEntry"),Er("getDataKey"),Er("setValue"),tu("manager",{setValue:q0,getValue:_3,onLoad:S3,onUnload:VT,state:QT})];const kx=(Qn,Zn,Yn)=>Zn.store.getValue(Qn),xx=(Qn,Zn,Yn,Jn)=>{Zn.store.setValue(Qn,Jn),Zn.onSetValue(Qn,Jn)},ik=(Qn,Zn,Yn)=>{Zn.store.initialValue.each(Jn=>{Zn.store.setValue(Qn,Jn)})};var dy=[Er("getValue"),Gs("setValue",xo),Tc("initialValue"),tu("manager",{setValue:xx,getValue:kx,onLoad:ik,onUnload:xo,state:Ap.init})];const zT=(Qn,Zn,Yn,Jn)=>{Yn.set(Jn),Zn.onSetValue(Qn,Jn)},uw=(Qn,Zn,Yn)=>Yn.get(),Ex=(Qn,Zn,Yn)=>{Zn.store.initialValue.each(Jn=>{Yn.isNotSet()&&Yn.set(Jn)})},w3=(Qn,Zn,Yn)=>{Yn.clear()};var dw=[Tc("initialValue"),tu("manager",{setValue:zT,getValue:uw,onLoad:Ex,onUnload:w3,state:dO})],C3=[xh("store",{mode:"memory"},jl("mode",{memory:dw,manual:dy,dataset:Cx})),rc("onSetValue"),Gs("resetOnDom",!1)];const da=Of({fields:C3,name:"representing",active:rk,apis:uy,extra:{setValueFrom:(Qn,Zn)=>{const Yn=da.getValue(Zn);da.setValue(Qn,Yn)}},state:x_}),Nf=(Qn,Zn)=>Kp(Qn,{},hs(Zn,Yn=>tp(Yn.name(),"Cannot configure "+Yn.name()+" for "+Qn)).concat([pu("dump",Go)])),j0=Qn=>Qn.dump,sf=(Qn,Zn)=>({...Zr(Zn),...Qn.dump}),Wg={field:Nf,augment:sf,get:j0},ak="placeholder",fw=Po.generate([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),fb=Qn=>Pl(Qn,"uiType"),lk=(Qn,Zn,Yn,Jn)=>Qn.exists(oo=>oo!==Yn.owner)?fw.single(!0,Mo(Yn)):Rr(Jn,Yn.name).fold(()=>{throw new Error("Unknown placeholder component: "+Yn.name+` +Known: [`+nc(Jn)+`] +Namespace: `+Qn.getOr("none")+` +Spec: `+JSON.stringify(Yn,null,2))},oo=>oo.replace()),ck=(Qn,Zn,Yn,Jn)=>fb(Yn)&&Yn.uiType===ak?lk(Qn,Zn,Yn,Jn):fw.single(!1,Mo(Yn)),E_=(Qn,Zn,Yn,Jn)=>ck(Qn,Zn,Yn,Jn).fold((lo,mo)=>{const yo=fb(Yn)?mo(Zn,Yn.config,Yn.validated):mo(Zn),Co=Rr(yo,"components").getOr([]),Ro=fs(Co,Lo=>E_(Qn,Zn,Lo,Jn));return[{...yo,components:Ro}]},(lo,mo)=>{if(fb(Yn)){const yo=mo(Zn,Yn.config,Yn.validated);return Yn.validated.preprocess.getOr(Go)(yo)}else return mo(Zn)}),WT=(Qn,Zn,Yn,Jn)=>fs(Yn,oo=>E_(Qn,Zn,oo,Jn)),hw=(Qn,Zn)=>{let Yn=!1;const Jn=()=>Yn,oo=()=>{if(Yn)throw new Error("Trying to use the same placeholder more than once: "+Qn);return Yn=!0,Zn},lo=()=>Zn.fold((mo,yo)=>mo,(mo,yo)=>mo);return{name:Mo(Qn),required:lo,used:Jn,replace:oo}},Tx=(Qn,Zn,Yn,Jn)=>{const oo=Vl(Jn,(mo,yo)=>hw(yo,mo)),lo=WT(Qn,Zn,Yn,oo);return Zl(oo,mo=>{if(mo.used()===!1&&mo.required())throw new Error("Placeholder: "+mo.name()+` was not found in components list +Namespace: `+Qn.getOr("none")+` +Components: `+JSON.stringify(Zn.components,null,2))}),lo},Ax=fw.single,k3=fw.multiple,hb=Mo(ak),uk=Po.generate([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),T_=Gs("factory",{sketch:Go}),Nh=Gs("schema",[]),Sf=Er("name"),dk=Bd("pname","pname",hf(Qn=>""),Ad()),mw=pu("schema",()=>[Tc("preprocess")]),fk=Gs("defaults",Mo({})),pw=Gs("overrides",Mo({})),gw=Ta([T_,Nh,Sf,dk,fk,pw]),A_=Ta([T_,Nh,Sf,fk,pw]),UT=Ta([T_,Nh,Sf,dk,fk,pw]),bw=Ta([T_,mw,Sf,Er("unit"),dk,fk,pw]),ZT=Qn=>Qn.fold(ko.some,ko.none,ko.some,ko.some),qT=Qn=>{const Zn=Yn=>Yn.name;return Qn.fold(Zn,Zn,Zn,Zn)},jT=Qn=>Qn.fold(Go,Go,Go,Go),Ug=(Qn,Zn)=>Yn=>{const Jn=td("Converting part type",Zn,Yn);return Qn(Jn)},Xh=Ug(uk.required,gw),v1=Ug(uk.external,A_),up=Ug(uk.optional,UT),vw=Ug(uk.group,bw),hk=Mo("entirety");var XT=Object.freeze({__proto__:null,required:Xh,external:v1,optional:up,group:vw,asNamedPart:ZT,name:qT,asCommon:jT,original:hk});const yw=(Qn,Zn,Yn,Jn)=>Lc(Zn.defaults(Qn,Yn,Jn),Yn,{uid:Qn.partUids[Zn.name]},Zn.overrides(Qn,Yn,Jn)),x3=(Qn,Zn,Yn)=>{const Jn={},oo={};return Qs(Yn,lo=>{lo.fold(mo=>{Jn[mo.pname]=Ax(!0,(yo,Co,Ro)=>mo.factory.sketch(yw(yo,mo,Co,Ro)))},mo=>{const yo=Zn.parts[mo.name];oo[mo.name]=Mo(mo.factory.sketch(yw(Zn,mo,yo[hk()]),yo))},mo=>{Jn[mo.pname]=Ax(!1,(yo,Co,Ro)=>mo.factory.sketch(yw(yo,mo,Co,Ro)))},mo=>{Jn[mo.pname]=k3(!0,(yo,Co,Ro)=>{const Lo=yo[mo.name];return hs(Lo,Wo=>mo.factory.sketch(Lc(mo.defaults(yo,Wo,Ro),Wo,mo.overrides(yo,Wo))))})})}),{internals:Mo(Jn),externals:Mo(oo)}},X0=(Qn,Zn)=>{const Yn={};return Qs(Zn,Jn=>{ZT(Jn).each(oo=>{const lo=Ow(Qn,oo.pname);Yn[oo.name]=mo=>{const yo=td("Part: "+oo.name+" in "+Qn,Ta(oo.schema),mo);return{...lo,config:mo,validated:yo}}})}),Yn},Ow=(Qn,Zn)=>({uiType:hb(),owner:Qn,name:Zn}),Px=(Qn,Zn,Yn)=>({uiType:hb(),owner:Qn,name:Zn,config:Yn,validated:{}}),YT=Qn=>fs(Qn,Zn=>Zn.fold(ko.none,ko.some,ko.none,ko.none).map(Yn=>fm(Yn.name,Yn.schema.concat([Gv(hk())]))).toArray()),GT=Qn=>hs(Qn,qT),$x=(Qn,Zn,Yn)=>x3(Qn,Zn,Yn),mk=(Qn,Zn,Yn)=>Tx(ko.some(Qn),Zn,Zn.components,Yn),Au=(Qn,Zn,Yn)=>{const Jn=Zn.partUids[Yn];return Qn.getSystem().getByUid(Jn).toOptional()},Y0=(Qn,Zn,Yn)=>Au(Qn,Zn,Yn).getOrDie("Could not find part: "+Yn),KT=(Qn,Zn,Yn)=>{const Jn={},oo=Zn.partUids,lo=Qn.getSystem();return Qs(Yn,mo=>{Jn[mo]=Mo(lo.getByUid(oo[mo]))}),Jn},Rx=(Qn,Zn)=>{const Yn=Qn.getSystem();return Vl(Zn.partUids,(Jn,oo)=>Mo(Yn.getByUid(Jn)))},Dx=Qn=>nc(Qn.partUids),fO=(Qn,Zn,Yn)=>{const Jn={},oo=Zn.partUids,lo=Qn.getSystem();return Qs(Yn,mo=>{Jn[mo]=Mo(lo.getByUid(oo[mo]).getOrDie())}),Jn},Mx=(Qn,Zn)=>{const Yn=GT(Zn);return La(hs(Yn,Jn=>({key:Jn,value:Qn+"-"+Jn})))},Nx=Qn=>Bd("partUids","partUids",ss(Zn=>Mx(Zn.uid,Qn)),Ad());var E3=Object.freeze({__proto__:null,generate:X0,generateOne:Px,schemas:YT,names:GT,substitutes:$x,components:mk,defaultUids:Mx,defaultUidsSchema:Nx,getAllParts:Rx,getAllPartNames:Dx,getPart:Au,getPartOrDie:Y0,getParts:KT,getPartsOrDie:fO});const P_=(Qn,Zn)=>(Qn.length>0?[fm("parts",Qn)]:[]).concat([Er("uid"),Gs("dom",{}),Gs("components",[]),Gv("originalSpec"),Gs("debug.sketcher",{})]).concat(Zn),$_=(Qn,Zn,Yn,Jn,oo)=>{const lo=P_(Jn,oo);return td(Qn+" [SpecSchema]",mu(lo.concat(Zn)),Yn)},Lx=(Qn,Zn,Yn,Jn)=>{const oo=fy(Jn),lo=$_(Qn,Zn,oo,[],[]);return Yn(lo,oo)},Ix=(Qn,Zn,Yn,Jn,oo)=>{const lo=fy(oo),mo=YT(Yn),yo=Nx(Yn),Co=$_(Qn,Zn,lo,mo,[yo]),Ro=$x(Qn,Co,Yn),Lo=mk(Qn,Co,Ro.internals());return Jn(Co,Lo,lo,Ro.externals())},y1=Qn=>Pl(Qn,"uid"),fy=Qn=>y1(Qn)?Qn:{...Qn,uid:Mv("uid")},T3=Qn=>Qn.uid!==void 0,_w=mu([Er("name"),Er("factory"),Er("configFields"),Gs("apis",{}),Gs("extraApis",{})]),A3=mu([Er("name"),Er("factory"),Er("configFields"),Er("partFields"),Gs("apis",{}),Gs("extraApis",{})]),Mp=Qn=>{const Zn=td("Sketcher for "+Qn.name,_w,Qn),Yn=lo=>Lx(Zn.name,Zn.configFields,Zn.factory,lo),Jn=Vl(Zn.apis,eb),oo=Vl(Zn.extraApis,(lo,mo)=>QO(lo,mo));return{name:Zn.name,configFields:Zn.configFields,sketch:Yn,...Jn,...oo}},Yh=Qn=>{const Zn=td("Sketcher for "+Qn.name,A3,Qn),Yn=mo=>Ix(Zn.name,Zn.configFields,Zn.partFields,Zn.factory,mo),Jn=X0(Zn.name,Zn.partFields),oo=Vl(Zn.apis,eb),lo=Vl(Zn.extraApis,(mo,yo)=>QO(mo,yo));return{name:Zn.name,partFields:Zn.partFields,configFields:Zn.configFields,sketch:Yn,parts:Jn,...oo,...lo}},hO=Qn=>ef("input")(Qn)&&Bu(Qn,"type")!=="radio"||ef("textarea")(Qn);var JT=Object.freeze({__proto__:null,getCurrent:(Qn,Zn,Yn)=>Zn.find(Qn)});const P3=[Er("find")],ic=Of({fields:P3,name:"composing",apis:JT}),Bx=["input","button","textarea","select"],eA=(Qn,Zn,Yn)=>{(Zn.disabled()?nA:Sw)(Qn,Zn)},Fx=(Qn,Zn)=>Zn.useNative===!0&&Fs(Bx,Nd(Qn.element)),$3=Qn=>cs(Qn.element,"disabled"),R3=Qn=>{aa(Qn.element,"disabled","disabled")},tA=Qn=>{_s(Qn.element,"disabled")},D3=Qn=>Bu(Qn.element,"aria-disabled")==="true",va=Qn=>{aa(Qn.element,"aria-disabled","true")},hy=Qn=>{aa(Qn.element,"aria-disabled","false")},nA=(Qn,Zn,Yn)=>{Zn.disableClass.each(oo=>{$d(Qn.element,oo)}),(Fx(Qn,Zn)?R3:va)(Qn),Zn.onDisabled(Qn)},Sw=(Qn,Zn,Yn)=>{Zn.disableClass.each(oo=>{Yu(Qn.element,oo)}),(Fx(Qn,Zn)?tA:hy)(Qn),Zn.onEnabled(Qn)},ww=(Qn,Zn)=>Fx(Qn,Zn)?$3(Qn):D3(Qn);var DN=Object.freeze({__proto__:null,enable:Sw,disable:nA,isDisabled:ww,onLoad:eA,set:(Qn,Zn,Yn,Jn)=>{(Jn?nA:Sw)(Qn,Zn)}}),N3=Object.freeze({__proto__:null,exhibit:(Qn,Zn)=>bm({classes:Zn.disabled()?Zn.disableClass.toArray():[]}),events:(Qn,Zn)=>Jc([IO(Im(),(Yn,Jn)=>ww(Yn,Qn)),Vd(Qn,Zn,eA)])}),oA=[Hd("disabled",sr),Gs("useNative",!0),Tc("disableClass"),rc("onDisabled"),rc("onEnabled")];const Ja=Of({fields:oA,name:"disabling",active:N3,apis:DN}),G0=(Qn,Zn,Yn,Jn)=>{const oo=_f(Qn.element,"."+Zn.highlightClass);Qs(oo,lo=>{Br(Jn,yo=>Oc(yo.element,lo))||(Yu(lo,Zn.highlightClass),Qn.getSystem().getByDom(lo).each(yo=>{Zn.onDehighlight(Qn,yo),Wl(yo,Tv())}))})},sA=(Qn,Zn,Yn)=>G0(Qn,Zn,Yn,[]),L3=(Qn,Zn,Yn,Jn)=>{pk(Qn,Zn,Yn,Jn)&&(Yu(Jn.element,Zn.highlightClass),Zn.onDehighlight(Qn,Jn),Wl(Jn,Tv()))},Cw=(Qn,Zn,Yn,Jn)=>{G0(Qn,Zn,Yn,[Jn]),pk(Qn,Zn,Yn,Jn)||($d(Jn.element,Zn.highlightClass),Zn.onHighlight(Qn,Jn),Wl(Jn,Ev()))},I3=(Qn,Zn,Yn)=>{R_(Qn,Zn).each(Jn=>{Cw(Qn,Zn,Yn,Jn)})},rA=(Qn,Zn,Yn)=>{Qx(Qn,Zn).each(Jn=>{Cw(Qn,Zn,Yn,Jn)})},Hx=(Qn,Zn,Yn,Jn)=>{F3(Qn,Zn,Yn,Jn).fold(oo=>{throw oo},oo=>{Cw(Qn,Zn,Yn,oo)})},iA=(Qn,Zn,Yn,Jn)=>{const oo=gk(Qn,Zn);Zs(oo,Jn).each(mo=>{Cw(Qn,Zn,Yn,mo)})},pk=(Qn,Zn,Yn,Jn)=>of(Jn.element,Zn.highlightClass),B3=(Qn,Zn,Yn)=>Rd(Qn.element,"."+Zn.highlightClass).bind(Jn=>Qn.getSystem().getByDom(Jn).toOptional()),F3=(Qn,Zn,Yn,Jn)=>{const oo=_f(Qn.element,"."+Zn.itemClass);return ko.from(oo[Jn]).fold(()=>yl.error(new Error("No element found with index "+Jn)),Qn.getSystem().getByDom)},R_=(Qn,Zn,Yn)=>Rd(Qn.element,"."+Zn.itemClass).bind(Jn=>Qn.getSystem().getByDom(Jn).toOptional()),Qx=(Qn,Zn,Yn)=>{const Jn=_f(Qn.element,"."+Zn.itemClass);return(Jn.length>0?ko.some(Jn[Jn.length-1]):ko.none()).bind(lo=>Qn.getSystem().getByDom(lo).toOptional())},aA=(Qn,Zn,Yn,Jn)=>{const oo=_f(Qn.element,"."+Zn.itemClass);return Sr(oo,mo=>of(mo,Zn.highlightClass)).bind(mo=>{const yo=Q0(mo,Jn,0,oo.length-1);return Qn.getSystem().getByDom(oo[yo]).toOptional()})},H3=(Qn,Zn,Yn)=>aA(Qn,Zn,Yn,-1),Q3=(Qn,Zn,Yn)=>aA(Qn,Zn,Yn,1),gk=(Qn,Zn,Yn)=>{const Jn=_f(Qn.element,"."+Zn.itemClass);return Ks(hs(Jn,oo=>Qn.getSystem().getByDom(oo).toOptional()))};var Jb=Object.freeze({__proto__:null,dehighlightAll:sA,dehighlight:L3,highlight:Cw,highlightFirst:I3,highlightLast:rA,highlightAt:Hx,highlightBy:iA,isHighlighted:pk,getHighlighted:B3,getFirst:R_,getLast:Qx,getPrevious:H3,getNext:Q3,getCandidates:gk}),bk=[Er("highlightClass"),Er("itemClass"),rc("onHighlight"),rc("onDehighlight")];const Bc=Of({fields:bk,name:"highlighting",apis:Jb}),V3=[8],K0=[9],e0=[13],vk=[27],mg=[32],yk=[37],J0=[38],D_=[39],kw=[40],Vx=(Qn,Zn,Yn)=>{const Jn=Vr(Qn.slice(0,Zn)),oo=Vr(Qn.slice(Zn+1));return Zs(Jn.concat(oo),Yn)},z3=(Qn,Zn,Yn)=>{const Jn=Vr(Qn.slice(0,Zn));return Zs(Jn,Yn)},zx=(Qn,Zn,Yn)=>{const Jn=Qn.slice(0,Zn),oo=Qn.slice(Zn+1);return Zs(oo.concat(Jn),Yn)},W3=(Qn,Zn,Yn)=>{const Jn=Qn.slice(Zn+1);return Zs(Jn,Yn)},dc=Qn=>Zn=>{const Yn=Zn.raw;return Fs(Qn,Yn.which)},pg=Qn=>Zn=>dr(Qn,Yn=>Yn(Zn)),ev=Qn=>Qn.raw.shiftKey===!0,U3=Qn=>Qn.raw.ctrlKey===!0,M_=is(ev),wc=(Qn,Zn)=>({matches:Qn,classification:Zn}),Z3=(Qn,Zn)=>Zs(Qn,Jn=>Jn.matches(Zn)).map(Jn=>Jn.classification),Wx=(Qn,Zn,Yn)=>{Zn.exists(oo=>Yn.exists(lo=>Oc(lo,oo)))||Qa(Qn,MO(),{prevFocus:Zn,newFocus:Yn})},eo=()=>{const Qn=Yn=>dg(Yn.element);return{get:Qn,set:(Yn,Jn)=>{const oo=Qn(Yn);Yn.getSystem().triggerFocus(Jn,Yn.element);const lo=Qn(Yn);Wx(Yn,oo,lo)}}},ro=()=>{const Qn=Yn=>Bc.getHighlighted(Yn).map(Jn=>Jn.element);return{get:Qn,set:(Yn,Jn)=>{const oo=Qn(Yn);Yn.getSystem().getByDom(Jn).fold(xo,mo=>{Bc.highlight(Yn,mo)});const lo=Qn(Yn);Wx(Yn,oo,lo)}}};var fo;(function(Qn){Qn.OnFocusMode="onFocus",Qn.OnEnterOrSpaceMode="onEnterOrSpace",Qn.OnApiMode="onApi"})(fo||(fo={}));const go=(Qn,Zn,Yn,Jn,oo)=>{const lo=()=>Qn.concat([Gs("focusManager",eo()),xh("focusInside","onFocus",Rg(Ro=>Fs(["onFocus","onEnterOrSpace","onApi"],Ro)?yl.value(Ro):yl.error("Invalid value for focusInside"))),tu("handler",Co),tu("state",Zn),tu("sendFocusIn",oo)]),mo=(Ro,Lo,Wo,jo,es)=>{const us=Wo(Ro,Lo,jo,es);return Z3(us,Lo.event).bind(Ps=>Ps(Ro,Lo,jo,es))},Co={schema:lo,processKey:mo,toEvents:(Ro,Lo)=>{const Wo=Ro.focusInside!==fo.OnFocusMode?ko.none():oo(Ro).map(us=>wr(tg(),(Ps,er)=>{us(Ps,Ro,Lo),er.stop()})),jo=(us,Ps)=>{const er=dc(mg.concat(e0))(Ps.event);Ro.focusInside===fo.OnEnterOrSpaceMode&&er&&hm(us,Ps)&&oo(Ro).each(Bs=>{Bs(us,Ro,Lo),Ps.stop()})},es=[wr(op(),(us,Ps)=>{mo(us,Ps,Yn,Ro,Lo).fold(()=>{jo(us,Ps)},er=>{Ps.stop()})}),wr(Q1(),(us,Ps)=>{mo(us,Ps,Jn,Ro,Lo).each(er=>{Ps.stop()})})];return Jc(Wo.toArray().concat(es))}};return Co},To=Qn=>{const Zn=[Tc("onEscape"),Tc("onEnter"),Gs("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Gs("firstTabstop",0),Gs("useTabstopAt",Js),Tc("visibilitySelector")].concat([Qn]),Yn=(Bs,Ns)=>{const Xs=Bs.visibilitySelector.bind(Hr=>Bg(Ns,Hr)).getOr(Ns);return cu(Xs)>0},Jn=(Bs,Ns)=>{const Xs=_f(Bs.element,Ns.selector),Hr=ga(Xs,kr=>Yn(Ns,kr));return ko.from(Hr[Ns.firstTabstop])},oo=(Bs,Ns)=>Ns.focusManager.get(Bs).bind(Xs=>Bg(Xs,Ns.selector)),lo=(Bs,Ns)=>Yn(Bs,Ns)&&Bs.useTabstopAt(Ns),mo=(Bs,Ns,Xs)=>{Jn(Bs,Ns).each(Hr=>{Ns.focusManager.set(Bs,Hr)})},yo=(Bs,Ns,Xs,Hr,kr)=>kr(Ns,Xs,Or=>lo(Hr,Or)).fold(()=>Hr.cyclic?ko.some(!0):ko.none(),Or=>(Hr.focusManager.set(Bs,Or),ko.some(!0))),Co=(Bs,Ns,Xs,Hr)=>{const kr=_f(Bs.element,Xs.selector);return oo(Bs,Xs).bind(Or=>Sr(kr,ms(Oc,Or)).bind(na=>yo(Bs,kr,na,Xs,Hr)))},Ro=(Bs,Ns,Xs)=>{const Hr=Xs.cyclic?Vx:z3;return Co(Bs,Ns,Xs,Hr)},Lo=(Bs,Ns,Xs)=>{const Hr=Xs.cyclic?zx:W3;return Co(Bs,Ns,Xs,Hr)},Wo=Bs=>ah(Bs).bind(jm).exists(Ns=>Oc(Ns,Bs)),jo=(Bs,Ns,Xs)=>oo(Bs,Xs).filter(Hr=>!Xs.useTabstopAt(Hr)).bind(Hr=>(Wo(Hr)?Ro:Lo)(Bs,Ns,Xs)),es=(Bs,Ns,Xs)=>Xs.onEnter.bind(Hr=>Hr(Bs,Ns)),us=(Bs,Ns,Xs)=>Xs.onEscape.bind(Hr=>Hr(Bs,Ns)),Ps=Mo([wc(pg([ev,dc(K0)]),Ro),wc(dc(K0),Lo),wc(pg([M_,dc(e0)]),es)]),er=Mo([wc(dc(vk),us),wc(dc(K0),jo)]);return go(Zn,Ap.init,Ps,er,()=>ko.some(mo))};var No=To(pu("cyclic",sr)),Zo=To(pu("cyclic",Js));const ns=(Qn,Zn,Yn)=>(Av(Qn,Yn,Im()),ko.some(!0)),ps=(Qn,Zn,Yn)=>hO(Yn)&&dc(mg)(Zn.event)?ko.none():ns(Qn,Zn,Yn),$s=(Qn,Zn)=>ko.some(!0),js=[Gs("execute",ps),Gs("useSpace",!1),Gs("useEnter",!0),Gs("useControlEnter",!1),Gs("useDown",!1)],Nr=(Qn,Zn,Yn)=>Yn.execute(Qn,Zn,Qn.element),la=(Qn,Zn,Yn,Jn)=>{const oo=Yn.useSpace&&!hO(Qn.element)?mg:[],lo=Yn.useEnter?e0:[],mo=Yn.useDown?kw:[],yo=oo.concat(lo).concat(mo);return[wc(dc(yo),Nr)].concat(Yn.useControlEnter?[wc(pg([U3,dc(e0)]),Nr)]:[])},sa=(Qn,Zn,Yn,Jn)=>Yn.useSpace&&!hO(Qn.element)?[wc(dc(mg),$s)]:[];var xr=go(js,Ap.init,la,sa,()=>ko.none());const ca=()=>{const Qn=Hl();return ph({readState:()=>Qn.get().map(oo=>({numRows:String(oo.numRows),numColumns:String(oo.numColumns)})).getOr({numRows:"?",numColumns:"?"}),setGridSize:(oo,lo)=>{Qn.set({numRows:oo,numColumns:lo})},getNumRows:()=>Qn.get().map(oo=>oo.numRows),getNumColumns:()=>Qn.get().map(oo=>oo.numColumns)})};var Ra=Object.freeze({__proto__:null,flatgrid:ca,init:Qn=>Qn.state(Qn)});const dl=Qn=>(Zn,Yn,Jn,oo)=>{const lo=Qn(Zn.element);return zd(lo,Zn,Yn,Jn,oo)},Bl=(Qn,Zn)=>{const Yn=u_(Qn,Zn);return dl(Yn)},Gu=(Qn,Zn)=>{const Yn=u_(Zn,Qn);return dl(Yn)},qf=Qn=>(Zn,Yn,Jn,oo)=>zd(Qn,Zn,Yn,Jn,oo),zd=(Qn,Zn,Yn,Jn,oo)=>Jn.focusManager.get(Zn).bind(mo=>Qn(Zn.element,mo,Jn,oo)).map(mo=>(Jn.focusManager.set(Zn,mo),!0)),dp=qf,mO=qf,pO=qf,Ux=Qn=>Qn.offsetWidth<=0&&Qn.offsetHeight<=0,Ok=Qn=>!Ux(Qn.dom),yu=(Qn,Zn)=>Sr(Qn,Zn).map(Yn=>({index:Yn,candidates:Qn})),wm=(Qn,Zn,Yn)=>{const Jn=mo=>Oc(mo,Zn),oo=_f(Qn,Yn),lo=ga(oo,Ok);return yu(lo,Jn)},Lh=(Qn,Zn)=>Sr(Qn,Yn=>Oc(Zn,Yn)),gg=(Qn,Zn,Yn,Jn)=>{const oo=Math.floor(Zn/Yn),lo=Zn%Yn;return Jn(oo,lo).bind(mo=>{const yo=mo.row*Yn+mo.column;return yo>=0&&yogg(Qn,Zn,Jn,(lo,mo)=>{const Co=lo===Yn-1?Qn.length-lo*Jn:Jn,Ro=Q0(mo,oo,0,Co-1);return ko.some({row:lo,column:Ro})}),my=(Qn,Zn,Yn,Jn,oo)=>gg(Qn,Zn,Jn,(lo,mo)=>{const yo=Q0(lo,oo,0,Yn-1),Ro=yo===Yn-1?Qn.length-yo*Jn:Jn,Lo=rp(mo,0,Ro-1);return ko.some({row:yo,column:Lo})}),Wm=(Qn,Zn,Yn,Jn)=>Np(Qn,Zn,Yn,Jn,1),Zx=(Qn,Zn,Yn,Jn)=>Np(Qn,Zn,Yn,Jn,-1),xw=(Qn,Zn,Yn,Jn)=>my(Qn,Zn,Yn,Jn,-1),t0=(Qn,Zn,Yn,Jn)=>my(Qn,Zn,Yn,Jn,1),Gh=[Er("selector"),Gs("execute",ps),Vm("onEscape"),Gs("captureTab",!1),e_()],Ew=(Qn,Zn,Yn)=>{Rd(Qn.element,Zn.selector).each(Jn=>{Zn.focusManager.set(Qn,Jn)})},lA=(Qn,Zn)=>Zn.focusManager.get(Qn).bind(Yn=>Bg(Yn,Zn.selector)),cA=(Qn,Zn,Yn,Jn)=>lA(Qn,Yn).bind(oo=>Yn.execute(Qn,Zn,oo)),N_=Qn=>(Zn,Yn,Jn,oo)=>wm(Zn,Yn,Jn.selector).bind(lo=>Qn(lo.candidates,lo.index,oo.getNumRows().getOr(Jn.initSize.numRows),oo.getNumColumns().getOr(Jn.initSize.numColumns))),uA=(Qn,Zn,Yn)=>Yn.captureTab?ko.some(!0):ko.none(),_k=(Qn,Zn,Yn)=>Yn.onEscape(Qn,Zn),dA=N_(Zx),gO=N_(Wm),NN=N_(xw),dH=N_(t0),fH=Mo([wc(dc(yk),Bl(dA,gO)),wc(dc(D_),Gu(dA,gO)),wc(dc(J0),dp(NN)),wc(dc(kw),mO(dH)),wc(pg([ev,dc(K0)]),uA),wc(pg([M_,dc(K0)]),uA),wc(dc(mg.concat(e0)),cA)]),hH=Mo([wc(dc(vk),_k),wc(dc(mg),$s)]);var mH=go(Gh,ca,fH,hH,()=>ko.some(Ew));const LN=(Qn,Zn,Yn,Jn,oo)=>{const lo=yo=>Nd(yo)==="button"&&Bu(yo,"disabled")==="disabled",mo=(yo,Co,Ro)=>oo(yo,Co,Jn,0,Ro.length-1,Ro[Co],Lo=>lo(Ro[Lo])?mo(yo,Lo,Ro):ko.from(Ro[Lo]));return wm(Qn,Yn,Zn).bind(yo=>{const Co=yo.index,Ro=yo.candidates;return mo(Co,Co,Ro)})},IN=(Qn,Zn,Yn,Jn)=>LN(Qn,Zn,Yn,Jn,(oo,lo,mo,yo,Co,Ro,Lo)=>{const Wo=rp(lo+mo,yo,Co);return Wo===oo?ko.from(Ro):Lo(Wo)}),Sk=(Qn,Zn,Yn,Jn)=>LN(Qn,Zn,Yn,Jn,(oo,lo,mo,yo,Co,Ro,Lo)=>{const Wo=Q0(lo,mo,yo,Co);return Wo===oo?ko.none():Lo(Wo)}),q3=[Er("selector"),Gs("getInitial",ko.none),Gs("execute",ps),Vm("onEscape"),Gs("executeOnMove",!1),Gs("allowVertical",!0),Gs("allowHorizontal",!0),Gs("cycles",!0)],pH=(Qn,Zn)=>Zn.focusManager.get(Qn).bind(Yn=>Bg(Yn,Zn.selector)),BN=(Qn,Zn,Yn)=>pH(Qn,Yn).bind(Jn=>Yn.execute(Qn,Zn,Jn)),FN=(Qn,Zn,Yn)=>{Zn.getInitial(Qn).orThunk(()=>Rd(Qn.element,Zn.selector)).each(Jn=>{Zn.focusManager.set(Qn,Jn)})},HN=(Qn,Zn,Yn)=>(Yn.cycles?Sk:IN)(Qn,Yn.selector,Zn,-1),QN=(Qn,Zn,Yn)=>(Yn.cycles?Sk:IN)(Qn,Yn.selector,Zn,1),O1=Qn=>(Zn,Yn,Jn,oo)=>Qn(Zn,Yn,Jn,oo).bind(()=>Jn.executeOnMove?BN(Zn,Yn,Jn):ko.some(!0)),gH=(Qn,Zn,Yn)=>Yn.onEscape(Qn,Zn),bH=(Qn,Zn,Yn,Jn)=>{const oo=[...Yn.allowHorizontal?yk:[]].concat(Yn.allowVertical?J0:[]),lo=[...Yn.allowHorizontal?D_:[]].concat(Yn.allowVertical?kw:[]);return[wc(dc(oo),O1(Bl(HN,QN))),wc(dc(lo),O1(Gu(HN,QN))),wc(dc(e0),BN),wc(dc(mg),BN)]},vH=Mo([wc(dc(mg),$s),wc(dc(vk),gH)]);var yH=go(q3,Ap.init,bH,vH,()=>ko.some(FN));const fA=(Qn,Zn,Yn)=>ko.from(Qn[Zn]).bind(Jn=>ko.from(Jn[Yn]).map(oo=>({rowIndex:Zn,columnIndex:Yn,cell:oo}))),Tw=(Qn,Zn,Yn,Jn)=>{const lo=Qn[Zn].length,mo=Q0(Yn,Jn,0,lo-1);return fA(Qn,Zn,mo)},hA=(Qn,Zn,Yn,Jn)=>{const oo=Q0(Yn,Jn,0,Qn.length-1),lo=Qn[oo].length,mo=rp(Zn,0,lo-1);return fA(Qn,oo,mo)},VN=(Qn,Zn,Yn,Jn)=>{const lo=Qn[Zn].length,mo=rp(Yn+Jn,0,lo-1);return fA(Qn,Zn,mo)},mA=(Qn,Zn,Yn,Jn)=>{const oo=rp(Yn+Jn,0,Qn.length-1),lo=Qn[oo].length,mo=rp(Zn,0,lo-1);return fA(Qn,oo,mo)},pA=(Qn,Zn,Yn)=>Tw(Qn,Zn,Yn,1),j3=(Qn,Zn,Yn)=>Tw(Qn,Zn,Yn,-1),OH=(Qn,Zn,Yn)=>hA(Qn,Yn,Zn,-1),_H=(Qn,Zn,Yn)=>hA(Qn,Yn,Zn,1),SH=(Qn,Zn,Yn)=>VN(Qn,Zn,Yn,-1),wH=(Qn,Zn,Yn)=>VN(Qn,Zn,Yn,1),CH=(Qn,Zn,Yn)=>mA(Qn,Yn,Zn,-1),kH=(Qn,Zn,Yn)=>mA(Qn,Yn,Zn,1),zN=[fm("selectors",[Er("row"),Er("cell")]),Gs("cycles",!0),Gs("previousSelector",ko.none),Gs("execute",ps)],X3=(Qn,Zn,Yn)=>{Zn.previousSelector(Qn).orThunk(()=>{const oo=Zn.selectors;return Rd(Qn.element,oo.cell)}).each(oo=>{Zn.focusManager.set(Qn,oo)})},xH=(Qn,Zn,Yn)=>dg(Qn.element).bind(Jn=>Yn.execute(Qn,Zn,Jn)),EH=(Qn,Zn)=>hs(Qn,Yn=>_f(Yn,Zn.selectors.cell)),gA=(Qn,Zn)=>(Yn,Jn,oo)=>{const lo=oo.cycles?Qn:Zn;return Bg(Jn,oo.selectors.row).bind(mo=>{const yo=_f(mo,oo.selectors.cell);return Lh(yo,Jn).bind(Co=>{const Ro=_f(Yn,oo.selectors.row);return Lh(Ro,mo).bind(Lo=>{const Wo=EH(Ro,oo);return lo(Wo,Lo,Co).map(jo=>jo.cell)})})})},WN=gA(j3,SH),L_=gA(pA,wH),UN=gA(OH,CH),TH=gA(_H,kH),Y3=Mo([wc(dc(yk),Bl(WN,L_)),wc(dc(D_),Gu(WN,L_)),wc(dc(J0),dp(UN)),wc(dc(kw),mO(TH)),wc(dc(mg.concat(e0)),xH)]),AH=Mo([wc(dc(mg),$s)]);var ZN=go(zN,Ap.init,Y3,AH,()=>ko.some(X3));const qN=[Er("selector"),Gs("execute",ps),Gs("moveOnTab",!1)],G3=(Qn,Zn,Yn)=>Yn.focusManager.get(Qn).bind(Jn=>Yn.execute(Qn,Zn,Jn)),jN=(Qn,Zn,Yn)=>{Rd(Qn.element,Zn.selector).each(Jn=>{Zn.focusManager.set(Qn,Jn)})},K3=(Qn,Zn,Yn)=>Sk(Qn,Yn.selector,Zn,-1),XN=(Qn,Zn,Yn)=>Sk(Qn,Yn.selector,Zn,1),PH=(Qn,Zn,Yn,Jn)=>Yn.moveOnTab?pO(K3)(Qn,Zn,Yn,Jn):ko.none(),$H=(Qn,Zn,Yn,Jn)=>Yn.moveOnTab?pO(XN)(Qn,Zn,Yn,Jn):ko.none(),J3=Mo([wc(dc(J0),pO(K3)),wc(dc(kw),pO(XN)),wc(pg([ev,dc(K0)]),PH),wc(pg([M_,dc(K0)]),$H),wc(dc(e0),G3),wc(dc(mg),G3)]),RH=Mo([wc(dc(mg),$s)]);var DH=go(qN,Ap.init,J3,RH,()=>ko.some(jN));const MH=[Vm("onSpace"),Vm("onEnter"),Vm("onShiftEnter"),Vm("onLeft"),Vm("onRight"),Vm("onTab"),Vm("onShiftTab"),Vm("onUp"),Vm("onDown"),Vm("onEscape"),Gs("stopSpaceKeyup",!1),Tc("focusIn")],NH=(Qn,Zn,Yn)=>[wc(dc(mg),Yn.onSpace),wc(pg([M_,dc(e0)]),Yn.onEnter),wc(pg([ev,dc(e0)]),Yn.onShiftEnter),wc(pg([ev,dc(K0)]),Yn.onShiftTab),wc(pg([M_,dc(K0)]),Yn.onTab),wc(dc(J0),Yn.onUp),wc(dc(kw),Yn.onDown),wc(dc(yk),Yn.onLeft),wc(dc(D_),Yn.onRight),wc(dc(mg),Yn.onSpace)],YN=(Qn,Zn,Yn)=>[...Yn.stopSpaceKeyup?[wc(dc(mg),$s)]:[],wc(dc(vk),Yn.onEscape)];var LH=go(MH,Ap.init,NH,YN,Qn=>Qn.focusIn);const IH=No.schema(),BH=Zo.schema(),GN=yH.schema(),FH=mH.schema(),HH=ZN.schema(),KN=xr.schema(),QH=DH.schema(),VH=LH.schema();var bA=Object.freeze({__proto__:null,acyclic:IH,cyclic:BH,flow:GN,flatgrid:FH,matrix:HH,execution:KN,menu:QH,special:VH});const zH=Qn=>Su(Qn,"setGridSize"),Za=Ub({branchKey:"mode",branches:bA,name:"keying",active:{events:(Qn,Zn)=>Qn.handler.toEvents(Qn,Zn)},apis:{focusIn:(Qn,Zn,Yn)=>{Zn.sendFocusIn(Zn).fold(()=>{Qn.getSystem().triggerFocus(Qn.element,Qn.element)},Jn=>{Jn(Qn,Zn,Yn)})},setGridSize:(Qn,Zn,Yn,Jn,oo)=>{zH(Yn)?Yn.setGridSize(Jn,oo):console.error("Layout does not support setGridSize")}},state:Ra}),fp=(Qn,Zn)=>{ma(()=>{h3(Qn,Zn,()=>hs(Zn,Qn.getSystem().build))},Qn.element)},JN=(Qn,Zn)=>{ma(()=>{m3(Qn,Zn,()=>AT(Qn.element,Zn,Qn.getSystem().buildOrPatch))},Qn.element)},e5=(Qn,Zn,Yn,Jn)=>{__(Zn);const oo=bC(Qn.element,Yn,Jn,Qn.getSystem().buildOrPatch);Ox(Qn,oo),Qn.syncComponents()},vA=(Qn,Zn,Yn)=>{const Jn=Qn.getSystem().build(Yn);S_(Qn,Jn,Zn)},WH=(Qn,Zn,Yn,Jn)=>{Kb(Zn),vA(Qn,(oo,lo)=>Ku(oo,lo,Yn),Jn)},t5=(Qn,Zn,Yn,Jn)=>(Zn.reuseDom?JN:fp)(Qn,Jn),n5=(Qn,Zn,Yn,Jn)=>{vA(Qn,Id,Jn)},UH=(Qn,Zn,Yn,Jn)=>{vA(Qn,y0,Jn)},ZH=(Qn,Zn,Yn,Jn)=>{const oo=yA(Qn);Zs(oo,mo=>Oc(Jn.element,mo.element)).each(Kb)},yA=(Qn,Zn)=>Qn.components(),o5=(Qn,Zn,Yn,Jn,oo)=>{const lo=yA(Qn);return ko.from(lo[Jn]).map(mo=>(oo.fold(()=>Kb(mo),yo=>{(Zn.reuseDom?e5:WH)(Qn,mo,Jn,yo)}),mo))};var jH=Object.freeze({__proto__:null,append:n5,prepend:UH,remove:ZH,replaceAt:o5,replaceBy:(Qn,Zn,Yn,Jn,oo)=>{const lo=yA(Qn);return Sr(lo,Jn).bind(mo=>o5(Qn,Zn,Yn,mo,oo))},set:t5,contents:yA});const Cl=Of({fields:[Xd("reuseDom",!0)],name:"replacing",apis:jH}),s5=(Qn,Zn)=>{const Yn=Jc(Zn);return Of({fields:[Er("enabled")],name:Qn,active:{events:Mo(Yn)}})},Rl=(Qn,Zn)=>{const Yn=s5(Qn,Zn);return{key:Qn,value:{config:{},me:Yn,configAsRaw:Mo({}),initialConfig:{},state:Ap}}},eR=(Qn,Zn)=>{Zn.ignore||(Cd(Qn.element),Zn.onFocus(Qn))};var XH=Object.freeze({__proto__:null,focus:eR,blur:(Qn,Zn)=>{Zn.ignore||Vg(Qn.element)},isFocused:Qn=>tO(Qn.element)}),r5=Object.freeze({__proto__:null,exhibit:(Qn,Zn)=>{const Yn=Zn.ignore?{}:{attributes:{tabindex:"-1"}};return bm(Yn)},events:Qn=>Jc([wr(tg(),(Zn,Yn)=>{eR(Zn,Qn),Yn.stop()})].concat(Qn.stopMousedown?[wr(Xl(),(Zn,Yn)=>{Yn.event.prevent()})]:[]))}),I_=[rc("onFocus"),Gs("stopMousedown",!1),Gs("ignore",!1)];const ol=Of({fields:I_,name:"focusing",active:r5,apis:XH}),i5=Qn=>({init:()=>{const Yn=Ua(Qn);return{get:()=>Yn.get(),set:yo=>Yn.set(yo),clear:()=>Yn.set(Qn),readState:()=>Yn.get()}}}),tR=(Qn,Zn,Yn)=>{const Jn=Zn.aria;Jn.update(Qn,Jn,Yn.get())},GH=(Qn,Zn,Yn)=>{Zn.toggleClass.each(Jn=>{Yn.get()?$d(Qn.element,Jn):Yu(Qn.element,Jn)})},qx=(Qn,Zn,Yn,Jn)=>{const oo=Yn.get();Yn.set(Jn),GH(Qn,Zn,Yn),tR(Qn,Zn,Yn),oo!==Jn&&Zn.onToggled(Qn,Jn)},a5=(Qn,Zn,Yn)=>{qx(Qn,Zn,Yn,!Yn.get())},KH=(Qn,Zn,Yn)=>{qx(Qn,Zn,Yn,!0)},l5=(Qn,Zn,Yn)=>{qx(Qn,Zn,Yn,!1)},nR=(Qn,Zn,Yn)=>Yn.get(),OA=(Qn,Zn,Yn)=>{qx(Qn,Zn,Yn,Zn.selected)};var JH=Object.freeze({__proto__:null,onLoad:OA,toggle:a5,isOn:nR,on:KH,off:l5,set:qx}),c5=Object.freeze({__proto__:null,exhibit:()=>bm({}),events:(Qn,Zn)=>{const Yn=ib(Qn,Zn,a5),Jn=Vd(Qn,Zn,OA);return Jc(Us([Qn.toggleOnExecute?[Yn]:[],[Jn]]))}});const t9=(Qn,Zn,Yn)=>{aa(Qn.element,"aria-pressed",Yn),Zn.syncWithExpanded&&wk(Qn,Zn,Yn)},n9=(Qn,Zn,Yn)=>{aa(Qn.element,"aria-selected",Yn)},jx=(Qn,Zn,Yn)=>{aa(Qn.element,"aria-checked",Yn)},wk=(Qn,Zn,Yn)=>{aa(Qn.element,"aria-expanded",Yn)};var u5=[Gs("selected",!1),Tc("toggleClass"),Gs("toggleOnExecute",!0),rc("onToggled"),xh("aria",{mode:"none"},jl("mode",{pressed:[Gs("syncWithExpanded",!1),tu("update",t9)],checked:[tu("update",jx)],expanded:[tu("update",wk)],selected:[tu("update",n9)],none:[tu("update",xo)]}))];const Ql=Of({fields:u5,name:"toggling",active:c5,apis:JH,state:i5(!1)}),bO=()=>{const Qn=(Zn,Yn)=>{Yn.stop(),og(Zn)};return[wr(Lg(),Qn),wr(ng(),Qn),X1(mm()),X1(Xl())]},tv=Qn=>{const Zn=Yn=>qh((Jn,oo)=>{Yn(Jn),oo.stop()});return Jc(Us([Qn.map(Zn).toArray(),bO()]))},d5="alloy.item-hover",f5="alloy.item-focus",oR="alloy.item-toggled",py=Qn=>{(dg(Qn.element).isNone()||ol.isFocused(Qn))&&(ol.isFocused(Qn)||ol.focus(Qn),Qa(Qn,d5,{item:Qn}))},_A=Qn=>{Qa(Qn,f5,{item:Qn})},o9=(Qn,Zn)=>{Qa(Qn,oR,{item:Qn,state:Zn})},sR=Mo(d5),h5=Mo(f5),m5=Mo(oR),rR=Qn=>Qn.toggling.map(Zn=>Zn.exclusive?"menuitemradio":"menuitemcheckbox").getOr("menuitem"),p5=Qn=>({aria:{mode:"checked"},...Yl(Qn,(Zn,Yn)=>Yn!=="exclusive"),onToggled:(Zn,Yn)=>{So(Qn.onToggled)&&Qn.onToggled(Zn,Yn),o9(Zn,Yn)}}),s9=Qn=>({dom:Qn.dom,domModification:{...Qn.domModification,attributes:{role:rR(Qn),...Qn.domModification.attributes,"aria-haspopup":Qn.hasSubmenu,...Qn.hasSubmenu?{"aria-expanded":!1}:{}}},behaviours:Wg.augment(Qn.itemBehaviours,[Qn.toggling.fold(Ql.revoke,Zn=>Ql.config(p5(Zn))),ol.config({ignore:Qn.ignoreFocus,stopMousedown:Qn.ignoreFocus,onFocus:Zn=>{_A(Zn)}}),Za.config({mode:"execution"}),da.config({store:{mode:"memory",initialValue:Qn.data}}),Rl("item-type-events",[...bO(),wr(eg(),py),wr(md(),ol.focus)])]),components:Qn.components,eventOrder:Qn.eventOrder}),r9=[Er("data"),Er("components"),Er("dom"),Gs("hasSubmenu",!1),Tc("toggling"),Wg.field("itemBehaviours",[Ql,ol,Za,da]),Gs("ignoreFocus",!1),Gs("domModification",{}),tu("builder",s9),Gs("eventOrder",{})],i9=Qn=>({dom:Qn.dom,components:Qn.components,events:Jc([Y1(md())])}),SA=[Er("dom"),Er("components"),tu("builder",i9)],Xx=Mo("item-widget"),Yx=Mo([Xh({name:"widget",overrides:Qn=>({behaviours:Zr([da.config({store:{mode:"manual",getValue:Zn=>Qn.data,setValue:xo}})])})})]),a9=Qn=>{const Zn=$x(Xx(),Qn,Yx()),Yn=mk(Xx(),Qn,Zn.internals()),Jn=lo=>Au(lo,Qn,"widget").map(mo=>(Za.focusIn(mo),mo)),oo=(lo,mo)=>hO(mo.event.target)?ko.none():(Qn.autofocus&&mo.setSource(lo.element),ko.none());return{dom:Qn.dom,components:Yn,domModification:Qn.domModification,events:Jc([qh((lo,mo)=>{Jn(lo).each(yo=>{mo.stop()})}),wr(eg(),py),wr(md(),(lo,mo)=>{Qn.autofocus?Jn(lo):ol.focus(lo)})]),behaviours:Wg.augment(Qn.widgetBehaviours,[da.config({store:{mode:"memory",initialValue:Qn.data}}),ol.config({ignore:Qn.ignoreFocus,onFocus:lo=>{_A(lo)}}),Za.config({mode:"special",focusIn:Qn.autofocus?lo=>{Jn(lo)}:Jy(),onLeft:oo,onRight:oo,onEscape:(lo,mo)=>!ol.isFocused(lo)&&!Qn.autofocus?(ol.focus(lo),ko.some(!0)):(Qn.autofocus&&mo.setSource(lo.element),ko.none())})])}},l9=[Er("uid"),Er("data"),Er("components"),Er("dom"),Gs("autofocus",!1),Gs("ignoreFocus",!1),Wg.field("widgetBehaviours",[da,ol,Za]),Gs("domModification",{}),Nx(Yx()),tu("builder",a9)],g5=jl("type",{widget:l9,item:r9,separator:SA}),b5=(Qn,Zn)=>({mode:"flatgrid",selector:"."+Qn.markers.item,initSize:{numColumns:Zn.initSize.numColumns,numRows:Zn.initSize.numRows},focusManager:Qn.focusManager}),v5=(Qn,Zn)=>({mode:"matrix",selectors:{row:Zn.rowSelector,cell:"."+Qn.markers.item},previousSelector:Zn.previousSelector,focusManager:Qn.focusManager}),y5=(Qn,Zn)=>({mode:"menu",selector:"."+Qn.markers.item,moveOnTab:Zn.moveOnTab,focusManager:Qn.focusManager}),c9=Mo([vw({factory:{sketch:Qn=>{const Zn=td("menu.spec item",g5,Qn);return Zn.builder(Zn)}},name:"items",unit:"item",defaults:(Qn,Zn)=>Pl(Zn,"uid")?Zn:{...Zn,uid:Mv("item")},overrides:(Qn,Zn)=>({type:Zn.type,ignoreFocus:Qn.fakeFocus,domModification:{classes:[Qn.markers.item]}})})]),iR=Mo([Er("value"),Er("items"),Er("dom"),Er("components"),Gs("eventOrder",{}),Nf("menuBehaviours",[Bc,da,ic,Za]),xh("movement",{mode:"menu",moveOnTab:!0},jl("mode",{grid:[e_(),tu("config",b5)],matrix:[tu("config",v5),Er("rowSelector"),Gs("previousSelector",ko.none)],menu:[Gs("moveOnTab",!0),tu("config",y5)]})),F2(),Gs("fakeFocus",!1),Gs("focusManager",eo()),rc("onHighlight"),rc("onDehighlight")]),O5=Mo("alloy.menu-focus"),u9=(Qn,Zn)=>{const Yn=_f(Qn.element,'[role="menuitemradio"][aria-checked="true"]');Qs(Yn,Jn=>{Oc(Jn,Zn.element)||Qn.getSystem().getByDom(Jn).each(oo=>{Ql.off(oo)})})},d9=(Qn,Zn,Yn,Jn)=>({uid:Qn.uid,dom:Qn.dom,markers:Qn.markers,behaviours:sf(Qn.menuBehaviours,[Bc.config({highlightClass:Qn.markers.selectedItem,itemClass:Qn.markers.item,onHighlight:Qn.onHighlight,onDehighlight:Qn.onDehighlight}),da.config({store:{mode:"memory",initialValue:Qn.value}}),ic.config({find:ko.some}),Za.config(Qn.movement.config(Qn,Qn.movement))]),events:Jc([wr(h5(),(oo,lo)=>{const mo=lo.event;oo.getSystem().getByDom(mo.target).each(yo=>{Bc.highlight(oo,yo),lo.stop(),Qa(oo,O5(),{menu:oo,item:yo})})}),wr(sR(),(oo,lo)=>{const mo=lo.event.item;Bc.highlight(oo,mo)}),wr(m5(),(oo,lo)=>{const{item:mo,state:yo}=lo.event;yo&&Bu(mo.element,"role")==="menuitemradio"&&u9(oo,mo)})]),components:Zn,eventOrder:Qn.eventOrder,domModification:{attributes:{role:"menu"}}}),Pw=Yh({name:"Menu",configFields:iR(),partFields:c9(),factory:d9}),_5=Qn=>Fc(Qn,(Zn,Yn)=>({k:Zn,v:Yn})),S5=(Qn,Zn,Yn,Jn)=>Rr(Yn,Jn).bind(oo=>Rr(Qn,oo).bind(lo=>{const mo=S5(Qn,Zn,Yn,lo);return ko.some([lo].concat(mo))})).getOr([]),f9=(Qn,Zn)=>{const Yn={};Zl(Qn,(mo,yo)=>{Qs(mo,Co=>{Yn[Co]=yo})});const Jn=Zn,oo=_5(Zn),lo=Vl(oo,(mo,yo)=>[yo].concat(S5(Yn,Jn,oo,yo)));return Vl(Yn,mo=>Rr(lo,mo).getOr([mo]))},w5=()=>{const Qn=Ua({}),Zn=Ua({}),Yn=Ua({}),Jn=Hl(),oo=Ua({}),lo=()=>{Qn.set({}),Zn.set({}),Yn.set({}),Jn.clear()},mo=()=>Jn.get().isNone(),yo=(kr,Or)=>{Zn.set({...Zn.get(),[kr]:{type:"prepared",menu:Or}})},Co=(kr,Or,qr,na)=>{Jn.set(kr),Qn.set(qr),Zn.set(Or),oo.set(na);const Dl=f9(na,qr);Yn.set(Dl)},Ro=kr=>Al(Qn.get(),(Or,qr)=>Or===kr),Lo=(kr,Or,qr)=>Ps(kr).bind(na=>Ro(kr).bind(Dl=>Or(Dl).map(Sa=>({triggeredMenu:na,triggeringItem:Sa,triggeringPath:qr})))),Wo=(kr,Or)=>{const qr=ga(Bs(kr).toArray(),na=>Ps(na).isSome());return Rr(Yn.get(),kr).bind(na=>{const Dl=Vr(qr.concat(na)),Sa=fs(Dl,(fl,rl)=>Lo(fl,Or,Dl.slice(0,rl+1)).fold(()=>vs(Jn.get(),fl)?[]:[ko.none()],Yc=>[ko.some(Yc)]));return pr(Sa)})},jo=kr=>Rr(Qn.get(),kr).map(Or=>{const qr=Rr(Yn.get(),kr).getOr([]);return[Or].concat(qr)}),es=kr=>Rr(Yn.get(),kr).bind(Or=>Or.length>1?ko.some(Or.slice(1)):ko.none()),us=kr=>Rr(Yn.get(),kr),Ps=kr=>er(kr).bind(Ck),er=kr=>Rr(Zn.get(),kr),Bs=kr=>Rr(Qn.get(),kr);return{setMenuBuilt:yo,setContents:Co,expand:jo,refresh:us,collapse:es,lookupMenu:er,lookupItem:Bs,otherMenus:kr=>{const Or=oo.get();return nr(nc(Or),kr)},getPrimary:()=>Jn.get().bind(Ps),getMenus:()=>Zn.get(),clear:lo,isClear:mo,getTriggeringPath:Wo}},Ck=Qn=>Qn.type==="prepared"?ko.some(Qn.menu):ko.none(),C5={init:w5,extractPreparedMenu:Ck},kk=ba("tiered-menu-item-highlight"),wA=ba("tiered-menu-item-dehighlight");var hp;(function(Qn){Qn[Qn.HighlightMenuAndItem=0]="HighlightMenuAndItem",Qn[Qn.HighlightJustMenu=1]="HighlightJustMenu",Qn[Qn.HighlightNone=2]="HighlightNone"})(hp||(hp={}));const k5=(Qn,Zn)=>{const Yn=Hl(),Jn=(oa,$a,hl)=>Vl(hl,(gl,Ka)=>{const kl=()=>Pw.sketch({...gl,value:Ka,markers:Qn.markers,fakeFocus:Qn.fakeFocus,onHighlight:($u,Cc)=>{Qa($u,kk,{menuComp:$u,itemComp:Cc})},onDehighlight:($u,Cc)=>{Qa($u,wA,{menuComp:$u,itemComp:Cc})},focusManager:Qn.fakeFocus?ro():eo()});return Ka===$a?{type:"prepared",menu:oa.getSystem().build(kl())}:{type:"notbuilt",nbMenu:kl}}),oo=C5.init(),lo=oa=>{const $a=Jn(oa,Qn.data.primary,Qn.data.menus),hl=Co();return oo.setContents(Qn.data.primary,$a,Qn.data.expansions,hl),oo.getPrimary()},mo=oa=>da.getValue(oa).value,yo=(oa,$a,hl)=>gc($a,gl=>{if(!gl.getSystem().isConnected())return ko.none();const Ka=Bc.getCandidates(gl);return Zs(Ka,kl=>mo(kl)===hl)}),Co=oa=>Vl(Qn.data.menus,($a,hl)=>fs($a.items,gl=>gl.type==="separator"?[]:[gl.data.value])),Ro=Bc.highlight,Lo=(oa,$a)=>{Ro(oa,$a),Bc.getHighlighted($a).orThunk(()=>Bc.getFirst($a)).each(hl=>{Qn.fakeFocus?Bc.highlight($a,hl):Av(oa,hl.element,md())})},Wo=(oa,$a)=>Ks(hs($a,hl=>oa.lookupMenu(hl).bind(gl=>gl.type==="prepared"?ko.some(gl.menu):ko.none()))),jo=(oa,$a,hl)=>{const gl=Wo($a,$a.otherMenus(hl));Qs(gl,Ka=>{sp(Ka.element,[Qn.markers.backgroundMenu]),Qn.stayInDom||Cl.remove(oa,Ka)})},es=oa=>Yn.get().getOrThunk(()=>{const $a={},hl=_f(oa.element,`.${Qn.markers.item}`),gl=ga(hl,Ka=>Bu(Ka,"aria-haspopup")==="true");return Qs(gl,Ka=>{oa.getSystem().getByDom(Ka).each(kl=>{const $u=mo(kl);$a[$u]=kl})}),Yn.set($a),$a}),us=(oa,$a)=>{const hl=es(oa);Zl(hl,(gl,Ka)=>{const kl=Fs($a,Ka);aa(gl.element,"aria-expanded",kl)})},Ps=(oa,$a,hl)=>ko.from(hl[0]).bind(gl=>$a.lookupMenu(gl).bind(Ka=>{if(Ka.type==="notbuilt")return ko.none();{const kl=Ka.menu,$u=Wo($a,hl.slice(1));return Qs($u,Cc=>{$d(Cc.element,Qn.markers.backgroundMenu)}),Gl(kl.element)||Cl.append(oa,Fm(kl)),sp(kl.element,[Qn.markers.backgroundMenu]),Lo(oa,kl),jo(oa,$a,hl),ko.some(kl)}}));let er;(function(oa){oa[oa.HighlightSubmenu=0]="HighlightSubmenu",oa[oa.HighlightParent=1]="HighlightParent"})(er||(er={}));const Bs=(oa,$a,hl)=>{if(hl.type==="notbuilt"){const gl=oa.getSystem().build(hl.nbMenu());return oo.setMenuBuilt($a,gl),gl}else return hl.menu},Ns=(oa,$a,hl=er.HighlightSubmenu)=>{if($a.hasConfigured(Ja)&&Ja.isDisabled($a))return ko.some($a);{const gl=mo($a);return oo.expand(gl).bind(Ka=>(us(oa,Ka),ko.from(Ka[0]).bind(kl=>oo.lookupMenu(kl).bind($u=>{const Cc=Bs(oa,kl,$u);return Gl(Cc.element)||Cl.append(oa,Fm(Cc)),Qn.onOpenSubmenu(oa,$a,Cc,Vr(Ka)),hl===er.HighlightSubmenu?(Bc.highlightFirst(Cc),Ps(oa,oo,Ka)):(Bc.dehighlightAll(Cc),ko.some($a))}))))}},Xs=(oa,$a)=>{const hl=mo($a);return oo.collapse(hl).bind(gl=>(us(oa,gl),Ps(oa,oo,gl).map(Ka=>(Qn.onCollapseMenu(oa,$a,Ka),Ka))))},Hr=(oa,$a)=>{const hl=mo($a);return oo.refresh(hl).bind(gl=>(us(oa,gl),Ps(oa,oo,gl)))},kr=(oa,$a)=>hO($a.element)?ko.none():Ns(oa,$a,er.HighlightSubmenu),Or=(oa,$a)=>hO($a.element)?ko.none():Xs(oa,$a),qr=(oa,$a)=>Xs(oa,$a).orThunk(()=>Qn.onEscape(oa,$a).map(()=>oa)),na=oa=>($a,hl)=>Bg(hl.getSource(),`.${Qn.markers.item}`).bind(gl=>$a.getSystem().getByDom(gl).toOptional().bind(Ka=>oa($a,Ka).map(Js))),Dl=Jc([wr(O5(),(oa,$a)=>{const hl=$a.event.item;oo.lookupItem(mo(hl)).each(()=>{const gl=$a.event.menu;Bc.highlight(oa,gl);const Ka=mo($a.event.item);oo.refresh(Ka).each(kl=>jo(oa,oo,kl))})}),qh((oa,$a)=>{const hl=$a.event.target;oa.getSystem().getByDom(hl).each(gl=>{mo(gl).indexOf("collapse-item")===0&&Xs(oa,gl),Ns(oa,gl,er.HighlightSubmenu).fold(()=>{Qn.onExecute(oa,gl)},xo)})}),eu((oa,$a)=>{lo(oa).each(hl=>{Cl.append(oa,Fm(hl)),Qn.onOpenMenu(oa,hl),Qn.highlightOnOpen===hp.HighlightMenuAndItem?Lo(oa,hl):Qn.highlightOnOpen===hp.HighlightJustMenu&&Ro(oa,hl)})}),wr(kk,(oa,$a)=>{Qn.onHighlightItem(oa,$a.event.menuComp,$a.event.itemComp)}),wr(wA,(oa,$a)=>{Qn.onDehighlightItem(oa,$a.event.menuComp,$a.event.itemComp)}),...Qn.navigateOnHover?[wr(sR(),(oa,$a)=>{const hl=$a.event.item;Hr(oa,hl),Ns(oa,hl,er.HighlightParent),Qn.onHover(oa,hl)})]:[]]),Sa=oa=>Bc.getHighlighted(oa).bind(Bc.getHighlighted),fl=oa=>{Sa(oa).each($a=>{Xs(oa,$a)})},rl=oa=>{oo.getPrimary().each($a=>{Lo(oa,$a)})},Yc=oa=>ko.from(oa.components()[0]).filter($a=>Bu($a.element,"role")==="menu"),yc={collapseMenu:fl,highlightPrimary:rl,repositionMenus:oa=>{oo.getPrimary().bind(hl=>Sa(oa).bind(gl=>{const Ka=mo(gl),kl=gd(oo.getMenus()),$u=Ks(hs(kl,C5.extractPreparedMenu));return oo.getTriggeringPath(Ka,Cc=>yo(oa,$u,Cc))}).map(gl=>({primary:hl,triggeringPath:gl}))).fold(()=>{Yc(oa).each(hl=>{Qn.onRepositionMenu(oa,hl,[])})},({primary:hl,triggeringPath:gl})=>{Qn.onRepositionMenu(oa,hl,gl)})}};return{uid:Qn.uid,dom:Qn.dom,markers:Qn.markers,behaviours:sf(Qn.tmenuBehaviours,[Za.config({mode:"special",onRight:na(kr),onLeft:na(Or),onEscape:na(qr),focusIn:(oa,$a)=>{oo.getPrimary().each(hl=>{Av(oa,hl.element,md())})}}),Bc.config({highlightClass:Qn.markers.selectedMenu,itemClass:Qn.markers.menu}),ic.config({find:oa=>Bc.getHighlighted(oa)}),Cl.config({})]),eventOrder:Qn.eventOrder,apis:yc,events:Dl}},h9=Mo("collapse-item"),m9=(Qn,Zn,Yn)=>({primary:Qn,menus:Zn,expansions:Yn}),x5=(Qn,Zn)=>({primary:Qn,menus:Jr(Qn,Zn),expansions:{}}),p9=Qn=>({value:ba(h9()),meta:{text:Qn}}),B_=Mp({name:"TieredMenu",configFields:[Yv("onExecute"),Yv("onEscape"),Fg("onOpenMenu"),Fg("onOpenSubmenu"),rc("onRepositionMenu"),rc("onCollapseMenu"),Gs("highlightOnOpen",hp.HighlightMenuAndItem),fm("data",[Er("primary"),Er("menus"),Er("expansions")]),Gs("fakeFocus",!1),rc("onHighlightItem"),rc("onDehighlightItem"),rc("onHover"),qy(),Er("dom"),Gs("navigateOnHover",!0),Gs("stayInDom",!1),Nf("tmenuBehaviours",[Za,Bc,ic,Cl]),Gs("eventOrder",{})],apis:{collapseMenu:(Qn,Zn)=>{Qn.collapseMenu(Zn)},highlightPrimary:(Qn,Zn)=>{Qn.highlightPrimary(Zn)},repositionMenus:(Qn,Zn)=>{Qn.repositionMenus(Zn)}},factory:k5,extraApis:{tieredData:m9,singleData:x5,collapseItem:p9}}),g9=(Qn,Zn,Yn,Jn,oo)=>{const lo=()=>Qn.lazySink(Zn),mo=Jn.type==="horizontal"?{layouts:{onLtr:()=>r_(),onRtl:()=>MS()}}:{},yo=Ro=>Ro.length===2,Co=Ro=>yo(Ro)?mo:{};return B_.sketch({dom:{tag:"div"},data:Jn.data,markers:Jn.menu.markers,highlightOnOpen:Jn.menu.highlightOnOpen,fakeFocus:Jn.menu.fakeFocus,onEscape:()=>(uc.close(Zn),Qn.onEscape.map(Ro=>Ro(Zn)),ko.some(!0)),onExecute:()=>ko.some(!0),onOpenMenu:(Ro,Lo)=>{jh.positionWithinBounds(lo().getOrDie(),Lo,Yn,oo())},onOpenSubmenu:(Ro,Lo,Wo,jo)=>{const es=lo().getOrDie();jh.position(es,Wo,{anchor:{type:"submenu",item:Lo,...Co(jo)}})},onRepositionMenu:(Ro,Lo,Wo)=>{const jo=lo().getOrDie();jh.positionWithinBounds(jo,Lo,Yn,oo()),Qs(Wo,es=>{const us=Co(es.triggeringPath);jh.position(jo,es.triggeredMenu,{anchor:{type:"submenu",item:es.triggeringItem,...us}})})}})},b9=(Qn,Zn)=>{const Yn=(jo,es)=>Qn.getRelated(jo).exists(Ps=>ob(Ps,es)),Jn=(jo,es)=>{uc.setContent(jo,es)},oo=(jo,es,us)=>{const Ps=ko.none;lo(jo,es,us,Ps)},lo=(jo,es,us,Ps)=>{const er=Qn.lazySink(jo).getOrDie();uc.openWhileCloaked(jo,es,()=>jh.positionWithinBounds(er,jo,us,Ps())),da.setValue(jo,ko.some({mode:"position",config:us,getBounds:Ps}))},mo=(jo,es,us)=>{yo(jo,es,us,ko.none)},yo=(jo,es,us,Ps)=>{const er=g9(Qn,jo,es,us,Ps);uc.open(jo,er),da.setValue(jo,ko.some({mode:"menu",menu:er}))},Co=jo=>{uc.isOpen(jo)&&(da.setValue(jo,ko.none()),uc.close(jo))},Ro=jo=>uc.getState(jo),Lo=jo=>{uc.isOpen(jo)&&da.getValue(jo).each(es=>{switch(es.mode){case"menu":uc.getState(jo).each(B_.repositionMenus);break;case"position":const us=Qn.lazySink(jo).getOrDie();jh.positionWithinBounds(us,jo,es.config,es.getBounds());break}})},Wo={setContent:Jn,showAt:oo,showWithinBounds:lo,showMenuAt:mo,showMenuWithinBounds:yo,hide:Co,getContent:Ro,reposition:Lo,isOpen:uc.isOpen};return{uid:Qn.uid,dom:Qn.dom,behaviours:sf(Qn.inlineBehaviours,[uc.config({isPartOf:(jo,es,us)=>ob(es,us)||Yn(jo,us),getAttachPoint:jo=>Qn.lazySink(jo).getOrDie(),onOpen:jo=>{Qn.onShow(jo)},onClose:jo=>{Qn.onHide(jo)}}),da.config({store:{mode:"memory",initialValue:ko.none()}}),Om.config({channels:{...cw({isExtraPart:Zn.isExtraPart,...Qn.fireDismissalEventInstead.map(jo=>({fireEventInstead:{event:jo.event}})).getOr({})}),...C_({...Qn.fireRepositionEventInstead.map(jo=>({fireEventInstead:{event:jo.event}})).getOr({}),doReposition:Lo})}})]),eventOrder:Qn.eventOrder,apis:Wo}},kd=Mp({name:"InlineView",configFields:[Er("lazySink"),rc("onShow"),rc("onHide"),I1("onEscape"),Nf("inlineBehaviours",[uc,da,Om]),hh("fireDismissalEventInstead",[Gs("event",q1())]),hh("fireRepositionEventInstead",[Gs("event",hS())]),Gs("getRelated",ko.none),Gs("isExtraPart",sr),Gs("eventOrder",ko.none)],factory:b9,apis:{showAt:(Qn,Zn,Yn,Jn)=>{Qn.showAt(Zn,Yn,Jn)},showWithinBounds:(Qn,Zn,Yn,Jn,oo)=>{Qn.showWithinBounds(Zn,Yn,Jn,oo)},showMenuAt:(Qn,Zn,Yn,Jn)=>{Qn.showMenuAt(Zn,Yn,Jn)},showMenuWithinBounds:(Qn,Zn,Yn,Jn,oo)=>{Qn.showMenuWithinBounds(Zn,Yn,Jn,oo)},hide:(Qn,Zn)=>{Qn.hide(Zn)},isOpen:(Qn,Zn)=>Qn.isOpen(Zn),getContent:(Qn,Zn)=>Qn.getContent(Zn),setContent:(Qn,Zn,Yn)=>{Qn.setContent(Zn,Yn)},reposition:(Qn,Zn)=>{Qn.reposition(Zn)}}});var $w=tinymce.util.Tools.resolve("tinymce.util.Delay");const yh=Mp({name:"Button",factory:Qn=>{const Zn=tv(Qn.action),Yn=Qn.dom.tag,Jn=lo=>Rr(Qn.dom,"attributes").bind(mo=>Rr(mo,lo)),oo=()=>{if(Yn==="button"){const lo=Jn("type").getOr("button"),mo=Jn("role").map(yo=>({role:yo})).getOr({});return{type:lo,...mo}}else return{role:Qn.role.getOr(Jn("role").getOr("button"))}};return{uid:Qn.uid,dom:Qn.dom,components:Qn.components,events:Zn,behaviours:Wg.augment(Qn.buttonBehaviours,[ol.config({}),Za.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:oo()},eventOrder:Qn.eventOrder}},configFields:[Gs("uid",void 0),Er("dom"),Gs("components",[]),Wg.field("buttonBehaviours",[ol,Za]),Tc("action"),Tc("role"),Gs("eventOrder",{})]}),v9=Qn=>{const Zn=Qn.dom.attributes!==void 0?Qn.dom.attributes:[];return za(Zn,(Yn,Jn)=>Jn.name==="class"?Yn:{...Yn,[Jn.name]:Jn.value},{})},y9=Qn=>Array.prototype.slice.call(Qn.dom.classList,0),vO=Qn=>{const Zn=Ds.fromHtml(Qn),Yn=kf(Zn),Jn=v9(Zn),oo=y9(Zn),lo=Yn.length===0?{}:{innerHtml:Rv(Zn)};return{tag:Nd(Zn),classes:oo,attributes:Jn,...lo}},ou=Qn=>{const Zn=T3(Qn)&&Su(Qn,"uid")?Qn.uid:Mv("memento");return{get:lo=>lo.getSystem().getByUid(Zn).getOrDie(),getOpt:lo=>lo.getSystem().getByUid(Zn).toOptional(),asSpec:()=>({...Qn,uid:Zn})}},{entries:aR,setPrototypeOf:lR,isFrozen:O9,getPrototypeOf:_9,getOwnPropertyDescriptor:S9}=Object;let{freeze:Zg,seal:nv,create:w9}=Object,{apply:CA,construct:cR}=typeof Reflect<"u"&&Reflect;CA||(CA=function(Zn,Yn,Jn){return Zn.apply(Yn,Jn)}),Zg||(Zg=function(Zn){return Zn}),nv||(nv=function(Zn){return Zn}),cR||(cR=function(Zn,Yn){return new Zn(...Yn)});const C9=o0(Array.prototype.forEach),k9=o0(Array.prototype.pop),Gx=o0(Array.prototype.push),kA=o0(String.prototype.toLowerCase),yO=o0(String.prototype.toString),x9=o0(String.prototype.match),ov=o0(String.prototype.replace),Rw=o0(String.prototype.indexOf),T5=o0(String.prototype.trim),mb=o0(RegExp.prototype.test),n0=E9(TypeError);function o0(Qn){return function(Zn){for(var Yn=arguments.length,Jn=new Array(Yn>1?Yn-1:0),oo=1;oo/gm),A5=nv(/\${[\w\W]*}/gm),R9=nv(/^data-[\-\w.\u00B7-\uFFFF]/),mR=nv(/^aria-[\-\w]+$/),pR=nv(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),D9=nv(/^(?:\w+script|data):/i),M9=nv(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),P5=nv(/^html$/i);var TA=Object.freeze({__proto__:null,MUSTACHE_EXPR:P9,ERB_EXPR:$9,TMPLIT_EXPR:A5,DATA_ATTR:R9,ARIA_ATTR:mR,IS_ALLOWED_URI:pR,IS_SCRIPT_OR_DATA:D9,ATTR_WHITESPACE:M9,DOCTYPE_NAME:P5});const N9=()=>typeof window>"u"?null:window,nE=function(Zn,Yn){if(typeof Zn!="object"||typeof Zn.createPolicy!="function")return null;let Jn=null;const oo="data-tt-policy-suffix";Yn&&Yn.hasAttribute(oo)&&(Jn=Yn.getAttribute(oo));const lo="dompurify"+(Jn?"#"+Jn:"");try{return Zn.createPolicy(lo,{createHTML(mo){return mo},createScriptURL(mo){return mo}})}catch{return console.warn("TrustedTypes policy "+lo+" could not be created."),null}};function oE(){let Qn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N9();const Zn=lc=>oE(lc);if(Zn.version="3.0.5",Zn.removed=[],!Qn||!Qn.document||Qn.document.nodeType!==9)return Zn.isSupported=!1,Zn;const Yn=Qn.document,Jn=Yn.currentScript;let{document:oo}=Qn;const{DocumentFragment:lo,HTMLTemplateElement:mo,Node:yo,Element:Co,NodeFilter:Ro,NamedNodeMap:Lo=Qn.NamedNodeMap||Qn.MozNamedAttrMap,HTMLFormElement:Wo,DOMParser:jo,trustedTypes:es}=Qn,us=Co.prototype,Ps=Kx(us,"cloneNode"),er=Kx(us,"nextSibling"),Bs=Kx(us,"childNodes"),Ns=Kx(us,"parentNode");if(typeof mo=="function"){const lc=oo.createElement("template");lc.content&&lc.content.ownerDocument&&(oo=lc.content.ownerDocument)}let Xs,Hr="";const{implementation:kr,createNodeIterator:Or,createDocumentFragment:qr,getElementsByTagName:na}=oo,{importNode:Dl}=Yn;let Sa={};Zn.isSupported=typeof aR=="function"&&typeof Ns=="function"&&kr&&kr.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:fl,ERB_EXPR:rl,TMPLIT_EXPR:Yc,DATA_ATTR:Ga,ARIA_ATTR:yc,IS_SCRIPT_OR_DATA:oa,ATTR_WHITESPACE:$a}=TA;let{IS_ALLOWED_URI:hl}=TA,gl=null;const Ka=mc({},[...uR,...dR,...Jx,...fR,...eE]);let kl=null;const $u=mc({},[...xA,...EA,...hR,...tE]);let Cc=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ih=null,Cg=null,xb=!0,m0=!0,dS=!1,rC=!0,hv=!1,PO=!1,CT=!1,TN=!1,E2=!1,l3=!1,sH=!1,zG=!0,WG=!1;const yK="user-content-";let AY=!0,AN=!1,c3={},u3=null;const UG=mc({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ZG=null;const qG=mc({},["audio","video","img","source","image","track"]);let PY=null;const jG=mc({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rH="http://www.w3.org/1998/Math/MathML",iH="http://www.w3.org/2000/svg",iC="http://www.w3.org/1999/xhtml";let d3=iC,$Y=!1,RY=null;const OK=mc({},[rH,iH,iC],yO);let kT;const _K=["application/xhtml+xml","text/html"],SK="text/html";let kg,f3=null;const wK=oo.createElement("form"),XG=function(gr){return gr instanceof RegExp||gr instanceof Function},DY=function(gr){if(!(f3&&f3===gr)){if((!gr||typeof gr!="object")&&(gr={}),gr=Dw(gr),kT=_K.indexOf(gr.PARSER_MEDIA_TYPE)===-1?kT=SK:kT=gr.PARSER_MEDIA_TYPE,kg=kT==="application/xhtml+xml"?yO:kA,gl="ALLOWED_TAGS"in gr?mc({},gr.ALLOWED_TAGS,kg):Ka,kl="ALLOWED_ATTR"in gr?mc({},gr.ALLOWED_ATTR,kg):$u,RY="ALLOWED_NAMESPACES"in gr?mc({},gr.ALLOWED_NAMESPACES,yO):OK,PY="ADD_URI_SAFE_ATTR"in gr?mc(Dw(jG),gr.ADD_URI_SAFE_ATTR,kg):jG,ZG="ADD_DATA_URI_TAGS"in gr?mc(Dw(qG),gr.ADD_DATA_URI_TAGS,kg):qG,u3="FORBID_CONTENTS"in gr?mc({},gr.FORBID_CONTENTS,kg):UG,Ih="FORBID_TAGS"in gr?mc({},gr.FORBID_TAGS,kg):{},Cg="FORBID_ATTR"in gr?mc({},gr.FORBID_ATTR,kg):{},c3="USE_PROFILES"in gr?gr.USE_PROFILES:!1,xb=gr.ALLOW_ARIA_ATTR!==!1,m0=gr.ALLOW_DATA_ATTR!==!1,dS=gr.ALLOW_UNKNOWN_PROTOCOLS||!1,rC=gr.ALLOW_SELF_CLOSE_IN_ATTR!==!1,hv=gr.SAFE_FOR_TEMPLATES||!1,PO=gr.WHOLE_DOCUMENT||!1,E2=gr.RETURN_DOM||!1,l3=gr.RETURN_DOM_FRAGMENT||!1,sH=gr.RETURN_TRUSTED_TYPE||!1,TN=gr.FORCE_BODY||!1,zG=gr.SANITIZE_DOM!==!1,WG=gr.SANITIZE_NAMED_PROPS||!1,AY=gr.KEEP_CONTENT!==!1,AN=gr.IN_PLACE||!1,hl=gr.ALLOWED_URI_REGEXP||pR,d3=gr.NAMESPACE||iC,Cc=gr.CUSTOM_ELEMENT_HANDLING||{},gr.CUSTOM_ELEMENT_HANDLING&&XG(gr.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Cc.tagNameCheck=gr.CUSTOM_ELEMENT_HANDLING.tagNameCheck),gr.CUSTOM_ELEMENT_HANDLING&&XG(gr.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Cc.attributeNameCheck=gr.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),gr.CUSTOM_ELEMENT_HANDLING&&typeof gr.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Cc.allowCustomizedBuiltInElements=gr.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),hv&&(m0=!1),l3&&(E2=!0),c3&&(gl=mc({},[...eE]),kl=[],c3.html===!0&&(mc(gl,uR),mc(kl,xA)),c3.svg===!0&&(mc(gl,dR),mc(kl,EA),mc(kl,tE)),c3.svgFilters===!0&&(mc(gl,Jx),mc(kl,EA),mc(kl,tE)),c3.mathMl===!0&&(mc(gl,fR),mc(kl,hR),mc(kl,tE))),gr.ADD_TAGS&&(gl===Ka&&(gl=Dw(gl)),mc(gl,gr.ADD_TAGS,kg)),gr.ADD_ATTR&&(kl===$u&&(kl=Dw(kl)),mc(kl,gr.ADD_ATTR,kg)),gr.ADD_URI_SAFE_ATTR&&mc(PY,gr.ADD_URI_SAFE_ATTR,kg),gr.FORBID_CONTENTS&&(u3===UG&&(u3=Dw(u3)),mc(u3,gr.FORBID_CONTENTS,kg)),AY&&(gl["#text"]=!0),PO&&mc(gl,["html","head","body"]),gl.table&&(mc(gl,["tbody"]),delete Ih.tbody),gr.TRUSTED_TYPES_POLICY){if(typeof gr.TRUSTED_TYPES_POLICY.createHTML!="function")throw n0('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof gr.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw n0('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Xs=gr.TRUSTED_TYPES_POLICY,Hr=Xs.createHTML("")}else Xs===void 0&&(Xs=nE(es,Jn)),Xs!==null&&typeof Hr=="string"&&(Hr=Xs.createHTML(""));Zg&&Zg(gr),f3=gr}},YG=mc({},["mi","mo","mn","ms","mtext"]),GG=mc({},["foreignobject","desc","title","annotation-xml"]),CK=mc({},["title","style","font","a","script"]),aH=mc({},dR);mc(aH,Jx),mc(aH,T9);const MY=mc({},fR);mc(MY,A9);const kK=function(gr){let Ia=Ns(gr);(!Ia||!Ia.tagName)&&(Ia={namespaceURI:d3,tagName:"template"});const bl=kA(gr.tagName),Bf=kA(Ia.tagName);return RY[gr.namespaceURI]?gr.namespaceURI===iH?Ia.namespaceURI===iC?bl==="svg":Ia.namespaceURI===rH?bl==="svg"&&(Bf==="annotation-xml"||YG[Bf]):!!aH[bl]:gr.namespaceURI===rH?Ia.namespaceURI===iC?bl==="math":Ia.namespaceURI===iH?bl==="math"&&GG[Bf]:!!MY[bl]:gr.namespaceURI===iC?Ia.namespaceURI===iH&&!GG[Bf]||Ia.namespaceURI===rH&&!YG[Bf]?!1:!MY[bl]&&(CK[bl]||!aH[bl]):!!(kT==="application/xhtml+xml"&&RY[gr.namespaceURI]):!1},xT=function(gr){Gx(Zn.removed,{element:gr});try{gr.parentNode.removeChild(gr)}catch{gr.remove()}},PN=function(gr,Ia){try{Gx(Zn.removed,{attribute:Ia.getAttributeNode(gr),from:Ia})}catch{Gx(Zn.removed,{attribute:null,from:Ia})}if(Ia.removeAttribute(gr),gr==="is"&&!kl[gr])if(E2||l3)try{xT(Ia)}catch{}else try{Ia.setAttribute(gr,"")}catch{}},KG=function(gr){let Ia,bl;if(TN)gr=""+gr;else{const Dy=x9(gr,/^[\r\n\t ]+/);bl=Dy&&Dy[0]}kT==="application/xhtml+xml"&&d3===iC&&(gr=''+gr+"");const Bf=Xs?Xs.createHTML(gr):gr;if(d3===iC)try{Ia=new jo().parseFromString(Bf,kT)}catch{}if(!Ia||!Ia.documentElement){Ia=kr.createDocument(d3,"template",null);try{Ia.documentElement.innerHTML=$Y?Hr:Bf}catch{}}const xg=Ia.body||Ia.documentElement;return gr&&bl&&xg.insertBefore(oo.createTextNode(bl),xg.childNodes[0]||null),d3===iC?na.call(Ia,PO?"html":"body")[0]:PO?Ia.documentElement:xg},JG=function(gr){return Or.call(gr.ownerDocument||gr,gr,Ro.SHOW_ELEMENT|Ro.SHOW_COMMENT|Ro.SHOW_TEXT,null,!1)},xK=function(gr){return gr instanceof Wo&&(typeof gr.nodeName!="string"||typeof gr.textContent!="string"||typeof gr.removeChild!="function"||!(gr.attributes instanceof Lo)||typeof gr.removeAttribute!="function"||typeof gr.setAttribute!="function"||typeof gr.namespaceURI!="string"||typeof gr.insertBefore!="function"||typeof gr.hasChildNodes!="function")},lH=function(gr){return typeof yo=="object"?gr instanceof yo:gr&&typeof gr=="object"&&typeof gr.nodeType=="number"&&typeof gr.nodeName=="string"},aC=function(gr,Ia,bl){Sa[gr]&&C9(Sa[gr],Bf=>{Bf.call(Zn,Ia,bl,f3)})},eK=function(gr){let Ia;if(aC("beforeSanitizeElements",gr,null),xK(gr))return xT(gr),!0;const bl=kg(gr.nodeName);if(aC("uponSanitizeElement",gr,{tagName:bl,allowedTags:gl}),gr.hasChildNodes()&&!lH(gr.firstElementChild)&&(!lH(gr.content)||!lH(gr.content.firstElementChild))&&mb(/<[/\w]/g,gr.innerHTML)&&mb(/<[/\w]/g,gr.textContent))return xT(gr),!0;if(!gl[bl]||Ih[bl]){if(!Ih[bl]&&nK(bl)&&(Cc.tagNameCheck instanceof RegExp&&mb(Cc.tagNameCheck,bl)||Cc.tagNameCheck instanceof Function&&Cc.tagNameCheck(bl)))return!1;if(AY&&!u3[bl]){const Bf=Ns(gr)||gr.parentNode,xg=Bs(gr)||gr.childNodes;if(xg&&Bf){const Dy=xg.length;for(let tm=Dy-1;tm>=0;--tm)Bf.insertBefore(Ps(xg[tm],!0),er(gr))}}return xT(gr),!0}return gr instanceof Co&&!kK(gr)||(bl==="noscript"||bl==="noembed"||bl==="noframes")&&mb(/<\/no(script|embed|frames)/i,gr.innerHTML)?(xT(gr),!0):(hv&&gr.nodeType===3&&(Ia=gr.textContent,Ia=ov(Ia,fl," "),Ia=ov(Ia,rl," "),Ia=ov(Ia,Yc," "),gr.textContent!==Ia&&(Gx(Zn.removed,{element:gr.cloneNode()}),gr.textContent=Ia)),aC("afterSanitizeElements",gr,null),!1)},tK=function(gr,Ia,bl){if(zG&&(Ia==="id"||Ia==="name")&&(bl in oo||bl in wK))return!1;if(!(m0&&!Cg[Ia]&&mb(Ga,Ia))){if(!(xb&&mb(yc,Ia))){if(!kl[Ia]||Cg[Ia]){if(!(nK(gr)&&(Cc.tagNameCheck instanceof RegExp&&mb(Cc.tagNameCheck,gr)||Cc.tagNameCheck instanceof Function&&Cc.tagNameCheck(gr))&&(Cc.attributeNameCheck instanceof RegExp&&mb(Cc.attributeNameCheck,Ia)||Cc.attributeNameCheck instanceof Function&&Cc.attributeNameCheck(Ia))||Ia==="is"&&Cc.allowCustomizedBuiltInElements&&(Cc.tagNameCheck instanceof RegExp&&mb(Cc.tagNameCheck,bl)||Cc.tagNameCheck instanceof Function&&Cc.tagNameCheck(bl))))return!1}else if(!PY[Ia]){if(!mb(hl,ov(bl,$a,""))){if(!((Ia==="src"||Ia==="xlink:href"||Ia==="href")&&gr!=="script"&&Rw(bl,"data:")===0&&ZG[gr])){if(!(dS&&!mb(oa,ov(bl,$a,"")))){if(bl)return!1}}}}}}return!0},nK=function(gr){return gr.indexOf("-")>0},oK=function(gr){let Ia,bl,Bf,xg;aC("beforeSanitizeAttributes",gr,null);const{attributes:Dy}=gr;if(!Dy)return;const tm={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:kl};for(xg=Dy.length;xg--;){Ia=Dy[xg];const{name:My,namespaceURI:NY}=Ia;bl=My==="value"?Ia.value:T5(Ia.value);const TK=bl;if(Bf=kg(My),tm.attrName=Bf,tm.attrValue=bl,tm.keepAttr=!0,tm.forceKeepAttr=void 0,aC("uponSanitizeAttribute",gr,tm),bl=tm.attrValue,tm.forceKeepAttr)continue;if(!tm.keepAttr){PN(My,gr);continue}if(!rC&&mb(/\/>/i,bl)){PN(My,gr);continue}hv&&(bl=ov(bl,fl," "),bl=ov(bl,rl," "),bl=ov(bl,Yc," "));const sK=kg(gr.nodeName);if(!tK(sK,Bf,bl)){PN(My,gr);continue}if(WG&&(Bf==="id"||Bf==="name")&&(PN(My,gr),bl=yK+bl),Xs&&typeof es=="object"&&typeof es.getAttributeType=="function"&&!NY)switch(es.getAttributeType(sK,Bf)){case"TrustedHTML":{bl=Xs.createHTML(bl);break}case"TrustedScriptURL":{bl=Xs.createScriptURL(bl);break}}if(bl!==TK)try{NY?gr.setAttributeNS(NY,My,bl):gr.setAttribute(My,bl)}catch{PN(My,gr)}}aC("afterSanitizeAttributes",gr,null)},EK=function lc(gr){let Ia;const bl=JG(gr);for(aC("beforeSanitizeShadowDOM",gr,null);Ia=bl.nextNode();)aC("uponSanitizeShadowNode",Ia,null),!eK(Ia)&&(Ia.content instanceof lo&&lc(Ia.content),oK(Ia));aC("afterSanitizeShadowDOM",gr,null)};return Zn.sanitize=function(lc){let gr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ia,bl,Bf,xg;if($Y=!lc,$Y&&(lc=""),typeof lc!="string"&&!lH(lc))if(typeof lc.toString=="function"){if(lc=lc.toString(),typeof lc!="string")throw n0("dirty is not a string, aborting")}else throw n0("toString is not a function");if(!Zn.isSupported)return lc;if(CT||DY(gr),Zn.removed=[],typeof lc=="string"&&(AN=!1),AN){if(lc.nodeName){const My=kg(lc.nodeName);if(!gl[My]||Ih[My])throw n0("root node is forbidden and cannot be sanitized in-place")}}else if(lc instanceof yo)Ia=KG(""),bl=Ia.ownerDocument.importNode(lc,!0),bl.nodeType===1&&bl.nodeName==="BODY"||bl.nodeName==="HTML"?Ia=bl:Ia.appendChild(bl);else{if(!E2&&!hv&&!PO&&lc.indexOf("<")===-1)return Xs&&sH?Xs.createHTML(lc):lc;if(Ia=KG(lc),!Ia)return E2?null:sH?Hr:""}Ia&&TN&&xT(Ia.firstChild);const Dy=JG(AN?lc:Ia);for(;Bf=Dy.nextNode();)eK(Bf)||(Bf.content instanceof lo&&EK(Bf.content),oK(Bf));if(AN)return lc;if(E2){if(l3)for(xg=qr.call(Ia.ownerDocument);Ia.firstChild;)xg.appendChild(Ia.firstChild);else xg=Ia;return(kl.shadowroot||kl.shadowrootmode)&&(xg=Dl.call(Yn,xg,!0)),xg}let tm=PO?Ia.outerHTML:Ia.innerHTML;return PO&&gl["!doctype"]&&Ia.ownerDocument&&Ia.ownerDocument.doctype&&Ia.ownerDocument.doctype.name&&mb(P5,Ia.ownerDocument.doctype.name)&&(tm=" +`+tm),hv&&(tm=ov(tm,fl," "),tm=ov(tm,rl," "),tm=ov(tm,Yc," ")),Xs&&sH?Xs.createHTML(tm):tm},Zn.setConfig=function(lc){DY(lc),CT=!0},Zn.clearConfig=function(){f3=null,CT=!1},Zn.isValidAttribute=function(lc,gr,Ia){f3||DY({});const bl=kg(lc),Bf=kg(gr);return tK(bl,Bf,Ia)},Zn.addHook=function(lc,gr){typeof gr=="function"&&(Sa[lc]=Sa[lc]||[],Gx(Sa[lc],gr))},Zn.removeHook=function(lc){if(Sa[lc])return k9(Sa[lc])},Zn.removeHooks=function(lc){Sa[lc]&&(Sa[lc]=[])},Zn.removeAllHooks=function(){Sa={}},Zn}var $5=oE();const gR=Qn=>$5().sanitize(Qn);var _1=tinymce.util.Tools.resolve("tinymce.util.I18n");const L9={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},R5="temporary-placeholder",bR=Qn=>()=>Rr(Qn,R5).getOr("!not found!"),sE=(Qn,Zn)=>{const Yn=Qn.toLowerCase();if(_1.isRtl()){const Jn=Vc(Yn,"-rtl");return Pl(Zn,Jn)?Jn:Yn}else return Yn},vR=(Qn,Zn)=>Rr(Zn,sE(Qn,Zn)),yR=(Qn,Zn)=>{const Yn=Zn();return vR(Qn,Yn).getOrThunk(bR(Yn))},OR=(Qn,Zn,Yn)=>{const Jn=Zn();return vR(Qn,Jn).or(Yn).getOrThunk(bR(Jn))},I9=Qn=>_1.isRtl()?Pl(L9,Qn):!1,AA=()=>Rl("add-focusable",[eu(Qn=>{GO(Qn.element,"svg").each(Zn=>aa(Zn,"focusable","false"))})]),D5=(Qn,Zn,Yn,Jn)=>{var oo,lo;const mo=I9(Zn)?["tox-icon--flip"]:[],yo=Rr(Yn,sE(Zn,Yn)).or(Jn).getOrThunk(bR(Yn));return{dom:{tag:Qn.tag,attributes:(oo=Qn.attributes)!==null&&oo!==void 0?oo:{},classes:Qn.classes.concat(mo),innerHtml:yo},behaviours:Zr([...(lo=Qn.behaviours)!==null&&lo!==void 0?lo:[],AA()])}},s0=(Qn,Zn,Yn,Jn=ko.none())=>D5(Zn,Qn,Yn(),Jn),B9=(Qn,Zn,Yn)=>{const Jn=Yn(),oo=Zs(Qn,lo=>Pl(Jn,sE(lo,Jn)));return D5(Zn,oo.getOr(R5),Jn,ko.none())},M5={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},_R=Mp({name:"Notification",factory:Qn=>{const Zn=ou({dom:vO(`

    ${gR(Qn.translationProvider(Qn.text))}

    `),behaviours:Zr([Cl.config({})])}),Yn=es=>({dom:{tag:"div",classes:["tox-bar"],styles:{width:`${es}%`}}}),Jn=es=>({dom:{tag:"div",classes:["tox-text"],innerHtml:`${es}%`}}),oo=ou({dom:{tag:"div",classes:Qn.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[Yn(0)]},Jn(0)],behaviours:Zr([Cl.config({})])}),yo={updateProgress:(es,us)=>{es.getSystem().isConnected()&&oo.getOpt(es).each(Ps=>{Cl.set(Ps,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[Yn(us)]},Jn(us)])})},updateText:(es,us)=>{if(es.getSystem().isConnected()){const Ps=Zn.get(es);Cl.set(Ps,[wd(us)])}}},Co=Us([Qn.icon.toArray(),Qn.level.toArray(),Qn.level.bind(es=>ko.from(M5[es])).toArray()]),Ro=ou(yh.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[s0("close",{tag:"span",classes:["tox-icon"],attributes:{"aria-label":Qn.translationProvider("Close")}},Qn.iconProvider)],action:es=>{Qn.onAction(es)}})),Lo=B9(Co,{tag:"div",classes:["tox-notification__icon"]},Qn.iconProvider),Wo={dom:{tag:"div",classes:["tox-notification__body"]},components:[Zn.asSpec()],behaviours:Zr([Cl.config({})])},jo=[Lo,Wo];return{uid:Qn.uid,dom:{tag:"div",attributes:{role:"alert"},classes:Qn.level.map(es=>["tox-notification","tox-notification--in",`tox-notification--${es}`]).getOr(["tox-notification","tox-notification--in"])},behaviours:Zr([ol.config({}),Rl("notification-events",[wr(Wu(),es=>{Ro.getOpt(es).each(ol.focus)})])]),components:jo.concat(Qn.progress?[oo.asSpec()]:[]).concat(Qn.closeButton?[Ro.asSpec()]:[]),apis:yo}},configFields:[Tc("level"),Er("progress"),Tc("icon"),Er("onAction"),Er("text"),Er("iconProvider"),Er("translationProvider"),Xd("closeButton",!0)],apis:{updateProgress:(Qn,Zn,Yn)=>{Qn.updateProgress(Zn,Yn)},updateText:(Qn,Zn,Yn)=>{Qn.updateText(Zn,Yn)}}});var SR=(Qn,Zn,Yn)=>{const Jn=Zn.backstage.shared,oo=()=>{const Co=au(Ds.fromDom(Qn.getContentAreaContainer())),Ro=tf(),Lo=rp(Ro.x,Co.x,Co.right),Wo=rp(Ro.y,Co.y,Co.bottom),jo=Math.max(Co.right,Ro.right),es=Math.max(Co.bottom,Ro.bottom);return ko.some(Kc(Lo,Wo,jo-Lo,es-Wo))};return{open:(Co,Ro)=>{const Lo=()=>{Ro(),kd.hide(jo)},Wo=gh(_R.sketch({text:Co.text,level:Fs(["success","error","warning","warn","info"],Co.type)?Co.type:void 0,progress:Co.progressBar===!0,icon:Co.icon,closeButton:Co.closeButton,onAction:Lo,iconProvider:Jn.providers.icons,translationProvider:Jn.providers.translate})),jo=gh(kd.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:Jn.getSink,fireDismissalEventInstead:{},...Jn.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}}}));Yn.add(jo),$o(Co.timeout)&&Co.timeout>0&&$w.setEditorTimeout(Qn,()=>{Lo()},Co.timeout);const us={close:Lo,reposition:()=>{const Ps=Fm(Wo),er={maxHeightFunction:zg()},Bs=Qn.notificationManager.getNotifications();if(Bs[0]===us){const Ns={...Jn.anchors.banner(),overrides:er};kd.showWithinBounds(jo,Ps,{anchor:Ns},oo)}else ws(Bs,us).each(Ns=>{const Xs=Bs[Ns-1].getEl(),Hr={type:"node",root:Ru(),node:ko.some(Ds.fromDom(Xs)),overrides:er,layouts:{onRtl:()=>[bu],onLtr:()=>[bu]}};kd.showWithinBounds(jo,Ps,{anchor:Hr},oo)})},text:Ps=>{_R.updateText(Wo,Ps)},settings:Co,getEl:()=>Wo.element.dom,progressBar:{value:Ps=>{_R.updateProgress(Wo,Ps)}}};return us},close:Co=>{Co.close()},getArgs:Co=>Co.settings}},Mw=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),N5=tinymce.util.Tools.resolve("tinymce.EditorManager"),xk=tinymce.util.Tools.resolve("tinymce.Env"),qg;(function(Qn){Qn.default="wrap",Qn.floating="floating",Qn.sliding="sliding",Qn.scrolling="scrolling"})(qg||(qg={}));var rE;(function(Qn){Qn.auto="auto",Qn.top="top",Qn.bottom="bottom"})(rE||(rE={}));const Iu=Qn=>Zn=>Zn.options.get(Qn),iE=Qn=>Zn=>ko.from(Qn(Zn)),L5=Qn=>{const Zn=xk.deviceType.isPhone(),Yn=xk.deviceType.isTablet()||Zn,Jn=Qn.options.register,oo=mo=>qn(mo)||mo===!1,lo=mo=>qn(mo)||$o(mo);Jn("skin",{processor:mo=>qn(mo)||mo===!1,default:"oxide"}),Jn("skin_url",{processor:"string"}),Jn("height",{processor:lo,default:Math.max(Qn.getElement().offsetHeight,400)}),Jn("width",{processor:lo,default:Mw.DOM.getStyle(Qn.getElement(),"width")}),Jn("min_height",{processor:"number",default:100}),Jn("min_width",{processor:"number"}),Jn("max_height",{processor:"number"}),Jn("max_width",{processor:"number"}),Jn("style_formats",{processor:"object[]"}),Jn("style_formats_merge",{processor:"boolean",default:!1}),Jn("style_formats_autohide",{processor:"boolean",default:!1}),Jn("line_height_formats",{processor:"string",default:"1 1.1 1.2 1.3 1.4 1.5 2"}),Jn("font_family_formats",{processor:"string",default:"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"}),Jn("font_size_formats",{processor:"string",default:"8pt 10pt 12pt 14pt 18pt 24pt 36pt"}),Jn("font_size_input_default_unit",{processor:"string",default:"pt"}),Jn("block_formats",{processor:"string",default:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre"}),Jn("content_langs",{processor:"object[]"}),Jn("removed_menuitems",{processor:"string",default:""}),Jn("menubar",{processor:mo=>qn(mo)||uo(mo),default:!Zn}),Jn("menu",{processor:"object",default:{}}),Jn("toolbar",{processor:mo=>uo(mo)||qn(mo)||to(mo)?{value:mo,valid:!0}:{valid:!1,message:"Must be a boolean, string or array."},default:!0}),_r(9,mo=>{Jn("toolbar"+(mo+1),{processor:"string"})}),Jn("toolbar_mode",{processor:"string",default:Yn?"scrolling":"floating"}),Jn("toolbar_groups",{processor:"object",default:{}}),Jn("toolbar_location",{processor:"string",default:rE.auto}),Jn("toolbar_persist",{processor:"boolean",default:!1}),Jn("toolbar_sticky",{processor:"boolean",default:Qn.inline}),Jn("toolbar_sticky_offset",{processor:"number",default:0}),Jn("fixed_toolbar_container",{processor:"string",default:""}),Jn("fixed_toolbar_container_target",{processor:"object"}),Jn("ui_mode",{processor:"string",default:"combined"}),Jn("file_picker_callback",{processor:"function"}),Jn("file_picker_validator_handler",{processor:"function"}),Jn("file_picker_types",{processor:"string"}),Jn("typeahead_urls",{processor:"boolean",default:!0}),Jn("anchor_top",{processor:oo,default:"#top"}),Jn("anchor_bottom",{processor:oo,default:"#bottom"}),Jn("draggable_modal",{processor:"boolean",default:!1}),Jn("statusbar",{processor:"boolean",default:!0}),Jn("elementpath",{processor:"boolean",default:!0}),Jn("branding",{processor:"boolean",default:!0}),Jn("promotion",{processor:"boolean",default:!0}),Jn("resize",{processor:mo=>mo==="both"||uo(mo),default:!xk.deviceType.isTouch()}),Jn("sidebar_show",{processor:"string"}),Jn("help_accessibility",{processor:"boolean",default:Qn.hasPlugin("help")}),Jn("default_font_stack",{processor:"string[]",default:[]})},I5=Iu("readonly"),PA=Iu("height"),aE=Iu("width"),wR=iE(Iu("min_width")),Ek=iE(Iu("min_height")),$A=iE(Iu("max_width")),CR=iE(Iu("max_height")),B5=iE(Iu("style_formats")),F5=Iu("style_formats_merge"),H5=Iu("style_formats_autohide"),Q5=Iu("content_langs"),kR=Iu("removed_menuitems"),Tk=Iu("toolbar_mode"),V5=Iu("toolbar_groups"),lE=Iu("toolbar_location"),Nw=Iu("fixed_toolbar_container"),F9=Iu("fixed_toolbar_container_target"),z5=Iu("toolbar_persist"),RA=Iu("toolbar_sticky_offset"),xR=Iu("menubar"),DA=Iu("toolbar"),W5=Iu("file_picker_callback"),ER=Iu("file_picker_validator_handler"),U5=Iu("font_size_input_default_unit"),TR=Iu("file_picker_types"),AR=Iu("typeahead_urls"),MA=Iu("anchor_top"),Z5=Iu("anchor_bottom"),PR=Iu("draggable_modal"),q5=Iu("statusbar"),Ak=Iu("elementpath"),$R=Iu("branding"),j5=Iu("resize"),NA=Iu("paste_as_text"),LA=Iu("sidebar_show"),X5=Iu("promotion"),IA=Iu("help_accessibility"),Y5=Iu("default_font_stack"),RR=Qn=>Qn.options.get("skin")===!1,Pk=Qn=>Qn.options.get("menubar")!==!1,BA=Qn=>{const Zn=Qn.options.get("skin_url");if(RR(Qn))return Zn;if(Zn)return Qn.documentBaseURI.toAbsolute(Zn);{const Yn=Qn.options.get("skin");return N5.baseURL+"/skins/ui/"+Yn}},FA=Qn=>ko.from(Qn.options.get("skin_url")),G5=Qn=>Qn.options.get("line_height_formats").split(" "),HA=Qn=>{const Zn=DA(Qn),Yn=qn(Zn),Jn=to(Zn)&&Zn.length>0;return!cE(Qn)&&(Jn||Yn||Zn===!0)},DR=Qn=>{const Zn=_r(9,Jn=>Qn.options.get("toolbar"+(Jn+1))),Yn=ga(Zn,qn);return Mr(Yn.length>0,Yn)},cE=Qn=>DR(Qn).fold(()=>{const Zn=DA(Qn);return Do(Zn,qn)&&Zn.length>0},Js),MR=Qn=>lE(Qn)===rE.bottom,K5=Qn=>{var Zn;if(!Qn.inline)return ko.none();const Yn=(Zn=Nw(Qn))!==null&&Zn!==void 0?Zn:"";if(Yn.length>0)return Rd(Ru(),Yn);const Jn=F9(Qn);return Oo(Jn)?ko.some(Ds.fromDom(Jn)):ko.none()},$k=Qn=>Qn.inline&&K5(Qn).isSome(),NR=Qn=>K5(Qn).getOrThunk(()=>Fr(rr(Ds.fromDom(Qn.getElement())))),LR=Qn=>Qn.inline&&!Pk(Qn)&&!HA(Qn)&&!cE(Qn),uE=Qn=>(Qn.options.get("toolbar_sticky")||Qn.inline)&&!$k(Qn)&&!LR(Qn),gy=Qn=>!$k(Qn)&&Qn.options.get("ui_mode")==="split",J5=Qn=>{const Zn=Qn.options.get("menu");return Vl(Zn,Yn=>({...Yn,items:Yn.items}))};var H9=Object.freeze({__proto__:null,get ToolbarMode(){return qg},get ToolbarLocation(){return rE},register:L5,getSkinUrl:BA,getSkinUrlOption:FA,isReadOnly:I5,isSkinDisabled:RR,getHeightOption:PA,getWidthOption:aE,getMinWidthOption:wR,getMinHeightOption:Ek,getMaxWidthOption:$A,getMaxHeightOption:CR,getUserStyleFormats:B5,shouldMergeStyleFormats:F5,shouldAutoHideStyleFormats:H5,getLineHeightFormats:G5,getContentLanguages:Q5,getRemovedMenuItems:kR,isMenubarEnabled:Pk,isMultipleToolbars:cE,isToolbarEnabled:HA,isToolbarPersist:z5,getMultipleToolbarsOption:DR,getUiContainer:NR,useFixedContainer:$k,isSplitUiMode:gy,getToolbarMode:Tk,isDraggableModal:PR,isDistractionFree:LR,isStickyToolbar:uE,getStickyToolbarOffset:RA,getToolbarLocation:lE,isToolbarLocationBottom:MR,getToolbarGroups:V5,getMenus:J5,getMenubar:xR,getToolbar:DA,getFilePickerCallback:W5,getFilePickerTypes:TR,useTypeaheadUrls:AR,getAnchorTop:MA,getAnchorBottom:Z5,getFilePickerValidatorHandler:ER,getFontSizeInputDefaultUnit:U5,useStatusBar:q5,useElementPath:Ak,promotionEnabled:X5,useBranding:$R,getResize:j5,getPasteAsText:NA,getSidebarShow:LA,useHelpAccessibility:IA,getDefaultFontStack:Y5});const eL="[data-mce-autocompleter]",IR=Qn=>Bg(Qn,eL),Q9=Qn=>Rd(Qn,eL),V9={setup:(Qn,Zn)=>{const Yn=(oo,lo)=>{Qa(oo,op(),{raw:lo})},Jn=()=>Qn.getMenu().bind(Bc.getHighlighted);Zn.on("keydown",oo=>{const lo=oo.which;Qn.isActive()&&(Qn.isMenuOpen()?lo===13?(Jn().each(og),oo.preventDefault()):lo===40?(Jn().fold(()=>{Qn.getMenu().each(Bc.highlightFirst)},mo=>{Yn(mo,oo)}),oo.preventDefault(),oo.stopImmediatePropagation()):(lo===37||lo===38||lo===39)&&Jn().each(mo=>{Yn(mo,oo),oo.preventDefault(),oo.stopImmediatePropagation()}):(lo===13||lo===38||lo===40)&&Qn.cancelIfNecessary())}),Zn.on("NodeChange",oo=>{Qn.isActive()&&!Qn.isProcessingAction()&&IR(Ds.fromDom(oo.element)).isNone()&&Qn.cancelIfNecessary()})}};var BR;(function(Qn){Qn[Qn.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",Qn[Qn.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"})(BR||(BR={}));var sv=BR;const FR="tox-menu-nav__js",Rk="tox-collection__item",HR="tox-swatch",z9={normal:FR,color:HR},tL="tox-collection__item--enabled",W9="tox-collection__group-heading",nL="tox-collection__item-icon",QR="tox-collection__item-label",U9="tox-collection__item-accessory",oL="tox-collection__item-caret",Z9="tox-collection__item-checkmark",dE="tox-collection__item--active",sL="tox-collection__item-container",q9="tox-collection__item-container--column",rL="tox-collection__item-container--row",QA="tox-collection__item-container--align-right",j9="tox-collection__item-container--align-left",VR="tox-collection__item-container--valign-top",X9="tox-collection__item-container--valign-middle",Y9="tox-collection__item-container--valign-bottom",iL=Qn=>Rr(z9,Qn).getOr(FR),aL=Qn=>Qn==="color"?"tox-swatches":"tox-menu",zR=Qn=>({backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:aL(Qn),tieredMenu:"tox-tiered-menu"}),OO=Qn=>{const Zn=zR(Qn);return{backgroundMenu:Zn.backgroundMenu,selectedMenu:Zn.selectedMenu,menu:Zn.menu,selectedItem:Zn.selectedItem,item:iL(Qn)}},WR=(Qn,Zn,Yn)=>{const Jn=zR(Yn);return{tag:"div",classes:Us([[Jn.menu,`tox-menu-${Zn}-column`],Qn?[Jn.hasIcons]:[]])}},lL=[Pw.parts.items({})],Dk=(Qn,Zn,Yn)=>{const Jn=zR(Yn);return{dom:{tag:"div",classes:Us([[Jn.tieredMenu]])},markers:OO(Yn)}},fE=Mo([Tc("data"),Gs("inputAttributes",{}),Gs("inputStyles",{}),Gs("tag","input"),Gs("inputClasses",[]),rc("onSetValue"),Gs("styles",{}),Gs("eventOrder",{}),Nf("inputBehaviours",[da,ol]),Gs("selectOnFocus",!0)]),UR=Qn=>Zr([ol.config({onFocus:Qn.selectOnFocus?Zn=>{const Yn=Zn.element,Jn=c1(Yn);Yn.dom.setSelectionRange(0,Jn.length)}:xo})]),by=Qn=>({...UR(Qn),...sf(Qn.inputBehaviours,[da.config({store:{mode:"manual",...Qn.data.map(Zn=>({initialValue:Zn})).getOr({}),getValue:Zn=>c1(Zn.element),setValue:(Zn,Yn)=>{c1(Zn.element)!==Yn&&Wv(Zn.element,Yn)}},onSetValue:Qn.onSetValue})])}),VA=Qn=>({tag:Qn.tag,attributes:{type:"text",...Qn.inputAttributes},styles:Qn.inputStyles,classes:Qn.inputClasses}),G9=(Qn,Zn)=>({uid:Qn.uid,dom:VA(Qn),components:[],behaviours:by(Qn),eventOrder:Qn.eventOrder}),Lw=Mp({name:"Input",configFields:fE(),factory:G9}),cL=ba("refetch-trigger-event"),uL=ba("redirect-menu-item-interaction"),Mk="tox-menu__searcher",zA=Qn=>Rd(Qn.element,`.${Mk}`).bind(Zn=>Qn.getSystem().getByDom(Zn).toOptional()),ZR=zA,qR=(Qn,Zn)=>{da.setValue(Qn,Zn.fetchPattern),Qn.element.dom.selectionStart=Zn.selectionStart,Qn.element.dom.selectionEnd=Zn.selectionEnd},dL=Qn=>{const Zn=da.getValue(Qn),Yn=Qn.element.dom.selectionStart,Jn=Qn.element.dom.selectionEnd;return{fetchPattern:Zn,selectionStart:Yn,selectionEnd:Jn}},jR=(Qn,Zn)=>{Uo(Zn.element,"id").each(Yn=>aa(Qn.element,"aria-activedescendant",Yn))},XR=Qn=>{const Zn=(oo,lo)=>(lo.cut(),ko.none()),Yn=(oo,lo)=>{const mo={interactionEvent:lo.event,eventType:lo.event.raw.type};return Qa(oo,uL,mo),ko.some(!0)},Jn="searcher-events";return{dom:{tag:"div",classes:[Rk]},components:[Lw.sketch({inputClasses:[Mk,"tox-textfield"],inputAttributes:{...Qn.placeholder.map(oo=>({placeholder:Qn.i18n(oo)})).getOr({}),type:"search","aria-autocomplete":"list"},inputBehaviours:Zr([Rl(Jn,[wr(o1(),oo=>{Wl(oo,cL)}),wr(op(),(oo,lo)=>{lo.event.raw.key==="Escape"&&lo.stop()})]),Za.config({mode:"special",onLeft:Zn,onRight:Zn,onSpace:Zn,onEnter:Yn,onEscape:Yn,onUp:Yn,onDown:Yn})]),eventOrder:{keydown:[Jn,Za.name()]}})]}},WA="tox-collection--results__js",YR=Qn=>{var Zn;return Qn.dom?{...Qn,dom:{...Qn.dom,attributes:{...(Zn=Qn.dom.attributes)!==null&&Zn!==void 0?Zn:{},id:ba("aria-item-search-result-id"),"aria-selected":"false"}}}:Qn},UA=(Qn,Zn)=>Yn=>{const Jn=ha(Yn,Zn);return hs(Jn,oo=>({dom:Qn,components:oo}))},K9=Qn=>({dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Pw.parts.items({preprocess:Qn!=="auto"?UA({tag:"div",classes:["tox-swatches__row"]},Qn):Go})]}]}),J9=Qn=>({dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Pw.parts.items({preprocess:UA({tag:"div",classes:["tox-collection__group"]},Qn)})]}),fL=(Qn,Zn)=>{const Yn=[];let Jn=[];return Qs(Qn,(oo,lo)=>{Zn(oo,lo)?(Jn.length>0&&Yn.push(Jn),Jn=[],(Pl(oo.dom,"innerHtml")||oo.components&&oo.components.length>0)&&Jn.push(oo)):Jn.push(oo)}),Jn.length>0&&Yn.push(Jn),hs(Yn,oo=>({dom:{tag:"div",classes:["tox-collection__group"]},components:oo}))},GR=(Qn,Zn,Yn)=>Pw.parts.items({preprocess:Jn=>{const oo=hs(Jn,Yn);return Qn!=="auto"&&Qn>1?UA({tag:"div",classes:["tox-collection__group"]},Qn)(oo):fL(oo,(lo,mo)=>Zn[mo].type==="separator")}}),hL=(Qn,Zn,Yn=!0)=>({dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(Qn===1?["tox-collection--list"]:["tox-collection--grid"])},components:[GR(Qn,Zn,Go)]}),eQ=(Qn,Zn,Yn=!0)=>{const Jn=ba("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection",WA].concat(Qn===1?["tox-collection--list"]:["tox-collection--grid"]),attributes:{id:Jn}},components:[GR(Qn,Zn,YR)]}},mL=(Qn,Zn,Yn)=>{const Jn=ba("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(Qn===1?["tox-collection--list"]:["tox-collection--grid"])},components:[XR({i18n:_1.translate,placeholder:Yn.placeholder}),{dom:{tag:"div",classes:[...Qn===1?["tox-collection--list"]:["tox-collection--grid"],WA],attributes:{id:Jn}},components:[GR(Qn,Zn,YR)]}]}},pL=(Qn,Zn=!0)=>({dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Pw.parts.items({preprocess:Yn=>fL(Yn,(Jn,oo)=>Qn[oo].type==="separator")})]}),ZA=Qn=>Br(Qn,Zn=>"icon"in Zn&&Zn.icon!==void 0),vy=Qn=>(console.error(Gf(Qn)),console.log(Qn),ko.none()),hE=(Qn,Zn,Yn,Jn,oo)=>{const lo=pL(Yn);return{value:Qn,dom:lo.dom,components:lo.components,items:Yn}},qA=(Qn,Zn,Yn,Jn,oo)=>{const lo=()=>oo.menuType!=="searchable"?hL(Jn,Yn):oo.searchMode.searchMode==="search-with-field"?mL(Jn,Yn,oo.searchMode):eQ(Jn,Yn);if(oo.menuType==="color"){const mo=K9(Jn);return{value:Qn,dom:mo.dom,components:mo.components,items:Yn}}else if(oo.menuType==="normal"&&Jn==="auto"){const mo=hL(Jn,Yn);return{value:Qn,dom:mo.dom,components:mo.components,items:Yn}}else if(oo.menuType==="normal"||oo.menuType==="searchable"){const mo=lo();return{value:Qn,dom:mo.dom,components:mo.components,items:Yn}}else if(oo.menuType==="listpreview"&&Jn!=="auto"){const mo=J9(Jn);return{value:Qn,dom:mo.dom,components:mo.components,items:Yn}}else return{value:Qn,dom:WR(Zn,Jn,oo.menuType),components:lL,items:Yn}},wf=hc("type"),KR=hc("name"),jA=hc("label"),_O=hc("text"),gL=hc("title"),JR=hc("icon"),Nk=hc("value"),bL=ep("fetch"),vL=ep("getSubmenuItems"),Lk=ep("onAction"),tQ=ep("onItemAction"),F_=Hd("onSetup",()=>xo),eD=$f("name"),yy=$f("text"),S1=$f("icon"),mE=$f("tooltip"),XA=$f("label"),nQ=$f("shortcut"),tD=I1("select"),YA=Xd("active",!1),yL=Xd("borderless",!1),pb=Xd("enabled",!0),Oy=Xd("primary",!1),OL=Qn=>Gs("columns",Qn),pE=Gs("meta",{}),Ik=Hd("onAction",xo),Iw=Qn=>mh("type",Qn),GA=Qn=>Bd("name","name",hf(()=>ba(`${Qn}-name`)),nf),_L=Qn=>Bd("value","value",hf(()=>ba(`${Qn}-value`)),Ad()),nD=Ta([wf,yy]),oD=Qn=>Lu("separatormenuitem",nD,Qn),SL=Ta([Iw("autocompleteitem"),YA,pb,pE,Nk,yy,S1]),oQ=Qn=>Lu("Autocompleter.Separator",nD,Qn),wL=Qn=>Lu("Autocompleter.Item",SL,Qn),Bk=[pb,mE,S1,yy,F_],CL=Ta([wf,Lk].concat(Bk)),sD=Qn=>Lu("toolbarbutton",CL,Qn),rD=[YA].concat(Bk),kL=Ta(rD.concat([wf,Lk])),xL=Qn=>Lu("ToggleButton",kL,Qn),EL=[Hd("predicate",sr),Eh("scope","node",["node","editor"]),Eh("position","selection",["node","selection","line"])],sQ=Bk.concat([Iw("contextformbutton"),Oy,Lk,pu("original",Go)]),rQ=rD.concat([Iw("contextformbutton"),Oy,Lk,pu("original",Go)]),TL=Bk.concat([Iw("contextformbutton")]),gE=rD.concat([Iw("contextformtogglebutton")]),AL=jl("type",{contextformbutton:sQ,contextformtogglebutton:rQ}),iQ=Ta([Iw("contextform"),Hd("initValue",Mo("")),XA,Pf("commands",AL),Fd("launch",jl("type",{contextformbutton:TL,contextformtogglebutton:gE}))].concat(EL)),aQ=Qn=>Lu("ContextForm",iQ,Qn),lQ=Ta([Iw("contexttoolbar"),hc("items")].concat(EL)),cQ=Qn=>Lu("ContextToolbar",lQ,Qn),uQ=[wf,hc("src"),$f("alt"),Th("classes",[],nf)],KA=Ta(uQ),dQ=[wf,_O,eD,Th("classes",["tox-collection__item-label"],nf)],PL=Ta(dQ),$L=mf(()=>Ir("type",{cardimage:KA,cardtext:PL,cardcontainer:RL})),RL=Ta([wf,mh("direction","horizontal"),mh("align","left"),mh("valign","middle"),Pf("items",$L)]),Bw=[pb,yy,nQ,_L("menuitem"),pE],fQ=Ta([wf,XA,Pf("items",$L),F_,Ik].concat(Bw)),DL=Qn=>Lu("cardmenuitem",fQ,Qn),ML=Ta([wf,YA,S1].concat(Bw)),NL=Qn=>Lu("choicemenuitem",ML,Qn),iD=[wf,hc("fancytype"),Ik],hQ=[Gs("initData",{})].concat(iD),mQ=[I1("select"),Kp("initData",{},[Xd("allowCustomColors",!0),mh("storageKey","default"),Ng("colors",Ad())])].concat(iD),pQ=jl("fancytype",{inserttable:hQ,colorswatch:mQ}),gQ=Qn=>Lu("fancymenuitem",pQ,Qn),LL=Ta([wf,F_,Ik,S1].concat(Bw)),IL=Qn=>Lu("menuitem",LL,Qn),bQ=Ta([wf,vL,F_,S1].concat(Bw)),vQ=Qn=>Lu("nestedmenuitem",bQ,Qn),yQ=Ta([wf,S1,YA,F_,Lk].concat(Bw)),OQ=Qn=>Lu("togglemenuitem",yQ,Qn),aD=(Qn,Zn,Yn)=>{const Jn=_f(Qn.element,"."+Yn);if(Jn.length>0){const oo=Sr(Jn,lo=>{const mo=lo.dom.getBoundingClientRect().top,yo=Jn[0].dom.getBoundingClientRect().top;return Math.abs(mo-yo)>Zn}).getOr(Jn.length);return ko.some({numColumns:oo,numRows:Math.ceil(Jn.length/oo)})}else return ko.none()},lD=(Qn,Zn)=>Zr([Rl(Qn,Zn)]),bE={namedEvents:lD,unnamedEvents:Qn=>lD(ba("unnamed-events"),Qn)},JA=ba("tooltip.exclusive"),Fk=ba("tooltip.show"),vE=ba("tooltip.hide"),BL=(Qn,Zn,Yn)=>{Qn.getSystem().broadcastOn([JA],{})};var SQ=Object.freeze({__proto__:null,hideAllExclusive:BL,setComponents:(Qn,Zn,Yn,Jn)=>{Yn.getTooltip().each(oo=>{oo.getSystem().isConnected()&&Cl.set(oo,Jn)})}}),FL=Object.freeze({__proto__:null,events:(Qn,Zn)=>{const Yn=oo=>{Zn.getTooltip().each(lo=>{Kb(lo),Qn.onHide(oo,lo),Zn.clearTooltip()}),Zn.clearTimer()},Jn=oo=>{if(!Zn.isShowing()){BL(oo);const lo=Qn.lazySink(oo).getOrDie(),mo=oo.getSystem().build({dom:Qn.tooltipDom,components:Qn.tooltipComponents,events:Jc(Qn.mode==="normal"?[wr(eg(),yo=>{Wl(oo,Fk)}),wr(Rf(),yo=>{Wl(oo,vE)})]:[]),behaviours:Zr([Cl.config({})])});Zn.setTooltip(mo),cy(lo,mo),Qn.onShow(oo,mo),jh.position(lo,mo,{anchor:Qn.anchor(oo)})}};return Jc(Us([[wr(Fk,oo=>{Zn.resetTimer(()=>{Jn(oo)},Qn.delay)}),wr(vE,oo=>{Zn.resetTimer(()=>{Yn(oo)},Qn.delay)}),wr(T0(),(oo,lo)=>{const mo=lo;mo.universal||Fs(mo.channels,JA)&&Yn(oo)}),ig(oo=>{Yn(oo)})],Qn.mode==="normal"?[wr(Wu(),oo=>{Wl(oo,Fk)}),wr(W1(),oo=>{Wl(oo,vE)}),wr(eg(),oo=>{Wl(oo,Fk)}),wr(Rf(),oo=>{Wl(oo,vE)})]:[wr(Ev(),(oo,lo)=>{Wl(oo,Fk)}),wr(Tv(),oo=>{Wl(oo,vE)})]]))}}),HL=[Er("lazySink"),Er("tooltipDom"),Gs("exclusive",!0),Gs("tooltipComponents",[]),Gs("delay",300),Eh("mode","normal",["normal","follow-highlight"]),Gs("anchor",Qn=>({type:"hotspot",hotspot:Qn,layouts:{onLtr:Mo([bu,Rh,gf,bf,eh,$l]),onRtl:Mo([bu,Rh,gf,bf,eh,$l])}})),rc("onHide"),rc("onShow")],CQ=Object.freeze({__proto__:null,init:()=>{const Qn=Hl(),Zn=Hl(),Yn=()=>{Qn.on(clearTimeout)},Jn=(lo,mo)=>{Yn(),Qn.set(setTimeout(lo,mo))},oo=Mo("not-implemented");return ph({getTooltip:Zn.get,isShowing:Zn.isSet,setTooltip:Zn.set,clearTooltip:Zn.clear,clearTimer:Yn,resetTimer:Jn,readState:oo})}});const QL=Of({fields:HL,name:"tooltipping",active:FL,state:CQ,apis:SQ}),kQ=Qn=>Qn.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),VL="silver.readonly",cD=Ta([wv("readonly")]),eP=(Qn,Zn)=>{const Jn=Qn.mainUi.outerContainer.element,oo=[Qn.mainUi.mothership,...Qn.uiMotherships];Zn&&Qs(oo,lo=>{lo.broadcastOn([db()],{target:Jn})}),Qs(oo,lo=>{lo.broadcastOn([VL],{readonly:Zn})})},zL=(Qn,Zn)=>{Qn.on("init",()=>{Qn.mode.isReadOnly()&&eP(Zn,!0)}),Qn.on("SwitchMode",()=>eP(Zn,Qn.mode.isReadOnly())),I5(Qn)&&Qn.mode.set("readonly")},jf=()=>Om.config({channels:{[VL]:{schema:cD,onReceive:(Qn,Zn)=>{Ja.set(Qn,Zn.readonly)}}}}),Lf={item:Qn=>Ja.config({disabled:Qn,disableClass:"tox-collection__item--state-disabled"}),button:Qn=>Ja.config({disabled:Qn}),splitButton:Qn=>Ja.config({disabled:Qn,disableClass:"tox-tbtn--disabled"}),toolbarButton:Qn=>Ja.config({disabled:Qn,disableClass:"tox-tbtn--disabled",useNative:!1})},w1=(Qn,Zn)=>{const Yn=Qn.getApi(Zn);return Jn=>{Jn(Yn)}},H_=(Qn,Zn)=>eu(Yn=>{w1(Qn,Yn)(oo=>{const lo=Qn.onSetup(oo);So(lo)&&Zn.set(lo)})}),_y=(Qn,Zn)=>ig(Yn=>w1(Qn,Yn)(Zn.get())),uD=(Qn,Zn)=>qh((Yn,Jn)=>{w1(Qn,Yn)(Qn.onAction),!Qn.triggersSubmenu&&Zn===sv.CLOSE_ON_EXECUTE&&(Yn.getSystem().isConnected()&&Wl(Yn,Fy()),Jn.stop())}),EQ={[Im()]:["disabling","alloy.base.behaviour","toggling","item-events"]},Hk=Ks,Sy=(Qn,Zn,Yn,Jn)=>{const oo=Ua(xo);return{type:"item",dom:Zn.dom,components:Hk(Zn.optComponents),data:Qn.data,eventOrder:EQ,hasSubmenu:Qn.triggersSubmenu,itemBehaviours:Zr([Rl("item-events",[uD(Qn,Yn),H_(Qn,oo),_y(Qn,oo)]),Lf.item(()=>!Qn.enabled||Jn.isDisabled()),jf(),Cl.config({})].concat(Qn.itemBehaviours))}},SO=Qn=>({value:Qn.value,meta:{text:Qn.text.getOr(""),...Qn.meta}}),tP=Qn=>{const Zn=xk.os.isMacOS()||xk.os.isiOS(),oo=Zn?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},lo=Qn.split("+"),mo=hs(lo,yo=>{const Co=yo.toLowerCase().trim();return Pl(oo,Co)?oo[Co]:yo});return Zn?mo.join(""):mo.join("+")},dD=(Qn,Zn,Yn=[nL])=>s0(Qn,{tag:"div",classes:Yn},Zn),r0=Qn=>({dom:{tag:"div",classes:[QR]},components:[wd(_1.translate(Qn))]}),WL=(Qn,Zn)=>({dom:{tag:"div",classes:Zn,innerHtml:Qn}}),TQ=(Qn,Zn)=>({dom:{tag:"div",classes:[QR]},components:[{dom:{tag:Qn.tag,styles:Qn.styles},components:[wd(_1.translate(Zn))]}]}),gb=Qn=>({dom:{tag:"div",classes:[U9]},components:[wd(tP(Qn))]}),Qk=Qn=>dD("checkmark",Qn,[Z9]),i0=Qn=>dD("chevron-right",Qn,[oL]),AQ=Qn=>dD("chevron-down",Qn,[oL]),Ou=(Qn,Zn)=>{const Yn=Qn.direction==="vertical"?q9:rL,Jn=Qn.align==="left"?j9:QA;return{dom:{tag:"div",classes:[sL,Yn,Jn,(()=>{switch(Qn.valign){case"top":return VR;case"middle":return X9;case"bottom":return Y9}})()]},components:Zn}},Vk=(Qn,Zn,Yn)=>({dom:{tag:"img",classes:Zn,attributes:{src:Qn,alt:Yn.getOr("")}}}),nP=(Qn,Zn,Yn)=>{const Jn="custom",oo="remove",lo=Qn.ariaLabel,mo=Qn.value,yo=Qn.iconContent.map(Ro=>OR(Ro,Zn.icons,Yn));return{dom:(()=>{const Ro=HR,Lo=yo.getOr(""),jo={tag:"div",attributes:lo.map(es=>({title:Zn.translate(es)})).getOr({}),classes:[Ro]};return mo===Jn?{...jo,tag:"button",classes:[...jo.classes,"tox-swatches__picker-btn"],innerHtml:Lo}:mo===oo?{...jo,classes:[...jo.classes,"tox-swatch--remove"],innerHtml:Lo}:Oo(mo)?{...jo,attributes:{...jo.attributes,"data-mce-color":mo},styles:{"background-color":mo},innerHtml:Lo}:jo})(),optComponents:[]}},fD=Qn=>{const Zn=Qn.map(Yn=>({attributes:{title:_1.translate(Yn),id:ba("menu-item")}})).getOr({});return{tag:"div",classes:[FR,Rk],...Zn}},hD=(Qn,Zn,Yn,Jn)=>{const oo={tag:"div",classes:[nL]},lo=jo=>s0(jo,oo,Zn.icons,Jn),mo=()=>ko.some({dom:oo}),yo=Yn?Qn.iconContent.map(lo).orThunk(mo):ko.none(),Co=Qn.checkMark,Ro=ko.from(Qn.meta).fold(()=>r0,jo=>Pl(jo,"style")?ms(TQ,jo.style):r0),Lo=Qn.htmlContent.fold(()=>Qn.textContent.map(Ro),jo=>ko.some(WL(jo,[QR])));return{dom:fD(Qn.ariaLabel),optComponents:[yo,Lo,Qn.shortcutContent.map(gb),Co,Qn.caret]}},Fw=(Qn,Zn,Yn,Jn=ko.none())=>Qn.presets==="color"?nP(Qn,Zn,Jn):hD(Qn,Zn,Yn,Jn),UL=(Qn,Zn)=>Rr(Qn,"tooltipWorker").map(Yn=>[QL.config({lazySink:Zn.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:Jn=>({type:"submenu",item:Jn,overrides:{maxHeightFunction:zg}}),mode:"follow-highlight",onShow:(Jn,oo)=>{Yn(lo=>{QL.setComponents(Jn,[yC({element:Ds.fromDom(lo)})])})}})]).getOr([]),mD=Qn=>Mw.DOM.encode(Qn),ZL=(Qn,Zn)=>{const Yn=_1.translate(Qn),Jn=mD(Yn);if(Zn.length>0){const oo=new RegExp(kQ(Zn),"gi");return Jn.replace(oo,lo=>`${lo}`)}else return Jn},qL=(Qn,Zn,Yn,Jn,oo,lo,mo,yo=!0)=>{const Co=Fw({presets:Jn,textContent:ko.none(),htmlContent:Yn?Qn.text.map(Ro=>ZL(Ro,Zn)):ko.none(),ariaLabel:Qn.text,iconContent:Qn.icon,shortcutContent:ko.none(),checkMark:ko.none(),caret:ko.none(),value:Qn.value},mo.providers,yo,Qn.icon);return Sy({data:SO(Qn),enabled:Qn.enabled,getApi:Mo({}),onAction:Ro=>oo(Qn.value,Qn.meta),onSetup:Mo(xo),triggersSubmenu:!1,itemBehaviours:UL(Qn.meta,mo)},Co,lo,mo.providers)},pD=(Qn,Zn)=>hs(Qn,Yn=>{switch(Yn.type){case"cardcontainer":return Ou(Yn,pD(Yn.items,Zn));case"cardimage":return Vk(Yn.src,Yn.classes,Yn.alt);case"cardtext":const oo=Yn.name.exists(lo=>Fs(Zn.cardText.highlightOn,lo))?ko.from(Zn.cardText.matchText).getOr(""):"";return WL(ZL(Yn.text,oo),Yn.classes)}}),gD=(Qn,Zn,Yn,Jn)=>{const oo=mo=>({isEnabled:()=>!Ja.isDisabled(mo),setEnabled:yo=>{Ja.set(mo,!yo),Qs(_f(mo.element,"*"),Co=>{mo.getSystem().getByDom(Co).each(Ro=>{Ro.hasConfigured(Ja)&&Ja.set(Ro,!yo)})})}}),lo={dom:fD(Qn.label),optComponents:[ko.some({dom:{tag:"div",classes:[sL,rL]},components:pD(Qn.items,Jn)})]};return Sy({data:SO({text:ko.none(),...Qn}),enabled:Qn.enabled,getApi:oo,onAction:Qn.onAction,onSetup:Qn.onSetup,triggersSubmenu:!1,itemBehaviours:ko.from(Jn.itemBehaviours).getOr([])},lo,Zn,Yn.providers)},jL=(Qn,Zn,Yn,Jn,oo,lo,mo,yo=!0)=>{const Co=Lo=>({setActive:Wo=>{Ql.set(Lo,Wo)},isActive:()=>Ql.isOn(Lo),isEnabled:()=>!Ja.isDisabled(Lo),setEnabled:Wo=>Ja.set(Lo,!Wo)}),Ro=Fw({presets:Yn,textContent:Zn?Qn.text:ko.none(),htmlContent:ko.none(),ariaLabel:Qn.text,iconContent:Qn.icon,shortcutContent:Zn?Qn.shortcut:ko.none(),checkMark:Zn?ko.some(Qk(mo.icons)):ko.none(),caret:ko.none(),value:Qn.value},mo,yo);return Lc(Sy({data:SO(Qn),enabled:Qn.enabled,getApi:Co,onAction:Lo=>Jn(Qn.value),onSetup:Lo=>(Lo.setActive(oo),xo),triggersSubmenu:!1,itemBehaviours:[]},Ro,lo,mo),{toggling:{toggleClass:tL,toggleOnExecute:!1,selected:Qn.active,exclusive:!0}})},yE=X0(Xx(),Yx()),XL=Qn=>({value:JL(Qn)}),YL=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,GL=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,KL=Qn=>YL.test(Qn)||GL.test(Qn),JL=Qn=>Rc(Qn,"#").toUpperCase(),eI=Qn=>KL(Qn)?ko.some({value:JL(Qn)}):ko.none(),PQ=Qn=>({value:Qn.value.replace(YL,(Yn,Jn,oo,lo)=>Jn+Jn+oo+oo+lo+lo)}),$Q=Qn=>{const Zn=PQ(Qn),Yn=GL.exec(Zn.value);return Yn===null?["FFFFFF","FF","FF","FF"]:Yn},oP=Qn=>{const Zn=Qn.toString(16);return(Zn.length===1?"0"+Zn:Zn).toUpperCase()},zk=Qn=>{const Zn=oP(Qn.red)+oP(Qn.green)+oP(Qn.blue);return XL(Zn)},tI=Math.min,nI=Math.max,OE=Math.round,oI=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,sI=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,Q_=(Qn,Zn,Yn,Jn)=>({red:Qn,green:Zn,blue:Yn,alpha:Jn}),bD=Qn=>{const Zn=parseInt(Qn,10);return Zn.toString()===Qn&&Zn>=0&&Zn<=255},rI=Qn=>{let Zn,Yn,Jn;const oo=(Qn.hue||0)%360;let lo=Qn.saturation/100,mo=Qn.value/100;if(lo=nI(0,tI(lo,1)),mo=nI(0,tI(mo,1)),lo===0)return Zn=Yn=Jn=OE(255*mo),Q_(Zn,Yn,Jn,1);const yo=oo/60,Co=mo*lo,Ro=Co*(1-Math.abs(yo%2-1)),Lo=mo-Co;switch(Math.floor(yo)){case 0:Zn=Co,Yn=Ro,Jn=0;break;case 1:Zn=Ro,Yn=Co,Jn=0;break;case 2:Zn=0,Yn=Co,Jn=Ro;break;case 3:Zn=0,Yn=Ro,Jn=Co;break;case 4:Zn=Ro,Yn=0,Jn=Co;break;case 5:Zn=Co,Yn=0,Jn=Ro;break;default:Zn=Yn=Jn=0}return Zn=OE(255*(Zn+Lo)),Yn=OE(255*(Yn+Lo)),Jn=OE(255*(Jn+Lo)),Q_(Zn,Yn,Jn,1)},_E=Qn=>{const Zn=$Q(Qn),Yn=parseInt(Zn[1],16),Jn=parseInt(Zn[2],16),oo=parseInt(Zn[3],16);return Q_(Yn,Jn,oo,1)},iI=(Qn,Zn,Yn,Jn)=>{const oo=parseInt(Qn,10),lo=parseInt(Zn,10),mo=parseInt(Yn,10),yo=parseFloat(Jn);return Q_(oo,lo,mo,yo)},vD=Qn=>{if(Qn==="transparent")return ko.some(Q_(0,0,0,0));const Zn=oI.exec(Qn);if(Zn!==null)return ko.some(iI(Zn[1],Zn[2],Zn[3],"1"));const Yn=sI.exec(Qn);return Yn!==null?ko.some(iI(Yn[1],Yn[2],Yn[3],Yn[4])):ko.none()},yD=Qn=>`rgba(${Qn.red},${Qn.green},${Qn.blue},${Qn.alpha})`,bb=Q_(255,0,0,1),RQ=Qn=>{Qn.dispatch("SkinLoaded")},OD=(Qn,Zn)=>{Qn.dispatch("SkinLoadError",Zn)},aI=Qn=>{Qn.dispatch("ResizeEditor")},sP=(Qn,Zn)=>{Qn.dispatch("ResizeContent",Zn)},DQ=(Qn,Zn)=>{Qn.dispatch("ScrollContent",Zn)},_D=(Qn,Zn)=>{Qn.dispatch("TextColorChange",Zn)},lI=(Qn,Zn)=>{Qn.dispatch("AfterProgressState",{state:Zn})},cI=(Qn,Zn)=>Qn.dispatch("ResolveName",{name:Zn.nodeName.toLowerCase(),target:Zn}),MQ=(Qn,Zn)=>{Qn.dispatch("ToggleToolbarDrawer",{state:Zn})},NQ=(Qn,Zn)=>{Qn.dispatch("StylesTextUpdate",Zn)},LQ=(Qn,Zn)=>{Qn.dispatch("AlignTextUpdate",Zn)},IQ=(Qn,Zn)=>{Qn.dispatch("FontSizeTextUpdate",Zn)},BQ=(Qn,Zn)=>{Qn.dispatch("FontSizeInputTextUpdate",Zn)},uI=(Qn,Zn)=>{Qn.dispatch("BlocksTextUpdate",Zn)},dI=(Qn,Zn)=>{Qn.dispatch("FontFamilyTextUpdate",Zn)},SE=(Qn,Zn)=>()=>{Qn(),Zn()},mp=Qn=>a0(Qn,"NodeChange",Zn=>{Zn.setEnabled(Qn.selection.isEditable())}),FQ=(Qn,Zn)=>Yn=>{const Jn=ab(),oo=()=>{Yn.setActive(Qn.formatter.match(Zn));const lo=Qn.formatter.formatChanged(Zn,Yn.setActive);Jn.set(lo)};return Qn.initialized?oo():Qn.once("init",oo),()=>{Qn.off("init",oo),Jn.clear()}},rP=(Qn,Zn)=>Yn=>{const Jn=mp(Qn)(Yn),oo=FQ(Qn,Zn)(Yn);return()=>{Jn(),oo()}},a0=(Qn,Zn,Yn)=>Jn=>{const oo=()=>Yn(Jn),lo=()=>{Yn(Jn),Qn.on(Zn,oo)};return Qn.initialized?lo():Qn.once("init",lo),()=>{Qn.off("init",lo),Qn.off(Zn,oo)}},fI=Qn=>Zn=>()=>{Qn.undoManager.transact(()=>{Qn.focus(),Qn.execCommand("mceToggleFormat",!1,Zn.format)})},bg=(Qn,Zn)=>()=>Qn.execCommand(Zn);var V_=tinymce.util.Tools.resolve("tinymce.util.LocalStorage");const SD={},wD=(Qn,Zn=10)=>{const Yn=V_.getItem(Qn),Jn=qn(Yn)?JSON.parse(Yn):[],lo=(Ro=>Zn-Ro.length<0?Ro.slice(0,Zn):Ro)(Jn),mo=Ro=>{ws(lo,Ro).each(yo),lo.unshift(Ro),lo.length>Zn&&lo.pop(),V_.setItem(Qn,JSON.stringify(lo))},yo=Ro=>{lo.splice(Ro,1)};return{add:mo,state:()=>lo.slice(0)}},iP=Qn=>Rr(SD,Qn).getOrThunk(()=>{const Zn=`tinymce-custom-colors-${Qn}`,Yn=V_.getItem(Zn);if(bo(Yn)){const oo=V_.getItem("tinymce-custom-colors");V_.setItem(Zn,Oo(oo)?oo:"[]")}const Jn=wD(Zn,10);return SD[Qn]=Jn,Jn}),CD=Qn=>hs(iP(Qn).state(),Zn=>({type:"choiceitem",text:Zn,icon:"checkmark",value:Zn})),kD=(Qn,Zn)=>{iP(Qn).add(Zn)},wE=(Qn,Zn,Yn)=>({hue:Qn,saturation:Zn,value:Yn}),aP=Qn=>{let Zn=0,Yn=0,Jn=0;const oo=Qn.red/255,lo=Qn.green/255,mo=Qn.blue/255,yo=Math.min(oo,Math.min(lo,mo)),Co=Math.max(oo,Math.max(lo,mo));if(yo===Co)return Jn=yo,wE(0,0,Jn*100);const Ro=oo===yo?lo-mo:mo===yo?oo-lo:mo-oo;return Zn=oo===yo?3:mo===yo?1:5,Zn=60*(Zn-Ro/(Co-yo)),Yn=(Co-yo)/Co,Jn=Co,wE(Math.round(Zn),Math.round(Yn*100),Math.round(Jn*100))},HQ=Qn=>aP(_E(Qn)),hI=Qn=>zk(rI(Qn)),QQ=Qn=>eI(Qn).orThunk(()=>vD(Qn).map(zk)).getOrThunk(()=>{const Zn=document.createElement("canvas");Zn.height=1,Zn.width=1;const Yn=Zn.getContext("2d");Yn.clearRect(0,0,Zn.width,Zn.height),Yn.fillStyle="#FFFFFF",Yn.fillStyle=Qn,Yn.fillRect(0,0,1,1);const Jn=Yn.getImageData(0,0,1,1).data,oo=Jn[0],lo=Jn[1],mo=Jn[2],yo=Jn[3];return zk(Q_(oo,lo,mo,yo))}),lP="forecolor",cP="hilitecolor",mI=5,VQ=Qn=>{const Zn=[];for(let Yn=0;YnZn=>Zn.options.get(Qn),xD="#000000",zQ=Qn=>{const Zn=Qn.options.register,Yn=oo=>Do(oo,qn)?{value:VQ(oo),valid:!0}:{valid:!1,message:"Must be an array of strings."},Jn=oo=>$o(oo)&&oo>0?{value:oo,valid:!0}:{valid:!1,message:"Must be a positive number."};Zn("color_map",{processor:Yn,default:["#BFEDD2","Light Green","#FBEEB8","Light Yellow","#F8CAC6","Light Red","#ECCAFA","Light Purple","#C2E0F4","Light Blue","#2DC26B","Green","#F1C40F","Yellow","#E03E2D","Red","#B96AD9","Purple","#3598DB","Blue","#169179","Dark Turquoise","#E67E23","Orange","#BA372A","Dark Red","#843FA1","Dark Purple","#236FA1","Dark Blue","#ECF0F1","Light Gray","#CED4D9","Medium Gray","#95A5A6","Gray","#7E8C8D","Dark Gray","#34495E","Navy Blue","#000000","Black","#ffffff","White"]}),Zn("color_map_background",{processor:Yn}),Zn("color_map_foreground",{processor:Yn}),Zn("color_cols",{processor:Jn,default:ED(Qn)}),Zn("color_cols_foreground",{processor:Jn,default:pI(Qn,lP)}),Zn("color_cols_background",{processor:Jn,default:pI(Qn,cP)}),Zn("custom_colors",{processor:"boolean",default:!0}),Zn("color_default_foreground",{processor:"string",default:xD}),Zn("color_default_background",{processor:"string",default:xD})},uP=(Qn,Zn)=>Zn===lP&&Qn.options.isSet("color_map_foreground")?wy("color_map_foreground")(Qn):Zn===cP&&Qn.options.isSet("color_map_background")?wy("color_map_background")(Qn):wy("color_map")(Qn),ED=(Qn,Zn="default")=>Math.max(mI,Math.ceil(Math.sqrt(uP(Qn,Zn).length))),pI=(Qn,Zn)=>{const Yn=wy("color_cols")(Qn),Jn=ED(Qn,Zn);return Yn===ED(Qn)?Jn:Yn},gI=(Qn,Zn="default")=>Math.round(Zn===lP?wy("color_cols_foreground")(Qn):Zn===cP?wy("color_cols_background")(Qn):wy("color_cols")(Qn)),bI=wy("custom_colors"),WQ=wy("color_default_foreground"),UQ=wy("color_default_background"),vI="rgba(0, 0, 0, 0)",ZQ=Qn=>vD(Qn).exists(Zn=>Zn.alpha!==0),qQ=Qn=>Jf(Qn,Zn=>{if(fc(Zn)){const Yn=qc(Zn,"background-color");return Mr(ZQ(Yn),Yn)}else return ko.none()}).getOr(vI),yI=(Qn,Zn)=>{const Yn=Ds.fromDom(Qn.selection.getStart()),Jn=Zn==="hilitecolor"?qQ(Yn):qc(Yn,"color");return vD(Jn).map(oo=>"#"+zk(oo).value)},jQ=(Qn,Zn,Yn)=>{Qn.undoManager.transact(()=>{Qn.focus(),Qn.formatter.apply(Zn,{value:Yn}),Qn.nodeChanged()})},XQ=(Qn,Zn)=>{Qn.undoManager.transact(()=>{Qn.focus(),Qn.formatter.remove(Zn,{value:null},void 0,!0),Qn.nodeChanged()})},dP=Qn=>{Qn.addCommand("mceApplyTextcolor",(Zn,Yn)=>{jQ(Qn,Zn,Yn)}),Qn.addCommand("mceRemoveTextcolor",Zn=>{XQ(Qn,Zn)})},TD=Qn=>{const Zn="choiceitem",Yn={type:Zn,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return Qn?[Yn,{type:Zn,text:"Custom color",icon:"color-picker",value:"custom"}]:[Yn]},AD=(Qn,Zn,Yn,Jn)=>{Yn==="custom"?wI(Qn)(lo=>{lo.each(mo=>{kD(Zn,mo),Qn.execCommand("mceApplyTextcolor",Zn,mo),Jn(mo)})},yI(Qn,Zn).getOr(xD)):Yn==="remove"?(Jn(""),Qn.execCommand("mceRemoveTextcolor",Zn)):(Jn(Yn),Qn.execCommand("mceApplyTextcolor",Zn,Yn))},PD=(Qn,Zn,Yn)=>Qn.concat(CD(Zn).concat(TD(Yn))),OI=(Qn,Zn,Yn)=>Jn=>{Jn(PD(Qn,Zn,Yn))},$D=(Qn,Zn,Yn)=>{const Jn=Zn==="forecolor"?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";Qn.setIconFill(Jn,Yn)},_I=(Qn,Zn)=>{Qn.setTooltip(Zn)},SI=(Qn,Zn)=>Yn=>{const Jn=yI(Qn,Zn);return vs(Jn,Yn.toUpperCase())},CE=(Qn,Zn,Yn)=>{if(ks(Yn))return Zn==="forecolor"?"Text color":"Background color";const Jn=Zn==="forecolor"?"Text color {0}":"Background color {0}",oo=PD(uP(Qn,Zn),Zn,!1),lo=Zs(oo,mo=>mo.value===Yn).getOr({text:""}).text;return Qn.translate([Jn,Qn.translate(lo)])},RD=(Qn,Zn,Yn,Jn)=>{Qn.ui.registry.addSplitButton(Zn,{tooltip:CE(Qn,Yn,Jn.get()),presets:"color",icon:Zn==="forecolor"?"text-color":"highlight-bg-color",select:SI(Qn,Yn),columns:gI(Qn,Yn),fetch:OI(uP(Qn,Yn),Yn,bI(Qn)),onAction:oo=>{AD(Qn,Yn,Jn.get(),xo)},onItemAction:(oo,lo)=>{AD(Qn,Yn,lo,mo=>{Jn.set(mo),_D(Qn,{name:Zn,color:mo})})},onSetup:oo=>{$D(oo,Zn,Jn.get());const lo=mo=>{mo.name===Zn&&($D(oo,mo.name,mo.color),_I(oo,CE(Qn,Yn,mo.color)))};return Qn.on("TextColorChange",lo),SE(mp(Qn)(oo),()=>{Qn.off("TextColorChange",lo)})}})},DD=(Qn,Zn,Yn,Jn,oo)=>{Qn.ui.registry.addNestedMenuItem(Zn,{text:Jn,icon:Zn==="forecolor"?"text-color":"highlight-bg-color",onSetup:lo=>(_I(lo,CE(Qn,Yn,oo.get())),$D(lo,Zn,oo.get()),mp(Qn)(lo)),getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"colorswatch",select:SI(Qn,Yn),initData:{storageKey:Yn},onAction:lo=>{AD(Qn,Yn,lo.value,mo=>{oo.set(mo),_D(Qn,{name:Zn,color:mo})})}}]})},wI=Qn=>(Zn,Yn)=>{let Jn=!1;const oo=yo=>{const Ro=yo.getData().colorpicker;Jn?(Zn(ko.from(Ro)),yo.close()):Qn.windowManager.alert(Qn.translate(["Invalid hex color code: {0}",Ro]))},lo=(yo,Co)=>{Co.name==="hex-valid"&&(Jn=Co.value)},mo={colorpicker:Yn};Qn.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:mo,onAction:lo,onSubmit:oo,onClose:xo,onCancel:()=>{Zn(ko.none())}})},CI=Qn=>{dP(Qn);const Zn=WQ(Qn),Yn=UQ(Qn),Jn=Ua(Zn),oo=Ua(Yn);RD(Qn,"forecolor","forecolor",Jn),RD(Qn,"backcolor","hilitecolor",oo),DD(Qn,"forecolor","forecolor","Text color",Jn),DD(Qn,"backcolor","hilitecolor","Background color",oo)},MD=(Qn,Zn,Yn,Jn,oo,lo,mo,yo)=>{const Co=ZA(Zn),Lo=YQ(Zn,Yn,Jn,oo!=="color"?"normal":"color",lo,mo,yo);return qA(Qn,Co,Lo,Jn,{menuType:oo})},YQ=(Qn,Zn,Yn,Jn,oo,lo,mo)=>Ks(hs(Qn,yo=>yo.type==="choiceitem"?NL(yo).fold(vy,Co=>ko.some(jL(Co,Yn===1,Jn,Zn,lo(Co.value),oo,mo,ZA(Qn)))):ko.none())),fP=(Qn,Zn)=>{const Yn=OO(Zn);return Qn===1?{mode:"menu",moveOnTab:!0}:Qn==="auto"?{mode:"grid",selector:"."+Yn.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+(Zn==="color"?"tox-swatches__row":"tox-collection__group"),previousSelector:oo=>Zn==="color"?Rd(oo.element,"[aria-checked=true]"):ko.none()}},GQ=(Qn,Zn)=>Qn===1?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:Qn==="auto"?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:Zn==="color"?".tox-swatches__row":".tox-collection__group",cell:Zn==="color"?`.${HR}`:`.${Rk}`}},KQ=(Qn,Zn)=>{const Yn=JQ(Qn,Zn),Jn=Zn.colorinput.getColorCols(Qn.initData.storageKey),oo="color",mo={...MD(ba("menu-value"),Yn,yo=>{Qn.onAction({value:yo})},Jn,oo,sv.CLOSE_ON_EXECUTE,Qn.select.getOr(sr),Zn.shared.providers),markers:OO(oo),movement:fP(Jn,oo)};return{type:"widget",data:{value:ba("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[yE.widget(Pw.sketch(mo))]}},JQ=(Qn,Zn)=>{const Yn=Qn.initData.allowCustomColors&&Zn.colorinput.hasCustomColors();return Qn.initData.colors.fold(()=>PD(Zn.colorinput.getColors(Qn.initData.storageKey),Qn.initData.storageKey,Yn),Jn=>Jn.concat(TD(Yn)))},kI=ba("cell-over"),xI=ba("cell-execute"),eV=Qn=>(Zn,Yn)=>Qn.shared.providers.translate(["{0} columns, {1} rows",Yn,Zn]),tV=(Qn,Zn,Yn)=>{const Jn=mo=>Qa(mo,kI,{row:Qn,col:Zn}),oo=mo=>Qa(mo,xI,{row:Qn,col:Zn}),lo=(mo,yo)=>{yo.stop(),oo(mo)};return gh({dom:{tag:"div",attributes:{role:"button","aria-label":Yn}},behaviours:Zr([Rl("insert-table-picker-cell",[wr(eg(),ol.focus),wr(Im(),oo),wr(Lg(),lo),wr(ng(),lo)]),Ql.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),ol.config({onFocus:Jn})])})},hP=(Qn,Zn,Yn)=>{const Jn=[];for(let oo=0;oo{for(let lo=0;lofs(Qn,Zn=>hs(Zn,Fm)),ID=(Qn,Zn)=>wd(`${Zn}x${Qn}`),nV={inserttable:(Qn,Zn)=>{const oo=eV(Zn),lo=hP(oo,10,10),mo=ID(0,0),yo=ou({dom:{tag:"span",classes:["tox-insert-table-picker__label"]},components:[mo],behaviours:Zr([Cl.config({})])});return{type:"widget",data:{value:ba("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[yE.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:LD(lo).concat(yo.asSpec()),behaviours:Zr([Rl("insert-table-picker",[eu(Co=>{Cl.set(yo.get(Co),[mo])}),pS(kI,(Co,Ro,Lo)=>{const{row:Wo,col:jo}=Lo.event;ND(lo,Wo,jo,10,10),Cl.set(yo.get(Co),[ID(Wo+1,jo+1)])}),pS(xI,(Co,Ro,Lo)=>{const{row:Wo,col:jo}=Lo.event;Qn.onAction({numRows:Wo+1,numColumns:jo+1}),Wl(Co,Fy())})]),Za.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:KQ},BD=(Qn,Zn)=>Rr(nV,Qn.fancytype).map(Yn=>Yn(Qn,Zn)),FD=(Qn,Zn,Yn,Jn=!0,oo=!1)=>{const lo=oo?AQ(Yn.icons):i0(Yn.icons),mo=Co=>({isEnabled:()=>!Ja.isDisabled(Co),setEnabled:Ro=>Ja.set(Co,!Ro),setIconFill:(Ro,Lo)=>{Rd(Co.element,`svg path[class="${Ro}"], rect[class="${Ro}"]`).each(Wo=>{aa(Wo,"fill",Lo)})},setTooltip:Ro=>{const Lo=Yn.translate(Ro);Qp(Co.element,{"aria-label":Lo,title:Lo})}}),yo=Fw({presets:"normal",iconContent:Qn.icon,textContent:Qn.text,htmlContent:ko.none(),ariaLabel:Qn.text,caret:ko.some(lo),checkMark:ko.none(),shortcutContent:Qn.shortcut},Yn,Jn);return Sy({data:SO(Qn),getApi:mo,enabled:Qn.enabled,onAction:xo,onSetup:Qn.onSetup,triggersSubmenu:!0,itemBehaviours:[]},yo,Zn,Yn)},mP=(Qn,Zn,Yn,Jn=!0)=>{const oo=mo=>({isEnabled:()=>!Ja.isDisabled(mo),setEnabled:yo=>Ja.set(mo,!yo)}),lo=Fw({presets:"normal",iconContent:Qn.icon,textContent:Qn.text,htmlContent:ko.none(),ariaLabel:Qn.text,caret:ko.none(),checkMark:ko.none(),shortcutContent:Qn.shortcut},Yn,Jn);return Sy({data:SO(Qn),getApi:oo,enabled:Qn.enabled,onAction:Qn.onAction,onSetup:Qn.onSetup,triggersSubmenu:!1,itemBehaviours:[]},lo,Zn,Yn)},EI=Qn=>({type:"separator",dom:{tag:"div",classes:[Rk,W9]},components:Qn.text.map(wd).toArray()}),oV=(Qn,Zn,Yn,Jn=!0)=>{const oo=mo=>({setActive:yo=>{Ql.set(mo,yo)},isActive:()=>Ql.isOn(mo),isEnabled:()=>!Ja.isDisabled(mo),setEnabled:yo=>Ja.set(mo,!yo)}),lo=Fw({iconContent:Qn.icon,textContent:Qn.text,htmlContent:ko.none(),ariaLabel:Qn.text,checkMark:ko.some(Qk(Yn.icons)),caret:ko.none(),shortcutContent:Qn.shortcut,presets:"normal",meta:Qn.meta},Yn,Jn);return Lc(Sy({data:SO(Qn),enabled:Qn.enabled,getApi:oo,onAction:Qn.onAction,onSetup:Qn.onSetup,triggersSubmenu:!1,itemBehaviours:[]},lo,Zn,Yn),{toggling:{toggleClass:tL,toggleOnExecute:!1,selected:Qn.active}})},sV=qL,TI=EI,rV=mP,iV=FD,aV=oV,lV=BD,cV=gD;var uV=Object.freeze({__proto__:null,getCoupled:(Qn,Zn,Yn,Jn)=>Yn.getOrCreate(Qn,Zn,Jn),getExistingCoupled:(Qn,Zn,Yn,Jn)=>Yn.getExisting(Qn,Zn,Jn)}),dV=[Kf("others",Dg(yl.value,Ad()))],AI=Object.freeze({__proto__:null,init:()=>{const Qn={},Zn=(lo,mo)=>{if(nc(lo.others).length===0)throw new Error("Cannot find any known coupled components");return Rr(Qn,mo)},Yn=(lo,mo,yo)=>Zn(mo,yo).getOrThunk(()=>{const Ro=Rr(mo.others,yo).getOrDie("No information found for coupled component: "+yo)(lo),Lo=lo.getSystem().build(Ro);return Qn[yo]=Lo,Lo}),Jn=(lo,mo,yo)=>Zn(mo,yo).orThunk(()=>(Rr(mo.others,yo).getOrDie("No information found for coupled component: "+yo),ko.none())),oo=Mo({});return ph({readState:oo,getExisting:Jn,getOrCreate:Yn})}});const Gd=Of({fields:dV,name:"coupling",apis:uV,state:AI}),HD=Qn=>{let Zn=ko.none(),Yn=[];const Jn=Ro=>HD(Lo=>{oo(Wo=>{Lo(Ro(Wo))})}),oo=Ro=>{mo()?Co(Ro):Yn.push(Ro)},lo=Ro=>{mo()||(Zn=ko.some(Ro),yo(Yn),Yn=[])},mo=()=>Zn.isSome(),yo=Ro=>{Qs(Ro,Co)},Co=Ro=>{Zn.each(Lo=>{setTimeout(()=>{Ro(Lo)},0)})};return Qn(lo),{get:oo,map:Jn,isReady:mo}},fV={nu:HD,pure:Qn=>HD(Zn=>{Zn(Qn)})},hV=Qn=>{setTimeout(()=>{throw Qn},0)},z_=Qn=>{const Zn=Co=>{Qn().then(Co,hV)};return{map:Co=>z_(()=>Qn().then(Co)),bind:Co=>z_(()=>Qn().then(Ro=>Co(Ro).toPromise())),anonBind:Co=>z_(()=>Qn().then(()=>Co.toPromise())),toLazy:()=>fV.nu(Zn),toCached:()=>{let Co=null;return z_(()=>(Co===null&&(Co=Qn()),Co))},toPromise:Qn,get:Zn}},Cm={nu:Qn=>z_(()=>new Promise(Qn)),pure:Qn=>z_(()=>Promise.resolve(Qn))},PI=Mo("sink"),$I=Mo(up({name:PI(),overrides:Mo({dom:{tag:"div"},behaviours:Zr([jh.config({useFixed:Js})]),events:Jc([X1(op()),X1(Xl()),X1(Lg())])})})),RI=(Qn,Zn)=>{const Yn=Qn.getHotspot(Zn).getOr(Zn),Jn="hotspot",oo=Qn.getAnchorOverrides();return Qn.layouts.fold(()=>({type:Jn,hotspot:Yn,overrides:oo}),lo=>({type:Jn,hotspot:Yn,overrides:oo,layouts:lo}))},mV=(Qn,Zn,Yn)=>{const Jn=Qn.fetch;return Jn(Yn).map(Zn)},pV=(Qn,Zn,Yn,Jn,oo,lo,mo)=>{const yo=mV(Qn,Zn,Jn),Co=DI(Jn,Qn);return yo.map(Ro=>Ro.bind(Lo=>ko.from(B_.sketch({...lo.menu(),uid:Mv(""),data:Lo,highlightOnOpen:mo,onOpenMenu:(Wo,jo)=>{const es=Co().getOrDie();jh.position(es,jo,{anchor:Yn}),uc.decloak(oo)},onOpenSubmenu:(Wo,jo,es)=>{const us=Co().getOrDie();jh.position(us,es,{anchor:{type:"submenu",item:jo}}),uc.decloak(oo)},onRepositionMenu:(Wo,jo,es)=>{const us=Co().getOrDie();jh.position(us,jo,{anchor:Yn}),Qs(es,Ps=>{jh.position(us,Ps.triggeredMenu,{anchor:{type:"submenu",item:Ps.triggeringItem}})})},onEscape:()=>(ol.focus(Jn),uc.close(oo),ko.some(!0))}))))},pP=(Qn,Zn,Yn,Jn,oo,lo,mo)=>{const yo=RI(Qn,Yn);return pV(Qn,Zn,yo,Yn,Jn,oo,mo).map(Ro=>(Ro.fold(()=>{uc.isOpen(Jn)&&uc.close(Jn)},Lo=>{uc.cloak(Jn),uc.open(Jn,Lo),lo(Jn)}),Jn))},gV=(Qn,Zn,Yn,Jn,oo,lo,mo)=>(uc.close(Jn),Cm.pure(Jn)),QD=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=Gd.getCoupled(Yn,"sandbox");return(uc.isOpen(mo)?gV:pP)(Qn,Zn,Yn,mo,Jn,oo,lo)},bV=(Qn,Zn,Yn)=>{const Jn=ic.getCurrent(Zn).getOr(Zn),oo=dd(Qn.element);Yn?ya(Jn.element,"min-width",oo+"px"):ql(Jn.element,oo)},DI=(Qn,Zn)=>Qn.getSystem().getByUid(Zn.uid+"-"+PI()).map(Yn=>()=>yl.value(Yn)).getOrThunk(()=>Zn.lazySink.fold(()=>()=>yl.error(new Error("No internal sink is specified, nor could an external sink be found")),Yn=>()=>Yn(Qn))),MI=Qn=>{uc.getState(Qn).each(Zn=>{B_.repositionMenus(Zn)})},VD=(Qn,Zn,Yn)=>{const Jn=I0(),oo=(yo,Co)=>{const Ro=RI(Qn,Zn);Jn.link(Zn.element),Qn.matchWidth&&bV(Ro.hotspot,Co,Qn.useMinWidth),Qn.onOpen(Ro,yo,Co),Yn!==void 0&&Yn.onOpen!==void 0&&Yn.onOpen(yo,Co)},lo=(yo,Co)=>{Jn.unlink(Zn.element),Yn!==void 0&&Yn.onClose!==void 0&&Yn.onClose(yo,Co)},mo=DI(Zn,Qn);return{dom:{tag:"div",classes:Qn.sandboxClasses,attributes:{id:Jn.id,role:"listbox"}},behaviours:Wg.augment(Qn.sandboxBehaviours,[da.config({store:{mode:"memory",initialValue:Zn}}),uc.config({onOpen:oo,onClose:lo,isPartOf:(yo,Co,Ro)=>ob(Co,Ro)||ob(Zn,Ro),getAttachPoint:()=>mo().getOrDie()}),ic.config({find:yo=>uc.getState(yo).bind(Co=>ic.getCurrent(Co))}),Om.config({channels:{...cw({isExtraPart:sr}),...C_({doReposition:MI})}})])}},NI=Qn=>{const Zn=Gd.getCoupled(Qn,"sandbox");MI(Zn)},zD=()=>[Gs("sandboxClasses",[]),Wg.field("sandboxBehaviours",[ic,Om,uc,da])],vV=Mo([Er("dom"),Er("fetch"),rc("onOpen"),Vm("onExecute"),Gs("getHotspot",ko.some),Gs("getAnchorOverrides",Mo({})),qb(),Nf("dropdownBehaviours",[Ql,Gd,Za,ol]),Er("toggleClass"),Gs("eventOrder",{}),Tc("lazySink"),Gs("matchWidth",!1),Gs("useMinWidth",!1),Tc("role")].concat(zD())),yV=Mo([v1({schema:[qy(),Gs("fakeFocus",!1)],name:"menu",defaults:Qn=>({onExecute:Qn.onExecute})}),$I()]),OV=(Qn,Zn,Yn,Jn)=>{const oo=Lo=>Rr(Qn.dom,"attributes").bind(Wo=>Rr(Wo,Lo)),lo=Lo=>{uc.getState(Lo).each(Wo=>{B_.highlightPrimary(Wo)})},mo=(Lo,Wo,jo)=>QD(Qn,Go,Lo,Jn,Wo,jo),yo=Lo=>{mo(Lo,lo,hp.HighlightMenuAndItem).get(xo)},Co={expand:Lo=>{Ql.isOn(Lo)||mo(Lo,xo,hp.HighlightNone).get(xo)},open:Lo=>{Ql.isOn(Lo)||mo(Lo,xo,hp.HighlightMenuAndItem).get(xo)},refetch:Lo=>Gd.getExistingCoupled(Lo,"sandbox").fold(()=>mo(Lo,xo,hp.HighlightMenuAndItem).map(xo),jo=>pP(Qn,Go,Lo,jo,Jn,xo,hp.HighlightMenuAndItem).map(xo)),isOpen:Ql.isOn,close:Lo=>{Ql.isOn(Lo)&&mo(Lo,xo,hp.HighlightMenuAndItem).get(xo)},repositionMenus:Lo=>{Ql.isOn(Lo)&&NI(Lo)}},Ro=(Lo,Wo)=>(og(Lo),ko.some(!0));return{uid:Qn.uid,dom:Qn.dom,components:Zn,behaviours:sf(Qn.dropdownBehaviours,[Ql.config({toggleClass:Qn.toggleClass,aria:{mode:"expanded"}}),Gd.config({others:{sandbox:Lo=>VD(Qn,Lo,{onOpen:()=>Ql.on(Lo),onClose:()=>Ql.off(Lo)})}}),Za.config({mode:"special",onSpace:Ro,onEnter:Ro,onDown:(Lo,Wo)=>{if(vb.isOpen(Lo)){const jo=Gd.getCoupled(Lo,"sandbox");lo(jo)}else vb.open(Lo);return ko.some(!0)},onEscape:(Lo,Wo)=>vb.isOpen(Lo)?(vb.close(Lo),ko.some(!0)):ko.none()}),ol.config({})]),events:tv(ko.some(yo)),eventOrder:{...Qn.eventOrder,[Im()]:["disabling","toggling","alloy.base.behaviour"]},apis:Co,domModification:{attributes:{"aria-haspopup":"true",...Qn.role.fold(()=>({}),Lo=>({role:Lo})),...Qn.dom.tag==="button"?{type:oo("type").getOr("button")}:{}}}}},vb=Yh({name:"Dropdown",configFields:vV(),partFields:yV(),factory:OV,apis:{open:(Qn,Zn)=>Qn.open(Zn),refetch:(Qn,Zn)=>Qn.refetch(Zn),expand:(Qn,Zn)=>Qn.expand(Zn),close:(Qn,Zn)=>Qn.close(Zn),isOpen:(Qn,Zn)=>Qn.isOpen(Zn),repositionMenus:(Qn,Zn)=>Qn.repositionMenus(Zn)}}),_V=Qn=>{switch(Qn.searchMode){case"no-search":return{menuType:"normal"};default:return{menuType:"searchable",searchMode:Qn}}},SV=Qn=>{const Zn=da.getValue(Qn),Yn=zA(Qn).map(dL);vb.refetch(Zn).get(()=>{const Jn=Gd.getCoupled(Zn,"sandbox");Yn.each(oo=>zA(Jn).each(lo=>qR(lo,oo)))})},wV=(Qn,Zn)=>{CV(Qn).each(Yn=>{T2(Qn,Yn.element,Zn.event.eventType,Zn.event.interactionEvent)})},CV=Qn=>uc.getState(Qn).bind(Bc.getHighlighted).bind(Bc.getHighlighted),kV=Qn=>of(Qn.element,WA)?ko.some(Qn.element):Rd(Qn.element,"."+WA),WD=(Qn,Zn,Yn)=>{ZR(Qn).each(Jn=>{jR(Jn,Yn),kV(Zn).each(lo=>{Uo(lo,"id").each(mo=>aa(Jn.element,"aria-controls",mo))})}),aa(Yn.element,"aria-selected","true")},xV=(Qn,Zn,Yn)=>{aa(Yn.element,"aria-selected","false")},EV=Qn=>{ZR(Qn).each(Zn=>ol.focus(Zn))},TV=Qn=>Gd.getExistingCoupled(Qn,"sandbox").bind(zA).map(dL).map(Yn=>Yn.fetchPattern).getOr("");var kE;(function(Qn){Qn[Qn.ContentFocus=0]="ContentFocus",Qn[Qn.UiFocus=1]="UiFocus"})(kE||(kE={}));const AV=(Qn,Zn,Yn,Jn,oo)=>{const lo=Yn.shared.providers,mo=yo=>oo?{...yo,shortcut:ko.none(),icon:yo.text.isSome()?ko.none():yo.icon}:yo;switch(Qn.type){case"menuitem":return IL(Qn).fold(vy,yo=>ko.some(rV(mo(yo),Zn,lo,Jn)));case"nestedmenuitem":return vQ(Qn).fold(vy,yo=>ko.some(iV(mo(yo),Zn,lo,Jn,oo)));case"togglemenuitem":return OQ(Qn).fold(vy,yo=>ko.some(aV(mo(yo),Zn,lo,Jn)));case"separator":return oD(Qn).fold(vy,yo=>ko.some(TI(yo)));case"fancymenuitem":return gQ(Qn).fold(vy,yo=>lV(yo,Yn));default:return console.error("Unknown item in general menu",Qn),ko.none()}},PV=(Qn,Zn,Yn,Jn,oo,lo,mo)=>{const yo=Jn===1,Co=!yo||ZA(Qn);return Ks(hs(Qn,Ro=>{switch(Ro.type){case"separator":return oQ(Ro).fold(vy,Lo=>ko.some(TI(Lo)));case"cardmenuitem":return DL(Ro).fold(vy,Lo=>ko.some(cV({...Lo,onAction:Wo=>{Lo.onAction(Wo),Yn(Lo.value,Lo.meta)}},oo,lo,{itemBehaviours:UL(Lo.meta,lo),cardText:{matchText:Zn,highlightOn:mo}})));case"autocompleteitem":default:return wL(Ro).fold(vy,Lo=>ko.some(sV(Lo,Zn,yo,"normal",Yn,oo,lo,Co)))}}))},LI=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=ZA(Zn),yo=Ks(hs(Zn,Lo=>{const Wo=es=>oo?!Pl(es,"text"):mo,jo=es=>AV(es,Yn,Jn,Wo(es),oo);return Lo.type==="nestedmenuitem"&&Lo.getSubmenuItems().length<=0?jo({...Lo,enabled:!1}):jo(Lo)})),Co=_V(lo);return(oo?hE:qA)(Qn,mo,yo,1,Co)},gP=Qn=>B_.singleData(Qn.value,Qn),$V=(Qn,Zn,Yn,Jn)=>{const oo=fP(Zn,Jn),lo=OO(Jn);return{data:gP({...Qn,movement:oo,menuBehaviours:bE.unnamedEvents(Zn!=="auto"?[]:[eu((mo,yo)=>{aD(mo,4,lo.item).each(({numColumns:Co,numRows:Ro})=>{Za.setGridSize(mo,Ro,Co)})})])}),menu:{markers:OO(Jn),fakeFocus:Yn===kE.ContentFocus}}},RV=(Qn,Zn)=>IR(Ds.fromDom(Zn.startContainer)).map(Yn=>{const Jn=Qn.createRng();return Jn.selectNode(Yn.dom),Jn}),DV={register:(Qn,Zn)=>{const Yn=ba("autocompleter"),Jn=Ua(!1),oo=Ua(!1),lo=gh(kd.sketch({dom:{tag:"div",classes:["tox-autocompleter"],attributes:{id:Yn}},components:[],fireDismissalEventInstead:{},inlineBehaviours:Zr([Rl("dismissAutocompleter",[wr(q1(),()=>Lo()),wr(Ev(),(er,Bs)=>{Uo(Bs.event.target,"id").each(Ns=>aa(Ds.fromDom(Qn.getBody()),"aria-activedescendant",Ns))})])]),lazySink:Zn.getSink})),mo=()=>kd.isOpen(lo),yo=oo.get,Co=()=>{if(mo()){kd.hide(lo),Qn.dom.remove(Yn,!1);const er=Ds.fromDom(Qn.getBody());Uo(er,"aria-owns").filter(Bs=>Bs===Yn).each(()=>{_s(er,"aria-owns"),_s(er,"aria-activedescendant")})}},Ro=()=>kd.getContent(lo).bind(er=>xa(er.components(),0)),Lo=()=>Qn.execCommand("mceAutocompleterClose"),Wo=er=>{const Bs=gc(er,Ns=>ko.from(Ns.columns)).getOr(1);return fs(er,Ns=>{const Xs=Ns.items;return PV(Xs,Ns.matchText,(Hr,kr)=>{const Or=Qn.selection.getRng();RV(Qn.dom,Or).each(qr=>{const na={hide:()=>Lo(),reload:Dl=>{Co(),Qn.execCommand("mceAutocompleterReload",!1,{fetchOptions:Dl})}};Jn.set(!0),Ns.onAction(na,qr,Hr,kr),Jn.set(!1)})},Bs,sv.BUBBLE_TO_SANDBOX,Zn,Ns.highlightOn)})},jo=(er,Bs)=>{Q9(Ds.fromDom(Qn.getBody())).each(Ns=>{const Xs=gc(er,Hr=>ko.from(Hr.columns)).getOr(1);kd.showMenuAt(lo,{anchor:{type:"node",root:Ds.fromDom(Qn.getBody()),node:ko.from(Ns)}},$V(qA("autocompleter-value",!0,Bs,Xs,{menuType:"normal"}),Xs,kE.ContentFocus,"normal"))}),Ro().each(Bc.highlightFirst)},es=er=>{const Bs=Wo(er);Bs.length>0?(jo(er,Bs),aa(Ds.fromDom(Qn.getBody()),"aria-owns",Yn),Qn.inline||us()):Co()},us=()=>{Qn.dom.get(Yn)&&Qn.dom.remove(Yn,!1);const er=Qn.getDoc().documentElement,Bs=Qn.selection.getNode(),Ns=uC(lo.element);fu(Ns,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",top:`${Bs.offsetTop}px`,left:`${Bs.offsetLeft}px`}),Qn.dom.add(er,Ns.dom),Rd(Ns,'[role="menu"]').each(Xs=>{El(Xs,"position"),El(Xs,"max-height")})};Qn.on("AutocompleterStart",({lookupData:er})=>{oo.set(!0),Jn.set(!1),es(er)}),Qn.on("AutocompleterUpdate",({lookupData:er})=>es(er)),Qn.on("AutocompleterEnd",()=>{Co(),oo.set(!1),Jn.set(!1)});const Ps={cancelIfNecessary:Lo,isMenuOpen:mo,isActive:yo,isProcessingAction:Jn.get,getMenu:Ro};V9.setup(Ps,Qn)}},II=["visible","hidden","clip"],BI=Qn=>Vu(Qn).length>0&&!Fs(II,Qn),UD=Qn=>{if(sm(Qn)){const Zn=qc(Qn,"overflow-x"),Yn=qc(Qn,"overflow-y");return BI(Zn)||BI(Yn)}else return!1},MV=Qn=>{const Zn=jC(Qn,UD),Yn=Zn.length===0?Nc(Qn).map(xl).map(Jn=>jC(Jn,UD)).getOr([]):Zn;return Nl(Yn).map(Jn=>({element:Jn,others:Yn.slice(1)}))},W_=(Qn,Zn)=>gy(Qn)?MV(Zn):ko.none(),Wk=Qn=>{const Zn=[...hs(Qn.others,au),tf()];return bv(au(Qn.element),Zn)},xE=(Qn,Zn,Yn)=>Bg(Qn,Zn,Yn).isSome(),FI=(Qn,Zn)=>{let Yn=null;return{cancel:()=>{Yn!==null&&(clearTimeout(Yn),Yn=null)},schedule:(...lo)=>{Yn=setTimeout(()=>{Qn.apply(null,lo),Yn=null},Zn)}}},HI=5,NV=400,QI=Qn=>{const Zn=Qn.raw;return Zn.touches===void 0||Zn.touches.length!==1?ko.none():ko.some(Zn.touches[0])},LV=(Qn,Zn)=>{const Yn=Math.abs(Qn.clientX-Zn.x),Jn=Math.abs(Qn.clientY-Zn.y);return Yn>HI||Jn>HI},IV=Qn=>{const Zn=Hl(),Yn=Ua(!1),Jn=FI(Ro=>{Qn.triggerEvent(DO(),Ro),Yn.set(!0)},NV),oo=Ro=>(QI(Ro).each(Lo=>{Jn.cancel();const Wo={x:Lo.clientX,y:Lo.clientY,target:Ro.target};Jn.schedule(Ro),Yn.set(!1),Zn.set(Wo)}),ko.none()),lo=Ro=>(Jn.cancel(),QI(Ro).each(Lo=>{Zn.on(Wo=>{LV(Lo,Wo)&&Zn.clear()})}),ko.none()),mo=Ro=>{Jn.cancel();const Lo=Wo=>Oc(Wo.target,Ro.target);return Zn.get().filter(Lo).map(Wo=>Yn.get()?(Ro.prevent(),!1):Qn.triggerEvent(ng(),Ro))},yo=La([{key:mm(),value:oo},{key:Nb(),value:lo},{key:H1(),value:mo}]);return{fireIfReady:(Ro,Lo)=>Rr(yo,Lo).bind(Wo=>Wo(Ro))}},BV=Qn=>Qn.raw.which===V3[0]&&!Fs(["input","textarea"],Nd(Qn.target))&&!xE(Qn.target,'[contenteditable="true"]'),FV=(Qn,Zn)=>{const Yn={stopBackspace:!0,...Zn},Jn=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"],oo=IV(Yn),lo=hs(Jn.concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),es=>Dh(Qn,es,us=>{oo.fireIfReady(us,es).each(er=>{er&&us.kill()}),Yn.triggerEvent(es,us)&&us.kill()})),mo=Hl(),yo=Dh(Qn,"paste",es=>{oo.fireIfReady(es,"paste").each(Ps=>{Ps&&es.kill()}),Yn.triggerEvent("paste",es)&&es.kill(),mo.set(setTimeout(()=>{Yn.triggerEvent(U1(),es)},0))}),Co=Dh(Qn,"keydown",es=>{Yn.triggerEvent("keydown",es)?es.kill():Yn.stopBackspace&&BV(es)&&es.prevent()}),Ro=Dh(Qn,"focusin",es=>{Yn.triggerEvent("focusin",es)&&es.kill()}),Lo=Hl(),Wo=Dh(Qn,"focusout",es=>{Yn.triggerEvent("focusout",es)&&es.kill(),Lo.set(setTimeout(()=>{Yn.triggerEvent(W1(),es)},0))});return{unbind:()=>{Qs(lo,es=>{es.unbind()}),Co.unbind(),Ro.unbind(),Wo.unbind(),yo.unbind(),mo.on(clearTimeout),Lo.on(clearTimeout)}}},VI=(Qn,Zn)=>{const Yn=Rr(Qn,"target").getOr(Zn);return Ua(Yn)},HV=(Qn,Zn)=>{const Yn=Ua(!1),Jn=Ua(!1);return{stop:()=>{Yn.set(!0)},cut:()=>{Jn.set(!0)},isStopped:Yn.get,isCut:Jn.get,event:Qn,setSource:Zn.set,getSource:Zn.get}},zI=Qn=>{const Zn=Ua(!1);return{stop:()=>{Zn.set(!0)},cut:xo,isStopped:Zn.get,isCut:sr,event:Qn,setSource:Yo("Cannot set source of a broadcasted event"),getSource:Yo("Cannot get source of a broadcasted event")}},EE=Po.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),WI=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=Qn(Zn,Jn),yo=HV(Yn,oo);return mo.fold(()=>(lo.logEventNoHandlers(Zn,Jn),EE.complete()),Co=>{const Ro=Co.descHandler;return Fv(Ro)(yo),yo.isStopped()?(lo.logEventStopped(Zn,Co.element,Ro.purpose),EE.stopped()):yo.isCut()?(lo.logEventCut(Zn,Co.element,Ro.purpose),EE.complete()):Zd(Co.element).fold(()=>(lo.logNoParent(Zn,Co.element,Ro.purpose),EE.complete()),Wo=>(lo.logEventResponse(Zn,Co.element,Ro.purpose),EE.resume(Wo)))})},UI=(Qn,Zn,Yn,Jn,oo,lo)=>WI(Qn,Zn,Yn,Jn,oo,lo).fold(Js,mo=>UI(Qn,Zn,Yn,mo,oo,lo),sr),QV=(Qn,Zn,Yn,Jn,oo)=>{const lo=VI(Yn,Jn);return WI(Qn,Zn,Yn,Jn,lo,oo)},VV=(Qn,Zn,Yn)=>{const Jn=zI(Zn);return Qs(Qn,oo=>{const lo=oo.descHandler;Fv(lo)(Jn)}),Jn.isStopped()},ZD=(Qn,Zn,Yn,Jn)=>ZI(Qn,Zn,Yn,Yn.target,Jn),ZI=(Qn,Zn,Yn,Jn,oo)=>{const lo=VI(Yn,Jn);return UI(Qn,Zn,Yn,Jn,lo,oo)},zV=(Qn,Zn)=>({element:Qn,descHandler:Zn}),WV=(Qn,Zn)=>({id:Qn,descHandler:Zn}),qI=()=>{const Qn={},Zn=(mo,yo,Co)=>{Zl(Co,(Ro,Lo)=>{const Wo=Qn[Lo]!==void 0?Qn[Lo]:{};Wo[yo]=OS(Ro,mo),Qn[Lo]=Wo})},Yn=(mo,yo)=>$0(yo).bind(Co=>Rr(mo,Co)).map(Co=>zV(yo,Co));return{registerId:Zn,unregisterId:mo=>{Zl(Qn,(yo,Co)=>{Pl(yo,mo)&&delete yo[mo]})},filterByType:mo=>Rr(Qn,mo).map(yo=>rd(yo,(Co,Ro)=>WV(Ro,Co))).getOr([]),find:(mo,yo,Co)=>Rr(Qn,yo).bind(Ro=>Jf(Co,Lo=>Yn(Ro,Lo),mo))}},jI=()=>{const Qn=qI(),Zn={},Yn=Ro=>{const Lo=Ro.element;return $0(Lo).getOrThunk(()=>J1("uid-",Ro.element))},Jn=(Ro,Lo)=>{const Wo=Zn[Lo];if(Wo===Ro)lo(Ro);else throw new Error('The tagId "'+Lo+'" is already used by: '+r1(Wo.element)+` +Cannot use it for: `+r1(Ro.element)+` +The conflicting element is`+(Gl(Wo.element)?" ":" not ")+"already in the DOM")},oo=Ro=>{const Lo=Yn(Ro);Su(Zn,Lo)&&Jn(Ro,Lo);const Wo=[Ro];Qn.registerId(Wo,Lo,Ro.events),Zn[Lo]=Ro},lo=Ro=>{$0(Ro.element).each(Lo=>{delete Zn[Lo],Qn.unregisterId(Lo)})};return{find:(Ro,Lo,Wo)=>Qn.find(Ro,Lo,Wo),filter:Ro=>Qn.filterByType(Ro),register:oo,unregister:lo,getById:Ro=>Rr(Zn,Ro)}},rv=Mp({name:"Container",factory:Qn=>{const{attributes:Zn,...Yn}=Qn.dom;return{uid:Qn.uid,dom:{tag:"div",attributes:{role:"presentation",...Zn},...Yn},components:Qn.components,behaviours:j0(Qn.containerBehaviours),events:Qn.events,domModification:Qn.domModification,eventOrder:Qn.eventOrder}},configFields:[Gs("components",[]),Nf("containerBehaviours",[]),Gs("events",{}),Gs("domModification",{}),Gs("eventOrder",{})]}),bP=Qn=>{const Zn=Bs=>Zd(Qn.element).fold(Js,Ns=>Oc(Bs,Ns)),Yn=jI(),Jn=(Bs,Ns)=>Yn.find(Zn,Bs,Ns),oo=FV(Qn.element,{triggerEvent:(Bs,Ns)=>KO(Bs,Ns.target,Xs=>ZD(Jn,Bs,Ns,Xs))}),lo={debugInfo:Mo("real"),triggerEvent:(Bs,Ns,Xs)=>{KO(Bs,Ns,Hr=>ZI(Jn,Bs,Xs,Ns,Hr))},triggerFocus:(Bs,Ns)=>{$0(Bs).fold(()=>{Cd(Bs)},Xs=>{KO(tg(),Bs,Hr=>(QV(Jn,tg(),{originator:Ns,kill:xo,prevent:xo,target:Bs},Bs,Hr),!1))})},triggerEscape:(Bs,Ns)=>{lo.triggerEvent("keydown",Bs.element,Ns.event)},getByUid:Bs=>Ps(Bs),getByDom:Bs=>er(Bs),build:gh,buildOrPatch:YO,addToGui:Bs=>{Co(Bs)},removeFromGui:Bs=>{Ro(Bs)},addToWorld:Bs=>{mo(Bs)},removeFromWorld:Bs=>{yo(Bs)},broadcast:Bs=>{jo(Bs)},broadcastOn:(Bs,Ns)=>{es(Bs,Ns)},broadcastEvent:(Bs,Ns)=>{us(Bs,Ns)},isConnected:Js},mo=Bs=>{Bs.connect(lo),Td(Bs.element)||(Yn.register(Bs),Qs(Bs.components(),mo),lo.triggerEvent(Z1(),Bs.element,{target:Bs.element}))},yo=Bs=>{Td(Bs.element)||(Qs(Bs.components(),yo),Yn.unregister(Bs)),Bs.disconnect()},Co=Bs=>{cy(Qn,Bs)},Ro=Bs=>{Kb(Bs)},Lo=()=>{oo.unbind(),am(Qn.element)},Wo=Bs=>{const Ns=Yn.filter(T0());Qs(Ns,Xs=>{const Hr=Xs.descHandler;Fv(Hr)(Bs)})},jo=Bs=>{Wo({universal:!0,data:Bs})},es=(Bs,Ns)=>{Wo({universal:!1,channels:Bs,data:Ns})},us=(Bs,Ns)=>{const Xs=Yn.filter(Bs);return VV(Xs,Ns)},Ps=Bs=>Yn.getById(Bs).fold(()=>yl.error(new Error('Could not find component with uid: "'+Bs+'" in system.')),yl.value),er=Bs=>{const Ns=$0(Bs).getOr("not found");return Ps(Ns)};return mo(Qn),{root:Qn,element:Qn.element,destroy:Lo,add:Co,remove:Ro,getByUid:Ps,getByDom:er,addToWorld:mo,removeFromWorld:yo,broadcast:jo,broadcastOn:es,broadcastEvent:us}},UV=(Qn,Zn)=>({dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:hs(Qn.items,Zn.interpreter)}),ZV=Mo([Gs("prefix","form-field"),Nf("fieldBehaviours",[ic,da])]),qV=Mo([up({schema:[Er("dom")],name:"label"}),up({factory:{sketch:Qn=>({uid:Qn.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:Qn.text}})},schema:[Er("text")],name:"aria-descriptor"}),Xh({factory:{sketch:Qn=>{const Zn=zr(Qn,["factory"]);return Qn.factory.sketch(Zn)}},schema:[Er("factory")],name:"field"})]),jV=(Qn,Zn,Yn,Jn)=>{const oo=sf(Qn.fieldBehaviours,[ic.config({find:yo=>Au(yo,Qn,"field")}),da.config({store:{mode:"manual",getValue:yo=>ic.getCurrent(yo).bind(da.getValue),setValue:(yo,Co)=>{ic.getCurrent(yo).each(Ro=>{da.setValue(Ro,Co)})}}})]),lo=Jc([eu((yo,Co)=>{const Ro=KT(yo,Qn,["label","field","aria-descriptor"]);Ro.field().each(Lo=>{const Wo=ba(Qn.prefix);Ro.label().each(jo=>{aa(jo.element,"for",Wo),aa(Lo.element,"id",Wo)}),Ro["aria-descriptor"]().each(jo=>{const es=ba(Qn.prefix);aa(jo.element,"id",es),aa(Lo.element,"aria-describedby",es)})})})]),mo={getField:yo=>Au(yo,Qn,"field"),getLabel:yo=>Au(yo,Qn,"label")};return{uid:Qn.uid,dom:Qn.dom,components:Zn,behaviours:oo,events:lo,apis:mo}},su=Yh({name:"FormField",configFields:ZV(),partFields:qV(),factory:jV,apis:{getField:(Qn,Zn)=>Qn.getField(Zn),getLabel:(Qn,Zn)=>Qn.getLabel(Zn)}});var vP=Object.freeze({__proto__:null,exhibit:(Qn,Zn)=>bm({attributes:La([{key:Zn.tabAttr,value:"true"}])})}),XV=[Gs("tabAttr","data-alloy-tabstop")];const sd=Of({fields:XV,name:"tabstopping",active:vP});var YV=tinymce.util.Tools.resolve("tinymce.html.Entities");const TE=(Qn,Zn,Yn,Jn)=>{const oo=KV(Qn,Zn,Yn,Jn);return su.sketch(oo)},GV=(Qn,Zn)=>TE(Qn,Zn,[],[]),KV=(Qn,Zn,Yn,Jn)=>({dom:AE(Yn),components:Qn.toArray().concat([Zn]),fieldBehaviours:Zr(Jn)}),tG=()=>AE([]),AE=Qn=>({tag:"div",classes:["tox-form__group"].concat(Qn)}),yb=(Qn,Zn)=>su.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[wd(Zn.translate(Qn))]}),vg=ba("form-component-change"),Uk=ba("form-close"),U_=ba("form-cancel"),Cy=ba("form-action"),PE=ba("form-submit"),qD=ba("form-block"),jD=ba("form-unblock"),XI=ba("form-tabchange"),YI=ba("form-resize"),JV=(Qn,Zn,Yn)=>{const Jn=Qn.label.map(es=>yb(es,Zn)),oo=Zn.icons(),lo=es=>{var us;return(us=oo[es])!==null&&us!==void 0?us:es},mo=es=>(us,Ps)=>{Bg(Ps.event.target,"[data-collection-item-value]").each(er=>{es(us,Ps,er,Bu(er,"data-collection-item-value"))})},yo=(es,us)=>{const Ps=hs(us,Ns=>{const Xs=_1.translate(Ns.text),Hr=Qn.columns===1?`
    ${Xs}
    `:"",kr=`
    ${lo(Ns.icon)}
    `,Or={_:" "," - ":" ","-":" "},qr=Xs.replace(/\_| \- |\-/g,Dl=>Or[Dl]);return`
    ${kr}${Hr}
    `}),er=Qn.columns!=="auto"&&Qn.columns>1?ha(Ps,Qn.columns):[Ps],Bs=hs(er,Ns=>`
    ${Ns.join("")}
    `);G1(es.element,Bs.join(""))},Co=mo((es,us,Ps,er)=>{us.stop(),Zn.isDisabled()||Qa(es,Cy,{name:Qn.name,value:er})}),Ro=[wr(eg(),mo((es,us,Ps)=>{Cd(Ps)})),wr(Lg(),Co),wr(ng(),Co),wr(Wu(),mo((es,us,Ps)=>{Rd(es.element,"."+dE).each(er=>{Yu(er,dE)}),$d(Ps,dE)})),wr(pm(),mo(es=>{Rd(es.element,"."+dE).each(us=>{Yu(us,dE)})})),qh(mo((es,us,Ps,er)=>{Qa(es,Cy,{name:Qn.name,value:er})}))],Lo=(es,us)=>hs(_f(es.element,".tox-collection__item"),us),Wo=su.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(Qn.columns!==1?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:Go},behaviours:Zr([Ja.config({disabled:Zn.isDisabled,onDisabled:es=>{Lo(es,us=>{$d(us,"tox-collection__item--state-disabled"),aa(us,"aria-disabled",!0)})},onEnabled:es=>{Lo(es,us=>{Yu(us,"tox-collection__item--state-disabled"),_s(us,"aria-disabled")})}}),jf(),Cl.config({}),da.config({store:{mode:"memory",initialValue:Yn.getOr([])},onSetValue:(es,us)=>{yo(es,us),Qn.columns==="auto"&&aD(es,5,"tox-collection__item").each(({numRows:Ps,numColumns:er})=>{Za.setGridSize(es,Ps,er)}),Wl(es,YI)}}),sd.config({}),Za.config(GQ(Qn.columns,"normal")),Rl("collection-events",Ro)]),eventOrder:{[Im()]:["disabling","alloy.base.behaviour","collection-events"]}});return TE(Jn,Wo,["tox-form__group--collection"],[])},ez=["input","textarea"],GI=Qn=>{const Zn=Nd(Qn);return Fs(ez,Zn)},KI=(Qn,Zn)=>{const Yn=Zn.getRoot(Qn).getOr(Qn.element);Yu(Yn,Zn.invalidClass),Zn.notify.each(Jn=>{GI(Qn.element)&&aa(Qn.element,"aria-invalid",!1),Jn.getContainer(Qn).each(oo=>{G1(oo,Jn.validHtml)}),Jn.onValid(Qn)})},XD=(Qn,Zn,Yn,Jn)=>{const oo=Zn.getRoot(Qn).getOr(Qn.element);$d(oo,Zn.invalidClass),Zn.notify.each(lo=>{GI(Qn.element)&&aa(Qn.element,"aria-invalid",!0),lo.getContainer(Qn).each(mo=>{G1(mo,Jn)}),lo.onInvalid(Qn,Jn)})},Hw=(Qn,Zn,Yn)=>Zn.validator.fold(()=>Cm.pure(yl.value(!0)),Jn=>Jn.validate(Qn)),CO=(Qn,Zn,Yn)=>(Zn.notify.each(Jn=>{Jn.onValidate(Qn)}),Hw(Qn,Zn).map(Jn=>Qn.getSystem().isConnected()?Jn.fold(oo=>(XD(Qn,Zn,Yn,oo),yl.error(oo)),oo=>(KI(Qn,Zn),yl.value(oo))):yl.error("No longer in system")));var JI=Object.freeze({__proto__:null,markValid:KI,markInvalid:XD,query:Hw,run:CO,isInvalid:(Qn,Zn)=>{const Yn=Zn.getRoot(Qn).getOr(Qn.element);return of(Yn,Zn.invalidClass)}}),yP=Object.freeze({__proto__:null,events:(Qn,Zn)=>Qn.validator.map(Yn=>Jc([wr(Yn.onEvent,Jn=>{CO(Jn,Qn,Zn).get(Go)})].concat(Yn.validateOnLoad?[eu(Jn=>{CO(Jn,Qn,Zn).get(xo)})]:[]))).getOr({})}),nz=[Er("invalidClass"),Gs("getRoot",ko.none),hh("notify",[Gs("aria","alert"),Gs("getContainer",ko.none),Gs("validHtml",""),rc("onValid"),rc("onInvalid"),rc("onValidate")]),hh("validator",[Er("validate"),Gs("onEvent","input"),Gs("validateOnLoad",!0)])];const C1=Of({fields:nz,name:"invalidating",active:yP,apis:JI,extra:{validation:Qn=>Zn=>{const Yn=da.getValue(Zn);return Cm.pure(Qn(Yn))}}});var oz=Object.freeze({__proto__:null,events:()=>Jc([IO(z1(),Js)]),exhibit:()=>bm({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})});const $E=Of({fields:[],name:"unselecting",active:oz}),sz=(Qn,Zn)=>vb.sketch({dom:Qn.dom,components:Qn.components,toggleClass:"mce-active",dropdownBehaviours:Zr([Lf.button(Zn.providers.isDisabled),jf(),$E.config({}),sd.config({})]),layouts:Qn.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:Zn.getSink,fetch:Yn=>Cm.nu(Jn=>Qn.fetch(Jn)).map(Jn=>ko.from(gP(Lc(MD(ba("menu-value"),Jn,oo=>{Qn.onItemAction(Yn,oo)},Qn.columns,Qn.presets,sv.CLOSE_ON_EXECUTE,sr,Zn.providers),{movement:fP(Qn.columns,Qn.presets)})))),parts:{menu:Dk(!1,1,Qn.presets)}}),eB=ba("color-input-change"),tB=ba("color-swatch-change"),RE=ba("color-picker-cancel"),rz=(Qn,Zn,Yn,Jn)=>{const oo=su.parts.field({factory:Lw,inputClasses:["tox-textfield"],data:Jn,onSetValue:Ro=>C1.run(Ro).get(xo),inputBehaviours:Zr([Ja.config({disabled:Zn.providers.isDisabled}),jf(),sd.config({}),C1.config({invalidClass:"tox-textbox-field-invalid",getRoot:Ro=>lh(Ro.element),notify:{onValid:Ro=>{const Lo=da.getValue(Ro);Qa(Ro,eB,{color:Lo})}},validator:{validateOnLoad:!1,validate:Ro=>{const Lo=da.getValue(Ro);if(Lo.length===0)return Cm.pure(yl.value(!0));{const Wo=Ds.fromTag("span");ya(Wo,"background-color",Lo);const jo=ku(Wo,"background-color").fold(()=>yl.error("blah"),es=>yl.value(Lo));return Cm.pure(jo)}}}})]),selectOnFocus:!1}),lo=Qn.label.map(Ro=>yb(Ro,Zn.providers)),mo=(Ro,Lo)=>{Qa(Ro,tB,{value:Lo})},yo=(Ro,Lo)=>{Co.getOpt(Ro).each(Wo=>{Lo==="custom"?Yn.colorPicker(jo=>{jo.fold(()=>Wl(Wo,RE),es=>{mo(Wo,es),kD(Qn.storageKey,es)})},"#ffffff"):Lo==="remove"?mo(Wo,""):mo(Wo,Lo)})},Co=ou(sz({dom:{tag:"span",attributes:{"aria-label":Zn.providers.translate("Color swatch")}},layouts:{onRtl:()=>[eh,gf,bu],onLtr:()=>[gf,eh,bu]},components:[],fetch:OI(Yn.getColors(Qn.storageKey),Qn.storageKey,Yn.hasCustomColors()),columns:Yn.getColorCols(Qn.storageKey),presets:"color",onItemAction:yo},Zn));return su.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:lo.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[oo,Co.asSpec()]}]),fieldBehaviours:Zr([Rl("form-field-events",[wr(eB,(Ro,Lo)=>{Co.getOpt(Ro).each(Wo=>{ya(Wo.element,"background-color",Lo.event.color)}),Qa(Ro,vg,{name:Qn.name})}),wr(tB,(Ro,Lo)=>{su.getField(Ro).each(Wo=>{da.setValue(Wo,Lo.event.value),ic.getCurrent(Ro).each(ol.focus)})}),wr(RE,(Ro,Lo)=>{su.getField(Ro).each(Wo=>{ic.getCurrent(Ro).each(ol.focus)})})])])})},YD=up({schema:[Er("dom")],name:"label"}),Z_=Qn=>up({name:""+Qn+"-edge",overrides:Zn=>Zn.model.manager.edgeActions[Qn].fold(()=>({}),Jn=>({events:Jc([sg(mm(),(oo,lo,mo)=>Jn(oo,mo),[Zn]),sg(Xl(),(oo,lo,mo)=>Jn(oo,mo),[Zn]),sg(Qd(),(oo,lo,mo)=>{mo.mouseIsDown.get()&&Jn(oo,mo)},[Zn])])}))}),iz=Z_("top-left"),az=Z_("top"),nB=Z_("top-right"),lz=Z_("right"),cz=Z_("bottom-right"),uz=Z_("bottom"),oB=Z_("bottom-left"),dz=Z_("left"),fz=Xh({name:"thumb",defaults:Mo({dom:{styles:{position:"absolute"}}}),overrides:Qn=>({events:Jc([A0(mm(),Qn,"spectrum"),A0(Nb(),Qn,"spectrum"),A0(H1(),Qn,"spectrum"),A0(Xl(),Qn,"spectrum"),A0(Qd(),Qn,"spectrum"),A0(Cv(),Qn,"spectrum")])})}),_P=Qn=>ev(Qn.event),hz=Xh({schema:[pu("mouseIsDown",()=>Ua(!1))],name:"spectrum",overrides:Qn=>{const Yn=Qn.model.manager,Jn=(oo,lo)=>Yn.getValueFromEvent(lo).map(mo=>Yn.setValueFrom(oo,Qn,mo));return{behaviours:Zr([Za.config({mode:"special",onLeft:(oo,lo)=>Yn.onLeft(oo,Qn,_P(lo)),onRight:(oo,lo)=>Yn.onRight(oo,Qn,_P(lo)),onUp:(oo,lo)=>Yn.onUp(oo,Qn,_P(lo)),onDown:(oo,lo)=>Yn.onDown(oo,Qn,_P(lo))}),sd.config({}),ol.config({})]),events:Jc([wr(mm(),Jn),wr(Nb(),Jn),wr(Xl(),Jn),wr(Qd(),(oo,lo)=>{Qn.mouseIsDown.get()&&Jn(oo,lo)})])}}});var mz=[YD,dz,lz,az,uz,iz,nB,oB,cz,fz,hz];const Zk=Mo("slider.change.value"),gz=Qn=>Qn.type.indexOf("touch")!==-1,GD=Qn=>{const Zn=Qn.event.raw;if(gz(Zn)){const Yn=Zn;return Yn.touches!==void 0&&Yn.touches.length===1?ko.some(Yn.touches[0]).map(Jn=>vc(Jn.clientX,Jn.clientY)):ko.none()}else{const Yn=Zn;return Yn.clientX!==void 0?ko.some(Yn).map(Jn=>vc(Jn.clientX,Jn.clientY)):ko.none()}},bz="top",vz="right",yz="bottom",sB="left",l0=Qn=>Qn.model.minX,Qw=Qn=>Qn.model.minY,SP=Qn=>Qn.model.minX-1,wP=Qn=>Qn.model.minY-1,ky=Qn=>Qn.model.maxX,Um=Qn=>Qn.model.maxY,qk=Qn=>Qn.model.maxX+1,DE=Qn=>Qn.model.maxY+1,rB=(Qn,Zn,Yn)=>Zn(Qn)-Yn(Qn),KD=Qn=>rB(Qn,ky,l0),JD=Qn=>rB(Qn,Um,Qw),iB=Qn=>KD(Qn)/2,eM=Qn=>JD(Qn)/2,Vw=(Qn,Zn)=>Zn?Qn.stepSize*Qn.speedMultiplier:Qn.stepSize,aB=Qn=>Qn.snapToGrid,lB=Qn=>Qn.snapStart,tM=Qn=>Qn.rounded,CP=(Qn,Zn)=>Qn[Zn+"-edge"]!==void 0,nM=Qn=>CP(Qn,sB),oM=Qn=>CP(Qn,vz),sM=Qn=>CP(Qn,bz),cB=Qn=>CP(Qn,yz),kO=Qn=>Qn.model.value.get(),q_=(Qn,Zn)=>({x:Qn,y:Zn}),c0=(Qn,Zn)=>{Qa(Qn,Zk(),{value:Zn})},Oz=(Qn,Zn)=>{c0(Qn,q_(SP(Zn),wP(Zn)))},_z=(Qn,Zn)=>{c0(Qn,wP(Zn))},rM=(Qn,Zn)=>{c0(Qn,q_(iB(Zn),wP(Zn)))},Sz=(Qn,Zn)=>{c0(Qn,q_(qk(Zn),wP(Zn)))},uB=(Qn,Zn)=>{c0(Qn,qk(Zn))},wz=(Qn,Zn)=>{c0(Qn,q_(qk(Zn),eM(Zn)))},Cz=(Qn,Zn)=>{c0(Qn,q_(qk(Zn),DE(Zn)))},kz=(Qn,Zn)=>{c0(Qn,DE(Zn))},xz=(Qn,Zn)=>{c0(Qn,q_(iB(Zn),DE(Zn)))},Ez=(Qn,Zn)=>{c0(Qn,q_(SP(Zn),DE(Zn)))},Tz=(Qn,Zn)=>{c0(Qn,SP(Zn))},Az=(Qn,Zn)=>{c0(Qn,q_(SP(Zn),eM(Zn)))},kP=(Qn,Zn,Yn,Jn)=>QnYn?Yn:Qn===Zn?Zn-1:Math.max(Zn,Qn-Jn),xP=(Qn,Zn,Yn,Jn)=>Qn>Yn?Qn:QnMath.max(Zn,Math.min(Yn,Qn)),Pz=(Qn,Zn,Yn,Jn,oo)=>oo.fold(()=>{const lo=Qn-Zn,mo=Math.round(lo/Jn)*Jn;return dB(Zn+mo,Zn-1,Yn+1)},lo=>{const mo=(Qn-lo)%Jn,yo=Math.round(mo/Jn),Co=Math.floor((Qn-lo)/Jn),Ro=Math.floor((Yn-lo)/Jn),Lo=Math.min(Ro,Co+yo),Wo=lo+Lo*Jn;return Math.max(lo,Wo)}),$z=(Qn,Zn,Yn)=>Math.min(Yn,Math.max(Qn,Zn))-Zn,fB=Qn=>{const{min:Zn,max:Yn,range:Jn,value:oo,step:lo,snap:mo,snapStart:yo,rounded:Co,hasMinEdge:Ro,hasMaxEdge:Lo,minBound:Wo,maxBound:jo,screenRange:es}=Qn,us=Ro?Zn-1:Zn,Ps=Lo?Yn+1:Yn;if(oojo)return Ps;{const er=$z(oo,Wo,jo),Bs=dB(er/es*Jn+Zn,us,Ps);return mo&&Bs>=Zn&&Bs<=Yn?Pz(Bs,Zn,Yn,lo,yo):Co?Math.round(Bs):Bs}},hB=Qn=>{const{min:Zn,max:Yn,range:Jn,value:oo,hasMinEdge:lo,hasMaxEdge:mo,maxBound:yo,maxOffset:Co,centerMinEdge:Ro,centerMaxEdge:Lo}=Qn;return ooYn?mo?yo:Lo:(oo-Zn)/Jn*Co},iM="top",aM="right",lM="bottom",EP="left",cM="width",Rz="height",iv=Qn=>Qn.element.dom.getBoundingClientRect(),u0=(Qn,Zn)=>Qn[Zn],TP=Qn=>{const Zn=iv(Qn);return u0(Zn,EP)},mB=Qn=>{const Zn=iv(Qn);return u0(Zn,aM)},AP=Qn=>{const Zn=iv(Qn);return u0(Zn,iM)},PP=Qn=>{const Zn=iv(Qn);return u0(Zn,lM)},xy=Qn=>{const Zn=iv(Qn);return u0(Zn,cM)},pB=Qn=>{const Zn=iv(Qn);return u0(Zn,Rz)},jk=(Qn,Zn,Yn)=>(Qn+Zn)/2-Yn,gB=(Qn,Zn)=>{const Yn=iv(Qn),Jn=iv(Zn),oo=u0(Yn,EP),lo=u0(Yn,aM),mo=u0(Jn,EP);return jk(oo,lo,mo)},$P=(Qn,Zn)=>{const Yn=iv(Qn),Jn=iv(Zn),oo=u0(Yn,iM),lo=u0(Yn,lM),mo=u0(Jn,iM);return jk(oo,lo,mo)},RP=(Qn,Zn)=>{Qa(Qn,Zk(),{value:Zn})},uM=(Qn,Zn,Yn)=>{const Jn={min:l0(Zn),max:ky(Zn),range:KD(Zn),value:Yn,step:Vw(Zn),snap:aB(Zn),snapStart:lB(Zn),rounded:tM(Zn),hasMinEdge:nM(Zn),hasMaxEdge:oM(Zn),minBound:TP(Qn),maxBound:mB(Qn),screenRange:xy(Qn)};return fB(Jn)},Dz=(Qn,Zn,Yn)=>{const Jn=uM(Qn,Zn,Yn);return RP(Qn,Jn),Jn},bB=(Qn,Zn)=>{const Yn=l0(Zn);RP(Qn,Yn)},Mz=(Qn,Zn)=>{const Yn=ky(Zn);RP(Qn,Yn)},dM=(Qn,Zn,Yn,Jn)=>{const lo=(Qn>0?xP:kP)(kO(Yn),l0(Yn),ky(Yn),Vw(Yn,Jn));return RP(Zn,lo),ko.some(lo)},DP=Qn=>(Zn,Yn,Jn)=>dM(Qn,Zn,Yn,Jn).map(Js),fM=Qn=>GD(Qn).map(Yn=>Yn.left),Nz=(Qn,Zn,Yn,Jn,oo)=>{const mo=xy(Qn),yo=Jn.bind(Lo=>ko.some(gB(Lo,Qn))).getOr(0),Co=oo.bind(Lo=>ko.some(gB(Lo,Qn))).getOr(mo),Ro={min:l0(Zn),max:ky(Zn),range:KD(Zn),value:Yn,hasMinEdge:nM(Zn),hasMaxEdge:oM(Zn),minBound:TP(Qn),minOffset:0,maxBound:mB(Qn),maxOffset:mo,centerMinEdge:yo,centerMaxEdge:Co};return hB(Ro)},yg=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=Nz(Zn,lo,Yn,Jn,oo);return TP(Zn)-TP(Qn)+mo},Lz=(Qn,Zn,Yn,Jn)=>{const oo=kO(Yn),lo=yg(Qn,Jn.getSpectrum(Qn),oo,Jn.getLeftEdge(Qn),Jn.getRightEdge(Qn),Yn),mo=dd(Zn.element)/2;ya(Zn.element,"left",lo-mo+"px")},Iz=DP(-1),vB=DP(1),yB=ko.none,Bz=ko.none,Fz={"top-left":ko.none(),top:ko.none(),"top-right":ko.none(),right:ko.some(uB),"bottom-right":ko.none(),bottom:ko.none(),"bottom-left":ko.none(),left:ko.some(Tz)};var Hz=Object.freeze({__proto__:null,setValueFrom:Dz,setToMin:bB,setToMax:Mz,findValueOfOffset:uM,getValueFromEvent:fM,findPositionOfValue:yg,setPositionFromValue:Lz,onLeft:Iz,onRight:vB,onUp:yB,onDown:Bz,edgeActions:Fz});const MP=(Qn,Zn)=>{Qa(Qn,Zk(),{value:Zn})},hM=(Qn,Zn,Yn)=>{const Jn={min:Qw(Zn),max:Um(Zn),range:JD(Zn),value:Yn,step:Vw(Zn),snap:aB(Zn),snapStart:lB(Zn),rounded:tM(Zn),hasMinEdge:sM(Zn),hasMaxEdge:cB(Zn),minBound:AP(Qn),maxBound:PP(Qn),screenRange:pB(Qn)};return fB(Jn)},Qz=(Qn,Zn,Yn)=>{const Jn=hM(Qn,Zn,Yn);return MP(Qn,Jn),Jn},Vz=(Qn,Zn)=>{const Yn=Qw(Zn);MP(Qn,Yn)},OB=(Qn,Zn)=>{const Yn=Um(Zn);MP(Qn,Yn)},zz=(Qn,Zn,Yn,Jn)=>{const lo=(Qn>0?xP:kP)(kO(Yn),Qw(Yn),Um(Yn),Vw(Yn,Jn));return MP(Zn,lo),ko.some(lo)},_B=Qn=>(Zn,Yn,Jn)=>zz(Qn,Zn,Yn,Jn).map(Js),Wz=Qn=>GD(Qn).map(Yn=>Yn.top),SB=(Qn,Zn,Yn,Jn,oo)=>{const mo=pB(Qn),yo=Jn.bind(Lo=>ko.some($P(Lo,Qn))).getOr(0),Co=oo.bind(Lo=>ko.some($P(Lo,Qn))).getOr(mo),Ro={min:Qw(Zn),max:Um(Zn),range:JD(Zn),value:Yn,hasMinEdge:sM(Zn),hasMaxEdge:cB(Zn),minBound:AP(Qn),minOffset:0,maxBound:PP(Qn),maxOffset:mo,centerMinEdge:yo,centerMaxEdge:Co};return hB(Ro)},ME=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=SB(Zn,lo,Yn,Jn,oo);return AP(Zn)-AP(Qn)+mo},Uz=(Qn,Zn,Yn,Jn)=>{const oo=kO(Yn),lo=ME(Qn,Jn.getSpectrum(Qn),oo,Jn.getTopEdge(Qn),Jn.getBottomEdge(Qn),Yn),mo=cu(Zn.element)/2;ya(Zn.element,"top",lo-mo+"px")},mM=ko.none,Xk=ko.none,wB=_B(-1),CB=_B(1),kB={"top-left":ko.none(),top:ko.some(_z),"top-right":ko.none(),right:ko.none(),"bottom-right":ko.none(),bottom:ko.some(kz),"bottom-left":ko.none(),left:ko.none()};var Zz=Object.freeze({__proto__:null,setValueFrom:Qz,setToMin:Vz,setToMax:OB,findValueOfOffset:hM,getValueFromEvent:Wz,findPositionOfValue:ME,setPositionFromValue:Uz,onLeft:mM,onRight:Xk,onUp:wB,onDown:CB,edgeActions:kB});const NP=(Qn,Zn)=>{Qa(Qn,Zk(),{value:Zn})},zw=(Qn,Zn)=>({x:Qn,y:Zn}),qz=(Qn,Zn,Yn)=>{const Jn=uM(Qn,Zn,Yn.left),oo=hM(Qn,Zn,Yn.top),lo=zw(Jn,oo);return NP(Qn,lo),lo},jz=(Qn,Zn,Yn,Jn,oo)=>{const lo=Qn>0?xP:kP,mo=Zn?kO(Jn).x:lo(kO(Jn).x,l0(Jn),ky(Jn),Vw(Jn,oo)),yo=Zn?lo(kO(Jn).y,Qw(Jn),Um(Jn),Vw(Jn,oo)):kO(Jn).y;return NP(Yn,zw(mo,yo)),ko.some(mo)},NE=(Qn,Zn)=>(Yn,Jn,oo)=>jz(Qn,Zn,Yn,Jn,oo).map(Js),xB=(Qn,Zn)=>{const Yn=l0(Zn),Jn=Qw(Zn);NP(Qn,zw(Yn,Jn))},pM=(Qn,Zn)=>{const Yn=ky(Zn),Jn=Um(Zn);NP(Qn,zw(Yn,Jn))},EB=Qn=>GD(Qn),Lp=(Qn,Zn,Yn,Jn)=>{const oo=kO(Yn),lo=yg(Qn,Jn.getSpectrum(Qn),oo.x,Jn.getLeftEdge(Qn),Jn.getRightEdge(Qn),Yn),mo=ME(Qn,Jn.getSpectrum(Qn),oo.y,Jn.getTopEdge(Qn),Jn.getBottomEdge(Qn),Yn),yo=dd(Zn.element)/2,Co=cu(Zn.element)/2;ya(Zn.element,"left",lo-yo+"px"),ya(Zn.element,"top",mo-Co+"px")},TB=NE(-1,!1),Xz=NE(1,!1),Yz=NE(-1,!0),AB=NE(1,!0),Gz={"top-left":ko.some(Oz),top:ko.some(rM),"top-right":ko.some(Sz),right:ko.some(wz),"bottom-right":ko.some(Cz),bottom:ko.some(xz),"bottom-left":ko.some(Ez),left:ko.some(Az)};var Kz=Object.freeze({__proto__:null,setValueFrom:qz,setToMin:xB,setToMax:pM,getValueFromEvent:EB,setPositionFromValue:Lp,onLeft:TB,onRight:Xz,onUp:Yz,onDown:AB,edgeActions:Gz});const Jz=[Gs("stepSize",1),Gs("speedMultiplier",10),Gs("onChange",xo),Gs("onChoose",xo),Gs("onInit",xo),Gs("onDragStart",xo),Gs("onDragEnd",xo),Gs("snapToGrid",!1),Gs("rounded",!0),Tc("snapStart"),Kf("model",jl("mode",{x:[Gs("minX",0),Gs("maxX",100),pu("value",Qn=>Ua(Qn.mode.minX)),Er("getInitialValue"),tu("manager",Hz)],y:[Gs("minY",0),Gs("maxY",100),pu("value",Qn=>Ua(Qn.mode.minY)),Er("getInitialValue"),tu("manager",Zz)],xy:[Gs("minX",0),Gs("maxX",100),Gs("minY",0),Gs("maxY",100),pu("value",Qn=>Ua({x:Qn.mode.minX,y:Qn.mode.minY})),Er("getInitialValue"),tu("manager",Kz)]})),Nf("sliderBehaviours",[Za,da]),pu("mouseIsDown",()=>Ua(!1))],Kh=Yh({name:"Slider",configFields:Jz,partFields:mz,factory:(Qn,Zn,Yn,Jn)=>{const oo=kr=>Y0(kr,Qn,"thumb"),lo=kr=>Y0(kr,Qn,"spectrum"),mo=kr=>Au(kr,Qn,"left-edge"),yo=kr=>Au(kr,Qn,"right-edge"),Co=kr=>Au(kr,Qn,"top-edge"),Ro=kr=>Au(kr,Qn,"bottom-edge"),Lo=Qn.model,Wo=Lo.manager,jo=(kr,Or)=>{Wo.setPositionFromValue(kr,Or,Qn,{getLeftEdge:mo,getRightEdge:yo,getTopEdge:Co,getBottomEdge:Ro,getSpectrum:lo})},es=(kr,Or)=>{Lo.value.set(Or);const qr=oo(kr);jo(kr,qr)},us=(kr,Or)=>{es(kr,Or);const qr=oo(kr);return Qn.onChange(kr,qr,Or),ko.some(!0)},Ps=kr=>{Wo.setToMin(kr,Qn)},er=kr=>{Wo.setToMax(kr,Qn)},Bs=kr=>{const Or=()=>{Au(kr,Qn,"thumb").each(na=>{const Dl=Lo.value.get();Qn.onChoose(kr,na,Dl)})},qr=Qn.mouseIsDown.get();Qn.mouseIsDown.set(!1),qr&&Or()},Ns=(kr,Or)=>{Or.stop(),Qn.mouseIsDown.set(!0),Qn.onDragStart(kr,oo(kr))},Xs=(kr,Or)=>{Or.stop(),Qn.onDragEnd(kr,oo(kr)),Bs(kr)},Hr=kr=>{Au(kr,Qn,"spectrum").map(Za.focusIn)};return{uid:Qn.uid,dom:Qn.dom,components:Zn,behaviours:sf(Qn.sliderBehaviours,[Za.config({mode:"special",focusIn:Hr}),da.config({store:{mode:"manual",getValue:kr=>Lo.value.get(),setValue:es}}),Om.config({channels:{[wx()]:{onReceive:Bs}}})]),events:Jc([wr(Zk(),(kr,Or)=>{us(kr,Or.event.value)}),eu((kr,Or)=>{const qr=Lo.getInitialValue();Lo.value.set(qr);const na=oo(kr);jo(kr,na);const Dl=lo(kr);Qn.onInit(kr,na,Dl,Lo.value.get())}),wr(mm(),Ns),wr(H1(),Xs),wr(Xl(),(kr,Or)=>{Hr(kr),Ns(kr,Or)}),wr(Cv(),Xs)]),apis:{resetToMin:Ps,resetToMax:er,setValue:es,refresh:jo},domModification:{styles:{position:"relative"}}}},apis:{setValue:(Qn,Zn,Yn)=>{Qn.setValue(Zn,Yn)},resetToMin:(Qn,Zn)=>{Qn.resetToMin(Zn)},resetToMax:(Qn,Zn)=>{Qn.resetToMax(Zn)},refresh:(Qn,Zn)=>{Qn.refresh(Zn)}}}),LE=ba("rgb-hex-update"),gM=ba("slider-update"),IE=ba("palette-update"),bM=(Qn,Zn)=>{const Yn=Kh.parts.spectrum({dom:{tag:"div",classes:[Zn("hue-slider-spectrum")],attributes:{role:"presentation"}}}),Jn=Kh.parts.thumb({dom:{tag:"div",classes:[Zn("hue-slider-thumb")],attributes:{role:"presentation"}}});return Kh.sketch({dom:{tag:"div",classes:[Zn("hue-slider")],attributes:{role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":120}},rounded:!1,model:{mode:"y",getInitialValue:Mo(0)},components:[Yn,Jn],sliderBehaviours:Zr([ol.config({})]),onChange:(oo,lo,mo)=>{aa(oo.element,"aria-valuenow",Math.floor(360-mo*3.6)),Qa(oo,gM,{value:mo})}})},PB="form",tW=[Nf("formBehaviours",[da])],$B=Qn=>"",nW=Qn=>{const Zn=(()=>{const lo=[];return{field:(yo,Co)=>(lo.push(yo),Px(PB,$B(yo),Co)),record:Mo(lo)}})(),Yn=Qn(Zn),Jn=Zn.record(),oo=hs(Jn,lo=>Xh({name:lo,pname:$B(lo)}));return Ix(PB,tW,oo,sW,Yn)},oW=(Qn,Zn)=>Qn.fold(()=>yl.error(Zn),yl.value),sW=(Qn,Zn)=>({uid:Qn.uid,dom:Qn.dom,components:Zn,behaviours:sf(Qn.formBehaviours,[da.config({store:{mode:"manual",getValue:Yn=>{const Jn=Rx(Yn,Qn);return Vl(Jn,(oo,lo)=>oo().bind(mo=>{const yo=ic.getCurrent(mo);return oW(yo,new Error(`Cannot find a current component to extract the value from for form part '${lo}': `+r1(mo.element)))}).map(da.getValue))},setValue:(Yn,Jn)=>{Zl(Jn,(oo,lo)=>{Au(Yn,Qn,lo).each(mo=>{ic.getCurrent(mo).each(yo=>{da.setValue(yo,oo)})})})}}})]),apis:{getField:(Yn,Jn)=>Au(Yn,Qn,Jn).bind(ic.getCurrent)}}),Yk={getField:eb((Qn,Zn,Yn)=>Qn.getField(Zn,Yn)),sketch:nW},vM=ba("valid-input"),RB=ba("invalid-input"),av=ba("validating-input"),Gk="colorcustom.rgb.",rW=(Qn,Zn,Yn,Jn)=>{const oo=(jo,es)=>C1.config({invalidClass:Zn("invalid"),notify:{onValidate:us=>{Qa(us,av,{type:jo})},onValid:us=>{Qa(us,vM,{type:jo,value:da.getValue(us)})},onInvalid:us=>{Qa(us,RB,{type:jo,value:da.getValue(us)})}},validator:{validate:us=>{const Ps=da.getValue(us),er=es(Ps)?yl.value(!0):yl.error(Qn("aria.input.invalid"));return Cm.pure(er)},validateOnLoad:!1}}),lo=(jo,es,us,Ps,er)=>{const Bs=Qn(Gk+"range"),Ns=su.parts.label({dom:{tag:"label",attributes:{"aria-label":Ps}},components:[wd(us)]}),Xs=su.parts.field({data:er,factory:Lw,inputAttributes:{type:"text",...es==="hex"?{"aria-live":"polite"}:{}},inputClasses:[Zn("textfield")],inputBehaviours:Zr([oo(es,jo),sd.config({})]),onSetValue:qr=>{C1.isInvalid(qr)&&C1.run(qr).get(xo)}}),Hr=[Ns,Xs],kr=es!=="hex"?[su.parts["aria-descriptor"]({text:Bs})]:[],Or=Hr.concat(kr);return{dom:{tag:"div",attributes:{role:"presentation"}},components:Or}},mo=(jo,es)=>{const us=zk(es);return Yk.getField(jo,"hex").each(Ps=>{ol.isFocused(Ps)||da.setValue(jo,{hex:us.value})}),us},yo=(jo,es)=>{const us=es.red,Ps=es.green,er=es.blue;da.setValue(jo,{red:us,green:Ps,blue:er})},Co=ou({dom:{tag:"div",classes:[Zn("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),Ro=(jo,es)=>{Co.getOpt(jo).each(us=>{ya(us.element,"background-color","#"+es.value)})};return Mp({factory:()=>{const jo={red:Ua(ko.some(255)),green:Ua(ko.some(255)),blue:Ua(ko.some(255)),hex:Ua(ko.some("ffffff"))},es=(rl,Yc)=>{const Ga=_E(Yc);yo(rl,Ga),Bs(Ga)},us=rl=>jo[rl].get(),Ps=(rl,Yc)=>{jo[rl].set(Yc)},er=()=>us("red").bind(rl=>us("green").bind(Yc=>us("blue").map(Ga=>Q_(rl,Yc,Ga,1)))),Bs=rl=>{const Yc=rl.red,Ga=rl.green,yc=rl.blue;Ps("red",ko.some(Yc)),Ps("green",ko.some(Ga)),Ps("blue",ko.some(yc))},Ns=(rl,Yc)=>{const Ga=Yc.event;Ga.type!=="hex"?Ps(Ga.type,ko.none()):Jn(rl)},Xs=(rl,Yc)=>{Yn(rl);const Ga=XL(Yc);Ps("hex",ko.some(Ga.value));const yc=_E(Ga);yo(rl,yc),Bs(yc),Qa(rl,LE,{hex:Ga}),Ro(rl,Ga)},Hr=(rl,Yc,Ga)=>{const yc=parseInt(Ga,10);Ps(Yc,ko.some(yc)),er().each(oa=>{const $a=mo(rl,oa);Qa(rl,LE,{hex:$a}),Ro(rl,$a)})},kr=rl=>rl.type==="hex",Or=(rl,Yc)=>{const Ga=Yc.event;kr(Ga)?Xs(rl,Ga.value):Hr(rl,Ga.type,Ga.value)},qr=rl=>({label:Qn(Gk+rl+".label"),description:Qn(Gk+rl+".description")}),na=qr("red"),Dl=qr("green"),Sa=qr("blue"),fl=qr("hex");return Lc(Yk.sketch(rl=>({dom:{tag:"form",classes:[Zn("rgb-form")],attributes:{"aria-label":Qn("aria.color.picker")}},components:[rl.field("red",su.sketch(lo(bD,"red",na.label,na.description,255))),rl.field("green",su.sketch(lo(bD,"green",Dl.label,Dl.description,255))),rl.field("blue",su.sketch(lo(bD,"blue",Sa.label,Sa.description,255))),rl.field("hex",su.sketch(lo(KL,"hex",fl.label,fl.description,"ffffff"))),Co.asSpec()],formBehaviours:Zr([C1.config({invalidClass:Zn("form-invalid")}),Rl("rgb-form-events",[wr(vM,Or),wr(RB,Ns),wr(av,Ns)])])})),{apis:{updateHex:(rl,Yc)=>{da.setValue(rl,{hex:Yc.value}),es(rl,Yc),Ro(rl,Yc)}}})},name:"RgbForm",configFields:[],apis:{updateHex:(jo,es,us)=>{jo.updateHex(es,us)}},extraApis:{}})},iW=(Qn,Zn)=>{const Yn=Kh.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[Zn("sv-palette-spectrum")]}}),Jn=Kh.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[Zn("sv-palette-thumb")],innerHtml:``}}),oo=(Ro,Lo)=>{const{width:Wo,height:jo}=Ro,es=Ro.getContext("2d");if(es===null)return;es.fillStyle=Lo,es.fillRect(0,0,Wo,jo);const us=es.createLinearGradient(0,0,Wo,0);us.addColorStop(0,"rgba(255,255,255,1)"),us.addColorStop(1,"rgba(255,255,255,0)"),es.fillStyle=us,es.fillRect(0,0,Wo,jo);const Ps=es.createLinearGradient(0,0,0,jo);Ps.addColorStop(0,"rgba(0,0,0,0)"),Ps.addColorStop(1,"rgba(0,0,0,1)"),es.fillStyle=Ps,es.fillRect(0,0,Wo,jo)},lo=(Ro,Lo)=>{const Wo=Ro.components()[0].element.dom,jo=wE(Lo,100,100),es=rI(jo);oo(Wo,yD(es))},mo=(Ro,Lo)=>{const Wo=aP(_E(Lo));Kh.setValue(Ro,{x:Wo.saturation,y:100-Wo.value}),aa(Ro.element,"aria-valuetext",Qn(["Saturation {0}%, Brightness {1}%",Wo.saturation,Wo.value]))};return Mp({factory:Ro=>{const Lo=Mo({x:0,y:0}),Wo=(us,Ps,er)=>{$o(er)||aa(us.element,"aria-valuetext",Qn(["Saturation {0}%, Brightness {1}%",Math.floor(er.x),Math.floor(100-er.y)])),Qa(us,IE,{value:er})},jo=(us,Ps,er,Bs)=>{oo(er.element.dom,yD(bb))},es=Zr([ic.config({find:ko.some}),ol.config({})]);return Kh.sketch({dom:{tag:"div",attributes:{role:"slider","aria-valuetext":Qn(["Saturation {0}%, Brightness {1}%",0,0])},classes:[Zn("sv-palette")]},model:{mode:"xy",getInitialValue:Lo},rounded:!1,components:[Yn,Jn],onChange:Wo,onInit:jo,sliderBehaviours:es})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:(Ro,Lo,Wo)=>{lo(Lo,Wo)},setThumb:(Ro,Lo,Wo)=>{mo(Lo,Wo)}},extraApis:{}})},DB=(Qn,Zn)=>{const Yn=oo=>{const lo=rW(Qn,Zn,oo.onValidHex,oo.onInvalidHex),mo=iW(Qn,Zn),yo=Or=>(100-Or)/100*360,Co=Or=>100-Or/360*100,Ro={paletteRgba:Ua(bb),paletteHue:Ua(0)},Lo=ou(bM(Qn,Zn)),Wo=ou(mo.sketch({})),jo=ou(lo.sketch({})),es=(Or,qr,na)=>{Wo.getOpt(Or).each(Dl=>{mo.setHue(Dl,na)})},us=(Or,qr)=>{jo.getOpt(Or).each(na=>{lo.updateHex(na,qr)})},Ps=(Or,qr,na)=>{Lo.getOpt(Or).each(Dl=>{Kh.setValue(Dl,Co(na))})},er=(Or,qr)=>{Wo.getOpt(Or).each(na=>{mo.setThumb(na,qr)})},Bs=(Or,qr)=>{const na=_E(Or);Ro.paletteRgba.set(na),Ro.paletteHue.set(qr)},Ns=(Or,qr,na,Dl)=>{Bs(qr,na),Qs(Dl,Sa=>{Sa(Or,qr,na)})},Xs=()=>{const Or=[us];return(qr,na)=>{const Dl=na.event.value,Sa=Ro.paletteHue.get(),fl=wE(Sa,Dl.x,100-Dl.y),rl=hI(fl);Ns(qr,rl,Sa,Or)}},Hr=()=>{const Or=[es,us];return(qr,na)=>{const Dl=yo(na.event.value),Sa=Ro.paletteRgba.get(),fl=aP(Sa),rl=wE(Dl,fl.saturation,fl.value),Yc=hI(rl);Ns(qr,Yc,Dl,Or)}},kr=()=>{const Or=[es,Ps,er];return(qr,na)=>{const Dl=na.event.hex,Sa=HQ(Dl);Ns(qr,Dl,Sa.hue,Or)}};return{uid:oo.uid,dom:oo.dom,components:[Wo.asSpec(),Lo.asSpec(),jo.asSpec()],behaviours:Zr([Rl("colour-picker-events",[wr(LE,kr()),wr(IE,Xs()),wr(gM,Hr())]),ic.config({find:Or=>jo.getOpt(Or)}),Za.config({mode:"acyclic"})])}};return Mp({name:"ColourPicker",configFields:[Er("dom"),Gs("onValidHex",xo),Gs("onInvalidHex",xo)],factory:Yn})},Og={self:()=>ic.config({find:ko.some}),memento:Qn=>ic.config({find:Qn.getOpt}),childAt:Qn=>ic.config({find:Zn=>Fh(Zn.element,Qn).bind(Yn=>Zn.getSystem().getByDom(Yn).toOptional())})},BE=Ta([Gs("preprocess",Go),Gs("postprocess",Go)]),NB=(Qn,Zn)=>{const Yn=td("RepresentingConfigs.memento processors",BE,Zn);return da.config({store:{mode:"manual",getValue:Jn=>{const oo=Qn.get(Jn),lo=da.getValue(oo);return Yn.postprocess(lo)},setValue:(Jn,oo)=>{const lo=Yn.preprocess(oo),mo=Qn.get(Jn);da.setValue(mo,lo)}}})},j_=(Qn,Zn,Yn)=>da.config({store:{mode:"manual",...Qn.map(Jn=>({initialValue:Jn})).getOr({}),getValue:Zn,setValue:Yn}}),OM=(Qn,Zn,Yn)=>j_(Qn,Jn=>Zn(Jn.element),(Jn,oo)=>Yn(Jn.element,oo)),LB=Qn=>OM(Qn,Rv,G1),LP=Qn=>da.config({store:{mode:"memory",initialValue:Qn}}),lW={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},cW=Qn=>Zn=>qn(Zn)?Qn.translate(lW[Zn]):Qn.translate(Zn),uW=(Qn,Zn,Yn)=>{const Jn=Co=>"tox-"+Co,oo=DB(cW(Zn),Jn),lo=Co=>{Qa(Co,Cy,{name:"hex-valid",value:!0})},mo=Co=>{Qa(Co,Cy,{name:"hex-valid",value:!1})},yo=ou(oo.sketch({dom:{tag:"div",classes:[Jn("color-picker-container")],attributes:{role:"presentation"}},onValidHex:lo,onInvalidHex:mo}));return{dom:{tag:"div"},components:[yo.asSpec()],behaviours:Zr([j_(Yn,Co=>{const Ro=yo.get(Co);return ic.getCurrent(Ro).bind(jo=>da.getValue(jo).hex).map(jo=>"#"+Rc(jo,"#")).getOr("")},(Co,Ro)=>{const Lo=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/,Wo=ko.from(Lo.exec(Ro)).bind(us=>xa(us,1)),jo=yo.get(Co);ic.getCurrent(jo).fold(()=>{console.log("Can not find form")},us=>{da.setValue(us,{hex:Wo.getOr("")}),Yk.getField(us,"hex").each(Ps=>{Wl(Ps,o1())})})}),Og.self()])}};var dW=tinymce.util.Tools.resolve("tinymce.Resource");const IB=Qn=>Pl(Qn,"init"),BB=Qn=>{const Zn=Hl(),Yn=ou({dom:{tag:Qn.tag}}),Jn=Hl();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:Zr([Rl("custom-editor-events",[eu(oo=>{Yn.getOpt(oo).each(lo=>{(IB(Qn)?Qn.init(lo.element.dom):dW.load(Qn.scriptId,Qn.scriptUrl).then(mo=>mo(lo.element.dom,Qn.settings))).then(mo=>{Jn.on(yo=>{mo.setValue(yo)}),Jn.clear(),Zn.set(mo)})})})]),j_(ko.none(),()=>Zn.get().fold(()=>Jn.get().getOr(""),oo=>oo.getValue()),(oo,lo)=>{Zn.get().fold(()=>Jn.set(lo),mo=>mo.setValue(lo))}),Og.self()]),components:[Yn.asSpec()]}};var xO=tinymce.util.Tools.resolve("tinymce.util.Tools");const FB=(Qn,Zn)=>{const Yn=xO.explode(Zn.getOption("images_file_types")),Jn=oo=>Br(Yn,lo=>ad(oo.name.toLowerCase(),`.${lo.toLowerCase()}`));return ga(cc(Qn),Jn)},fW=(Qn,Zn,Yn)=>{const Jn=(jo,es)=>{es.stop()},oo=jo=>(es,us)=>{Qs(jo,Ps=>{Ps(es,us)})},lo=(jo,es)=>{var us;if(!Ja.isDisabled(jo)){const Ps=es.event.raw;yo(jo,(us=Ps.dataTransfer)===null||us===void 0?void 0:us.files)}},mo=(jo,es)=>{const us=es.event.raw.target;yo(jo,us.files)},yo=(jo,es)=>{es&&(da.setValue(jo,FB(es,Zn)),Qa(jo,vg,{name:Qn.name}))},Co=ou({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Zr([Rl("input-file-events",[X1(Lg()),X1(ng())])])}),Ro=jo=>({uid:jo.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Zr([LP(Yn.getOr([])),Og.self(),Ja.config({}),Ql.config({toggleClass:"dragenter",toggleOnExecute:!1}),Rl("dropzone-events",[wr("dragenter",oo([Jn,Ql.toggle])),wr("dragleave",oo([Jn,Ql.toggle])),wr("dragover",Jn),wr("drop",oo([Jn,lo])),wr(E0(),mo)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p"},components:[wd(Zn.translate("Drop an image here"))]},yh.sketch({dom:{tag:"button",styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[wd(Zn.translate("Browse for an image")),Co.asSpec()],action:es=>{Co.get(es).element.dom.click()},buttonBehaviours:Zr([sd.config({}),Lf.button(Zn.isDisabled),jf()])})]}]}),Lo=Qn.label.map(jo=>yb(jo,Zn)),Wo=su.parts.field({factory:{sketch:Ro}});return TE(Lo,Wo,["tox-form__group--stretched"],[])},HB=(Qn,Zn)=>({dom:{tag:"div",classes:["tox-form__grid",`tox-form__grid--${Qn.columns}col`]},components:hs(Qn.items,Zn.interpreter)}),FE=(Qn,Zn)=>{let Yn=null,Jn=null;return{cancel:()=>{io(Yn)||(clearTimeout(Yn),Yn=null,Jn=null)},throttle:(...mo)=>{Jn=mo,io(Yn)&&(Yn=setTimeout(()=>{const yo=Jn;Yn=null,Jn=null,Qn.apply(null,yo)},Zn))}}},hW=(Qn,Zn)=>{let Yn=null;return{cancel:()=>{io(Yn)||(clearTimeout(Yn),Yn=null)},throttle:(...lo)=>{io(Yn)&&(Yn=setTimeout(()=>{Yn=null,Qn.apply(null,lo)},Zn))}}},IP=(Qn,Zn)=>{let Yn=null;const Jn=()=>{io(Yn)||(clearTimeout(Yn),Yn=null)};return{cancel:Jn,throttle:(...lo)=>{Jn(),Yn=setTimeout(()=>{Yn=null,Qn.apply(null,lo)},Zn)}}},_M=ba("alloy-fake-before-tabstop"),SM=ba("alloy-fake-after-tabstop"),QB=Qn=>({dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:Qn},behaviours:Zr([ol.config({ignore:!0}),sd.config({})])}),VB=(Qn,Zn)=>({dom:{tag:"div",classes:["tox-navobj",...Qn.getOr([])]},components:[QB([_M]),Zn,QB([SM])],behaviours:Zr([Og.childAt(1)])}),wM=(Qn,Zn)=>{Qa(Qn,op(),{raw:{which:9,shiftKey:Zn}})},mW=(Qn,Zn)=>{const Yn=Zn.element;of(Yn,_M)?wM(Qn,!0):of(Yn,SM)&&wM(Qn,!1)},Kk=Qn=>xE(Qn,["."+_M,"."+SM].join(","),sr),Jk=ba("update-dialog"),Ey=ba("update-title"),BP=ba("update-body"),CM=ba("update-footer"),kM=ba("body-send-message"),e2=ba("dialog-focus-shifted"),FP=Tr().browser,X_=FP.isSafari(),zB=FP.isFirefox(),xM=X_||zB,pW=FP.isChromium(),gW=({scrollTop:Qn,scrollHeight:Zn,clientHeight:Yn})=>Math.ceil(Qn)+Yn>=Zn,WB=(Qn,Zn)=>Qn.scrollTo(0,Zn==="bottom"?99999999:Zn),bW=(Qn,Zn)=>{const Yn=Qn.body;return ko.from(!/^1))?Yn:Qn.documentElement)},UB=(Qn,Zn,Yn)=>{const Jn=Qn.dom;ko.from(Jn.contentDocument).fold(Yn,oo=>{let lo=0;const mo=bW(oo,Zn).map(Co=>(lo=Co.scrollTop,Co)).forall(gW),yo=()=>{const Co=Jn.contentWindow;Oo(Co)&&(mo?WB(Co,"bottom"):!mo&&xM&&lo!==0&&WB(Co,lo))};X_&&Jn.addEventListener("load",yo,{once:!0}),oo.open(),oo.write(Zn),oo.close(),X_||yo()})},ZB=Mr(xM,X_?500:200).map(Qn=>FE(UB,Qn)),yW=(Qn,Zn)=>{const Yn=Ua(Qn.getOr(""));return{getValue:Jn=>Yn.get(),setValue:(Jn,oo)=>{if(Yn.get()!==oo){const lo=Jn.element,mo=()=>aa(lo,"srcdoc",oo);Zn?ZB.fold(Mo(UB),yo=>yo.throttle)(lo,oo,mo):mo()}Yn.set(oo)}}},OW=(Qn,Zn,Yn)=>{const Jn="tox-dialog__iframe",oo=Qn.transparent?[]:[`${Jn}--opaque`],lo=Qn.border?["tox-navobj-bordered"]:[],mo={...Qn.label.map(Wo=>({title:Wo})).getOr({}),...Yn.map(Wo=>({srcdoc:Wo})).getOr({}),...Qn.sandboxed?{sandbox:"allow-scripts allow-same-origin"}:{}},yo=yW(Yn,Qn.streamContent),Co=Qn.label.map(Wo=>yb(Wo,Zn)),Ro=Wo=>VB(ko.from(lo),{uid:Wo.uid,dom:{tag:"iframe",attributes:mo,classes:[Jn,...oo]},behaviours:Zr([sd.config({}),ol.config({}),j_(Yn,yo.getValue,yo.setValue),Om.config({channels:{[e2]:{onReceive:(jo,es)=>{es.newFocus.each(us=>{lh(jo.element).each(Ps=>{(Oc(jo.element,us)?$d:Yu)(Ps,"tox-navobj-bordered-focus")})})}}}})])}),Lo=su.parts.field({factory:{sketch:Ro}});return TE(Co,Lo,["tox-form__group--stretched"],[])},_W=Qn=>new Promise((Zn,Yn)=>{const Jn=()=>{lo(),Zn(Qn)},oo=[Dh(Qn,"load",Jn),Dh(Qn,"error",()=>{lo(),Yn("Unable to load data from image: "+Qn.dom.src)})],lo=()=>Qs(oo,mo=>mo.unbind());Qn.dom.complete&&Jn()}),HP=(Qn,Zn,Yn,Jn,oo)=>{const lo=Yn*oo,mo=Jn*oo,yo=Math.max(0,Qn/2-lo/2),Co=Math.max(0,Zn/2-mo/2);return{left:yo.toString()+"px",top:Co.toString()+"px",width:lo.toString()+"px",height:mo.toString()+"px"}},SW=(Qn,Zn,Yn)=>{const Jn=dd(Qn),oo=cu(Qn);return Math.min(Jn/Zn,oo/Yn,1)},wW=(Qn,Zn)=>{const Yn=Ua(Zn.getOr({url:""})),Jn=ou({dom:{tag:"img",classes:["tox-imagepreview__image"],attributes:Zn.map(Co=>({src:Co.url})).getOr({})}}),oo=ou({dom:{tag:"div",classes:["tox-imagepreview__container"],attributes:{role:"presentation"}},components:[Jn.asSpec()]}),lo=(Co,Ro)=>{const Lo={url:Ro.url};Ro.zoom.each(jo=>Lo.zoom=jo),Ro.cachedWidth.each(jo=>Lo.cachedWidth=jo),Ro.cachedHeight.each(jo=>Lo.cachedHeight=jo),Yn.set(Lo);const Wo=()=>{const{cachedWidth:jo,cachedHeight:es,zoom:us}=Lo;if(!ho(jo)&&!ho(es)){if(ho(us)){const er=SW(Co.element,jo,es);Lo.zoom=er}const Ps=HP(dd(Co.element),cu(Co.element),jo,es,Lo.zoom);oo.getOpt(Co).each(er=>{fu(er.element,Ps)})}};Jn.getOpt(Co).each(jo=>{const es=jo.element;Ro.url!==Bu(es,"src")&&(aa(es,"src",Ro.url),Yu(Co.element,"tox-imagepreview__loaded")),Wo(),_W(es).then(us=>{Co.getSystem().isConnected()&&($d(Co.element,"tox-imagepreview__loaded"),Lo.cachedWidth=us.dom.naturalWidth,Lo.cachedHeight=us.dom.naturalHeight,Wo())})})},mo={};Qn.height.each(Co=>mo.height=Co);const yo=Zn.map(Co=>({url:Co.url,zoom:ko.from(Co.zoom),cachedWidth:ko.from(Co.cachedWidth),cachedHeight:ko.from(Co.cachedHeight)}));return{dom:{tag:"div",classes:["tox-imagepreview"],styles:mo,attributes:{role:"presentation"}},components:[oo.asSpec()],behaviours:Zr([Og.self(),j_(yo,()=>Yn.get(),lo)])}},qB=(Qn,Zn)=>{const Yn="tox-label",Jn=Qn.align==="center"?[`${Yn}--center`]:[],oo=Qn.align==="end"?[`${Yn}--end`]:[],lo={dom:{tag:"label",classes:[Yn,...Jn,...oo]},components:[wd(Zn.providers.translate(Qn.label))]},mo=hs(Qn.items,Zn.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[lo,...mo],behaviours:Zr([Og.self(),Cl.config({}),LB(ko.none()),Za.config({mode:"acyclic"})])}},EM=ba("toolbar.button.execute"),CW=Qn=>qh((Zn,Yn)=>{w1(Qn,Zn)(Jn=>{Qa(Zn,EM,{buttonApi:Jn}),Qn.onAction(Jn)})}),Ww=ba("common-button-display-events"),QP={[Im()]:["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],[Zh()]:["toolbar-button-events",Ww],[Xl()]:["focusing","alloy.base.behaviour",Ww]},TM=Qn=>ya(Qn.element,"width",qc(Qn.element,"width")),AM=(Qn,Zn,Yn)=>s0(Qn,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:Yn},Zn),PM=(Qn,Zn)=>AM(Qn,Zn,[]),Y_=(Qn,Zn)=>AM(Qn,Zn,[Cl.config({})]),jB=(Qn,Zn,Yn)=>({dom:{tag:"span",classes:[`${Zn}__select-label`]},components:[wd(Yn.translate(Qn))],behaviours:Zr([Cl.config({})])}),k1=ba("update-menu-text"),G_=ba("update-menu-icon"),$M=(Qn,Zn,Yn)=>{const Jn=Ua(xo),oo=Qn.text.map(jo=>ou(jB(jo,Zn,Yn.providers))),lo=Qn.icon.map(jo=>ou(Y_(jo,Yn.providers.icons))),mo=(jo,es)=>{const us=da.getValue(jo);return ol.focus(us),Qa(us,"keydown",{raw:es.event.raw}),vb.close(us),ko.some(!0)},yo=Qn.role.fold(()=>({}),jo=>({role:jo})),Co=Qn.tooltip.fold(()=>({}),jo=>{const es=Yn.providers.translate(jo);return{title:es,"aria-label":es}}),Ro=s0("chevron-down",{tag:"div",classes:[`${Zn}__select-chevron`]},Yn.providers.icons),Lo=ba("common-button-display-events");return ou(vb.sketch({...Qn.uid?{uid:Qn.uid}:{},...yo,dom:{tag:"button",classes:[Zn,`${Zn}--select`].concat(hs(Qn.classes,jo=>`${Zn}--${jo}`)),attributes:{...Co}},components:Hk([lo.map(jo=>jo.asSpec()),oo.map(jo=>jo.asSpec()),ko.some(Ro)]),matchWidth:!0,useMinWidth:!0,onOpen:(jo,es,us)=>{Qn.searchable&&EV(us)},dropdownBehaviours:Zr([...Qn.dropdownBehaviours,Lf.button(()=>Qn.disabled||Yn.providers.isDisabled()),jf(),$E.config({}),Cl.config({}),Rl("dropdown-events",[H_(Qn,Jn),_y(Qn,Jn)]),Rl(Lo,[eu((jo,es)=>TM(jo))]),Rl("menubutton-update-display-text",[wr(k1,(jo,es)=>{oo.bind(us=>us.getOpt(jo)).each(us=>{Cl.set(us,[wd(Yn.providers.translate(es.event.text))])})}),wr(G_,(jo,es)=>{lo.bind(us=>us.getOpt(jo)).each(us=>{Cl.set(us,[Y_(es.event.icon,Yn.providers.icons)])})})])]),eventOrder:Lc(QP,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"],[Zh()]:["toolbar-button-events","dropdown-events",Lo]}),sandboxBehaviours:Zr([Za.config({mode:"special",onLeft:mo,onRight:mo}),Rl("dropdown-sandbox-events",[wr(cL,(jo,es)=>{SV(jo),es.stop()}),wr(uL,(jo,es)=>{wV(jo,es),es.stop()})])]),lazySink:Yn.getSink,toggleClass:`${Zn}--active`,parts:{menu:{...Dk(!1,Qn.columns,Qn.presets),fakeFocus:Qn.searchable,onHighlightItem:WD,onCollapseMenu:(jo,es,us)=>{Bc.getHighlighted(us).each(Ps=>{WD(jo,us,Ps)})},onDehighlightItem:xV}},getAnchorOverrides:()=>({maxHeightFunction:(jo,es)=>{LC()(jo,es-10)}}),fetch:jo=>Cm.nu(ms(Qn.fetch,jo))})).asSpec()},kW=Qn=>qn(Qn),XB=Qn=>Qn.type==="separator",xW=Qn=>Pl(Qn,"getSubmenuItems"),YB={type:"separator"},EW=(Qn,Zn)=>{const Yn=za(Qn,(Jn,oo)=>kW(oo)?oo===""?Jn:oo==="|"?Jn.length>0&&!XB(Jn[Jn.length-1])?Jn.concat([YB]):Jn:Pl(Zn,oo.toLowerCase())?Jn.concat([Zn[oo.toLowerCase()]]):Jn:Jn.concat([oo]),[]);return Yn.length>0&&XB(Yn[Yn.length-1])&&Yn.pop(),Yn},GB=(Qn,Zn)=>{const Yn=Qn.getSubmenuItems(),Jn=KB(Yn,Zn),oo=Lc(Jn.menus,{[Qn.value]:Jn.items}),lo=Lc(Jn.expansions,{[Qn.value]:Qn.value});return{item:Qn,menus:oo,expansions:lo}},TW=Qn=>{const Zn=Rr(Qn,"value").getOrThunk(()=>ba("generated-menu-item"));return Lc({value:Zn},Qn)},KB=(Qn,Zn)=>{const Yn=EW(qn(Qn)?Qn.split(" "):Qn,Zn);return Ca(Yn,(Jn,oo)=>{if(xW(oo)){const lo=TW(oo),mo=GB(lo,Zn);return{menus:Lc(Jn.menus,mo.menus),items:[mo.item,...Jn.items],expansions:Lc(Jn.expansions,mo.expansions)}}else return{...Jn,items:[oo,...Jn.items]}},{menus:{},expansions:{},items:[]})},AW=Qn=>Qn.search.fold(()=>({searchMode:"no-search"}),Zn=>({searchMode:"search-with-field",placeholder:Zn.placeholder})),PW=Qn=>Qn.search.fold(()=>({searchMode:"no-search"}),Zn=>({searchMode:"search-with-results"})),t2=(Qn,Zn,Yn,Jn)=>{const oo=ba("primary-menu"),lo=KB(Qn,Yn.shared.providers.menuItems());if(lo.items.length===0)return ko.none();const mo=AW(Jn),yo=LI(oo,lo.items,Zn,Yn,Jn.isHorizontalMenu,mo),Co=PW(Jn),Ro=Vl(lo.menus,(Wo,jo)=>LI(jo,Wo,Zn,Yn,!1,Co)),Lo=Lc(Ro,Jr(oo,yo));return ko.from(B_.tieredData(oo,Lo,lo.expansions))},RM=Qn=>!Pl(Qn,"items"),JB="data-value",eF=(Qn,Zn,Yn,Jn)=>hs(Yn,oo=>RM(oo)?{type:"togglemenuitem",text:oo.text,value:oo.value,active:oo.value===Jn,onAction:()=>{da.setValue(Qn,oo.value),Qa(Qn,vg,{name:Zn}),ol.focus(Qn)}}:{type:"nestedmenuitem",text:oo.text,getSubmenuItems:()=>eF(Qn,Zn,oo.items,Jn)}),DM=(Qn,Zn)=>gc(Qn,Yn=>RM(Yn)?Mr(Yn.value===Zn,Yn):DM(Yn.items,Zn)),MM=(Qn,Zn,Yn)=>{const Jn=Zn.shared.providers,oo=Yn.bind(Co=>DM(Qn.items,Co)).orThunk(()=>Nl(Qn.items).filter(RM)),lo=Qn.label.map(Co=>yb(Co,Jn)),mo=su.parts.field({dom:{},factory:{sketch:Co=>$M({uid:Co.uid,text:oo.map(Ro=>Ro.text),icon:ko.none(),tooltip:Qn.label,role:ko.none(),fetch:(Ro,Lo)=>{const Wo=eF(Ro,Qn.name,Qn.items,da.getValue(Ro));Lo(t2(Wo,sv.CLOSE_ON_EXECUTE,Zn,{isHorizontalMenu:!1,search:ko.none()}))},onSetup:Mo(xo),getApi:Mo({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[sd.config({}),j_(oo.map(Ro=>Ro.value),Ro=>Bu(Ro.element,JB),(Ro,Lo)=>{DM(Qn.items,Lo).each(Wo=>{aa(Ro.element,JB,Wo.value),Qa(Ro,k1,{text:Wo.text})})})]},"tox-listbox",Zn.shared)}}),yo={dom:{tag:"div",classes:["tox-listboxfield"]},components:[mo]};return su.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Us([lo.toArray(),[yo]]),fieldBehaviours:Zr([Ja.config({disabled:Mo(!Qn.enabled),onDisabled:Co=>{su.getField(Co).each(Ja.disable)},onEnabled:Co=>{su.getField(Co).each(Ja.enable)}})])})},$W=(Qn,Zn)=>({dom:{tag:"div",classes:Qn.classes},components:hs(Qn.items,Zn.shared.interpreter)}),RW=(Qn,Zn)=>{const Yn=hs(Qn.options,oo=>({dom:{tag:"option",value:oo.value,innerHtml:oo.text}})),Jn=Qn.data.map(oo=>Jr("initialValue",oo)).getOr({});return{uid:Qn.uid,dom:{tag:"select",classes:Qn.selectClasses,attributes:Qn.selectAttributes},components:Yn,behaviours:sf(Qn.selectBehaviours,[ol.config({}),da.config({store:{mode:"manual",getValue:oo=>c1(oo.element),setValue:(oo,lo)=>{const mo=Nl(Qn.options);Zs(Qn.options,Co=>Co.value===lo).isSome()?Wv(oo.element,lo):oo.element.dom.selectedIndex===-1&&lo===""&&mo.each(Co=>Wv(oo.element,Co.value))},...Jn}})])}},DW=Mp({name:"HtmlSelect",configFields:[Er("options"),Nf("selectBehaviours",[ol,da]),Gs("selectClasses",[]),Gs("selectAttributes",{}),Tc("data")],factory:RW}),HE=(Qn,Zn,Yn)=>{const Jn=hs(Qn.items,Co=>({text:Zn.translate(Co.text),value:Co.value})),oo=Qn.label.map(Co=>yb(Co,Zn)),lo=su.parts.field({dom:{},...Yn.map(Co=>({data:Co})).getOr({}),selectAttributes:{size:Qn.size},options:Jn,factory:DW,selectBehaviours:Zr([Ja.config({disabled:()=>!Qn.enabled||Zn.isDisabled()}),sd.config({}),Rl("selectbox-change",[wr(E0(),(Co,Ro)=>{Qa(Co,vg,{name:Qn.name})})])])}),mo=Qn.size>1?ko.none():ko.some(s0("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},Zn.icons)),yo={dom:{tag:"div",classes:["tox-selectfield"]},components:Us([[lo],mo.toArray()])};return su.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Us([oo.toArray(),[yo]]),fieldBehaviours:Zr([Ja.config({disabled:()=>!Qn.enabled||Zn.isDisabled(),onDisabled:Co=>{su.getField(Co).each(Ja.disable)},onEnabled:Co=>{su.getField(Co).each(Ja.enable)}}),jf()])})},NM=Mo([Gs("field1Name","field1"),Gs("field2Name","field2"),Fg("onLockedChange"),Wb(["lockClass"]),Gs("locked",!1),Wg.field("coupledFieldBehaviours",[ic,da])]),MW=(Qn,Zn,Yn)=>Au(Qn,Zn,Yn).bind(ic.getCurrent),tF=(Qn,Zn)=>Xh({factory:su,name:Qn,overrides:Yn=>({fieldBehaviours:Zr([Rl("coupled-input-behaviour",[wr(o1(),Jn=>{MW(Jn,Yn,Zn).each(oo=>{Au(Jn,Yn,"lock").each(lo=>{Ql.isOn(lo)&&Yn.onLockedChange(Jn,oo,lo)})})})])])})}),LM=Mo([tF("field1","field2"),tF("field2","field1"),Xh({factory:yh,schema:[Er("dom")],name:"lock",overrides:Qn=>({buttonBehaviours:Zr([Ql.config({selected:Qn.locked,toggleClass:Qn.markers.lockClass,aria:{mode:"pressed"}})])})})]),NW=(Qn,Zn,Yn,Jn)=>({uid:Qn.uid,dom:Qn.dom,components:Zn,behaviours:Wg.augment(Qn.coupledFieldBehaviours,[ic.config({find:ko.some}),da.config({store:{mode:"manual",getValue:oo=>{const lo=fO(oo,Qn,["field1","field2"]);return{[Qn.field1Name]:da.getValue(lo.field1()),[Qn.field2Name]:da.getValue(lo.field2())}},setValue:(oo,lo)=>{const mo=fO(oo,Qn,["field1","field2"]);Su(lo,Qn.field1Name)&&da.setValue(mo.field1(),lo[Qn.field1Name]),Su(lo,Qn.field2Name)&&da.setValue(mo.field2(),lo[Qn.field2Name])}}})]),apis:{getField1:oo=>Au(oo,Qn,"field1"),getField2:oo=>Au(oo,Qn,"field2"),getLock:oo=>Au(oo,Qn,"lock")}}),_g=Yh({name:"FormCoupledInputs",configFields:NM(),partFields:LM(),factory:NW,apis:{getField1:(Qn,Zn)=>Qn.getField1(Zn),getField2:(Qn,Zn)=>Qn.getField2(Zn),getLock:(Qn,Zn)=>Qn.getLock(Zn)}}),nF=Qn=>{const Zn={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},Yn=oo=>oo in Zn?Zn[oo]:1;let Jn=Qn.value.toFixed(Yn(Qn.unit));return Jn.indexOf(".")!==-1&&(Jn=Jn.replace(/\.?0*$/,"")),Jn+Qn.unit},IM=Qn=>{const Yn=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(Qn);if(Yn!==null){const Jn=parseFloat(Yn[1]),oo=Yn[2];return yl.value({value:Jn,unit:oo})}else return yl.error(Qn)},oF=(Qn,Zn)=>{const Yn={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},Jn=oo=>Pl(Yn,oo);return Qn.unit===Zn?ko.some(Qn.value):Jn(Qn.unit)&&Jn(Zn)?Yn[Qn.unit]===Yn[Zn]?ko.some(Qn.value):ko.some(Qn.value/Yn[Qn.unit]*Yn[Zn]):ko.none()},VP=Qn=>ko.none(),sF=(Qn,Zn)=>Yn=>oF(Yn,Zn).map(Jn=>({value:Jn*Qn,unit:Zn})),LW=(Qn,Zn)=>{const Yn=IM(Qn).toOptional(),Jn=IM(Zn).toOptional();return ia(Yn,Jn,(oo,lo)=>oF(oo,lo.unit).map(mo=>lo.value/mo).map(mo=>sF(mo,lo.unit)).getOr(VP)).getOr(VP)},rF=(Qn,Zn)=>{let Yn=VP;const Jn=ba("ratio-event"),oo=Wo=>s0(Wo,{tag:"span",classes:["tox-icon","tox-lock-icon__"+Wo]},Zn.icons),lo=_g.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:Zn.translate(Qn.label.getOr("Constrain proportions"))}},components:[oo("lock"),oo("unlock")],buttonBehaviours:Zr([Ja.config({disabled:()=>!Qn.enabled||Zn.isDisabled()}),jf(),sd.config({})])}),mo=Wo=>({dom:{tag:"div",classes:["tox-form__group"]},components:Wo}),yo=Wo=>su.parts.field({factory:Lw,inputClasses:["tox-textfield"],inputBehaviours:Zr([Ja.config({disabled:()=>!Qn.enabled||Zn.isDisabled()}),jf(),sd.config({}),Rl("size-input-events",[wr(Wu(),(jo,es)=>{Qa(jo,Jn,{isField1:Wo})}),wr(E0(),(jo,es)=>{Qa(jo,vg,{name:Qn.name})})])]),selectOnFocus:!1}),Co=Wo=>({dom:{tag:"label",classes:["tox-label"]},components:[wd(Zn.translate(Wo))]}),Ro=_g.parts.field1(mo([su.parts.label(Co("Width")),yo(!0)])),Lo=_g.parts.field2(mo([su.parts.label(Co("Height")),yo(!1)]));return _g.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[Ro,Lo,mo([Co(m_),lo])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:(Wo,jo,es)=>{IM(da.getValue(Wo)).each(us=>{Yn(us).each(Ps=>{da.setValue(jo,nF(Ps))})})},coupledFieldBehaviours:Zr([Ja.config({disabled:()=>!Qn.enabled||Zn.isDisabled(),onDisabled:Wo=>{_g.getField1(Wo).bind(su.getField).each(Ja.disable),_g.getField2(Wo).bind(su.getField).each(Ja.disable),_g.getLock(Wo).each(Ja.disable)},onEnabled:Wo=>{_g.getField1(Wo).bind(su.getField).each(Ja.enable),_g.getField2(Wo).bind(su.getField).each(Ja.enable),_g.getLock(Wo).each(Ja.enable)}}),jf(),Rl("size-input-events2",[wr(Jn,(Wo,jo)=>{const es=jo.event.isField1,us=es?_g.getField1(Wo):_g.getField2(Wo),Ps=es?_g.getField2(Wo):_g.getField1(Wo),er=us.map(da.getValue).getOr(""),Bs=Ps.map(da.getValue).getOr("");Yn=LW(er,Bs)})])])})},iF=(Qn,Zn,Yn)=>{const Jn=Kh.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[wd(Zn.translate(Qn.label))]}),oo=Kh.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),lo=Kh.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Kh.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:Qn.min,maxX:Qn.max,getInitialValue:Mo(Yn.getOrThunk(()=>(Math.abs(Qn.max)-Math.abs(Qn.min))/2))},components:[Jn,oo,lo],sliderBehaviours:Zr([Og.self(),ol.config({})]),onChoose:(mo,yo,Co)=>{Qa(mo,vg,{name:Qn.name,value:Co})}})},IW=(Qn,Zn)=>{const Yn=yo=>({dom:{tag:"th",innerHtml:Zn.translate(yo)}}),Jn=yo=>({dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:hs(yo,Yn)}]}),oo=yo=>({dom:{tag:"td",innerHtml:Zn.translate(yo)}}),lo=yo=>({dom:{tag:"tr"},components:hs(yo,oo)}),mo=yo=>({dom:{tag:"tbody"},components:hs(yo,lo)});return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[Jn(Qn.header),mo(Qn.cells)],behaviours:Zr([sd.config({}),ol.config({})])}},BM=(Qn,Zn)=>{const Yn=Qn.label.map(es=>yb(es,Zn)),Jn=[Ja.config({disabled:()=>Qn.disabled||Zn.isDisabled()}),jf(),Za.config({mode:"execution",useEnter:Qn.multiline!==!0,useControlEnter:Qn.multiline===!0,execute:es=>(Wl(es,PE),ko.some(!0))}),Rl("textfield-change",[wr(o1(),(es,us)=>{Qa(es,vg,{name:Qn.name})}),wr(U1(),(es,us)=>{Qa(es,vg,{name:Qn.name})})]),sd.config({})],oo=Qn.validation.map(es=>C1.config({getRoot:us=>lh(us.element),invalidClass:"tox-invalid",validator:{validate:us=>{const Ps=da.getValue(us),er=es.validator(Ps);return Cm.pure(er===!0?yl.value(Ps):yl.error(er))},validateOnLoad:es.validateOnLoad}})).toArray(),lo=Qn.placeholder.fold(Mo({}),es=>({placeholder:Zn.translate(es)})),mo=Qn.inputMode.fold(Mo({}),es=>({inputmode:es})),yo={...lo,...mo},Co=su.parts.field({tag:Qn.multiline===!0?"textarea":"input",...Qn.data.map(es=>({data:es})).getOr({}),inputAttributes:yo,inputClasses:[Qn.classname],inputBehaviours:Zr(Us([Jn,oo])),selectOnFocus:!1,factory:Lw}),Ro=Qn.multiline?{dom:{tag:"div",classes:["tox-textarea-wrap"]},components:[Co]}:Co,Wo=(Qn.flex?["tox-form__group--stretched"]:[]).concat(Qn.maximized?["tox-form-group--maximize"]:[]),jo=[Ja.config({disabled:()=>Qn.disabled||Zn.isDisabled(),onDisabled:es=>{su.getField(es).each(Ja.disable)},onEnabled:es=>{su.getField(es).each(Ja.enable)}}),jf()];return TE(Yn,Ro,Wo,jo)},aF=(Qn,Zn,Yn)=>BM({name:Qn.name,multiline:!1,label:Qn.label,inputMode:Qn.inputMode,placeholder:Qn.placeholder,flex:!1,disabled:!Qn.enabled,classname:"tox-textfield",validation:ko.none(),maximized:Qn.maximized,data:Yn},Zn),lF=(Qn,Zn,Yn)=>BM({name:Qn.name,multiline:!0,label:Qn.label,inputMode:ko.none(),placeholder:Qn.placeholder,flex:!0,disabled:!Qn.enabled,classname:"tox-textarea",validation:ko.none(),maximized:Qn.maximized,data:Yn},Zn),QE=(Qn,Zn)=>Zn.getAnimationRoot.fold(()=>Qn.element,Yn=>Yn(Qn)),EO=Qn=>Qn.dimension.property,Uw=(Qn,Zn)=>Qn.dimension.getDimension(Zn),VE=(Qn,Zn)=>{const Yn=QE(Qn,Zn);sp(Yn,[Zn.shrinkingClass,Zn.growingClass])},FM=(Qn,Zn)=>{Yu(Qn.element,Zn.openClass),$d(Qn.element,Zn.closedClass),ya(Qn.element,EO(Zn),"0px"),Hf(Qn.element)},zP=(Qn,Zn)=>{Yu(Qn.element,Zn.closedClass),$d(Qn.element,Zn.openClass),El(Qn.element,EO(Zn))},cF=(Qn,Zn,Yn,Jn)=>{Yn.setCollapsed(),ya(Qn.element,EO(Zn),Uw(Zn,Qn.element)),VE(Qn,Zn),FM(Qn,Zn),Zn.onStartShrink(Qn),Zn.onShrunk(Qn)},BW=(Qn,Zn,Yn,Jn)=>{const oo=Jn.getOrThunk(()=>Uw(Zn,Qn.element));Yn.setCollapsed(),ya(Qn.element,EO(Zn),oo),Hf(Qn.element);const lo=QE(Qn,Zn);Yu(lo,Zn.growingClass),$d(lo,Zn.shrinkingClass),FM(Qn,Zn),Zn.onStartShrink(Qn)},WP=(Qn,Zn,Yn)=>{const Jn=Uw(Zn,Qn.element);(Jn==="0px"?cF:BW)(Qn,Zn,Yn,ko.some(Jn))},uF=(Qn,Zn,Yn)=>{const Jn=QE(Qn,Zn),oo=of(Jn,Zn.shrinkingClass),lo=Uw(Zn,Qn.element);zP(Qn,Zn);const mo=Uw(Zn,Qn.element);(oo?()=>{ya(Qn.element,EO(Zn),lo),Hf(Qn.element)}:()=>{FM(Qn,Zn)})(),Yu(Jn,Zn.shrinkingClass),$d(Jn,Zn.growingClass),zP(Qn,Zn),ya(Qn.element,EO(Zn),mo),Yn.setExpanded(),Zn.onStartGrow(Qn)},FW=(Qn,Zn,Yn)=>{if(Yn.isExpanded()){El(Qn.element,EO(Zn));const Jn=Uw(Zn,Qn.element);ya(Qn.element,EO(Zn),Jn)}},HW=(Qn,Zn,Yn)=>{Yn.isExpanded()||uF(Qn,Zn,Yn)},dF=(Qn,Zn,Yn)=>{Yn.isExpanded()&&WP(Qn,Zn,Yn)},QW=(Qn,Zn,Yn)=>{Yn.isExpanded()&&cF(Qn,Zn,Yn)},fF=(Qn,Zn,Yn)=>Yn.isExpanded(),VW=(Qn,Zn,Yn)=>Yn.isCollapsed(),HM=(Qn,Zn,Yn)=>{const Jn=QE(Qn,Zn);return of(Jn,Zn.growingClass)===!0},hF=(Qn,Zn,Yn)=>{const Jn=QE(Qn,Zn);return of(Jn,Zn.shrinkingClass)===!0};var zW=Object.freeze({__proto__:null,refresh:FW,grow:HW,shrink:dF,immediateShrink:QW,hasGrown:fF,hasShrunk:VW,isGrowing:HM,isShrinking:hF,isTransitioning:(Qn,Zn,Yn)=>HM(Qn,Zn)||hF(Qn,Zn),toggleGrow:(Qn,Zn,Yn)=>{(Yn.isExpanded()?WP:uF)(Qn,Zn,Yn)},disableTransitions:VE,immediateGrow:(Qn,Zn,Yn)=>{Yn.isExpanded()||(zP(Qn,Zn),ya(Qn.element,EO(Zn),Uw(Zn,Qn.element)),VE(Qn,Zn),Yn.setExpanded(),Zn.onStartGrow(Qn),Zn.onGrown(Qn))}}),UW=Object.freeze({__proto__:null,exhibit:(Qn,Zn,Yn)=>{const Jn=Zn.expanded;return bm(Jn?{classes:[Zn.openClass],styles:{}}:{classes:[Zn.closedClass],styles:Jr(Zn.dimension.property,"0px")})},events:(Qn,Zn)=>Jc([rg(V1(),(Yn,Jn)=>{Jn.event.raw.propertyName===Qn.dimension.property&&(VE(Yn,Qn),Zn.isExpanded()&&El(Yn.element,Qn.dimension.property),(Zn.isExpanded()?Qn.onGrown:Qn.onShrunk)(Yn))})])}),mF=[Er("closedClass"),Er("openClass"),Er("shrinkingClass"),Er("growingClass"),Tc("getAnimationRoot"),rc("onShrunk"),rc("onStartShrink"),rc("onGrown"),rc("onStartGrow"),Gs("expanded",!1),Kf("dimension",jl("property",{width:[tu("property","width"),tu("getDimension",Qn=>dd(Qn)+"px")],height:[tu("property","height"),tu("getDimension",Qn=>cu(Qn)+"px")]}))],ZW=Object.freeze({__proto__:null,init:Qn=>{const Zn=Ua(Qn.expanded),Yn=()=>"expanded: "+Zn.get();return ph({isExpanded:()=>Zn.get()===!0,isCollapsed:()=>Zn.get()===!1,setCollapsed:ms(Zn.set,!1),setExpanded:ms(Zn.set,!0),readState:Yn})}});const jg=Of({fields:mF,name:"sliding",active:UW,apis:zW,state:ZW}),QM=Qn=>({isEnabled:()=>!Ja.isDisabled(Qn),setEnabled:Zn=>Ja.set(Qn,!Zn),setActive:Zn=>{const Yn=Qn.element;Zn?($d(Yn,"tox-tbtn--enabled"),aa(Yn,"aria-pressed",!0)):(Yu(Yn,"tox-tbtn--enabled"),_s(Yn,"aria-pressed"))},isActive:()=>of(Qn.element,"tox-tbtn--enabled"),setText:Zn=>{Qa(Qn,k1,{text:Zn})},setIcon:Zn=>Qa(Qn,G_,{icon:Zn})}),zE=(Qn,Zn,Yn,Jn,oo=!0)=>$M({text:Qn.text,icon:Qn.icon,tooltip:Qn.tooltip,searchable:Qn.search.isSome(),role:Jn,fetch:(lo,mo)=>{const yo={pattern:Qn.search.isSome()?TV(lo):""};Qn.fetch(Co=>{mo(t2(Co,sv.CLOSE_ON_EXECUTE,Yn,{isHorizontalMenu:!1,search:Qn.search}))},yo,QM(lo))},onSetup:Qn.onSetup,getApi:QM,columns:1,presets:"normal",classes:[],dropdownBehaviours:[...oo?[sd.config({})]:[]]},Zn,Yn.shared),qW=(Qn,Zn,Yn)=>{const Jn=lo=>mo=>{const yo=!mo.isActive();mo.setActive(yo),lo.storage.set(yo),Yn.shared.getSink().each(Co=>{Zn().getOpt(Co).each(Ro=>{Cd(Ro.element),Qa(Ro,Cy,{name:lo.name,value:lo.storage.get()})})})},oo=lo=>mo=>{mo.setActive(lo.storage.get())};return lo=>{lo(hs(Qn,mo=>{const yo=mo.text.fold(()=>({}),Co=>({text:Co}));return{type:mo.type,active:!1,...yo,onAction:Jn(mo),onSetup:oo(mo)}}))}},pF=Qn=>({dom:{tag:"span",classes:["tox-tree__label"],attributes:{title:Qn,"aria-label":Qn}},components:[wd(Qn)]}),VM=ba("leaf-label-event-id"),UP=({leaf:Qn,onLeafAction:Zn,visible:Yn,treeId:Jn,selectedId:oo,backstage:lo})=>{const mo=Qn.menu.map(Co=>zE(Co,"tox-mbtn",lo,ko.none(),Yn)),yo=[pF(Qn.title)];return mo.each(Co=>yo.push(Co)),yh.sketch({dom:{tag:"div",classes:["tox-tree--leaf__label","tox-trbtn"].concat(Yn?["tox-tree--leaf__label--visible"]:[])},components:yo,role:"treeitem",action:Co=>{Zn(Qn.id),Co.getSystem().broadcastOn([`update-active-item-${Jn}`],{value:Qn.id})},eventOrder:{[op()]:[VM,"keying"]},buttonBehaviours:Zr([...Yn?[sd.config({})]:[],Ql.config({toggleClass:"tox-trbtn--enabled",toggleOnExecute:!1,aria:{mode:"selected"}}),Om.config({channels:{[`update-active-item-${Jn}`]:{onReceive:(Co,Ro)=>{(Ro.value===Qn.id?Ql.on:Ql.off)(Co)}}}}),Rl(VM,[eu((Co,Ro)=>{oo.each(Lo=>{(Lo===Qn.id?Ql.on:Ql.off)(Co)})}),wr(op(),(Co,Ro)=>{const Lo=Ro.event.raw.code==="ArrowLeft",Wo=Ro.event.raw.code==="ArrowRight";Lo?(Hm(Co.element,".tox-tree--directory").each(jo=>{Co.getSystem().getByDom(jo).each(es=>{GO(jo,".tox-tree--directory__label").each(us=>{es.getSystem().getByDom(us).each(ol.focus)})})}),Ro.stop()):Wo&&Ro.stop()})])])})},gF=(Qn,Zn,Yn)=>s0(Qn,{tag:"span",classes:["tox-tree__icon-wrap","tox-icon"],behaviours:Yn},Zn),ZP=(Qn,Zn)=>gF(Qn,Zn,[]),bF=ba("directory-label-event-id"),jW=({directory:Qn,visible:Zn,noChildren:Yn,backstage:Jn})=>{const oo=Qn.menu.map(yo=>zE(yo,"tox-mbtn",Jn,ko.none())),lo=[{dom:{tag:"div",classes:["tox-chevron"]},components:[ZP("chevron-right",Jn.shared.providers.icons)]},pF(Qn.title)];oo.each(yo=>{lo.push(yo)});const mo=yo=>{Hm(yo.element,".tox-tree--directory").each(Co=>{yo.getSystem().getByDom(Co).each(Ro=>{const Lo=!Ql.isOn(Ro);Ql.toggle(Ro),Qa(yo,"expand-tree-node",{expanded:Lo,node:Qn.id})})})};return yh.sketch({dom:{tag:"div",classes:["tox-tree--directory__label","tox-trbtn"].concat(Zn?["tox-tree--directory__label--visible"]:[])},components:lo,action:mo,eventOrder:{[op()]:[bF,"keying"]},buttonBehaviours:Zr([...Zn?[sd.config({})]:[],Rl(bF,[wr(op(),(yo,Co)=>{const Ro=Co.event.raw.code==="ArrowRight",Lo=Co.event.raw.code==="ArrowLeft";Ro&&Yn&&Co.stop(),(Ro||Lo)&&Hm(yo.element,".tox-tree--directory").each(Wo=>{yo.getSystem().getByDom(Wo).each(jo=>{!Ql.isOn(jo)&&Ro||Ql.isOn(jo)&&Lo?(mo(yo),Co.stop()):Lo&&!Ql.isOn(jo)&&(Hm(jo.element,".tox-tree--directory").each(es=>{GO(es,".tox-tree--directory__label").each(us=>{jo.getSystem().getByDom(us).each(ol.focus)})}),Co.stop())})})})])])})},XW=({children:Qn,onLeafAction:Zn,visible:Yn,treeId:Jn,expandedIds:oo,selectedId:lo,backstage:mo})=>({dom:{tag:"div",classes:["tox-tree--directory__children"]},components:Qn.map(yo=>yo.type==="leaf"?UP({leaf:yo,selectedId:lo,onLeafAction:Zn,visible:Yn,treeId:Jn,backstage:mo}):qP({directory:yo,expandedIds:oo,selectedId:lo,onLeafAction:Zn,labelTabstopping:Yn,treeId:Jn,backstage:mo})),behaviours:Zr([jg.config({dimension:{property:"height"},closedClass:"tox-tree--directory__children--closed",openClass:"tox-tree--directory__children--open",growingClass:"tox-tree--directory__children--growing",shrinkingClass:"tox-tree--directory__children--shrinking",expanded:Yn}),Cl.config({})])}),YW=ba("directory-event-id"),qP=({directory:Qn,onLeafAction:Zn,labelTabstopping:Yn,treeId:Jn,backstage:oo,expandedIds:lo,selectedId:mo})=>{const{children:yo}=Qn,Co=Ua(lo),Ro=Wo=>yo.map(jo=>jo.type==="leaf"?UP({leaf:jo,selectedId:mo,onLeafAction:Zn,visible:Wo,treeId:Jn,backstage:oo}):qP({directory:jo,expandedIds:Co.get(),selectedId:mo,onLeafAction:Zn,labelTabstopping:Wo,treeId:Jn,backstage:oo})),Lo=lo.includes(Qn.id);return{dom:{tag:"div",classes:["tox-tree--directory"],attributes:{role:"treeitem"}},components:[jW({directory:Qn,visible:Yn,noChildren:Qn.children.length===0,backstage:oo}),XW({children:yo,expandedIds:lo,selectedId:mo,onLeafAction:Zn,visible:Lo,treeId:Jn,backstage:oo})],behaviours:Zr([Rl(YW,[eu((Wo,jo)=>{Ql.set(Wo,Lo)}),wr("expand-tree-node",(Wo,jo)=>{const{expanded:es,node:us}=jo.event;Co.set(es?[...Co.get(),us]:Co.get().filter(Ps=>Ps!==us))})]),Ql.config({...Qn.children.length>0?{aria:{mode:"expanded"}}:{},toggleClass:"tox-tree--directory--expanded",onToggled:(Wo,jo)=>{const es=Wo.components()[1],us=Ro(jo);jo?jg.grow(es):jg.shrink(es),Cl.set(es,us)}})])}},GW=ba("tree-event-id"),KW=(Qn,Zn)=>{const Yn=Qn.onLeafAction.getOr(xo),Jn=Qn.onToggleExpand.getOr(xo),oo=Qn.defaultExpandedIds,lo=Ua(oo),mo=Ua(Qn.defaultSelectedId),yo=ba("tree-id"),Co=(Ro,Lo)=>Qn.items.map(Wo=>Wo.type==="leaf"?UP({leaf:Wo,selectedId:Ro,onLeafAction:Yn,visible:!0,treeId:yo,backstage:Zn}):qP({directory:Wo,selectedId:Ro,onLeafAction:Yn,expandedIds:Lo,labelTabstopping:!0,treeId:yo,backstage:Zn}));return{dom:{tag:"div",classes:["tox-tree"],attributes:{role:"tree"}},components:Co(mo.get(),lo.get()),behaviours:Zr([Za.config({mode:"flow",selector:".tox-tree--leaf__label--visible, .tox-tree--directory__label--visible",cycles:!1}),Rl(GW,[wr("expand-tree-node",(Ro,Lo)=>{const{expanded:Wo,node:jo}=Lo.event;lo.set(Wo?[...lo.get(),jo]:lo.get().filter(es=>es!==jo)),Jn(lo.get(),{expanded:Wo,node:jo})})]),Om.config({channels:{[`update-active-item-${yo}`]:{onReceive:(Ro,Lo)=>{mo.set(ko.some(Lo.value)),Cl.set(Ro,Co(ko.some(Lo.value),lo.get()))}}}}),Cl.config({})])}};var vF=Object.freeze({__proto__:null,events:(Qn,Zn)=>{const Jn=Qn.stream.streams.setup(Qn,Zn);return Jc([wr(Qn.event,Jn),ig(()=>Zn.cancel())].concat(Qn.cancelEvent.map(oo=>[wr(oo,()=>Zn.cancel())]).getOr([])))}});const zM=Qn=>{const Zn=Ua(null);return ph({readState:()=>({timer:Zn.get()!==null?"set":"unset"}),setTimer:lo=>{Zn.set(lo)},cancel:()=>{const lo=Zn.get();lo!==null&&lo.cancel()}})};var JW=Object.freeze({__proto__:null,throttle:zM,init:Qn=>Qn.stream.streams.state(Qn)});const yF=(Qn,Zn)=>{const Yn=Qn.stream,Jn=IP(Qn.onStream,Yn.delay);return Zn.setTimer(Jn),(oo,lo)=>{Jn.throttle(oo,lo),Yn.stopEvent&&lo.stop()}};var eU=[Kf("stream",jl("mode",{throttle:[Er("delay"),Gs("stopEvent",!0),tu("streams",{setup:yF,state:zM})]})),Gs("event","input"),Tc("cancelEvent"),Fg("onStream")];const WM=Of({fields:eU,name:"streaming",active:vF,state:JW}),cl=(Qn,Zn,Yn)=>{const Jn=da.getValue(Yn);da.setValue(Zn,Jn),UM(Zn)},n2=(Qn,Zn)=>{const Yn=Qn.element,Jn=c1(Yn),oo=Yn.dom;Bu(Yn,"type")!=="number"&&Zn(oo,Jn)},UM=Qn=>{n2(Qn,(Zn,Yn)=>Zn.setSelectionRange(Yn.length,Yn.length))},OF=(Qn,Zn)=>{n2(Qn,(Yn,Jn)=>Yn.setSelectionRange(Zn,Jn.length))},_F=(Qn,Zn,Yn)=>{if(Qn.selectsOver){const Jn=da.getValue(Zn),oo=Qn.getDisplayText(Jn),lo=da.getValue(Yn);return Qn.getDisplayText(lo).indexOf(oo)===0?ko.some(()=>{cl(Qn,Zn,Yn),OF(Zn,oo.length)}):ko.none()}else return ko.none()},jP=Mo("alloy.typeahead.itemexecute"),SF=(Qn,Zn,Yn,Jn)=>{const oo=(Wo,jo,es)=>{Qn.previewing.set(!1);const us=Gd.getCoupled(Wo,"sandbox");if(uc.isOpen(us))ic.getCurrent(us).each(Ps=>{Bc.getHighlighted(Ps).fold(()=>{es(Ps)},()=>{LO(us,Ps.element,"keydown",jo)})});else{const Ps=er=>{ic.getCurrent(er).each(es)};pP(Qn,mo(Wo),Wo,us,Jn,Ps,hp.HighlightMenuAndItem).get(xo)}},lo=UR(Qn),mo=Wo=>jo=>jo.map(es=>{const us=gd(es.menus),Ps=fs(us,Bs=>ga(Bs.items,Ns=>Ns.type==="item"));return da.getState(Wo).update(hs(Ps,Bs=>Bs.data)),es}),yo=Wo=>ic.getCurrent(Wo),Co="typeaheadevents",Ro=[ol.config({}),da.config({onSetValue:Qn.onSetValue,store:{mode:"dataset",getDataKey:Wo=>c1(Wo.element),getFallbackEntry:Wo=>({value:Wo,meta:{}}),setValue:(Wo,jo)=>{Wv(Wo.element,Qn.model.getDisplayText(jo))},...Qn.initialData.map(Wo=>Jr("initialValue",Wo)).getOr({})}}),WM.config({stream:{mode:"throttle",delay:Qn.responseTime,stopEvent:!1},onStream:(Wo,jo)=>{const es=Gd.getCoupled(Wo,"sandbox");if(ol.isFocused(Wo)&&c1(Wo.element).length>=Qn.minChars){const Ps=yo(es).bind(Bs=>Bc.getHighlighted(Bs).map(da.getValue));Qn.previewing.set(!0);const er=Bs=>{yo(es).each(Ns=>{Ps.fold(()=>{Qn.model.selectsOver&&Bc.highlightFirst(Ns)},Xs=>{Bc.highlightBy(Ns,Hr=>da.getValue(Hr).value===Xs.value),Bc.getHighlighted(Ns).orThunk(()=>(Bc.highlightFirst(Ns),ko.none()))})})};pP(Qn,mo(Wo),Wo,es,Jn,er,hp.HighlightJustMenu).get(xo)}},cancelEvent:Hy()}),Za.config({mode:"special",onDown:(Wo,jo)=>(oo(Wo,jo,Bc.highlightFirst),ko.some(!0)),onEscape:Wo=>{const jo=Gd.getCoupled(Wo,"sandbox");return uc.isOpen(jo)?(uc.close(jo),ko.some(!0)):ko.none()},onUp:(Wo,jo)=>(oo(Wo,jo,Bc.highlightLast),ko.some(!0)),onEnter:Wo=>{const jo=Gd.getCoupled(Wo,"sandbox"),es=uc.isOpen(jo);if(es&&!Qn.previewing.get())return yo(jo).bind(us=>Bc.getHighlighted(us)).map(us=>(Qa(Wo,jP(),{item:us}),!0));{const us=da.getValue(Wo);return Wl(Wo,Hy()),Qn.onExecute(jo,Wo,us),es&&uc.close(jo),ko.some(!0)}}}),Ql.config({toggleClass:Qn.markers.openClass,aria:{mode:"expanded"}}),Gd.config({others:{sandbox:Wo=>VD(Qn,Wo,{onOpen:()=>Ql.on(Wo),onClose:()=>{Qn.lazyTypeaheadComp.get().each(jo=>_s(jo.element,"aria-activedescendant")),Ql.off(Wo)}})}}),Rl(Co,[eu(Wo=>{Qn.lazyTypeaheadComp.set(ko.some(Wo))}),ig(Wo=>{Qn.lazyTypeaheadComp.set(ko.none())}),qh(Wo=>{const jo=xo;QD(Qn,mo(Wo),Wo,Jn,jo,hp.HighlightMenuAndItem).get(xo)}),wr(jP(),(Wo,jo)=>{const es=Gd.getCoupled(Wo,"sandbox");cl(Qn.model,Wo,jo.event.item),Wl(Wo,Hy()),Qn.onItemExecute(Wo,es,jo.event.item,da.getValue(Wo)),uc.close(es),UM(Wo)})].concat(Qn.dismissOnBlur?[wr(W1(),Wo=>{const jo=Gd.getCoupled(Wo,"sandbox");dg(jo.element).isNone()&&uc.close(jo)})]:[]))],Lo={[xp()]:[da.name(),WM.name(),Co],...Qn.eventOrder};return{uid:Qn.uid,dom:VA(Lc(Qn,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:{...lo,...sf(Qn.typeaheadBehaviours,Ro)},eventOrder:Lo}},dG=Mo([Tc("lazySink"),Er("fetch"),Gs("minChars",5),Gs("responseTime",1e3),rc("onOpen"),Gs("getHotspot",ko.some),Gs("getAnchorOverrides",Mo({})),Gs("layouts",ko.none()),Gs("eventOrder",{}),Kp("model",{},[Gs("getDisplayText",Qn=>Qn.meta!==void 0&&Qn.meta.text!==void 0?Qn.meta.text:Qn.value),Gs("selectsOver",!0),Gs("populateFromBrowse",!0)]),rc("onSetValue"),Vm("onExecute"),rc("onItemExecute"),Gs("inputClasses",[]),Gs("inputAttributes",{}),Gs("inputStyles",{}),Gs("matchWidth",!0),Gs("useMinWidth",!1),Gs("dismissOnBlur",!0),Wb(["openClass"]),Tc("initialData"),Nf("typeaheadBehaviours",[ol,da,WM,Za,Ql,Gd]),pu("lazyTypeaheadComp",()=>Ua(ko.none)),pu("previewing",()=>Ua(!0))].concat(fE()).concat(zD())),WE=Mo([v1({schema:[qy()],name:"menu",overrides:Qn=>({fakeFocus:!0,onHighlightItem:(Zn,Yn,Jn)=>{Qn.previewing.get()?Qn.lazyTypeaheadComp.get().each(oo=>{_F(Qn.model,oo,Jn).fold(()=>{Qn.model.selectsOver?(Bc.dehighlight(Yn,Jn),Qn.previewing.set(!0)):Qn.previewing.set(!1)},lo=>{lo(),Qn.previewing.set(!1)})}):Qn.lazyTypeaheadComp.get().each(oo=>{Qn.model.populateFromBrowse&&cl(Qn.model,oo,Jn),Uo(Jn.element,"id").each(lo=>aa(oo.element,"aria-activedescendant",lo))})},onExecute:(Zn,Yn)=>Qn.lazyTypeaheadComp.get().map(Jn=>(Qa(Jn,jP(),{item:Yn}),!0)),onHover:(Zn,Yn)=>{Qn.previewing.set(!1),Qn.lazyTypeaheadComp.get().each(Jn=>{Qn.model.populateFromBrowse&&cl(Qn.model,Jn,Yn)})}})})]),tU=Yh({name:"Typeahead",configFields:dG(),partFields:WE(),factory:SF}),Ob=Qn=>({...Qn,toCached:()=>Ob(Qn.toCached()),bindFuture:Co=>Ob(Qn.bind(Ro=>Ro.fold(Lo=>Cm.pure(yl.error(Lo)),Lo=>Co(Lo)))),bindResult:Co=>Ob(Qn.map(Ro=>Ro.bind(Co))),mapResult:Co=>Ob(Qn.map(Ro=>Ro.map(Co))),mapError:Co=>Ob(Qn.map(Ro=>Ro.mapError(Co))),foldResult:(Co,Ro)=>Qn.map(Lo=>Lo.fold(Co,Ro)),withTimeout:(Co,Ro)=>Ob(Cm.nu(Lo=>{let Wo=!1;const jo=setTimeout(()=>{Wo=!0,Lo(yl.error(Ro()))},Co);Qn.get(es=>{Wo||(clearTimeout(jo),Lo(es))})}))}),wF=Qn=>Ob(Cm.nu(Qn)),CF=Qn=>Ob(Cm.pure(yl.value(Qn))),sU={nu:wF,wrap:Ob,pure:CF,value:CF,error:Qn=>Ob(Cm.pure(yl.error(Qn))),fromResult:Qn=>Ob(Cm.pure(Qn)),fromFuture:Qn=>Ob(Qn.map(yl.value)),fromPromise:Qn=>wF(Zn=>{Qn.then(Yn=>{Zn(yl.value(Yn))},Yn=>{Zn(yl.error(Yn))})})},XP=(Qn,Zn,Yn=[],Jn,oo,lo)=>{const mo=Zn.fold(()=>({}),Ro=>({action:Ro})),yo={buttonBehaviours:Zr([Lf.button(()=>!Qn.enabled||lo.isDisabled()),jf(),sd.config({}),Rl("button press",[mS("click"),mS("mousedown")])].concat(Yn)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]},...mo},Co=Lc(yo,{dom:Jn});return Lc(Co,{components:oo})},rU=(Qn,Zn,Yn,Jn=[])=>{const oo=Qn.tooltip.map(Co=>({"aria-label":Yn.translate(Co),title:Yn.translate(Co)})).getOr({}),lo={tag:"button",classes:["tox-tbtn"],attributes:oo},mo=Qn.icon.map(Co=>PM(Co,Yn.icons)),yo=Hk([mo]);return XP(Qn,Zn,Jn,lo,yo,Yn)},ZM=Qn=>{switch(Qn){case"primary":return["tox-button"];case"toolbar":return["tox-tbtn"];case"secondary":default:return["tox-button","tox-button--secondary"]}},xF=(Qn,Zn,Yn,Jn=[],oo=[])=>{const lo=Yn.translate(Qn.text),mo=Qn.icon.map(jo=>PM(jo,Yn.icons)),yo=[mo.getOrThunk(()=>wd(lo))],Co=Qn.buttonType.getOr(!Qn.primary&&!Qn.borderless?"secondary":"primary"),Wo={tag:"button",classes:[...ZM(Co),...mo.isSome()?["tox-button--icon"]:[],...Qn.borderless?["tox-button--naked"]:[],...oo],attributes:{title:lo}};return XP(Qn,Zn,Jn,Wo,yo,Yn)},qM=(Qn,Zn,Yn,Jn=[],oo=[])=>{const lo=xF(Qn,ko.some(Zn),Yn,Jn,oo);return yh.sketch(lo)},EF=(Qn,Zn)=>Yn=>{Zn==="custom"?Qa(Yn,Cy,{name:Qn,value:{}}):Zn==="submit"?Wl(Yn,PE):Zn==="cancel"?Wl(Yn,U_):console.error("Unknown button type: ",Zn)},iU=(Qn,Zn)=>Zn==="menu",aU=(Qn,Zn)=>Zn==="custom"||Zn==="cancel"||Zn==="submit",lU=(Qn,Zn)=>Zn==="togglebutton",cU=(Qn,Zn)=>{var Yn,Jn;const oo=Qn.icon.map(Ns=>Y_(Ns,Zn.icons)).map(ou),lo=Ns=>{Qa(Ns,Cy,{name:Qn.name,value:{setIcon:Xs=>{oo.map(Hr=>Hr.getOpt(Ns).each(kr=>{Cl.set(kr,[Y_(Xs,Zn.icons)])}))}}})},mo=Qn.buttonType.getOr(Qn.primary?"primary":"secondary"),yo={...Qn,name:(Yn=Qn.name)!==null&&Yn!==void 0?Yn:"",primary:mo==="primary",tooltip:ko.from(Qn.tooltip),enabled:(Jn=Qn.enabled)!==null&&Jn!==void 0?Jn:!1,borderless:!1},Co=yo.tooltip.map(Ns=>({"aria-label":Zn.translate(Ns),title:Zn.translate(Ns)})).getOr({}),Ro=ZM(mo??"secondary"),Lo=Qn.icon.isSome()&&Qn.text.isSome(),Wo={tag:"button",classes:[...Ro.concat(Qn.icon.isSome()?["tox-button--icon"]:[]),...Qn.active?["tox-button--enabled"]:[],...Lo?["tox-button--icon-and-text"]:[]],attributes:Co},jo=[],es=Zn.translate(Qn.text.getOr("")),us=wd(es),er=[...Hk([oo.map(Ns=>Ns.asSpec())]),...Qn.text.isSome()?[us]:[]],Bs=XP(yo,ko.some(lo),jo,Wo,er,Zn);return yh.sketch(Bs)},YP=(Qn,Zn,Yn)=>{if(iU(Qn,Zn)){const Jn=()=>mo,oo=Qn,lo={...Qn,type:"menubutton",search:ko.none(),onSetup:yo=>(yo.setEnabled(Qn.enabled),xo),fetch:qW(oo.items,Jn,Yn)},mo=ou(zE(lo,"tox-tbtn",Yn,ko.none()));return mo.asSpec()}else if(aU(Qn,Zn)){const Jn=EF(Qn.name,Zn),oo={...Qn,borderless:!1};return qM(oo,Jn,Yn.shared.providers,[])}else{if(lU(Qn,Zn))return cU(Qn,Yn.shared.providers);throw console.error("Unknown footer button type: ",Zn),new Error("Unknown footer button type")}},uU=(Qn,Zn)=>{const Yn=EF(Qn.name,"custom");return GV(ko.none(),su.parts.field({factory:yh,...xF(Qn,ko.some(Yn),Zn,[LP(""),Og.self()])}))},dU={type:"separator"},fU=Qn=>({type:"menuitem",value:Qn.url,text:Qn.title,meta:{attach:Qn.attach},onAction:xo}),jM=(Qn,Zn)=>({type:"menuitem",value:Zn,text:Qn,meta:{attach:void 0},onAction:xo}),hU=Qn=>hs(Qn,fU),TF=(Qn,Zn)=>ga(Zn,Yn=>Yn.type===Qn),AF=(Qn,Zn)=>hU(TF(Qn,Zn)),mU=Qn=>AF("header",Qn.targets),pU=Qn=>AF("anchor",Qn.targets),gU=Qn=>ko.from(Qn.anchorTop).map(Zn=>jM("",Zn)).toArray(),bU=Qn=>ko.from(Qn.anchorBottom).map(Zn=>jM("",Zn)).toArray(),vU=Qn=>hs(Qn,Zn=>jM(Zn,Zn)),PF=Qn=>za(Qn,(Zn,Yn)=>Zn.length===0||Yn.length===0?Zn.concat(Yn):Zn.concat(dU,Yn),[]),XM=(Qn,Zn)=>{const Yn=Qn.toLowerCase();return ga(Zn,Jn=>{var oo;const lo=Jn.meta!==void 0&&Jn.meta.text!==void 0?Jn.meta.text:Jn.text,mo=(oo=Jn.value)!==null&&oo!==void 0?oo:"";return xc(lo.toLowerCase(),Yn)||xc(mo.toLowerCase(),Yn)})},$F=(Qn,Zn,Yn)=>{var Jn,oo;const lo=da.getValue(Zn),mo=(oo=(Jn=lo==null?void 0:lo.meta)===null||Jn===void 0?void 0:Jn.text)!==null&&oo!==void 0?oo:lo.value;return Yn.getLinkInformation().fold(()=>[],Co=>{const Ro=XM(mo,vU(Yn.getHistory(Qn)));return Qn==="file"?PF([Ro,XM(mo,mU(Co)),XM(mo,Us([gU(Co),pU(Co),bU(Co)]))]):Ro})},RF=ba("aria-invalid"),DF=(Qn,Zn,Yn,Jn)=>{const oo=Zn.shared.providers,lo=Ns=>{const Xs=da.getValue(Ns);Yn.addToHistory(Xs.value,Qn.filetype)},mo={...Jn.map(Ns=>({initialData:Ns})).getOr({}),dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":RF,type:"url"},minChars:0,responseTime:0,fetch:Ns=>{const Xs=$F(Qn.filetype,Ns,Yn),Hr=t2(Xs,sv.BUBBLE_TO_SANDBOX,Zn,{isHorizontalMenu:!1,search:ko.none()});return Cm.pure(Hr)},getHotspot:Ns=>us.getOpt(Ns),onSetValue:(Ns,Xs)=>{Ns.hasConfigured(C1)&&C1.run(Ns).get(xo)},typeaheadBehaviours:Zr([...Yn.getValidationHandler().map(Ns=>C1.config({getRoot:Xs=>lh(Xs.element),invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:(Xs,Hr)=>{Lo.getOpt(Xs).each(kr=>{aa(kr.element,"title",oo.translate(Hr))})}},validator:{validate:Xs=>{const Hr=da.getValue(Xs);return sU.nu(kr=>{Ns({type:Qn.filetype,url:Hr.value},Or=>{if(Or.status==="invalid"){const qr=yl.error(Or.message);kr(qr)}else{const qr=yl.value(Or.message);kr(qr)}})})},validateOnLoad:!1}})).toArray(),Ja.config({disabled:()=>!Qn.enabled||oo.isDisabled()}),sd.config({}),Rl("urlinput-events",[wr(o1(),Ns=>{const Xs=c1(Ns.element),Hr=Xs.trim();Hr!==Xs&&Wv(Ns.element,Hr),Qn.filetype==="file"&&Qa(Ns,vg,{name:Qn.name})}),wr(E0(),Ns=>{Qa(Ns,vg,{name:Qn.name}),lo(Ns)}),wr(U1(),Ns=>{Qa(Ns,vg,{name:Qn.name}),lo(Ns)})])]),eventOrder:{[o1()]:["streaming","urlinput-events","invalidating"]},model:{getDisplayText:Ns=>Ns.value,selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:Zn.shared.getSink,parts:{menu:Dk(!1,1,"normal")},onExecute:(Ns,Xs,Hr)=>{Qa(Xs,PE,{})},onItemExecute:(Ns,Xs,Hr,kr)=>{lo(Ns),Qa(Ns,vg,{name:Qn.name})}},yo=su.parts.field({...mo,factory:tU}),Co=Qn.label.map(Ns=>yb(Ns,oo)),Lo=ou(((Ns,Xs,Hr=Ns,kr=Ns)=>s0(Hr,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+Ns],attributes:{title:oo.translate(kr),"aria-live":"polite",...Xs.fold(()=>({}),Or=>({id:Or}))}},oo.icons))("invalid",ko.some(RF),"warning")),Wo=ou({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[Lo.asSpec()]}),jo=Yn.getUrlPicker(Qn.filetype),es=ba("browser.url.event"),us=ou({dom:{tag:"div",classes:["tox-control-wrap"]},components:[yo,Wo.asSpec()],behaviours:Zr([Ja.config({disabled:()=>!Qn.enabled||oo.isDisabled()})])}),Ps=ou(qM({name:Qn.name,icon:ko.some("browse"),text:Qn.picker_text.or(Qn.label).getOr(""),enabled:Qn.enabled,primary:!1,buttonType:ko.none(),borderless:!0},Ns=>Wl(Ns,es),oo,[],["tox-browse-url"])),er=()=>({dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:Us([[us.asSpec()],jo.map(()=>Ps.asSpec()).toArray()])}),Bs=Ns=>{ic.getCurrent(Ns).each(Xs=>{const Hr=da.getValue(Xs),kr={fieldname:Qn.name,...Hr};jo.each(Or=>{Or(kr).get(qr=>{da.setValue(Xs,qr),Qa(Ns,vg,{name:Qn.name})})})})};return su.sketch({dom:tG(),components:Co.toArray().concat([er()]),fieldBehaviours:Zr([Ja.config({disabled:()=>!Qn.enabled||oo.isDisabled(),onDisabled:Ns=>{su.getField(Ns).each(Ja.disable),Ps.getOpt(Ns).each(Ja.disable)},onEnabled:Ns=>{su.getField(Ns).each(Ja.enable),Ps.getOpt(Ns).each(Ja.enable)}}),jf(),Rl("url-input-events",[wr(es,Bs)])])})},MF=(Qn,Zn)=>{const Yn=yR(Qn.icon,Zn.icons);return rv.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in",`tox-notification--${Qn.level}`]},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:Qn.url?void 0:Yn},components:Qn.url?[yh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:Yn,attributes:{title:Zn.translate(Qn.iconTooltip)}},action:Jn=>Qa(Jn,Cy,{name:"alert-banner",value:Qn.url}),buttonBehaviours:Zr([AA()])})]:void 0},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:Zn.translate(Qn.text)}}]})},YM=(Qn,Zn)=>{Qn.dom.checked=Zn},yU=Qn=>Qn.dom.checked,NF=(Qn,Zn,Yn)=>{const Jn=Co=>(Co.element.dom.click(),ko.some(!0)),oo=su.parts.field({factory:{sketch:Go},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:Zr([Og.self(),Ja.config({disabled:()=>!Qn.enabled||Zn.isDisabled(),onDisabled:Co=>{lh(Co.element).each(Ro=>$d(Ro,"tox-checkbox--disabled"))},onEnabled:Co=>{lh(Co.element).each(Ro=>Yu(Ro,"tox-checkbox--disabled"))}}),sd.config({}),ol.config({}),OM(Yn,yU,YM),Za.config({mode:"special",onEnter:Jn,onSpace:Jn,stopSpaceKeyup:!0}),Rl("checkbox-events",[wr(E0(),(Co,Ro)=>{Qa(Co,vg,{name:Qn.name})})])])}),lo=su.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"]},components:[wd(Zn.translate(Qn.label))],behaviours:Zr([$E.config({})])}),mo=Co=>s0(Co==="checked"?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+Co]},Zn.icons),yo=ou({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[mo("checked"),mo("unchecked")]});return su.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[oo,yo.asSpec(),lo],fieldBehaviours:Zr([Ja.config({disabled:()=>!Qn.enabled||Zn.isDisabled()}),jf()])})},LF=Qn=>Qn.presets==="presentation"?rv.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:Qn.html}}):rv.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:Qn.html,attributes:{role:"document"}},containerBehaviours:Zr([sd.config({}),ol.config({})])}),sh=Qn=>(Zn,Yn,Jn,oo)=>Rr(Yn,"name").fold(()=>Qn(Yn,oo,ko.none()),lo=>Zn.field(lo,Qn(Yn,oo,Rr(Jn,lo)))),IF=Qn=>(Zn,Yn,Jn,oo)=>{const lo=Lc(Yn,{source:"dynamic"});return sh(Qn)(Zn,lo,Jn,oo)},OU={bar:sh((Qn,Zn)=>UV(Qn,Zn.shared)),collection:sh((Qn,Zn,Yn)=>JV(Qn,Zn.shared.providers,Yn)),alertbanner:sh((Qn,Zn)=>MF(Qn,Zn.shared.providers)),input:sh((Qn,Zn,Yn)=>aF(Qn,Zn.shared.providers,Yn)),textarea:sh((Qn,Zn,Yn)=>lF(Qn,Zn.shared.providers,Yn)),label:sh((Qn,Zn)=>qB(Qn,Zn.shared)),iframe:IF((Qn,Zn,Yn)=>OW(Qn,Zn.shared.providers,Yn)),button:sh((Qn,Zn)=>uU(Qn,Zn.shared.providers)),checkbox:sh((Qn,Zn,Yn)=>NF(Qn,Zn.shared.providers,Yn)),colorinput:sh((Qn,Zn,Yn)=>rz(Qn,Zn.shared,Zn.colorinput,Yn)),colorpicker:sh((Qn,Zn,Yn)=>uW(Qn,Zn.shared.providers,Yn)),dropzone:sh((Qn,Zn,Yn)=>fW(Qn,Zn.shared.providers,Yn)),grid:sh((Qn,Zn)=>HB(Qn,Zn.shared)),listbox:sh((Qn,Zn,Yn)=>MM(Qn,Zn,Yn)),selectbox:sh((Qn,Zn,Yn)=>HE(Qn,Zn.shared.providers,Yn)),sizeinput:sh((Qn,Zn)=>rF(Qn,Zn.shared.providers)),slider:sh((Qn,Zn,Yn)=>iF(Qn,Zn.shared.providers,Yn)),urlinput:sh((Qn,Zn,Yn)=>DF(Qn,Zn,Zn.urlinput,Yn)),customeditor:sh(BB),htmlpanel:sh(LF),imagepreview:sh((Qn,Zn,Yn)=>wW(Qn,Yn)),table:sh((Qn,Zn)=>IW(Qn,Zn.shared.providers)),tree:sh((Qn,Zn)=>KW(Qn,Zn)),panel:sh((Qn,Zn)=>$W(Qn,Zn))},_U={field:(Qn,Zn)=>Zn,record:Mo([])},d0=(Qn,Zn,Yn,Jn)=>{const oo=Lc(Jn,{shared:{interpreter:lo=>o2(Qn,lo,Yn,oo)}});return o2(Qn,Zn,Yn,oo)},o2=(Qn,Zn,Yn,Jn)=>Rr(OU,Zn.type).fold(()=>(console.error(`Unknown factory type "${Zn.type}", defaulting to container: `,Zn),Zn),oo=>oo(Qn,Zn,Yn,Jn)),UE=(Qn,Zn,Yn)=>o2(_U,Qn,Zn,Yn),K_="layout-inset",ZE=Qn=>Qn.x,BF=(Qn,Zn)=>Qn.x+Qn.width/2-Zn.width/2,qE=(Qn,Zn)=>Qn.x+Qn.width-Zn.width,GP=Qn=>Qn.y,jE=(Qn,Zn)=>Qn.y+Qn.height-Zn.height,FF=(Qn,Zn)=>Qn.y+Qn.height/2-Zn.height/2,XE=(Qn,Zn,Yn)=>Yd(qE(Qn,Zn),jE(Qn,Zn),Yn.insetSouthwest(),Pp(),"southwest",Uu(Qn,{right:0,bottom:3}),K_),YE=(Qn,Zn,Yn)=>Yd(ZE(Qn),jE(Qn,Zn),Yn.insetSoutheast(),n_(),"southeast",Uu(Qn,{left:1,bottom:3}),K_),Zw=(Qn,Zn,Yn)=>Yd(qE(Qn,Zn),GP(Qn),Yn.insetNorthwest(),TS(),"northwest",Uu(Qn,{right:0,top:2}),K_),GE=(Qn,Zn,Yn)=>Yd(ZE(Qn),GP(Qn),Yn.insetNortheast(),Xy(),"northeast",Uu(Qn,{left:1,top:2}),K_),f0=(Qn,Zn,Yn)=>Yd(BF(Qn,Zn),GP(Qn),Yn.insetNorth(),ug(),"north",Uu(Qn,{top:2}),K_),s2=(Qn,Zn,Yn)=>Yd(BF(Qn,Zn),jE(Qn,Zn),Yn.insetSouth(),H2(),"south",Uu(Qn,{bottom:3}),K_),HF=(Qn,Zn,Yn)=>Yd(qE(Qn,Zn),FF(Qn,Zn),Yn.insetEast(),H0(),"east",Uu(Qn,{right:0}),K_),QF=(Qn,Zn,Yn)=>Yd(ZE(Qn),FF(Qn,Zn),Yn.insetWest(),lr(),"west",Uu(Qn,{left:1}),K_),VF=Qn=>{switch(Qn){case"north":return f0;case"northeast":return GE;case"northwest":return Zw;case"south":return s2;case"southeast":return YE;case"southwest":return XE;case"east":return HF;case"west":return QF}},GM=(Qn,Zn,Yn,Jn,oo)=>AC(Jn).map(VF).getOr(f0)(Qn,Zn,Yn,Jn,oo),SU=Qn=>{switch(Qn){case"north":return s2;case"northeast":return YE;case"northwest":return XE;case"south":return f0;case"southeast":return GE;case"southwest":return Zw;case"east":return QF;case"west":return HF}},wU=(Qn,Zn,Yn,Jn,oo)=>AC(Jn).map(SU).getOr(f0)(Qn,Zn,Yn,Jn,oo),KE={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},CU=(Qn,Zn,Yn)=>{const oo={maxHeightFunction:zg()},lo=()=>({type:"node",root:Fr(rr(Qn())),node:ko.from(Qn()),bubble:p1(12,12,KE),layouts:{onRtl:()=>[GE],onLtr:()=>[Zw]},overrides:oo}),mo=()=>({type:"hotspot",hotspot:Zn(),bubble:p1(-12,12,KE),layouts:{onRtl:()=>[gf,eh,bu],onLtr:()=>[eh,gf,bu]},overrides:oo});return()=>Yn()?lo():mo()},zF=(Qn,Zn,Yn,Jn)=>{const lo={maxHeightFunction:zg()},mo=()=>({type:"node",root:Fr(rr(Zn())),node:ko.from(Zn()),bubble:p1(12,12,KE),layouts:{onRtl:()=>[f0],onLtr:()=>[f0]},overrides:lo}),yo=()=>Qn?{type:"node",root:Fr(rr(Zn())),node:ko.from(Zn()),bubble:p1(0,-Vp(Zn()),KE),layouts:{onRtl:()=>[Rh],onLtr:()=>[Rh]},overrides:lo}:{type:"hotspot",hotspot:Yn(),bubble:p1(0,0,KE),layouts:{onRtl:()=>[Rh],onLtr:()=>[Rh]},overrides:lo};return()=>Jn()?mo():yo()},lv=(Qn,Zn,Yn)=>{const Jn=()=>({type:"node",root:Fr(rr(Qn())),node:ko.from(Qn()),layouts:{onRtl:()=>[f0],onLtr:()=>[f0]}}),oo=()=>({type:"hotspot",hotspot:Zn(),layouts:{onRtl:()=>[bu],onLtr:()=>[bu]}});return()=>Yn()?Jn():oo()},KM=(Qn,Zn)=>()=>({type:"selection",root:Zn(),getSelection:()=>{const Yn=Qn.selection.getRng(),Jn=Qn.model.table.getSelectedCells();if(Jn.length>1){const oo=Jn[0],lo=Jn[Jn.length-1],mo={firstCell:Ds.fromDom(oo),lastCell:Ds.fromDom(lo)};return ko.some(mo)}return ko.some(Zf.range(Ds.fromDom(Yn.startContainer),Yn.startOffset,Ds.fromDom(Yn.endContainer),Yn.endOffset))}}),kU=Qn=>Zn=>({type:"node",root:Qn(),node:Zn}),xU=(Qn,Zn,Yn,Jn)=>{const oo=$k(Qn),lo=()=>Ds.fromDom(Qn.getBody()),mo=()=>Ds.fromDom(Qn.getContentAreaContainer()),yo=()=>oo||!Jn();return{inlineDialog:CU(mo,Zn,yo),inlineBottomDialog:zF(Qn.inline,mo,Yn,yo),banner:lv(mo,Zn,yo),cursor:KM(Qn,lo),node:kU(lo)}},EU=Qn=>(Zn,Yn)=>{wI(Qn)(Zn,Yn)},TU=Qn=>()=>bI(Qn),AU=Qn=>Zn=>uP(Qn,Zn),WF=Qn=>Zn=>gI(Qn,Zn),UF=Qn=>({colorPicker:EU(Qn),hasCustomColors:TU(Qn),getColors:AU(Qn),getColorCols:WF(Qn)}),hG=Qn=>()=>PR(Qn),mG=Qn=>({isDraggableModal:hG(Qn)}),km=Qn=>{const Zn=Ua(MR(Qn)?"bottom":"top");return{isPositionedAtTop:()=>Zn.get()==="top",getDockingMode:Zn.get,setDockingMode:Zn.set}},KP=Qn=>Su(Qn,"items"),ZF=Qn=>Su(Qn,"format"),JE=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],PU=Qn=>Pl(Qn,"items"),$U=Qn=>Pl(Qn,"block"),RU=Qn=>Pl(Qn,"inline"),DU=Qn=>Pl(Qn,"selector"),qF=Qn=>za(Qn,(Zn,Yn)=>{if(PU(Yn)){const Jn=qF(Yn.items);return{customFormats:Zn.customFormats.concat(Jn.customFormats),formats:Zn.formats.concat([{title:Yn.title,items:Jn.formats}])}}else if(RU(Yn)||$U(Yn)||DU(Yn)){const oo=`custom-${qn(Yn.name)?Yn.name:Yn.title.toLowerCase()}`;return{customFormats:Zn.customFormats.concat([{name:oo,format:Yn}]),formats:Zn.formats.concat([{title:Yn.title,format:oo,icon:Yn.icon}])}}else return{...Zn,formats:Zn.formats.concat(Yn)}},{customFormats:[],formats:[]}),MU=(Qn,Zn)=>{const Yn=qF(Zn),Jn=oo=>{Qs(oo,lo=>{Qn.formatter.has(lo.name)||Qn.formatter.register(lo.name,lo.format)})};return Qn.formatter?Jn(Yn.customFormats):Qn.on("init",()=>{Jn(Yn.customFormats)}),Yn.formats},jF=Qn=>B5(Qn).map(Zn=>{const Yn=MU(Qn,Zn);return F5(Qn)?JE.concat(Yn):Yn}).getOr(JE),NU=Qn=>{const Zn=nc(Qn);return Zn.length===1&&Fs(Zn,"title")},JM=(Qn,Zn,Yn)=>({...Qn,type:"formatter",isSelected:Zn(Qn.format),getStylePreview:Yn(Qn.format)}),eT=(Qn,Zn,Yn,Jn)=>{const oo=Co=>JM(Co,Yn,Jn),lo=Co=>{const Ro=yo(Co.items);return{...Co,type:"submenu",getStyleItems:Mo(Ro)}},mo=Co=>{const Ro=qn(Co.name)?Co.name:ba(Co.title),Lo=`custom-${Ro}`,Wo={...Co,type:"formatter",format:Lo,isSelected:Yn(Lo),getStylePreview:Jn(Lo)};return Qn.formatter.register(Ro,Wo),Wo},yo=Co=>hs(Co,Ro=>KP(Ro)?lo(Ro):ZF(Ro)?oo(Ro):NU(Ro)?{...Ro,type:"separator"}:mo(Ro));return yo(Zn)},LU=Qn=>{const Zn=yo=>()=>Qn.formatter.match(yo),Yn=yo=>()=>{const Co=Qn.formatter.get(yo);return Co!==void 0?ko.some({tag:Co.length>0&&(Co[0].inline||Co[0].block)||"div",styles:Qn.dom.parseStyle(Qn.formatter.getCssText(yo))}):ko.none()},Jn=Ua([]),oo=Ua([]),lo=Ua(!1);return Qn.on("PreInit",yo=>{const Co=jF(Qn),Ro=eT(Qn,Co,Zn,Yn);Jn.set(Ro)}),Qn.on("addStyleModifications",yo=>{const Co=eT(Qn,yo.items,Zn,Yn);oo.set(Co),lo.set(yo.replace)}),{getData:()=>{const yo=lo.get()?[]:Jn.get(),Co=oo.get();return yo.concat(Co)}}},XF=Qn=>Oo(Qn)&&Qn.nodeType===1,IU=xO.trim,e4=Qn=>Zn=>!!(XF(Zn)&&(Zn.contentEditable===Qn||Zn.getAttribute("data-mce-contenteditable")===Qn)),BU=e4("true"),FU=e4("false"),t4=(Qn,Zn,Yn,Jn,oo)=>({type:Qn,title:Zn,url:Yn,level:Jn,attach:oo}),pG=Qn=>{let Zn=Qn;for(;Zn=Zn.parentNode;){const Yn=Zn.contentEditable;if(Yn&&Yn!=="inherit")return BU(Zn)}return!1},gG=(Qn,Zn)=>hs(_f(Ds.fromDom(Zn),Qn),Yn=>Yn.dom),YF=Qn=>Qn.innerText||Qn.textContent,HU=Qn=>Qn.id?Qn.id:ba("h"),QU=Qn=>Qn&&Qn.nodeName==="A"&&(Qn.id||Qn.name)!==void 0,GF=Qn=>QU(Qn)&&KF(Qn),JP=Qn=>Qn&&/^(H[1-6])$/.test(Qn.nodeName),KF=Qn=>pG(Qn)&&!FU(Qn),VU=Qn=>JP(Qn)&&KF(Qn),JF=Qn=>JP(Qn)?parseInt(Qn.nodeName.substr(1),10):0,zU=Qn=>{var Zn;const Yn=HU(Qn),Jn=()=>{Qn.id=Yn};return t4("header",(Zn=YF(Qn))!==null&&Zn!==void 0?Zn:"","#"+Yn,JF(Qn),Jn)},WU=Qn=>{const Zn=Qn.id||Qn.name,Yn=YF(Qn);return t4("anchor",Yn||"#"+Zn,"#"+Zn,0,xo)},UU=Qn=>hs(ga(Qn,VU),zU),ZU=Qn=>hs(ga(Qn,GF),WU),n4=Qn=>gG("h1,h2,h3,h4,h5,h6,a:not([href])",Qn),e6=Qn=>IU(Qn.title).length>0,qU={find:Qn=>{const Zn=n4(Qn);return ga(UU(Zn).concat(ZU(Zn)),e6)}},e$="tinymce-url-history",t6=5,o4=Qn=>qn(Qn)&&/^https?/.test(Qn),jU=Qn=>to(Qn)&&Qn.length<=t6&&dr(Qn,o4),tT=Qn=>Xn(Qn)&&Al(Qn,Zn=>!jU(Zn)).isNone(),n6=()=>{const Qn=V_.getItem(e$);if(Qn===null)return{};let Zn;try{Zn=JSON.parse(Qn)}catch(Yn){if(Yn instanceof SyntaxError)return console.log("Local storage "+e$+" was not valid JSON",Yn),{};throw Yn}return tT(Zn)?Zn:(console.log("Local storage "+e$+" was not valid format",Zn),{})},t$=Qn=>{if(!tT(Qn))throw new Error(`Bad format for history: +`+JSON.stringify(Qn));V_.setItem(e$,JSON.stringify(Qn))},XU=Qn=>{const Zn=n6();return Rr(Zn,Qn).getOr([])},s4=(Qn,Zn)=>{if(!o4(Qn))return;const Yn=n6(),Jn=Rr(Yn,Zn).getOr([]),oo=ga(Jn,lo=>lo!==Qn);Yn[Zn]=[Qn].concat(oo).slice(0,t6),t$(Yn)},r2=Qn=>!!Qn,o6=Qn=>Vl(xO.makeMap(Qn,/[, ]/),r2),r4=Qn=>ko.from(W5(Qn)),s6=Qn=>{const Zn=ko.from(TR(Qn)).filter(r2).map(o6);return r4(Qn).fold(sr,Yn=>Zn.fold(Js,Jn=>nc(Jn).length>0?Jn:!1))},r6=(Qn,Zn)=>{const Yn=s6(Qn);return uo(Yn)?Yn?r4(Qn):ko.none():Yn[Zn]?r4(Qn):ko.none()},i6=(Qn,Zn)=>r6(Qn,Zn).map(Yn=>Jn=>Cm.nu(oo=>{const lo=(yo,Co)=>{if(!qn(yo))throw new Error("Expected value to be string");if(Co!==void 0&&!Xn(Co))throw new Error("Expected meta to be a object");oo({value:yo,meta:Co})},mo={filetype:Zn,fieldname:Jn.fieldname,...ko.from(Jn.meta).getOr({})};Yn.call(Qn,lo,Jn.value,mo)})),a6=Qn=>ko.from(Qn).filter(qn).getOrUndefined(),i4=Qn=>AR(Qn)?ko.some({targets:qU.find(Qn.getBody()),anchorTop:a6(MA(Qn)),anchorBottom:a6(Z5(Qn))}):ko.none(),n$=Qn=>ko.from(ER(Qn)),YU=Qn=>({getHistory:XU,addToHistory:s4,getLinkInformation:()=>i4(Qn),getValidationHandler:()=>n$(Qn),getUrlPicker:Zn=>i6(Qn,Zn)}),GU=(Qn,Zn,Yn,Jn)=>{const oo=Ua(!1),lo=km(Zn),mo={icons:()=>Zn.ui.registry.getAll().icons,menuItems:()=>Zn.ui.registry.getAll().menuItems,translate:_1.translate,isDisabled:()=>Zn.mode.isReadOnly()||!Zn.ui.isEnabled(),getOption:Zn.options.get},yo=YU(Zn),Co=LU(Zn),Ro=UF(Zn),Lo=mG(Zn),Wo=()=>oo.get(),jo=er=>oo.set(er),es={shared:{providers:mo,anchors:xU(Zn,Yn,Jn,lo.isPositionedAtTop),header:lo},urlinput:yo,styles:Co,colorinput:Ro,dialog:Lo,isContextMenuOpen:Wo,setContextMenuState:jo},us={...es,shared:{...es.shared,interpreter:er=>UE(er,{},us),getSink:Qn.popup}},Ps={...es,shared:{...es.shared,interpreter:er=>UE(er,{},Ps),getSink:Qn.dialog}};return{popup:us,dialog:Ps}},i2=(Qn,Zn,Yn)=>{const Jn=(Or,qr)=>{Qs([Zn,...Yn],na=>{na.broadcastEvent(Or,qr)})},oo=(Or,qr)=>{Qs([Zn,...Yn],na=>{na.broadcastOn([Or],qr)})},lo=Or=>oo(db(),{target:Or.target}),mo=Op(),yo=Dh(mo,"touchstart",lo),Co=Dh(mo,"touchmove",Or=>Jn(Ah(),Or)),Ro=Dh(mo,"touchend",Or=>Jn(kp(),Or)),Lo=Dh(mo,"mousedown",lo),Wo=Dh(mo,"mouseup",Or=>{Or.raw.button===0&&oo(wx(),{target:Or.target})}),jo=Or=>oo(db(),{target:Ds.fromDom(Or.target)}),es=Or=>{Or.button===0&&oo(wx(),{target:Ds.fromDom(Or.target)})},us=()=>{Qs(Qn.editorManager.get(),Or=>{Qn!==Or&&Or.dispatch("DismissPopups",{relatedTarget:Qn})})},Ps=Or=>Jn(s1(),th(Or)),er=Or=>{oo(uO(),{}),Jn(Ig(),th(Or))},Bs=rr(Ds.fromDom(Qn.getElement())),Ns=a_(Bs,"scroll",Or=>{requestAnimationFrame(()=>{const qr=Qn.getContainer();if(qr!=null){const Dl=W_(Qn,Zn.element).map(Sa=>[Sa.element,...Sa.others]).getOr([]);Br(Dl,Sa=>Oc(Sa,Or.target))&&(Qn.dispatch("ElementScroll",{target:Or.target.dom}),Jn(j1(),Or))}})}),Xs=()=>oo(uO(),{}),Hr=Or=>{Or.state&&oo(db(),{target:Ds.fromDom(Qn.getContainer())})},kr=Or=>{oo(db(),{target:Ds.fromDom(Or.relatedTarget.getContainer())})};Qn.on("PostRender",()=>{Qn.on("click",jo),Qn.on("tap",jo),Qn.on("mouseup",es),Qn.on("mousedown",us),Qn.on("ScrollWindow",Ps),Qn.on("ResizeWindow",er),Qn.on("ResizeEditor",Xs),Qn.on("AfterProgressState",Hr),Qn.on("DismissPopups",kr)}),Qn.on("remove",()=>{Qn.off("click",jo),Qn.off("tap",jo),Qn.off("mouseup",es),Qn.off("mousedown",us),Qn.off("ScrollWindow",Ps),Qn.off("ResizeWindow",er),Qn.off("ResizeEditor",Xs),Qn.off("AfterProgressState",Hr),Qn.off("DismissPopups",kr),Lo.unbind(),yo.unbind(),Co.unbind(),Ro.unbind(),Wo.unbind(),Ns.unbind()}),Qn.on("detach",()=>{Qs([Zn,...Yn],w_),Qs([Zn,...Yn],Or=>Or.destroy())})},rh=E3,Ty=XT,l6=Mo([Gs("shell",!1),Er("makeItem"),Gs("setupItem",xo),Wg.field("listBehaviours",[Cl])]),a4=up({name:"items",overrides:()=>({behaviours:Zr([Cl.config({})])})}),KU=Mo([a4]),JU=Mo("CustomList"),eZ=(Qn,Zn,Yn,Jn)=>{const oo=(yo,Co)=>{mo(yo).fold(()=>{throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},Ro=>{const Lo=Cl.contents(Ro),Wo=Co.length,jo=Wo-Lo.length,es=jo>0?_r(jo,()=>Qn.makeItem()):[],us=Lo.slice(Wo);Qs(us,er=>Cl.remove(Ro,er)),Qs(es,er=>Cl.append(Ro,er));const Ps=Cl.contents(Ro);Qs(Ps,(er,Bs)=>{Qn.setupItem(yo,er,Co[Bs],Bs)})})},lo=Qn.shell?{behaviours:[Cl.config({})],components:[]}:{behaviours:[],components:Zn},mo=yo=>Qn.shell?ko.some(yo):Au(yo,Qn,"items");return{uid:Qn.uid,dom:Qn.dom,components:lo.components,behaviours:sf(Qn.listBehaviours,lo.behaviours),apis:{setItems:oo}}},o$=Yh({name:JU(),configFields:l6(),partFields:KU(),factory:eZ,apis:{setItems:(Qn,Zn,Yn)=>{Qn.setItems(Zn,Yn)}}}),a2=Mo([Er("dom"),Gs("shell",!0),Nf("toolbarBehaviours",[Cl])]),tZ=Mo([up({name:"groups",overrides:()=>({behaviours:Zr([Cl.config({})])})})]),nZ=(Qn,Zn,Yn,Jn)=>{const oo=(yo,Co)=>{lo(yo).fold(()=>{throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},Ro=>{Cl.set(Ro,Co)})},lo=yo=>Qn.shell?ko.some(yo):Au(yo,Qn,"groups"),mo=Qn.shell?{behaviours:[Cl.config({})],components:[]}:{behaviours:[],components:Zn};return{uid:Qn.uid,dom:Qn.dom,components:mo.components,behaviours:sf(Qn.toolbarBehaviours,mo.behaviours),apis:{setGroups:oo,refresh:xo},domModification:{attributes:{role:"group"}}}},cv=Yh({name:"Toolbar",configFields:a2(),partFields:tZ(),factory:nZ,apis:{setGroups:(Qn,Zn,Yn)=>{Qn.setGroups(Zn,Yn)}}}),oZ=xo,sZ=sr,l4=Mo([]);var rZ=Object.freeze({__proto__:null,setup:oZ,isDocked:sZ,getBehaviours:l4});const qw=Qn=>(vs(ku(Qn,"position"),"fixed")?ko.none():ch(Qn)).orThunk(()=>{const Jn=Ds.fromTag("span");return Zd(Qn).bind(oo=>{Id(oo,Jn);const lo=ch(Jn);return am(Jn),lo})}),u6=Qn=>qw(Qn).map(uh).getOrThunk(()=>vc(0,0)),iZ=(Qn,Zn)=>{const Yn=Qn.element;$d(Yn,Zn.transitionClass),Yu(Yn,Zn.fadeOutClass),$d(Yn,Zn.fadeInClass),Zn.onShow(Qn)},c4=(Qn,Zn)=>{const Yn=Qn.element;$d(Yn,Zn.transitionClass),Yu(Yn,Zn.fadeInClass),$d(Yn,Zn.fadeOutClass),Zn.onHide(Qn)},d6=(Qn,Zn)=>Qn.yZn.y,f6=(Qn,Zn)=>Qn.y>=Zn.y,h6=(Qn,Zn)=>Qn.bottom<=Zn.bottom,u4=(Qn,Zn,Yn)=>({location:"top",leftX:Zn,topY:Yn.bounds.y-Qn.y}),d4=(Qn,Zn,Yn)=>({location:"bottom",leftX:Zn,bottomY:Qn.bottom-Yn.bounds.bottom}),f4=Qn=>Qn.box.x-Qn.win.x,aZ=(Qn,Zn,Yn)=>{const Jn=Zn.win,oo=Zn.box,lo=f4(Zn);return gc(Qn,mo=>{switch(mo){case"bottom":return h6(oo,Yn.bounds)?ko.none():ko.some(d4(Jn,lo,Yn));case"top":return f6(oo,Yn.bounds)?ko.none():ko.some(u4(Jn,lo,Yn));default:return ko.none()}}).getOr({location:"no-dock"})},lZ=(Qn,Zn,Yn)=>dr(Qn,Jn=>{switch(Jn){case"bottom":return h6(Zn,Yn.bounds);case"top":return f6(Zn,Yn.bounds)}}),cZ=(Qn,Zn)=>{const Yn=Zn.optScrollEnv.fold(Mo(Qn.bounds.y),Jn=>Jn.scrollElmTop+(Qn.bounds.y-Jn.currentScrollTop));return vc(Qn.bounds.x,Yn)},uZ=(Qn,Zn)=>{const Yn=Zn.optScrollEnv.fold(Mo(Qn.y),Jn=>Qn.y+Jn.currentScrollTop-Jn.scrollElmTop);return vc(Qn.x,Yn)},m6=(Qn,Zn,Yn)=>Yn.getInitialPos().map(Jn=>{const oo=cZ(Jn,Zn);return{box:Kc(oo.left,oo.top,dd(Qn),cu(Qn)),location:Jn.location}}),p6=(Qn,Zn,Yn,Jn,oo)=>{const lo=uZ(Zn,Yn),mo=Kc(lo.left,lo.top,Zn.width,Zn.height);Jn.setInitialPos({style:jc(Qn),position:qc(Qn,"position")||"static",bounds:mo,location:oo.location})},g6=(Qn,Zn,Yn,Jn,oo)=>{Jn.getInitialPos().fold(()=>p6(Qn,Zn,Yn,Jn,oo),()=>xo)},h4=(Qn,Zn,Yn)=>Yn.getInitialPos().bind(Jn=>{var oo;switch(Yn.clearInitialPos(),Jn.position){case"static":return ko.some({morph:"static"});case"absolute":const lo=qw(Qn).getOr(Ru()),mo=au(lo),yo=(oo=lo.dom.scrollTop)!==null&&oo!==void 0?oo:0;return ko.some({morph:"absolute",positionCss:ip("absolute",Rr(Jn.style,"left").map(Co=>Zn.x-mo.x),Rr(Jn.style,"top").map(Co=>Zn.y-mo.y+yo),Rr(Jn.style,"right").map(Co=>mo.right-Zn.right),Rr(Jn.style,"bottom").map(Co=>mo.bottom-Zn.bottom))});default:return ko.none()}}),s$=(Qn,Zn,Yn)=>m6(Qn,Zn,Yn).filter(({box:Jn})=>lZ(Yn.getModes(),Jn,Zn)).bind(({box:Jn})=>h4(Qn,Jn,Yn)),r$=Qn=>{switch(Qn.location){case"top":return ko.some({morph:"fixed",positionCss:ip("fixed",ko.some(Qn.leftX),ko.some(Qn.topY),ko.none(),ko.none())});case"bottom":return ko.some({morph:"fixed",positionCss:ip("fixed",ko.some(Qn.leftX),ko.none(),ko.none(),ko.some(Qn.bottomY))});default:return ko.none()}},dZ=(Qn,Zn,Yn)=>{const Jn=au(Qn),oo=tf(),lo=aZ(Yn.getModes(),{win:oo,box:Jn},Zn);return lo.location==="top"||lo.location==="bottom"?(p6(Qn,Jn,Zn,Yn,lo),r$(lo)):ko.none()},fZ=(Qn,Zn,Yn)=>s$(Qn,Zn,Yn).orThunk(()=>Zn.optScrollEnv.bind(Jn=>m6(Qn,Zn,Yn)).bind(({box:Jn,location:oo})=>{const lo=tf(),mo=f4({win:lo,box:Jn}),yo=oo==="top"?u4(lo,mo,Zn):d4(lo,mo,Zn);return r$(yo)})),hZ=(Qn,Zn,Yn)=>{const Jn=Qn.element;return vs(ku(Jn,"position"),"fixed")?fZ(Jn,Zn,Yn):dZ(Jn,Zn,Yn)},mZ=(Qn,Zn,Yn)=>{const Jn=Qn.element;return m6(Jn,Zn,Yn).bind(({box:oo})=>h4(Jn,oo,Yn))},pZ=(Qn,Zn,Yn,Jn)=>{const oo=au(Qn),lo=tf(),mo=f4({win:lo,box:oo}),yo=Jn(lo,mo,Zn);return yo.location==="bottom"||yo.location==="top"?(g6(Qn,oo,Zn,Yn,yo),r$(yo)):ko.none()},b6=(Qn,Zn,Yn)=>{Yn.setDocked(!1),Qs(["left","right","top","bottom","position"],Jn=>El(Qn.element,Jn)),Zn.onUndocked(Qn)},m4=(Qn,Zn,Yn,Jn)=>{const oo=Jn.position==="fixed";Yn.setDocked(oo),m1(Qn.element,Jn),(oo?Zn.onDocked:Zn.onUndocked)(Qn)},p4=(Qn,Zn,Yn,Jn,oo=!1)=>{Zn.contextual.each(lo=>{lo.lazyContext(Qn).each(mo=>{const yo=d6(mo,Jn.bounds);yo!==Yn.isVisible()&&(Yn.setVisible(yo),oo&&!yo?(od(Qn.element,[lo.fadeOutClass]),lo.onHide(Qn)):(yo?iZ:c4)(Qn,lo))})})},g4=(Qn,Zn,Yn,Jn,oo)=>{p4(Qn,Zn,Yn,Jn,!0),m4(Qn,Zn,Yn,oo.positionCss)},gZ=(Qn,Zn,Yn,Jn,oo)=>{switch(oo.morph){case"static":return b6(Qn,Zn,Yn);case"absolute":return m4(Qn,Zn,Yn,oo.positionCss);case"fixed":return g4(Qn,Zn,Yn,Jn,oo)}},v6=(Qn,Zn,Yn)=>{const Jn=Zn.lazyViewport(Qn);p4(Qn,Zn,Yn,Jn),hZ(Qn,Jn,Yn).each(oo=>{gZ(Qn,Zn,Yn,Jn,oo)})},bZ=(Qn,Zn,Yn)=>{const Jn=Qn.element;Yn.setDocked(!1);const oo=Zn.lazyViewport(Qn);mZ(Qn,oo,Yn).each(lo=>{switch(lo.morph){case"static":{b6(Qn,Zn,Yn);break}case"absolute":{m4(Qn,Zn,Yn,lo.positionCss);break}}}),Yn.setVisible(!0),Zn.contextual.each(lo=>{sp(Jn,[lo.fadeInClass,lo.fadeOutClass,lo.transitionClass]),lo.onShow(Qn)}),i$(Qn,Zn,Yn)},i$=(Qn,Zn,Yn)=>{Qn.getSystem().isConnected()&&v6(Qn,Zn,Yn)},y6=(Qn,Zn,Yn)=>{Yn.isDocked()&&bZ(Qn,Zn,Yn)},J_=Qn=>(Zn,Yn,Jn)=>{const oo=Yn.lazyViewport(Zn);pZ(Zn.element,oo,Jn,Qn).each(mo=>{g4(Zn,Yn,Jn,oo,mo)})},O6=J_(u4),nT=J_(d4);var _6=Object.freeze({__proto__:null,refresh:i$,reset:y6,isDocked:(Qn,Zn,Yn)=>Yn.isDocked(),getModes:(Qn,Zn,Yn)=>Yn.getModes(),setModes:(Qn,Zn,Yn,Jn)=>Yn.setModes(Jn),forceDockToTop:O6,forceDockToBottom:nT}),OZ=Object.freeze({__proto__:null,events:(Qn,Zn)=>Jc([rg(V1(),(Yn,Jn)=>{Qn.contextual.each(oo=>{of(Yn.element,oo.transitionClass)&&(sp(Yn.element,[oo.transitionClass,oo.fadeInClass]),(Zn.isVisible()?oo.onShown:oo.onHidden)(Yn)),Jn.stop()})}),wr(s1(),(Yn,Jn)=>{i$(Yn,Qn,Zn)}),wr(j1(),(Yn,Jn)=>{i$(Yn,Qn,Zn)}),wr(Ig(),(Yn,Jn)=>{y6(Yn,Qn,Zn)})])}),_Z=[hh("contextual",[hc("fadeInClass"),hc("fadeOutClass"),hc("transitionClass"),ep("lazyContext"),rc("onShow"),rc("onShown"),rc("onHide"),rc("onHidden")]),Hd("lazyViewport",()=>({bounds:tf(),optScrollEnv:ko.none()})),Th("modes",["top","bottom"],nf),rc("onDocked"),rc("onUndocked")],SZ=Object.freeze({__proto__:null,init:Qn=>{const Zn=Ua(!1),Yn=Ua(!0),Jn=Hl(),oo=Ua(Qn.modes),lo=()=>`docked: ${Zn.get()}, visible: ${Yn.get()}, modes: ${oo.get().join(",")}`;return ph({isDocked:Zn.get,setDocked:Zn.set,getInitialPos:Jn.get,setInitialPos:Jn.set,clearInitialPos:Jn.clear,isVisible:Yn.get,setVisible:Yn.set,getModes:oo.get,setModes:oo.set,readState:lo})}});const rf=Of({fields:_Z,name:"docking",active:OZ,apis:_6,state:SZ}),eS=Mo(ba("toolbar-height-change")),x1={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},a$="tox-tinymce--toolbar-sticky-on",S6="tox-tinymce--toolbar-sticky-off",wZ=(Qn,Zn)=>{const Yn=vd(Zn),oo=Sh(Zn).dom.innerHeight,lo=Af(Yn),mo=Ds.fromDom(Qn.elm),yo=cf(mo),Co=cu(mo),Ro=yo.y,Lo=Ro+Co,Wo=uh(Zn),jo=cu(Zn),es=Wo.top,us=es+jo,Ps=Math.abs(es-lo.top)<2,er=Math.abs(us-(lo.top+oo))<2;if(Ps&&Roes){const Bs=Ro-oo+Co+jo;e1(lo.left,Bs,Yn)}},l2=(Qn,Zn)=>Fs(rf.getModes(Qn),Zn),y4=Qn=>{const Zn=Jn=>Vp(Jn)+(parseInt(qc(Jn,"margin-top"),10)||0)+(parseInt(qc(Jn,"margin-bottom"),10)||0),Yn=Qn.element;lh(Yn).each(Jn=>{const oo="padding-"+rf.getModes(Qn)[0];if(rf.isDocked(Qn)){const lo=dd(Jn);ya(Yn,"width",lo+"px"),ya(Jn,oo,Zn(Yn)+"px")}else El(Yn,"width"),El(Jn,oo)})},c2=(Qn,Zn)=>{Zn?(Yu(Qn,x1.fadeOutClass),od(Qn,[x1.transitionClass,x1.fadeInClass])):(Yu(Qn,x1.fadeInClass),od(Qn,[x1.fadeOutClass,x1.transitionClass]))},O4=(Qn,Zn)=>{const Yn=Ds.fromDom(Qn.getContainer());Zn?($d(Yn,a$),Yu(Yn,S6)):($d(Yn,S6),Yu(Yn,a$))},CZ=(Qn,Zn)=>{const Yn=vd(Zn);h1(Yn).filter(Jn=>!Oc(Zn,Jn)).filter(Jn=>Oc(Jn,Ds.fromDom(Yn.dom.body))||cd(Qn,Jn)).each(()=>Cd(Zn))},kZ=(Qn,Zn)=>dg(Qn).orThunk(()=>Zn().toOptional().bind(Yn=>dg(Yn.element))),xZ=(Qn,Zn,Yn)=>{Qn.inline||(Zn.header.isPositionedAtTop()||Qn.on("ResizeEditor",()=>{Yn().each(rf.reset)}),Qn.on("ResizeWindow ResizeEditor",()=>{Yn().each(y4)}),Qn.on("SkinLoaded",()=>{Yn().each(Jn=>{rf.isDocked(Jn)?rf.reset(Jn):rf.refresh(Jn)})}),Qn.on("FullscreenStateChanged",()=>{Yn().each(rf.reset)})),Qn.on("AfterScrollIntoView",Jn=>{Yn().each(oo=>{rf.refresh(oo);const lo=oo.element;Ok(lo)&&wZ(Jn,lo)})}),Qn.on("PostRender",()=>{O4(Qn,!1)})},EZ=Qn=>Qn().map(rf.isDocked).getOr(!1),TZ=()=>[Om.config({channels:{[eS()]:{onReceive:y4}}})],w6=(Qn,Zn)=>{const Yn=Hl(),Jn=Zn.getSink,oo=yo=>{Jn().each(Co=>yo(Co.element))},lo=yo=>{Qn.inline||y4(yo),O4(Qn,rf.isDocked(yo)),yo.getSystem().broadcastOn([uO()],{}),Jn().each(Co=>Co.getSystem().broadcastOn([uO()],{}))},mo=Qn.inline?[]:TZ();return[ol.config({}),rf.config({contextual:{lazyContext:yo=>{const Co=Vp(yo.element),Ro=Qn.inline?Qn.getContentAreaContainer():Qn.getContainer();return ko.from(Ro).map(Lo=>{const Wo=au(Ds.fromDom(Lo));return W_(Qn,yo.element).fold(()=>{const es=Wo.height-Co,us=Wo.y+(l2(yo,"top")?0:Co);return Kc(Wo.x,us,Wo.width,es)},es=>{const us=O0(Wo,Wk(es)),Ps=l2(yo,"top")?us.y:us.y+Co;return Kc(us.x,Ps,us.width,us.height-Co)})})},onShow:()=>{oo(yo=>c2(yo,!0))},onShown:yo=>{oo(Co=>sp(Co,[x1.transitionClass,x1.fadeInClass])),Yn.get().each(Co=>{CZ(yo.element,Co),Yn.clear()})},onHide:yo=>{kZ(yo.element,Jn).fold(Yn.clear,Yn.set),oo(Co=>c2(Co,!1))},onHidden:()=>{oo(yo=>sp(yo,[x1.transitionClass]))},...x1},lazyViewport:yo=>W_(Qn,yo.element).fold(()=>{const Ro=tf(),Lo=RA(Qn),Wo=Ro.y+(l2(yo,"top")?Lo:0),jo=Ro.height-(l2(yo,"bottom")?Lo:0);return{bounds:Kc(Ro.x,Wo,Ro.width,jo),optScrollEnv:ko.none()}},Ro=>({bounds:Wk(Ro),optScrollEnv:ko.some({currentScrollTop:Ro.element.dom.scrollTop,scrollElmTop:uh(Ro.element).top})})),modes:[Zn.header.getDockingMode()],onDocked:lo,onUndocked:lo}),...mo]};var C6=Object.freeze({__proto__:null,setup:xZ,isDocked:EZ,getBehaviours:w6});const k6=Qn=>{const Zn=Qn.editor,Yn=Qn.sticky?w6:l4;return{uid:Qn.uid,dom:Qn.dom,components:Qn.components,behaviours:Zr(Yn(Zn,Qn.sharedBackstage))}},_4=Ta([wf,Kf("items",Oa([Yp([KR,Pf("items",nf)]),nf]))].concat(Bk)),AZ=Qn=>Lu("GroupToolbarButton",_4,Qn),l$=[$f("text"),$f("tooltip"),$f("icon"),xh("search",!1,Oa([Jm,Ta([$f("placeholder")])],Qn=>uo(Qn)?Qn?ko.some({placeholder:ko.none()}):ko.none():ko.some(Qn))),ep("fetch"),Hd("onSetup",()=>xo)],oT=Ta([wf,...l$]),S4=Qn=>Lu("menubutton",oT,Qn),PZ=Ta([wf,mE,S1,yy,tD,bL,F_,Eh("presets","normal",["normal","color","listpreview"]),OL(1),Lk,tQ]),$Z=Qn=>Lu("SplitButton",PZ,Qn);var w4=Mp({factory:(Qn,Zn)=>{const Yn=(oo,lo)=>{const mo=hs(lo,yo=>{const Co={type:"menubutton",text:yo.text,fetch:Lo=>{Lo(yo.getItems())}},Ro=S4(Co).mapError(Lo=>Gf(Lo)).getOrDie();return zE(Ro,"tox-mbtn",Zn.backstage,ko.some("menuitem"))});Cl.set(oo,mo)},Jn={focus:Za.focusIn,setMenus:Yn};return{uid:Qn.uid,dom:Qn.dom,components:[],behaviours:Zr([Cl.config({}),Rl("menubar-events",[eu(oo=>{Qn.onSetup(oo)}),wr(eg(),(oo,lo)=>{Rd(oo.element,".tox-mbtn--active").each(mo=>{Bg(lo.event.target,".tox-mbtn").each(yo=>{Oc(mo,yo)||oo.getSystem().getByDom(mo).each(Co=>{oo.getSystem().getByDom(yo).each(Ro=>{vb.expand(Ro),vb.close(Co),ol.focus(Ro)})})})})}),wr(MO(),(oo,lo)=>{lo.event.prevFocus.bind(mo=>oo.getSystem().getByDom(mo).toOptional()).each(mo=>{lo.event.newFocus.bind(yo=>oo.getSystem().getByDom(yo).toOptional()).each(yo=>{vb.isOpen(mo)&&(vb.expand(yo),vb.close(mo))})})})]),Za.config({mode:"flow",selector:".tox-mbtn",onEscape:oo=>(Qn.onEscape(oo),ko.some(!0))}),sd.config({})]),apis:Jn,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Er("dom"),Er("uid"),Er("onEscape"),Er("backstage"),Gs("onSetup",xo)],apis:{focus:(Qn,Zn)=>{Qn.focus(Zn)},setMenus:(Qn,Zn,Yn)=>{Qn.setMenus(Zn,Yn)}}});const C4="⚡️Upgrade",k4="https://www.tiny.cloud/tinymce-self-hosted-premium-features/?utm_campaign=self_hosted_upgrade_promo&utm_source=tiny&utm_medium=referral",RZ=Qn=>({uid:Qn.uid,dom:Qn.dom,components:[{dom:{tag:"a",attributes:{href:k4,rel:"noopener",target:"_blank","aria-hidden":"true"},classes:["tox-promotion-link"],innerHtml:C4}}]}),c$="container",DZ=[Nf("slotBehaviours",[])],x6=Qn=>"",MZ=Qn=>{const Zn=(()=>{const lo=[];return{slot:(yo,Co)=>(lo.push(yo),Px(c$,x6(yo),Co)),record:Mo(lo)}})(),Yn=Qn(Zn),Jn=Zn.record(),oo=hs(Jn,lo=>Xh({name:lo,pname:x6(lo)}));return Ix(c$,DZ,oo,NZ,Yn)},NZ=(Qn,Zn)=>{const Yn=Ps=>Dx(Qn),Jn=(Ps,er)=>Au(Ps,Qn,er),oo=(Ps,er)=>(Bs,Ns)=>Au(Bs,Qn,Ns).map(Xs=>Ps(Xs,Ns)).getOr(er),lo=Ps=>(er,Bs)=>{Qs(Bs,Ns=>Ps(er,Ns))},mo=(Ps,er)=>Bu(Ps.element,"aria-hidden")!=="true",yo=(Ps,er)=>{if(!mo(Ps)){const Bs=Ps.element;El(Bs,"display"),_s(Bs,"aria-hidden"),Qa(Ps,kv(),{name:er,visible:!0})}},Co=(Ps,er)=>{if(mo(Ps)){const Bs=Ps.element;ya(Bs,"display","none"),aa(Bs,"aria-hidden","true"),Qa(Ps,kv(),{name:er,visible:!1})}},Ro=oo(mo,!1),Lo=oo(Co),Wo=lo(Lo),jo=Ps=>Wo(Ps,Yn()),es=oo(yo),us={getSlotNames:Yn,getSlot:Jn,isShowing:Ro,hideSlot:Lo,hideAllSlots:jo,showSlot:es};return{uid:Qn.uid,dom:Qn.dom,components:Zn,behaviours:j0(Qn.slotBehaviours),apis:us}},pp={...Vl({getSlotNames:(Qn,Zn)=>Qn.getSlotNames(Zn),getSlot:(Qn,Zn,Yn)=>Qn.getSlot(Zn,Yn),isShowing:(Qn,Zn,Yn)=>Qn.isShowing(Zn,Yn),hideSlot:(Qn,Zn,Yn)=>Qn.hideSlot(Zn,Yn),hideAllSlots:(Qn,Zn)=>Qn.hideAllSlots(Zn),showSlot:(Qn,Zn,Yn)=>Qn.showSlot(Zn,Yn)},Qn=>eb(Qn)),sketch:MZ},SG=Ta([S1,mE,Hd("onShow",xo),Hd("onHide",xo),F_]),E6=Qn=>Lu("sidebar",SG,Qn),LZ=Qn=>{const{sidebars:Zn}=Qn.ui.registry.getAll();Qs(nc(Zn),Yn=>{const Jn=Zn[Yn],oo=()=>vs(ko.from(Qn.queryCommandValue("ToggleSidebar")),Yn);Qn.ui.registry.addToggleButton(Yn,{icon:Jn.icon,tooltip:Jn.tooltip,onAction:lo=>{Qn.execCommand("ToggleSidebar",!1,Yn),lo.setActive(oo())},onSetup:lo=>{lo.setActive(oo());const mo=()=>lo.setActive(oo());return Qn.on("ToggleSidebar",mo),()=>{Qn.off("ToggleSidebar",mo)}}})})},T6=Qn=>({element:()=>Qn.element.dom}),IZ=(Qn,Zn)=>{const Yn=hs(nc(Zn),Jn=>{const oo=Zn[Jn],lo=Ec(E6(oo));return{name:Jn,getApi:T6,onSetup:lo.onSetup,onShow:lo.onShow,onHide:lo.onHide}});return hs(Yn,Jn=>{const oo=Ua(xo);return Qn.slot(Jn.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:bE.unnamedEvents([H_(Jn,oo),_y(Jn,oo),wr(kv(),(lo,mo)=>{const yo=mo.event;Zs(Yn,Ro=>Ro.name===yo.name).each(Ro=>{(yo.visible?Ro.onShow:Ro.onHide)(Ro.getApi(lo))})})])})})},BZ=Qn=>pp.sketch(Zn=>({dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:IZ(Zn,Qn),slotBehaviours:bE.unnamedEvents([eu(Yn=>pp.hideAllSlots(Yn))])})),FZ=(Qn,Zn,Yn)=>{ic.getCurrent(Qn).each(oo=>{Cl.set(oo,[BZ(Zn)]);const lo=Yn==null?void 0:Yn.toLowerCase();qn(lo)&&Pl(Zn,lo)&&ic.getCurrent(oo).each(mo=>{pp.showSlot(mo,lo),jg.immediateGrow(oo),El(oo.element,"width"),u$(Qn.element,"region")})})},u$=(Qn,Zn)=>{aa(Qn,"role",Zn)},HZ=(Qn,Zn)=>{ic.getCurrent(Qn).each(Jn=>{ic.getCurrent(Jn).each(lo=>{jg.hasGrown(Jn)?pp.isShowing(lo,Zn)?(jg.shrink(Jn),u$(Qn.element,"presentation")):(pp.hideAllSlots(lo),pp.showSlot(lo,Zn),u$(Qn.element,"region")):(pp.hideAllSlots(lo),pp.showSlot(lo,Zn),jg.grow(Jn),u$(Qn.element,"region"))})})},A6=Qn=>ic.getCurrent(Qn).bind(Yn=>jg.isGrowing(Yn)||jg.hasGrown(Yn)?ic.getCurrent(Yn).bind(lo=>Zs(pp.getSlotNames(lo),mo=>pp.isShowing(lo,mo))):ko.none()),x4=ba("FixSizeEvent"),E4=ba("AutoSizeEvent"),QZ=Qn=>({uid:Qn.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"presentation"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:Zr([sd.config({}),ol.config({}),jg.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:Zn=>{ic.getCurrent(Zn).each(pp.hideAllSlots),Wl(Zn,E4)},onGrown:Zn=>{Wl(Zn,E4)},onStartGrow:Zn=>{Qa(Zn,x4,{width:ku(Zn.element,"width").getOr("")})},onStartShrink:Zn=>{Qa(Zn,x4,{width:dd(Zn.element)+"px"})}}),Cl.config({}),ic.config({find:Zn=>{const Yn=Cl.contents(Zn);return Nl(Yn)}})])}],behaviours:Zr([Og.childAt(0),Rl("sidebar-sliding-events",[wr(x4,(Zn,Yn)=>{ya(Zn.element,"width",Yn.event.width)}),wr(E4,(Zn,Yn)=>{El(Zn.element,"width")})])])});var P6=Object.freeze({__proto__:null,block:(Qn,Zn,Yn,Jn)=>{aa(Qn.element,"aria-busy",!0);const oo=Zn.getRoot(Qn).getOr(Qn),lo=Zr([Za.config({mode:"special",onTab:()=>ko.some(!0),onShiftTab:()=>ko.some(!0)}),ol.config({})]),mo=Jn(oo,lo),yo=oo.getSystem().build(mo);Cl.append(oo,Fm(yo)),yo.hasConfigured(Za)&&Zn.focus&&Za.focusIn(yo),Yn.isBlocked()||Zn.onBlock(Qn),Yn.blockWith(()=>Cl.remove(oo,yo))},unblock:(Qn,Zn,Yn)=>{_s(Qn.element,"aria-busy"),Yn.isBlocked()&&Zn.onUnblock(Qn),Yn.clear()},isBlocked:(Qn,Zn,Yn)=>Yn.isBlocked()}),zZ=[Hd("getRoot",ko.none),Xd("focus",!0),rc("onBlock"),rc("onUnblock")],E1=Object.freeze({__proto__:null,init:()=>{const Qn=zS(),Zn=Yn=>{Qn.set({destroy:Yn})};return ph({readState:Qn.isSet,blockWith:Zn,clear:Qn.clear,isBlocked:Qn.isSet})}});const uv=Of({fields:zZ,name:"blocking",apis:P6,state:E1}),$6=Qn=>(Zn,Yn)=>({dom:{tag:"div",attributes:{"aria-label":Qn.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:vO('
    ')}]}),T4=Qn=>ic.getCurrent(Qn).each(Zn=>Cd(Zn.element,!0)),WZ=(Qn,Zn)=>{const Yn="tabindex",Jn=`data-mce-${Yn}`;ko.from(Qn.iframeElement).map(Ds.fromDom).each(oo=>{Zn?(Uo(oo,Yn).each(lo=>aa(oo,Jn,lo)),aa(oo,Yn,-1)):(_s(oo,Yn),Uo(oo,Jn).each(lo=>{aa(oo,Yn,lo),_s(oo,Jn)}))})},sT=(Qn,Zn,Yn,Jn)=>{const oo=Zn.element;if(WZ(Qn,Yn),Yn)uv.block(Zn,$6(Jn)),El(oo,"display"),_s(oo,"aria-hidden"),Qn.hasFocus()&&T4(Zn);else{const lo=ic.getCurrent(Zn).exists(mo=>tO(mo.element));uv.unblock(Zn),ya(oo,"display","none"),aa(oo,"aria-hidden","true"),lo&&Qn.focus()}},UZ=Qn=>({uid:Qn.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:Zr([Cl.config({}),uv.config({focus:!1}),ic.config({find:Zn=>Nl(Zn.components())})]),components:[]}),d$=Qn=>Qn.type==="focusin",ZZ=Qn=>d$(Qn)?(Qn.composed?Nl(Qn.composedPath()):ko.from(Qn.target)).map(Ds.fromDom).filter(fc).exists(Yn=>of(Yn,"mce-pastebin")):!1,f$=(Qn,Zn,Yn)=>{const Jn=Ua(!1),oo=Hl(),lo=yo=>{Jn.get()&&!ZZ(yo)&&(yo.preventDefault(),T4(Zn()),Qn.editorManager.setActive(Qn))};Qn.inline||Qn.on("PreInit",()=>{Qn.dom.bind(Qn.getWin(),"focusin",lo),Qn.on("BeforeExecCommand",yo=>{yo.command.toLowerCase()==="mcefocus"&&yo.value!==!0&&lo(yo)})});const mo=yo=>{yo!==Jn.get()&&(Jn.set(yo),sT(Qn,Zn(),yo,Yn.providers),lI(Qn,yo))};Qn.on("ProgressState",yo=>{if(oo.on(clearTimeout),$o(yo.time)){const Co=$w.setEditorTimeout(Qn,()=>mo(yo.state),yo.time);oo.set(Co)}else mo(yo.state),oo.clear()})},qZ=(Qn,Zn)=>za(Qn,(oo,lo)=>Zn(lo,oo.len).fold(Mo(oo),yo=>({len:yo.finish,list:oo.list.concat([yo])})),{len:0,list:[]}).list,A4=(Qn,Zn,Yn)=>({within:Qn,extra:Zn,withinWidth:Yn}),T1=(Qn,Zn,Yn)=>{const Jn=qZ(Qn,(yo,Co)=>{const Ro=Yn(yo);return ko.some({element:yo,start:Co,finish:Co+Ro,width:Ro})}),oo=ga(Jn,yo=>yo.finish<=Zn),lo=Ca(oo,(yo,Co)=>yo+Co.width,0),mo=Jn.slice(oo.length);return{within:oo,extra:mo,withinWidth:lo}},h$=Qn=>hs(Qn,Zn=>Zn.element),m$=(Qn,Zn,Yn)=>{const Jn=h$(Qn.concat(Zn));return A4(Jn,[],Yn)},R6=(Qn,Zn,Yn,Jn)=>{const oo=h$(Qn).concat([Yn]);return A4(oo,h$(Zn),Jn)},D6=(Qn,Zn,Yn)=>A4(h$(Qn),[],Yn),jZ=(Qn,Zn,Yn)=>{const Jn=T1(Zn,Qn,Yn);return Jn.extra.length===0?ko.some(Jn):ko.none()},M6=(Qn,Zn,Yn,Jn)=>{const oo=jZ(Qn,Zn,Yn).getOrThunk(()=>T1(Zn,Qn-Yn(Jn),Yn)),lo=oo.within,mo=oo.extra,yo=oo.withinWidth;return mo.length===1&&mo[0].width<=Yn(Jn)?m$(lo,mo,yo):mo.length>=1?R6(lo,mo,Jn,yo):D6(lo,mo,yo)},N6=(Qn,Zn)=>{const Yn=hs(Zn,Jn=>Fm(Jn));cv.setGroups(Qn,Yn)},XZ=Qn=>gc(Qn,Zn=>dg(Zn.element).bind(Yn=>Zn.getSystem().getByDom(Yn).toOptional())),L6=(Qn,Zn,Yn)=>{const Jn=Zn.builtGroups.get();if(Jn.length===0)return;const oo=Y0(Qn,Zn,"primary"),lo=Gd.getCoupled(Qn,"overflowGroup");ya(oo.element,"visibility","hidden");const mo=Jn.concat([lo]),yo=XZ(mo);Yn([]),N6(oo,mo);const Co=dd(oo.element),Ro=M6(Co,Zn.builtGroups.get(),Lo=>dd(Lo.element),lo);Ro.extra.length===0?(Cl.remove(oo,lo),Yn([])):(N6(oo,Ro.within),Yn(Ro.extra)),El(oo.element,"visibility"),Hf(oo.element),yo.each(ol.focus)},I6=Mo([Nf("splitToolbarBehaviours",[Gd]),pu("builtGroups",()=>Ua([]))]),YZ=Mo([Wb(["overflowToggledClass"]),I1("getOverflowBounds"),Er("lazySink"),pu("overflowGroups",()=>Ua([])),rc("onOpened"),rc("onClosed")].concat(I6())),GZ=Mo([Xh({factory:cv,schema:a2(),name:"primary"}),v1({schema:a2(),name:"overflow"}),v1({name:"overflow-button"}),v1({name:"overflow-group"})]),P4=Mo((Qn,Zn)=>{mv(Qn,Math.floor(Zn))}),B6=Mo([Wb(["toggledClass"]),Er("lazySink"),ep("fetch"),I1("getBounds"),hh("fireDismissalEventInstead",[Gs("event",q1())]),qb(),rc("onToggled")]),F6=Mo([v1({name:"button",overrides:Qn=>({dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:Zr([Ql.config({toggleClass:Qn.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1,onToggled:Qn.onToggled})])})}),v1({factory:cv,schema:a2(),name:"toolbar",overrides:Qn=>({toolbarBehaviours:Zr([Za.config({mode:"cyclic",onEscape:Zn=>(Au(Zn,Qn,"button").each(ol.focus),ko.none())})])})})]),rT=Hl(),KZ=(Qn,Zn)=>{rT.set(!0),$4(Qn,Zn),rT.clear()},$4=(Qn,Zn)=>{const Yn=Gd.getCoupled(Qn,"toolbarSandbox");uc.isOpen(Yn)?uc.close(Yn):uc.open(Yn,Zn.toolbar())},p$=(Qn,Zn,Yn,Jn)=>{const oo=Yn.getBounds.map(mo=>mo()),lo=Yn.lazySink(Qn).getOrDie();jh.positionWithinBounds(lo,Zn,{anchor:{type:"hotspot",hotspot:Qn,layouts:Jn,overrides:{maxWidthFunction:P4()}}},oo)},R4=(Qn,Zn,Yn,Jn,oo)=>{cv.setGroups(Zn,oo),p$(Qn,Zn,Yn,Jn),Ql.on(Qn)},H6=(Qn,Zn,Yn)=>{const Jn=I0(),oo=(mo,yo)=>{const Co=rT.get().getOr(!1);Yn.fetch().get(Ro=>{R4(Qn,yo,Yn,Zn.layouts,Ro),Jn.link(Qn.element),Co||Za.focusIn(yo)})},lo=()=>{Ql.off(Qn),rT.get().getOr(!1)||ol.focus(Qn),Jn.unlink(Qn.element)};return{dom:{tag:"div",attributes:{id:Jn.id}},behaviours:Zr([Za.config({mode:"special",onEscape:mo=>(uc.close(mo),ko.some(!0))}),uc.config({onOpen:oo,onClose:lo,isPartOf:(mo,yo,Co)=>ob(yo,Co)||ob(Qn,Co),getAttachPoint:()=>Yn.lazySink(Qn).getOrDie()}),Om.config({channels:{...cw({isExtraPart:sr,...Yn.fireDismissalEventInstead.map(mo=>({fireEventInstead:{event:mo.event}})).getOr({})}),...C_({doReposition:()=>{uc.getState(Gd.getCoupled(Qn,"toolbarSandbox")).each(mo=>{p$(Qn,mo,Yn,Zn.layouts)})}})}})])}},tS=Yh({name:"FloatingToolbarButton",factory:(Qn,Zn,Yn,Jn)=>({...yh.sketch({...Jn.button(),action:oo=>{$4(oo,Jn)},buttonBehaviours:Wg.augment({dump:Jn.button().buttonBehaviours},[Gd.config({others:{toolbarSandbox:oo=>H6(oo,Yn,Qn)}})])}),apis:{setGroups:(oo,lo)=>{uc.getState(Gd.getCoupled(oo,"toolbarSandbox")).each(mo=>{R4(oo,mo,Qn,Yn.layouts,lo)})},reposition:oo=>{uc.getState(Gd.getCoupled(oo,"toolbarSandbox")).each(lo=>{p$(oo,lo,Qn,Yn.layouts)})},toggle:oo=>{$4(oo,Jn)},toggleWithoutFocusing:oo=>{KZ(oo,Jn)},getToolbar:oo=>uc.getState(Gd.getCoupled(oo,"toolbarSandbox")),isOpen:oo=>uc.isOpen(Gd.getCoupled(oo,"toolbarSandbox"))}}),configFields:B6(),partFields:F6(),apis:{setGroups:(Qn,Zn,Yn)=>{Qn.setGroups(Zn,Yn)},reposition:(Qn,Zn)=>{Qn.reposition(Zn)},toggle:(Qn,Zn)=>{Qn.toggle(Zn)},toggleWithoutFocusing:(Qn,Zn)=>{Qn.toggleWithoutFocusing(Zn)},getToolbar:(Qn,Zn)=>Qn.getToolbar(Zn),isOpen:(Qn,Zn)=>Qn.isOpen(Zn)}}),JZ=Mo([Er("items"),Wb(["itemSelector"]),Nf("tgroupBehaviours",[Za])]),Q6=Mo([vw({name:"items",unit:"item"})]),eq=(Qn,Zn,Yn,Jn)=>({uid:Qn.uid,dom:Qn.dom,components:Zn,behaviours:sf(Qn.tgroupBehaviours,[Za.config({mode:"flow",selector:Qn.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}),g$=Yh({name:"ToolbarGroup",configFields:JZ(),partFields:Q6(),factory:eq}),V6=Qn=>hs(Qn,Zn=>Fm(Zn)),z6=(Qn,Zn,Yn)=>{L6(Qn,Yn,Jn=>{Yn.overflowGroups.set(Jn),Zn.getOpt(Qn).each(oo=>{tS.setGroups(oo,V6(Jn))})})},tq=(Qn,Zn,Yn,Jn)=>{const oo=ou(tS.sketch({fetch:()=>Cm.nu(lo=>{lo(V6(Qn.overflowGroups.get()))}),layouts:{onLtr:()=>[eh,gf],onRtl:()=>[gf,eh],onBottomLtr:()=>[$l,bf],onBottomRtl:()=>[bf,$l]},getBounds:Yn.getOverflowBounds,lazySink:Qn.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:Qn.markers.overflowToggledClass},parts:{button:Jn["overflow-button"](),toolbar:Jn.overflow()},onToggled:(lo,mo)=>Qn[mo?"onOpened":"onClosed"](lo)}));return{uid:Qn.uid,dom:Qn.dom,components:Zn,behaviours:sf(Qn.splitToolbarBehaviours,[Gd.config({others:{overflowGroup:()=>g$.sketch({...Jn["overflow-group"](),items:[oo.asSpec()]})}})]),apis:{setGroups:(lo,mo)=>{Qn.builtGroups.set(hs(mo,lo.getSystem().build)),z6(lo,oo,Qn)},refresh:lo=>z6(lo,oo,Qn),toggle:lo=>{oo.getOpt(lo).each(mo=>{tS.toggle(mo)})},toggleWithoutFocusing:lo=>{oo.getOpt(lo).each(tS.toggleWithoutFocusing)},isOpen:lo=>oo.getOpt(lo).map(tS.isOpen).getOr(!1),reposition:lo=>{oo.getOpt(lo).each(mo=>{tS.reposition(mo)})},getOverflow:lo=>oo.getOpt(lo).bind(tS.getToolbar)},domModification:{attributes:{role:"group"}}}},W6=Yh({name:"SplitFloatingToolbar",configFields:YZ(),partFields:GZ(),factory:tq,apis:{setGroups:(Qn,Zn,Yn)=>{Qn.setGroups(Zn,Yn)},refresh:(Qn,Zn)=>{Qn.refresh(Zn)},reposition:(Qn,Zn)=>{Qn.reposition(Zn)},toggle:(Qn,Zn)=>{Qn.toggle(Zn)},toggleWithoutFocusing:(Qn,Zn)=>{Qn.toggle(Zn)},isOpen:(Qn,Zn)=>Qn.isOpen(Zn),getOverflow:(Qn,Zn)=>Qn.getOverflow(Zn)}}),nq=Mo([Wb(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),rc("onOpened"),rc("onClosed")].concat(I6())),oq=Mo([Xh({factory:cv,schema:a2(),name:"primary"}),Xh({factory:cv,schema:a2(),name:"overflow",overrides:Qn=>({toolbarBehaviours:Zr([jg.config({dimension:{property:"height"},closedClass:Qn.markers.closedClass,openClass:Qn.markers.openClass,shrinkingClass:Qn.markers.shrinkingClass,growingClass:Qn.markers.growingClass,onShrunk:Zn=>{Au(Zn,Qn,"overflow-button").each(Yn=>{Ql.off(Yn),ol.focus(Yn)}),Qn.onClosed(Zn)},onGrown:Zn=>{Za.focusIn(Zn),Qn.onOpened(Zn)},onStartGrow:Zn=>{Au(Zn,Qn,"overflow-button").each(Ql.on)}}),Za.config({mode:"acyclic",onEscape:Zn=>(Au(Zn,Qn,"overflow-button").each(ol.focus),ko.some(!0))})])})}),v1({name:"overflow-button",overrides:Qn=>({buttonBehaviours:Zr([Ql.config({toggleClass:Qn.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])})}),v1({name:"overflow-group"})]),sq=(Qn,Zn)=>Au(Qn,Zn,"overflow").map(jg.hasGrown).getOr(!1),U6=(Qn,Zn)=>{Au(Qn,Zn,"overflow-button").bind(()=>Au(Qn,Zn,"overflow")).each(Yn=>{b$(Qn,Zn),jg.toggleGrow(Yn)})},b$=(Qn,Zn)=>{Au(Qn,Zn,"overflow").each(Yn=>{L6(Qn,Zn,Jn=>{const oo=hs(Jn,lo=>Fm(lo));cv.setGroups(Yn,oo)}),Au(Qn,Zn,"overflow-button").each(Jn=>{jg.hasGrown(Yn)&&Ql.on(Jn)}),jg.refresh(Yn)})},rq=(Qn,Zn,Yn,Jn)=>{const oo="alloy.toolbar.toggle",lo=(mo,yo)=>{const Co=hs(yo,mo.getSystem().build);Qn.builtGroups.set(Co)};return{uid:Qn.uid,dom:Qn.dom,components:Zn,behaviours:sf(Qn.splitToolbarBehaviours,[Gd.config({others:{overflowGroup:mo=>g$.sketch({...Jn["overflow-group"](),items:[yh.sketch({...Jn["overflow-button"](),action:yo=>{Wl(mo,oo)}})]})}}),Rl("toolbar-toggle-events",[wr(oo,mo=>{U6(mo,Qn)})])]),apis:{setGroups:(mo,yo)=>{lo(mo,yo),b$(mo,Qn)},refresh:mo=>b$(mo,Qn),toggle:mo=>U6(mo,Qn),isOpen:mo=>sq(mo,Qn)},domModification:{attributes:{role:"group"}}}},D4=Yh({name:"SplitSlidingToolbar",configFields:nq(),partFields:oq(),factory:rq,apis:{setGroups:(Qn,Zn,Yn)=>{Qn.setGroups(Zn,Yn)},refresh:(Qn,Zn)=>{Qn.refresh(Zn)},toggle:(Qn,Zn)=>{Qn.toggle(Zn)},isOpen:(Qn,Zn)=>Qn.isOpen(Zn)}}),v$=Qn=>{const Zn=Qn.title.fold(()=>({}),Yn=>({attributes:{title:Yn}}));return{dom:{tag:"div",classes:["tox-toolbar__group"],...Zn},components:[g$.parts.items({})],items:Qn.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled]), .tox-number-input:not([disabled])"},tgroupBehaviours:Zr([sd.config({}),ol.config({})])}},y$=Qn=>g$.sketch(v$(Qn)),iT=(Qn,Zn)=>{const Yn=eu(Jn=>{const oo=hs(Qn.initGroups,y$);cv.setGroups(Jn,oo)});return Zr([Lf.toolbarButton(Qn.providers.isDisabled),jf(),Za.config({mode:Zn,onEscape:Qn.onEscape,selector:".tox-toolbar__group"}),Rl("toolbar-events",[Yn])])},Z6=Qn=>{const Zn=Qn.cyclicKeying?"cyclic":"acyclic";return{uid:Qn.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":v$({title:ko.none(),items:[]}),"overflow-button":rU({name:"more",icon:ko.some("more-drawer"),enabled:!0,tooltip:ko.some("Reveal or hide additional toolbar items"),primary:!1,buttonType:ko.none(),borderless:!1},ko.none(),Qn.providers)},splitToolbarBehaviours:iT(Qn,Zn)}},q6=Qn=>{const Zn=Z6(Qn),Yn=4,Jn=W6.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return W6.sketch({...Zn,lazySink:Qn.getSink,getOverflowBounds:()=>{const oo=Qn.moreDrawerData.lazyHeader().element,lo=cf(oo),mo=Xf(oo),yo=cf(mo),Co=Math.max(mo.dom.scrollHeight,yo.height);return Kc(lo.x+Yn,yo.y,lo.width-Yn*2,Co)},parts:{...Zn.parts,overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:Qn.attributes}}},components:[Jn],markers:{overflowToggledClass:"tox-tbtn--enabled"},onOpened:oo=>Qn.onToggled(oo,!0),onClosed:oo=>Qn.onToggled(oo,!1)})},iq=Qn=>{const Zn=D4.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),Yn=D4.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),Jn=Z6(Qn);return D4.sketch({...Jn,components:[Zn,Yn],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:oo=>{oo.getSystem().broadcastOn([eS()],{type:"opened"}),Qn.onToggled(oo,!0)},onClosed:oo=>{oo.getSystem().broadcastOn([eS()],{type:"closed"}),Qn.onToggled(oo,!1)}})},O$=Qn=>{const Zn=Qn.cyclicKeying?"cyclic":"acyclic";return cv.sketch({uid:Qn.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(Qn.type===qg.scrolling?["tox-toolbar--scrolling"]:[])},components:[cv.parts.groups({})],toolbarBehaviours:iT(Qn,Zn)})},aq=[yy,S1,$f("tooltip"),Eh("buttonType","secondary",["primary","secondary"]),Xd("borderless",!1),ep("onAction")],lq=[...aq,_O,hd("type",["button"])],cq=[...aq,Xd("active",!1),hd("type",["togglebutton"])],_$={button:lq,togglebutton:cq},uq=[hd("type",["group"]),Th("buttons",[],jl("type",_$))],S$=jl("type",{..._$,group:uq}),j6=Ta([Th("buttons",[],S$),ep("onShow"),ep("onHide")]),X6=Qn=>Lu("view",j6,Qn),M4=(Qn,Zn)=>{var Yn,Jn;const oo=Qn.type==="togglebutton",lo=Qn.icon.map(Xs=>Y_(Xs,Zn.icons)).map(ou),yo=Xs=>{const Hr=qr=>{lo.map(na=>na.getOpt(Xs).each(Dl=>{Cl.set(Dl,[Y_(qr,Zn.icons)])}))},kr=qr=>{const na=Xs.element;qr?($d(na,"tox-button--enabled"),aa(na,"aria-pressed",!0)):(Yu(na,"tox-button--enabled"),_s(na,"aria-pressed"))},Or=()=>of(Xs.element,"tox-button--enabled");if(oo)return Qn.onAction({setIcon:Hr,setActive:kr,isActive:Or});if(Qn.type==="button")return Qn.onAction({setIcon:Hr})},Co={...Qn,name:oo?Qn.text.getOr(Qn.icon.getOr("")):(Yn=Qn.text)!==null&&Yn!==void 0?Yn:Qn.icon.getOr(""),primary:Qn.buttonType==="primary",buttonType:ko.from(Qn.buttonType),tooltip:Qn.tooltip,icon:Qn.icon,enabled:!0,borderless:Qn.borderless},Ro=ZM((Jn=Qn.buttonType)!==null&&Jn!==void 0?Jn:"secondary"),Lo=oo?Qn.text.map(Zn.translate):ko.some(Zn.translate(Qn.text)),Wo=Lo.map(wd),jo=Co.tooltip.or(Lo).map(Xs=>({"aria-label":Zn.translate(Xs),title:Zn.translate(Xs)})).getOr({}),es=lo.map(Xs=>Xs.asSpec()),us=Hk([es,Wo]),Ps=Qn.icon.isSome()&&Wo.isSome(),er={tag:"button",classes:Ro.concat(...Qn.icon.isSome()&&!Ps?["tox-button--icon"]:[]).concat(...Ps?["tox-button--icon-and-text"]:[]).concat(...Qn.borderless?["tox-button--naked"]:[]).concat(...Qn.type==="togglebutton"&&Qn.active?["tox-button--enabled"]:[]),attributes:jo},Bs=[],Ns=XP(Co,ko.some(yo),Bs,er,us,Zn);return yh.sketch(Ns)},Y6=(Qn,Zn)=>M4(Qn,Zn),G6=(Qn,Zn)=>({dom:{tag:"div",classes:["tox-view__toolbar__group"]},components:hs(Qn.buttons,Yn=>Y6(Yn,Zn))}),jw=Tr().deviceType,K6=jw.isPhone(),dq=jw.isTablet(),fq=Qn=>{let Zn=!1;const Yn=hs(Qn.buttons,Jn=>Jn.type==="group"?(Zn=!0,G6(Jn,Qn.providers)):Y6(Jn,Qn.providers));return{uid:Qn.uid,dom:{tag:"div",classes:[Zn?"tox-view__toolbar":"tox-view__header",...K6||dq?["tox-view--mobile","tox-view--scrolling"]:[]]},behaviours:Zr([ol.config({}),Za.config({mode:"flow",selector:"button, .tox-button",focusInside:fo.OnEnterOrSpaceMode})]),components:Zn?Yn:[rv.sketch({dom:{tag:"div",classes:["tox-view__header-start"]},components:[]}),rv.sketch({dom:{tag:"div",classes:["tox-view__header-end"]},components:Yn})]}},hq=Qn=>({uid:Qn.uid,dom:{tag:"div",classes:["tox-view__pane"]}}),N4=(Qn,Zn,Yn,Jn)=>{const oo={getPane:lo=>rh.getPart(lo,Qn,"pane"),getOnShow:lo=>Qn.viewConfig.onShow,getOnHide:lo=>Qn.viewConfig.onHide};return{uid:Qn.uid,dom:Qn.dom,components:Zn,apis:oo}};var u2=Yh({name:"silver.View",configFields:[Er("viewConfig")],partFields:[up({factory:{sketch:fq},schema:[Er("buttons"),Er("providers")],name:"header"}),up({factory:{sketch:hq},schema:[],name:"pane"})],factory:N4,apis:{getPane:(Qn,Zn)=>Qn.getPane(Zn),getOnShow:(Qn,Zn)=>Qn.getOnShow(Zn),getOnHide:(Qn,Zn)=>Qn.getOnHide(Zn)}});const mq=(Qn,Zn,Yn)=>rd(Zn,(Jn,oo)=>{const lo=Ec(X6(Jn));return Qn.slot(oo,u2.sketch({dom:{tag:"div",classes:["tox-view"]},viewConfig:lo,components:[...lo.buttons.length>0?[u2.parts.header({buttons:lo.buttons,providers:Yn})]:[],u2.parts.pane({})]}))}),J6=(Qn,Zn)=>pp.sketch(Yn=>({dom:{tag:"div",classes:["tox-view-wrap__slot-container"]},components:mq(Yn,Qn,Zn),slotBehaviours:bE.unnamedEvents([eu(Jn=>pp.hideAllSlots(Jn))])})),L4=Qn=>Zs(pp.getSlotNames(Qn),Zn=>pp.isShowing(Qn,Zn)),w$=Qn=>{const Zn=Qn.element;ya(Zn,"display","none"),aa(Zn,"aria-hidden","true")},I4=Qn=>{const Zn=Qn.element;El(Zn,"display"),_s(Zn,"aria-hidden")},pq=Qn=>({getContainer:Mo(Qn)}),e7=(Qn,Zn,Yn)=>{pp.getSlot(Qn,Zn).each(Jn=>{u2.getPane(Jn).each(oo=>{Yn(Jn)(pq(oo.element.dom))})})},t7=(Qn,Zn)=>e7(Qn,Zn,u2.getOnShow),gq=(Qn,Zn)=>e7(Qn,Zn,u2.getOnHide);var C$=Mp({factory:(Qn,Zn)=>{const lo={setViews:(mo,yo)=>{Cl.set(mo,[J6(yo,Zn.backstage.shared.providers)])},whichView:mo=>ic.getCurrent(mo).bind(L4),toggleView:(mo,yo,Co,Ro)=>ic.getCurrent(mo).exists(Lo=>{const Wo=L4(Lo),jo=Wo.exists(us=>Ro===us),es=pp.getSlot(Lo,Ro).isSome();return es&&(pp.hideAllSlots(Lo),jo?(w$(mo),yo()):(Co(),I4(mo),pp.showSlot(Lo,Ro),t7(Lo,Ro)),Wo.each(us=>gq(Lo,us))),es})};return{uid:Qn.uid,dom:{tag:"div",classes:["tox-view-wrap"],attributes:{"aria-hidden":"true"},styles:{display:"none"}},components:[],behaviours:Zr([Cl.config({}),ic.config({find:mo=>{const yo=Cl.contents(mo);return Nl(yo)}})]),apis:lo}},name:"silver.ViewWrapper",configFields:[Er("backstage")],apis:{setViews:(Qn,Zn,Yn)=>Qn.setViews(Zn,Yn),toggleView:(Qn,Zn,Yn,Jn,oo)=>Qn.toggleView(Zn,Yn,Jn,oo),whichView:(Qn,Zn)=>Qn.whichView(Zn)}});const n7=(Qn,Zn,Yn)=>{let Jn=!1;const oo={getSocket:lo=>rh.getPart(lo,Qn,"socket"),setSidebar:(lo,mo,yo)=>{rh.getPart(lo,Qn,"sidebar").each(Co=>FZ(Co,mo,yo))},toggleSidebar:(lo,mo)=>{rh.getPart(lo,Qn,"sidebar").each(yo=>HZ(yo,mo))},whichSidebar:lo=>rh.getPart(lo,Qn,"sidebar").bind(A6).getOrNull(),getHeader:lo=>rh.getPart(lo,Qn,"header"),getToolbar:lo=>rh.getPart(lo,Qn,"toolbar"),setToolbar:(lo,mo)=>{rh.getPart(lo,Qn,"toolbar").each(yo=>{const Co=hs(mo,y$);yo.getApis().setGroups(yo,Co)})},setToolbars:(lo,mo)=>{rh.getPart(lo,Qn,"multiple-toolbar").each(yo=>{const Co=hs(mo,Ro=>hs(Ro,y$));o$.setItems(yo,Co)})},refreshToolbar:lo=>{rh.getPart(lo,Qn,"toolbar").each(yo=>yo.getApis().refresh(yo))},toggleToolbarDrawer:lo=>{rh.getPart(lo,Qn,"toolbar").each(mo=>{Ma(mo.getApis().toggle,yo=>yo(mo))})},toggleToolbarDrawerWithoutFocusing:lo=>{rh.getPart(lo,Qn,"toolbar").each(mo=>{Ma(mo.getApis().toggleWithoutFocusing,yo=>yo(mo))})},isToolbarDrawerToggled:lo=>rh.getPart(lo,Qn,"toolbar").bind(mo=>ko.from(mo.getApis().isOpen).map(yo=>yo(mo))).getOr(!1),getThrobber:lo=>rh.getPart(lo,Qn,"throbber"),focusToolbar:lo=>{rh.getPart(lo,Qn,"toolbar").orThunk(()=>rh.getPart(lo,Qn,"multiple-toolbar")).each(yo=>{Za.focusIn(yo)})},setMenubar:(lo,mo)=>{rh.getPart(lo,Qn,"menubar").each(yo=>{w4.setMenus(yo,mo)})},focusMenubar:lo=>{rh.getPart(lo,Qn,"menubar").each(mo=>{w4.focus(mo)})},setViews:(lo,mo)=>{rh.getPart(lo,Qn,"viewWrapper").each(yo=>{C$.setViews(yo,mo)})},toggleView:(lo,mo)=>rh.getPart(lo,Qn,"viewWrapper").exists(yo=>C$.toggleView(yo,()=>oo.showMainView(lo),()=>oo.hideMainView(lo),mo)),whichView:lo=>rh.getPart(lo,Qn,"viewWrapper").bind(C$.whichView).getOrNull(),hideMainView:lo=>{Jn=oo.isToolbarDrawerToggled(lo),Jn&&oo.toggleToolbarDrawer(lo),rh.getPart(lo,Qn,"editorContainer").each(mo=>{const yo=mo.element;ya(yo,"display","none"),aa(yo,"aria-hidden","true")})},showMainView:lo=>{Jn&&oo.toggleToolbarDrawer(lo),rh.getPart(lo,Qn,"editorContainer").each(mo=>{const yo=mo.element;El(yo,"display"),_s(yo,"aria-hidden")})}};return{uid:Qn.uid,dom:Qn.dom,components:Zn,apis:oo,behaviours:Qn.behaviours}},bq=Ty.optional({factory:w4,name:"menubar",schema:[Er("backstage")]}),vq=Qn=>Qn.type===qg.sliding?iq:Qn.type===qg.floating?q6:O$,B4=Ty.optional({factory:{sketch:Qn=>o$.sketch({uid:Qn.uid,dom:Qn.dom,listBehaviours:Zr([Za.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:()=>O$({type:Qn.type,uid:ba("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:Qn.providers,onEscape:()=>(Qn.onEscape(),ko.some(!0))}),setupItem:(Zn,Yn,Jn,oo)=>{cv.setGroups(Yn,Jn)},shell:!0})},name:"multiple-toolbar",schema:[Er("dom"),Er("onEscape")]}),yq=Ty.optional({factory:{sketch:Qn=>{const Zn=vq(Qn),Yn={type:Qn.type,uid:Qn.uid,onEscape:()=>(Qn.onEscape(),ko.some(!0)),onToggled:(Jn,oo)=>Qn.onToolbarToggled(oo),cyclicKeying:!1,initGroups:[],getSink:Qn.getSink,providers:Qn.providers,moreDrawerData:{lazyToolbar:Qn.lazyToolbar,lazyMoreButton:Qn.lazyMoreButton,lazyHeader:Qn.lazyHeader},attributes:Qn.attributes};return Zn(Yn)}},name:"toolbar",schema:[Er("dom"),Er("onEscape"),Er("getSink")]}),Oq=Ty.optional({factory:{sketch:k6},name:"header",schema:[Er("dom")]}),o7=Ty.optional({factory:{sketch:RZ},name:"promotion",schema:[Er("dom")]}),_q=Ty.optional({name:"socket",schema:[Er("dom")]}),s7=Ty.optional({factory:{sketch:QZ},name:"sidebar",schema:[Er("dom")]}),Sq=Ty.optional({factory:{sketch:UZ},name:"throbber",schema:[Er("dom")]}),r7=Ty.optional({factory:C$,name:"viewWrapper",schema:[Er("backstage")]}),wq=Qn=>({uid:Qn.uid,dom:{tag:"div",classes:["tox-editor-container"]},components:Qn.components}),Cq=Ty.optional({factory:{sketch:wq},name:"editorContainer",schema:[]});var Hu=Yh({name:"OuterContainer",factory:n7,configFields:[Er("dom"),Er("behaviours")],partFields:[Oq,bq,yq,B4,_q,s7,o7,Sq,r7,Cq],apis:{getSocket:(Qn,Zn)=>Qn.getSocket(Zn),setSidebar:(Qn,Zn,Yn,Jn)=>{Qn.setSidebar(Zn,Yn,Jn)},toggleSidebar:(Qn,Zn,Yn)=>{Qn.toggleSidebar(Zn,Yn)},whichSidebar:(Qn,Zn)=>Qn.whichSidebar(Zn),getHeader:(Qn,Zn)=>Qn.getHeader(Zn),getToolbar:(Qn,Zn)=>Qn.getToolbar(Zn),setToolbar:(Qn,Zn,Yn)=>{Qn.setToolbar(Zn,Yn)},setToolbars:(Qn,Zn,Yn)=>{Qn.setToolbars(Zn,Yn)},refreshToolbar:(Qn,Zn)=>Qn.refreshToolbar(Zn),toggleToolbarDrawer:(Qn,Zn)=>{Qn.toggleToolbarDrawer(Zn)},toggleToolbarDrawerWithoutFocusing:(Qn,Zn)=>{Qn.toggleToolbarDrawerWithoutFocusing(Zn)},isToolbarDrawerToggled:(Qn,Zn)=>Qn.isToolbarDrawerToggled(Zn),getThrobber:(Qn,Zn)=>Qn.getThrobber(Zn),setMenubar:(Qn,Zn,Yn)=>{Qn.setMenubar(Zn,Yn)},focusMenubar:(Qn,Zn)=>{Qn.focusMenubar(Zn)},focusToolbar:(Qn,Zn)=>{Qn.focusToolbar(Zn)},setViews:(Qn,Zn,Yn)=>{Qn.setViews(Zn,Yn)},toggleView:(Qn,Zn,Yn)=>Qn.toggleView(Zn,Yn),whichView:(Qn,Zn)=>Qn.whichView(Zn)}});const i7="file edit view insert format tools table help",a7={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template inserttemplate codesample inserttable accordion | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents footnotes | mergetags | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | styles blocks fontfamily fontsize align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"aidialog aishortcuts | spellchecker spellcheckerlanguage | autocorrect capitalization | a11ycheck code typography wordcount addtemplate"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},kq=(Qn,Zn,Yn)=>{const Jn=kR(Yn).split(/[ ,]/);return{text:Qn.title,getItems:()=>fs(Qn.items,oo=>{const lo=oo.toLowerCase();return lo.trim().length===0?[]:Br(Jn,mo=>mo===lo)?[]:lo==="separator"||lo==="|"?[{type:"separator"}]:Zn.menuItems[lo]?[Zn.menuItems[lo]]:[]})}},F4=Qn=>Qn.split(" "),k$=(Qn,Zn)=>{const Yn={...a7,...Zn.menus},Jn=nc(Zn.menus).length>0,oo=Zn.menubar===void 0||Zn.menubar===!0?F4(i7):F4(Zn.menubar===!1?"":Zn.menubar),lo=ga(oo,yo=>{const Co=Pl(a7,yo);return Jn?Co||Rr(Zn.menus,yo).exists(Ro=>Pl(Ro,"items")):Co}),mo=hs(lo,yo=>{const Co=Yn[yo];return kq({title:Co.title,items:F4(Co.items)},Zn,Qn)});return ga(mo,yo=>{const Co=Ro=>qn(Ro)||Ro.type!=="separator";return yo.getItems().length>0&&Br(yo.getItems(),Co)})},H4=Qn=>{const Zn=()=>{Qn._skinLoaded=!0,RQ(Qn)};return()=>{Qn.initialized?Zn():Qn.on("init",Zn)}},xq=(Qn,Zn)=>()=>OD(Qn,{message:Zn}),l7=(Qn,Zn,Yn)=>(Qn.on("remove",()=>Yn.unload(Zn)),Yn.load(Zn)),Q4=(Qn,Zn,Yn,Jn)=>(Qn.on("remove",()=>Jn.unloadRawCss(Zn)),Jn.loadRawCss(Zn,Yn)),Eq=async(Qn,Zn)=>{const Jn="ui/"+FA(Qn).getOr("default")+"/skin.css",oo=tinymce.Resource.get(Jn);if(qn(oo))return Promise.resolve(Q4(Qn,Jn,oo,Qn.ui.styleSheetLoader));{const lo=Zn+"/skin.min.css";return l7(Qn,lo,Qn.ui.styleSheetLoader)}},Tq=async(Qn,Zn)=>{if(Wa(Ds.fromDom(Qn.getElement()))){const oo="ui/"+FA(Qn).getOr("default")+"/skin.shadowdom.css",lo=tinymce.Resource.get(oo);if(qn(lo))return Q4(Qn,oo,lo,Mw.DOM.styleSheetLoader),Promise.resolve();{const mo=Zn+"/skin.shadowdom.min.css";return l7(Qn,mo,Mw.DOM.styleSheetLoader)}}},Aq=async(Qn,Zn)=>{FA(Zn).fold(()=>{const Jn=BA(Zn);Jn&&Zn.contentCSS.push(Jn+(Qn?"/content.inline":"/content")+".min.css")},Jn=>{const oo="ui/"+Jn+(Qn?"/content.inline":"/content")+".css",lo=tinymce.Resource.get(oo);if(qn(lo))Q4(Zn,oo,lo,Zn.ui.styleSheetLoader);else{const mo=BA(Zn);mo&&Zn.contentCSS.push(mo+(Qn?"/content.inline":"/content")+".min.css")}});const Yn=BA(Zn);if(!RR(Zn)&&qn(Yn))return Promise.all([Eq(Zn,Yn),Tq(Zn,Yn)]).then()},c7=(Qn,Zn)=>Aq(Qn,Zn).then(H4(Zn),xq(Zn,"Skin could not be loaded")),Pq=ms(c7,!1),$q=ms(c7,!0),Xw=(Qn,Zn,Yn)=>Qn.translate([Zn,Qn.translate(Yn)]),x$=(Qn,Zn)=>{const Yn=(mo,yo,Co,Ro)=>{const Lo=Qn.shared.providers.translate(mo.title);if(mo.type==="separator")return ko.some({type:"separator",text:Lo});if(mo.type==="submenu"){const Wo=fs(mo.getStyleItems(),jo=>Jn(jo,yo,Ro));return yo===0&&Wo.length<=0?ko.none():ko.some({type:"nestedmenuitem",text:Lo,enabled:Wo.length>0,getSubmenuItems:()=>fs(mo.getStyleItems(),jo=>Jn(jo,yo,Ro))})}else return ko.some({type:"togglemenuitem",text:Lo,icon:mo.icon,active:mo.isSelected(Ro),enabled:!Co,onAction:Zn.onAction(mo),...mo.getStylePreview().fold(()=>({}),Wo=>({meta:{style:Wo}}))})},Jn=(mo,yo,Co)=>{const Ro=mo.type==="formatter"&&Zn.isInvalid(mo);return yo===0?Ro?[]:Yn(mo,yo,!1,Co).toArray():Yn(mo,yo,Ro,Co).toArray()},oo=mo=>{const yo=Zn.getCurrentValue(),Co=Zn.shouldHide?0:1;return fs(mo,Ro=>Jn(Ro,Co,yo))};return{validateItems:oo,getFetch:(mo,yo)=>(Co,Ro)=>{const Lo=yo(),Wo=oo(Lo),jo=t2(Wo,sv.CLOSE_ON_EXECUTE,mo,{isHorizontalMenu:!1,search:ko.none()});Ro(jo)}}},nS=(Qn,Zn,Yn)=>{const Jn=Yn.dataset,oo=Jn.type==="basic"?()=>hs(Jn.data,lo=>JM(lo,Yn.isSelectedFor,Yn.getPreviewFor)):Jn.getData;return{items:x$(Zn,Yn),getStyleItems:oo}},d2=(Qn,Zn,Yn,Jn,oo)=>{const{items:lo,getStyleItems:mo}=nS(Qn,Zn,Yn),yo=Ro=>({getComponent:Mo(Ro),setTooltip:Lo=>{const Wo=Zn.shared.providers.translate(Lo);Qp(Ro.element,{"aria-label":Wo,title:Wo})}}),Co=Ro=>{const Lo=Wo=>Ro.setTooltip(Xw(Qn,Jn,Wo.value));return Qn.on(oo,Lo),SE(a0(Qn,"NodeChange",Wo=>{const jo=Wo.getComponent();Yn.updateText(jo),Ja.set(Wo.getComponent(),!Qn.selection.isEditable())})(Ro),()=>Qn.off(oo,Lo))};return $M({text:Yn.icon.isSome()?ko.none():Yn.text,icon:Yn.icon,tooltip:ko.from(Yn.tooltip),role:ko.none(),fetch:lo.getFetch(Zn,mo),onSetup:Co,getApi:yo,columns:1,presets:"normal",classes:Yn.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",Zn.shared)},oS=Qn=>hs(Qn,Zn=>{let Yn=Zn,Jn=Zn;const oo=Zn.split("=");return oo.length>1&&(Yn=oo[0],Jn=oo[1]),{title:Yn,format:Jn}}),u7=Qn=>({type:"basic",data:Qn});var f2;(function(Qn){Qn[Qn.SemiColon=0]="SemiColon",Qn[Qn.Space=1]="Space"})(f2||(f2={}));const Rq=(Qn,Zn)=>Zn===f2.SemiColon?Qn.replace(/;$/,"").split(";"):Qn.split(" "),V4=(Qn,Zn,Yn)=>{const Jn=Qn.options.get(Zn);return{type:"basic",data:oS(Rq(Jn,Yn))}},Dq="Align",d7="Alignment {0}",f7="left",z4=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],W4=Qn=>{const Zn=()=>Zs(z4,yo=>Qn.formatter.match(yo.format)),Yn=yo=>()=>Qn.formatter.match(yo),Jn=yo=>ko.none,oo=yo=>{const Ro=Zn().fold(Mo(f7),Lo=>Lo.title.toLowerCase());Qa(yo,G_,{icon:`align-${Ro}`}),LQ(Qn,{value:Ro})},lo=u7(z4),mo=yo=>()=>Zs(z4,Co=>Co.format===yo.format).each(Co=>Qn.execCommand(Co.command));return{tooltip:Xw(Qn,d7,f7),text:ko.none(),icon:ko.some("align-left"),isSelectedFor:Yn,getCurrentValue:ko.none,getPreviewFor:Jn,onAction:mo,updateText:oo,dataset:lo,shouldHide:!1,isInvalid:yo=>!Qn.formatter.canApply(yo.format)}},Mq=(Qn,Zn)=>d2(Qn,Zn,W4(Qn),d7,"AlignTextUpdate"),Nq=(Qn,Zn)=>{const Yn=nS(Qn,Zn,W4(Qn));Qn.ui.registry.addNestedMenuItem("align",{text:Zn.shared.providers.translate(Dq),onSetup:mp(Qn),getSubmenuItems:()=>Yn.items.validateItems(Yn.getStyleItems())})},E$=(Qn,Zn)=>{const Yn=Zn(),Jn=hs(Yn,oo=>oo.format);return ko.from(Qn.formatter.closest(Jn)).bind(oo=>Zs(Yn,lo=>lo.format===oo)).orThunk(()=>Mr(Qn.formatter.match("p"),{title:"Paragraph",format:"p"}))},Lq="Blocks",h7="Block {0}",U4="Paragraph",m7=Qn=>{const Zn=lo=>()=>Qn.formatter.match(lo),Yn=lo=>()=>{const mo=Qn.formatter.get(lo);return mo?ko.some({tag:mo.length>0&&(mo[0].inline||mo[0].block)||"div",styles:Qn.dom.parseStyle(Qn.formatter.getCssText(lo))}):ko.none()},Jn=lo=>{const yo=E$(Qn,()=>oo.data).fold(Mo(U4),Co=>Co.title);Qa(lo,k1,{text:yo}),uI(Qn,{value:yo})},oo=V4(Qn,"block_formats",f2.SemiColon);return{tooltip:Xw(Qn,h7,U4),text:ko.some(U4),icon:ko.none(),isSelectedFor:Zn,getCurrentValue:ko.none,getPreviewFor:Yn,onAction:fI(Qn),updateText:Jn,dataset:oo,shouldHide:!1,isInvalid:lo=>!Qn.formatter.canApply(lo.format)}},Iq=(Qn,Zn)=>d2(Qn,Zn,m7(Qn),h7,"BlocksTextUpdate"),Bq=(Qn,Zn)=>{const Yn=nS(Qn,Zn,m7(Qn));Qn.ui.registry.addNestedMenuItem("blocks",{text:Lq,onSetup:mp(Qn),getSubmenuItems:()=>Yn.items.validateItems(Yn.getStyleItems())})},p7="Fonts",Z4="Font {0}",T$="System Font",Fq=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],q4=Qn=>{const Zn=Qn.split(/\s*,\s*/);return hs(Zn,Yn=>Yn.replace(/^['"]+|['"]+$/g,""))},g7=(Qn,Zn)=>Zn.length>0&&dr(Zn,Yn=>Qn.indexOf(Yn.toLowerCase())>-1),Hq=(Qn,Zn)=>{if(Qn.indexOf("-apple-system")===0||Zn.length>0){const Yn=q4(Qn.toLowerCase());return g7(Yn,Fq)||g7(Yn,Zn)}else return!1},b7=Qn=>{const Zn=()=>{const Co=us=>us?q4(us)[0]:"",Ro=Qn.queryCommandValue("FontName"),Lo=yo.data,Wo=Ro?Ro.toLowerCase():"",jo=Y5(Qn);return{matchOpt:Zs(Lo,us=>{const Ps=us.format;return Ps.toLowerCase()===Wo||Co(Ps).toLowerCase()===Co(Wo).toLowerCase()}).orThunk(()=>Mr(Hq(Wo,jo),{title:T$,format:Wo})),font:Ro}},Yn=Co=>Ro=>Ro.exists(Lo=>Lo.format===Co),Jn=()=>{const{matchOpt:Co}=Zn();return Co},oo=Co=>()=>ko.some({tag:"div",styles:Co.indexOf("dings")===-1?{"font-family":Co}:{}}),lo=Co=>()=>{Qn.undoManager.transact(()=>{Qn.focus(),Qn.execCommand("FontName",!1,Co.format)})},mo=Co=>{const{matchOpt:Ro,font:Lo}=Zn(),Wo=Ro.fold(Mo(Lo),jo=>jo.title);Qa(Co,k1,{text:Wo}),dI(Qn,{value:Wo})},yo=V4(Qn,"font_family_formats",f2.SemiColon);return{tooltip:Xw(Qn,Z4,T$),text:ko.some(T$),icon:ko.none(),isSelectedFor:Yn,getCurrentValue:Jn,getPreviewFor:oo,onAction:lo,updateText:mo,dataset:yo,shouldHide:!1,isInvalid:sr}},v7=(Qn,Zn)=>d2(Qn,Zn,b7(Qn),Z4,"FontFamilyTextUpdate"),Qq=(Qn,Zn)=>{const Yn=nS(Qn,Zn,b7(Qn));Qn.ui.registry.addNestedMenuItem("fontfamily",{text:Zn.shared.providers.translate(p7),onSetup:mp(Qn),getSubmenuItems:()=>Yn.items.validateItems(Yn.getStyleItems())})},y7={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Vq=(()=>{const Qn="[0-9]+",Yn="[eE]"+("[+-]?"+Qn),Jn="\\.",oo=yo=>`(?:${yo})?`,mo=`[+-]?(?:${["Infinity",Qn+Jn+oo(Qn)+oo(Yn),Jn+Qn+oo(Yn),Qn+oo(Yn)].join("|")})`;return new RegExp(`^(${mo})(.*)$`)})(),zq=(Qn,Zn)=>Br(Zn,Yn=>Br(y7[Yn],Jn=>Qn===Jn)),A$=(Qn,Zn)=>ko.from(Vq.exec(Qn)).bind(Jn=>{const oo=Number(Jn[1]),lo=Jn[2];return zq(lo,Zn)?ko.some({value:oo,unit:lo}):ko.none()}),Wq=(Qn,Zn)=>A$(Qn,Zn).map(({value:Yn,unit:Jn})=>Yn+Jn),O7={tab:Mo(9),escape:Mo(27),enter:Mo(13),backspace:Mo(8),delete:Mo(46),left:Mo(37),up:Mo(38),right:Mo(39),down:Mo(40),space:Mo(32),home:Mo(36),end:Mo(35),pageUp:Mo(33),pageDown:Mo(34)},Uq=(Qn,Zn,Yn)=>{let Jn=ko.none();const oo=Ns=>Ns.map(Xs=>da.getValue(Xs)).getOr(""),lo=a0(Qn,"NodeChange SwitchMode",Ns=>{const Xs=Ns.getComponent();Jn=ko.some(Xs),Yn.updateInputValue(Xs),Ja.set(Xs,!Qn.selection.isEditable())}),mo=Ns=>({getComponent:Mo(Ns)}),yo=Ua(xo),Co=ba("custom-number-input-events"),Ro=(Ns,Xs,Hr)=>{const kr=oo(Jn),Or=Yn.getNewValue(kr,Ns),qr=kr.length-`${Or}`.length,na=Jn.map(Sa=>Sa.element.dom.selectionStart-qr),Dl=Jn.map(Sa=>Sa.element.dom.selectionEnd-qr);Yn.onAction(Or,Hr),Jn.each(Sa=>{da.setValue(Sa,Or),Xs&&(na.each(fl=>Sa.element.dom.selectionStart=fl),Dl.each(fl=>Sa.element.dom.selectionEnd=fl))})},Lo=(Ns,Xs)=>Ro((Hr,kr)=>Hr-kr,Ns,Xs),Wo=(Ns,Xs)=>Ro((Hr,kr)=>Hr+kr,Ns,Xs),jo=Ns=>lh(Ns.element).fold(ko.none,Xs=>(Cd(Xs),ko.some(!0))),es=Ns=>tO(Ns.element)?(jm(Ns.element).each(Xs=>Cd(Xs)),ko.some(!0)):ko.none(),us=(Ns,Xs,Hr,kr)=>{const Or=Ua(xo),qr=Zn.shared.providers.translate(Hr),na=ba("altExecuting"),Dl=a0(Qn,"NodeChange SwitchMode",fl=>{Ja.set(fl.getComponent(),!Qn.selection.isEditable())}),Sa=fl=>{Ja.isDisabled(fl)||Ns(!0)};return yh.sketch({dom:{tag:"button",attributes:{title:qr,"aria-label":qr},classes:kr.concat(Xs)},components:[PM(Xs,Zn.shared.providers.icons)],buttonBehaviours:Zr([Ja.config({}),Rl(na,[H_({onSetup:Dl,getApi:mo},Or),_y({getApi:mo},Or),wr(op(),(fl,rl)=>{(rl.event.raw.keyCode===O7.space()||rl.event.raw.keyCode===O7.enter())&&(Ja.isDisabled(fl)||Ns(!1))}),wr(Lg(),Sa),wr(H1(),Sa)])]),eventOrder:{[op()]:[na,"keying"],[Lg()]:[na,"alloy.base.behaviour"],[H1()]:[na,"alloy.base.behaviour"]}})},Ps=ou(us(Ns=>Lo(!1,Ns),"minus","Decrease font size",[])),er=ou(us(Ns=>Wo(!1,Ns),"plus","Increase font size",[])),Bs=ou({dom:{tag:"div",classes:["tox-input-wrapper"]},components:[Lw.sketch({inputBehaviours:Zr([Ja.config({}),Rl(Co,[H_({onSetup:lo,getApi:mo},yo),_y({getApi:mo},yo)]),Rl("input-update-display-text",[wr(k1,(Ns,Xs)=>{da.setValue(Ns,Xs.event.text)}),wr(pm(),Ns=>{Yn.onAction(da.getValue(Ns))}),wr(E0(),Ns=>{Yn.onAction(da.getValue(Ns))})]),Za.config({mode:"special",onEnter:Ns=>(Ro(Go,!0,!0),ko.some(!0)),onEscape:jo,onUp:Ns=>(Wo(!0,!1),ko.some(!0)),onDown:Ns=>(Lo(!0,!1),ko.some(!0)),onLeft:(Ns,Xs)=>(Xs.cut(),ko.none()),onRight:(Ns,Xs)=>(Xs.cut(),ko.none())})])})],behaviours:Zr([ol.config({}),Za.config({mode:"special",onEnter:es,onSpace:es,onEscape:jo}),Rl("input-wrapper-events",[wr(eg(),Ns=>{Qs([Ps,er],Xs=>{const Hr=Ds.fromDom(Xs.get(Ns).element.dom);tO(Hr)&&Vg(Hr)})})])])});return{dom:{tag:"div",classes:["tox-number-input"]},components:[Ps.asSpec(),Bs.asSpec(),er.asSpec()],behaviours:Zr([ol.config({}),Za.config({mode:"flow",focusInside:fo.OnEnterOrSpaceMode,cycles:!1,selector:"button, .tox-input-wrapper",onEscape:Ns=>tO(Ns.element)?ko.none():(Cd(Ns.element),ko.some(!0))})])}},Zq="Font sizes",j4="Font size {0}",_7="12pt",qq={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},jq={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},Xq=(Qn,Zn)=>{const Yn=Math.pow(10,Zn);return Math.round(Qn*Yn)/Yn},Yq=(Qn,Zn)=>/[0-9.]+px$/.test(Qn)?Xq(parseInt(Qn,10)*72/96,Zn||0)+"pt":Rr(jq,Qn).getOr(Qn),Gq=Qn=>Rr(qq,Qn).getOr(""),S7=Qn=>{const Zn=()=>{let Co=ko.none();const Ro=yo.data,Lo=Qn.queryCommandValue("FontSize");if(Lo)for(let Wo=3;Co.isNone()&&Wo>=0;Wo--){const jo=Yq(Lo,Wo),es=Gq(jo);Co=Zs(Ro,us=>us.format===Lo||us.format===jo||us.format===es)}return{matchOpt:Co,size:Lo}},Yn=Co=>Ro=>Ro.exists(Lo=>Lo.format===Co),Jn=()=>{const{matchOpt:Co}=Zn();return Co},oo=Mo(ko.none),lo=Co=>()=>{Qn.undoManager.transact(()=>{Qn.focus(),Qn.execCommand("FontSize",!1,Co.format)})},mo=Co=>{const{matchOpt:Ro,size:Lo}=Zn(),Wo=Ro.fold(Mo(Lo),jo=>jo.title);Qa(Co,k1,{text:Wo}),IQ(Qn,{value:Wo})},yo=V4(Qn,"font_size_formats",f2.Space);return{tooltip:Xw(Qn,j4,_7),text:ko.some(_7),icon:ko.none(),isSelectedFor:Yn,getPreviewFor:oo,getCurrentValue:Jn,onAction:lo,updateText:mo,dataset:yo,shouldHide:!1,isInvalid:sr}},w7=(Qn,Zn)=>d2(Qn,Zn,S7(Qn),j4,"FontSizeTextUpdate"),Kq=Qn=>{var Zn;const Yn={step:1};return(Zn={em:{step:.1},cm:{step:.1},in:{step:.1},pc:{step:.1},ch:{step:.1},rem:{step:.1}}[Qn])!==null&&Zn!==void 0?Zn:Yn},Jq=16,C7=Qn=>Qn>=0,ej=Qn=>{const Zn=()=>Qn.queryCommandValue("FontSize");return{updateInputValue:Jn=>Qa(Jn,k1,{text:Zn()}),onAction:(Jn,oo)=>Qn.execCommand("FontSize",!1,Jn,{skip_focus:!oo}),getNewValue:(Jn,oo)=>{A$(Jn,["unsupportedLength","empty"]);const lo=Zn(),mo=A$(Jn,["unsupportedLength","empty"]).or(A$(lo,["unsupportedLength","empty"])),yo=mo.map(jo=>jo.value).getOr(Jq),Co=U5(Qn),Ro=mo.map(jo=>jo.unit).filter(jo=>jo!=="").getOr(Co),Lo=oo(yo,Kq(Ro).step),Wo=`${C7(Lo)?Lo:yo}${Ro}`;return Wo!==lo&&BQ(Qn,{value:Wo}),Wo}}},k7=(Qn,Zn)=>Uq(Qn,Zn,ej(Qn)),x7=(Qn,Zn)=>{const Yn=nS(Qn,Zn,S7(Qn));Qn.ui.registry.addNestedMenuItem("fontsize",{text:Zq,onSetup:mp(Qn),getSubmenuItems:()=>Yn.items.validateItems(Yn.getStyleItems())})},tj="Formats",E7="Format {0}",T7=(Qn,Zn)=>{const Yn="Paragraph",Jn=mo=>()=>Qn.formatter.match(mo),oo=mo=>()=>{const yo=Qn.formatter.get(mo);return yo!==void 0?ko.some({tag:yo.length>0&&(yo[0].inline||yo[0].block)||"div",styles:Qn.dom.parseStyle(Qn.formatter.getCssText(mo))}):ko.none()},lo=mo=>{const yo=Wo=>KP(Wo)?fs(Wo.items,yo):ZF(Wo)?[{title:Wo.title,format:Wo.format}]:[],Co=fs(jF(Qn),yo),Lo=E$(Qn,Mo(Co)).fold(Mo(Yn),Wo=>Wo.title);Qa(mo,k1,{text:Lo}),NQ(Qn,{value:Lo})};return{tooltip:Xw(Qn,E7,Yn),text:ko.some(Yn),icon:ko.none(),isSelectedFor:Jn,getCurrentValue:ko.none,getPreviewFor:oo,onAction:fI(Qn),updateText:lo,shouldHide:H5(Qn),isInvalid:mo=>!Qn.formatter.canApply(mo.format),dataset:Zn}},h2=(Qn,Zn)=>{const Yn={type:"advanced",...Zn.styles};return d2(Qn,Zn,T7(Qn,Yn),E7,"StylesTextUpdate")},nj=(Qn,Zn)=>{const Yn={type:"advanced",...Zn.styles},Jn=nS(Qn,Zn,T7(Qn,Yn));Qn.ui.registry.addNestedMenuItem("styles",{text:tj,onSetup:mp(Qn),getSubmenuItems:()=>Jn.items.validateItems(Jn.getStyleItems())})},oj=Mo([Er("toggleClass"),Er("fetch"),Fg("onExecute"),Gs("getHotspot",ko.some),Gs("getAnchorOverrides",Mo({})),qb(),Fg("onItemExecute"),Tc("lazySink"),Er("dom"),rc("onOpen"),Nf("splitDropdownBehaviours",[Gd,Za,ol]),Gs("matchWidth",!1),Gs("useMinWidth",!1),Gs("eventOrder",{}),Tc("role")].concat(zD())),sj=Xh({factory:yh,schema:[Er("dom")],name:"arrow",defaults:()=>({buttonBehaviours:Zr([ol.revoke()])}),overrides:Qn=>({dom:{tag:"span",attributes:{role:"presentation"}},action:Zn=>{Zn.getSystem().getByUid(Qn.uid).each(og)},buttonBehaviours:Zr([Ql.config({toggleOnExecute:!1,toggleClass:Qn.toggleClass})])})}),rj=Xh({factory:yh,schema:[Er("dom")],name:"button",defaults:()=>({buttonBehaviours:Zr([ol.revoke()])}),overrides:Qn=>({dom:{tag:"span",attributes:{role:"presentation"}},action:Zn=>{Zn.getSystem().getByUid(Qn.uid).each(Yn=>{Qn.onExecute(Yn,Zn)})}})}),ij=Mo([sj,rj,up({factory:{sketch:Qn=>({uid:Qn.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:Qn.text}})},schema:[Er("text")],name:"aria-descriptor"}),v1({schema:[qy()],name:"menu",defaults:Qn=>({onExecute:(Zn,Yn)=>{Zn.getSystem().getByUid(Qn.uid).each(Jn=>{Qn.onItemExecute(Jn,Zn,Yn)})}})}),$I()]),aj=(Qn,Zn,Yn,Jn)=>{const oo=Lo=>{ic.getCurrent(Lo).each(Wo=>{Bc.highlightFirst(Wo),Za.focusIn(Wo)})},lo=Lo=>{QD(Qn,Go,Lo,Jn,oo,hp.HighlightMenuAndItem).get(xo)},mo=Lo=>(lo(Lo),ko.some(!0)),yo=Lo=>{const Wo=Y0(Lo,Qn,"button");return og(Wo),ko.some(!0)},Co={...Jc([eu((Lo,Wo)=>{Au(Lo,Qn,"aria-descriptor").each(es=>{const us=ba("aria");aa(es.element,"id",us),aa(Lo.element,"aria-describedby",us)})})]),...tv(ko.some(lo))},Ro={repositionMenus:Lo=>{Ql.isOn(Lo)&&NI(Lo)}};return{uid:Qn.uid,dom:Qn.dom,components:Zn,apis:Ro,eventOrder:{...Qn.eventOrder,[Im()]:["disabling","toggling","alloy.base.behaviour"]},events:Co,behaviours:sf(Qn.splitDropdownBehaviours,[Gd.config({others:{sandbox:Lo=>{const Wo=Y0(Lo,Qn,"arrow");return VD(Qn,Lo,{onOpen:()=>{Ql.on(Wo),Ql.on(Lo)},onClose:()=>{Ql.off(Wo),Ql.off(Lo)}})}}}),Za.config({mode:"special",onSpace:yo,onEnter:yo,onDown:mo}),ol.config({}),Ql.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:Qn.role.getOr("button"),"aria-haspopup":!0}}}},P$=Yh({name:"SplitDropdown",configFields:oj(),partFields:ij(),factory:aj,apis:{repositionMenus:(Qn,Zn)=>Qn.repositionMenus(Zn)}}),A7=Qn=>({isEnabled:()=>!Ja.isDisabled(Qn),setEnabled:Zn=>Ja.set(Qn,!Zn),setText:Zn=>Qa(Qn,k1,{text:Zn}),setIcon:Zn=>Qa(Qn,G_,{icon:Zn})}),X4=Qn=>({setActive:Zn=>{Ql.set(Qn,Zn)},isActive:()=>Ql.isOn(Qn),isEnabled:()=>!Ja.isDisabled(Qn),setEnabled:Zn=>Ja.set(Qn,!Zn),setText:Zn=>Qa(Qn,k1,{text:Zn}),setIcon:Zn=>Qa(Qn,G_,{icon:Zn})}),P7=(Qn,Zn)=>Qn.map(Yn=>({"aria-label":Zn.translate(Yn),title:Zn.translate(Yn)})).getOr({}),$7=ba("focus-button"),$$=(Qn,Zn,Yn,Jn,oo)=>{const lo=Zn.map(yo=>ou(jB(yo,"tox-tbtn",oo))),mo=Qn.map(yo=>ou(Y_(yo,oo.icons)));return{dom:{tag:"button",classes:["tox-tbtn"].concat(Zn.isSome()?["tox-tbtn--select"]:[]),attributes:P7(Yn,oo)},components:Hk([mo.map(yo=>yo.asSpec()),lo.map(yo=>yo.asSpec())]),eventOrder:{[Xl()]:["focusing","alloy.base.behaviour",Ww],[Zh()]:[Ww,"toolbar-group-button-events"]},buttonBehaviours:Zr([Lf.toolbarButton(oo.isDisabled),jf(),Rl(Ww,[eu((yo,Co)=>TM(yo)),wr(k1,(yo,Co)=>{lo.bind(Ro=>Ro.getOpt(yo)).each(Ro=>{Cl.set(Ro,[wd(oo.translate(Co.event.text))])})}),wr(G_,(yo,Co)=>{mo.bind(Ro=>Ro.getOpt(yo)).each(Ro=>{Cl.set(Ro,[Y_(Co.event.icon,oo.icons)])})}),wr(Xl(),(yo,Co)=>{Co.event.prevent(),Wl(yo,$7)})])].concat(Jn.getOr([])))}},R7=(Qn,Zn,Yn,Jn)=>{const oo=Zn.shared,lo=Ua(xo),mo={toolbarButtonBehaviours:[],getApi:A7,onSetup:Qn.onSetup},yo=[Rl("toolbar-group-button-events",[H_(mo,lo),_y(mo,lo)])];return tS.sketch({lazySink:oo.getSink,fetch:()=>Cm.nu(Co=>{Co(hs(Yn(Qn.items),y$))}),markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:$$(Qn.icon,Qn.text,Qn.tooltip,ko.some(yo),oo.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:Jn}}}})},D7=(Qn,Zn,Yn)=>{var Jn;const oo=Ua(xo),lo=$$(Qn.icon,Qn.text,Qn.tooltip,ko.none(),Yn);return yh.sketch({dom:lo.dom,components:lo.components,eventOrder:QP,buttonBehaviours:{...Zr([Rl("toolbar-button-events",[CW({onAction:Qn.onAction,getApi:Zn.getApi}),H_(Zn,oo),_y(Zn,oo)]),Lf.toolbarButton(()=>!Qn.enabled||Yn.isDisabled()),jf()].concat(Zn.toolbarButtonBehaviours)),[Ww]:(Jn=lo.buttonBehaviours)===null||Jn===void 0?void 0:Jn[Ww]}})},lj=(Qn,Zn)=>M7(Qn,Zn,[]),M7=(Qn,Zn,Yn)=>D7(Qn,{toolbarButtonBehaviours:Yn.length>0?[Rl("toolbarButtonWith",Yn)]:[],getApi:A7,onSetup:Qn.onSetup},Zn),cj=(Qn,Zn)=>N7(Qn,Zn,[]),N7=(Qn,Zn,Yn)=>D7(Qn,{toolbarButtonBehaviours:[Cl.config({}),Ql.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(Yn.length>0?[Rl("toolbarToggleButtonWith",Yn)]:[]),getApi:X4,onSetup:Qn.onSetup},Zn),uj=(Qn,Zn,Yn)=>Jn=>Cm.nu(oo=>Zn.fetch(oo)).map(oo=>ko.from(gP(Lc(MD(ba("menu-value"),oo,lo=>{Zn.onItemAction(Qn(Jn),lo)},Zn.columns,Zn.presets,sv.CLOSE_ON_EXECUTE,Zn.select.getOr(sr),Yn),{movement:fP(Zn.columns,Zn.presets),menuBehaviours:bE.unnamedEvents(Zn.columns!=="auto"?[]:[eu((lo,mo)=>{aD(lo,4,iL(Zn.presets)).each(({numRows:yo,numColumns:Co})=>{Za.setGridSize(lo,yo,Co)})})])})))),L7=(Qn,Zn)=>{const Yn=lo=>({isEnabled:()=>!Ja.isDisabled(lo),setEnabled:mo=>Ja.set(lo,!mo),setIconFill:(mo,yo)=>{Rd(lo.element,`svg path[class="${mo}"], rect[class="${mo}"]`).each(Co=>{aa(Co,"fill",yo)})},setActive:mo=>{aa(lo.element,"aria-pressed",mo),Rd(lo.element,"span").each(yo=>{lo.getSystem().getByDom(yo).each(Co=>Ql.set(Co,mo))})},isActive:()=>Rd(lo.element,"span").exists(mo=>lo.getSystem().getByDom(mo).exists(Ql.isOn)),setText:mo=>Rd(lo.element,"span").each(yo=>lo.getSystem().getByDom(yo).each(Co=>Qa(Co,k1,{text:mo}))),setIcon:mo=>Rd(lo.element,"span").each(yo=>lo.getSystem().getByDom(yo).each(Co=>Qa(Co,G_,{icon:mo}))),setTooltip:mo=>{const yo=Zn.providers.translate(mo);Qp(lo.element,{"aria-label":yo,title:yo})}}),Jn=Ua(xo),oo={getApi:Yn,onSetup:Qn.onSetup};return P$.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:{"aria-pressed":!1,...P7(Qn.tooltip,Zn.providers)}},onExecute:lo=>{const mo=Yn(lo);mo.isEnabled()&&Qn.onAction(mo)},onItemExecute:(lo,mo,yo)=>{},splitDropdownBehaviours:Zr([Lf.splitButton(Zn.providers.isDisabled),jf(),Rl("split-dropdown-events",[eu((lo,mo)=>TM(lo)),wr($7,ol.focus),H_(oo,Jn),_y(oo,Jn)]),$E.config({})]),eventOrder:{[Zh()]:["alloy.base.behaviour","split-dropdown-events"]},toggleClass:"tox-tbtn--enabled",lazySink:Zn.getSink,fetch:uj(Yn,Qn,Zn.providers),parts:{menu:Dk(!1,Qn.columns,Qn.presets)},components:[P$.parts.button($$(Qn.icon,Qn.text,ko.none(),ko.some([Ql.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),Zn.providers)),P$.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:yR("chevron-down",Zn.providers.icons)},buttonBehaviours:Zr([Lf.splitButton(Zn.providers.isDisabled),jf(),AA()])}),P$.parts["aria-descriptor"]({text:Zn.providers.translate("To open the popup, press Shift+Enter")})]})},dj=[{name:"history",items:["undo","redo"]},{name:"ai",items:["aidialog","aishortcuts"]},{name:"styles",items:["styles"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],aT=(Qn,Zn)=>(Yn,Jn,oo)=>{const lo=Qn(Yn).mapError(mo=>Gf(mo)).getOrDie();return Zn(lo,Jn,oo)},fj={button:aT(sD,(Qn,Zn)=>lj(Qn,Zn.shared.providers)),togglebutton:aT(xL,(Qn,Zn)=>cj(Qn,Zn.shared.providers)),menubutton:aT(S4,(Qn,Zn)=>zE(Qn,"tox-tbtn",Zn,ko.none(),!1)),splitbutton:aT($Z,(Qn,Zn)=>L7(Qn,Zn.shared)),grouptoolbarbutton:aT(AZ,(Qn,Zn,Yn)=>{const Jn=Yn.ui.registry.getAll().buttons,oo=mo=>M$(Yn,{buttons:Jn,toolbar:mo,allowToolbarGroups:!1},Zn,ko.none()),lo={[oy]:Zn.shared.header.isPositionedAtTop()?$p.TopToBottom:$p.BottomToTop};switch(Tk(Yn)){case qg.floating:return R7(Qn,Zn,oo,lo);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})},hj=(Qn,Zn,Yn)=>Rr(fj,Qn.type).fold(()=>(console.error("skipping button defined by",Qn),ko.none()),Jn=>ko.some(Jn(Qn,Zn,Yn))),lT={styles:h2,fontsize:w7,fontsizeinput:k7,fontfamily:v7,blocks:Iq,align:Mq},mj=Qn=>{const Zn=hs(dj,Yn=>{const Jn=ga(Yn.items,oo=>Pl(Qn,oo)||Pl(lT,oo));return{name:Yn.name,items:Jn}});return ga(Zn,Yn=>Yn.items.length>0)},R$=Qn=>{const Zn=Qn.split("|");return hs(Zn,Yn=>({items:Yn.trim().split(" ")}))},D$=Qn=>Do(Qn,Zn=>Pl(Zn,"name")&&Pl(Zn,"items")),I7=Qn=>{const Zn=Qn.toolbar,Yn=Qn.buttons;return Zn===!1?[]:Zn===void 0||Zn===!0?mj(Yn):qn(Zn)?R$(Zn):D$(Zn)?Zn:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},pj=(Qn,Zn,Yn,Jn,oo,lo)=>Rr(Zn,Yn.toLowerCase()).orThunk(()=>lo.bind(mo=>gc(mo,yo=>Rr(Zn,yo+Yn.toLowerCase())))).fold(()=>Rr(lT,Yn.toLowerCase()).map(mo=>mo(Qn,oo)),mo=>mo.type==="grouptoolbarbutton"&&!Jn?(console.warn(`Ignoring the '${Yn}' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested.`),ko.none()):hj(mo,oo,Qn)),M$=(Qn,Zn,Yn,Jn)=>{const oo=I7(Zn),lo=hs(oo,mo=>{const yo=fs(mo.items,Co=>Co.trim().length===0?[]:pj(Qn,Zn.buttons,Co,Zn.allowToolbarGroups,Yn,Jn).toArray());return{title:ko.from(Qn.translate(mo.name)),items:yo}});return ga(lo,mo=>mo.items.length>0)},B7=(Qn,Zn,Yn,Jn)=>{const oo=Zn.mainUi.outerContainer,lo=Yn.toolbar,mo=Yn.buttons;if(Do(lo,qn)){const yo=lo.map(Co=>{const Ro={toolbar:Co,buttons:mo,allowToolbarGroups:Yn.allowToolbarGroups};return M$(Qn,Ro,Jn,ko.none())});Hu.setToolbars(oo,yo)}else Hu.setToolbar(oo,M$(Qn,Yn,Jn,ko.none()))},F7=Tr(),gj=F7.os.isiOS()&&F7.os.version.major<=12,N$=(Qn,Zn)=>{const{uiMotherships:Yn}=Zn,Jn=Qn.dom;let oo=Qn.getWin();const lo=Qn.getDoc().documentElement,mo=Ua(vc(oo.innerWidth,oo.innerHeight)),yo=Ua(vc(lo.offsetWidth,lo.offsetHeight)),Co=()=>{const jo=mo.get();(jo.left!==oo.innerWidth||jo.top!==oo.innerHeight)&&(mo.set(vc(oo.innerWidth,oo.innerHeight)),sP(Qn))},Ro=()=>{const jo=Qn.getDoc().documentElement,es=yo.get();(es.left!==jo.offsetWidth||es.top!==jo.offsetHeight)&&(yo.set(vc(jo.offsetWidth,jo.offsetHeight)),sP(Qn))},Lo=jo=>{DQ(Qn,jo)};Jn.bind(oo,"resize",Co),Jn.bind(oo,"scroll",Lo);const Wo=a_(Ds.fromDom(Qn.getBody()),"load",Ro);Qn.on("hide",()=>{Qs(Yn,jo=>{ya(jo.element,"display","none")})}),Qn.on("show",()=>{Qs(Yn,jo=>{El(jo.element,"display")})}),Qn.on("NodeChange",Ro),Qn.on("remove",()=>{Wo.unbind(),Jn.unbind(oo,"resize",Co),Jn.unbind(oo,"scroll",Lo),oo=null})},H7=(Qn,Zn,Yn)=>{gy(Qn)&&Z0(Yn.mainUi.mothership.element,Yn.popupUi.mothership),vh(Zn,Yn.dialogUi.mothership)};var Q7=Object.freeze({__proto__:null,render:(Qn,Zn,Yn,Jn,oo)=>{const{mainUi:lo,uiMotherships:mo}=Zn,yo=Ua(0),Co=lo.outerContainer;Pq(Qn);const Ro=Ds.fromDom(oo.targetNode),Lo=Fr(rr(Ro));Z0(Ro,lo.mothership),H7(Qn,Lo,Zn),Qn.on("SkinLoaded",()=>{Hu.setSidebar(Co,Yn.sidebar,LA(Qn)),B7(Qn,Zn,Yn,Jn),yo.set(Qn.getWin().innerWidth),Hu.setMenubar(Co,k$(Qn,Yn)),Hu.setViews(Co,Yn.views),N$(Qn,Zn)});const Wo=Hu.getSocket(Co).getOrDie("Could not find expected socket element");if(gj){fu(Wo.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});const Ps=hW(()=>{Qn.dispatch("ScrollContent")},20),er=Dh(Wo.element,"scroll",Ps.throttle);Qn.on("remove",er.unbind)}zL(Qn,Zn),Qn.addCommand("ToggleSidebar",(Ps,er)=>{Hu.toggleSidebar(Co,er),Qn.dispatch("ToggleSidebar")}),Qn.addQueryValueHandler("ToggleSidebar",()=>{var Ps;return(Ps=Hu.whichSidebar(Co))!==null&&Ps!==void 0?Ps:""}),Qn.addCommand("ToggleView",(Ps,er)=>{if(Hu.toggleView(Co,er)){const Bs=Co.element;lo.mothership.broadcastOn([db()],{target:Bs}),Qs(mo,Ns=>{Ns.broadcastOn([db()],{target:Bs})}),io(Hu.whichView(Co))&&(Qn.focus(),Qn.nodeChanged(),Hu.refreshToolbar(Co))}}),Qn.addQueryValueHandler("ToggleView",()=>{var Ps;return(Ps=Hu.whichView(Co))!==null&&Ps!==void 0?Ps:""});const jo=Tk(Qn),es=()=>{Hu.refreshToolbar(Zn.mainUi.outerContainer)};(jo===qg.sliding||jo===qg.floating)&&Qn.on("ResizeWindow ResizeEditor ResizeContent",()=>{const Ps=Qn.getWin().innerWidth;Ps!==yo.get()&&(es(),yo.set(Ps))});const us={setEnabled:Ps=>{eP(Zn,!Ps)},isEnabled:()=>!Ja.isDisabled(Co)};return{iframeContainer:Wo.element.dom,editorContainer:Co.element.dom,api:us}}});const L$=Qn=>/^[0-9\.]+(|px)$/i.test(""+Qn)?ko.some(parseInt(""+Qn,10)):ko.none(),Y4=Qn=>$o(Qn)?Qn+"px":Qn,cT=(Qn,Zn,Yn)=>{const Jn=Zn.filter(lo=>QnQn>lo);return Jn.or(oo).getOr(Qn)},vj=Qn=>{const Zn=PA(Qn),Yn=Ek(Qn),Jn=CR(Qn);return L$(Zn).map(oo=>cT(oo,Yn,Jn))},yj=Qn=>vj(Qn).getOr(PA(Qn)),V7=Qn=>{const Zn=aE(Qn),Yn=wR(Qn),Jn=$A(Qn);return L$(Zn).map(oo=>cT(oo,Yn,Jn))},Oj=Qn=>V7(Qn).getOr(aE(Qn)),{ToolbarLocation:G4,ToolbarMode:m2}=H9,_j=40,Sj=(Qn,Zn,Yn,Jn,oo)=>{const{mainUi:lo,uiMotherships:mo}=Yn,yo=Mw.DOM,Co=$k(Qn),Ro=uE(Qn),Lo=$A(Qn).or(V7(Qn)),Wo=Jn.shared.header,jo=Wo.isPositionedAtTop,es=Tk(Qn),us=es===m2.sliding||es===m2.floating,Ps=Ua(!1),er=()=>Ps.get()&&!Qn.removed,Bs=Ga=>us?Ga.fold(Mo(0),yc=>yc.components().length>1?cu(yc.components()[1].element):0):0,Ns=Ga=>{switch(lE(Qn)){case G4.auto:const yc=Hu.getToolbar(lo.outerContainer),oa=Bs(yc),$a=cu(Ga.element)-oa,hl=au(Zn);if(hl.y>$a)return"top";{const Ka=Xf(Zn),kl=Math.max(Ka.dom.scrollHeight,cu(Ka));return hl.bottom{oo.on(yc=>{rf.setModes(yc,[Ga]),Wo.setDockingMode(Ga);const oa=jo()?$p.TopToBottom:$p.BottomToTop;aa(yc.element,oy,oa)})},Hr=()=>{oo.on(Ga=>{const yc=Lo.getOrThunk(()=>{const oa=L$(qc(Ru(),"margin-left")).getOr(0);return dd(Ru())-uh(Zn).left+oa});ya(Ga.element,"max-width",yc+"px")})},kr=Ga=>{oo.on(yc=>{const oa=Hu.getToolbar(lo.outerContainer),$a=Bs(oa),hl=au(Zn),{top:gl,left:Ka}=Or(Qn,lo.outerContainer.element).fold(()=>({top:jo()?Math.max(hl.y-cu(yc.element)+$a,0):hl.bottom,left:hl.x}),Cc=>{var Ih;const Cg=au(Cc),xb=(Ih=Cc.dom.scrollTop)!==null&&Ih!==void 0?Ih:0,m0=Oc(Cc,Ru()),dS=m0?Math.max(hl.y-cu(yc.element)+$a,0):hl.y-Cg.y+xb-cu(yc.element)+$a;return{top:jo()?dS:hl.bottom,left:m0?hl.x:hl.x-Cg.x}}),kl={position:"absolute",left:Math.round(Ka)+"px",top:Math.round(gl)+"px"},$u=Ga.map(Cc=>{const Ih=Af(),Cg=150,xb=window.innerWidth-(Ka-Ih.left);return{width:Math.max(Math.min(Cc,xb),Cg)+"px"}}).getOr({});fu(lo.outerContainer.element,{...kl,...$u})})},Or=(Ga,yc)=>gy(Ga)?qw(yc):ko.none(),qr=()=>{Qs(mo,Ga=>{Ga.broadcastOn([uO()],{})})},na=()=>{if(Co)return ko.none();if(uh(lo.outerContainer.element).left+yd(lo.outerContainer.element)>=window.innerWidth-_j||ku(lo.outerContainer.element,"width").isSome()){ya(lo.outerContainer.element,"position","absolute"),ya(lo.outerContainer.element,"left","0px"),El(lo.outerContainer.element,"width");const yc=yd(lo.outerContainer.element);return ko.some(yc)}else return ko.none()},Dl=Ga=>{if(!er())return;Co||Hr();const yc=Co?ko.none():na();us&&Hu.refreshToolbar(lo.outerContainer),Co||kr(yc),Ro&&oo.on(Ga),qr()},Sa=()=>Co||!Ro||!er()?!1:oo.get().exists(Ga=>{const yc=Wo.getDockingMode(),oa=Ns(Ga);return oa!==yc?(Xs(oa),!0):!1});return{isVisible:er,isPositionedAtTop:jo,show:()=>{Ps.set(!0),ya(lo.outerContainer.element,"display","flex"),yo.addClass(Qn.getBody(),"mce-edit-focus"),Qs(mo,Ga=>{El(Ga.element,"display")}),Sa(),gy(Qn)?Dl(Ga=>rf.isDocked(Ga)?rf.reset(Ga):rf.refresh(Ga)):Dl(rf.refresh)},hide:()=>{Ps.set(!1),ya(lo.outerContainer.element,"display","none"),yo.removeClass(Qn.getBody(),"mce-edit-focus"),Qs(mo,Ga=>{ya(Ga.element,"display","none")})},update:Dl,updateMode:()=>{Sa()&&Dl(rf.reset)},repositionPopups:qr}},z7=(Qn,Zn)=>{const Yn=au(Qn);return{pos:Zn?Yn.y:Yn.bottom,bounds:Yn}},W7=(Qn,Zn,Yn,Jn)=>{const oo=Ua(z7(Zn,Yn.isPositionedAtTop())),lo=Ro=>{const{pos:Lo,bounds:Wo}=z7(Zn,Yn.isPositionedAtTop()),{pos:jo,bounds:es}=oo.get(),us=Wo.height!==es.height||Wo.width!==es.width;oo.set({pos:Lo,bounds:Wo}),us&&sP(Qn,Ro),Yn.isVisible()&&(jo!==Lo?Yn.update(rf.reset):us&&(Yn.updateMode(),Yn.repositionPopups()))};Jn||(Qn.on("activate",Yn.show),Qn.on("deactivate",Yn.hide)),Qn.on("SkinLoaded ResizeWindow",()=>Yn.update(rf.reset)),Qn.on("NodeChange keydown",Ro=>{requestAnimationFrame(()=>lo(Ro))});let mo=0;const yo=IP(()=>Yn.update(rf.refresh),33);Qn.on("ScrollWindow",()=>{const Ro=Af().left;Ro!==mo&&(mo=Ro,yo.throttle()),Yn.updateMode()}),gy(Qn)&&Qn.on("ElementScroll",Ro=>{Yn.update(rf.refresh)});const Co=ab();Co.set(a_(Ds.fromDom(Qn.getBody()),"load",Ro=>lo(Ro.raw))),Qn.on("remove",()=>{Co.clear()})};var U7=Object.freeze({__proto__:null,render:(Qn,Zn,Yn,Jn,oo)=>{const{mainUi:lo}=Zn,mo=Hl(),yo=Ds.fromDom(oo.targetNode),Co=Sj(Qn,yo,Zn,Jn,mo),Ro=z5(Qn);$q(Qn);const Lo=()=>{if(mo.isSet()){Co.show();return}mo.set(Hu.getHeader(lo.outerContainer).getOrDie());const jo=NR(Qn);gy(Qn)?(Z0(yo,lo.mothership),Z0(yo,Zn.popupUi.mothership)):vh(jo,lo.mothership),vh(jo,Zn.dialogUi.mothership),B7(Qn,Zn,Yn,Jn),Hu.setMenubar(lo.outerContainer,k$(Qn,Yn)),Co.show(),W7(Qn,yo,Co,Ro),Qn.nodeChanged()};Qn.on("show",Lo),Qn.on("hide",Co.hide),Ro||(Qn.on("focus",Lo),Qn.on("blur",Co.hide)),Qn.on("init",()=>{(Qn.hasFocus()||Ro)&&Lo()}),zL(Qn,Zn);const Wo={show:Lo,hide:Co.hide,setEnabled:jo=>{eP(Zn,!jo)},isEnabled:()=>!Ja.isDisabled(lo.outerContainer)};return{editorContainer:lo.outerContainer.element.dom,api:Wo}}});const wj=()=>{const Qn=Hl(),Zn=Hl(),Yn=Hl();return{dialogUi:Qn,popupUi:Zn,mainUi:Yn,getUiMotherships:()=>{const lo=Qn.get().map(yo=>yo.mothership),mo=Zn.get().map(yo=>yo.mothership);return lo.fold(()=>mo.toArray(),yo=>mo.fold(()=>[yo],Co=>Oc(yo.element,Co.element)?[yo]:[yo,Co]))},lazyGetInOuterOrDie:(lo,mo)=>()=>Yn.get().bind(yo=>mo(yo.outerContainer)).getOrDie(`Could not find ${lo} element in OuterContainer`)}},Cj="contexttoolbar-show",Z7="contexttoolbar-hide",kj=Qn=>({hide:()=>Wl(Qn,Fy()),getValue:()=>da.getValue(Qn)}),q7=(Qn,Zn)=>wr(EM,(Yn,Jn)=>{const oo=Qn.get(Yn),lo=kj(oo);Zn.onAction(lo,Jn.event.buttonApi)}),uT=(Qn,Zn,Yn)=>{const{primary:Jn,...oo}=Zn.original,lo=Ec(sD({...oo,type:"button",onAction:xo}));return M7(lo,Yn,[q7(Qn,Zn)])},j7=(Qn,Zn,Yn)=>{const{primary:Jn,...oo}=Zn.original,lo=Ec(xL({...oo,type:"togglebutton",onAction:xo}));return N7(lo,Yn,[q7(Qn,Zn)])},xj=Qn=>Qn.type==="contextformtogglebutton",Ej=(Qn,Zn,Yn)=>xj(Zn)?j7(Qn,Zn,Yn):uT(Qn,Zn,Yn),X7=(Qn,Zn,Yn)=>{const Jn=hs(Zn,mo=>ou(Ej(Qn,mo,Yn)));return{asSpecs:()=>hs(Jn,mo=>mo.asSpec()),findPrimary:mo=>gc(Zn,(yo,Co)=>yo.primary?ko.from(Jn[Co]).bind(Ro=>Ro.getOpt(mo)).filter(is(Ja.isDisabled)):ko.none())}},I$=(Qn,Zn)=>{const Yn=Qn.label.fold(()=>({}),lo=>({"aria-label":lo})),Jn=ou(Lw.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:Qn.initValue(),inputAttributes:Yn,selectOnFocus:!0,inputBehaviours:Zr([Za.config({mode:"special",onEnter:lo=>oo.findPrimary(lo).map(mo=>(og(mo),!0)),onLeft:(lo,mo)=>(mo.cut(),ko.none()),onRight:(lo,mo)=>(mo.cut(),ko.none())})])})),oo=X7(Jn,Qn.commands,Zn);return[{title:ko.none(),items:[Jn.asSpec()]},{title:ko.none(),items:oo.asSpecs()}]},Y7={renderContextForm:(Qn,Zn,Yn)=>O$({type:Qn,uid:ba("context-toolbar"),initGroups:I$(Zn,Yn),onEscape:ko.none,cyclicKeying:!0,providers:Yn}),buildInitGroups:I$},G7=(Qn,Zn,Yn)=>Zn.bottom-Qn.y>=Yn&&Qn.bottom-Zn.y>=Yn,p2=Qn=>{const Zn=Qn.getBoundingClientRect();if(Zn.height<=0&&Zn.width<=0){const Yn=Eg(Ds.fromDom(Qn.startContainer),Qn.startOffset).element;return(Td(Yn)?Zd(Yn):ko.some(Yn)).filter(fc).map(oo=>oo.dom.getBoundingClientRect()).getOr(Zn)}else return Zn},g2=Qn=>{const Zn=Qn.selection.getRng(),Yn=p2(Zn);if(Qn.inline){const Jn=Af();return Kc(Jn.left+Yn.left,Jn.top+Yn.top,Yn.width,Yn.height)}else{const Jn=cf(Ds.fromDom(Qn.getBody()));return Kc(Jn.x+Yn.left,Jn.y+Yn.top,Yn.width,Yn.height)}},K4=(Qn,Zn)=>Zn.filter(Yn=>Gl(Yn)&&sm(Yn)).map(cf).getOrThunk(()=>g2(Qn)),K7=(Qn,Zn,Yn)=>{const Jn=Math.max(Qn.x+Yn,Zn.x),oo=Math.min(Qn.right-Yn,Zn.right);return{x:Jn,width:oo-Jn}},J7=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=Ds.fromDom(Qn.getContainer()),yo=Rd(mo,".tox-editor-header").getOr(mo),Co=au(yo),Ro=Co.y>=Zn.bottom,Lo=Jn&&!Ro;if(Qn.inline&&Lo)return{y:Math.max(Co.bottom+lo,Yn.y),bottom:Yn.bottom};if(Qn.inline&&!Lo)return{y:Yn.y,bottom:Math.min(Co.y-lo,Yn.bottom)};const Wo=oo==="line"?au(mo):Zn;return Lo?{y:Math.max(Co.bottom+lo,Yn.y),bottom:Math.min(Wo.bottom-lo,Yn.bottom)}:{y:Math.max(Wo.y+lo,Yn.y),bottom:Math.min(Co.y-lo,Yn.bottom)}},e8=(Qn,Zn,Yn,Jn=0)=>{const oo=Pb(window),lo=au(Ds.fromDom(Qn.getContentAreaContainer())),mo=Pk(Qn)||HA(Qn)||cE(Qn),{x:yo,width:Co}=K7(lo,oo,Jn);if(Qn.inline&&!mo)return Kc(yo,oo.y,Co,oo.height);{const Ro=Zn.header.isPositionedAtTop(),{y:Lo,bottom:Wo}=J7(Qn,lo,oo,Ro,Yn,Jn);return Kc(yo,Lo,Co,Wo-Lo)}},dT=12,t8={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},n8={maxHeightFunction:zg(),maxWidthFunction:P4()},Aj=(Qn,Zn)=>{const Yn=Qn.selection.getRng(),Jn=Eg(Ds.fromDom(Yn.startContainer),Yn.startOffset);return Yn.startContainer===Yn.endContainer&&Yn.startOffset===Yn.endOffset-1&&Oc(Jn.element,Zn)},Pj=(Qn,Zn,Yn)=>{const Jn=ku(Qn,"position");ya(Qn,"position",Zn);const oo=Yn(Qn);return Jn.each(lo=>ya(Qn,"position",lo)),oo},o8=Qn=>Qn==="node",s8=(Qn,Zn,Yn,Jn,oo)=>{const lo=g2(Qn),mo=Jn.lastElement().exists(yo=>Oc(Yn,yo));if(Aj(Qn,Yn))return mo?GM:f0;if(mo)return Pj(Zn,Jn.getMode(),()=>G7(lo,au(Zn),-20)&&!Jn.isReposition()?wU:GM);{const yo=Jn.getMode()==="fixed"?oo.y+Af().top:oo.y,Co=cu(Zn)+dT;return yo+Co<=lo.y?f0:s2}},B$=(Qn,Zn,Yn,Jn)=>{const oo=Co=>(Ro,Lo,Wo,jo,es)=>{const us=s8(Qn,jo,Co,Yn,es),Ps={...Ro,y:es.y,height:es.height};return{...us(Ps,Lo,Wo,jo,es),alwaysFit:!0}},lo=Co=>o8(Jn)?[oo(Co)]:[];return Zn?{onLtr:Co=>[bu,gf,eh,bf,$l,Rh].concat(lo(Co)),onRtl:Co=>[bu,eh,gf,$l,bf,Rh].concat(lo(Co))}:{onLtr:Co=>[Rh,bu,bf,gf,$l,eh].concat(lo(Co)),onRtl:Co=>[Rh,bu,$l,eh,bf,gf].concat(lo(Co))}},r8=(Qn,Zn,Yn,Jn)=>Zn==="line"?{bubble:p1(dT,0,t8),layouts:{onLtr:()=>[vf],onRtl:()=>[Gy]},overrides:n8}:{bubble:p1(0,dT,t8,1/dT),layouts:B$(Qn,Yn,Jn,Zn),overrides:n8},F$=(Qn,Zn)=>{const Yn=ga(Zn,lo=>lo.predicate(Qn.dom)),{pass:Jn,fail:oo}=el(Yn,lo=>lo.type==="contexttoolbar");return{contextToolbars:Jn,contextForms:oo}},J4=Qn=>{if(Qn.length<=1)return Qn;{const Zn=lo=>Br(Qn,mo=>mo.position===lo),Yn=lo=>ga(Qn,mo=>mo.position===lo),Jn=Zn("selection"),oo=Zn("node");if(Jn||oo)if(oo&&Jn){const lo=Yn("node"),mo=hs(Yn("selection"),yo=>({...yo,position:"node"}));return lo.concat(mo)}else return Yn(Jn?"selection":"node");else return Yn("line")}},$j=Qn=>{if(Qn.length<=1)return Qn;{const Zn=Jn=>Zs(Qn,oo=>oo.position===Jn);return Zn("selection").orThunk(()=>Zn("node")).orThunk(()=>Zn("line")).map(Jn=>Jn.position).fold(()=>[],Jn=>ga(Qn,oo=>oo.position===Jn))}},i8=(Qn,Zn,Yn)=>{const Jn=F$(Qn,Zn);if(Jn.contextForms.length>0)return ko.some({elem:Qn,toolbars:[Jn.contextForms[0]]});{const oo=F$(Qn,Yn);if(oo.contextForms.length>0)return ko.some({elem:Qn,toolbars:[oo.contextForms[0]]});if(Jn.contextToolbars.length>0||oo.contextToolbars.length>0){const lo=J4(Jn.contextToolbars.concat(oo.contextToolbars));return ko.some({elem:Qn,toolbars:lo})}else return ko.none()}},Rj=(Qn,Zn,Yn)=>Qn(Zn)?ko.none():Uh(Zn,Jn=>{if(fc(Jn)){const{contextToolbars:oo,contextForms:lo}=F$(Jn,Yn.inNodeScope),mo=lo.length>0?lo:$j(oo);return mo.length>0?ko.some({elem:Jn,toolbars:mo}):ko.none()}else return ko.none()},Qn),Dj=(Qn,Zn)=>{const Yn=Ds.fromDom(Zn.getBody()),Jn=mo=>Oc(mo,Yn),oo=mo=>!Jn(mo)&&!cd(Yn,mo),lo=Ds.fromDom(Zn.selection.getNode());return oo(lo)?ko.none():i8(lo,Qn.inNodeScope,Qn.inEditorScope).orThunk(()=>Rj(Jn,lo,Qn))},H$=(Qn,Zn)=>{const Yn={},Jn=[],oo=[],lo={},mo={},yo=(Lo,Wo)=>{const jo=Ec(aQ(Wo));Yn[Lo]=jo,jo.launch.map(es=>{lo["form:"+Lo]={...Wo.launch,type:es.type==="contextformtogglebutton"?"togglebutton":"button",onAction:()=>{Zn(jo)}}}),jo.scope==="editor"?oo.push(jo):Jn.push(jo),mo[Lo]=jo},Co=(Lo,Wo)=>{cQ(Wo).each(jo=>{Wo.scope==="editor"?oo.push(jo):Jn.push(jo),mo[Lo]=jo})},Ro=nc(Qn);return Qs(Ro,Lo=>{const Wo=Qn[Lo];Wo.type==="contextform"?yo(Lo,Wo):Wo.type==="contexttoolbar"&&Co(Lo,Wo)}),{forms:Yn,inNodeScope:Jn,inEditorScope:oo,lookupTable:mo,formNavigators:lo}},eN=ba("forward-slide"),a8=ba("backward-slide"),tN=ba("change-slide-event"),nN="tox-pop--resizing",Mj=Qn=>{const Zn=Ua([]);return kd.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:Yn=>{Zn.set([]),kd.getContent(Yn).each(Jn=>{El(Jn.element,"visibility")}),Yu(Yn.element,nN),El(Yn.element,"width")},inlineBehaviours:Zr([Rl("context-toolbar-events",[rg(V1(),(Yn,Jn)=>{Jn.event.raw.propertyName==="width"&&(Yu(Yn.element,nN),El(Yn.element,"width"))}),wr(tN,(Yn,Jn)=>{const oo=Yn.element;El(oo,"width");const lo=dd(oo);kd.setContent(Yn,Jn.event.contents),$d(oo,nN);const mo=dd(oo);ya(oo,"width",lo+"px"),kd.getContent(Yn).each(yo=>{Jn.event.focus.bind(Co=>(Cd(Co),dg(oo))).orThunk(()=>(Za.focusIn(yo),h1(rr(oo))))}),setTimeout(()=>{ya(Yn.element,"width",mo+"px")},0)}),wr(eN,(Yn,Jn)=>{kd.getContent(Yn).each(oo=>{Zn.set(Zn.get().concat([{bar:oo,focus:h1(rr(Yn.element))}]))}),Qa(Yn,tN,{contents:Jn.event.forwardContents,focus:ko.none()})}),wr(a8,(Yn,Jn)=>{Zc(Zn.get()).each(oo=>{Zn.set(Zn.get().slice(0,Zn.get().length-1)),Qa(Yn,tN,{contents:Fm(oo.bar),focus:oo.focus})})})]),Za.config({mode:"special",onEscape:Yn=>Zc(Zn.get()).fold(()=>Qn.onEscape(),Jn=>(Wl(Yn,a8),ko.some(!0)))})]),lazySink:()=>yl.value(Qn.sink)})},oN="tox-pop--transition",l8=(Qn,Zn,Yn,Jn)=>{const oo=Jn.backstage,lo=oo.shared,mo=Tr().deviceType.isTouch,yo=Hl(),Co=Hl(),Ro=Hl(),Lo=gh(Mj({sink:Yn,onEscape:()=>(Qn.focus(),ko.some(!0))})),Wo=()=>{const Sa=Ro.get().getOr("node"),fl=o8(Sa)?1:0;return e8(Qn,lo,Sa,fl)},jo=()=>!Qn.removed&&!(mo()&&oo.isContextMenuOpen()),es=Sa=>vs(ia(Sa,yo.get(),Oc),!0),us=()=>{if(jo()){const Sa=Wo(),fl=vs(Ro.get(),"node")?K4(Qn,yo.get()):g2(Qn);return Sa.height<=0||!G7(fl,Sa,.01)}else return!0},Ps=()=>{yo.clear(),Co.clear(),Ro.clear(),kd.hide(Lo)},er=()=>{if(kd.isOpen(Lo)){const Sa=Lo.element;El(Sa,"display"),us()?ya(Sa,"display","none"):(Co.set(0),kd.reposition(Lo))}},Bs=Sa=>({dom:{tag:"div",classes:["tox-pop__dialog"]},components:[Sa],behaviours:Zr([Za.config({mode:"acyclic"}),Rl("pop-dialog-wrap-events",[eu(fl=>{Qn.shortcuts.add("ctrl+F9","focus statusbar",()=>Za.focusIn(fl))}),ig(fl=>{Qn.shortcuts.remove("ctrl+F9")})])])}),Ns=Du(()=>H$(Zn,Sa=>{const fl=kr([Sa]);Qa(Lo,eN,{forwardContents:Bs(fl)})})),Xs=(Sa,fl)=>M$(Qn,{buttons:Sa,toolbar:fl.items,allowToolbarGroups:!1},Jn.backstage,ko.some(["form:"])),Hr=(Sa,fl)=>Y7.buildInitGroups(Sa,fl),kr=Sa=>{const{buttons:fl}=Qn.ui.registry.getAll(),rl=Ns(),Yc={...fl,...rl.formNavigators},Ga=Tk(Qn)===qg.scrolling?qg.scrolling:qg.default,yc=Us(hs(Sa,oa=>oa.type==="contexttoolbar"?Xs(Yc,oa):Hr(oa,lo.providers)));return O$({type:Ga,uid:ba("context-toolbar"),initGroups:yc,onEscape:ko.none,cyclicKeying:!0,providers:lo.providers})},Or=(Sa,fl)=>{const rl=Sa==="node"?lo.anchors.node(fl):lo.anchors.cursor(),Yc=r8(Qn,Sa,mo(),{lastElement:yo.get,isReposition:()=>vs(Co.get(),0),getMode:()=>jh.getMode(Yn)});return Lc(rl,Yc)},qr=(Sa,fl)=>{if(Dl.cancel(),!jo())return;const rl=kr(Sa),Yc=Sa[0].position,Ga=Or(Yc,fl);Ro.set(Yc),Co.set(1);const yc=Lo.element;El(yc,"display"),es(fl)||(Yu(yc,oN),jh.reset(Yn,Lo)),kd.showWithinBounds(Lo,Bs(rl),{anchor:Ga,transition:{classes:[oN],mode:"placement"}},()=>ko.some(Wo())),fl.fold(yo.clear,yo.set),us()&&ya(yc,"display","none")};let na=!1;const Dl=IP(()=>{if(!(!Qn.hasFocus()||Qn.removed||na))if(of(Lo.element,oN))Dl.throttle();else{const Sa=Ns();Dj(Sa,Qn).fold(Ps,fl=>{qr(fl.toolbars,ko.some(fl.elem))})}},17);Qn.on("init",()=>{Qn.on("remove",Ps),Qn.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",er),Qn.on("click keyup focus SetContent",Dl.throttle),Qn.on(Z7,Ps),Qn.on(Cj,Sa=>{const fl=Ns();Rr(fl.lookupTable,Sa.toolbarKey).each(rl=>{qr([rl],Mr(Sa.target!==Qn,Sa.target)),kd.getContent(Lo).each(Za.focusIn)})}),Qn.on("focusout",Sa=>{$w.setEditorTimeout(Qn,()=>{dg(Yn.element).isNone()&&dg(Lo.element).isNone()&&Ps()},0)}),Qn.on("SwitchMode",()=>{Qn.mode.isReadOnly()&&Ps()}),Qn.on("AfterProgressState",Sa=>{Sa.state?Ps():Qn.hasFocus()&&Dl.throttle()}),Qn.on("dragstart",()=>{na=!0}),Qn.on("dragend drop",()=>{na=!1}),Qn.on("NodeChange",Sa=>{dg(Lo.element).fold(Dl.throttle,xo)})})},c8=Qn=>{Qs([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],Yn=>{Qn.ui.registry.addToggleButton(Yn.name,{tooltip:Yn.text,icon:Yn.icon,onAction:bg(Qn,Yn.cmd),onSetup:rP(Qn,Yn.name)})}),Qn.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onSetup:mp(Qn),onAction:bg(Qn,"JustifyNone")})},u8=(Qn,Zn)=>{const Yn=()=>{const Jn=Zn.getOptions(Qn),oo=Zn.getCurrent(Qn).map(Zn.hash),lo=Hl();return hs(Jn,mo=>({type:"togglemenuitem",text:Zn.display(mo),onSetup:yo=>{const Co=Lo=>{Lo&&(lo.on(Wo=>Wo.setActive(!1)),lo.set(yo)),yo.setActive(Lo)};Co(vs(oo,Zn.hash(mo)));const Ro=Zn.watcher(Qn,mo,Co);return()=>{lo.clear(),Ro()}},onAction:()=>Zn.setCurrent(Qn,mo)}))};Qn.ui.registry.addMenuButton(Zn.name,{tooltip:Zn.text,icon:Zn.icon,fetch:Jn=>Jn(Yn()),onSetup:Zn.onToolbarSetup}),Qn.ui.registry.addNestedMenuItem(Zn.name,{type:"nestedmenuitem",text:Zn.text,getSubmenuItems:Yn,onSetup:Zn.onMenuSetup})},Nj=Qn=>({name:"lineheight",text:"Line height",icon:"line-height",getOptions:G5,hash:Zn=>Wq(Zn,["fixed","relative","empty"]).getOr(Zn),display:Go,watcher:(Zn,Yn,Jn)=>Zn.formatter.formatChanged("lineheight",Jn,!1,{value:Yn}).unbind,getCurrent:Zn=>ko.from(Zn.queryCommandValue("LineHeight")),setCurrent:(Zn,Yn)=>Zn.execCommand("LineHeight",!1,Yn),onToolbarSetup:mp(Qn),onMenuSetup:mp(Qn)}),d8=Qn=>ko.from(Q5(Qn)).map(Yn=>({name:"language",text:"Language",icon:"language",getOptions:Mo(Yn),hash:Jn=>ho(Jn.customCode)?Jn.code:`${Jn.code}/${Jn.customCode}`,display:Jn=>Jn.title,watcher:(Jn,oo,lo)=>{var mo;return Jn.formatter.formatChanged("lang",lo,!1,{value:oo.code,customValue:(mo=oo.customCode)!==null&&mo!==void 0?mo:null}).unbind},getCurrent:Jn=>{const oo=Ds.fromDom(Jn.selection.getNode());return Jf(oo,lo=>ko.some(lo).filter(fc).bind(mo=>Uo(mo,"lang").map(Co=>{const Ro=Uo(mo,"data-mce-lang").getOrUndefined();return{code:Co,customCode:Ro,title:""}})))},setCurrent:(Jn,oo)=>Jn.execCommand("Lang",!1,oo),onToolbarSetup:Jn=>{const oo=ab();return Jn.setActive(Qn.formatter.match("lang",{},void 0,!0)),oo.set(Qn.formatter.formatChanged("lang",Jn.setActive,!0)),SE(oo.clear,mp(Qn)(Jn))},onMenuSetup:mp(Qn)})),Lj=Qn=>{u8(Qn,Nj(Qn)),d8(Qn).each(Zn=>u8(Qn,Zn))},Ij=(Qn,Zn)=>{Nq(Qn,Zn),Qq(Qn,Zn),nj(Qn,Zn),Bq(Qn,Zn),x7(Qn,Zn)},Bj=Qn=>a0(Qn,"NodeChange",Zn=>{Zn.setEnabled(Qn.queryCommandState("outdent")&&Qn.selection.isEditable())}),Fj=Qn=>{Qn.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:Bj(Qn),onAction:bg(Qn,"outdent")}),Qn.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onSetup:mp(Qn),onAction:bg(Qn,"indent")})},Hj=Qn=>{Fj(Qn)},Q$=(Qn,Zn)=>Yn=>{Yn.setActive(Zn.get());const Jn=oo=>{Zn.set(oo.state),Yn.setActive(oo.state)};return Qn.on("PastePlainTextToggle",Jn),SE(()=>Qn.off("PastePlainTextToggle",Jn),mp(Qn)(Yn))},Qj=Qn=>{const Zn=Ua(NA(Qn)),Yn=()=>Qn.execCommand("mceTogglePlainTextPaste");Qn.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:Yn,onSetup:Q$(Qn,Zn)}),Qn.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:Yn,onSetup:Q$(Qn,Zn)})},sN=(Qn,Zn)=>()=>{Qn.execCommand("mceToggleFormat",!1,Zn)},rN=Qn=>{xO.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(Zn,Yn)=>{Qn.ui.registry.addToggleButton(Zn.name,{tooltip:Zn.text,icon:Zn.icon,onSetup:rP(Qn,Zn.name),onAction:sN(Qn,Zn.name)})});for(let Zn=1;Zn<=6;Zn++){const Yn="h"+Zn;Qn.ui.registry.addToggleButton(Yn,{text:Yn.toUpperCase(),tooltip:"Heading "+Zn,onSetup:rP(Qn,Yn),onAction:sN(Qn,Yn)})}},f8=Qn=>{xO.each([{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"print",text:"Print",action:"mcePrint",icon:"print"}],Zn=>{Qn.ui.registry.addButton(Zn.name,{tooltip:Zn.text,icon:Zn.icon,onAction:bg(Qn,Zn.action)})}),xO.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],Zn=>{Qn.ui.registry.addButton(Zn.name,{tooltip:Zn.text,icon:Zn.icon,onSetup:mp(Qn),onAction:bg(Qn,Zn.action)})})},h8=Qn=>{xO.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],Zn=>{Qn.ui.registry.addToggleButton(Zn.name,{tooltip:Zn.text,icon:Zn.icon,onAction:bg(Qn,Zn.action),onSetup:rP(Qn,Zn.name)})})},Vj=Qn=>{rN(Qn),f8(Qn),h8(Qn)},zj=Qn=>{xO.each([{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"},{name:"print",text:"Print...",action:"mcePrint",icon:"print",shortcut:"Meta+P"}],Zn=>{Qn.ui.registry.addMenuItem(Zn.name,{text:Zn.text,icon:Zn.icon,shortcut:Zn.shortcut,onAction:bg(Qn,Zn.action)})}),xO.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],Zn=>{Qn.ui.registry.addMenuItem(Zn.name,{text:Zn.text,icon:Zn.icon,shortcut:Zn.shortcut,onSetup:mp(Qn),onAction:bg(Qn,Zn.action)})}),Qn.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onSetup:mp(Qn),onAction:sN(Qn,"code")})},Wj=Qn=>{Vj(Qn),zj(Qn)},V$=(Qn,Zn)=>a0(Qn,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",Yn=>{Yn.setEnabled(!Qn.mode.isReadOnly()&&Qn.undoManager[Zn]())}),Uj=Qn=>{Qn.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:V$(Qn,"hasUndo"),onAction:bg(Qn,"undo")}),Qn.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:V$(Qn,"hasRedo"),onAction:bg(Qn,"redo")})},iN=Qn=>{Qn.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",enabled:!1,onSetup:V$(Qn,"hasUndo"),onAction:bg(Qn,"undo")}),Qn.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",enabled:!1,onSetup:V$(Qn,"hasRedo"),onAction:bg(Qn,"redo")})},Zj=Qn=>{Uj(Qn),iN(Qn)},m8=Qn=>a0(Qn,"VisualAid",Zn=>{Zn.setActive(Qn.hasVisual)}),qj=Qn=>{Qn.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:m8(Qn),onAction:bg(Qn,"mceToggleVisualAid")})},jj=Qn=>{Qn.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:bg(Qn,"mceToggleVisualAid")})},aN=Qn=>{jj(Qn),qj(Qn)},Xj=(Qn,Zn)=>{c8(Qn),Wj(Qn),Ij(Qn,Zn),Zj(Qn),CI(Qn),aN(Qn),Hj(Qn),Lj(Qn),Qj(Qn)},p8=Qn=>qn(Qn)?Qn.split(/[ ,]/):Qn,g8=Qn=>Zn=>Zn.options.get(Qn),Yj=Qn=>{const Zn=Qn.options.register;Zn("contextmenu_avoid_overlap",{processor:"string",default:""}),Zn("contextmenu_never_use_native",{processor:"boolean",default:!1}),Zn("contextmenu",{processor:Yn=>Yn===!1?{value:[],valid:!0}:qn(Yn)||Do(Yn,qn)?{value:p8(Yn),valid:!0}:{valid:!1,message:"Must be false or a string."},default:"link linkchecker image editimage table spellchecker configurepermanentpen"})},z$=g8("contextmenu_never_use_native"),Gj=g8("contextmenu_avoid_overlap"),Kj=Qn=>b8(Qn).length===0,b8=Qn=>{const Zn=Qn.ui.registry.getAll().contextMenus,Yn=Qn.options.get("contextmenu");return Qn.options.isSet("contextmenu")?Yn:ga(Yn,Jn=>Pl(Zn,Jn))},fT=(Qn,Zn)=>({type:"makeshift",x:Qn,y:Zn}),Jj=(Qn,Zn,Yn)=>fT(Qn.x+Zn,Qn.y+Yn),lN=Qn=>Qn.type==="longpress"||Qn.type.indexOf("touch")===0,eX=Qn=>{if(lN(Qn)){const Zn=Qn.touches[0];return fT(Zn.pageX,Zn.pageY)}else return fT(Qn.pageX,Qn.pageY)},tX=Qn=>{if(lN(Qn)){const Zn=Qn.touches[0];return fT(Zn.clientX,Zn.clientY)}else return fT(Qn.clientX,Qn.clientY)},nX=(Qn,Zn)=>{const Yn=Mw.DOM.getPos(Qn);return Jj(Zn,Yn.x,Yn.y)},oX=(Qn,Zn)=>Zn.type==="contextmenu"||Zn.type==="longpress"?Qn.inline?eX(Zn):nX(Qn.getContentAreaContainer(),tX(Zn)):v8(Qn),v8=Qn=>({type:"selection",root:Ds.fromDom(Qn.selection.getNode())}),sX=Qn=>({type:"node",node:ko.some(Ds.fromDom(Qn.selection.getNode())),root:Ds.fromDom(Qn.getBody())}),y8=(Qn,Zn,Yn)=>{switch(Yn){case"node":return sX(Qn);case"point":return oX(Qn,Zn);case"selection":return v8(Qn)}},rX=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=Yn(),yo=y8(Qn,Zn,lo);t2(mo,sv.CLOSE_ON_EXECUTE,Jn,{isHorizontalMenu:!1,search:ko.none()}).map(Co=>{Zn.preventDefault(),kd.showMenuAt(oo,{anchor:yo},{menu:{markers:OO("normal")},data:Co})})},O8={onLtr:()=>[bu,gf,eh,bf,$l,Rh,f0,s2,GE,YE,Zw,XE],onRtl:()=>[bu,eh,gf,$l,bf,Rh,f0,s2,Zw,XE,GE,YE]},iX=12,_8={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},aX=(Qn,Zn)=>{const Yn=Qn.selection;if(Yn.isCollapsed()||Zn.touches.length<1)return!1;{const Jn=Zn.touches[0],oo=Yn.getRng();return rw(Qn.getWin(),Zf.domRange(oo)).exists(mo=>mo.left<=Jn.clientX&&mo.right>=Jn.clientX&&mo.top<=Jn.clientY&&mo.bottom>=Jn.clientY)}},lX=Qn=>{const Zn=Qn.selection.getRng(),Yn=()=>{$w.setEditorTimeout(Qn,()=>{Qn.selection.setRng(Zn)},10),lo()};Qn.once("touchend",Yn);const Jn=mo=>{mo.preventDefault(),mo.stopImmediatePropagation()};Qn.on("mousedown",Jn,!0);const oo=()=>lo();Qn.once("longpresscancel",oo);const lo=()=>{Qn.off("touchend",Yn),Qn.off("longpresscancel",oo),Qn.off("mousedown",Jn)}},cX=(Qn,Zn,Yn)=>{const Jn=y8(Qn,Zn,Yn);return{bubble:p1(0,Yn==="point"?iX:0,_8),layouts:O8,overrides:{maxWidthFunction:P4(),maxHeightFunction:zg()},...Jn}},Yw=(Qn,Zn,Yn,Jn,oo,lo,mo)=>{const yo=cX(Qn,Zn,lo);t2(Yn,sv.CLOSE_ON_EXECUTE,Jn,{isHorizontalMenu:!0,search:ko.none()}).map(Co=>{Zn.preventDefault();const Ro=mo?hp.HighlightMenuAndItem:hp.HighlightNone;kd.showMenuWithinBounds(oo,{anchor:yo},{menu:{markers:OO("normal"),highlightOnOpen:Ro},data:Co,type:"horizontal"},()=>ko.some(e8(Qn,Jn.shared,lo==="node"?"node":"selection"))),Qn.dispatch(Z7)})},S8=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=Tr(),yo=mo.os.isiOS(),Co=mo.os.isMacOS(),Ro=mo.os.isAndroid(),Lo=mo.deviceType.isTouch(),Wo=()=>!(Ro||yo||Co&&Lo),jo=()=>{const es=Yn();Yw(Qn,Zn,es,Jn,oo,lo,Wo())};if((Co||yo)&&lo!=="node"){const es=()=>{lX(Qn),jo()};aX(Qn,Zn)?es():(Qn.once("selectionchange",es),Qn.once("touchend",()=>Qn.off("selectionchange",es)))}else jo()},w8=Qn=>qn(Qn)?Qn==="|":Qn.type==="separator",cN={type:"separator"},C8=Qn=>{const Zn=Yn=>({text:Yn.text,icon:Yn.icon,enabled:Yn.enabled,shortcut:Yn.shortcut});if(qn(Qn))return Qn;switch(Qn.type){case"separator":return cN;case"submenu":return{type:"nestedmenuitem",...Zn(Qn),getSubmenuItems:()=>{const Jn=Qn.getSubmenuItems();return qn(Jn)?Jn:hs(Jn,C8)}};default:const Yn=Qn;return{type:"menuitem",...Zn(Yn),onAction:Io(Yn.onAction)}}},k8=(Qn,Zn)=>{if(Zn.length===0)return Qn;const Jn=Zc(Qn).filter(oo=>!w8(oo)).fold(()=>[],oo=>[cN]);return Qn.concat(Jn).concat(Zn).concat([cN])},x8=(Qn,Zn,Yn)=>{const Jn=za(Zn,(oo,lo)=>Rr(Qn,lo.toLowerCase()).map(mo=>{const yo=mo.update(Yn);if(qn(yo)&&Ts(Vu(yo)))return k8(oo,yo.split(" "));if(to(yo)&&yo.length>0){const Co=hs(yo,C8);return k8(oo,Co)}else return oo}).getOrThunk(()=>oo.concat([lo])),[]);return Jn.length>0&&w8(Jn[Jn.length-1])&&Jn.pop(),Jn},uX=(Qn,Zn)=>Zn.ctrlKey&&!z$(Qn),dX=Qn=>Qn.type==="longpress"||Pl(Qn,"touches"),E8=(Qn,Zn)=>!dX(Zn)&&(Zn.button!==2||Zn.target===Qn.getBody()&&Zn.pointerType===""),T8=(Qn,Zn)=>E8(Qn,Zn)?Qn.selection.getStart(!0):Zn.target,fX=(Qn,Zn)=>{const Yn=Gj(Qn),Jn=E8(Qn,Zn)?"selection":"point";if(Ts(Yn)){const oo=T8(Qn,Zn);return xE(Ds.fromDom(oo),Yn)?"node":Jn}else return Jn},hX=(Qn,Zn,Yn)=>{const oo=Tr().deviceType.isTouch,lo=gh(kd.sketch({dom:{tag:"div"},lazySink:Zn,onEscape:()=>Qn.focus(),onShow:()=>Yn.setContextMenuState(!0),onHide:()=>Yn.setContextMenuState(!1),fireDismissalEventInstead:{},inlineBehaviours:Zr([Rl("dismissContextMenu",[wr(q1(),(Co,Ro)=>{uc.close(Co),Qn.focus()})])])})),mo=()=>kd.hide(lo),yo=Co=>{if(z$(Qn)&&Co.preventDefault(),uX(Qn,Co)||Kj(Qn))return;const Ro=fX(Qn,Co),Lo=()=>{const jo=T8(Qn,Co),es=Qn.ui.registry.getAll(),us=b8(Qn);return x8(es.contextMenus,us,jo)};(oo()?S8:rX)(Qn,Co,Lo,Yn,lo,Ro)};Qn.on("init",()=>{const Co="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(oo()?"":" ResizeWindow");Qn.on(Co,mo),Qn.on("longpress contextmenu",yo)})},uN=Po.generate([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),W$=Qn=>Zn=>Zn.translate(-Qn.left,-Qn.top),U$=Qn=>Zn=>Zn.translate(Qn.left,Qn.top),TO=Qn=>(Zn,Yn)=>za(Qn,(Jn,oo)=>oo(Jn),vc(Zn,Yn)),hT=(Qn,Zn,Yn)=>Qn.fold(TO([U$(Yn),W$(Zn)]),TO([W$(Zn)]),TO([])),Gw=(Qn,Zn,Yn)=>Qn.fold(TO([U$(Yn)]),TO([]),TO([U$(Zn)])),A8=(Qn,Zn,Yn)=>Qn.fold(TO([]),TO([W$(Yn)]),TO([U$(Zn),W$(Yn)])),mT=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=Gw(Qn,oo,lo),yo=Gw(Zn,oo,lo);return Math.abs(mo.left-yo.left)<=Yn&&Math.abs(mo.top-yo.top)<=Jn},mX=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=Gw(Qn,oo,lo),yo=Gw(Zn,oo,lo),Co=Math.abs(mo.left-yo.left),Ro=Math.abs(mo.top-yo.top);return vc(Co,Ro)},P8=(Qn,Zn,Yn)=>{const Jn=Qn.fold((oo,lo)=>({position:ko.some("absolute"),left:ko.some(oo+"px"),top:ko.some(lo+"px")}),(oo,lo)=>({position:ko.some("absolute"),left:ko.some(oo-Yn.left+"px"),top:ko.some(lo-Yn.top+"px")}),(oo,lo)=>({position:ko.some("fixed"),left:ko.some(oo+"px"),top:ko.some(lo+"px")}));return{right:ko.none(),bottom:ko.none(),...Jn}},dN=(Qn,Zn,Yn)=>Qn.fold((Jn,oo)=>Z$(Jn+Zn,oo+Yn),(Jn,oo)=>sS(Jn+Zn,oo+Yn),(Jn,oo)=>Kw(Jn+Zn,oo+Yn)),fN=(Qn,Zn,Yn,Jn)=>{const oo=(lo,mo)=>(yo,Co)=>{const Ro=lo(Zn,Yn,Jn);return mo(yo.getOr(Ro.left),Co.getOr(Ro.top))};return Qn.fold(oo(A8,Z$),oo(Gw,sS),oo(hT,Kw))},Z$=uN.offset,sS=uN.absolute,Kw=uN.fixed,$8=(Qn,Zn)=>{const Yn=Bu(Qn,Zn);return ho(Yn)?NaN:parseInt(Yn,10)},pX=(Qn,Zn)=>{const Yn=Qn.element,Jn=$8(Yn,Zn.leftAttr),oo=$8(Yn,Zn.topAttr);return isNaN(Jn)||isNaN(oo)?ko.none():ko.some(vc(Jn,oo))},gX=(Qn,Zn,Yn)=>{const Jn=Qn.element;aa(Jn,Zn.leftAttr,Yn.left+"px"),aa(Jn,Zn.topAttr,Yn.top+"px")},bX=(Qn,Zn)=>{const Yn=Qn.element;_s(Yn,Zn.leftAttr),_s(Yn,Zn.topAttr)},vX=(Qn,Zn,Yn,Jn)=>pX(Qn,Zn).fold(()=>Yn,oo=>Kw(oo.left+Jn.left,oo.top+Jn.top)),yX=(Qn,Zn,Yn,Jn,oo,lo)=>{const mo=vX(Qn,Zn,Yn,Jn),yo=Zn.mustSnap?_X(Qn,Zn,mo,oo,lo):SX(Qn,Zn,mo,oo,lo),Co=hT(mo,oo,lo);return gX(Qn,Zn,Co),yo.fold(()=>({coord:Kw(Co.left,Co.top),extra:ko.none()}),Ro=>({coord:Ro.output,extra:Ro.extra}))},OX=(Qn,Zn)=>{bX(Qn,Zn)},R8=(Qn,Zn,Yn,Jn)=>gc(Qn,oo=>{const lo=oo.sensor;return mT(Zn,lo,oo.range.left,oo.range.top,Yn,Jn)?ko.some({output:fN(oo.output,Zn,Yn,Jn),extra:oo.extra}):ko.none()}),_X=(Qn,Zn,Yn,Jn,oo)=>{const lo=Zn.getSnapPoints(Qn);return R8(lo,Yn,Jn,oo).orThunk(()=>za(lo,(Co,Ro)=>{const Lo=Ro.sensor,Wo=mX(Yn,Lo,Ro.range.left,Ro.range.top,Jn,oo);return Co.deltas.fold(()=>({deltas:ko.some(Wo),snap:ko.some(Ro)}),jo=>{const es=(Wo.left+Wo.top)/2,us=(jo.left+jo.top)/2;return es<=us?{deltas:ko.some(Wo),snap:ko.some(Ro)}:Co})},{deltas:ko.none(),snap:ko.none()}).snap.map(Co=>({output:fN(Co.output,Yn,Jn,oo),extra:Co.extra})))},SX=(Qn,Zn,Yn,Jn,oo)=>{const lo=Zn.getSnapPoints(Qn);return R8(lo,Yn,Jn,oo)},wX=(Qn,Zn,Yn)=>({coord:fN(Qn.output,Qn.output,Zn,Yn),extra:Qn.extra});var CX=Object.freeze({__proto__:null,snapTo:(Qn,Zn,Yn,Jn)=>{const oo=Zn.getTarget(Qn.element);if(Zn.repositionTarget){const lo=vd(Qn.element),mo=Af(lo),yo=u6(oo),Co=wX(Jn,mo,yo),Ro=P8(Co.coord,mo,yo);Lr(oo,Ro)}}});const b2="data-initial-z-index",kX=Qn=>{Zd(Qn.element).filter(fc).each(Zn=>{Uo(Zn,b2).fold(()=>El(Zn,"z-index"),Yn=>ya(Zn,"z-index",Yn)),_s(Zn,b2)})},xX=Qn=>{Zd(Qn.element).filter(fc).each(Zn=>{ku(Zn,"z-index").each(Yn=>{aa(Zn,b2,Yn)}),ya(Zn,"z-index",qc(Qn.element,"z-index"))})},D8=(Qn,Zn)=>{Qn.getSystem().addToGui(Zn),xX(Zn)},EX=Qn=>{kX(Qn),Qn.getSystem().removeFromGui(Qn)},M8=(Qn,Zn,Yn)=>Qn.getSystem().build(rv.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[Zn]},events:Yn}));var TX=hh("snaps",[Er("getSnapPoints"),rc("onSensor"),Er("leftAttr"),Er("topAttr"),Gs("lazyViewport",tf),Gs("mustSnap",!1)]);const q$=[Gs("useFixed",sr),Er("blockerClass"),Gs("getTarget",Go),Gs("onDrag",xo),Gs("repositionTarget",!0),Gs("onDrop",xo),Hd("getBounds",tf),TX],AX=Qn=>ka(ku(Qn,"left"),ku(Qn,"top"),ku(Qn,"position"),(Zn,Yn,Jn)=>(Jn==="fixed"?Kw:Z$)(parseInt(Zn,10),parseInt(Yn,10))).getOrThunk(()=>{const Zn=uh(Qn);return sS(Zn.left,Zn.top)}),PX=(Qn,Zn,Yn,Jn,oo)=>{const lo=oo.bounds,mo=Gw(Zn,Yn,Jn),yo=rp(mo.left,lo.x,lo.x+lo.width-oo.width),Co=rp(mo.top,lo.y,lo.y+lo.height-oo.height),Ro=sS(yo,Co);return Zn.fold(()=>{const Lo=A8(Ro,Yn,Jn);return Z$(Lo.left,Lo.top)},Mo(Ro),()=>{const Lo=hT(Ro,Yn,Jn);return Kw(Lo.left,Lo.top)})},$X=(Qn,Zn,Yn,Jn,oo,lo,mo)=>{const yo=Zn.fold(()=>{const Co=dN(Yn,lo.left,lo.top),Ro=hT(Co,Jn,oo);return Kw(Ro.left,Ro.top)},Co=>{const Ro=yX(Qn,Co,Yn,lo,Jn,oo);return Ro.extra.each(Lo=>{Co.onSensor(Qn,Lo)}),Ro.coord});return PX(Qn,yo,Jn,oo,mo)},RX=(Qn,Zn,Yn,Jn)=>{const oo=Zn.getTarget(Qn.element);if(Zn.repositionTarget){const lo=vd(Qn.element),mo=Af(lo),yo=u6(oo),Co=AX(oo),Ro=$X(Qn,Zn.snaps,Co,mo,yo,Jn,Yn),Lo=P8(Ro,mo,yo);Lr(oo,Lo)}Zn.onDrag(Qn,oo,Jn)},N8=(Qn,Zn)=>({bounds:Qn.getBounds(),height:Vp(Zn.element),width:yd(Zn.element)}),pT=(Qn,Zn,Yn,Jn,oo)=>{const lo=Yn.update(Jn,oo),mo=Yn.getStartData().getOrThunk(()=>N8(Zn,Qn));lo.each(yo=>{RX(Qn,Zn,mo,yo)})},hN=(Qn,Zn,Yn,Jn)=>{Zn.each(EX),Yn.snaps.each(lo=>{OX(Qn,lo)});const oo=Yn.getTarget(Qn.element);Jn.reset(),Yn.onDrop(Qn,oo)},mN=Qn=>(Zn,Yn)=>{const Jn=oo=>{Yn.setStartData(N8(Zn,oo))};return Jc([wr(s1(),oo=>{Yn.getStartData().each(()=>Jn(oo))}),...Qn(Zn,Yn,Jn)])},DX=Qn=>Jc([wr(Xl(),Qn.forceDrop),wr(Cv(),Qn.drop),wr(Qd(),(Zn,Yn)=>{Qn.move(Yn.event)}),wr(Rf(),Qn.delayDrop)]);var MX=Object.freeze({__proto__:null,getData:Qn=>ko.from(vc(Qn.x,Qn.y)),getDelta:(Qn,Zn)=>vc(Zn.left-Qn.left,Zn.top-Qn.top)});const L8=(Qn,Zn,Yn)=>[wr(Xl(),(Jn,oo)=>{if(oo.event.raw.button!==0)return;oo.stop();const mo=()=>hN(Jn,ko.some(Ro),Qn,Zn),yo=FI(mo,200),Co={drop:mo,delayDrop:yo.schedule,forceDrop:mo,move:Wo=>{yo.cancel(),pT(Jn,Qn,Zn,MX,Wo)}},Ro=M8(Jn,Qn.blockerClass,DX(Co));(()=>{Yn(Jn),D8(Jn,Ro)})()})],NX=[...q$,tu("dragger",{handlers:mN(L8)})],LX=Qn=>Jc([wr(mm(),Qn.forceDrop),wr(H1(),Qn.drop),wr(Fl(),Qn.drop),wr(Nb(),(Zn,Yn)=>{Qn.move(Yn.event)})]),IX=Qn=>{const Zn=Qn[0];return ko.some(vc(Zn.clientX,Zn.clientY))};var I8=Object.freeze({__proto__:null,getData:Qn=>{const Yn=Qn.raw.touches;return Yn.length===1?IX(Yn):ko.none()},getDelta:(Qn,Zn)=>vc(Zn.left-Qn.left,Zn.top-Qn.top)});const B8=(Qn,Zn,Yn)=>{const Jn=Hl(),oo=lo=>{hN(lo,Jn.get(),Qn,Zn),Jn.clear()};return[wr(mm(),(lo,mo)=>{mo.stop();const yo=()=>oo(lo),Co={drop:yo,delayDrop:xo,forceDrop:yo,move:Wo=>{pT(lo,Qn,Zn,I8,Wo)}},Ro=M8(lo,Qn.blockerClass,LX(Co));Jn.set(Ro),(()=>{Yn(lo),D8(lo,Ro)})()}),wr(Nb(),(lo,mo)=>{mo.stop(),pT(lo,Qn,Zn,I8,mo.event)}),wr(H1(),(lo,mo)=>{mo.stop(),oo(lo)}),wr(Fl(),oo)]},BX=[...q$,tu("dragger",{handlers:mN(B8)})],FX=(Qn,Zn,Yn)=>[...L8(Qn,Zn,Yn),...B8(Qn,Zn,Yn)],HX=[...q$,tu("dragger",{handlers:mN(FX)})];var VX=Object.freeze({__proto__:null,mouse:NX,touch:BX,mouseOrTouch:HX}),zX=Object.freeze({__proto__:null,init:()=>{let Qn=ko.none(),Zn=ko.none();const Yn=()=>{Qn=ko.none(),Zn=ko.none()},Jn=(Co,Ro)=>{const Lo=Qn.map(Wo=>Co.getDelta(Wo,Ro));return Qn=ko.some(Ro),Lo},oo=(Co,Ro)=>Co.getData(Ro).bind(Lo=>Jn(Co,Lo)),lo=Co=>{Zn=ko.some(Co)},mo=()=>Zn,yo=Mo({});return ph({readState:yo,reset:Yn,update:oo,getStartData:mo,setStartData:lo})}});const Jw=Ub({branchKey:"mode",branches:VX,name:"dragging",active:{events:(Qn,Zn)=>Qn.dragger.handlers(Qn,Zn)},extra:{snap:Qn=>({sensor:Qn.sensor,range:Qn.range,output:Qn.output,extra:ko.from(Qn.extra)})},state:zX,apis:CX}),pN=40,j$=pN/2,F8=(Qn,Zn,Yn,Jn,oo,lo)=>Qn.fold(()=>Jw.snap({sensor:sS(Yn-j$,Jn-j$),range:vc(oo,lo),output:sS(ko.some(Yn),ko.some(Jn)),extra:{td:Zn}}),mo=>{const yo=Yn-j$,Co=Jn-j$,Ro=pN,Lo=pN,Wo=mo.element.dom.getBoundingClientRect();return Jw.snap({sensor:sS(yo,Co),range:vc(Ro,Lo),output:sS(ko.some(Yn-Wo.width/2),ko.some(Jn-Wo.height/2)),extra:{td:Zn}})}),gN=(Qn,Zn,Yn)=>{const Jn=(oo,lo)=>oo.exists(mo=>Oc(mo,lo));return{getSnapPoints:Qn,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:(oo,lo)=>{const mo=lo.td;Jn(Zn.get(),mo)||(Zn.set(mo),Yn(mo))},mustSnap:!0}},bN=Qn=>ou(yh.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:Zr([Jw.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:Qn}),$E.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}})),eC=(Qn,Zn)=>{const Yn=Ua([]),Jn=Ua([]),oo=Ua(!1),lo=Hl(),mo=Hl(),yo=qr=>{const na=cf(qr);return F8(es.getOpt(Zn),qr,na.x,na.y,na.width,na.height)},Co=()=>hs(Yn.get(),qr=>yo(qr)),Ro=qr=>{const na=cf(qr);return F8(us.getOpt(Zn),qr,na.right,na.bottom,na.width,na.height)},Lo=()=>hs(Jn.get(),qr=>Ro(qr)),Wo=gN(Co,lo,qr=>{mo.get().each(na=>{Qn.dispatch("TableSelectorChange",{start:qr,finish:na})})}),jo=gN(Lo,mo,qr=>{lo.get().each(na=>{Qn.dispatch("TableSelectorChange",{start:na,finish:qr})})}),es=bN(Wo),us=bN(jo),Ps=gh(es.asSpec()),er=gh(us.asSpec()),Bs=(qr,na,Dl,Sa)=>{const fl=na.dom.getBoundingClientRect();El(qr.element,"display");const rl=Sh(Ds.fromDom(Qn.getBody())).dom.innerHeight,Yc=Dl(fl),Ga=Sa(fl,rl);(Yc||Ga)&&ya(qr.element,"display","none")},Ns=(qr,na,Dl,Sa)=>{const fl=Dl(na);Jw.snapTo(qr,fl),Bs(qr,na,Ga=>Ga[Sa]<0,(Ga,yc)=>Ga[Sa]>yc)},Xs=qr=>Ns(Ps,qr,yo,"top"),Hr=()=>lo.get().each(Xs),kr=qr=>Ns(er,qr,Ro,"bottom"),Or=()=>mo.get().each(kr);Tr().deviceType.isTouch()&&(Qn.on("TableSelectionChange",qr=>{oo.get()||(cy(Zn,Ps),cy(Zn,er),oo.set(!0)),lo.set(qr.start),mo.set(qr.finish),qr.otherCells.each(na=>{Yn.set(na.upOrLeftCells),Jn.set(na.downOrRightCells),Xs(qr.start),kr(qr.finish)})}),Qn.on("ResizeEditor ResizeWindow ScrollContent",()=>{Hr(),Or()}),Qn.on("TableSelectionClear",()=>{oo.get()&&(Kb(Ps),Kb(er),oo.set(!1)),lo.clear(),mo.clear()}))};var WX=` + + +`;const vN=Qn=>Qn.nodeName==="BR"||!!Qn.getAttribute("data-mce-bogus")||Qn.getAttribute("data-mce-type")==="bookmark",X$=(Qn,Zn,Yn)=>{var Jn;const oo=(Jn=Zn.delimiter)!==null&&Jn!==void 0?Jn:"›",lo=(Ro,Lo,Wo)=>yh.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":Wo,"aria-level":Wo+1}},components:[wd(Ro)],action:jo=>{Qn.focus(),Qn.selection.select(Lo),Qn.nodeChanged()},buttonBehaviours:Zr([Lf.button(Yn.isDisabled),jf()])}),mo=()=>({dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0}},components:[wd(` ${oo} `)]}),yo=Ro=>za(Ro,(Lo,Wo,jo)=>{const es=lo(Wo.name,Wo.element,jo);return jo===0?Lo.concat([es]):Lo.concat([mo(),es])},[]),Co=Ro=>{const Lo=[];let Wo=Ro.length;for(;Wo-- >0;){const jo=Ro[Wo];if(jo.nodeType===1&&!vN(jo)){const es=cI(Qn,jo);if(es.isDefaultPrevented()||Lo.push({name:es.name,element:jo}),es.isPropagationStopped())break}}return Lo};return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Zr([Za.config({mode:"flow",selector:"div[role=button]"}),Ja.config({disabled:Yn.isDisabled}),jf(),sd.config({}),Cl.config({}),Rl("elementPathEvents",[eu((Ro,Lo)=>{Qn.shortcuts.add("alt+F11","focus statusbar elementpath",()=>Za.focusIn(Ro)),Qn.on("NodeChange",Wo=>{const jo=Co(Wo.parents),es=jo.length>0?yo(jo):[];Cl.set(Ro,es)})})])]),components:[]}};var rS;(function(Qn){Qn[Qn.None=0]="None",Qn[Qn.Both=1]="Both",Qn[Qn.Vertical=2]="Vertical"})(rS||(rS={}));const UX=(Qn,Zn,Yn,Jn,oo)=>{const lo={height:cT(Jn+Zn.top,Ek(Qn),CR(Qn))};return Yn===rS.Both&&(lo.width=cT(oo+Zn.left,wR(Qn),$A(Qn))),lo},H8=(Qn,Zn,Yn)=>{const Jn=Ds.fromDom(Qn.getContainer()),oo=UX(Qn,Zn,Yn,cu(Jn),dd(Jn));Zl(oo,(lo,mo)=>{$o(lo)&&ya(Jn,mo,Y4(lo))}),aI(Qn)},ZX=Qn=>{const Zn=j5(Qn);return Zn===!1?rS.None:Zn==="both"?rS.Both:rS.Vertical},Y$=(Qn,Zn,Yn,Jn)=>{const lo=vc(Yn*20,Jn*20);return H8(Qn,lo,Zn),ko.some(!0)},tC=(Qn,Zn)=>{const Yn=ZX(Qn);if(Yn===rS.None)return ko.none();const Jn=Yn===rS.Both?"Press the arrow keys to resize the editor.":"Press the Up and Down arrow keys to resize the editor.";return ko.some(s0("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:Zn.translate("Resize"),"aria-label":Zn.translate(Jn)},behaviours:[Jw.config({mode:"mouse",repositionTarget:!1,onDrag:(oo,lo,mo)=>H8(Qn,mo,Yn),blockerClass:"tox-blocker"}),Za.config({mode:"special",onLeft:()=>Y$(Qn,Yn,-1,0),onRight:()=>Y$(Qn,Yn,1,0),onUp:()=>Y$(Qn,Yn,0,-1),onDown:()=>Y$(Qn,Yn,0,1)}),sd.config({}),ol.config({})]},Zn.icons))},Q8=(Qn,Zn)=>{const Yn=(Jn,oo,lo)=>Cl.set(Jn,[wd(Zn.translate(["{0} "+lo,oo[lo]]))]);return yh.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:Zr([Lf.button(Zn.isDisabled),jf(),sd.config({}),Cl.config({}),da.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Rl("wordcount-events",[qh(Jn=>{const oo=da.getValue(Jn),lo=oo.mode==="words"?"characters":"words";da.setValue(Jn,{mode:lo,count:oo.count}),Yn(Jn,oo.count,lo)}),eu(Jn=>{Qn.on("wordCountUpdate",oo=>{const{mode:lo}=da.getValue(Jn);da.setValue(Jn,{mode:lo,count:oo.wordCount}),Yn(Jn,oo.wordCount,lo)})})])]),eventOrder:{[Im()]:["disabling","alloy.base.behaviour","wordcount-events"]}})},qX=(Qn,Zn)=>{const Yn=()=>({dom:{tag:"span",classes:["tox-statusbar__branding"]},components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/powered-by-tiny?utm_campaign=poweredby&utm_source=tiny&utm_medium=referral&utm_content=v6",rel:"noopener",target:"_blank","aria-label":_1.translate(["Powered by {0}","Tiny"])},innerHtml:WX.trim()},behaviours:Zr([ol.config({})])}]}),Jn=()=>{const yo=tP("Alt+0");return{dom:{tag:"div",classes:["tox-statusbar__help-text"]},components:[wd(_1.translate(["Press {0} for help",yo]))]}},oo=()=>{const yo=[];return Qn.hasPlugin("wordcount")&&yo.push(Q8(Qn,Zn)),$R(Qn)&&yo.push(Yn()),{dom:{tag:"div",classes:["tox-statusbar__right-container"]},components:yo}},lo=()=>{const yo=[],Co=IA(Qn),Ro=Ak(Qn),Lo=$R(Qn)||Qn.hasPlugin("wordcount"),Wo=()=>{const jo="tox-statusbar__text-container--flex-start",es="tox-statusbar__text-container--flex-end",us="tox-statusbar__text-container--space-around";if(Co){const Ps="tox-statusbar__text-container-3-cols";return!Lo&&!Ro?[Ps,us]:Lo&&!Ro?[Ps,es]:[Ps,jo]}return[Lo&&!Ro?es:jo]};return Ro&&yo.push(X$(Qn,{},Zn)),Co&&yo.push(Jn()),Lo&&yo.push(oo()),yo.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container",...Wo()]},components:yo}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(()=>{const yo=lo(),Co=tC(Qn,Zn);return yo.concat(Co.toArray())})()}},V8=(Qn,Zn)=>Zn.get().getOrDie(`UI for ${Qn} has not been rendered`),jX=(Qn,Zn)=>{const Yn=Qn.inline,Jn=Yn?U7:Q7,oo=uE(Qn)?C6:rZ,lo=wj(),mo=Hl(),yo=Hl(),Co=Hl(),jo=Tr().deviceType.isTouch()?["tox-platform-touch"]:[],es=MR(Qn),us=Tk(Qn),Ps=ou({dom:{tag:"div",classes:["tox-anchorbar"]}}),er=ou({dom:{tag:"div",classes:["tox-bottom-anchorbar"]}}),Bs=()=>lo.mainUi.get().map(Ka=>Ka.outerContainer).bind(Hu.getHeader),Ns=()=>yl.fromOption(lo.dialogUi.get().map(Ka=>Ka.sink),"UI has not been rendered"),Xs=()=>yl.fromOption(lo.popupUi.get().map(Ka=>Ka.sink),"(popup) UI has not been rendered"),Hr=lo.lazyGetInOuterOrDie("anchor bar",Ps.getOpt),kr=lo.lazyGetInOuterOrDie("bottom anchor bar",er.getOpt),Or=lo.lazyGetInOuterOrDie("toolbar",Hu.getToolbar),qr=lo.lazyGetInOuterOrDie("throbber",Hu.getThrobber),na=GU({popup:Xs,dialog:Ns},Qn,Hr,kr),Dl=()=>{const Ka={attributes:{[oy]:es?$p.BottomToTop:$p.TopToBottom}},kl=Hu.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:na.popup,onEscape:()=>{Qn.focus()}}),$u=Hu.parts.toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:na.popup.shared.getSink,providers:na.popup.shared.providers,onEscape:()=>{Qn.focus()},onToolbarToggled:CT=>{MQ(Qn,CT)},type:us,lazyToolbar:Or,lazyHeader:()=>Bs().getOrDie("Could not find header element"),...Ka}),Cc=Hu.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:na.popup.shared.providers,onEscape:()=>{Qn.focus()},type:us}),Ih=cE(Qn),Cg=HA(Qn),xb=Pk(Qn),m0=X5(Qn),dS=Sa(),rC=Ih||Cg||xb,hv=()=>Ih?[Cc]:Cg?[$u]:[],PO=m0?[dS,kl]:[kl];return Hu.parts.header({dom:{tag:"div",classes:["tox-editor-header"].concat(rC?[]:["tox-editor-header--empty"]),...Ka},components:Us([xb?PO:[],hv(),$k(Qn)?[]:[Ps.asSpec()]]),sticky:uE(Qn),editor:Qn,sharedBackstage:na.popup.shared})},Sa=()=>Hu.parts.promotion({dom:{tag:"div",classes:["tox-promotion"]}}),fl=()=>{const Ka=Hu.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),kl=Hu.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}});return{dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[Ka,kl]}},rl=()=>{const Ka=NR(Qn),kl=Oc(Ru(),Ka)&&qc(Ka,"display")==="grid",$u={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(jo),attributes:{..._1.isRtl()?{dir:"rtl"}:{}}},behaviours:Zr([jh.config({useFixed:()=>oo.isDocked(Bs)})])},Cc={dom:{styles:{width:document.body.clientWidth+"px"}},events:Jc([wr(Ig(),xb=>{ya(xb.element,"width",document.body.clientWidth+"px")})])},Ih=gh(Lc($u,kl?Cc:{})),Cg=bP(Ih);return yo.set(Cg),{sink:Ih,mothership:Cg}},Yc=()=>{const Ka={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-silver-popup-sink","tox-tinymce-aux"].concat(jo),attributes:{..._1.isRtl()?{dir:"rtl"}:{}}},behaviours:Zr([jh.config({useFixed:()=>oo.isDocked(Bs),getBounds:()=>Zn.getPopupSinkBounds()})])},kl=gh(Ka),$u=bP(kl);return Co.set($u),{sink:kl,mothership:$u}},Ga=()=>{const Ka=Dl(),kl=fl(),$u=Hu.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:na.popup}),Cc=Hu.parts.viewWrapper({backstage:na.popup}),Ih=q5(Qn)&&!Yn?ko.some(qX(Qn,na.popup.shared.providers)):ko.none(),Cg=Us([es?[]:[Ka],Yn?[]:[kl],es?[Ka]:[]]),xb=Hu.parts.editorContainer({components:Us([Cg,Yn?[]:[er.asSpec(),...Ih.toArray()]])}),m0=LR(Qn),dS={role:"application",..._1.isRtl()?{dir:"rtl"}:{},...m0?{"aria-hidden":"true"}:{}},rC=gh(Hu.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(Yn?["tox-tinymce-inline"]:[]).concat(es?["tox-tinymce--toolbar-bottom"]:[]).concat(jo),styles:{visibility:"hidden",...m0?{opacity:"0",border:"0"}:{}},attributes:dS},components:[xb,...Yn?[]:[Cc],$u],behaviours:Zr([jf(),Ja.config({disableClass:"tox-tinymce--disabled"}),Za.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])})),hv=bP(rC);return mo.set(hv),{mothership:hv,outerContainer:rC}},yc=Ka=>{const kl=Y4(yj(Qn)),$u=Y4(Oj(Qn));return Qn.inline||(Tm("div","width",$u)&&ya(Ka.element,"width",$u),Tm("div","height",kl)?ya(Ka.element,"height",kl):ya(Ka.element,"height","400px")),kl},oa=Ka=>{Qn.addShortcut("alt+F9","focus menubar",()=>{Hu.focusMenubar(Ka)}),Qn.addShortcut("alt+F10","focus toolbar",()=>{Hu.focusToolbar(Ka)}),Qn.addCommand("ToggleToolbarDrawer",(kl,$u)=>{$u!=null&&$u.skipFocus?Hu.toggleToolbarDrawerWithoutFocusing(Ka):Hu.toggleToolbarDrawer(Ka)}),Qn.addQueryStateHandler("ToggleToolbarDrawer",()=>Hu.isToolbarDrawerToggled(Ka))},$a=Ka=>{const{mainUi:kl,popupUi:$u,uiMotherships:Cc}=Ka;Vl(V5(Qn),(E2,l3)=>{Qn.ui.registry.addGroupToolbarButton(l3,E2)});const{buttons:Ih,menuItems:Cg,contextToolbars:xb,sidebars:m0,views:dS}=Qn.ui.registry.getAll(),rC=DR(Qn),hv={menuItems:Cg,menus:J5(Qn),menubar:xR(Qn),toolbar:rC.getOrThunk(()=>DA(Qn)),allowToolbarGroups:us===qg.floating,buttons:Ih,sidebar:m0,views:dS};oa(kl.outerContainer),i2(Qn,kl.mothership,Cc),oo.setup(Qn,na.popup.shared,Bs),Xj(Qn,na.popup),hX(Qn,na.popup.shared.getSink,na.popup),LZ(Qn),f$(Qn,qr,na.popup.shared),l8(Qn,xb,$u.sink,{backstage:na.popup}),eC(Qn,$u.sink);const PO=Qn.getElement(),CT=yc(kl.outerContainer),TN={targetNode:PO,height:CT};return Jn.render(Qn,Ka,hv,na.popup,TN)},hl=Ka=>(Co.set(Ka.mothership),Ka),gl=()=>{const Ka=Ga(),kl=rl(),$u=gy(Qn)?Yc():hl(kl);lo.dialogUi.set(kl),lo.popupUi.set($u),lo.mainUi.set(Ka);const Cc={popupUi:$u,dialogUi:kl,mainUi:Ka,uiMotherships:lo.getUiMotherships()};return $a(Cc)};return{popups:{backstage:na.popup,getMothership:()=>V8("popups",Co)},dialogs:{backstage:na.dialog,getMothership:()=>V8("dialogs",yo)},renderUI:gl}},XX=(Qn,Zn)=>{const Yn=Uo(Qn,"id").fold(()=>{const Jn=ba("dialog-label");return aa(Zn,"id",Jn),Jn},Go);aa(Qn,"aria-labelledby",Yn)},YX=Mo([Er("lazySink"),Tc("dragBlockClass"),Hd("getBounds",tf),Gs("useTabstopAt",Js),Gs("firstTabstop",0),Gs("eventOrder",{}),Nf("modalBehaviours",[Za]),Vm("onExecute"),Yv("onEscape")]),yN={sketch:Go},GX=Mo([up({name:"draghandle",overrides:(Qn,Zn)=>({behaviours:Zr([Jw.config({mode:"mouse",getTarget:Yn=>Hm(Yn,'[role="dialog"]').getOr(Yn),blockerClass:Qn.dragBlockClass.getOrDie(new Error(`The drag blocker class was not specified for a dialog with a drag handle: +`+JSON.stringify(Zn,null,2)).message),getBounds:Qn.getDragBounds})])})}),Xh({schema:[Er("dom")],name:"title"}),Xh({factory:yN,schema:[Er("dom")],name:"close"}),Xh({factory:yN,schema:[Er("dom")],name:"body"}),up({factory:yN,schema:[Er("dom")],name:"footer"}),v1({factory:{sketch:(Qn,Zn)=>({...Qn,dom:Zn.dom,components:Zn.components})},schema:[Gs("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Gs("components",[])],name:"blocker"})]),KX=(Qn,Zn,Yn,Jn)=>{const oo=Hl(),lo=es=>{oo.set(es);const us=Qn.lazySink(es).getOrDie(),Ps=Jn.blocker(),er=us.getSystem().build({...Ps,components:Ps.components.concat([Fm(es)]),behaviours:Zr([ol.config({}),Rl("dialog-blocker-events",[rg(Wu(),()=>{uv.isBlocked(es)?xo():Za.focusIn(es)})])])});cy(us,er),Za.focusIn(es)},mo=es=>{oo.clear(),Zd(es.element).each(us=>{es.getSystem().getByDom(us).each(Ps=>{Kb(Ps)})})},yo=es=>Y0(es,Qn,"body"),Co=es=>Au(es,Qn,"footer"),Ro=(es,us)=>{uv.block(es,us)},Lo=es=>{uv.unblock(es)},Wo=ba("modal-events"),jo={...Qn.eventOrder,[Zh()]:[Wo].concat(Qn.eventOrder["alloy.system.attached"]||[])};return{uid:Qn.uid,dom:Qn.dom,components:Zn,apis:{show:lo,hide:mo,getBody:yo,getFooter:Co,setIdle:Lo,setBusy:Ro},eventOrder:jo,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:sf(Qn.modalBehaviours,[Cl.config({}),Za.config({mode:"cyclic",onEnter:Qn.onExecute,onEscape:Qn.onEscape,useTabstopAt:Qn.useTabstopAt,firstTabstop:Qn.firstTabstop}),uv.config({getRoot:oo.get}),Rl(Wo,[eu(es=>{XX(es.element,Y0(es,Qn,"title").element)})])])}},If=Yh({name:"ModalDialog",configFields:YX(),partFields:GX(),factory:KX,apis:{show:(Qn,Zn)=>{Qn.show(Zn)},hide:(Qn,Zn)=>{Qn.hide(Zn)},getBody:(Qn,Zn)=>Qn.getBody(Zn),getFooter:(Qn,Zn)=>Qn.getFooter(Zn),setBusy:(Qn,Zn,Yn)=>{Qn.setBusy(Zn,Yn)},setIdle:(Qn,Zn)=>{Qn.setIdle(Zn)}}}),gT=Ta([wf,KR].concat(Bw)),ON=Jm,v2=[GA("button"),S1,Eh("align","end",["start","end"]),Oy,pb,Ly("buttonType",["primary","secondary"])],iS=[...v2,_O],y2=[hd("type",["submit","cancel","custom"]),...iS],JX=[hd("type",["menu"]),yy,mE,S1,Pf("items",gT),...v2],z8=[...v2,hd("type",["togglebutton"]),hc("tooltip"),S1,yy,Xd("active",!1)],W8=jl("type",{submit:y2,cancel:y2,custom:y2,menu:JX,togglebutton:z8}),U8=[wf,_O,hd("level",["info","warn","error","success"]),JR,Gs("url","")],eY=Ta(U8),tY=Qn=>[wf,Qn],nY=[wf,_O,pb,GA("button"),S1,yL,Ly("buttonType",["primary","secondary","toolbar"]),Oy],Z8=Ta(nY),nC=[wf,KR],_b=nC.concat([XA]),oY=nC.concat([jA,pb]),sY=Ta(oY),rY=Jm,q8=_b.concat([OL("auto")]),iY=Ta(q8),aY=Yp([Nk,_O,JR]),lY=_b.concat([mh("storageKey","default")]),_N=Ta(lY),SN=nf,j8=Ta(_b),cY=nf,uY=nC.concat([mh("tag","textarea"),hc("scriptId"),hc("scriptUrl"),Iy("settings",void 0)]),X8=nC.concat([mh("tag","textarea"),ep("init")]),dY=Rg(Qn=>Lu("customeditor.old",mu(X8),Qn).orThunk(()=>Lu("customeditor.new",mu(uY),Qn))),fY=nf,Y8=Ta(_b),hY=RO(),G$=Qn=>[wf,k0("columns"),Qn],_2=[wf,hc("html"),Eh("presets","presentation",["presentation","document"])],K$=Ta(_2),G8=_b.concat([Xd("border",!1),Xd("sandboxed",!0),Xd("streamContent",!1),Xd("transparent",!0)]),J$=Ta(G8),Sg=nf,e3=Ta(nC.concat([$f("height")])),K8=Ta([hc("url"),Mg("zoom"),Mg("cachedWidth"),Mg("cachedHeight")]),J8=_b.concat([$f("inputMode"),$f("placeholder"),Xd("maximized",!1),pb]),mY=Ta(J8),pY=nf,aS=Qn=>[wf,jA,Qn,Eh("align","start",["start","center","end"])],LG=[_O,Nk],gY=[_O,Pf("items",L1("items",()=>wN))],wN=Oa([Ta(LG),Ta(gY)]),S2=_b.concat([Pf("items",wN),pb]),t3=Ta(S2),eH=nf,bY=_b.concat([Mb("items",[_O,Nk]),Lm("size",1),pb]),vY=Ta(bY),yY=nf,OY=_b.concat([Xd("constrain",!0),pb]),w2=Ta(OY),_Y=Ta([hc("width"),hc("height")]),SY=nC.concat([jA,Lm("min",0),Lm("max",0)]),wY=Ta(SY),IG=w0,CY=[wf,Pf("header",nf),Pf("cells",Xp(nf))],kY=Ta(CY),bT=_b.concat([$f("placeholder"),Xd("maximized",!1),pb]),xY=Ta(bT),EY=nf,CN=[hd("type",["directory","leaf"]),gL,hc("id"),Fd("menu",oT)],TY=Ta(CN),Mn=CN.concat([Pf("children",L1("children",()=>Ir("type",{directory:Vn,leaf:TY})))]),Vn=Ta(Mn),Wn=Ir("type",{directory:Vn,leaf:TY}),jn=[wf,Pf("items",Wn),I1("onLeafAction"),I1("onToggleExpand"),Th("defaultExpandedIds",[],nf),$f("defaultSelectedId")],Gn=Ta(jn),no=_b.concat([Eh("filetype","file",["image","media","file"]),pb,$f("picker_text")]),ao=Ta(no),po=Ta([Nk,pE]),vo=Qn=>Bd("items","items",sc(),Xp(Rg(Zn=>Lu(`Checking item of ${Qn}`,Ao,Zn).fold(Yn=>yl.error(Gf(Yn)),Yn=>yl.value(Yn))))),Ao=mf(()=>Ir("type",{alertbanner:eY,bar:Ta(tY(vo("bar"))),button:Z8,checkbox:sY,colorinput:_N,colorpicker:j8,dropzone:Y8,grid:Ta(G$(vo("grid"))),iframe:J$,input:mY,listbox:t3,selectbox:vY,sizeinput:w2,slider:wY,textarea:xY,urlinput:ao,customeditor:dY,htmlpanel:K$,imagepreview:e3,collection:iY,label:Ta(aS(vo("label"))),table:kY,tree:Gn,panel:Qo})),Fo=[wf,Gs("classes",[]),Pf("items",Ao)],Qo=Ta(Fo),qo=[GA("tab"),gL,Pf("items",Ao)],ds=[wf,Mb("tabs",qo)],bs=Ta(ds),ls=iS,ys=W8,Ls=Ta([hc("title"),Kf("body",Ir("type",{panel:Qo,tabpanel:bs})),mh("size","normal"),Th("buttons",[],ys),Gs("initialData",{}),Hd("onAction",xo),Hd("onChange",xo),Hd("onSubmit",xo),Hd("onClose",xo),Hd("onCancel",xo),Hd("onTabChange",xo)]),zs=Qn=>Lu("dialog",Ls,Qn),Hs=Ta([hd("type",["cancel","custom"]),...ls]),tr=Ta([hc("title"),hc("url"),Mg("height"),Mg("width"),Ng("buttons",Hs),Hd("onAction",xo),Hd("onCancel",xo),Hd("onClose",xo),Hd("onMessage",xo)]),Pr=Qn=>Lu("dialog",tr,Qn),Ur=Qn=>Xn(Qn)?[Qn].concat(fs(gd(Qn),Ur)):to(Qn)?fs(Qn,Ur):[],fa=Qn=>qn(Qn.type)&&qn(Qn.name),yr={checkbox:rY,colorinput:SN,colorpicker:cY,dropzone:hY,input:pY,iframe:Sg,imagepreview:K8,selectbox:yY,sizeinput:_Y,slider:IG,listbox:eH,size:_Y,textarea:EY,urlinput:po,customeditor:fY,collection:aY,togglemenuitem:ON},fr=Qn=>ko.from(yr[Qn.type]),Ar=Qn=>ga(Ur(Qn),fa),wa=Qn=>{const Zn=Ar(Qn),Yn=fs(Zn,Jn=>fr(Jn).fold(()=>[],oo=>[Kf(Jn.name,oo)]));return Ta(Yn)},Va=Qn=>{var Zn;const Yn=Ec(zs(Qn)),Jn=wa(Qn),oo=(Zn=Qn.initialData)!==null&&Zn!==void 0?Zn:{};return{internalDialog:Yn,dataValidator:Jn,initialData:oo}},Tl={open:(Qn,Zn)=>{const Yn=Va(Zn);return Qn(Yn.internalDialog,Yn.initialData,Yn.dataValidator)},openUrl:(Qn,Zn)=>{const Yn=Ec(Pr(Zn));return Qn(Yn)},redial:Qn=>Va(Qn)};var uu=Object.freeze({__proto__:null,events:(Qn,Zn)=>{const Yn=(Jn,oo)=>{Qn.updateState.each(lo=>{const mo=lo(Jn,oo);Zn.set(mo)}),Qn.renderComponents.each(lo=>{const mo=lo(oo,Zn.get());(Qn.reuseDom?JN:fp)(Jn,mo)})};return Jc([wr(T0(),(Jn,oo)=>{const lo=oo;if(!lo.universal){const mo=Qn.channel;Fs(lo.channels,mo)&&Yn(Jn,lo.data)}}),eu((Jn,oo)=>{Qn.initialData.each(lo=>{Yn(Jn,lo)})})])}}),Wd=Object.freeze({__proto__:null,getState:(Qn,Zn,Yn)=>Yn}),Jh=[Er("channel"),Tc("renderComponents"),Tc("updateState"),Tc("initialData"),Xd("reuseDom",!0)],ea=Object.freeze({__proto__:null,init:()=>{const Qn=Ua(ko.none()),Zn=()=>Qn.set(ko.none());return{readState:()=>Qn.get().getOr("none"),get:Qn.get,set:Qn.set,clear:Zn}}});const pa=Of({fields:Jh,name:"reflecting",active:uu,apis:Wd,state:ea}),$c=Qn=>{const Zn=[],Yn={};return Zl(Qn,(Jn,oo)=>{Jn.fold(()=>{Zn.push(oo)},lo=>{Yn[oo]=lo})}),Zn.length>0?yl.error(Zn):yl.value(Yn)},ac=(Qn,Zn,Yn)=>{const Jn=ou(Yk.sketch(oo=>({dom:{tag:"div",classes:["tox-form"].concat(Qn.classes)},components:hs(Qn.items,lo=>d0(oo,lo,Zn,Yn))})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[Jn.asSpec()]}],behaviours:Zr([Za.config({mode:"acyclic",useTabstopAt:is(Kk)}),Og.memento(Jn),NB(Jn,{postprocess:oo=>$c(oo).fold(lo=>(console.error(lo),{}),Go)}),Rl("dialog-body-panel",[wr(Wu(),(oo,lo)=>{oo.getSystem().broadcastOn([e2],{newFocus:ko.some(lo.event.target)})})])])}},Pa=(Qn,Zn)=>({uid:Qn.uid,dom:Qn.dom,components:Qn.components,events:tv(Qn.action),behaviours:sf(Qn.tabButtonBehaviours,[ol.config({}),Za.config({mode:"execution",useSpace:!0,useEnter:!0}),da.config({store:{mode:"memory",initialValue:Qn.value}})]),domModification:Qn.domModification}),ml=Mp({name:"TabButton",configFields:[Gs("uid",void 0),Er("value"),Bd("dom","dom",ss(()=>({attributes:{role:"tab",id:ba("aria"),"aria-selected":"false"}})),Ad()),Tc("action"),Gs("domModification",{}),Nf("tabButtonBehaviours",[ol,Za,da]),Er("view")],factory:Pa}),Yr=Mo([Er("tabs"),Er("dom"),Gs("clickToDismiss",!1),Nf("tabbarBehaviours",[Bc,Za]),Wb(["tabClass","selectedClass"])]),pl=vw({factory:ml,name:"tabs",unit:"tab",overrides:Qn=>{const Zn=(Jn,oo)=>{Bc.dehighlight(Jn,oo),Qa(Jn,NO(),{tabbar:Jn,button:oo})},Yn=(Jn,oo)=>{Bc.highlight(Jn,oo),Qa(Jn,xv(),{tabbar:Jn,button:oo})};return{action:Jn=>{const oo=Jn.getSystem().getByUid(Qn.uid).getOrDie(),lo=Bc.isHighlighted(oo,Jn);(lo&&Qn.clickToDismiss?Zn:lo?xo:Yn)(oo,Jn)},domModification:{classes:[Qn.markers.tabClass]}}}}),pc=Mo([pl]),Pu=(Qn,Zn,Yn,Jn)=>({uid:Qn.uid,dom:Qn.dom,components:Zn,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:sf(Qn.tabbarBehaviours,[Bc.config({highlightClass:Qn.markers.selectedClass,itemClass:Qn.markers.tabClass,onHighlight:(oo,lo)=>{aa(lo.element,"aria-selected","true")},onDehighlight:(oo,lo)=>{aa(lo.element,"aria-selected","false")}}),Za.config({mode:"flow",getInitial:oo=>Bc.getHighlighted(oo).map(lo=>lo.element),selector:"."+Qn.markers.tabClass,executeOnMove:!0})])}),du=Yh({name:"Tabbar",configFields:Yr(),partFields:pc(),factory:Pu}),Oh=(Qn,Zn)=>({uid:Qn.uid,dom:Qn.dom,behaviours:sf(Qn.tabviewBehaviours,[Cl.config({})]),domModification:{attributes:{role:"tabpanel"}}}),h0=Mp({name:"Tabview",configFields:[Nf("tabviewBehaviours",[Cl])],factory:Oh}),Ay=Mo([Gs("selectFirst",!0),rc("onChangeTab"),rc("onDismissTab"),Gs("tabs",[]),Nf("tabSectionBehaviours",[])]),Ip=Xh({factory:du,schema:[Er("dom"),fm("markers",[Er("tabClass"),Er("selectedClass")])],name:"tabbar",defaults:Qn=>({tabs:Qn.tabs})}),Sb=Xh({factory:h0,name:"tabview"}),Sl=Mo([Ip,Sb]),Mc=(Qn,Zn,Yn,Jn)=>{const oo=mo=>{const yo=da.getValue(mo);Au(mo,Qn,"tabview").each(Co=>{Zs(Qn.tabs,Lo=>Lo.value===yo).each(Lo=>{const Wo=Lo.view();Uo(mo.element,"id").each(jo=>{aa(Co.element,"aria-labelledby",jo)}),Cl.set(Co,Wo),Qn.onChangeTab(Co,mo,Wo)})})},lo=(mo,yo)=>{Au(mo,Qn,"tabbar").each(Co=>{yo(Co).each(og)})};return{uid:Qn.uid,dom:Qn.dom,components:Zn,behaviours:j0(Qn.tabSectionBehaviours),events:Jc(Us([Qn.selectFirst?[eu((mo,yo)=>{lo(mo,Bc.getFirst)})]:[],[wr(xv(),(mo,yo)=>{const Co=yo.event.button;oo(Co)}),wr(NO(),(mo,yo)=>{const Co=yo.event.button;Qn.onDismissTab(mo,Co)})]])),apis:{getViewItems:mo=>Au(mo,Qn,"tabview").map(yo=>Cl.contents(yo)).getOr([]),showTab:(mo,yo)=>{lo(mo,Ro=>{const Lo=Bc.getCandidates(Ro);return Zs(Lo,jo=>da.getValue(jo)===yo).filter(jo=>!Bc.isHighlighted(Ro,jo))})}}}},ru=Yh({name:"TabSection",configFields:Ay(),partFields:Sl(),factory:Mc,apis:{getViewItems:(Qn,Zn)=>Qn.getViewItems(Zn),showTab:(Qn,Zn,Yn)=>{Qn.showTab(Zn,Yn)}}}),Kd=(Qn,Zn,Yn)=>hs(Qn,(Jn,oo)=>{Cl.set(Yn,Qn[oo].view());const lo=Zn.dom.getBoundingClientRect();return Cl.set(Yn,[]),lo.height}),xd=Qn=>Nl(Ml(Qn,(Zn,Yn)=>Zn>Yn?-1:Zn{const Jn=Xf(Qn).dom,oo=Hm(Qn,".tox-dialog-wrap").getOr(Qn),lo=qc(oo,"position")==="fixed";let mo;lo?mo=Math.max(Jn.clientHeight,window.innerHeight):mo=Math.max(Jn.offsetHeight,Jn.scrollHeight);const yo=cu(Zn),Ro=Zn.dom.offsetLeft>=Yn.dom.offsetLeft+dd(Yn)?Math.max(cu(Yn),yo):yo,Lo=parseInt(qc(Qn,"margin-top"),10)||0,Wo=parseInt(qc(Qn,"margin-bottom"),10)||0,es=cu(Qn)+Lo+Wo-Ro;return mo-es},dv=(Qn,Zn)=>{Nl(Qn).each(Yn=>ru.showTab(Zn,Yn.value))},AO=(Qn,Zn)=>{ya(Qn,"height",Zn+"px"),ya(Qn,"flex-basis",Zn+"px")},oC=(Qn,Zn,Yn)=>{Hm(Qn,'[role="dialog"]').each(Jn=>{Rd(Jn,'[role="tablist"]').each(oo=>{Yn.get().map(lo=>(ya(Zn,"height","0"),ya(Zn,"flex-basis","0"),Math.min(lo,wg(Jn,Zn,oo)))).each(lo=>{AO(Zn,lo)})})})},C2=Qn=>Rd(Qn,'[role="tabpanel"]'),n3=Qn=>{const Zn=Hl();return{extraEvents:[eu(oo=>{const lo=oo.element;C2(lo).each(mo=>{ya(mo,"visibility","hidden"),oo.getSystem().getByDom(mo).toOptional().each(yo=>{const Co=Kd(Qn,mo,yo);xd(Co).fold(Zn.clear,Zn.set)}),oC(lo,mo,Zn),El(mo,"visibility"),dv(Qn,oo),requestAnimationFrame(()=>{oC(lo,mo,Zn)})})}),wr(Ig(),oo=>{const lo=oo.element;C2(lo).each(mo=>{oC(lo,mo,Zn)})}),wr(YI,(oo,lo)=>{const mo=oo.element;C2(mo).each(yo=>{const Co=h1(rr(yo));ya(yo,"visibility","hidden");const Ro=ku(yo,"height").map(jo=>parseInt(jo,10));El(yo,"height"),El(yo,"flex-basis");const Lo=yo.dom.getBoundingClientRect().height;Ro.forall(jo=>Lo>jo)?(Zn.set(Lo),oC(mo,yo,Zn)):Ro.each(jo=>{AO(yo,jo)}),El(yo,"visibility"),Co.each(Cd)})})],selectFirst:!1}},sC="send-data-to-section",vT="send-data-to-view",k2=(Qn,Zn,Yn)=>{const Jn=Ua({}),oo=Ro=>{const Lo=da.getValue(Ro),Wo=$c(Lo).getOr({}),jo=Jn.get(),es=Lc(jo,Wo);Jn.set(es)},lo=Ro=>{const Lo=Jn.get();da.setValue(Ro,Lo)},mo=Ua(null),yo=hs(Qn.tabs,Ro=>({value:Ro.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"]},components:[wd(Yn.shared.providers.translate(Ro.title))],view:()=>[Yk.sketch(Lo=>({dom:{tag:"div",classes:["tox-form"]},components:hs(Ro.items,Wo=>d0(Lo,Wo,Zn,Yn)),formBehaviours:Zr([Za.config({mode:"acyclic",useTabstopAt:is(Kk)}),Rl("TabView.form.events",[eu(lo),ig(oo)]),Om.config({channels:La([{key:sC,value:{onReceive:oo}},{key:vT,value:{onReceive:lo}}])})])}))]})),Co=n3(yo);return ru.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:(Ro,Lo,Wo)=>{const jo=da.getValue(Lo);Qa(Ro,XI,{name:jo,oldName:mo.get()}),mo.set(jo)},tabs:yo,components:[ru.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[du.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:Zr([sd.config({})])}),ru.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:Co.selectFirst,tabSectionBehaviours:Zr([Rl("tabpanel",Co.extraEvents),Za.config({mode:"acyclic"}),ic.config({find:Ro=>Nl(ru.getViewItems(Ro))}),j_(ko.none(),Ro=>(Ro.getSystem().broadcastOn([sC],{}),Jn.get()),(Ro,Lo)=>{Jn.set(Lo),Ro.getSystem().broadcastOn([vT],{})})])})},lS=(Qn,Zn,Yn,Jn,oo)=>{const lo=Co=>{const Ro=Co.body;switch(Ro.type){case"tabpanel":return[k2(Ro,Co.initialData,Jn)];default:return[ac(Ro,Co.initialData,Jn)]}},mo=(Co,Ro)=>ko.some({isTabPanel:()=>Ro.body.type==="tabpanel"}),yo={"aria-live":"polite"};return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:{...Yn.map(Co=>({id:Co})).getOr({}),...oo?yo:{}}},components:[],behaviours:Zr([Og.childAt(0),pa.config({channel:`${BP}-${Zn}`,updateState:mo,renderComponents:lo,initialData:Qn})])}},fv=(Qn,Zn,Yn,Jn,oo)=>lS(Qn,Zn,ko.some(Yn),Jn,oo),Py=(Qn,Zn,Yn)=>{const Jn=lS(Qn,Zn,ko.none(),Yn,!1);return If.parts.body(Jn)},yT=Qn=>{const Zn={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[VB(ko.none(),{dom:{tag:"iframe",attributes:{src:Qn.url}},behaviours:Zr([sd.config({}),ol.config({})])})]}],behaviours:Zr([Za.config({mode:"acyclic",useTabstopAt:is(Kk)})])};return If.parts.body(Zn)},x2=xk.deviceType.isTouch(),OT=(Qn,Zn)=>({dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[Qn,Zn]}),$y=(Qn,Zn)=>If.parts.close(yh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":Zn.translate("Close")}},action:Qn,buttonBehaviours:Zr([sd.config({})])})),o3=()=>If.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}}),_T=(Qn,Zn)=>If.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:vO(`

    ${gR(Zn.translate(Qn))}

    `)}]}]}),xm=Qn=>If.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:Qn}),cS=(Qn,Zn)=>[rv.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:Qn}),rv.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:Zn})],s3=Qn=>{const Zn="tox-dialog",Yn=Zn+"-wrap",Jn=Yn+"__backdrop",oo=Zn+"__disable-scroll";return If.sketch({lazySink:Qn.lazySink,onEscape:lo=>(Qn.onEscape(lo),ko.some(!0)),useTabstopAt:lo=>!Kk(lo),firstTabstop:Qn.firstTabstop,dom:{tag:"div",classes:[Zn].concat(Qn.extraClasses),styles:{position:"relative",...Qn.extraStyles}},components:[Qn.header,Qn.body,...Qn.footer.toArray()],parts:{blocker:{dom:vO(`
    `),components:[{dom:{tag:"div",classes:x2?[Jn,Jn+"--opaque"]:[Jn]}}]}},dragBlockClass:Yn,modalBehaviours:Zr([ol.config({}),Rl("dialog-events",Qn.dialogEvents.concat([rg(Wu(),(lo,mo)=>{uv.isBlocked(lo)?xo():Za.focusIn(lo)}),wr(MO(),(lo,mo)=>{lo.getSystem().broadcastOn([e2],{newFocus:mo.event.newFocus})})])),Rl("scroll-lock",[eu(()=>{$d(Ru(),oo)}),ig(()=>{Yu(Ru(),oo)})]),...Qn.extraBehaviours]),eventOrder:{[Im()]:["dialog-events"],[Zh()]:["scroll-lock","dialog-events","alloy.base.behaviour"],[xp()]:["alloy.base.behaviour","dialog-events","scroll-lock"],...Qn.eventOrder}})},r3=Qn=>yh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":Qn.translate("Close"),title:Qn.translate("Close")}},buttonBehaviours:Zr([sd.config({})]),components:[s0("close",{tag:"span",classes:["tox-icon"]},Qn.icons)],action:Zn=>{Wl(Zn,U_)}}),ST=(Qn,Zn,Yn,Jn)=>{const oo=lo=>[wd(Jn.translate(lo.title))];return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:{...Yn.map(lo=>({id:lo})).getOr({})}},components:[],behaviours:Zr([pa.config({channel:`${Ey}-${Zn}`,initialData:Qn,renderComponents:oo})])}},Ry=()=>({dom:vO('
    ')}),wT=(Qn,Zn,Yn,Jn)=>rv.sketch({dom:vO('
    '),components:[ST(Qn,Zn,ko.some(Yn),Jn),Ry(),r3(Jn)],containerBehaviours:Zr([Jw.config({mode:"mouse",blockerClass:"blocker",getTarget:oo=>Bg(oo,'[role="dialog"]').getOrDie(),snaps:{getSnapPoints:()=>[],leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}),or=(Qn,Zn,Yn)=>{const Jn=If.parts.title(ST(Qn,Zn,ko.none(),Yn)),oo=If.parts.draghandle(Ry()),lo=If.parts.close(r3(Yn)),mo=[Jn].concat(Qn.draggable?[oo]:[]).concat([lo]);return rv.sketch({dom:vO('
    '),components:mo})},ur=(Qn,Zn,Yn)=>or({title:Yn.shared.providers.translate(Qn),draggable:Yn.dialog.isDraggableModal()},Zn,Yn.shared.providers),Gr=(Qn,Zn,Yn,Jn)=>({dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":Yn.translate(Qn)},styles:{left:"0px",right:"0px",bottom:"0px",top:`${Jn.getOr(0)}px`,position:"absolute"}},behaviours:Zn,components:[{dom:vO('
    ')}]}),Wr=(Qn,Zn,Yn)=>({onClose:()=>Yn.closeWindow(),onBlock:Jn=>{const oo=Rd(Qn().element,".tox-dialog__header").map(lo=>cu(lo));If.setBusy(Qn(),(lo,mo)=>Gr(Jn.message,mo,Zn,oo))},onUnblock:()=>{If.setIdle(Qn())}}),Ha="tox-dialog--fullscreen",Jl="tox-dialog--width-lg",pd="tox-dialog--width-md",gp=Qn=>{switch(Qn){case"large":return ko.some(Jl);case"medium":return ko.some(pd);default:return ko.none()}},em=(Qn,Zn)=>{const Yn=Ds.fromDom(Zn.element.dom);of(Yn,Ha)||(sp(Yn,[Jl,pd]),gp(Qn).each(Jn=>$d(Yn,Jn)))},uS=(Qn,Zn)=>{const Yn=Ds.fromDom(Qn.element.dom),Jn=zv(Yn),oo=Zs(Jn,lo=>lo===Jl||lo===pd).or(gp(Zn));CS(Yn,[Ha,...oo.toArray()])},wb=(Qn,Zn,Yn)=>gh(s3({...Qn,firstTabstop:1,lazySink:Yn.shared.getSink,extraBehaviours:[LP({}),...Qn.extraBehaviours],onEscape:Jn=>{Wl(Jn,U_)},dialogEvents:Zn,eventOrder:{[T0()]:[pa.name(),Om.name()],[Zh()]:["scroll-lock",pa.name(),"messages","dialog-events","alloy.base.behaviour"],[xp()]:["alloy.base.behaviour","dialog-events","messages",pa.name(),"scroll-lock"]}})),i3=(Qn,Zn={})=>{const Yn=Jn=>{const oo=hs(Jn.items,lo=>{const mo=Rr(Zn,lo.name).getOr(Ua(!1));return{...lo,storage:mo}});return{...Jn,items:oo}};return hs(Qn,Jn=>Jn.type==="menu"?Yn(Jn):Jn)},kN=Qn=>za(Qn,(Zn,Yn)=>Yn.type==="menu"?za(Yn.items,(oo,lo)=>(oo[lo.name]=lo.storage,oo),Zn):Zn,{}),xN=(Qn,Zn)=>[pS(Wu(),mW),Qn(Uk,(Yn,Jn,oo,lo)=>{h1(rr(lo.element)).fold(xo,Vg),Zn.onClose(),Jn.onClose()}),Qn(U_,(Yn,Jn,oo,lo)=>{Jn.onCancel(Yn),Wl(lo,Uk)}),wr(jD,(Yn,Jn)=>Zn.onUnblock()),wr(qD,(Yn,Jn)=>Zn.onBlock(Jn.event))],tH=(Qn,Zn)=>{const Yn=(oo,lo)=>wr(oo,(mo,yo)=>{Jn(mo,(Co,Ro)=>{lo(Qn(),Co,yo.event,mo)})}),Jn=(oo,lo)=>{pa.getState(oo).get().each(mo=>{lo(mo,oo)})};return[...xN(Yn,Zn),Yn(Cy,(oo,lo,mo)=>{lo.onAction(oo,{name:mo.name})})]},nH=(Qn,Zn,Yn)=>{const Jn=(lo,mo)=>wr(lo,(yo,Co)=>{oo(yo,(Ro,Lo)=>{mo(Qn(),Ro,Co.event,yo)})}),oo=(lo,mo)=>{pa.getState(lo).get().each(yo=>{mo(yo.internalDialog,lo)})};return[...xN(Jn,Zn),Jn(PE,(lo,mo)=>mo.onSubmit(lo)),Jn(vg,(lo,mo,yo)=>{mo.onChange(lo,{name:yo.name})}),Jn(Cy,(lo,mo,yo,Co)=>{const Ro=()=>Co.getSystem().isConnected()?Za.focusIn(Co):void 0,Lo=es=>cs(es,"disabled")||Uo(es,"aria-disabled").exists(us=>us==="true"),Wo=rr(Co.element),jo=h1(Wo);mo.onAction(lo,{name:yo.name,value:yo.value}),h1(Wo).fold(Ro,es=>{Lo(es)||jo.exists(us=>cd(es,us)&&Lo(us))?Ro():Yn().toOptional().filter(us=>!cd(us.element,es)).each(Ro)})}),Jn(XI,(lo,mo,yo)=>{mo.onTabChange(lo,{newTabName:yo.name,oldTabName:yo.oldName})}),ig(lo=>{const mo=Qn();da.setValue(lo,mo.getData())})]},ec=(Qn,Zn)=>YP(Qn,Qn.type,Zn),hr=(Qn,Zn,Yn)=>Zs(Zn,Jn=>Jn.name===Yn).bind(Jn=>Jn.memento.getOpt(Qn)),Da=(Qn,Zn)=>{const Yn=Zn.map(yo=>yo.footerButtons).getOr([]),Jn=el(Yn,yo=>yo.align==="start"),oo=(yo,Co)=>rv.sketch({dom:{tag:"div",classes:[`tox-dialog__footer-${yo}`]},components:hs(Co,Ro=>Ro.memento.asSpec())}),lo=oo("start",Jn.pass),mo=oo("end",Jn.fail);return[lo,mo]},sl=(Qn,Zn,Yn)=>{const Jn=(oo,lo)=>{const mo=hs(lo.buttons,Co=>{const Ro=ou(ec(Co,Yn));return{name:Co.name,align:Co.align,memento:Ro}}),yo=Co=>hr(oo,mo,Co);return ko.some({lookupByName:yo,footerButtons:mo})};return{dom:vO(''),components:[],behaviours:Zr([pa.config({channel:`${CM}-${Zn}`,initialData:Qn,updateState:Jn,renderComponents:Da})])}},af=(Qn,Zn,Yn)=>sl(Qn,Zn,Yn),Zm=(Qn,Zn,Yn)=>If.parts.footer(sl(Qn,Zn,Yn)),Cb=(Qn,Zn)=>{if(Qn.getRoot().getSystem().isConnected()){const Jn=ic.getCurrent(Qn.getFormWrapper()).getOr(Qn.getFormWrapper());return Yk.getField(Jn,Zn).orThunk(()=>Qn.getFooter().bind(mo=>pa.getState(mo).get()).bind(mo=>mo.lookupByName(Zn)))}else return ko.none()},_h=(Qn,Zn)=>{const Yn=Qn.getRoot();return pa.getState(Yn).get().map(Jn=>Ec(Lu("data",Jn.dataValidator,Zn))).getOr(Zn)},kb=(Qn,Zn,Yn)=>{const Jn=us=>{const Ps=Qn.getRoot();Ps.getSystem().isConnected()&&us(Ps)},es={getData:()=>{const us=Qn.getRoot(),Ps=us.getSystem().isConnected()?Qn.getFormWrapper():us,er=da.getValue(Ps),Bs=Vl(Yn,Ns=>Ns.get());return{...er,...Bs}},setData:us=>{Jn(Ps=>{const er=es.getData(),Bs=Lc(er,us),Ns=_h(Qn,Bs),Xs=Qn.getFormWrapper();da.setValue(Xs,Ns),Zl(Yn,(Hr,kr)=>{Pl(Bs,kr)&&Hr.set(Bs[kr])})})},setEnabled:(us,Ps)=>{Cb(Qn,us).each(Ps?Ja.enable:Ja.disable)},focus:us=>{Cb(Qn,us).each(ol.focus)},block:us=>{if(!qn(us))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");Jn(Ps=>{Qa(Ps,qD,{message:us})})},unblock:()=>{Jn(us=>{Wl(us,jD)})},showTab:us=>{Jn(Ps=>{const er=Qn.getBody();pa.getState(er).get().exists(Ns=>Ns.isTabPanel())&&ic.getCurrent(er).each(Ns=>{ru.showTab(Ns,us)})})},redial:us=>{Jn(Ps=>{const er=Qn.getId(),Bs=Zn(us),Ns=i3(Bs.internalDialog.buttons,Yn);Ps.getSystem().broadcastOn([`${Jk}-${er}`],Bs),Ps.getSystem().broadcastOn([`${Ey}-${er}`],Bs.internalDialog),Ps.getSystem().broadcastOn([`${BP}-${er}`],Bs.internalDialog),Ps.getSystem().broadcastOn([`${CM}-${er}`],{...Bs.internalDialog,buttons:Ns}),es.setData(Bs.initialData)})},close:()=>{Jn(us=>{Wl(us,Uk)})},toggleFullscreen:Qn.toggleFullscreen};return es},EN=(Qn,Zn,Yn)=>{const Jn=ba("dialog"),oo=Qn.internalDialog,lo=ur(oo.title,Jn,Yn),mo=Ua(oo.size),yo=gp(mo.get()).toArray(),Co=(Ns,Xs)=>(mo.set(Xs.internalDialog.size),em(Xs.internalDialog.size,Ns),ko.some(Xs)),Ro=Py({body:oo.body,initialData:oo.initialData},Jn,Yn),Lo=i3(oo.buttons),Wo=kN(Lo),jo=Mr(Lo.length!==0,Zm({buttons:Lo},Jn,Yn)),es=nH(()=>Bs,Wr(()=>Ps,Yn.shared.providers,Zn),Yn.shared.getSink),us={id:Jn,header:lo,body:Ro,footer:jo,extraClasses:yo,extraBehaviours:[pa.config({channel:`${Jk}-${Jn}`,updateState:Co,initialData:Qn})],extraStyles:{}},Ps=wb(us,es,Yn),er=(()=>{const Ns=()=>{const Hr=If.getBody(Ps);return ic.getCurrent(Hr).getOr(Hr)},Xs=()=>{uS(Ps,mo.get())};return{getId:Mo(Jn),getRoot:Mo(Ps),getBody:()=>If.getBody(Ps),getFooter:()=>If.getFooter(Ps),getFormWrapper:Ns,toggleFullscreen:Xs}})(),Bs=kb(er,Zn.redial,Wo);return{dialog:Ps,instanceApi:Bs}},oH=(Qn,Zn,Yn,Jn=!1,oo)=>{const lo=ba("dialog"),mo=ba("dialog-label"),yo=ba("dialog-content"),Co=Qn.internalDialog,Ro=Ua(Co.size),Lo=gp(Ro.get()).toArray(),Wo=(Or,qr)=>(Ro.set(qr.internalDialog.size),em(qr.internalDialog.size,Or),oo(),ko.some(qr)),jo=ou(wT({title:Co.title,draggable:!0},lo,mo,Yn.shared.providers)),es=ou(fv({body:Co.body,initialData:Co.initialData},lo,yo,Yn,Jn)),us=i3(Co.buttons),Ps=kN(us),er=Mr(us.length!==0,ou(af({buttons:us},lo,Yn))),Bs=nH(()=>kr,{onBlock:Or=>{uv.block(Xs,(qr,na)=>{const Dl=jo.getOpt(Xs).map(Sa=>cu(Sa.element));return Gr(Or.message,na,Yn.shared.providers,Dl)})},onUnblock:()=>{uv.unblock(Xs)},onClose:()=>Zn.closeWindow()},Yn.shared.getSink),Xs=gh({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline",...Lo],attributes:{role:"dialog","aria-labelledby":mo}},eventOrder:{[T0()]:[pa.name(),Om.name()],[Im()]:["execute-on-form"],[Zh()]:["reflecting","execute-on-form"]},behaviours:Zr([Za.config({mode:"cyclic",onEscape:Or=>(Wl(Or,Uk),ko.some(!0)),useTabstopAt:Or=>!Kk(Or)&&(Nd(Or)!=="button"||Bu(Or,"disabled")!=="disabled"),firstTabstop:1}),pa.config({channel:`${Jk}-${lo}`,updateState:Wo,initialData:Qn}),ol.config({}),Rl("execute-on-form",Bs.concat([rg(Wu(),(Or,qr)=>{Za.focusIn(Or)}),wr(MO(),(Or,qr)=>{Or.getSystem().broadcastOn([e2],{newFocus:qr.event.newFocus})})])),uv.config({getRoot:()=>ko.some(Xs)}),Cl.config({}),LP({})]),components:[jo.asSpec(),es.asSpec(),...er.map(Or=>Or.asSpec()).toArray()]}),Hr=()=>{uS(Xs,Ro.get())},kr=kb({getId:Mo(lo),getRoot:Mo(Xs),getFooter:()=>er.map(Or=>Or.get(Xs)),getBody:()=>es.get(Xs),getFormWrapper:()=>{const Or=es.get(Xs);return ic.getCurrent(Or).getOr(Or)},toggleFullscreen:Hr},Zn.redial,Ps);return{dialog:Xs,instanceApi:kr}};var a3=tinymce.util.Tools.resolve("tinymce.util.URI");const FG=Qn=>{const Zn=mo=>{Qn.getSystem().isConnected()&&mo(Qn)};return{block:mo=>{if(!qn(mo))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");Zn(yo=>{Qa(yo,qD,{message:mo})})},unblock:()=>{Zn(mo=>{Wl(mo,jD)})},close:()=>{Zn(mo=>{Wl(mo,Uk)})},sendMessage:mo=>{Zn(yo=>{yo.getSystem().broadcastOn([kM],mo)})}}},cK=["insertContent","setContent","execCommand","close","block","unblock"],HG=Qn=>Xn(Qn)&&cK.indexOf(Qn.mceAction)!==-1,uK=Qn=>!HG(Qn)&&Xn(Qn)&&Pl(Qn,"mceAction"),dK=(Qn,Zn,Yn)=>{switch(Yn.mceAction){case"insertContent":Qn.insertContent(Yn.content);break;case"setContent":Qn.setContent(Yn.content);break;case"execCommand":const Jn=uo(Yn.ui)?Yn.ui:!1;Qn.execCommand(Yn.cmd,Jn,Yn.value);break;case"close":Zn.close();break;case"block":Zn.block(Yn.message);break;case"unblock":Zn.unblock();break}},fK=(Qn,Zn,Yn,Jn)=>{const oo=ba("dialog"),lo=ur(Qn.title,oo,Jn),mo=yT(Qn),yo=Qn.buttons.bind(Xs=>Xs.length===0?ko.none():ko.some(Zm({buttons:Xs},oo,Jn))),Co=tH(()=>Ns,Wr(()=>Bs,Jn.shared.providers,Zn)),Ro={...Qn.height.fold(()=>({}),Xs=>({height:Xs+"px","max-height":Xs+"px"})),...Qn.width.fold(()=>({}),Xs=>({width:Xs+"px","max-width":Xs+"px"}))},Lo=Qn.width.isNone()&&Qn.height.isNone()?["tox-dialog--width-lg"]:[],Wo=new a3(Qn.url,{base_uri:new a3(window.location.href)}),jo=`${Wo.protocol}://${Wo.host}${Wo.port?":"+Wo.port:""}`,es=ab(),us=(Xs,Hr)=>ko.some(Hr),Ps=[pa.config({channel:`${Jk}-${oo}`,updateState:us,initialData:Qn}),Rl("messages",[eu(()=>{const Xs=Dh(Ds.fromDom(window),"message",Hr=>{if(Wo.isSameOrigin(new a3(Hr.raw.origin))){const kr=Hr.raw.data;HG(kr)?dK(Yn,Ns,kr):uK(kr)&&Qn.onMessage(Ns,kr)}});es.set(Xs)}),ig(es.clear)]),Om.config({channels:{[kM]:{onReceive:(Xs,Hr)=>{Rd(Xs.element,"iframe").each(kr=>{const Or=kr.dom.contentWindow;Oo(Or)&&Or.postMessage(Hr,jo)})}}}})],Bs=wb({id:oo,header:lo,body:mo,footer:yo,extraClasses:Lo,extraBehaviours:Ps,extraStyles:Ro},Co,Jn),Ns=FG(Bs);return{dialog:Bs,instanceApi:Ns}},hK=Qn=>{const Zn=Qn.shared;return{open:(Jn,oo)=>{const lo=()=>{If.hide(Ro),oo()},mo=ou(YP({name:"close-alert",text:"OK",primary:!0,buttonType:ko.some("primary"),align:"end",enabled:!0,icon:ko.none()},"cancel",Qn)),yo=o3(),Co=$y(lo,Zn.providers),Ro=gh(s3({lazySink:()=>Zn.getSink(),header:OT(yo,Co),body:_T(Jn,Zn.providers),footer:ko.some(xm(cS([],[mo.asSpec()]))),onEscape:lo,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[wr(U_,lo)],eventOrder:{}}));If.show(Ro);const Lo=mo.get(Ro);ol.focus(Lo)}}},mK=Qn=>{const Zn=Qn.shared;return{open:(Jn,oo)=>{const lo=jo=>{If.hide(Lo),oo(jo)},mo=ou(YP({name:"yes",text:"Yes",primary:!0,buttonType:ko.some("primary"),align:"end",enabled:!0,icon:ko.none()},"submit",Qn)),yo=YP({name:"no",text:"No",primary:!1,buttonType:ko.some("secondary"),align:"end",enabled:!0,icon:ko.none()},"cancel",Qn),Co=o3(),Ro=$y(()=>lo(!1),Zn.providers),Lo=gh(s3({lazySink:()=>Zn.getSink(),header:OT(Co,Ro),body:_T(Jn,Zn.providers),footer:ko.some(xm(cS([],[yo,mo.asSpec()]))),onEscape:()=>lo(!1),extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[wr(U_,()=>lo(!1)),wr(PE,()=>lo(!0))],eventOrder:{}}));If.show(Lo);const Wo=mo.get(Lo);ol.focus(Wo)}}},QG=(Qn,Zn)=>Ec(Lu("data",Zn,Qn)),VG=Qn=>xE(Qn,".tox-alert-dialog")||xE(Qn,".tox-confirm-dialog"),pK=(Qn,Zn,Yn)=>Zn&&Yn?[]:[rf.config({contextual:{lazyContext:()=>ko.some(au(Ds.fromDom(Qn.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"],lazyViewport:Jn=>W_(Qn,Jn.element).map(lo=>({bounds:Wk(lo),optScrollEnv:ko.some({currentScrollTop:lo.element.dom.scrollTop,scrollElmTop:uh(lo.element).top})})).getOrThunk(()=>({bounds:tf(),optScrollEnv:ko.none()}))})],gK=Qn=>{const Zn=Qn.editor,Yn=uE(Zn),Jn=hK(Qn.backstages.dialog),oo=mK(Qn.backstages.dialog),lo=(us,Ps,er)=>{if(!ho(Ps)){if(Ps.inline==="toolbar")return Ro(us,Qn.backstages.popup.shared.anchors.inlineDialog(),er,Ps);if(Ps.inline==="bottom")return Lo(us,Qn.backstages.popup.shared.anchors.inlineBottomDialog(),er,Ps);if(Ps.inline==="cursor")return Ro(us,Qn.backstages.popup.shared.anchors.cursor(),er,Ps)}return Co(us,er)},mo=(us,Ps)=>yo(us,Ps),yo=(us,Ps)=>{const er=Bs=>{const Ns=fK(Bs,{closeWindow:()=>{If.hide(Ns.dialog),Ps(Ns.instanceApi)}},Zn,Qn.backstages.dialog);return If.show(Ns.dialog),Ns.instanceApi};return Tl.openUrl(er,us)},Co=(us,Ps)=>{const er=(Bs,Ns,Xs)=>{const Hr=Ns,Or=EN({dataValidator:Xs,initialData:Hr,internalDialog:Bs},{redial:Tl.redial,closeWindow:()=>{If.hide(Or.dialog),Ps(Or.instanceApi)}},Qn.backstages.dialog);return If.show(Or.dialog),Or.instanceApi.setData(Hr),Or.instanceApi};return Tl.open(er,us)},Ro=(us,Ps,er,Bs)=>{const Ns=(Xs,Hr,kr)=>{const Or=QG(Hr,kr),qr=Hl(),na=Qn.backstages.popup.shared.header.isPositionedAtTop(),Dl={dataValidator:kr,initialData:Or,internalDialog:Xs},Sa=()=>qr.on(Ga=>{kd.reposition(Ga),(!Yn||!na)&&rf.refresh(Ga)}),fl=oH(Dl,{redial:Tl.redial,closeWindow:()=>{qr.on(kd.hide),Zn.off("ResizeEditor",Sa),qr.clear(),er(fl.instanceApi)}},Qn.backstages.popup,Bs.ariaAttrs,Sa),rl=gh(kd.sketch({lazySink:Qn.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:Bs.persistent?{event:"doNotDismissYet"}:{},...na?{}:{fireRepositionEventInstead:{}},inlineBehaviours:Zr([Rl("window-manager-inline-events",[wr(q1(),(Ga,yc)=>{Wl(fl.dialog,U_)})]),...pK(Zn,Yn,na)]),isExtraPart:(Ga,yc)=>VG(yc)}));qr.set(rl);const Yc=()=>{const Ga=Zn.inline?Ru():Ds.fromDom(Zn.getContainer()),yc=au(Ga);return ko.some(yc)};return kd.showWithinBounds(rl,Fm(fl.dialog),{anchor:Ps},Yc),(!Yn||!na)&&(rf.refresh(rl),Zn.on("ResizeEditor",Sa)),fl.instanceApi.setData(Or),Za.focusIn(fl.dialog),fl.instanceApi};return Tl.open(Ns,us)},Lo=(us,Ps,er,Bs)=>{const Ns=(Xs,Hr,kr)=>{const Or=QG(Hr,kr),qr=Hl(),na=Qn.backstages.popup.shared.header.isPositionedAtTop(),Dl={dataValidator:kr,initialData:Or,internalDialog:Xs},Sa=()=>qr.on(Ga=>{kd.reposition(Ga),rf.refresh(Ga)}),fl=oH(Dl,{redial:Tl.redial,closeWindow:()=>{qr.on(kd.hide),Zn.off("ResizeEditor ScrollWindow ElementScroll",Sa),qr.clear(),er(fl.instanceApi)}},Qn.backstages.popup,Bs.ariaAttrs,Sa),rl=gh(kd.sketch({lazySink:Qn.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:Bs.persistent?{event:"doNotDismissYet"}:{},...na?{}:{fireRepositionEventInstead:{}},inlineBehaviours:Zr([Rl("window-manager-inline-events",[wr(q1(),(Ga,yc)=>{Wl(fl.dialog,U_)})]),rf.config({contextual:{lazyContext:()=>ko.some(au(Ds.fromDom(Zn.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top","bottom"],lazyViewport:Ga=>W_(Zn,Ga.element).map(oa=>({bounds:Wk(oa),optScrollEnv:ko.some({currentScrollTop:oa.element.dom.scrollTop,scrollElmTop:uh(oa.element).top})})).getOrThunk(()=>({bounds:tf(),optScrollEnv:ko.none()}))})]),isExtraPart:(Ga,yc)=>VG(yc)}));qr.set(rl);const Yc=()=>Qn.backstages.popup.shared.getSink().toOptional().bind(Ga=>{const yc=W_(Zn,Ga.element),oa=15,$a=yc.map(Ka=>Wk(Ka)).getOr(tf()),hl=au(Ds.fromDom(Zn.getContentAreaContainer())),gl=O0(hl,$a);return ko.some(Kc(gl.x,gl.y,gl.width,gl.height-oa))});return kd.showWithinBounds(rl,Fm(fl.dialog),{anchor:Ps},Yc),rf.refresh(rl),Zn.on("ResizeEditor ScrollWindow ElementScroll ResizeWindow",Sa),fl.instanceApi.setData(Or),Za.focusIn(fl.dialog),fl.instanceApi};return Tl.open(Ns,us)};return{open:lo,openUrl:mo,alert:(us,Ps)=>{Jn.open(us,Ps)},close:us=>{us.close()},confirm:(us,Ps)=>{oo.open(us,Ps)}}},bK=Qn=>{L5(Qn),zQ(Qn),Yj(Qn)};var vK=()=>{lm.add("silver",Qn=>{bK(Qn);let Zn=()=>tf();const{dialogs:Yn,popups:Jn,renderUI:oo}=jX(Qn,{getPopupSinkBounds:()=>Zn()}),lo=()=>{const Co=oo();return W_(Qn,Jn.getMothership().element).each(Lo=>{Zn=()=>Wk(Lo)}),Co};DV.register(Qn,Jn.backstage.shared);const mo=gK({editor:Qn,backstages:{popup:Jn.backstage,dialog:Yn.backstage}}),yo=()=>SR(Qn,{backstage:Jn.backstage},Jn.getMothership());return{renderUI:lo,getWindowManagerImpl:Mo(mo),getNotificationManagerImpl:yo}})};vK()})();(function(){var _n=tinymce.util.Tools.resolve("tinymce.PluginManager");const Ce=(rs,As,Ws)=>{var rr;return Ws(rs,As.prototype)?!0:((rr=rs.constructor)===null||rr===void 0?void 0:rr.name)===As.name},ke=rs=>{const As=typeof rs;return rs===null?"null":As==="object"&&Array.isArray(rs)?"array":As==="object"&&Ce(rs,String,(Ws,rr)=>rr.isPrototypeOf(Ws))?"string":As},$n=rs=>As=>ke(As)===rs,Hn=rs=>As=>typeof As===rs,zn=rs=>As=>rs===As,Un=$n("string"),qn=$n("object"),Xn=$n("array"),Kn=zn(null),to=Hn("boolean"),io=rs=>rs==null,uo=rs=>!io(rs),ho=Hn("function"),bo=(rs,As)=>{if(Xn(rs)){for(let Ws=0,rr=rs.length;Ws{},So=rs=>()=>rs,$o=(rs,As)=>rs===As;class Do{constructor(As,Ws){this.tag=As,this.value=Ws}static some(As){return new Do(!0,As)}static none(){return Do.singletonNone}fold(As,Ws){return this.tag?Ws(this.value):As()}isSome(){return this.tag}isNone(){return!this.tag}map(As){return this.tag?Do.some(As(this.value)):Do.none()}bind(As){return this.tag?As(this.value):Do.none()}exists(As){return this.tag&&As(this.value)}forall(As){return!this.tag||As(this.value)}filter(As){return!this.tag||As(this.value)?this:Do.none()}getOr(As){return this.tag?this.value:As}or(As){return this.tag?this:As}getOrThunk(As){return this.tag?this.value:As()}orThunk(As){return this.tag?this:As()}getOrDie(As){if(this.tag)return this.value;throw new Error(As??"Called getOrDie on None")}static from(As){return uo(As)?Do.some(As):Do.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(As){this.tag&&As(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Do.singletonNone=new Do(!1);const xo=Array.prototype.indexOf,Io=Array.prototype.push,Vo=(rs,As)=>xo.call(rs,As),Jo=(rs,As)=>Vo(rs,As)>-1,Mo=(rs,As)=>{const Ws=rs.length,rr=new Array(Ws);for(let Fr=0;Fr{for(let Ws=0,rr=rs.length;Ws(Go(rs,(rr,Fr)=>{Ws=As(Ws,rr,Fr)}),Ws),ms=rs=>{const As=[];for(let Ws=0,rr=rs.length;Wsms(Mo(rs,As)),Yo=(rs,As)=>{for(let Ws=0;Wsrs.exists(rr=>Ws(rr,As)),sr=rs=>{const As=[],Ws=rr=>{As.push(rr)};for(let rr=0;rrrs?Do.some(As):Do.none(),ko=rs=>As=>As.options.get(rs),gs=rs=>{const As=rs.options.register;As("link_assume_external_targets",{processor:Ws=>{const rr=Un(Ws)||to(Ws);return rr?Ws===!0?{value:1,valid:rr}:Ws==="http"||Ws==="https"?{value:Ws,valid:rr}:{value:0,valid:rr}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),As("link_context_toolbar",{processor:"boolean",default:!1}),As("link_list",{processor:Ws=>Un(Ws)||ho(Ws)||bo(Ws,qn)}),As("link_default_target",{processor:"string"}),As("link_default_protocol",{processor:"string",default:"https"}),As("link_target_list",{processor:Ws=>to(Ws)||bo(Ws,qn),default:!0}),As("link_rel_list",{processor:"object[]",default:[]}),As("link_class_list",{processor:"object[]",default:[]}),As("link_title",{processor:"boolean",default:!0}),As("allow_unsafe_link_target",{processor:"boolean",default:!1}),As("link_quicklink",{processor:"boolean",default:!1})},xs=ko("link_assume_external_targets"),Qr=ko("link_context_toolbar"),cr=ko("link_list"),ws=ko("link_default_target"),Fs=ko("link_default_protocol"),Br=ko("link_target_list"),_r=ko("link_rel_list"),ha=ko("link_class_list"),hs=ko("link_title"),Qs=ko("allow_unsafe_link_target"),zo=ko("link_quicklink");var el=tinymce.util.Tools.resolve("tinymce.util.Tools");const ga=rs=>Un(rs.value)?rs.value:"",Ca=rs=>Un(rs.text)?rs.text:Un(rs.title)?rs.title:"",za=(rs,As)=>{const Ws=[];return el.each(rs,rr=>{const Fr=Ca(rr);if(rr.menu!==void 0){const Wa=za(rr.menu,As);Ws.push({text:Fr,items:Wa})}else{const Wa=As(rr);Ws.push({text:Fr,value:Wa})}}),Ws},Il=(rs=ga)=>As=>Do.from(As).map(Ws=>za(Ws,rs)),Us={sanitize:rs=>Il(ga)(rs),sanitizeWith:Il,createUi:(rs,As)=>Ws=>({name:rs,type:"listbox",label:As,items:Ws}),getValue:ga},fs=Object.keys,dr=Object.hasOwnProperty,Vr=(rs,As)=>{const Ws=fs(rs);for(let rr=0,Fr=Ws.length;rr(As,Ws)=>{rs[Ws]=As},Kr=(rs,As,Ws,rr)=>{Vr(rs,(Fr,Wa)=>{(As(Fr,Wa)?Ws:rr)(Fr,Wa)})},ra=(rs,As)=>{const Ws={};return Kr(rs,As,nr(Ws),Oo),Ws},Ml=(rs,As)=>dr.call(rs,As),xa=(rs,As)=>Ml(rs,As)&&rs[As]!==void 0&&rs[As]!==null;var Nl=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Zc=tinymce.util.Tools.resolve("tinymce.util.URI");const cc=rs=>uo(rs)&&rs.nodeName.toLowerCase()==="a",gc=rs=>cc(rs)&&!!Zl(rs),nc=(rs,As)=>{if(rs.collapsed)return[];{const Ws=rs.cloneContents(),rr=Ws.firstChild,Fr=new Nl(rr,Ws),Wa=[];let Nc=rr;do As(Nc)&&Wa.push(Nc);while(Nc=Fr.next());return Wa}},Ed=rs=>/^\w+:/i.test(rs),Zl=rs=>{var As,Ws;return(Ws=(As=rs.getAttribute("data-mce-href"))!==null&&As!==void 0?As:rs.getAttribute("href"))!==null&&Ws!==void 0?Ws:""},Vl=(rs,As)=>{const Ws=["noopener"],rr=rs?rs.split(/\s+/):[],Fr=ul=>el.trim(ul.sort().join(" ")),Wa=ul=>(ul=Nc(ul),ul.length>0?ul.concat(Ws):Ws),Nc=ul=>ul.filter(lu=>el.inArray(Ws,lu)===-1),xl=As?Wa(rr):Nc(rr);return xl.length>0?Fr(xl):""},Fc=rs=>rs.replace(/\uFEFF/g,""),qa=(rs,As)=>(As=As||Yl(rs.selection.getRng())[0]||rs.selection.getNode(),Pl(As)?Do.from(rs.dom.select("a[href]",As)[0]):Do.from(rs.dom.getParent(As,"a[href]"))),Ya=(rs,As)=>qa(rs,As).isSome(),kc=(rs,As)=>{const Ws=As.fold(()=>rs.getContent({format:"text"}),rr=>rr.innerText||rr.textContent||"");return Fc(Ws)},Yl=rs=>nc(rs,gc),rd=rs=>el.grep(rs,gc),Al=rs=>rd(rs).length>0,gd=rs=>Yl(rs).length>0,Rr=rs=>{const As=rs.schema.getTextInlineElements(),Ws=Wa=>Wa.nodeType===1&&!cc(Wa)&&!Ml(As,Wa.nodeName.toLowerCase());if(qa(rs).exists(Wa=>Wa.hasAttribute("data-mce-block")))return!1;const Fr=rs.selection.getRng();return Fr.collapsed?!0:nc(Fr,Ws).length===0},Pl=rs=>uo(rs)&&rs.nodeName==="FIGURE"&&/\bimage\b/i.test(rs.className),Su=rs=>os(["title","rel","class","target"],(Ws,rr)=>(rs[rr].each(Fr=>{Ws[rr]=Fr.length>0?Fr:null}),Ws),{href:rs.href}),vs=(rs,As)=>(As==="http"||As==="https")&&!Ed(rs)?As+"://"+rs:rs,Es=(rs,As)=>{const Ws={...As};if(_r(rs).length===0&&!Qs(rs)){const rr=Vl(Ws.rel,Ws.target==="_blank");Ws.rel=rr||null}return Do.from(Ws.target).isNone()&&Br(rs)===!1&&(Ws.target=ws(rs)),Ws.href=vs(Ws.href,xs(rs)),Ws},Ks=(rs,As,Ws,rr)=>{Ws.each(Fr=>{Ml(As,"innerText")?As.innerText=Fr:As.textContent=Fr}),rs.dom.setAttribs(As,rr),rs.selection.select(As)},pr=(rs,As,Ws,rr)=>{const Fr=rs.dom;Pl(As)?Vc(Fr,As,rr):Ws.fold(()=>{rs.execCommand("mceInsertLink",!1,rr)},Wa=>{rs.insertContent(Fr.createHTML("a",rr,Fr.encode(Wa)))})},ia=(rs,As,Ws)=>{const rr=rs.selection.getNode(),Fr=qa(rs,rr),Wa=Es(rs,Su(Ws));rs.undoManager.transact(()=>{Ws.href===As.href&&As.attach(),Fr.fold(()=>{pr(rs,rr,Ws.text,Wa)},Nc=>{rs.focus(),Ks(rs,Nc,Ws.text,Wa)})})},ka=rs=>{const As=rs.dom,Ws=rs.selection,rr=Ws.getBookmark(),Fr=Ws.getRng().cloneRange(),Wa=As.getParent(Fr.startContainer,"a[href]",rs.getBody()),Nc=As.getParent(Fr.endContainer,"a[href]",rs.getBody());Wa&&Fr.setStartBefore(Wa),Nc&&Fr.setEndAfter(Nc),Ws.setRng(Fr),rs.execCommand("unlink"),Ws.moveToBookmark(rr)},Ma=rs=>{rs.undoManager.transact(()=>{const As=rs.selection.getNode();Pl(As)?Rc(rs,As):ka(rs),rs.focus()})},Mr=rs=>{const{class:As,href:Ws,rel:rr,target:Fr,text:Wa,title:Nc}=rs;return ra({class:As.getOrNull(),href:Ws,rel:rr.getOrNull(),target:Fr.getOrNull(),text:Wa.getOrNull(),title:Nc.getOrNull()},(xl,ul)=>Kn(xl)===!1)},il=(rs,As)=>{const Ws=rs.options.get,rr={allow_html_data_urls:Ws("allow_html_data_urls"),allow_script_urls:Ws("allow_script_urls"),allow_svg_data_urls:Ws("allow_svg_data_urls")},Fr=As.href;return{...As,href:Zc.isDomSafe(Fr,"a",rr)?Fr:""}},Na=(rs,As,Ws)=>{const rr=il(rs,Ws);rs.hasPlugin("rtc",!0)?rs.execCommand("createlink",!1,Mr(rr)):ia(rs,As,rr)},vl=rs=>{rs.hasPlugin("rtc",!0)?rs.execCommand("unlink"):Ma(rs)},Rc=(rs,As)=>{var Ws;const rr=rs.dom.select("img",As)[0];if(rr){const Fr=rs.dom.getParents(rr,"a[href]",As)[0];Fr&&((Ws=Fr.parentNode)===null||Ws===void 0||Ws.insertBefore(rr,Fr),rs.dom.remove(Fr))}},Vc=(rs,As,Ws)=>{var rr;const Fr=rs.select("img",As)[0];if(Fr){const Wa=rs.create("a",Ws);(rr=Fr.parentNode)===null||rr===void 0||rr.insertBefore(Wa,Fr),Wa.appendChild(Fr)}},xc=rs=>xa(rs,"items"),zc=(rs,As)=>Yo(As,Ws=>xc(Ws)?zc(rs,Ws.items):Js(Ws.value===rs,Ws)),ad=(rs,As,Ws,rr)=>{const Fr=rr[As],Wa=rs.length>0;return Fr!==void 0?zc(Fr,Ws).map(Nc=>({url:{value:Nc.value,meta:{text:Wa?rs:Nc.text,attach:Oo}},text:Wa?rs:Nc.text})):Do.none()},Bh=(rs,As)=>As==="link"?rs.link:As==="anchor"?rs.anchor:Do.none(),Ts={init:(rs,As)=>{const Ws={text:rs.text,title:rs.title},rr=ul=>{var lu;return Js(Ws.title.length<=0,Do.from((lu=ul.meta)===null||lu===void 0?void 0:lu.title).getOr(""))},Fr=ul=>{var lu;return Js(Ws.text.length<=0,Do.from((lu=ul.meta)===null||lu===void 0?void 0:lu.text).getOr(ul.value))},Wa=ul=>{const lu=Fr(ul.url),Gl=rr(ul.url);return lu.isSome()||Gl.isSome()?Do.some({...lu.map(Ru=>({text:Ru})).getOr({}),...Gl.map(Ru=>({title:Ru})).getOr({})}):Do.none()},Nc=(ul,lu)=>{const Gl=Bh(As,lu).getOr([]);return ad(Ws.text,lu,Gl,ul)};return{onChange:(ul,lu)=>{const Gl=lu.name;return Gl==="url"?Wa(ul()):Jo(["anchor","link"],Gl)?Nc(ul(),Gl):((Gl==="text"||Gl==="title")&&(Ws[Gl]=ul()[Gl]),Do.none())}}},getDelta:ad};var ks=tinymce.util.Tools.resolve("tinymce.util.Delay");const ir=(rs,As,Ws)=>{const rr=rs.selection.getRng();ks.setEditorTimeout(rs,()=>{rs.windowManager.confirm(As,Fr=>{rs.selection.setRng(rr),Ws(Fr)})})},br=rs=>{const As=rs.href;return As.indexOf("@")>0&&As.indexOf("/")===-1&&As.indexOf("mailto:")===-1?Do.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:rr=>({...rr,href:"mailto:"+As})}):Do.none()},Aa=(rs,As)=>Ws=>{const rr=Ws.href;return rs===1&&!Ed(rr)||rs===0&&/^\s*www(\.|\d\.)/i.test(rr)?Do.some({message:`The URL you entered seems to be an external link. Do you want to add the required ${As}:// prefix?`,preprocess:Wa=>({...Wa,href:As+"://"+rr})}):Do.none()},_l={preprocess:(rs,As)=>Yo([br,Aa(xs(rs),Fs(rs))],Ws=>Ws(As)).fold(()=>Promise.resolve(As),Ws=>new Promise(rr=>{ir(rs,Ws.message,Fr=>{rr(Fr?Ws.preprocess(As):As)})}))},Ds={getAnchors:rs=>{const As=rs.dom.select("a:not([href])"),Ws=is(As,rr=>{const Fr=rr.name||rr.id;return Fr?[{text:Fr,value:"#"+Fr}]:[]});return Ws.length>0?Do.some([{text:"None",value:""}].concat(Ws)):Do.none()}},wu={getClasses:rs=>{const As=ha(rs);return As.length>0?Us.sanitize(As):Do.none()}},qu=rs=>{try{return Do.some(JSON.parse(rs))}catch{return Do.none()}},bc={getLinks:rs=>{const As=rr=>rs.convertURL(rr.value||rr.url||"","href"),Ws=cr(rs);return new Promise(rr=>{Un(Ws)?fetch(Ws).then(Fr=>Fr.ok?Fr.text().then(qu):Promise.reject()).then(rr,()=>rr(Do.none())):ho(Ws)?Ws(Fr=>rr(Do.some(Fr))):rr(Do.from(Ws))}).then(rr=>rr.bind(Us.sanitizeWith(As)).map(Fr=>Fr.length>0?[{text:"None",value:""}].concat(Fr):Fr))}},Ff={getRels:(rs,As)=>{const Ws=_r(rs);if(Ws.length>0){const rr=Ys(As,"_blank"),Fr=Qs(rs)===!1,Wa=xl=>Vl(Us.getValue(xl),rr);return(Fr?Us.sanitizeWith(Wa):Us.sanitize)(Ws)}return Do.none()}},Ud=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],oc={getTargets:rs=>{const As=Br(rs);return Xn(As)?Us.sanitize(As).orThunk(()=>Do.some(Ud)):As===!1?Do.none():Do.some(Ud)}},Dc=(rs,As,Ws)=>{const rr=rs.getAttrib(As,Ws);return rr!==null&&rr.length>0?Do.some(rr):Do.none()},bd=(rs,As)=>{const Ws=rs.dom,Fr=Rr(rs)?Do.some(kc(rs.selection,As)):Do.none(),Wa=As.bind(Gl=>Do.from(Ws.getAttrib(Gl,"href"))),Nc=As.bind(Gl=>Do.from(Ws.getAttrib(Gl,"target"))),xl=As.bind(Gl=>Dc(Ws,Gl,"rel")),ul=As.bind(Gl=>Dc(Ws,Gl,"class")),lu=As.bind(Gl=>Dc(Ws,Gl,"title"));return{url:Wa,text:Fr,title:lu,target:Nc,rel:xl,linkClass:ul}},ih={collect:(rs,As)=>bc.getLinks(rs).then(Ws=>{const rr=bd(rs,As);return{anchor:rr,catalogs:{targets:oc.getTargets(rs),rels:Ff.getRels(rs,rr.target),classes:wu.getClasses(rs),anchor:Ds.getAnchors(rs),link:Ws},optNode:As,flags:{titleEnabled:hs(rs)}}})},om=(rs,As)=>Ws=>{const rr=Ws.getData();if(!rr.url.value){vl(rs),Ws.close();return}const Fr=xl=>Do.from(rr[xl]).filter(ul=>!Ys(As.anchor[xl],ul)),Wa={href:rr.url.value,text:Fr("text"),target:Fr("target"),rel:Fr("rel"),class:Fr("linkClass"),title:Fr("title")},Nc={href:rr.url.value,attach:rr.url.meta!==void 0&&rr.url.meta.attach?rr.url.meta.attach:Oo};_l.preprocess(rs,Wa).then(xl=>{Na(rs,Nc,xl)}),Ws.close()},sm=rs=>{const As=qa(rs);return ih.collect(rs,As)},fc=(rs,As)=>{const Ws=rs.anchor,rr=Ws.url.getOr("");return{url:{value:rr,meta:{original:{value:rr}}},text:Ws.text.getOr(""),title:Ws.title.getOr(""),anchor:rr,link:rr,rel:Ws.rel.getOr(""),target:Ws.target.or(As).getOr(""),linkClass:Ws.linkClass.getOr("")}},Td=(rs,As,Ws)=>{const rr=[{name:"url",type:"urlinput",filetype:"file",label:"URL",picker_text:"Browse links"}],Fr=rs.anchor.text.map(()=>({name:"text",type:"input",label:"Text to display"})).toArray(),Wa=rs.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],Nc=Do.from(ws(Ws)),xl=fc(rs,Nc),ul=rs.catalogs,lu=Ts.init(xl,ul);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:ms([rr,Fr,Wa,sr([ul.anchor.map(Us.createUi("anchor","Anchors")),ul.rels.map(Us.createUi("rel","Rel")),ul.targets.map(Us.createUi("target","Open link in...")),ul.link.map(Us.createUi("link","Link list")),ul.classes.map(Us.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:xl,onChange:(Ru,{name:xf})=>{lu.onChange(Ru.getData,{name:xf}).each(Hp=>{Ru.setData(Hp)})},onSubmit:As}},Jd=rs=>{sm(rs).then(Ws=>{const rr=om(rs,Ws);return Td(Ws,rr,rs)}).then(Ws=>{rs.windowManager.open(Ws)})},Em=rs=>{rs.addCommand("mceLink",(As,Ws)=>{(Ws==null?void 0:Ws.dialog)===!0||!zo(rs)?Jd(rs):rs.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"})})};var ef=tinymce.util.Tools.resolve("tinymce.util.VK");const Cu=(rs,As)=>{document.body.appendChild(rs),rs.dispatchEvent(As),document.body.removeChild(rs)},Qc=rs=>{const As=document.createElement("a");As.target="_blank",As.href=rs,As.rel="noreferrer noopener";const Ws=document.createEvent("MouseEvents");Ws.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Cu(As,Ws)},Cf=(rs,As)=>rs.dom.getParent(As,"a[href]"),qm=rs=>Cf(rs,rs.selection.getStart()),Oc=rs=>rs.altKey===!0&&rs.shiftKey===!1&&rs.ctrlKey===!1&&rs.metaKey===!1,cd=(rs,As)=>{if(As){const Ws=Zl(As);if(/^#/.test(Ws)){const rr=rs.dom.select(Ws);rr.length&&rs.selection.scrollIntoView(rr[0],!0)}else Qc(As.href)}},vd=rs=>()=>{rs.execCommand("mceLink",!1,{dialog:!0})},ju=rs=>()=>{cd(rs,qm(rs))},Xf=rs=>{rs.on("click",As=>{const Ws=Cf(rs,As.target);Ws&&ef.metaKeyPressed(As)&&(As.preventDefault(),cd(rs,Ws))}),rs.on("keydown",As=>{if(!As.isDefaultPrevented()&&As.keyCode===13&&Oc(As)){const Ws=qm(rs);Ws&&(As.preventDefault(),cd(rs,Ws))}})},Sh=(rs,As)=>(rs.on("NodeChange",As),()=>rs.off("NodeChange",As)),Zd=rs=>As=>{const Ws=()=>{As.setActive(!rs.mode.isReadOnly()&&Ya(rs,rs.selection.getNode())),As.setEnabled(rs.selection.isEditable())};return Ws(),Sh(rs,Ws)},ah=rs=>As=>{const Ws=()=>{As.setEnabled(rs.selection.isEditable())};return Ws(),Sh(rs,Ws)},lh=rs=>(rs.selection.isCollapsed()?rd(rs.dom.getParents(rs.selection.getStart())):Yl(rs.selection.getRng())).length===1,Bp=rs=>As=>{const Ws=()=>As.setEnabled(lh(rs));return Ws(),Sh(rs,Ws)},ch=rs=>As=>{const Ws=Wa=>Al(Wa)||gd(rs.selection.getRng()),rr=rs.dom.getParents(rs.selection.getStart()),Fr=Wa=>{As.setEnabled(Ws(Wa)&&rs.selection.isEditable())};return Fr(rr),Sh(rs,Wa=>Fr(Wa.parents))},bp=rs=>{rs.addShortcut("Meta+K","",()=>{rs.execCommand("mceLink")})},kf=rs=>{rs.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:vd(rs),onSetup:Zd(rs)}),rs.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:ju(rs),onSetup:Bp(rs)}),rs.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>vl(rs),onSetup:ch(rs)})},Fh=rs=>{rs.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:ju(rs),onSetup:Bp(rs)}),rs.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onSetup:ah(rs),onAction:vd(rs)}),rs.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>vl(rs),onSetup:ch(rs)})},jm=rs=>{const As="link unlink openlink",Ws="link";rs.ui.registry.addContextMenu("link",{update:rr=>rs.dom.isEditable(rr)?Al(rs.dom.getParents(rr,"a"))?As:Ws:""})},Fp=rs=>{const As=Fr=>{Fr.selection.collapse(!1)},Ws=Fr=>{const Wa=rs.selection.getNode();return Fr.setEnabled(Ya(rs,Wa)),Oo},rr=Fr=>{const Wa=qa(rs),Nc=Rr(rs);if(Wa.isNone()&&Nc){const xl=kc(rs.selection,Wa);return Js(xl.length===0,Fr)}else return Do.none()};rs.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Zd(rs)},label:"Link",predicate:Fr=>Qr(rs)&&Ya(rs,Fr),initValue:()=>qa(rs).fold(So(""),Zl),commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:Fr=>{const Wa=rs.selection.getNode();return Fr.setActive(Ya(rs,Wa)),Zd(rs)(Fr)},onAction:Fr=>{const Wa=Fr.getValue(),Nc=rr(Wa);Na(rs,{href:Wa,attach:Oo},{href:Wa,text:Nc,title:Do.none(),rel:Do.none(),target:Do.none(),class:Do.none()}),As(rs),Fr.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:Ws,onAction:Fr=>{vl(rs),Fr.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:Ws,onAction:Fr=>{ju(rs)(),Fr.hide()}}]})};var Eg=()=>{_n.add("link",rs=>{gs(rs),kf(rs),Fh(rs),jm(rs),Fp(rs),Xf(rs),Em(rs),bp(rs)})};Eg()})();(function(){var _n=tinymce.util.Tools.resolve("tinymce.PluginManager");const Ce=(qn,Xn)=>{qn.focus(),qn.undoManager.transact(()=>{qn.setContent(Xn)}),qn.selection.setCursorLocation(),qn.nodeChanged()},ke=qn=>qn.getContent({source_view:!0}),$n=qn=>{const Xn=ke(qn);qn.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:Xn},onSubmit:Kn=>{Ce(qn,Kn.getData().code),Kn.close()}})},Hn=qn=>{qn.addCommand("mceCodeEditor",()=>{$n(qn)})},zn=qn=>{const Xn=()=>qn.execCommand("mceCodeEditor");qn.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:Xn}),qn.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:Xn})};var Un=()=>{_n.add("code",qn=>(Hn(qn),zn(qn),{}))};Un()})();(function(){var _n=tinymce.util.Tools.resolve("tinymce.PluginManager");const Ce=Object.getPrototypeOf,ke=(Uo,cs,_s)=>{var ar;return _s(Uo,cs.prototype)?!0:((ar=Uo.constructor)===null||ar===void 0?void 0:ar.name)===cs.name},$n=Uo=>{const cs=typeof Uo;return Uo===null?"null":cs==="object"&&Array.isArray(Uo)?"array":cs==="object"&&ke(Uo,String,(_s,ar)=>ar.isPrototypeOf(_s))?"string":cs},Hn=Uo=>cs=>$n(cs)===Uo,zn=Uo=>cs=>typeof cs===Uo,Un=Uo=>cs=>Uo===cs,qn=(Uo,cs)=>Kn(Uo)&&ke(Uo,cs,(_s,ar)=>Ce(_s)===ar),Xn=Hn("string"),Kn=Hn("object"),to=Uo=>qn(Uo,Object),io=Hn("array"),uo=Un(null),ho=zn("boolean"),bo=Uo=>Uo==null,Oo=Uo=>!bo(Uo),So=zn("function"),$o=zn("number"),Do=(Uo,cs)=>{if(io(Uo)){for(let _s=0,ar=Uo.length;_s{};class Io{constructor(cs,_s){this.tag=cs,this.value=_s}static some(cs){return new Io(!0,cs)}static none(){return Io.singletonNone}fold(cs,_s){return this.tag?_s(this.value):cs()}isSome(){return this.tag}isNone(){return!this.tag}map(cs){return this.tag?Io.some(cs(this.value)):Io.none()}bind(cs){return this.tag?cs(this.value):Io.none()}exists(cs){return this.tag&&cs(this.value)}forall(cs){return!this.tag||cs(this.value)}filter(cs){return!this.tag||cs(this.value)?this:Io.none()}getOr(cs){return this.tag?this.value:cs}or(cs){return this.tag?this:cs}getOrThunk(cs){return this.tag?this.value:cs()}orThunk(cs){return this.tag?this:cs()}getOrDie(cs){if(this.tag)return this.value;throw new Error(cs??"Called getOrDie on None")}static from(cs){return Oo(cs)?Io.some(cs):Io.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(cs){this.tag&&cs(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Io.singletonNone=new Io(!1);const Vo=Object.keys,Jo=Object.hasOwnProperty,Mo=(Uo,cs)=>{const _s=Vo(Uo);for(let ar=0,ta=_s.length;ar(cs,_s)=>{Uo[_s]=cs},os=(Uo,cs,_s,ar)=>{Mo(Uo,(ta,al)=>{(cs(ta,al)?_s:ar)(ta,al)})},ms=(Uo,cs)=>{const _s={};return os(Uo,cs,Go(_s),xo),_s},is=(Uo,cs)=>Jo.call(Uo,cs),Yo=(Uo,cs)=>is(Uo,cs)&&Uo[cs]!==void 0&&Uo[cs]!==null,Ys=Array.prototype.push,sr=Uo=>{const cs=[];for(let _s=0,ar=Uo.length;_scs>=0&&csJs(Uo,0),gs=(Uo,cs)=>{for(let _s=0;_s{if(Xn(_s)||ho(_s)||$o(_s))Uo.setAttribute(cs,_s+"");else throw console.error("Invalid call to Attribute.set. Key ",cs,":: Value ",_s,":: Element ",Uo),new Error("Attribute value was not simple")},Qr=(Uo,cs,_s)=>{xs(Uo.dom,cs,_s)},cr=(Uo,cs)=>{Uo.dom.removeAttribute(cs)},ws=(Uo,cs)=>{const ar=(cs||document).createElement("div");if(ar.innerHTML=Uo,!ar.hasChildNodes()||ar.childNodes.length>1){const ta="HTML does not have a single root node";throw console.error(ta,Uo),new Error(ta)}return _r(ar.childNodes[0])},Fs=(Uo,cs)=>{const ar=(cs||document).createElement(Uo);return _r(ar)},Br=(Uo,cs)=>{const ar=(cs||document).createTextNode(Uo);return _r(ar)},_r=Uo=>{if(Uo==null)throw new Error("Node cannot be null or undefined");return{dom:Uo}},hs={fromHtml:ws,fromTag:Fs,fromText:Br,fromDom:_r,fromPoint:(Uo,cs,_s)=>Io.from(Uo.dom.elementFromPoint(cs,_s)).map(_r)};var Qs=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),zo=tinymce.util.Tools.resolve("tinymce.util.URI");const el=Uo=>Uo.length>0,ga=Uo=>cs=>cs.options.get(Uo),Ca=Uo=>{const cs=Uo.options.register;cs("image_dimensions",{processor:"boolean",default:!0}),cs("image_advtab",{processor:"boolean",default:!1}),cs("image_uploadtab",{processor:"boolean",default:!0}),cs("image_prepend_url",{processor:"string",default:""}),cs("image_class_list",{processor:"object[]"}),cs("image_description",{processor:"boolean",default:!0}),cs("image_title",{processor:"boolean",default:!1}),cs("image_caption",{processor:"boolean",default:!1}),cs("image_list",{processor:_s=>{const ar=_s===!1||Xn(_s)||Do(_s,Kn)||So(_s);return ar?{value:_s,valid:ar}:{valid:!1,message:"Must be false, a string, an array or a function."}},default:!1})},za=ga("image_dimensions"),Il=ga("image_advtab"),Zs=ga("image_uploadtab"),Sr=ga("image_prepend_url"),Us=ga("image_class_list"),fs=ga("image_description"),dr=ga("image_title"),Vr=ga("image_caption"),nr=ga("image_list"),Kr=ga("a11y_advanced_options"),ra=ga("automatic_uploads"),Ml=Uo=>el(Uo.options.get("images_upload_url")),xa=Uo=>Oo(Uo.options.get("images_upload_handler")),Nl=(Uo,cs)=>Math.max(parseInt(Uo,10),parseInt(cs,10)),Zc=Uo=>new Promise(cs=>{const _s=document.createElement("img"),ar=al=>{_s.onload=_s.onerror=null,_s.parentNode&&_s.parentNode.removeChild(_s),cs(al)};_s.onload=()=>{const al=Nl(_s.width,_s.clientWidth),ya=Nl(_s.height,_s.clientHeight),fu={width:al,height:ya};ar(Promise.resolve(fu))},_s.onerror=()=>{ar(Promise.reject(`Failed to get image dimensions for: ${Uo}`))};const ta=_s.style;ta.visibility="hidden",ta.position="fixed",ta.bottom=ta.left="0px",ta.width=ta.height="auto",document.body.appendChild(_s),_s.src=Uo}),cc=Uo=>(Uo&&(Uo=Uo.replace(/px$/,"")),Uo),gc=Uo=>(Uo.length>0&&/^[0-9]+$/.test(Uo)&&(Uo+="px"),Uo),nc=Uo=>{if(Uo.margin){const cs=String(Uo.margin).split(" ");switch(cs.length){case 1:Uo["margin-top"]=Uo["margin-top"]||cs[0],Uo["margin-right"]=Uo["margin-right"]||cs[0],Uo["margin-bottom"]=Uo["margin-bottom"]||cs[0],Uo["margin-left"]=Uo["margin-left"]||cs[0];break;case 2:Uo["margin-top"]=Uo["margin-top"]||cs[0],Uo["margin-right"]=Uo["margin-right"]||cs[1],Uo["margin-bottom"]=Uo["margin-bottom"]||cs[0],Uo["margin-left"]=Uo["margin-left"]||cs[1];break;case 3:Uo["margin-top"]=Uo["margin-top"]||cs[0],Uo["margin-right"]=Uo["margin-right"]||cs[1],Uo["margin-bottom"]=Uo["margin-bottom"]||cs[2],Uo["margin-left"]=Uo["margin-left"]||cs[1];break;case 4:Uo["margin-top"]=Uo["margin-top"]||cs[0],Uo["margin-right"]=Uo["margin-right"]||cs[1],Uo["margin-bottom"]=Uo["margin-bottom"]||cs[2],Uo["margin-left"]=Uo["margin-left"]||cs[3]}delete Uo.margin}return Uo},Ed=(Uo,cs)=>{const _s=nr(Uo);Xn(_s)?fetch(_s).then(ar=>{ar.ok&&ar.json().then(cs)}):So(_s)?_s(cs):cs(_s)},Zl=(Uo,cs,_s)=>{const ar=()=>{_s.onload=_s.onerror=null,Uo.selection&&(Uo.selection.select(_s),Uo.nodeChanged())};_s.onload=()=>{!cs.width&&!cs.height&&za(Uo)&&Uo.dom.setAttribs(_s,{width:String(_s.clientWidth),height:String(_s.clientHeight)}),ar()},_s.onerror=ar},Vl=Uo=>new Promise((cs,_s)=>{const ar=new FileReader;ar.onload=()=>{cs(ar.result)},ar.onerror=()=>{var ta;_s((ta=ar.error)===null||ta===void 0?void 0:ta.message)},ar.readAsDataURL(Uo)}),Fc=Uo=>Uo.nodeName==="IMG"&&(Uo.hasAttribute("data-mce-object")||Uo.hasAttribute("data-mce-placeholder")),qa=(Uo,cs)=>{const _s=Uo.options.get;return zo.isDomSafe(cs,"img",{allow_html_data_urls:_s("allow_html_data_urls"),allow_script_urls:_s("allow_script_urls"),allow_svg_data_urls:_s("allow_svg_data_urls")})},Ya=Qs.DOM,kc=Uo=>Uo.style.marginLeft&&Uo.style.marginRight&&Uo.style.marginLeft===Uo.style.marginRight?cc(Uo.style.marginLeft):"",Yl=Uo=>Uo.style.marginTop&&Uo.style.marginBottom&&Uo.style.marginTop===Uo.style.marginBottom?cc(Uo.style.marginTop):"",rd=Uo=>Uo.style.borderWidth?cc(Uo.style.borderWidth):"",Al=(Uo,cs)=>{var _s;return Uo.hasAttribute(cs)&&(_s=Uo.getAttribute(cs))!==null&&_s!==void 0?_s:""},gd=Uo=>Uo.parentNode!==null&&Uo.parentNode.nodeName==="FIGURE",Rr=(Uo,cs,_s)=>{_s===""||_s===null?Uo.removeAttribute(cs):Uo.setAttribute(cs,_s)},Pl=Uo=>{const cs=Ya.create("figure",{class:"image"});Ya.insertAfter(cs,Uo),cs.appendChild(Uo),cs.appendChild(Ya.create("figcaption",{contentEditable:"true"},"Caption")),cs.contentEditable="false"},Su=Uo=>{const cs=Uo.parentNode;Oo(cs)&&(Ya.insertAfter(Uo,cs),Ya.remove(cs))},vs=Uo=>{gd(Uo)?Su(Uo):Pl(Uo)},Es=(Uo,cs)=>{const _s=Uo.getAttribute("style"),ar=cs(_s!==null?_s:"");ar.length>0?(Uo.setAttribute("style",ar),Uo.setAttribute("data-mce-style",ar)):Uo.removeAttribute("style")},Ks=(Uo,cs)=>(_s,ar,ta)=>{const al=_s.style;al[ar]?(al[ar]=gc(ta),Es(_s,cs)):Rr(_s,ar,ta)},pr=(Uo,cs)=>Uo.style[cs]?cc(Uo.style[cs]):Al(Uo,cs),ia=(Uo,cs)=>{const _s=gc(cs);Uo.style.marginLeft=_s,Uo.style.marginRight=_s},ka=(Uo,cs)=>{const _s=gc(cs);Uo.style.marginTop=_s,Uo.style.marginBottom=_s},Ma=(Uo,cs)=>{const _s=gc(cs);Uo.style.borderWidth=_s},Mr=(Uo,cs)=>{Uo.style.borderStyle=cs},il=Uo=>{var cs;return(cs=Uo.style.borderStyle)!==null&&cs!==void 0?cs:""},Na=Uo=>Oo(Uo)&&Uo.nodeName==="FIGURE",vl=Uo=>Uo.nodeName==="IMG",Rc=Uo=>Ya.getAttrib(Uo,"alt").length===0&&Ya.getAttrib(Uo,"role")==="presentation",Vc=Uo=>Rc(Uo)?"":Al(Uo,"alt"),xc=()=>({src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),zc=(Uo,cs)=>{var _s;const ar=document.createElement("img");return Rr(ar,"style",cs.style),(kc(ar)||cs.hspace!=="")&&ia(ar,cs.hspace),(Yl(ar)||cs.vspace!=="")&&ka(ar,cs.vspace),(rd(ar)||cs.border!=="")&&Ma(ar,cs.border),(il(ar)||cs.borderStyle!=="")&&Mr(ar,cs.borderStyle),Uo((_s=ar.getAttribute("style"))!==null&&_s!==void 0?_s:"")},ad=(Uo,cs)=>{const _s=document.createElement("img");if(br(Uo,{...cs,caption:!1},_s),Ts(_s,cs.alt,cs.isDecorative),cs.caption){const ar=Ya.create("figure",{class:"image"});return ar.appendChild(_s),ar.appendChild(Ya.create("figcaption",{contentEditable:"true"},"Caption")),ar.contentEditable="false",ar}else return _s},Bh=(Uo,cs)=>({src:Al(cs,"src"),alt:Vc(cs),title:Al(cs,"title"),width:pr(cs,"width"),height:pr(cs,"height"),class:Al(cs,"class"),style:Uo(Al(cs,"style")),caption:gd(cs),hspace:kc(cs),vspace:Yl(cs),border:rd(cs),borderStyle:il(cs),isDecorative:Rc(cs)}),Vu=(Uo,cs,_s,ar,ta)=>{_s[ar]!==cs[ar]&&ta(Uo,ar,String(_s[ar]))},Ts=(Uo,cs,_s)=>{if(_s){Ya.setAttrib(Uo,"role","presentation");const ar=hs.fromDom(Uo);Qr(ar,"alt","")}else{if(uo(cs)){const ar=hs.fromDom(Uo);cr(ar,"alt")}else{const ar=hs.fromDom(Uo);Qr(ar,"alt",cs)}Ya.getAttrib(Uo,"role")==="presentation"&&Ya.setAttrib(Uo,"role","")}},ks=(Uo,cs,_s)=>{(_s.alt!==cs.alt||_s.isDecorative!==cs.isDecorative)&&Ts(Uo,_s.alt,_s.isDecorative)},ir=(Uo,cs)=>(_s,ar,ta)=>{Uo(_s,ta),Es(_s,cs)},br=(Uo,cs,_s)=>{const ar=Bh(Uo,_s);Vu(_s,ar,cs,"caption",(ta,al,ya)=>vs(ta)),Vu(_s,ar,cs,"src",Rr),Vu(_s,ar,cs,"title",Rr),Vu(_s,ar,cs,"width",Ks("width",Uo)),Vu(_s,ar,cs,"height",Ks("height",Uo)),Vu(_s,ar,cs,"class",Rr),Vu(_s,ar,cs,"style",ir((ta,al)=>Rr(ta,"style",al),Uo)),Vu(_s,ar,cs,"hspace",ir(ia,Uo)),Vu(_s,ar,cs,"vspace",ir(ka,Uo)),Vu(_s,ar,cs,"border",ir(Ma,Uo)),Vu(_s,ar,cs,"borderStyle",ir(Mr,Uo)),ks(_s,ar,cs)},Aa=(Uo,cs)=>{const _s=Uo.dom.styles.parse(cs),ar=nc(_s),ta=Uo.dom.styles.parse(Uo.dom.styles.serialize(ar));return Uo.dom.styles.serialize(ta)},Ba=Uo=>{const cs=Uo.selection.getNode(),_s=Uo.dom.getParent(cs,"figure.image");return _s?Uo.dom.select("img",_s)[0]:cs&&(cs.nodeName!=="IMG"||Fc(cs))?null:cs},_l=(Uo,cs)=>{var _s;const ar=Uo.dom,ta=ms(Uo.schema.getTextBlockElements(),(ya,fu)=>!Uo.schema.isValidChild(fu,"figure")),al=ar.getParent(cs.parentNode,ya=>Yo(ta,ya.nodeName),Uo.getBody());return al&&(_s=ar.split(al,cs))!==null&&_s!==void 0?_s:cs},Hc=Uo=>{const cs=Ba(Uo);return cs?Bh(_s=>Aa(Uo,_s),cs):xc()},Ds=(Uo,cs)=>{const _s=ad(ta=>Aa(Uo,ta),cs);Uo.dom.setAttrib(_s,"data-mce-id","__mcenew"),Uo.focus(),Uo.selection.setContent(_s.outerHTML);const ar=Uo.dom.select('*[data-mce-id="__mcenew"]')[0];if(Uo.dom.setAttrib(ar,"data-mce-id",null),Na(ar)){const ta=_l(Uo,ar);Uo.selection.select(ta)}else Uo.selection.select(ar)},tl=(Uo,cs)=>{Uo.dom.setAttrib(cs,"src",cs.getAttribute("src"))},wu=(Uo,cs)=>{if(cs){const _s=Uo.dom.is(cs.parentNode,"figure.image")?cs.parentNode:cs;Uo.dom.remove(_s),Uo.focus(),Uo.nodeChanged(),Uo.dom.isEmpty(Uo.getBody())&&(Uo.setContent(""),Uo.selection.setCursorLocation())}},qu=(Uo,cs)=>{const _s=Ba(Uo);if(_s)if(br(ar=>Aa(Uo,ar),cs,_s),tl(Uo,_s),Na(_s.parentNode)){const ar=_s.parentNode;_l(Uo,ar),Uo.selection.select(_s.parentNode)}else Uo.selection.select(_s),Zl(Uo,cs,_s)},Md=(Uo,cs)=>{const _s=cs.src;return{...cs,src:qa(Uo,_s)?_s:""}},bc=(Uo,cs)=>{const _s=Ba(Uo);if(_s){const ta={...Bh(ya=>Aa(Uo,ya),_s),...cs},al=Md(Uo,ta);ta.src?qu(Uo,al):wu(Uo,_s)}else cs.src&&Ds(Uo,{...xc(),...cs})},Ud=(Uo=>(...cs)=>{if(cs.length===0)throw new Error("Can't merge zero objects");const _s={};for(let ar=0;arto(Uo)&&to(cs)?Ud(Uo,cs):cs);var ld=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),oc=tinymce.util.Tools.resolve("tinymce.util.Tools");const Dc=Uo=>Xn(Uo.value)?Uo.value:"",bd=Uo=>Xn(Uo.text)?Uo.text:Xn(Uo.title)?Uo.title:"",Nd=(Uo,cs)=>{const _s=[];return oc.each(Uo,ar=>{const ta=bd(ar);if(ar.menu!==void 0){const al=Nd(ar.menu,cs);_s.push({text:ta,items:al})}else{const al=cs(ar);_s.push({text:ta,value:al})}}),_s},ih=(Uo=Dc)=>cs=>cs?Io.from(cs).map(_s=>Nd(_s,Uo)):Io.none(),om=Uo=>ih(Dc)(Uo),sm=Uo=>is(Uo,"items"),fc=(Uo,cs)=>gs(Uo,_s=>sm(_s)?fc(_s.items,cs):_s.value===cs?Io.some(_s):Io.none()),Jd={sanitizer:ih,sanitize:om,findEntry:(Uo,cs)=>Uo.bind(_s=>fc(_s,cs))},ef={makeTab:Uo=>({title:"Advanced",name:"advanced",items:[{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]})},Cu=Uo=>{const cs=Jd.sanitizer(hu=>Uo.convertURL(hu.value||hu.url||"","src")),_s=new Promise(hu=>{Ed(Uo,Qf=>{hu(cs(Qf).map(cu=>sr([[{text:"None",value:""}],cu])))})}),ar=Jd.sanitize(Us(Uo)),ta=Il(Uo),al=Zs(Uo),ya=Ml(Uo),fu=xa(Uo),Lr=Hc(Uo),qc=fs(Uo),Ef=dr(Uo),ku=za(Uo),jc=Vr(Uo),Tm=Kr(Uo),El=ra(Uo),Hf=Io.some(Sr(Uo)).filter(hu=>Xn(hu)&&hu.length>0);return _s.then(hu=>({image:Lr,imageList:hu,classList:ar,hasAdvTab:ta,hasUploadTab:al,hasUploadUrl:ya,hasUploadHandler:fu,hasDescription:qc,hasImageTitle:Ef,hasDimensions:ku,hasImageCaption:jc,prependURL:Hf,hasAccessibilityOptions:Tm,automaticUploads:El}))},Qc=Uo=>{const cs={name:"src",type:"urlinput",filetype:"image",label:"Source",picker_text:"Browse files"},_s=Uo.imageList.map(Ef=>({name:"images",type:"listbox",label:"Image list",items:Ef})),ar={name:"alt",type:"input",label:"Alternative description",enabled:!(Uo.hasAccessibilityOptions&&Uo.image.isDecorative)},ta={name:"title",type:"input",label:"Image title"},al={name:"dimensions",type:"sizeinput"},ya={type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]},fu=Uo.classList.map(Ef=>({name:"classes",type:"listbox",label:"Class",items:Ef})),Lr={type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]},qc=Ef=>Ef?{type:"grid",columns:2}:{type:"panel"};return sr([[cs],_s.toArray(),Uo.hasAccessibilityOptions&&Uo.hasDescription?[ya]:[],Uo.hasDescription?[ar]:[],Uo.hasImageTitle?[ta]:[],Uo.hasDimensions?[al]:[],[{...qc(Uo.classList.isSome()&&Uo.hasImageCaption),items:sr([fu.toArray(),Uo.hasImageCaption?[Lr]:[]])}]])},qm={makeTab:Uo=>({title:"General",name:"general",items:Qc(Uo)}),makeItems:Qc},cd={makeTab:Uo=>({title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]})},vd=Uo=>({prevImage:Jd.findEntry(Uo.imageList,Uo.image.src),prevAlt:Uo.image.alt,open:!0}),ju=Uo=>({src:{value:Uo.src,meta:{}},images:Uo.src,alt:Uo.alt,title:Uo.title,dimensions:{width:Uo.width,height:Uo.height},classes:Uo.class,caption:Uo.caption,style:Uo.style,vspace:Uo.vspace,border:Uo.border,hspace:Uo.hspace,borderstyle:Uo.borderStyle,fileinput:[],isDecorative:Uo.isDecorative}),Xf=(Uo,cs)=>({src:Uo.src.value,alt:(Uo.alt===null||Uo.alt.length===0)&&cs?null:Uo.alt,title:Uo.title,width:Uo.dimensions.width,height:Uo.dimensions.height,class:Uo.classes,style:Uo.style,caption:Uo.caption,hspace:Uo.hspace,vspace:Uo.vspace,border:Uo.border,borderStyle:Uo.borderstyle,isDecorative:Uo.isDecorative}),Sh=(Uo,cs)=>/^(?:[a-zA-Z]+:)?\/\//.test(cs)?Io.none():Uo.prependURL.bind(_s=>cs.substring(0,_s.length)!==_s?Io.some(_s+cs):Io.none()),Zd=(Uo,cs)=>{const _s=cs.getData();Sh(Uo,_s.src.value).each(ar=>{cs.setData({src:{value:ar,meta:_s.src.meta}})})},ah=(Uo,cs,_s)=>{Uo.hasDescription&&Xn(_s.alt)&&(cs.alt=_s.alt),Uo.hasAccessibilityOptions&&(cs.isDecorative=_s.isDecorative||cs.isDecorative||!1),Uo.hasImageTitle&&Xn(_s.title)&&(cs.title=_s.title),Uo.hasDimensions&&(Xn(_s.width)&&(cs.dimensions.width=_s.width),Xn(_s.height)&&(cs.dimensions.height=_s.height)),Xn(_s.class)&&Jd.findEntry(Uo.classList,_s.class).each(ar=>{cs.classes=ar.value}),Uo.hasImageCaption&&ho(_s.caption)&&(cs.caption=_s.caption),Uo.hasAdvTab&&(Xn(_s.style)&&(cs.style=_s.style),Xn(_s.vspace)&&(cs.vspace=_s.vspace),Xn(_s.border)&&(cs.border=_s.border),Xn(_s.hspace)&&(cs.hspace=_s.hspace),Xn(_s.borderstyle)&&(cs.borderstyle=_s.borderstyle))},lh=(Uo,cs)=>{const _s=cs.getData(),ar=_s.src.meta;if(ar!==void 0){const ta=Ud({},_s);ah(Uo,ta,ar),cs.setData(ta)}},Bp=(Uo,cs,_s,ar)=>{const ta=ar.getData(),al=ta.src.value,ya=ta.src.meta||{};!ya.width&&!ya.height&&cs.hasDimensions&&(el(al)?Uo.imageSize(al).then(fu=>{_s.open&&ar.setData({dimensions:fu})}).catch(fu=>console.error(fu)):ar.setData({dimensions:{width:"",height:""}}))},ch=(Uo,cs,_s)=>{const ar=_s.getData(),ta=Jd.findEntry(Uo.imageList,ar.src.value);cs.prevImage=ta,_s.setData({images:ta.map(al=>al.value).getOr("")})},bp=(Uo,cs,_s,ar)=>{Zd(cs,ar),lh(cs,ar),Bp(Uo,cs,_s,ar),ch(cs,_s,ar)},kf=(Uo,cs,_s,ar)=>{const ta=ar.getData(),al=Jd.findEntry(cs.imageList,ta.images);al.each(ya=>{ta.alt===""||_s.prevImage.map(Lr=>Lr.text===ta.alt).getOr(!1)?ya.value===""?ar.setData({src:ya,alt:_s.prevAlt}):ar.setData({src:ya,alt:ya.text}):ar.setData({src:ya})}),_s.prevImage=al,bp(Uo,cs,_s,ar)},Fh=(Uo,cs,_s,ar)=>{const ta=ar.getData();ar.block("Uploading image"),ko(ta.fileinput).fold(()=>{ar.unblock()},al=>{const ya=URL.createObjectURL(al),fu=()=>{ar.unblock(),URL.revokeObjectURL(ya)},Lr=qc=>{ar.setData({src:{value:qc,meta:{}}}),ar.showTab("general"),bp(Uo,cs,_s,ar)};Vl(al).then(qc=>{const Ef=Uo.createBlobCache(al,ya,qc);cs.automaticUploads?Uo.uploadImage(Ef).then(ku=>{Lr(ku.url),fu()}).catch(ku=>{fu(),Uo.alertErr(ku)}):(Uo.addToBlobCache(Ef),Lr(Ef.blobUri()),ar.unblock())})})},jm=(Uo,cs,_s)=>(ar,ta)=>{ta.name==="src"?bp(Uo,cs,_s,ar):ta.name==="images"?kf(Uo,cs,_s,ar):ta.name==="alt"?_s.prevAlt=ar.getData().alt:ta.name==="fileinput"?Fh(Uo,cs,_s,ar):ta.name==="isDecorative"&&ar.setEnabled("alt",!ar.getData().isDecorative)},Fp=Uo=>()=>{Uo.open=!1},Eg=Uo=>Uo.hasAdvTab||Uo.hasUploadUrl||Uo.hasUploadHandler?{type:"tabpanel",tabs:sr([[qm.makeTab(Uo)],Uo.hasAdvTab?[ef.makeTab(Uo)]:[],Uo.hasUploadTab&&(Uo.hasUploadUrl||Uo.hasUploadHandler)?[cd.makeTab(Uo)]:[]])}:{type:"panel",items:qm.makeItems(Uo)},rs=(Uo,cs,_s)=>ar=>{const ta=Ud(ju(cs.image),ar.getData()),al={...ta,style:zc(_s.normalizeCss,Xf(ta,!1))};Uo.execCommand("mceUpdateImage",!1,Xf(al,cs.hasAccessibilityOptions)),Uo.editorUpload.uploadImagesAuto(),ar.close()},As=Uo=>cs=>qa(Uo,cs)?Zc(Uo.documentBaseURI.toAbsolute(cs)).then(_s=>({width:String(_s.width),height:String(_s.height)})):Promise.resolve({width:"",height:""}),Ws=Uo=>(cs,_s,ar)=>{var ta;return Uo.editorUpload.blobCache.create({blob:cs,blobUri:_s,name:(ta=cs.name)===null||ta===void 0?void 0:ta.replace(/\.[^\.]+$/,""),filename:cs.name,base64:ar.split(",")[1]})},rr=Uo=>cs=>{Uo.editorUpload.blobCache.add(cs)},Fr=Uo=>cs=>{Uo.windowManager.alert(cs)},Wa=Uo=>cs=>Aa(Uo,cs),Nc=Uo=>cs=>Uo.dom.parseStyle(cs),xl=Uo=>(cs,_s)=>Uo.dom.serializeStyle(cs,_s),ul=Uo=>cs=>ld(Uo).upload([cs],!1).then(_s=>{var ar;return _s.length===0?Promise.reject("Failed to upload image"):_s[0].status===!1?Promise.reject((ar=_s[0].error)===null||ar===void 0?void 0:ar.message):_s[0]}),lu=Uo=>{const cs={imageSize:As(Uo),addToBlobCache:rr(Uo),createBlobCache:Ws(Uo),alertErr:Fr(Uo),normalizeCss:Wa(Uo),parseStyle:Nc(Uo),serializeStyle:xl(Uo),uploadImage:ul(Uo)};return{open:()=>{Cu(Uo).then(ar=>{const ta=vd(ar);return{title:"Insert/Edit Image",size:"normal",body:Eg(ar),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:ju(ar.image),onSubmit:rs(Uo,ar,cs),onChange:jm(cs,ar,ta),onClose:Fp(ta)}}).then(Uo.windowManager.open)}}},Gl=Uo=>{Uo.addCommand("mceImage",lu(Uo).open),Uo.addCommand("mceUpdateImage",(cs,_s)=>{Uo.undoManager.transact(()=>bc(Uo,_s))})},Ru=Uo=>{const cs=Uo.attr("class");return Oo(cs)&&/\bimage\b/.test(cs)},xf=Uo=>cs=>{let _s=cs.length;const ar=ta=>{ta.attr("contenteditable",Uo?"true":null)};for(;_s--;){const ta=cs[_s];Ru(ta)&&(ta.attr("contenteditable",Uo?"false":null),oc.each(ta.getAll("figcaption"),ar))}},Hp=Uo=>{Uo.on("PreInit",()=>{Uo.parser.addNodeFilter("figure",xf(!0)),Uo.serializer.addNodeFilter("figure",xf(!1))})},aa=Uo=>cs=>{const _s=()=>{cs.setEnabled(Uo.selection.isEditable())};return Uo.on("NodeChange",_s),_s(),()=>{Uo.off("NodeChange",_s)}},Qp=Uo=>{Uo.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:lu(Uo).open,onSetup:cs=>{cs.setActive(Oo(Ba(Uo)));const _s=Uo.selection.selectorChangedWithUnbind("img:not([data-mce-object]):not([data-mce-placeholder]),figure.image",cs.setActive).unbind,ar=aa(Uo)(cs);return()=>{_s(),ar()}}}),Uo.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:lu(Uo).open,onSetup:aa(Uo)}),Uo.ui.registry.addContextMenu("image",{update:cs=>Uo.selection.isEditable()&&(Na(cs)||vl(cs)&&!Fc(cs))?["image"]:[]})};var Bu=()=>{_n.add("image",Uo=>{Ca(Uo),Hp(Uo),Qp(Uo),Gl(Uo)})};Bu()})();(function(){var _n=tinymce.util.Tools.resolve("tinymce.PluginManager");const Ce=(_o,Po,Xo)=>{var as;return Xo(_o,Po.prototype)?!0:((as=_o.constructor)===null||as===void 0?void 0:as.name)===Po.name},ke=_o=>{const Po=typeof _o;return _o===null?"null":Po==="object"&&Array.isArray(_o)?"array":Po==="object"&&Ce(_o,String,(Xo,as)=>as.isPrototypeOf(Xo))?"string":Po},$n=_o=>Po=>ke(Po)===_o,Hn=_o=>Po=>typeof Po===_o,zn=_o=>Po=>_o===Po,Un=$n("string"),qn=$n("array"),Xn=Hn("boolean"),Kn=zn(void 0),to=_o=>_o==null,io=_o=>!to(_o),uo=Hn("function"),ho=Hn("number"),bo=()=>{},Oo=(_o,Po)=>Xo=>_o(Po(Xo)),So=_o=>()=>_o,$o=_o=>_o,Do=(_o,Po)=>_o===Po;function xo(_o,...Po){return(...Xo)=>{const as=Po.concat(Xo);return _o.apply(null,as)}}const Io=_o=>{_o()},Vo=So(!1),Jo=So(!0);class Mo{constructor(Po,Xo){this.tag=Po,this.value=Xo}static some(Po){return new Mo(!0,Po)}static none(){return Mo.singletonNone}fold(Po,Xo){return this.tag?Xo(this.value):Po()}isSome(){return this.tag}isNone(){return!this.tag}map(Po){return this.tag?Mo.some(Po(this.value)):Mo.none()}bind(Po){return this.tag?Po(this.value):Mo.none()}exists(Po){return this.tag&&Po(this.value)}forall(Po){return!this.tag||Po(this.value)}filter(Po){return!this.tag||Po(this.value)?this:Mo.none()}getOr(Po){return this.tag?this.value:Po}or(Po){return this.tag?this:Po}getOrThunk(Po){return this.tag?this.value:Po()}orThunk(Po){return this.tag?this:Po()}getOrDie(Po){if(this.tag)return this.value;throw new Error(Po??"Called getOrDie on None")}static from(Po){return io(Po)?Mo.some(Po):Mo.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Po){this.tag&&Po(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Mo.singletonNone=new Mo(!1);const Go=Object.keys,os=Object.hasOwnProperty,ms=(_o,Po)=>{const Xo=Go(_o);for(let as=0,Ms=Xo.length;as(Po,Xo)=>{_o[Xo]=Po},Yo=(_o,Po,Xo,as)=>{ms(_o,(Ms,vr)=>{(Po(Ms,vr)?Xo:as)(Ms,vr)})},Ys=(_o,Po)=>{const Xo={};return Yo(_o,Po,is(Xo),bo),Xo},sr=(_o,Po)=>{const Xo=[];return ms(_o,(as,Ms)=>{Xo.push(Po(as,Ms))}),Xo},Js=_o=>sr(_o,$o),ko=_o=>Go(_o).length,gs=(_o,Po)=>xs(_o,Po)?Mo.from(_o[Po]):Mo.none(),xs=(_o,Po)=>os.call(_o,Po),Qr=(_o,Po)=>xs(_o,Po)&&_o[Po]!==void 0&&_o[Po]!==null,cr=_o=>{for(const Po in _o)if(os.call(_o,Po))return!1;return!0},ws=Array.prototype.indexOf,Fs=Array.prototype.push,Br=(_o,Po)=>ws.call(_o,Po),_r=(_o,Po)=>Br(_o,Po)>-1,ha=(_o,Po)=>{for(let Xo=0,as=_o.length;Xo{const Xo=[];for(let as=0;as<_o;as++)Xo.push(Po(as));return Xo},Qs=(_o,Po)=>{const Xo=_o.length,as=new Array(Xo);for(let Ms=0;Ms{for(let Xo=0,as=_o.length;Xo{for(let Xo=_o.length-1;Xo>=0;Xo--){const as=_o[Xo];Po(as,Xo)}},ga=(_o,Po)=>{const Xo=[],as=[];for(let Ms=0,vr=_o.length;Ms{const Xo=[];for(let as=0,Ms=_o.length;as(el(_o,(as,Ms)=>{Xo=Po(Xo,as,Ms)}),Xo),Il=(_o,Po,Xo)=>(zo(_o,(as,Ms)=>{Xo=Po(Xo,as,Ms)}),Xo),Zs=(_o,Po,Xo)=>{for(let as=0,Ms=_o.length;asZs(_o,Po,Vo),Us=_o=>{const Po=[];for(let Xo=0,as=_o.length;XoUs(Qs(_o,Po)),dr=(_o,Po)=>{for(let Xo=0,as=_o.length;Xo{const Xo={};for(let as=0,Ms=_o.length;asPo>=0&&Po<_o.length?Mo.some(_o[Po]):Mo.none(),Kr=_o=>nr(_o,0),ra=_o=>nr(_o,_o.length-1),Ml=(_o,Po)=>{for(let Xo=0;Xo<_o.length;Xo++){const as=Po(_o[Xo],Xo);if(as.isSome())return as}return Mo.none()},xa=8,Nl=9,Zc=11,cc=1,gc=3,nc=(_o,Po)=>{const as=(Po||document).createElement("div");if(as.innerHTML=_o,!as.hasChildNodes()||as.childNodes.length>1){const Ms="HTML does not have a single root node";throw console.error(Ms,_o),new Error(Ms)}return Vl(as.childNodes[0])},Ed=(_o,Po)=>{const as=(Po||document).createElement(_o);return Vl(as)},Zl=(_o,Po)=>{const as=(Po||document).createTextNode(_o);return Vl(as)},Vl=_o=>{if(_o==null)throw new Error("Node cannot be null or undefined");return{dom:_o}},qa={fromHtml:nc,fromTag:Ed,fromText:Zl,fromDom:Vl,fromPoint:(_o,Po,Xo)=>Mo.from(_o.dom.elementFromPoint(Po,Xo)).map(Vl)},Ya=(_o,Po)=>{const Xo=_o.dom;if(Xo.nodeType!==cc)return!1;{const as=Xo;if(as.matches!==void 0)return as.matches(Po);if(as.msMatchesSelector!==void 0)return as.msMatchesSelector(Po);if(as.webkitMatchesSelector!==void 0)return as.webkitMatchesSelector(Po);if(as.mozMatchesSelector!==void 0)return as.mozMatchesSelector(Po);throw new Error("Browser lacks native selectors")}},kc=_o=>_o.nodeType!==cc&&_o.nodeType!==Nl&&_o.nodeType!==Zc||_o.childElementCount===0,Yl=(_o,Po)=>{const Xo=Po===void 0?document:Po.dom;return kc(Xo)?[]:Qs(Xo.querySelectorAll(_o),qa.fromDom)},rd=(_o,Po)=>{const Xo=Po===void 0?document:Po.dom;return kc(Xo)?Mo.none():Mo.from(Xo.querySelector(_o)).map(qa.fromDom)},Al=(_o,Po)=>_o.dom===Po.dom,gd=Ya;typeof window<"u"||Function("return this;")();const Rr=_o=>_o.dom.nodeName.toLowerCase(),Pl=_o=>_o.dom.nodeType,Su=_o=>Po=>Pl(Po)===_o,vs=_o=>Pl(_o)===xa||Rr(_o)==="#comment",Es=Su(cc),Ks=Su(gc),pr=Su(Nl),ia=Su(Zc),ka=_o=>Po=>Es(Po)&&Rr(Po)===_o,Ma=_o=>qa.fromDom(_o.dom.ownerDocument),Mr=_o=>pr(_o)?_o:Ma(_o),il=_o=>Mo.from(_o.dom.parentNode).map(qa.fromDom),Na=(_o,Po)=>{const Xo=uo(Po)?Po:Vo;let as=_o.dom;const Ms=[];for(;as.parentNode!==null&&as.parentNode!==void 0;){const vr=as.parentNode,zr=qa.fromDom(vr);if(Ms.push(zr),Xo(zr)===!0)break;as=vr}return Ms},vl=_o=>Mo.from(_o.dom.previousSibling).map(qa.fromDom),Rc=_o=>Mo.from(_o.dom.nextSibling).map(qa.fromDom),Vc=_o=>Qs(_o.dom.childNodes,qa.fromDom),xc=(_o,Po)=>{const Xo=_o.dom.childNodes;return Mo.from(Xo[Po]).map(qa.fromDom)},zc=_o=>xc(_o,0),ad=_o=>ia(_o)&&io(_o.dom.host),Vu=uo(Element.prototype.attachShadow)&&uo(Node.prototype.getRootNode)?_o=>qa.fromDom(_o.dom.getRootNode()):Mr,Ts=_o=>{const Po=Vu(_o);return ad(Po)?Mo.some(Po):Mo.none()},ks=_o=>qa.fromDom(_o.dom.host),ir=_o=>{const Po=Ks(_o)?_o.dom.parentNode:_o.dom;if(Po==null||Po.ownerDocument===null)return!1;const Xo=Po.ownerDocument;return Ts(qa.fromDom(Po)).fold(()=>Xo.body.contains(Po),Oo(ir,ks))};var br=(_o,Po,Xo,as,Ms)=>_o(Xo,as)?Mo.some(Xo):uo(Ms)&&Ms(Xo)?Mo.none():Po(Xo,as,Ms);const Aa=(_o,Po,Xo)=>{let as=_o.dom;const Ms=uo(Xo)?Xo:Vo;for(;as.parentNode;){as=as.parentNode;const vr=qa.fromDom(as);if(Po(vr))return Mo.some(vr);if(Ms(vr))break}return Mo.none()},Ba=(_o,Po,Xo)=>br((Ms,vr)=>vr(Ms),Aa,_o,Po,Xo),_l=(_o,Po)=>{const Xo=Ms=>Po(qa.fromDom(Ms));return Sr(_o.dom.childNodes,Xo).map(qa.fromDom)},Hc=(_o,Po,Xo)=>Aa(_o,as=>Ya(as,Po),Xo),Ds=(_o,Po)=>_l(_o,Xo=>Ya(Xo,Po)),tl=(_o,Po)=>rd(Po,_o),wu=(_o,Po,Xo)=>br((Ms,vr)=>Ya(Ms,vr),Hc,_o,Po,Xo),qu=_o=>wu(_o,"[contenteditable]"),Md=(_o,Po=!1)=>ir(_o)?_o.dom.isContentEditable:qu(_o).fold(So(Po),Xo=>bc(Xo)==="true"),bc=_o=>_o.dom.contentEditable,nm=_o=>_o.nodeName.toLowerCase(),Ff=_o=>qa.fromDom(_o.getBody()),Ud=_o=>Po=>Al(Po,Ff(_o)),ld=_o=>_o?_o.replace(/px$/,""):"",oc=_o=>/^\d+(\.\d+)?$/.test(_o)?_o+"px":_o,Dc=_o=>qa.fromDom(_o.selection.getStart()),bd=_o=>qa.fromDom(_o.selection.getEnd()),Nd=_o=>Ba(_o,ka("table")).forall(Md),ih=(_o,Po)=>Ca(Vc(_o),Po),om=(_o,Po)=>{let Xo=[];return zo(Vc(_o),as=>{Po(as)&&(Xo=Xo.concat([as])),Xo=Xo.concat(om(as,Po))}),Xo},sm=(_o,Po)=>ih(_o,Xo=>Ya(Xo,Po)),fc=(_o,Po)=>Yl(Po,_o),Td=(_o,Po,Xo)=>{if(Un(Xo)||Xn(Xo)||ho(Xo))_o.setAttribute(Po,Xo+"");else throw console.error("Invalid call to Attribute.set. Key ",Po,":: Value ",Xo,":: Element ",_o),new Error("Attribute value was not simple")},Jd=(_o,Po,Xo)=>{Td(_o.dom,Po,Xo)},Em=(_o,Po)=>{const Xo=_o.dom;ms(Po,(as,Ms)=>{Td(Xo,Ms,as)})},ef=(_o,Po)=>{const Xo=_o.dom.getAttribute(Po);return Xo===null?void 0:Xo},Cu=(_o,Po)=>Mo.from(ef(_o,Po)),Qc=(_o,Po)=>{_o.dom.removeAttribute(Po)},Cf=_o=>Il(_o.dom.attributes,(Po,Xo)=>(Po[Xo.name]=Xo.value,Po),{}),qm=(_o,Po,Xo=Do)=>_o.exists(as=>Xo(as,Po)),Oc=_o=>{const Po=[],Xo=as=>{Po.push(as)};for(let as=0;as<_o.length;as++)_o[as].each(Xo);return Po},cd=(_o,Po,Xo)=>_o.isSome()&&Po.isSome()?Mo.some(Xo(_o.getOrDie(),Po.getOrDie())):Mo.none(),vd=_o=>_o.bind($o),ju=(_o,Po)=>_o?Mo.some(Po):Mo.none(),Xf=(_o,Po)=>_o.substring(Po),Sh=(_o,Po,Xo)=>Po===""||_o.length>=Po.length&&_o.substr(Xo,Xo+Po.length)===Po,Zd=(_o,Po)=>ah(_o,Po)?Xf(_o,Po.length):_o,ah=(_o,Po)=>Sh(_o,Po,0),Bp=(_o=>Po=>Po.replace(_o,""))(/^\s+|\s+$/g),ch=_o=>_o.length>0,bp=_o=>!ch(_o),kf=(_o,Po=10)=>{const Xo=parseInt(_o,Po);return isNaN(Xo)?Mo.none():Mo.some(Xo)},Fh=_o=>{const Po=parseFloat(_o);return isNaN(Po)?Mo.none():Mo.some(Po)},jm=_o=>_o.style!==void 0&&uo(_o.style.getPropertyValue),Fp=(_o,Po,Xo)=>{if(!Un(Xo))throw console.error("Invalid call to CSS.set. Property ",Po,":: Value ",Xo,":: Element ",_o),new Error("CSS value must be a string: "+Xo);jm(_o)&&_o.style.setProperty(Po,Xo)},Eg=(_o,Po)=>{jm(_o)&&_o.style.removeProperty(Po)},rs=(_o,Po,Xo)=>{const as=_o.dom;Fp(as,Po,Xo)},As=(_o,Po)=>{const Xo=_o.dom,Ms=window.getComputedStyle(Xo).getPropertyValue(Po);return Ms===""&&!ir(_o)?Ws(Xo,Po):Ms},Ws=(_o,Po)=>jm(_o)?_o.style.getPropertyValue(Po):"",rr=(_o,Po)=>{const Xo=_o.dom,as=Ws(Xo,Po);return Mo.from(as).filter(Ms=>Ms.length>0)},Fr=(_o,Po)=>{const Xo=_o.dom;Eg(Xo,Po),qm(Cu(_o,"style").map(Bp),"")&&Qc(_o,"style")},Wa=(_o,Po,Xo=0)=>Cu(_o,Po).map(as=>parseInt(as,10)).getOr(Xo),Nc=(_o,Po)=>xl(_o,Po,Jo),xl=(_o,Po,Xo)=>fs(Vc(_o),as=>Ya(as,Po)?Xo(as)?[as]:[]:xl(as,Po,Xo)),ul=["tfoot","thead","tbody","colgroup"],lu=_o=>_r(ul,_o),Gl=(_o,Po)=>({rows:_o,columns:Po}),Ru=(_o,Po,Xo)=>({element:_o,rowspan:Po,colspan:Xo}),xf=(_o,Po,Xo,as,Ms,vr)=>({element:_o,rowspan:Po,colspan:Xo,row:as,column:Ms,isLocked:vr}),Hp=(_o,Po,Xo)=>({element:_o,cells:Po,section:Xo}),aa=(_o,Po,Xo,as)=>({startRow:_o,startCol:Po,finishRow:Xo,finishCol:as}),Qp=(_o,Po,Xo)=>({element:_o,colspan:Po,column:Xo}),Bu=(_o,Po)=>({element:_o,columns:Po}),Uo=(_o,Po,Xo=Vo)=>{if(Xo(Po))return Mo.none();if(_r(_o,Rr(Po)))return Mo.some(Po);const as=Ms=>Ya(Ms,"table")||Xo(Ms);return Hc(Po,_o.join(","),as)},cs=(_o,Po)=>Uo(["td","th"],_o,Po),_s=_o=>Nc(_o,"th,td"),ar=_o=>Ya(_o,"colgroup")?sm(_o,"col"):fs(ya(_o),Po=>sm(Po,"col")),ta=(_o,Po)=>wu(_o,"table",Po),al=_o=>Nc(_o,"tr"),ya=_o=>ta(_o).fold(So([]),Po=>sm(Po,"colgroup")),fu=(_o,Po)=>Qs(_o,Xo=>{if(Rr(Xo)==="colgroup"){const as=Qs(ar(Xo),Ms=>{const vr=Wa(Ms,"span",1);return Ru(Ms,1,vr)});return Hp(Xo,as,"colgroup")}else{const as=Qs(_s(Xo),Ms=>{const vr=Wa(Ms,"rowspan",1),zr=Wa(Ms,"colspan",1);return Ru(Ms,vr,zr)});return Hp(Xo,as,Po(Xo))}}),Lr=_o=>il(_o).map(Po=>{const Xo=Rr(Po);return lu(Xo)?Xo:"tbody"}).getOr("tbody"),qc=_o=>{const Po=al(_o),as=[...ya(_o),...Po];return fu(as,Lr)},Ef="data-snooker-locked-cols",ku=_o=>Cu(_o,Ef).bind(Po=>Mo.from(Po.match(/\d+/g))).map(Po=>Vr(Po,Jo)),jc=(_o,Po)=>_o+","+Po,Tm=(_o,Po,Xo)=>Mo.from(_o.access[jc(Po,Xo)]),El=(_o,Po,Xo)=>{const as=Hf(_o,Ms=>Xo(Po,Ms.element));return as.length>0?Mo.some(as[0]):Mo.none()},Hf=(_o,Po)=>{const Xo=fs(_o.all,as=>as.cells);return Ca(Xo,Po)},hu=_o=>{const Po={};let Xo=0;return zo(_o.cells,as=>{const Ms=as.colspan;hs(Ms,vr=>{const zr=Xo+vr;Po[zr]=Qp(as.element,Ms,zr)}),Xo+=Ms}),Po},Qf=_o=>{const Po={},Xo=[],Ms=Kr(_o).map(Uh=>Uh.element).bind(ta).bind(ku).getOr({});let vr=0,zr=0,Jr=0;const{pass:La,fail:Ol}=ga(_o,Uh=>Uh.section==="colgroup");zo(Ol,Uh=>{const Jf=[];zo(Uh.cells,hm=>{let Jp=0;for(;Po[jc(Jr,Jp)]!==void 0;)Jp++;const wp=Qr(Ms,Jp.toString()),B1=xf(hm.element,hm.rowspan,hm.colspan,Jr,Jp,wp);for(let Sc=0;Sc{const Jf=hu(Uh);return{colgroups:[Bu(Uh.element,Js(Jf))],columns:Jf}}).getOrThunk(()=>({colgroups:[],columns:{}}));return{grid:Gl(vr,zr),access:Po,all:Xo,columns:Xu,colgroups:Ac}},Am={fromTable:_o=>{const Po=qc(_o);return Qf(Po)},generate:Qf,getAt:Tm,findItem:El,filterItems:Hf,justCells:_o=>fs(_o.all,Po=>Po.cells),justColumns:_o=>Js(_o.columns),hasColumns:_o=>Go(_o.columns).length>0,getColumnAt:(_o,Po)=>Mo.from(_o.columns[Po])};var Pm=tinymce.util.Tools.resolve("tinymce.util.Tools");const uh=(_o,Po,Xo)=>{const as=_o.select("td,th",Po);let Ms;for(let vr=0;vr{Pm.each("left center right".split(" "),as=>{as!==Xo&&_o.formatter.remove("align"+as,{},Po)}),Xo&&_o.formatter.apply("align"+Xo,{},Po)},A1=(_o,Po,Xo)=>{Pm.each("top middle bottom".split(" "),as=>{as!==Xo&&_o.formatter.remove("valign"+as,{},Po)}),Xo&&_o.formatter.apply("valign"+Xo,{},Po)},ql=(_o,Po,Xo)=>{_o.dispatch("TableModified",{...Xo,table:Po})},dd=(_o,Po)=>Fh(_o).getOr(Po),yd=(_o,Po,Xo)=>dd(As(_o,Po),Xo),mv=(_o,Po,Xo,as)=>{const Ms=yd(_o,`padding-${Xo}`,0),vr=yd(_o,`padding-${as}`,0),zr=yd(_o,`border-${Xo}-width`,0),Jr=yd(_o,`border-${as}-width`,0);return Po-Ms-vr-zr-Jr},Du=(_o,Po)=>{const Xo=_o.dom,as=Xo.getBoundingClientRect().width||Xo.offsetWidth;return Po==="border-box"?as:mv(_o,as,"left","right")},qd=_o=>Du(_o,"content-box");var Eb=tinymce.util.Tools.resolve("tinymce.Env");const Tb="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol",Qh=hs(5,_o=>{const Po=`${_o+1}px`;return{title:Po,value:Po}}),Xg=Qs(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],_o=>({title:_o,value:_o.toLowerCase()})),Gc="100%",im=_o=>{var Po;const Xo=_o.dom,as=(Po=Xo.getParent(_o.selection.getStart(),Xo.isBlock))!==null&&Po!==void 0?Po:_o.getBody();return qd(qa.fromDom(as))+"px"},Tf=(_o,Po)=>g0(_o)||!$m(_o)?Po:p0(_o)?{...Po,width:im(_o)}:{...Po,width:Gc},Ld=(_o,Po)=>g0(_o)||$m(_o)?Po:p0(_o)?{...Po,width:im(_o)}:{...Po,width:Gc},Od=_o=>Po=>Po.options.get(_o),Mu=_o=>{const Po=_o.options.register;Po("table_border_widths",{processor:"object[]",default:Qh}),Po("table_border_styles",{processor:"object[]",default:Xg}),Po("table_cell_advtab",{processor:"boolean",default:!0}),Po("table_row_advtab",{processor:"boolean",default:!0}),Po("table_advtab",{processor:"boolean",default:!0}),Po("table_appearance_options",{processor:"boolean",default:!0}),Po("table_grid",{processor:"boolean",default:!Eb.deviceType.isTouch()}),Po("table_cell_class_list",{processor:"object[]",default:[]}),Po("table_row_class_list",{processor:"object[]",default:[]}),Po("table_class_list",{processor:"object[]",default:[]}),Po("table_toolbar",{processor:"string",default:Tb}),Po("table_background_color_map",{processor:"object[]",default:[]}),Po("table_border_color_map",{processor:"object[]",default:[]})},Vh=Od("table_sizing_mode"),zp=Od("table_border_widths"),Tg=Od("table_border_styles"),Ab=Od("table_cell_advtab"),P1=Od("table_row_advtab"),Yf=Od("table_advtab"),$1=Od("table_appearance_options"),jd=Od("table_grid"),$m=Od("table_style_by_css"),R1=Od("table_cell_class_list"),Xm=Od("table_row_class_list"),Yg=Od("table_class_list"),Vf=Od("table_toolbar"),Gg=Od("table_background_color_map"),yp=Od("table_border_color_map"),p0=_o=>Vh(_o)==="fixed",g0=_o=>Vh(_o)==="responsive",Wp=_o=>{const Po=_o.options,Xo=Po.get("table_default_styles");return Po.isSet("table_default_styles")?Xo:Tf(_o,Xo)},zf=_o=>{const Po=_o.options,Xo=Po.get("table_default_attributes");return Po.isSet("table_default_attributes")?Xo:Ld(_o,Xo)},b0=(_o,Po)=>Po.column>=_o.startCol&&Po.column+Po.colspan-1<=_o.finishCol&&Po.row>=_o.startRow&&Po.row+Po.rowspan-1<=_o.finishRow,Cs=(_o,Po)=>{let Xo=!0;const as=xo(b0,Po);for(let Ms=Po.startRow;Ms<=Po.finishRow;Ms++)for(let vr=Po.startCol;vr<=Po.finishCol;vr++)Xo=Xo&&Am.getAt(_o,Ms,vr).exists(as);return Xo?Mo.some(Po):Mo.none()},Up=(_o,Po)=>aa(Math.min(_o.row,Po.row),Math.min(_o.column,Po.column),Math.max(_o.row+_o.rowspan-1,Po.row+Po.rowspan-1),Math.max(_o.column+_o.colspan-1,Po.column+Po.colspan-1)),zh=(_o,Po,Xo)=>{const as=Am.findItem(_o,Po,Al),Ms=Am.findItem(_o,Xo,Al);return as.bind(vr=>Ms.map(zr=>Up(vr,zr)))},Kg=(_o,Po,Xo)=>zh(_o,Po,Xo).bind(as=>Cs(_o,as)),v0=(_o,Po,Xo)=>{const as=Jg(_o);return Kg(as,Po,Xo)},Jg=Am.fromTable,Vs=(_o,Po)=>{il(_o).each(as=>{as.dom.insertBefore(Po.dom,_o.dom)})},Dr=(_o,Po)=>{Rc(_o).fold(()=>{il(_o).each(Ms=>{Fa(Ms,Po)})},as=>{Vs(as,Po)})},Tr=(_o,Po)=>{zc(_o).fold(()=>{Fa(_o,Po)},as=>{_o.dom.insertBefore(Po.dom,as.dom)})},Fa=(_o,Po)=>{_o.dom.appendChild(Po.dom)},zl=(_o,Po)=>{Vs(_o,Po),Fa(Po,_o)},_c=(_o,Po)=>{zo(Po,(Xo,as)=>{const Ms=as===0?_o:Po[as-1];Dr(Ms,Xo)})},Wc=(_o,Po)=>{zo(Po,Xo=>{Fa(_o,Xo)})},Uc=_o=>{const Po=_o.dom;Po.parentNode!==null&&Po.parentNode.removeChild(Po)},D1=_o=>{const Po=Vc(_o);Po.length>0&&_c(_o,Po),Uc(_o)},_d=((_o,Po)=>{const Xo=vr=>{if(!_o(vr))throw new Error("Can only get "+Po+" value of a "+Po+" node");return as(vr).getOr("")},as=vr=>_o(vr)?Mo.from(vr.dom.nodeValue):Mo.none();return{get:Xo,getOption:as,set:(vr,zr)=>{if(!_o(vr))throw new Error("Can only set raw "+Po+" value of a "+Po+" node");vr.dom.nodeValue=zr}}})(Ks,"text"),Wh=_o=>_d.get(_o),y0=(_o,Po)=>_d.set(_o,Po);var Id=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Ku=()=>{const _o=Ol=>qa.fromDom(Ol.dom.cloneNode(!1)),Po=Ol=>Mr(Ol).dom,Xo=Ol=>Es(Ol)?Rr(Ol)==="body"?!0:_r(Id,Rr(Ol)):!1,as=Ol=>Es(Ol)?_r(["br","img","hr","input"],Rr(Ol)):!1,Ms=Ol=>Es(Ol)&&ef(Ol,"contenteditable")==="false",vr=(Ol,Xu)=>Ol.dom.compareDocumentPosition(Xu.dom),zr=(Ol,Xu)=>{const Ac=Cf(Ol);Em(Xu,Ac)},Jr=Ol=>{const Xu=Rr(Ol);return _r(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],Xu)},La=Ol=>Es(Ol)?Cu(Ol,"lang"):Mo.none();return{up:So({selector:Hc,closest:wu,predicate:Aa,all:Na}),down:So({selector:fc,predicate:om}),styles:So({get:As,getRaw:rr,set:rs,remove:Fr}),attrs:So({get:ef,set:Jd,remove:Qc,copyTo:zr}),insert:So({before:Vs,after:Dr,afterAll:_c,append:Fa,appendAll:Wc,prepend:Tr,wrap:zl}),remove:So({unwrap:D1,remove:Uc}),create:So({nu:qa.fromTag,clone:_o,text:qa.fromText}),query:So({comparePosition:vr,prevSibling:vl,nextSibling:Rc}),property:So({children:Vc,name:Rr,parent:il,document:Po,isText:Ks,isComment:vs,isElement:Es,isSpecial:Jr,getLanguage:La,getText:Wh,setText:y0,isBoundary:Xo,isEmptyTag:as,isNonEditable:Ms}),eq:Al,is:gd}};const Rm=(_o,Po,Xo,as)=>{const Ms=Xo[0],vr=Xo.slice(1);return as(_o,Po,Ms,vr)},iu=(_o,Po,Xo)=>Xo.length>0?Rm(_o,Po,Xo,am):Mo.none(),am=(_o,Po,Xo,as)=>{const Ms=Po(_o,Xo);return za(as,(vr,zr)=>{const Jr=Po(_o,zr);return Af(_o,vr,Jr)},Ms)},Af=(_o,Po,Xo)=>Po.bind(as=>Xo.filter(xo(_o.eq,as))),e1=iu,gv=Ku(),M1=(_o,Po)=>e1(gv,(Xo,as)=>_o(as),Po),Pb=_o=>Hc(_o,"table"),Op=(_o,Po)=>{const Xo=fc(_o,Po);return Xo.length>0?Mo.some(Xo):Mo.none()},Wf=(_o,Po,Xo)=>tl(_o,Po).bind(as=>tl(_o,Xo).bind(Ms=>M1(Pb,[as,Ms]).map(vr=>({first:as,last:Ms,table:vr})))),N1=(_o,Po)=>Op(_o,Po),Ny=(_o,Po,Xo)=>Wf(_o,Po,Xo).bind(as=>{const Ms=La=>Al(_o,La),vr="thead,tfoot,tbody,table",zr=Hc(as.first,vr,Ms),Jr=Hc(as.last,vr,Ms);return zr.bind(La=>Jr.bind(Ol=>Al(La,Ol)?v0(as.table,as.first,as.last):Mo.none()))}),t1=_o=>Qs(_o,qa.fromDom),$b="data-mce-selected",Zp="td["+$b+"],th["+$b+"]",qp="data-mce-first-selected",Ag="td["+qp+"],th["+qp+"]",Kc="data-mce-last-selected",au="td["+Kc+"],th["+Kc+"]",cf={selected:$b,selectedSelector:Zp,firstSelected:qp,firstSelectedSelector:Ag,lastSelected:Kc,lastSelectedSelector:au},O0=_o=>ta(_o).bind(Po=>N1(Po,cf.firstSelectedSelector)).fold(So(_o),Po=>Po[0]),bv=_o=>(Po,Xo)=>{const as=Rr(Po),Ms=as==="col"||as==="colgroup"?O0(Po):Po;return wu(Ms,_o,Xo)},tf=bv("th,td,caption"),lm=bv("th,td"),uf=_o=>t1(_o.model.table.getSelectedCells()),cm=(_o,Po)=>{const Xo=lm(_o),as=Xo.bind(Ms=>ta(Ms)).map(Ms=>al(Ms));return cd(Xo,as,(Ms,vr)=>Ca(vr,zr=>ha(t1(zr.dom.cells),Jr=>ef(Jr,Po)==="1"||Al(Jr,Ms)))).getOr([])},Rb=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],yl=_o=>({value:df(_o)}),dh=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,jp=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Sd=_o=>dh.test(_o)||jp.test(_o),df=_o=>Zd(_o,"#").toUpperCase(),vv=_o=>Sd(_o)?Mo.some({value:df(_o)}):Mo.none(),ff=_o=>{const Po=_o.toString(16);return(Po.length===1?"0"+Po:Po).toUpperCase()},Ju=_o=>{const Po=ff(_o.red)+ff(_o.green)+ff(_o.blue);return yl(Po)},wh=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,fd=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,Ym=(_o,Po,Xo,as)=>({red:_o,green:Po,blue:Xo,alpha:as}),_p=(_o,Po,Xo,as)=>{const Ms=parseInt(_o,10),vr=parseInt(Po,10),zr=parseInt(Xo,10),Jr=parseFloat(as);return Ym(Ms,vr,zr,Jr)},xu=_o=>{if(_o==="transparent")return Mo.some(Ym(0,0,0,0));const Po=wh.exec(_o);if(Po!==null)return Mo.some(_p(Po[1],Po[2],Po[3],"1"));const Xo=fd.exec(_o);return Xo!==null?Mo.some(_p(Xo[1],Xo[2],Xo[3],Xo[4])):Mo.none()},ed=_o=>vv(_o).orThunk(()=>xu(_o).map(Ju)).getOrThunk(()=>{const Po=document.createElement("canvas");Po.height=1,Po.width=1;const Xo=Po.getContext("2d");Xo.clearRect(0,0,Po.width,Po.height),Xo.fillStyle="#FFFFFF",Xo.fillStyle=_o,Xo.fillRect(0,0,1,1);const as=Xo.getImageData(0,0,1,1).data,Ms=as[0],vr=as[1],zr=as[2],Jr=as[3];return Ju(Ym(Ms,vr,zr,Jr))}),fh=_o=>xu(_o).map(Ju).map(Po=>"#"+Po.value).getOr(_o),Gm=_o=>{let Po=_o;return{get:()=>Po,set:Ms=>{Po=Ms}}},Fu=_o=>{const Po=Gm(Mo.none()),Xo=()=>Po.get().each(_o);return{clear:()=>{Xo(),Po.set(Mo.none())},isSet:()=>Po.get().isSome(),get:()=>Po.get(),set:Jr=>{Xo(),Po.set(Mo.some(Jr))}}},_0=()=>Fu(_o=>_o.unbind()),yv=(_o,Po,Xo)=>as=>{const Ms=_0(),vr=bp(Xo),zr=()=>{const Jr=uf(_o),La=Ol=>_o.formatter.match(Po,{value:Xo},Ol.dom,vr);vr?(as.setActive(!ha(Jr,La)),Ms.set(_o.formatter.formatChanged(Po,Ol=>as.setActive(!Ol),!0))):(as.setActive(dr(Jr,La)),Ms.set(_o.formatter.formatChanged(Po,as.setActive,!1,{value:Xo})))};return _o.initialized?zr():_o.on("init",zr),Ms.clear},Lc=_o=>Qr(_o,"menu"),Dm=_o=>Qs(_o,Po=>{const Xo=Po.text||Po.title||"";return Lc(Po)?{text:Xo,items:Dm(Po.menu)}:{text:Xo,value:Po.value}}),sc=(_o,Po,Xo,as)=>Qs(Po,Ms=>{const vr=Ms.text||Ms.title;return Lc(Ms)?{type:"nestedmenuitem",text:vr,getSubmenuItems:()=>sc(_o,Ms.menu,Xo,as)}:{text:vr,type:"togglemenuitem",onAction:()=>as(Ms.value),onSetup:yv(_o,Xo,Ms.value)}}),hf=(_o,Po)=>Xo=>{_o.execCommand("mceTableApplyCellStyle",!1,{[Po]:Xo})},um=_o=>fs(_o,Po=>Lc(Po)?[{...Po,menu:um(Po.menu)}]:ch(Po.value)?[Po]:[]),Km=(_o,Po,Xo,as)=>Ms=>Ms(sc(_o,Po,Xo,as)),ss=(_o,Po,Xo)=>{const as=Qs(Po,Ms=>({text:Ms.title,value:"#"+ed(Ms.value).value,type:"choiceitem"}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:as.length>0?as:void 0,allowCustomColors:!1},onAction:Ms=>{const vr=Ms.value==="remove"?"":Ms.value;_o.execCommand("mceTableApplyCellStyle",!1,{[Xo]:vr})}}]},dm=_o=>()=>{const Xo=_o.queryCommandValue("mceTableRowType")==="header"?"body":"header";_o.execCommand("mceTableRowType",!1,{type:Xo})},n1=_o=>()=>{const Xo=_o.queryCommandValue("mceTableColType")==="th"?"td":"th";_o.execCommand("mceTableColType",!1,{type:Xo})},Ch=_o=>{const Po=Dm(R1(_o));return Po.length>0?Mo.some({name:"class",type:"listbox",label:"Class",items:Po}):Mo.none()},Xc=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:Rb}],Ov=_o=>Xc.concat(Ch(_o).toArray()),Db=(_o,Po)=>{const as=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(Dm(Tg(_o)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:Po==="cell"?[{name:"borderwidth",type:"input",label:"Border width"}].concat(as):as}},Mm={normal:(_o,Po)=>{const Xo=_o.dom;return{setAttrib:(zr,Jr)=>{Xo.setAttrib(Po,zr,Jr)},setStyle:(zr,Jr)=>{Xo.setStyle(Po,zr,Jr)},setFormat:(zr,Jr)=>{Jr===""?_o.formatter.remove(zr,{value:null},Po,!0):_o.formatter.apply(zr,{value:Jr},Po)}}}},Eo=ka("th"),Bo=(_o,Po)=>_o&&Po?"sectionCells":_o?"section":"cells",Ko=_o=>{const Po=_o.section==="thead",Xo=qm(Ss(_o.cells),"th");return _o.section==="tfoot"?{type:"footer"}:Po||Xo?{type:"header",subType:Bo(Po,Xo)}:{type:"body"}},Ss=_o=>{const Po=Ca(_o,Xo=>Eo(Xo.element));return Po.length===0?Mo.some("td"):Po.length===_o.length?Mo.some("th"):Mo.none()},Rs=_o=>{const Po=Qs(_o,Ms=>Ko(Ms).type),Xo=_r(Po,"header"),as=_r(Po,"footer");if(!Xo&&!as)return Mo.some("body");{const Ms=_r(Po,"body");return Xo&&!Ms&&!as?Mo.some("header"):!Xo&&!Ms&&as?Mo.some("footer"):Mo.none()}},$r=_o=>{let Po=!1,Xo;return(...as)=>(Po||(Po=!0,Xo=_o.apply(null,as)),Xo)},Ea=(_o,Po)=>Ml(_o.all,Xo=>Sr(Xo.cells,as=>Al(Po,as.element))),ll=(_o,Po,Xo)=>{const as=Qs(Po.selection,vr=>cs(vr).bind(zr=>Ea(_o,zr)).filter(Xo)),Ms=Oc(as);return ju(Ms.length>0,Ms)},nl=(_o,Po)=>Po.mergable,Xa=(_o,Po)=>Po.unmergable,Nu=(_o,Po)=>ll(_o,Po,Jo),zu=(_o,Po)=>Ea(_o,Po).exists(Xo=>!Xo.isLocked),kh=(_o,Po)=>dr(Po,Xo=>zu(_o,Xo)),Sp=(_o,Po)=>nl(_o,Po).filter(Xo=>kh(_o,Xo.cells)),mf=(_o,Po)=>Xa(_o,Po).filter(Xo=>kh(_o,Xo));({...{generate:_o=>{if(!qn(_o))throw new Error("cases must be an array");if(_o.length===0)throw new Error("there must be at least one case");const Po=[],Xo={};return zo(_o,(as,Ms)=>{const vr=Go(as);if(vr.length!==1)throw new Error("one and only one name per case");const zr=vr[0],Jr=as[zr];if(Xo[zr]!==void 0)throw new Error("duplicate key detected:"+zr);if(zr==="cata")throw new Error("cannot have a case named cata (sorry)");if(!qn(Jr))throw new Error("case arguments must be an array");Po.push(zr),Xo[zr]=(...La)=>{const Ol=La.length;if(Ol!==Jr.length)throw new Error("Wrong number of arguments to case "+zr+". Expected "+Jr.length+" ("+Jr+"), got "+Ol);return{fold:(...Ac)=>{if(Ac.length!==_o.length)throw new Error("Wrong number of arguments to fold. Expected "+_o.length+", got "+Ac.length);return Ac[Ms].apply(null,La)},match:Ac=>{const gu=Go(Ac);if(Po.length!==gu.length)throw new Error("Wrong number of arguments to match. Expected: "+Po.join(",")+` +Actual: `+gu.join(","));if(!dr(Po,Jf=>_r(gu,Jf)))throw new Error("Not all branches were specified when using match. Specified: "+gu.join(", ")+` +Required: `+Po.join(", "));return Ac[zr].apply(null,La)},log:Ac=>{console.log(Ac,{constructors:Po,constructor:zr,params:La})}}}}),Xo}}.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])});const Oa=(_o,Po)=>{const Xo=Am.fromTable(_o);return Nu(Xo,Po).bind(Ms=>{const vr=Ms[Ms.length-1],zr=Ms[0].row,Jr=vr.row+vr.rowspan,La=Xo.all.slice(zr,Jr);return Rs(La)}).getOr("")},pf=_o=>ah(_o,"rgb")?fh(_o):_o,$O=_o=>{const Po=qa.fromDom(_o);return{borderwidth:rr(Po,"border-width").getOr(""),borderstyle:rr(Po,"border-style").getOr(""),bordercolor:rr(Po,"border-color").map(pf).getOr(""),backgroundcolor:rr(Po,"background-color").map(pf).getOr("")}},Yp=_o=>{const Po=_o[0],Xo=_o.slice(1);return zo(Xo,as=>{zo(Go(Po),Ms=>{ms(as,(vr,zr)=>{const Jr=Po[Ms];Jr!==""&&Ms===zr&&Jr!==vr&&(Po[Ms]="")})})}),Po},Ad=(_o,Po,Xo,as)=>Sr(_o,Ms=>!Kn(Xo.formatter.matchNode(as,Po+Ms))).getOr(""),Pg=xo(Ad,["left","center","right"],"align"),w0=xo(Ad,["top","middle","bottom"],"valign"),nf=(_o,Po)=>{const Xo=Wp(_o),as=zf(_o),Ms=()=>({borderstyle:gs(Xo,"border-style").getOr(""),bordercolor:pf(gs(Xo,"border-color").getOr("")),backgroundcolor:pf(gs(Xo,"background-color").getOr(""))}),vr={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},zr=()=>{const Xu=Xo["border-width"];return $m(_o)&&Xu?{border:Xu}:gs(as,"border").fold(()=>({}),Ac=>({border:Ac}))},Jr=Po?Ms():{},La=()=>{const Xu=gs(Xo,"border-spacing").or(gs(as,"cellspacing")).fold(()=>({}),gu=>({cellspacing:gu})),Ac=gs(Xo,"border-padding").or(gs(as,"cellpadding")).fold(()=>({}),gu=>({cellpadding:gu}));return{...Xu,...Ac}};return{...vr,...Xo,...as,...Jr,...zr(),...La()}},Jm=_o=>ta(qa.fromDom(_o)).map(Po=>{const Xo={selection:t1(_o.cells)};return Oa(Po,Xo)}).getOr(""),_v=(_o,Po,Xo)=>{const as=(Jr,La)=>{const Ol=rr(qa.fromDom(La),"border-width");return $m(_o)&&Ol.isSome()?Ol.getOr(""):Jr.getAttrib(La,"border")||uh(_o.dom,La,"border-width")||uh(_o.dom,La,"border")||""},Ms=_o.dom,vr=$m(_o)?Ms.getStyle(Po,"border-spacing")||Ms.getAttrib(Po,"cellspacing"):Ms.getAttrib(Po,"cellspacing")||Ms.getStyle(Po,"border-spacing"),zr=$m(_o)?uh(Ms,Po,"padding")||Ms.getAttrib(Po,"cellpadding"):Ms.getAttrib(Po,"cellpadding")||uh(Ms,Po,"padding");return{width:Ms.getStyle(Po,"width")||Ms.getAttrib(Po,"width"),height:Ms.getStyle(Po,"height")||Ms.getAttrib(Po,"height"),cellspacing:vr??"",cellpadding:zr??"",border:as(Ms,Po),caption:!!Ms.select("caption",Po)[0],class:Ms.getAttrib(Po,"class",""),align:Pg(_o,Po),...Xo?$O(Po):{}}},Gp=(_o,Po,Xo)=>{const as=_o.dom;return{height:as.getStyle(Po,"height")||as.getAttrib(Po,"height"),class:as.getAttrib(Po,"class",""),type:Jm(Po),align:Pg(_o,Po),...Xo?$O(Po):{}}},Sv=(_o,Po,Xo,as)=>{const Ms=_o.dom,vr=as.getOr(Po),zr=(Jr,La)=>Ms.getStyle(Jr,La)||Ms.getAttrib(Jr,La);return{width:zr(vr,"width"),height:zr(Po,"height"),scope:Ms.getAttrib(Po,"scope"),celltype:nm(Po),class:Ms.getAttrib(Po,"class",""),halign:Pg(_o,Po),valign:w0(_o,Po),...Xo?$O(Po):{}}},$g=(_o,Po)=>{const Xo=Am.fromTable(_o),as=Am.justCells(Xo),Ms=Ca(as,vr=>ha(Po,zr=>Al(vr.element,zr)));return Qs(Ms,vr=>({element:vr.element.dom,column:Am.getColumnAt(Xo,vr.column).map(zr=>zr.element.dom)}))},Ir=(_o,Po,Xo,as)=>{as("scope")&&_o.setAttrib("scope",Xo.scope),as("class")&&_o.setAttrib("class",Xo.class),as("height")&&_o.setStyle("height",oc(Xo.height)),as("width")&&Po.setStyle("width",oc(Xo.width))},RO=(_o,Po,Xo)=>{Xo("backgroundcolor")&&_o.setFormat("tablecellbackgroundcolor",Po.backgroundcolor),Xo("bordercolor")&&_o.setFormat("tablecellbordercolor",Po.bordercolor),Xo("borderstyle")&&_o.setFormat("tablecellborderstyle",Po.borderstyle),Xo("borderwidth")&&_o.setFormat("tablecellborderwidth",oc(Po.borderwidth))},Rg=(_o,Po,Xo,as)=>{const Ms=Po.length===1;zo(Po,vr=>{const zr=vr.element,Jr=Ms?Jo:as,La=Mm.normal(_o,zr),Ol=vr.column.map(Xu=>Mm.normal(_o,Xu)).getOr(La);Ir(La,Ol,Xo,Jr),Ab(_o)&&RO(La,Xo,Jr),as("halign")&&Hh(_o,zr,Xo.halign),as("valign")&&A1(_o,zr,Xo.valign)})},Dg=(_o,Po)=>{_o.execCommand("mceTableCellType",!1,{type:Po.celltype,no_events:!0})},Nm=(_o,Po,Xo,as)=>{const Ms=Ys(as,(vr,zr)=>Xo[zr]!==vr);ko(Ms)>0&&Po.length>=1&&ta(Po[0]).each(vr=>{const zr=$g(vr,Po),Jr=ko(Ys(Ms,(Ol,Xu)=>Xu!=="scope"&&Xu!=="celltype"))>0,La=xs(Ms,"celltype");(Jr||xs(Ms,"scope"))&&Rg(_o,zr,as,xo(xs,Ms)),La&&Dg(_o,as),ql(_o,vr.dom,{structure:La,style:Jr})})},Lu=(_o,Po,Xo,as)=>{const Ms=as.getData();as.close(),_o.undoManager.transact(()=>{Nm(_o,Po,Xo,Ms),_o.focus()})},Ec=(_o,Po)=>{const Xo=ta(Po[0]).map(as=>Qs($g(as,Po),Ms=>Sv(_o,Ms.element,Ab(_o),Ms.column)));return Yp(Xo.getOrDie())},td=_o=>{const Po=uf(_o);if(Po.length===0)return;const Xo=Ec(_o,Po),as={type:"tabpanel",tabs:[{title:"General",name:"general",items:Ov(_o)},Db(_o,"cell")]},Ms={type:"panel",items:[{type:"grid",columns:2,items:Ov(_o)}]};_o.windowManager.open({title:"Cell Properties",size:"normal",body:Ab(_o)?as:Ms,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Xo,onSubmit:xo(Lu,_o,Po,Xo)})},Gf=_o=>{const Po=Dm(Xm(_o));return Po.length>0?Mo.some({name:"class",type:"listbox",label:"Class",items:Po}):Mo.none()},jl=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],L1=_o=>jl.concat(Gf(_o).toArray()),Bd=(_o,Po,Xo)=>{Xo("class")&&_o.setAttrib("class",Po.class),Xo("height")&&_o.setStyle("height",oc(Po.height))},pu=(_o,Po,Xo)=>{Xo("backgroundcolor")&&_o.setStyle("background-color",Po.backgroundcolor),Xo("bordercolor")&&_o.setStyle("border-color",Po.bordercolor),Xo("borderstyle")&&_o.setStyle("border-style",Po.borderstyle)},C0=(_o,Po,Xo,as)=>{const vr=Po.length===1?Jo:as;zo(Po,zr=>{const Jr=Mm.normal(_o,zr);Bd(Jr,Xo,vr),P1(_o)&&pu(Jr,Xo,vr),as("align")&&Hh(_o,zr,Xo.align)})},Er=(_o,Po)=>{_o.execCommand("mceTableRowType",!1,{type:Po.type,no_events:!0})},Kf=(_o,Po,Xo,as)=>{const Ms=Ys(as,(vr,zr)=>Xo[zr]!==vr);if(ko(Ms)>0){const vr=xs(Ms,"type"),zr=vr?ko(Ms)>1:!0;zr&&C0(_o,Po,as,xo(xs,Ms)),vr&&Er(_o,as),ta(qa.fromDom(Po[0])).each(Jr=>ql(_o,Jr.dom,{structure:vr,style:zr}))}},k0=(_o,Po,Xo,as)=>{const Ms=as.getData();as.close(),_o.undoManager.transact(()=>{Kf(_o,Po,Xo,Ms),_o.focus()})},hc=_o=>{const Po=cm(Dc(_o),cf.selected);if(Po.length===0)return;const Xo=Qs(Po,zr=>Gp(_o,zr.dom,P1(_o))),as=Yp(Xo),Ms={type:"tabpanel",tabs:[{title:"General",name:"general",items:L1(_o)},Db(_o,"row")]},vr={type:"panel",items:[{type:"grid",columns:2,items:L1(_o)}]};_o.windowManager.open({title:"Row Properties",size:"normal",body:P1(_o)?Ms:vr,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:as,onSubmit:xo(k0,_o,Qs(Po,zr=>zr.dom),as)})},hd=(_o,Po,Xo)=>{const as=Xo?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],Ms=[{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}],vr=$1(_o)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],zr=[{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}],Jr=Po.length>0?[{type:"listbox",name:"class",label:"Class",items:Po}]:[];return as.concat(Ms).concat(vr).concat(zr).concat(Jr)},wv=(_o,Po,Xo,as)=>{if(Po.tagName==="TD"||Po.tagName==="TH")Un(Xo)&&io(as)?_o.setStyle(Po,Xo,as):_o.setStyles(Po,Xo);else if(Po.children)for(let Ms=0;Ms{const Ms=_o.dom,vr={},zr={},Jr=$m(_o),La=Yf(_o);if(Kn(Xo.class)||(vr.class=Xo.class),zr.height=oc(Xo.height),Jr?zr.width=oc(Xo.width):Ms.getAttrib(Po,"width")&&(vr.width=ld(Xo.width)),Jr?(zr["border-width"]=oc(Xo.border),zr["border-spacing"]=oc(Xo.cellspacing)):(vr.border=Xo.border,vr.cellpadding=Xo.cellpadding,vr.cellspacing=Xo.cellspacing),Jr&&Po.children){const Ol={};if(as.border&&(Ol["border-width"]=oc(Xo.border)),as.cellpadding&&(Ol.padding=oc(Xo.cellpadding)),La&&as.bordercolor&&(Ol["border-color"]=Xo.bordercolor),!cr(Ol))for(let Xu=0;Xu{const Ms=_o.dom,vr=as.getData(),zr=Ys(vr,(Jr,La)=>Xo[La]!==Jr);as.close(),vr.class===""&&delete vr.class,_o.undoManager.transact(()=>{if(!Po){const Jr=kf(vr.cols).getOr(1),La=kf(vr.rows).getOr(1);_o.execCommand("mceInsertTable",!1,{rows:La,columns:Jr}),Po=lm(Dc(_o),Ud(_o)).bind(Ol=>ta(Ol,Ud(_o))).map(Ol=>Ol.dom).getOrDie()}if(ko(zr)>0){const Jr={border:xs(zr,"border"),bordercolor:xs(zr,"bordercolor"),cellpadding:xs(zr,"cellpadding")};ep(_o,Po,vr,Jr);const La=Ms.select("caption",Po)[0];(La&&!vr.caption||!La&&vr.caption)&&_o.execCommand("mceTableToggleCaption"),Hh(_o,Po,vr.align)}if(_o.focus(),_o.addVisual(),ko(zr)>0){const Jr=xs(zr,"caption"),La=Jr?ko(zr)>1:!0;ql(_o,Po,{structure:Jr,style:La})}})},fm=(_o,Po)=>{const Xo=_o.dom;let as,Ms=nf(_o,Yf(_o));Po?(Ms.cols="1",Ms.rows="1",Yf(_o)&&(Ms.borderstyle="",Ms.bordercolor="",Ms.backgroundcolor="")):(as=Xo.getParent(_o.selection.getStart(),"table",_o.getBody()),as?Ms=_v(_o,as,Yf(_o)):Yf(_o)&&(Ms.borderstyle="",Ms.bordercolor="",Ms.backgroundcolor=""));const vr=Dm(Yg(_o));vr.length>0&&Ms.class&&(Ms.class=Ms.class.replace(/\s*mce\-item\-table\s*/g,""));const zr={type:"grid",columns:2,items:hd(_o,vr,Po)},Jr=()=>({type:"panel",items:[zr]}),La=()=>({type:"tabpanel",tabs:[{title:"General",name:"general",items:[zr]},Db(_o,"table")]}),Ol=Yf(_o)?La():Jr();_o.windowManager.open({title:"Table Properties",size:"normal",body:Ol,onSubmit:xo(tp,_o,as,Ms),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Ms})},Mb=_o=>{const Po=Xo=>{Nd(Dc(_o))&&Xo()};ms({mceTableProps:xo(fm,_o,!1),mceTableRowProps:xo(hc,_o),mceTableCellProps:xo(td,_o),mceInsertTableDialog:xo(fm,_o,!0)},(Xo,as)=>_o.addCommand(as,()=>Po(Xo)))},Pf=(_o,Po)=>Ds(_o,Po).isSome(),Tc=$o,Fd=_o=>{const Po=(as,Ms)=>Cu(as,Ms).exists(vr=>parseInt(vr,10)>1),Xo=as=>Po(as,"rowspan")||Po(as,"colspan");return _o.length>0&&dr(_o,Xo)?Mo.some(_o):Mo.none()},Mg=(_o,Po,Xo)=>Po.length<=1?Mo.none():Ny(_o,Xo.firstSelectedSelector,Xo.lastSelectedSelector).map(as=>({bounds:as,cells:Po})),$f=_o=>({element:_o,mergable:Mo.none(),unmergable:Mo.none(),selection:[_o]}),Ly=(_o,Po,Xo)=>({element:Xo,mergable:Mg(Po,_o,cf),unmergable:Fd(_o),selection:Tc(_o)}),I1=_o=>{const Po=Gm(Mo.none()),Xo=Gm([]);let as=Mo.none();const Ms=ka("caption"),vr=Fl=>as.forall(Xl=>!Xl[Fl]),zr=()=>tf(Dc(_o),Ud(_o)),Jr=()=>tf(bd(_o),Ud(_o)),La=()=>zr().bind(Fl=>vd(cd(ta(Fl),Jr().bind(ta),(Xl,Qd)=>Al(Xl,Qd)?Ms(Fl)?Mo.some($f(Fl)):Mo.some(Ly(uf(_o),Xl,Fl)):Mo.none()))),Ol=Fl=>ta(Fl.element).map(Qd=>{const Rf=Am.fromTable(Qd),Cv=Nu(Rf,Fl).getOr([]),eg=Il(Cv,(Wu,pm)=>(pm.isLocked&&(Wu.onAny=!0,pm.column===0?Wu.onFirst=!0:pm.column+pm.colspan>=Rf.grid.columns&&(Wu.onLast=!0)),Wu),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:Sp(Rf,Fl).isSome(),unmergeable:mf(Rf,Fl).isSome(),locked:eg}}),Xu=()=>{Po.set($r(La)()),as=Po.get().bind(Ol),zo(Xo.get(),Io)},Ac=Fl=>(Fl(),Xo.set(Xo.get().concat([Fl])),()=>{Xo.set(Ca(Xo.get(),Xl=>Xl!==Fl))}),gu=(Fl,Xl)=>Ac(()=>Po.get().fold(()=>{Fl.setEnabled(!1)},Qd=>{Fl.setEnabled(!Xl(Qd)&&_o.selection.isEditable())})),Uh=(Fl,Xl,Qd)=>Ac(()=>Po.get().fold(()=>{Fl.setEnabled(!1),Fl.setActive(!1)},Rf=>{Fl.setEnabled(!Xl(Rf)&&_o.selection.isEditable()),Fl.setActive(Qd(Rf))})),Jf=Fl=>as.exists(Xl=>Xl.locked[Fl]),hm=Fl=>gu(Fl,Xl=>!1),Jp=Fl=>gu(Fl,Xl=>Ms(Xl.element)),wp=Fl=>Xl=>gu(Xl,Qd=>Ms(Qd.element)||Jf(Fl)),B1=Fl=>Xl=>gu(Xl,Qd=>Ms(Qd.element)||Fl().isNone()),Sc=(Fl,Xl)=>Qd=>gu(Qd,Rf=>Ms(Rf.element)||Fl().isNone()||Jf(Xl)),F1=Fl=>gu(Fl,Xl=>vr("mergeable")),x0=Fl=>gu(Fl,Xl=>vr("unmergeable")),nd=Fl=>Uh(Fl,Vo,Xl=>ta(Xl.element,Ud(_o)).exists(Rf=>Pf(Rf,"caption"))),mm=(Fl,Xl)=>Qd=>Uh(Qd,Rf=>Ms(Rf.element),()=>_o.queryCommandValue(Fl)===Xl),Nb=mm("mceTableRowType","header"),H1=mm("mceTableColType","th");return _o.on("NodeChange ExecCommand TableSelectorChange",Xu),{onSetupTable:hm,onSetupCellOrRow:Jp,onSetupColumn:wp,onSetupPasteable:B1,onSetupPasteableColumn:Sc,onSetupMergeable:F1,onSetupUnmergeable:x0,resetTargets:Xu,onSetupTableWithCaption:nd,onSetupTableRowHeaders:Nb,onSetupTableColumnHeaders:H1,targets:Po.get}};var Ng=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const hh="x-tinymce/dom-table-",np=hh+"rows",Gs=hh+"columns",xh=_o=>{var Po;const Xo=(Po=Ng.read())!==null&&Po!==void 0?Po:[];return Ml(Xo,as=>Mo.from(as.getType(_o)))},Lm=()=>xh(np),mh=()=>xh(Gs),Eh=_o=>Po=>{const Xo=()=>{Po.setEnabled(_o.selection.isEditable())};return _o.on("NodeChange",Xo),Xo(),()=>{_o.off("NodeChange",Xo)}},Xd=(_o,Po)=>{_o.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:Eh(_o),fetch:Jr=>Jr("inserttable | cell row column | advtablesort | tableprops deletetable")});const Xo=Jr=>()=>_o.execCommand(Jr),as=(Jr,La)=>{_o.queryCommandSupported(La.command)&&_o.ui.registry.addButton(Jr,{...La,onAction:uo(La.onAction)?La.onAction:Xo(La.command)})},Ms=(Jr,La)=>{_o.queryCommandSupported(La.command)&&_o.ui.registry.addToggleButton(Jr,{...La,onAction:uo(La.onAction)?La.onAction:Xo(La.command)})};as("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:Po.onSetupTable}),as("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:Po.onSetupTable}),as("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:Po.onSetupCellOrRow}),as("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:Po.onSetupMergeable}),as("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:Po.onSetupUnmergeable}),as("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:Po.onSetupCellOrRow}),as("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:Po.onSetupCellOrRow}),as("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:Po.onSetupCellOrRow}),as("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:Po.onSetupCellOrRow}),as("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:Po.onSetupColumn("onFirst")}),as("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:Po.onSetupColumn("onLast")}),as("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:Po.onSetupColumn("onAny")}),as("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:Po.onSetupCellOrRow}),as("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:Po.onSetupCellOrRow}),as("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:Po.onSetupPasteable(Lm)}),as("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:Po.onSetupPasteable(Lm)}),as("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:Po.onSetupColumn("onAny")}),as("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:Po.onSetupColumn("onAny")}),as("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:Po.onSetupPasteableColumn(mh,"onFirst")}),as("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:Po.onSetupPasteableColumn(mh,"onLast")}),as("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:Eh(_o)});const vr=um(Yg(_o));vr.length!==0&&_o.queryCommandSupported("mceTableToggleClass")&&_o.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Km(_o,vr,"tableclass",Jr=>_o.execCommand("mceTableToggleClass",!1,Jr)),onSetup:Po.onSetupTable});const zr=um(R1(_o));zr.length!==0&&_o.queryCommandSupported("mceTableCellToggleClass")&&_o.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Km(_o,zr,"tablecellclass",Jr=>_o.execCommand("mceTableCellToggleClass",!1,Jr)),onSetup:Po.onSetupCellOrRow}),_o.queryCommandSupported("mceTableApplyCellStyle")&&(_o.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Km(_o,Rb,"tablecellverticalalign",hf(_o,"vertical-align")),onSetup:Po.onSetupCellOrRow}),_o.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Km(_o,zp(_o),"tablecellborderwidth",hf(_o,"border-width")),onSetup:Po.onSetupCellOrRow}),_o.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Km(_o,Tg(_o),"tablecellborderstyle",hf(_o,"border-style")),onSetup:Po.onSetupCellOrRow}),_o.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:Jr=>Jr(ss(_o,Gg(_o),"background-color")),onSetup:Po.onSetupCellOrRow}),_o.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:Jr=>Jr(ss(_o,yp(_o),"border-color")),onSetup:Po.onSetupCellOrRow})),Ms("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:Po.onSetupTableWithCaption}),Ms("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:dm(_o),onSetup:Po.onSetupTableRowHeaders}),Ms("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:n1(_o),onSetup:Po.onSetupTableColumnHeaders})},Hd=_o=>{const Po=as=>_o.dom.is(as,"table")&&_o.getBody().contains(as)&&_o.dom.isEditable(as.parentNode),Xo=Vf(_o);Xo.length>0&&_o.ui.registry.addContextToolbar("table",{predicate:Po,items:Xo,scope:"node",position:"node"})},Iy=_o=>Po=>{const Xo=()=>{Po.setEnabled(_o.selection.isEditable())};return _o.on("NodeChange",Xo),Xo(),()=>{_o.off("NodeChange",Xo)}},Th=(_o,Po)=>{const Xo=Ac=>()=>_o.execCommand(Ac),as=(Ac,gu)=>_o.queryCommandSupported(gu.command)?(_o.ui.registry.addMenuItem(Ac,{...gu,onAction:uo(gu.onAction)?gu.onAction:Xo(gu.command)}),!0):!1,Ms=(Ac,gu)=>{_o.queryCommandSupported(gu.command)&&_o.ui.registry.addToggleMenuItem(Ac,{...gu,onAction:uo(gu.onAction)?gu.onAction:Xo(gu.command)})},vr=Ac=>{_o.execCommand("mceInsertTable",!1,{rows:Ac.numRows,columns:Ac.numColumns})},zr=[as("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:Po.onSetupCellOrRow}),as("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:Po.onSetupCellOrRow}),as("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:Po.onSetupCellOrRow}),as("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:Po.onSetupCellOrRow}),as("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:Po.onSetupCellOrRow}),as("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:Po.onSetupCellOrRow}),as("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:Po.onSetupPasteable(Lm)}),as("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:Po.onSetupPasteable(Lm)})],Jr=[as("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:Po.onSetupColumn("onFirst")}),as("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:Po.onSetupColumn("onLast")}),as("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:Po.onSetupColumn("onAny")}),as("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:Po.onSetupColumn("onAny")}),as("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:Po.onSetupColumn("onAny")}),as("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:Po.onSetupPasteableColumn(mh,"onFirst")}),as("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:Po.onSetupPasteableColumn(mh,"onLast")})],La=[as("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:Po.onSetupCellOrRow}),as("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:Po.onSetupMergeable}),as("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:Po.onSetupUnmergeable})];jd(_o)?_o.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:vr}],onSetup:Iy(_o)}):_o.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:Xo("mceInsertTableDialog"),onSetup:Iy(_o)}),_o.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:Xo("mceInsertTableDialog"),onSetup:Iy(_o)}),as("tableprops",{text:"Table properties",onSetup:Po.onSetupTable,command:"mceTableProps"}),as("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:Po.onSetupTable,command:"mceTableDelete"}),_r(zr,!0)&&_o.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:So("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),_r(Jr,!0)&&_o.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:So("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),_r(La,!0)&&_o.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:So("tablecellprops tablemergecells tablesplitcells")}),_o.ui.registry.addContextMenu("table",{update:()=>(Po.resetTargets(),Po.targets().fold(So(""),Ac=>Rr(Ac.element)==="caption"?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"))});const Ol=um(Yg(_o));Ol.length!==0&&_o.queryCommandSupported("mceTableToggleClass")&&_o.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>sc(_o,Ol,"tableclass",Ac=>_o.execCommand("mceTableToggleClass",!1,Ac)),onSetup:Po.onSetupTable});const Xu=um(R1(_o));Xu.length!==0&&_o.queryCommandSupported("mceTableCellToggleClass")&&_o.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>sc(_o,Xu,"tablecellclass",Ac=>_o.execCommand("mceTableCellToggleClass",!1,Ac)),onSetup:Po.onSetupCellOrRow}),_o.queryCommandSupported("mceTableApplyCellStyle")&&(_o.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>sc(_o,Rb,"tablecellverticalalign",hf(_o,"vertical-align")),onSetup:Po.onSetupCellOrRow}),_o.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>sc(_o,zp(_o),"tablecellborderwidth",hf(_o,"border-width")),onSetup:Po.onSetupCellOrRow}),_o.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>sc(_o,Tg(_o),"tablecellborderstyle",hf(_o,"border-style")),onSetup:Po.onSetupCellOrRow}),_o.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>ss(_o,Gg(_o),"background-color"),onSetup:Po.onSetupCellOrRow}),_o.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>ss(_o,yp(_o),"border-color"),onSetup:Po.onSetupCellOrRow})),Ms("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:Po.onSetupTableWithCaption}),Ms("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:dm(_o),onSetup:Po.onSetupTableRowHeaders}),Ms("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:n1(_o),onSetup:Po.onSetupTableRowHeaders})},Kp=_o=>{const Po=I1(_o);Mu(_o),Mb(_o),Th(_o,Po),Xd(_o,Po),Hd(_o)};var Ua=()=>{_n.add("table",Kp)};Ua()})();(function(){var _n=tinymce.util.Tools.resolve("tinymce.PluginManager");const Ce=ko=>ko==null,ke=ko=>!Ce(ko),$n=()=>{},Hn=ko=>()=>ko;class zn{constructor(gs,xs){this.tag=gs,this.value=xs}static some(gs){return new zn(!0,gs)}static none(){return zn.singletonNone}fold(gs,xs){return this.tag?xs(this.value):gs()}isSome(){return this.tag}isNone(){return!this.tag}map(gs){return this.tag?zn.some(gs(this.value)):zn.none()}bind(gs){return this.tag?gs(this.value):zn.none()}exists(gs){return this.tag&&gs(this.value)}forall(gs){return!this.tag||gs(this.value)}filter(gs){return!this.tag||gs(this.value)?this:zn.none()}getOr(gs){return this.tag?this.value:gs}or(gs){return this.tag?this:gs}getOrThunk(gs){return this.tag?this.value:gs()}orThunk(gs){return this.tag?this:gs()}getOrDie(gs){if(this.tag)return this.value;throw new Error(gs??"Called getOrDie on None")}static from(gs){return ke(gs)?zn.some(gs):zn.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(gs){this.tag&&gs(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}zn.singletonNone=new zn(!1);const Un=(ko,gs)=>gs>=0&&gsUn(ko,0);var Xn=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils");const Kn=typeof window<"u"?window:Function("return this;")(),to=function(ko,gs,xs){const Qr=window.Prism;window.Prism={manual:!0};var cr=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},ws=function(Fs){var Br=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,_r=0,ha={},hs={manual:Fs.Prism&&Fs.Prism.manual,disableWorkerMessageHandler:Fs.Prism&&Fs.Prism.disableWorkerMessageHandler,util:{encode:function fs(dr){return dr instanceof Qs?new Qs(dr.type,fs(dr.content),dr.alias):Array.isArray(dr)?dr.map(fs):dr.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(nr){var fs=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(nr.stack)||[])[1];if(fs){var dr=document.getElementsByTagName("script");for(var Vr in dr)if(dr[Vr].src==fs)return dr[Vr]}return null}},isActive:function(fs,dr,Vr){for(var nr="no-"+dr;fs;){var Kr=fs.classList;if(Kr.contains(dr))return!0;if(Kr.contains(nr))return!1;fs=fs.parentElement}return!!Vr}},languages:{plain:ha,plaintext:ha,text:ha,txt:ha,extend:function(fs,dr){var Vr=hs.util.clone(hs.languages[fs]);for(var nr in dr)Vr[nr]=dr[nr];return Vr},insertBefore:function(fs,dr,Vr,nr){nr=nr||hs.languages;var Kr=nr[fs],ra={};for(var Ml in Kr)if(Kr.hasOwnProperty(Ml)){if(Ml==dr)for(var xa in Vr)Vr.hasOwnProperty(xa)&&(ra[xa]=Vr[xa]);Vr.hasOwnProperty(Ml)||(ra[Ml]=Kr[Ml])}var Nl=nr[fs];return nr[fs]=ra,hs.languages.DFS(hs.languages,function(Zc,cc){cc===Nl&&Zc!=fs&&(this[Zc]=ra)}),ra},DFS:function fs(dr,Vr,nr,Kr){Kr=Kr||{};var ra=hs.util.objId;for(var Ml in dr)if(dr.hasOwnProperty(Ml)){Vr.call(dr,Ml,dr[Ml],nr||Ml);var xa=dr[Ml],Nl=hs.util.type(xa);Nl==="Object"&&!Kr[ra(xa)]?(Kr[ra(xa)]=!0,fs(xa,Vr,null,Kr)):Nl==="Array"&&!Kr[ra(xa)]&&(Kr[ra(xa)]=!0,fs(xa,Vr,Ml,Kr))}}},plugins:{},highlightAll:function(fs,dr){hs.highlightAllUnder(document,fs,dr)},highlightAllUnder:function(fs,dr,Vr){var nr={callback:Vr,container:fs,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};hs.hooks.run("before-highlightall",nr),nr.elements=Array.prototype.slice.apply(nr.container.querySelectorAll(nr.selector)),hs.hooks.run("before-all-elements-highlight",nr);for(var Kr=0,ra;ra=nr.elements[Kr++];)hs.highlightElement(ra,dr===!0,nr.callback)},highlightElement:function(fs,dr,Vr){var nr=hs.util.getLanguage(fs),Kr=hs.languages[nr];hs.util.setLanguage(fs,nr);var ra=fs.parentElement;ra&&ra.nodeName.toLowerCase()==="pre"&&hs.util.setLanguage(ra,nr);var Ml=fs.textContent,xa={element:fs,language:nr,grammar:Kr,code:Ml};function Nl(cc){xa.highlightedCode=cc,hs.hooks.run("before-insert",xa),xa.element.innerHTML=xa.highlightedCode,hs.hooks.run("after-highlight",xa),hs.hooks.run("complete",xa),Vr&&Vr.call(xa.element)}if(hs.hooks.run("before-sanity-check",xa),ra=xa.element.parentElement,ra&&ra.nodeName.toLowerCase()==="pre"&&!ra.hasAttribute("tabindex")&&ra.setAttribute("tabindex","0"),!xa.code){hs.hooks.run("complete",xa),Vr&&Vr.call(xa.element);return}if(hs.hooks.run("before-highlight",xa),!xa.grammar){Nl(hs.util.encode(xa.code));return}if(dr&&Fs.Worker){var Zc=new Worker(hs.filename);Zc.onmessage=function(cc){Nl(cc.data)},Zc.postMessage(JSON.stringify({language:xa.language,code:xa.code,immediateClose:!0}))}else Nl(hs.highlight(xa.code,xa.grammar,xa.language))},highlight:function(fs,dr,Vr){var nr={code:fs,grammar:dr,language:Vr};if(hs.hooks.run("before-tokenize",nr),!nr.grammar)throw new Error('The language "'+nr.language+'" has no grammar.');return nr.tokens=hs.tokenize(nr.code,nr.grammar),hs.hooks.run("after-tokenize",nr),Qs.stringify(hs.util.encode(nr.tokens),nr.language)},tokenize:function(fs,dr){var Vr=dr.rest;if(Vr){for(var nr in Vr)dr[nr]=Vr[nr];delete dr.rest}var Kr=new ga;return Ca(Kr,Kr.head,fs),el(fs,Kr,dr,Kr.head,0),Il(Kr)},hooks:{all:{},add:function(fs,dr){var Vr=hs.hooks.all;Vr[fs]=Vr[fs]||[],Vr[fs].push(dr)},run:function(fs,dr){var Vr=hs.hooks.all[fs];if(!(!Vr||!Vr.length))for(var nr=0,Kr;Kr=Vr[nr++];)Kr(dr)}},Token:Qs};Fs.Prism=hs;function Qs(fs,dr,Vr,nr){this.type=fs,this.content=dr,this.alias=Vr,this.length=(nr||"").length|0}Qs.stringify=function fs(dr,Vr){if(typeof dr=="string")return dr;if(Array.isArray(dr)){var nr="";return dr.forEach(function(Nl){nr+=fs(Nl,Vr)}),nr}var Kr={type:dr.type,content:fs(dr.content,Vr),tag:"span",classes:["token",dr.type],attributes:{},language:Vr},ra=dr.alias;ra&&(Array.isArray(ra)?Array.prototype.push.apply(Kr.classes,ra):Kr.classes.push(ra)),hs.hooks.run("wrap",Kr);var Ml="";for(var xa in Kr.attributes)Ml+=" "+xa+'="'+(Kr.attributes[xa]||"").replace(/"/g,""")+'"';return"<"+Kr.tag+' class="'+Kr.classes.join(" ")+'"'+Ml+">"+Kr.content+""};function zo(fs,dr,Vr,nr){fs.lastIndex=dr;var Kr=fs.exec(Vr);if(Kr&&nr&&Kr[1]){var ra=Kr[1].length;Kr.index+=ra,Kr[0]=Kr[0].slice(ra)}return Kr}function el(fs,dr,Vr,nr,Kr,ra){for(var Ml in Vr)if(!(!Vr.hasOwnProperty(Ml)||!Vr[Ml])){var xa=Vr[Ml];xa=Array.isArray(xa)?xa:[xa];for(var Nl=0;Nl=ra.reach);qa+=Fc.value.length,Fc=Fc.next){var Ya=Fc.value;if(dr.length>fs.length)return;if(!(Ya instanceof Qs)){var kc=1,Yl;if(nc){if(Yl=zo(Vl,qa,fs,gc),!Yl||Yl.index>=fs.length)break;var Rr=Yl.index,rd=Yl.index+Yl[0].length,Al=qa;for(Al+=Fc.value.length;Rr>=Al;)Fc=Fc.next,Al+=Fc.value.length;if(Al-=Fc.value.length,qa=Al,Fc.value instanceof Qs)continue;for(var gd=Fc;gd!==dr.tail&&(Alra.reach&&(ra.reach=Es);var Ks=Fc.prev;Su&&(Ks=Ca(dr,Ks,Su),qa+=Su.length),za(dr,Ks,kc);var pr=new Qs(Ml,cc?hs.tokenize(Pl,cc):Pl,Ed,Pl);if(Fc=Ca(dr,Ks,pr),vs&&Ca(dr,Fc,vs),kc>1){var ia={cause:Ml+","+Nl,reach:Es};el(fs,dr,Vr,Fc.prev,qa,ia),ra&&ia.reach>ra.reach&&(ra.reach=ia.reach)}}}}}}function ga(){var fs={value:null,prev:null,next:null},dr={value:null,prev:fs,next:null};fs.next=dr,this.head=fs,this.tail=dr,this.length=0}function Ca(fs,dr,Vr){var nr=dr.next,Kr={value:Vr,prev:dr,next:nr};return dr.next=Kr,nr.prev=Kr,fs.length++,Kr}function za(fs,dr,Vr){for(var nr=dr.next,Kr=0;Kr]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},function(Fs){function Br(_r,ha){return"___"+_r.toUpperCase()+ha+"___"}Object.defineProperties(Fs.languages["markup-templating"]={},{buildPlaceholders:{value:function(_r,ha,hs,Qs){if(_r.language===ha){var zo=_r.tokenStack=[];_r.code=_r.code.replace(hs,function(el){if(typeof Qs=="function"&&!Qs(el))return el;for(var ga=zo.length,Ca;_r.code.indexOf(Ca=Br(ha,ga))!==-1;)++ga;return zo[ga]=el,Ca}),_r.grammar=Fs.languages.markup}}},tokenizePlaceholders:{value:function(_r,ha){if(_r.language!==ha||!_r.tokenStack)return;_r.grammar=Fs.languages[ha];var hs=0,Qs=Object.keys(_r.tokenStack);function zo(el){for(var ga=0;ga=Qs.length);ga++){var Ca=el[ga];if(typeof Ca=="string"||Ca.content&&typeof Ca.content=="string"){var za=Qs[hs],Il=_r.tokenStack[za],Zs=typeof Ca=="string"?Ca:Ca.content,Sr=Br(ha,za),Us=Zs.indexOf(Sr);if(Us>-1){++hs;var fs=Zs.substring(0,Us),dr=new Fs.Token(ha,Fs.tokenize(Il,_r.grammar),"language-"+ha,Il),Vr=Zs.substring(Us+Sr.length),nr=[];fs&&nr.push.apply(nr,zo([fs])),nr.push(dr),Vr&&nr.push.apply(nr,zo([Vr])),typeof Ca=="string"?el.splice.apply(el,[ga,1].concat(nr)):Ca.content=nr}}else Ca.content&&zo(Ca.content)}return el}zo(_r.tokens)}}})}(ws),ws.languages.c=ws.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),ws.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),ws.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},ws.languages.c.string],char:ws.languages.c.char,comment:ws.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:ws.languages.c}}}}),ws.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete ws.languages.c.boolean,function(Fs){var Br=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,_r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return Br.source});Fs.languages.cpp=Fs.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return Br.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:Br,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),Fs.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return _r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),Fs.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:Fs.languages.cpp}}}}),Fs.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),Fs.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:Fs.languages.extend("cpp",{})}}),Fs.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},Fs.languages.cpp["base-clause"])}(ws),function(Fs){function Br(Yl,rd){return Yl.replace(/<<(\d+)>>/g,function(Al,gd){return"(?:"+rd[+gd]+")"})}function _r(Yl,rd,Al){return RegExp(Br(Yl,rd),"")}function ha(Yl,rd){for(var Al=0;Al>/g,function(){return"(?:"+Yl+")"});return Yl.replace(/<>/g,"[^\\s\\S]")}var hs={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function Qs(Yl){return"\\b(?:"+Yl.trim().replace(/ /g,"|")+")\\b"}var zo=Qs(hs.typeDeclaration),el=RegExp(Qs(hs.type+" "+hs.typeDeclaration+" "+hs.contextual+" "+hs.other)),ga=Qs(hs.typeDeclaration+" "+hs.contextual+" "+hs.other),Ca=Qs(hs.type+" "+hs.typeDeclaration+" "+hs.other),za=ha(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),Il=ha(/\((?:[^()]|<>)*\)/.source,2),Zs=/@?\b[A-Za-z_]\w*\b/.source,Sr=Br(/<<0>>(?:\s*<<1>>)?/.source,[Zs,za]),Us=Br(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[ga,Sr]),fs=/\[\s*(?:,\s*)*\]/.source,dr=Br(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[Us,fs]),Vr=Br(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[za,Il,fs]),nr=Br(/\(<<0>>+(?:,<<0>>+)+\)/.source,[Vr]),Kr=Br(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[nr,Us,fs]),ra={keyword:el,punctuation:/[<>()?,.:[\]]/},Ml=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,xa=/"(?:\\.|[^\\"\r\n])*"/.source,Nl=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;Fs.languages.csharp=Fs.languages.extend("clike",{string:[{pattern:_r(/(^|[^$\\])<<0>>/.source,[Nl]),lookbehind:!0,greedy:!0},{pattern:_r(/(^|[^@$\\])<<0>>/.source,[xa]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:_r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[Us]),lookbehind:!0,inside:ra},{pattern:_r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[Zs,Kr]),lookbehind:!0,inside:ra},{pattern:_r(/(\busing\s+)<<0>>(?=\s*=)/.source,[Zs]),lookbehind:!0},{pattern:_r(/(\b<<0>>\s+)<<1>>/.source,[zo,Sr]),lookbehind:!0,inside:ra},{pattern:_r(/(\bcatch\s*\(\s*)<<0>>/.source,[Us]),lookbehind:!0,inside:ra},{pattern:_r(/(\bwhere\s+)<<0>>/.source,[Zs]),lookbehind:!0},{pattern:_r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[dr]),lookbehind:!0,inside:ra},{pattern:_r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[Kr,Ca,Zs]),inside:ra}],keyword:el,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),Fs.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),Fs.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:_r(/([(,]\s*)<<0>>(?=\s*:)/.source,[Zs]),lookbehind:!0,alias:"punctuation"}}),Fs.languages.insertBefore("csharp","class-name",{namespace:{pattern:_r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[Zs]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:_r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[Il]),lookbehind:!0,alias:"class-name",inside:ra},"return-type":{pattern:_r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[Kr,Us]),inside:ra,alias:"class-name"},"constructor-invocation":{pattern:_r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[Kr]),lookbehind:!0,inside:ra,alias:"class-name"},"generic-method":{pattern:_r(/<<0>>\s*<<1>>(?=\s*\()/.source,[Zs,za]),inside:{function:_r(/^<<0>>/.source,[Zs]),generic:{pattern:RegExp(za),alias:"class-name",inside:ra}}},"type-list":{pattern:_r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[zo,Sr,Zs,Kr,el.source,Il,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:_r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[Sr,Il]),lookbehind:!0,greedy:!0,inside:Fs.languages.csharp},keyword:el,"class-name":{pattern:RegExp(Kr),greedy:!0,inside:ra},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var Zc=xa+"|"+Ml,cc=Br(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[Zc]),gc=ha(Br(/[^"'/()]|<<0>>|\(<>*\)/.source,[cc]),2),nc=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,Ed=Br(/<<0>>(?:\s*\(<<1>>*\))?/.source,[Us,gc]);Fs.languages.insertBefore("csharp","class-name",{attribute:{pattern:_r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[nc,Ed]),lookbehind:!0,greedy:!0,inside:{target:{pattern:_r(/^<<0>>(?=\s*:)/.source,[nc]),alias:"keyword"},"attribute-arguments":{pattern:_r(/\(<<0>>*\)/.source,[gc]),inside:Fs.languages.csharp},"class-name":{pattern:RegExp(Us),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var Zl=/:[^}\r\n]+/.source,Vl=ha(Br(/[^"'/()]|<<0>>|\(<>*\)/.source,[cc]),2),Fc=Br(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Vl,Zl]),qa=ha(Br(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[Zc]),2),Ya=Br(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[qa,Zl]);function kc(Yl,rd){return{interpolation:{pattern:_r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[Yl]),lookbehind:!0,inside:{"format-string":{pattern:_r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[rd,Zl]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:Fs.languages.csharp}}},string:/[\s\S]+/}}Fs.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:_r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[Fc]),lookbehind:!0,greedy:!0,inside:kc(Fc,Vl)},{pattern:_r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[Ya]),lookbehind:!0,greedy:!0,inside:kc(Ya,qa)}],char:{pattern:RegExp(Ml),greedy:!0}}),Fs.languages.dotnet=Fs.languages.cs=Fs.languages.csharp}(ws),function(Fs){var Br=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;Fs.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+Br.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+Br.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+Br.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+Br.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:Br,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},Fs.languages.css.atrule.inside.rest=Fs.languages.css;var _r=Fs.languages.markup;_r&&(_r.tag.addInlined("style","css"),_r.tag.addAttribute("style","css"))}(ws),function(Fs){var Br=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,_r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,ha={pattern:RegExp(/(^|[^\w.])/.source+_r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};Fs.languages.java=Fs.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[ha,{pattern:RegExp(/(^|[^\w.])/.source+_r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:ha.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+_r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:ha.inside}],keyword:Br,function:[Fs.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),Fs.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),Fs.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":ha,keyword:Br,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+_r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:ha.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+_r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:ha.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return Br.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(ws),ws.languages.javascript=ws.languages.extend("clike",{"class-name":[ws.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),ws.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,ws.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:ws.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:ws.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:ws.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:ws.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:ws.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),ws.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:ws.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),ws.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),ws.languages.markup&&(ws.languages.markup.tag.addInlined("script","javascript"),ws.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),ws.languages.js=ws.languages.javascript,ws.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},ws.languages.markup.tag.inside["attr-value"].inside.entity=ws.languages.markup.entity,ws.languages.markup.doctype.inside["internal-subset"].inside=ws.languages.markup,ws.hooks.add("wrap",function(Fs){Fs.type==="entity"&&(Fs.attributes.title=Fs.content.replace(/&/,"&"))}),Object.defineProperty(ws.languages.markup.tag,"addInlined",{value:function(Br,_r){var ha={};ha["language-"+_r]={pattern:/(^$)/i,lookbehind:!0,inside:ws.languages[_r]},ha.cdata=/^$/i;var hs={"included-cdata":{pattern://i,inside:ha}};hs["language-"+_r]={pattern:/[\s\S]+/,inside:ws.languages[_r]};var Qs={};Qs[Br]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return Br}),"i"),lookbehind:!0,greedy:!0,inside:hs},ws.languages.insertBefore("markup","cdata",Qs)}}),Object.defineProperty(ws.languages.markup.tag,"addAttribute",{value:function(Fs,Br){ws.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+Fs+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[Br,"language-"+Br],inside:ws.languages[Br]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),ws.languages.html=ws.languages.markup,ws.languages.mathml=ws.languages.markup,ws.languages.svg=ws.languages.markup,ws.languages.xml=ws.languages.extend("markup",{}),ws.languages.ssml=ws.languages.xml,ws.languages.atom=ws.languages.xml,ws.languages.rss=ws.languages.xml,function(Fs){var Br=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,_r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],ha=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,hs=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,Qs=/[{}\[\](),:;]/;Fs.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:Br,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:_r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:ha,operator:hs,punctuation:Qs};var zo={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:Fs.languages.php},el=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:zo}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:zo}}];Fs.languages.insertBefore("php","variable",{string:el,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:Br,string:el,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:_r,number:ha,operator:hs,punctuation:Qs}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),Fs.hooks.add("before-tokenize",function(ga){if(/<\?/.test(ga.code)){var Ca=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;Fs.languages["markup-templating"].buildPlaceholders(ga,"php",Ca)}}),Fs.hooks.add("after-tokenize",function(ga){Fs.languages["markup-templating"].tokenizePlaceholders(ga,"php")})}(ws),ws.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},ws.languages.python["string-interpolation"].inside.interpolation.inside.rest=ws.languages.python,ws.languages.py=ws.languages.python,function(Fs){Fs.languages.ruby=Fs.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),Fs.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var Br={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:Fs.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete Fs.languages.ruby.function;var _r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",ha=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;Fs.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+_r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:Br,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:Br,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+ha),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+ha+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),Fs.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+_r),greedy:!0,inside:{interpolation:Br,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:Br,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:Br,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+_r),greedy:!0,inside:{interpolation:Br,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:Br,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete Fs.languages.ruby.string,Fs.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),Fs.languages.rb=Fs.languages.ruby}(ws),window.Prism=Qr,ws}(),io=ko=>gs=>gs.options.get(ko),uo=ko=>{const gs=ko.options.register;gs("codesample_languages",{processor:"object[]"}),gs("codesample_global_prismjs",{processor:"boolean",default:!1})},ho=io("codesample_languages"),bo=io("codesample_global_prismjs"),Oo=ko=>Kn.Prism&&bo(ko)?Kn.Prism:to,So=ko=>ke(ko)&&ko.nodeName==="PRE"&&ko.className.indexOf("language-")!==-1,$o=ko=>{const gs=ko.selection?ko.selection.getNode():null;return So(gs)?zn.some(gs):zn.none()},Do=(ko,gs,xs)=>{const Qr=ko.dom;ko.undoManager.transact(()=>{const cr=$o(ko);return xs=Xn.DOM.encode(xs),cr.fold(()=>{ko.insertContent('
    '+xs+"
    ");const ws=Qr.select("#__new")[0];Qr.setAttrib(ws,"id",null),ko.selection.select(ws)},ws=>{Qr.setAttrib(ws,"class","language-"+gs),ws.innerHTML=xs,Oo(ko).highlightElement(ws),ko.selection.select(ws)})})},xo=ko=>$o(ko).bind(xs=>zn.from(xs.textContent)).getOr(""),Io=ko=>{const gs=[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}],xs=ho(ko);return xs||gs},Vo=(ko,gs)=>$o(ko).fold(()=>gs,Qr=>{const cr=Qr.className.match(/language-(\w+)/);return cr?cr[1]:gs}),Jo=ko=>{const gs=Io(ko),xs=qn(gs).fold(Hn(""),ws=>ws.value),Qr=Vo(ko,xs),cr=xo(ko);ko.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"listbox",name:"language",label:"Language",items:gs},{type:"textarea",name:"code",label:"Code view"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:Qr,code:cr},onSubmit:ws=>{const Fs=ws.getData();Do(ko,Fs.language,Fs.code),ws.close()}})},Mo=ko=>{ko.addCommand("codesample",()=>{const gs=ko.selection.getNode();ko.selection.isCollapsed()||So(gs)?Jo(ko):ko.formatter.toggle("code")})},os=(ko=>gs=>gs.replace(ko,""))(/^\s+|\s+$/g);var ms=tinymce.util.Tools.resolve("tinymce.util.Tools");const is=ko=>{ko.on("PreProcess",gs=>{const xs=ko.dom,Qr=xs.select("pre[contenteditable=false]",gs.node);ms.each(ms.grep(Qr,So),cr=>{const ws=cr.textContent;xs.setAttrib(cr,"class",os(xs.getAttrib(cr,"class"))),xs.setAttrib(cr,"contentEditable",null),xs.setAttrib(cr,"data-mce-highlighted",null);let Fs;for(;Fs=cr.firstChild;)cr.removeChild(Fs);const Br=xs.add(cr,"code");Br.textContent=ws})}),ko.on("SetContent",()=>{const gs=ko.dom,xs=ms.grep(gs.select("pre"),Qr=>So(Qr)&&gs.getAttrib(Qr,"data-mce-highlighted")!=="true");xs.length&&ko.undoManager.transact(()=>{ms.each(xs,Qr=>{var cr;ms.each(gs.select("br",Qr),ws=>{gs.replace(ko.getDoc().createTextNode(` +`),ws)}),Qr.innerHTML=gs.encode((cr=Qr.textContent)!==null&&cr!==void 0?cr:""),Oo(ko).highlightElement(Qr),gs.setAttrib(Qr,"data-mce-highlighted",!0),Qr.className=os(Qr.className)})})}),ko.on("PreInit",()=>{ko.parser.addNodeFilter("pre",gs=>{var xs;for(let Qr=0,cr=gs.length;Qrxs=>{const Qr=()=>{xs.setEnabled(ko.selection.isEditable()),gs(xs)};return ko.on("NodeChange",Qr),Qr(),()=>{ko.off("NodeChange",Qr)}},Ys=ko=>{const gs=ko.selection.getStart();return ko.dom.is(gs,'pre[class*="language-"]')},sr=ko=>{const gs=()=>ko.execCommand("codesample");ko.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:gs,onSetup:Yo(ko,xs=>{xs.setActive(Ys(ko))})}),ko.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:gs,onSetup:Yo(ko)})};var Js=()=>{_n.add("codesample",ko=>{uo(ko),is(ko),sr(ko),Mo(ko),ko.on("dblclick",gs=>{So(gs.target)&&Jo(ko)})})};Js()})();(function(){var _n=tinymce.util.Tools.resolve("tinymce.PluginManager");const Ce=(Ts,ks,ir)=>{var br;return ir(Ts,ks.prototype)?!0:((br=Ts.constructor)===null||br===void 0?void 0:br.name)===ks.name},ke=Ts=>{const ks=typeof Ts;return Ts===null?"null":ks==="object"&&Array.isArray(Ts)?"array":ks==="object"&&Ce(Ts,String,(ir,br)=>br.isPrototypeOf(ir))?"string":ks},$n=Ts=>ks=>ke(ks)===Ts,Hn=$n("string"),zn=$n("object"),Un=$n("array"),qn=Ts=>Ts==null,Xn=Ts=>!qn(Ts);class Kn{constructor(ks,ir){this.tag=ks,this.value=ir}static some(ks){return new Kn(!0,ks)}static none(){return Kn.singletonNone}fold(ks,ir){return this.tag?ir(this.value):ks()}isSome(){return this.tag}isNone(){return!this.tag}map(ks){return this.tag?Kn.some(ks(this.value)):Kn.none()}bind(ks){return this.tag?ks(this.value):Kn.none()}exists(ks){return this.tag&&ks(this.value)}forall(ks){return!this.tag||ks(this.value)}filter(ks){return!this.tag||ks(this.value)?this:Kn.none()}getOr(ks){return this.tag?this.value:ks}or(ks){return this.tag?this:ks}getOrThunk(ks){return this.tag?this.value:ks()}orThunk(ks){return this.tag?this:ks()}getOrDie(ks){if(this.tag)return this.value;throw new Error(ks??"Called getOrDie on None")}static from(ks){return Xn(ks)?Kn.some(ks):Kn.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(ks){this.tag&&ks(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Kn.singletonNone=new Kn(!1);const to=Array.prototype.push,io=(Ts,ks)=>{for(let ir=0,br=Ts.length;ir{const ks=[];for(let ir=0,br=Ts.length;ir{let ks=Ts;return{get:()=>ks,set:Aa=>{ks=Aa}}},bo=Object.keys,Oo=Object.hasOwnProperty,So=(Ts,ks)=>{const ir=bo(Ts);for(let br=0,Aa=ir.length;brDo(Ts,ks)?Kn.from(Ts[ks]):Kn.none(),Do=(Ts,ks)=>Oo.call(Ts,ks),xo=Ts=>ks=>ks.options.get(Ts),Io=Ts=>{const ks=Ts.options.register;ks("audio_template_callback",{processor:"function"}),ks("video_template_callback",{processor:"function"}),ks("iframe_template_callback",{processor:"function"}),ks("media_live_embeds",{processor:"boolean",default:!0}),ks("media_filter_html",{processor:"boolean",default:!0}),ks("media_url_resolver",{processor:"function"}),ks("media_alt_source",{processor:"boolean",default:!0}),ks("media_poster",{processor:"boolean",default:!0}),ks("media_dimensions",{processor:"boolean",default:!0})},Vo=xo("audio_template_callback"),Jo=xo("video_template_callback"),Mo=xo("iframe_template_callback"),Go=xo("media_live_embeds"),os=xo("media_filter_html"),ms=xo("media_url_resolver"),is=xo("media_alt_source"),Yo=xo("media_poster"),Ys=xo("media_dimensions");var sr=tinymce.util.Tools.resolve("tinymce.util.Tools"),Js=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),ko=tinymce.util.Tools.resolve("tinymce.html.DomParser");const gs=Js.DOM,xs=Ts=>Ts.replace(/px$/,""),Qr=Ts=>{const ks=Ts.attr("style"),ir=ks?gs.parseStyle(ks):{};return{type:"ephox-embed-iri",source:Ts.attr("data-ephox-embed-iri"),altsource:"",poster:"",width:$o(ir,"max-width").map(xs).getOr(""),height:$o(ir,"max-height").map(xs).getOr("")}},cr=(Ts,ks)=>{let ir={};const Aa=ko({validate:!1,forced_root_block:!1},ks).parse(Ts);for(let Ba=Aa;Ba;Ba=Ba.walk())if(Ba.type===1){const _l=Ba.name;if(Ba.attr("data-ephox-embed-iri")){ir=Qr(Ba);break}else!ir.source&&_l==="param"&&(ir.source=Ba.attr("movie")),(_l==="iframe"||_l==="object"||_l==="embed"||_l==="video"||_l==="audio")&&(ir.type||(ir.type=_l),ir=sr.extend(Ba.attributes.map,ir)),_l==="source"&&(ir.source?ir.altsource||(ir.altsource=Ba.attr("src")):ir.source=Ba.attr("src")),_l==="img"&&!ir.poster&&(ir.poster=Ba.attr("src"))}return ir.source=ir.source||ir.src||"",ir.altsource=ir.altsource||"",ir.poster=ir.poster||"",ir},ws=Ts=>{var ks;const ir={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},br=(ks=Ts.toLowerCase().split(".").pop())!==null&&ks!==void 0?ks:"";return $o(ir,br).getOr("")};var Fs=tinymce.util.Tools.resolve("tinymce.html.Node"),Br=tinymce.util.Tools.resolve("tinymce.html.Serializer");const _r=(Ts,ks={})=>ko({forced_root_block:!1,validate:!1,allow_conditional_comments:!0,...ks},Ts),ha=Js.DOM,hs=Ts=>/^[0-9.]+$/.test(Ts)?Ts+"px":Ts,Qs=(Ts,ks)=>{const ir=ks.attr("style"),br=ir?ha.parseStyle(ir):{};Xn(Ts.width)&&(br["max-width"]=hs(Ts.width)),Xn(Ts.height)&&(br["max-height"]=hs(Ts.height)),ks.attr("style",ha.serializeStyle(br))},zo=["source","altsource"],el=(Ts,ks,ir,br)=>{let Aa=0,Ba=0;const _l=_r(br);_l.addNodeFilter("source",Ds=>Aa=Ds.length);const Hc=_l.parse(Ts);for(let Ds=Hc;Ds;Ds=Ds.walk())if(Ds.type===1){const tl=Ds.name;if(Ds.attr("data-ephox-embed-iri")){Qs(ks,Ds);break}else{switch(tl){case"video":case"object":case"embed":case"img":case"iframe":ks.height!==void 0&&ks.width!==void 0&&(Ds.attr("width",ks.width),Ds.attr("height",ks.height));break}if(ir)switch(tl){case"video":Ds.attr("poster",ks.poster),Ds.attr("src",null);for(let qu=Aa;qu<2;qu++)if(ks[zo[qu]]){const Md=new Fs("source",1);Md.attr("src",ks[zo[qu]]),Md.attr("type",ks[zo[qu]+"mime"]||null),Ds.append(Md)}break;case"iframe":Ds.attr("src",ks.source);break;case"object":const wu=Ds.getAll("img").length>0;if(ks.poster&&!wu){Ds.attr("src",ks.poster);const qu=new Fs("img",1);qu.attr("src",ks.poster),qu.attr("width",ks.width),qu.attr("height",ks.height),Ds.append(qu)}break;case"source":if(Ba<2&&(Ds.attr("src",ks[zo[Ba]]),Ds.attr("type",ks[zo[Ba]+"mime"]||null),!ks[zo[Ba]])){Ds.remove();continue}Ba++;break;case"img":ks.poster||Ds.remove();break}}}return Br({},br).serialize(Hc)},ga=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?h=$2&title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?h=$3&title=0&byline=0",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],Ca=Ts=>{const ks=Ts.match(/^(https?:\/\/|www\.)(.+)$/i);return ks&&ks.length>1?ks[1]==="www."?"https://":ks[1]:"https://"},za=(Ts,ks)=>{const ir=Ca(ks),br=Ts.regex.exec(ks);let Aa=ir+Ts.url;if(Xn(br))for(let Ba=0;Babr[Ba]?br[Ba]:"");return Aa.replace(/\?$/,"")},Il=Ts=>{const ks=ga.filter(ir=>ir.regex.test(Ts));return ks.length>0?sr.extend({},ks[0],{url:za(ks[0],Ts)}):null},Zs=(Ts,ks)=>{if(ks)return ks(Ts);{const ir=Ts.allowfullscreen?' allowFullscreen="1"':"";return'"}},Sr=Ts=>{let ks='';return Ts.poster&&(ks+=''),ks+="",ks},Us=(Ts,ks)=>ks?ks(Ts):'",fs=(Ts,ks)=>ks?ks(Ts):'",dr=(Ts,ks)=>{var ir;const br=sr.extend({},ks);if(!br.source&&(sr.extend(br,cr((ir=br.embed)!==null&&ir!==void 0?ir:"",Ts.schema)),!br.source))return"";br.altsource||(br.altsource=""),br.poster||(br.poster=""),br.source=Ts.convertURL(br.source,"source"),br.altsource=Ts.convertURL(br.altsource,"source"),br.sourcemime=ws(br.source),br.altsourcemime=ws(br.altsource),br.poster=Ts.convertURL(br.poster,"poster");const Aa=Il(br.source);if(Aa&&(br.source=Aa.url,br.type=Aa.type,br.allowfullscreen=Aa.allowFullscreen,br.width=br.width||String(Aa.w),br.height=br.height||String(Aa.h)),br.embed)return el(br.embed,br,!0,Ts.schema);{const Ba=Vo(Ts),_l=Jo(Ts),Hc=Mo(Ts);return br.width=br.width||"300",br.height=br.height||"150",sr.each(br,(Ds,tl)=>{br[tl]=Ts.dom.encode(""+Ds)}),br.type==="iframe"?Zs(br,Hc):br.sourcemime==="application/x-shockwave-flash"?Sr(br):br.sourcemime.indexOf("audio")!==-1?Us(br,Ba):fs(br,_l)}},Vr=Ts=>Ts.hasAttribute("data-mce-object")||Ts.hasAttribute("data-ephox-embed-iri"),nr=Ts=>{Ts.on("click keyup touchend",()=>{const ks=Ts.selection.getNode();ks&&Ts.dom.hasClass(ks,"mce-preview-object")&&Ts.dom.getAttrib(ks,"data-mce-selected")&&ks.setAttribute("data-mce-selected","2")}),Ts.on("ObjectResized",ks=>{const ir=ks.target;if(ir.getAttribute("data-mce-object")){let br=ir.getAttribute("data-mce-html");br&&(br=unescape(br),ir.setAttribute("data-mce-html",escape(el(br,{width:String(ks.width),height:String(ks.height)},!1,Ts.schema))))}})},Kr={},ra=(Ts,ks,ir)=>new Promise((br,Aa)=>{const Ba=_l=>(_l.html&&(Kr[Ts.source]=_l),br({url:Ts.source,html:_l.html?_l.html:ks(Ts)}));Kr[Ts.source]?Ba(Kr[Ts.source]):ir({url:Ts.source},Ba,Aa)}),Ml=(Ts,ks)=>Promise.resolve({html:ks(Ts),url:Ts.source}),xa=Ts=>ks=>dr(Ts,ks),Nl=(Ts,ks)=>{const ir=ms(Ts);return ir?ra(ks,xa(Ts),ir):Ml(ks,xa(Ts))},Zc=Ts=>Do(Kr,Ts),cc=(Ts,ks)=>$o(ks,Ts).bind(ir=>$o(ir,"meta")),gc=(Ts,ks,ir)=>br=>{const Aa=()=>$o(Ts,br),Ba=()=>$o(ks,br),_l=tl=>$o(tl,"value").bind(wu=>wu.length>0?Kn.some(wu):Kn.none()),Hc=()=>Aa().bind(tl=>zn(tl)?_l(tl).orThunk(Ba):Ba().orThunk(()=>Kn.from(tl))),Ds=()=>Ba().orThunk(()=>Aa().bind(tl=>zn(tl)?_l(tl):Kn.from(tl)));return{[br]:(br===ir?Hc():Ds()).getOr("")}},nc=(Ts,ks)=>{const ir={};return $o(Ts,"dimensions").each(br=>{io(["width","height"],Aa=>{$o(ks,Aa).orThunk(()=>$o(br,Aa)).each(Ba=>ir[Aa]=Ba)})}),ir},Ed=(Ts,ks)=>{const ir=ks&&ks!=="dimensions"?cc(ks,Ts).getOr({}):{},br=gc(Ts,ir,ks);return{...br("source"),...br("altsource"),...br("poster"),...br("embed"),...nc(Ts,ir)}},Zl=Ts=>{const ks={...Ts,source:{value:$o(Ts,"source").getOr("")},altsource:{value:$o(Ts,"altsource").getOr("")},poster:{value:$o(Ts,"poster").getOr("")}};return io(["width","height"],ir=>{$o(Ts,ir).each(br=>{const Aa=ks.dimensions||{};Aa[ir]=br,ks.dimensions=Aa})}),ks},Vl=Ts=>ks=>{const ir=ks&&ks.msg?"Media embed handler error: "+ks.msg:"Media embed handler threw unknown error.";Ts.notificationManager.open({type:"error",text:ir})},Fc=Ts=>{const ks=Ts.selection.getNode(),ir=Vr(ks)?Ts.serializer.serialize(ks,{selection:!0}):"",br=cr(ir,Ts.schema),Ba=(()=>{if(Yl(br.source,br.type)){const _l=Ts.dom.getRect(ks);return{width:_l.w.toString().replace(/px$/,""),height:_l.h.toString().replace(/px$/,"")}}else return{}})();return{embed:ir,...br,...Ba}},qa=(Ts,ks)=>ir=>{if(Hn(ir.url)&&ir.url.trim().length>0){const br=ir.html,Ba={...cr(br,ks.schema),source:ir.url,embed:br};Ts.setData(Zl(Ba))}},Ya=(Ts,ks)=>{const ir=Ts.dom.select("*[data-mce-object]");for(let br=0;br=0;Aa--)ks[br]===ir[Aa]&&ir.splice(Aa,1);Ts.selection.select(ir[0])},kc=(Ts,ks)=>{const ir=Ts.dom.select("*[data-mce-object]");Ts.insertContent(ks),Ya(Ts,ir),Ts.nodeChanged()},Yl=(Ts,ks)=>Xn(ks)&&ks==="ephox-embed-iri"&&Xn(Il(Ts)),rd=(Ts,ks)=>((br,Aa)=>br.width!==Aa.width||br.height!==Aa.height)(Ts,ks)&&Yl(ks.source,Ts.type),Al=(Ts,ks,ir)=>{var br;ks.embed=rd(Ts,ks)&&Ys(ir)?dr(ir,{...ks,embed:""}):el((br=ks.embed)!==null&&br!==void 0?br:"",ks,!1,ir.schema),ks.embed&&(Ts.source===ks.source||Zc(ks.source))?kc(ir,ks.embed):Nl(ir,ks).then(Aa=>{kc(ir,Aa.html)}).catch(Vl(ir))},gd=Ts=>{const ks=Fc(Ts),ir=ho(ks),br=Zl(ks),Aa=(ld,oc)=>{const Dc=Ed(oc.getData(),"source");ld.source!==Dc.source&&(qa(Ud,Ts)({url:Dc.source,html:""}),Nl(Ts,Dc).then(qa(Ud,Ts)).catch(Vl(Ts)))},Ba=ld=>{var oc;const Dc=Ed(ld.getData()),bd=cr((oc=Dc.embed)!==null&&oc!==void 0?oc:"",Ts.schema);ld.setData(Zl(bd))},_l=(ld,oc,Dc)=>{const bd=Ed(ld.getData(),oc),Nd=rd(Dc,bd)&&Ys(Ts)?{...bd,embed:""}:bd,ih=dr(Ts,Nd);ld.setData(Zl({...Nd,embed:ih}))},Hc=[{name:"source",type:"urlinput",filetype:"media",label:"Source",picker_text:"Browse files"}],Ds=Ys(Ts)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],tl={title:"General",name:"general",items:uo([Hc,Ds])},qu={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},Md=[];is(Ts)&&Md.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),Yo(Ts)&&Md.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});const bc={title:"Advanced",name:"advanced",items:Md},nm=[tl,qu];Md.length>0&&nm.push(bc);const Ff={type:"tabpanel",tabs:nm},Ud=Ts.windowManager.open({title:"Insert/Edit Media",size:"normal",body:Ff,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:ld=>{const oc=Ed(ld.getData());Al(ir.get(),oc,Ts),ld.close()},onChange:(ld,oc)=>{switch(oc.name){case"source":Aa(ir.get(),ld);break;case"embed":Ba(ld);break;case"dimensions":case"altsource":case"poster":_l(ld,oc.name,ir.get());break}ir.set(Ed(ld.getData()))},initialData:br})},Rr=Ts=>({showDialog:()=>{gd(Ts)}}),Pl=Ts=>{const ks=()=>{gd(Ts)};Ts.addCommand("mceMedia",ks)},Su=(Ts,ks,ir)=>Ts.length>=ks.length&&Ts.substr(ir,ir+ks.length)===ks,vs=(Ts,ks)=>Su(Ts,ks,0);var Es=tinymce.util.Tools.resolve("tinymce.Env");const Ks=Ts=>{const ks=Ts.name;return ks==="iframe"||ks==="video"||ks==="audio"},pr=(Ts,ks,ir,br=null)=>{const Aa=Ts.attr(ir);return Xn(Aa)?Aa:Do(ks,ir)?null:br},ia=(Ts,ks,ir)=>{const br=ks.name==="img"||Ts.name==="video",Aa=br?"300":null,Ba=Ts.name==="audio"?"30":"150",_l=br?Ba:null;ks.attr({width:pr(Ts,ir,"width",Aa),height:pr(Ts,ir,"height",_l)})},ka=(Ts,ks,ir,br)=>{const Aa=_r(Ts.schema).parse(br,{context:ks});for(;Aa.firstChild;)ir.append(Aa.firstChild)},Ma=(Ts,ks)=>{const ir=ks.name,br=new Fs("img",1);return il(Ts,ks,br),ia(ks,br,{}),br.attr({style:ks.attr("style"),src:Es.transparentSrc,"data-mce-object":ir,class:"mce-object mce-object-"+ir}),br},Mr=(Ts,ks)=>{var ir;const br=ks.name,Aa=new Fs("span",1);Aa.attr({contentEditable:"false",style:ks.attr("style"),"data-mce-object":br,class:"mce-preview-object mce-object-"+br}),il(Ts,ks,Aa);const Ba=Ts.dom.parseStyle((ir=ks.attr("style"))!==null&&ir!==void 0?ir:""),_l=new Fs(br,1);if(ia(ks,_l,Ba),_l.attr({src:ks.attr("src"),style:ks.attr("style"),class:ks.attr("class")}),br==="iframe")_l.attr({allowfullscreen:ks.attr("allowfullscreen"),frameborder:"0",sandbox:ks.attr("sandbox")});else{io(["controls","crossorigin","currentTime","loop","muted","poster","preload"],wu=>{_l.attr(wu,ks.attr(wu))});const tl=Aa.attr("data-mce-html");Xn(tl)&&ka(Ts,br,_l,unescape(tl))}const Hc=new Fs("span",1);return Hc.attr("class","mce-shim"),Aa.append(_l),Aa.append(Hc),Aa},il=(Ts,ks,ir)=>{var br;const Aa=(br=ks.attributes)!==null&&br!==void 0?br:[];let Ba=Aa.length;for(;Ba--;){const tl=Aa[Ba].name;let wu=Aa[Ba].value;tl!=="width"&&tl!=="height"&&tl!=="style"&&!vs(tl,"data-mce-")&&((tl==="data"||tl==="src")&&(wu=Ts.convertURL(wu,tl)),ir.attr("data-mce-p-"+tl,wu))}const _l=Br({inner:!0},Ts.schema),Hc=new Fs("div",1);io(ks.children(),tl=>Hc.append(tl));const Ds=_l.serialize(Hc);Ds&&(ir.attr("data-mce-html",escape(Ds)),ir.empty())},Na=Ts=>{const ks=Ts.attr("class");return Hn(ks)&&/\btiny-pageembed\b/.test(ks)},vl=Ts=>{let ks=Ts;for(;ks=ks.parent;)if(ks.attr("data-ephox-embed-iri")||Na(ks))return!0;return!1},Rc=Ts=>ks=>{let ir=ks.length,br;for(;ir--;)br=ks[ir],br.parent&&(br.parent.attr("data-mce-object")||(Ks(br)&&Go(Ts)?vl(br)||br.replace(Mr(Ts,br)):vl(br)||br.replace(Ma(Ts,br))))},Vc=(Ts,ks,ir)=>{const br=Ts.options.get,Aa=br("xss_sanitization"),Ba=os(Ts);return _r(Ts.schema,{sanitize:Aa,validate:Ba}).parse(ir,{context:ks})},xc=Ts=>{Ts.on("PreInit",()=>{const{schema:ks,serializer:ir,parser:br}=Ts,Aa=ks.getBoolAttrs();io("webkitallowfullscreen mozallowfullscreen".split(" "),Ba=>{Aa[Ba]={}}),So({embed:["wmode"]},(Ba,_l)=>{const Hc=ks.getElementRule(_l);Hc&&io(Ba,Ds=>{Hc.attributes[Ds]={},Hc.attributesOrder.push(Ds)})}),br.addNodeFilter("iframe,video,audio,object,embed",Rc(Ts)),ir.addAttributeFilter("data-mce-object",(Ba,_l)=>{var Hc;let Ds=Ba.length;for(;Ds--;){const tl=Ba[Ds];if(!tl.parent)continue;const wu=tl.attr(_l),qu=new Fs(wu,1);if(wu!=="audio"){const Ff=tl.attr("class");Ff&&Ff.indexOf("mce-preview-object")!==-1&&tl.firstChild?qu.attr({width:tl.firstChild.attr("width"),height:tl.firstChild.attr("height")}):qu.attr({width:tl.attr("width"),height:tl.attr("height")})}qu.attr({style:tl.attr("style")});const Md=(Hc=tl.attributes)!==null&&Hc!==void 0?Hc:[];let bc=Md.length;for(;bc--;){const Ff=Md[bc].name;Ff.indexOf("data-mce-p-")===0&&qu.attr(Ff.substr(11),Md[bc].value)}const nm=tl.attr("data-mce-html");if(nm){const Ff=Vc(Ts,wu,unescape(nm));io(Ff.children(),Ud=>qu.append(Ud))}tl.replace(qu)}})}),Ts.on("SetContent",()=>{const ks=Ts.dom;io(ks.select("span.mce-preview-object"),ir=>{ks.select("span.mce-shim",ir).length===0&&ks.add(ir,"span",{class:"mce-shim"})})})},zc=Ts=>{Ts.on("ResolveName",ks=>{let ir;ks.target.nodeType===1&&(ir=ks.target.getAttribute("data-mce-object"))&&(ks.name=ir)})},ad=Ts=>ks=>{const ir=()=>{ks.setEnabled(Ts.selection.isEditable())};return Ts.on("NodeChange",ir),ir(),()=>{Ts.off("NodeChange",ir)}},Bh=Ts=>{const ks=()=>Ts.execCommand("mceMedia");Ts.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:ks,onSetup:ir=>{const br=Ts.selection;ir.setActive(Vr(br.getNode()));const Aa=br.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",ir.setActive).unbind,Ba=ad(Ts)(ir);return()=>{Aa(),Ba()}}}),Ts.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:ks,onSetup:ad(Ts)})};var Vu=()=>{_n.add("media",Ts=>(Io(Ts),Pl(Ts),Bh(Ts),zc(Ts),xc(Ts),nr(Ts),Rr(Ts)))};Vu()})();(function(){var _n=tinymce.util.Tools.resolve("tinymce.PluginManager");const Ce=(Eo,Bo,Ko)=>{var Ss;return Ko(Eo,Bo.prototype)?!0:((Ss=Eo.constructor)===null||Ss===void 0?void 0:Ss.name)===Bo.name},ke=Eo=>{const Bo=typeof Eo;return Eo===null?"null":Bo==="object"&&Array.isArray(Eo)?"array":Bo==="object"&&Ce(Eo,String,(Ko,Ss)=>Ss.isPrototypeOf(Ko))?"string":Bo},$n=Eo=>Bo=>ke(Bo)===Eo,Hn=Eo=>Bo=>typeof Bo===Eo,zn=$n("string"),Un=$n("object"),qn=$n("array"),Xn=Hn("boolean"),Kn=Eo=>Eo==null,to=Eo=>!Kn(Eo),io=Hn("function"),uo=Hn("number"),ho=()=>{},bo=(Eo,Bo)=>Ko=>Eo(Bo(Ko)),Oo=Eo=>()=>Eo,So=(Eo,Bo)=>Eo===Bo;function $o(Eo,...Bo){return(...Ko)=>{const Ss=Bo.concat(Ko);return Eo.apply(null,Ss)}}const Do=Eo=>Bo=>!Eo(Bo),xo=Oo(!1);class Io{constructor(Bo,Ko){this.tag=Bo,this.value=Ko}static some(Bo){return new Io(!0,Bo)}static none(){return Io.singletonNone}fold(Bo,Ko){return this.tag?Ko(this.value):Bo()}isSome(){return this.tag}isNone(){return!this.tag}map(Bo){return this.tag?Io.some(Bo(this.value)):Io.none()}bind(Bo){return this.tag?Bo(this.value):Io.none()}exists(Bo){return this.tag&&Bo(this.value)}forall(Bo){return!this.tag||Bo(this.value)}filter(Bo){return!this.tag||Bo(this.value)?this:Io.none()}getOr(Bo){return this.tag?this.value:Bo}or(Bo){return this.tag?this:Bo}getOrThunk(Bo){return this.tag?this.value:Bo()}orThunk(Bo){return this.tag?this:Bo()}getOrDie(Bo){if(this.tag)return this.value;throw new Error(Bo??"Called getOrDie on None")}static from(Bo){return to(Bo)?Io.some(Bo):Io.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Bo){this.tag&&Bo(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Io.singletonNone=new Io(!1);const Vo=Array.prototype.slice,Jo=Array.prototype.indexOf,Mo=Array.prototype.push,Go=(Eo,Bo)=>Jo.call(Eo,Bo),os=(Eo,Bo)=>Go(Eo,Bo)>-1,ms=(Eo,Bo)=>{for(let Ko=0,Ss=Eo.length;Ko{const Ko=Eo.length,Ss=new Array(Ko);for(let Rs=0;Rs{for(let Ko=0,Ss=Eo.length;Ko{const Ko=[];for(let Ss=0,Rs=Eo.length;Ss{if(Eo.length===0)return[];{let Ko=Bo(Eo[0]);const Ss=[];let Rs=[];for(let $r=0,Ea=Eo.length;$r(Yo(Eo,(Ss,Rs)=>{Ko=Bo(Ko,Ss,Rs)}),Ko),ko=(Eo,Bo,Ko)=>{for(let Ss=0,Rs=Eo.length;Ssko(Eo,Bo,xo),xs=Eo=>{const Bo=[];for(let Ko=0,Ss=Eo.length;Koxs(is(Eo,Bo)),cr=Eo=>{const Bo=Vo.call(Eo,0);return Bo.reverse(),Bo},ws=(Eo,Bo)=>Bo>=0&&Bows(Eo,0),Br=Eo=>ws(Eo,Eo.length-1),_r=(Eo,Bo)=>{const Ko=[],Ss=io(Bo)?Rs=>ms(Ko,$r=>Bo($r,Rs)):Rs=>os(Ko,Rs);for(let Rs=0,$r=Eo.length;Rs<$r;Rs++){const Ea=Eo[Rs];Ss(Ea)||Ko.push(Ea)}return Ko},ha=(Eo,Bo,Ko=So)=>Eo.exists(Ss=>Ko(Ss,Bo)),hs=(Eo,Bo,Ko=So)=>Qs(Eo,Bo,Ko).getOr(Eo.isNone()&&Bo.isNone()),Qs=(Eo,Bo,Ko)=>Eo.isSome()&&Bo.isSome()?Io.some(Ko(Eo.getOrDie(),Bo.getOrDie())):Io.none(),zo=8,el=9,ga=11,Ca=1,za=3,Il=(Eo,Bo)=>{const Ss=(Bo||document).createElement("div");if(Ss.innerHTML=Eo,!Ss.hasChildNodes()||Ss.childNodes.length>1){const Rs="HTML does not have a single root node";throw console.error(Rs,Eo),new Error(Rs)}return Us(Ss.childNodes[0])},Zs=(Eo,Bo)=>{const Ss=(Bo||document).createElement(Eo);return Us(Ss)},Sr=(Eo,Bo)=>{const Ss=(Bo||document).createTextNode(Eo);return Us(Ss)},Us=Eo=>{if(Eo==null)throw new Error("Node cannot be null or undefined");return{dom:Eo}},dr={fromHtml:Il,fromTag:Zs,fromText:Sr,fromDom:Us,fromPoint:(Eo,Bo,Ko)=>Io.from(Eo.dom.elementFromPoint(Bo,Ko)).map(Us)},Vr=(Eo,Bo)=>{const Ko=Eo.dom;if(Ko.nodeType!==Ca)return!1;{const Ss=Ko;if(Ss.matches!==void 0)return Ss.matches(Bo);if(Ss.msMatchesSelector!==void 0)return Ss.msMatchesSelector(Bo);if(Ss.webkitMatchesSelector!==void 0)return Ss.webkitMatchesSelector(Bo);if(Ss.mozMatchesSelector!==void 0)return Ss.mozMatchesSelector(Bo);throw new Error("Browser lacks native selectors")}},nr=(Eo,Bo)=>Eo.dom===Bo.dom,Kr=(Eo,Bo)=>{const Ko=Eo.dom,Ss=Bo.dom;return Ko===Ss?!1:Ko.contains(Ss)},ra=Vr,Ml=typeof window<"u"?window:Function("return this;")(),xa=(Eo,Bo)=>{let Ko=Bo??Ml;for(let Ss=0;Ss{const Ko=Eo.split(".");return xa(Ko,Bo)},Zc=(Eo,Bo)=>Nl(Eo,Bo),cc=(Eo,Bo)=>{const Ko=Zc(Eo,Bo);if(Ko==null)throw new Error(Eo+" not available on this browser");return Ko},gc=Object.getPrototypeOf,nc=Eo=>cc("HTMLElement",Eo),Ed=Eo=>{const Bo=Nl("ownerDocument.defaultView",Eo);return Un(Eo)&&(nc(Bo).prototype.isPrototypeOf(Eo)||/^HTML\w*Element$/.test(gc(Eo).constructor.name))},Zl=Eo=>Eo.dom.nodeName.toLowerCase(),Vl=Eo=>Eo.dom.nodeType,Fc=Eo=>Bo=>Vl(Bo)===Eo,qa=Eo=>Vl(Eo)===zo||Zl(Eo)==="#comment",Ya=Eo=>kc(Eo)&&Ed(Eo.dom),kc=Fc(Ca),Yl=Fc(za),rd=Fc(el),Al=Fc(ga),gd=Eo=>Bo=>kc(Bo)&&Zl(Bo)===Eo,Rr=Eo=>dr.fromDom(Eo.dom.ownerDocument),Pl=Eo=>rd(Eo)?Eo:Rr(Eo),Su=Eo=>Io.from(Eo.dom.parentNode).map(dr.fromDom),vs=Eo=>Io.from(Eo.dom.parentElement).map(dr.fromDom),Es=Eo=>Io.from(Eo.dom.nextSibling).map(dr.fromDom),Ks=Eo=>is(Eo.dom.childNodes,dr.fromDom),pr=(Eo,Bo)=>{const Ko=Eo.dom.childNodes;return Io.from(Ko[Bo]).map(dr.fromDom)},ia=Eo=>pr(Eo,0),ka=Eo=>pr(Eo,Eo.dom.childNodes.length-1),Ma=Eo=>Al(Eo)&&to(Eo.dom.host),il=io(Element.prototype.attachShadow)&&io(Node.prototype.getRootNode)?Eo=>dr.fromDom(Eo.dom.getRootNode()):Pl,Na=Eo=>{const Bo=il(Eo);return Ma(Bo)?Io.some(Bo):Io.none()},vl=Eo=>dr.fromDom(Eo.dom.host),Rc=Eo=>{const Bo=Yl(Eo)?Eo.dom.parentNode:Eo.dom;if(Bo==null||Bo.ownerDocument===null)return!1;const Ko=Bo.ownerDocument;return Na(dr.fromDom(Bo)).fold(()=>Ko.body.contains(Bo),bo(Rc,vl))};var Vc=(Eo,Bo,Ko,Ss,Rs)=>Eo(Ko,Ss)?Io.some(Ko):io(Rs)&&Rs(Ko)?Io.none():Bo(Ko,Ss,Rs);const xc=(Eo,Bo,Ko)=>{let Ss=Eo.dom;const Rs=io(Ko)?Ko:xo;for(;Ss.parentNode;){Ss=Ss.parentNode;const $r=dr.fromDom(Ss);if(Bo($r))return Io.some($r);if(Rs($r))break}return Io.none()},zc=(Eo,Bo,Ko)=>Vc((Rs,$r)=>$r(Rs),xc,Eo,Bo,Ko),ad=(Eo,Bo,Ko)=>xc(Eo,Ss=>Vr(Ss,Bo),Ko),Bh=(Eo,Bo,Ko)=>Vc((Rs,$r)=>Vr(Rs,$r),ad,Eo,Bo,Ko),Vu=Eo=>Bh(Eo,"[contenteditable]"),Ts=(Eo,Bo=!1)=>Rc(Eo)?Eo.dom.isContentEditable:Vu(Eo).fold(Oo(Bo),Ko=>ks(Ko)==="true"),ks=Eo=>Eo.dom.contentEditable,ir=(Eo,Bo)=>{Su(Eo).each(Ss=>{Ss.dom.insertBefore(Bo.dom,Eo.dom)})},br=(Eo,Bo)=>{Es(Eo).fold(()=>{Su(Eo).each(Rs=>{Ba(Rs,Bo)})},Ss=>{ir(Ss,Bo)})},Aa=(Eo,Bo)=>{ia(Eo).fold(()=>{Ba(Eo,Bo)},Ss=>{Eo.dom.insertBefore(Bo.dom,Ss.dom)})},Ba=(Eo,Bo)=>{Eo.dom.appendChild(Bo.dom)},_l=(Eo,Bo)=>{Yo(Bo,Ko=>{ir(Eo,Ko)})},Hc=(Eo,Bo)=>{Yo(Bo,Ko=>{Ba(Eo,Ko)})},Ds=Eo=>{Eo.dom.textContent="",Yo(Ks(Eo),Bo=>{tl(Bo)})},tl=Eo=>{const Bo=Eo.dom;Bo.parentNode!==null&&Bo.parentNode.removeChild(Bo)};var wu=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),qu=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Md=tinymce.util.Tools.resolve("tinymce.util.VK");const bc=Eo=>is(Eo,dr.fromDom),nm=Object.keys,Ff=(Eo,Bo)=>{const Ko=nm(Eo);for(let Ss=0,Rs=Ko.length;Ss(Bo,Ko)=>{Eo[Ko]=Bo},ld=(Eo,Bo,Ko,Ss)=>{Ff(Eo,(Rs,$r)=>{(Bo(Rs,$r)?Ko:Ss)(Rs,$r)})},oc=(Eo,Bo)=>{const Ko={};return ld(Eo,Bo,Ud(Ko),ho),Ko},Dc=(Eo,Bo,Ko)=>{if(zn(Ko)||Xn(Ko)||uo(Ko))Eo.setAttribute(Bo,Ko+"");else throw console.error("Invalid call to Attribute.set. Key ",Bo,":: Value ",Ko,":: Element ",Eo),new Error("Attribute value was not simple")},bd=(Eo,Bo)=>{const Ko=Eo.dom;Ff(Bo,(Ss,Rs)=>{Dc(Ko,Rs,Ss)})},Nd=Eo=>Js(Eo.dom.attributes,(Bo,Ko)=>(Bo[Ko.name]=Ko.value,Bo),{}),ih=(Eo,Bo)=>dr.fromDom(Eo.dom.cloneNode(Bo)),om=Eo=>ih(Eo,!0),sm=(Eo,Bo)=>{const Ko=dr.fromTag(Bo),Ss=Nd(Eo);return bd(Ko,Ss),Ko},fc=(Eo,Bo)=>{const Ko=sm(Eo,Bo);br(Eo,Ko);const Ss=Ks(Eo);return Hc(Ko,Ss),tl(Eo),Ko};var Td=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Jd=tinymce.util.Tools.resolve("tinymce.util.Tools");const Em=Eo=>Bo=>to(Bo)&&Bo.nodeName.toLowerCase()===Eo,ef=Eo=>Bo=>to(Bo)&&Eo.test(Bo.nodeName),Cu=Eo=>to(Eo)&&Eo.nodeType===3,Qc=Eo=>to(Eo)&&Eo.nodeType===1,Cf=ef(/^(OL|UL|DL)$/),qm=ef(/^(OL|UL)$/),Oc=Em("ol"),cd=ef(/^(LI|DT|DD)$/),vd=ef(/^(DT|DD)$/),ju=ef(/^(TH|TD)$/),Xf=Em("br"),Sh=Eo=>{var Bo;return((Bo=Eo.parentNode)===null||Bo===void 0?void 0:Bo.firstChild)===Eo},Zd=(Eo,Bo)=>to(Bo)&&Bo.nodeName in Eo.schema.getTextBlockElements(),ah=(Eo,Bo)=>to(Eo)&&Eo.nodeName in Bo,lh=(Eo,Bo)=>to(Bo)&&Bo.nodeName in Eo.schema.getVoidElements(),Bp=(Eo,Bo)=>Xf(Bo)?Eo.isBlock(Bo.nextSibling)&&!Xf(Bo.previousSibling):!1,ch=(Eo,Bo,Ko)=>{const Ss=Eo.isEmpty(Bo);return Ko&&Eo.select("span[data-mce-type=bookmark]",Bo).length>0?!1:Ss},bp=(Eo,Bo)=>Eo.isChildOf(Bo,Eo.getRoot()),kf=Eo=>Bo=>Bo.options.get(Eo),Fh=Eo=>{const Bo=Eo.options.register;Bo("lists_indent_on_tab",{processor:"boolean",default:!0})},jm=kf("lists_indent_on_tab"),Fp=kf("forced_root_block"),Eg=kf("forced_root_block_attrs"),rs=(Eo,Bo)=>{const Ko=Eo.dom,Ss=Eo.schema.getBlockElements(),Rs=Ko.createFragment(),$r=Fp(Eo),Ea=Eg(Eo);let ll,nl,Xa=!1;for(nl=Ko.create($r,Ea),ah(Bo.firstChild,Ss)||Rs.appendChild(nl);ll=Bo.firstChild;){const Nu=ll.nodeName;!Xa&&(Nu!=="SPAN"||ll.getAttribute("data-mce-type")!=="bookmark")&&(Xa=!0),ah(ll,Ss)?(Rs.appendChild(ll),nl=null):(nl||(nl=Ko.create($r,Ea),Rs.appendChild(nl)),nl.appendChild(ll))}return!Xa&&nl&&nl.appendChild(Ko.create("br",{"data-mce-bogus":"1"})),Rs},As=Td.DOM,Ws=(Eo,Bo,Ko)=>{const Ss=Xa=>{const Nu=Xa.parentNode;Nu&&Jd.each(Rs,zu=>{Nu.insertBefore(zu,Ko.parentNode)}),As.remove(Xa)},Rs=As.select('span[data-mce-type="bookmark"]',Bo),$r=rs(Eo,Ko),Ea=As.createRng();Ea.setStartAfter(Ko),Ea.setEndAfter(Bo);const ll=Ea.extractContents();for(let Xa=ll.firstChild;Xa;Xa=Xa.firstChild)if(Xa.nodeName==="LI"&&Eo.dom.isEmpty(Xa)){As.remove(Xa);break}Eo.dom.isEmpty(ll)||As.insertAfter(ll,Bo),As.insertAfter($r,Bo);const nl=Ko.parentElement;nl&&ch(Eo.dom,nl)&&Ss(nl),As.remove(Ko),ch(Eo.dom,Bo)&&As.remove(Bo)},rr=gd("dd"),Fr=gd("dt"),Wa=(Eo,Bo)=>{rr(Bo)?fc(Bo,"dt"):Fr(Bo)&&vs(Bo).each(Ko=>Ws(Eo,Ko.dom,Bo.dom))},Nc=Eo=>{Fr(Eo)&&fc(Eo,"dd")},xl=(Eo,Bo,Ko)=>{Bo==="Indent"?Yo(Ko,Nc):Yo(Ko,Ss=>Wa(Eo,Ss))},ul=(Eo,Bo)=>{if(Cu(Eo))return{container:Eo,offset:Bo};const Ko=wu.getNode(Eo,Bo);return Cu(Ko)?{container:Ko,offset:Bo>=Eo.childNodes.length?Ko.data.length:0}:Ko.previousSibling&&Cu(Ko.previousSibling)?{container:Ko.previousSibling,offset:Ko.previousSibling.data.length}:Ko.nextSibling&&Cu(Ko.nextSibling)?{container:Ko.nextSibling,offset:0}:{container:Eo,offset:Bo}},lu=Eo=>{const Bo=Eo.cloneRange(),Ko=ul(Eo.startContainer,Eo.startOffset);Bo.setStart(Ko.container,Ko.offset);const Ss=ul(Eo.endContainer,Eo.endOffset);return Bo.setEnd(Ss.container,Ss.offset),Bo},Gl=["OL","UL","DL"],Ru=Gl.join(","),xf=(Eo,Bo)=>{const Ko=Bo||Eo.selection.getStart(!0);return Eo.dom.getParent(Ko,Ru,ta(Eo,Ko))},Hp=(Eo,Bo)=>to(Eo)&&Bo.length===1&&Bo[0]===Eo,aa=Eo=>Ys(Eo.querySelectorAll(Ru),Cf),Qp=Eo=>{const Bo=xf(Eo),Ko=Eo.selection.getSelectedBlocks();return Hp(Bo,Ko)?aa(Bo):Ys(Ko,Ss=>Cf(Ss)&&Bo!==Ss)},Bu=(Eo,Bo)=>{const Ko=Jd.map(Bo,Ss=>{const Rs=Eo.dom.getParent(Ss,"li,dd,dt",ta(Eo,Ss));return Rs||Ss});return _r(Ko)},Uo=Eo=>{const Bo=Eo.selection.getSelectedBlocks();return Ys(Bu(Eo,Bo),cd)},cs=Eo=>Ys(Uo(Eo),vd),_s=(Eo,Bo)=>{const Ko=Eo.dom.getParents(Bo,"TD,TH");return Ko.length>0?Ko[0]:Eo.getBody()},ar=(Eo,Bo)=>!Cf(Bo)&&!cd(Bo)&&ms(Gl,Ko=>Eo.isValidChild(Bo.nodeName,Ko)),ta=(Eo,Bo)=>{const Ko=Eo.dom.getParents(Bo,Eo.dom.isBlock);return gs(Ko,Rs=>ar(Eo.schema,Rs)).getOr(Eo.getBody())},al=Eo=>Su(Eo).exists(Bo=>cd(Bo.dom)&&ia(Bo).exists(Ko=>!Cf(Ko.dom))&&ka(Bo).exists(Ko=>!Cf(Ko.dom))),ya=(Eo,Bo)=>{const Ko=Eo.dom.getParents(Bo,"ol,ul",ta(Eo,Bo));return Br(Ko)},fu=Eo=>{const Bo=ya(Eo,Eo.selection.getStart()),Ko=Ys(Eo.selection.getSelectedBlocks(),qm);return Bo.toArray().concat(Ko)},Lr=Eo=>{const Bo=Eo.selection.getStart();return Eo.dom.getParents(Bo,"ol,ul",ta(Eo,Bo))},qc=Eo=>{const Bo=fu(Eo),Ko=Lr(Eo);return gs(Ko,Ss=>al(dr.fromDom(Ss))).fold(()=>Ef(Eo,Bo),Ss=>[Ss])},Ef=(Eo,Bo)=>{const Ko=is(Bo,Ss=>ya(Eo,Ss).getOr(Ss));return _r(Ko)},ku=Eo=>/\btox\-/.test(Eo.className),jc=(Eo,Bo)=>ko(Eo,Cf,ju).exists(Ko=>Ko.nodeName===Bo&&!ku(Ko)),Tm=(Eo,Bo)=>Bo!==null&&!Eo.dom.isEditable(Bo),El=Eo=>{const Bo=xf(Eo);return Tm(Eo,Bo)},Hf=(Eo,Bo)=>{const Ko=Eo.dom.getParent(Bo,"ol,ul,dl");return Tm(Eo,Ko)},hu=(Eo,Bo)=>{const Ko=Eo.selection.getNode();return Bo({parents:Eo.dom.getParents(Ko),element:Ko}),Eo.on("NodeChange",Bo),()=>Eo.off("NodeChange",Bo)},Qf=(Eo,Bo)=>{const Ss=document.createDocumentFragment();return Yo(Eo,Rs=>{Ss.appendChild(Rs.dom)}),dr.fromDom(Ss)},cu=(Eo,Bo,Ko)=>Eo.dispatch("ListMutation",{action:Bo,element:Ko}),ud=(Eo=>Bo=>Bo.replace(Eo,""))(/^\s+|\s+$/g),vp=Eo=>Eo.length>0,vc=Eo=>!vp(Eo),Am=Eo=>Eo.style!==void 0&&io(Eo.style.getPropertyValue),Pm=(Eo,Bo,Ko)=>{if(!zn(Ko))throw console.error("Invalid call to CSS.set. Property ",Bo,":: Value ",Ko,":: Element ",Eo),new Error("CSS value must be a string: "+Ko);Am(Eo)&&Eo.style.setProperty(Bo,Ko)},uh=(Eo,Bo,Ko)=>{const Ss=Eo.dom;Pm(Ss,Bo,Ko)},Hh=Eo=>ra(Eo,"OL,UL"),A1=Eo=>ra(Eo,"LI"),ql=Eo=>ia(Eo).exists(Hh),dd=Eo=>ka(Eo).exists(Hh),yd=Eo=>"listAttributes"in Eo,mv=Eo=>"isComment"in Eo,Du=Eo=>"isFragment"in Eo,lf=Eo=>Eo.depth>0,qd=Eo=>Eo.isSelected,Eb=Eo=>{const Bo=Ks(Eo),Ko=dd(Eo)?Bo.slice(0,-1):Bo;return is(Ko,om)},Tb=(Eo,Bo,Ko)=>Su(Eo).filter(kc).map(Ss=>({depth:Bo,dirty:!1,isSelected:Ko,content:Eb(Eo),itemAttributes:Nd(Eo),listAttributes:Nd(Ss),listType:Zl(Ss),isInPreviousLi:!1})),Qh=(Eo,Bo)=>{Ba(Eo.item,Bo.list)},Xg=Eo=>{for(let Bo=1;Bo{Qs(Br(Eo),Fs(Bo),Qh)},im=(Eo,Bo)=>{const Ko={list:dr.fromTag(Bo,Eo),item:dr.fromTag("li",Eo)};return Ba(Ko.list,Ko.item),Ko},Tf=(Eo,Bo,Ko)=>{const Ss=[];for(let Rs=0;Rs{for(let Ko=0;Ko{yd(Bo)&&(bd(Ko.list,Bo.listAttributes),bd(Ko.item,Bo.itemAttributes)),Hc(Ko.item,Bo.content)})},Od=(Eo,Bo)=>{Zl(Eo.list)!==Bo.listType&&(Eo.list=fc(Eo.list,Bo.listType)),bd(Eo.list,Bo.listAttributes)},Mu=(Eo,Bo,Ko)=>{const Ss=dr.fromTag("li",Eo);return bd(Ss,Bo),Hc(Ss,Ko),Ss},Vh=(Eo,Bo)=>{Ba(Eo.list,Bo),Eo.item=Bo},zp=(Eo,Bo,Ko)=>{const Ss=Bo.slice(0,Ko.depth);return Br(Ss).each(Rs=>{if(yd(Ko)){const $r=Mu(Eo,Ko.itemAttributes,Ko.content);Vh(Rs,$r),Od(Rs,Ko)}else if(Du(Ko))Hc(Rs.item,Ko.content);else{const $r=dr.fromHtml(``);Ba(Rs.list,$r)}}),Ss},Tg=(Eo,Bo,Ko)=>{const Ss=Tf(Eo,Ko,Ko.depth-Bo.length);return Xg(Ss),Ld(Ss,Ko),Gc(Bo,Ss),Bo.concat(Ss)},Ab=(Eo,Bo)=>{let Ko=Io.none();const Ss=Js(Bo,(Rs,$r,Ea)=>mv($r)?Ea===0?(Ko=Io.some($r),Rs):zp(Eo,Rs,$r):$r.depth>Rs.length?Tg(Eo,Rs,$r):zp(Eo,Rs,$r),[]);return Ko.each(Rs=>{const $r=dr.fromHtml(``);Fs(Ss).each(Ea=>{Aa(Ea.list,$r)})}),Fs(Ss).map(Rs=>Rs.list)},P1=(Eo,Bo)=>{switch(Eo){case"Indent":Bo.depth++;break;case"Outdent":Bo.depth--;break;case"Flatten":Bo.depth=0}Bo.dirty=!0},Yf=(Eo,Bo)=>{yd(Eo)&&yd(Bo)&&(Eo.listType=Bo.listType,Eo.listAttributes={...Bo.listAttributes})},$1=Eo=>{Eo.listAttributes=oc(Eo.listAttributes,(Bo,Ko)=>Ko!=="start")},jd=(Eo,Bo)=>{const Ko=Eo[Bo].depth,Ss=$r=>$r.depth===Ko&&!$r.dirty,Rs=$r=>$r.depthko(Eo.slice(Bo+1),Ss,Rs))},$m=Eo=>(Yo(Eo,(Bo,Ko)=>{jd(Eo,Ko).fold(()=>{Bo.dirty&&yd(Bo)&&$1(Bo)},Ss=>Yf(Bo,Ss))}),Eo),R1=Eo=>{let Bo=Eo;return{get:()=>Bo,set:Rs=>{Bo=Rs}}},Xm=(Eo,Bo,Ko,Ss)=>{var Rs;if(qa(Ss))return[{depth:Eo+1,content:(Rs=Ss.dom.nodeValue)!==null&&Rs!==void 0?Rs:"",dirty:!1,isSelected:!1,isComment:!0}];Bo.each(ll=>{nr(ll.start,Ss)&&Ko.set(!0)});const $r=Tb(Ss,Eo,Ko.get());Bo.each(ll=>{nr(ll.end,Ss)&&Ko.set(!1)});const Ea=ka(Ss).filter(Hh).map(ll=>Vf(Eo,Bo,Ko,ll)).getOr([]);return $r.toArray().concat(Ea)},Yg=(Eo,Bo,Ko,Ss)=>ia(Ss).filter(Hh).fold(()=>Xm(Eo,Bo,Ko,Ss),Rs=>{const $r=Js(Ks(Ss),(Ea,ll,nl)=>{if(nl===0)return Ea;if(A1(ll))return Ea.concat(Xm(Eo,Bo,Ko,ll));{const Xa={isFragment:!0,depth:Eo,content:[ll],isSelected:!1,dirty:!1,parentListType:Zl(Rs)};return Ea.concat(Xa)}},[]);return Vf(Eo,Bo,Ko,Rs).concat($r)}),Vf=(Eo,Bo,Ko,Ss)=>Qr(Ks(Ss),Rs=>{const $r=Hh(Rs)?Vf:Yg,Ea=Eo+1;return $r(Ea,Bo,Ko,Rs)}),Gg=(Eo,Bo)=>{const Ko=R1(!1),Ss=0;return is(Eo,Rs=>({sourceList:Rs,entries:Vf(Ss,Bo,Ko,Rs)}))},yp=(Eo,Bo)=>{const Ko=$m(Bo);return is(Ko,Ss=>{const Rs=mv(Ss)?Qf([dr.fromHtml(``)]):Qf(Ss.content);return dr.fromDom(rs(Eo,Rs.dom))})},p0=(Eo,Bo)=>{const Ko=$m(Bo);return Ab(Eo.contentDocument,Ko).toArray()},g0=(Eo,Bo)=>Qr(sr(Bo,lf),Ko=>Fs(Ko).exists(lf)?p0(Eo,Ko):yp(Eo,Ko)),Wp=(Eo,Bo)=>{Yo(Ys(Eo,qd),Ko=>P1(Bo,Ko))},zf=Eo=>{const Bo=is(Uo(Eo),dr.fromDom);return Qs(gs(Bo,Do(ql)),gs(cr(Bo),Do(ql)),(Ko,Ss)=>({start:Ko,end:Ss}))},b0=(Eo,Bo,Ko)=>{const Ss=Gg(Bo,zf(Eo));Yo(Ss,Rs=>{Wp(Rs.entries,Ko);const $r=g0(Eo,Rs.entries);Yo($r,Ea=>{cu(Eo,Ko==="Indent"?"IndentList":"OutdentList",Ea.dom)}),_l(Rs.sourceList,$r),tl(Rs.sourceList)})},Cs=(Eo,Bo)=>{const Ko=bc(qc(Eo)),Ss=bc(cs(Eo));let Rs=!1;if(Ko.length||Ss.length){const $r=Eo.selection.getBookmark();b0(Eo,Ko,Bo),xl(Eo,Bo,Ss),Eo.selection.moveToBookmark($r),Eo.selection.setRng(lu(Eo.selection.getRng())),Eo.nodeChanged(),Rs=!0}return Rs},Up=(Eo,Bo)=>!El(Eo)&&Cs(Eo,Bo),zh=Eo=>Up(Eo,"Indent"),Kg=Eo=>Up(Eo,"Outdent"),v0=Eo=>Up(Eo,"Flatten"),Jg="\uFEFF",Vs=Eo=>Eo===Jg,Dr=(Eo,Bo,Ko)=>xc(Eo,Bo,Ko).isSome(),Tr=(Eo,Bo)=>Dr(Eo,$o(nr,Bo));var Fa=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager");const zl=Td.DOM,_c=Eo=>{const Bo={},Ko=Ss=>{let Rs=Eo[Ss?"startContainer":"endContainer"],$r=Eo[Ss?"startOffset":"endOffset"];if(Qc(Rs)){const Ea=zl.create("span",{"data-mce-type":"bookmark"});Rs.hasChildNodes()?($r=Math.min($r,Rs.childNodes.length-1),Ss?Rs.insertBefore(Ea,Rs.childNodes[$r]):zl.insertAfter(Ea,Rs.childNodes[$r])):Rs.appendChild(Ea),Rs=Ea,$r=0}Bo[Ss?"startContainer":"endContainer"]=Rs,Bo[Ss?"startOffset":"endOffset"]=$r};return Ko(!0),Eo.collapsed||Ko(),Bo},Wc=Eo=>{const Bo=Ss=>{const Rs=ll=>{var nl;let Xa=(nl=ll.parentNode)===null||nl===void 0?void 0:nl.firstChild,Nu=0;for(;Xa;){if(Xa===ll)return Nu;(!Qc(Xa)||Xa.getAttribute("data-mce-type")!=="bookmark")&&Nu++,Xa=Xa.nextSibling}return-1};let $r=Eo[Ss?"startContainer":"endContainer"],Ea=Eo[Ss?"startOffset":"endOffset"];if($r){if(Qc($r)&&$r.parentNode){const ll=$r;Ea=Rs($r),$r=$r.parentNode,zl.remove(ll),!$r.hasChildNodes()&&zl.isBlock($r)&&$r.appendChild(zl.create("br"))}Eo[Ss?"startContainer":"endContainer"]=$r,Eo[Ss?"startOffset":"endOffset"]=Ea}};Bo(!0),Bo();const Ko=zl.createRng();return Ko.setStart(Eo.startContainer,Eo.startOffset),Eo.endContainer&&Ko.setEnd(Eo.endContainer,Eo.endOffset),lu(Ko)},Uc=Eo=>{switch(Eo){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},D1=(Eo,Bo,Ko)=>{const Ss=Ko["list-style-type"]?Ko["list-style-type"]:null;Eo.setStyle(Bo,"list-style-type",Ss)},pv=(Eo,Bo)=>{Jd.each(Bo,(Ko,Ss)=>{Eo.setAttribute(Ss,Ko)})},_d=(Eo,Bo,Ko)=>{pv(Bo,Ko["list-attributes"]),Jd.each(Eo.select("li",Bo),Ss=>{pv(Ss,Ko["list-item-attributes"])})},Wh=(Eo,Bo,Ko)=>{D1(Eo,Bo,Ko),_d(Eo,Bo,Ko)},y0=(Eo,Bo,Ko)=>{Jd.each(Ko,Ss=>Eo.setStyle(Bo,Ss,""))},Id=(Eo,Bo)=>to(Bo)&&!ah(Bo,Eo.schema.getBlockElements()),Ku=(Eo,Bo,Ko,Ss)=>{let Rs=Bo[Ko?"startContainer":"endContainer"];const $r=Bo[Ko?"startOffset":"endOffset"];Qc(Rs)&&(Rs=Rs.childNodes[Math.min($r,Rs.childNodes.length-1)]||Rs),!Ko&&Xf(Rs.nextSibling)&&(Rs=Rs.nextSibling);const Ea=nl=>{for(;!Eo.dom.isBlock(nl)&&nl.parentNode&&Ss!==nl;)nl=nl.parentNode;return nl},ll=(nl,Xa)=>{var Nu;const zu=new qu(nl,Ea(nl)),kh=Xa?"next":"prev";let Sp;for(;Sp=zu[kh]();)if(!(lh(Eo,Sp)||Vs(Sp.textContent)||((Nu=Sp.textContent)===null||Nu===void 0?void 0:Nu.length)===0))return Io.some(Sp);return Io.none()};if(Ko&&Cu(Rs))if(Vs(Rs.textContent))Rs=ll(Rs,!1).getOr(Rs);else for(Rs.parentNode!==null&&Id(Eo,Rs.parentNode)&&(Rs=Rs.parentNode);Rs.previousSibling!==null&&(Id(Eo,Rs.previousSibling)||Cu(Rs.previousSibling));)Rs=Rs.previousSibling;if(!Ko&&Cu(Rs))if(Vs(Rs.textContent))Rs=ll(Rs,!0).getOr(Rs);else for(Rs.parentNode!==null&&Id(Eo,Rs.parentNode)&&(Rs=Rs.parentNode);Rs.nextSibling!==null&&(Id(Eo,Rs.nextSibling)||Cu(Rs.nextSibling));)Rs=Rs.nextSibling;for(;Rs.parentNode!==Ss;){const nl=Rs.parentNode;if(Zd(Eo,Rs)||/^(TD|TH)$/.test(nl.nodeName))return Rs;Rs=nl}return Rs},Rm=(Eo,Bo,Ko)=>{const Ss=[],Rs=Eo.dom,$r=Ku(Eo,Bo,!0,Ko),Ea=Ku(Eo,Bo,!1,Ko);let ll;const nl=[];for(let Xa=$r;Xa&&(nl.push(Xa),Xa!==Ea);Xa=Xa.nextSibling);return Jd.each(nl,Xa=>{var Nu;if(Zd(Eo,Xa)){Ss.push(Xa),ll=null;return}if(Rs.isBlock(Xa)||Xf(Xa)){Xf(Xa)&&Rs.remove(Xa),ll=null;return}const zu=Xa.nextSibling;if(Fa.isBookmarkNode(Xa)&&(Cf(zu)||Zd(Eo,zu)||!zu&&Xa.parentNode===Ko)){ll=null;return}ll||(ll=Rs.create("p"),(Nu=Xa.parentNode)===null||Nu===void 0||Nu.insertBefore(ll,Xa),Ss.push(ll)),ll.appendChild(Xa)}),Ss},iu=(Eo,Bo,Ko)=>{const Ss=Eo.getStyle(Bo,"list-style-type");let Rs=Ko?Ko["list-style-type"]:"";return Rs=Rs===null?"":Rs,Ss===Rs},am=(Eo,Bo)=>{const Ko=Eo.selection.getStart(!0),Ss=Ku(Eo,Bo,!0,Eo.getBody());return Tr(dr.fromDom(Ss),dr.fromDom(Bo.commonAncestorContainer))?Bo.commonAncestorContainer:Ko},Af=(Eo,Bo,Ko)=>{const Ss=Eo.selection.getRng();let Rs="LI";const $r=ta(Eo,am(Eo,Ss)),Ea=Eo.dom;if(Ea.getContentEditable(Eo.selection.getNode())==="false")return;Bo=Bo.toUpperCase(),Bo==="DL"&&(Rs="DT");const ll=_c(Ss),nl=Ys(Rm(Eo,Ss,$r),Eo.dom.isEditable);Jd.each(nl,Xa=>{let Nu;const zu=Xa.previousSibling,kh=Xa.parentNode;cd(kh)||(zu&&Cf(zu)&&zu.nodeName===Bo&&iu(Ea,zu,Ko)?(Nu=zu,Xa=Ea.rename(Xa,Rs),zu.appendChild(Xa)):(Nu=Ea.create(Bo),kh.insertBefore(Nu,Xa),Nu.appendChild(Xa),Xa=Ea.rename(Xa,Rs)),y0(Ea,Xa,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),Wh(Ea,Nu,Ko),Op(Eo.dom,Nu))}),Eo.selection.setRng(Wc(ll))},e1=(Eo,Bo)=>Cf(Eo)&&Eo.nodeName===(Bo==null?void 0:Bo.nodeName),gv=(Eo,Bo,Ko)=>{const Ss=Eo.getStyle(Bo,"list-style-type",!0),Rs=Eo.getStyle(Ko,"list-style-type",!0);return Ss===Rs},M1=(Eo,Bo)=>Eo.className===Bo.className,Pb=(Eo,Bo,Ko)=>e1(Bo,Ko)&&gv(Eo,Bo,Ko)&&M1(Bo,Ko),Op=(Eo,Bo)=>{let Ko,Ss=Bo.nextSibling;if(Pb(Eo,Bo,Ss)){const Rs=Ss;for(;Ko=Rs.firstChild;)Bo.appendChild(Ko);Eo.remove(Rs)}if(Ss=Bo.previousSibling,Pb(Eo,Bo,Ss)){const Rs=Ss;for(;Ko=Rs.lastChild;)Bo.insertBefore(Ko,Bo.firstChild);Eo.remove(Rs)}},Wf=(Eo,Bo,Ko,Ss)=>{if(Bo.nodeName!==Ko){const Rs=Eo.dom.rename(Bo,Ko);Wh(Eo.dom,Rs,Ss),cu(Eo,Uc(Ko),Rs)}else Wh(Eo.dom,Bo,Ss),cu(Eo,Uc(Ko),Bo)},N1=(Eo,Bo,Ko,Ss)=>{if(Bo.classList.forEach((Rs,$r,Ea)=>{Rs.startsWith("tox-")&&(Ea.remove(Rs),Ea.length===0&&Bo.removeAttribute("class"))}),Bo.nodeName!==Ko){const Rs=Eo.dom.rename(Bo,Ko);Wh(Eo.dom,Rs,Ss),cu(Eo,Uc(Ko),Rs)}else Wh(Eo.dom,Bo,Ss),cu(Eo,Uc(Ko),Bo)},Ny=(Eo,Bo,Ko,Ss,Rs)=>{const $r=Cf(Bo);if($r&&Bo.nodeName===Ss&&!t1(Rs)&&!ku(Bo))v0(Eo);else{Af(Eo,Ss,Rs);const Ea=_c(Eo.selection.getRng()),ll=$r?[Bo,...Ko]:Ko,nl=$r&&ku(Bo)?N1:Wf;Jd.each(ll,Xa=>{nl(Eo,Xa,Ss,Rs)}),Eo.selection.setRng(Wc(Ea))}},t1=Eo=>"list-style-type"in Eo,$b=(Eo,Bo,Ko,Ss)=>{if(Bo!==Eo.getBody())if(Bo)if(Bo.nodeName===Ko&&!t1(Ss)&&!ku(Bo))v0(Eo);else{const Rs=_c(Eo.selection.getRng());ku(Bo)&&Bo.classList.forEach((Ea,ll,nl)=>{Ea.startsWith("tox-")&&(nl.remove(Ea),nl.length===0&&Bo.removeAttribute("class"))}),Wh(Eo.dom,Bo,Ss);const $r=Eo.dom.rename(Bo,Ko);Op(Eo.dom,$r),Eo.selection.setRng(Wc(Rs)),Af(Eo,Ko,Ss),cu(Eo,Uc(Ko),$r)}else Af(Eo,Ko,Ss),cu(Eo,Uc(Ko),Bo)},Zp=(Eo,Bo,Ko)=>{const Ss=xf(Eo);if(Hf(Eo,Ss))return;const Rs=Qp(Eo),$r=Un(Ko)?Ko:{};Rs.length>0?Ny(Eo,Ss,Rs,Bo,$r):$b(Eo,Ss,Bo,$r)},qp=Td.DOM,Ag=(Eo,Bo)=>{const Ko=Bo.parentElement;if(Ko&&Ko.nodeName==="LI"&&Ko.firstChild===Bo){const Ss=Ko.previousSibling;Ss&&Ss.nodeName==="LI"?(Ss.appendChild(Bo),ch(Eo,Ko)&&qp.remove(Ko)):qp.setStyle(Ko,"listStyleType","none")}if(Cf(Ko)){const Ss=Ko.previousSibling;Ss&&Ss.nodeName==="LI"&&Ss.appendChild(Bo)}},Kc=(Eo,Bo)=>{const Ko=Jd.grep(Eo.select("ol,ul",Bo));Jd.each(Ko,Ss=>{Ag(Eo,Ss)})},au=(Eo,Bo,Ko,Ss)=>{let Rs=Bo.startContainer;const $r=Bo.startOffset;if(Cu(Rs)&&(Ko?$r0))return Rs;const Ea=Eo.schema.getNonEmptyElements();Qc(Rs)&&(Rs=wu.getNode(Rs,$r));const ll=new qu(Rs,Ss);Ko&&Bp(Eo.dom,Rs)&&ll.next();const nl=Ko?ll.next.bind(ll):ll.prev2.bind(ll);for(;Rs=nl();)if(Rs.nodeName==="LI"&&!Rs.hasChildNodes()||Ea[Rs.nodeName]||Cu(Rs)&&Rs.data.length>0)return Rs;return null},cf=(Eo,Bo)=>{const Ko=Bo.childNodes;return Ko.length===1&&!Cf(Ko[0])&&Eo.isBlock(Ko[0])},O0=Eo=>Io.from(Eo).map(dr.fromDom).filter(Ya).exists(Bo=>Ts(Bo)&&!os(["details"],Zl(Bo))),bv=(Eo,Bo)=>{cf(Eo,Bo)&&O0(Bo.firstChild)&&Eo.remove(Bo.firstChild,!0)},tf=(Eo,Bo,Ko)=>{let Ss;const Rs=cf(Eo,Ko)?Ko.firstChild:Ko;if(bv(Eo,Bo),!ch(Eo,Bo,!0))for(;Ss=Bo.firstChild;)Rs.appendChild(Ss)},lm=(Eo,Bo,Ko)=>{let Ss;const Rs=Bo.parentNode;if(!bp(Eo,Bo)||!bp(Eo,Ko))return;Cf(Ko.lastChild)&&(Ss=Ko.lastChild),Rs===Ko.lastChild&&Xf(Rs.previousSibling)&&Eo.remove(Rs.previousSibling);const $r=Ko.lastChild;$r&&Xf($r)&&Bo.hasChildNodes()&&Eo.remove($r),ch(Eo,Ko,!0)&&Ds(dr.fromDom(Ko)),tf(Eo,Bo,Ko),Ss&&Ko.appendChild(Ss);const ll=Kr(dr.fromDom(Ko),dr.fromDom(Bo))?Eo.getParents(Bo,Cf,Ko):[];Eo.remove(Bo),Yo(ll,nl=>{ch(Eo,nl)&&nl!==Eo.getRoot()&&Eo.remove(nl)})},uf=(Eo,Bo,Ko)=>{Ds(dr.fromDom(Ko)),lm(Eo.dom,Bo,Ko),Eo.selection.setCursorLocation(Ko,0)},cm=(Eo,Bo,Ko,Ss)=>{const Rs=Eo.dom;if(Rs.isEmpty(Ss))uf(Eo,Ko,Ss);else{const $r=_c(Bo);lm(Rs,Ko,Ss),Eo.selection.setRng(Wc($r))}},Rb=(Eo,Bo,Ko,Ss)=>{const Rs=_c(Bo);lm(Eo.dom,Ko,Ss);const $r=Wc(Rs);Eo.selection.setRng($r)},yl=(Eo,Bo)=>{const Ko=Eo.dom,Ss=Eo.selection,Rs=Ss.getStart(),$r=_s(Eo,Rs),Ea=Ko.getParent(Ss.getStart(),"LI",$r);if(Ea){const ll=Ea.parentElement;if(ll===Eo.getBody()&&ch(Ko,ll))return!0;const nl=lu(Ss.getRng()),Xa=Ko.getParent(au(Eo,nl,Bo,$r),"LI",$r),Nu=Xa&&(Bo?Ko.isChildOf(Ea,Xa):Ko.isChildOf(Xa,Ea));if(Xa&&Xa!==Ea&&!Nu)return Eo.undoManager.transact(()=>{Bo?cm(Eo,nl,Xa,Ea):Sh(Ea)?Kg(Eo):Rb(Eo,nl,Ea,Xa)}),!0;if(Nu&&!Bo&&Xa!==Ea)return Eo.undoManager.transact(()=>{if(nl.commonAncestorContainer.parentElement){const zu=_c(nl),kh=nl.commonAncestorContainer.parentElement;tf(Ko,nl.commonAncestorContainer.parentElement,Xa),kh.remove();const Sp=Wc(zu);Eo.selection.setRng(Sp)}}),!0;if(!Xa&&!Bo&&nl.startOffset===0&&nl.endOffset===0)return Eo.undoManager.transact(()=>{v0(Eo)}),!0}return!1},dh=(Eo,Bo,Ko)=>{const Ss=Eo.getParent(Bo.parentNode,Eo.isBlock,Ko);Eo.remove(Bo),Ss&&Eo.isEmpty(Ss)&&Eo.remove(Ss)},jp=(Eo,Bo)=>{const Ko=Eo.dom,Ss=Eo.selection.getStart(),Rs=_s(Eo,Ss),$r=Ko.getParent(Ss,Ko.isBlock,Rs);if($r&&Ko.isEmpty($r)){const Ea=lu(Eo.selection.getRng()),ll=Ko.getParent(au(Eo,Ea,Bo,Rs),"LI",Rs);if(ll){const nl=kh=>os(["td","th","caption"],Zl(kh)),Xa=kh=>kh.dom===Rs,Nu=zc(dr.fromDom(ll),nl,Xa),zu=zc(dr.fromDom(Ea.startContainer),nl,Xa);return hs(Nu,zu,nr)?(Eo.undoManager.transact(()=>{const kh=ll.parentNode;dh(Ko,$r,Rs),Op(Ko,kh),Eo.selection.select(ll,!0),Eo.selection.collapse(Bo)}),!0):!1}}return!1},Sd=(Eo,Bo)=>yl(Eo,Bo)||jp(Eo,Bo),df=Eo=>{const Bo=Eo.selection.getStart(),Ko=_s(Eo,Bo);return Eo.dom.getParent(Bo,"LI,DT,DD",Ko)||Uo(Eo).length>0},vv=Eo=>df(Eo)?(Eo.undoManager.transact(()=>{Eo.execCommand("Delete"),Kc(Eo.dom,Eo.getBody())}),!0):!1,ff=(Eo,Bo)=>{const Ko=Eo.selection;return!Hf(Eo,Ko.getNode())&&(Ko.isCollapsed()?Sd(Eo,Bo):vv(Eo))},Ju=Eo=>{Eo.on("ExecCommand",Bo=>{const Ko=Bo.command.toLowerCase();(Ko==="delete"||Ko==="forwarddelete")&&df(Eo)&&Kc(Eo.dom,Eo.getBody())}),Eo.on("keydown",Bo=>{Bo.keyCode===Md.BACKSPACE?ff(Eo,!1)&&Bo.preventDefault():Bo.keyCode===Md.DELETE&&ff(Eo,!0)&&Bo.preventDefault()})},wh=Eo=>({backspaceDelete:Bo=>{ff(Eo,Bo)}}),fd=(Eo,Bo)=>{const Ko=xf(Eo);Ko===null||Hf(Eo,Ko)||Eo.undoManager.transact(()=>{Un(Bo.styles)&&Eo.dom.setStyles(Ko,Bo.styles),Un(Bo.attrs)&&Ff(Bo.attrs,(Ss,Rs)=>Eo.dom.setAttrib(Ko,Rs,Ss))})},Ym=Eo=>{const Bo=cr(ud(Eo).split("")),Ko=is(Bo,(Ss,Rs)=>{const $r=Ss.toUpperCase().charCodeAt(0)-65+1;return Math.pow(26,Rs)*$r});return Js(Ko,(Ss,Rs)=>Ss+Rs,0)},_p=Eo=>{if(Eo--,Eo<0)return"";{const Bo=Eo%26,Ko=Math.floor(Eo/26),Ss=_p(Ko),Rs=String.fromCharCode(65+Bo);return Ss+Rs}},xu=Eo=>/^[A-Z]+$/.test(Eo),ed=Eo=>/^[a-z]+$/.test(Eo),fh=Eo=>/^[0-9]+$/.test(Eo),Gm=Eo=>fh(Eo)?2:xu(Eo)?0:ed(Eo)?1:vc(Eo)?3:4,Fu=Eo=>{switch(Gm(Eo)){case 2:return Io.some({listStyleType:Io.none(),start:Eo});case 0:return Io.some({listStyleType:Io.some("upper-alpha"),start:Ym(Eo).toString()});case 1:return Io.some({listStyleType:Io.some("lower-alpha"),start:Ym(Eo).toString()});case 3:return Io.some({listStyleType:Io.none(),start:""});case 4:return Io.none()}},_0=Eo=>{const Bo=parseInt(Eo.start,10);return ha(Eo.listStyleType,"upper-alpha")?_p(Bo):ha(Eo.listStyleType,"lower-alpha")?_p(Bo).toLowerCase():Eo.start},yv=Eo=>{const Bo=xf(Eo);!Oc(Bo)||Hf(Eo,Bo)||Eo.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:_0({start:Eo.dom.getAttrib(Bo,"start","1"),listStyleType:Io.from(Eo.dom.getStyle(Bo,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:Ko=>{const Ss=Ko.getData();Fu(Ss.start).each(Rs=>{Eo.execCommand("mceListUpdate",!1,{attrs:{start:Rs.start==="1"?"":Rs.start},styles:{"list-style-type":Rs.listStyleType.getOr("")}})}),Ko.close()}})},Lc=(Eo,Bo)=>()=>{const Ko=xf(Eo);return to(Ko)&&Ko.nodeName===Bo},Dm=Eo=>{Eo.addCommand("mceListProps",()=>{yv(Eo)})},sc=Eo=>{Eo.on("BeforeExecCommand",Bo=>{const Ko=Bo.command.toLowerCase();Ko==="indent"?zh(Eo):Ko==="outdent"&&Kg(Eo)}),Eo.addCommand("InsertUnorderedList",(Bo,Ko)=>{Zp(Eo,"UL",Ko)}),Eo.addCommand("InsertOrderedList",(Bo,Ko)=>{Zp(Eo,"OL",Ko)}),Eo.addCommand("InsertDefinitionList",(Bo,Ko)=>{Zp(Eo,"DL",Ko)}),Eo.addCommand("RemoveList",()=>{v0(Eo)}),Dm(Eo),Eo.addCommand("mceListUpdate",(Bo,Ko)=>{Un(Ko)&&fd(Eo,Ko)}),Eo.addQueryStateHandler("InsertUnorderedList",Lc(Eo,"UL")),Eo.addQueryStateHandler("InsertOrderedList",Lc(Eo,"OL")),Eo.addQueryStateHandler("InsertDefinitionList",Lc(Eo,"DL"))};var hf=tinymce.util.Tools.resolve("tinymce.html.Node");const um=Eo=>Eo.type===3,Km=Eo=>Eo.length===0,ss=Eo=>{const Bo=(Rs,$r)=>{const Ea=hf.create("li");Yo(Rs,ll=>Ea.append(ll)),$r?Eo.insert(Ea,$r,!0):Eo.append(Ea)},Ko=(Rs,$r)=>um($r)?[...Rs,$r]:!Km(Rs)&&!um($r)?(Bo(Rs,$r),[]):Rs,Ss=Js(Eo.children(),Ko,[]);Km(Ss)||Bo(Ss)},dm=Eo=>{Eo.on("PreInit",()=>{const{parser:Bo}=Eo;Bo.addNodeFilter("ul,ol",Ko=>Yo(Ko,ss))})},n1=Eo=>{Eo.on("keydown",Bo=>{Bo.keyCode!==Md.TAB||Md.metaKeyPressed(Bo)||Eo.undoManager.transact(()=>{(Bo.shiftKey?Kg(Eo):zh(Eo))&&Bo.preventDefault()})})},Ch=Eo=>{jm(Eo)&&n1(Eo),Ju(Eo)},Xc=(Eo,Bo)=>Ko=>{const Ss=Rs=>{Ko.setActive(jc(Rs.parents,Bo)),Ko.setEnabled(!Hf(Eo,Rs.element)&&Eo.selection.isEditable())};return Ko.setEnabled(Eo.selection.isEditable()),hu(Eo,Ss)},Ov=Eo=>{const Bo=Ko=>()=>Eo.execCommand(Ko);Eo.hasPlugin("advlist")||(Eo.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:Bo("InsertOrderedList"),onSetup:Xc(Eo,"OL")}),Eo.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:Bo("InsertUnorderedList"),onSetup:Xc(Eo,"UL")}))},Db=(Eo,Bo)=>Ko=>hu(Eo,Rs=>Ko.setEnabled(jc(Rs.parents,Bo)&&!Hf(Eo,Rs.element))),S0=Eo=>{const Bo={text:"List properties...",icon:"ordered-list",onAction:()=>Eo.execCommand("mceListProps"),onSetup:Db(Eo,"OL")};Eo.ui.registry.addMenuItem("listprops",Bo),Eo.ui.registry.addContextMenu("lists",{update:Ko=>{const Ss=xf(Eo,Ko);return Oc(Ss)?["listprops"]:[]}})};var Mm=()=>{_n.add("lists",Eo=>(Fh(Eo),dm(Eo),Eo.hasPlugin("rtc",!0)?Dm(Eo):(Ch(Eo),sc(Eo)),Ov(Eo),S0(Eo),wh(Eo)))};Mm()})();(function(){const _n=xo=>{let Io=xo;return{get:()=>Io,set:Mo=>{Io=Mo}}};var Ce=tinymce.util.Tools.resolve("tinymce.PluginManager");const ke=xo=>()=>xo;var $n=tinymce.util.Tools.resolve("tinymce.Env");const Hn=xo=>xo.dispatch("ResizeEditor"),zn=xo=>Io=>Io.options.get(xo),Un=xo=>{const Io=xo.options.register;Io("autoresize_overflow_padding",{processor:"number",default:1}),Io("autoresize_bottom_margin",{processor:"number",default:50})},qn=zn("min_height"),Xn=zn("max_height"),Kn=zn("autoresize_overflow_padding"),to=zn("autoresize_bottom_margin"),io=xo=>xo.plugins.fullscreen&&xo.plugins.fullscreen.isFullscreen(),uo=(xo,Io)=>{const Vo=xo.getBody();Vo&&(Vo.style.overflowY=Io?"":"hidden",Io||(Vo.scrollTop=0))},ho=(xo,Io,Vo,Jo)=>{var Mo;const Go=parseInt((Mo=xo.getStyle(Io,Vo,Jo))!==null&&Mo!==void 0?Mo:"",10);return isNaN(Go)?0:Go},bo=xo=>{if((xo==null?void 0:xo.type.toLowerCase())==="setcontent"){const Io=xo;return Io.selection===!0||Io.paste===!0}else return!1},Oo=(xo,Io,Vo,Jo)=>{var Mo;const Go=xo.dom,os=xo.getDoc();if(!os)return;if(io(xo)){uo(xo,!0);return}const ms=os.documentElement,is=Jo?Jo():Kn(xo),Yo=(Mo=qn(xo))!==null&&Mo!==void 0?Mo:xo.getElement().offsetHeight;let Ys=Yo;const sr=ho(Go,ms,"margin-top",!0),Js=ho(Go,ms,"margin-bottom",!0);let ko=ms.offsetHeight+sr+Js+is;ko<0&&(ko=0);const gs=xo.getContainer().offsetHeight,xs=xo.getContentAreaContainer().offsetHeight,Qr=gs-xs;ko+Qr>Yo&&(Ys=ko+Qr);const cr=Xn(xo);if(cr&&Ys>cr?(Ys=cr,uo(xo,!0)):uo(xo,!1),Ys!==Io.get()){const ws=Ys-Io.get();if(Go.setStyle(xo.getContainer(),"height",Ys+"px"),Io.set(Ys),Hn(xo),$n.browser.isSafari()&&($n.os.isMacOS()||$n.os.isiOS())){const Fs=xo.getWin();Fs.scrollTo(Fs.pageXOffset,Fs.pageYOffset)}xo.hasFocus()&&bo(Vo)&&xo.selection.scrollIntoView(),($n.browser.isSafari()||$n.browser.isChromium())&&ws<0&&Oo(xo,Io,Vo,Jo)}},So=(xo,Io)=>{let Vo=()=>to(xo),Jo,Mo;xo.on("init",Go=>{Jo=0;const os=Kn(xo),ms=xo.dom;ms.setStyles(xo.getDoc().documentElement,{height:"auto"}),$n.browser.isEdge()||$n.browser.isIE()?ms.setStyles(xo.getBody(),{paddingLeft:os,paddingRight:os,"min-height":0}):ms.setStyles(xo.getBody(),{paddingLeft:os,paddingRight:os}),Oo(xo,Io,Go,Vo),Jo+=1}),xo.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",Go=>{if(Jo===1)Mo=xo.getContainer().offsetHeight,Oo(xo,Io,Go,Vo),Jo+=1;else if(Jo===2){const os=Mo{xo.addCommand("mceAutoResize",()=>{Oo(xo,Io)})};var Do=()=>{Ce.add("autoresize",xo=>{if(Un(xo),xo.options.isSet("resize")||xo.options.set("resize",!1),!xo.inline){const Io=_n(0);$o(xo,Io),So(xo,Io)}})};Do()})();(function(){var _n=tinymce.util.Tools.resolve("tinymce.PluginManager");const ke=(Zs=>Sr=>Zs===Sr)(null),$n=Zs=>Zs,Hn=(Zs,Sr)=>{const Us=Zs.length,fs=new Array(Us);for(let dr=0;dr]",punctuation:"[~№|!-*+-\\/:;?@\\[-`{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]"},qn={ALETTER:0,MIDNUMLET:1,MIDLETTER:2,MIDNUM:3,NUMERIC:4,CR:5,LF:6,NEWLINE:7,EXTEND:8,FORMAT:9,KATAKANA:10,EXTENDNUMLET:11,AT:12,OTHER:13},Xn=[new RegExp(Un.aletter),new RegExp(Un.midnumlet),new RegExp(Un.midletter),new RegExp(Un.midnum),new RegExp(Un.numeric),new RegExp(Un.cr),new RegExp(Un.lf),new RegExp(Un.newline),new RegExp(Un.extend),new RegExp(Un.format),new RegExp(Un.katakana),new RegExp(Un.extendnumlet),new RegExp("@")],Kn="",to=new RegExp("^"+Un.punctuation+"$"),io=/^\s+$/,uo=Xn,ho=qn.OTHER,bo=Zs=>{let Sr=ho;const Us=uo.length;for(let fs=0;fs{const Sr={};return Us=>{if(Sr[Us])return Sr[Us];{const fs=Zs(Us);return Sr[Us]=fs,fs}}},So=Zs=>{const Sr=Oo(bo);return Hn(Zs,Sr)},$o=(Zs,Sr)=>{const Us=Zs[Sr],fs=Zs[Sr+1];if(Sr<0||Sr>Zs.length-1&&Sr!==0||Us===qn.ALETTER&&fs===qn.ALETTER)return!1;const dr=Zs[Sr+2];if(Us===qn.ALETTER&&(fs===qn.MIDLETTER||fs===qn.MIDNUMLET||fs===qn.AT)&&dr===qn.ALETTER)return!1;const Vr=Zs[Sr-1];return(Us===qn.MIDLETTER||Us===qn.MIDNUMLET||fs===qn.AT)&&fs===qn.ALETTER&&Vr===qn.ALETTER||(Us===qn.NUMERIC||Us===qn.ALETTER)&&(fs===qn.NUMERIC||fs===qn.ALETTER)||(Us===qn.MIDNUM||Us===qn.MIDNUMLET)&&fs===qn.NUMERIC&&Vr===qn.NUMERIC||Us===qn.NUMERIC&&(fs===qn.MIDNUM||fs===qn.MIDNUMLET)&&dr===qn.NUMERIC||(Us===qn.EXTEND||Us===qn.FORMAT)&&(fs===qn.ALETTER||fs===qn.NUMERIC||fs===qn.KATAKANA||fs===qn.EXTEND||fs===qn.FORMAT)||(fs===qn.EXTEND||fs===qn.FORMAT&&(dr===qn.ALETTER||dr===qn.NUMERIC||dr===qn.KATAKANA||dr===qn.EXTEND||dr===qn.FORMAT))&&(Us===qn.ALETTER||Us===qn.NUMERIC||Us===qn.KATAKANA||Us===qn.EXTEND||Us===qn.FORMAT)||Us===qn.CR&&fs===qn.LF?!1:Us===qn.NEWLINE||Us===qn.CR||Us===qn.LF||fs===qn.NEWLINE||fs===qn.CR||fs===qn.LF?!0:!(Us===qn.KATAKANA&&fs===qn.KATAKANA||fs===qn.EXTENDNUMLET&&(Us===qn.ALETTER||Us===qn.NUMERIC||Us===qn.KATAKANA||Us===qn.EXTENDNUMLET)||Us===qn.EXTENDNUMLET&&(fs===qn.ALETTER||fs===qn.NUMERIC||fs===qn.KATAKANA)||Us===qn.AT)},Do=Kn,xo=io,Io=to,Vo=Zs=>Zs==="http"||Zs==="https",Jo=(Zs,Sr)=>{let Us;for(Us=Sr;Us{const Us=Jo(Zs,Sr+1);return Zs.slice(Sr+1,Us).join(Do).substr(0,3)==="://"?Us:Sr},Go=(Zs,Sr,Us,fs)=>{const dr=[],Vr=[];let nr=[];for(let Kr=0;Kr({includeWhitespace:!1,includePunctuation:!1}),ms=(Zs,Sr,Us)=>{Us={...os(),...Us};const fs=Hn(Zs,Sr),dr=So(fs);return Go(Zs,fs,dr,Us)},Yo=(Zs,Sr,Us)=>ms(Zs,Sr,Us).words,Ys=Zs=>Zs.replace(/\uFEFF/g,"");var sr=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const Js=(Zs,Sr)=>{const Us=Sr.getBlockElements(),fs=Sr.getVoidElements(),dr=Ml=>Us[Ml.nodeName]||fs[Ml.nodeName],Vr=[];let nr="";const Kr=new sr(Zs,Zs);let ra;for(;ra=Kr.next();)ra.nodeType===3?nr+=Ys(ra.data):dr(ra)&&nr.length&&(Vr.push(nr),nr="");return nr.length&&Vr.push(nr),Vr},ko=Zs=>Zs.replace(/\u200B/g,""),gs=Zs=>Zs.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length,xs=(Zs,Sr)=>{const Us=ko(Js(Zs,Sr).join(` +`));return Yo(Us.split(""),$n).length},Qr=(Zs,Sr)=>{const Us=Js(Zs,Sr).join("");return gs(Us)},cr=(Zs,Sr)=>{const Us=Js(Zs,Sr).join("").replace(/\s/g,"");return gs(Us)},ws=(Zs,Sr)=>()=>Sr(Zs.getBody(),Zs.schema),Fs=(Zs,Sr)=>()=>Sr(Zs.selection.getRng().cloneContents(),Zs.schema),Br=Zs=>ws(Zs,xs),_r=Zs=>({body:{getWordCount:Br(Zs),getCharacterCount:ws(Zs,Qr),getCharacterCountWithoutSpaces:ws(Zs,cr)},selection:{getWordCount:Fs(Zs,xs),getCharacterCount:Fs(Zs,Qr),getCharacterCountWithoutSpaces:Fs(Zs,cr)},getCount:Br(Zs)}),ha=(Zs,Sr)=>{Zs.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(Sr.body.getWordCount()),String(Sr.selection.getWordCount())],["Characters (no spaces)",String(Sr.body.getCharacterCountWithoutSpaces()),String(Sr.selection.getCharacterCountWithoutSpaces())],["Characters",String(Sr.body.getCharacterCount()),String(Sr.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},hs=(Zs,Sr)=>{Zs.addCommand("mceWordCount",()=>ha(Zs,Sr))},Qs=(Zs,Sr)=>{let Us=null;return{cancel:()=>{ke(Us)||(clearTimeout(Us),Us=null)},throttle:(...Vr)=>{ke(Us)&&(Us=setTimeout(()=>{Us=null,Zs.apply(null,Vr)},Sr))}}};var zo=tinymce.util.Tools.resolve("tinymce.util.Delay");const el=(Zs,Sr)=>{Zs.dispatch("wordCountUpdate",{wordCount:{words:Sr.body.getWordCount(),characters:Sr.body.getCharacterCount(),charactersWithoutSpaces:Sr.body.getCharacterCountWithoutSpaces()}})},ga=(Zs,Sr)=>{el(Zs,Sr)},Ca=(Zs,Sr,Us)=>{const fs=Qs(()=>ga(Zs,Sr),Us);Zs.on("init",()=>{ga(Zs,Sr),zo.setEditorTimeout(Zs,()=>{Zs.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",fs.throttle)},0),Zs.on("remove",fs.cancel)})},za=Zs=>{const Sr=()=>Zs.execCommand("mceWordCount");Zs.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:Sr}),Zs.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:Sr})};var Il=(Zs=300)=>{_n.add("wordcount",Sr=>{const Us=_r(Sr);return hs(Sr,Us),za(Sr),Ca(Sr,Us,Zs),Us})};Il()})();function get_each_context$8(_n,Ce,ke){const $n=_n.slice();return $n[14]=Ce[ke],$n}function get_each_context_1$2(_n,Ce,ke){const $n=_n.slice();return $n[17]=Ce[ke],$n}function create_else_block$7(_n){let Ce,ke;return Ce=new Dropdown({props:{$$slots:{button:[create_button_slot$1],default:[create_default_slot$1]},$$scope:{ctx:_n}}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&1048576&&(zn.$$scope={dirty:Hn,ctx:$n}),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_if_block_1$a(_n){let Ce,ke,$n;return{c(){Ce=element("button"),Ce.textContent="Browse",attr(Ce,"class","button")},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"click",_n[9]),ke=!0)},p:noop,i:noop,o:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function create_each_block_1$2(_n){let Ce,ke,$n;function Hn(...zn){return _n[10](_n[17],...zn)}return{c(){Ce=element("a"),Ce.textContent=`${_n[17].label}`,attr(Ce,"class","dropdown-item"),attr(Ce,"href","/")},m(zn,Un){insert$1(zn,Ce,Un),ke||($n=listen(Ce,"click",Hn),ke=!0)},p(zn,Un){_n=zn},d(zn){zn&&detach(Ce),ke=!1,$n()}}}function create_default_slot$1(_n){let Ce,ke=ensure_array_like(_n[3]),$n=[];for(let Hn=0;Hnqn[14].id;for(let qn=0;qn0&&create_if_block$e(_n),bo={};return Xn=new Dialog({props:bo}),_n[12](Xn),Xn.$on("insert",_n[6]),{c(){Ce=element("div"),ke=element("label"),ke.textContent="Rich editor files",$n=space$3(),zn.c(),Un=space$3(),ho&&ho.c(),qn=space$3(),create_component(Xn.$$.fragment),attr(ke,"class","mt-4 mb-3"),attr(Ce,"class","mb-3")},m(Oo,So){insert$1(Oo,Ce,So),append(Ce,ke),append(Ce,$n),io[Hn].m(Ce,null),insert$1(Oo,Un,So),ho&&ho.m(Oo,So),insert$1(Oo,qn,So),mount_component(Xn,Oo,So),Kn=!0},p(Oo,[So]){let $o=Hn;Hn=uo(Oo),Hn===$o?io[Hn].p(Oo,So):(group_outros(),transition_out(io[$o],1,1,()=>{io[$o]=null}),check_outros(),zn=io[Hn],zn?zn.p(Oo,So):(zn=io[Hn]=to[Hn](Oo),zn.c()),transition_in(zn,1),zn.m(Ce,null)),Oo[2].length>0?ho?(ho.p(Oo,So),So&4&&transition_in(ho,1)):(ho=create_if_block$e(Oo),ho.c(),transition_in(ho,1),ho.m(qn.parentNode,qn)):ho&&(group_outros(),transition_out(ho,1,1,()=>{ho=null}),check_outros());const Do={};Xn.$set(Do)},i(Oo){Kn||(transition_in(zn),transition_in(ho),transition_in(Xn.$$.fragment,Oo),Kn=!0)},o(Oo){transition_out(zn),transition_out(ho),transition_out(Xn.$$.fragment,Oo),Kn=!1},d(Oo){Oo&&(detach(Ce),detach(Un),detach(qn)),io[Hn].d(),ho&&ho.d(Oo),_n[12](null),destroy_component(Xn,Oo)}}}function instance$l(_n,Ce,ke){let $n;const Hn=getContext$1("channel");let{field:zn}=Ce,{record:Un}=Ce,{graph:qn}=Ce,Xn,Kn=Hn.schemas.filter($o=>zn.collections.includes($o.name));function to($o){$o.preventDefault(),ke(7,qn.edges=qn.edges.filter(Do=>!(Do.target===$o.detail&&Do.field===zn.name)),qn)}function io($o,Do){$o.preventDefault(),Xn.open(Do)}function uo($o){$o.preventDefault(),Xn.close(),ke(7,qn=insertEdges(qn,Un,$o.detail.records,zn.name,$o.detail.action))}const ho=$o=>io($o,Kn[0].name),bo=($o,Do)=>io(Do,$o.name);function Oo($o){bubble.call(this,_n,$o)}function So($o){binding_callbacks[$o?"unshift":"push"](()=>{Xn=$o,ke(1,Xn)})}return _n.$$set=$o=>{"field"in $o&&ke(0,zn=$o.field),"record"in $o&&ke(8,Un=$o.record),"graph"in $o&&ke(7,qn=$o.graph)},_n.$$.update=()=>{_n.$$.dirty&385&&ke(2,$n=(qn==null?void 0:qn.edges.filter($o=>$o.field===zn.name).map($o=>qn.records.find(Do=>Do.id===$o.target&&Un.id===$o.source)).filter($o=>!!($o!=null&&$o.id)))??[])},[zn,Xn,$n,Kn,to,io,uo,qn,Un,ho,bo,Oo,So]}class RichEditorFiles extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$l,create_fragment$l,safe_not_equal,{field:0,record:8,graph:7})}}var t$1="2.1.5";const e="[data-trix-attachment]",i$1={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}},n={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,htmlAttributes:["language"],text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test(_n){return r(_n.parentNode)===n[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test(_n){return r(_n.parentNode)===n[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}},r=_n=>{var Ce;return _n==null||(Ce=_n.tagName)===null||Ce===void 0?void 0:Ce.toLowerCase()},o=navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i),s=o&&parseInt(o[1]);var a={composesExistingText:/Android.*Chrome/.test(navigator.userAgent),recentAndroid:s&&s>12,samsungAndroid:s&&navigator.userAgent.match(/Android.*SM-/),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:typeof InputEvent<"u"&&["data","getTargetRanges","inputType"].every(_n=>_n in InputEvent.prototype)},l={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption…",code:"Code",heading1:"Heading",indent:"Increase Level",italic:"Italic",link:"Link",numbers:"Numbers",outdent:"Decrease Level",quote:"Quote",redo:"Redo",remove:"Remove",strike:"Strikethrough",undo:"Undo",unlink:"Unlink",url:"URL",urlPlaceholder:"Enter a URL…",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"};const c=[l.bytes,l.KB,l.MB,l.GB,l.TB,l.PB];var u={prefix:"IEC",precision:2,formatter(_n){switch(_n){case 0:return"0 ".concat(l.bytes);case 1:return"1 ".concat(l.byte);default:let Ce;this.prefix==="SI"?Ce=1e3:this.prefix==="IEC"&&(Ce=1024);const ke=Math.floor(Math.log(_n)/Math.log(Ce)),$n=(_n/Math.pow(Ce,ke)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"");return"".concat($n," ").concat(c[ke])}}};const h="\uFEFF",d=" ",g=function(_n){for(const Ce in _n){const ke=_n[Ce];this[Ce]=ke}return this},m=document.documentElement,p=m.matches,f=function(_n){let{onElement:Ce,matchingSelector:ke,withCallback:$n,inPhase:Hn,preventDefault:zn,times:Un}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const qn=Ce||m,Xn=ke,Kn=Hn==="capturing",to=function(io){Un!=null&&--Un==0&&to.destroy();const uo=A(io.target,{matchingSelector:Xn});uo!=null&&($n==null||$n.call(uo,io,uo),zn&&io.preventDefault())};return to.destroy=()=>qn.removeEventListener(_n,to,Kn),qn.addEventListener(_n,to,Kn),to},b=function(_n){let{onElement:Ce,bubbles:ke,cancelable:$n,attributes:Hn}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const zn=Ce??m;ke=ke!==!1,$n=$n!==!1;const Un=document.createEvent("Events");return Un.initEvent(_n,ke,$n),Hn!=null&&g.call(Un,Hn),zn.dispatchEvent(Un)},v=function(_n,Ce){if((_n==null?void 0:_n.nodeType)===1)return p.call(_n,Ce)},A=function(_n){let{matchingSelector:Ce,untilNode:ke}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(;_n&&_n.nodeType!==Node.ELEMENT_NODE;)_n=_n.parentNode;if(_n!=null){if(Ce==null)return _n;if(_n.closest&&ke==null)return _n.closest(Ce);for(;_n&&_n!==ke;){if(v(_n,Ce))return _n;_n=_n.parentNode}}},x=_n=>document.activeElement!==_n&&y(_n,document.activeElement),y=function(_n,Ce){if(_n&&Ce)for(;Ce;){if(Ce===_n)return!0;Ce=Ce.parentNode}},C$1=function(_n){var Ce;if((Ce=_n)===null||Ce===void 0||!Ce.parentNode)return;let ke=0;for(_n=_n.previousSibling;_n;)ke++,_n=_n.previousSibling;return ke},k=_n=>{var Ce;return _n==null||(Ce=_n.parentNode)===null||Ce===void 0?void 0:Ce.removeChild(_n)},R=function(_n){let{onlyNodesOfType:Ce,usingFilter:ke,expandEntityReferences:$n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const Hn=(()=>{switch(Ce){case"element":return NodeFilter.SHOW_ELEMENT;case"text":return NodeFilter.SHOW_TEXT;case"comment":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}})();return document.createTreeWalker(_n,Hn,ke??null,$n===!0)},E=_n=>{var Ce;return _n==null||(Ce=_n.tagName)===null||Ce===void 0?void 0:Ce.toLowerCase()},S$1=function(_n){let Ce,ke,$n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof _n=="object"?($n=_n,_n=$n.tagName):$n={attributes:$n};const Hn=document.createElement(_n);if($n.editable!=null&&($n.attributes==null&&($n.attributes={}),$n.attributes.contenteditable=$n.editable),$n.attributes)for(Ce in $n.attributes)ke=$n.attributes[Ce],Hn.setAttribute(Ce,ke);if($n.style)for(Ce in $n.style)ke=$n.style[Ce],Hn.style[Ce]=ke;if($n.data)for(Ce in $n.data)ke=$n.data[Ce],Hn.dataset[Ce]=ke;return $n.className&&$n.className.split(" ").forEach(zn=>{Hn.classList.add(zn)}),$n.textContent&&(Hn.textContent=$n.textContent),$n.childNodes&&[].concat($n.childNodes).forEach(zn=>{Hn.appendChild(zn)}),Hn};let L;const D=function(){if(L!=null)return L;L=[];for(const _n in n){const Ce=n[_n];Ce.tagName&&L.push(Ce.tagName)}return L},w=_n=>B(_n==null?void 0:_n.firstChild),T=function(_n){let{strict:Ce}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{strict:!0};return Ce?B(_n):B(_n)||!B(_n.firstChild)&&function(ke){return D().includes(E(ke))&&!D().includes(E(ke.firstChild))}(_n)},B=_n=>F(_n)&&(_n==null?void 0:_n.data)==="block",F=_n=>(_n==null?void 0:_n.nodeType)===Node.COMMENT_NODE,P=function(_n){let{name:Ce}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(_n)return O(_n)?_n.data===h?!Ce||_n.parentNode.dataset.trixCursorTarget===Ce:void 0:P(_n.firstChild)},I=_n=>v(_n,e),N=_n=>O(_n)&&(_n==null?void 0:_n.data)==="",O=_n=>(_n==null?void 0:_n.nodeType)===Node.TEXT_NODE,M={level2Enabled:!0,getLevel(){return this.level2Enabled&&a.supportsInputEvents?2:0},pickFiles(_n){const Ce=S$1("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId});Ce.addEventListener("change",()=>{_n(Ce.files),k(Ce)}),k(document.getElementById(this.fileInputId)),document.body.appendChild(Ce),Ce.click()}};var j={removeBlankTableCells:!1,tableCellSeparator:" | ",tableRowSeparator:` +`},W={bold:{tagName:"strong",inheritable:!0,parser(_n){const Ce=window.getComputedStyle(_n);return Ce.fontWeight==="bold"||Ce.fontWeight>=600}},italic:{tagName:"em",inheritable:!0,parser:_n=>window.getComputedStyle(_n).fontStyle==="italic"},href:{groupTagName:"a",parser(_n){const Ce="a:not(".concat(e,")"),ke=_n.closest(Ce);if(ke)return ke.getAttribute("href")}},strike:{tagName:"del",inheritable:!0},frozen:{style:{backgroundColor:"highlight"}}},U={getDefaultHTML:()=>`
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    `)};const q={interval:5e3};var V=Object.freeze({__proto__:null,attachments:i$1,blockAttributes:n,browser:a,css:{attachment:"attachment",attachmentCaption:"attachment__caption",attachmentCaptionEditor:"attachment__caption-editor",attachmentMetadata:"attachment__metadata",attachmentMetadataContainer:"attachment__metadata-container",attachmentName:"attachment__name",attachmentProgress:"attachment__progress",attachmentSize:"attachment__size",attachmentToolbar:"attachment__toolbar",attachmentGallery:"attachment-gallery"},fileSize:u,input:M,keyNames:{8:"backspace",9:"tab",13:"return",27:"escape",37:"left",39:"right",46:"delete",68:"d",72:"h",79:"o"},lang:l,parser:j,textAttributes:W,toolbar:U,undo:q});class H{static proxyMethod(Ce){const{name:ke,toMethod:$n,toProperty:Hn,optional:zn}=z(Ce);this.prototype[ke]=function(){let Un,qn;var Xn,Kn;return $n?qn=zn?(Xn=this[$n])===null||Xn===void 0?void 0:Xn.call(this):this[$n]():Hn&&(qn=this[Hn]),zn?(Un=(Kn=qn)===null||Kn===void 0?void 0:Kn[ke],Un?_.call(Un,qn,arguments):void 0):(Un=qn[ke],_.call(Un,qn,arguments))}}}const z=function(_n){const Ce=_n.match(J);if(!Ce)throw new Error("can't parse @proxyMethod expression: ".concat(_n));const ke={name:Ce[4]};return Ce[2]!=null?ke.toMethod=Ce[1]:ke.toProperty=Ce[1],Ce[3]!=null&&(ke.optional=!0),ke},{apply:_}=Function.prototype,J=new RegExp("^(.+?)(\\(\\))?(\\?)?\\.(.+?)$");var K,G,$;class X extends H{static box(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return Ce instanceof this?Ce:this.fromUCS2String(Ce==null?void 0:Ce.toString())}static fromUCS2String(Ce){return new this(Ce,tt(Ce))}static fromCodepoints(Ce){return new this(et(Ce),Ce)}constructor(Ce,ke){super(...arguments),this.ucs2String=Ce,this.codepoints=ke,this.length=this.codepoints.length,this.ucs2Length=this.ucs2String.length}offsetToUCS2Offset(Ce){return et(this.codepoints.slice(0,Math.max(0,Ce))).length}offsetFromUCS2Offset(Ce){return tt(this.ucs2String.slice(0,Math.max(0,Ce))).length}slice(){return this.constructor.fromCodepoints(this.codepoints.slice(...arguments))}charAt(Ce){return this.slice(Ce,Ce+1)}isEqualTo(Ce){return this.constructor.box(Ce).ucs2String===this.ucs2String}toJSON(){return this.ucs2String}getCacheKey(){return this.ucs2String}toString(){return this.ucs2String}}const Y=((K=Array.from)===null||K===void 0?void 0:K.call(Array,"👼").length)===1,Q=((G=" ".codePointAt)===null||G===void 0?void 0:G.call(" ",0))!=null,Z=(($=String.fromCodePoint)===null||$===void 0?void 0:$.call(String,32,128124))===" 👼";let tt,et;tt=Y&&Q?_n=>Array.from(_n).map(Ce=>Ce.codePointAt(0)):function(_n){const Ce=[];let ke=0;const{length:$n}=_n;for(;ke<$n;){let Hn=_n.charCodeAt(ke++);if(55296<=Hn&&Hn<=56319&&ke<$n){const zn=_n.charCodeAt(ke++);(64512&zn)==56320?Hn=((1023&Hn)<<10)+(1023&zn)+65536:ke--}Ce.push(Hn)}return Ce},et=Z?_n=>String.fromCodePoint(...Array.from(_n||[])):function(_n){return(()=>{const Ce=[];return Array.from(_n).forEach(ke=>{let $n="";ke>65535&&(ke-=65536,$n+=String.fromCharCode(ke>>>10&1023|55296),ke=56320|1023&ke),Ce.push($n+String.fromCharCode(ke))}),Ce})().join("")};let it=0;class nt extends H{static fromJSONString(Ce){return this.fromJSON(JSON.parse(Ce))}constructor(){super(...arguments),this.id=++it}hasSameConstructorAs(Ce){return this.constructor===(Ce==null?void 0:Ce.constructor)}isEqualTo(Ce){return this===Ce}inspect(){const Ce=[],ke=this.contentsForInspection()||{};for(const $n in ke){const Hn=ke[$n];Ce.push("".concat($n,"=").concat(Hn))}return"#<".concat(this.constructor.name,":").concat(this.id).concat(Ce.length?" ".concat(Ce.join(", ")):"",">")}contentsForInspection(){}toJSONString(){return JSON.stringify(this)}toUTF16String(){return X.box(this)}getCacheKey(){return this.id.toString()}}const rt=function(){let _n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(_n.length!==Ce.length)return!1;for(let ke=0;ke<_n.length;ke++)if(_n[ke]!==Ce[ke])return!1;return!0},ot=function(_n){const Ce=_n.slice(0);for(var ke=arguments.length,$n=new Array(ke>1?ke-1:0),Hn=1;Hn(lt$1||(lt$1=ft().concat(mt())),lt$1),gt=_n=>n[_n],mt=()=>(ct||(ct=Object.keys(n)),ct),pt=_n=>W[_n],ft=()=>(ut||(ut=Object.keys(W)),ut),bt=function(_n,Ce){vt(_n).textContent=Ce.replace(/%t/g,_n)},vt=function(_n){const Ce=document.createElement("style");Ce.setAttribute("type","text/css"),Ce.setAttribute("data-tag-name",_n.toLowerCase());const ke=At();return ke&&Ce.setAttribute("nonce",ke),document.head.insertBefore(Ce,document.head.firstChild),Ce},At=function(){const _n=xt("trix-csp-nonce")||xt("csp-nonce");if(_n)return _n.getAttribute("content")},xt=_n=>document.head.querySelector("meta[name=".concat(_n,"]")),yt={"application/x-trix-feature-detection":"test"},Ct=function(_n){const Ce=_n.getData("text/plain"),ke=_n.getData("text/html");if(!Ce||!ke)return Ce==null?void 0:Ce.length;{const{body:$n}=new DOMParser().parseFromString(ke,"text/html");if($n.textContent===Ce)return!$n.querySelector("*")}},kt=/Mac|^iP/.test(navigator.platform)?_n=>_n.metaKey:_n=>_n.ctrlKey,Rt=_n=>setTimeout(_n,1),Et=function(){let _n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const Ce={};for(const ke in _n){const $n=_n[ke];Ce[ke]=$n}return Ce},St=function(){let _n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Object.keys(_n).length!==Object.keys(Ce).length)return!1;for(const ke in _n)if(_n[ke]!==Ce[ke])return!1;return!0},Lt=function(_n){if(_n!=null)return Array.isArray(_n)||(_n=[_n,_n]),[Tt(_n[0]),Tt(_n[1]!=null?_n[1]:_n[0])]},Dt=function(_n){if(_n==null)return;const[Ce,ke]=Lt(_n);return Bt(Ce,ke)},wt=function(_n,Ce){if(_n==null||Ce==null)return;const[ke,$n]=Lt(_n),[Hn,zn]=Lt(Ce);return Bt(ke,Hn)&&Bt($n,zn)},Tt=function(_n){return typeof _n=="number"?_n:Et(_n)},Bt=function(_n,Ce){return typeof _n=="number"?_n===Ce:St(_n,Ce)};class Ft extends H{constructor(){super(...arguments),this.update=this.update.bind(this),this.selectionManagers=[]}start(){this.started||(this.started=!0,document.addEventListener("selectionchange",this.update,!0))}stop(){if(this.started)return this.started=!1,document.removeEventListener("selectionchange",this.update,!0)}registerSelectionManager(Ce){if(!this.selectionManagers.includes(Ce))return this.selectionManagers.push(Ce),this.start()}unregisterSelectionManager(Ce){if(this.selectionManagers=this.selectionManagers.filter(ke=>ke!==Ce),this.selectionManagers.length===0)return this.stop()}notifySelectionManagersOfSelectionChange(){return this.selectionManagers.map(Ce=>Ce.selectionDidChange())}update(){this.notifySelectionManagersOfSelectionChange()}reset(){this.update()}}const Pt=new Ft,It=function(){const _n=window.getSelection();if(_n.rangeCount>0)return _n},Nt=function(){var _n;const Ce=(_n=It())===null||_n===void 0?void 0:_n.getRangeAt(0);if(Ce&&!Mt(Ce))return Ce},Ot=function(_n){const Ce=window.getSelection();return Ce.removeAllRanges(),Ce.addRange(_n),Pt.update()},Mt=_n=>jt(_n.startContainer)||jt(_n.endContainer),jt=_n=>!Object.getPrototypeOf(_n),Wt=_n=>_n.replace(new RegExp("".concat(h),"g"),"").replace(new RegExp("".concat(d),"g")," "),Ut=new RegExp("[^\\S".concat(d,"]")),qt=_n=>_n.replace(new RegExp("".concat(Ut.source),"g")," ").replace(/\ {2,}/g," "),Vt=function(_n,Ce){if(_n.isEqualTo(Ce))return["",""];const ke=Ht(_n,Ce),{length:$n}=ke.utf16String;let Hn;if($n){const{offset:zn}=ke,Un=_n.codepoints.slice(0,zn).concat(_n.codepoints.slice(zn+$n));Hn=Ht(Ce,X.fromCodepoints(Un))}else Hn=Ht(Ce,_n);return[ke.utf16String.toString(),Hn.utf16String.toString()]},Ht=function(_n,Ce){let ke=0,$n=_n.length,Hn=Ce.length;for(;ke<$n&&_n.charAt(ke).isEqualTo(Ce.charAt(ke));)ke++;for(;$n>ke+1&&_n.charAt($n-1).isEqualTo(Ce.charAt(Hn-1));)$n--,Hn--;return{utf16String:_n.slice(ke,$n),offset:ke}};class zt extends nt{static fromCommonAttributesOfObjects(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(!Ce.length)return new this;let ke=Gt(Ce[0]),$n=ke.getKeys();return Ce.slice(1).forEach(Hn=>{$n=ke.getKeysCommonToHash(Gt(Hn)),ke=ke.slice($n)}),ke}static box(Ce){return Gt(Ce)}constructor(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(...arguments),this.values=Kt(Ce)}add(Ce,ke){return this.merge(_t(Ce,ke))}remove(Ce){return new zt(Kt(this.values,Ce))}get(Ce){return this.values[Ce]}has(Ce){return Ce in this.values}merge(Ce){return new zt(Jt(this.values,$t(Ce)))}slice(Ce){const ke={};return Array.from(Ce).forEach($n=>{this.has($n)&&(ke[$n]=this.values[$n])}),new zt(ke)}getKeys(){return Object.keys(this.values)}getKeysCommonToHash(Ce){return Ce=Gt(Ce),this.getKeys().filter(ke=>this.values[ke]===Ce.values[ke])}isEqualTo(Ce){return rt(this.toArray(),Gt(Ce).toArray())}isEmpty(){return this.getKeys().length===0}toArray(){if(!this.array){const Ce=[];for(const ke in this.values){const $n=this.values[ke];Ce.push(Ce.push(ke,$n))}this.array=Ce.slice(0)}return this.array}toObject(){return Kt(this.values)}toJSON(){return this.toObject()}contentsForInspection(){return{values:JSON.stringify(this.values)}}}const _t=function(_n,Ce){const ke={};return ke[_n]=Ce,ke},Jt=function(_n,Ce){const ke=Kt(_n);for(const $n in Ce){const Hn=Ce[$n];ke[$n]=Hn}return ke},Kt=function(_n,Ce){const ke={};return Object.keys(_n).sort().forEach($n=>{$n!==Ce&&(ke[$n]=_n[$n])}),ke},Gt=function(_n){return _n instanceof zt?_n:new zt(_n)},$t=function(_n){return _n instanceof zt?_n.values:_n};class Xt{static groupObjects(){let Ce,ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{depth:$n,asTree:Hn}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Hn&&$n==null&&($n=0);const zn=[];return Array.from(ke).forEach(Un=>{var qn;if(Ce){var Xn,Kn,to;if((Xn=Un.canBeGrouped)!==null&&Xn!==void 0&&Xn.call(Un,$n)&&(Kn=(to=Ce[Ce.length-1]).canBeGroupedWith)!==null&&Kn!==void 0&&Kn.call(to,Un,$n))return void Ce.push(Un);zn.push(new this(Ce,{depth:$n,asTree:Hn})),Ce=null}(qn=Un.canBeGrouped)!==null&&qn!==void 0&&qn.call(Un,$n)?Ce=[Un]:zn.push(Un)}),Ce&&zn.push(new this(Ce,{depth:$n,asTree:Hn})),zn}constructor(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{depth:ke,asTree:$n}=arguments.length>1?arguments[1]:void 0;this.objects=Ce,$n&&(this.depth=ke,this.objects=this.constructor.groupObjects(this.objects,{asTree:$n,depth:this.depth+1}))}getObjects(){return this.objects}getDepth(){return this.depth}getCacheKey(){const Ce=["objectGroup"];return Array.from(this.getObjects()).forEach(ke=>{Ce.push(ke.getCacheKey())}),Ce.join("/")}}class Yt extends H{constructor(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.objects={},Array.from(Ce).forEach(ke=>{const $n=JSON.stringify(ke);this.objects[$n]==null&&(this.objects[$n]=ke)})}find(Ce){const ke=JSON.stringify(Ce);return this.objects[ke]}}class Qt{constructor(Ce){this.reset(Ce)}add(Ce){const ke=Zt(Ce);this.elements[ke]=Ce}remove(Ce){const ke=Zt(Ce),$n=this.elements[ke];if($n)return delete this.elements[ke],$n}reset(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return this.elements={},Array.from(Ce).forEach(ke=>{this.add(ke)}),Ce}}const Zt=_n=>_n.dataset.trixStoreKey;class te extends H{isPerforming(){return this.performing===!0}hasPerformed(){return this.performed===!0}hasSucceeded(){return this.performed&&this.succeeded}hasFailed(){return this.performed&&!this.succeeded}getPromise(){return this.promise||(this.promise=new Promise((Ce,ke)=>(this.performing=!0,this.perform(($n,Hn)=>{this.succeeded=$n,this.performing=!1,this.performed=!0,this.succeeded?Ce(Hn):ke(Hn)})))),this.promise}perform(Ce){return Ce(!1)}release(){var Ce,ke;(Ce=this.promise)===null||Ce===void 0||(ke=Ce.cancel)===null||ke===void 0||ke.call(Ce),this.promise=null,this.performing=null,this.performed=null,this.succeeded=null}}te.proxyMethod("getPromise().then"),te.proxyMethod("getPromise().catch");class ee extends H{constructor(Ce){let ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.object=Ce,this.options=ke,this.childViews=[],this.rootView=this}getNodes(){return this.nodes||(this.nodes=this.createNodes()),this.nodes.map(Ce=>Ce.cloneNode(!0))}invalidate(){var Ce;return this.nodes=null,this.childViews=[],(Ce=this.parentView)===null||Ce===void 0?void 0:Ce.invalidate()}invalidateViewForObject(Ce){var ke;return(ke=this.findViewForObject(Ce))===null||ke===void 0?void 0:ke.invalidate()}findOrCreateCachedChildView(Ce,ke,$n){let Hn=this.getCachedViewForObject(ke);return Hn?this.recordChildView(Hn):(Hn=this.createChildView(...arguments),this.cacheViewForObject(Hn,ke)),Hn}createChildView(Ce,ke){let $n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};ke instanceof Xt&&($n.viewClass=Ce,Ce=ie$2);const Hn=new Ce(ke,$n);return this.recordChildView(Hn)}recordChildView(Ce){return Ce.parentView=this,Ce.rootView=this.rootView,this.childViews.push(Ce),Ce}getAllChildViews(){let Ce=[];return this.childViews.forEach(ke=>{Ce.push(ke),Ce=Ce.concat(ke.getAllChildViews())}),Ce}findElement(){return this.findElementForObject(this.object)}findElementForObject(Ce){const ke=Ce==null?void 0:Ce.id;if(ke)return this.rootView.element.querySelector("[data-trix-id='".concat(ke,"']"))}findViewForObject(Ce){for(const ke of this.getAllChildViews())if(ke.object===Ce)return ke}getViewCache(){return this.rootView!==this?this.rootView.getViewCache():this.isViewCachingEnabled()?(this.viewCache||(this.viewCache={}),this.viewCache):void 0}isViewCachingEnabled(){return this.shouldCacheViews!==!1}enableViewCaching(){this.shouldCacheViews=!0}disableViewCaching(){this.shouldCacheViews=!1}getCachedViewForObject(Ce){var ke;return(ke=this.getViewCache())===null||ke===void 0?void 0:ke[Ce.getCacheKey()]}cacheViewForObject(Ce,ke){const $n=this.getViewCache();$n&&($n[ke.getCacheKey()]=Ce)}garbageCollectCachedViews(){const Ce=this.getViewCache();if(Ce){const ke=this.getAllChildViews().concat(this).map($n=>$n.object.getCacheKey());for(const $n in Ce)ke.includes($n)||delete Ce[$n]}}}let ie$2=class extends ee{constructor(){super(...arguments),this.objectGroup=this.object,this.viewClass=this.options.viewClass,delete this.options.viewClass}getChildViews(){return this.childViews.length||Array.from(this.objectGroup.getObjects()).forEach(Ce=>{this.findOrCreateCachedChildView(this.viewClass,Ce,this.options)}),this.childViews}createNodes(){const Ce=this.createContainerElement();return this.getChildViews().forEach(ke=>{Array.from(ke.getNodes()).forEach($n=>{Ce.appendChild($n)})}),[Ce]}createContainerElement(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.objectGroup.getDepth();return this.getChildViews()[0].createContainerElement(Ce)}};const ne="style href src width height language class".split(" "),re="javascript:".split(" "),oe="script iframe form noscript".split(" ");class se extends H{static setHTML(Ce,ke){const $n=new this(ke).sanitize(),Hn=$n.getHTML?$n.getHTML():$n.outerHTML;Ce.innerHTML=Hn}static sanitize(Ce,ke){const $n=new this(Ce,ke);return $n.sanitize(),$n}constructor(Ce){let{allowedAttributes:ke,forbiddenProtocols:$n,forbiddenElements:Hn}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.allowedAttributes=ke||ne,this.forbiddenProtocols=$n||re,this.forbiddenElements=Hn||oe,this.body=ae(Ce)}sanitize(){return this.sanitizeElements(),this.normalizeListElementNesting()}getHTML(){return this.body.innerHTML}getBody(){return this.body}sanitizeElements(){const Ce=R(this.body),ke=[];for(;Ce.nextNode();){const $n=Ce.currentNode;switch($n.nodeType){case Node.ELEMENT_NODE:this.elementIsRemovable($n)?ke.push($n):this.sanitizeElement($n);break;case Node.COMMENT_NODE:ke.push($n)}}return ke.forEach($n=>k($n)),this.body}sanitizeElement(Ce){return Ce.hasAttribute("href")&&this.forbiddenProtocols.includes(Ce.protocol)&&Ce.removeAttribute("href"),Array.from(Ce.attributes).forEach(ke=>{let{name:$n}=ke;this.allowedAttributes.includes($n)||$n.indexOf("data-trix")===0||Ce.removeAttribute($n)}),Ce}normalizeListElementNesting(){return Array.from(this.body.querySelectorAll("ul,ol")).forEach(Ce=>{const ke=Ce.previousElementSibling;ke&&E(ke)==="li"&&ke.appendChild(Ce)}),this.body}elementIsRemovable(Ce){if((Ce==null?void 0:Ce.nodeType)===Node.ELEMENT_NODE)return this.elementIsForbidden(Ce)||this.elementIsntSerializable(Ce)}elementIsForbidden(Ce){return this.forbiddenElements.includes(E(Ce))}elementIsntSerializable(Ce){return Ce.getAttribute("data-trix-serialize")==="false"&&!I(Ce)}}const ae=function(){let _n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";_n=_n.replace(/<\/html[^>]*>[^]*$/i,"");const Ce=document.implementation.createHTMLDocument("");return Ce.documentElement.innerHTML=_n,Array.from(Ce.head.querySelectorAll("style")).forEach(ke=>{Ce.body.appendChild(ke)}),Ce.body},{css:le}=V;class ce extends ee{constructor(){super(...arguments),this.attachment=this.object,this.attachment.uploadProgressDelegate=this,this.attachmentPiece=this.options.piece}createContentNodes(){return[]}createNodes(){let Ce;const ke=Ce=S$1({tagName:"figure",className:this.getClassName(),data:this.getData(),editable:!1}),$n=this.getHref();return $n&&(Ce=S$1({tagName:"a",editable:!1,attributes:{href:$n,tabindex:-1}}),ke.appendChild(Ce)),this.attachment.hasContent()?se.setHTML(Ce,this.attachment.getContent()):this.createContentNodes().forEach(Hn=>{Ce.appendChild(Hn)}),Ce.appendChild(this.createCaptionElement()),this.attachment.isPending()&&(this.progressElement=S$1({tagName:"progress",attributes:{class:le.attachmentProgress,value:this.attachment.getUploadProgress(),max:100},data:{trixMutable:!0,trixStoreKey:["progressElement",this.attachment.id].join("/")}}),ke.appendChild(this.progressElement)),[ue("left"),ke,ue("right")]}createCaptionElement(){const Ce=S$1({tagName:"figcaption",className:le.attachmentCaption}),ke=this.attachmentPiece.getCaption();if(ke)Ce.classList.add("".concat(le.attachmentCaption,"--edited")),Ce.textContent=ke;else{let $n,Hn;const zn=this.getCaptionConfig();if(zn.name&&($n=this.attachment.getFilename()),zn.size&&(Hn=this.attachment.getFormattedFilesize()),$n){const Un=S$1({tagName:"span",className:le.attachmentName,textContent:$n});Ce.appendChild(Un)}if(Hn){$n&&Ce.appendChild(document.createTextNode(" "));const Un=S$1({tagName:"span",className:le.attachmentSize,textContent:Hn});Ce.appendChild(Un)}}return Ce}getClassName(){const Ce=[le.attachment,"".concat(le.attachment,"--").concat(this.attachment.getType())],ke=this.attachment.getExtension();return ke&&Ce.push("".concat(le.attachment,"--").concat(ke)),Ce.join(" ")}getData(){const Ce={trixAttachment:JSON.stringify(this.attachment),trixContentType:this.attachment.getContentType(),trixId:this.attachment.id},{attributes:ke}=this.attachmentPiece;return ke.isEmpty()||(Ce.trixAttributes=JSON.stringify(ke)),this.attachment.isPending()&&(Ce.trixSerialize=!1),Ce}getHref(){if(!he(this.attachment.getContent(),"a"))return this.attachment.getHref()}getCaptionConfig(){var Ce;const ke=this.attachment.getType(),$n=Et((Ce=i$1[ke])===null||Ce===void 0?void 0:Ce.caption);return ke==="file"&&($n.name=!0),$n}findProgressElement(){var Ce;return(Ce=this.findElement())===null||Ce===void 0?void 0:Ce.querySelector("progress")}attachmentDidChangeUploadProgress(){const Ce=this.attachment.getUploadProgress(),ke=this.findProgressElement();ke&&(ke.value=Ce)}}const ue=_n=>S$1({tagName:"span",textContent:h,data:{trixCursorTarget:_n,trixSerialize:!1}}),he=function(_n,Ce){const ke=S$1("div");return se.setHTML(ke,_n||""),ke.querySelector(Ce)};class de extends ce{constructor(){super(...arguments),this.attachment.previewDelegate=this}createContentNodes(){return this.image=S$1({tagName:"img",attributes:{src:""},data:{trixMutable:!0}}),this.refresh(this.image),[this.image]}createCaptionElement(){const Ce=super.createCaptionElement(...arguments);return Ce.textContent||Ce.setAttribute("data-trix-placeholder",l.captionPlaceholder),Ce}refresh(Ce){var ke;if(Ce||(Ce=(ke=this.findElement())===null||ke===void 0?void 0:ke.querySelector("img")),Ce)return this.updateAttributesForImage(Ce)}updateAttributesForImage(Ce){const ke=this.attachment.getURL(),$n=this.attachment.getPreviewURL();if(Ce.src=$n||ke,$n===ke)Ce.removeAttribute("data-trix-serialized-attributes");else{const qn=JSON.stringify({src:ke});Ce.setAttribute("data-trix-serialized-attributes",qn)}const Hn=this.attachment.getWidth(),zn=this.attachment.getHeight();Hn!=null&&(Ce.width=Hn),zn!=null&&(Ce.height=zn);const Un=["imageElement",this.attachment.id,Ce.src,Ce.width,Ce.height].join("/");Ce.dataset.trixStoreKey=Un}attachmentDidChangeAttributes(){return this.refresh(this.image),this.refresh()}}class ge extends ee{constructor(){super(...arguments),this.piece=this.object,this.attributes=this.piece.getAttributes(),this.textConfig=this.options.textConfig,this.context=this.options.context,this.piece.attachment?this.attachment=this.piece.attachment:this.string=this.piece.toString()}createNodes(){let Ce=this.attachment?this.createAttachmentNodes():this.createStringNodes();const ke=this.createElement();if(ke){const $n=function(Hn){for(;(zn=Hn)!==null&&zn!==void 0&&zn.firstElementChild;){var zn;Hn=Hn.firstElementChild}return Hn}(ke);Array.from(Ce).forEach(Hn=>{$n.appendChild(Hn)}),Ce=[ke]}return Ce}createAttachmentNodes(){const Ce=this.attachment.isPreviewable()?de:ce;return this.createChildView(Ce,this.piece.attachment,{piece:this.piece}).getNodes()}createStringNodes(){var Ce;if((Ce=this.textConfig)!==null&&Ce!==void 0&&Ce.plaintext)return[document.createTextNode(this.string)];{const ke=[],$n=this.string.split(` +`);for(let Hn=0;Hn<$n.length;Hn++){const zn=$n[Hn];if(Hn>0){const Un=S$1("br");ke.push(Un)}if(zn.length){const Un=document.createTextNode(this.preserveSpaces(zn));ke.push(Un)}}return ke}}createElement(){let Ce,ke,$n;const Hn={};for(ke in this.attributes){$n=this.attributes[ke];const Un=pt(ke);if(Un){if(Un.tagName){var zn;const qn=S$1(Un.tagName);zn?(zn.appendChild(qn),zn=qn):Ce=zn=qn}if(Un.styleProperty&&(Hn[Un.styleProperty]=$n),Un.style)for(ke in Un.style)$n=Un.style[ke],Hn[ke]=$n}}if(Object.keys(Hn).length)for(ke in Ce||(Ce=S$1("span")),Hn)$n=Hn[ke],Ce.style[ke]=$n;return Ce}createContainerElement(){for(const Ce in this.attributes){const ke=this.attributes[Ce],$n=pt(Ce);if($n&&$n.groupTagName){const Hn={};return Hn[Ce]=ke,S$1($n.groupTagName,Hn)}}}preserveSpaces(Ce){return this.context.isLast&&(Ce=Ce.replace(/\ $/,d)),Ce=Ce.replace(/(\S)\ {3}(\S)/g,"$1 ".concat(d," $2")).replace(/\ {2}/g,"".concat(d," ")).replace(/\ {2}/g," ".concat(d)),(this.context.isFirst||this.context.followsWhitespace)&&(Ce=Ce.replace(/^\ /,d)),Ce}}class me extends ee{constructor(){super(...arguments),this.text=this.object,this.textConfig=this.options.textConfig}createNodes(){const Ce=[],ke=Xt.groupObjects(this.getPieces()),$n=ke.length-1;for(let zn=0;zn!Ce.hasAttribute("blockBreak"))}}const pe=_n=>/\s$/.test(_n==null?void 0:_n.toString()),{css:fe}=V;class be extends ee{constructor(){super(...arguments),this.block=this.object,this.attributes=this.block.getAttributes()}createNodes(){const Ce=[document.createComment("block")];if(this.block.isEmpty())Ce.push(S$1("br"));else{var ke;const $n=(ke=gt(this.block.getLastAttribute()))===null||ke===void 0?void 0:ke.text,Hn=this.findOrCreateCachedChildView(me,this.block.text,{textConfig:$n});Ce.push(...Array.from(Hn.getNodes()||[])),this.shouldAddExtraNewlineElement()&&Ce.push(S$1("br"))}if(this.attributes.length)return Ce;{let $n;const{tagName:Hn}=n.default;this.block.isRTL()&&($n={dir:"rtl"});const zn=S$1({tagName:Hn,attributes:$n});return Ce.forEach(Un=>zn.appendChild(Un)),[zn]}}createContainerElement(Ce){const ke={};let $n;const Hn=this.attributes[Ce],{tagName:zn,htmlAttributes:Un=[]}=gt(Hn);if(Ce===0&&this.block.isRTL()&&Object.assign(ke,{dir:"rtl"}),Hn==="attachmentGallery"){const qn=this.block.getBlockBreakPosition();$n="".concat(fe.attachmentGallery," ").concat(fe.attachmentGallery,"--").concat(qn)}return Object.entries(this.block.htmlAttributes).forEach(qn=>{let[Xn,Kn]=qn;Un.includes(Xn)&&(ke[Xn]=Kn)}),S$1({tagName:zn,className:$n,attributes:ke})}shouldAddExtraNewlineElement(){return/\n\n$/.test(this.block.toString())}}class ve extends ee{static render(Ce){const ke=S$1("div"),$n=new this(Ce,{element:ke});return $n.render(),$n.sync(),ke}constructor(){super(...arguments),this.element=this.options.element,this.elementStore=new Qt,this.setDocument(this.object)}setDocument(Ce){Ce.isEqualTo(this.document)||(this.document=this.object=Ce)}render(){if(this.childViews=[],this.shadowElement=S$1("div"),!this.document.isEmpty()){const Ce=Xt.groupObjects(this.document.getBlocks(),{asTree:!0});Array.from(Ce).forEach(ke=>{const $n=this.findOrCreateCachedChildView(be,ke);Array.from($n.getNodes()).map(Hn=>this.shadowElement.appendChild(Hn))})}}isSynced(){return xe(this.shadowElement,this.element)}sync(){const Ce=this.createDocumentFragmentForSync();for(;this.element.lastChild;)this.element.removeChild(this.element.lastChild);return this.element.appendChild(Ce),this.didSync()}didSync(){return this.elementStore.reset(Ae(this.element)),Rt(()=>this.garbageCollectCachedViews())}createDocumentFragmentForSync(){const Ce=document.createDocumentFragment();return Array.from(this.shadowElement.childNodes).forEach(ke=>{Ce.appendChild(ke.cloneNode(!0))}),Array.from(Ae(Ce)).forEach(ke=>{const $n=this.elementStore.remove(ke);$n&&ke.parentNode.replaceChild($n,ke)}),Ce}}const Ae=_n=>_n.querySelectorAll("[data-trix-store-key]"),xe=(_n,Ce)=>ye(_n.innerHTML)===ye(Ce.innerHTML),ye=_n=>_n.replace(/ /g," ");function Re(_n,Ce,ke){return(Ce=Ee(Ce))in _n?Object.defineProperty(_n,Ce,{value:ke,enumerable:!0,configurable:!0,writable:!0}):_n[Ce]=ke,_n}function Ee(_n){var Ce=function(ke,$n){if(typeof ke!="object"||ke===null)return ke;var Hn=ke[Symbol.toPrimitive];if(Hn!==void 0){var zn=Hn.call(ke,$n||"default");if(typeof zn!="object")return zn;throw new TypeError("@@toPrimitive must return a primitive value.")}return($n==="string"?String:Number)(ke)}(_n,"string");return typeof Ce=="symbol"?Ce:String(Ce)}class Se extends nt{static registerType(Ce,ke){ke.type=Ce,this.types[Ce]=ke}static fromJSON(Ce){const ke=this.types[Ce.type];if(ke)return ke.fromJSON(Ce)}constructor(Ce){let ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.attributes=zt.box(ke)}copyWithAttributes(Ce){return new this.constructor(this.getValue(),Ce)}copyWithAdditionalAttributes(Ce){return this.copyWithAttributes(this.attributes.merge(Ce))}copyWithoutAttribute(Ce){return this.copyWithAttributes(this.attributes.remove(Ce))}copy(){return this.copyWithAttributes(this.attributes)}getAttribute(Ce){return this.attributes.get(Ce)}getAttributesHash(){return this.attributes}getAttributes(){return this.attributes.toObject()}hasAttribute(Ce){return this.attributes.has(Ce)}hasSameStringValueAsPiece(Ce){return Ce&&this.toString()===Ce.toString()}hasSameAttributesAsPiece(Ce){return Ce&&(this.attributes===Ce.attributes||this.attributes.isEqualTo(Ce.attributes))}isBlockBreak(){return!1}isEqualTo(Ce){return super.isEqualTo(...arguments)||this.hasSameConstructorAs(Ce)&&this.hasSameStringValueAsPiece(Ce)&&this.hasSameAttributesAsPiece(Ce)}isEmpty(){return this.length===0}isSerializable(){return!0}toJSON(){return{type:this.constructor.type,attributes:this.getAttributes()}}contentsForInspection(){return{type:this.constructor.type,attributes:this.attributes.inspect()}}canBeGrouped(){return this.hasAttribute("href")}canBeGroupedWith(Ce){return this.getAttribute("href")===Ce.getAttribute("href")}getLength(){return this.length}canBeConsolidatedWith(Ce){return!1}}Re(Se,"types",{});class Le extends te{constructor(Ce){super(...arguments),this.url=Ce}perform(Ce){const ke=new Image;ke.onload=()=>(ke.width=this.width=ke.naturalWidth,ke.height=this.height=ke.naturalHeight,Ce(!0,ke)),ke.onerror=()=>Ce(!1),ke.src=this.url}}class De extends nt{static attachmentForFile(Ce){const ke=new this(this.attributesForFile(Ce));return ke.setFile(Ce),ke}static attributesForFile(Ce){return new zt({filename:Ce.name,filesize:Ce.size,contentType:Ce.type})}static fromJSON(Ce){return new this(Ce)}constructor(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(Ce),this.releaseFile=this.releaseFile.bind(this),this.attributes=zt.box(Ce),this.didChangeAttributes()}getAttribute(Ce){return this.attributes.get(Ce)}hasAttribute(Ce){return this.attributes.has(Ce)}getAttributes(){return this.attributes.toObject()}setAttributes(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const ke=this.attributes.merge(Ce);var $n,Hn,zn,Un;if(!this.attributes.isEqualTo(ke))return this.attributes=ke,this.didChangeAttributes(),($n=this.previewDelegate)===null||$n===void 0||(Hn=$n.attachmentDidChangeAttributes)===null||Hn===void 0||Hn.call($n,this),(zn=this.delegate)===null||zn===void 0||(Un=zn.attachmentDidChangeAttributes)===null||Un===void 0?void 0:Un.call(zn,this)}didChangeAttributes(){if(this.isPreviewable())return this.preloadURL()}isPending(){return this.file!=null&&!(this.getURL()||this.getHref())}isPreviewable(){return this.attributes.has("previewable")?this.attributes.get("previewable"):De.previewablePattern.test(this.getContentType())}getType(){return this.hasContent()?"content":this.isPreviewable()?"preview":"file"}getURL(){return this.attributes.get("url")}getHref(){return this.attributes.get("href")}getFilename(){return this.attributes.get("filename")||""}getFilesize(){return this.attributes.get("filesize")}getFormattedFilesize(){const Ce=this.attributes.get("filesize");return typeof Ce=="number"?u.formatter(Ce):""}getExtension(){var Ce;return(Ce=this.getFilename().match(/\.(\w+)$/))===null||Ce===void 0?void 0:Ce[1].toLowerCase()}getContentType(){return this.attributes.get("contentType")}hasContent(){return this.attributes.has("content")}getContent(){return this.attributes.get("content")}getWidth(){return this.attributes.get("width")}getHeight(){return this.attributes.get("height")}getFile(){return this.file}setFile(Ce){if(this.file=Ce,this.isPreviewable())return this.preloadFile()}releaseFile(){this.releasePreloadedFile(),this.file=null}getUploadProgress(){return this.uploadProgress!=null?this.uploadProgress:0}setUploadProgress(Ce){var ke,$n;if(this.uploadProgress!==Ce)return this.uploadProgress=Ce,(ke=this.uploadProgressDelegate)===null||ke===void 0||($n=ke.attachmentDidChangeUploadProgress)===null||$n===void 0?void 0:$n.call(ke,this)}toJSON(){return this.getAttributes()}getCacheKey(){return[super.getCacheKey(...arguments),this.attributes.getCacheKey(),this.getPreviewURL()].join("/")}getPreviewURL(){return this.previewURL||this.preloadingURL}setPreviewURL(Ce){var ke,$n,Hn,zn;if(Ce!==this.getPreviewURL())return this.previewURL=Ce,(ke=this.previewDelegate)===null||ke===void 0||($n=ke.attachmentDidChangeAttributes)===null||$n===void 0||$n.call(ke,this),(Hn=this.delegate)===null||Hn===void 0||(zn=Hn.attachmentDidChangePreviewURL)===null||zn===void 0?void 0:zn.call(Hn,this)}preloadURL(){return this.preload(this.getURL(),this.releaseFile)}preloadFile(){if(this.file)return this.fileObjectURL=URL.createObjectURL(this.file),this.preload(this.fileObjectURL)}releasePreloadedFile(){this.fileObjectURL&&(URL.revokeObjectURL(this.fileObjectURL),this.fileObjectURL=null)}preload(Ce,ke){if(Ce&&Ce!==this.getPreviewURL())return this.preloadingURL=Ce,new Le(Ce).then($n=>{let{width:Hn,height:zn}=$n;return this.getWidth()&&this.getHeight()||this.setAttributes({width:Hn,height:zn}),this.preloadingURL=null,this.setPreviewURL(Ce),ke==null?void 0:ke()}).catch(()=>(this.preloadingURL=null,ke==null?void 0:ke()))}}Re(De,"previewablePattern",/^image(\/(gif|png|webp|jpe?g)|$)/);class we extends Se{static fromJSON(Ce){return new this(De.fromJSON(Ce.attachment),Ce.attributes)}constructor(Ce){super(...arguments),this.attachment=Ce,this.length=1,this.ensureAttachmentExclusivelyHasAttribute("href"),this.attachment.hasContent()||this.removeProhibitedAttributes()}ensureAttachmentExclusivelyHasAttribute(Ce){this.hasAttribute(Ce)&&(this.attachment.hasAttribute(Ce)||this.attachment.setAttributes(this.attributes.slice([Ce])),this.attributes=this.attributes.remove(Ce))}removeProhibitedAttributes(){const Ce=this.attributes.slice(we.permittedAttributes);Ce.isEqualTo(this.attributes)||(this.attributes=Ce)}getValue(){return this.attachment}isSerializable(){return!this.attachment.isPending()}getCaption(){return this.attributes.get("caption")||""}isEqualTo(Ce){var ke;return super.isEqualTo(Ce)&&this.attachment.id===(Ce==null||(ke=Ce.attachment)===null||ke===void 0?void 0:ke.id)}toString(){return""}toJSON(){const Ce=super.toJSON(...arguments);return Ce.attachment=this.attachment,Ce}getCacheKey(){return[super.getCacheKey(...arguments),this.attachment.getCacheKey()].join("/")}toConsole(){return JSON.stringify(this.toString())}}Re(we,"permittedAttributes",["caption","presentation"]),Se.registerType("attachment",we);class Te extends Se{static fromJSON(Ce){return new this(Ce.string,Ce.attributes)}constructor(Ce){super(...arguments),this.string=(ke=>ke.replace(/\r\n?/g,` +`))(Ce),this.length=this.string.length}getValue(){return this.string}toString(){return this.string.toString()}isBlockBreak(){return this.toString()===` +`&&this.getAttribute("blockBreak")===!0}toJSON(){const Ce=super.toJSON(...arguments);return Ce.string=this.string,Ce}canBeConsolidatedWith(Ce){return Ce&&this.hasSameConstructorAs(Ce)&&this.hasSameAttributesAsPiece(Ce)}consolidateWith(Ce){return new this.constructor(this.toString()+Ce.toString(),this.attributes)}splitAtOffset(Ce){let ke,$n;return Ce===0?(ke=null,$n=this):Ce===this.length?(ke=this,$n=null):(ke=new this.constructor(this.string.slice(0,Ce),this.attributes),$n=new this.constructor(this.string.slice(Ce),this.attributes)),[ke,$n]}toConsole(){let{string:Ce}=this;return Ce.length>15&&(Ce=Ce.slice(0,14)+"…"),JSON.stringify(Ce.toString())}}Se.registerType("string",Te);class Be extends nt{static box(Ce){return Ce instanceof this?Ce:new this(Ce)}constructor(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.objects=Ce.slice(0),this.length=this.objects.length}indexOf(Ce){return this.objects.indexOf(Ce)}splice(){for(var Ce=arguments.length,ke=new Array(Ce),$n=0;$nCe(ke,$n))}insertObjectAtIndex(Ce,ke){return this.splice(ke,0,Ce)}insertSplittableListAtIndex(Ce,ke){return this.splice(ke,0,...Ce.objects)}insertSplittableListAtPosition(Ce,ke){const[$n,Hn]=this.splitObjectAtPosition(ke);return new this.constructor($n).insertSplittableListAtIndex(Ce,Hn)}editObjectAtIndex(Ce,ke){return this.replaceObjectAtIndex(ke(this.objects[Ce]),Ce)}replaceObjectAtIndex(Ce,ke){return this.splice(ke,1,Ce)}removeObjectAtIndex(Ce){return this.splice(Ce,1)}getObjectAtIndex(Ce){return this.objects[Ce]}getSplittableListInRange(Ce){const[ke,$n,Hn]=this.splitObjectsAtRange(Ce);return new this.constructor(ke.slice($n,Hn+1))}selectSplittableList(Ce){const ke=this.objects.filter($n=>Ce($n));return new this.constructor(ke)}removeObjectsInRange(Ce){const[ke,$n,Hn]=this.splitObjectsAtRange(Ce);return new this.constructor(ke).splice($n,Hn-$n+1)}transformObjectsInRange(Ce,ke){const[$n,Hn,zn]=this.splitObjectsAtRange(Ce),Un=$n.map((qn,Xn)=>Hn<=Xn&&Xn<=zn?ke(qn):qn);return new this.constructor(Un)}splitObjectsAtRange(Ce){let ke,[$n,Hn,zn]=this.splitObjectAtPosition(Pe(Ce));return[$n,ke]=new this.constructor($n).splitObjectAtPosition(Ie(Ce)+zn),[$n,Hn,ke-1]}getObjectAtPosition(Ce){const{index:ke}=this.findIndexAndOffsetAtPosition(Ce);return this.objects[ke]}splitObjectAtPosition(Ce){let ke,$n;const{index:Hn,offset:zn}=this.findIndexAndOffsetAtPosition(Ce),Un=this.objects.slice(0);if(Hn!=null)if(zn===0)ke=Hn,$n=0;else{const qn=this.getObjectAtIndex(Hn),[Xn,Kn]=qn.splitAtOffset(zn);Un.splice(Hn,1,Xn,Kn),ke=Hn+1,$n=Xn.getLength()-zn}else ke=Un.length,$n=0;return[Un,ke,$n]}consolidate(){const Ce=[];let ke=this.objects[0];return this.objects.slice(1).forEach($n=>{var Hn,zn;(Hn=(zn=ke).canBeConsolidatedWith)!==null&&Hn!==void 0&&Hn.call(zn,$n)?ke=ke.consolidateWith($n):(Ce.push(ke),ke=$n)}),ke&&Ce.push(ke),new this.constructor(Ce)}consolidateFromIndexToIndex(Ce,ke){const $n=this.objects.slice(0).slice(Ce,ke+1),Hn=new this.constructor($n).consolidate().toArray();return this.splice(Ce,$n.length,...Hn)}findIndexAndOffsetAtPosition(Ce){let ke,$n=0;for(ke=0;kethis.endPosition+=Ce.getLength())),this.endPosition}toString(){return this.objects.join("")}toArray(){return this.objects.slice(0)}toJSON(){return this.toArray()}isEqualTo(Ce){return super.isEqualTo(...arguments)||Fe(this.objects,Ce==null?void 0:Ce.objects)}contentsForInspection(){return{objects:"[".concat(this.objects.map(Ce=>Ce.inspect()).join(", "),"]")}}}const Fe=function(_n){let Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(_n.length!==Ce.length)return!1;let ke=!0;for(let $n=0;$n<_n.length;$n++){const Hn=_n[$n];ke&&!Hn.isEqualTo(Ce[$n])&&(ke=!1)}return ke},Pe=_n=>_n[0],Ie=_n=>_n[1];class Ne extends nt{static textForAttachmentWithAttributes(Ce,ke){return new this([new we(Ce,ke)])}static textForStringWithAttributes(Ce,ke){return new this([new Te(Ce,ke)])}static fromJSON(Ce){return new this(Array.from(Ce).map(ke=>Se.fromJSON(ke)))}constructor(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments);const ke=Ce.filter($n=>!$n.isEmpty());this.pieceList=new Be(ke)}copy(){return this.copyWithPieceList(this.pieceList)}copyWithPieceList(Ce){return new this.constructor(Ce.consolidate().toArray())}copyUsingObjectMap(Ce){const ke=this.getPieces().map($n=>Ce.find($n)||$n);return new this.constructor(ke)}appendText(Ce){return this.insertTextAtPosition(Ce,this.getLength())}insertTextAtPosition(Ce,ke){return this.copyWithPieceList(this.pieceList.insertSplittableListAtPosition(Ce.pieceList,ke))}removeTextAtRange(Ce){return this.copyWithPieceList(this.pieceList.removeObjectsInRange(Ce))}replaceTextAtRange(Ce,ke){return this.removeTextAtRange(ke).insertTextAtPosition(Ce,ke[0])}moveTextFromRangeToPosition(Ce,ke){if(Ce[0]<=ke&&ke<=Ce[1])return;const $n=this.getTextAtRange(Ce),Hn=$n.getLength();return Ce[0]$n.copyWithAdditionalAttributes(Ce)))}removeAttributeAtRange(Ce,ke){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(ke,$n=>$n.copyWithoutAttribute(Ce)))}setAttributesAtRange(Ce,ke){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(ke,$n=>$n.copyWithAttributes(Ce)))}getAttributesAtPosition(Ce){var ke;return((ke=this.pieceList.getObjectAtPosition(Ce))===null||ke===void 0?void 0:ke.getAttributes())||{}}getCommonAttributes(){const Ce=Array.from(this.pieceList.toArray()).map(ke=>ke.getAttributes());return zt.fromCommonAttributesOfObjects(Ce).toObject()}getCommonAttributesAtRange(Ce){return this.getTextAtRange(Ce).getCommonAttributes()||{}}getExpandedRangeForAttributeAtOffset(Ce,ke){let $n,Hn=$n=ke;const zn=this.getLength();for(;Hn>0&&this.getCommonAttributesAtRange([Hn-1,$n])[Ce];)Hn--;for(;$n!!Ce.attachment)}getAttachments(){return this.getAttachmentPieces().map(Ce=>Ce.attachment)}getAttachmentAndPositionById(Ce){let ke=0;for(const Hn of this.pieceList.toArray()){var $n;if((($n=Hn.attachment)===null||$n===void 0?void 0:$n.id)===Ce)return{attachment:Hn.attachment,position:ke};ke+=Hn.length}return{attachment:null,position:null}}getAttachmentById(Ce){const{attachment:ke}=this.getAttachmentAndPositionById(Ce);return ke}getRangeOfAttachment(Ce){const ke=this.getAttachmentAndPositionById(Ce.id),$n=ke.position;if(Ce=ke.attachment)return[$n,$n+1]}updateAttributesForAttachment(Ce,ke){const $n=this.getRangeOfAttachment(ke);return $n?this.addAttributesAtRange(Ce,$n):this}getLength(){return this.pieceList.getEndPosition()}isEmpty(){return this.getLength()===0}isEqualTo(Ce){var ke;return super.isEqualTo(Ce)||(Ce==null||(ke=Ce.pieceList)===null||ke===void 0?void 0:ke.isEqualTo(this.pieceList))}isBlockBreak(){return this.getLength()===1&&this.pieceList.getObjectAtIndex(0).isBlockBreak()}eachPiece(Ce){return this.pieceList.eachObject(Ce)}getPieces(){return this.pieceList.toArray()}getPieceAtPosition(Ce){return this.pieceList.getObjectAtPosition(Ce)}contentsForInspection(){return{pieceList:this.pieceList.inspect()}}toSerializableText(){const Ce=this.pieceList.selectSplittableList(ke=>ke.isSerializable());return this.copyWithPieceList(Ce)}toString(){return this.pieceList.toString()}toJSON(){return this.pieceList.toJSON()}toConsole(){return JSON.stringify(this.pieceList.toArray().map(Ce=>JSON.parse(Ce.toConsole())))}getDirection(){return at(this.toString())}isRTL(){return this.getDirection()==="rtl"}}class Oe extends nt{static fromJSON(Ce){return new this(Ne.fromJSON(Ce.text),Ce.attributes,Ce.htmlAttributes)}constructor(Ce,ke,$n){super(...arguments),this.text=Me(Ce||new Ne),this.attributes=ke||[],this.htmlAttributes=$n||{}}isEmpty(){return this.text.isBlockBreak()}isEqualTo(Ce){return!!super.isEqualTo(Ce)||this.text.isEqualTo(Ce==null?void 0:Ce.text)&&rt(this.attributes,Ce==null?void 0:Ce.attributes)&&St(this.htmlAttributes,Ce==null?void 0:Ce.htmlAttributes)}copyWithText(Ce){return new Oe(Ce,this.attributes,this.htmlAttributes)}copyWithoutText(){return this.copyWithText(null)}copyWithAttributes(Ce){return new Oe(this.text,Ce,this.htmlAttributes)}copyWithoutAttributes(){return this.copyWithAttributes(null)}copyUsingObjectMap(Ce){const ke=Ce.find(this.text);return ke?this.copyWithText(ke):this.copyWithText(this.text.copyUsingObjectMap(Ce))}addAttribute(Ce){const ke=this.attributes.concat(He(Ce));return this.copyWithAttributes(ke)}addHTMLAttribute(Ce,ke){const $n=Object.assign({},this.htmlAttributes,{[Ce]:ke});return new Oe(this.text,this.attributes,$n)}removeAttribute(Ce){const{listAttribute:ke}=gt(Ce),$n=_e(_e(this.attributes,Ce),ke);return this.copyWithAttributes($n)}removeLastAttribute(){return this.removeAttribute(this.getLastAttribute())}getLastAttribute(){return ze(this.attributes)}getAttributes(){return this.attributes.slice(0)}getAttributeLevel(){return this.attributes.length}getAttributeAtLevel(Ce){return this.attributes[Ce-1]}hasAttribute(Ce){return this.attributes.includes(Ce)}hasAttributes(){return this.getAttributeLevel()>0}getLastNestableAttribute(){return ze(this.getNestableAttributes())}getNestableAttributes(){return this.attributes.filter(Ce=>gt(Ce).nestable)}getNestingLevel(){return this.getNestableAttributes().length}decreaseNestingLevel(){const Ce=this.getLastNestableAttribute();return Ce?this.removeAttribute(Ce):this}increaseNestingLevel(){const Ce=this.getLastNestableAttribute();if(Ce){const ke=this.attributes.lastIndexOf(Ce),$n=ot(this.attributes,ke+1,0,...He(Ce));return this.copyWithAttributes($n)}return this}getListItemAttributes(){return this.attributes.filter(Ce=>gt(Ce).listAttribute)}isListItem(){var Ce;return(Ce=gt(this.getLastAttribute()))===null||Ce===void 0?void 0:Ce.listAttribute}isTerminalBlock(){var Ce;return(Ce=gt(this.getLastAttribute()))===null||Ce===void 0?void 0:Ce.terminal}breaksOnReturn(){var Ce;return(Ce=gt(this.getLastAttribute()))===null||Ce===void 0?void 0:Ce.breakOnReturn}findLineBreakInDirectionFromPosition(Ce,ke){const $n=this.toString();let Hn;switch(Ce){case"forward":Hn=$n.indexOf(` +`,ke);break;case"backward":Hn=$n.slice(0,ke).lastIndexOf(` +`)}if(Hn!==-1)return Hn}contentsForInspection(){return{text:this.text.inspect(),attributes:this.attributes}}toString(){return this.text.toString()}toJSON(){return{text:this.text,attributes:this.attributes,htmlAttributes:this.htmlAttributes}}getDirection(){return this.text.getDirection()}isRTL(){return this.text.isRTL()}getLength(){return this.text.getLength()}canBeConsolidatedWith(Ce){return!this.hasAttributes()&&!Ce.hasAttributes()&&this.getDirection()===Ce.getDirection()}consolidateWith(Ce){const ke=Ne.textForStringWithAttributes(` +`),$n=this.getTextWithoutBlockBreak().appendText(ke);return this.copyWithText($n.appendText(Ce.text))}splitAtOffset(Ce){let ke,$n;return Ce===0?(ke=null,$n=this):Ce===this.getLength()?(ke=this,$n=null):(ke=this.copyWithText(this.text.getTextAtRange([0,Ce])),$n=this.copyWithText(this.text.getTextAtRange([Ce,this.getLength()]))),[ke,$n]}getBlockBreakPosition(){return this.text.getLength()-1}getTextWithoutBlockBreak(){return qe(this.text)?this.text.getTextAtRange([0,this.getBlockBreakPosition()]):this.text.copy()}canBeGrouped(Ce){return this.attributes[Ce]}canBeGroupedWith(Ce,ke){const $n=Ce.getAttributes(),Hn=$n[ke],zn=this.attributes[ke];return zn===Hn&&!(gt(zn).group===!1&&!(()=>{if(!ht){ht=[];for(const Un in n){const{listAttribute:qn}=n[Un];qn!=null&&ht.push(qn)}}return ht})().includes($n[ke+1]))&&(this.getDirection()===Ce.getDirection()||Ce.isEmpty())}}const Me=function(_n){return _n=je(_n),_n=Ue(_n)},je=function(_n){let Ce=!1;const ke=_n.getPieces();let $n=ke.slice(0,ke.length-1);const Hn=ke[ke.length-1];return Hn?($n=$n.map(zn=>zn.isBlockBreak()?(Ce=!0,Ve(zn)):zn),Ce?new Ne([...$n,Hn]):_n):_n},We=Ne.textForStringWithAttributes(` +`,{blockBreak:!0}),Ue=function(_n){return qe(_n)?_n:_n.appendText(We)},qe=function(_n){const Ce=_n.getLength();return Ce===0?!1:_n.getTextAtRange([Ce-1,Ce]).isBlockBreak()},Ve=_n=>_n.copyWithoutAttribute("blockBreak"),He=function(_n){const{listAttribute:Ce}=gt(_n);return Ce?[Ce,_n]:[_n]},ze=_n=>_n.slice(-1)[0],_e=function(_n,Ce){const ke=_n.lastIndexOf(Ce);return ke===-1?_n:ot(_n,ke,1)};class Je extends nt{static fromJSON(Ce){return new this(Array.from(Ce).map(ke=>Oe.fromJSON(ke)))}static fromString(Ce,ke){const $n=Ne.textForStringWithAttributes(Ce,ke);return new this([new Oe($n)])}constructor(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),Ce.length===0&&(Ce=[new Oe]),this.blockList=Be.box(Ce)}isEmpty(){const Ce=this.getBlockAtIndex(0);return this.blockList.length===1&&Ce.isEmpty()&&!Ce.hasAttributes()}copy(){const Ce=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).consolidateBlocks?this.blockList.consolidate().toArray():this.blockList.toArray();return new this.constructor(Ce)}copyUsingObjectsFromDocument(Ce){const ke=new Yt(Ce.getObjects());return this.copyUsingObjectMap(ke)}copyUsingObjectMap(Ce){const ke=this.getBlocks().map($n=>Ce.find($n)||$n.copyUsingObjectMap(Ce));return new this.constructor(ke)}copyWithBaseBlockAttributes(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const ke=this.getBlocks().map($n=>{const Hn=Ce.concat($n.getAttributes());return $n.copyWithAttributes(Hn)});return new this.constructor(ke)}replaceBlock(Ce,ke){const $n=this.blockList.indexOf(Ce);return $n===-1?this:new this.constructor(this.blockList.replaceObjectAtIndex(ke,$n))}insertDocumentAtRange(Ce,ke){const{blockList:$n}=Ce;ke=Lt(ke);let[Hn]=ke;const{index:zn,offset:Un}=this.locationFromPosition(Hn);let qn=this;const Xn=this.getBlockAtPosition(Hn);return Dt(ke)&&Xn.isEmpty()&&!Xn.hasAttributes()?qn=new this.constructor(qn.blockList.removeObjectAtIndex(zn)):Xn.getBlockBreakPosition()===Un&&Hn++,qn=qn.removeTextAtRange(ke),new this.constructor(qn.blockList.insertSplittableListAtPosition($n,Hn))}mergeDocumentAtRange(Ce,ke){let $n,Hn;ke=Lt(ke);const[zn]=ke,Un=this.locationFromPosition(zn),qn=this.getBlockAtIndex(Un.index).getAttributes(),Xn=Ce.getBaseBlockAttributes(),Kn=qn.slice(-Xn.length);if(rt(Xn,Kn)){const uo=qn.slice(0,-Xn.length);$n=Ce.copyWithBaseBlockAttributes(uo)}else $n=Ce.copy({consolidateBlocks:!0}).copyWithBaseBlockAttributes(qn);const to=$n.getBlockCount(),io=$n.getBlockAtIndex(0);if(rt(qn,io.getAttributes())){const uo=io.getTextWithoutBlockBreak();if(Hn=this.insertTextAtRange(uo,ke),to>1){$n=new this.constructor($n.getBlocks().slice(1));const ho=zn+uo.getLength();Hn=Hn.insertDocumentAtRange($n,ho)}}else Hn=this.insertDocumentAtRange($n,ke);return Hn}insertTextAtRange(Ce,ke){ke=Lt(ke);const[$n]=ke,{index:Hn,offset:zn}=this.locationFromPosition($n),Un=this.removeTextAtRange(ke);return new this.constructor(Un.blockList.editObjectAtIndex(Hn,qn=>qn.copyWithText(qn.text.insertTextAtPosition(Ce,zn))))}removeTextAtRange(Ce){let ke;Ce=Lt(Ce);const[$n,Hn]=Ce;if(Dt(Ce))return this;const[zn,Un]=Array.from(this.locationRangeFromRange(Ce)),qn=zn.index,Xn=zn.offset,Kn=this.getBlockAtIndex(qn),to=Un.index,io=Un.offset,uo=this.getBlockAtIndex(to);if(Hn-$n==1&&Kn.getBlockBreakPosition()===Xn&&uo.getBlockBreakPosition()!==io&&uo.text.getStringAtPosition(io)===` +`)ke=this.blockList.editObjectAtIndex(to,ho=>ho.copyWithText(ho.text.removeTextAtRange([io,io+1])));else{let ho;const bo=Kn.text.getTextAtRange([0,Xn]),Oo=uo.text.getTextAtRange([io,uo.getLength()]),So=bo.appendText(Oo);ho=qn!==to&&Xn===0&&Kn.getAttributeLevel()>=uo.getAttributeLevel()?uo.copyWithText(So):Kn.copyWithText(So);const $o=to+1-qn;ke=this.blockList.splice(qn,$o,ho)}return new this.constructor(ke)}moveTextFromRangeToPosition(Ce,ke){let $n;Ce=Lt(Ce);const[Hn,zn]=Ce;if(Hn<=ke&&ke<=zn)return this;let Un=this.getDocumentAtRange(Ce),qn=this.removeTextAtRange(Ce);const Xn=HnHn=Hn.editObjectAtIndex(qn,function(){return gt(Ce)?zn.addAttribute(Ce,ke):Un[0]===Un[1]?zn:zn.copyWithText(zn.text.addAttributeAtRange(Ce,ke,Un))})),new this.constructor(Hn)}addAttribute(Ce,ke){let{blockList:$n}=this;return this.eachBlock((Hn,zn)=>$n=$n.editObjectAtIndex(zn,()=>Hn.addAttribute(Ce,ke))),new this.constructor($n)}removeAttributeAtRange(Ce,ke){let{blockList:$n}=this;return this.eachBlockAtRange(ke,function(Hn,zn,Un){gt(Ce)?$n=$n.editObjectAtIndex(Un,()=>Hn.removeAttribute(Ce)):zn[0]!==zn[1]&&($n=$n.editObjectAtIndex(Un,()=>Hn.copyWithText(Hn.text.removeAttributeAtRange(Ce,zn))))}),new this.constructor($n)}updateAttributesForAttachment(Ce,ke){const $n=this.getRangeOfAttachment(ke),[Hn]=Array.from($n),{index:zn}=this.locationFromPosition(Hn),Un=this.getTextAtIndex(zn);return new this.constructor(this.blockList.editObjectAtIndex(zn,qn=>qn.copyWithText(Un.updateAttributesForAttachment(Ce,ke))))}removeAttributeForAttachment(Ce,ke){const $n=this.getRangeOfAttachment(ke);return this.removeAttributeAtRange(Ce,$n)}setHTMLAttributeAtPosition(Ce,ke,$n){const Hn=this.getBlockAtPosition(Ce),zn=Hn.addHTMLAttribute(ke,$n);return this.replaceBlock(Hn,zn)}insertBlockBreakAtRange(Ce){let ke;Ce=Lt(Ce);const[$n]=Ce,{offset:Hn}=this.locationFromPosition($n),zn=this.removeTextAtRange(Ce);return Hn===0&&(ke=[new Oe]),new this.constructor(zn.blockList.insertSplittableListAtPosition(new Be(ke),$n))}applyBlockAttributeAtRange(Ce,ke,$n){const Hn=this.expandRangeToLineBreaksAndSplitBlocks($n);let zn=Hn.document;$n=Hn.range;const Un=gt(Ce);if(Un.listAttribute){zn=zn.removeLastListAttributeAtRange($n,{exceptAttributeName:Ce});const qn=zn.convertLineBreaksToBlockBreaksInRange($n);zn=qn.document,$n=qn.range}else zn=Un.exclusive?zn.removeBlockAttributesAtRange($n):Un.terminal?zn.removeLastTerminalAttributeAtRange($n):zn.consolidateBlocksAtRange($n);return zn.addAttributeAtRange(Ce,ke,$n)}removeLastListAttributeAtRange(Ce){let ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{blockList:$n}=this;return this.eachBlockAtRange(Ce,function(Hn,zn,Un){const qn=Hn.getLastAttribute();qn&>(qn).listAttribute&&qn!==ke.exceptAttributeName&&($n=$n.editObjectAtIndex(Un,()=>Hn.removeAttribute(qn)))}),new this.constructor($n)}removeLastTerminalAttributeAtRange(Ce){let{blockList:ke}=this;return this.eachBlockAtRange(Ce,function($n,Hn,zn){const Un=$n.getLastAttribute();Un&>(Un).terminal&&(ke=ke.editObjectAtIndex(zn,()=>$n.removeAttribute(Un)))}),new this.constructor(ke)}removeBlockAttributesAtRange(Ce){let{blockList:ke}=this;return this.eachBlockAtRange(Ce,function($n,Hn,zn){$n.hasAttributes()&&(ke=ke.editObjectAtIndex(zn,()=>$n.copyWithoutAttributes()))}),new this.constructor(ke)}expandRangeToLineBreaksAndSplitBlocks(Ce){let ke;Ce=Lt(Ce);let[$n,Hn]=Ce;const zn=this.locationFromPosition($n),Un=this.locationFromPosition(Hn);let qn=this;const Xn=qn.getBlockAtIndex(zn.index);if(zn.offset=Xn.findLineBreakInDirectionFromPosition("backward",zn.offset),zn.offset!=null&&(ke=qn.positionFromLocation(zn),qn=qn.insertBlockBreakAtRange([ke,ke+1]),Un.index+=1,Un.offset-=qn.getBlockAtIndex(zn.index).getLength(),zn.index+=1),zn.offset=0,Un.offset===0&&Un.index>zn.index)Un.index-=1,Un.offset=qn.getBlockAtIndex(Un.index).getBlockBreakPosition();else{const Kn=qn.getBlockAtIndex(Un.index);Kn.text.getStringAtRange([Un.offset-1,Un.offset])===` +`?Un.offset-=1:Un.offset=Kn.findLineBreakInDirectionFromPosition("forward",Un.offset),Un.offset!==Kn.getBlockBreakPosition()&&(ke=qn.positionFromLocation(Un),qn=qn.insertBlockBreakAtRange([ke,ke+1]))}return $n=qn.positionFromLocation(zn),Hn=qn.positionFromLocation(Un),{document:qn,range:Ce=Lt([$n,Hn])}}convertLineBreaksToBlockBreaksInRange(Ce){Ce=Lt(Ce);let[ke]=Ce;const $n=this.getStringAtRange(Ce).slice(0,-1);let Hn=this;return $n.replace(/.*?\n/g,function(zn){ke+=zn.length,Hn=Hn.insertBlockBreakAtRange([ke-1,ke])}),{document:Hn,range:Ce}}consolidateBlocksAtRange(Ce){Ce=Lt(Ce);const[ke,$n]=Ce,Hn=this.locationFromPosition(ke).index,zn=this.locationFromPosition($n).index;return new this.constructor(this.blockList.consolidateFromIndexToIndex(Hn,zn))}getDocumentAtRange(Ce){Ce=Lt(Ce);const ke=this.blockList.getSplittableListInRange(Ce).toArray();return new this.constructor(ke)}getStringAtRange(Ce){let ke;const $n=Ce=Lt(Ce);return $n[$n.length-1]!==this.getLength()&&(ke=-1),this.getDocumentAtRange(Ce).toString().slice(0,ke)}getBlockAtIndex(Ce){return this.blockList.getObjectAtIndex(Ce)}getBlockAtPosition(Ce){const{index:ke}=this.locationFromPosition(Ce);return this.getBlockAtIndex(ke)}getTextAtIndex(Ce){var ke;return(ke=this.getBlockAtIndex(Ce))===null||ke===void 0?void 0:ke.text}getTextAtPosition(Ce){const{index:ke}=this.locationFromPosition(Ce);return this.getTextAtIndex(ke)}getPieceAtPosition(Ce){const{index:ke,offset:$n}=this.locationFromPosition(Ce);return this.getTextAtIndex(ke).getPieceAtPosition($n)}getCharacterAtPosition(Ce){const{index:ke,offset:$n}=this.locationFromPosition(Ce);return this.getTextAtIndex(ke).getStringAtRange([$n,$n+1])}getLength(){return this.blockList.getEndPosition()}getBlocks(){return this.blockList.toArray()}getBlockCount(){return this.blockList.length}getEditCount(){return this.editCount}eachBlock(Ce){return this.blockList.eachObject(Ce)}eachBlockAtRange(Ce,ke){let $n,Hn;Ce=Lt(Ce);const[zn,Un]=Ce,qn=this.locationFromPosition(zn),Xn=this.locationFromPosition(Un);if(qn.index===Xn.index)return $n=this.getBlockAtIndex(qn.index),Hn=[qn.offset,Xn.offset],ke($n,Hn,qn.index);for(let Kn=qn.index;Kn<=Xn.index;Kn++)if($n=this.getBlockAtIndex(Kn),$n){switch(Kn){case qn.index:Hn=[qn.offset,$n.text.getLength()];break;case Xn.index:Hn=[0,Xn.offset];break;default:Hn=[0,$n.text.getLength()]}ke($n,Hn,Kn)}}getCommonAttributesAtRange(Ce){Ce=Lt(Ce);const[ke]=Ce;if(Dt(Ce))return this.getCommonAttributesAtPosition(ke);{const $n=[],Hn=[];return this.eachBlockAtRange(Ce,function(zn,Un){if(Un[0]!==Un[1])return $n.push(zn.text.getCommonAttributesAtRange(Un)),Hn.push(Ke(zn))}),zt.fromCommonAttributesOfObjects($n).merge(zt.fromCommonAttributesOfObjects(Hn)).toObject()}}getCommonAttributesAtPosition(Ce){let ke,$n;const{index:Hn,offset:zn}=this.locationFromPosition(Ce),Un=this.getBlockAtIndex(Hn);if(!Un)return{};const qn=Ke(Un),Xn=Un.text.getAttributesAtPosition(zn),Kn=Un.text.getAttributesAtPosition(zn-1),to=Object.keys(W).filter(io=>W[io].inheritable);for(ke in Kn)$n=Kn[ke],($n===Xn[ke]||to.includes(ke))&&(qn[ke]=$n);return qn}getRangeOfCommonAttributeAtPosition(Ce,ke){const{index:$n,offset:Hn}=this.locationFromPosition(ke),zn=this.getTextAtIndex($n),[Un,qn]=Array.from(zn.getExpandedRangeForAttributeAtOffset(Ce,Hn)),Xn=this.positionFromLocation({index:$n,offset:Un}),Kn=this.positionFromLocation({index:$n,offset:qn});return Lt([Xn,Kn])}getBaseBlockAttributes(){let Ce=this.getBlockAtIndex(0).getAttributes();for(let ke=1;ke{const zn=[];for(let Un=0;Un{let{text:$n}=ke;return Ce=Ce.concat($n.getAttachmentPieces())}),Ce}getAttachments(){return this.getAttachmentPieces().map(Ce=>Ce.attachment)}getRangeOfAttachment(Ce){let ke=0;const $n=this.blockList.toArray();for(let Hn=0;Hn<$n.length;Hn++){const{text:zn}=$n[Hn],Un=zn.getRangeOfAttachment(Ce);if(Un)return Lt([ke+Un[0],ke+Un[1]]);ke+=zn.getLength()}}getLocationRangeOfAttachment(Ce){const ke=this.getRangeOfAttachment(Ce);return this.locationRangeFromRange(ke)}getAttachmentPieceForAttachment(Ce){for(const ke of this.getAttachmentPieces())if(ke.attachment===Ce)return ke}findRangesForBlockAttribute(Ce){let ke=0;const $n=[];return this.getBlocks().forEach(Hn=>{const zn=Hn.getLength();Hn.hasAttribute(Ce)&&$n.push([ke,ke+zn]),ke+=zn}),$n}findRangesForTextAttribute(Ce){let{withValue:ke}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$n=0,Hn=[];const zn=[];return this.getPieces().forEach(Un=>{const qn=Un.getLength();(function(Xn){return ke?Xn.getAttribute(Ce)===ke:Xn.hasAttribute(Ce)})(Un)&&(Hn[1]===$n?Hn[1]=$n+qn:zn.push(Hn=[$n,$n+qn])),$n+=qn}),zn}locationFromPosition(Ce){const ke=this.blockList.findIndexAndOffsetAtPosition(Math.max(0,Ce));if(ke.index!=null)return ke;{const $n=this.getBlocks();return{index:$n.length-1,offset:$n[$n.length-1].getLength()}}}positionFromLocation(Ce){return this.blockList.findPositionAtIndexAndOffset(Ce.index,Ce.offset)}locationRangeFromPosition(Ce){return Lt(this.locationFromPosition(Ce))}locationRangeFromRange(Ce){if(!(Ce=Lt(Ce)))return;const[ke,$n]=Array.from(Ce),Hn=this.locationFromPosition(ke),zn=this.locationFromPosition($n);return Lt([Hn,zn])}rangeFromLocationRange(Ce){let ke;Ce=Lt(Ce);const $n=this.positionFromLocation(Ce[0]);return Dt(Ce)||(ke=this.positionFromLocation(Ce[1])),Lt([$n,ke])}isEqualTo(Ce){return this.blockList.isEqualTo(Ce==null?void 0:Ce.blockList)}getTexts(){return this.getBlocks().map(Ce=>Ce.text)}getPieces(){const Ce=[];return Array.from(this.getTexts()).forEach(ke=>{Ce.push(...Array.from(ke.getPieces()||[]))}),Ce}getObjects(){return this.getBlocks().concat(this.getTexts()).concat(this.getPieces())}toSerializableDocument(){const Ce=[];return this.blockList.eachObject(ke=>Ce.push(ke.copyWithText(ke.text.toSerializableText()))),new this.constructor(Ce)}toString(){return this.blockList.toString()}toJSON(){return this.blockList.toJSON()}toConsole(){return JSON.stringify(this.blockList.toArray().map(Ce=>JSON.parse(Ce.text.toConsole())))}}const Ke=function(_n){const Ce={},ke=_n.getLastAttribute();return ke&&(Ce[ke]=!0),Ce},Ge=function(_n){let Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return{string:_n=Wt(_n),attributes:Ce,type:"string"}},$e=(_n,Ce)=>{try{return JSON.parse(_n.getAttribute("data-trix-".concat(Ce)))}catch{return{}}};class Xe extends H{static parse(Ce,ke){const $n=new this(Ce,ke);return $n.parse(),$n}constructor(Ce){let{referenceElement:ke}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.html=Ce,this.referenceElement=ke,this.blocks=[],this.blockElements=[],this.processedElements=[]}getDocument(){return Je.fromJSON(this.blocks)}parse(){try{this.createHiddenContainer(),se.setHTML(this.containerElement,this.html);const Ce=R(this.containerElement,{usingFilter:ti});for(;Ce.nextNode();)this.processNode(Ce.currentNode);return this.translateBlockElementMarginsToNewlines()}finally{this.removeHiddenContainer()}}createHiddenContainer(){return this.referenceElement?(this.containerElement=this.referenceElement.cloneNode(!1),this.containerElement.removeAttribute("id"),this.containerElement.setAttribute("data-trix-internal",""),this.containerElement.style.display="none",this.referenceElement.parentNode.insertBefore(this.containerElement,this.referenceElement.nextSibling)):(this.containerElement=S$1({tagName:"div",style:{display:"none"}}),document.body.appendChild(this.containerElement))}removeHiddenContainer(){return k(this.containerElement)}processNode(Ce){switch(Ce.nodeType){case Node.TEXT_NODE:if(!this.isInsignificantTextNode(Ce))return this.appendBlockForTextNode(Ce),this.processTextNode(Ce);break;case Node.ELEMENT_NODE:return this.appendBlockForElement(Ce),this.processElement(Ce)}}appendBlockForTextNode(Ce){const ke=Ce.parentNode;if(ke===this.currentBlockElement&&this.isBlockElement(Ce.previousSibling))return this.appendStringWithAttributes(` +`);if(ke===this.containerElement||this.isBlockElement(ke)){var $n;const Hn=this.getBlockAttributes(ke),zn=this.getBlockHTMLAttributes(ke);rt(Hn,($n=this.currentBlock)===null||$n===void 0?void 0:$n.attributes)||(this.currentBlock=this.appendBlockForAttributesWithElement(Hn,ke,zn),this.currentBlockElement=ke)}}appendBlockForElement(Ce){const ke=this.isBlockElement(Ce),$n=y(this.currentBlockElement,Ce);if(ke&&!this.isBlockElement(Ce.firstChild)){if(!this.isInsignificantTextNode(Ce.firstChild)||!this.isBlockElement(Ce.firstElementChild)){const Hn=this.getBlockAttributes(Ce),zn=this.getBlockHTMLAttributes(Ce);if(Ce.firstChild){if($n&&rt(Hn,this.currentBlock.attributes))return this.appendStringWithAttributes(` +`);this.currentBlock=this.appendBlockForAttributesWithElement(Hn,Ce,zn),this.currentBlockElement=Ce}}}else if(this.currentBlockElement&&!$n&&!ke){const Hn=this.findParentBlockElement(Ce);if(Hn)return this.appendBlockForElement(Hn);this.currentBlock=this.appendEmptyBlock(),this.currentBlockElement=null}}findParentBlockElement(Ce){let{parentElement:ke}=Ce;for(;ke&&ke!==this.containerElement;){if(this.isBlockElement(ke)&&this.blockElements.includes(ke))return ke;ke=ke.parentElement}return null}processTextNode(Ce){let ke=Ce.data;var $n;return Ye(Ce.parentNode)||(ke=qt(ke),ni(($n=Ce.previousSibling)===null||$n===void 0?void 0:$n.textContent)&&(ke=ei(ke))),this.appendStringWithAttributes(ke,this.getTextAttributes(Ce.parentNode))}processElement(Ce){let ke;if(I(Ce)){if(ke=$e(Ce,"attachment"),Object.keys(ke).length){const $n=this.getTextAttributes(Ce);this.appendAttachmentWithAttributes(ke,$n),Ce.innerHTML=""}return this.processedElements.push(Ce)}switch(E(Ce)){case"br":return this.isExtraBR(Ce)||this.isBlockElement(Ce.nextSibling)||this.appendStringWithAttributes(` +`,this.getTextAttributes(Ce)),this.processedElements.push(Ce);case"img":ke={url:Ce.getAttribute("src"),contentType:"image"};const $n=(Hn=>{const zn=Hn.getAttribute("width"),Un=Hn.getAttribute("height"),qn={};return zn&&(qn.width=parseInt(zn,10)),Un&&(qn.height=parseInt(Un,10)),qn})(Ce);for(const Hn in $n){const zn=$n[Hn];ke[Hn]=zn}return this.appendAttachmentWithAttributes(ke,this.getTextAttributes(Ce)),this.processedElements.push(Ce);case"tr":if(this.needsTableSeparator(Ce))return this.appendStringWithAttributes(j.tableRowSeparator);break;case"td":if(this.needsTableSeparator(Ce))return this.appendStringWithAttributes(j.tableCellSeparator)}}appendBlockForAttributesWithElement(Ce,ke){let $n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.blockElements.push(ke);const Hn=function(){return{text:[],attributes:arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},htmlAttributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}}}(Ce,$n);return this.blocks.push(Hn),Hn}appendEmptyBlock(){return this.appendBlockForAttributesWithElement([],null)}appendStringWithAttributes(Ce,ke){return this.appendPiece(Ge(Ce,ke))}appendAttachmentWithAttributes(Ce,ke){return this.appendPiece(function($n){return{attachment:$n,attributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},type:"attachment"}}(Ce,ke))}appendPiece(Ce){return this.blocks.length===0&&this.appendEmptyBlock(),this.blocks[this.blocks.length-1].text.push(Ce)}appendStringToTextAtIndex(Ce,ke){const{text:$n}=this.blocks[ke],Hn=$n[$n.length-1];if((Hn==null?void 0:Hn.type)!=="string")return $n.push(Ge(Ce));Hn.string+=Ce}prependStringToTextAtIndex(Ce,ke){const{text:$n}=this.blocks[ke],Hn=$n[0];if((Hn==null?void 0:Hn.type)!=="string")return $n.unshift(Ge(Ce));Hn.string=Ce+Hn.string}getTextAttributes(Ce){let ke;const $n={};for(const Hn in W){const zn=W[Hn];if(zn.tagName&&A(Ce,{matchingSelector:zn.tagName,untilNode:this.containerElement}))$n[Hn]=!0;else if(zn.parser){if(ke=zn.parser(Ce),ke){let Un=!1;for(const qn of this.findBlockElementAncestors(Ce))if(zn.parser(qn)===ke){Un=!0;break}Un||($n[Hn]=ke)}}else zn.styleProperty&&(ke=Ce.style[zn.styleProperty],ke&&($n[Hn]=ke))}if(I(Ce)){const Hn=$e(Ce,"attributes");for(const zn in Hn)ke=Hn[zn],$n[zn]=ke}return $n}getBlockAttributes(Ce){const ke=[];for(;Ce&&Ce!==this.containerElement;){for(const Hn in n){const zn=n[Hn];var $n;zn.parse!==!1&&E(Ce)===zn.tagName&&(($n=zn.test)!==null&&$n!==void 0&&$n.call(zn,Ce)||!zn.test)&&(ke.push(Hn),zn.listAttribute&&ke.push(zn.listAttribute))}Ce=Ce.parentNode}return ke.reverse()}getBlockHTMLAttributes(Ce){const ke={},$n=Object.values(n).find(Hn=>Hn.tagName===E(Ce));return(($n==null?void 0:$n.htmlAttributes)||[]).forEach(Hn=>{Ce.hasAttribute(Hn)&&(ke[Hn]=Ce.getAttribute(Hn))}),ke}findBlockElementAncestors(Ce){const ke=[];for(;Ce&&Ce!==this.containerElement;){const $n=E(Ce);D().includes($n)&&ke.push(Ce),Ce=Ce.parentNode}return ke}isBlockElement(Ce){if((Ce==null?void 0:Ce.nodeType)===Node.ELEMENT_NODE&&!I(Ce)&&!A(Ce,{matchingSelector:"td",untilNode:this.containerElement}))return D().includes(E(Ce))||window.getComputedStyle(Ce).display==="block"}isInsignificantTextNode(Ce){if((Ce==null?void 0:Ce.nodeType)!==Node.TEXT_NODE||!ii(Ce.data))return;const{parentNode:ke,previousSibling:$n,nextSibling:Hn}=Ce;return Qe(ke.previousSibling)&&!this.isBlockElement(ke.previousSibling)||Ye(ke)?void 0:!$n||this.isBlockElement($n)||!Hn||this.isBlockElement(Hn)}isExtraBR(Ce){return E(Ce)==="br"&&this.isBlockElement(Ce.parentNode)&&Ce.parentNode.lastChild===Ce}needsTableSeparator(Ce){if(j.removeBlankTableCells){var ke;const $n=(ke=Ce.previousSibling)===null||ke===void 0?void 0:ke.textContent;return $n&&/\S/.test($n)}return Ce.previousSibling}translateBlockElementMarginsToNewlines(){const Ce=this.getMarginOfDefaultBlockElement();for(let ke=0;ke2*Ce.top&&this.prependStringToTextAtIndex(` +`,ke),$n.bottom>2*Ce.bottom&&this.appendStringToTextAtIndex(` +`,ke))}}getMarginOfBlockElementAtIndex(Ce){const ke=this.blockElements[Ce];if(ke&&ke.textContent&&!D().includes(E(ke))&&!this.processedElements.includes(ke))return Ze(ke)}getMarginOfDefaultBlockElement(){const Ce=S$1(n.default.tagName);return this.containerElement.appendChild(Ce),Ze(Ce)}}const Ye=function(_n){const{whiteSpace:Ce}=window.getComputedStyle(_n);return["pre","pre-wrap","pre-line"].includes(Ce)},Qe=_n=>_n&&!ni(_n.textContent),Ze=function(_n){const Ce=window.getComputedStyle(_n);if(Ce.display==="block")return{top:parseInt(Ce.marginTop),bottom:parseInt(Ce.marginBottom)}},ti=function(_n){return E(_n)==="style"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},ei=_n=>_n.replace(new RegExp("^".concat(Ut.source,"+")),""),ii=_n=>new RegExp("^".concat(Ut.source,"*$")).test(_n),ni=_n=>/\s$/.test(_n),ri=["contenteditable","data-trix-id","data-trix-store-key","data-trix-mutable","data-trix-placeholder","tabindex"],oi="data-trix-serialized-attributes",si="[".concat(oi,"]"),ai=new RegExp("","g"),li={"application/json":function(_n){let Ce;if(_n instanceof Je)Ce=_n;else{if(!(_n instanceof HTMLElement))throw new Error("unserializable object");Ce=Xe.parse(_n.innerHTML).getDocument()}return Ce.toSerializableDocument().toJSONString()},"text/html":function(_n){let Ce;if(_n instanceof Je)Ce=ve.render(_n);else{if(!(_n instanceof HTMLElement))throw new Error("unserializable object");Ce=_n.cloneNode(!0)}return Array.from(Ce.querySelectorAll("[data-trix-serialize=false]")).forEach(ke=>{k(ke)}),ri.forEach(ke=>{Array.from(Ce.querySelectorAll("[".concat(ke,"]"))).forEach($n=>{$n.removeAttribute(ke)})}),Array.from(Ce.querySelectorAll(si)).forEach(ke=>{try{const $n=JSON.parse(ke.getAttribute(oi));ke.removeAttribute(oi);for(const Hn in $n){const zn=$n[Hn];ke.setAttribute(Hn,zn)}}catch{}}),Ce.innerHTML.replace(ai,"")}};var ci=Object.freeze({__proto__:null});class ui extends H{constructor(Ce,ke){super(...arguments),this.attachmentManager=Ce,this.attachment=ke,this.id=this.attachment.id,this.file=this.attachment.file}remove(){return this.attachmentManager.requestRemovalOfAttachment(this.attachment)}}ui.proxyMethod("attachment.getAttribute"),ui.proxyMethod("attachment.hasAttribute"),ui.proxyMethod("attachment.setAttribute"),ui.proxyMethod("attachment.getAttributes"),ui.proxyMethod("attachment.setAttributes"),ui.proxyMethod("attachment.isPending"),ui.proxyMethod("attachment.isPreviewable"),ui.proxyMethod("attachment.getURL"),ui.proxyMethod("attachment.getHref"),ui.proxyMethod("attachment.getFilename"),ui.proxyMethod("attachment.getFilesize"),ui.proxyMethod("attachment.getFormattedFilesize"),ui.proxyMethod("attachment.getExtension"),ui.proxyMethod("attachment.getContentType"),ui.proxyMethod("attachment.getFile"),ui.proxyMethod("attachment.setFile"),ui.proxyMethod("attachment.releaseFile"),ui.proxyMethod("attachment.getUploadProgress"),ui.proxyMethod("attachment.setUploadProgress");class hi extends H{constructor(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.managedAttachments={},Array.from(Ce).forEach(ke=>{this.manageAttachment(ke)})}getAttachments(){const Ce=[];for(const ke in this.managedAttachments){const $n=this.managedAttachments[ke];Ce.push($n)}return Ce}manageAttachment(Ce){return this.managedAttachments[Ce.id]||(this.managedAttachments[Ce.id]=new ui(this,Ce)),this.managedAttachments[Ce.id]}attachmentIsManaged(Ce){return Ce.id in this.managedAttachments}requestRemovalOfAttachment(Ce){var ke,$n;if(this.attachmentIsManaged(Ce))return(ke=this.delegate)===null||ke===void 0||($n=ke.attachmentManagerDidRequestRemovalOfAttachment)===null||$n===void 0?void 0:$n.call(ke,Ce)}unmanageAttachment(Ce){const ke=this.managedAttachments[Ce.id];return delete this.managedAttachments[Ce.id],ke}}class di{constructor(Ce){this.composition=Ce,this.document=this.composition.document;const ke=this.composition.getSelectedRange();this.startPosition=ke[0],this.endPosition=ke[1],this.startLocation=this.document.locationFromPosition(this.startPosition),this.endLocation=this.document.locationFromPosition(this.endPosition),this.block=this.document.getBlockAtIndex(this.endLocation.index),this.breaksOnReturn=this.block.breaksOnReturn(),this.previousCharacter=this.block.text.getStringAtPosition(this.endLocation.offset-1),this.nextCharacter=this.block.text.getStringAtPosition(this.endLocation.offset)}shouldInsertBlockBreak(){return this.block.hasAttributes()&&this.block.isListItem()&&!this.block.isEmpty()?this.startLocation.offset!==0:this.breaksOnReturn&&this.nextCharacter!==` +`}shouldBreakFormattedBlock(){return this.block.hasAttributes()&&!this.block.isListItem()&&(this.breaksOnReturn&&this.nextCharacter===` +`||this.previousCharacter===` +`)}shouldDecreaseListLevel(){return this.block.hasAttributes()&&this.block.isListItem()&&this.block.isEmpty()}shouldPrependListItem(){return this.block.isListItem()&&this.startLocation.offset===0&&!this.block.isEmpty()}shouldRemoveLastBlockAttribute(){return this.block.hasAttributes()&&!this.block.isListItem()&&this.block.isEmpty()}}class gi extends H{constructor(){super(...arguments),this.document=new Je,this.attachments=[],this.currentAttributes={},this.revision=0}setDocument(Ce){var ke,$n;if(!Ce.isEqualTo(this.document))return this.document=Ce,this.refreshAttachments(),this.revision++,(ke=this.delegate)===null||ke===void 0||($n=ke.compositionDidChangeDocument)===null||$n===void 0?void 0:$n.call(ke,Ce)}getSnapshot(){return{document:this.document,selectedRange:this.getSelectedRange()}}loadSnapshot(Ce){var ke,$n,Hn,zn;let{document:Un,selectedRange:qn}=Ce;return(ke=this.delegate)===null||ke===void 0||($n=ke.compositionWillLoadSnapshot)===null||$n===void 0||$n.call(ke),this.setDocument(Un??new Je),this.setSelection(qn??[0,0]),(Hn=this.delegate)===null||Hn===void 0||(zn=Hn.compositionDidLoadSnapshot)===null||zn===void 0?void 0:zn.call(Hn)}insertText(Ce){let{updatePosition:ke}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{updatePosition:!0};const $n=this.getSelectedRange();this.setDocument(this.document.insertTextAtRange(Ce,$n));const Hn=$n[0],zn=Hn+Ce.getLength();return ke&&this.setSelection(zn),this.notifyDelegateOfInsertionAtRange([Hn,zn])}insertBlock(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Oe;const ke=new Je([Ce]);return this.insertDocument(ke)}insertDocument(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Je;const ke=this.getSelectedRange();this.setDocument(this.document.insertDocumentAtRange(Ce,ke));const $n=ke[0],Hn=$n+Ce.getLength();return this.setSelection(Hn),this.notifyDelegateOfInsertionAtRange([$n,Hn])}insertString(Ce,ke){const $n=this.getCurrentTextAttributes(),Hn=Ne.textForStringWithAttributes(Ce,$n);return this.insertText(Hn,ke)}insertBlockBreak(){const Ce=this.getSelectedRange();this.setDocument(this.document.insertBlockBreakAtRange(Ce));const ke=Ce[0],$n=ke+1;return this.setSelection($n),this.notifyDelegateOfInsertionAtRange([ke,$n])}insertLineBreak(){const Ce=new di(this);if(Ce.shouldDecreaseListLevel())return this.decreaseListLevel(),this.setSelection(Ce.startPosition);if(Ce.shouldPrependListItem()){const ke=new Je([Ce.block.copyWithoutText()]);return this.insertDocument(ke)}return Ce.shouldInsertBlockBreak()?this.insertBlockBreak():Ce.shouldRemoveLastBlockAttribute()?this.removeLastBlockAttribute():Ce.shouldBreakFormattedBlock()?this.breakFormattedBlock(Ce):this.insertString(` +`)}insertHTML(Ce){const ke=Xe.parse(Ce).getDocument(),$n=this.getSelectedRange();this.setDocument(this.document.mergeDocumentAtRange(ke,$n));const Hn=$n[0],zn=Hn+ke.getLength()-1;return this.setSelection(zn),this.notifyDelegateOfInsertionAtRange([Hn,zn])}replaceHTML(Ce){const ke=Xe.parse(Ce).getDocument().copyUsingObjectsFromDocument(this.document),$n=this.getLocationRange({strict:!1}),Hn=this.document.rangeFromLocationRange($n);return this.setDocument(ke),this.setSelection(Hn)}insertFile(Ce){return this.insertFiles([Ce])}insertFiles(Ce){const ke=[];return Array.from(Ce).forEach($n=>{var Hn;if((Hn=this.delegate)!==null&&Hn!==void 0&&Hn.compositionShouldAcceptFile($n)){const zn=De.attachmentForFile($n);ke.push(zn)}}),this.insertAttachments(ke)}insertAttachment(Ce){return this.insertAttachments([Ce])}insertAttachments(Ce){let ke=new Ne;return Array.from(Ce).forEach($n=>{var Hn;const zn=$n.getType(),Un=(Hn=i$1[zn])===null||Hn===void 0?void 0:Hn.presentation,qn=this.getCurrentTextAttributes();Un&&(qn.presentation=Un);const Xn=Ne.textForAttachmentWithAttributes($n,qn);ke=ke.appendText(Xn)}),this.insertText(ke)}shouldManageDeletingInDirection(Ce){const ke=this.getLocationRange();if(Dt(ke)){if(Ce==="backward"&&ke[0].offset===0||this.shouldManageMovingCursorInDirection(Ce))return!0}else if(ke[0].index!==ke[1].index)return!0;return!1}deleteInDirection(Ce){let ke,$n,Hn,{length:zn}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const Un=this.getLocationRange();let qn=this.getSelectedRange();const Xn=Dt(qn);if(Xn?$n=Ce==="backward"&&Un[0].offset===0:Hn=Un[0].index!==Un[1].index,$n&&this.canDecreaseBlockAttributeLevel()){const Kn=this.getBlock();if(Kn.isListItem()?this.decreaseListLevel():this.decreaseBlockAttributeLevel(),this.setSelection(qn[0]),Kn.isEmpty())return!1}return Xn&&(qn=this.getExpandedRangeInDirection(Ce,{length:zn}),Ce==="backward"&&(ke=this.getAttachmentAtRange(qn))),ke?(this.editAttachment(ke),!1):(this.setDocument(this.document.removeTextAtRange(qn)),this.setSelection(qn[0]),!$n&&!Hn&&void 0)}moveTextFromRange(Ce){const[ke]=Array.from(this.getSelectedRange());return this.setDocument(this.document.moveTextFromRangeToPosition(Ce,ke)),this.setSelection(ke)}removeAttachment(Ce){const ke=this.document.getRangeOfAttachment(Ce);if(ke)return this.stopEditingAttachment(),this.setDocument(this.document.removeTextAtRange(ke)),this.setSelection(ke[0])}removeLastBlockAttribute(){const[Ce,ke]=Array.from(this.getSelectedRange()),$n=this.document.getBlockAtPosition(ke);return this.removeCurrentAttribute($n.getLastAttribute()),this.setSelection(Ce)}insertPlaceholder(){return this.placeholderPosition=this.getPosition(),this.insertString(" ")}selectPlaceholder(){if(this.placeholderPosition!=null)return this.setSelectedRange([this.placeholderPosition,this.placeholderPosition+1]),this.getSelectedRange()}forgetPlaceholder(){this.placeholderPosition=null}hasCurrentAttribute(Ce){const ke=this.currentAttributes[Ce];return ke!=null&&ke!==!1}toggleCurrentAttribute(Ce){const ke=!this.currentAttributes[Ce];return ke?this.setCurrentAttribute(Ce,ke):this.removeCurrentAttribute(Ce)}canSetCurrentAttribute(Ce){return gt(Ce)?this.canSetCurrentBlockAttribute(Ce):this.canSetCurrentTextAttribute(Ce)}canSetCurrentTextAttribute(Ce){const ke=this.getSelectedDocument();if(ke){for(const $n of Array.from(ke.getAttachments()))if(!$n.hasContent())return!1;return!0}}canSetCurrentBlockAttribute(Ce){const ke=this.getBlock();if(ke)return!ke.isTerminalBlock()}setCurrentAttribute(Ce,ke){return gt(Ce)?this.setBlockAttribute(Ce,ke):(this.setTextAttribute(Ce,ke),this.currentAttributes[Ce]=ke,this.notifyDelegateOfCurrentAttributesChange())}setHTMLAtributeAtPosition(Ce,ke,$n){var Hn;const zn=this.document.getBlockAtPosition(Ce),Un=(Hn=gt(zn.getLastAttribute()))===null||Hn===void 0?void 0:Hn.htmlAttributes;if(zn&&Un!=null&&Un.includes(ke)){const qn=this.document.setHTMLAttributeAtPosition(Ce,ke,$n);this.setDocument(qn)}}setTextAttribute(Ce,ke){const $n=this.getSelectedRange();if(!$n)return;const[Hn,zn]=Array.from($n);if(Hn!==zn)return this.setDocument(this.document.addAttributeAtRange(Ce,ke,$n));if(Ce==="href"){const Un=Ne.textForStringWithAttributes(ke,{href:ke});return this.insertText(Un)}}setBlockAttribute(Ce,ke){const $n=this.getSelectedRange();if(this.canSetCurrentAttribute(Ce))return this.setDocument(this.document.applyBlockAttributeAtRange(Ce,ke,$n)),this.setSelection($n)}removeCurrentAttribute(Ce){return gt(Ce)?(this.removeBlockAttribute(Ce),this.updateCurrentAttributes()):(this.removeTextAttribute(Ce),delete this.currentAttributes[Ce],this.notifyDelegateOfCurrentAttributesChange())}removeTextAttribute(Ce){const ke=this.getSelectedRange();if(ke)return this.setDocument(this.document.removeAttributeAtRange(Ce,ke))}removeBlockAttribute(Ce){const ke=this.getSelectedRange();if(ke)return this.setDocument(this.document.removeAttributeAtRange(Ce,ke))}canDecreaseNestingLevel(){var Ce;return((Ce=this.getBlock())===null||Ce===void 0?void 0:Ce.getNestingLevel())>0}canIncreaseNestingLevel(){var Ce;const ke=this.getBlock();if(ke){if((Ce=gt(ke.getLastNestableAttribute()))===null||Ce===void 0||!Ce.listAttribute)return ke.getNestingLevel()>0;{const $n=this.getPreviousBlock();if($n)return function(){let Hn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return rt((arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).slice(0,Hn.length),Hn)}($n.getListItemAttributes(),ke.getListItemAttributes())}}}decreaseNestingLevel(){const Ce=this.getBlock();if(Ce)return this.setDocument(this.document.replaceBlock(Ce,Ce.decreaseNestingLevel()))}increaseNestingLevel(){const Ce=this.getBlock();if(Ce)return this.setDocument(this.document.replaceBlock(Ce,Ce.increaseNestingLevel()))}canDecreaseBlockAttributeLevel(){var Ce;return((Ce=this.getBlock())===null||Ce===void 0?void 0:Ce.getAttributeLevel())>0}decreaseBlockAttributeLevel(){var Ce;const ke=(Ce=this.getBlock())===null||Ce===void 0?void 0:Ce.getLastAttribute();if(ke)return this.removeCurrentAttribute(ke)}decreaseListLevel(){let[Ce]=Array.from(this.getSelectedRange());const{index:ke}=this.document.locationFromPosition(Ce);let $n=ke;const Hn=this.getBlock().getAttributeLevel();let zn=this.document.getBlockAtIndex($n+1);for(;zn&&zn.isListItem()&&!(zn.getAttributeLevel()<=Hn);)$n++,zn=this.document.getBlockAtIndex($n+1);Ce=this.document.positionFromLocation({index:ke,offset:0});const Un=this.document.positionFromLocation({index:$n,offset:0});return this.setDocument(this.document.removeLastListAttributeAtRange([Ce,Un]))}updateCurrentAttributes(){const Ce=this.getSelectedRange({ignoreLock:!0});if(Ce){const ke=this.document.getCommonAttributesAtRange(Ce);if(Array.from(dt()).forEach($n=>{ke[$n]||this.canSetCurrentAttribute($n)||(ke[$n]=!1)}),!St(ke,this.currentAttributes))return this.currentAttributes=ke,this.notifyDelegateOfCurrentAttributesChange()}}getCurrentAttributes(){return g.call({},this.currentAttributes)}getCurrentTextAttributes(){const Ce={};for(const ke in this.currentAttributes){const $n=this.currentAttributes[ke];$n!==!1&&pt(ke)&&(Ce[ke]=$n)}return Ce}freezeSelection(){return this.setCurrentAttribute("frozen",!0)}thawSelection(){return this.removeCurrentAttribute("frozen")}hasFrozenSelection(){return this.hasCurrentAttribute("frozen")}setSelection(Ce){var ke;const $n=this.document.locationRangeFromRange(Ce);return(ke=this.delegate)===null||ke===void 0?void 0:ke.compositionDidRequestChangingSelectionToLocationRange($n)}getSelectedRange(){const Ce=this.getLocationRange();if(Ce)return this.document.rangeFromLocationRange(Ce)}setSelectedRange(Ce){const ke=this.document.locationRangeFromRange(Ce);return this.getSelectionManager().setLocationRange(ke)}getPosition(){const Ce=this.getLocationRange();if(Ce)return this.document.positionFromLocation(Ce[0])}getLocationRange(Ce){return this.targetLocationRange?this.targetLocationRange:this.getSelectionManager().getLocationRange(Ce)||Lt({index:0,offset:0})}withTargetLocationRange(Ce,ke){let $n;this.targetLocationRange=Ce;try{$n=ke()}finally{this.targetLocationRange=null}return $n}withTargetRange(Ce,ke){const $n=this.document.locationRangeFromRange(Ce);return this.withTargetLocationRange($n,ke)}withTargetDOMRange(Ce,ke){const $n=this.createLocationRangeFromDOMRange(Ce,{strict:!1});return this.withTargetLocationRange($n,ke)}getExpandedRangeInDirection(Ce){let{length:ke}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},[$n,Hn]=Array.from(this.getSelectedRange());return Ce==="backward"?ke?$n-=ke:$n=this.translateUTF16PositionFromOffset($n,-1):ke?Hn+=ke:Hn=this.translateUTF16PositionFromOffset(Hn,1),Lt([$n,Hn])}shouldManageMovingCursorInDirection(Ce){if(this.editingAttachment)return!0;const ke=this.getExpandedRangeInDirection(Ce);return this.getAttachmentAtRange(ke)!=null}moveCursorInDirection(Ce){let ke,$n;if(this.editingAttachment)$n=this.document.getRangeOfAttachment(this.editingAttachment);else{const Hn=this.getSelectedRange();$n=this.getExpandedRangeInDirection(Ce),ke=!wt(Hn,$n)}if(Ce==="backward"?this.setSelectedRange($n[0]):this.setSelectedRange($n[1]),ke){const Hn=this.getAttachmentAtRange($n);if(Hn)return this.editAttachment(Hn)}}expandSelectionInDirection(Ce){let{length:ke}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const $n=this.getExpandedRangeInDirection(Ce,{length:ke});return this.setSelectedRange($n)}expandSelectionForEditing(){if(this.hasCurrentAttribute("href"))return this.expandSelectionAroundCommonAttribute("href")}expandSelectionAroundCommonAttribute(Ce){const ke=this.getPosition(),$n=this.document.getRangeOfCommonAttributeAtPosition(Ce,ke);return this.setSelectedRange($n)}selectionContainsAttachments(){var Ce;return((Ce=this.getSelectedAttachments())===null||Ce===void 0?void 0:Ce.length)>0}selectionIsInCursorTarget(){return this.editingAttachment||this.positionIsCursorTarget(this.getPosition())}positionIsCursorTarget(Ce){const ke=this.document.locationFromPosition(Ce);if(ke)return this.locationIsCursorTarget(ke)}positionIsBlockBreak(Ce){var ke;return(ke=this.document.getPieceAtPosition(Ce))===null||ke===void 0?void 0:ke.isBlockBreak()}getSelectedDocument(){const Ce=this.getSelectedRange();if(Ce)return this.document.getDocumentAtRange(Ce)}getSelectedAttachments(){var Ce;return(Ce=this.getSelectedDocument())===null||Ce===void 0?void 0:Ce.getAttachments()}getAttachments(){return this.attachments.slice(0)}refreshAttachments(){const Ce=this.document.getAttachments(),{added:ke,removed:$n}=function(){let Hn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],zn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const Un=[],qn=[],Xn=new Set;Hn.forEach(to=>{Xn.add(to)});const Kn=new Set;return zn.forEach(to=>{Kn.add(to),Xn.has(to)||Un.push(to)}),Hn.forEach(to=>{Kn.has(to)||qn.push(to)}),{added:Un,removed:qn}}(this.attachments,Ce);return this.attachments=Ce,Array.from($n).forEach(Hn=>{var zn,Un;Hn.delegate=null,(zn=this.delegate)===null||zn===void 0||(Un=zn.compositionDidRemoveAttachment)===null||Un===void 0||Un.call(zn,Hn)}),(()=>{const Hn=[];return Array.from(ke).forEach(zn=>{var Un,qn;zn.delegate=this,Hn.push((Un=this.delegate)===null||Un===void 0||(qn=Un.compositionDidAddAttachment)===null||qn===void 0?void 0:qn.call(Un,zn))}),Hn})()}attachmentDidChangeAttributes(Ce){var ke,$n;return this.revision++,(ke=this.delegate)===null||ke===void 0||($n=ke.compositionDidEditAttachment)===null||$n===void 0?void 0:$n.call(ke,Ce)}attachmentDidChangePreviewURL(Ce){var ke,$n;return this.revision++,(ke=this.delegate)===null||ke===void 0||($n=ke.compositionDidChangeAttachmentPreviewURL)===null||$n===void 0?void 0:$n.call(ke,Ce)}editAttachment(Ce,ke){var $n,Hn;if(Ce!==this.editingAttachment)return this.stopEditingAttachment(),this.editingAttachment=Ce,($n=this.delegate)===null||$n===void 0||(Hn=$n.compositionDidStartEditingAttachment)===null||Hn===void 0?void 0:Hn.call($n,this.editingAttachment,ke)}stopEditingAttachment(){var Ce,ke;this.editingAttachment&&((Ce=this.delegate)===null||Ce===void 0||(ke=Ce.compositionDidStopEditingAttachment)===null||ke===void 0||ke.call(Ce,this.editingAttachment),this.editingAttachment=null)}updateAttributesForAttachment(Ce,ke){return this.setDocument(this.document.updateAttributesForAttachment(Ce,ke))}removeAttributeForAttachment(Ce,ke){return this.setDocument(this.document.removeAttributeForAttachment(Ce,ke))}breakFormattedBlock(Ce){let{document:ke}=Ce;const{block:$n}=Ce;let Hn=Ce.startPosition,zn=[Hn-1,Hn];$n.getBlockBreakPosition()===Ce.startLocation.offset?($n.breaksOnReturn()&&Ce.nextCharacter===` +`?Hn+=1:ke=ke.removeTextAtRange(zn),zn=[Hn,Hn]):Ce.nextCharacter===` +`?Ce.previousCharacter===` +`?zn=[Hn-1,Hn+1]:(zn=[Hn,Hn+1],Hn+=1):Ce.startLocation.offset-1!=0&&(Hn+=1);const Un=new Je([$n.removeLastAttribute().copyWithoutText()]);return this.setDocument(ke.insertDocumentAtRange(Un,zn)),this.setSelection(Hn)}getPreviousBlock(){const Ce=this.getLocationRange();if(Ce){const{index:ke}=Ce[0];if(ke>0)return this.document.getBlockAtIndex(ke-1)}}getBlock(){const Ce=this.getLocationRange();if(Ce)return this.document.getBlockAtIndex(Ce[0].index)}getAttachmentAtRange(Ce){const ke=this.document.getDocumentAtRange(Ce);if(ke.toString()==="".concat("",` +`))return ke.getAttachments()[0]}notifyDelegateOfCurrentAttributesChange(){var Ce,ke;return(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.compositionDidChangeCurrentAttributes)===null||ke===void 0?void 0:ke.call(Ce,this.currentAttributes)}notifyDelegateOfInsertionAtRange(Ce){var ke,$n;return(ke=this.delegate)===null||ke===void 0||($n=ke.compositionDidPerformInsertionAtRange)===null||$n===void 0?void 0:$n.call(ke,Ce)}translateUTF16PositionFromOffset(Ce,ke){const $n=this.document.toUTF16String(),Hn=$n.offsetFromUCS2Offset(Ce);return $n.offsetToUCS2Offset(Hn+ke)}}gi.proxyMethod("getSelectionManager().getPointRange"),gi.proxyMethod("getSelectionManager().setLocationRangeFromPointRange"),gi.proxyMethod("getSelectionManager().createLocationRangeFromDOMRange"),gi.proxyMethod("getSelectionManager().locationIsCursorTarget"),gi.proxyMethod("getSelectionManager().selectionIsExpanded"),gi.proxyMethod("delegate?.getSelectionManager");class mi extends H{constructor(Ce){super(...arguments),this.composition=Ce,this.undoEntries=[],this.redoEntries=[]}recordUndoEntry(Ce){let{context:ke,consolidatable:$n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const Hn=this.undoEntries.slice(-1)[0];if(!$n||!pi(Hn,Ce,ke)){const zn=this.createEntry({description:Ce,context:ke});this.undoEntries.push(zn),this.redoEntries=[]}}undo(){const Ce=this.undoEntries.pop();if(Ce){const ke=this.createEntry(Ce);return this.redoEntries.push(ke),this.composition.loadSnapshot(Ce.snapshot)}}redo(){const Ce=this.redoEntries.pop();if(Ce){const ke=this.createEntry(Ce);return this.undoEntries.push(ke),this.composition.loadSnapshot(Ce.snapshot)}}canUndo(){return this.undoEntries.length>0}canRedo(){return this.redoEntries.length>0}createEntry(){let{description:Ce,context:ke}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{description:Ce==null?void 0:Ce.toString(),context:JSON.stringify(ke),snapshot:this.composition.getSnapshot()}}}const pi=(_n,Ce,ke)=>(_n==null?void 0:_n.description)===(Ce==null?void 0:Ce.toString())&&(_n==null?void 0:_n.context)===JSON.stringify(ke),fi="attachmentGallery";class bi{constructor(Ce){this.document=Ce.document,this.selectedRange=Ce.selectedRange}perform(){return this.removeBlockAttribute(),this.applyBlockAttribute()}getSnapshot(){return{document:this.document,selectedRange:this.selectedRange}}removeBlockAttribute(){return this.findRangesOfBlocks().map(Ce=>this.document=this.document.removeAttributeAtRange(fi,Ce))}applyBlockAttribute(){let Ce=0;this.findRangesOfPieces().forEach(ke=>{ke[1]-ke[0]>1&&(ke[0]+=Ce,ke[1]+=Ce,this.document.getCharacterAtPosition(ke[1])!==` +`&&(this.document=this.document.insertBlockBreakAtRange(ke[1]),ke[1]0&&arguments[0]!==void 0?arguments[0]:"";const ke=Xe.parse(Ce,{referenceElement:this.element}).getDocument();return this.loadDocument(ke)}loadJSON(Ce){let{document:ke,selectedRange:$n}=Ce;return ke=Je.fromJSON(ke),this.loadSnapshot({document:ke,selectedRange:$n})}loadSnapshot(Ce){return this.undoManager=new mi(this.composition),this.composition.loadSnapshot(Ce)}getDocument(){return this.composition.document}getSelectedDocument(){return this.composition.getSelectedDocument()}getSnapshot(){return this.composition.getSnapshot()}toJSON(){return this.getSnapshot()}deleteInDirection(Ce){return this.composition.deleteInDirection(Ce)}insertAttachment(Ce){return this.composition.insertAttachment(Ce)}insertAttachments(Ce){return this.composition.insertAttachments(Ce)}insertDocument(Ce){return this.composition.insertDocument(Ce)}insertFile(Ce){return this.composition.insertFile(Ce)}insertFiles(Ce){return this.composition.insertFiles(Ce)}insertHTML(Ce){return this.composition.insertHTML(Ce)}insertString(Ce){return this.composition.insertString(Ce)}insertText(Ce){return this.composition.insertText(Ce)}insertLineBreak(){return this.composition.insertLineBreak()}getSelectedRange(){return this.composition.getSelectedRange()}getPosition(){return this.composition.getPosition()}getClientRectAtPosition(Ce){const ke=this.getDocument().locationRangeFromRange([Ce,Ce+1]);return this.selectionManager.getClientRectAtLocationRange(ke)}expandSelectionInDirection(Ce){return this.composition.expandSelectionInDirection(Ce)}moveCursorInDirection(Ce){return this.composition.moveCursorInDirection(Ce)}setSelectedRange(Ce){return this.composition.setSelectedRange(Ce)}activateAttribute(Ce){let ke=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this.composition.setCurrentAttribute(Ce,ke)}attributeIsActive(Ce){return this.composition.hasCurrentAttribute(Ce)}canActivateAttribute(Ce){return this.composition.canSetCurrentAttribute(Ce)}deactivateAttribute(Ce){return this.composition.removeCurrentAttribute(Ce)}setHTMLAtributeAtPosition(Ce,ke,$n){this.composition.setHTMLAtributeAtPosition(Ce,ke,$n)}canDecreaseNestingLevel(){return this.composition.canDecreaseNestingLevel()}canIncreaseNestingLevel(){return this.composition.canIncreaseNestingLevel()}decreaseNestingLevel(){if(this.canDecreaseNestingLevel())return this.composition.decreaseNestingLevel()}increaseNestingLevel(){if(this.canIncreaseNestingLevel())return this.composition.increaseNestingLevel()}canRedo(){return this.undoManager.canRedo()}canUndo(){return this.undoManager.canUndo()}recordUndoEntry(Ce){let{context:ke,consolidatable:$n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.undoManager.recordUndoEntry(Ce,{context:ke,consolidatable:$n})}redo(){if(this.canRedo())return this.undoManager.redo()}undo(){if(this.canUndo())return this.undoManager.undo()}}class yi{constructor(Ce){this.element=Ce}findLocationFromContainerAndOffset(Ce,ke){let{strict:$n}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{strict:!0},Hn=0,zn=!1;const Un={index:0,offset:0},qn=this.findAttachmentElementParentForNode(Ce);qn&&(Ce=qn.parentNode,ke=C$1(qn));const Xn=R(this.element,{usingFilter:Ei});for(;Xn.nextNode();){const Kn=Xn.currentNode;if(Kn===Ce&&O(Ce)){P(Kn)||(Un.offset+=ke);break}if(Kn.parentNode===Ce){if(Hn++===ke)break}else if(!y(Ce,Kn)&&Hn>0)break;T(Kn,{strict:$n})?(zn&&Un.index++,Un.offset=0,zn=!0):Un.offset+=Ci(Kn)}return Un}findContainerAndOffsetFromLocation(Ce){let ke,$n;if(Ce.index===0&&Ce.offset===0){for(ke=this.element,$n=0;ke.firstChild;)if(ke=ke.firstChild,w(ke)){$n=1;break}return[ke,$n]}let[Hn,zn]=this.findNodeAndOffsetFromLocation(Ce);if(Hn){if(O(Hn))Ci(Hn)===0?(ke=Hn.parentNode.parentNode,$n=C$1(Hn.parentNode),P(Hn,{name:"right"})&&$n++):(ke=Hn,$n=Ce.offset-zn);else{if(ke=Hn.parentNode,!T(Hn.previousSibling)&&!w(ke))for(;Hn===ke.lastChild&&(Hn=ke,ke=ke.parentNode,!w(ke)););$n=C$1(Hn),Ce.offset!==0&&$n++}return[ke,$n]}}findNodeAndOffsetFromLocation(Ce){let ke,$n,Hn=0;for(const zn of this.getSignificantNodesForIndex(Ce.index)){const Un=Ci(zn);if(Ce.offset<=Hn+Un)if(O(zn)){if(ke=zn,$n=Hn,Ce.offset===$n&&P(ke))break}else ke||(ke=zn,$n=Hn);if(Hn+=Un,Hn>Ce.offset)break}return[ke,$n]}findAttachmentElementParentForNode(Ce){for(;Ce&&Ce!==this.element;){if(I(Ce))return Ce;Ce=Ce.parentNode}}getSignificantNodesForIndex(Ce){const ke=[],$n=R(this.element,{usingFilter:ki});let Hn=!1;for(;$n.nextNode();){const Un=$n.currentNode;var zn;if(B(Un)){if(zn!=null?zn++:zn=0,zn===Ce)Hn=!0;else if(Hn)break}else Hn&&ke.push(Un)}return ke}}const Ci=function(_n){return _n.nodeType===Node.TEXT_NODE?P(_n)?0:_n.textContent.length:E(_n)==="br"||I(_n)?1:0},ki=function(_n){return Ri(_n)===NodeFilter.FILTER_ACCEPT?Ei(_n):NodeFilter.FILTER_REJECT},Ri=function(_n){return N(_n)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},Ei=function(_n){return I(_n.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT};class Si{createDOMRangeFromPoint(Ce){let ke,{x:$n,y:Hn}=Ce;if(document.caretPositionFromPoint){const{offsetNode:zn,offset:Un}=document.caretPositionFromPoint($n,Hn);return ke=document.createRange(),ke.setStart(zn,Un),ke}if(document.caretRangeFromPoint)return document.caretRangeFromPoint($n,Hn);if(document.body.createTextRange){const zn=Nt();try{const Un=document.body.createTextRange();Un.moveToPoint($n,Hn),Un.select()}catch{}return ke=Nt(),Ot(zn),ke}}getClientRectsForDOMRange(Ce){const ke=Array.from(Ce.getClientRects());return[ke[0],ke[ke.length-1]]}}class Li extends H{constructor(Ce){super(...arguments),this.didMouseDown=this.didMouseDown.bind(this),this.selectionDidChange=this.selectionDidChange.bind(this),this.element=Ce,this.locationMapper=new yi(this.element),this.pointMapper=new Si,this.lockCount=0,f("mousedown",{onElement:this.element,withCallback:this.didMouseDown})}getLocationRange(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Ce.strict===!1?this.createLocationRangeFromDOMRange(Nt()):Ce.ignoreLock?this.currentLocationRange:this.lockedLocationRange?this.lockedLocationRange:this.currentLocationRange}setLocationRange(Ce){if(this.lockedLocationRange)return;Ce=Lt(Ce);const ke=this.createDOMRangeFromLocationRange(Ce);ke&&(Ot(ke),this.updateCurrentLocationRange(Ce))}setLocationRangeFromPointRange(Ce){Ce=Lt(Ce);const ke=this.getLocationAtPoint(Ce[0]),$n=this.getLocationAtPoint(Ce[1]);this.setLocationRange([ke,$n])}getClientRectAtLocationRange(Ce){const ke=this.createDOMRangeFromLocationRange(Ce);if(ke)return this.getClientRectsForDOMRange(ke)[1]}locationIsCursorTarget(Ce){const ke=Array.from(this.findNodeAndOffsetFromLocation(Ce))[0];return P(ke)}lock(){this.lockCount++==0&&(this.updateCurrentLocationRange(),this.lockedLocationRange=this.getLocationRange())}unlock(){if(--this.lockCount==0){const{lockedLocationRange:Ce}=this;if(this.lockedLocationRange=null,Ce!=null)return this.setLocationRange(Ce)}}clearSelection(){var Ce;return(Ce=It())===null||Ce===void 0?void 0:Ce.removeAllRanges()}selectionIsCollapsed(){var Ce;return((Ce=Nt())===null||Ce===void 0?void 0:Ce.collapsed)===!0}selectionIsExpanded(){return!this.selectionIsCollapsed()}createLocationRangeFromDOMRange(Ce,ke){if(Ce==null||!this.domRangeWithinElement(Ce))return;const $n=this.findLocationFromContainerAndOffset(Ce.startContainer,Ce.startOffset,ke);if(!$n)return;const Hn=Ce.collapsed?void 0:this.findLocationFromContainerAndOffset(Ce.endContainer,Ce.endOffset,ke);return Lt([$n,Hn])}didMouseDown(){return this.pauseTemporarily()}pauseTemporarily(){let Ce;this.paused=!0;const ke=()=>{if(this.paused=!1,clearTimeout($n),Array.from(Ce).forEach(Hn=>{Hn.destroy()}),y(document,this.element))return this.selectionDidChange()},$n=setTimeout(ke,200);Ce=["mousemove","keydown"].map(Hn=>f(Hn,{onElement:document,withCallback:ke}))}selectionDidChange(){if(!this.paused&&!x(this.element))return this.updateCurrentLocationRange()}updateCurrentLocationRange(Ce){var ke,$n;if((Ce??(Ce=this.createLocationRangeFromDOMRange(Nt())))&&!wt(Ce,this.currentLocationRange))return this.currentLocationRange=Ce,(ke=this.delegate)===null||ke===void 0||($n=ke.locationRangeDidChange)===null||$n===void 0?void 0:$n.call(ke,this.currentLocationRange.slice(0))}createDOMRangeFromLocationRange(Ce){const ke=this.findContainerAndOffsetFromLocation(Ce[0]),$n=Dt(Ce)?ke:this.findContainerAndOffsetFromLocation(Ce[1])||ke;if(ke!=null&&$n!=null){const Hn=document.createRange();return Hn.setStart(...Array.from(ke||[])),Hn.setEnd(...Array.from($n||[])),Hn}}getLocationAtPoint(Ce){const ke=this.createDOMRangeFromPoint(Ce);var $n;if(ke)return($n=this.createLocationRangeFromDOMRange(ke))===null||$n===void 0?void 0:$n[0]}domRangeWithinElement(Ce){return Ce.collapsed?y(this.element,Ce.startContainer):y(this.element,Ce.startContainer)&&y(this.element,Ce.endContainer)}}Li.proxyMethod("locationMapper.findLocationFromContainerAndOffset"),Li.proxyMethod("locationMapper.findContainerAndOffsetFromLocation"),Li.proxyMethod("locationMapper.findNodeAndOffsetFromLocation"),Li.proxyMethod("pointMapper.createDOMRangeFromPoint"),Li.proxyMethod("pointMapper.getClientRectsForDOMRange");var Di=Object.freeze({__proto__:null,Attachment:De,AttachmentManager:hi,AttachmentPiece:we,Block:Oe,Composition:gi,Document:Je,Editor:xi,HTMLParser:Xe,HTMLSanitizer:se,LineBreakInsertion:di,LocationMapper:yi,ManagedAttachment:ui,Piece:Se,PointMapper:Si,SelectionManager:Li,SplittableList:Be,StringPiece:Te,Text:Ne,UndoManager:mi}),wi=Object.freeze({__proto__:null,ObjectView:ee,AttachmentView:ce,BlockView:be,DocumentView:ve,PieceView:ge,PreviewableAttachmentView:de,TextView:me});const{lang:Ti,css:Bi,keyNames:Fi}=V,Pi=function(_n){return function(){const Ce=_n.apply(this,arguments);Ce.do(),this.undos||(this.undos=[]),this.undos.push(Ce.undo)}};class Ii extends H{constructor(Ce,ke,$n){let Hn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(...arguments),Re(this,"makeElementMutable",Pi(()=>({do:()=>{this.element.dataset.trixMutable=!0},undo:()=>delete this.element.dataset.trixMutable}))),Re(this,"addToolbar",Pi(()=>{const zn=S$1({tagName:"div",className:Bi.attachmentToolbar,data:{trixMutable:!0},childNodes:S$1({tagName:"div",className:"trix-button-row",childNodes:S$1({tagName:"span",className:"trix-button-group trix-button-group--actions",childNodes:S$1({tagName:"button",className:"trix-button trix-button--remove",textContent:Ti.remove,attributes:{title:Ti.remove},data:{trixAction:"remove"}})})})});return this.attachment.isPreviewable()&&zn.appendChild(S$1({tagName:"div",className:Bi.attachmentMetadataContainer,childNodes:S$1({tagName:"span",className:Bi.attachmentMetadata,childNodes:[S$1({tagName:"span",className:Bi.attachmentName,textContent:this.attachment.getFilename(),attributes:{title:this.attachment.getFilename()}}),S$1({tagName:"span",className:Bi.attachmentSize,textContent:this.attachment.getFormattedFilesize()})]})})),f("click",{onElement:zn,withCallback:this.didClickToolbar}),f("click",{onElement:zn,matchingSelector:"[data-trix-action]",withCallback:this.didClickActionButton}),b("trix-attachment-before-toolbar",{onElement:this.element,attributes:{toolbar:zn,attachment:this.attachment}}),{do:()=>this.element.appendChild(zn),undo:()=>k(zn)}})),Re(this,"installCaptionEditor",Pi(()=>{const zn=S$1({tagName:"textarea",className:Bi.attachmentCaptionEditor,attributes:{placeholder:Ti.captionPlaceholder},data:{trixMutable:!0}});zn.value=this.attachmentPiece.getCaption();const Un=zn.cloneNode();Un.classList.add("trix-autoresize-clone"),Un.tabIndex=-1;const qn=function(){Un.value=zn.value,zn.style.height=Un.scrollHeight+"px"};f("input",{onElement:zn,withCallback:qn}),f("input",{onElement:zn,withCallback:this.didInputCaption}),f("keydown",{onElement:zn,withCallback:this.didKeyDownCaption}),f("change",{onElement:zn,withCallback:this.didChangeCaption}),f("blur",{onElement:zn,withCallback:this.didBlurCaption});const Xn=this.element.querySelector("figcaption"),Kn=Xn.cloneNode();return{do:()=>{if(Xn.style.display="none",Kn.appendChild(zn),Kn.appendChild(Un),Kn.classList.add("".concat(Bi.attachmentCaption,"--editing")),Xn.parentElement.insertBefore(Kn,Xn),qn(),this.options.editCaption)return Rt(()=>zn.focus())},undo(){k(Kn),Xn.style.display=null}}})),this.didClickToolbar=this.didClickToolbar.bind(this),this.didClickActionButton=this.didClickActionButton.bind(this),this.didKeyDownCaption=this.didKeyDownCaption.bind(this),this.didInputCaption=this.didInputCaption.bind(this),this.didChangeCaption=this.didChangeCaption.bind(this),this.didBlurCaption=this.didBlurCaption.bind(this),this.attachmentPiece=Ce,this.element=ke,this.container=$n,this.options=Hn,this.attachment=this.attachmentPiece.attachment,E(this.element)==="a"&&(this.element=this.element.firstChild),this.install()}install(){this.makeElementMutable(),this.addToolbar(),this.attachment.isPreviewable()&&this.installCaptionEditor()}uninstall(){var Ce;let ke=this.undos.pop();for(this.savePendingCaption();ke;)ke(),ke=this.undos.pop();(Ce=this.delegate)===null||Ce===void 0||Ce.didUninstallAttachmentEditor(this)}savePendingCaption(){if(this.pendingCaption!=null){const zn=this.pendingCaption;var Ce,ke,$n,Hn;this.pendingCaption=null,zn?(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.attachmentEditorDidRequestUpdatingAttributesForAttachment)===null||ke===void 0||ke.call(Ce,{caption:zn},this.attachment):($n=this.delegate)===null||$n===void 0||(Hn=$n.attachmentEditorDidRequestRemovingAttributeForAttachment)===null||Hn===void 0||Hn.call($n,"caption",this.attachment)}}didClickToolbar(Ce){return Ce.preventDefault(),Ce.stopPropagation()}didClickActionButton(Ce){var ke;if(Ce.target.getAttribute("data-trix-action")==="remove")return(ke=this.delegate)===null||ke===void 0?void 0:ke.attachmentEditorDidRequestRemovalOfAttachment(this.attachment)}didKeyDownCaption(Ce){var ke,$n;if(Fi[Ce.keyCode]==="return")return Ce.preventDefault(),this.savePendingCaption(),(ke=this.delegate)===null||ke===void 0||($n=ke.attachmentEditorDidRequestDeselectingAttachment)===null||$n===void 0?void 0:$n.call(ke,this.attachment)}didInputCaption(Ce){this.pendingCaption=Ce.target.value.replace(/\s/g," ").trim()}didChangeCaption(Ce){return this.savePendingCaption()}didBlurCaption(Ce){return this.savePendingCaption()}}class Ni extends H{constructor(Ce,ke){super(...arguments),this.didFocus=this.didFocus.bind(this),this.didBlur=this.didBlur.bind(this),this.didClickAttachment=this.didClickAttachment.bind(this),this.element=Ce,this.composition=ke,this.documentView=new ve(this.composition.document,{element:this.element}),f("focus",{onElement:this.element,withCallback:this.didFocus}),f("blur",{onElement:this.element,withCallback:this.didBlur}),f("click",{onElement:this.element,matchingSelector:"a[contenteditable=false]",preventDefault:!0}),f("mousedown",{onElement:this.element,matchingSelector:e,withCallback:this.didClickAttachment}),f("click",{onElement:this.element,matchingSelector:"a".concat(e),preventDefault:!0})}didFocus(Ce){var ke;const $n=()=>{var Hn,zn;if(!this.focused)return this.focused=!0,(Hn=this.delegate)===null||Hn===void 0||(zn=Hn.compositionControllerDidFocus)===null||zn===void 0?void 0:zn.call(Hn)};return((ke=this.blurPromise)===null||ke===void 0?void 0:ke.then($n))||$n()}didBlur(Ce){this.blurPromise=new Promise(ke=>Rt(()=>{var $n,Hn;return x(this.element)||(this.focused=null,($n=this.delegate)===null||$n===void 0||(Hn=$n.compositionControllerDidBlur)===null||Hn===void 0||Hn.call($n)),this.blurPromise=null,ke()}))}didClickAttachment(Ce,ke){var $n,Hn;const zn=this.findAttachmentForElement(ke),Un=!!A(Ce.target,{matchingSelector:"figcaption"});return($n=this.delegate)===null||$n===void 0||(Hn=$n.compositionControllerDidSelectAttachment)===null||Hn===void 0?void 0:Hn.call($n,zn,{editCaption:Un})}getSerializableElement(){return this.isEditingAttachment()?this.documentView.shadowElement:this.element}render(){var Ce,ke,$n,Hn,zn,Un;return this.revision!==this.composition.revision&&(this.documentView.setDocument(this.composition.document),this.documentView.render(),this.revision=this.composition.revision),this.canSyncDocumentView()&&!this.documentView.isSynced()&&(($n=this.delegate)===null||$n===void 0||(Hn=$n.compositionControllerWillSyncDocumentView)===null||Hn===void 0||Hn.call($n),this.documentView.sync(),(zn=this.delegate)===null||zn===void 0||(Un=zn.compositionControllerDidSyncDocumentView)===null||Un===void 0||Un.call(zn)),(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.compositionControllerDidRender)===null||ke===void 0?void 0:ke.call(Ce)}rerenderViewForObject(Ce){return this.invalidateViewForObject(Ce),this.render()}invalidateViewForObject(Ce){return this.documentView.invalidateViewForObject(Ce)}isViewCachingEnabled(){return this.documentView.isViewCachingEnabled()}enableViewCaching(){return this.documentView.enableViewCaching()}disableViewCaching(){return this.documentView.disableViewCaching()}refreshViewCache(){return this.documentView.garbageCollectCachedViews()}isEditingAttachment(){return!!this.attachmentEditor}installAttachmentEditorForAttachment(Ce,ke){var $n;if((($n=this.attachmentEditor)===null||$n===void 0?void 0:$n.attachment)===Ce)return;const Hn=this.documentView.findElementForObject(Ce);if(!Hn)return;this.uninstallAttachmentEditor();const zn=this.composition.document.getAttachmentPieceForAttachment(Ce);this.attachmentEditor=new Ii(zn,Hn,this.element,ke),this.attachmentEditor.delegate=this}uninstallAttachmentEditor(){var Ce;return(Ce=this.attachmentEditor)===null||Ce===void 0?void 0:Ce.uninstall()}didUninstallAttachmentEditor(){return this.attachmentEditor=null,this.render()}attachmentEditorDidRequestUpdatingAttributesForAttachment(Ce,ke){var $n,Hn;return($n=this.delegate)===null||$n===void 0||(Hn=$n.compositionControllerWillUpdateAttachment)===null||Hn===void 0||Hn.call($n,ke),this.composition.updateAttributesForAttachment(Ce,ke)}attachmentEditorDidRequestRemovingAttributeForAttachment(Ce,ke){var $n,Hn;return($n=this.delegate)===null||$n===void 0||(Hn=$n.compositionControllerWillUpdateAttachment)===null||Hn===void 0||Hn.call($n,ke),this.composition.removeAttributeForAttachment(Ce,ke)}attachmentEditorDidRequestRemovalOfAttachment(Ce){var ke,$n;return(ke=this.delegate)===null||ke===void 0||($n=ke.compositionControllerDidRequestRemovalOfAttachment)===null||$n===void 0?void 0:$n.call(ke,Ce)}attachmentEditorDidRequestDeselectingAttachment(Ce){var ke,$n;return(ke=this.delegate)===null||ke===void 0||($n=ke.compositionControllerDidRequestDeselectingAttachment)===null||$n===void 0?void 0:$n.call(ke,Ce)}canSyncDocumentView(){return!this.isEditingAttachment()}findAttachmentForElement(Ce){return this.composition.document.getAttachmentById(parseInt(Ce.dataset.trixId,10))}}class Oi extends H{}const Mi="data-trix-mutable",ji="[".concat(Mi,"]"),Wi={attributes:!0,childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0};class Ui extends H{constructor(Ce){super(Ce),this.didMutate=this.didMutate.bind(this),this.element=Ce,this.observer=new window.MutationObserver(this.didMutate),this.start()}start(){return this.reset(),this.observer.observe(this.element,Wi)}stop(){return this.observer.disconnect()}didMutate(Ce){var ke,$n;if(this.mutations.push(...Array.from(this.findSignificantMutations(Ce)||[])),this.mutations.length)return(ke=this.delegate)===null||ke===void 0||($n=ke.elementDidMutate)===null||$n===void 0||$n.call(ke,this.getMutationSummary()),this.reset()}reset(){this.mutations=[]}findSignificantMutations(Ce){return Ce.filter(ke=>this.mutationIsSignificant(ke))}mutationIsSignificant(Ce){if(this.nodeIsMutable(Ce.target))return!1;for(const ke of Array.from(this.nodesModifiedByMutation(Ce)))if(this.nodeIsSignificant(ke))return!0;return!1}nodeIsSignificant(Ce){return Ce!==this.element&&!this.nodeIsMutable(Ce)&&!N(Ce)}nodeIsMutable(Ce){return A(Ce,{matchingSelector:ji})}nodesModifiedByMutation(Ce){const ke=[];switch(Ce.type){case"attributes":Ce.attributeName!==Mi&&ke.push(Ce.target);break;case"characterData":ke.push(Ce.target.parentNode),ke.push(Ce.target);break;case"childList":ke.push(...Array.from(Ce.addedNodes||[])),ke.push(...Array.from(Ce.removedNodes||[]))}return ke}getMutationSummary(){return this.getTextMutationSummary()}getTextMutationSummary(){const{additions:Ce,deletions:ke}=this.getTextChangesFromCharacterData(),$n=this.getTextChangesFromChildList();Array.from($n.additions).forEach(qn=>{Array.from(Ce).includes(qn)||Ce.push(qn)}),ke.push(...Array.from($n.deletions||[]));const Hn={},zn=Ce.join("");zn&&(Hn.textAdded=zn);const Un=ke.join("");return Un&&(Hn.textDeleted=Un),Hn}getMutationsByType(Ce){return Array.from(this.mutations).filter(ke=>ke.type===Ce)}getTextChangesFromChildList(){let Ce,ke;const $n=[],Hn=[];return Array.from(this.getMutationsByType("childList")).forEach(zn=>{$n.push(...Array.from(zn.addedNodes||[])),Hn.push(...Array.from(zn.removedNodes||[]))}),$n.length===0&&Hn.length===1&&B(Hn[0])?(Ce=[],ke=[` +`]):(Ce=qi($n),ke=qi(Hn)),{additions:Ce.filter((zn,Un)=>zn!==ke[Un]).map(Wt),deletions:ke.filter((zn,Un)=>zn!==Ce[Un]).map(Wt)}}getTextChangesFromCharacterData(){let Ce,ke;const $n=this.getMutationsByType("characterData");if($n.length){const Hn=$n[0],zn=$n[$n.length-1],Un=function(qn,Xn){let Kn,to;return qn=X.box(qn),(Xn=X.box(Xn)).length0&&arguments[0]!==void 0?arguments[0]:[];const Ce=[];for(const ke of Array.from(_n))switch(ke.nodeType){case Node.TEXT_NODE:Ce.push(ke.data);break;case Node.ELEMENT_NODE:E(ke)==="br"?Ce.push(` +`):Ce.push(...Array.from(qi(ke.childNodes)||[]))}return Ce};class Vi extends te{constructor(Ce){super(...arguments),this.file=Ce}perform(Ce){const ke=new FileReader;return ke.onerror=()=>Ce(!1),ke.onload=()=>{ke.onerror=null;try{ke.abort()}catch{}return Ce(!0,this.file)},ke.readAsArrayBuffer(this.file)}}class Hi{constructor(Ce){this.element=Ce}shouldIgnore(Ce){return!!a.samsungAndroid&&(this.previousEvent=this.event,this.event=Ce,this.checkSamsungKeyboardBuggyModeStart(),this.checkSamsungKeyboardBuggyModeEnd(),this.buggyMode)}checkSamsungKeyboardBuggyModeStart(){this.insertingLongTextAfterUnidentifiedChar()&&zi(this.element.innerText,this.event.data)&&(this.buggyMode=!0,this.event.preventDefault())}checkSamsungKeyboardBuggyModeEnd(){this.buggyMode&&this.event.inputType!=="insertText"&&(this.buggyMode=!1)}insertingLongTextAfterUnidentifiedChar(){var Ce;return this.isBeforeInputInsertText()&&this.previousEventWasUnidentifiedKeydown()&&((Ce=this.event.data)===null||Ce===void 0?void 0:Ce.length)>50}isBeforeInputInsertText(){return this.event.type==="beforeinput"&&this.event.inputType==="insertText"}previousEventWasUnidentifiedKeydown(){var Ce,ke;return((Ce=this.previousEvent)===null||Ce===void 0?void 0:Ce.type)==="keydown"&&((ke=this.previousEvent)===null||ke===void 0?void 0:ke.key)==="Unidentified"}}const zi=(_n,Ce)=>Ji(_n)===Ji(Ce),_i=new RegExp("(".concat("","|").concat(h,"|").concat(d,"|\\s)+"),"g"),Ji=_n=>_n.replace(_i," ").trim();class Ki extends H{constructor(Ce){super(...arguments),this.element=Ce,this.mutationObserver=new Ui(this.element),this.mutationObserver.delegate=this,this.flakyKeyboardDetector=new Hi(this.element);for(const ke in this.constructor.events)f(ke,{onElement:this.element,withCallback:this.handlerFor(ke)})}elementDidMutate(Ce){}editorWillSyncDocumentView(){return this.mutationObserver.stop()}editorDidSyncDocumentView(){return this.mutationObserver.start()}requestRender(){var Ce,ke;return(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.inputControllerDidRequestRender)===null||ke===void 0?void 0:ke.call(Ce)}requestReparse(){var Ce,ke;return(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.inputControllerDidRequestReparse)===null||ke===void 0||ke.call(Ce),this.requestRender()}attachFiles(Ce){const ke=Array.from(Ce).map($n=>new Vi($n));return Promise.all(ke).then($n=>{this.handleInput(function(){var Hn,zn;return(Hn=this.delegate)===null||Hn===void 0||Hn.inputControllerWillAttachFiles(),(zn=this.responder)===null||zn===void 0||zn.insertFiles($n),this.requestRender()})})}handlerFor(Ce){return ke=>{ke.defaultPrevented||this.handleInput(()=>{if(!x(this.element)){if(this.flakyKeyboardDetector.shouldIgnore(ke))return;this.eventName=Ce,this.constructor.events[Ce].call(this,ke)}})}}handleInput(Ce){try{var ke;(ke=this.delegate)===null||ke===void 0||ke.inputControllerWillHandleInput(),Ce.call(this)}finally{var $n;($n=this.delegate)===null||$n===void 0||$n.inputControllerDidHandleInput()}}createLinkHTML(Ce,ke){const $n=document.createElement("a");return $n.href=Ce,$n.textContent=ke||Ce,$n.outerHTML}}var Gi;Re(Ki,"events",{});const{browser:$i,keyNames:Xi}=V;let Yi=0;class Qi extends Ki{constructor(){super(...arguments),this.resetInputSummary()}setInputSummary(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.inputSummary.eventName=this.eventName;for(const ke in Ce){const $n=Ce[ke];this.inputSummary[ke]=$n}return this.inputSummary}resetInputSummary(){this.inputSummary={}}reset(){return this.resetInputSummary(),Pt.reset()}elementDidMutate(Ce){var ke,$n;return this.isComposing()?(ke=this.delegate)===null||ke===void 0||($n=ke.inputControllerDidAllowUnhandledInput)===null||$n===void 0?void 0:$n.call(ke):this.handleInput(function(){return this.mutationIsSignificant(Ce)&&(this.mutationIsExpected(Ce)?this.requestRender():this.requestReparse()),this.reset()})}mutationIsExpected(Ce){let{textAdded:ke,textDeleted:$n}=Ce;if(this.inputSummary.preferDocument)return!0;const Hn=ke!=null?ke===this.inputSummary.textAdded:!this.inputSummary.textAdded,zn=$n!=null?this.inputSummary.didDelete:!this.inputSummary.didDelete,Un=[` +`,` +`].includes(ke)&&!Hn,qn=$n===` +`&&!zn;if(Un&&!qn||qn&&!Un){const Kn=this.getSelectedRange();if(Kn){var Xn;const to=Un?ke.replace(/\n$/,"").length||-1:(ke==null?void 0:ke.length)||1;if((Xn=this.responder)!==null&&Xn!==void 0&&Xn.positionIsBlockBreak(Kn[1]+to))return!0}}return Hn&&zn}mutationIsSignificant(Ce){var ke;const $n=Object.keys(Ce).length>0,Hn=((ke=this.compositionInput)===null||ke===void 0?void 0:ke.getEndData())==="";return $n||!Hn}getCompositionInput(){if(this.isComposing())return this.compositionInput;this.compositionInput=new rn(this)}isComposing(){return this.compositionInput&&!this.compositionInput.isEnded()}deleteInDirection(Ce,ke){var $n;return(($n=this.responder)===null||$n===void 0?void 0:$n.deleteInDirection(Ce))!==!1?this.setInputSummary({didDelete:!0}):ke?(ke.preventDefault(),this.requestRender()):void 0}serializeSelectionToDataTransfer(Ce){var ke;if(!function(Hn){if(Hn==null||!Hn.setData)return!1;for(const zn in yt){const Un=yt[zn];try{if(Hn.setData(zn,Un),!Hn.getData(zn)===Un)return!1}catch{return!1}}return!0}(Ce))return;const $n=(ke=this.responder)===null||ke===void 0?void 0:ke.getSelectedDocument().toSerializableDocument();return Ce.setData("application/x-trix-document",JSON.stringify($n)),Ce.setData("text/html",ve.render($n).innerHTML),Ce.setData("text/plain",$n.toString().replace(/\n$/,"")),!0}canAcceptDataTransfer(Ce){const ke={};return Array.from((Ce==null?void 0:Ce.types)||[]).forEach($n=>{ke[$n]=!0}),ke.Files||ke["application/x-trix-document"]||ke["text/html"]||ke["text/plain"]}getPastedHTMLUsingHiddenElement(Ce){const ke=this.getSelectedRange(),$n={position:"absolute",left:"".concat(window.pageXOffset,"px"),top:"".concat(window.pageYOffset,"px"),opacity:0},Hn=S$1({style:$n,tagName:"div",editable:!0});return document.body.appendChild(Hn),Hn.focus(),requestAnimationFrame(()=>{const zn=Hn.innerHTML;return k(Hn),this.setSelectedRange(ke),Ce(zn)})}}Re(Qi,"events",{keydown(_n){this.isComposing()||this.resetInputSummary(),this.inputSummary.didInput=!0;const Ce=Xi[_n.keyCode];if(Ce){var ke;let Hn=this.keys;["ctrl","alt","shift","meta"].forEach(zn=>{var Un;_n["".concat(zn,"Key")]&&(zn==="ctrl"&&(zn="control"),Hn=(Un=Hn)===null||Un===void 0?void 0:Un[zn])}),((ke=Hn)===null||ke===void 0?void 0:ke[Ce])!=null&&(this.setInputSummary({keyName:Ce}),Pt.reset(),Hn[Ce].call(this,_n))}if(kt(_n)){const Hn=String.fromCharCode(_n.keyCode).toLowerCase();if(Hn){var $n;const zn=["alt","shift"].map(Un=>{if(_n["".concat(Un,"Key")])return Un}).filter(Un=>Un);zn.push(Hn),($n=this.delegate)!==null&&$n!==void 0&&$n.inputControllerDidReceiveKeyboardCommand(zn)&&_n.preventDefault()}}},keypress(_n){if(this.inputSummary.eventName!=null||_n.metaKey||_n.ctrlKey&&!_n.altKey)return;const Ce=en(_n);var ke,$n;return Ce?((ke=this.delegate)===null||ke===void 0||ke.inputControllerWillPerformTyping(),($n=this.responder)===null||$n===void 0||$n.insertString(Ce),this.setInputSummary({textAdded:Ce,didDelete:this.selectionIsExpanded()})):void 0},textInput(_n){const{data:Ce}=_n,{textAdded:ke}=this.inputSummary;if(ke&&ke!==Ce&&ke.toUpperCase()===Ce){var $n;const Hn=this.getSelectedRange();return this.setSelectedRange([Hn[0],Hn[1]+ke.length]),($n=this.responder)===null||$n===void 0||$n.insertString(Ce),this.setInputSummary({textAdded:Ce}),this.setSelectedRange(Hn)}},dragenter(_n){_n.preventDefault()},dragstart(_n){var Ce,ke;return this.serializeSelectionToDataTransfer(_n.dataTransfer),this.draggedRange=this.getSelectedRange(),(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.inputControllerDidStartDrag)===null||ke===void 0?void 0:ke.call(Ce)},dragover(_n){if(this.draggedRange||this.canAcceptDataTransfer(_n.dataTransfer)){_n.preventDefault();const $n={x:_n.clientX,y:_n.clientY};var Ce,ke;if(!St($n,this.draggingPoint))return this.draggingPoint=$n,(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.inputControllerDidReceiveDragOverPoint)===null||ke===void 0?void 0:ke.call(Ce,this.draggingPoint)}},dragend(_n){var Ce,ke;(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.inputControllerDidCancelDrag)===null||ke===void 0||ke.call(Ce),this.draggedRange=null,this.draggingPoint=null},drop(_n){var Ce,ke;_n.preventDefault();const $n=(Ce=_n.dataTransfer)===null||Ce===void 0?void 0:Ce.files,Hn=_n.dataTransfer.getData("application/x-trix-document"),zn={x:_n.clientX,y:_n.clientY};if((ke=this.responder)===null||ke===void 0||ke.setLocationRangeFromPointRange(zn),$n!=null&&$n.length)this.attachFiles($n);else if(this.draggedRange){var Un,qn;(Un=this.delegate)===null||Un===void 0||Un.inputControllerWillMoveText(),(qn=this.responder)===null||qn===void 0||qn.moveTextFromRange(this.draggedRange),this.draggedRange=null,this.requestRender()}else if(Hn){var Xn;const Kn=Je.fromJSONString(Hn);(Xn=this.responder)===null||Xn===void 0||Xn.insertDocument(Kn),this.requestRender()}this.draggedRange=null,this.draggingPoint=null},cut(_n){var Ce,ke;if((Ce=this.responder)!==null&&Ce!==void 0&&Ce.selectionIsExpanded()&&(this.serializeSelectionToDataTransfer(_n.clipboardData)&&_n.preventDefault(),(ke=this.delegate)===null||ke===void 0||ke.inputControllerWillCutText(),this.deleteInDirection("backward"),_n.defaultPrevented))return this.requestRender()},copy(_n){var Ce;(Ce=this.responder)!==null&&Ce!==void 0&&Ce.selectionIsExpanded()&&this.serializeSelectionToDataTransfer(_n.clipboardData)&&_n.preventDefault()},paste(_n){const Ce=_n.clipboardData||_n.testClipboardData,ke={clipboard:Ce};if(!Ce||nn(_n))return void this.getPastedHTMLUsingHiddenElement(Io=>{var Vo,Jo,Mo;return ke.type="text/html",ke.html=Io,(Vo=this.delegate)===null||Vo===void 0||Vo.inputControllerWillPaste(ke),(Jo=this.responder)===null||Jo===void 0||Jo.insertHTML(ke.html),this.requestRender(),(Mo=this.delegate)===null||Mo===void 0?void 0:Mo.inputControllerDidPaste(ke)});const $n=Ce.getData("URL"),Hn=Ce.getData("text/html"),zn=Ce.getData("public.url-name");if($n){var Un,qn,Xn;let Io;ke.type="text/html",Io=zn?qt(zn).trim():$n,ke.html=this.createLinkHTML($n,Io),(Un=this.delegate)===null||Un===void 0||Un.inputControllerWillPaste(ke),this.setInputSummary({textAdded:Io,didDelete:this.selectionIsExpanded()}),(qn=this.responder)===null||qn===void 0||qn.insertHTML(ke.html),this.requestRender(),(Xn=this.delegate)===null||Xn===void 0||Xn.inputControllerDidPaste(ke)}else if(Ct(Ce)){var Kn,to,io;ke.type="text/plain",ke.string=Ce.getData("text/plain"),(Kn=this.delegate)===null||Kn===void 0||Kn.inputControllerWillPaste(ke),this.setInputSummary({textAdded:ke.string,didDelete:this.selectionIsExpanded()}),(to=this.responder)===null||to===void 0||to.insertString(ke.string),this.requestRender(),(io=this.delegate)===null||io===void 0||io.inputControllerDidPaste(ke)}else if(Hn){var uo,ho,bo;ke.type="text/html",ke.html=Hn,(uo=this.delegate)===null||uo===void 0||uo.inputControllerWillPaste(ke),(ho=this.responder)===null||ho===void 0||ho.insertHTML(ke.html),this.requestRender(),(bo=this.delegate)===null||bo===void 0||bo.inputControllerDidPaste(ke)}else if(Array.from(Ce.types).includes("Files")){var Oo,So;const Io=(Oo=Ce.items)===null||Oo===void 0||(Oo=Oo[0])===null||Oo===void 0||(So=Oo.getAsFile)===null||So===void 0?void 0:So.call(Oo);if(Io){var $o,Do,xo;const Vo=Zi(Io);!Io.name&&Vo&&(Io.name="pasted-file-".concat(++Yi,".").concat(Vo)),ke.type="File",ke.file=Io,($o=this.delegate)===null||$o===void 0||$o.inputControllerWillAttachFiles(),(Do=this.responder)===null||Do===void 0||Do.insertFile(ke.file),this.requestRender(),(xo=this.delegate)===null||xo===void 0||xo.inputControllerDidPaste(ke)}}_n.preventDefault()},compositionstart(_n){return this.getCompositionInput().start(_n.data)},compositionupdate(_n){return this.getCompositionInput().update(_n.data)},compositionend(_n){return this.getCompositionInput().end(_n.data)},beforeinput(_n){this.inputSummary.didInput=!0},input(_n){return this.inputSummary.didInput=!0,_n.stopPropagation()}}),Re(Qi,"keys",{backspace(_n){var Ce;return(Ce=this.delegate)===null||Ce===void 0||Ce.inputControllerWillPerformTyping(),this.deleteInDirection("backward",_n)},delete(_n){var Ce;return(Ce=this.delegate)===null||Ce===void 0||Ce.inputControllerWillPerformTyping(),this.deleteInDirection("forward",_n)},return(_n){var Ce,ke;return this.setInputSummary({preferDocument:!0}),(Ce=this.delegate)===null||Ce===void 0||Ce.inputControllerWillPerformTyping(),(ke=this.responder)===null||ke===void 0?void 0:ke.insertLineBreak()},tab(_n){var Ce,ke;(Ce=this.responder)!==null&&Ce!==void 0&&Ce.canIncreaseNestingLevel()&&((ke=this.responder)===null||ke===void 0||ke.increaseNestingLevel(),this.requestRender(),_n.preventDefault())},left(_n){var Ce;if(this.selectionIsInCursorTarget())return _n.preventDefault(),(Ce=this.responder)===null||Ce===void 0?void 0:Ce.moveCursorInDirection("backward")},right(_n){var Ce;if(this.selectionIsInCursorTarget())return _n.preventDefault(),(Ce=this.responder)===null||Ce===void 0?void 0:Ce.moveCursorInDirection("forward")},control:{d(_n){var Ce;return(Ce=this.delegate)===null||Ce===void 0||Ce.inputControllerWillPerformTyping(),this.deleteInDirection("forward",_n)},h(_n){var Ce;return(Ce=this.delegate)===null||Ce===void 0||Ce.inputControllerWillPerformTyping(),this.deleteInDirection("backward",_n)},o(_n){var Ce,ke;return _n.preventDefault(),(Ce=this.delegate)===null||Ce===void 0||Ce.inputControllerWillPerformTyping(),(ke=this.responder)===null||ke===void 0||ke.insertString(` +`,{updatePosition:!1}),this.requestRender()}},shift:{return(_n){var Ce,ke;(Ce=this.delegate)===null||Ce===void 0||Ce.inputControllerWillPerformTyping(),(ke=this.responder)===null||ke===void 0||ke.insertString(` +`),this.requestRender(),_n.preventDefault()},tab(_n){var Ce,ke;(Ce=this.responder)!==null&&Ce!==void 0&&Ce.canDecreaseNestingLevel()&&((ke=this.responder)===null||ke===void 0||ke.decreaseNestingLevel(),this.requestRender(),_n.preventDefault())},left(_n){if(this.selectionIsInCursorTarget())return _n.preventDefault(),this.expandSelectionInDirection("backward")},right(_n){if(this.selectionIsInCursorTarget())return _n.preventDefault(),this.expandSelectionInDirection("forward")}},alt:{backspace(_n){var Ce;return this.setInputSummary({preferDocument:!1}),(Ce=this.delegate)===null||Ce===void 0?void 0:Ce.inputControllerWillPerformTyping()}},meta:{backspace(_n){var Ce;return this.setInputSummary({preferDocument:!1}),(Ce=this.delegate)===null||Ce===void 0?void 0:Ce.inputControllerWillPerformTyping()}}}),Qi.proxyMethod("responder?.getSelectedRange"),Qi.proxyMethod("responder?.setSelectedRange"),Qi.proxyMethod("responder?.expandSelectionInDirection"),Qi.proxyMethod("responder?.selectionIsInCursorTarget"),Qi.proxyMethod("responder?.selectionIsExpanded");const Zi=_n=>{var Ce;return(Ce=_n.type)===null||Ce===void 0||(Ce=Ce.match(/\/(\w+)$/))===null||Ce===void 0?void 0:Ce[1]},tn=!((Gi=" ".codePointAt)===null||Gi===void 0||!Gi.call(" ",0)),en=function(_n){if(_n.key&&tn&&_n.key.codePointAt(0)===_n.keyCode)return _n.key;{let Ce;if(_n.which===null?Ce=_n.keyCode:_n.which!==0&&_n.charCode!==0&&(Ce=_n.charCode),Ce!=null&&Xi[Ce]!=="escape")return X.fromCodepoints([Ce]).toString()}},nn=function(_n){const Ce=_n.clipboardData;if(Ce){if(Ce.types.includes("text/html")){for(const ke of Ce.types){const $n=/^CorePasteboardFlavorType/.test(ke),Hn=/^dyn\./.test(ke)&&Ce.getData(ke);if($n||Hn)return!0}return!1}{const ke=Ce.types.includes("com.apple.webarchive"),$n=Ce.types.includes("com.apple.flat-rtfd");return ke||$n}}};class rn extends H{constructor(Ce){super(...arguments),this.inputController=Ce,this.responder=this.inputController.responder,this.delegate=this.inputController.delegate,this.inputSummary=this.inputController.inputSummary,this.data={}}start(Ce){if(this.data.start=Ce,this.isSignificant()){var ke,$n;this.inputSummary.eventName==="keypress"&&this.inputSummary.textAdded&&(($n=this.responder)===null||$n===void 0||$n.deleteInDirection("left")),this.selectionIsExpanded()||(this.insertPlaceholder(),this.requestRender()),this.range=(ke=this.responder)===null||ke===void 0?void 0:ke.getSelectedRange()}}update(Ce){if(this.data.update=Ce,this.isSignificant()){const ke=this.selectPlaceholder();ke&&(this.forgetPlaceholder(),this.range=ke)}}end(Ce){return this.data.end=Ce,this.isSignificant()?(this.forgetPlaceholder(),this.canApplyToDocument()?(this.setInputSummary({preferDocument:!0,didInput:!1}),(ke=this.delegate)===null||ke===void 0||ke.inputControllerWillPerformTyping(),($n=this.responder)===null||$n===void 0||$n.setSelectedRange(this.range),(Hn=this.responder)===null||Hn===void 0||Hn.insertString(this.data.end),(zn=this.responder)===null||zn===void 0?void 0:zn.setSelectedRange(this.range[0]+this.data.end.length)):this.data.start!=null||this.data.update!=null?(this.requestReparse(),this.inputController.reset()):void 0):this.inputController.reset();var ke,$n,Hn,zn}getEndData(){return this.data.end}isEnded(){return this.getEndData()!=null}isSignificant(){return!$i.composesExistingText||this.inputSummary.didInput}canApplyToDocument(){var Ce,ke;return((Ce=this.data.start)===null||Ce===void 0?void 0:Ce.length)===0&&((ke=this.data.end)===null||ke===void 0?void 0:ke.length)>0&&this.range}}rn.proxyMethod("inputController.setInputSummary"),rn.proxyMethod("inputController.requestRender"),rn.proxyMethod("inputController.requestReparse"),rn.proxyMethod("responder?.selectionIsExpanded"),rn.proxyMethod("responder?.insertPlaceholder"),rn.proxyMethod("responder?.selectPlaceholder"),rn.proxyMethod("responder?.forgetPlaceholder");class on extends Ki{constructor(){super(...arguments),this.render=this.render.bind(this)}elementDidMutate(){return this.scheduledRender?this.composing?(Ce=this.delegate)===null||Ce===void 0||(ke=Ce.inputControllerDidAllowUnhandledInput)===null||ke===void 0?void 0:ke.call(Ce):void 0:this.reparse();var Ce,ke}scheduleRender(){return this.scheduledRender?this.scheduledRender:this.scheduledRender=requestAnimationFrame(this.render)}render(){var Ce,ke;cancelAnimationFrame(this.scheduledRender),this.scheduledRender=null,this.composing||(ke=this.delegate)===null||ke===void 0||ke.render(),(Ce=this.afterRender)===null||Ce===void 0||Ce.call(this),this.afterRender=null}reparse(){var Ce;return(Ce=this.delegate)===null||Ce===void 0?void 0:Ce.reparse()}insertString(){var Ce;let ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",$n=arguments.length>1?arguments[1]:void 0;return(Ce=this.delegate)===null||Ce===void 0||Ce.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var Hn;return(Hn=this.responder)===null||Hn===void 0?void 0:Hn.insertString(ke,$n)})}toggleAttributeIfSupported(Ce){var ke;if(dt().includes(Ce))return(ke=this.delegate)===null||ke===void 0||ke.inputControllerWillPerformFormatting(Ce),this.withTargetDOMRange(function(){var $n;return($n=this.responder)===null||$n===void 0?void 0:$n.toggleCurrentAttribute(Ce)})}activateAttributeIfSupported(Ce,ke){var $n;if(dt().includes(Ce))return($n=this.delegate)===null||$n===void 0||$n.inputControllerWillPerformFormatting(Ce),this.withTargetDOMRange(function(){var Hn;return(Hn=this.responder)===null||Hn===void 0?void 0:Hn.setCurrentAttribute(Ce,ke)})}deleteInDirection(Ce){let{recordUndoEntry:ke}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{recordUndoEntry:!0};var $n;ke&&(($n=this.delegate)===null||$n===void 0||$n.inputControllerWillPerformTyping());const Hn=()=>{var Un;return(Un=this.responder)===null||Un===void 0?void 0:Un.deleteInDirection(Ce)},zn=this.getTargetDOMRange({minLength:this.composing?1:2});return zn?this.withTargetDOMRange(zn,Hn):Hn()}withTargetDOMRange(Ce,ke){var $n;return typeof Ce=="function"&&(ke=Ce,Ce=this.getTargetDOMRange()),Ce?($n=this.responder)===null||$n===void 0?void 0:$n.withTargetDOMRange(Ce,ke.bind(this)):(Pt.reset(),ke.call(this))}getTargetDOMRange(){var Ce,ke;let{minLength:$n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{minLength:0};const Hn=(Ce=(ke=this.event).getTargetRanges)===null||Ce===void 0?void 0:Ce.call(ke);if(Hn&&Hn.length){const zn=sn(Hn[0]);if($n===0||zn.toString().length>=$n)return zn}}withEvent(Ce,ke){let $n;this.event=Ce;try{$n=ke.call(this)}finally{this.event=null}return $n}}Re(on,"events",{keydown(_n){if(kt(_n)){var Ce;const ke=hn(_n);(Ce=this.delegate)!==null&&Ce!==void 0&&Ce.inputControllerDidReceiveKeyboardCommand(ke)&&_n.preventDefault()}else{let ke=_n.key;_n.altKey&&(ke+="+Alt"),_n.shiftKey&&(ke+="+Shift");const $n=this.constructor.keys[ke];if($n)return this.withEvent(_n,$n)}},paste(_n){var Ce;let ke;const $n=(Ce=_n.clipboardData)===null||Ce===void 0?void 0:Ce.getData("URL");return cn(_n)?(_n.preventDefault(),this.attachFiles(_n.clipboardData.files)):un(_n)?(_n.preventDefault(),ke={type:"text/plain",string:_n.clipboardData.getData("text/plain")},(Hn=this.delegate)===null||Hn===void 0||Hn.inputControllerWillPaste(ke),(zn=this.responder)===null||zn===void 0||zn.insertString(ke.string),this.render(),(Un=this.delegate)===null||Un===void 0?void 0:Un.inputControllerDidPaste(ke)):$n?(_n.preventDefault(),ke={type:"text/html",html:this.createLinkHTML($n)},(qn=this.delegate)===null||qn===void 0||qn.inputControllerWillPaste(ke),(Xn=this.responder)===null||Xn===void 0||Xn.insertHTML(ke.html),this.render(),(Kn=this.delegate)===null||Kn===void 0?void 0:Kn.inputControllerDidPaste(ke)):void 0;var Hn,zn,Un,qn,Xn,Kn},beforeinput(_n){const Ce=this.constructor.inputTypes[_n.inputType];Ce&&(this.withEvent(_n,Ce),this.scheduleRender())},input(_n){Pt.reset()},dragstart(_n){var Ce,ke;(Ce=this.responder)!==null&&Ce!==void 0&&Ce.selectionContainsAttachments()&&(_n.dataTransfer.setData("application/x-trix-dragging",!0),this.dragging={range:(ke=this.responder)===null||ke===void 0?void 0:ke.getSelectedRange(),point:dn(_n)})},dragenter(_n){an(_n)&&_n.preventDefault()},dragover(_n){if(this.dragging){_n.preventDefault();const ke=dn(_n);var Ce;if(!St(ke,this.dragging.point))return this.dragging.point=ke,(Ce=this.responder)===null||Ce===void 0?void 0:Ce.setLocationRangeFromPointRange(ke)}else an(_n)&&_n.preventDefault()},drop(_n){var Ce,ke;if(this.dragging)return _n.preventDefault(),(Ce=this.delegate)===null||Ce===void 0||Ce.inputControllerWillMoveText(),(ke=this.responder)===null||ke===void 0||ke.moveTextFromRange(this.dragging.range),this.dragging=null,this.scheduleRender();if(an(_n)){var $n;_n.preventDefault();const Hn=dn(_n);return($n=this.responder)===null||$n===void 0||$n.setLocationRangeFromPointRange(Hn),this.attachFiles(_n.dataTransfer.files)}},dragend(){var _n;this.dragging&&((_n=this.responder)===null||_n===void 0||_n.setSelectedRange(this.dragging.range),this.dragging=null)},compositionend(_n){this.composing&&(this.composing=!1,a.recentAndroid||this.scheduleRender())}}),Re(on,"keys",{ArrowLeft(){var _n,Ce;if((_n=this.responder)!==null&&_n!==void 0&&_n.shouldManageMovingCursorInDirection("backward"))return this.event.preventDefault(),(Ce=this.responder)===null||Ce===void 0?void 0:Ce.moveCursorInDirection("backward")},ArrowRight(){var _n,Ce;if((_n=this.responder)!==null&&_n!==void 0&&_n.shouldManageMovingCursorInDirection("forward"))return this.event.preventDefault(),(Ce=this.responder)===null||Ce===void 0?void 0:Ce.moveCursorInDirection("forward")},Backspace(){var _n,Ce,ke;if((_n=this.responder)!==null&&_n!==void 0&&_n.shouldManageDeletingInDirection("backward"))return this.event.preventDefault(),(Ce=this.delegate)===null||Ce===void 0||Ce.inputControllerWillPerformTyping(),(ke=this.responder)===null||ke===void 0||ke.deleteInDirection("backward"),this.render()},Tab(){var _n,Ce;if((_n=this.responder)!==null&&_n!==void 0&&_n.canIncreaseNestingLevel())return this.event.preventDefault(),(Ce=this.responder)===null||Ce===void 0||Ce.increaseNestingLevel(),this.render()},"Tab+Shift"(){var _n,Ce;if((_n=this.responder)!==null&&_n!==void 0&&_n.canDecreaseNestingLevel())return this.event.preventDefault(),(Ce=this.responder)===null||Ce===void 0||Ce.decreaseNestingLevel(),this.render()}}),Re(on,"inputTypes",{deleteByComposition(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteByCut(){return this.deleteInDirection("backward")},deleteByDrag(){return this.event.preventDefault(),this.withTargetDOMRange(function(){var _n;this.deleteByDragRange=(_n=this.responder)===null||_n===void 0?void 0:_n.getSelectedRange()})},deleteCompositionText(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteContent(){return this.deleteInDirection("backward")},deleteContentBackward(){return this.deleteInDirection("backward")},deleteContentForward(){return this.deleteInDirection("forward")},deleteEntireSoftLine(){return this.deleteInDirection("forward")},deleteHardLineBackward(){return this.deleteInDirection("backward")},deleteHardLineForward(){return this.deleteInDirection("forward")},deleteSoftLineBackward(){return this.deleteInDirection("backward")},deleteSoftLineForward(){return this.deleteInDirection("forward")},deleteWordBackward(){return this.deleteInDirection("backward")},deleteWordForward(){return this.deleteInDirection("forward")},formatBackColor(){return this.activateAttributeIfSupported("backgroundColor",this.event.data)},formatBold(){return this.toggleAttributeIfSupported("bold")},formatFontColor(){return this.activateAttributeIfSupported("color",this.event.data)},formatFontName(){return this.activateAttributeIfSupported("font",this.event.data)},formatIndent(){var _n;if((_n=this.responder)!==null&&_n!==void 0&&_n.canIncreaseNestingLevel())return this.withTargetDOMRange(function(){var Ce;return(Ce=this.responder)===null||Ce===void 0?void 0:Ce.increaseNestingLevel()})},formatItalic(){return this.toggleAttributeIfSupported("italic")},formatJustifyCenter(){return this.toggleAttributeIfSupported("justifyCenter")},formatJustifyFull(){return this.toggleAttributeIfSupported("justifyFull")},formatJustifyLeft(){return this.toggleAttributeIfSupported("justifyLeft")},formatJustifyRight(){return this.toggleAttributeIfSupported("justifyRight")},formatOutdent(){var _n;if((_n=this.responder)!==null&&_n!==void 0&&_n.canDecreaseNestingLevel())return this.withTargetDOMRange(function(){var Ce;return(Ce=this.responder)===null||Ce===void 0?void 0:Ce.decreaseNestingLevel()})},formatRemove(){this.withTargetDOMRange(function(){for(const ke in(_n=this.responder)===null||_n===void 0?void 0:_n.getCurrentAttributes()){var _n,Ce;(Ce=this.responder)===null||Ce===void 0||Ce.removeCurrentAttribute(ke)}})},formatSetBlockTextDirection(){return this.activateAttributeIfSupported("blockDir",this.event.data)},formatSetInlineTextDirection(){return this.activateAttributeIfSupported("textDir",this.event.data)},formatStrikeThrough(){return this.toggleAttributeIfSupported("strike")},formatSubscript(){return this.toggleAttributeIfSupported("sub")},formatSuperscript(){return this.toggleAttributeIfSupported("sup")},formatUnderline(){return this.toggleAttributeIfSupported("underline")},historyRedo(){var _n;return(_n=this.delegate)===null||_n===void 0?void 0:_n.inputControllerWillPerformRedo()},historyUndo(){var _n;return(_n=this.delegate)===null||_n===void 0?void 0:_n.inputControllerWillPerformUndo()},insertCompositionText(){return this.composing=!0,this.insertString(this.event.data)},insertFromComposition(){return this.composing=!1,this.insertString(this.event.data)},insertFromDrop(){const _n=this.deleteByDragRange;var Ce;if(_n)return this.deleteByDragRange=null,(Ce=this.delegate)===null||Ce===void 0||Ce.inputControllerWillMoveText(),this.withTargetDOMRange(function(){var ke;return(ke=this.responder)===null||ke===void 0?void 0:ke.moveTextFromRange(_n)})},insertFromPaste(){const{dataTransfer:_n}=this.event,Ce={dataTransfer:_n},ke=_n.getData("URL"),$n=_n.getData("text/html");if(ke){var Hn;let Xn;this.event.preventDefault(),Ce.type="text/html";const Kn=_n.getData("public.url-name");Xn=Kn?qt(Kn).trim():ke,Ce.html=this.createLinkHTML(ke,Xn),(Hn=this.delegate)===null||Hn===void 0||Hn.inputControllerWillPaste(Ce),this.withTargetDOMRange(function(){var to;return(to=this.responder)===null||to===void 0?void 0:to.insertHTML(Ce.html)}),this.afterRender=()=>{var to;return(to=this.delegate)===null||to===void 0?void 0:to.inputControllerDidPaste(Ce)}}else if(Ct(_n)){var zn;Ce.type="text/plain",Ce.string=_n.getData("text/plain"),(zn=this.delegate)===null||zn===void 0||zn.inputControllerWillPaste(Ce),this.withTargetDOMRange(function(){var Xn;return(Xn=this.responder)===null||Xn===void 0?void 0:Xn.insertString(Ce.string)}),this.afterRender=()=>{var Xn;return(Xn=this.delegate)===null||Xn===void 0?void 0:Xn.inputControllerDidPaste(Ce)}}else if(ln(this.event)){var Un;Ce.type="File",Ce.file=_n.files[0],(Un=this.delegate)===null||Un===void 0||Un.inputControllerWillPaste(Ce),this.withTargetDOMRange(function(){var Xn;return(Xn=this.responder)===null||Xn===void 0?void 0:Xn.insertFile(Ce.file)}),this.afterRender=()=>{var Xn;return(Xn=this.delegate)===null||Xn===void 0?void 0:Xn.inputControllerDidPaste(Ce)}}else if($n){var qn;this.event.preventDefault(),Ce.type="text/html",Ce.html=$n,(qn=this.delegate)===null||qn===void 0||qn.inputControllerWillPaste(Ce),this.withTargetDOMRange(function(){var Xn;return(Xn=this.responder)===null||Xn===void 0?void 0:Xn.insertHTML(Ce.html)}),this.afterRender=()=>{var Xn;return(Xn=this.delegate)===null||Xn===void 0?void 0:Xn.inputControllerDidPaste(Ce)}}},insertFromYank(){return this.insertString(this.event.data)},insertLineBreak(){return this.insertString(` +`)},insertLink(){return this.activateAttributeIfSupported("href",this.event.data)},insertOrderedList(){return this.toggleAttributeIfSupported("number")},insertParagraph(){var _n;return(_n=this.delegate)===null||_n===void 0||_n.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var Ce;return(Ce=this.responder)===null||Ce===void 0?void 0:Ce.insertLineBreak()})},insertReplacementText(){const _n=this.event.dataTransfer.getData("text/plain"),Ce=this.event.getTargetRanges()[0];this.withTargetDOMRange(Ce,()=>{this.insertString(_n,{updatePosition:!1})})},insertText(){var _n;return this.insertString(this.event.data||((_n=this.event.dataTransfer)===null||_n===void 0?void 0:_n.getData("text/plain")))},insertTranspose(){return this.insertString(this.event.data)},insertUnorderedList(){return this.toggleAttributeIfSupported("bullet")}});const sn=function(_n){const Ce=document.createRange();return Ce.setStart(_n.startContainer,_n.startOffset),Ce.setEnd(_n.endContainer,_n.endOffset),Ce},an=_n=>{var Ce;return Array.from(((Ce=_n.dataTransfer)===null||Ce===void 0?void 0:Ce.types)||[]).includes("Files")},ln=_n=>{var Ce;return((Ce=_n.dataTransfer.files)===null||Ce===void 0?void 0:Ce[0])&&!cn(_n)&&!(ke=>{let{dataTransfer:$n}=ke;return $n.types.includes("Files")&&$n.types.includes("text/html")&&$n.getData("text/html").includes("urn:schemas-microsoft-com:office:office")})(_n)},cn=function(_n){const Ce=_n.clipboardData;if(Ce)return Array.from(Ce.types).filter(ke=>ke.match(/file/i)).length===Ce.types.length&&Ce.files.length>=1},un=function(_n){const Ce=_n.clipboardData;if(Ce)return Ce.types.includes("text/plain")&&Ce.types.length===1},hn=function(_n){const Ce=[];return _n.altKey&&Ce.push("alt"),_n.shiftKey&&Ce.push("shift"),Ce.push(_n.key),Ce},dn=_n=>({x:_n.clientX,y:_n.clientY}),gn="[data-trix-attribute]",mn="[data-trix-action]",pn="".concat(gn,", ").concat(mn),fn="[data-trix-dialog]",bn="".concat(fn,"[data-trix-active]"),vn="".concat(fn," [data-trix-method]"),An="".concat(fn," [data-trix-input]"),xn=(_n,Ce)=>(Ce||(Ce=Cn(_n)),_n.querySelector("[data-trix-input][name='".concat(Ce,"']"))),yn=_n=>_n.getAttribute("data-trix-action"),Cn=_n=>_n.getAttribute("data-trix-attribute")||_n.getAttribute("data-trix-dialog-attribute");class kn extends H{constructor(Ce){super(Ce),this.didClickActionButton=this.didClickActionButton.bind(this),this.didClickAttributeButton=this.didClickAttributeButton.bind(this),this.didClickDialogButton=this.didClickDialogButton.bind(this),this.didKeyDownDialogInput=this.didKeyDownDialogInput.bind(this),this.element=Ce,this.attributes={},this.actions={},this.resetDialogInputs(),f("mousedown",{onElement:this.element,matchingSelector:mn,withCallback:this.didClickActionButton}),f("mousedown",{onElement:this.element,matchingSelector:gn,withCallback:this.didClickAttributeButton}),f("click",{onElement:this.element,matchingSelector:pn,preventDefault:!0}),f("click",{onElement:this.element,matchingSelector:vn,withCallback:this.didClickDialogButton}),f("keydown",{onElement:this.element,matchingSelector:An,withCallback:this.didKeyDownDialogInput})}didClickActionButton(Ce,ke){var $n;($n=this.delegate)===null||$n===void 0||$n.toolbarDidClickButton(),Ce.preventDefault();const Hn=yn(ke);return this.getDialog(Hn)?this.toggleDialog(Hn):(zn=this.delegate)===null||zn===void 0?void 0:zn.toolbarDidInvokeAction(Hn,ke);var zn}didClickAttributeButton(Ce,ke){var $n;($n=this.delegate)===null||$n===void 0||$n.toolbarDidClickButton(),Ce.preventDefault();const Hn=Cn(ke);var zn;return this.getDialog(Hn)?this.toggleDialog(Hn):(zn=this.delegate)===null||zn===void 0||zn.toolbarDidToggleAttribute(Hn),this.refreshAttributeButtons()}didClickDialogButton(Ce,ke){const $n=A(ke,{matchingSelector:fn});return this[ke.getAttribute("data-trix-method")].call(this,$n)}didKeyDownDialogInput(Ce,ke){if(Ce.keyCode===13){Ce.preventDefault();const $n=ke.getAttribute("name"),Hn=this.getDialog($n);this.setAttribute(Hn)}if(Ce.keyCode===27)return Ce.preventDefault(),this.hideDialog()}updateActions(Ce){return this.actions=Ce,this.refreshActionButtons()}refreshActionButtons(){return this.eachActionButton((Ce,ke)=>{Ce.disabled=this.actions[ke]===!1})}eachActionButton(Ce){return Array.from(this.element.querySelectorAll(mn)).map(ke=>Ce(ke,yn(ke)))}updateAttributes(Ce){return this.attributes=Ce,this.refreshAttributeButtons()}refreshAttributeButtons(){return this.eachAttributeButton((Ce,ke)=>(Ce.disabled=this.attributes[ke]===!1,this.attributes[ke]||this.dialogIsVisible(ke)?(Ce.setAttribute("data-trix-active",""),Ce.classList.add("trix-active")):(Ce.removeAttribute("data-trix-active"),Ce.classList.remove("trix-active"))))}eachAttributeButton(Ce){return Array.from(this.element.querySelectorAll(gn)).map(ke=>Ce(ke,Cn(ke)))}applyKeyboardCommand(Ce){const ke=JSON.stringify(Ce.sort());for(const $n of Array.from(this.element.querySelectorAll("[data-trix-key]"))){const Hn=$n.getAttribute("data-trix-key").split("+");if(JSON.stringify(Hn.sort())===ke)return b("mousedown",{onElement:$n}),!0}return!1}dialogIsVisible(Ce){const ke=this.getDialog(Ce);if(ke)return ke.hasAttribute("data-trix-active")}toggleDialog(Ce){return this.dialogIsVisible(Ce)?this.hideDialog():this.showDialog(Ce)}showDialog(Ce){var ke,$n;this.hideDialog(),(ke=this.delegate)===null||ke===void 0||ke.toolbarWillShowDialog();const Hn=this.getDialog(Ce);Hn.setAttribute("data-trix-active",""),Hn.classList.add("trix-active"),Array.from(Hn.querySelectorAll("input[disabled]")).forEach(Un=>{Un.removeAttribute("disabled")});const zn=Cn(Hn);if(zn){const Un=xn(Hn,Ce);Un&&(Un.value=this.attributes[zn]||"",Un.select())}return($n=this.delegate)===null||$n===void 0?void 0:$n.toolbarDidShowDialog(Ce)}setAttribute(Ce){const ke=Cn(Ce),$n=xn(Ce,ke);return $n.willValidate&&!$n.checkValidity()?($n.setAttribute("data-trix-validate",""),$n.classList.add("trix-validate"),$n.focus()):((Hn=this.delegate)===null||Hn===void 0||Hn.toolbarDidUpdateAttribute(ke,$n.value),this.hideDialog());var Hn}removeAttribute(Ce){var ke;const $n=Cn(Ce);return(ke=this.delegate)===null||ke===void 0||ke.toolbarDidRemoveAttribute($n),this.hideDialog()}hideDialog(){const Ce=this.element.querySelector(bn);var ke;if(Ce)return Ce.removeAttribute("data-trix-active"),Ce.classList.remove("trix-active"),this.resetDialogInputs(),(ke=this.delegate)===null||ke===void 0?void 0:ke.toolbarDidHideDialog(($n=>$n.getAttribute("data-trix-dialog"))(Ce))}resetDialogInputs(){Array.from(this.element.querySelectorAll(An)).forEach(Ce=>{Ce.setAttribute("disabled","disabled"),Ce.removeAttribute("data-trix-validate"),Ce.classList.remove("trix-validate")})}getDialog(Ce){return this.element.querySelector("[data-trix-dialog=".concat(Ce,"]"))}}class Rn extends Oi{constructor(Ce){let{editorElement:ke,document:$n,html:Hn}=Ce;super(...arguments),this.editorElement=ke,this.selectionManager=new Li(this.editorElement),this.selectionManager.delegate=this,this.composition=new gi,this.composition.delegate=this,this.attachmentManager=new hi(this.composition.getAttachments()),this.attachmentManager.delegate=this,this.inputController=M.getLevel()===2?new on(this.editorElement):new Qi(this.editorElement),this.inputController.delegate=this,this.inputController.responder=this.composition,this.compositionController=new Ni(this.editorElement,this.composition),this.compositionController.delegate=this,this.toolbarController=new kn(this.editorElement.toolbarElement),this.toolbarController.delegate=this,this.editor=new xi(this.composition,this.selectionManager,this.editorElement),$n?this.editor.loadDocument($n):this.editor.loadHTML(Hn)}registerSelectionManager(){return Pt.registerSelectionManager(this.selectionManager)}unregisterSelectionManager(){return Pt.unregisterSelectionManager(this.selectionManager)}render(){return this.compositionController.render()}reparse(){return this.composition.replaceHTML(this.editorElement.innerHTML)}compositionDidChangeDocument(Ce){if(this.notifyEditorElement("document-change"),!this.handlingInput)return this.render()}compositionDidChangeCurrentAttributes(Ce){return this.currentAttributes=Ce,this.toolbarController.updateAttributes(this.currentAttributes),this.updateCurrentActions(),this.notifyEditorElement("attributes-change",{attributes:this.currentAttributes})}compositionDidPerformInsertionAtRange(Ce){this.pasting&&(this.pastedRange=Ce)}compositionShouldAcceptFile(Ce){return this.notifyEditorElement("file-accept",{file:Ce})}compositionDidAddAttachment(Ce){const ke=this.attachmentManager.manageAttachment(Ce);return this.notifyEditorElement("attachment-add",{attachment:ke})}compositionDidEditAttachment(Ce){this.compositionController.rerenderViewForObject(Ce);const ke=this.attachmentManager.manageAttachment(Ce);return this.notifyEditorElement("attachment-edit",{attachment:ke}),this.notifyEditorElement("change")}compositionDidChangeAttachmentPreviewURL(Ce){return this.compositionController.invalidateViewForObject(Ce),this.notifyEditorElement("change")}compositionDidRemoveAttachment(Ce){const ke=this.attachmentManager.unmanageAttachment(Ce);return this.notifyEditorElement("attachment-remove",{attachment:ke})}compositionDidStartEditingAttachment(Ce,ke){return this.attachmentLocationRange=this.composition.document.getLocationRangeOfAttachment(Ce),this.compositionController.installAttachmentEditorForAttachment(Ce,ke),this.selectionManager.setLocationRange(this.attachmentLocationRange)}compositionDidStopEditingAttachment(Ce){this.compositionController.uninstallAttachmentEditor(),this.attachmentLocationRange=null}compositionDidRequestChangingSelectionToLocationRange(Ce){if(!this.loadingSnapshot||this.isFocused())return this.requestedLocationRange=Ce,this.compositionRevisionWhenLocationRangeRequested=this.composition.revision,this.handlingInput?void 0:this.render()}compositionWillLoadSnapshot(){this.loadingSnapshot=!0}compositionDidLoadSnapshot(){this.compositionController.refreshViewCache(),this.render(),this.loadingSnapshot=!1}getSelectionManager(){return this.selectionManager}attachmentManagerDidRequestRemovalOfAttachment(Ce){return this.removeAttachment(Ce)}compositionControllerWillSyncDocumentView(){return this.inputController.editorWillSyncDocumentView(),this.selectionManager.lock(),this.selectionManager.clearSelection()}compositionControllerDidSyncDocumentView(){return this.inputController.editorDidSyncDocumentView(),this.selectionManager.unlock(),this.updateCurrentActions(),this.notifyEditorElement("sync")}compositionControllerDidRender(){this.requestedLocationRange&&(this.compositionRevisionWhenLocationRangeRequested===this.composition.revision&&this.selectionManager.setLocationRange(this.requestedLocationRange),this.requestedLocationRange=null,this.compositionRevisionWhenLocationRangeRequested=null),this.renderedCompositionRevision!==this.composition.revision&&(this.runEditorFilters(),this.composition.updateCurrentAttributes(),this.notifyEditorElement("render")),this.renderedCompositionRevision=this.composition.revision}compositionControllerDidFocus(){return this.isFocusedInvisibly()&&this.setLocationRange({index:0,offset:0}),this.toolbarController.hideDialog(),this.notifyEditorElement("focus")}compositionControllerDidBlur(){return this.notifyEditorElement("blur")}compositionControllerDidSelectAttachment(Ce,ke){return this.toolbarController.hideDialog(),this.composition.editAttachment(Ce,ke)}compositionControllerDidRequestDeselectingAttachment(Ce){const ke=this.attachmentLocationRange||this.composition.document.getLocationRangeOfAttachment(Ce);return this.selectionManager.setLocationRange(ke[1])}compositionControllerWillUpdateAttachment(Ce){return this.editor.recordUndoEntry("Edit Attachment",{context:Ce.id,consolidatable:!0})}compositionControllerDidRequestRemovalOfAttachment(Ce){return this.removeAttachment(Ce)}inputControllerWillHandleInput(){this.handlingInput=!0,this.requestedRender=!1}inputControllerDidRequestRender(){this.requestedRender=!0}inputControllerDidHandleInput(){if(this.handlingInput=!1,this.requestedRender)return this.requestedRender=!1,this.render()}inputControllerDidAllowUnhandledInput(){return this.notifyEditorElement("change")}inputControllerDidRequestReparse(){return this.reparse()}inputControllerWillPerformTyping(){return this.recordTypingUndoEntry()}inputControllerWillPerformFormatting(Ce){return this.recordFormattingUndoEntry(Ce)}inputControllerWillCutText(){return this.editor.recordUndoEntry("Cut")}inputControllerWillPaste(Ce){return this.editor.recordUndoEntry("Paste"),this.pasting=!0,this.notifyEditorElement("before-paste",{paste:Ce})}inputControllerDidPaste(Ce){return Ce.range=this.pastedRange,this.pastedRange=null,this.pasting=null,this.notifyEditorElement("paste",{paste:Ce})}inputControllerWillMoveText(){return this.editor.recordUndoEntry("Move")}inputControllerWillAttachFiles(){return this.editor.recordUndoEntry("Drop Files")}inputControllerWillPerformUndo(){return this.editor.undo()}inputControllerWillPerformRedo(){return this.editor.redo()}inputControllerDidReceiveKeyboardCommand(Ce){return this.toolbarController.applyKeyboardCommand(Ce)}inputControllerDidStartDrag(){this.locationRangeBeforeDrag=this.selectionManager.getLocationRange()}inputControllerDidReceiveDragOverPoint(Ce){return this.selectionManager.setLocationRangeFromPointRange(Ce)}inputControllerDidCancelDrag(){this.selectionManager.setLocationRange(this.locationRangeBeforeDrag),this.locationRangeBeforeDrag=null}locationRangeDidChange(Ce){return this.composition.updateCurrentAttributes(),this.updateCurrentActions(),this.attachmentLocationRange&&!wt(this.attachmentLocationRange,Ce)&&this.composition.stopEditingAttachment(),this.notifyEditorElement("selection-change")}toolbarDidClickButton(){if(!this.getLocationRange())return this.setLocationRange({index:0,offset:0})}toolbarDidInvokeAction(Ce,ke){return this.invokeAction(Ce,ke)}toolbarDidToggleAttribute(Ce){if(this.recordFormattingUndoEntry(Ce),this.composition.toggleCurrentAttribute(Ce),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidUpdateAttribute(Ce,ke){if(this.recordFormattingUndoEntry(Ce),this.composition.setCurrentAttribute(Ce,ke),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidRemoveAttribute(Ce){if(this.recordFormattingUndoEntry(Ce),this.composition.removeCurrentAttribute(Ce),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarWillShowDialog(Ce){return this.composition.expandSelectionForEditing(),this.freezeSelection()}toolbarDidShowDialog(Ce){return this.notifyEditorElement("toolbar-dialog-show",{dialogName:Ce})}toolbarDidHideDialog(Ce){return this.thawSelection(),this.editorElement.focus(),this.notifyEditorElement("toolbar-dialog-hide",{dialogName:Ce})}freezeSelection(){if(!this.selectionFrozen)return this.selectionManager.lock(),this.composition.freezeSelection(),this.selectionFrozen=!0,this.render()}thawSelection(){if(this.selectionFrozen)return this.composition.thawSelection(),this.selectionManager.unlock(),this.selectionFrozen=!1,this.render()}canInvokeAction(Ce){return!!this.actionIsExternal(Ce)||!((ke=this.actions[Ce])===null||ke===void 0||(ke=ke.test)===null||ke===void 0||!ke.call(this));var ke}invokeAction(Ce,ke){return this.actionIsExternal(Ce)?this.notifyEditorElement("action-invoke",{actionName:Ce,invokingElement:ke}):($n=this.actions[Ce])===null||$n===void 0||($n=$n.perform)===null||$n===void 0?void 0:$n.call(this);var $n}actionIsExternal(Ce){return/^x-./.test(Ce)}getCurrentActions(){const Ce={};for(const ke in this.actions)Ce[ke]=this.canInvokeAction(ke);return Ce}updateCurrentActions(){const Ce=this.getCurrentActions();if(!St(Ce,this.currentActions))return this.currentActions=Ce,this.toolbarController.updateActions(this.currentActions),this.notifyEditorElement("actions-change",{actions:this.currentActions})}runEditorFilters(){let Ce=this.composition.getSnapshot();if(Array.from(this.editor.filters).forEach(Hn=>{const{document:zn,selectedRange:Un}=Ce;Ce=Hn.call(this.editor,Ce)||{},Ce.document||(Ce.document=zn),Ce.selectedRange||(Ce.selectedRange=Un)}),ke=Ce,$n=this.composition.getSnapshot(),!wt(ke.selectedRange,$n.selectedRange)||!ke.document.isEqualTo($n.document))return this.composition.loadSnapshot(Ce);var ke,$n}updateInputElement(){const Ce=function(ke,$n){const Hn=li[$n];if(Hn)return Hn(ke);throw new Error("unknown content type: ".concat($n))}(this.compositionController.getSerializableElement(),"text/html");return this.editorElement.setInputElementValue(Ce)}notifyEditorElement(Ce,ke){switch(Ce){case"document-change":this.documentChangedSinceLastRender=!0;break;case"render":this.documentChangedSinceLastRender&&(this.documentChangedSinceLastRender=!1,this.notifyEditorElement("change"));break;case"change":case"attachment-add":case"attachment-edit":case"attachment-remove":this.updateInputElement()}return this.editorElement.notify(Ce,ke)}removeAttachment(Ce){return this.editor.recordUndoEntry("Delete Attachment"),this.composition.removeAttachment(Ce),this.render()}recordFormattingUndoEntry(Ce){const ke=gt(Ce),$n=this.selectionManager.getLocationRange();if(ke||!Dt($n))return this.editor.recordUndoEntry("Formatting",{context:this.getUndoContext(),consolidatable:!0})}recordTypingUndoEntry(){return this.editor.recordUndoEntry("Typing",{context:this.getUndoContext(this.currentAttributes),consolidatable:!0})}getUndoContext(){for(var Ce=arguments.length,ke=new Array(Ce),$n=0;$n0?Math.floor(new Date().getTime()/q.interval):0}isFocused(){var Ce;return this.editorElement===((Ce=this.editorElement.ownerDocument)===null||Ce===void 0?void 0:Ce.activeElement)}isFocusedInvisibly(){return this.isFocused()&&!this.getLocationRange()}get actions(){return this.constructor.actions}}Re(Rn,"actions",{undo:{test(){return this.editor.canUndo()},perform(){return this.editor.undo()}},redo:{test(){return this.editor.canRedo()},perform(){return this.editor.redo()}},link:{test(){return this.editor.canActivateAttribute("href")}},increaseNestingLevel:{test(){return this.editor.canIncreaseNestingLevel()},perform(){return this.editor.increaseNestingLevel()&&this.render()}},decreaseNestingLevel:{test(){return this.editor.canDecreaseNestingLevel()},perform(){return this.editor.decreaseNestingLevel()&&this.render()}},attachFiles:{test:()=>!0,perform(){return M.pickFiles(this.editor.insertFiles)}}}),Rn.proxyMethod("getSelectionManager().setLocationRange"),Rn.proxyMethod("getSelectionManager().getLocationRange");var En=Object.freeze({__proto__:null,AttachmentEditorController:Ii,CompositionController:Ni,Controller:Oi,EditorController:Rn,InputController:Ki,Level0InputController:Qi,Level2InputController:on,ToolbarController:kn}),Sn=Object.freeze({__proto__:null,MutationObserver:Ui,SelectionChangeObserver:Ft}),Ln=Object.freeze({__proto__:null,FileVerificationOperation:Vi,ImagePreloadOperation:Le});bt("trix-toolbar",`%t { + display: block; +} + +%t { + white-space: nowrap; +} + +%t [data-trix-dialog] { + display: none; +} + +%t [data-trix-dialog][data-trix-active] { + display: block; +} + +%t [data-trix-dialog] [data-trix-validate]:invalid { + background-color: #ffdddd; +}`);class Dn extends HTMLElement{connectedCallback(){this.innerHTML===""&&(this.innerHTML=U.getDefaultHTML())}}let wn=0;const Tn=function(_n){if(!_n.hasAttribute("contenteditable"))return _n.setAttribute("contenteditable",""),function(Ce){let ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ke.times=1,f(Ce,ke)}("focus",{onElement:_n,withCallback:()=>Bn(_n)})},Bn=function(_n){return Fn(_n),Pn()},Fn=function(_n){var Ce,ke;if((Ce=(ke=document).queryCommandSupported)!==null&&Ce!==void 0&&Ce.call(ke,"enableObjectResizing"))return document.execCommand("enableObjectResizing",!1,!1),f("mscontrolselect",{onElement:_n,preventDefault:!0})},Pn=function(_n){var Ce,ke;if((Ce=(ke=document).queryCommandSupported)!==null&&Ce!==void 0&&Ce.call(ke,"DefaultParagraphSeparator")){const{tagName:$n}=n.default;if(["div","p"].includes($n))return document.execCommand("DefaultParagraphSeparator",!1,$n)}},In=a.forcesObjectResizing?{display:"inline",width:"auto"}:{display:"inline-block",width:"1px"};bt("trix-editor",`%t { + display: block; +} + +%t:empty::before { + content: attr(placeholder); + color: graytext; + cursor: text; + pointer-events: none; + white-space: pre-line; +} + +%t a[contenteditable=false] { + cursor: text; +} + +%t img { + max-width: 100%; + height: auto; +} + +%t `.concat(e,` figcaption textarea { + resize: none; +} + +%t `).concat(e,` figcaption textarea.trix-autoresize-clone { + position: absolute; + left: -9999px; + max-height: 0px; +} + +%t `).concat(e,` figcaption[data-trix-placeholder]:empty::before { + content: attr(data-trix-placeholder); + color: graytext; +} + +%t [data-trix-cursor-target] { + display: `).concat(In.display,` !important; + width: `).concat(In.width,` !important; + padding: 0 !important; + margin: 0 !important; + border: none !important; +} + +%t [data-trix-cursor-target=left] { + vertical-align: top !important; + margin-left: -1px !important; +} + +%t [data-trix-cursor-target=right] { + vertical-align: bottom !important; + margin-right: -1px !important; +}`));class Nn extends HTMLElement{get trixId(){return this.hasAttribute("trix-id")?this.getAttribute("trix-id"):(this.setAttribute("trix-id",++wn),this.trixId)}get labels(){const Ce=[];this.id&&this.ownerDocument&&Ce.push(...Array.from(this.ownerDocument.querySelectorAll("label[for='".concat(this.id,"']"))||[]));const ke=A(this,{matchingSelector:"label"});return ke&&[this,null].includes(ke.control)&&Ce.push(ke),Ce}get toolbarElement(){var Ce;if(this.hasAttribute("toolbar"))return(Ce=this.ownerDocument)===null||Ce===void 0?void 0:Ce.getElementById(this.getAttribute("toolbar"));if(this.parentNode){const ke="trix-toolbar-".concat(this.trixId);this.setAttribute("toolbar",ke);const $n=S$1("trix-toolbar",{id:ke});return this.parentNode.insertBefore($n,this),$n}}get form(){var Ce;return(Ce=this.inputElement)===null||Ce===void 0?void 0:Ce.form}get inputElement(){var Ce;if(this.hasAttribute("input"))return(Ce=this.ownerDocument)===null||Ce===void 0?void 0:Ce.getElementById(this.getAttribute("input"));if(this.parentNode){const ke="trix-input-".concat(this.trixId);this.setAttribute("input",ke);const $n=S$1("input",{type:"hidden",id:ke});return this.parentNode.insertBefore($n,this.nextElementSibling),$n}}get editor(){var Ce;return(Ce=this.editorController)===null||Ce===void 0?void 0:Ce.editor}get name(){var Ce;return(Ce=this.inputElement)===null||Ce===void 0?void 0:Ce.name}get value(){var Ce;return(Ce=this.inputElement)===null||Ce===void 0?void 0:Ce.value}set value(Ce){var ke;this.defaultValue=Ce,(ke=this.editor)===null||ke===void 0||ke.loadHTML(this.defaultValue)}notify(Ce,ke){if(this.editorController)return b("trix-".concat(Ce),{onElement:this,attributes:ke})}setInputElementValue(Ce){this.inputElement&&(this.inputElement.value=Ce)}connectedCallback(){this.hasAttribute("data-trix-internal")||(Tn(this),function(Ce){Ce.hasAttribute("role")||Ce.setAttribute("role","textbox")}(this),function(Ce){if(Ce.hasAttribute("aria-label")||Ce.hasAttribute("aria-labelledby"))return;const ke=function(){const $n=Array.from(Ce.labels).map(zn=>{if(!zn.contains(Ce))return zn.textContent}).filter(zn=>zn),Hn=$n.join(" ");return Hn?Ce.setAttribute("aria-label",Hn):Ce.removeAttribute("aria-label")};ke(),f("focus",{onElement:Ce,withCallback:ke})}(this),this.editorController||(b("trix-before-initialize",{onElement:this}),this.editorController=new Rn({editorElement:this,html:this.defaultValue=this.value}),requestAnimationFrame(()=>b("trix-initialize",{onElement:this}))),this.editorController.registerSelectionManager(),this.registerResetListener(),this.registerClickListener(),function(Ce){!document.querySelector(":focus")&&Ce.hasAttribute("autofocus")&&document.querySelector("[autofocus]")===Ce&&Ce.focus()}(this))}disconnectedCallback(){var Ce;return(Ce=this.editorController)===null||Ce===void 0||Ce.unregisterSelectionManager(),this.unregisterResetListener(),this.unregisterClickListener()}registerResetListener(){return this.resetListener=this.resetBubbled.bind(this),window.addEventListener("reset",this.resetListener,!1)}unregisterResetListener(){return window.removeEventListener("reset",this.resetListener,!1)}registerClickListener(){return this.clickListener=this.clickBubbled.bind(this),window.addEventListener("click",this.clickListener,!1)}unregisterClickListener(){return window.removeEventListener("click",this.clickListener,!1)}resetBubbled(Ce){if(!Ce.defaultPrevented&&Ce.target===this.form)return this.reset()}clickBubbled(Ce){if(Ce.defaultPrevented||this.contains(Ce.target))return;const ke=A(Ce.target,{matchingSelector:"label"});return ke&&Array.from(this.labels).includes(ke)?this.focus():void 0}reset(){this.value=this.defaultValue}}const On={VERSION:t$1,config:V,core:ci,models:Di,views:wi,controllers:En,observers:Sn,operations:Ln,elements:Object.freeze({__proto__:null,TrixEditorElement:Nn,TrixToolbarElement:Dn}),filters:Object.freeze({__proto__:null,Filter:bi,attachmentGalleryFilter:vi})};Object.assign(On,Di),window.Trix=On,setTimeout(function(){customElements.get("trix-toolbar")||customElements.define("trix-toolbar",Dn),customElements.get("trix-editor")||customElements.define("trix-editor",Nn)},0);function create_fragment$k(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn;return{c(){Ce=element("div"),ke=element("input"),Hn=space$3(),zn=element("trix-editor"),attr(ke,"id",$n="x-"+_n[1].name),ke.value=_n[0],attr(ke,"type","hidden"),set_custom_element_data(zn,"class","content"),set_custom_element_data(zn,"input",Un="x-"+_n[1].name),set_custom_element_data(zn,"role","textbox"),set_custom_element_data(zn,"tabindex","0"),attr(Ce,"class","tox-wrapper")},m(Kn,to){insert$1(Kn,Ce,to),append(Ce,ke),append(Ce,Hn),append(Ce,zn),_n[5](zn),qn||(Xn=listen(zn,"trix-change",_n[3]),qn=!0)},p(Kn,[to]){to&2&&$n!==($n="x-"+Kn[1].name)&&attr(ke,"id",$n),to&1&&(ke.value=Kn[0]),to&2&&Un!==(Un="x-"+Kn[1].name)&&set_custom_element_data(zn,"input",Un)},i:noop,o:noop,d(Kn){Kn&&detach(Ce),_n[5](null),qn=!1,Xn()}}}function instance$k(_n,Ce,ke){let{value:$n=""}=Ce,{field:Hn}=Ce,zn;function Un(Kn){ke(0,$n=Kn.target.value)}function qn(Kn){if(Kn.record._file.width>0){var to=new On.Attachment({content:Kn.html});zn.editor.insertAttachment(to)}else zn.editor.insertHTML(`${Kn.record._file.originalName}`)}onMount(()=>{zn.addEventListener("trix-file-accept",Kn=>{Kn.preventDefault()}),zn.addEventListener("trix-before-initialize",Kn=>{On.config.blockAttributes.heading1.tagName="h2";const{toolbarElement:to}=Kn.target;to.querySelector("[data-trix-attribute=heading1]").insertAdjacentHTML("afterend",'')})}),On.config.blockAttributes.default.breakOnReturn=!1,On.config.blockAttributes.heading3={tagName:"h3",terminal:!0,breakOnReturn:!0,group:!1};function Xn(Kn){binding_callbacks[Kn?"unshift":"push"](()=>{zn=Kn,ke(2,zn)})}return _n.$$set=Kn=>{"value"in Kn&&ke(0,$n=Kn.value),"field"in Kn&&ke(1,Hn=Kn.field)},[$n,Hn,zn,Un,qn,Xn]}class Trix_1 extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$k,create_fragment$k,safe_not_equal,{value:0,field:1,insertMedia:4})}get insertMedia(){return this.$$.ctx[4]}}function create_if_block_1$9(_n){let Ce,ke,$n;function Hn(Un){_n[11](Un)}let zn={record:_n[3],field:_n[2],validationErrors:_n[4]};return _n[1]!==void 0&&(zn.graph=_n[1]),Ce=new RichEditorFiles({props:zn}),binding_callbacks.push(()=>bind(Ce,"graph",Hn)),Ce.$on("editor-insert",_n[7]),{c(){create_component(Ce.$$.fragment)},m(Un,qn){mount_component(Ce,Un,qn),$n=!0},p(Un,qn){const Xn={};qn&8&&(Xn.record=Un[3]),qn&4&&(Xn.field=Un[2]),qn&16&&(Xn.validationErrors=Un[4]),!ke&&qn&2&&(ke=!0,Xn.graph=Un[1],add_flush_callback(()=>ke=!1)),Ce.$set(Xn)},i(Un){$n||(transition_in(Ce.$$.fragment,Un),$n=!0)},o(Un){transition_out(Ce.$$.fragment,Un),$n=!1},d(Un){destroy_component(Ce,Un)}}}function create_if_block$d(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[6]),attr(Ce,"class","invalid-feedback d-block")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,Hn){Hn&64&&set_data(ke,$n[6])},d($n){$n&&detach(Ce)}}}function create_fragment$j(_n){let Ce,ke,$n,Hn,zn,Un;function qn(io){_n[10](io)}let Xn={field:_n[2]};_n[0]!==void 0&&(Xn.value=_n[0]),ke=new Trix_1({props:Xn}),_n[9](ke),binding_callbacks.push(()=>bind(ke,"value",qn));let Kn=_n[2].collections.length>0&&create_if_block_1$9(_n),to=_n[6]&&create_if_block$d(_n);return{c(){Ce=element("div"),create_component(ke.$$.fragment),Hn=space$3(),Kn&&Kn.c(),zn=space$3(),to&&to.c(),attr(Ce,"class","mb-0")},m(io,uo){insert$1(io,Ce,uo),mount_component(ke,Ce,null),append(Ce,Hn),Kn&&Kn.m(Ce,null),append(Ce,zn),to&&to.m(Ce,null),Un=!0},p(io,[uo]){const ho={};uo&4&&(ho.field=io[2]),!$n&&uo&1&&($n=!0,ho.value=io[0],add_flush_callback(()=>$n=!1)),ke.$set(ho),io[2].collections.length>0?Kn?(Kn.p(io,uo),uo&4&&transition_in(Kn,1)):(Kn=create_if_block_1$9(io),Kn.c(),transition_in(Kn,1),Kn.m(Ce,zn)):Kn&&(group_outros(),transition_out(Kn,1,1,()=>{Kn=null}),check_outros()),io[6]?to?to.p(io,uo):(to=create_if_block$d(io),to.c(),to.m(Ce,null)):to&&(to.d(1),to=null)},i(io){Un||(transition_in(ke.$$.fragment,io),transition_in(Kn),Un=!0)},o(io){transition_out(ke.$$.fragment,io),transition_out(Kn),Un=!1},d(io){io&&detach(Ce),_n[9](null),destroy_component(ke),Kn&&Kn.d(),to&&to.d()}}}function instance$j(_n,Ce,ke){let $n,{value:Hn}=Ce,{field:zn}=Ce,{isCreateMode:Un}=Ce,{graph:qn}=Ce,{record:Xn}=Ce,{validationErrors:Kn}=Ce,to;zn.readonly;function io(Oo){to.insertMedia(Oo.detail)}function uo(Oo){binding_callbacks[Oo?"unshift":"push"](()=>{to=Oo,ke(5,to)})}function ho(Oo){Hn=Oo,ke(0,Hn)}function bo(Oo){qn=Oo,ke(1,qn)}return _n.$$set=Oo=>{"value"in Oo&&ke(0,Hn=Oo.value),"field"in Oo&&ke(2,zn=Oo.field),"isCreateMode"in Oo&&ke(8,Un=Oo.isCreateMode),"graph"in Oo&&ke(1,qn=Oo.graph),"record"in Oo&&ke(3,Xn=Oo.record),"validationErrors"in Oo&&ke(4,Kn=Oo.validationErrors)},_n.$$.update=()=>{_n.$$.dirty&20&&ke(6,$n=getErrorMessage(Kn,zn.name))},[Hn,qn,zn,Xn,Kn,to,$n,io,Un,uo,ho,bo]}class RichEditor extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$j,create_fragment$j,safe_not_equal,{value:0,field:2,isCreateMode:8,graph:1,record:3,validationErrors:4})}}class Text{lineAt(Ce){if(Ce<0||Ce>this.length)throw new RangeError(`Invalid position ${Ce} in document of length ${this.length}`);return this.lineInner(Ce,!1,1,0)}line(Ce){if(Ce<1||Ce>this.lines)throw new RangeError(`Invalid line number ${Ce} in ${this.lines}-line document`);return this.lineInner(Ce,!0,1,0)}replace(Ce,ke,$n){[Ce,ke]=clip(this,Ce,ke);let Hn=[];return this.decompose(0,Ce,Hn,2),$n.length&&$n.decompose(0,$n.length,Hn,3),this.decompose(ke,this.length,Hn,1),TextNode.from(Hn,this.length-(ke-Ce)+$n.length)}append(Ce){return this.replace(this.length,this.length,Ce)}slice(Ce,ke=this.length){[Ce,ke]=clip(this,Ce,ke);let $n=[];return this.decompose(Ce,ke,$n,0),TextNode.from($n,ke-Ce)}eq(Ce){if(Ce==this)return!0;if(Ce.length!=this.length||Ce.lines!=this.lines)return!1;let ke=this.scanIdentical(Ce,1),$n=this.length-this.scanIdentical(Ce,-1),Hn=new RawTextCursor(this),zn=new RawTextCursor(Ce);for(let Un=ke,qn=ke;;){if(Hn.next(Un),zn.next(Un),Un=0,Hn.lineBreak!=zn.lineBreak||Hn.done!=zn.done||Hn.value!=zn.value)return!1;if(qn+=Hn.value.length,Hn.done||qn>=$n)return!0}}iter(Ce=1){return new RawTextCursor(this,Ce)}iterRange(Ce,ke=this.length){return new PartialTextCursor(this,Ce,ke)}iterLines(Ce,ke){let $n;if(Ce==null)$n=this.iter();else{ke==null&&(ke=this.lines+1);let Hn=this.line(Ce).from;$n=this.iterRange(Hn,Math.max(Hn,ke==this.lines+1?this.length:ke<=1?0:this.line(ke-1).to))}return new LineCursor($n)}toString(){return this.sliceString(0)}toJSON(){let Ce=[];return this.flatten(Ce),Ce}constructor(){}static of(Ce){if(Ce.length==0)throw new RangeError("A document must have at least one line");return Ce.length==1&&!Ce[0]?Text.empty:Ce.length<=32?new TextLeaf(Ce):TextNode.from(TextLeaf.split(Ce,[]))}}class TextLeaf extends Text{constructor(Ce,ke=textLength(Ce)){super(),this.text=Ce,this.length=ke}get lines(){return this.text.length}get children(){return null}lineInner(Ce,ke,$n,Hn){for(let zn=0;;zn++){let Un=this.text[zn],qn=Hn+Un.length;if((ke?$n:qn)>=Ce)return new Line$1(Hn,qn,$n,Un);Hn=qn+1,$n++}}decompose(Ce,ke,$n,Hn){let zn=Ce<=0&&ke>=this.length?this:new TextLeaf(sliceText(this.text,Ce,ke),Math.min(ke,this.length)-Math.max(0,Ce));if(Hn&1){let Un=$n.pop(),qn=appendText(zn.text,Un.text.slice(),0,zn.length);if(qn.length<=32)$n.push(new TextLeaf(qn,Un.length+zn.length));else{let Xn=qn.length>>1;$n.push(new TextLeaf(qn.slice(0,Xn)),new TextLeaf(qn.slice(Xn)))}}else $n.push(zn)}replace(Ce,ke,$n){if(!($n instanceof TextLeaf))return super.replace(Ce,ke,$n);[Ce,ke]=clip(this,Ce,ke);let Hn=appendText(this.text,appendText($n.text,sliceText(this.text,0,Ce)),ke),zn=this.length+$n.length-(ke-Ce);return Hn.length<=32?new TextLeaf(Hn,zn):TextNode.from(TextLeaf.split(Hn,[]),zn)}sliceString(Ce,ke=this.length,$n=` +`){[Ce,ke]=clip(this,Ce,ke);let Hn="";for(let zn=0,Un=0;zn<=ke&&UnCe&&Un&&(Hn+=$n),Cezn&&(Hn+=qn.slice(Math.max(0,Ce-zn),ke-zn)),zn=Xn+1}return Hn}flatten(Ce){for(let ke of this.text)Ce.push(ke)}scanIdentical(){return 0}static split(Ce,ke){let $n=[],Hn=-1;for(let zn of Ce)$n.push(zn),Hn+=zn.length+1,$n.length==32&&(ke.push(new TextLeaf($n,Hn)),$n=[],Hn=-1);return Hn>-1&&ke.push(new TextLeaf($n,Hn)),ke}}class TextNode extends Text{constructor(Ce,ke){super(),this.children=Ce,this.length=ke,this.lines=0;for(let $n of Ce)this.lines+=$n.lines}lineInner(Ce,ke,$n,Hn){for(let zn=0;;zn++){let Un=this.children[zn],qn=Hn+Un.length,Xn=$n+Un.lines-1;if((ke?Xn:qn)>=Ce)return Un.lineInner(Ce,ke,$n,Hn);Hn=qn+1,$n=Xn+1}}decompose(Ce,ke,$n,Hn){for(let zn=0,Un=0;Un<=ke&&zn=Un){let Kn=Hn&((Un<=Ce?1:0)|(Xn>=ke?2:0));Un>=Ce&&Xn<=ke&&!Kn?$n.push(qn):qn.decompose(Ce-Un,ke-Un,$n,Kn)}Un=Xn+1}}replace(Ce,ke,$n){if([Ce,ke]=clip(this,Ce,ke),$n.lines=zn&&ke<=qn){let Xn=Un.replace(Ce-zn,ke-zn,$n),Kn=this.lines-Un.lines+Xn.lines;if(Xn.lines>4&&Xn.lines>Kn>>6){let to=this.children.slice();return to[Hn]=Xn,new TextNode(to,this.length-(ke-Ce)+$n.length)}return super.replace(zn,qn,Xn)}zn=qn+1}return super.replace(Ce,ke,$n)}sliceString(Ce,ke=this.length,$n=` +`){[Ce,ke]=clip(this,Ce,ke);let Hn="";for(let zn=0,Un=0;znCe&&zn&&(Hn+=$n),CeUn&&(Hn+=qn.sliceString(Ce-Un,ke-Un,$n)),Un=Xn+1}return Hn}flatten(Ce){for(let ke of this.children)ke.flatten(Ce)}scanIdentical(Ce,ke){if(!(Ce instanceof TextNode))return 0;let $n=0,[Hn,zn,Un,qn]=ke>0?[0,0,this.children.length,Ce.children.length]:[this.children.length-1,Ce.children.length-1,-1,-1];for(;;Hn+=ke,zn+=ke){if(Hn==Un||zn==qn)return $n;let Xn=this.children[Hn],Kn=Ce.children[zn];if(Xn!=Kn)return $n+Xn.scanIdentical(Kn,ke);$n+=Xn.length+1}}static from(Ce,ke=Ce.reduce(($n,Hn)=>$n+Hn.length+1,-1)){let $n=0;for(let ho of Ce)$n+=ho.lines;if($n<32){let ho=[];for(let bo of Ce)bo.flatten(ho);return new TextLeaf(ho,ke)}let Hn=Math.max(32,$n>>5),zn=Hn<<1,Un=Hn>>1,qn=[],Xn=0,Kn=-1,to=[];function io(ho){let bo;if(ho.lines>zn&&ho instanceof TextNode)for(let Oo of ho.children)io(Oo);else ho.lines>Un&&(Xn>Un||!Xn)?(uo(),qn.push(ho)):ho instanceof TextLeaf&&Xn&&(bo=to[to.length-1])instanceof TextLeaf&&ho.lines+bo.lines<=32?(Xn+=ho.lines,Kn+=ho.length+1,to[to.length-1]=new TextLeaf(bo.text.concat(ho.text),bo.length+1+ho.length)):(Xn+ho.lines>Hn&&uo(),Xn+=ho.lines,Kn+=ho.length+1,to.push(ho))}function uo(){Xn!=0&&(qn.push(to.length==1?to[0]:TextNode.from(to,Kn)),Kn=-1,Xn=to.length=0)}for(let ho of Ce)io(ho);return uo(),qn.length==1?qn[0]:new TextNode(qn,ke)}}Text.empty=new TextLeaf([""],0);function textLength(_n){let Ce=-1;for(let ke of _n)Ce+=ke.length+1;return Ce}function appendText(_n,Ce,ke=0,$n=1e9){for(let Hn=0,zn=0,Un=!0;zn<_n.length&&Hn<=$n;zn++){let qn=_n[zn],Xn=Hn+qn.length;Xn>=ke&&(Xn>$n&&(qn=qn.slice(0,$n-Hn)),Hn0?1:(Ce instanceof TextLeaf?Ce.text.length:Ce.children.length)<<1]}nextInner(Ce,ke){for(this.done=this.lineBreak=!1;;){let $n=this.nodes.length-1,Hn=this.nodes[$n],zn=this.offsets[$n],Un=zn>>1,qn=Hn instanceof TextLeaf?Hn.text.length:Hn.children.length;if(Un==(ke>0?qn:0)){if($n==0)return this.done=!0,this.value="",this;ke>0&&this.offsets[$n-1]++,this.nodes.pop(),this.offsets.pop()}else if((zn&1)==(ke>0?0:1)){if(this.offsets[$n]+=ke,Ce==0)return this.lineBreak=!0,this.value=` +`,this;Ce--}else if(Hn instanceof TextLeaf){let Xn=Hn.text[Un+(ke<0?-1:0)];if(this.offsets[$n]+=ke,Xn.length>Math.max(0,Ce))return this.value=Ce==0?Xn:ke>0?Xn.slice(Ce):Xn.slice(0,Xn.length-Ce),this;Ce-=Xn.length}else{let Xn=Hn.children[Un+(ke<0?-1:0)];Ce>Xn.length?(Ce-=Xn.length,this.offsets[$n]+=ke):(ke<0&&this.offsets[$n]--,this.nodes.push(Xn),this.offsets.push(ke>0?1:(Xn instanceof TextLeaf?Xn.text.length:Xn.children.length)<<1))}}}next(Ce=0){return Ce<0&&(this.nextInner(-Ce,-this.dir),Ce=this.value.length),this.nextInner(Ce,this.dir)}}class PartialTextCursor{constructor(Ce,ke,$n){this.value="",this.done=!1,this.cursor=new RawTextCursor(Ce,ke>$n?-1:1),this.pos=ke>$n?Ce.length:0,this.from=Math.min(ke,$n),this.to=Math.max(ke,$n)}nextInner(Ce,ke){if(ke<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;Ce+=Math.max(0,ke<0?this.pos-this.to:this.from-this.pos);let $n=ke<0?this.pos-this.from:this.to-this.pos;Ce>$n&&(Ce=$n),$n-=Ce;let{value:Hn}=this.cursor.next(Ce);return this.pos+=(Hn.length+Ce)*ke,this.value=Hn.length<=$n?Hn:ke<0?Hn.slice(Hn.length-$n):Hn.slice(0,$n),this.done=!this.value,this}next(Ce=0){return Ce<0?Ce=Math.max(Ce,this.from-this.pos):Ce>0&&(Ce=Math.min(Ce,this.to-this.pos)),this.nextInner(Ce,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class LineCursor{constructor(Ce){this.inner=Ce,this.afterBreak=!0,this.value="",this.done=!1}next(Ce=0){let{done:ke,lineBreak:$n,value:Hn}=this.inner.next(Ce);return ke&&this.afterBreak?(this.value="",this.afterBreak=!1):ke?(this.done=!0,this.value=""):$n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=Hn,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Text.prototype[Symbol.iterator]=function(){return this.iter()},RawTextCursor.prototype[Symbol.iterator]=PartialTextCursor.prototype[Symbol.iterator]=LineCursor.prototype[Symbol.iterator]=function(){return this});let Line$1=class{constructor(Ce,ke,$n,Hn){this.from=Ce,this.to=ke,this.number=$n,this.text=Hn}get length(){return this.to-this.from}};function clip(_n,Ce,ke){return Ce=Math.max(0,Math.min(_n.length,Ce)),[Ce,Math.max(Ce,Math.min(_n.length,ke))]}let extend="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(_n=>_n?parseInt(_n,36):1);for(let _n=1;_n_n)return extend[Ce-1]<=_n;return!1}function isRegionalIndicator(_n){return _n>=127462&&_n<=127487}const ZWJ=8205;function findClusterBreak(_n,Ce,ke=!0,$n=!0){return(ke?nextClusterBreak:prevClusterBreak)(_n,Ce,$n)}function nextClusterBreak(_n,Ce,ke){if(Ce==_n.length)return Ce;Ce&&surrogateLow(_n.charCodeAt(Ce))&&surrogateHigh(_n.charCodeAt(Ce-1))&&Ce--;let $n=codePointAt(_n,Ce);for(Ce+=codePointSize($n);Ce<_n.length;){let Hn=codePointAt(_n,Ce);if($n==ZWJ||Hn==ZWJ||ke&&isExtendingChar(Hn))Ce+=codePointSize(Hn),$n=Hn;else if(isRegionalIndicator(Hn)){let zn=0,Un=Ce-2;for(;Un>=0&&isRegionalIndicator(codePointAt(_n,Un));)zn++,Un-=2;if(zn%2==0)break;Ce+=2}else break}return Ce}function prevClusterBreak(_n,Ce,ke){for(;Ce>0;){let $n=nextClusterBreak(_n,Ce-2,ke);if($n=56320&&_n<57344}function surrogateHigh(_n){return _n>=55296&&_n<56320}function codePointAt(_n,Ce){let ke=_n.charCodeAt(Ce);if(!surrogateHigh(ke)||Ce+1==_n.length)return ke;let $n=_n.charCodeAt(Ce+1);return surrogateLow($n)?(ke-55296<<10)+($n-56320)+65536:ke}function fromCodePoint(_n){return _n<=65535?String.fromCharCode(_n):(_n-=65536,String.fromCharCode((_n>>10)+55296,(_n&1023)+56320))}function codePointSize(_n){return _n<65536?1:2}const DefaultSplit=/\r\n?|\n/;var MapMode=function(_n){return _n[_n.Simple=0]="Simple",_n[_n.TrackDel=1]="TrackDel",_n[_n.TrackBefore=2]="TrackBefore",_n[_n.TrackAfter=3]="TrackAfter",_n}(MapMode||(MapMode={}));class ChangeDesc{constructor(Ce){this.sections=Ce}get length(){let Ce=0;for(let ke=0;keCe)return zn+(Ce-Hn);zn+=qn}else{if($n!=MapMode.Simple&&Kn>=Ce&&($n==MapMode.TrackDel&&HnCe||$n==MapMode.TrackBefore&&HnCe))return null;if(Kn>Ce||Kn==Ce&&ke<0&&!qn)return Ce==Hn||ke<0?zn:zn+Xn;zn+=Xn}Hn=Kn}if(Ce>Hn)throw new RangeError(`Position ${Ce} is out of range for changeset of length ${Hn}`);return zn}touchesRange(Ce,ke=Ce){for(let $n=0,Hn=0;$n=0&&Hn<=ke&&qn>=Ce)return Hnke?"cover":!0;Hn=qn}return!1}toString(){let Ce="";for(let ke=0;ke=0?":"+Hn:"")}return Ce}toJSON(){return this.sections}static fromJSON(Ce){if(!Array.isArray(Ce)||Ce.length%2||Ce.some(ke=>typeof ke!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ChangeDesc(Ce)}static create(Ce){return new ChangeDesc(Ce)}}class ChangeSet extends ChangeDesc{constructor(Ce,ke){super(Ce),this.inserted=ke}apply(Ce){if(this.length!=Ce.length)throw new RangeError("Applying change set to a document with the wrong length");return iterChanges(this,(ke,$n,Hn,zn,Un)=>Ce=Ce.replace(Hn,Hn+($n-ke),Un),!1),Ce}mapDesc(Ce,ke=!1){return mapSet(this,Ce,ke,!0)}invert(Ce){let ke=this.sections.slice(),$n=[];for(let Hn=0,zn=0;Hn=0){ke[Hn]=qn,ke[Hn+1]=Un;let Xn=Hn>>1;for(;$n.length0&&addInsert($n,ke,zn.text),zn.forward(to),qn+=to}let Kn=Ce[Un++];for(;qn>1].toJSON()))}return Ce}static of(Ce,ke,$n){let Hn=[],zn=[],Un=0,qn=null;function Xn(to=!1){if(!to&&!Hn.length)return;Unuo||io<0||uo>ke)throw new RangeError(`Invalid change range ${io} to ${uo} (in doc of length ${ke})`);let bo=ho?typeof ho=="string"?Text.of(ho.split($n||DefaultSplit)):ho:Text.empty,Oo=bo.length;if(io==uo&&Oo==0)return;ioUn&&addSection(Hn,io-Un,-1),addSection(Hn,uo-io,Oo),addInsert(zn,Hn,bo),Un=uo}}return Kn(Ce),Xn(!qn),qn}static empty(Ce){return new ChangeSet(Ce?[Ce,-1]:[],[])}static fromJSON(Ce){if(!Array.isArray(Ce))throw new RangeError("Invalid JSON representation of ChangeSet");let ke=[],$n=[];for(let Hn=0;Hnqn&&typeof Un!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(zn.length==1)ke.push(zn[0],0);else{for(;$n.length=0&&ke<=0&&ke==_n[Hn+1]?_n[Hn]+=Ce:Ce==0&&_n[Hn]==0?_n[Hn+1]+=ke:$n?(_n[Hn]+=Ce,_n[Hn+1]+=ke):_n.push(Ce,ke)}function addInsert(_n,Ce,ke){if(ke.length==0)return;let $n=Ce.length-2>>1;if($n<_n.length)_n[_n.length-1]=_n[_n.length-1].append(ke);else{for(;_n.length<$n;)_n.push(Text.empty);_n.push(ke)}}function iterChanges(_n,Ce,ke){let $n=_n.inserted;for(let Hn=0,zn=0,Un=0;Un<_n.sections.length;){let qn=_n.sections[Un++],Xn=_n.sections[Un++];if(Xn<0)Hn+=qn,zn+=qn;else{let Kn=Hn,to=zn,io=Text.empty;for(;Kn+=qn,to+=Xn,Xn&&$n&&(io=io.append($n[Un-2>>1])),!(ke||Un==_n.sections.length||_n.sections[Un+1]<0);)qn=_n.sections[Un++],Xn=_n.sections[Un++];Ce(Hn,Kn,zn,to,io),Hn=Kn,zn=to}}}function mapSet(_n,Ce,ke,$n=!1){let Hn=[],zn=$n?[]:null,Un=new SectionIter(_n),qn=new SectionIter(Ce);for(let Xn=-1;;)if(Un.ins==-1&&qn.ins==-1){let Kn=Math.min(Un.len,qn.len);addSection(Hn,Kn,-1),Un.forward(Kn),qn.forward(Kn)}else if(qn.ins>=0&&(Un.ins<0||Xn==Un.i||Un.off==0&&(qn.len=0&&Xn=0){let Kn=0,to=Un.len;for(;to;)if(qn.ins==-1){let io=Math.min(to,qn.len);Kn+=io,to-=io,qn.forward(io)}else if(qn.ins==0&&qn.lenXn||Un.ins>=0&&Un.len>Xn)&&(qn||$n.length>Kn),zn.forward2(Xn),Un.forward(Xn)}}}}class SectionIter{constructor(Ce){this.set=Ce,this.i=0,this.next()}next(){let{sections:Ce}=this.set;this.i>1;return ke>=Ce.length?Text.empty:Ce[ke]}textBit(Ce){let{inserted:ke}=this.set,$n=this.i-2>>1;return $n>=ke.length&&!Ce?Text.empty:ke[$n].slice(this.off,Ce==null?void 0:this.off+Ce)}forward(Ce){Ce==this.len?this.next():(this.len-=Ce,this.off+=Ce)}forward2(Ce){this.ins==-1?this.forward(Ce):Ce==this.ins?this.next():(this.ins-=Ce,this.off+=Ce)}}class SelectionRange{constructor(Ce,ke,$n){this.from=Ce,this.to=ke,this.flags=$n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let Ce=this.flags&7;return Ce==7?null:Ce}get goalColumn(){let Ce=this.flags>>6;return Ce==16777215?void 0:Ce}map(Ce,ke=-1){let $n,Hn;return this.empty?$n=Hn=Ce.mapPos(this.from,ke):($n=Ce.mapPos(this.from,1),Hn=Ce.mapPos(this.to,-1)),$n==this.from&&Hn==this.to?this:new SelectionRange($n,Hn,this.flags)}extend(Ce,ke=Ce){if(Ce<=this.anchor&&ke>=this.anchor)return EditorSelection.range(Ce,ke);let $n=Math.abs(Ce-this.anchor)>Math.abs(ke-this.anchor)?Ce:ke;return EditorSelection.range(this.anchor,$n)}eq(Ce,ke=!1){return this.anchor==Ce.anchor&&this.head==Ce.head&&(!ke||!this.empty||this.assoc==Ce.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(Ce){if(!Ce||typeof Ce.anchor!="number"||typeof Ce.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return EditorSelection.range(Ce.anchor,Ce.head)}static create(Ce,ke,$n){return new SelectionRange(Ce,ke,$n)}}class EditorSelection{constructor(Ce,ke){this.ranges=Ce,this.mainIndex=ke}map(Ce,ke=-1){return Ce.empty?this:EditorSelection.create(this.ranges.map($n=>$n.map(Ce,ke)),this.mainIndex)}eq(Ce,ke=!1){if(this.ranges.length!=Ce.ranges.length||this.mainIndex!=Ce.mainIndex)return!1;for(let $n=0;$nCe.toJSON()),main:this.mainIndex}}static fromJSON(Ce){if(!Ce||!Array.isArray(Ce.ranges)||typeof Ce.main!="number"||Ce.main>=Ce.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new EditorSelection(Ce.ranges.map(ke=>SelectionRange.fromJSON(ke)),Ce.main)}static single(Ce,ke=Ce){return new EditorSelection([EditorSelection.range(Ce,ke)],0)}static create(Ce,ke=0){if(Ce.length==0)throw new RangeError("A selection needs at least one range");for(let $n=0,Hn=0;HnCe?8:0)|zn)}static normalized(Ce,ke=0){let $n=Ce[ke];Ce.sort((Hn,zn)=>Hn.from-zn.from),ke=Ce.indexOf($n);for(let Hn=1;Hnzn.head?EditorSelection.range(Xn,qn):EditorSelection.range(qn,Xn))}}return new EditorSelection(Ce,ke)}}function checkSelection(_n,Ce){for(let ke of _n.ranges)if(ke.to>Ce)throw new RangeError("Selection points outside of document")}let nextID=0;class Facet{constructor(Ce,ke,$n,Hn,zn){this.combine=Ce,this.compareInput=ke,this.compare=$n,this.isStatic=Hn,this.id=nextID++,this.default=Ce([]),this.extensions=typeof zn=="function"?zn(this):zn}get reader(){return this}static define(Ce={}){return new Facet(Ce.combine||(ke=>ke),Ce.compareInput||((ke,$n)=>ke===$n),Ce.compare||(Ce.combine?(ke,$n)=>ke===$n:sameArray$1),!!Ce.static,Ce.enables)}of(Ce){return new FacetProvider([],this,0,Ce)}compute(Ce,ke){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(Ce,this,1,ke)}computeN(Ce,ke){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(Ce,this,2,ke)}from(Ce,ke){return ke||(ke=$n=>$n),this.compute([Ce],$n=>ke($n.field(Ce)))}}function sameArray$1(_n,Ce){return _n==Ce||_n.length==Ce.length&&_n.every((ke,$n)=>ke===Ce[$n])}class FacetProvider{constructor(Ce,ke,$n,Hn){this.dependencies=Ce,this.facet=ke,this.type=$n,this.value=Hn,this.id=nextID++}dynamicSlot(Ce){var ke;let $n=this.value,Hn=this.facet.compareInput,zn=this.id,Un=Ce[zn]>>1,qn=this.type==2,Xn=!1,Kn=!1,to=[];for(let io of this.dependencies)io=="doc"?Xn=!0:io=="selection"?Kn=!0:((ke=Ce[io.id])!==null&&ke!==void 0?ke:1)&1||to.push(Ce[io.id]);return{create(io){return io.values[Un]=$n(io),1},update(io,uo){if(Xn&&uo.docChanged||Kn&&(uo.docChanged||uo.selection)||ensureAll(io,to)){let ho=$n(io);if(qn?!compareArray(ho,io.values[Un],Hn):!Hn(ho,io.values[Un]))return io.values[Un]=ho,1}return 0},reconfigure:(io,uo)=>{let ho,bo=uo.config.address[zn];if(bo!=null){let Oo=getAddr(uo,bo);if(this.dependencies.every(So=>So instanceof Facet?uo.facet(So)===io.facet(So):So instanceof StateField?uo.field(So,!1)==io.field(So,!1):!0)||(qn?compareArray(ho=$n(io),Oo,Hn):Hn(ho=$n(io),Oo)))return io.values[Un]=Oo,0}else ho=$n(io);return io.values[Un]=ho,1}}}}function compareArray(_n,Ce,ke){if(_n.length!=Ce.length)return!1;for(let $n=0;$n<_n.length;$n++)if(!ke(_n[$n],Ce[$n]))return!1;return!0}function ensureAll(_n,Ce){let ke=!1;for(let $n of Ce)ensureAddr(_n,$n)&1&&(ke=!0);return ke}function dynamicFacetSlot(_n,Ce,ke){let $n=ke.map(Xn=>_n[Xn.id]),Hn=ke.map(Xn=>Xn.type),zn=$n.filter(Xn=>!(Xn&1)),Un=_n[Ce.id]>>1;function qn(Xn){let Kn=[];for(let to=0;to<$n.length;to++){let io=getAddr(Xn,$n[to]);if(Hn[to]==2)for(let uo of io)Kn.push(uo);else Kn.push(io)}return Ce.combine(Kn)}return{create(Xn){for(let Kn of $n)ensureAddr(Xn,Kn);return Xn.values[Un]=qn(Xn),1},update(Xn,Kn){if(!ensureAll(Xn,zn))return 0;let to=qn(Xn);return Ce.compare(to,Xn.values[Un])?0:(Xn.values[Un]=to,1)},reconfigure(Xn,Kn){let to=ensureAll(Xn,$n),io=Kn.config.facets[Ce.id],uo=Kn.facet(Ce);if(io&&!to&&sameArray$1(ke,io))return Xn.values[Un]=uo,0;let ho=qn(Xn);return Ce.compare(ho,uo)?(Xn.values[Un]=uo,0):(Xn.values[Un]=ho,1)}}}const initField=Facet.define({static:!0});class StateField{constructor(Ce,ke,$n,Hn,zn){this.id=Ce,this.createF=ke,this.updateF=$n,this.compareF=Hn,this.spec=zn,this.provides=void 0}static define(Ce){let ke=new StateField(nextID++,Ce.create,Ce.update,Ce.compare||(($n,Hn)=>$n===Hn),Ce);return Ce.provide&&(ke.provides=Ce.provide(ke)),ke}create(Ce){let ke=Ce.facet(initField).find($n=>$n.field==this);return((ke==null?void 0:ke.create)||this.createF)(Ce)}slot(Ce){let ke=Ce[this.id]>>1;return{create:$n=>($n.values[ke]=this.create($n),1),update:($n,Hn)=>{let zn=$n.values[ke],Un=this.updateF(zn,Hn);return this.compareF(zn,Un)?0:($n.values[ke]=Un,1)},reconfigure:($n,Hn)=>Hn.config.address[this.id]!=null?($n.values[ke]=Hn.field(this),0):($n.values[ke]=this.create($n),1)}}init(Ce){return[this,initField.of({field:this,create:Ce})]}get extension(){return this}}const Prec_={lowest:4,low:3,default:2,high:1,highest:0};function prec(_n){return Ce=>new PrecExtension(Ce,_n)}const Prec={highest:prec(Prec_.highest),high:prec(Prec_.high),default:prec(Prec_.default),low:prec(Prec_.low),lowest:prec(Prec_.lowest)};class PrecExtension{constructor(Ce,ke){this.inner=Ce,this.prec=ke}}class Compartment{of(Ce){return new CompartmentInstance(this,Ce)}reconfigure(Ce){return Compartment.reconfigure.of({compartment:this,extension:Ce})}get(Ce){return Ce.config.compartments.get(this)}}class CompartmentInstance{constructor(Ce,ke){this.compartment=Ce,this.inner=ke}}class Configuration{constructor(Ce,ke,$n,Hn,zn,Un){for(this.base=Ce,this.compartments=ke,this.dynamicSlots=$n,this.address=Hn,this.staticValues=zn,this.facets=Un,this.statusTemplate=[];this.statusTemplate.length<$n.length;)this.statusTemplate.push(0)}staticFacet(Ce){let ke=this.address[Ce.id];return ke==null?Ce.default:this.staticValues[ke>>1]}static resolve(Ce,ke,$n){let Hn=[],zn=Object.create(null),Un=new Map;for(let uo of flatten(Ce,ke,Un))uo instanceof StateField?Hn.push(uo):(zn[uo.facet.id]||(zn[uo.facet.id]=[])).push(uo);let qn=Object.create(null),Xn=[],Kn=[];for(let uo of Hn)qn[uo.id]=Kn.length<<1,Kn.push(ho=>uo.slot(ho));let to=$n==null?void 0:$n.config.facets;for(let uo in zn){let ho=zn[uo],bo=ho[0].facet,Oo=to&&to[uo]||[];if(ho.every(So=>So.type==0))if(qn[bo.id]=Xn.length<<1|1,sameArray$1(Oo,ho))Xn.push($n.facet(bo));else{let So=bo.combine(ho.map($o=>$o.value));Xn.push($n&&bo.compare(So,$n.facet(bo))?$n.facet(bo):So)}else{for(let So of ho)So.type==0?(qn[So.id]=Xn.length<<1|1,Xn.push(So.value)):(qn[So.id]=Kn.length<<1,Kn.push($o=>So.dynamicSlot($o)));qn[bo.id]=Kn.length<<1,Kn.push(So=>dynamicFacetSlot(So,bo,ho))}}let io=Kn.map(uo=>uo(qn));return new Configuration(Ce,Un,io,qn,Xn,zn)}}function flatten(_n,Ce,ke){let $n=[[],[],[],[],[]],Hn=new Map;function zn(Un,qn){let Xn=Hn.get(Un);if(Xn!=null){if(Xn<=qn)return;let Kn=$n[Xn].indexOf(Un);Kn>-1&&$n[Xn].splice(Kn,1),Un instanceof CompartmentInstance&&ke.delete(Un.compartment)}if(Hn.set(Un,qn),Array.isArray(Un))for(let Kn of Un)zn(Kn,qn);else if(Un instanceof CompartmentInstance){if(ke.has(Un.compartment))throw new RangeError("Duplicate use of compartment in extensions");let Kn=Ce.get(Un.compartment)||Un.inner;ke.set(Un.compartment,Kn),zn(Kn,qn)}else if(Un instanceof PrecExtension)zn(Un.inner,Un.prec);else if(Un instanceof StateField)$n[qn].push(Un),Un.provides&&zn(Un.provides,qn);else if(Un instanceof FacetProvider)$n[qn].push(Un),Un.facet.extensions&&zn(Un.facet.extensions,Prec_.default);else{let Kn=Un.extension;if(!Kn)throw new Error(`Unrecognized extension value in extension set (${Un}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);zn(Kn,qn)}}return zn(_n,Prec_.default),$n.reduce((Un,qn)=>Un.concat(qn))}function ensureAddr(_n,Ce){if(Ce&1)return 2;let ke=Ce>>1,$n=_n.status[ke];if($n==4)throw new Error("Cyclic dependency between fields and/or facets");if($n&2)return $n;_n.status[ke]=4;let Hn=_n.computeSlot(_n,_n.config.dynamicSlots[ke]);return _n.status[ke]=2|Hn}function getAddr(_n,Ce){return Ce&1?_n.config.staticValues[Ce>>1]:_n.values[Ce>>1]}const languageData=Facet.define(),allowMultipleSelections=Facet.define({combine:_n=>_n.some(Ce=>Ce),static:!0}),lineSeparator=Facet.define({combine:_n=>_n.length?_n[0]:void 0,static:!0}),changeFilter=Facet.define(),transactionFilter=Facet.define(),transactionExtender=Facet.define(),readOnly=Facet.define({combine:_n=>_n.length?_n[0]:!1});class Annotation{constructor(Ce,ke){this.type=Ce,this.value=ke}static define(){return new AnnotationType}}class AnnotationType{of(Ce){return new Annotation(this,Ce)}}class StateEffectType{constructor(Ce){this.map=Ce}of(Ce){return new StateEffect(this,Ce)}}class StateEffect{constructor(Ce,ke){this.type=Ce,this.value=ke}map(Ce){let ke=this.type.map(this.value,Ce);return ke===void 0?void 0:ke==this.value?this:new StateEffect(this.type,ke)}is(Ce){return this.type==Ce}static define(Ce={}){return new StateEffectType(Ce.map||(ke=>ke))}static mapEffects(Ce,ke){if(!Ce.length)return Ce;let $n=[];for(let Hn of Ce){let zn=Hn.map(ke);zn&&$n.push(zn)}return $n}}StateEffect.reconfigure=StateEffect.define();StateEffect.appendConfig=StateEffect.define();class Transaction{constructor(Ce,ke,$n,Hn,zn,Un){this.startState=Ce,this.changes=ke,this.selection=$n,this.effects=Hn,this.annotations=zn,this.scrollIntoView=Un,this._doc=null,this._state=null,$n&&checkSelection($n,ke.newLength),zn.some(qn=>qn.type==Transaction.time)||(this.annotations=zn.concat(Transaction.time.of(Date.now())))}static create(Ce,ke,$n,Hn,zn,Un){return new Transaction(Ce,ke,$n,Hn,zn,Un)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(Ce){for(let ke of this.annotations)if(ke.type==Ce)return ke.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(Ce){let ke=this.annotation(Transaction.userEvent);return!!(ke&&(ke==Ce||ke.length>Ce.length&&ke.slice(0,Ce.length)==Ce&&ke[Ce.length]=="."))}}Transaction.time=Annotation.define();Transaction.userEvent=Annotation.define();Transaction.addToHistory=Annotation.define();Transaction.remote=Annotation.define();function joinRanges(_n,Ce){let ke=[];for(let $n=0,Hn=0;;){let zn,Un;if($n<_n.length&&(Hn==Ce.length||Ce[Hn]>=_n[$n]))zn=_n[$n++],Un=_n[$n++];else if(Hn=0;Hn--){let zn=$n[Hn](_n);zn instanceof Transaction?_n=zn:Array.isArray(zn)&&zn.length==1&&zn[0]instanceof Transaction?_n=zn[0]:_n=resolveTransaction(Ce,asArray$1(zn),!1)}return _n}function extendTransaction(_n){let Ce=_n.startState,ke=Ce.facet(transactionExtender),$n=_n;for(let Hn=ke.length-1;Hn>=0;Hn--){let zn=ke[Hn](_n);zn&&Object.keys(zn).length&&($n=mergeTransaction($n,resolveTransactionInner(Ce,zn,_n.changes.newLength),!0))}return $n==_n?_n:Transaction.create(Ce,_n.changes,_n.selection,$n.effects,$n.annotations,$n.scrollIntoView)}const none$3=[];function asArray$1(_n){return _n==null?none$3:Array.isArray(_n)?_n:[_n]}var CharCategory=function(_n){return _n[_n.Word=0]="Word",_n[_n.Space=1]="Space",_n[_n.Other=2]="Other",_n}(CharCategory||(CharCategory={}));const nonASCIISingleCaseWordChar=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let wordChar;try{wordChar=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function hasWordChar(_n){if(wordChar)return wordChar.test(_n);for(let Ce=0;Ce<_n.length;Ce++){let ke=_n[Ce];if(/\w/.test(ke)||ke>"€"&&(ke.toUpperCase()!=ke.toLowerCase()||nonASCIISingleCaseWordChar.test(ke)))return!0}return!1}function makeCategorizer(_n){return Ce=>{if(!/\S/.test(Ce))return CharCategory.Space;if(hasWordChar(Ce))return CharCategory.Word;for(let ke=0;ke<_n.length;ke++)if(Ce.indexOf(_n[ke])>-1)return CharCategory.Word;return CharCategory.Other}}class EditorState{constructor(Ce,ke,$n,Hn,zn,Un){this.config=Ce,this.doc=ke,this.selection=$n,this.values=Hn,this.status=Ce.statusTemplate.slice(),this.computeSlot=zn,Un&&(Un._state=this);for(let qn=0;qnHn.set(Kn,Xn)),ke=null),Hn.set(qn.value.compartment,qn.value.extension)):qn.is(StateEffect.reconfigure)?(ke=null,$n=qn.value):qn.is(StateEffect.appendConfig)&&(ke=null,$n=asArray$1($n).concat(qn.value));let zn;ke?zn=Ce.startState.values.slice():(ke=Configuration.resolve($n,Hn,this),zn=new EditorState(ke,this.doc,this.selection,ke.dynamicSlots.map(()=>null),(Xn,Kn)=>Kn.reconfigure(Xn,this),null).values);let Un=Ce.startState.facet(allowMultipleSelections)?Ce.newSelection:Ce.newSelection.asSingle();new EditorState(ke,Ce.newDoc,Un,zn,(qn,Xn)=>Xn.update(qn,Ce),Ce)}replaceSelection(Ce){return typeof Ce=="string"&&(Ce=this.toText(Ce)),this.changeByRange(ke=>({changes:{from:ke.from,to:ke.to,insert:Ce},range:EditorSelection.cursor(ke.from+Ce.length)}))}changeByRange(Ce){let ke=this.selection,$n=Ce(ke.ranges[0]),Hn=this.changes($n.changes),zn=[$n.range],Un=asArray$1($n.effects);for(let qn=1;qnUn.spec.fromJSON(qn,Xn)))}}return EditorState.create({doc:Ce.doc,selection:EditorSelection.fromJSON(Ce.selection),extensions:ke.extensions?Hn.concat([ke.extensions]):Hn})}static create(Ce={}){let ke=Configuration.resolve(Ce.extensions||[],new Map),$n=Ce.doc instanceof Text?Ce.doc:Text.of((Ce.doc||"").split(ke.staticFacet(EditorState.lineSeparator)||DefaultSplit)),Hn=Ce.selection?Ce.selection instanceof EditorSelection?Ce.selection:EditorSelection.single(Ce.selection.anchor,Ce.selection.head):EditorSelection.single(0);return checkSelection(Hn,$n.length),ke.staticFacet(allowMultipleSelections)||(Hn=Hn.asSingle()),new EditorState(ke,$n,Hn,ke.dynamicSlots.map(()=>null),(zn,Un)=>Un.create(zn),null)}get tabSize(){return this.facet(EditorState.tabSize)}get lineBreak(){return this.facet(EditorState.lineSeparator)||` +`}get readOnly(){return this.facet(readOnly)}phrase(Ce,...ke){for(let $n of this.facet(EditorState.phrases))if(Object.prototype.hasOwnProperty.call($n,Ce)){Ce=$n[Ce];break}return ke.length&&(Ce=Ce.replace(/\$(\$|\d*)/g,($n,Hn)=>{if(Hn=="$")return"$";let zn=+(Hn||1);return!zn||zn>ke.length?$n:ke[zn-1]})),Ce}languageDataAt(Ce,ke,$n=-1){let Hn=[];for(let zn of this.facet(languageData))for(let Un of zn(this,ke,$n))Object.prototype.hasOwnProperty.call(Un,Ce)&&Hn.push(Un[Ce]);return Hn}charCategorizer(Ce){return makeCategorizer(this.languageDataAt("wordChars",Ce).join(""))}wordAt(Ce){let{text:ke,from:$n,length:Hn}=this.doc.lineAt(Ce),zn=this.charCategorizer(Ce),Un=Ce-$n,qn=Ce-$n;for(;Un>0;){let Xn=findClusterBreak(ke,Un,!1);if(zn(ke.slice(Xn,Un))!=CharCategory.Word)break;Un=Xn}for(;qn_n.length?_n[0]:4});EditorState.lineSeparator=lineSeparator;EditorState.readOnly=readOnly;EditorState.phrases=Facet.define({compare(_n,Ce){let ke=Object.keys(_n),$n=Object.keys(Ce);return ke.length==$n.length&&ke.every(Hn=>_n[Hn]==Ce[Hn])}});EditorState.languageData=languageData;EditorState.changeFilter=changeFilter;EditorState.transactionFilter=transactionFilter;EditorState.transactionExtender=transactionExtender;Compartment.reconfigure=StateEffect.define();function combineConfig(_n,Ce,ke={}){let $n={};for(let Hn of _n)for(let zn of Object.keys(Hn)){let Un=Hn[zn],qn=$n[zn];if(qn===void 0)$n[zn]=Un;else if(!(qn===Un||Un===void 0))if(Object.hasOwnProperty.call(ke,zn))$n[zn]=ke[zn](qn,Un);else throw new Error("Config merge conflict for field "+zn)}for(let Hn in Ce)$n[Hn]===void 0&&($n[Hn]=Ce[Hn]);return $n}class RangeValue{eq(Ce){return this==Ce}range(Ce,ke=Ce){return Range$2.create(Ce,ke,this)}}RangeValue.prototype.startSide=RangeValue.prototype.endSide=0;RangeValue.prototype.point=!1;RangeValue.prototype.mapMode=MapMode.TrackDel;let Range$2=class rK{constructor(Ce,ke,$n){this.from=Ce,this.to=ke,this.value=$n}static create(Ce,ke,$n){return new rK(Ce,ke,$n)}};function cmpRange(_n,Ce){return _n.from-Ce.from||_n.value.startSide-Ce.value.startSide}class Chunk{constructor(Ce,ke,$n,Hn){this.from=Ce,this.to=ke,this.value=$n,this.maxPoint=Hn}get length(){return this.to[this.to.length-1]}findIndex(Ce,ke,$n,Hn=0){let zn=$n?this.to:this.from;for(let Un=Hn,qn=zn.length;;){if(Un==qn)return Un;let Xn=Un+qn>>1,Kn=zn[Xn]-Ce||($n?this.value[Xn].endSide:this.value[Xn].startSide)-ke;if(Xn==Un)return Kn>=0?Un:qn;Kn>=0?qn=Xn:Un=Xn+1}}between(Ce,ke,$n,Hn){for(let zn=this.findIndex(ke,-1e9,!0),Un=this.findIndex($n,1e9,!1,zn);znho||uo==ho&&Kn.startSide>0&&Kn.endSide<=0)continue;(ho-uo||Kn.endSide-Kn.startSide)<0||(Un<0&&(Un=uo),Kn.point&&(qn=Math.max(qn,ho-uo)),$n.push(Kn),Hn.push(uo-Un),zn.push(ho-Un))}return{mapped:$n.length?new Chunk(Hn,zn,$n,qn):null,pos:Un}}}class RangeSet{constructor(Ce,ke,$n,Hn){this.chunkPos=Ce,this.chunk=ke,this.nextLayer=$n,this.maxPoint=Hn}static create(Ce,ke,$n,Hn){return new RangeSet(Ce,ke,$n,Hn)}get length(){let Ce=this.chunk.length-1;return Ce<0?0:Math.max(this.chunkEnd(Ce),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let Ce=this.nextLayer.size;for(let ke of this.chunk)Ce+=ke.value.length;return Ce}chunkEnd(Ce){return this.chunkPos[Ce]+this.chunk[Ce].length}update(Ce){let{add:ke=[],sort:$n=!1,filterFrom:Hn=0,filterTo:zn=this.length}=Ce,Un=Ce.filter;if(ke.length==0&&!Un)return this;if($n&&(ke=ke.slice().sort(cmpRange)),this.isEmpty)return ke.length?RangeSet.of(ke):this;let qn=new LayerCursor(this,null,-1).goto(0),Xn=0,Kn=[],to=new RangeSetBuilder;for(;qn.value||Xn=0){let io=ke[Xn++];to.addInner(io.from,io.to,io.value)||Kn.push(io)}else qn.rangeIndex==1&&qn.chunkIndexthis.chunkEnd(qn.chunkIndex)||znqn.to||zn=zn&&Ce<=zn+Un.length&&Un.between(zn,Ce-zn,ke-zn,$n)===!1)return}this.nextLayer.between(Ce,ke,$n)}}iter(Ce=0){return HeapCursor.from([this]).goto(Ce)}get isEmpty(){return this.nextLayer==this}static iter(Ce,ke=0){return HeapCursor.from(Ce).goto(ke)}static compare(Ce,ke,$n,Hn,zn=-1){let Un=Ce.filter(io=>io.maxPoint>0||!io.isEmpty&&io.maxPoint>=zn),qn=ke.filter(io=>io.maxPoint>0||!io.isEmpty&&io.maxPoint>=zn),Xn=findSharedChunks(Un,qn,$n),Kn=new SpanCursor(Un,Xn,zn),to=new SpanCursor(qn,Xn,zn);$n.iterGaps((io,uo,ho)=>compare(Kn,io,to,uo,ho,Hn)),$n.empty&&$n.length==0&&compare(Kn,0,to,0,0,Hn)}static eq(Ce,ke,$n=0,Hn){Hn==null&&(Hn=999999999);let zn=Ce.filter(to=>!to.isEmpty&&ke.indexOf(to)<0),Un=ke.filter(to=>!to.isEmpty&&Ce.indexOf(to)<0);if(zn.length!=Un.length)return!1;if(!zn.length)return!0;let qn=findSharedChunks(zn,Un),Xn=new SpanCursor(zn,qn,0).goto($n),Kn=new SpanCursor(Un,qn,0).goto($n);for(;;){if(Xn.to!=Kn.to||!sameValues(Xn.active,Kn.active)||Xn.point&&(!Kn.point||!Xn.point.eq(Kn.point)))return!1;if(Xn.to>Hn)return!0;Xn.next(),Kn.next()}}static spans(Ce,ke,$n,Hn,zn=-1){let Un=new SpanCursor(Ce,null,zn).goto(ke),qn=ke,Xn=Un.openStart;for(;;){let Kn=Math.min(Un.to,$n);if(Un.point){let to=Un.activeForPoint(Un.to),io=Un.pointFromqn&&(Hn.span(qn,Kn,Un.active,Xn),Xn=Un.openEnd(Kn));if(Un.to>$n)return Xn+(Un.point&&Un.to>$n?1:0);qn=Un.to,Un.next()}}static of(Ce,ke=!1){let $n=new RangeSetBuilder;for(let Hn of Ce instanceof Range$2?[Ce]:ke?lazySort(Ce):Ce)$n.add(Hn.from,Hn.to,Hn.value);return $n.finish()}static join(Ce){if(!Ce.length)return RangeSet.empty;let ke=Ce[Ce.length-1];for(let $n=Ce.length-2;$n>=0;$n--)for(let Hn=Ce[$n];Hn!=RangeSet.empty;Hn=Hn.nextLayer)ke=new RangeSet(Hn.chunkPos,Hn.chunk,ke,Math.max(Hn.maxPoint,ke.maxPoint));return ke}}RangeSet.empty=new RangeSet([],[],null,-1);function lazySort(_n){if(_n.length>1)for(let Ce=_n[0],ke=1;ke<_n.length;ke++){let $n=_n[ke];if(cmpRange(Ce,$n)>0)return _n.slice().sort(cmpRange);Ce=$n}return _n}RangeSet.empty.nextLayer=RangeSet.empty;class RangeSetBuilder{finishChunk(Ce){this.chunks.push(new Chunk(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,Ce&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(Ce,ke,$n){this.addInner(Ce,ke,$n)||(this.nextLayer||(this.nextLayer=new RangeSetBuilder)).add(Ce,ke,$n)}addInner(Ce,ke,$n){let Hn=Ce-this.lastTo||$n.startSide-this.last.endSide;if(Hn<=0&&(Ce-this.lastFrom||$n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return Hn<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=Ce),this.from.push(Ce-this.chunkStart),this.to.push(ke-this.chunkStart),this.last=$n,this.lastFrom=Ce,this.lastTo=ke,this.value.push($n),$n.point&&(this.maxPoint=Math.max(this.maxPoint,ke-Ce)),!0)}addChunk(Ce,ke){if((Ce-this.lastTo||ke.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,ke.maxPoint),this.chunks.push(ke),this.chunkPos.push(Ce);let $n=ke.value.length-1;return this.last=ke.value[$n],this.lastFrom=ke.from[$n]+Ce,this.lastTo=ke.to[$n]+Ce,!0}finish(){return this.finishInner(RangeSet.empty)}finishInner(Ce){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return Ce;let ke=RangeSet.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(Ce):Ce,this.setMaxPoint);return this.from=null,ke}}function findSharedChunks(_n,Ce,ke){let $n=new Map;for(let zn of _n)for(let Un=0;Un=this.minPoint)break}}setRangeIndex(Ce){if(Ce==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=$n&&Hn.push(new LayerCursor(Un,ke,$n,zn));return Hn.length==1?Hn[0]:new HeapCursor(Hn)}get startSide(){return this.value?this.value.startSide:0}goto(Ce,ke=-1e9){for(let $n of this.heap)$n.goto(Ce,ke);for(let $n=this.heap.length>>1;$n>=0;$n--)heapBubble(this.heap,$n);return this.next(),this}forward(Ce,ke){for(let $n of this.heap)$n.forward(Ce,ke);for(let $n=this.heap.length>>1;$n>=0;$n--)heapBubble(this.heap,$n);(this.to-Ce||this.value.endSide-ke)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let Ce=this.heap[0];this.from=Ce.from,this.to=Ce.to,this.value=Ce.value,this.rank=Ce.rank,Ce.value&&Ce.next(),heapBubble(this.heap,0)}}}function heapBubble(_n,Ce){for(let ke=_n[Ce];;){let $n=(Ce<<1)+1;if($n>=_n.length)break;let Hn=_n[$n];if($n+1<_n.length&&Hn.compare(_n[$n+1])>=0&&(Hn=_n[$n+1],$n++),ke.compare(Hn)<0)break;_n[$n]=ke,_n[Ce]=Hn,Ce=$n}}class SpanCursor{constructor(Ce,ke,$n){this.minPoint=$n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=HeapCursor.from(Ce,ke,$n)}goto(Ce,ke=-1e9){return this.cursor.goto(Ce,ke),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=Ce,this.endSide=ke,this.openStart=-1,this.next(),this}forward(Ce,ke){for(;this.minActive>-1&&(this.activeTo[this.minActive]-Ce||this.active[this.minActive].endSide-ke)<0;)this.removeActive(this.minActive);this.cursor.forward(Ce,ke)}removeActive(Ce){remove(this.active,Ce),remove(this.activeTo,Ce),remove(this.activeRank,Ce),this.minActive=findMinIndex(this.active,this.activeTo)}addActive(Ce){let ke=0,{value:$n,to:Hn,rank:zn}=this.cursor;for(;ke0;)ke++;insert(this.active,ke,$n),insert(this.activeTo,ke,Hn),insert(this.activeRank,ke,zn),Ce&&insert(Ce,ke,this.cursor.from),this.minActive=findMinIndex(this.active,this.activeTo)}next(){let Ce=this.to,ke=this.point;this.point=null;let $n=this.openStart<0?[]:null;for(;;){let Hn=this.minActive;if(Hn>-1&&(this.activeTo[Hn]-this.cursor.from||this.active[Hn].endSide-this.cursor.startSide)<0){if(this.activeTo[Hn]>Ce){this.to=this.activeTo[Hn],this.endSide=this.active[Hn].endSide;break}this.removeActive(Hn),$n&&remove($n,Hn)}else if(this.cursor.value)if(this.cursor.from>Ce){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let zn=this.cursor.value;if(!zn.point)this.addActive($n),this.cursor.next();else if(ke&&this.cursor.to==this.to&&this.cursor.from=0&&$n[Hn]=0&&!(this.activeRank[$n]Ce||this.activeTo[$n]==Ce&&this.active[$n].endSide>=this.point.endSide)&&ke.push(this.active[$n]);return ke.reverse()}openEnd(Ce){let ke=0;for(let $n=this.activeTo.length-1;$n>=0&&this.activeTo[$n]>Ce;$n--)ke++;return ke}}function compare(_n,Ce,ke,$n,Hn,zn){_n.goto(Ce),ke.goto($n);let Un=$n+Hn,qn=$n,Xn=$n-Ce;for(;;){let Kn=_n.to+Xn-ke.to||_n.endSide-ke.endSide,to=Kn<0?_n.to+Xn:ke.to,io=Math.min(to,Un);if(_n.point||ke.point?_n.point&&ke.point&&(_n.point==ke.point||_n.point.eq(ke.point))&&sameValues(_n.activeForPoint(_n.to),ke.activeForPoint(ke.to))||zn.comparePoint(qn,io,_n.point,ke.point):io>qn&&!sameValues(_n.active,ke.active)&&zn.compareRange(qn,io,_n.active,ke.active),to>Un)break;qn=to,Kn<=0&&_n.next(),Kn>=0&&ke.next()}}function sameValues(_n,Ce){if(_n.length!=Ce.length)return!1;for(let ke=0;ke<_n.length;ke++)if(_n[ke]!=Ce[ke]&&!_n[ke].eq(Ce[ke]))return!1;return!0}function remove(_n,Ce){for(let ke=Ce,$n=_n.length-1;ke<$n;ke++)_n[ke]=_n[ke+1];_n.pop()}function insert(_n,Ce,ke){for(let $n=_n.length-1;$n>=Ce;$n--)_n[$n+1]=_n[$n];_n[Ce]=ke}function findMinIndex(_n,Ce){let ke=-1,$n=1e9;for(let Hn=0;Hn=Ce)return Hn;if(Hn==_n.length)break;zn+=_n.charCodeAt(Hn)==9?ke-zn%ke:1,Hn=findClusterBreak(_n,Hn)}return $n===!0?-1:_n.length}const C="ͼ",COUNT=typeof Symbol>"u"?"__"+C:Symbol.for(C),SET=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),top=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class StyleModule{constructor(Ce,ke){this.rules=[];let{finish:$n}=ke||{};function Hn(Un){return/^@/.test(Un)?[Un]:Un.split(/,\s*/)}function zn(Un,qn,Xn,Kn){let to=[],io=/^@(\w+)\b/.exec(Un[0]),uo=io&&io[1]=="keyframes";if(io&&qn==null)return Xn.push(Un[0]+";");for(let ho in qn){let bo=qn[ho];if(/&/.test(ho))zn(ho.split(/,\s*/).map(Oo=>Un.map(So=>Oo.replace(/&/,So))).reduce((Oo,So)=>Oo.concat(So)),bo,Xn);else if(bo&&typeof bo=="object"){if(!io)throw new RangeError("The value of a property ("+ho+") should be a primitive value.");zn(Hn(ho),bo,to,uo)}else bo!=null&&to.push(ho.replace(/_.*/,"").replace(/[A-Z]/g,Oo=>"-"+Oo.toLowerCase())+": "+bo+";")}(to.length||uo)&&Xn.push(($n&&!io&&!Kn?Un.map($n):Un).join(", ")+" {"+to.join(" ")+"}")}for(let Un in Ce)zn(Hn(Un),Ce[Un],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let Ce=top[COUNT]||1;return top[COUNT]=Ce+1,C+Ce.toString(36)}static mount(Ce,ke,$n){let Hn=Ce[SET],zn=$n&&$n.nonce;Hn?zn&&Hn.setNonce(zn):Hn=new StyleSet(Ce,zn),Hn.mount(Array.isArray(ke)?ke:[ke],Ce)}}let adoptedSet=new Map;class StyleSet{constructor(Ce,ke){let $n=Ce.ownerDocument||Ce,Hn=$n.defaultView;if(!Ce.head&&Ce.adoptedStyleSheets&&Hn.CSSStyleSheet){let zn=adoptedSet.get($n);if(zn)return Ce[SET]=zn;this.sheet=new Hn.CSSStyleSheet,adoptedSet.set($n,this)}else this.styleTag=$n.createElement("style"),ke&&this.styleTag.setAttribute("nonce",ke);this.modules=[],Ce[SET]=this}mount(Ce,ke){let $n=this.sheet,Hn=0,zn=0;for(let Un=0;Un-1&&(this.modules.splice(Xn,1),zn--,Xn=-1),Xn==-1){if(this.modules.splice(zn++,0,qn),$n)for(let Kn=0;Kn",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},mac=typeof navigator<"u"&&/Mac/.test(navigator.platform),ie$1=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var i=0;i<10;i++)base[48+i]=base[96+i]=String(i);for(var i=1;i<=24;i++)base[i+111]="F"+i;for(var i=65;i<=90;i++)base[i]=String.fromCharCode(i+32),shift[i]=String.fromCharCode(i);for(var code in base)shift.hasOwnProperty(code)||(shift[code]=base[code]);function keyName(_n){var Ce=mac&&_n.metaKey&&_n.shiftKey&&!_n.ctrlKey&&!_n.altKey||ie$1&&_n.shiftKey&&_n.key&&_n.key.length==1||_n.key=="Unidentified",ke=!Ce&&_n.key||(_n.shiftKey?shift:base)[_n.keyCode]||_n.key||"Unidentified";return ke=="Esc"&&(ke="Escape"),ke=="Del"&&(ke="Delete"),ke=="Left"&&(ke="ArrowLeft"),ke=="Up"&&(ke="ArrowUp"),ke=="Right"&&(ke="ArrowRight"),ke=="Down"&&(ke="ArrowDown"),ke}function getSelection(_n){let Ce;return _n.nodeType==11?Ce=_n.getSelection?_n:_n.ownerDocument:Ce=_n,Ce.getSelection()}function contains(_n,Ce){return Ce?_n==Ce||_n.contains(Ce.nodeType!=1?Ce.parentNode:Ce):!1}function deepActiveElement(_n){let Ce=_n.activeElement;for(;Ce&&Ce.shadowRoot;)Ce=Ce.shadowRoot.activeElement;return Ce}function hasSelection(_n,Ce){if(!Ce.anchorNode)return!1;try{return contains(_n,Ce.anchorNode)}catch{return!1}}function clientRectsFor(_n){return _n.nodeType==3?textRange(_n,0,_n.nodeValue.length).getClientRects():_n.nodeType==1?_n.getClientRects():[]}function isEquivalentPosition(_n,Ce,ke,$n){return ke?scanFor(_n,Ce,ke,$n,-1)||scanFor(_n,Ce,ke,$n,1):!1}function domIndex(_n){for(var Ce=0;;Ce++)if(_n=_n.previousSibling,!_n)return Ce}function isBlockElement(_n){return _n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(_n.nodeName)}function scanFor(_n,Ce,ke,$n,Hn){for(;;){if(_n==ke&&Ce==$n)return!0;if(Ce==(Hn<0?0:maxOffset(_n))){if(_n.nodeName=="DIV")return!1;let zn=_n.parentNode;if(!zn||zn.nodeType!=1)return!1;Ce=domIndex(_n)+(Hn<0?0:1),_n=zn}else if(_n.nodeType==1){if(_n=_n.childNodes[Ce+(Hn<0?-1:0)],_n.nodeType==1&&_n.contentEditable=="false")return!1;Ce=Hn<0?maxOffset(_n):0}else return!1}}function maxOffset(_n){return _n.nodeType==3?_n.nodeValue.length:_n.childNodes.length}function flattenRect(_n,Ce){let ke=Ce?_n.left:_n.right;return{left:ke,right:ke,top:_n.top,bottom:_n.bottom}}function windowRect(_n){let Ce=_n.visualViewport;return Ce?{left:0,right:Ce.width,top:0,bottom:Ce.height}:{left:0,right:_n.innerWidth,top:0,bottom:_n.innerHeight}}function getScale(_n,Ce){let ke=Ce.width/_n.offsetWidth,$n=Ce.height/_n.offsetHeight;return(ke>.995&&ke<1.005||!isFinite(ke)||Math.abs(Ce.width-_n.offsetWidth)<1)&&(ke=1),($n>.995&&$n<1.005||!isFinite($n)||Math.abs(Ce.height-_n.offsetHeight)<1)&&($n=1),{scaleX:ke,scaleY:$n}}function scrollRectIntoView(_n,Ce,ke,$n,Hn,zn,Un,qn){let Xn=_n.ownerDocument,Kn=Xn.defaultView||window;for(let to=_n,io=!1;to&&!io;)if(to.nodeType==1){let uo,ho=to==Xn.body,bo=1,Oo=1;if(ho)uo=windowRect(Kn);else{if(/^(fixed|sticky)$/.test(getComputedStyle(to).position)&&(io=!0),to.scrollHeight<=to.clientHeight&&to.scrollWidth<=to.clientWidth){to=to.assignedSlot||to.parentNode;continue}let Do=to.getBoundingClientRect();({scaleX:bo,scaleY:Oo}=getScale(to,Do)),uo={left:Do.left,right:Do.left+to.clientWidth*bo,top:Do.top,bottom:Do.top+to.clientHeight*Oo}}let So=0,$o=0;if(Hn=="nearest")Ce.top0&&Ce.bottom>uo.bottom+$o&&($o=Ce.bottom-uo.bottom+$o+Un)):Ce.bottom>uo.bottom&&($o=Ce.bottom-uo.bottom+Un,ke<0&&Ce.top-$o0&&Ce.right>uo.right+So&&(So=Ce.right-uo.right+So+zn)):Ce.right>uo.right&&(So=Ce.right-uo.right+zn,ke<0&&Ce.leftHn.clientHeight&&($n=Hn),!ke&&Hn.scrollWidth>Hn.clientWidth&&(ke=Hn),Hn=Hn.assignedSlot||Hn.parentNode;else if(Hn.nodeType==11)Hn=Hn.host;else break;return{x:ke,y:$n}}class DOMSelectionState{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(Ce){return this.anchorNode==Ce.anchorNode&&this.anchorOffset==Ce.anchorOffset&&this.focusNode==Ce.focusNode&&this.focusOffset==Ce.focusOffset}setRange(Ce){let{anchorNode:ke,focusNode:$n}=Ce;this.set(ke,Math.min(Ce.anchorOffset,ke?maxOffset(ke):0),$n,Math.min(Ce.focusOffset,$n?maxOffset($n):0))}set(Ce,ke,$n,Hn){this.anchorNode=Ce,this.anchorOffset=ke,this.focusNode=$n,this.focusOffset=Hn}}let preventScrollSupported=null;function focusPreventScroll(_n){if(_n.setActive)return _n.setActive();if(preventScrollSupported)return _n.focus(preventScrollSupported);let Ce=[];for(let ke=_n;ke&&(Ce.push(ke,ke.scrollTop,ke.scrollLeft),ke!=ke.ownerDocument);ke=ke.parentNode);if(_n.focus(preventScrollSupported==null?{get preventScroll(){return preventScrollSupported={preventScroll:!0},!0}}:void 0),!preventScrollSupported){preventScrollSupported=!1;for(let ke=0;keMath.max(1,_n.scrollHeight-_n.clientHeight-4)}function textNodeBefore(_n,Ce){for(let ke=_n,$n=Ce;;){if(ke.nodeType==3&&$n>0)return{node:ke,offset:$n};if(ke.nodeType==1&&$n>0){if(ke.contentEditable=="false")return null;ke=ke.childNodes[$n-1],$n=maxOffset(ke)}else if(ke.parentNode&&!isBlockElement(ke))$n=domIndex(ke),ke=ke.parentNode;else return null}}function textNodeAfter(_n,Ce){for(let ke=_n,$n=Ce;;){if(ke.nodeType==3&&$nke)return io.domBoundsAround(Ce,ke,Kn);if(uo>=Ce&&Hn==-1&&(Hn=Xn,zn=Kn),Kn>ke&&io.dom.parentNode==this.dom){Un=Xn,qn=to;break}to=uo,Kn=uo+io.breakAfter}return{from:zn,to:qn<0?$n+this.length:qn,startDOM:(Hn?this.children[Hn-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:Un=0?this.children[Un].dom:null}}markDirty(Ce=!1){this.flags|=2,this.markParentsDirty(Ce)}markParentsDirty(Ce){for(let ke=this.parent;ke;ke=ke.parent){if(Ce&&(ke.flags|=2),ke.flags&1)return;ke.flags|=1,Ce=!1}}setParent(Ce){this.parent!=Ce&&(this.parent=Ce,this.flags&7&&this.markParentsDirty(!0))}setDOM(Ce){this.dom!=Ce&&(this.dom&&(this.dom.cmView=null),this.dom=Ce,Ce.cmView=this)}get rootView(){for(let Ce=this;;){let ke=Ce.parent;if(!ke)return Ce;Ce=ke}}replaceChildren(Ce,ke,$n=noChildren){this.markDirty();for(let Hn=Ce;Hnthis.pos||Ce==this.pos&&(ke>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=Ce-this.pos,this;let $n=this.children[--this.i];this.pos-=$n.length+$n.breakAfter}}}function replaceRange(_n,Ce,ke,$n,Hn,zn,Un,qn,Xn){let{children:Kn}=_n,to=Kn.length?Kn[Ce]:null,io=zn.length?zn[zn.length-1]:null,uo=io?io.breakAfter:Un;if(!(Ce==$n&&to&&!Un&&!uo&&zn.length<2&&to.merge(ke,Hn,zn.length?io:null,ke==0,qn,Xn))){if($n0&&(!Un&&zn.length&&to.merge(ke,to.length,zn[0],!1,qn,0)?to.breakAfter=zn.shift().breakAfter:(ke2);var browser={mac:ios||/Mac/.test(nav.platform),windows:/Win/.test(nav.platform),linux:/Linux|X11/.test(nav.platform),ie,ie_version:ie_upto10?doc.documentMode||6:ie_11up?+ie_11up[1]:ie_edge?+ie_edge[1]:0,gecko,gecko_version:gecko?+(/Firefox\/(\d+)/.exec(nav.userAgent)||[0,0])[1]:0,chrome:!!chrome,chrome_version:chrome?+chrome[1]:0,ios,android:/Android\b/.test(nav.userAgent),webkit,safari,webkit_version:webkit?+(/\bAppleWebKit\/(\d+)/.exec(nav.userAgent)||[0,0])[1]:0,tabSize:doc.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const MaxJoinLen=256;class TextView extends ContentView{constructor(Ce){super(),this.text=Ce}get length(){return this.text.length}createDOM(Ce){this.setDOM(Ce||document.createTextNode(this.text))}sync(Ce,ke){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(ke&&ke.node==this.dom&&(ke.written=!0),this.dom.nodeValue=this.text)}reuseDOM(Ce){Ce.nodeType==3&&this.createDOM(Ce)}merge(Ce,ke,$n){return this.flags&8||$n&&(!($n instanceof TextView)||this.length-(ke-Ce)+$n.length>MaxJoinLen||$n.flags&8)?!1:(this.text=this.text.slice(0,Ce)+($n?$n.text:"")+this.text.slice(ke),this.markDirty(),!0)}split(Ce){let ke=new TextView(this.text.slice(Ce));return this.text=this.text.slice(0,Ce),this.markDirty(),ke.flags|=this.flags&8,ke}localPosFromDOM(Ce,ke){return Ce==this.dom?ke:ke?this.text.length:0}domAtPos(Ce){return new DOMPos(this.dom,Ce)}domBoundsAround(Ce,ke,$n){return{from:$n,to:$n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(Ce,ke){return textCoords(this.dom,Ce,ke)}}class MarkView extends ContentView{constructor(Ce,ke=[],$n=0){super(),this.mark=Ce,this.children=ke,this.length=$n;for(let Hn of ke)Hn.setParent(this)}setAttrs(Ce){if(clearAttributes(Ce),this.mark.class&&(Ce.className=this.mark.class),this.mark.attrs)for(let ke in this.mark.attrs)Ce.setAttribute(ke,this.mark.attrs[ke]);return Ce}canReuseDOM(Ce){return super.canReuseDOM(Ce)&&!((this.flags|Ce.flags)&8)}reuseDOM(Ce){Ce.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(Ce),this.flags|=6)}sync(Ce,ke){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(Ce,ke)}merge(Ce,ke,$n,Hn,zn,Un){return $n&&(!($n instanceof MarkView&&$n.mark.eq(this.mark))||Ce&&zn<=0||keCe&&ke.push($n=Ce&&(Hn=zn),$n=Xn,zn++}let Un=this.length-Ce;return this.length=Ce,Hn>-1&&(this.children.length=Hn,this.markDirty()),new MarkView(this.mark,ke,Un)}domAtPos(Ce){return inlineDOMAtPos(this,Ce)}coordsAt(Ce,ke){return coordsInChildren(this,Ce,ke)}}function textCoords(_n,Ce,ke){let $n=_n.nodeValue.length;Ce>$n&&(Ce=$n);let Hn=Ce,zn=Ce,Un=0;Ce==0&&ke<0||Ce==$n&&ke>=0?browser.chrome||browser.gecko||(Ce?(Hn--,Un=1):zn<$n&&(zn++,Un=-1)):ke<0?Hn--:zn<$n&&zn++;let qn=textRange(_n,Hn,zn).getClientRects();if(!qn.length)return null;let Xn=qn[(Un?Un<0:ke>=0)?0:qn.length-1];return browser.safari&&!Un&&Xn.width==0&&(Xn=Array.prototype.find.call(qn,Kn=>Kn.width)||Xn),Un?flattenRect(Xn,Un<0):Xn||null}class WidgetView extends ContentView{static create(Ce,ke,$n){return new WidgetView(Ce,ke,$n)}constructor(Ce,ke,$n){super(),this.widget=Ce,this.length=ke,this.side=$n,this.prevWidget=null}split(Ce){let ke=WidgetView.create(this.widget,this.length-Ce,this.side);return this.length-=Ce,ke}sync(Ce){(!this.dom||!this.widget.updateDOM(this.dom,Ce))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(Ce)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(Ce,ke,$n,Hn,zn,Un){return $n&&(!($n instanceof WidgetView)||!this.widget.compare($n.widget)||Ce>0&&zn<=0||ke0)?DOMPos.before(this.dom):DOMPos.after(this.dom,Ce==this.length)}domBoundsAround(){return null}coordsAt(Ce,ke){let $n=this.widget.coordsAt(this.dom,Ce,ke);if($n)return $n;let Hn=this.dom.getClientRects(),zn=null;if(!Hn.length)return null;let Un=this.side?this.side<0:Ce>0;for(let qn=Un?Hn.length-1:0;zn=Hn[qn],!(Ce>0?qn==0:qn==Hn.length-1||zn.top0?DOMPos.before(this.dom):DOMPos.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(Ce){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Text.empty}get isHidden(){return!0}}TextView.prototype.children=WidgetView.prototype.children=WidgetBufferView.prototype.children=noChildren;function inlineDOMAtPos(_n,Ce){let ke=_n.dom,{children:$n}=_n,Hn=0;for(let zn=0;Hn<$n.length;Hn++){let Un=$n[Hn],qn=zn+Un.length;if(!(qn==zn&&Un.getSide()<=0)){if(Ce>zn&&Ce0;zn--){let Un=$n[zn-1];if(Un.dom.parentNode==ke)return Un.domAtPos(Un.length)}for(let zn=Hn;zn<$n.length;zn++){let Un=$n[zn];if(Un.dom.parentNode==ke)return Un.domAtPos(0)}return new DOMPos(ke,0)}function joinInlineInto(_n,Ce,ke){let $n,{children:Hn}=_n;ke>0&&Ce instanceof MarkView&&Hn.length&&($n=Hn[Hn.length-1])instanceof MarkView&&$n.mark.eq(Ce.mark)?joinInlineInto($n,Ce.children[0],ke-1):(Hn.push(Ce),Ce.setParent(_n)),_n.length+=Ce.length}function coordsInChildren(_n,Ce,ke){let $n=null,Hn=-1,zn=null,Un=-1;function qn(Kn,to){for(let io=0,uo=0;io=to&&(ho.children.length?qn(ho,to-uo):(!zn||zn.isHidden&&ke>0)&&(bo>to||uo==bo&&ho.getSide()>0)?(zn=ho,Un=to-uo):(uo-1?1:0)!=Hn.length-(ke&&Hn.indexOf(ke)>-1?1:0))return!1;for(let zn of $n)if(zn!=ke&&(Hn.indexOf(zn)==-1||_n[zn]!==Ce[zn]))return!1;return!0}function updateAttrs(_n,Ce,ke){let $n=!1;if(Ce)for(let Hn in Ce)ke&&Hn in ke||($n=!0,Hn=="style"?_n.style.cssText="":_n.removeAttribute(Hn));if(ke)for(let Hn in ke)Ce&&Ce[Hn]==ke[Hn]||($n=!0,Hn=="style"?_n.style.cssText=ke[Hn]:_n.setAttribute(Hn,ke[Hn]));return $n}function getAttrs$1(_n){let Ce=Object.create(null);for(let ke=0;ke<_n.attributes.length;ke++){let $n=_n.attributes[ke];Ce[$n.name]=$n.value}return Ce}class WidgetType{eq(Ce){return!1}updateDOM(Ce,ke){return!1}compare(Ce){return this==Ce||this.constructor==Ce.constructor&&this.eq(Ce)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(Ce){return!0}coordsAt(Ce,ke,$n){return null}get isHidden(){return!1}get editable(){return!1}destroy(Ce){}}var BlockType=function(_n){return _n[_n.Text=0]="Text",_n[_n.WidgetBefore=1]="WidgetBefore",_n[_n.WidgetAfter=2]="WidgetAfter",_n[_n.WidgetRange=3]="WidgetRange",_n}(BlockType||(BlockType={}));class Decoration extends RangeValue{constructor(Ce,ke,$n,Hn){super(),this.startSide=Ce,this.endSide=ke,this.widget=$n,this.spec=Hn}get heightRelevant(){return!1}static mark(Ce){return new MarkDecoration(Ce)}static widget(Ce){let ke=Math.max(-1e4,Math.min(1e4,Ce.side||0)),$n=!!Ce.block;return ke+=$n&&!Ce.inlineOrder?ke>0?3e8:-4e8:ke>0?1e8:-1e8,new PointDecoration(Ce,ke,ke,$n,Ce.widget||null,!1)}static replace(Ce){let ke=!!Ce.block,$n,Hn;if(Ce.isBlockGap)$n=-5e8,Hn=4e8;else{let{start:zn,end:Un}=getInclusive(Ce,ke);$n=(zn?ke?-3e8:-1:5e8)-1,Hn=(Un?ke?2e8:1:-6e8)+1}return new PointDecoration(Ce,$n,Hn,ke,Ce.widget||null,!0)}static line(Ce){return new LineDecoration(Ce)}static set(Ce,ke=!1){return RangeSet.of(Ce,ke)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Decoration.none=RangeSet.empty;class MarkDecoration extends Decoration{constructor(Ce){let{start:ke,end:$n}=getInclusive(Ce);super(ke?-1:5e8,$n?1:-6e8,null,Ce),this.tagName=Ce.tagName||"span",this.class=Ce.class||"",this.attrs=Ce.attributes||null}eq(Ce){var ke,$n;return this==Ce||Ce instanceof MarkDecoration&&this.tagName==Ce.tagName&&(this.class||((ke=this.attrs)===null||ke===void 0?void 0:ke.class))==(Ce.class||(($n=Ce.attrs)===null||$n===void 0?void 0:$n.class))&&attrsEq(this.attrs,Ce.attrs,"class")}range(Ce,ke=Ce){if(Ce>=ke)throw new RangeError("Mark decorations may not be empty");return super.range(Ce,ke)}}MarkDecoration.prototype.point=!1;class LineDecoration extends Decoration{constructor(Ce){super(-2e8,-2e8,null,Ce)}eq(Ce){return Ce instanceof LineDecoration&&this.spec.class==Ce.spec.class&&attrsEq(this.spec.attributes,Ce.spec.attributes)}range(Ce,ke=Ce){if(ke!=Ce)throw new RangeError("Line decoration ranges must be zero-length");return super.range(Ce,ke)}}LineDecoration.prototype.mapMode=MapMode.TrackBefore;LineDecoration.prototype.point=!0;class PointDecoration extends Decoration{constructor(Ce,ke,$n,Hn,zn,Un){super(ke,$n,zn,Ce),this.block=Hn,this.isReplace=Un,this.mapMode=Hn?ke<=0?MapMode.TrackBefore:MapMode.TrackAfter:MapMode.TrackDel}get type(){return this.startSide!=this.endSide?BlockType.WidgetRange:this.startSide<=0?BlockType.WidgetBefore:BlockType.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(Ce){return Ce instanceof PointDecoration&&widgetsEq(this.widget,Ce.widget)&&this.block==Ce.block&&this.startSide==Ce.startSide&&this.endSide==Ce.endSide}range(Ce,ke=Ce){if(this.isReplace&&(Ce>ke||Ce==ke&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&ke!=Ce)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(Ce,ke)}}PointDecoration.prototype.point=!0;function getInclusive(_n,Ce=!1){let{inclusiveStart:ke,inclusiveEnd:$n}=_n;return ke==null&&(ke=_n.inclusive),$n==null&&($n=_n.inclusive),{start:ke??Ce,end:$n??Ce}}function widgetsEq(_n,Ce){return _n==Ce||!!(_n&&Ce&&_n.compare(Ce))}function addRange(_n,Ce,ke,$n=0){let Hn=ke.length-1;Hn>=0&&ke[Hn]+$n>=_n?ke[Hn]=Math.max(ke[Hn],Ce):ke.push(_n,Ce)}class LineView extends ContentView{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(Ce,ke,$n,Hn,zn,Un){if($n){if(!($n instanceof LineView))return!1;this.dom||$n.transferDOM(this)}return Hn&&this.setDeco($n?$n.attrs:null),mergeChildrenInto(this,Ce,ke,$n?$n.children.slice():[],zn,Un),!0}split(Ce){let ke=new LineView;if(ke.breakAfter=this.breakAfter,this.length==0)return ke;let{i:$n,off:Hn}=this.childPos(Ce);Hn&&(ke.append(this.children[$n].split(Hn),0),this.children[$n].merge(Hn,this.children[$n].length,null,!1,0,0),$n++);for(let zn=$n;zn0&&this.children[$n-1].length==0;)this.children[--$n].destroy();return this.children.length=$n,this.markDirty(),this.length=Ce,ke}transferDOM(Ce){this.dom&&(this.markDirty(),Ce.setDOM(this.dom),Ce.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(Ce){attrsEq(this.attrs,Ce)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=Ce)}append(Ce,ke){joinInlineInto(this,Ce,ke)}addLineDeco(Ce){let ke=Ce.spec.attributes,$n=Ce.spec.class;ke&&(this.attrs=combineAttrs(ke,this.attrs||{})),$n&&(this.attrs=combineAttrs({class:$n},this.attrs||{}))}domAtPos(Ce){return inlineDOMAtPos(this,Ce)}reuseDOM(Ce){Ce.nodeName=="DIV"&&(this.setDOM(Ce),this.flags|=6)}sync(Ce,ke){var $n;this.dom?this.flags&4&&(clearAttributes(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(updateAttrs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(Ce,ke);let Hn=this.dom.lastChild;for(;Hn&&ContentView.get(Hn)instanceof MarkView;)Hn=Hn.lastChild;if(!Hn||!this.length||Hn.nodeName!="BR"&&(($n=ContentView.get(Hn))===null||$n===void 0?void 0:$n.isEditable)==!1&&(!browser.ios||!this.children.some(zn=>zn instanceof TextView))){let zn=document.createElement("BR");zn.cmIgnore=!0,this.dom.appendChild(zn)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let Ce=0,ke;for(let $n of this.children){if(!($n instanceof TextView)||/[^ -~]/.test($n.text))return null;let Hn=clientRectsFor($n.dom);if(Hn.length!=1)return null;Ce+=Hn[0].width,ke=Hn[0].height}return Ce?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:Ce/this.length,textHeight:ke}:null}coordsAt(Ce,ke){let $n=coordsInChildren(this,Ce,ke);if(!this.children.length&&$n&&this.parent){let{heightOracle:Hn}=this.parent.view.viewState,zn=$n.bottom-$n.top;if(Math.abs(zn-Hn.lineHeight)<2&&Hn.textHeight=ke){if(zn instanceof LineView)return zn;if(Un>ke)break}Hn=Un+zn.breakAfter}return null}}class BlockWidgetView extends ContentView{constructor(Ce,ke,$n){super(),this.widget=Ce,this.length=ke,this.deco=$n,this.breakAfter=0,this.prevWidget=null}merge(Ce,ke,$n,Hn,zn,Un){return $n&&(!($n instanceof BlockWidgetView)||!this.widget.compare($n.widget)||Ce>0&&zn<=0||ke0}}class BlockGapWidget extends WidgetType{constructor(Ce){super(),this.height=Ce}toDOM(){let Ce=document.createElement("div");return Ce.className="cm-gap",this.updateDOM(Ce),Ce}eq(Ce){return Ce.height==this.height}updateDOM(Ce){return Ce.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class ContentBuilder{constructor(Ce,ke,$n,Hn){this.doc=Ce,this.pos=ke,this.end=$n,this.disallowBlockEffectsFor=Hn,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=Ce.iter(),this.skip=ke}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let Ce=this.content[this.content.length-1];return!(Ce.breakAfter||Ce instanceof BlockWidgetView&&Ce.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new LineView),this.atCursorPos=!0),this.curLine}flushBuffer(Ce=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(wrapMarks(new WidgetBufferView(-1),Ce),Ce.length),this.pendingBuffer=0)}addBlockWidget(Ce){this.flushBuffer(),this.curLine=null,this.content.push(Ce)}finish(Ce){this.pendingBuffer&&Ce<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(Ce&&this.content.length&&this.content[this.content.length-1]instanceof BlockWidgetView)&&this.getLine()}buildText(Ce,ke,$n){for(;Ce>0;){if(this.textOff==this.text.length){let{value:zn,lineBreak:Un,done:qn}=this.cursor.next(this.skip);if(this.skip=0,qn)throw new Error("Ran out of text content when drawing inline views");if(Un){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,Ce--;continue}else this.text=zn,this.textOff=0}let Hn=Math.min(this.text.length-this.textOff,Ce,512);this.flushBuffer(ke.slice(ke.length-$n)),this.getLine().append(wrapMarks(new TextView(this.text.slice(this.textOff,this.textOff+Hn)),ke),$n),this.atCursorPos=!0,this.textOff+=Hn,Ce-=Hn,$n=0}}span(Ce,ke,$n,Hn){this.buildText(ke-Ce,$n,Hn),this.pos=ke,this.openStart<0&&(this.openStart=Hn)}point(Ce,ke,$n,Hn,zn,Un){if(this.disallowBlockEffectsFor[Un]&&$n instanceof PointDecoration){if($n.block)throw new RangeError("Block decorations may not be specified via plugins");if(ke>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let qn=ke-Ce;if($n instanceof PointDecoration)if($n.block)$n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new BlockWidgetView($n.widget||NullWidget.block,qn,$n));else{let Xn=WidgetView.create($n.widget||NullWidget.inline,qn,qn?0:$n.startSide),Kn=this.atCursorPos&&!Xn.isEditable&&zn<=Hn.length&&(Ce0),to=!Xn.isEditable&&(CeHn.length||$n.startSide<=0),io=this.getLine();this.pendingBuffer==2&&!Kn&&!Xn.isEditable&&(this.pendingBuffer=0),this.flushBuffer(Hn),Kn&&(io.append(wrapMarks(new WidgetBufferView(1),Hn),zn),zn=Hn.length+Math.max(0,zn-Hn.length)),io.append(wrapMarks(Xn,Hn),zn),this.atCursorPos=to,this.pendingBuffer=to?CeHn.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=Hn.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco($n);qn&&(this.textOff+qn<=this.text.length?this.textOff+=qn:(this.skip+=qn-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=ke),this.openStart<0&&(this.openStart=zn)}static build(Ce,ke,$n,Hn,zn){let Un=new ContentBuilder(Ce,ke,$n,zn);return Un.openEnd=RangeSet.spans(Hn,ke,$n,Un),Un.openStart<0&&(Un.openStart=Un.openEnd),Un.finish(Un.openEnd),Un}}function wrapMarks(_n,Ce){for(let ke of Ce)_n=new MarkView(ke,[_n],_n.length);return _n}class NullWidget extends WidgetType{constructor(Ce){super(),this.tag=Ce}eq(Ce){return Ce.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(Ce){return Ce.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}NullWidget.inline=new NullWidget("span");NullWidget.block=new NullWidget("div");var Direction=function(_n){return _n[_n.LTR=0]="LTR",_n[_n.RTL=1]="RTL",_n}(Direction||(Direction={}));const LTR=Direction.LTR,RTL=Direction.RTL;function dec(_n){let Ce=[];for(let ke=0;ke<_n.length;ke++)Ce.push(1<<+_n[ke]);return Ce}const LowTypes=dec("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),ArabicTypes=dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Brackets=Object.create(null),BracketStack=[];for(let _n of["()","[]","{}"]){let Ce=_n.charCodeAt(0),ke=_n.charCodeAt(1);Brackets[Ce]=ke,Brackets[ke]=-Ce}function charType(_n){return _n<=247?LowTypes[_n]:1424<=_n&&_n<=1524?2:1536<=_n&&_n<=1785?ArabicTypes[_n-1536]:1774<=_n&&_n<=2220?4:8192<=_n&&_n<=8204?256:64336<=_n&&_n<=65023?4:1}const BidiRE=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class BidiSpan{get dir(){return this.level%2?RTL:LTR}constructor(Ce,ke,$n){this.from=Ce,this.to=ke,this.level=$n}side(Ce,ke){return this.dir==ke==Ce?this.to:this.from}forward(Ce,ke){return Ce==(this.dir==ke)}static find(Ce,ke,$n,Hn){let zn=-1;for(let Un=0;Un=ke){if(qn.level==$n)return Un;(zn<0||(Hn!=0?Hn<0?qn.fromke:Ce[zn].level>qn.level))&&(zn=Un)}}if(zn<0)throw new RangeError("Index out of range");return zn}}function isolatesEq(_n,Ce){if(_n.length!=Ce.length)return!1;for(let ke=0;ke<_n.length;ke++){let $n=_n[ke],Hn=Ce[ke];if($n.from!=Hn.from||$n.to!=Hn.to||$n.direction!=Hn.direction||!isolatesEq($n.inner,Hn.inner))return!1}return!0}const types=[];function computeCharTypes(_n,Ce,ke,$n,Hn){for(let zn=0;zn<=$n.length;zn++){let Un=zn?$n[zn-1].to:Ce,qn=zn<$n.length?$n[zn].from:ke,Xn=zn?256:Hn;for(let Kn=Un,to=Xn,io=Xn;Kn=0;Oo-=3)if(BracketStack[Oo+1]==-ho){let So=BracketStack[Oo+2],$o=So&2?Hn:So&4?So&1?zn:Hn:0;$o&&(types[io]=types[BracketStack[Oo]]=$o),qn=Oo;break}}else{if(BracketStack.length==189)break;BracketStack[qn++]=io,BracketStack[qn++]=uo,BracketStack[qn++]=Xn}else if((bo=types[io])==2||bo==1){let Oo=bo==Hn;Xn=Oo?0:1;for(let So=qn-3;So>=0;So-=3){let $o=BracketStack[So+2];if($o&2)break;if(Oo)BracketStack[So+2]|=2;else{if($o&4)break;BracketStack[So+2]|=4}}}}}function processNeutrals(_n,Ce,ke,$n){for(let Hn=0,zn=$n;Hn<=ke.length;Hn++){let Un=Hn?ke[Hn-1].to:_n,qn=HnXn;)bo==So&&(bo=ke[--Oo].from,So=Oo?ke[Oo-1].to:_n),types[--bo]=ho;Xn=to}else zn=Kn,Xn++}}}function emitSpans(_n,Ce,ke,$n,Hn,zn,Un){let qn=$n%2?2:1;if($n%2==Hn%2)for(let Xn=Ce,Kn=0;XnXn&&Un.push(new BidiSpan(Xn,Oo.from,ho));let So=Oo.direction==LTR!=!(ho%2);computeSectionOrder(_n,So?$n+1:$n,Hn,Oo.inner,Oo.from,Oo.to,Un),Xn=Oo.to}bo=Oo.to}else{if(bo==ke||(to?types[bo]!=qn:types[bo]==qn))break;bo++}uo?emitSpans(_n,Xn,bo,$n+1,Hn,uo,Un):XnCe;){let to=!0,io=!1;if(!Kn||Xn>zn[Kn-1].to){let Oo=types[Xn-1];Oo!=qn&&(to=!1,io=Oo==16)}let uo=!to&&qn==1?[]:null,ho=to?$n:$n+1,bo=Xn;e:for(;;)if(Kn&&bo==zn[Kn-1].to){if(io)break e;let Oo=zn[--Kn];if(!to)for(let So=Oo.from,$o=Kn;;){if(So==Ce)break e;if($o&&zn[$o-1].to==So)So=zn[--$o].from;else{if(types[So-1]==qn)break e;break}}if(uo)uo.push(Oo);else{Oo.totypes.length;)types[types.length]=256;let $n=[],Hn=Ce==LTR?0:1;return computeSectionOrder(_n,Hn,Hn,ke,0,_n.length,$n),$n}function trivialOrder(_n){return[new BidiSpan(0,_n,0)]}let movedOver="";function moveVisually(_n,Ce,ke,$n,Hn){var zn;let Un=$n.head-_n.from,qn=BidiSpan.find(Ce,Un,(zn=$n.bidiLevel)!==null&&zn!==void 0?zn:-1,$n.assoc),Xn=Ce[qn],Kn=Xn.side(Hn,ke);if(Un==Kn){let uo=qn+=Hn?1:-1;if(uo<0||uo>=Ce.length)return null;Xn=Ce[qn=uo],Un=Xn.side(!Hn,ke),Kn=Xn.side(Hn,ke)}let to=findClusterBreak(_n.text,Un,Xn.forward(Hn,ke));(toXn.to)&&(to=Kn),movedOver=_n.text.slice(Math.min(Un,to),Math.max(Un,to));let io=qn==(Hn?Ce.length-1:0)?null:Ce[qn+(Hn?1:-1)];return io&&to==Kn&&io.level+(Hn?0:1)_n.some(Ce=>Ce)}),nativeSelectionHidden=Facet.define({combine:_n=>_n.some(Ce=>Ce)}),scrollHandler=Facet.define();class ScrollTarget{constructor(Ce,ke="nearest",$n="nearest",Hn=5,zn=5,Un=!1){this.range=Ce,this.y=ke,this.x=$n,this.yMargin=Hn,this.xMargin=zn,this.isSnapshot=Un}map(Ce){return Ce.empty?this:new ScrollTarget(this.range.map(Ce),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(Ce){return this.range.to<=Ce.doc.length?this:new ScrollTarget(EditorSelection.cursor(Ce.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const scrollIntoView$1=StateEffect.define({map:(_n,Ce)=>_n.map(Ce)}),setEditContextFormatting=StateEffect.define();function logException(_n,Ce,ke){let $n=_n.facet(exceptionSink);$n.length?$n[0](Ce):window.onerror?window.onerror(String(Ce),ke,void 0,void 0,Ce):ke?console.error(ke+":",Ce):console.error(Ce)}const editable=Facet.define({combine:_n=>_n.length?_n[0]:!0});let nextPluginID=0;const viewPlugin=Facet.define();class ViewPlugin{constructor(Ce,ke,$n,Hn,zn){this.id=Ce,this.create=ke,this.domEventHandlers=$n,this.domEventObservers=Hn,this.extension=zn(this)}static define(Ce,ke){const{eventHandlers:$n,eventObservers:Hn,provide:zn,decorations:Un}=ke||{};return new ViewPlugin(nextPluginID++,Ce,$n,Hn,qn=>{let Xn=[viewPlugin.of(qn)];return Un&&Xn.push(decorations.of(Kn=>{let to=Kn.plugin(qn);return to?Un(to):Decoration.none})),zn&&Xn.push(zn(qn)),Xn})}static fromClass(Ce,ke){return ViewPlugin.define($n=>new Ce($n),ke)}}class PluginInstance{constructor(Ce){this.spec=Ce,this.mustUpdate=null,this.value=null}update(Ce){if(this.value){if(this.mustUpdate){let ke=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(ke)}catch($n){if(logException(ke.state,$n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(Ce)}catch(ke){logException(Ce.state,ke,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(Ce){var ke;if(!((ke=this.value)===null||ke===void 0)&&ke.destroy)try{this.value.destroy()}catch($n){logException(Ce.state,$n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const editorAttributes=Facet.define(),contentAttributes=Facet.define(),decorations=Facet.define(),outerDecorations=Facet.define(),atomicRanges=Facet.define(),bidiIsolatedRanges=Facet.define();function getIsolatedRanges(_n,Ce){let ke=_n.state.facet(bidiIsolatedRanges);if(!ke.length)return ke;let $n=ke.map(zn=>zn instanceof Function?zn(_n):zn),Hn=[];return RangeSet.spans($n,Ce.from,Ce.to,{point(){},span(zn,Un,qn,Xn){let Kn=zn-Ce.from,to=Un-Ce.from,io=Hn;for(let uo=qn.length-1;uo>=0;uo--,Xn--){let ho=qn[uo].spec.bidiIsolate,bo;if(ho==null&&(ho=autoDirection(Ce.text,Kn,to)),Xn>0&&io.length&&(bo=io[io.length-1]).to==Kn&&bo.direction==ho)bo.to=to,io=bo.inner;else{let Oo={from:Kn,to,direction:ho,inner:[]};io.push(Oo),io=Oo.inner}}}}),Hn}const scrollMargins=Facet.define();function getScrollMargins(_n){let Ce=0,ke=0,$n=0,Hn=0;for(let zn of _n.state.facet(scrollMargins)){let Un=zn(_n);Un&&(Un.left!=null&&(Ce=Math.max(Ce,Un.left)),Un.right!=null&&(ke=Math.max(ke,Un.right)),Un.top!=null&&($n=Math.max($n,Un.top)),Un.bottom!=null&&(Hn=Math.max(Hn,Un.bottom)))}return{left:Ce,right:ke,top:$n,bottom:Hn}}const styleModule=Facet.define();class ChangedRange{constructor(Ce,ke,$n,Hn){this.fromA=Ce,this.toA=ke,this.fromB=$n,this.toB=Hn}join(Ce){return new ChangedRange(Math.min(this.fromA,Ce.fromA),Math.max(this.toA,Ce.toA),Math.min(this.fromB,Ce.fromB),Math.max(this.toB,Ce.toB))}addToSet(Ce){let ke=Ce.length,$n=this;for(;ke>0;ke--){let Hn=Ce[ke-1];if(!(Hn.fromA>$n.toA)){if(Hn.toA<$n.fromA)break;$n=$n.join(Hn),Ce.splice(ke-1,1)}}return Ce.splice(ke,0,$n),Ce}static extendWithRanges(Ce,ke){if(ke.length==0)return Ce;let $n=[];for(let Hn=0,zn=0,Un=0,qn=0;;Hn++){let Xn=Hn==Ce.length?null:Ce[Hn],Kn=Un-qn,to=Xn?Xn.fromB:1e9;for(;znto)break;zn+=2}if(!Xn)return $n;new ChangedRange(Xn.fromA,Xn.toA,Xn.fromB,Xn.toB).addToSet($n),Un=Xn.toA,qn=Xn.toB}}}class ViewUpdate{constructor(Ce,ke,$n){this.view=Ce,this.state=ke,this.transactions=$n,this.flags=0,this.startState=Ce.state,this.changes=ChangeSet.empty(this.startState.doc.length);for(let zn of $n)this.changes=this.changes.compose(zn.changes);let Hn=[];this.changes.iterChangedRanges((zn,Un,qn,Xn)=>Hn.push(new ChangedRange(zn,Un,qn,Xn))),this.changedRanges=Hn}static create(Ce,ke,$n){return new ViewUpdate(Ce,ke,$n)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(Ce=>Ce.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class DocView extends ContentView{get length(){return this.view.state.doc.length}constructor(Ce){super(),this.view=Ce,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Decoration.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(Ce.contentDOM),this.children=[new LineView],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ChangedRange(0,0,0,Ce.state.doc.length)],0,null)}update(Ce){var ke;let $n=Ce.changedRanges;this.minWidth>0&&$n.length&&($n.every(({fromA:Kn,toA:to})=>tothis.minWidthTo)?(this.minWidthFrom=Ce.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=Ce.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(Ce);let Hn=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((ke=this.domChanged)===null||ke===void 0)&&ke.newSel?Hn=this.domChanged.newSel.head:!touchesComposition(Ce.changes,this.hasComposition)&&!Ce.selectionSet&&(Hn=Ce.state.selection.main.head));let zn=Hn>-1?findCompositionRange(this.view,Ce.changes,Hn):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:Kn,to}=this.hasComposition;$n=new ChangedRange(Kn,to,Ce.changes.mapPos(Kn,-1),Ce.changes.mapPos(to,1)).addToSet($n.slice())}this.hasComposition=zn?{from:zn.range.fromB,to:zn.range.toB}:null,(browser.ie||browser.chrome)&&!zn&&Ce&&Ce.state.doc.lines!=Ce.startState.doc.lines&&(this.forceSelection=!0);let Un=this.decorations,qn=this.updateDeco(),Xn=findChangedDeco(Un,qn,Ce.changes);return $n=ChangedRange.extendWithRanges($n,Xn),!(this.flags&7)&&$n.length==0?!1:(this.updateInner($n,Ce.startState.doc.length,zn),Ce.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(Ce,ke,$n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(Ce,ke,$n);let{observer:Hn}=this.view;Hn.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let Un=browser.chrome||browser.ios?{node:Hn.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,Un),this.flags&=-8,Un&&(Un.written||Hn.selectionRange.focusNode!=Un.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(Un=>Un.flags&=-9);let zn=[];if(this.view.viewport.from||this.view.viewport.to=0?Hn[Un]:null;if(!qn)break;let{fromA:Xn,toA:Kn,fromB:to,toB:io}=qn,uo,ho,bo,Oo;if($n&&$n.range.fromBto){let Io=ContentBuilder.build(this.view.state.doc,to,$n.range.fromB,this.decorations,this.dynamicDecorationMap),Vo=ContentBuilder.build(this.view.state.doc,$n.range.toB,io,this.decorations,this.dynamicDecorationMap);ho=Io.breakAtStart,bo=Io.openStart,Oo=Vo.openEnd;let Jo=this.compositionView($n);Vo.breakAtStart?Jo.breakAfter=1:Vo.content.length&&Jo.merge(Jo.length,Jo.length,Vo.content[0],!1,Vo.openStart,0)&&(Jo.breakAfter=Vo.content[0].breakAfter,Vo.content.shift()),Io.content.length&&Jo.merge(0,0,Io.content[Io.content.length-1],!0,0,Io.openEnd)&&Io.content.pop(),uo=Io.content.concat(Jo).concat(Vo.content)}else({content:uo,breakAtStart:ho,openStart:bo,openEnd:Oo}=ContentBuilder.build(this.view.state.doc,to,io,this.decorations,this.dynamicDecorationMap));let{i:So,off:$o}=zn.findPos(Kn,1),{i:Do,off:xo}=zn.findPos(Xn,-1);replaceRange(this,Do,xo,So,$o,uo,ho,bo,Oo)}$n&&this.fixCompositionDOM($n)}updateEditContextFormatting(Ce){this.editContextFormatting=this.editContextFormatting.map(Ce.changes);for(let ke of Ce.transactions)for(let $n of ke.effects)$n.is(setEditContextFormatting)&&(this.editContextFormatting=$n.value)}compositionView(Ce){let ke=new TextView(Ce.text.nodeValue);ke.flags|=8;for(let{deco:Hn}of Ce.marks)ke=new MarkView(Hn,[ke],ke.length);let $n=new LineView;return $n.append(ke,0),$n}fixCompositionDOM(Ce){let ke=(zn,Un)=>{Un.flags|=8|(Un.children.some(Xn=>Xn.flags&7)?1:0),this.markedForComposition.add(Un);let qn=ContentView.get(zn);qn&&qn!=Un&&(qn.dom=null),Un.setDOM(zn)},$n=this.childPos(Ce.range.fromB,1),Hn=this.children[$n.i];ke(Ce.line,Hn);for(let zn=Ce.marks.length-1;zn>=-1;zn--)$n=Hn.childPos($n.off,1),Hn=Hn.children[$n.i],ke(zn>=0?Ce.marks[zn].node:Ce.text,Hn)}updateSelection(Ce=!1,ke=!1){(Ce||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let $n=this.view.root.activeElement,Hn=$n==this.dom,zn=!Hn&&hasSelection(this.dom,this.view.observer.selectionRange)&&!($n&&this.dom.contains($n));if(!(Hn||ke||zn))return;let Un=this.forceSelection;this.forceSelection=!1;let qn=this.view.state.selection.main,Xn=this.moveToLine(this.domAtPos(qn.anchor)),Kn=qn.empty?Xn:this.moveToLine(this.domAtPos(qn.head));if(browser.gecko&&qn.empty&&!this.hasComposition&&betweenUneditable(Xn)){let io=document.createTextNode("");this.view.observer.ignore(()=>Xn.node.insertBefore(io,Xn.node.childNodes[Xn.offset]||null)),Xn=Kn=new DOMPos(io,0),Un=!0}let to=this.view.observer.selectionRange;(Un||!to.focusNode||(!isEquivalentPosition(Xn.node,Xn.offset,to.anchorNode,to.anchorOffset)||!isEquivalentPosition(Kn.node,Kn.offset,to.focusNode,to.focusOffset))&&!this.suppressWidgetCursorChange(to,qn))&&(this.view.observer.ignore(()=>{browser.android&&browser.chrome&&this.dom.contains(to.focusNode)&&inUneditable(to.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let io=getSelection(this.view.root);if(io)if(qn.empty){if(browser.gecko){let uo=nextToUneditable(Xn.node,Xn.offset);if(uo&&uo!=3){let ho=(uo==1?textNodeBefore:textNodeAfter)(Xn.node,Xn.offset);ho&&(Xn=new DOMPos(ho.node,ho.offset))}}io.collapse(Xn.node,Xn.offset),qn.bidiLevel!=null&&io.caretBidiLevel!==void 0&&(io.caretBidiLevel=qn.bidiLevel)}else if(io.extend){io.collapse(Xn.node,Xn.offset);try{io.extend(Kn.node,Kn.offset)}catch{}}else{let uo=document.createRange();qn.anchor>qn.head&&([Xn,Kn]=[Kn,Xn]),uo.setEnd(Kn.node,Kn.offset),uo.setStart(Xn.node,Xn.offset),io.removeAllRanges(),io.addRange(uo)}zn&&this.view.root.activeElement==this.dom&&(this.dom.blur(),$n&&$n.focus())}),this.view.observer.setSelectionRange(Xn,Kn)),this.impreciseAnchor=Xn.precise?null:new DOMPos(to.anchorNode,to.anchorOffset),this.impreciseHead=Kn.precise?null:new DOMPos(to.focusNode,to.focusOffset)}suppressWidgetCursorChange(Ce,ke){return this.hasComposition&&ke.empty&&isEquivalentPosition(Ce.focusNode,Ce.focusOffset,Ce.anchorNode,Ce.anchorOffset)&&this.posFromDOM(Ce.focusNode,Ce.focusOffset)==ke.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:Ce}=this,ke=Ce.state.selection.main,$n=getSelection(Ce.root),{anchorNode:Hn,anchorOffset:zn}=Ce.observer.selectionRange;if(!$n||!ke.empty||!ke.assoc||!$n.modify)return;let Un=LineView.find(this,ke.head);if(!Un)return;let qn=Un.posAtStart;if(ke.head==qn||ke.head==qn+Un.length)return;let Xn=this.coordsAt(ke.head,-1),Kn=this.coordsAt(ke.head,1);if(!Xn||!Kn||Xn.bottom>Kn.top)return;let to=this.domAtPos(ke.head+ke.assoc);$n.collapse(to.node,to.offset),$n.modify("move",ke.assoc<0?"forward":"backward","lineboundary"),Ce.observer.readSelectionRange();let io=Ce.observer.selectionRange;Ce.docView.posFromDOM(io.anchorNode,io.anchorOffset)!=ke.from&&$n.collapse(Hn,zn)}moveToLine(Ce){let ke=this.dom,$n;if(Ce.node!=ke)return Ce;for(let Hn=Ce.offset;!$n&&Hn=0;Hn--){let zn=ContentView.get(ke.childNodes[Hn]);zn instanceof LineView&&($n=zn.domAtPos(zn.length))}return $n?new DOMPos($n.node,$n.offset,!0):Ce}nearest(Ce){for(let ke=Ce;ke;){let $n=ContentView.get(ke);if($n&&$n.rootView==this)return $n;ke=ke.parentNode}return null}posFromDOM(Ce,ke){let $n=this.nearest(Ce);if(!$n)throw new RangeError("Trying to find position for a DOM position outside of the document");return $n.localPosFromDOM(Ce,ke)+$n.posAtStart}domAtPos(Ce){let{i:ke,off:$n}=this.childCursor().findPos(Ce,-1);for(;ke=0;Un--){let qn=this.children[Un],Xn=zn-qn.breakAfter,Kn=Xn-qn.length;if(XnCe||qn.covers(1))&&(!$n||qn instanceof LineView&&!($n instanceof LineView&&ke>=0)))$n=qn,Hn=Kn;else if($n&&Kn==Ce&&Xn==Ce&&qn instanceof BlockWidgetView&&Math.abs(ke)<2){if(qn.deco.startSide<0)break;Un&&($n=null)}zn=Kn}return $n?$n.coordsAt(Ce-Hn,ke):null}coordsForChar(Ce){let{i:ke,off:$n}=this.childPos(Ce,1),Hn=this.children[ke];if(!(Hn instanceof LineView))return null;for(;Hn.children.length;){let{i:qn,off:Xn}=Hn.childPos($n,1);for(;;qn++){if(qn==Hn.children.length)return null;if((Hn=Hn.children[qn]).length)break}$n=Xn}if(!(Hn instanceof TextView))return null;let zn=findClusterBreak(Hn.text,$n);if(zn==$n)return null;let Un=textRange(Hn.dom,$n,zn).getClientRects();for(let qn=0;qnMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,qn=-1,Xn=this.view.textDirection==Direction.LTR;for(let Kn=0,to=0;toHn)break;if(Kn>=$n){let ho=io.dom.getBoundingClientRect();if(ke.push(ho.height),Un){let bo=io.dom.lastChild,Oo=bo?clientRectsFor(bo):[];if(Oo.length){let So=Oo[Oo.length-1],$o=Xn?So.right-ho.left:ho.right-So.left;$o>qn&&(qn=$o,this.minWidth=zn,this.minWidthFrom=Kn,this.minWidthTo=uo)}}}Kn=uo+io.breakAfter}return ke}textDirectionAt(Ce){let{i:ke}=this.childPos(Ce,1);return getComputedStyle(this.children[ke].dom).direction=="rtl"?Direction.RTL:Direction.LTR}measureTextSize(){for(let zn of this.children)if(zn instanceof LineView){let Un=zn.measureTextSize();if(Un)return Un}let Ce=document.createElement("div"),ke,$n,Hn;return Ce.className="cm-line",Ce.style.width="99999px",Ce.style.position="absolute",Ce.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(Ce);let zn=clientRectsFor(Ce.firstChild)[0];ke=Ce.getBoundingClientRect().height,$n=zn?zn.width/27:7,Hn=zn?zn.height:ke,Ce.remove()}),{lineHeight:ke,charWidth:$n,textHeight:Hn}}childCursor(Ce=this.length){let ke=this.children.length;return ke&&(Ce-=this.children[--ke].length),new ChildCursor(this.children,Ce,ke)}computeBlockGapDeco(){let Ce=[],ke=this.view.viewState;for(let $n=0,Hn=0;;Hn++){let zn=Hn==ke.viewports.length?null:ke.viewports[Hn],Un=zn?zn.from-1:this.length;if(Un>$n){let qn=(ke.lineBlockAt(Un).bottom-ke.lineBlockAt($n).top)/this.view.scaleY;Ce.push(Decoration.replace({widget:new BlockGapWidget(qn),block:!0,inclusive:!0,isBlockGap:!0}).range($n,Un))}if(!zn)break;$n=zn.to+1}return Decoration.set(Ce)}updateDeco(){let Ce=1,ke=this.view.state.facet(decorations).map(zn=>(this.dynamicDecorationMap[Ce++]=typeof zn=="function")?zn(this.view):zn),$n=!1,Hn=this.view.state.facet(outerDecorations).map((zn,Un)=>{let qn=typeof zn=="function";return qn&&($n=!0),qn?zn(this.view):zn});for(Hn.length&&(this.dynamicDecorationMap[Ce++]=$n,ke.push(RangeSet.join(Hn))),this.decorations=[this.editContextFormatting,...ke,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];Ceke.anchor?-1:1),Hn;if(!$n)return;!ke.empty&&(Hn=this.coordsAt(ke.anchor,ke.anchor>ke.head?-1:1))&&($n={left:Math.min($n.left,Hn.left),top:Math.min($n.top,Hn.top),right:Math.max($n.right,Hn.right),bottom:Math.max($n.bottom,Hn.bottom)});let zn=getScrollMargins(this.view),Un={left:$n.left-zn.left,top:$n.top-zn.top,right:$n.right+zn.right,bottom:$n.bottom+zn.bottom},{offsetWidth:qn,offsetHeight:Xn}=this.view.scrollDOM;scrollRectIntoView(this.view.scrollDOM,Un,ke.head{$nCe.from&&(ke=!0)}),ke}function groupAt(_n,Ce,ke=1){let $n=_n.charCategorizer(Ce),Hn=_n.doc.lineAt(Ce),zn=Ce-Hn.from;if(Hn.length==0)return EditorSelection.cursor(Ce);zn==0?ke=1:zn==Hn.length&&(ke=-1);let Un=zn,qn=zn;ke<0?Un=findClusterBreak(Hn.text,zn,!1):qn=findClusterBreak(Hn.text,zn);let Xn=$n(Hn.text.slice(Un,qn));for(;Un>0;){let Kn=findClusterBreak(Hn.text,Un,!1);if($n(Hn.text.slice(Kn,Un))!=Xn)break;Un=Kn}for(;qn_n?Ce.left-_n:Math.max(0,_n-Ce.right)}function getdy(_n,Ce){return Ce.top>_n?Ce.top-_n:Math.max(0,_n-Ce.bottom)}function yOverlap(_n,Ce){return _n.topCe.top+1}function upTop(_n,Ce){return Ce<_n.top?{top:Ce,left:_n.left,right:_n.right,bottom:_n.bottom}:_n}function upBot(_n,Ce){return Ce>_n.bottom?{top:_n.top,left:_n.left,right:_n.right,bottom:Ce}:_n}function domPosAtCoords(_n,Ce,ke){let $n,Hn,zn,Un,qn=!1,Xn,Kn,to,io;for(let bo=_n.firstChild;bo;bo=bo.nextSibling){let Oo=clientRectsFor(bo);for(let So=0;Soxo||Un==xo&&zn>Do){$n=bo,Hn=$o,zn=Do,Un=xo;let Io=xo?ke<$o.top?-1:1:Do?Ce<$o.left?-1:1:0;qn=!Io||(Io>0?So0)}Do==0?ke>$o.bottom&&(!to||to.bottom<$o.bottom)?(Xn=bo,to=$o):ke<$o.top&&(!io||io.top>$o.top)&&(Kn=bo,io=$o):to&&yOverlap(to,$o)?to=upBot(to,$o.bottom):io&&yOverlap(io,$o)&&(io=upTop(io,$o.top))}}if(to&&to.bottom>=ke?($n=Xn,Hn=to):io&&io.top<=ke&&($n=Kn,Hn=io),!$n)return{node:_n,offset:0};let uo=Math.max(Hn.left,Math.min(Hn.right,Ce));if($n.nodeType==3)return domPosInText($n,uo,ke);if(qn&&$n.contentEditable!="false")return domPosAtCoords($n,uo,ke);let ho=Array.prototype.indexOf.call(_n.childNodes,$n)+(Ce>=(Hn.left+Hn.right)/2?1:0);return{node:_n,offset:ho}}function domPosInText(_n,Ce,ke){let $n=_n.nodeValue.length,Hn=-1,zn=1e9,Un=0;for(let qn=0;qn<$n;qn++){let Xn=textRange(_n,qn,qn+1).getClientRects();for(let Kn=0;Knke?to.top-ke:ke-to.bottom)-1;if(to.left-1<=Ce&&to.right+1>=Ce&&io=(to.left+to.right)/2,ho=uo;if((browser.chrome||browser.gecko)&&textRange(_n,qn).getBoundingClientRect().left==to.right&&(ho=!uo),io<=0)return{node:_n,offset:qn+(ho?1:0)};Hn=qn+(ho?1:0),zn=io}}}return{node:_n,offset:Hn>-1?Hn:Un>0?_n.nodeValue.length:0}}function posAtCoords(_n,Ce,ke,$n=-1){var Hn,zn;let Un=_n.contentDOM.getBoundingClientRect(),qn=Un.top+_n.viewState.paddingTop,Xn,{docHeight:Kn}=_n.viewState,{x:to,y:io}=Ce,uo=io-qn;if(uo<0)return 0;if(uo>Kn)return _n.state.doc.length;for(let Io=_n.viewState.heightOracle.textHeight/2,Vo=!1;Xn=_n.elementAtHeight(uo),Xn.type!=BlockType.Text;)for(;uo=$n>0?Xn.bottom+Io:Xn.top-Io,!(uo>=0&&uo<=Kn);){if(Vo)return ke?null:0;Vo=!0,$n=-$n}io=qn+uo;let ho=Xn.from;if(ho<_n.viewport.from)return _n.viewport.from==0?0:ke?null:posAtCoordsImprecise(_n,Un,Xn,to,io);if(ho>_n.viewport.to)return _n.viewport.to==_n.state.doc.length?_n.state.doc.length:ke?null:posAtCoordsImprecise(_n,Un,Xn,to,io);let bo=_n.dom.ownerDocument,Oo=_n.root.elementFromPoint?_n.root:bo,So=Oo.elementFromPoint(to,io);So&&!_n.contentDOM.contains(So)&&(So=null),So||(to=Math.max(Un.left+1,Math.min(Un.right-1,to)),So=Oo.elementFromPoint(to,io),So&&!_n.contentDOM.contains(So)&&(So=null));let $o,Do=-1;if(So&&((Hn=_n.docView.nearest(So))===null||Hn===void 0?void 0:Hn.isEditable)!=!1){if(bo.caretPositionFromPoint){let Io=bo.caretPositionFromPoint(to,io);Io&&({offsetNode:$o,offset:Do}=Io)}else if(bo.caretRangeFromPoint){let Io=bo.caretRangeFromPoint(to,io);Io&&({startContainer:$o,startOffset:Do}=Io,(!_n.contentDOM.contains($o)||browser.safari&&isSuspiciousSafariCaretResult($o,Do,to)||browser.chrome&&isSuspiciousChromeCaretResult($o,Do,to))&&($o=void 0))}}if(!$o||!_n.docView.dom.contains($o)){let Io=LineView.find(_n.docView,ho);if(!Io)return uo>Xn.top+Xn.height/2?Xn.to:Xn.from;({node:$o,offset:Do}=domPosAtCoords(Io.dom,to,io))}let xo=_n.docView.nearest($o);if(!xo)return null;if(xo.isWidget&&((zn=xo.dom)===null||zn===void 0?void 0:zn.nodeType)==1){let Io=xo.dom.getBoundingClientRect();return Ce.y_n.defaultLineHeight*1.5){let qn=_n.viewState.heightOracle.textHeight,Xn=Math.floor((Hn-ke.top-(_n.defaultLineHeight-qn)*.5)/qn);zn+=Xn*_n.viewState.heightOracle.lineLength}let Un=_n.state.sliceDoc(ke.from,ke.to);return ke.from+findColumn(Un,zn,_n.state.tabSize)}function isSuspiciousSafariCaretResult(_n,Ce,ke){let $n;if(_n.nodeType!=3||Ce!=($n=_n.nodeValue.length))return!1;for(let Hn=_n.nextSibling;Hn;Hn=Hn.nextSibling)if(Hn.nodeType!=1||Hn.nodeName!="BR")return!1;return textRange(_n,$n-1,$n).getBoundingClientRect().left>ke}function isSuspiciousChromeCaretResult(_n,Ce,ke){if(Ce!=0)return!1;for(let Hn=_n;;){let zn=Hn.parentNode;if(!zn||zn.nodeType!=1||zn.firstChild!=Hn)return!1;if(zn.classList.contains("cm-line"))break;Hn=zn}let $n=_n.nodeType==1?_n.getBoundingClientRect():textRange(_n,0,Math.max(_n.nodeValue.length,1)).getBoundingClientRect();return ke-$n.left>5}function blockAt(_n,Ce){let ke=_n.lineBlockAt(Ce);if(Array.isArray(ke.type)){for(let $n of ke.type)if($n.to>Ce||$n.to==Ce&&($n.to==ke.to||$n.type==BlockType.Text))return $n}return ke}function moveToLineBoundary(_n,Ce,ke,$n){let Hn=blockAt(_n,Ce.head),zn=!$n||Hn.type!=BlockType.Text||!(_n.lineWrapping||Hn.widgetLineBreaks)?null:_n.coordsAtPos(Ce.assoc<0&&Ce.head>Hn.from?Ce.head-1:Ce.head);if(zn){let Un=_n.dom.getBoundingClientRect(),qn=_n.textDirectionAt(Hn.from),Xn=_n.posAtCoords({x:ke==(qn==Direction.LTR)?Un.right-1:Un.left+1,y:(zn.top+zn.bottom)/2});if(Xn!=null)return EditorSelection.cursor(Xn,ke?-1:1)}return EditorSelection.cursor(ke?Hn.to:Hn.from,ke?-1:1)}function moveByChar(_n,Ce,ke,$n){let Hn=_n.state.doc.lineAt(Ce.head),zn=_n.bidiSpans(Hn),Un=_n.textDirectionAt(Hn.from);for(let qn=Ce,Xn=null;;){let Kn=moveVisually(Hn,zn,Un,qn,ke),to=movedOver;if(!Kn){if(Hn.number==(ke?_n.state.doc.lines:1))return qn;to=` +`,Hn=_n.state.doc.line(Hn.number+(ke?1:-1)),zn=_n.bidiSpans(Hn),Kn=_n.visualLineSide(Hn,!ke)}if(Xn){if(!Xn(to))return qn}else{if(!$n)return Kn;Xn=$n(to)}qn=Kn}}function byGroup(_n,Ce,ke){let $n=_n.state.charCategorizer(Ce),Hn=$n(ke);return zn=>{let Un=$n(zn);return Hn==CharCategory.Space&&(Hn=Un),Hn==Un}}function moveVertically(_n,Ce,ke,$n){let Hn=Ce.head,zn=ke?1:-1;if(Hn==(ke?_n.state.doc.length:0))return EditorSelection.cursor(Hn,Ce.assoc);let Un=Ce.goalColumn,qn,Xn=_n.contentDOM.getBoundingClientRect(),Kn=_n.coordsAtPos(Hn,Ce.assoc||-1),to=_n.documentTop;if(Kn)Un==null&&(Un=Kn.left-Xn.left),qn=zn<0?Kn.top:Kn.bottom;else{let ho=_n.viewState.lineBlockAt(Hn);Un==null&&(Un=Math.min(Xn.right-Xn.left,_n.defaultCharacterWidth*(Hn-ho.from))),qn=(zn<0?ho.top:ho.bottom)+to}let io=Xn.left+Un,uo=$n??_n.viewState.heightOracle.textHeight>>1;for(let ho=0;;ho+=10){let bo=qn+(uo+ho)*zn,Oo=posAtCoords(_n,{x:io,y:bo},!1,zn);if(boXn.bottom||(zn<0?OoHn)){let So=_n.docView.coordsForChar(Oo),$o=!So||bo{if(Ce>zn&&CeHn(_n)),ke.from,Ce.head>ke.from?-1:1);return $n==ke.from?ke:EditorSelection.cursor($n,$nzn)&&this.lineBreak(),Hn=Un}return this.findPointBefore($n,ke),this}readTextNode(Ce){let ke=Ce.nodeValue;for(let $n of this.points)$n.node==Ce&&($n.pos=this.text.length+Math.min($n.offset,ke.length));for(let $n=0,Hn=this.lineSeparator?null:/\r\n?|\n/g;;){let zn=-1,Un=1,qn;if(this.lineSeparator?(zn=ke.indexOf(this.lineSeparator,$n),Un=this.lineSeparator.length):(qn=Hn.exec(ke))&&(zn=qn.index,Un=qn[0].length),this.append(ke.slice($n,zn<0?ke.length:zn)),zn<0)break;if(this.lineBreak(),Un>1)for(let Xn of this.points)Xn.node==Ce&&Xn.pos>this.text.length&&(Xn.pos-=Un-1);$n=zn+Un}}readNode(Ce){if(Ce.cmIgnore)return;let ke=ContentView.get(Ce),$n=ke&&ke.overrideDOMText;if($n!=null){this.findPointInside(Ce,$n.length);for(let Hn=$n.iter();!Hn.next().done;)Hn.lineBreak?this.lineBreak():this.append(Hn.value)}else Ce.nodeType==3?this.readTextNode(Ce):Ce.nodeName=="BR"?Ce.nextSibling&&this.lineBreak():Ce.nodeType==1&&this.readRange(Ce.firstChild,null)}findPointBefore(Ce,ke){for(let $n of this.points)$n.node==Ce&&Ce.childNodes[$n.offset]==ke&&($n.pos=this.text.length)}findPointInside(Ce,ke){for(let $n of this.points)(Ce.nodeType==3?$n.node==Ce:Ce.contains($n.node))&&($n.pos=this.text.length+(isAtEnd(Ce,$n.node,$n.offset)?ke:0))}}function isAtEnd(_n,Ce,ke){for(;;){if(!Ce||ke-1;let{impreciseHead:zn,impreciseAnchor:Un}=Ce.docView;if(Ce.state.readOnly&&ke>-1)this.newSel=null;else if(ke>-1&&(this.bounds=Ce.docView.domBoundsAround(ke,$n,0))){let qn=zn||Un?[]:selectionPoints(Ce),Xn=new DOMReader(qn,Ce.state);Xn.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=Xn.text,this.newSel=selectionFromPoints(qn,this.bounds.from)}else{let qn=Ce.observer.selectionRange,Xn=zn&&zn.node==qn.focusNode&&zn.offset==qn.focusOffset||!contains(Ce.contentDOM,qn.focusNode)?Ce.state.selection.main.head:Ce.docView.posFromDOM(qn.focusNode,qn.focusOffset),Kn=Un&&Un.node==qn.anchorNode&&Un.offset==qn.anchorOffset||!contains(Ce.contentDOM,qn.anchorNode)?Ce.state.selection.main.anchor:Ce.docView.posFromDOM(qn.anchorNode,qn.anchorOffset),to=Ce.viewport;if((browser.ios||browser.chrome)&&Ce.state.selection.main.empty&&Xn!=Kn&&(to.from>0||to.toDate.now()-100?_n.inputState.lastKeyCode:-1;if(Ce.bounds){let{from:Un,to:qn}=Ce.bounds,Xn=Hn.from,Kn=null;(zn===8||browser.android&&Ce.text.length=Hn.from&&ke.to<=Hn.to&&(ke.from!=Hn.from||ke.to!=Hn.to)&&Hn.to-Hn.from-(ke.to-ke.from)<=4?ke={from:Hn.from,to:Hn.to,insert:_n.state.doc.slice(Hn.from,ke.from).append(ke.insert).append(_n.state.doc.slice(ke.to,Hn.to))}:(browser.mac||browser.android)&&ke&&ke.from==ke.to&&ke.from==Hn.head-1&&/^\. ?$/.test(ke.insert.toString())&&_n.contentDOM.getAttribute("autocorrect")=="off"?($n&&ke.insert.length==2&&($n=EditorSelection.single($n.main.anchor-1,$n.main.head-1)),ke={from:Hn.from,to:Hn.to,insert:Text.of([" "])}):browser.chrome&&ke&&ke.from==ke.to&&ke.from==Hn.head&&ke.insert.toString()==` + `&&_n.lineWrapping&&($n&&($n=EditorSelection.single($n.main.anchor-1,$n.main.head-1)),ke={from:Hn.from,to:Hn.to,insert:Text.of([" "])}),ke)return applyDOMChangeInner(_n,ke,$n,zn);if($n&&!$n.main.eq(Hn)){let Un=!1,qn="select";return _n.inputState.lastSelectionTime>Date.now()-50&&(_n.inputState.lastSelectionOrigin=="select"&&(Un=!0),qn=_n.inputState.lastSelectionOrigin),_n.dispatch({selection:$n,scrollIntoView:Un,userEvent:qn}),!0}else return!1}function applyDOMChangeInner(_n,Ce,ke,$n=-1){if(browser.ios&&_n.inputState.flushIOSKey(Ce))return!0;let Hn=_n.state.selection.main;if(browser.android&&(Ce.to==Hn.to&&(Ce.from==Hn.from||Ce.from==Hn.from-1&&_n.state.sliceDoc(Ce.from,Hn.from)==" ")&&Ce.insert.length==1&&Ce.insert.lines==2&&dispatchKey(_n.contentDOM,"Enter",13)||(Ce.from==Hn.from-1&&Ce.to==Hn.to&&Ce.insert.length==0||$n==8&&Ce.insert.lengthHn.head)&&dispatchKey(_n.contentDOM,"Backspace",8)||Ce.from==Hn.from&&Ce.to==Hn.to+1&&Ce.insert.length==0&&dispatchKey(_n.contentDOM,"Delete",46)))return!0;let zn=Ce.insert.toString();_n.inputState.composing>=0&&_n.inputState.composing++;let Un,qn=()=>Un||(Un=applyDefaultInsert(_n,Ce,ke));return _n.state.facet(inputHandler$1).some(Xn=>Xn(_n,Ce.from,Ce.to,zn,qn))||_n.dispatch(qn()),!0}function applyDefaultInsert(_n,Ce,ke){let $n,Hn=_n.state,zn=Hn.selection.main;if(Ce.from>=zn.from&&Ce.to<=zn.to&&Ce.to-Ce.from>=(zn.to-zn.from)/3&&(!ke||ke.main.empty&&ke.main.from==Ce.from+Ce.insert.length)&&_n.inputState.composing<0){let qn=zn.fromCe.to?Hn.sliceDoc(Ce.to,zn.to):"";$n=Hn.replaceSelection(_n.state.toText(qn+Ce.insert.sliceString(0,void 0,_n.state.lineBreak)+Xn))}else{let qn=Hn.changes(Ce),Xn=ke&&ke.main.to<=qn.newLength?ke.main:void 0;if(Hn.selection.ranges.length>1&&_n.inputState.composing>=0&&Ce.to<=zn.to&&Ce.to>=zn.to-10){let Kn=_n.state.sliceDoc(Ce.from,Ce.to),to,io=ke&&findCompositionNode(_n,ke.main.head);if(io){let bo=Ce.insert.length-(Ce.to-Ce.from);to={from:io.from,to:io.to-bo}}else to=_n.state.doc.lineAt(zn.head);let uo=zn.to-Ce.to,ho=zn.to-zn.from;$n=Hn.changeByRange(bo=>{if(bo.from==zn.from&&bo.to==zn.to)return{changes:qn,range:Xn||bo.map(qn)};let Oo=bo.to-uo,So=Oo-Kn.length;if(bo.to-bo.from!=ho||_n.state.sliceDoc(So,Oo)!=Kn||bo.to>=to.from&&bo.from<=to.to)return{range:bo};let $o=Hn.changes({from:So,to:Oo,insert:Ce.insert}),Do=bo.to-zn.to;return{changes:$o,range:Xn?EditorSelection.range(Math.max(0,Xn.anchor+Do),Math.max(0,Xn.head+Do)):bo.map($o)}})}else $n={changes:qn,selection:Xn&&Hn.selection.replaceRange(Xn)}}let Un="input.type";return(_n.composing||_n.inputState.compositionPendingChange&&_n.inputState.compositionEndedAt>Date.now()-50)&&(_n.inputState.compositionPendingChange=!1,Un+=".compose",_n.inputState.compositionFirstChange&&(Un+=".start",_n.inputState.compositionFirstChange=!1)),Hn.update($n,{userEvent:Un,scrollIntoView:!0})}function findDiff(_n,Ce,ke,$n){let Hn=Math.min(_n.length,Ce.length),zn=0;for(;zn0&&qn>0&&_n.charCodeAt(Un-1)==Ce.charCodeAt(qn-1);)Un--,qn--;if($n=="end"){let Xn=Math.max(0,zn-Math.min(Un,qn));ke-=Un+Xn-zn}if(Un=Un?zn-ke:0;zn-=Xn,qn=zn+(qn-Un),Un=zn}else if(qn=qn?zn-ke:0;zn-=Xn,Un=zn+(Un-qn),qn=zn}return{from:zn,toA:Un,toB:qn}}function selectionPoints(_n){let Ce=[];if(_n.root.activeElement!=_n.contentDOM)return Ce;let{anchorNode:ke,anchorOffset:$n,focusNode:Hn,focusOffset:zn}=_n.observer.selectionRange;return ke&&(Ce.push(new DOMPoint(ke,$n)),(Hn!=ke||zn!=$n)&&Ce.push(new DOMPoint(Hn,zn))),Ce}function selectionFromPoints(_n,Ce){if(_n.length==0)return null;let ke=_n[0].pos,$n=_n.length==2?_n[1].pos:ke;return ke>-1&&$n>-1?EditorSelection.single(ke+Ce,$n+Ce):null}class InputState{setSelectionOrigin(Ce){this.lastSelectionOrigin=Ce,this.lastSelectionTime=Date.now()}constructor(Ce){this.view=Ce,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=Ce.hasFocus,browser.safari&&Ce.contentDOM.addEventListener("input",()=>null),browser.gecko&&firefoxCopyCutHack(Ce.contentDOM.ownerDocument)}handleEvent(Ce){!eventBelongsToEditor(this.view,Ce)||this.ignoreDuringComposition(Ce)||Ce.type=="keydown"&&this.keydown(Ce)||this.runHandlers(Ce.type,Ce)}runHandlers(Ce,ke){let $n=this.handlers[Ce];if($n){for(let Hn of $n.observers)Hn(this.view,ke);for(let Hn of $n.handlers){if(ke.defaultPrevented)break;if(Hn(this.view,ke)){ke.preventDefault();break}}}}ensureHandlers(Ce){let ke=computeHandlers(Ce),$n=this.handlers,Hn=this.view.contentDOM;for(let zn in ke)if(zn!="scroll"){let Un=!ke[zn].handlers.length,qn=$n[zn];qn&&Un!=!qn.handlers.length&&(Hn.removeEventListener(zn,this.handleEvent),qn=null),qn||Hn.addEventListener(zn,this.handleEvent,{passive:Un})}for(let zn in $n)zn!="scroll"&&!ke[zn]&&Hn.removeEventListener(zn,this.handleEvent);this.handlers=ke}keydown(Ce){if(this.lastKeyCode=Ce.keyCode,this.lastKeyTime=Date.now(),Ce.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&Ce.keyCode!=27&&modifierCodes.indexOf(Ce.keyCode)<0&&(this.tabFocusMode=-1),browser.android&&browser.chrome&&!Ce.synthetic&&(Ce.keyCode==13||Ce.keyCode==8))return this.view.observer.delayAndroidKey(Ce.key,Ce.keyCode),!0;let ke;return browser.ios&&!Ce.synthetic&&!Ce.altKey&&!Ce.metaKey&&((ke=PendingKeys.find($n=>$n.keyCode==Ce.keyCode))&&!Ce.ctrlKey||EmacsyPendingKeys.indexOf(Ce.key)>-1&&Ce.ctrlKey&&!Ce.shiftKey)?(this.pendingIOSKey=ke||Ce,setTimeout(()=>this.flushIOSKey(),250),!0):(Ce.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(Ce){let ke=this.pendingIOSKey;return!ke||ke.key=="Enter"&&Ce&&Ce.from0?!0:browser.safari&&!browser.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(Ce){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=Ce}update(Ce){this.view.observer.update(Ce),this.mouseSelection&&this.mouseSelection.update(Ce),this.draggedContent&&Ce.docChanged&&(this.draggedContent=this.draggedContent.map(Ce.changes)),Ce.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function bindHandler(_n,Ce){return(ke,$n)=>{try{return Ce.call(_n,$n,ke)}catch(Hn){logException(ke.state,Hn)}}}function computeHandlers(_n){let Ce=Object.create(null);function ke($n){return Ce[$n]||(Ce[$n]={observers:[],handlers:[]})}for(let $n of _n){let Hn=$n.spec;if(Hn&&Hn.domEventHandlers)for(let zn in Hn.domEventHandlers){let Un=Hn.domEventHandlers[zn];Un&&ke(zn).handlers.push(bindHandler($n.value,Un))}if(Hn&&Hn.domEventObservers)for(let zn in Hn.domEventObservers){let Un=Hn.domEventObservers[zn];Un&&ke(zn).observers.push(bindHandler($n.value,Un))}}for(let $n in handlers)ke($n).handlers.push(handlers[$n]);for(let $n in observers)ke($n).observers.push(observers[$n]);return Ce}const PendingKeys=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],EmacsyPendingKeys="dthko",modifierCodes=[16,17,18,20,91,92,224,225],dragScrollMargin=6;function dragScrollSpeed(_n){return Math.max(0,_n)*.7+8}function dist(_n,Ce){return Math.max(Math.abs(_n.clientX-Ce.clientX),Math.abs(_n.clientY-Ce.clientY))}class MouseSelection{constructor(Ce,ke,$n,Hn){this.view=Ce,this.startEvent=ke,this.style=$n,this.mustSelect=Hn,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=ke,this.scrollParents=scrollableParents(Ce.contentDOM),this.atoms=Ce.state.facet(atomicRanges).map(Un=>Un(Ce));let zn=Ce.contentDOM.ownerDocument;zn.addEventListener("mousemove",this.move=this.move.bind(this)),zn.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=ke.shiftKey,this.multiple=Ce.state.facet(EditorState.allowMultipleSelections)&&addsSelectionRange(Ce,ke),this.dragging=isInPrimarySelection(Ce,ke)&&getClickType(ke)==1?null:!1}start(Ce){this.dragging===!1&&this.select(Ce)}move(Ce){if(Ce.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&dist(this.startEvent,Ce)<10)return;this.select(this.lastEvent=Ce);let ke=0,$n=0,Hn=0,zn=0,Un=this.view.win.innerWidth,qn=this.view.win.innerHeight;this.scrollParents.x&&({left:Hn,right:Un}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:zn,bottom:qn}=this.scrollParents.y.getBoundingClientRect());let Xn=getScrollMargins(this.view);Ce.clientX-Xn.left<=Hn+dragScrollMargin?ke=-dragScrollSpeed(Hn-Ce.clientX):Ce.clientX+Xn.right>=Un-dragScrollMargin&&(ke=dragScrollSpeed(Ce.clientX-Un)),Ce.clientY-Xn.top<=zn+dragScrollMargin?$n=-dragScrollSpeed(zn-Ce.clientY):Ce.clientY+Xn.bottom>=qn-dragScrollMargin&&($n=dragScrollSpeed(Ce.clientY-qn)),this.setScrollSpeed(ke,$n)}up(Ce){this.dragging==null&&this.select(this.lastEvent),this.dragging||Ce.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let Ce=this.view.contentDOM.ownerDocument;Ce.removeEventListener("mousemove",this.move),Ce.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(Ce,ke){this.scrollSpeed={x:Ce,y:ke},Ce||ke?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:Ce,y:ke}=this.scrollSpeed;Ce&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=Ce,Ce=0),ke&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=ke,ke=0),(Ce||ke)&&this.view.win.scrollBy(Ce,ke),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(Ce){let ke=null;for(let $n=0;$nke.isUserEvent("input.type"))?this.destroy():this.style.update(Ce)&&setTimeout(()=>this.select(this.lastEvent),20)}}function addsSelectionRange(_n,Ce){let ke=_n.state.facet(clickAddsSelectionRange);return ke.length?ke[0](Ce):browser.mac?Ce.metaKey:Ce.ctrlKey}function dragMovesSelection(_n,Ce){let ke=_n.state.facet(dragMovesSelection$1);return ke.length?ke[0](Ce):browser.mac?!Ce.altKey:!Ce.ctrlKey}function isInPrimarySelection(_n,Ce){let{main:ke}=_n.state.selection;if(ke.empty)return!1;let $n=getSelection(_n.root);if(!$n||$n.rangeCount==0)return!0;let Hn=$n.getRangeAt(0).getClientRects();for(let zn=0;zn=Ce.clientX&&Un.top<=Ce.clientY&&Un.bottom>=Ce.clientY)return!0}return!1}function eventBelongsToEditor(_n,Ce){if(!Ce.bubbles)return!0;if(Ce.defaultPrevented)return!1;for(let ke=Ce.target,$n;ke!=_n.contentDOM;ke=ke.parentNode)if(!ke||ke.nodeType==11||($n=ContentView.get(ke))&&$n.ignoreEvent(Ce))return!1;return!0}const handlers=Object.create(null),observers=Object.create(null),brokenClipboardAPI=browser.ie&&browser.ie_version<15||browser.ios&&browser.webkit_version<604;function capturePaste(_n){let Ce=_n.dom.parentNode;if(!Ce)return;let ke=Ce.appendChild(document.createElement("textarea"));ke.style.cssText="position: fixed; left: -10000px; top: 10px",ke.focus(),setTimeout(()=>{_n.focus(),ke.remove(),doPaste(_n,ke.value)},50)}function doPaste(_n,Ce){let{state:ke}=_n,$n,Hn=1,zn=ke.toText(Ce),Un=zn.lines==ke.selection.ranges.length;if(lastLinewiseCopy!=null&&ke.selection.ranges.every(Xn=>Xn.empty)&&lastLinewiseCopy==zn.toString()){let Xn=-1;$n=ke.changeByRange(Kn=>{let to=ke.doc.lineAt(Kn.from);if(to.from==Xn)return{range:Kn};Xn=to.from;let io=ke.toText((Un?zn.line(Hn++).text:Ce)+ke.lineBreak);return{changes:{from:to.from,insert:io},range:EditorSelection.cursor(Kn.from+io.length)}})}else Un?$n=ke.changeByRange(Xn=>{let Kn=zn.line(Hn++);return{changes:{from:Xn.from,to:Xn.to,insert:Kn.text},range:EditorSelection.cursor(Xn.from+Kn.length)}}):$n=ke.replaceSelection(zn);_n.dispatch($n,{userEvent:"input.paste",scrollIntoView:!0})}observers.scroll=_n=>{_n.inputState.lastScrollTop=_n.scrollDOM.scrollTop,_n.inputState.lastScrollLeft=_n.scrollDOM.scrollLeft};handlers.keydown=(_n,Ce)=>(_n.inputState.setSelectionOrigin("select"),Ce.keyCode==27&&_n.inputState.tabFocusMode!=0&&(_n.inputState.tabFocusMode=Date.now()+2e3),!1);observers.touchstart=(_n,Ce)=>{_n.inputState.lastTouchTime=Date.now(),_n.inputState.setSelectionOrigin("select.pointer")};observers.touchmove=_n=>{_n.inputState.setSelectionOrigin("select.pointer")};handlers.mousedown=(_n,Ce)=>{if(_n.observer.flush(),_n.inputState.lastTouchTime>Date.now()-2e3)return!1;let ke=null;for(let $n of _n.state.facet(mouseSelectionStyle))if(ke=$n(_n,Ce),ke)break;if(!ke&&Ce.button==0&&(ke=basicMouseSelection(_n,Ce)),ke){let $n=!_n.hasFocus;_n.inputState.startMouseSelection(new MouseSelection(_n,Ce,ke,$n)),$n&&_n.observer.ignore(()=>{focusPreventScroll(_n.contentDOM);let zn=_n.root.activeElement;zn&&!zn.contains(_n.contentDOM)&&zn.blur()});let Hn=_n.inputState.mouseSelection;if(Hn)return Hn.start(Ce),Hn.dragging===!1}return!1};function rangeForClick(_n,Ce,ke,$n){if($n==1)return EditorSelection.cursor(Ce,ke);if($n==2)return groupAt(_n.state,Ce,ke);{let Hn=LineView.find(_n.docView,Ce),zn=_n.state.doc.lineAt(Hn?Hn.posAtEnd:Ce),Un=Hn?Hn.posAtStart:zn.from,qn=Hn?Hn.posAtEnd:zn.to;return qn<_n.state.doc.length&&qn==zn.to&&qn++,EditorSelection.range(Un,qn)}}let inside=(_n,Ce,ke)=>Ce>=ke.top&&Ce<=ke.bottom&&_n>=ke.left&&_n<=ke.right;function findPositionSide(_n,Ce,ke,$n){let Hn=LineView.find(_n.docView,Ce);if(!Hn)return 1;let zn=Ce-Hn.posAtStart;if(zn==0)return 1;if(zn==Hn.length)return-1;let Un=Hn.coordsAt(zn,-1);if(Un&&inside(ke,$n,Un))return-1;let qn=Hn.coordsAt(zn,1);return qn&&inside(ke,$n,qn)?1:Un&&Un.bottom>=$n?-1:1}function queryPos(_n,Ce){let ke=_n.posAtCoords({x:Ce.clientX,y:Ce.clientY},!1);return{pos:ke,bias:findPositionSide(_n,ke,Ce.clientX,Ce.clientY)}}const BadMouseDetail=browser.ie&&browser.ie_version<=11;let lastMouseDown=null,lastMouseDownCount=0,lastMouseDownTime=0;function getClickType(_n){if(!BadMouseDetail)return _n.detail;let Ce=lastMouseDown,ke=lastMouseDownTime;return lastMouseDown=_n,lastMouseDownTime=Date.now(),lastMouseDownCount=!Ce||ke>Date.now()-400&&Math.abs(Ce.clientX-_n.clientX)<2&&Math.abs(Ce.clientY-_n.clientY)<2?(lastMouseDownCount+1)%3:1}function basicMouseSelection(_n,Ce){let ke=queryPos(_n,Ce),$n=getClickType(Ce),Hn=_n.state.selection;return{update(zn){zn.docChanged&&(ke.pos=zn.changes.mapPos(ke.pos),Hn=Hn.map(zn.changes))},get(zn,Un,qn){let Xn=queryPos(_n,zn),Kn,to=rangeForClick(_n,Xn.pos,Xn.bias,$n);if(ke.pos!=Xn.pos&&!Un){let io=rangeForClick(_n,ke.pos,ke.bias,$n),uo=Math.min(io.from,to.from),ho=Math.max(io.to,to.to);to=uo1&&(Kn=removeRangeAround(Hn,Xn.pos))?Kn:qn?Hn.addRange(to):EditorSelection.create([to])}}}function removeRangeAround(_n,Ce){for(let ke=0;ke<_n.ranges.length;ke++){let{from:$n,to:Hn}=_n.ranges[ke];if($n<=Ce&&Hn>=Ce)return EditorSelection.create(_n.ranges.slice(0,ke).concat(_n.ranges.slice(ke+1)),_n.mainIndex==ke?0:_n.mainIndex-(_n.mainIndex>ke?1:0))}return null}handlers.dragstart=(_n,Ce)=>{let{selection:{main:ke}}=_n.state;if(Ce.target.draggable){let Hn=_n.docView.nearest(Ce.target);if(Hn&&Hn.isWidget){let zn=Hn.posAtStart,Un=zn+Hn.length;(zn>=ke.to||Un<=ke.from)&&(ke=EditorSelection.range(zn,Un))}}let{inputState:$n}=_n;return $n.mouseSelection&&($n.mouseSelection.dragging=!0),$n.draggedContent=ke,Ce.dataTransfer&&(Ce.dataTransfer.setData("Text",_n.state.sliceDoc(ke.from,ke.to)),Ce.dataTransfer.effectAllowed="copyMove"),!1};handlers.dragend=_n=>(_n.inputState.draggedContent=null,!1);function dropText(_n,Ce,ke,$n){if(!ke)return;let Hn=_n.posAtCoords({x:Ce.clientX,y:Ce.clientY},!1),{draggedContent:zn}=_n.inputState,Un=$n&&zn&&dragMovesSelection(_n,Ce)?{from:zn.from,to:zn.to}:null,qn={from:Hn,insert:ke},Xn=_n.state.changes(Un?[Un,qn]:qn);_n.focus(),_n.dispatch({changes:Xn,selection:{anchor:Xn.mapPos(Hn,-1),head:Xn.mapPos(Hn,1)},userEvent:Un?"move.drop":"input.drop"}),_n.inputState.draggedContent=null}handlers.drop=(_n,Ce)=>{if(!Ce.dataTransfer)return!1;if(_n.state.readOnly)return!0;let ke=Ce.dataTransfer.files;if(ke&&ke.length){let $n=Array(ke.length),Hn=0,zn=()=>{++Hn==ke.length&&dropText(_n,Ce,$n.filter(Un=>Un!=null).join(_n.state.lineBreak),!1)};for(let Un=0;Un{/[\x00-\x08\x0e-\x1f]{2}/.test(qn.result)||($n[Un]=qn.result),zn()},qn.readAsText(ke[Un])}return!0}else{let $n=Ce.dataTransfer.getData("Text");if($n)return dropText(_n,Ce,$n,!0),!0}return!1};handlers.paste=(_n,Ce)=>{if(_n.state.readOnly)return!0;_n.observer.flush();let ke=brokenClipboardAPI?null:Ce.clipboardData;return ke?(doPaste(_n,ke.getData("text/plain")||ke.getData("text/uri-list")),!0):(capturePaste(_n),!1)};function captureCopy(_n,Ce){let ke=_n.dom.parentNode;if(!ke)return;let $n=ke.appendChild(document.createElement("textarea"));$n.style.cssText="position: fixed; left: -10000px; top: 10px",$n.value=Ce,$n.focus(),$n.selectionEnd=Ce.length,$n.selectionStart=0,setTimeout(()=>{$n.remove(),_n.focus()},50)}function copiedRange(_n){let Ce=[],ke=[],$n=!1;for(let Hn of _n.selection.ranges)Hn.empty||(Ce.push(_n.sliceDoc(Hn.from,Hn.to)),ke.push(Hn));if(!Ce.length){let Hn=-1;for(let{from:zn}of _n.selection.ranges){let Un=_n.doc.lineAt(zn);Un.number>Hn&&(Ce.push(Un.text),ke.push({from:Un.from,to:Math.min(_n.doc.length,Un.to+1)})),Hn=Un.number}$n=!0}return{text:Ce.join(_n.lineBreak),ranges:ke,linewise:$n}}let lastLinewiseCopy=null;handlers.copy=handlers.cut=(_n,Ce)=>{let{text:ke,ranges:$n,linewise:Hn}=copiedRange(_n.state);if(!ke&&!Hn)return!1;lastLinewiseCopy=Hn?ke:null,Ce.type=="cut"&&!_n.state.readOnly&&_n.dispatch({changes:$n,scrollIntoView:!0,userEvent:"delete.cut"});let zn=brokenClipboardAPI?null:Ce.clipboardData;return zn?(zn.clearData(),zn.setData("text/plain",ke),!0):(captureCopy(_n,ke),!1)};const isFocusChange=Annotation.define();function focusChangeTransaction(_n,Ce){let ke=[];for(let $n of _n.facet(focusChangeEffect)){let Hn=$n(_n,Ce);Hn&&ke.push(Hn)}return ke?_n.update({effects:ke,annotations:isFocusChange.of(!0)}):null}function updateForFocusChange(_n){setTimeout(()=>{let Ce=_n.hasFocus;if(Ce!=_n.inputState.notifiedFocused){let ke=focusChangeTransaction(_n.state,Ce);ke?_n.dispatch(ke):_n.update([])}},10)}observers.focus=_n=>{_n.inputState.lastFocusTime=Date.now(),!_n.scrollDOM.scrollTop&&(_n.inputState.lastScrollTop||_n.inputState.lastScrollLeft)&&(_n.scrollDOM.scrollTop=_n.inputState.lastScrollTop,_n.scrollDOM.scrollLeft=_n.inputState.lastScrollLeft),updateForFocusChange(_n)};observers.blur=_n=>{_n.observer.clearSelectionRange(),updateForFocusChange(_n)};observers.compositionstart=observers.compositionupdate=_n=>{_n.observer.editContext||(_n.inputState.compositionFirstChange==null&&(_n.inputState.compositionFirstChange=!0),_n.inputState.composing<0&&(_n.inputState.composing=0))};observers.compositionend=_n=>{_n.observer.editContext||(_n.inputState.composing=-1,_n.inputState.compositionEndedAt=Date.now(),_n.inputState.compositionPendingKey=!0,_n.inputState.compositionPendingChange=_n.observer.pendingRecords().length>0,_n.inputState.compositionFirstChange=null,browser.chrome&&browser.android?_n.observer.flushSoon():_n.inputState.compositionPendingChange?Promise.resolve().then(()=>_n.observer.flush()):setTimeout(()=>{_n.inputState.composing<0&&_n.docView.hasComposition&&_n.update([])},50))};observers.contextmenu=_n=>{_n.inputState.lastContextMenu=Date.now()};handlers.beforeinput=(_n,Ce)=>{var ke,$n;if(Ce.inputType=="insertReplacementText"&&_n.observer.editContext){let zn=(ke=Ce.dataTransfer)===null||ke===void 0?void 0:ke.getData("text/plain"),Un=Ce.getTargetRanges();if(zn&&Un.length){let qn=Un[0],Xn=_n.posAtDOM(qn.startContainer,qn.startOffset),Kn=_n.posAtDOM(qn.endContainer,qn.endOffset);return applyDOMChangeInner(_n,{from:Xn,to:Kn,insert:_n.state.toText(zn)},null),!0}}let Hn;if(browser.chrome&&browser.android&&(Hn=PendingKeys.find(zn=>zn.inputType==Ce.inputType))&&(_n.observer.delayAndroidKey(Hn.key,Hn.keyCode),Hn.key=="Backspace"||Hn.key=="Delete")){let zn=(($n=window.visualViewport)===null||$n===void 0?void 0:$n.height)||0;setTimeout(()=>{var Un;(((Un=window.visualViewport)===null||Un===void 0?void 0:Un.height)||0)>zn+10&&_n.hasFocus&&(_n.contentDOM.blur(),_n.focus())},100)}return browser.ios&&Ce.inputType=="deleteContentForward"&&_n.observer.flushSoon(),browser.safari&&Ce.inputType=="insertText"&&_n.inputState.composing>=0&&setTimeout(()=>observers.compositionend(_n,Ce),20),!1};const appliedFirefoxHack=new Set;function firefoxCopyCutHack(_n){appliedFirefoxHack.has(_n)||(appliedFirefoxHack.add(_n),_n.addEventListener("copy",()=>{}),_n.addEventListener("cut",()=>{}))}const wrappingWhiteSpace=["pre-wrap","normal","pre-line","break-spaces"];let heightChangeFlag=!1;function clearHeightChangeFlag(){heightChangeFlag=!1}class HeightOracle{constructor(Ce){this.lineWrapping=Ce,this.doc=Text.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(Ce,ke){let $n=this.doc.lineAt(ke).number-this.doc.lineAt(Ce).number+1;return this.lineWrapping&&($n+=Math.max(0,Math.ceil((ke-Ce-$n*this.lineLength*.5)/this.lineLength))),this.lineHeight*$n}heightForLine(Ce){return this.lineWrapping?(1+Math.max(0,Math.ceil((Ce-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(Ce){return this.doc=Ce,this}mustRefreshForWrapping(Ce){return wrappingWhiteSpace.indexOf(Ce)>-1!=this.lineWrapping}mustRefreshForHeights(Ce){let ke=!1;for(let $n=0;$n-1,Xn=Math.round(ke)!=Math.round(this.lineHeight)||this.lineWrapping!=qn;if(this.lineWrapping=qn,this.lineHeight=ke,this.charWidth=$n,this.textHeight=Hn,this.lineLength=zn,Xn){this.heightSamples={};for(let Kn=0;Kn0}set outdated(Ce){this.flags=(Ce?2:0)|this.flags&-3}setHeight(Ce){this.height!=Ce&&(Math.abs(this.height-Ce)>Epsilon&&(heightChangeFlag=!0),this.height=Ce)}replace(Ce,ke,$n){return HeightMap.of($n)}decomposeLeft(Ce,ke){ke.push(this)}decomposeRight(Ce,ke){ke.push(this)}applyChanges(Ce,ke,$n,Hn){let zn=this,Un=$n.doc;for(let qn=Hn.length-1;qn>=0;qn--){let{fromA:Xn,toA:Kn,fromB:to,toB:io}=Hn[qn],uo=zn.lineAt(Xn,QueryType$1.ByPosNoHeight,$n.setDoc(ke),0,0),ho=uo.to>=Kn?uo:zn.lineAt(Kn,QueryType$1.ByPosNoHeight,$n,0,0);for(io+=ho.to-Kn,Kn=ho.to;qn>0&&uo.from<=Hn[qn-1].toA;)Xn=Hn[qn-1].fromA,to=Hn[qn-1].fromB,qn--,Xnzn*2){let qn=Ce[ke-1];qn.break?Ce.splice(--ke,1,qn.left,null,qn.right):Ce.splice(--ke,1,qn.left,qn.right),$n+=1+qn.break,Hn-=qn.size}else if(zn>Hn*2){let qn=Ce[$n];qn.break?Ce.splice($n,1,qn.left,null,qn.right):Ce.splice($n,1,qn.left,qn.right),$n+=2+qn.break,zn-=qn.size}else break;else if(Hn=zn&&Un(this.blockAt(0,$n,Hn,zn))}updateHeight(Ce,ke=0,$n=!1,Hn){return Hn&&Hn.from<=ke&&Hn.more&&this.setHeight(Hn.heights[Hn.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class HeightMapText extends HeightMapBlock{constructor(Ce,ke){super(Ce,ke,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(Ce,ke,$n,Hn){return new BlockInfo(Hn,this.length,$n,this.height,this.breaks)}replace(Ce,ke,$n){let Hn=$n[0];return $n.length==1&&(Hn instanceof HeightMapText||Hn instanceof HeightMapGap&&Hn.flags&4)&&Math.abs(this.length-Hn.length)<10?(Hn instanceof HeightMapGap?Hn=new HeightMapText(Hn.length,this.height):Hn.height=this.height,this.outdated||(Hn.outdated=!1),Hn):HeightMap.of($n)}updateHeight(Ce,ke=0,$n=!1,Hn){return Hn&&Hn.from<=ke&&Hn.more?this.setHeight(Hn.heights[Hn.index++]):($n||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,Ce.heightForLine(this.length-this.collapsed))+this.breaks*Ce.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class HeightMapGap extends HeightMap{constructor(Ce){super(Ce,0)}heightMetrics(Ce,ke){let $n=Ce.doc.lineAt(ke).number,Hn=Ce.doc.lineAt(ke+this.length).number,zn=Hn-$n+1,Un,qn=0;if(Ce.lineWrapping){let Xn=Math.min(this.height,Ce.lineHeight*zn);Un=Xn/zn,this.length>zn+1&&(qn=(this.height-Xn)/(this.length-zn-1))}else Un=this.height/zn;return{firstLine:$n,lastLine:Hn,perLine:Un,perChar:qn}}blockAt(Ce,ke,$n,Hn){let{firstLine:zn,lastLine:Un,perLine:qn,perChar:Xn}=this.heightMetrics(ke,Hn);if(ke.lineWrapping){let Kn=Hn+(Ce0){let zn=$n[$n.length-1];zn instanceof HeightMapGap?$n[$n.length-1]=new HeightMapGap(zn.length+Hn):$n.push(null,new HeightMapGap(Hn-1))}if(Ce>0){let zn=$n[0];zn instanceof HeightMapGap?$n[0]=new HeightMapGap(Ce+zn.length):$n.unshift(new HeightMapGap(Ce-1),null)}return HeightMap.of($n)}decomposeLeft(Ce,ke){ke.push(new HeightMapGap(Ce-1),null)}decomposeRight(Ce,ke){ke.push(null,new HeightMapGap(this.length-Ce-1))}updateHeight(Ce,ke=0,$n=!1,Hn){let zn=ke+this.length;if(Hn&&Hn.from<=ke+this.length&&Hn.more){let Un=[],qn=Math.max(ke,Hn.from),Xn=-1;for(Hn.from>ke&&Un.push(new HeightMapGap(Hn.from-ke-1).updateHeight(Ce,ke));qn<=zn&&Hn.more;){let to=Ce.doc.lineAt(qn).length;Un.length&&Un.push(null);let io=Hn.heights[Hn.index++];Xn==-1?Xn=io:Math.abs(io-Xn)>=Epsilon&&(Xn=-2);let uo=new HeightMapText(to,io);uo.outdated=!1,Un.push(uo),qn+=to+1}qn<=zn&&Un.push(null,new HeightMapGap(zn-qn).updateHeight(Ce,qn));let Kn=HeightMap.of(Un);return(Xn<0||Math.abs(Kn.height-this.height)>=Epsilon||Math.abs(Xn-this.heightMetrics(Ce,ke).perLine)>=Epsilon)&&(heightChangeFlag=!0),replace(this,Kn)}else($n||this.outdated)&&(this.setHeight(Ce.heightForGap(ke,ke+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class HeightMapBranch extends HeightMap{constructor(Ce,ke,$n){super(Ce.length+ke+$n.length,Ce.height+$n.height,ke|(Ce.outdated||$n.outdated?2:0)),this.left=Ce,this.right=$n,this.size=Ce.size+$n.size}get break(){return this.flags&1}blockAt(Ce,ke,$n,Hn){let zn=$n+this.left.height;return Ceqn))return Kn;let to=ke==QueryType$1.ByPosNoHeight?QueryType$1.ByPosNoHeight:QueryType$1.ByPos;return Xn?Kn.join(this.right.lineAt(qn,to,$n,Un,qn)):this.left.lineAt(qn,to,$n,Hn,zn).join(Kn)}forEachLine(Ce,ke,$n,Hn,zn,Un){let qn=Hn+this.left.height,Xn=zn+this.left.length+this.break;if(this.break)Ce=Xn&&this.right.forEachLine(Ce,ke,$n,qn,Xn,Un);else{let Kn=this.lineAt(Xn,QueryType$1.ByPos,$n,Hn,zn);Ce=Ce&&Kn.from<=ke&&Un(Kn),ke>Kn.to&&this.right.forEachLine(Kn.to+1,ke,$n,qn,Xn,Un)}}replace(Ce,ke,$n){let Hn=this.left.length+this.break;if(kethis.left.length)return this.balanced(this.left,this.right.replace(Ce-Hn,ke-Hn,$n));let zn=[];Ce>0&&this.decomposeLeft(Ce,zn);let Un=zn.length;for(let qn of $n)zn.push(qn);if(Ce>0&&mergeGaps(zn,Un-1),ke=$n&&ke.push(null)),Ce>$n&&this.right.decomposeLeft(Ce-$n,ke)}decomposeRight(Ce,ke){let $n=this.left.length,Hn=$n+this.break;if(Ce>=Hn)return this.right.decomposeRight(Ce-Hn,ke);Ce<$n&&this.left.decomposeRight(Ce,ke),this.break&&Ce2*ke.size||ke.size>2*Ce.size?HeightMap.of(this.break?[Ce,null,ke]:[Ce,ke]):(this.left=replace(this.left,Ce),this.right=replace(this.right,ke),this.setHeight(Ce.height+ke.height),this.outdated=Ce.outdated||ke.outdated,this.size=Ce.size+ke.size,this.length=Ce.length+this.break+ke.length,this)}updateHeight(Ce,ke=0,$n=!1,Hn){let{left:zn,right:Un}=this,qn=ke+zn.length+this.break,Xn=null;return Hn&&Hn.from<=ke+zn.length&&Hn.more?Xn=zn=zn.updateHeight(Ce,ke,$n,Hn):zn.updateHeight(Ce,ke,$n),Hn&&Hn.from<=qn+Un.length&&Hn.more?Xn=Un=Un.updateHeight(Ce,qn,$n,Hn):Un.updateHeight(Ce,qn,$n),Xn?this.balanced(zn,Un):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function mergeGaps(_n,Ce){let ke,$n;_n[Ce]==null&&(ke=_n[Ce-1])instanceof HeightMapGap&&($n=_n[Ce+1])instanceof HeightMapGap&&_n.splice(Ce-1,3,new HeightMapGap(ke.length+1+$n.length))}const relevantWidgetHeight=5;class NodeBuilder{constructor(Ce,ke){this.pos=Ce,this.oracle=ke,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=Ce}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(Ce,ke){if(this.lineStart>-1){let $n=Math.min(ke,this.lineEnd),Hn=this.nodes[this.nodes.length-1];Hn instanceof HeightMapText?Hn.length+=$n-this.pos:($n>this.pos||!this.isCovered)&&this.nodes.push(new HeightMapText($n-this.pos,-1)),this.writtenTo=$n,ke>$n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=ke}point(Ce,ke,$n){if(Ce=relevantWidgetHeight)&&this.addLineDeco(Hn,zn,Un)}else ke>Ce&&this.span(Ce,ke);this.lineEnd>-1&&this.lineEnd-1)return;let{from:Ce,to:ke}=this.oracle.doc.lineAt(this.pos);this.lineStart=Ce,this.lineEnd=ke,this.writtenToCe&&this.nodes.push(new HeightMapText(this.pos-Ce,-1)),this.writtenTo=this.pos}blankContent(Ce,ke){let $n=new HeightMapGap(ke-Ce);return this.oracle.doc.lineAt(Ce).to==ke&&($n.flags|=4),$n}ensureLine(){this.enterLine();let Ce=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(Ce instanceof HeightMapText)return Ce;let ke=new HeightMapText(0,-1);return this.nodes.push(ke),ke}addBlock(Ce){this.enterLine();let ke=Ce.deco;ke&&ke.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(Ce),this.writtenTo=this.pos=this.pos+Ce.length,ke&&ke.endSide>0&&(this.covering=Ce)}addLineDeco(Ce,ke,$n){let Hn=this.ensureLine();Hn.length+=$n,Hn.collapsed+=$n,Hn.widgetHeight=Math.max(Hn.widgetHeight,Ce),Hn.breaks+=ke,this.writtenTo=this.pos=this.pos+$n}finish(Ce){let ke=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(ke instanceof HeightMapText)&&!this.isCovered?this.nodes.push(new HeightMapText(0,-1)):(this.writtenToto.clientHeight||to.scrollWidth>to.clientWidth)&&io.overflow!="visible"){let uo=to.getBoundingClientRect();zn=Math.max(zn,uo.left),Un=Math.min(Un,uo.right),qn=Math.max(qn,uo.top),Xn=Math.min(Kn==_n.parentNode?Hn.innerHeight:Xn,uo.bottom)}Kn=io.position=="absolute"||io.position=="fixed"?to.offsetParent:to.parentNode}else if(Kn.nodeType==11)Kn=Kn.host;else break;return{left:zn-ke.left,right:Math.max(zn,Un)-ke.left,top:qn-(ke.top+Ce),bottom:Math.max(qn,Xn)-(ke.top+Ce)}}function fullPixelRange(_n,Ce){let ke=_n.getBoundingClientRect();return{left:0,right:ke.right-ke.left,top:Ce,bottom:ke.bottom-(ke.top+Ce)}}class LineGap{constructor(Ce,ke,$n){this.from=Ce,this.to=ke,this.size=$n}static same(Ce,ke){if(Ce.length!=ke.length)return!1;for(let $n=0;$ntypeof $n!="function"&&$n.class=="cm-lineWrapping");this.heightOracle=new HeightOracle(ke),this.stateDeco=Ce.facet(decorations).filter($n=>typeof $n!="function"),this.heightMap=HeightMap.empty().applyChanges(this.stateDeco,Text.empty,this.heightOracle.setDoc(Ce.doc),[new ChangedRange(0,0,0,Ce.doc.length)]);for(let $n=0;$n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());$n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Decoration.set(this.lineGaps.map($n=>$n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let Ce=[this.viewport],{main:ke}=this.state.selection;for(let $n=0;$n<=1;$n++){let Hn=$n?ke.head:ke.anchor;if(!Ce.some(({from:zn,to:Un})=>Hn>=zn&&Hn<=Un)){let{from:zn,to:Un}=this.lineBlockAt(Hn);Ce.push(new Viewport(zn,Un))}}return this.viewports=Ce.sort(($n,Hn)=>$n.from-Hn.from),this.updateScaler()}updateScaler(){let Ce=this.scaler;return this.scaler=this.heightMap.height<=7e6?IdScaler:new BigScaler(this.heightOracle,this.heightMap,this.viewports),Ce.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,Ce=>{this.viewportLines.push(scaleBlock(Ce,this.scaler))})}update(Ce,ke=null){this.state=Ce.state;let $n=this.stateDeco;this.stateDeco=this.state.facet(decorations).filter(to=>typeof to!="function");let Hn=Ce.changedRanges,zn=ChangedRange.extendWithRanges(Hn,heightRelevantDecoChanges($n,this.stateDeco,Ce?Ce.changes:ChangeSet.empty(this.state.doc.length))),Un=this.heightMap.height,qn=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);clearHeightChangeFlag(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,Ce.startState.doc,this.heightOracle.setDoc(this.state.doc),zn),(this.heightMap.height!=Un||heightChangeFlag)&&(Ce.flags|=2),qn?(this.scrollAnchorPos=Ce.changes.mapPos(qn.from,-1),this.scrollAnchorHeight=qn.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let Xn=zn.length?this.mapViewport(this.viewport,Ce.changes):this.viewport;(ke&&(ke.range.headXn.to)||!this.viewportIsAppropriate(Xn))&&(Xn=this.getViewport(0,ke));let Kn=Xn.from!=this.viewport.from||Xn.to!=this.viewport.to;this.viewport=Xn,Ce.flags|=this.updateForViewport(),(Kn||!Ce.changes.empty||Ce.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,Ce.changes))),Ce.flags|=this.computeVisibleRanges(),ke&&(this.scrollTarget=ke),!this.mustEnforceCursorAssoc&&Ce.selectionSet&&Ce.view.lineWrapping&&Ce.state.selection.main.empty&&Ce.state.selection.main.assoc&&!Ce.state.facet(nativeSelectionHidden)&&(this.mustEnforceCursorAssoc=!0)}measure(Ce){let ke=Ce.contentDOM,$n=window.getComputedStyle(ke),Hn=this.heightOracle,zn=$n.whiteSpace;this.defaultTextDirection=$n.direction=="rtl"?Direction.RTL:Direction.LTR;let Un=this.heightOracle.mustRefreshForWrapping(zn),qn=ke.getBoundingClientRect(),Xn=Un||this.mustMeasureContent||this.contentDOMHeight!=qn.height;this.contentDOMHeight=qn.height,this.mustMeasureContent=!1;let Kn=0,to=0;if(qn.width&&qn.height){let{scaleX:Io,scaleY:Vo}=getScale(ke,qn);(Io>.005&&Math.abs(this.scaleX-Io)>.005||Vo>.005&&Math.abs(this.scaleY-Vo)>.005)&&(this.scaleX=Io,this.scaleY=Vo,Kn|=8,Un=Xn=!0)}let io=(parseInt($n.paddingTop)||0)*this.scaleY,uo=(parseInt($n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=io||this.paddingBottom!=uo)&&(this.paddingTop=io,this.paddingBottom=uo,Kn|=10),this.editorWidth!=Ce.scrollDOM.clientWidth&&(Hn.lineWrapping&&(Xn=!0),this.editorWidth=Ce.scrollDOM.clientWidth,Kn|=8);let ho=Ce.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=ho&&(this.scrollAnchorHeight=-1,this.scrollTop=ho),this.scrolledToBottom=isScrolledToBottom(Ce.scrollDOM);let bo=(this.printing?fullPixelRange:visiblePixelRange)(ke,this.paddingTop),Oo=bo.top-this.pixelViewport.top,So=bo.bottom-this.pixelViewport.bottom;this.pixelViewport=bo;let $o=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if($o!=this.inView&&(this.inView=$o,$o&&(Xn=!0)),!this.inView&&!this.scrollTarget)return 0;let Do=qn.width;if((this.contentDOMWidth!=Do||this.editorHeight!=Ce.scrollDOM.clientHeight)&&(this.contentDOMWidth=qn.width,this.editorHeight=Ce.scrollDOM.clientHeight,Kn|=8),Xn){let Io=Ce.docView.measureVisibleLineHeights(this.viewport);if(Hn.mustRefreshForHeights(Io)&&(Un=!0),Un||Hn.lineWrapping&&Math.abs(Do-this.contentDOMWidth)>Hn.charWidth){let{lineHeight:Vo,charWidth:Jo,textHeight:Mo}=Ce.docView.measureTextSize();Un=Vo>0&&Hn.refresh(zn,Vo,Jo,Mo,Do/Jo,Io),Un&&(Ce.docView.minWidth=0,Kn|=8)}Oo>0&&So>0?to=Math.max(Oo,So):Oo<0&&So<0&&(to=Math.min(Oo,So)),clearHeightChangeFlag();for(let Vo of this.viewports){let Jo=Vo.from==this.viewport.from?Io:Ce.docView.measureVisibleLineHeights(Vo);this.heightMap=(Un?HeightMap.empty().applyChanges(this.stateDeco,Text.empty,this.heightOracle,[new ChangedRange(0,0,0,Ce.state.doc.length)]):this.heightMap).updateHeight(Hn,0,Un,new MeasuredHeights(Vo.from,Jo))}heightChangeFlag&&(Kn|=2)}let xo=!this.viewportIsAppropriate(this.viewport,to)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return xo&&(Kn&2&&(Kn|=this.updateScaler()),this.viewport=this.getViewport(to,this.scrollTarget),Kn|=this.updateForViewport()),(Kn&2||xo)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(Un?[]:this.lineGaps,Ce)),Kn|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,Ce.docView.enforceCursorAssoc()),Kn}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(Ce,ke){let $n=.5-Math.max(-.5,Math.min(.5,Ce/1e3/2)),Hn=this.heightMap,zn=this.heightOracle,{visibleTop:Un,visibleBottom:qn}=this,Xn=new Viewport(Hn.lineAt(Un-$n*1e3,QueryType$1.ByHeight,zn,0,0).from,Hn.lineAt(qn+(1-$n)*1e3,QueryType$1.ByHeight,zn,0,0).to);if(ke){let{head:Kn}=ke.range;if(KnXn.to){let to=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),io=Hn.lineAt(Kn,QueryType$1.ByPos,zn,0,0),uo;ke.y=="center"?uo=(io.top+io.bottom)/2-to/2:ke.y=="start"||ke.y=="nearest"&&Kn=qn+Math.max(10,Math.min($n,250)))&&Hn>Un-2*1e3&&zn>1,Un=Hn<<1;if(this.defaultTextDirection!=Direction.LTR&&!$n)return[];let qn=[],Xn=(to,io,uo,ho)=>{if(io-toto&&$o$o.from>=uo.from&&$o.to<=uo.to&&Math.abs($o.from-to)$o.fromDo));if(!So){if(io$o.from<=io&&$o.to>=io)){let $o=ke.moveToLineBoundary(EditorSelection.cursor(io),!1,!0).head;$o>to&&(io=$o)}So=new LineGap(to,io,this.gapSize(uo,to,io,ho))}qn.push(So)},Kn=to=>{if(to.lengthto.from&&Xn(to.from,ho,to,io),boke.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let Ce=this.stateDeco;this.lineGaps.length&&(Ce=Ce.concat(this.lineGapDeco));let ke=[];RangeSet.spans(Ce,this.viewport.from,this.viewport.to,{span(Hn,zn){ke.push({from:Hn,to:zn})},point(){}},20);let $n=ke.length!=this.visibleRanges.length||this.visibleRanges.some((Hn,zn)=>Hn.from!=ke[zn].from||Hn.to!=ke[zn].to);return this.visibleRanges=ke,$n?4:0}lineBlockAt(Ce){return Ce>=this.viewport.from&&Ce<=this.viewport.to&&this.viewportLines.find(ke=>ke.from<=Ce&&ke.to>=Ce)||scaleBlock(this.heightMap.lineAt(Ce,QueryType$1.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(Ce){return Ce>=this.viewportLines[0].top&&Ce<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(ke=>ke.top<=Ce&&ke.bottom>=Ce)||scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(Ce),QueryType$1.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(Ce){let ke=this.lineBlockAtHeight(Ce+8);return ke.from>=this.viewport.from||this.viewportLines[0].top-Ce>200?ke:this.viewportLines[0]}elementAtHeight(Ce){return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(Ce),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Viewport{constructor(Ce,ke){this.from=Ce,this.to=ke}}function lineStructure(_n,Ce,ke){let $n=[],Hn=_n,zn=0;return RangeSet.spans(ke,_n,Ce,{span(){},point(Un,qn){Un>Hn&&($n.push({from:Hn,to:Un}),zn+=Un-Hn),Hn=qn}},20),Hn=1)return Ce[Ce.length-1].to;let $n=Math.floor(_n*ke);for(let Hn=0;;Hn++){let{from:zn,to:Un}=Ce[Hn],qn=Un-zn;if($n<=qn)return zn+$n;$n-=qn}}function findFraction(_n,Ce){let ke=0;for(let{from:$n,to:Hn}of _n.ranges){if(Ce<=Hn){ke+=Ce-$n;break}ke+=Hn-$n}return ke/_n.total}function find(_n,Ce){for(let ke of _n)if(Ce(ke))return ke}const IdScaler={toDOM(_n){return _n},fromDOM(_n){return _n},scale:1,eq(_n){return _n==this}};class BigScaler{constructor(Ce,ke,$n){let Hn=0,zn=0,Un=0;this.viewports=$n.map(({from:qn,to:Xn})=>{let Kn=ke.lineAt(qn,QueryType$1.ByPos,Ce,0,0).top,to=ke.lineAt(Xn,QueryType$1.ByPos,Ce,0,0).bottom;return Hn+=to-Kn,{from:qn,to:Xn,top:Kn,bottom:to,domTop:0,domBottom:0}}),this.scale=(7e6-Hn)/(ke.height-Hn);for(let qn of this.viewports)qn.domTop=Un+(qn.top-zn)*this.scale,Un=qn.domBottom=qn.domTop+(qn.bottom-qn.top),zn=qn.bottom}toDOM(Ce){for(let ke=0,$n=0,Hn=0;;ke++){let zn=keke.from==Ce.viewports[$n].from&&ke.to==Ce.viewports[$n].to):!1}}function scaleBlock(_n,Ce){if(Ce.scale==1)return _n;let ke=Ce.toDOM(_n.top),$n=Ce.toDOM(_n.bottom);return new BlockInfo(_n.from,_n.length,ke,$n-ke,Array.isArray(_n._content)?_n._content.map(Hn=>scaleBlock(Hn,Ce)):_n._content)}const theme=Facet.define({combine:_n=>_n.join(" ")}),darkTheme=Facet.define({combine:_n=>_n.indexOf(!0)>-1}),baseThemeID=StyleModule.newName(),baseLightID=StyleModule.newName(),baseDarkID=StyleModule.newName(),lightDarkIDs={"&light":"."+baseLightID,"&dark":"."+baseDarkID};function buildTheme(_n,Ce,ke){return new StyleModule(Ce,{finish($n){return/&/.test($n)?$n.replace(/&\w*/,Hn=>{if(Hn=="&")return _n;if(!ke||!ke[Hn])throw new RangeError(`Unsupported selector: ${Hn}`);return ke[Hn]}):_n+" "+$n}})}const baseTheme$1$3=buildTheme("."+baseThemeID,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},lightDarkIDs),observeOptions={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},useCharData=browser.ie&&browser.ie_version<=11;class DOMObserver{constructor(Ce){this.view=Ce,this.active=!1,this.editContext=null,this.selectionRange=new DOMSelectionState,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=Ce.contentDOM,this.observer=new MutationObserver(ke=>{for(let $n of ke)this.queue.push($n);(browser.ie&&browser.ie_version<=11||browser.ios&&Ce.composing)&&ke.some($n=>$n.type=="childList"&&$n.removedNodes.length||$n.type=="characterData"&&$n.oldValue.length>$n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Ce.constructor.EDIT_CONTEXT!==!1&&!(browser.chrome&&browser.chrome_version<126)&&(this.editContext=new EditContextManager(Ce),Ce.state.facet(editable)&&(Ce.contentDOM.editContext=this.editContext.editContext)),useCharData&&(this.onCharData=ke=>{this.queue.push({target:ke.target,type:"characterData",oldValue:ke.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var ke;((ke=this.view.docView)===null||ke===void 0?void 0:ke.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),ke.length>0&&ke[ke.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(ke=>{ke.length>0&&ke[ke.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(Ce){this.view.inputState.runHandlers("scroll",Ce),this.intersecting&&this.view.measure()}onScroll(Ce){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(Ce)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(Ce){(Ce.type=="change"||!Ce.type)&&!Ce.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(Ce){if(this.gapIntersection&&(Ce.length!=this.gaps.length||this.gaps.some((ke,$n)=>ke!=Ce[$n]))){this.gapIntersection.disconnect();for(let ke of Ce)this.gapIntersection.observe(ke);this.gaps=Ce}}onSelectionChange(Ce){let ke=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:$n}=this,Hn=this.selectionRange;if($n.state.facet(editable)?$n.root.activeElement!=this.dom:!hasSelection($n.dom,Hn))return;let zn=Hn.anchorNode&&$n.docView.nearest(Hn.anchorNode);if(zn&&zn.ignoreEvent(Ce)){ke||(this.selectionChanged=!1);return}(browser.ie&&browser.ie_version<=11||browser.android&&browser.chrome)&&!$n.state.selection.main.empty&&Hn.focusNode&&isEquivalentPosition(Hn.focusNode,Hn.focusOffset,Hn.anchorNode,Hn.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:Ce}=this,ke=getSelection(Ce.root);if(!ke)return!1;let $n=browser.safari&&Ce.root.nodeType==11&&deepActiveElement(this.dom.ownerDocument)==this.dom&&safariSelectionRangeHack(this.view,ke)||ke;if(!$n||this.selectionRange.eq($n))return!1;let Hn=hasSelection(this.dom,$n);return Hn&&!this.selectionChanged&&Ce.inputState.lastFocusTime>Date.now()-200&&Ce.inputState.lastTouchTime{let zn=this.delayedAndroidKey;zn&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=zn.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&zn.force&&dispatchKey(this.dom,zn.key,zn.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(Hn)}(!this.delayedAndroidKey||Ce=="Enter")&&(this.delayedAndroidKey={key:Ce,keyCode:ke,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let Ce of this.observer.takeRecords())this.queue.push(Ce);return this.queue}processRecords(){let Ce=this.pendingRecords();Ce.length&&(this.queue=[]);let ke=-1,$n=-1,Hn=!1;for(let zn of Ce){let Un=this.readMutation(zn);Un&&(Un.typeOver&&(Hn=!0),ke==-1?{from:ke,to:$n}=Un:(ke=Math.min(Un.from,ke),$n=Math.max(Un.to,$n)))}return{from:ke,to:$n,typeOver:Hn}}readChange(){let{from:Ce,to:ke,typeOver:$n}=this.processRecords(),Hn=this.selectionChanged&&hasSelection(this.dom,this.selectionRange);if(Ce<0&&!Hn)return null;Ce>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let zn=new DOMChange(this.view,Ce,ke,$n);return this.view.docView.domChanged={newSel:zn.newSel?zn.newSel.main:null},zn}flush(Ce=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;Ce&&this.readSelectionRange();let ke=this.readChange();if(!ke)return this.view.requestMeasure(),!1;let $n=this.view.state,Hn=applyDOMChange(this.view,ke);return this.view.state==$n&&(ke.domChanged||ke.newSel&&!ke.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),Hn}readMutation(Ce){let ke=this.view.docView.nearest(Ce.target);if(!ke||ke.ignoreMutation(Ce))return null;if(ke.markDirty(Ce.type=="attributes"),Ce.type=="attributes"&&(ke.flags|=4),Ce.type=="childList"){let $n=findChild(ke,Ce.previousSibling||Ce.target.previousSibling,-1),Hn=findChild(ke,Ce.nextSibling||Ce.target.nextSibling,1);return{from:$n?ke.posAfter($n):ke.posAtStart,to:Hn?ke.posBefore(Hn):ke.posAtEnd,typeOver:!1}}else return Ce.type=="characterData"?{from:ke.posAtStart,to:ke.posAtEnd,typeOver:Ce.target.nodeValue==Ce.oldValue}:null}setWindow(Ce){Ce!=this.win&&(this.removeWindowListeners(this.win),this.win=Ce,this.addWindowListeners(this.win))}addWindowListeners(Ce){Ce.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):Ce.addEventListener("beforeprint",this.onPrint),Ce.addEventListener("scroll",this.onScroll),Ce.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(Ce){Ce.removeEventListener("scroll",this.onScroll),Ce.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):Ce.removeEventListener("beforeprint",this.onPrint),Ce.document.removeEventListener("selectionchange",this.onSelectionChange)}update(Ce){this.editContext&&(this.editContext.update(Ce),Ce.startState.facet(editable)!=Ce.state.facet(editable)&&(Ce.view.contentDOM.editContext=Ce.state.facet(editable)?this.editContext.editContext:null))}destroy(){var Ce,ke,$n;this.stop(),(Ce=this.intersection)===null||Ce===void 0||Ce.disconnect(),(ke=this.gapIntersection)===null||ke===void 0||ke.disconnect(),($n=this.resizeScroll)===null||$n===void 0||$n.disconnect();for(let Hn of this.scrollTargets)Hn.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function findChild(_n,Ce,ke){for(;Ce;){let $n=ContentView.get(Ce);if($n&&$n.parent==_n)return $n;let Hn=Ce.parentNode;Ce=Hn!=_n.dom?Hn:ke>0?Ce.nextSibling:Ce.previousSibling}return null}function buildSelectionRangeFromRange(_n,Ce){let ke=Ce.startContainer,$n=Ce.startOffset,Hn=Ce.endContainer,zn=Ce.endOffset,Un=_n.docView.domAtPos(_n.state.selection.main.anchor);return isEquivalentPosition(Un.node,Un.offset,Hn,zn)&&([ke,$n,Hn,zn]=[Hn,zn,ke,$n]),{anchorNode:ke,anchorOffset:$n,focusNode:Hn,focusOffset:zn}}function safariSelectionRangeHack(_n,Ce){if(Ce.getComposedRanges){let Hn=Ce.getComposedRanges(_n.root)[0];if(Hn)return buildSelectionRangeFromRange(_n,Hn)}let ke=null;function $n(Hn){Hn.preventDefault(),Hn.stopImmediatePropagation(),ke=Hn.getTargetRanges()[0]}return _n.contentDOM.addEventListener("beforeinput",$n,!0),_n.dom.ownerDocument.execCommand("indent"),_n.contentDOM.removeEventListener("beforeinput",$n,!0),ke?buildSelectionRangeFromRange(_n,ke):null}class EditContextManager{constructor(Ce){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(Ce.state);let ke=this.editContext=new window.EditContext({text:Ce.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,Ce.state.selection.main.anchor))),selectionEnd:this.toContextPos(Ce.state.selection.main.head)});this.handlers.textupdate=$n=>{let{anchor:Hn}=Ce.state.selection.main,zn={from:this.toEditorPos($n.updateRangeStart),to:this.toEditorPos($n.updateRangeEnd),insert:Text.of($n.text.split(` +`))};zn.from==this.from&&Hnthis.to&&(zn.to=Hn),!(zn.from==zn.to&&!zn.insert.length)&&(this.pendingContextChange=zn,Ce.state.readOnly||applyDOMChangeInner(Ce,zn,EditorSelection.single(this.toEditorPos($n.selectionStart),this.toEditorPos($n.selectionEnd))),this.pendingContextChange&&(this.revertPending(Ce.state),this.setSelection(Ce.state)))},this.handlers.characterboundsupdate=$n=>{let Hn=[],zn=null;for(let Un=this.toEditorPos($n.rangeStart),qn=this.toEditorPos($n.rangeEnd);Un{let Hn=[];for(let zn of $n.getTextFormats()){let Un=zn.underlineStyle,qn=zn.underlineThickness;if(Un!="None"&&qn!="None"){let Xn=`text-decoration: underline ${Un=="Dashed"?"dashed ":Un=="Squiggle"?"wavy ":""}${qn=="Thin"?1:2}px`;Hn.push(Decoration.mark({attributes:{style:Xn}}).range(this.toEditorPos(zn.rangeStart),this.toEditorPos(zn.rangeEnd)))}}Ce.dispatch({effects:setEditContextFormatting.of(Decoration.set(Hn))})},this.handlers.compositionstart=()=>{Ce.inputState.composing<0&&(Ce.inputState.composing=0,Ce.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{Ce.inputState.composing=-1,Ce.inputState.compositionFirstChange=null};for(let $n in this.handlers)ke.addEventListener($n,this.handlers[$n]);this.measureReq={read:$n=>{this.editContext.updateControlBounds($n.contentDOM.getBoundingClientRect());let Hn=getSelection($n.root);Hn&&Hn.rangeCount&&this.editContext.updateSelectionBounds(Hn.getRangeAt(0).getBoundingClientRect())}}}applyEdits(Ce){let ke=0,$n=!1,Hn=this.pendingContextChange;return Ce.changes.iterChanges((zn,Un,qn,Xn,Kn)=>{if($n)return;let to=Kn.length-(Un-zn);if(Hn&&Un>=Hn.to)if(Hn.from==zn&&Hn.to==Un&&Hn.insert.eq(Kn)){Hn=this.pendingContextChange=null,ke+=to,this.to+=to;return}else Hn=null,this.revertPending(Ce.state);if(zn+=ke,Un+=ke,Un<=this.from)this.from+=to,this.to+=to;else if(znthis.to||this.to-this.from+Kn.length>3e4){$n=!0;return}this.editContext.updateText(this.toContextPos(zn),this.toContextPos(Un),Kn.toString()),this.to+=to}ke+=to}),Hn&&!$n&&this.revertPending(Ce.state),!$n}update(Ce){let ke=this.pendingContextChange;!this.applyEdits(Ce)||!this.rangeIsValid(Ce.state)?(this.pendingContextChange=null,this.resetRange(Ce.state),this.editContext.updateText(0,this.editContext.text.length,Ce.state.doc.sliceString(this.from,this.to)),this.setSelection(Ce.state)):(Ce.docChanged||Ce.selectionSet||ke)&&this.setSelection(Ce.state),(Ce.geometryChanged||Ce.docChanged||Ce.selectionSet)&&Ce.view.requestMeasure(this.measureReq)}resetRange(Ce){let{head:ke}=Ce.selection.main;this.from=Math.max(0,ke-1e4),this.to=Math.min(Ce.doc.length,ke+1e4)}revertPending(Ce){let ke=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(ke.from),this.toContextPos(ke.from+ke.insert.length),Ce.doc.sliceString(ke.from,ke.to))}setSelection(Ce){let{main:ke}=Ce.selection,$n=this.toContextPos(Math.max(this.from,Math.min(this.to,ke.anchor))),Hn=this.toContextPos(ke.head);(this.editContext.selectionStart!=$n||this.editContext.selectionEnd!=Hn)&&this.editContext.updateSelection($n,Hn)}rangeIsValid(Ce){let{head:ke}=Ce.selection.main;return!(this.from>0&&ke-this.from<500||this.to1e4*3)}toEditorPos(Ce){return Ce+this.from}toContextPos(Ce){return Ce-this.from}destroy(){for(let Ce in this.handlers)this.editContext.removeEventListener(Ce,this.handlers[Ce])}}class EditorView{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(Ce={}){var ke;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),Ce.parent&&Ce.parent.appendChild(this.dom);let{dispatch:$n}=Ce;this.dispatchTransactions=Ce.dispatchTransactions||$n&&(Hn=>Hn.forEach(zn=>$n(zn,this)))||(Hn=>this.update(Hn)),this.dispatch=this.dispatch.bind(this),this._root=Ce.root||getRoot(Ce.parent)||document,this.viewState=new ViewState(Ce.state||EditorState.create(Ce)),Ce.scrollTo&&Ce.scrollTo.is(scrollIntoView$1)&&(this.viewState.scrollTarget=Ce.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(viewPlugin).map(Hn=>new PluginInstance(Hn));for(let Hn of this.plugins)Hn.update(this);this.observer=new DOMObserver(this),this.inputState=new InputState(this),this.inputState.ensureHandlers(this.plugins),this.docView=new DocView(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((ke=document.fonts)===null||ke===void 0)&&ke.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...Ce){let ke=Ce.length==1&&Ce[0]instanceof Transaction?Ce:Ce.length==1&&Array.isArray(Ce[0])?Ce[0]:[this.state.update(...Ce)];this.dispatchTransactions(ke,this)}update(Ce){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let ke=!1,$n=!1,Hn,zn=this.state;for(let uo of Ce){if(uo.startState!=zn)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");zn=uo.state}if(this.destroyed){this.viewState.state=zn;return}let Un=this.hasFocus,qn=0,Xn=null;Ce.some(uo=>uo.annotation(isFocusChange))?(this.inputState.notifiedFocused=Un,qn=1):Un!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=Un,Xn=focusChangeTransaction(zn,Un),Xn||(qn=1));let Kn=this.observer.delayedAndroidKey,to=null;if(Kn?(this.observer.clearDelayedAndroidKey(),to=this.observer.readChange(),(to&&!this.state.doc.eq(zn.doc)||!this.state.selection.eq(zn.selection))&&(to=null)):this.observer.clear(),zn.facet(EditorState.phrases)!=this.state.facet(EditorState.phrases))return this.setState(zn);Hn=ViewUpdate.create(this,zn,Ce),Hn.flags|=qn;let io=this.viewState.scrollTarget;try{this.updateState=2;for(let uo of Ce){if(io&&(io=io.map(uo.changes)),uo.scrollIntoView){let{main:ho}=uo.state.selection;io=new ScrollTarget(ho.empty?ho:EditorSelection.cursor(ho.head,ho.head>ho.anchor?-1:1))}for(let ho of uo.effects)ho.is(scrollIntoView$1)&&(io=ho.value.clip(this.state))}this.viewState.update(Hn,io),this.bidiCache=CachedOrder.update(this.bidiCache,Hn.changes),Hn.empty||(this.updatePlugins(Hn),this.inputState.update(Hn)),ke=this.docView.update(Hn),this.state.facet(styleModule)!=this.styleModules&&this.mountStyles(),$n=this.updateAttrs(),this.showAnnouncements(Ce),this.docView.updateSelection(ke,Ce.some(uo=>uo.isUserEvent("select.pointer")))}finally{this.updateState=0}if(Hn.startState.facet(theme)!=Hn.state.facet(theme)&&(this.viewState.mustMeasureContent=!0),(ke||$n||io||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),ke&&this.docViewUpdate(),!Hn.empty)for(let uo of this.state.facet(updateListener))try{uo(Hn)}catch(ho){logException(this.state,ho,"update listener")}(Xn||to)&&Promise.resolve().then(()=>{Xn&&this.state==Xn.startState&&this.dispatch(Xn),to&&!applyDOMChange(this,to)&&Kn.force&&dispatchKey(this.contentDOM,Kn.key,Kn.keyCode)})}setState(Ce){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=Ce;return}this.updateState=2;let ke=this.hasFocus;try{for(let $n of this.plugins)$n.destroy(this);this.viewState=new ViewState(Ce),this.plugins=Ce.facet(viewPlugin).map($n=>new PluginInstance($n)),this.pluginMap.clear();for(let $n of this.plugins)$n.update(this);this.docView.destroy(),this.docView=new DocView(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}ke&&this.focus(),this.requestMeasure()}updatePlugins(Ce){let ke=Ce.startState.facet(viewPlugin),$n=Ce.state.facet(viewPlugin);if(ke!=$n){let Hn=[];for(let zn of $n){let Un=ke.indexOf(zn);if(Un<0)Hn.push(new PluginInstance(zn));else{let qn=this.plugins[Un];qn.mustUpdate=Ce,Hn.push(qn)}}for(let zn of this.plugins)zn.mustUpdate!=Ce&&zn.destroy(this);this.plugins=Hn,this.pluginMap.clear()}else for(let Hn of this.plugins)Hn.mustUpdate=Ce;for(let Hn=0;Hn-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,Ce&&this.observer.forceFlush();let ke=null,$n=this.scrollDOM,Hn=$n.scrollTop*this.scaleY,{scrollAnchorPos:zn,scrollAnchorHeight:Un}=this.viewState;Math.abs(Hn-this.viewState.scrollTop)>1&&(Un=-1),this.viewState.scrollAnchorHeight=-1;try{for(let qn=0;;qn++){if(Un<0)if(isScrolledToBottom($n))zn=-1,Un=this.viewState.heightMap.height;else{let ho=this.viewState.scrollAnchorAt(Hn);zn=ho.from,Un=ho.top}this.updateState=1;let Xn=this.viewState.measure(this);if(!Xn&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(qn>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let Kn=[];Xn&4||([this.measureRequests,Kn]=[Kn,this.measureRequests]);let to=Kn.map(ho=>{try{return ho.read(this)}catch(bo){return logException(this.state,bo),BadMeasure}}),io=ViewUpdate.create(this,this.state,[]),uo=!1;io.flags|=Xn,ke?ke.flags|=Xn:ke=io,this.updateState=2,io.empty||(this.updatePlugins(io),this.inputState.update(io),this.updateAttrs(),uo=this.docView.update(io),uo&&this.docViewUpdate());for(let ho=0;ho1||bo<-1){Hn=Hn+bo,$n.scrollTop=Hn/this.scaleY,Un=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(ke&&!ke.empty)for(let qn of this.state.facet(updateListener))qn(ke)}get themeClasses(){return baseThemeID+" "+(this.state.facet(darkTheme)?baseDarkID:baseLightID)+" "+this.state.facet(theme)}updateAttrs(){let Ce=attrsFromFacet(this,editorAttributes,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),ke={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(editable)?"true":"false",class:"cm-content",style:`${browser.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(ke["aria-readonly"]="true"),attrsFromFacet(this,contentAttributes,ke);let $n=this.observer.ignore(()=>{let Hn=updateAttrs(this.contentDOM,this.contentAttrs,ke),zn=updateAttrs(this.dom,this.editorAttrs,Ce);return Hn||zn});return this.editorAttrs=Ce,this.contentAttrs=ke,$n}showAnnouncements(Ce){let ke=!0;for(let $n of Ce)for(let Hn of $n.effects)if(Hn.is(EditorView.announce)){ke&&(this.announceDOM.textContent=""),ke=!1;let zn=this.announceDOM.appendChild(document.createElement("div"));zn.textContent=Hn.value}}mountStyles(){this.styleModules=this.state.facet(styleModule);let Ce=this.state.facet(EditorView.cspNonce);StyleModule.mount(this.root,this.styleModules.concat(baseTheme$1$3).reverse(),Ce?{nonce:Ce}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(Ce){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),Ce){if(this.measureRequests.indexOf(Ce)>-1)return;if(Ce.key!=null){for(let ke=0;ke$n.spec==Ce)||null),ke&&ke.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(Ce){return this.readMeasured(),this.viewState.elementAtHeight(Ce)}lineBlockAtHeight(Ce){return this.readMeasured(),this.viewState.lineBlockAtHeight(Ce)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(Ce){return this.viewState.lineBlockAt(Ce)}get contentHeight(){return this.viewState.contentHeight}moveByChar(Ce,ke,$n){return skipAtoms(this,Ce,moveByChar(this,Ce,ke,$n))}moveByGroup(Ce,ke){return skipAtoms(this,Ce,moveByChar(this,Ce,ke,$n=>byGroup(this,Ce.head,$n)))}visualLineSide(Ce,ke){let $n=this.bidiSpans(Ce),Hn=this.textDirectionAt(Ce.from),zn=$n[ke?$n.length-1:0];return EditorSelection.cursor(zn.side(ke,Hn)+Ce.from,zn.forward(!ke,Hn)?1:-1)}moveToLineBoundary(Ce,ke,$n=!0){return moveToLineBoundary(this,Ce,ke,$n)}moveVertically(Ce,ke,$n){return skipAtoms(this,Ce,moveVertically(this,Ce,ke,$n))}domAtPos(Ce){return this.docView.domAtPos(Ce)}posAtDOM(Ce,ke=0){return this.docView.posFromDOM(Ce,ke)}posAtCoords(Ce,ke=!0){return this.readMeasured(),posAtCoords(this,Ce,ke)}coordsAtPos(Ce,ke=1){this.readMeasured();let $n=this.docView.coordsAt(Ce,ke);if(!$n||$n.left==$n.right)return $n;let Hn=this.state.doc.lineAt(Ce),zn=this.bidiSpans(Hn),Un=zn[BidiSpan.find(zn,Ce-Hn.from,-1,ke)];return flattenRect($n,Un.dir==Direction.LTR==ke>0)}coordsForChar(Ce){return this.readMeasured(),this.docView.coordsForChar(Ce)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(Ce){return!this.state.facet(perLineTextDirection)||Cethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(Ce))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(Ce){if(Ce.length>MaxBidiLine)return trivialOrder(Ce.length);let ke=this.textDirectionAt(Ce.from),$n;for(let zn of this.bidiCache)if(zn.from==Ce.from&&zn.dir==ke&&(zn.fresh||isolatesEq(zn.isolates,$n=getIsolatedRanges(this,Ce))))return zn.order;$n||($n=getIsolatedRanges(this,Ce));let Hn=computeOrder(Ce.text,ke,$n);return this.bidiCache.push(new CachedOrder(Ce.from,Ce.to,ke,$n,!0,Hn)),Hn}get hasFocus(){var Ce;return(this.dom.ownerDocument.hasFocus()||browser.safari&&((Ce=this.inputState)===null||Ce===void 0?void 0:Ce.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{focusPreventScroll(this.contentDOM),this.docView.updateSelection()})}setRoot(Ce){this._root!=Ce&&(this._root=Ce,this.observer.setWindow((Ce.nodeType==9?Ce:Ce.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let Ce of this.plugins)Ce.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(Ce,ke={}){return scrollIntoView$1.of(new ScrollTarget(typeof Ce=="number"?EditorSelection.cursor(Ce):Ce,ke.y,ke.x,ke.yMargin,ke.xMargin))}scrollSnapshot(){let{scrollTop:Ce,scrollLeft:ke}=this.scrollDOM,$n=this.viewState.scrollAnchorAt(Ce);return scrollIntoView$1.of(new ScrollTarget(EditorSelection.cursor($n.from),"start","start",$n.top-Ce,ke,!0))}setTabFocusMode(Ce){Ce==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof Ce=="boolean"?this.inputState.tabFocusMode=Ce?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+Ce)}static domEventHandlers(Ce){return ViewPlugin.define(()=>({}),{eventHandlers:Ce})}static domEventObservers(Ce){return ViewPlugin.define(()=>({}),{eventObservers:Ce})}static theme(Ce,ke){let $n=StyleModule.newName(),Hn=[theme.of($n),styleModule.of(buildTheme(`.${$n}`,Ce))];return ke&&ke.dark&&Hn.push(darkTheme.of(!0)),Hn}static baseTheme(Ce){return Prec.lowest(styleModule.of(buildTheme("."+baseThemeID,Ce,lightDarkIDs)))}static findFromDOM(Ce){var ke;let $n=Ce.querySelector(".cm-content"),Hn=$n&&ContentView.get($n)||ContentView.get(Ce);return((ke=Hn==null?void 0:Hn.rootView)===null||ke===void 0?void 0:ke.view)||null}}EditorView.styleModule=styleModule;EditorView.inputHandler=inputHandler$1;EditorView.scrollHandler=scrollHandler;EditorView.focusChangeEffect=focusChangeEffect;EditorView.perLineTextDirection=perLineTextDirection;EditorView.exceptionSink=exceptionSink;EditorView.updateListener=updateListener;EditorView.editable=editable;EditorView.mouseSelectionStyle=mouseSelectionStyle;EditorView.dragMovesSelection=dragMovesSelection$1;EditorView.clickAddsSelectionRange=clickAddsSelectionRange;EditorView.decorations=decorations;EditorView.outerDecorations=outerDecorations;EditorView.atomicRanges=atomicRanges;EditorView.bidiIsolatedRanges=bidiIsolatedRanges;EditorView.scrollMargins=scrollMargins;EditorView.darkTheme=darkTheme;EditorView.cspNonce=Facet.define({combine:_n=>_n.length?_n[0]:""});EditorView.contentAttributes=contentAttributes;EditorView.editorAttributes=editorAttributes;EditorView.lineWrapping=EditorView.contentAttributes.of({class:"cm-lineWrapping"});EditorView.announce=StateEffect.define();const MaxBidiLine=4096,BadMeasure={};class CachedOrder{constructor(Ce,ke,$n,Hn,zn,Un){this.from=Ce,this.to=ke,this.dir=$n,this.isolates=Hn,this.fresh=zn,this.order=Un}static update(Ce,ke){if(ke.empty&&!Ce.some(zn=>zn.fresh))return Ce;let $n=[],Hn=Ce.length?Ce[Ce.length-1].dir:Direction.LTR;for(let zn=Math.max(0,Ce.length-10);zn=0;Hn--){let zn=$n[Hn],Un=typeof zn=="function"?zn(_n):zn;Un&&combineAttrs(Un,ke)}return ke}const currentPlatform=browser.mac?"mac":browser.windows?"win":browser.linux?"linux":"key";function normalizeKeyName(_n,Ce){const ke=_n.split(/-(?!$)/);let $n=ke[ke.length-1];$n=="Space"&&($n=" ");let Hn,zn,Un,qn;for(let Xn=0;Xn$n.concat(Hn),[]))),ke}function runScopeHandlers(_n,Ce,ke){return runHandlers(getKeymap(_n.state),Ce,_n,ke)}let storedPrefix=null;const PrefixTimeout=4e3;function buildKeymap(_n,Ce=currentPlatform){let ke=Object.create(null),$n=Object.create(null),Hn=(Un,qn)=>{let Xn=$n[Un];if(Xn==null)$n[Un]=qn;else if(Xn!=qn)throw new Error("Key binding "+Un+" is used both as a regular binding and as a multi-stroke prefix")},zn=(Un,qn,Xn,Kn,to)=>{var io,uo;let ho=ke[Un]||(ke[Un]=Object.create(null)),bo=qn.split(/ (?!$)/).map($o=>normalizeKeyName($o,Ce));for(let $o=1;$o{let Io=storedPrefix={view:xo,prefix:Do,scope:Un};return setTimeout(()=>{storedPrefix==Io&&(storedPrefix=null)},PrefixTimeout),!0}]})}let Oo=bo.join(" ");Hn(Oo,!1);let So=ho[Oo]||(ho[Oo]={preventDefault:!1,stopPropagation:!1,run:((uo=(io=ho._any)===null||io===void 0?void 0:io.run)===null||uo===void 0?void 0:uo.slice())||[]});Xn&&So.run.push(Xn),Kn&&(So.preventDefault=!0),to&&(So.stopPropagation=!0)};for(let Un of _n){let qn=Un.scope?Un.scope.split(" "):["editor"];if(Un.any)for(let Kn of qn){let to=ke[Kn]||(ke[Kn]=Object.create(null));to._any||(to._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:io}=Un;for(let uo in to)to[uo].run.push(ho=>io(ho,currentKeyEvent))}let Xn=Un[Ce]||Un.key;if(Xn)for(let Kn of qn)zn(Kn,Xn,Un.run,Un.preventDefault,Un.stopPropagation),Un.shift&&zn(Kn,"Shift-"+Xn,Un.shift,Un.preventDefault,Un.stopPropagation)}return ke}let currentKeyEvent=null;function runHandlers(_n,Ce,ke,$n){currentKeyEvent=Ce;let Hn=keyName(Ce),zn=codePointAt(Hn,0),Un=codePointSize(zn)==Hn.length&&Hn!=" ",qn="",Xn=!1,Kn=!1,to=!1;storedPrefix&&storedPrefix.view==ke&&storedPrefix.scope==$n&&(qn=storedPrefix.prefix+" ",modifierCodes.indexOf(Ce.keyCode)<0&&(Kn=!0,storedPrefix=null));let io=new Set,uo=So=>{if(So){for(let $o of So.run)if(!io.has($o)&&(io.add($o),$o(ke)))return So.stopPropagation&&(to=!0),!0;So.preventDefault&&(So.stopPropagation&&(to=!0),Kn=!0)}return!1},ho=_n[$n],bo,Oo;return ho&&(uo(ho[qn+modifiers(Hn,Ce,!Un)])?Xn=!0:Un&&(Ce.altKey||Ce.metaKey||Ce.ctrlKey)&&!(browser.windows&&Ce.ctrlKey&&Ce.altKey)&&(bo=base[Ce.keyCode])&&bo!=Hn?(uo(ho[qn+modifiers(bo,Ce,!0)])||Ce.shiftKey&&(Oo=shift[Ce.keyCode])!=Hn&&Oo!=bo&&uo(ho[qn+modifiers(Oo,Ce,!1)]))&&(Xn=!0):Un&&Ce.shiftKey&&uo(ho[qn+modifiers(Hn,Ce,!0)])&&(Xn=!0),!Xn&&uo(ho._any)&&(Xn=!0)),Kn&&(Xn=!0),Xn&&to&&Ce.stopPropagation(),currentKeyEvent=null,Xn}class RectangleMarker{constructor(Ce,ke,$n,Hn,zn){this.className=Ce,this.left=ke,this.top=$n,this.width=Hn,this.height=zn}draw(){let Ce=document.createElement("div");return Ce.className=this.className,this.adjust(Ce),Ce}update(Ce,ke){return ke.className!=this.className?!1:(this.adjust(Ce),!0)}adjust(Ce){Ce.style.left=this.left+"px",Ce.style.top=this.top+"px",this.width!=null&&(Ce.style.width=this.width+"px"),Ce.style.height=this.height+"px"}eq(Ce){return this.left==Ce.left&&this.top==Ce.top&&this.width==Ce.width&&this.height==Ce.height&&this.className==Ce.className}static forRange(Ce,ke,$n){if($n.empty){let Hn=Ce.coordsAtPos($n.head,$n.assoc||1);if(!Hn)return[];let zn=getBase(Ce);return[new RectangleMarker(ke,Hn.left-zn.left,Hn.top-zn.top,null,Hn.bottom-Hn.top)]}else return rectanglesForRange(Ce,ke,$n)}}function getBase(_n){let Ce=_n.scrollDOM.getBoundingClientRect();return{left:(_n.textDirection==Direction.LTR?Ce.left:Ce.right-_n.scrollDOM.clientWidth*_n.scaleX)-_n.scrollDOM.scrollLeft*_n.scaleX,top:Ce.top-_n.scrollDOM.scrollTop*_n.scaleY}}function wrappedLine(_n,Ce,ke,$n){let Hn=_n.coordsAtPos(Ce,ke*2);if(!Hn)return $n;let zn=_n.dom.getBoundingClientRect(),Un=(Hn.top+Hn.bottom)/2,qn=_n.posAtCoords({x:zn.left+1,y:Un}),Xn=_n.posAtCoords({x:zn.right-1,y:Un});return qn==null||Xn==null?$n:{from:Math.max($n.from,Math.min(qn,Xn)),to:Math.min($n.to,Math.max(qn,Xn))}}function rectanglesForRange(_n,Ce,ke){if(ke.to<=_n.viewport.from||ke.from>=_n.viewport.to)return[];let $n=Math.max(ke.from,_n.viewport.from),Hn=Math.min(ke.to,_n.viewport.to),zn=_n.textDirection==Direction.LTR,Un=_n.contentDOM,qn=Un.getBoundingClientRect(),Xn=getBase(_n),Kn=Un.querySelector(".cm-line"),to=Kn&&window.getComputedStyle(Kn),io=qn.left+(to?parseInt(to.paddingLeft)+Math.min(0,parseInt(to.textIndent)):0),uo=qn.right-(to?parseInt(to.paddingRight):0),ho=blockAt(_n,$n),bo=blockAt(_n,Hn),Oo=ho.type==BlockType.Text?ho:null,So=bo.type==BlockType.Text?bo:null;if(Oo&&(_n.lineWrapping||ho.widgetLineBreaks)&&(Oo=wrappedLine(_n,$n,1,Oo)),So&&(_n.lineWrapping||bo.widgetLineBreaks)&&(So=wrappedLine(_n,Hn,-1,So)),Oo&&So&&Oo.from==So.from&&Oo.to==So.to)return Do(xo(ke.from,ke.to,Oo));{let Vo=Oo?xo(ke.from,null,Oo):Io(ho,!1),Jo=So?xo(null,ke.to,So):Io(bo,!0),Mo=[];return(Oo||ho).to<(So||bo).from-(Oo&&So?1:0)||ho.widgetLineBreaks>1&&Vo.bottom+_n.defaultLineHeight/2Yo&&sr.from=ko)break;cr>Js&&is(Math.max(Qr,Js),Vo==null&&Qr<=Yo,Math.min(cr,ko),Jo==null&&cr>=Ys,xs.dir)}if(Js=gs.to+1,Js>=ko)break}return ms.length==0&&is(Yo,Vo==null,Ys,Jo==null,_n.textDirection),{top:Go,bottom:os,horizontal:ms}}function Io(Vo,Jo){let Mo=qn.top+(Jo?Vo.top:Vo.bottom);return{top:Mo,bottom:Mo,horizontal:[]}}}function sameMarker(_n,Ce){return _n.constructor==Ce.constructor&&_n.eq(Ce)}class LayerView{constructor(Ce,ke){this.view=Ce,this.layer=ke,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=Ce.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),ke.above&&this.dom.classList.add("cm-layer-above"),ke.class&&this.dom.classList.add(ke.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(Ce.state),Ce.requestMeasure(this.measureReq),ke.mount&&ke.mount(this.dom,Ce)}update(Ce){Ce.startState.facet(layerOrder)!=Ce.state.facet(layerOrder)&&this.setOrder(Ce.state),(this.layer.update(Ce,this.dom)||Ce.geometryChanged)&&(this.scale(),Ce.view.requestMeasure(this.measureReq))}docViewUpdate(Ce){this.layer.updateOnDocViewUpdate!==!1&&Ce.requestMeasure(this.measureReq)}setOrder(Ce){let ke=0,$n=Ce.facet(layerOrder);for(;ke<$n.length&&$n[ke]!=this.layer;)ke++;this.dom.style.zIndex=String((this.layer.above?150:-1)-ke)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:Ce,scaleY:ke}=this.view;(Ce!=this.scaleX||ke!=this.scaleY)&&(this.scaleX=Ce,this.scaleY=ke,this.dom.style.transform=`scale(${1/Ce}, ${1/ke})`)}draw(Ce){if(Ce.length!=this.drawn.length||Ce.some((ke,$n)=>!sameMarker(ke,this.drawn[$n]))){let ke=this.dom.firstChild,$n=0;for(let Hn of Ce)Hn.update&&ke&&Hn.constructor&&this.drawn[$n].constructor&&Hn.update(ke,this.drawn[$n])?(ke=ke.nextSibling,$n++):this.dom.insertBefore(Hn.draw(),ke);for(;ke;){let Hn=ke.nextSibling;ke.remove(),ke=Hn}this.drawn=Ce}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const layerOrder=Facet.define();function layer(_n){return[ViewPlugin.define(Ce=>new LayerView(Ce,_n)),layerOrder.of(_n)]}const CanHidePrimary=!browser.ios,selectionConfig=Facet.define({combine(_n){return combineConfig(_n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(Ce,ke)=>Math.min(Ce,ke),drawRangeCursor:(Ce,ke)=>Ce||ke})}});function drawSelection(_n={}){return[selectionConfig.of(_n),cursorLayer,selectionLayer,hideNativeSelection,nativeSelectionHidden.of(!0)]}function configChanged(_n){return _n.startState.facet(selectionConfig)!=_n.state.facet(selectionConfig)}const cursorLayer=layer({above:!0,markers(_n){let{state:Ce}=_n,ke=Ce.facet(selectionConfig),$n=[];for(let Hn of Ce.selection.ranges){let zn=Hn==Ce.selection.main;if(Hn.empty?!zn||CanHidePrimary:ke.drawRangeCursor){let Un=zn?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",qn=Hn.empty?Hn:EditorSelection.cursor(Hn.head,Hn.head>Hn.anchor?-1:1);for(let Xn of RectangleMarker.forRange(_n,Un,qn))$n.push(Xn)}}return $n},update(_n,Ce){_n.transactions.some($n=>$n.selection)&&(Ce.style.animationName=Ce.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let ke=configChanged(_n);return ke&&setBlinkRate(_n.state,Ce),_n.docChanged||_n.selectionSet||ke},mount(_n,Ce){setBlinkRate(Ce.state,_n)},class:"cm-cursorLayer"});function setBlinkRate(_n,Ce){Ce.style.animationDuration=_n.facet(selectionConfig).cursorBlinkRate+"ms"}const selectionLayer=layer({above:!1,markers(_n){return _n.state.selection.ranges.map(Ce=>Ce.empty?[]:RectangleMarker.forRange(_n,"cm-selectionBackground",Ce)).reduce((Ce,ke)=>Ce.concat(ke))},update(_n,Ce){return _n.docChanged||_n.selectionSet||_n.viewportChanged||configChanged(_n)},class:"cm-selectionLayer"}),themeSpec={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};CanHidePrimary&&(themeSpec[".cm-line"].caretColor=themeSpec[".cm-content"].caretColor="transparent !important");const hideNativeSelection=Prec.highest(EditorView.theme(themeSpec)),setDropCursorPos=StateEffect.define({map(_n,Ce){return _n==null?null:Ce.mapPos(_n)}}),dropCursorPos=StateField.define({create(){return null},update(_n,Ce){return _n!=null&&(_n=Ce.changes.mapPos(_n)),Ce.effects.reduce((ke,$n)=>$n.is(setDropCursorPos)?$n.value:ke,_n)}}),drawDropCursor=ViewPlugin.fromClass(class{constructor(_n){this.view=_n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(_n){var Ce;let ke=_n.state.field(dropCursorPos);ke==null?this.cursor!=null&&((Ce=this.cursor)===null||Ce===void 0||Ce.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(_n.startState.field(dropCursorPos)!=ke||_n.docChanged||_n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:_n}=this,Ce=_n.state.field(dropCursorPos),ke=Ce!=null&&_n.coordsAtPos(Ce);if(!ke)return null;let $n=_n.scrollDOM.getBoundingClientRect();return{left:ke.left-$n.left+_n.scrollDOM.scrollLeft*_n.scaleX,top:ke.top-$n.top+_n.scrollDOM.scrollTop*_n.scaleY,height:ke.bottom-ke.top}}drawCursor(_n){if(this.cursor){let{scaleX:Ce,scaleY:ke}=this.view;_n?(this.cursor.style.left=_n.left/Ce+"px",this.cursor.style.top=_n.top/ke+"px",this.cursor.style.height=_n.height/ke+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(_n){this.view.state.field(dropCursorPos)!=_n&&this.view.dispatch({effects:setDropCursorPos.of(_n)})}},{eventObservers:{dragover(_n){this.setDropPos(this.view.posAtCoords({x:_n.clientX,y:_n.clientY}))},dragleave(_n){(_n.target==this.view.contentDOM||!this.view.contentDOM.contains(_n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function dropCursor(){return[dropCursorPos,drawDropCursor]}function iterMatches(_n,Ce,ke,$n,Hn){Ce.lastIndex=0;for(let zn=_n.iterRange(ke,$n),Un=ke,qn;!zn.next().done;Un+=zn.value.length)if(!zn.lineBreak)for(;qn=Ce.exec(zn.value);)Hn(Un+qn.index,qn)}function matchRanges(_n,Ce){let ke=_n.visibleRanges;if(ke.length==1&&ke[0].from==_n.viewport.from&&ke[0].to==_n.viewport.to)return ke;let $n=[];for(let{from:Hn,to:zn}of ke)Hn=Math.max(_n.state.doc.lineAt(Hn).from,Hn-Ce),zn=Math.min(_n.state.doc.lineAt(zn).to,zn+Ce),$n.length&&$n[$n.length-1].to>=Hn?$n[$n.length-1].to=zn:$n.push({from:Hn,to:zn});return $n}class MatchDecorator{constructor(Ce){const{regexp:ke,decoration:$n,decorate:Hn,boundary:zn,maxLength:Un=1e3}=Ce;if(!ke.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=ke,Hn)this.addMatch=(qn,Xn,Kn,to)=>Hn(to,Kn,Kn+qn[0].length,qn,Xn);else if(typeof $n=="function")this.addMatch=(qn,Xn,Kn,to)=>{let io=$n(qn,Xn,Kn);io&&to(Kn,Kn+qn[0].length,io)};else if($n)this.addMatch=(qn,Xn,Kn,to)=>to(Kn,Kn+qn[0].length,$n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=zn,this.maxLength=Un}createDeco(Ce){let ke=new RangeSetBuilder,$n=ke.add.bind(ke);for(let{from:Hn,to:zn}of matchRanges(Ce,this.maxLength))iterMatches(Ce.state.doc,this.regexp,Hn,zn,(Un,qn)=>this.addMatch(qn,Ce,Un,$n));return ke.finish()}updateDeco(Ce,ke){let $n=1e9,Hn=-1;return Ce.docChanged&&Ce.changes.iterChanges((zn,Un,qn,Xn)=>{Xn>Ce.view.viewport.from&&qn1e3?this.createDeco(Ce.view):Hn>-1?this.updateRange(Ce.view,ke.map(Ce.changes),$n,Hn):ke}updateRange(Ce,ke,$n,Hn){for(let zn of Ce.visibleRanges){let Un=Math.max(zn.from,$n),qn=Math.min(zn.to,Hn);if(qn>Un){let Xn=Ce.state.doc.lineAt(Un),Kn=Xn.toXn.from;Un--)if(this.boundary.test(Xn.text[Un-1-Xn.from])){to=Un;break}for(;qnuo.push($o.range(Oo,So));if(Xn==Kn)for(this.regexp.lastIndex=to-Xn.from;(ho=this.regexp.exec(Xn.text))&&ho.indexthis.addMatch(So,Ce,Oo,bo));ke=ke.update({filterFrom:to,filterTo:io,filter:(Oo,So)=>Ooio,add:uo})}}return ke}}const UnicodeRegexpSupport=/x/.unicode!=null?"gu":"g",Specials=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,UnicodeRegexpSupport),Names={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let _supportsTabSize=null;function supportsTabSize(){var _n;if(_supportsTabSize==null&&typeof document<"u"&&document.body){let Ce=document.body.style;_supportsTabSize=((_n=Ce.tabSize)!==null&&_n!==void 0?_n:Ce.MozTabSize)!=null}return _supportsTabSize||!1}const specialCharConfig=Facet.define({combine(_n){let Ce=combineConfig(_n,{render:null,specialChars:Specials,addSpecialChars:null});return(Ce.replaceTabs=!supportsTabSize())&&(Ce.specialChars=new RegExp(" |"+Ce.specialChars.source,UnicodeRegexpSupport)),Ce.addSpecialChars&&(Ce.specialChars=new RegExp(Ce.specialChars.source+"|"+Ce.addSpecialChars.source,UnicodeRegexpSupport)),Ce}});function highlightSpecialChars(_n={}){return[specialCharConfig.of(_n),specialCharPlugin()]}let _plugin=null;function specialCharPlugin(){return _plugin||(_plugin=ViewPlugin.fromClass(class{constructor(_n){this.view=_n,this.decorations=Decoration.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(_n.state.facet(specialCharConfig)),this.decorations=this.decorator.createDeco(_n)}makeDecorator(_n){return new MatchDecorator({regexp:_n.specialChars,decoration:(Ce,ke,$n)=>{let{doc:Hn}=ke.state,zn=codePointAt(Ce[0],0);if(zn==9){let Un=Hn.lineAt($n),qn=ke.state.tabSize,Xn=countColumn(Un.text,qn,$n-Un.from);return Decoration.replace({widget:new TabWidget((qn-Xn%qn)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[zn]||(this.decorationCache[zn]=Decoration.replace({widget:new SpecialCharWidget(_n,zn)}))},boundary:_n.replaceTabs?void 0:/[^]/})}update(_n){let Ce=_n.state.facet(specialCharConfig);_n.startState.facet(specialCharConfig)!=Ce?(this.decorator=this.makeDecorator(Ce),this.decorations=this.decorator.createDeco(_n.view)):this.decorations=this.decorator.updateDeco(_n,this.decorations)}},{decorations:_n=>_n.decorations}))}const DefaultPlaceholder="•";function placeholder$1(_n){return _n>=32?DefaultPlaceholder:_n==10?"␤":String.fromCharCode(9216+_n)}class SpecialCharWidget extends WidgetType{constructor(Ce,ke){super(),this.options=Ce,this.code=ke}eq(Ce){return Ce.code==this.code}toDOM(Ce){let ke=placeholder$1(this.code),$n=Ce.state.phrase("Control character")+" "+(Names[this.code]||"0x"+this.code.toString(16)),Hn=this.options.render&&this.options.render(this.code,$n,ke);if(Hn)return Hn;let zn=document.createElement("span");return zn.textContent=ke,zn.title=$n,zn.setAttribute("aria-label",$n),zn.className="cm-specialChar",zn}ignoreEvent(){return!1}}class TabWidget extends WidgetType{constructor(Ce){super(),this.width=Ce}eq(Ce){return Ce.width==this.width}toDOM(){let Ce=document.createElement("span");return Ce.textContent=" ",Ce.className="cm-tab",Ce.style.width=this.width+"px",Ce}ignoreEvent(){return!1}}function highlightActiveLine(){return activeLineHighlighter}const lineDeco=Decoration.line({class:"cm-activeLine"}),activeLineHighlighter=ViewPlugin.fromClass(class{constructor(_n){this.decorations=this.getDeco(_n)}update(_n){(_n.docChanged||_n.selectionSet)&&(this.decorations=this.getDeco(_n.view))}getDeco(_n){let Ce=-1,ke=[];for(let $n of _n.state.selection.ranges){let Hn=_n.lineBlockAt($n.head);Hn.from>Ce&&(ke.push(lineDeco.range(Hn.from)),Ce=Hn.from)}return Decoration.set(ke)}},{decorations:_n=>_n.decorations}),MaxOff=2e3;function rectangleFor(_n,Ce,ke){let $n=Math.min(Ce.line,ke.line),Hn=Math.max(Ce.line,ke.line),zn=[];if(Ce.off>MaxOff||ke.off>MaxOff||Ce.col<0||ke.col<0){let Un=Math.min(Ce.off,ke.off),qn=Math.max(Ce.off,ke.off);for(let Xn=$n;Xn<=Hn;Xn++){let Kn=_n.doc.line(Xn);Kn.length<=qn&&zn.push(EditorSelection.range(Kn.from+Un,Kn.to+qn))}}else{let Un=Math.min(Ce.col,ke.col),qn=Math.max(Ce.col,ke.col);for(let Xn=$n;Xn<=Hn;Xn++){let Kn=_n.doc.line(Xn),to=findColumn(Kn.text,Un,_n.tabSize,!0);if(to<0)zn.push(EditorSelection.cursor(Kn.to));else{let io=findColumn(Kn.text,qn,_n.tabSize);zn.push(EditorSelection.range(Kn.from+to,Kn.from+io))}}}return zn}function absoluteColumn(_n,Ce){let ke=_n.coordsAtPos(_n.viewport.from);return ke?Math.round(Math.abs((ke.left-Ce)/_n.defaultCharacterWidth)):-1}function getPos(_n,Ce){let ke=_n.posAtCoords({x:Ce.clientX,y:Ce.clientY},!1),$n=_n.state.doc.lineAt(ke),Hn=ke-$n.from,zn=Hn>MaxOff?-1:Hn==$n.length?absoluteColumn(_n,Ce.clientX):countColumn($n.text,_n.state.tabSize,ke-$n.from);return{line:$n.number,col:zn,off:Hn}}function rectangleSelectionStyle(_n,Ce){let ke=getPos(_n,Ce),$n=_n.state.selection;return ke?{update(Hn){if(Hn.docChanged){let zn=Hn.changes.mapPos(Hn.startState.doc.line(ke.line).from),Un=Hn.state.doc.lineAt(zn);ke={line:Un.number,col:ke.col,off:Math.min(ke.off,Un.length)},$n=$n.map(Hn.changes)}},get(Hn,zn,Un){let qn=getPos(_n,Hn);if(!qn)return $n;let Xn=rectangleFor(_n.state,ke,qn);return Xn.length?Un?EditorSelection.create(Xn.concat($n.ranges)):EditorSelection.create(Xn):$n}}:null}function rectangularSelection(_n){let Ce=ke=>ke.altKey&&ke.button==0;return EditorView.mouseSelectionStyle.of((ke,$n)=>Ce($n)?rectangleSelectionStyle(ke,$n):null)}const keys={Alt:[18,_n=>!!_n.altKey],Control:[17,_n=>!!_n.ctrlKey],Shift:[16,_n=>!!_n.shiftKey],Meta:[91,_n=>!!_n.metaKey]},showCrosshair={style:"cursor: crosshair"};function crosshairCursor(_n={}){let[Ce,ke]=keys[_n.key||"Alt"],$n=ViewPlugin.fromClass(class{constructor(Hn){this.view=Hn,this.isDown=!1}set(Hn){this.isDown!=Hn&&(this.isDown=Hn,this.view.update([]))}},{eventObservers:{keydown(Hn){this.set(Hn.keyCode==Ce||ke(Hn))},keyup(Hn){(Hn.keyCode==Ce||!ke(Hn))&&this.set(!1)},mousemove(Hn){this.set(ke(Hn))}}});return[$n,EditorView.contentAttributes.of(Hn=>{var zn;return!((zn=Hn.plugin($n))===null||zn===void 0)&&zn.isDown?showCrosshair:null})]}const Outside="-10000px";class TooltipViewManager{constructor(Ce,ke,$n,Hn){this.facet=ke,this.createTooltipView=$n,this.removeTooltipView=Hn,this.input=Ce.state.facet(ke),this.tooltips=this.input.filter(Un=>Un);let zn=null;this.tooltipViews=this.tooltips.map(Un=>zn=$n(Un,zn))}update(Ce,ke){var $n;let Hn=Ce.state.facet(this.facet),zn=Hn.filter(Xn=>Xn);if(Hn===this.input){for(let Xn of this.tooltipViews)Xn.update&&Xn.update(Ce);return!1}let Un=[],qn=ke?[]:null;for(let Xn=0;Xnke[Kn]=Xn),ke.length=qn.length),this.input=Hn,this.tooltips=zn,this.tooltipViews=Un,!0}}function windowSpace(_n){let{win:Ce}=_n;return{top:0,left:0,bottom:Ce.innerHeight,right:Ce.innerWidth}}const tooltipConfig=Facet.define({combine:_n=>{var Ce,ke,$n;return{position:browser.ios?"absolute":((Ce=_n.find(Hn=>Hn.position))===null||Ce===void 0?void 0:Ce.position)||"fixed",parent:((ke=_n.find(Hn=>Hn.parent))===null||ke===void 0?void 0:ke.parent)||null,tooltipSpace:(($n=_n.find(Hn=>Hn.tooltipSpace))===null||$n===void 0?void 0:$n.tooltipSpace)||windowSpace}}}),knownHeight=new WeakMap,tooltipPlugin=ViewPlugin.fromClass(class{constructor(_n){this.view=_n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let Ce=_n.state.facet(tooltipConfig);this.position=Ce.position,this.parent=Ce.parent,this.classes=_n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new TooltipViewManager(_n,showTooltip,(ke,$n)=>this.createTooltip(ke,$n),ke=>{this.resizeObserver&&this.resizeObserver.unobserve(ke.dom),ke.dom.remove()}),this.above=this.manager.tooltips.map(ke=>!!ke.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(ke=>{Date.now()>this.lastTransaction-50&&ke.length>0&&ke[ke.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),_n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let _n of this.manager.tooltipViews)this.intersectionObserver.observe(_n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(_n){_n.transactions.length&&(this.lastTransaction=Date.now());let Ce=this.manager.update(_n,this.above);Ce&&this.observeIntersection();let ke=Ce||_n.geometryChanged,$n=_n.state.facet(tooltipConfig);if($n.position!=this.position&&!this.madeAbsolute){this.position=$n.position;for(let Hn of this.manager.tooltipViews)Hn.dom.style.position=this.position;ke=!0}if($n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=$n.parent,this.createContainer();for(let Hn of this.manager.tooltipViews)this.container.appendChild(Hn.dom);ke=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);ke&&this.maybeMeasure()}createTooltip(_n,Ce){let ke=_n.create(this.view),$n=Ce?Ce.dom:null;if(ke.dom.classList.add("cm-tooltip"),_n.arrow&&!ke.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let Hn=document.createElement("div");Hn.className="cm-tooltip-arrow",ke.dom.appendChild(Hn)}return ke.dom.style.position=this.position,ke.dom.style.top=Outside,ke.dom.style.left="0px",this.container.insertBefore(ke.dom,$n),ke.mount&&ke.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(ke.dom),ke}destroy(){var _n,Ce,ke;this.view.win.removeEventListener("resize",this.measureSoon);for(let $n of this.manager.tooltipViews)$n.dom.remove(),(_n=$n.destroy)===null||_n===void 0||_n.call($n);this.parent&&this.container.remove(),(Ce=this.resizeObserver)===null||Ce===void 0||Ce.disconnect(),(ke=this.intersectionObserver)===null||ke===void 0||ke.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let _n=this.view.dom.getBoundingClientRect(),Ce=1,ke=1,$n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:Hn}=this.manager.tooltipViews[0];if(browser.gecko)$n=Hn.offsetParent!=this.container.ownerDocument.body;else if(Hn.style.top==Outside&&Hn.style.left=="0px"){let zn=Hn.getBoundingClientRect();$n=Math.abs(zn.top+1e4)>1||Math.abs(zn.left)>1}}if($n||this.position=="absolute")if(this.parent){let Hn=this.parent.getBoundingClientRect();Hn.width&&Hn.height&&(Ce=Hn.width/this.parent.offsetWidth,ke=Hn.height/this.parent.offsetHeight)}else({scaleX:Ce,scaleY:ke}=this.view.viewState);return{editor:_n,parent:this.parent?this.container.getBoundingClientRect():_n,pos:this.manager.tooltips.map((Hn,zn)=>{let Un=this.manager.tooltipViews[zn];return Un.getCoords?Un.getCoords(Hn.pos):this.view.coordsAtPos(Hn.pos)}),size:this.manager.tooltipViews.map(({dom:Hn})=>Hn.getBoundingClientRect()),space:this.view.state.facet(tooltipConfig).tooltipSpace(this.view),scaleX:Ce,scaleY:ke,makeAbsolute:$n}}writeMeasure(_n){var Ce;if(_n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let qn of this.manager.tooltipViews)qn.dom.style.position="absolute"}let{editor:ke,space:$n,scaleX:Hn,scaleY:zn}=_n,Un=[];for(let qn=0;qn=Math.min(ke.bottom,$n.bottom)||io.rightMath.min(ke.right,$n.right)+.1){to.style.top=Outside;continue}let ho=Xn.arrow?Kn.dom.querySelector(".cm-tooltip-arrow"):null,bo=ho?7:0,Oo=uo.right-uo.left,So=(Ce=knownHeight.get(Kn))!==null&&Ce!==void 0?Ce:uo.bottom-uo.top,$o=Kn.offset||noOffset,Do=this.view.textDirection==Direction.LTR,xo=uo.width>$n.right-$n.left?Do?$n.left:$n.right-uo.width:Do?Math.max($n.left,Math.min(io.left-(ho?14:0)+$o.x,$n.right-Oo)):Math.min(Math.max($n.left,io.left-Oo+(ho?14:0)-$o.x),$n.right-Oo),Io=this.above[qn];!Xn.strictSide&&(Io?io.top-(uo.bottom-uo.top)-$o.y<$n.top:io.bottom+(uo.bottom-uo.top)+$o.y>$n.bottom)&&Io==$n.bottom-io.bottom>io.top-$n.top&&(Io=this.above[qn]=!Io);let Vo=(Io?io.top-$n.top:$n.bottom-io.bottom)-bo;if(Voxo&&Go.topJo&&(Jo=Io?Go.top-So-2-bo:Go.bottom+bo+2);if(this.position=="absolute"?(to.style.top=(Jo-_n.parent.top)/zn+"px",to.style.left=(xo-_n.parent.left)/Hn+"px"):(to.style.top=Jo/zn+"px",to.style.left=xo/Hn+"px"),ho){let Go=io.left+(Do?$o.x:-$o.x)-(xo+14-7);ho.style.left=Go/Hn+"px"}Kn.overlap!==!0&&Un.push({left:xo,top:Jo,right:Mo,bottom:Jo+So}),to.classList.toggle("cm-tooltip-above",Io),to.classList.toggle("cm-tooltip-below",!Io),Kn.positioned&&Kn.positioned(_n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let _n of this.manager.tooltipViews)_n.dom.style.top=Outside}},{eventObservers:{scroll(){this.maybeMeasure()}}}),baseTheme$4=EditorView.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),noOffset={x:0,y:0},showTooltip=Facet.define({enables:[tooltipPlugin,baseTheme$4]}),showHoverTooltip=Facet.define({combine:_n=>_n.reduce((Ce,ke)=>Ce.concat(ke),[])});class HoverTooltipHost{static create(Ce){return new HoverTooltipHost(Ce)}constructor(Ce){this.view=Ce,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new TooltipViewManager(Ce,showHoverTooltip,(ke,$n)=>this.createHostedView(ke,$n),ke=>ke.dom.remove())}createHostedView(Ce,ke){let $n=Ce.create(this.view);return $n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore($n.dom,ke?ke.dom.nextSibling:this.dom.firstChild),this.mounted&&$n.mount&&$n.mount(this.view),$n}mount(Ce){for(let ke of this.manager.tooltipViews)ke.mount&&ke.mount(Ce);this.mounted=!0}positioned(Ce){for(let ke of this.manager.tooltipViews)ke.positioned&&ke.positioned(Ce)}update(Ce){this.manager.update(Ce)}destroy(){var Ce;for(let ke of this.manager.tooltipViews)(Ce=ke.destroy)===null||Ce===void 0||Ce.call(ke)}passProp(Ce){let ke;for(let $n of this.manager.tooltipViews){let Hn=$n[Ce];if(Hn!==void 0){if(ke===void 0)ke=Hn;else if(ke!==Hn)return}}return ke}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const showHoverTooltipHost=showTooltip.compute([showHoverTooltip],_n=>{let Ce=_n.facet(showHoverTooltip);return Ce.length===0?null:{pos:Math.min(...Ce.map(ke=>ke.pos)),end:Math.max(...Ce.map(ke=>{var $n;return($n=ke.end)!==null&&$n!==void 0?$n:ke.pos})),create:HoverTooltipHost.create,above:Ce[0].above,arrow:Ce.some(ke=>ke.arrow)}});class HoverPlugin{constructor(Ce,ke,$n,Hn,zn){this.view=Ce,this.source=ke,this.field=$n,this.setHover=Hn,this.hoverTime=zn,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:Ce.dom,time:0},this.checkHover=this.checkHover.bind(this),Ce.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),Ce.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let Ce=Date.now()-this.lastMove.time;Ceqn.bottom||ke.xqn.right+Ce.defaultCharacterWidth)return;let Xn=Ce.bidiSpans(Ce.state.doc.lineAt(Hn)).find(to=>to.from<=Hn&&to.to>=Hn),Kn=Xn&&Xn.dir==Direction.RTL?-1:1;zn=ke.x{this.pending==qn&&(this.pending=null,Xn&&!(Array.isArray(Xn)&&!Xn.length)&&Ce.dispatch({effects:this.setHover.of(Array.isArray(Xn)?Xn:[Xn])}))},Xn=>logException(Ce.state,Xn,"hover tooltip"))}else Un&&!(Array.isArray(Un)&&!Un.length)&&Ce.dispatch({effects:this.setHover.of(Array.isArray(Un)?Un:[Un])})}get tooltip(){let Ce=this.view.plugin(tooltipPlugin),ke=Ce?Ce.manager.tooltips.findIndex($n=>$n.create==HoverTooltipHost.create):-1;return ke>-1?Ce.manager.tooltipViews[ke]:null}mousemove(Ce){var ke,$n;this.lastMove={x:Ce.clientX,y:Ce.clientY,target:Ce.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:Hn,tooltip:zn}=this;if(Hn.length&&zn&&!isInTooltip(zn.dom,Ce)||this.pending){let{pos:Un}=Hn[0]||this.pending,qn=($n=(ke=Hn[0])===null||ke===void 0?void 0:ke.end)!==null&&$n!==void 0?$n:Un;(Un==qn?this.view.posAtCoords(this.lastMove)!=Un:!isOverRange(this.view,Un,qn,Ce.clientX,Ce.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(Ce){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:ke}=this;if(ke.length){let{tooltip:$n}=this;$n&&$n.dom.contains(Ce.relatedTarget)?this.watchTooltipLeave($n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(Ce){let ke=$n=>{Ce.removeEventListener("mouseleave",ke),this.active.length&&!this.view.dom.contains($n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};Ce.addEventListener("mouseleave",ke)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const tooltipMargin=4;function isInTooltip(_n,Ce){let ke=_n.getBoundingClientRect();return Ce.clientX>=ke.left-tooltipMargin&&Ce.clientX<=ke.right+tooltipMargin&&Ce.clientY>=ke.top-tooltipMargin&&Ce.clientY<=ke.bottom+tooltipMargin}function isOverRange(_n,Ce,ke,$n,Hn,zn){let Un=_n.scrollDOM.getBoundingClientRect(),qn=_n.documentTop+_n.documentPadding.top+_n.contentHeight;if(Un.left>$n||Un.right<$n||Un.top>Hn||Math.min(Un.bottom,qn)=Ce&&Xn<=ke}function hoverTooltip(_n,Ce={}){let ke=StateEffect.define(),$n=StateField.define({create(){return[]},update(Hn,zn){if(Hn.length&&(Ce.hideOnChange&&(zn.docChanged||zn.selection)?Hn=[]:Ce.hideOn&&(Hn=Hn.filter(Un=>!Ce.hideOn(zn,Un))),zn.docChanged)){let Un=[];for(let qn of Hn){let Xn=zn.changes.mapPos(qn.pos,-1,MapMode.TrackDel);if(Xn!=null){let Kn=Object.assign(Object.create(null),qn);Kn.pos=Xn,Kn.end!=null&&(Kn.end=zn.changes.mapPos(Kn.end)),Un.push(Kn)}}Hn=Un}for(let Un of zn.effects)Un.is(ke)&&(Hn=Un.value),Un.is(closeHoverTooltipEffect)&&(Hn=[]);return Hn},provide:Hn=>showHoverTooltip.from(Hn)});return{active:$n,extension:[$n,ViewPlugin.define(Hn=>new HoverPlugin(Hn,_n,$n,ke,Ce.hoverTime||300)),showHoverTooltipHost]}}function getTooltip(_n,Ce){let ke=_n.plugin(tooltipPlugin);if(!ke)return null;let $n=ke.manager.tooltips.indexOf(Ce);return $n<0?null:ke.manager.tooltipViews[$n]}const closeHoverTooltipEffect=StateEffect.define(),panelConfig=Facet.define({combine(_n){let Ce,ke;for(let $n of _n)Ce=Ce||$n.topContainer,ke=ke||$n.bottomContainer;return{topContainer:Ce,bottomContainer:ke}}});function getPanel(_n,Ce){let ke=_n.plugin(panelPlugin),$n=ke?ke.specs.indexOf(Ce):-1;return $n>-1?ke.panels[$n]:null}const panelPlugin=ViewPlugin.fromClass(class{constructor(_n){this.input=_n.state.facet(showPanel),this.specs=this.input.filter(ke=>ke),this.panels=this.specs.map(ke=>ke(_n));let Ce=_n.state.facet(panelConfig);this.top=new PanelGroup(_n,!0,Ce.topContainer),this.bottom=new PanelGroup(_n,!1,Ce.bottomContainer),this.top.sync(this.panels.filter(ke=>ke.top)),this.bottom.sync(this.panels.filter(ke=>!ke.top));for(let ke of this.panels)ke.dom.classList.add("cm-panel"),ke.mount&&ke.mount()}update(_n){let Ce=_n.state.facet(panelConfig);this.top.container!=Ce.topContainer&&(this.top.sync([]),this.top=new PanelGroup(_n.view,!0,Ce.topContainer)),this.bottom.container!=Ce.bottomContainer&&(this.bottom.sync([]),this.bottom=new PanelGroup(_n.view,!1,Ce.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let ke=_n.state.facet(showPanel);if(ke!=this.input){let $n=ke.filter(Xn=>Xn),Hn=[],zn=[],Un=[],qn=[];for(let Xn of $n){let Kn=this.specs.indexOf(Xn),to;Kn<0?(to=Xn(_n.view),qn.push(to)):(to=this.panels[Kn],to.update&&to.update(_n)),Hn.push(to),(to.top?zn:Un).push(to)}this.specs=$n,this.panels=Hn,this.top.sync(zn),this.bottom.sync(Un);for(let Xn of qn)Xn.dom.classList.add("cm-panel"),Xn.mount&&Xn.mount()}else for(let $n of this.panels)$n.update&&$n.update(_n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:_n=>EditorView.scrollMargins.of(Ce=>{let ke=Ce.plugin(_n);return ke&&{top:ke.top.scrollMargin(),bottom:ke.bottom.scrollMargin()}})});class PanelGroup{constructor(Ce,ke,$n){this.view=Ce,this.top=ke,this.container=$n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(Ce){for(let ke of this.panels)ke.destroy&&Ce.indexOf(ke)<0&&ke.destroy();this.panels=Ce,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let ke=this.container||this.view.dom;ke.insertBefore(this.dom,this.top?ke.firstChild:null)}let Ce=this.dom.firstChild;for(let ke of this.panels)if(ke.dom.parentNode==this.dom){for(;Ce!=ke.dom;)Ce=rm(Ce);Ce=Ce.nextSibling}else this.dom.insertBefore(ke.dom,Ce);for(;Ce;)Ce=rm(Ce)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let Ce of this.classes.split(" "))Ce&&this.container.classList.remove(Ce);for(let Ce of(this.classes=this.view.themeClasses).split(" "))Ce&&this.container.classList.add(Ce)}}}function rm(_n){let Ce=_n.nextSibling;return _n.remove(),Ce}const showPanel=Facet.define({enables:panelPlugin});class GutterMarker extends RangeValue{compare(Ce){return this==Ce||this.constructor==Ce.constructor&&this.eq(Ce)}eq(Ce){return!1}destroy(Ce){}}GutterMarker.prototype.elementClass="";GutterMarker.prototype.toDOM=void 0;GutterMarker.prototype.mapMode=MapMode.TrackBefore;GutterMarker.prototype.startSide=GutterMarker.prototype.endSide=-1;GutterMarker.prototype.point=!0;const gutterLineClass=Facet.define(),gutterWidgetClass=Facet.define(),defaults$1={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>RangeSet.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},activeGutters=Facet.define();function gutter(_n){return[gutters(),activeGutters.of(Object.assign(Object.assign({},defaults$1),_n))]}const unfixGutters=Facet.define({combine:_n=>_n.some(Ce=>Ce)});function gutters(_n){return[gutterView]}const gutterView=ViewPlugin.fromClass(class{constructor(_n){this.view=_n,this.prevViewport=_n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=_n.state.facet(activeGutters).map(Ce=>new SingleGutterView(_n,Ce));for(let Ce of this.gutters)this.dom.appendChild(Ce.dom);this.fixed=!_n.state.facet(unfixGutters),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),_n.scrollDOM.insertBefore(this.dom,_n.contentDOM)}update(_n){if(this.updateGutters(_n)){let Ce=this.prevViewport,ke=_n.view.viewport,$n=Math.min(Ce.to,ke.to)-Math.max(Ce.from,ke.from);this.syncGutters($n<(ke.to-ke.from)*.8)}_n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(unfixGutters)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=_n.view.viewport}syncGutters(_n){let Ce=this.dom.nextSibling;_n&&this.dom.remove();let ke=RangeSet.iter(this.view.state.facet(gutterLineClass),this.view.viewport.from),$n=[],Hn=this.gutters.map(zn=>new UpdateContext(zn,this.view.viewport,-this.view.documentPadding.top));for(let zn of this.view.viewportLineBlocks)if($n.length&&($n=[]),Array.isArray(zn.type)){let Un=!0;for(let qn of zn.type)if(qn.type==BlockType.Text&&Un){advanceCursor(ke,$n,qn.from);for(let Xn of Hn)Xn.line(this.view,qn,$n);Un=!1}else if(qn.widget)for(let Xn of Hn)Xn.widget(this.view,qn)}else if(zn.type==BlockType.Text){advanceCursor(ke,$n,zn.from);for(let Un of Hn)Un.line(this.view,zn,$n)}else if(zn.widget)for(let Un of Hn)Un.widget(this.view,zn);for(let zn of Hn)zn.finish();_n&&this.view.scrollDOM.insertBefore(this.dom,Ce)}updateGutters(_n){let Ce=_n.startState.facet(activeGutters),ke=_n.state.facet(activeGutters),$n=_n.docChanged||_n.heightChanged||_n.viewportChanged||!RangeSet.eq(_n.startState.facet(gutterLineClass),_n.state.facet(gutterLineClass),_n.view.viewport.from,_n.view.viewport.to);if(Ce==ke)for(let Hn of this.gutters)Hn.update(_n)&&($n=!0);else{$n=!0;let Hn=[];for(let zn of ke){let Un=Ce.indexOf(zn);Un<0?Hn.push(new SingleGutterView(this.view,zn)):(this.gutters[Un].update(_n),Hn.push(this.gutters[Un]))}for(let zn of this.gutters)zn.dom.remove(),Hn.indexOf(zn)<0&&zn.destroy();for(let zn of Hn)this.dom.appendChild(zn.dom);this.gutters=Hn}return $n}destroy(){for(let _n of this.gutters)_n.destroy();this.dom.remove()}},{provide:_n=>EditorView.scrollMargins.of(Ce=>{let ke=Ce.plugin(_n);return!ke||ke.gutters.length==0||!ke.fixed?null:Ce.textDirection==Direction.LTR?{left:ke.dom.offsetWidth*Ce.scaleX}:{right:ke.dom.offsetWidth*Ce.scaleX}})});function asArray(_n){return Array.isArray(_n)?_n:[_n]}function advanceCursor(_n,Ce,ke){for(;_n.value&&_n.from<=ke;)_n.from==ke&&Ce.push(_n.value),_n.next()}class UpdateContext{constructor(Ce,ke,$n){this.gutter=Ce,this.height=$n,this.i=0,this.cursor=RangeSet.iter(Ce.markers,ke.from)}addElement(Ce,ke,$n){let{gutter:Hn}=this,zn=(ke.top-this.height)/Ce.scaleY,Un=ke.height/Ce.scaleY;if(this.i==Hn.elements.length){let qn=new GutterElement(Ce,Un,zn,$n);Hn.elements.push(qn),Hn.dom.appendChild(qn.dom)}else Hn.elements[this.i].update(Ce,Un,zn,$n);this.height=ke.bottom,this.i++}line(Ce,ke,$n){let Hn=[];advanceCursor(this.cursor,Hn,ke.from),$n.length&&(Hn=Hn.concat($n));let zn=this.gutter.config.lineMarker(Ce,ke,Hn);zn&&Hn.unshift(zn);let Un=this.gutter;Hn.length==0&&!Un.config.renderEmptyElements||this.addElement(Ce,ke,Hn)}widget(Ce,ke){let $n=this.gutter.config.widgetMarker(Ce,ke.widget,ke),Hn=$n?[$n]:null;for(let zn of Ce.state.facet(gutterWidgetClass)){let Un=zn(Ce,ke.widget,ke);Un&&(Hn||(Hn=[])).push(Un)}Hn&&this.addElement(Ce,ke,Hn)}finish(){let Ce=this.gutter;for(;Ce.elements.length>this.i;){let ke=Ce.elements.pop();Ce.dom.removeChild(ke.dom),ke.destroy()}}}class SingleGutterView{constructor(Ce,ke){this.view=Ce,this.config=ke,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let $n in ke.domEventHandlers)this.dom.addEventListener($n,Hn=>{let zn=Hn.target,Un;if(zn!=this.dom&&this.dom.contains(zn)){for(;zn.parentNode!=this.dom;)zn=zn.parentNode;let Xn=zn.getBoundingClientRect();Un=(Xn.top+Xn.bottom)/2}else Un=Hn.clientY;let qn=Ce.lineBlockAtHeight(Un-Ce.documentTop);ke.domEventHandlers[$n](Ce,qn,Hn)&&Hn.preventDefault()});this.markers=asArray(ke.markers(Ce)),ke.initialSpacer&&(this.spacer=new GutterElement(Ce,0,0,[ke.initialSpacer(Ce)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(Ce){let ke=this.markers;if(this.markers=asArray(this.config.markers(Ce.view)),this.spacer&&this.config.updateSpacer){let Hn=this.config.updateSpacer(this.spacer.markers[0],Ce);Hn!=this.spacer.markers[0]&&this.spacer.update(Ce.view,0,0,[Hn])}let $n=Ce.view.viewport;return!RangeSet.eq(this.markers,ke,$n.from,$n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(Ce):!1)}destroy(){for(let Ce of this.elements)Ce.destroy()}}class GutterElement{constructor(Ce,ke,$n,Hn){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(Ce,ke,$n,Hn)}update(Ce,ke,$n,Hn){this.height!=ke&&(this.height=ke,this.dom.style.height=ke+"px"),this.above!=$n&&(this.dom.style.marginTop=(this.above=$n)?$n+"px":""),sameMarkers(this.markers,Hn)||this.setMarkers(Ce,Hn)}setMarkers(Ce,ke){let $n="cm-gutterElement",Hn=this.dom.firstChild;for(let zn=0,Un=0;;){let qn=Un,Xn=znzn(qn,Xn,Kn)||Un(qn,Xn,Kn):Un}return $n}})}});class NumberMarker extends GutterMarker{constructor(Ce){super(),this.number=Ce}eq(Ce){return this.number==Ce.number}toDOM(){return document.createTextNode(this.number)}}function formatNumber(_n,Ce){return _n.state.facet(lineNumberConfig).formatNumber(Ce,_n.state)}const lineNumberGutter=activeGutters.compute([lineNumberConfig],_n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(Ce){return Ce.state.facet(lineNumberMarkers)},lineMarker(Ce,ke,$n){return $n.some(Hn=>Hn.toDOM)?null:new NumberMarker(formatNumber(Ce,Ce.state.doc.lineAt(ke.from).number))},widgetMarker:(Ce,ke,$n)=>{for(let Hn of Ce.state.facet(lineNumberWidgetMarker)){let zn=Hn(Ce,ke,$n);if(zn)return zn}return null},lineMarkerChange:Ce=>Ce.startState.facet(lineNumberConfig)!=Ce.state.facet(lineNumberConfig),initialSpacer(Ce){return new NumberMarker(formatNumber(Ce,maxLineNumber(Ce.state.doc.lines)))},updateSpacer(Ce,ke){let $n=formatNumber(ke.view,maxLineNumber(ke.view.state.doc.lines));return $n==Ce.number?Ce:new NumberMarker($n)},domEventHandlers:_n.facet(lineNumberConfig).domEventHandlers}));function lineNumbers(_n={}){return[lineNumberConfig.of(_n),gutters(),lineNumberGutter]}function maxLineNumber(_n){let Ce=9;for(;Ce<_n;)Ce=Ce*10+9;return Ce}const activeLineGutterMarker=new class extends GutterMarker{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},activeLineGutterHighlighter=gutterLineClass.compute(["selection"],_n=>{let Ce=[],ke=-1;for(let $n of _n.selection.ranges){let Hn=_n.doc.lineAt($n.head).from;Hn>ke&&(ke=Hn,Ce.push(activeLineGutterMarker.range(Hn)))}return RangeSet.of(Ce)});function highlightActiveLineGutter(){return activeLineGutterHighlighter}const DefaultBufferLength=1024;let nextPropID=0,Range$1=class{constructor(Ce,ke){this.from=Ce,this.to=ke}};class NodeProp{constructor(Ce={}){this.id=nextPropID++,this.perNode=!!Ce.perNode,this.deserialize=Ce.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(Ce){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof Ce!="function"&&(Ce=NodeType.match(Ce)),ke=>{let $n=Ce(ke);return $n===void 0?null:[this,$n]}}}NodeProp.closedBy=new NodeProp({deserialize:_n=>_n.split(" ")});NodeProp.openedBy=new NodeProp({deserialize:_n=>_n.split(" ")});NodeProp.group=new NodeProp({deserialize:_n=>_n.split(" ")});NodeProp.isolate=new NodeProp({deserialize:_n=>{if(_n&&_n!="rtl"&&_n!="ltr"&&_n!="auto")throw new RangeError("Invalid value for isolate: "+_n);return _n||"auto"}});NodeProp.contextHash=new NodeProp({perNode:!0});NodeProp.lookAhead=new NodeProp({perNode:!0});NodeProp.mounted=new NodeProp({perNode:!0});class MountedTree{constructor(Ce,ke,$n){this.tree=Ce,this.overlay=ke,this.parser=$n}static get(Ce){return Ce&&Ce.props&&Ce.props[NodeProp.mounted.id]}}const noProps=Object.create(null);class NodeType{constructor(Ce,ke,$n,Hn=0){this.name=Ce,this.props=ke,this.id=$n,this.flags=Hn}static define(Ce){let ke=Ce.props&&Ce.props.length?Object.create(null):noProps,$n=(Ce.top?1:0)|(Ce.skipped?2:0)|(Ce.error?4:0)|(Ce.name==null?8:0),Hn=new NodeType(Ce.name||"",ke,Ce.id,$n);if(Ce.props){for(let zn of Ce.props)if(Array.isArray(zn)||(zn=zn(Hn)),zn){if(zn[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");ke[zn[0].id]=zn[1]}}return Hn}prop(Ce){return this.props[Ce.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(Ce){if(typeof Ce=="string"){if(this.name==Ce)return!0;let ke=this.prop(NodeProp.group);return ke?ke.indexOf(Ce)>-1:!1}return this.id==Ce}static match(Ce){let ke=Object.create(null);for(let $n in Ce)for(let Hn of $n.split(" "))ke[Hn]=Ce[$n];return $n=>{for(let Hn=$n.prop(NodeProp.group),zn=-1;zn<(Hn?Hn.length:0);zn++){let Un=ke[zn<0?$n.name:Hn[zn]];if(Un)return Un}}}}NodeType.none=new NodeType("",Object.create(null),0,8);class NodeSet{constructor(Ce){this.types=Ce;for(let ke=0;ke0;for(let Xn=this.cursor(Un|IterMode.IncludeAnonymous);;){let Kn=!1;if(Xn.from<=zn&&Xn.to>=Hn&&(!qn&&Xn.type.isAnonymous||ke(Xn)!==!1)){if(Xn.firstChild())continue;Kn=!0}for(;Kn&&$n&&(qn||!Xn.type.isAnonymous)&&$n(Xn),!Xn.nextSibling();){if(!Xn.parent())return;Kn=!0}}}prop(Ce){return Ce.perNode?this.props?this.props[Ce.id]:void 0:this.type.prop(Ce)}get propValues(){let Ce=[];if(this.props)for(let ke in this.props)Ce.push([+ke,this.props[ke]]);return Ce}balance(Ce={}){return this.children.length<=8?this:balanceRange(NodeType.none,this.children,this.positions,0,this.children.length,0,this.length,(ke,$n,Hn)=>new Tree(this.type,ke,$n,Hn,this.propValues),Ce.makeTree||((ke,$n,Hn)=>new Tree(NodeType.none,ke,$n,Hn)))}static build(Ce){return buildTree(Ce)}}Tree.empty=new Tree(NodeType.none,[],[],0);class FlatBufferCursor{constructor(Ce,ke){this.buffer=Ce,this.index=ke}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new FlatBufferCursor(this.buffer,this.index)}}class TreeBuffer{constructor(Ce,ke,$n){this.buffer=Ce,this.length=ke,this.set=$n}get type(){return NodeType.none}toString(){let Ce=[];for(let ke=0;ke0));Xn=Un[Xn+3]);return qn}slice(Ce,ke,$n){let Hn=this.buffer,zn=new Uint16Array(ke-Ce),Un=0;for(let qn=Ce,Xn=0;qn=Ce&&keCe;case 1:return ke<=Ce&&$n>Ce;case 2:return $n>Ce;case 4:return!0}}function resolveNode(_n,Ce,ke,$n){for(var Hn;_n.from==_n.to||(ke<1?_n.from>=Ce:_n.from>Ce)||(ke>-1?_n.to<=Ce:_n.to0?qn.length:-1;Ce!=Kn;Ce+=ke){let to=qn[Ce],io=Xn[Ce]+Un.from;if(checkSide(Hn,$n,io,io+to.length)){if(to instanceof TreeBuffer){if(zn&IterMode.ExcludeBuffers)continue;let uo=to.findChild(0,to.buffer.length,ke,$n-io,Hn);if(uo>-1)return new BufferNode(new BufferContext(Un,to,Ce,io),null,uo)}else if(zn&IterMode.IncludeAnonymous||!to.type.isAnonymous||hasChild(to)){let uo;if(!(zn&IterMode.IgnoreMounts)&&(uo=MountedTree.get(to))&&!uo.overlay)return new TreeNode(uo.tree,io,Ce,Un);let ho=new TreeNode(to,io,Ce,Un);return zn&IterMode.IncludeAnonymous||!ho.type.isAnonymous?ho:ho.nextChild(ke<0?to.children.length-1:0,ke,$n,Hn)}}}if(zn&IterMode.IncludeAnonymous||!Un.type.isAnonymous||(Un.index>=0?Ce=Un.index+ke:Ce=ke<0?-1:Un._parent._tree.children.length,Un=Un._parent,!Un))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(Ce){return this.nextChild(0,1,Ce,2)}childBefore(Ce){return this.nextChild(this._tree.children.length-1,-1,Ce,-2)}enter(Ce,ke,$n=0){let Hn;if(!($n&IterMode.IgnoreOverlays)&&(Hn=MountedTree.get(this._tree))&&Hn.overlay){let zn=Ce-this.from;for(let{from:Un,to:qn}of Hn.overlay)if((ke>0?Un<=zn:Un=zn:qn>zn))return new TreeNode(Hn.tree,Hn.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,Ce,ke,$n)}nextSignificantParent(){let Ce=this;for(;Ce.type.isAnonymous&&Ce._parent;)Ce=Ce._parent;return Ce}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function getChildren(_n,Ce,ke,$n){let Hn=_n.cursor(),zn=[];if(!Hn.firstChild())return zn;if(ke!=null){for(let Un=!1;!Un;)if(Un=Hn.type.is(ke),!Hn.nextSibling())return zn}for(;;){if($n!=null&&Hn.type.is($n))return zn;if(Hn.type.is(Ce)&&zn.push(Hn.node),!Hn.nextSibling())return $n==null?zn:[]}}function matchNodeContext(_n,Ce,ke=Ce.length-1){for(let $n=_n.parent;ke>=0;$n=$n.parent){if(!$n)return!1;if(!$n.type.isAnonymous){if(Ce[ke]&&Ce[ke]!=$n.name)return!1;ke--}}return!0}class BufferContext{constructor(Ce,ke,$n,Hn){this.parent=Ce,this.buffer=ke,this.index=$n,this.start=Hn}}class BufferNode extends BaseNode{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(Ce,ke,$n){super(),this.context=Ce,this._parent=ke,this.index=$n,this.type=Ce.buffer.set.types[Ce.buffer.buffer[$n]]}child(Ce,ke,$n){let{buffer:Hn}=this.context,zn=Hn.findChild(this.index+4,Hn.buffer[this.index+3],Ce,ke-this.context.start,$n);return zn<0?null:new BufferNode(this.context,this,zn)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(Ce){return this.child(1,Ce,2)}childBefore(Ce){return this.child(-1,Ce,-2)}enter(Ce,ke,$n=0){if($n&IterMode.ExcludeBuffers)return null;let{buffer:Hn}=this.context,zn=Hn.findChild(this.index+4,Hn.buffer[this.index+3],ke>0?1:-1,Ce-this.context.start,ke);return zn<0?null:new BufferNode(this.context,this,zn)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(Ce){return this._parent?null:this.context.parent.nextChild(this.context.index+Ce,Ce,0,4)}get nextSibling(){let{buffer:Ce}=this.context,ke=Ce.buffer[this.index+3];return ke<(this._parent?Ce.buffer[this._parent.index+3]:Ce.buffer.length)?new BufferNode(this.context,this._parent,ke):this.externalSibling(1)}get prevSibling(){let{buffer:Ce}=this.context,ke=this._parent?this._parent.index+4:0;return this.index==ke?this.externalSibling(-1):new BufferNode(this.context,this._parent,Ce.findChild(ke,this.index,-1,0,4))}get tree(){return null}toTree(){let Ce=[],ke=[],{buffer:$n}=this.context,Hn=this.index+4,zn=$n.buffer[this.index+3];if(zn>Hn){let Un=$n.buffer[this.index+1];Ce.push($n.slice(Hn,zn,Un)),ke.push(0)}return new Tree(this.type,Ce,ke,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function iterStack(_n){if(!_n.length)return null;let Ce=0,ke=_n[0];for(let zn=1;zn<_n.length;zn++){let Un=_n[zn];(Un.from>ke.from||Un.to=Ce){let qn=new TreeNode(Un.tree,Un.overlay[0].from+zn.from,-1,zn);(Hn||(Hn=[$n])).push(resolveNode(qn,Ce,ke,!1))}}return Hn?iterStack(Hn):$n}class TreeCursor{get name(){return this.type.name}constructor(Ce,ke=0){if(this.mode=ke,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,Ce instanceof TreeNode)this.yieldNode(Ce);else{this._tree=Ce.context.parent,this.buffer=Ce.context;for(let $n=Ce._parent;$n;$n=$n._parent)this.stack.unshift($n.index);this.bufferNode=Ce,this.yieldBuf(Ce.index)}}yieldNode(Ce){return Ce?(this._tree=Ce,this.type=Ce.type,this.from=Ce.from,this.to=Ce.to,!0):!1}yieldBuf(Ce,ke){this.index=Ce;let{start:$n,buffer:Hn}=this.buffer;return this.type=ke||Hn.set.types[Hn.buffer[Ce]],this.from=$n+Hn.buffer[Ce+1],this.to=$n+Hn.buffer[Ce+2],!0}yield(Ce){return Ce?Ce instanceof TreeNode?(this.buffer=null,this.yieldNode(Ce)):(this.buffer=Ce.context,this.yieldBuf(Ce.index,Ce.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(Ce,ke,$n){if(!this.buffer)return this.yield(this._tree.nextChild(Ce<0?this._tree._tree.children.length-1:0,Ce,ke,$n,this.mode));let{buffer:Hn}=this.buffer,zn=Hn.findChild(this.index+4,Hn.buffer[this.index+3],Ce,ke-this.buffer.start,$n);return zn<0?!1:(this.stack.push(this.index),this.yieldBuf(zn))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(Ce){return this.enterChild(1,Ce,2)}childBefore(Ce){return this.enterChild(-1,Ce,-2)}enter(Ce,ke,$n=this.mode){return this.buffer?$n&IterMode.ExcludeBuffers?!1:this.enterChild(1,Ce,ke):this.yield(this._tree.enter(Ce,ke,$n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&IterMode.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let Ce=this.mode&IterMode.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(Ce)}sibling(Ce){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+Ce,Ce,0,4,this.mode)):!1;let{buffer:ke}=this.buffer,$n=this.stack.length-1;if(Ce<0){let Hn=$n<0?0:this.stack[$n]+4;if(this.index!=Hn)return this.yieldBuf(ke.findChild(Hn,this.index,-1,0,4))}else{let Hn=ke.buffer[this.index+3];if(Hn<($n<0?ke.buffer.length:ke.buffer[this.stack[$n]+3]))return this.yieldBuf(Hn)}return $n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+Ce,Ce,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(Ce){let ke,$n,{buffer:Hn}=this;if(Hn){if(Ce>0){if(this.index-1)for(let zn=ke+Ce,Un=Ce<0?-1:$n._tree.children.length;zn!=Un;zn+=Ce){let qn=$n._tree.children[zn];if(this.mode&IterMode.IncludeAnonymous||qn instanceof TreeBuffer||!qn.type.isAnonymous||hasChild(qn))return!1}return!0}move(Ce,ke){if(ke&&this.enterChild(Ce,0,4))return!0;for(;;){if(this.sibling(Ce))return!0;if(this.atLastNode(Ce)||!this.parent())return!1}}next(Ce=!0){return this.move(1,Ce)}prev(Ce=!0){return this.move(-1,Ce)}moveTo(Ce,ke=0){for(;(this.from==this.to||(ke<1?this.from>=Ce:this.from>Ce)||(ke>-1?this.to<=Ce:this.to=0;){for(let Un=Ce;Un;Un=Un._parent)if(Un.index==Hn){if(Hn==this.index)return Un;ke=Un,$n=zn+1;break e}Hn=this.stack[--zn]}for(let Hn=$n;Hn=0;zn--){if(zn<0)return matchNodeContext(this.node,Ce,Hn);let Un=$n[ke.buffer[this.stack[zn]]];if(!Un.isAnonymous){if(Ce[Hn]&&Ce[Hn]!=Un.name)return!1;Hn--}}return!0}}function hasChild(_n){return _n.children.some(Ce=>Ce instanceof TreeBuffer||!Ce.type.isAnonymous||hasChild(Ce))}function buildTree(_n){var Ce;let{buffer:ke,nodeSet:$n,maxBufferLength:Hn=DefaultBufferLength,reused:zn=[],minRepeatType:Un=$n.types.length}=_n,qn=Array.isArray(ke)?new FlatBufferCursor(ke,ke.length):ke,Xn=$n.types,Kn=0,to=0;function io(Vo,Jo,Mo,Go,os,ms){let{id:is,start:Yo,end:Ys,size:sr}=qn,Js=to;for(;sr<0;)if(qn.next(),sr==-1){let cr=zn[is];Mo.push(cr),Go.push(Yo-Vo);return}else if(sr==-3){Kn=is;return}else if(sr==-4){to=is;return}else throw new RangeError(`Unrecognized record size: ${sr}`);let ko=Xn[is],gs,xs,Qr=Yo-Vo;if(Ys-Yo<=Hn&&(xs=So(qn.pos-Jo,os))){let cr=new Uint16Array(xs.size-xs.skip),ws=qn.pos-xs.size,Fs=cr.length;for(;qn.pos>ws;)Fs=$o(xs.start,cr,Fs);gs=new TreeBuffer(cr,Ys-xs.start,$n),Qr=xs.start-Vo}else{let cr=qn.pos-sr;qn.next();let ws=[],Fs=[],Br=is>=Un?is:-1,_r=0,ha=Ys;for(;qn.pos>cr;)Br>=0&&qn.id==Br&&qn.size>=0?(qn.end<=ha-Hn&&(bo(ws,Fs,Yo,_r,qn.end,ha,Br,Js),_r=ws.length,ha=qn.end),qn.next()):ms>2500?uo(Yo,cr,ws,Fs):io(Yo,cr,ws,Fs,Br,ms+1);if(Br>=0&&_r>0&&_r-1&&_r>0){let hs=ho(ko);gs=balanceRange(ko,ws,Fs,0,ws.length,0,Ys-Yo,hs,hs)}else gs=Oo(ko,ws,Fs,Ys-Yo,Js-Ys)}Mo.push(gs),Go.push(Qr)}function uo(Vo,Jo,Mo,Go){let os=[],ms=0,is=-1;for(;qn.pos>Jo;){let{id:Yo,start:Ys,end:sr,size:Js}=qn;if(Js>4)qn.next();else{if(is>-1&&Ys=0;sr-=3)Yo[Js++]=os[sr],Yo[Js++]=os[sr+1]-Ys,Yo[Js++]=os[sr+2]-Ys,Yo[Js++]=Js;Mo.push(new TreeBuffer(Yo,os[2]-Ys,$n)),Go.push(Ys-Vo)}}function ho(Vo){return(Jo,Mo,Go)=>{let os=0,ms=Jo.length-1,is,Yo;if(ms>=0&&(is=Jo[ms])instanceof Tree){if(!ms&&is.type==Vo&&is.length==Go)return is;(Yo=is.prop(NodeProp.lookAhead))&&(os=Mo[ms]+is.length+Yo)}return Oo(Vo,Jo,Mo,Go,os)}}function bo(Vo,Jo,Mo,Go,os,ms,is,Yo){let Ys=[],sr=[];for(;Vo.length>Go;)Ys.push(Vo.pop()),sr.push(Jo.pop()+Mo-os);Vo.push(Oo($n.types[is],Ys,sr,ms-os,Yo-ms)),Jo.push(os-Mo)}function Oo(Vo,Jo,Mo,Go,os=0,ms){if(Kn){let is=[NodeProp.contextHash,Kn];ms=ms?[is].concat(ms):[is]}if(os>25){let is=[NodeProp.lookAhead,os];ms=ms?[is].concat(ms):[is]}return new Tree(Vo,Jo,Mo,Go,ms)}function So(Vo,Jo){let Mo=qn.fork(),Go=0,os=0,ms=0,is=Mo.end-Hn,Yo={size:0,start:0,skip:0};e:for(let Ys=Mo.pos-Vo;Mo.pos>Ys;){let sr=Mo.size;if(Mo.id==Jo&&sr>=0){Yo.size=Go,Yo.start=os,Yo.skip=ms,ms+=4,Go+=4,Mo.next();continue}let Js=Mo.pos-sr;if(sr<0||Js=Un?4:0,gs=Mo.start;for(Mo.next();Mo.pos>Js;){if(Mo.size<0)if(Mo.size==-3)ko+=4;else break e;else Mo.id>=Un&&(ko+=4);Mo.next()}os=gs,Go+=sr,ms+=ko}return(Jo<0||Go==Vo)&&(Yo.size=Go,Yo.start=os,Yo.skip=ms),Yo.size>4?Yo:void 0}function $o(Vo,Jo,Mo){let{id:Go,start:os,end:ms,size:is}=qn;if(qn.next(),is>=0&&Go4){let Ys=qn.pos-(is-4);for(;qn.pos>Ys;)Mo=$o(Vo,Jo,Mo)}Jo[--Mo]=Yo,Jo[--Mo]=ms-Vo,Jo[--Mo]=os-Vo,Jo[--Mo]=Go}else is==-3?Kn=Go:is==-4&&(to=Go);return Mo}let Do=[],xo=[];for(;qn.pos>0;)io(_n.start||0,_n.bufferStart||0,Do,xo,-1,0);let Io=(Ce=_n.length)!==null&&Ce!==void 0?Ce:Do.length?xo[0]+Do[0].length:0;return new Tree(Xn[_n.topID],Do.reverse(),xo.reverse(),Io)}const nodeSizeCache=new WeakMap;function nodeSize(_n,Ce){if(!_n.isAnonymous||Ce instanceof TreeBuffer||Ce.type!=_n)return 1;let ke=nodeSizeCache.get(Ce);if(ke==null){ke=1;for(let $n of Ce.children){if($n.type!=_n||!($n instanceof Tree)){ke=1;break}ke+=nodeSize(_n,$n)}nodeSizeCache.set(Ce,ke)}return ke}function balanceRange(_n,Ce,ke,$n,Hn,zn,Un,qn,Xn){let Kn=0;for(let bo=$n;bo=to)break;Jo+=Mo}if(xo==Io+1){if(Jo>to){let Mo=bo[Io];ho(Mo.children,Mo.positions,0,Mo.children.length,Oo[Io]+Do);continue}io.push(bo[Io])}else{let Mo=Oo[xo-1]+bo[xo-1].length-Vo;io.push(balanceRange(_n,bo,Oo,Io,xo,Vo,Mo,null,Xn))}uo.push(Vo+Do-zn)}}return ho(Ce,ke,$n,Hn,0),(qn||Xn)(io,uo,Un)}class NodeWeakMap{constructor(){this.map=new WeakMap}setBuffer(Ce,ke,$n){let Hn=this.map.get(Ce);Hn||this.map.set(Ce,Hn=new Map),Hn.set(ke,$n)}getBuffer(Ce,ke){let $n=this.map.get(Ce);return $n&&$n.get(ke)}set(Ce,ke){Ce instanceof BufferNode?this.setBuffer(Ce.context.buffer,Ce.index,ke):Ce instanceof TreeNode&&this.map.set(Ce.tree,ke)}get(Ce){return Ce instanceof BufferNode?this.getBuffer(Ce.context.buffer,Ce.index):Ce instanceof TreeNode?this.map.get(Ce.tree):void 0}cursorSet(Ce,ke){Ce.buffer?this.setBuffer(Ce.buffer.buffer,Ce.index,ke):this.map.set(Ce.tree,ke)}cursorGet(Ce){return Ce.buffer?this.getBuffer(Ce.buffer.buffer,Ce.index):this.map.get(Ce.tree)}}class TreeFragment{constructor(Ce,ke,$n,Hn,zn=!1,Un=!1){this.from=Ce,this.to=ke,this.tree=$n,this.offset=Hn,this.open=(zn?1:0)|(Un?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(Ce,ke=[],$n=!1){let Hn=[new TreeFragment(0,Ce.length,Ce,0,!1,$n)];for(let zn of ke)zn.to>Ce.length&&Hn.push(zn);return Hn}static applyChanges(Ce,ke,$n=128){if(!ke.length)return Ce;let Hn=[],zn=1,Un=Ce.length?Ce[0]:null;for(let qn=0,Xn=0,Kn=0;;qn++){let to=qn=$n)for(;Un&&Un.from=uo.from||io<=uo.to||Kn){let ho=Math.max(uo.from,Xn)-Kn,bo=Math.min(uo.to,io)-Kn;uo=ho>=bo?null:new TreeFragment(ho,bo,uo.tree,uo.offset+Kn,qn>0,!!to)}if(uo&&Hn.push(uo),Un.to>io)break;Un=znnew Range$1(Hn.from,Hn.to)):[new Range$1(0,0)]:[new Range$1(0,Ce.length)],this.createParse(Ce,ke||[],$n)}parse(Ce,ke,$n){let Hn=this.startParse(Ce,ke,$n);for(;;){let zn=Hn.advance();if(zn)return zn}}}class StringInput{constructor(Ce){this.string=Ce}get length(){return this.string.length}chunk(Ce){return this.string.slice(Ce)}get lineChunks(){return!1}read(Ce,ke){return this.string.slice(Ce,ke)}}function parseMixed(_n){return(Ce,ke,$n,Hn)=>new MixedParse(Ce,_n,ke,$n,Hn)}class InnerParse{constructor(Ce,ke,$n,Hn,zn){this.parser=Ce,this.parse=ke,this.overlay=$n,this.target=Hn,this.from=zn}}function checkRanges(_n){if(!_n.length||_n.some(Ce=>Ce.from>=Ce.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(_n))}class ActiveOverlay{constructor(Ce,ke,$n,Hn,zn,Un,qn){this.parser=Ce,this.predicate=ke,this.mounts=$n,this.index=Hn,this.start=zn,this.target=Un,this.prev=qn,this.depth=0,this.ranges=[]}}const stoppedInner=new NodeProp({perNode:!0});class MixedParse{constructor(Ce,ke,$n,Hn,zn){this.nest=ke,this.input=$n,this.fragments=Hn,this.ranges=zn,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=Ce}advance(){if(this.baseParse){let $n=this.baseParse.advance();if(!$n)return null;if(this.baseParse=null,this.baseTree=$n,this.startInner(),this.stoppedAt!=null)for(let Hn of this.inner)Hn.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let $n=this.baseTree;return this.stoppedAt!=null&&($n=new Tree($n.type,$n.children,$n.positions,$n.length,$n.propValues.concat([[stoppedInner,this.stoppedAt]]))),$n}let Ce=this.inner[this.innerDone],ke=Ce.parse.advance();if(ke){this.innerDone++;let $n=Object.assign(Object.create(null),Ce.target.props);$n[NodeProp.mounted.id]=new MountedTree(ke,Ce.overlay,Ce.parser),Ce.target.props=$n}return null}get parsedPos(){if(this.baseParse)return 0;let Ce=this.input.length;for(let ke=this.innerDone;ke=this.stoppedAt)qn=!1;else if(Ce.hasNode(Hn)){if(ke){let Kn=ke.mounts.find(to=>to.frag.from<=Hn.from&&to.frag.to>=Hn.to&&to.mount.overlay);if(Kn)for(let to of Kn.mount.overlay){let io=to.from+Kn.pos,uo=to.to+Kn.pos;io>=Hn.from&&uo<=Hn.to&&!ke.ranges.some(ho=>ho.fromio)&&ke.ranges.push({from:io,to:uo})}}qn=!1}else if($n&&(Un=checkCover($n.ranges,Hn.from,Hn.to)))qn=Un!=2;else if(!Hn.type.isAnonymous&&(zn=this.nest(Hn,this.input))&&(Hn.fromnew Range$1(io.from-Hn.from,io.to-Hn.from)):null,Hn.tree,to.length?to[0].from:Hn.from)),zn.overlay?to.length&&($n={ranges:to,depth:0,prev:$n}):qn=!1}}else ke&&(Xn=ke.predicate(Hn))&&(Xn===!0&&(Xn=new Range$1(Hn.from,Hn.to)),Xn.fromnew Range$1(to.from-ke.start,to.to-ke.start)),ke.target,Kn[0].from))),ke=ke.prev}$n&&!--$n.depth&&($n=$n.prev)}}}}function checkCover(_n,Ce,ke){for(let $n of _n){if($n.from>=ke)break;if($n.to>Ce)return $n.from<=Ce&&$n.to>=ke?2:1}return 0}function sliceBuf(_n,Ce,ke,$n,Hn,zn){if(Ce=Ce&&ke.enter($n,1,IterMode.IgnoreOverlays|IterMode.ExcludeBuffers)||ke.next(!1)||(this.done=!0)}hasNode(Ce){if(this.moveTo(Ce.from),!this.done&&this.cursor.from+this.offset==Ce.from&&this.cursor.tree)for(let ke=this.cursor.tree;;){if(ke==Ce.tree)return!0;if(ke.children.length&&ke.positions[0]==0&&ke.children[0]instanceof Tree)ke=ke.children[0];else break}return!1}}let FragmentCursor$2=class{constructor(Ce){var ke;if(this.fragments=Ce,this.curTo=0,this.fragI=0,Ce.length){let $n=this.curFrag=Ce[0];this.curTo=(ke=$n.tree.prop(stoppedInner))!==null&&ke!==void 0?ke:$n.to,this.inner=new StructureCursor($n.tree,-$n.offset)}else this.curFrag=this.inner=null}hasNode(Ce){for(;this.curFrag&&Ce.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=Ce.from&&this.curTo>=Ce.to&&this.inner.hasNode(Ce)}nextFrag(){var Ce;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let ke=this.curFrag=this.fragments[this.fragI];this.curTo=(Ce=ke.tree.prop(stoppedInner))!==null&&Ce!==void 0?Ce:ke.to,this.inner=new StructureCursor(ke.tree,-ke.offset)}}findMounts(Ce,ke){var $n;let Hn=[];if(this.inner){this.inner.cursor.moveTo(Ce,1);for(let zn=this.inner.cursor.node;zn;zn=zn.parent){let Un=($n=zn.tree)===null||$n===void 0?void 0:$n.prop(NodeProp.mounted);if(Un&&Un.parser==ke)for(let qn=this.fragI;qn=zn.to)break;Xn.tree==this.curFrag.tree&&Hn.push({frag:Xn,pos:zn.from-Xn.offset,mount:Un})}}}return Hn}};function punchRanges(_n,Ce){let ke=null,$n=Ce;for(let Hn=1,zn=0;Hn<_n.length;Hn++){let Un=_n[Hn-1].to,qn=_n[Hn].from;for(;zn<$n.length;zn++){let Xn=$n[zn];if(Xn.from>=qn)break;Xn.to<=Un||(ke||($n=ke=Ce.slice()),Xn.fromqn&&ke.splice(zn+1,0,new Range$1(qn,Xn.to))):Xn.to>qn?ke[zn--]=new Range$1(qn,Xn.to):ke.splice(zn--,1))}}return $n}function findCoverChanges(_n,Ce,ke,$n){let Hn=0,zn=0,Un=!1,qn=!1,Xn=-1e9,Kn=[];for(;;){let to=Hn==_n.length?1e9:Un?_n[Hn].to:_n[Hn].from,io=zn==Ce.length?1e9:qn?Ce[zn].to:Ce[zn].from;if(Un!=qn){let uo=Math.max(Xn,ke),ho=Math.min(to,io,$n);uonew Range$1(uo.from+$n,uo.to+$n)),io=findCoverChanges(Ce,to,Xn,Kn);for(let uo=0,ho=Xn;;uo++){let bo=uo==io.length,Oo=bo?Kn:io[uo].from;if(Oo>ho&&ke.push(new TreeFragment(ho,Oo,Hn.tree,-Un,zn.from>=ho||zn.openStart,zn.to<=Oo||zn.openEnd)),bo)break;ho=io[uo].to}}else ke.push(new TreeFragment(Xn,Kn,Hn.tree,-Un,zn.from>=Un||zn.openStart,zn.to<=qn||zn.openEnd))}return ke}let nextTagID=0;class Tag{constructor(Ce,ke,$n,Hn){this.name=Ce,this.set=ke,this.base=$n,this.modified=Hn,this.id=nextTagID++}toString(){let{name:Ce}=this;for(let ke of this.modified)ke.name&&(Ce=`${ke.name}(${Ce})`);return Ce}static define(Ce,ke){let $n=typeof Ce=="string"?Ce:"?";if(Ce instanceof Tag&&(ke=Ce),ke!=null&&ke.base)throw new Error("Can not derive from a modified tag");let Hn=new Tag($n,[],null,[]);if(Hn.set.push(Hn),ke)for(let zn of ke.set)Hn.set.push(zn);return Hn}static defineModifier(Ce){let ke=new Modifier(Ce);return $n=>$n.modified.indexOf(ke)>-1?$n:Modifier.get($n.base||$n,$n.modified.concat(ke).sort((Hn,zn)=>Hn.id-zn.id))}}let nextModifierID=0;class Modifier{constructor(Ce){this.name=Ce,this.instances=[],this.id=nextModifierID++}static get(Ce,ke){if(!ke.length)return Ce;let $n=ke[0].instances.find(qn=>qn.base==Ce&&sameArray(ke,qn.modified));if($n)return $n;let Hn=[],zn=new Tag(Ce.name,Hn,Ce,ke);for(let qn of ke)qn.instances.push(zn);let Un=powerSet(ke);for(let qn of Ce.set)if(!qn.modified.length)for(let Xn of Un)Hn.push(Modifier.get(qn,Xn));return zn}}function sameArray(_n,Ce){return _n.length==Ce.length&&_n.every((ke,$n)=>ke==Ce[$n])}function powerSet(_n){let Ce=[[]];for(let ke=0;ke<_n.length;ke++)for(let $n=0,Hn=Ce.length;$n$n.length-ke.length)}function styleTags(_n){let Ce=Object.create(null);for(let ke in _n){let $n=_n[ke];Array.isArray($n)||($n=[$n]);for(let Hn of ke.split(" "))if(Hn){let zn=[],Un=2,qn=Hn;for(let io=0;;){if(qn=="..."&&io>0&&io+3==Hn.length){Un=1;break}let uo=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(qn);if(!uo)throw new RangeError("Invalid path: "+Hn);if(zn.push(uo[0]=="*"?"":uo[0][0]=='"'?JSON.parse(uo[0]):uo[0]),io+=uo[0].length,io==Hn.length)break;let ho=Hn[io++];if(io==Hn.length&&ho=="!"){Un=0;break}if(ho!="/")throw new RangeError("Invalid path: "+Hn);qn=Hn.slice(io)}let Xn=zn.length-1,Kn=zn[Xn];if(!Kn)throw new RangeError("Invalid path: "+Hn);let to=new Rule($n,Un,Xn>0?zn.slice(0,Xn):null);Ce[Kn]=to.sort(Ce[Kn])}}return ruleNodeProp.add(Ce)}const ruleNodeProp=new NodeProp;class Rule{constructor(Ce,ke,$n,Hn){this.tags=Ce,this.mode=ke,this.context=$n,this.next=Hn}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(Ce){return!Ce||Ce.depth{let Un=Hn;for(let qn of zn)for(let Xn of qn.set){let Kn=ke[Xn.id];if(Kn){Un=Un?Un+" "+Kn:Kn;break}}return Un},scope:$n}}function highlightTags(_n,Ce){let ke=null;for(let $n of _n){let Hn=$n.style(Ce);Hn&&(ke=ke?ke+" "+Hn:Hn)}return ke}function highlightTree(_n,Ce,ke,$n=0,Hn=_n.length){let zn=new HighlightBuilder($n,Array.isArray(Ce)?Ce:[Ce],ke);zn.highlightRange(_n.cursor(),$n,Hn,"",zn.highlighters),zn.flush(Hn)}class HighlightBuilder{constructor(Ce,ke,$n){this.at=Ce,this.highlighters=ke,this.span=$n,this.class=""}startSpan(Ce,ke){ke!=this.class&&(this.flush(Ce),Ce>this.at&&(this.at=Ce),this.class=ke)}flush(Ce){Ce>this.at&&this.class&&this.span(this.at,Ce,this.class)}highlightRange(Ce,ke,$n,Hn,zn){let{type:Un,from:qn,to:Xn}=Ce;if(qn>=$n||Xn<=ke)return;Un.isTop&&(zn=this.highlighters.filter(ho=>!ho.scope||ho.scope(Un)));let Kn=Hn,to=getStyleTags(Ce)||Rule.empty,io=highlightTags(zn,to.tags);if(io&&(Kn&&(Kn+=" "),Kn+=io,to.mode==1&&(Hn+=(Hn?" ":"")+io)),this.startSpan(Math.max(ke,qn),Kn),to.opaque)return;let uo=Ce.tree&&Ce.tree.prop(NodeProp.mounted);if(uo&&uo.overlay){let ho=Ce.node.enter(uo.overlay[0].from+qn,1),bo=this.highlighters.filter(So=>!So.scope||So.scope(uo.tree.type)),Oo=Ce.firstChild();for(let So=0,$o=qn;;So++){let Do=So=xo||!Ce.nextSibling())););if(!Do||xo>$n)break;$o=Do.to+qn,$o>ke&&(this.highlightRange(ho.cursor(),Math.max(ke,Do.from+qn),Math.min($n,$o),"",bo),this.startSpan(Math.min($n,$o),Kn))}Oo&&Ce.parent()}else if(Ce.firstChild()){uo&&(Hn="");do if(!(Ce.to<=ke)){if(Ce.from>=$n)break;this.highlightRange(Ce,ke,$n,Hn,zn),this.startSpan(Math.min($n,Ce.to),Kn)}while(Ce.nextSibling());Ce.parent()}}}function getStyleTags(_n){let Ce=_n.type.prop(ruleNodeProp);for(;Ce&&Ce.context&&!_n.matchContext(Ce.context);)Ce=Ce.next;return Ce||null}const t=Tag.define,comment=t(),name=t(),typeName=t(name),propertyName=t(name),literal=t(),string=t(literal),number=t(literal),content=t(),heading=t(content),keyword=t(),operator=t(),punctuation=t(),bracket=t(punctuation),meta=t(),tags$1={comment,lineComment:t(comment),blockComment:t(comment),docComment:t(comment),name,variableName:t(name),typeName,tagName:t(typeName),propertyName,attributeName:t(propertyName),className:t(name),labelName:t(name),namespace:t(name),macroName:t(name),literal,string,docString:t(string),character:t(string),attributeValue:t(string),number,integer:t(number),float:t(number),bool:t(literal),regexp:t(literal),escape:t(literal),color:t(literal),url:t(literal),keyword,self:t(keyword),null:t(keyword),atom:t(keyword),unit:t(keyword),modifier:t(keyword),operatorKeyword:t(keyword),controlKeyword:t(keyword),definitionKeyword:t(keyword),moduleKeyword:t(keyword),operator,derefOperator:t(operator),arithmeticOperator:t(operator),logicOperator:t(operator),bitwiseOperator:t(operator),compareOperator:t(operator),updateOperator:t(operator),definitionOperator:t(operator),typeOperator:t(operator),controlOperator:t(operator),punctuation,separator:t(punctuation),bracket,angleBracket:t(bracket),squareBracket:t(bracket),paren:t(bracket),brace:t(bracket),content,heading,heading1:t(heading),heading2:t(heading),heading3:t(heading),heading4:t(heading),heading5:t(heading),heading6:t(heading),contentSeparator:t(content),list:t(content),quote:t(content),emphasis:t(content),strong:t(content),link:t(content),monospace:t(content),strikethrough:t(content),inserted:t(),deleted:t(),changed:t(),invalid:t(),meta,documentMeta:t(meta),annotation:t(meta),processingInstruction:t(meta),definition:Tag.defineModifier("definition"),constant:Tag.defineModifier("constant"),function:Tag.defineModifier("function"),standard:Tag.defineModifier("standard"),local:Tag.defineModifier("local"),special:Tag.defineModifier("special")};for(let _n in tags$1){let Ce=tags$1[_n];Ce instanceof Tag&&(Ce.name=_n)}tagHighlighter([{tag:tags$1.link,class:"tok-link"},{tag:tags$1.heading,class:"tok-heading"},{tag:tags$1.emphasis,class:"tok-emphasis"},{tag:tags$1.strong,class:"tok-strong"},{tag:tags$1.keyword,class:"tok-keyword"},{tag:tags$1.atom,class:"tok-atom"},{tag:tags$1.bool,class:"tok-bool"},{tag:tags$1.url,class:"tok-url"},{tag:tags$1.labelName,class:"tok-labelName"},{tag:tags$1.inserted,class:"tok-inserted"},{tag:tags$1.deleted,class:"tok-deleted"},{tag:tags$1.literal,class:"tok-literal"},{tag:tags$1.string,class:"tok-string"},{tag:tags$1.number,class:"tok-number"},{tag:[tags$1.regexp,tags$1.escape,tags$1.special(tags$1.string)],class:"tok-string2"},{tag:tags$1.variableName,class:"tok-variableName"},{tag:tags$1.local(tags$1.variableName),class:"tok-variableName tok-local"},{tag:tags$1.definition(tags$1.variableName),class:"tok-variableName tok-definition"},{tag:tags$1.special(tags$1.variableName),class:"tok-variableName2"},{tag:tags$1.definition(tags$1.propertyName),class:"tok-propertyName tok-definition"},{tag:tags$1.typeName,class:"tok-typeName"},{tag:tags$1.namespace,class:"tok-namespace"},{tag:tags$1.className,class:"tok-className"},{tag:tags$1.macroName,class:"tok-macroName"},{tag:tags$1.propertyName,class:"tok-propertyName"},{tag:tags$1.operator,class:"tok-operator"},{tag:tags$1.comment,class:"tok-comment"},{tag:tags$1.meta,class:"tok-meta"},{tag:tags$1.invalid,class:"tok-invalid"},{tag:tags$1.punctuation,class:"tok-punctuation"}]);var _a;const languageDataProp=new NodeProp;function defineLanguageFacet(_n){return Facet.define({combine:_n?Ce=>Ce.concat(_n):void 0})}const sublanguageProp=new NodeProp;class Language{constructor(Ce,ke,$n=[],Hn=""){this.data=Ce,this.name=Hn,EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(EditorState.prototype,"tree",{get(){return syntaxTree(this)}}),this.parser=ke,this.extension=[language.of(this),EditorState.languageData.of((zn,Un,qn)=>{let Xn=topNodeAt(zn,Un,qn),Kn=Xn.type.prop(languageDataProp);if(!Kn)return[];let to=zn.facet(Kn),io=Xn.type.prop(sublanguageProp);if(io){let uo=Xn.resolve(Un-Xn.from,qn);for(let ho of io)if(ho.test(uo,zn)){let bo=zn.facet(ho.facet);return ho.type=="replace"?bo:bo.concat(to)}}return to})].concat($n)}isActiveAt(Ce,ke,$n=-1){return topNodeAt(Ce,ke,$n).type.prop(languageDataProp)==this.data}findRegions(Ce){let ke=Ce.facet(language);if((ke==null?void 0:ke.data)==this.data)return[{from:0,to:Ce.doc.length}];if(!ke||!ke.allowsNesting)return[];let $n=[],Hn=(zn,Un)=>{if(zn.prop(languageDataProp)==this.data){$n.push({from:Un,to:Un+zn.length});return}let qn=zn.prop(NodeProp.mounted);if(qn){if(qn.tree.prop(languageDataProp)==this.data){if(qn.overlay)for(let Xn of qn.overlay)$n.push({from:Xn.from+Un,to:Xn.to+Un});else $n.push({from:Un,to:Un+zn.length});return}else if(qn.overlay){let Xn=$n.length;if(Hn(qn.tree,qn.overlay[0].from+Un),$n.length>Xn)return}}for(let Xn=0;Xn$n.isTop?ke:void 0)]}),Ce.name)}configure(Ce,ke){return new LRLanguage(this.data,this.parser.configure(Ce),ke||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function syntaxTree(_n){let Ce=_n.field(Language.state,!1);return Ce?Ce.tree:Tree.empty}class DocInput{constructor(Ce){this.doc=Ce,this.cursorPos=0,this.string="",this.cursor=Ce.iter()}get length(){return this.doc.length}syncTo(Ce){return this.string=this.cursor.next(Ce-this.cursorPos).value,this.cursorPos=Ce+this.string.length,this.cursorPos-this.string.length}chunk(Ce){return this.syncTo(Ce),this.string}get lineChunks(){return!0}read(Ce,ke){let $n=this.cursorPos-this.string.length;return Ce<$n||ke>=this.cursorPos?this.doc.sliceString(Ce,ke):this.string.slice(Ce-$n,ke-$n)}}let currentContext=null;class ParseContext{constructor(Ce,ke,$n=[],Hn,zn,Un,qn,Xn){this.parser=Ce,this.state=ke,this.fragments=$n,this.tree=Hn,this.treeLen=zn,this.viewport=Un,this.skipped=qn,this.scheduleOn=Xn,this.parse=null,this.tempSkipped=[]}static create(Ce,ke,$n){return new ParseContext(Ce,ke,[],Tree.empty,0,$n,[],null)}startParse(){return this.parser.startParse(new DocInput(this.state.doc),this.fragments)}work(Ce,ke){return ke!=null&&ke>=this.state.doc.length&&(ke=void 0),this.tree!=Tree.empty&&this.isDone(ke??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var $n;if(typeof Ce=="number"){let Hn=Date.now()+Ce;Ce=()=>Date.now()>Hn}for(this.parse||(this.parse=this.startParse()),ke!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>ke)&&ke=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>Ce)&&this.parse.stopAt(Ce),this.withContext(()=>{for(;!(ke=this.parse.advance()););}),this.treeLen=Ce,this.tree=ke,this.fragments=this.withoutTempSkipped(TreeFragment.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(Ce){let ke=currentContext;currentContext=this;try{return Ce()}finally{currentContext=ke}}withoutTempSkipped(Ce){for(let ke;ke=this.tempSkipped.pop();)Ce=cutFragments(Ce,ke.from,ke.to);return Ce}changes(Ce,ke){let{fragments:$n,tree:Hn,treeLen:zn,viewport:Un,skipped:qn}=this;if(this.takeTree(),!Ce.empty){let Xn=[];if(Ce.iterChangedRanges((Kn,to,io,uo)=>Xn.push({fromA:Kn,toA:to,fromB:io,toB:uo})),$n=TreeFragment.applyChanges($n,Xn),Hn=Tree.empty,zn=0,Un={from:Ce.mapPos(Un.from,-1),to:Ce.mapPos(Un.to,1)},this.skipped.length){qn=[];for(let Kn of this.skipped){let to=Ce.mapPos(Kn.from,1),io=Ce.mapPos(Kn.to,-1);toCe.from&&(this.fragments=cutFragments(this.fragments,Hn,zn),this.skipped.splice($n--,1))}return this.skipped.length>=ke?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(Ce,ke){this.skipped.push({from:Ce,to:ke})}static getSkippingParser(Ce){return new class extends Parser{createParse(ke,$n,Hn){let zn=Hn[0].from,Un=Hn[Hn.length-1].to;return{parsedPos:zn,advance(){let Xn=currentContext;if(Xn){for(let Kn of Hn)Xn.tempSkipped.push(Kn);Ce&&(Xn.scheduleOn=Xn.scheduleOn?Promise.all([Xn.scheduleOn,Ce]):Ce)}return this.parsedPos=Un,new Tree(NodeType.none,[],[],Un-zn)},stoppedAt:null,stopAt(){}}}}}isDone(Ce){Ce=Math.min(Ce,this.state.doc.length);let ke=this.fragments;return this.treeLen>=Ce&&ke.length&&ke[0].from==0&&ke[0].to>=Ce}static get(){return currentContext}}function cutFragments(_n,Ce,ke){return TreeFragment.applyChanges(_n,[{fromA:Ce,toA:ke,fromB:Ce,toB:ke}])}class LanguageState{constructor(Ce){this.context=Ce,this.tree=Ce.tree}apply(Ce){if(!Ce.docChanged&&this.tree==this.context.tree)return this;let ke=this.context.changes(Ce.changes,Ce.state),$n=this.context.treeLen==Ce.startState.doc.length?void 0:Math.max(Ce.changes.mapPos(this.context.treeLen),ke.viewport.to);return ke.work(20,$n)||ke.takeTree(),new LanguageState(ke)}static init(Ce){let ke=Math.min(3e3,Ce.doc.length),$n=ParseContext.create(Ce.facet(language).parser,Ce,{from:0,to:ke});return $n.work(20,ke)||$n.takeTree(),new LanguageState($n)}}Language.state=StateField.define({create:LanguageState.init,update(_n,Ce){for(let ke of Ce.effects)if(ke.is(Language.setState))return ke.value;return Ce.startState.facet(language)!=Ce.state.facet(language)?LanguageState.init(Ce.state):_n.apply(Ce)}});let requestIdle=_n=>{let Ce=setTimeout(()=>_n(),500);return()=>clearTimeout(Ce)};typeof requestIdleCallback<"u"&&(requestIdle=_n=>{let Ce=-1,ke=setTimeout(()=>{Ce=requestIdleCallback(_n,{timeout:400})},100);return()=>Ce<0?clearTimeout(ke):cancelIdleCallback(Ce)});const isInputPending=typeof navigator<"u"&&(!((_a=navigator.scheduling)===null||_a===void 0)&&_a.isInputPending)?()=>navigator.scheduling.isInputPending():null,parseWorker=ViewPlugin.fromClass(class{constructor(Ce){this.view=Ce,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(Ce){let ke=this.view.state.field(Language.state).context;(ke.updateViewport(Ce.view.viewport)||this.view.viewport.to>ke.treeLen)&&this.scheduleWork(),(Ce.docChanged||Ce.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(ke)}scheduleWork(){if(this.working)return;let{state:Ce}=this.view,ke=Ce.field(Language.state);(ke.tree!=ke.context.tree||!ke.context.isDone(Ce.doc.length))&&(this.working=requestIdle(this.work))}work(Ce){this.working=null;let ke=Date.now();if(this.chunkEndHn+1e3,Xn=zn.context.work(()=>isInputPending&&isInputPending()||Date.now()>Un,Hn+(qn?0:1e5));this.chunkBudget-=Date.now()-ke,(Xn||this.chunkBudget<=0)&&(zn.context.takeTree(),this.view.dispatch({effects:Language.setState.of(new LanguageState(zn.context))})),this.chunkBudget>0&&!(Xn&&!qn)&&this.scheduleWork(),this.checkAsyncSchedule(zn.context)}checkAsyncSchedule(Ce){Ce.scheduleOn&&(this.workScheduled++,Ce.scheduleOn.then(()=>this.scheduleWork()).catch(ke=>logException(this.view.state,ke)).then(()=>this.workScheduled--),Ce.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),language=Facet.define({combine(_n){return _n.length?_n[0]:null},enables:_n=>[Language.state,parseWorker,EditorView.contentAttributes.compute([_n],Ce=>{let ke=Ce.facet(_n);return ke&&ke.name?{"data-language":ke.name}:{}})]});class LanguageSupport{constructor(Ce,ke=[]){this.language=Ce,this.support=ke,this.extension=[Ce,ke]}}class LanguageDescription{constructor(Ce,ke,$n,Hn,zn,Un=void 0){this.name=Ce,this.alias=ke,this.extensions=$n,this.filename=Hn,this.loadFunc=zn,this.support=Un,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(Ce=>this.support=Ce,Ce=>{throw this.loading=null,Ce}))}static of(Ce){let{load:ke,support:$n}=Ce;if(!ke){if(!$n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");ke=()=>Promise.resolve($n)}return new LanguageDescription(Ce.name,(Ce.alias||[]).concat(Ce.name).map(Hn=>Hn.toLowerCase()),Ce.extensions||[],Ce.filename,ke,$n)}static matchFilename(Ce,ke){for(let Hn of Ce)if(Hn.filename&&Hn.filename.test(ke))return Hn;let $n=/\.([^.]+)$/.exec(ke);if($n){for(let Hn of Ce)if(Hn.extensions.indexOf($n[1])>-1)return Hn}return null}static matchLanguageName(Ce,ke,$n=!0){ke=ke.toLowerCase();for(let Hn of Ce)if(Hn.alias.some(zn=>zn==ke))return Hn;if($n)for(let Hn of Ce)for(let zn of Hn.alias){let Un=ke.indexOf(zn);if(Un>-1&&(zn.length>2||!/\w/.test(ke[Un-1])&&!/\w/.test(ke[Un+zn.length])))return Hn}return null}}const indentService=Facet.define(),indentUnit=Facet.define({combine:_n=>{if(!_n.length)return" ";let Ce=_n[0];if(!Ce||/\S/.test(Ce)||Array.from(Ce).some(ke=>ke!=Ce[0]))throw new Error("Invalid indent unit: "+JSON.stringify(_n[0]));return Ce}});function getIndentUnit(_n){let Ce=_n.facet(indentUnit);return Ce.charCodeAt(0)==9?_n.tabSize*Ce.length:Ce.length}function indentString(_n,Ce){let ke="",$n=_n.tabSize,Hn=_n.facet(indentUnit)[0];if(Hn==" "){for(;Ce>=$n;)ke+=" ",Ce-=$n;Hn=" "}for(let zn=0;zn=Ce?syntaxIndentation(_n,ke,Ce):null}class IndentContext{constructor(Ce,ke={}){this.state=Ce,this.options=ke,this.unit=getIndentUnit(Ce)}lineAt(Ce,ke=1){let $n=this.state.doc.lineAt(Ce),{simulateBreak:Hn,simulateDoubleBreak:zn}=this.options;return Hn!=null&&Hn>=$n.from&&Hn<=$n.to?zn&&Hn==Ce?{text:"",from:Ce}:(ke<0?Hn-1&&(zn+=Un-this.countColumn($n,$n.search(/\S|$/))),zn}countColumn(Ce,ke=Ce.length){return countColumn(Ce,this.state.tabSize,ke)}lineIndent(Ce,ke=1){let{text:$n,from:Hn}=this.lineAt(Ce,ke),zn=this.options.overrideIndentation;if(zn){let Un=zn(Hn);if(Un>-1)return Un}return this.countColumn($n,$n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const indentNodeProp=new NodeProp;function syntaxIndentation(_n,Ce,ke){let $n=Ce.resolveStack(ke),Hn=$n.node.enterUnfinishedNodesBefore(ke);if(Hn!=$n.node){let zn=[];for(let Un=Hn;Un!=$n.node;Un=Un.parent)zn.push(Un);for(let Un=zn.length-1;Un>=0;Un--)$n={node:zn[Un],next:$n}}return indentFor($n,_n,ke)}function indentFor(_n,Ce,ke){for(let $n=_n;$n;$n=$n.next){let Hn=indentStrategy($n.node);if(Hn)return Hn(TreeIndentContext.create(Ce,ke,$n))}return 0}function ignoreClosed(_n){return _n.pos==_n.options.simulateBreak&&_n.options.simulateDoubleBreak}function indentStrategy(_n){let Ce=_n.type.prop(indentNodeProp);if(Ce)return Ce;let ke=_n.firstChild,$n;if(ke&&($n=ke.type.prop(NodeProp.closedBy))){let Hn=_n.lastChild,zn=Hn&&$n.indexOf(Hn.name)>-1;return Un=>delimitedStrategy(Un,!0,1,void 0,zn&&!ignoreClosed(Un)?Hn.from:void 0)}return _n.parent==null?topIndent:null}function topIndent(){return 0}class TreeIndentContext extends IndentContext{constructor(Ce,ke,$n){super(Ce.state,Ce.options),this.base=Ce,this.pos=ke,this.context=$n}get node(){return this.context.node}static create(Ce,ke,$n){return new TreeIndentContext(Ce,ke,$n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(Ce){let ke=this.state.doc.lineAt(Ce.from);for(;;){let $n=Ce.resolve(ke.from);for(;$n.parent&&$n.parent.from==$n.from;)$n=$n.parent;if(isParent($n,Ce))break;ke=this.state.doc.lineAt($n.from)}return this.lineIndent(ke.from)}continue(){return indentFor(this.context.next,this.base,this.pos)}}function isParent(_n,Ce){for(let ke=Ce;ke;ke=ke.parent)if(_n==ke)return!0;return!1}function bracketedAligned(_n){let Ce=_n.node,ke=Ce.childAfter(Ce.from),$n=Ce.lastChild;if(!ke)return null;let Hn=_n.options.simulateBreak,zn=_n.state.doc.lineAt(ke.from),Un=Hn==null||Hn<=zn.from?zn.to:Math.min(zn.to,Hn);for(let qn=ke.to;;){let Xn=Ce.childAfter(qn);if(!Xn||Xn==$n)return null;if(!Xn.type.isSkipped)return Xn.fromdelimitedStrategy($n,Ce,ke,_n)}function delimitedStrategy(_n,Ce,ke,$n,Hn){let zn=_n.textAfter,Un=zn.match(/^\s*/)[0].length,qn=$n&&zn.slice(Un,Un+$n.length)==$n||Hn==_n.pos+Un,Xn=Ce?bracketedAligned(_n):null;return Xn?qn?_n.column(Xn.from):_n.column(Xn.to):_n.baseIndent+(qn?0:_n.unit*ke)}const flatIndent=_n=>_n.baseIndent;function continuedIndent({except:_n,units:Ce=1}={}){return ke=>{let $n=_n&&_n.test(ke.textAfter);return ke.baseIndent+($n?0:Ce*ke.unit)}}const DontIndentBeyond=200;function indentOnInput(){return EditorState.transactionFilter.of(_n=>{if(!_n.docChanged||!_n.isUserEvent("input.type")&&!_n.isUserEvent("input.complete"))return _n;let Ce=_n.startState.languageDataAt("indentOnInput",_n.startState.selection.main.head);if(!Ce.length)return _n;let ke=_n.newDoc,{head:$n}=_n.newSelection.main,Hn=ke.lineAt($n);if($n>Hn.from+DontIndentBeyond)return _n;let zn=ke.sliceString(Hn.from,$n);if(!Ce.some(Kn=>Kn.test(zn)))return _n;let{state:Un}=_n,qn=-1,Xn=[];for(let{head:Kn}of Un.selection.ranges){let to=Un.doc.lineAt(Kn);if(to.from==qn)continue;qn=to.from;let io=getIndentation(Un,to.from);if(io==null)continue;let uo=/^\s*/.exec(to.text)[0],ho=indentString(Un,io);uo!=ho&&Xn.push({from:to.from,to:to.from+uo.length,insert:ho})}return Xn.length?[_n,{changes:Xn,sequential:!0}]:_n})}const foldService=Facet.define(),foldNodeProp=new NodeProp;function foldInside(_n){let Ce=_n.firstChild,ke=_n.lastChild;return Ce&&Ce.toke)continue;if(zn&&qn.from=Ce&&Kn.to>ke&&(zn=Kn)}}return zn}function isUnfinished(_n){let Ce=_n.lastChild;return Ce&&Ce.to==_n.to&&Ce.type.isError}function foldable(_n,Ce,ke){for(let $n of _n.facet(foldService)){let Hn=$n(_n,Ce,ke);if(Hn)return Hn}return syntaxFolding(_n,Ce,ke)}function mapRange(_n,Ce){let ke=Ce.mapPos(_n.from,1),$n=Ce.mapPos(_n.to,-1);return ke>=$n?void 0:{from:ke,to:$n}}const foldEffect=StateEffect.define({map:mapRange}),unfoldEffect=StateEffect.define({map:mapRange});function selectedLines(_n){let Ce=[];for(let{head:ke}of _n.state.selection.ranges)Ce.some($n=>$n.from<=ke&&$n.to>=ke)||Ce.push(_n.lineBlockAt(ke));return Ce}const foldState=StateField.define({create(){return Decoration.none},update(_n,Ce){_n=_n.map(Ce.changes);for(let ke of Ce.effects)if(ke.is(foldEffect)&&!foldExists(_n,ke.value.from,ke.value.to)){let{preparePlaceholder:$n}=Ce.state.facet(foldConfig),Hn=$n?Decoration.replace({widget:new PreparedFoldWidget($n(Ce.state,ke.value))}):foldWidget;_n=_n.update({add:[Hn.range(ke.value.from,ke.value.to)]})}else ke.is(unfoldEffect)&&(_n=_n.update({filter:($n,Hn)=>ke.value.from!=$n||ke.value.to!=Hn,filterFrom:ke.value.from,filterTo:ke.value.to}));if(Ce.selection){let ke=!1,{head:$n}=Ce.selection.main;_n.between($n,$n,(Hn,zn)=>{Hn<$n&&zn>$n&&(ke=!0)}),ke&&(_n=_n.update({filterFrom:$n,filterTo:$n,filter:(Hn,zn)=>zn<=$n||Hn>=$n}))}return _n},provide:_n=>EditorView.decorations.from(_n),toJSON(_n,Ce){let ke=[];return _n.between(0,Ce.doc.length,($n,Hn)=>{ke.push($n,Hn)}),ke},fromJSON(_n){if(!Array.isArray(_n)||_n.length%2)throw new RangeError("Invalid JSON for fold state");let Ce=[];for(let ke=0;ke<_n.length;){let $n=_n[ke++],Hn=_n[ke++];if(typeof $n!="number"||typeof Hn!="number")throw new RangeError("Invalid JSON for fold state");Ce.push(foldWidget.range($n,Hn))}return Decoration.set(Ce,!0)}});function findFold(_n,Ce,ke){var $n;let Hn=null;return($n=_n.field(foldState,!1))===null||$n===void 0||$n.between(Ce,ke,(zn,Un)=>{(!Hn||Hn.from>zn)&&(Hn={from:zn,to:Un})}),Hn}function foldExists(_n,Ce,ke){let $n=!1;return _n.between(Ce,Ce,(Hn,zn)=>{Hn==Ce&&zn==ke&&($n=!0)}),$n}function maybeEnable(_n,Ce){return _n.field(foldState,!1)?Ce:Ce.concat(StateEffect.appendConfig.of(codeFolding()))}const foldCode=_n=>{for(let Ce of selectedLines(_n)){let ke=foldable(_n.state,Ce.from,Ce.to);if(ke)return _n.dispatch({effects:maybeEnable(_n.state,[foldEffect.of(ke),announceFold(_n,ke)])}),!0}return!1},unfoldCode=_n=>{if(!_n.state.field(foldState,!1))return!1;let Ce=[];for(let ke of selectedLines(_n)){let $n=findFold(_n.state,ke.from,ke.to);$n&&Ce.push(unfoldEffect.of($n),announceFold(_n,$n,!1))}return Ce.length&&_n.dispatch({effects:Ce}),Ce.length>0};function announceFold(_n,Ce,ke=!0){let $n=_n.state.doc.lineAt(Ce.from).number,Hn=_n.state.doc.lineAt(Ce.to).number;return EditorView.announce.of(`${_n.state.phrase(ke?"Folded lines":"Unfolded lines")} ${$n} ${_n.state.phrase("to")} ${Hn}.`)}const foldAll=_n=>{let{state:Ce}=_n,ke=[];for(let $n=0;$n{let Ce=_n.state.field(foldState,!1);if(!Ce||!Ce.size)return!1;let ke=[];return Ce.between(0,_n.state.doc.length,($n,Hn)=>{ke.push(unfoldEffect.of({from:$n,to:Hn}))}),_n.dispatch({effects:ke}),!0},foldKeymap=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:foldCode},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:unfoldCode},{key:"Ctrl-Alt-[",run:foldAll},{key:"Ctrl-Alt-]",run:unfoldAll}],defaultConfig={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},foldConfig=Facet.define({combine(_n){return combineConfig(_n,defaultConfig)}});function codeFolding(_n){return[foldState,baseTheme$1$2]}function widgetToDOM(_n,Ce){let{state:ke}=_n,$n=ke.facet(foldConfig),Hn=Un=>{let qn=_n.lineBlockAt(_n.posAtDOM(Un.target)),Xn=findFold(_n.state,qn.from,qn.to);Xn&&_n.dispatch({effects:unfoldEffect.of(Xn)}),Un.preventDefault()};if($n.placeholderDOM)return $n.placeholderDOM(_n,Hn,Ce);let zn=document.createElement("span");return zn.textContent=$n.placeholderText,zn.setAttribute("aria-label",ke.phrase("folded code")),zn.title=ke.phrase("unfold"),zn.className="cm-foldPlaceholder",zn.onclick=Hn,zn}const foldWidget=Decoration.replace({widget:new class extends WidgetType{toDOM(_n){return widgetToDOM(_n,null)}}});class PreparedFoldWidget extends WidgetType{constructor(Ce){super(),this.value=Ce}eq(Ce){return this.value==Ce.value}toDOM(Ce){return widgetToDOM(Ce,this.value)}}const foldGutterDefaults={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class FoldMarker extends GutterMarker{constructor(Ce,ke){super(),this.config=Ce,this.open=ke}eq(Ce){return this.config==Ce.config&&this.open==Ce.open}toDOM(Ce){if(this.config.markerDOM)return this.config.markerDOM(this.open);let ke=document.createElement("span");return ke.textContent=this.open?this.config.openText:this.config.closedText,ke.title=Ce.state.phrase(this.open?"Fold line":"Unfold line"),ke}}function foldGutter(_n={}){let Ce=Object.assign(Object.assign({},foldGutterDefaults),_n),ke=new FoldMarker(Ce,!0),$n=new FoldMarker(Ce,!1),Hn=ViewPlugin.fromClass(class{constructor(Un){this.from=Un.viewport.from,this.markers=this.buildMarkers(Un)}update(Un){(Un.docChanged||Un.viewportChanged||Un.startState.facet(language)!=Un.state.facet(language)||Un.startState.field(foldState,!1)!=Un.state.field(foldState,!1)||syntaxTree(Un.startState)!=syntaxTree(Un.state)||Ce.foldingChanged(Un))&&(this.markers=this.buildMarkers(Un.view))}buildMarkers(Un){let qn=new RangeSetBuilder;for(let Xn of Un.viewportLineBlocks){let Kn=findFold(Un.state,Xn.from,Xn.to)?$n:foldable(Un.state,Xn.from,Xn.to)?ke:null;Kn&&qn.add(Xn.from,Xn.from,Kn)}return qn.finish()}}),{domEventHandlers:zn}=Ce;return[Hn,gutter({class:"cm-foldGutter",markers(Un){var qn;return((qn=Un.plugin(Hn))===null||qn===void 0?void 0:qn.markers)||RangeSet.empty},initialSpacer(){return new FoldMarker(Ce,!1)},domEventHandlers:Object.assign(Object.assign({},zn),{click:(Un,qn,Xn)=>{if(zn.click&&zn.click(Un,qn,Xn))return!0;let Kn=findFold(Un.state,qn.from,qn.to);if(Kn)return Un.dispatch({effects:unfoldEffect.of(Kn)}),!0;let to=foldable(Un.state,qn.from,qn.to);return to?(Un.dispatch({effects:foldEffect.of(to)}),!0):!1}})}),codeFolding()]}const baseTheme$1$2=EditorView.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class HighlightStyle{constructor(Ce,ke){this.specs=Ce;let $n;function Hn(qn){let Xn=StyleModule.newName();return($n||($n=Object.create(null)))["."+Xn]=qn,Xn}const zn=typeof ke.all=="string"?ke.all:ke.all?Hn(ke.all):void 0,Un=ke.scope;this.scope=Un instanceof Language?qn=>qn.prop(languageDataProp)==Un.data:Un?qn=>qn==Un:void 0,this.style=tagHighlighter(Ce.map(qn=>({tag:qn.tag,class:qn.class||Hn(Object.assign({},qn,{tag:null}))})),{all:zn}).style,this.module=$n?new StyleModule($n):null,this.themeType=ke.themeType}static define(Ce,ke){return new HighlightStyle(Ce,ke||{})}}const highlighterFacet=Facet.define(),fallbackHighlighter=Facet.define({combine(_n){return _n.length?[_n[0]]:null}});function getHighlighters(_n){let Ce=_n.facet(highlighterFacet);return Ce.length?Ce:_n.facet(fallbackHighlighter)}function syntaxHighlighting(_n,Ce){let ke=[treeHighlighter],$n;return _n instanceof HighlightStyle&&(_n.module&&ke.push(EditorView.styleModule.of(_n.module)),$n=_n.themeType),Ce!=null&&Ce.fallback?ke.push(fallbackHighlighter.of(_n)):$n?ke.push(highlighterFacet.computeN([EditorView.darkTheme],Hn=>Hn.facet(EditorView.darkTheme)==($n=="dark")?[_n]:[])):ke.push(highlighterFacet.of(_n)),ke}class TreeHighlighter{constructor(Ce){this.markCache=Object.create(null),this.tree=syntaxTree(Ce.state),this.decorations=this.buildDeco(Ce,getHighlighters(Ce.state)),this.decoratedTo=Ce.viewport.to}update(Ce){let ke=syntaxTree(Ce.state),$n=getHighlighters(Ce.state),Hn=$n!=getHighlighters(Ce.startState),{viewport:zn}=Ce.view,Un=Ce.changes.mapPos(this.decoratedTo,1);ke.length=zn.to?(this.decorations=this.decorations.map(Ce.changes),this.decoratedTo=Un):(ke!=this.tree||Ce.viewportChanged||Hn)&&(this.tree=ke,this.decorations=this.buildDeco(Ce.view,$n),this.decoratedTo=zn.to)}buildDeco(Ce,ke){if(!ke||!this.tree.length)return Decoration.none;let $n=new RangeSetBuilder;for(let{from:Hn,to:zn}of Ce.visibleRanges)highlightTree(this.tree,ke,(Un,qn,Xn)=>{$n.add(Un,qn,this.markCache[Xn]||(this.markCache[Xn]=Decoration.mark({class:Xn})))},Hn,zn);return $n.finish()}}const treeHighlighter=Prec.high(ViewPlugin.fromClass(TreeHighlighter,{decorations:_n=>_n.decorations})),defaultHighlightStyle=HighlightStyle.define([{tag:tags$1.meta,color:"#404740"},{tag:tags$1.link,textDecoration:"underline"},{tag:tags$1.heading,textDecoration:"underline",fontWeight:"bold"},{tag:tags$1.emphasis,fontStyle:"italic"},{tag:tags$1.strong,fontWeight:"bold"},{tag:tags$1.strikethrough,textDecoration:"line-through"},{tag:tags$1.keyword,color:"#708"},{tag:[tags$1.atom,tags$1.bool,tags$1.url,tags$1.contentSeparator,tags$1.labelName],color:"#219"},{tag:[tags$1.literal,tags$1.inserted],color:"#164"},{tag:[tags$1.string,tags$1.deleted],color:"#a11"},{tag:[tags$1.regexp,tags$1.escape,tags$1.special(tags$1.string)],color:"#e40"},{tag:tags$1.definition(tags$1.variableName),color:"#00f"},{tag:tags$1.local(tags$1.variableName),color:"#30a"},{tag:[tags$1.typeName,tags$1.namespace],color:"#085"},{tag:tags$1.className,color:"#167"},{tag:[tags$1.special(tags$1.variableName),tags$1.macroName],color:"#256"},{tag:tags$1.definition(tags$1.propertyName),color:"#00c"},{tag:tags$1.comment,color:"#940"},{tag:tags$1.invalid,color:"#f00"}]),baseTheme$3=EditorView.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),DefaultScanDist=1e4,DefaultBrackets="()[]{}",bracketMatchingConfig=Facet.define({combine(_n){return combineConfig(_n,{afterCursor:!0,brackets:DefaultBrackets,maxScanDistance:DefaultScanDist,renderMatch:defaultRenderMatch})}}),matchingMark=Decoration.mark({class:"cm-matchingBracket"}),nonmatchingMark=Decoration.mark({class:"cm-nonmatchingBracket"});function defaultRenderMatch(_n){let Ce=[],ke=_n.matched?matchingMark:nonmatchingMark;return Ce.push(ke.range(_n.start.from,_n.start.to)),_n.end&&Ce.push(ke.range(_n.end.from,_n.end.to)),Ce}const bracketMatchingState=StateField.define({create(){return Decoration.none},update(_n,Ce){if(!Ce.docChanged&&!Ce.selection)return _n;let ke=[],$n=Ce.state.facet(bracketMatchingConfig);for(let Hn of Ce.state.selection.ranges){if(!Hn.empty)continue;let zn=matchBrackets(Ce.state,Hn.head,-1,$n)||Hn.head>0&&matchBrackets(Ce.state,Hn.head-1,1,$n)||$n.afterCursor&&(matchBrackets(Ce.state,Hn.head,1,$n)||Hn.headEditorView.decorations.from(_n)}),bracketMatchingUnique=[bracketMatchingState,baseTheme$3];function bracketMatching(_n={}){return[bracketMatchingConfig.of(_n),bracketMatchingUnique]}const bracketMatchingHandle=new NodeProp;function matchingNodes(_n,Ce,ke){let $n=_n.prop(Ce<0?NodeProp.openedBy:NodeProp.closedBy);if($n)return $n;if(_n.name.length==1){let Hn=ke.indexOf(_n.name);if(Hn>-1&&Hn%2==(Ce<0?1:0))return[ke[Hn+Ce]]}return null}function findHandle(_n){let Ce=_n.type.prop(bracketMatchingHandle);return Ce?Ce(_n.node):_n}function matchBrackets(_n,Ce,ke,$n={}){let Hn=$n.maxScanDistance||DefaultScanDist,zn=$n.brackets||DefaultBrackets,Un=syntaxTree(_n),qn=Un.resolveInner(Ce,ke);for(let Xn=qn;Xn;Xn=Xn.parent){let Kn=matchingNodes(Xn.type,ke,zn);if(Kn&&Xn.from0?Ce>=to.from&&Ceto.from&&Ce<=to.to))return matchMarkedBrackets(_n,Ce,ke,Xn,to,Kn,zn)}}return matchPlainBrackets(_n,Ce,ke,Un,qn.type,Hn,zn)}function matchMarkedBrackets(_n,Ce,ke,$n,Hn,zn,Un){let qn=$n.parent,Xn={from:Hn.from,to:Hn.to},Kn=0,to=qn==null?void 0:qn.cursor();if(to&&(ke<0?to.childBefore($n.from):to.childAfter($n.to)))do if(ke<0?to.to<=$n.from:to.from>=$n.to){if(Kn==0&&zn.indexOf(to.type.name)>-1&&to.from0)return null;let Kn={from:ke<0?Ce-1:Ce,to:ke>0?Ce+1:Ce},to=_n.doc.iterRange(Ce,ke>0?_n.doc.length:0),io=0;for(let uo=0;!to.next().done&&uo<=zn;){let ho=to.value;ke<0&&(uo+=ho.length);let bo=Ce+uo*ke;for(let Oo=ke>0?0:ho.length-1,So=ke>0?ho.length:-1;Oo!=So;Oo+=ke){let $o=Un.indexOf(ho[Oo]);if(!($o<0||$n.resolveInner(bo+Oo,1).type!=Hn))if($o%2==0==ke>0)io++;else{if(io==1)return{start:Kn,end:{from:bo+Oo,to:bo+Oo+1},matched:$o>>1==Xn>>1};io--}}ke>0&&(uo+=ho.length)}return to.done?{start:Kn,matched:!1}:null}const noTokens=Object.create(null),typeArray=[NodeType.none],warned=[],byTag=Object.create(null),defaultTable=Object.create(null);for(let[_n,Ce]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])defaultTable[_n]=createTokenType(noTokens,Ce);function warnForPart(_n,Ce){warned.indexOf(_n)>-1||(warned.push(_n),console.warn(Ce))}function createTokenType(_n,Ce){let ke=[];for(let qn of Ce.split(" ")){let Xn=[];for(let Kn of qn.split(".")){let to=_n[Kn]||tags$1[Kn];to?typeof to=="function"?Xn.length?Xn=Xn.map(to):warnForPart(Kn,`Modifier ${Kn} used at start of tag`):Xn.length?warnForPart(Kn,`Tag ${Kn} used as modifier`):Xn=Array.isArray(to)?to:[to]:warnForPart(Kn,`Unknown highlighting tag ${Kn}`)}for(let Kn of Xn)ke.push(Kn)}if(!ke.length)return 0;let $n=Ce.replace(/ /g,"_"),Hn=$n+" "+ke.map(qn=>qn.id),zn=byTag[Hn];if(zn)return zn.id;let Un=byTag[Hn]=NodeType.define({id:typeArray.length,name:$n,props:[styleTags({[$n]:ke})]});return typeArray.push(Un),Un.id}Direction.RTL,Direction.LTR;const toggleComment=_n=>{let{state:Ce}=_n,ke=Ce.doc.lineAt(Ce.selection.main.from),$n=getConfig(_n.state,ke.from);return $n.line?toggleLineComment(_n):$n.block?toggleBlockCommentByLine(_n):!1};function command(_n,Ce){return({state:ke,dispatch:$n})=>{if(ke.readOnly)return!1;let Hn=_n(Ce,ke);return Hn?($n(ke.update(Hn)),!0):!1}}const toggleLineComment=command(changeLineComment,0),toggleBlockComment=command(changeBlockComment,0),toggleBlockCommentByLine=command((_n,Ce)=>changeBlockComment(_n,Ce,selectedLineRanges(Ce)),0);function getConfig(_n,Ce){let ke=_n.languageDataAt("commentTokens",Ce);return ke.length?ke[0]:{}}const SearchMargin=50;function findBlockComment(_n,{open:Ce,close:ke},$n,Hn){let zn=_n.sliceDoc($n-SearchMargin,$n),Un=_n.sliceDoc(Hn,Hn+SearchMargin),qn=/\s*$/.exec(zn)[0].length,Xn=/^\s*/.exec(Un)[0].length,Kn=zn.length-qn;if(zn.slice(Kn-Ce.length,Kn)==Ce&&Un.slice(Xn,Xn+ke.length)==ke)return{open:{pos:$n-qn,margin:qn&&1},close:{pos:Hn+Xn,margin:Xn&&1}};let to,io;Hn-$n<=2*SearchMargin?to=io=_n.sliceDoc($n,Hn):(to=_n.sliceDoc($n,$n+SearchMargin),io=_n.sliceDoc(Hn-SearchMargin,Hn));let uo=/^\s*/.exec(to)[0].length,ho=/\s*$/.exec(io)[0].length,bo=io.length-ho-ke.length;return to.slice(uo,uo+Ce.length)==Ce&&io.slice(bo,bo+ke.length)==ke?{open:{pos:$n+uo+Ce.length,margin:/\s/.test(to.charAt(uo+Ce.length))?1:0},close:{pos:Hn-ho-ke.length,margin:/\s/.test(io.charAt(bo-1))?1:0}}:null}function selectedLineRanges(_n){let Ce=[];for(let ke of _n.selection.ranges){let $n=_n.doc.lineAt(ke.from),Hn=ke.to<=$n.to?$n:_n.doc.lineAt(ke.to),zn=Ce.length-1;zn>=0&&Ce[zn].to>$n.from?Ce[zn].to=Hn.to:Ce.push({from:$n.from+/^\s*/.exec($n.text)[0].length,to:Hn.to})}return Ce}function changeBlockComment(_n,Ce,ke=Ce.selection.ranges){let $n=ke.map(zn=>getConfig(Ce,zn.from).block);if(!$n.every(zn=>zn))return null;let Hn=ke.map((zn,Un)=>findBlockComment(Ce,$n[Un],zn.from,zn.to));if(_n!=2&&!Hn.every(zn=>zn))return{changes:Ce.changes(ke.map((zn,Un)=>Hn[Un]?[]:[{from:zn.from,insert:$n[Un].open+" "},{from:zn.to,insert:" "+$n[Un].close}]))};if(_n!=1&&Hn.some(zn=>zn)){let zn=[];for(let Un=0,qn;UnHn&&(zn==Un||Un>io.from)){Hn=io.from;let uo=/^\s*/.exec(io.text)[0].length,ho=uo==io.length,bo=io.text.slice(uo,uo+Kn.length)==Kn?uo:-1;uozn.comment<0&&(!zn.empty||zn.single))){let zn=[];for(let{line:qn,token:Xn,indent:Kn,empty:to,single:io}of $n)(io||!to)&&zn.push({from:qn.from+Kn,insert:Xn+" "});let Un=Ce.changes(zn);return{changes:Un,selection:Ce.selection.map(Un,1)}}else if(_n!=1&&$n.some(zn=>zn.comment>=0)){let zn=[];for(let{line:Un,comment:qn,token:Xn}of $n)if(qn>=0){let Kn=Un.from+qn,to=Kn+Xn.length;Un.text[to-Un.from]==" "&&to++,zn.push({from:Kn,to})}return{changes:zn}}return null}const fromHistory=Annotation.define(),isolateHistory=Annotation.define(),invertedEffects=Facet.define(),historyConfig=Facet.define({combine(_n){return combineConfig(_n,{minDepth:100,newGroupDelay:500,joinToEvent:(Ce,ke)=>ke},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(Ce,ke)=>($n,Hn)=>Ce($n,Hn)||ke($n,Hn)})}}),historyField_=StateField.define({create(){return HistoryState.empty},update(_n,Ce){let ke=Ce.state.facet(historyConfig),$n=Ce.annotation(fromHistory);if($n){let Xn=HistEvent.fromTransaction(Ce,$n.selection),Kn=$n.side,to=Kn==0?_n.undone:_n.done;return Xn?to=updateBranch(to,to.length,ke.minDepth,Xn):to=addSelection(to,Ce.startState.selection),new HistoryState(Kn==0?$n.rest:to,Kn==0?to:$n.rest)}let Hn=Ce.annotation(isolateHistory);if((Hn=="full"||Hn=="before")&&(_n=_n.isolate()),Ce.annotation(Transaction.addToHistory)===!1)return Ce.changes.empty?_n:_n.addMapping(Ce.changes.desc);let zn=HistEvent.fromTransaction(Ce),Un=Ce.annotation(Transaction.time),qn=Ce.annotation(Transaction.userEvent);return zn?_n=_n.addChanges(zn,Un,qn,ke,Ce):Ce.selection&&(_n=_n.addSelection(Ce.startState.selection,Un,qn,ke.newGroupDelay)),(Hn=="full"||Hn=="after")&&(_n=_n.isolate()),_n},toJSON(_n){return{done:_n.done.map(Ce=>Ce.toJSON()),undone:_n.undone.map(Ce=>Ce.toJSON())}},fromJSON(_n){return new HistoryState(_n.done.map(HistEvent.fromJSON),_n.undone.map(HistEvent.fromJSON))}});function history$1(_n={}){return[historyField_,historyConfig.of(_n),EditorView.domEventHandlers({beforeinput(Ce,ke){let $n=Ce.inputType=="historyUndo"?undo:Ce.inputType=="historyRedo"?redo:null;return $n?(Ce.preventDefault(),$n(ke)):!1}})]}function cmd(_n,Ce){return function({state:ke,dispatch:$n}){if(!Ce&&ke.readOnly)return!1;let Hn=ke.field(historyField_,!1);if(!Hn)return!1;let zn=Hn.pop(_n,ke,Ce);return zn?($n(zn),!0):!1}}const undo=cmd(0,!1),redo=cmd(1,!1),undoSelection=cmd(0,!0),redoSelection=cmd(1,!0);class HistEvent{constructor(Ce,ke,$n,Hn,zn){this.changes=Ce,this.effects=ke,this.mapped=$n,this.startSelection=Hn,this.selectionsAfter=zn}setSelAfter(Ce){return new HistEvent(this.changes,this.effects,this.mapped,this.startSelection,Ce)}toJSON(){var Ce,ke,$n;return{changes:(Ce=this.changes)===null||Ce===void 0?void 0:Ce.toJSON(),mapped:(ke=this.mapped)===null||ke===void 0?void 0:ke.toJSON(),startSelection:($n=this.startSelection)===null||$n===void 0?void 0:$n.toJSON(),selectionsAfter:this.selectionsAfter.map(Hn=>Hn.toJSON())}}static fromJSON(Ce){return new HistEvent(Ce.changes&&ChangeSet.fromJSON(Ce.changes),[],Ce.mapped&&ChangeDesc.fromJSON(Ce.mapped),Ce.startSelection&&EditorSelection.fromJSON(Ce.startSelection),Ce.selectionsAfter.map(EditorSelection.fromJSON))}static fromTransaction(Ce,ke){let $n=none$2;for(let Hn of Ce.startState.facet(invertedEffects)){let zn=Hn(Ce);zn.length&&($n=$n.concat(zn))}return!$n.length&&Ce.changes.empty?null:new HistEvent(Ce.changes.invert(Ce.startState.doc),$n,void 0,ke||Ce.startState.selection,none$2)}static selection(Ce){return new HistEvent(void 0,none$2,void 0,void 0,Ce)}}function updateBranch(_n,Ce,ke,$n){let Hn=Ce+1>ke+20?Ce-ke-1:0,zn=_n.slice(Hn,Ce);return zn.push($n),zn}function isAdjacent(_n,Ce){let ke=[],$n=!1;return _n.iterChangedRanges((Hn,zn)=>ke.push(Hn,zn)),Ce.iterChangedRanges((Hn,zn,Un,qn)=>{for(let Xn=0;Xn=Kn&&Un<=to&&($n=!0)}}),$n}function eqSelectionShape(_n,Ce){return _n.ranges.length==Ce.ranges.length&&_n.ranges.filter((ke,$n)=>ke.empty!=Ce.ranges[$n].empty).length===0}function conc(_n,Ce){return _n.length?Ce.length?_n.concat(Ce):_n:Ce}const none$2=[],MaxSelectionsPerEvent=200;function addSelection(_n,Ce){if(_n.length){let ke=_n[_n.length-1],$n=ke.selectionsAfter.slice(Math.max(0,ke.selectionsAfter.length-MaxSelectionsPerEvent));return $n.length&&$n[$n.length-1].eq(Ce)?_n:($n.push(Ce),updateBranch(_n,_n.length-1,1e9,ke.setSelAfter($n)))}else return[HistEvent.selection([Ce])]}function popSelection(_n){let Ce=_n[_n.length-1],ke=_n.slice();return ke[_n.length-1]=Ce.setSelAfter(Ce.selectionsAfter.slice(0,Ce.selectionsAfter.length-1)),ke}function addMappingToBranch(_n,Ce){if(!_n.length)return _n;let ke=_n.length,$n=none$2;for(;ke;){let Hn=mapEvent(_n[ke-1],Ce,$n);if(Hn.changes&&!Hn.changes.empty||Hn.effects.length){let zn=_n.slice(0,ke);return zn[ke-1]=Hn,zn}else Ce=Hn.mapped,ke--,$n=Hn.selectionsAfter}return $n.length?[HistEvent.selection($n)]:none$2}function mapEvent(_n,Ce,ke){let $n=conc(_n.selectionsAfter.length?_n.selectionsAfter.map(qn=>qn.map(Ce)):none$2,ke);if(!_n.changes)return HistEvent.selection($n);let Hn=_n.changes.map(Ce),zn=Ce.mapDesc(_n.changes,!0),Un=_n.mapped?_n.mapped.composeDesc(zn):zn;return new HistEvent(Hn,StateEffect.mapEffects(_n.effects,Ce),Un,_n.startSelection.map(zn),$n)}const joinableUserEvent=/^(input\.type|delete)($|\.)/;class HistoryState{constructor(Ce,ke,$n=0,Hn=void 0){this.done=Ce,this.undone=ke,this.prevTime=$n,this.prevUserEvent=Hn}isolate(){return this.prevTime?new HistoryState(this.done,this.undone):this}addChanges(Ce,ke,$n,Hn,zn){let Un=this.done,qn=Un[Un.length-1];return qn&&qn.changes&&!qn.changes.empty&&Ce.changes&&(!$n||joinableUserEvent.test($n))&&(!qn.selectionsAfter.length&&ke-this.prevTime0&&ke-this.prevTimeke.empty?_n.moveByChar(ke,Ce):rangeEnd(ke,Ce))}function ltrAtCursor(_n){return _n.textDirectionAt(_n.state.selection.main.head)==Direction.LTR}const cursorCharLeft=_n=>cursorByChar(_n,!ltrAtCursor(_n)),cursorCharRight=_n=>cursorByChar(_n,ltrAtCursor(_n));function cursorByGroup(_n,Ce){return moveSel(_n,ke=>ke.empty?_n.moveByGroup(ke,Ce):rangeEnd(ke,Ce))}const cursorGroupLeft=_n=>cursorByGroup(_n,!ltrAtCursor(_n)),cursorGroupRight=_n=>cursorByGroup(_n,ltrAtCursor(_n));function interestingNode(_n,Ce,ke){if(Ce.type.prop(ke))return!0;let $n=Ce.to-Ce.from;return $n&&($n>2||/[^\s,.;:]/.test(_n.sliceDoc(Ce.from,Ce.to)))||Ce.firstChild}function moveBySyntax(_n,Ce,ke){let $n=syntaxTree(_n).resolveInner(Ce.head),Hn=ke?NodeProp.closedBy:NodeProp.openedBy;for(let Xn=Ce.head;;){let Kn=ke?$n.childAfter(Xn):$n.childBefore(Xn);if(!Kn)break;interestingNode(_n,Kn,Hn)?$n=Kn:Xn=ke?Kn.to:Kn.from}let zn=$n.type.prop(Hn),Un,qn;return zn&&(Un=ke?matchBrackets(_n,$n.from,1):matchBrackets(_n,$n.to,-1))&&Un.matched?qn=ke?Un.end.to:Un.end.from:qn=ke?$n.to:$n.from,EditorSelection.cursor(qn,ke?-1:1)}const cursorSyntaxLeft=_n=>moveSel(_n,Ce=>moveBySyntax(_n.state,Ce,!ltrAtCursor(_n))),cursorSyntaxRight=_n=>moveSel(_n,Ce=>moveBySyntax(_n.state,Ce,ltrAtCursor(_n)));function cursorByLine(_n,Ce){return moveSel(_n,ke=>{if(!ke.empty)return rangeEnd(ke,Ce);let $n=_n.moveVertically(ke,Ce);return $n.head!=ke.head?$n:_n.moveToLineBoundary(ke,Ce)})}const cursorLineUp=_n=>cursorByLine(_n,!1),cursorLineDown=_n=>cursorByLine(_n,!0);function pageInfo(_n){let Ce=_n.scrollDOM.clientHeight<_n.scrollDOM.scrollHeight-2,ke=0,$n=0,Hn;if(Ce){for(let zn of _n.state.facet(EditorView.scrollMargins)){let Un=zn(_n);Un!=null&&Un.top&&(ke=Math.max(Un==null?void 0:Un.top,ke)),Un!=null&&Un.bottom&&($n=Math.max(Un==null?void 0:Un.bottom,$n))}Hn=_n.scrollDOM.clientHeight-ke-$n}else Hn=(_n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:ke,marginBottom:$n,selfScroll:Ce,height:Math.max(_n.defaultLineHeight,Hn-5)}}function cursorByPage(_n,Ce){let ke=pageInfo(_n),{state:$n}=_n,Hn=updateSel($n.selection,Un=>Un.empty?_n.moveVertically(Un,Ce,ke.height):rangeEnd(Un,Ce));if(Hn.eq($n.selection))return!1;let zn;if(ke.selfScroll){let Un=_n.coordsAtPos($n.selection.main.head),qn=_n.scrollDOM.getBoundingClientRect(),Xn=qn.top+ke.marginTop,Kn=qn.bottom-ke.marginBottom;Un&&Un.top>Xn&&Un.bottomcursorByPage(_n,!1),cursorPageDown=_n=>cursorByPage(_n,!0);function moveByLineBoundary(_n,Ce,ke){let $n=_n.lineBlockAt(Ce.head),Hn=_n.moveToLineBoundary(Ce,ke);if(Hn.head==Ce.head&&Hn.head!=(ke?$n.to:$n.from)&&(Hn=_n.moveToLineBoundary(Ce,ke,!1)),!ke&&Hn.head==$n.from&&$n.length){let zn=/^\s*/.exec(_n.state.sliceDoc($n.from,Math.min($n.from+100,$n.to)))[0].length;zn&&Ce.head!=$n.from+zn&&(Hn=EditorSelection.cursor($n.from+zn))}return Hn}const cursorLineBoundaryForward=_n=>moveSel(_n,Ce=>moveByLineBoundary(_n,Ce,!0)),cursorLineBoundaryBackward=_n=>moveSel(_n,Ce=>moveByLineBoundary(_n,Ce,!1)),cursorLineBoundaryLeft=_n=>moveSel(_n,Ce=>moveByLineBoundary(_n,Ce,!ltrAtCursor(_n))),cursorLineBoundaryRight=_n=>moveSel(_n,Ce=>moveByLineBoundary(_n,Ce,ltrAtCursor(_n))),cursorLineStart=_n=>moveSel(_n,Ce=>EditorSelection.cursor(_n.lineBlockAt(Ce.head).from,1)),cursorLineEnd=_n=>moveSel(_n,Ce=>EditorSelection.cursor(_n.lineBlockAt(Ce.head).to,-1));function toMatchingBracket(_n,Ce,ke){let $n=!1,Hn=updateSel(_n.selection,zn=>{let Un=matchBrackets(_n,zn.head,-1)||matchBrackets(_n,zn.head,1)||zn.head>0&&matchBrackets(_n,zn.head-1,1)||zn.head<_n.doc.length&&matchBrackets(_n,zn.head+1,-1);if(!Un||!Un.end)return zn;$n=!0;let qn=Un.start.from==zn.head?Un.end.to:Un.end.from;return EditorSelection.cursor(qn)});return $n?(Ce(setSel(_n,Hn)),!0):!1}const cursorMatchingBracket=({state:_n,dispatch:Ce})=>toMatchingBracket(_n,Ce);function extendSel(_n,Ce){let ke=updateSel(_n.state.selection,$n=>{let Hn=Ce($n);return EditorSelection.range($n.anchor,Hn.head,Hn.goalColumn,Hn.bidiLevel||void 0)});return ke.eq(_n.state.selection)?!1:(_n.dispatch(setSel(_n.state,ke)),!0)}function selectByChar(_n,Ce){return extendSel(_n,ke=>_n.moveByChar(ke,Ce))}const selectCharLeft=_n=>selectByChar(_n,!ltrAtCursor(_n)),selectCharRight=_n=>selectByChar(_n,ltrAtCursor(_n));function selectByGroup(_n,Ce){return extendSel(_n,ke=>_n.moveByGroup(ke,Ce))}const selectGroupLeft=_n=>selectByGroup(_n,!ltrAtCursor(_n)),selectGroupRight=_n=>selectByGroup(_n,ltrAtCursor(_n)),selectSyntaxLeft=_n=>extendSel(_n,Ce=>moveBySyntax(_n.state,Ce,!ltrAtCursor(_n))),selectSyntaxRight=_n=>extendSel(_n,Ce=>moveBySyntax(_n.state,Ce,ltrAtCursor(_n)));function selectByLine(_n,Ce){return extendSel(_n,ke=>_n.moveVertically(ke,Ce))}const selectLineUp=_n=>selectByLine(_n,!1),selectLineDown=_n=>selectByLine(_n,!0);function selectByPage(_n,Ce){return extendSel(_n,ke=>_n.moveVertically(ke,Ce,pageInfo(_n).height))}const selectPageUp=_n=>selectByPage(_n,!1),selectPageDown=_n=>selectByPage(_n,!0),selectLineBoundaryForward=_n=>extendSel(_n,Ce=>moveByLineBoundary(_n,Ce,!0)),selectLineBoundaryBackward=_n=>extendSel(_n,Ce=>moveByLineBoundary(_n,Ce,!1)),selectLineBoundaryLeft=_n=>extendSel(_n,Ce=>moveByLineBoundary(_n,Ce,!ltrAtCursor(_n))),selectLineBoundaryRight=_n=>extendSel(_n,Ce=>moveByLineBoundary(_n,Ce,ltrAtCursor(_n))),selectLineStart=_n=>extendSel(_n,Ce=>EditorSelection.cursor(_n.lineBlockAt(Ce.head).from)),selectLineEnd=_n=>extendSel(_n,Ce=>EditorSelection.cursor(_n.lineBlockAt(Ce.head).to)),cursorDocStart=({state:_n,dispatch:Ce})=>(Ce(setSel(_n,{anchor:0})),!0),cursorDocEnd=({state:_n,dispatch:Ce})=>(Ce(setSel(_n,{anchor:_n.doc.length})),!0),selectDocStart=({state:_n,dispatch:Ce})=>(Ce(setSel(_n,{anchor:_n.selection.main.anchor,head:0})),!0),selectDocEnd=({state:_n,dispatch:Ce})=>(Ce(setSel(_n,{anchor:_n.selection.main.anchor,head:_n.doc.length})),!0),selectAll=({state:_n,dispatch:Ce})=>(Ce(_n.update({selection:{anchor:0,head:_n.doc.length},userEvent:"select"})),!0),selectLine=({state:_n,dispatch:Ce})=>{let ke=selectedLineBlocks(_n).map(({from:$n,to:Hn})=>EditorSelection.range($n,Math.min(Hn+1,_n.doc.length)));return Ce(_n.update({selection:EditorSelection.create(ke),userEvent:"select"})),!0},selectParentSyntax=({state:_n,dispatch:Ce})=>{let ke=updateSel(_n.selection,$n=>{var Hn;let zn=syntaxTree(_n).resolveStack($n.from,1);for(let Un=zn;Un;Un=Un.next){let{node:qn}=Un;if((qn.from<$n.from&&qn.to>=$n.to||qn.to>$n.to&&qn.from<=$n.from)&&(!((Hn=qn.parent)===null||Hn===void 0)&&Hn.parent))return EditorSelection.range(qn.to,qn.from)}return $n});return Ce(setSel(_n,ke)),!0},simplifySelection=({state:_n,dispatch:Ce})=>{let ke=_n.selection,$n=null;return ke.ranges.length>1?$n=EditorSelection.create([ke.main]):ke.main.empty||($n=EditorSelection.create([EditorSelection.cursor(ke.main.head)])),$n?(Ce(setSel(_n,$n)),!0):!1};function deleteBy(_n,Ce){if(_n.state.readOnly)return!1;let ke="delete.selection",{state:$n}=_n,Hn=$n.changeByRange(zn=>{let{from:Un,to:qn}=zn;if(Un==qn){let Xn=Ce(zn);XnUn&&(ke="delete.forward",Xn=skipAtomic(_n,Xn,!0)),Un=Math.min(Un,Xn),qn=Math.max(qn,Xn)}else Un=skipAtomic(_n,Un,!1),qn=skipAtomic(_n,qn,!0);return Un==qn?{range:zn}:{changes:{from:Un,to:qn},range:EditorSelection.cursor(Un,UnHn(_n)))$n.between(Ce,Ce,(Hn,zn)=>{HnCe&&(Ce=ke?zn:Hn)});return Ce}const deleteByChar=(_n,Ce,ke)=>deleteBy(_n,$n=>{let Hn=$n.from,{state:zn}=_n,Un=zn.doc.lineAt(Hn),qn,Xn;if(ke&&!Ce&&Hn>Un.from&&HndeleteByChar(_n,!1,!0),deleteCharForward=_n=>deleteByChar(_n,!0,!1),deleteByGroup=(_n,Ce)=>deleteBy(_n,ke=>{let $n=ke.head,{state:Hn}=_n,zn=Hn.doc.lineAt($n),Un=Hn.charCategorizer($n);for(let qn=null;;){if($n==(Ce?zn.to:zn.from)){$n==ke.head&&zn.number!=(Ce?Hn.doc.lines:1)&&($n+=Ce?1:-1);break}let Xn=findClusterBreak(zn.text,$n-zn.from,Ce)+zn.from,Kn=zn.text.slice(Math.min($n,Xn)-zn.from,Math.max($n,Xn)-zn.from),to=Un(Kn);if(qn!=null&&to!=qn)break;(Kn!=" "||$n!=ke.head)&&(qn=to),$n=Xn}return $n}),deleteGroupBackward=_n=>deleteByGroup(_n,!1),deleteGroupForward=_n=>deleteByGroup(_n,!0),deleteToLineEnd=_n=>deleteBy(_n,Ce=>{let ke=_n.lineBlockAt(Ce.head).to;return Ce.headdeleteBy(_n,Ce=>{let ke=_n.moveToLineBoundary(Ce,!1).head;return Ce.head>ke?ke:Math.max(0,Ce.head-1)}),deleteLineBoundaryForward=_n=>deleteBy(_n,Ce=>{let ke=_n.moveToLineBoundary(Ce,!0).head;return Ce.head{if(_n.readOnly)return!1;let ke=_n.changeByRange($n=>({changes:{from:$n.from,to:$n.to,insert:Text.of(["",""])},range:EditorSelection.cursor($n.from)}));return Ce(_n.update(ke,{scrollIntoView:!0,userEvent:"input"})),!0},transposeChars=({state:_n,dispatch:Ce})=>{if(_n.readOnly)return!1;let ke=_n.changeByRange($n=>{if(!$n.empty||$n.from==0||$n.from==_n.doc.length)return{range:$n};let Hn=$n.from,zn=_n.doc.lineAt(Hn),Un=Hn==zn.from?Hn-1:findClusterBreak(zn.text,Hn-zn.from,!1)+zn.from,qn=Hn==zn.to?Hn+1:findClusterBreak(zn.text,Hn-zn.from,!0)+zn.from;return{changes:{from:Un,to:qn,insert:_n.doc.slice(Hn,qn).append(_n.doc.slice(Un,Hn))},range:EditorSelection.cursor(qn)}});return ke.changes.empty?!1:(Ce(_n.update(ke,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function selectedLineBlocks(_n){let Ce=[],ke=-1;for(let $n of _n.selection.ranges){let Hn=_n.doc.lineAt($n.from),zn=_n.doc.lineAt($n.to);if(!$n.empty&&$n.to==zn.from&&(zn=_n.doc.lineAt($n.to-1)),ke>=Hn.number){let Un=Ce[Ce.length-1];Un.to=zn.to,Un.ranges.push($n)}else Ce.push({from:Hn.from,to:zn.to,ranges:[$n]});ke=zn.number+1}return Ce}function moveLine(_n,Ce,ke){if(_n.readOnly)return!1;let $n=[],Hn=[];for(let zn of selectedLineBlocks(_n)){if(ke?zn.to==_n.doc.length:zn.from==0)continue;let Un=_n.doc.lineAt(ke?zn.to+1:zn.from-1),qn=Un.length+1;if(ke){$n.push({from:zn.to,to:Un.to},{from:zn.from,insert:Un.text+_n.lineBreak});for(let Xn of zn.ranges)Hn.push(EditorSelection.range(Math.min(_n.doc.length,Xn.anchor+qn),Math.min(_n.doc.length,Xn.head+qn)))}else{$n.push({from:Un.from,to:zn.from},{from:zn.to,insert:_n.lineBreak+Un.text});for(let Xn of zn.ranges)Hn.push(EditorSelection.range(Xn.anchor-qn,Xn.head-qn))}}return $n.length?(Ce(_n.update({changes:$n,scrollIntoView:!0,selection:EditorSelection.create(Hn,_n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const moveLineUp=({state:_n,dispatch:Ce})=>moveLine(_n,Ce,!1),moveLineDown=({state:_n,dispatch:Ce})=>moveLine(_n,Ce,!0);function copyLine(_n,Ce,ke){if(_n.readOnly)return!1;let $n=[];for(let Hn of selectedLineBlocks(_n))ke?$n.push({from:Hn.from,insert:_n.doc.slice(Hn.from,Hn.to)+_n.lineBreak}):$n.push({from:Hn.to,insert:_n.lineBreak+_n.doc.slice(Hn.from,Hn.to)});return Ce(_n.update({changes:$n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const copyLineUp=({state:_n,dispatch:Ce})=>copyLine(_n,Ce,!1),copyLineDown=({state:_n,dispatch:Ce})=>copyLine(_n,Ce,!0),deleteLine=_n=>{if(_n.state.readOnly)return!1;let{state:Ce}=_n,ke=Ce.changes(selectedLineBlocks(Ce).map(({from:Hn,to:zn})=>(Hn>0?Hn--:zn{let zn;if(_n.lineWrapping){let Un=_n.lineBlockAt(Hn.head),qn=_n.coordsAtPos(Hn.head,Hn.assoc||1);qn&&(zn=Un.bottom+_n.documentTop-qn.bottom+_n.defaultLineHeight/2)}return _n.moveVertically(Hn,!0,zn)}).map(ke);return _n.dispatch({changes:ke,selection:$n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function isBetweenBrackets(_n,Ce){if(/\(\)|\[\]|\{\}/.test(_n.sliceDoc(Ce-1,Ce+1)))return{from:Ce,to:Ce};let ke=syntaxTree(_n).resolveInner(Ce),$n=ke.childBefore(Ce),Hn=ke.childAfter(Ce),zn;return $n&&Hn&&$n.to<=Ce&&Hn.from>=Ce&&(zn=$n.type.prop(NodeProp.closedBy))&&zn.indexOf(Hn.name)>-1&&_n.doc.lineAt($n.to).from==_n.doc.lineAt(Hn.from).from&&!/\S/.test(_n.sliceDoc($n.to,Hn.from))?{from:$n.to,to:Hn.from}:null}const insertNewlineAndIndent=newlineAndIndent(!1),insertBlankLine=newlineAndIndent(!0);function newlineAndIndent(_n){return({state:Ce,dispatch:ke})=>{if(Ce.readOnly)return!1;let $n=Ce.changeByRange(Hn=>{let{from:zn,to:Un}=Hn,qn=Ce.doc.lineAt(zn),Xn=!_n&&zn==Un&&isBetweenBrackets(Ce,zn);_n&&(zn=Un=(Un<=qn.to?qn:Ce.doc.lineAt(Un)).to);let Kn=new IndentContext(Ce,{simulateBreak:zn,simulateDoubleBreak:!!Xn}),to=getIndentation(Kn,zn);for(to==null&&(to=countColumn(/^\s*/.exec(Ce.doc.lineAt(zn).text)[0],Ce.tabSize));Unqn.from&&zn{let Hn=[];for(let Un=$n.from;Un<=$n.to;){let qn=_n.doc.lineAt(Un);qn.number>ke&&($n.empty||$n.to>qn.from)&&(Ce(qn,Hn,$n),ke=qn.number),Un=qn.to+1}let zn=_n.changes(Hn);return{changes:Hn,range:EditorSelection.range(zn.mapPos($n.anchor,1),zn.mapPos($n.head,1))}})}const indentSelection=({state:_n,dispatch:Ce})=>{if(_n.readOnly)return!1;let ke=Object.create(null),$n=new IndentContext(_n,{overrideIndentation:zn=>{let Un=ke[zn];return Un??-1}}),Hn=changeBySelectedLine(_n,(zn,Un,qn)=>{let Xn=getIndentation($n,zn.from);if(Xn==null)return;/\S/.test(zn.text)||(Xn=0);let Kn=/^\s*/.exec(zn.text)[0],to=indentString(_n,Xn);(Kn!=to||qn.from_n.readOnly?!1:(Ce(_n.update(changeBySelectedLine(_n,(ke,$n)=>{$n.push({from:ke.from,insert:_n.facet(indentUnit)})}),{userEvent:"input.indent"})),!0),indentLess=({state:_n,dispatch:Ce})=>_n.readOnly?!1:(Ce(_n.update(changeBySelectedLine(_n,(ke,$n)=>{let Hn=/^\s*/.exec(ke.text)[0];if(!Hn)return;let zn=countColumn(Hn,_n.tabSize),Un=0,qn=indentString(_n,Math.max(0,zn-getIndentUnit(_n)));for(;Un(_n.setTabFocusMode(),!0),emacsStyleKeymap=[{key:"Ctrl-b",run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{key:"Ctrl-f",run:cursorCharRight,shift:selectCharRight},{key:"Ctrl-p",run:cursorLineUp,shift:selectLineUp},{key:"Ctrl-n",run:cursorLineDown,shift:selectLineDown},{key:"Ctrl-a",run:cursorLineStart,shift:selectLineStart},{key:"Ctrl-e",run:cursorLineEnd,shift:selectLineEnd},{key:"Ctrl-d",run:deleteCharForward},{key:"Ctrl-h",run:deleteCharBackward},{key:"Ctrl-k",run:deleteToLineEnd},{key:"Ctrl-Alt-h",run:deleteGroupBackward},{key:"Ctrl-o",run:splitLine},{key:"Ctrl-t",run:transposeChars},{key:"Ctrl-v",run:cursorPageDown}],standardKeymap=[{key:"ArrowLeft",run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:cursorGroupLeft,shift:selectGroupLeft,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:cursorLineBoundaryLeft,shift:selectLineBoundaryLeft,preventDefault:!0},{key:"ArrowRight",run:cursorCharRight,shift:selectCharRight,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:cursorGroupRight,shift:selectGroupRight,preventDefault:!0},{mac:"Cmd-ArrowRight",run:cursorLineBoundaryRight,shift:selectLineBoundaryRight,preventDefault:!0},{key:"ArrowUp",run:cursorLineUp,shift:selectLineUp,preventDefault:!0},{mac:"Cmd-ArrowUp",run:cursorDocStart,shift:selectDocStart},{mac:"Ctrl-ArrowUp",run:cursorPageUp,shift:selectPageUp},{key:"ArrowDown",run:cursorLineDown,shift:selectLineDown,preventDefault:!0},{mac:"Cmd-ArrowDown",run:cursorDocEnd,shift:selectDocEnd},{mac:"Ctrl-ArrowDown",run:cursorPageDown,shift:selectPageDown},{key:"PageUp",run:cursorPageUp,shift:selectPageUp},{key:"PageDown",run:cursorPageDown,shift:selectPageDown},{key:"Home",run:cursorLineBoundaryBackward,shift:selectLineBoundaryBackward,preventDefault:!0},{key:"Mod-Home",run:cursorDocStart,shift:selectDocStart},{key:"End",run:cursorLineBoundaryForward,shift:selectLineBoundaryForward,preventDefault:!0},{key:"Mod-End",run:cursorDocEnd,shift:selectDocEnd},{key:"Enter",run:insertNewlineAndIndent},{key:"Mod-a",run:selectAll},{key:"Backspace",run:deleteCharBackward,shift:deleteCharBackward},{key:"Delete",run:deleteCharForward},{key:"Mod-Backspace",mac:"Alt-Backspace",run:deleteGroupBackward},{key:"Mod-Delete",mac:"Alt-Delete",run:deleteGroupForward},{mac:"Mod-Backspace",run:deleteLineBoundaryBackward},{mac:"Mod-Delete",run:deleteLineBoundaryForward}].concat(emacsStyleKeymap.map(_n=>({mac:_n.key,run:_n.run,shift:_n.shift}))),defaultKeymap=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:cursorSyntaxLeft,shift:selectSyntaxLeft},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:cursorSyntaxRight,shift:selectSyntaxRight},{key:"Alt-ArrowUp",run:moveLineUp},{key:"Shift-Alt-ArrowUp",run:copyLineUp},{key:"Alt-ArrowDown",run:moveLineDown},{key:"Shift-Alt-ArrowDown",run:copyLineDown},{key:"Escape",run:simplifySelection},{key:"Mod-Enter",run:insertBlankLine},{key:"Alt-l",mac:"Ctrl-l",run:selectLine},{key:"Mod-i",run:selectParentSyntax,preventDefault:!0},{key:"Mod-[",run:indentLess},{key:"Mod-]",run:indentMore},{key:"Mod-Alt-\\",run:indentSelection},{key:"Shift-Mod-k",run:deleteLine},{key:"Shift-Mod-\\",run:cursorMatchingBracket},{key:"Mod-/",run:toggleComment},{key:"Alt-A",run:toggleBlockComment},{key:"Ctrl-m",mac:"Shift-Alt-m",run:toggleTabFocusMode}].concat(standardKeymap),indentWithTab={key:"Tab",run:indentMore,shift:indentLess};function crelt(){var _n=arguments[0];typeof _n=="string"&&(_n=document.createElement(_n));var Ce=1,ke=arguments[1];if(ke&&typeof ke=="object"&&ke.nodeType==null&&!Array.isArray(ke)){for(var $n in ke)if(Object.prototype.hasOwnProperty.call(ke,$n)){var Hn=ke[$n];typeof Hn=="string"?_n.setAttribute($n,Hn):Hn!=null&&(_n[$n]=Hn)}Ce++}for(;Ce_n.normalize("NFKD"):_n=>_n;class SearchCursor{constructor(Ce,ke,$n=0,Hn=Ce.length,zn,Un){this.test=Un,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=Ce.iterRange($n,Hn),this.bufferStart=$n,this.normalize=zn?qn=>zn(basicNormalize(qn)):basicNormalize,this.query=this.normalize(ke)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return codePointAt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let Ce=this.peek();if(Ce<0)return this.done=!0,this;let ke=fromCodePoint(Ce),$n=this.bufferStart+this.bufferPos;this.bufferPos+=codePointSize(Ce);let Hn=this.normalize(ke);for(let zn=0,Un=$n;;zn++){let qn=Hn.charCodeAt(zn),Xn=this.match(qn,Un,this.bufferPos+this.bufferStart);if(zn==Hn.length-1){if(Xn)return this.value=Xn,this;break}Un==$n&&znthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let Ce=this.matchPos-this.curLineStart;;){this.re.lastIndex=Ce;let ke=this.matchPos<=this.to&&this.re.exec(this.curLine);if(ke){let $n=this.curLineStart+ke.index,Hn=$n+ke[0].length;if(this.matchPos=toCharEnd(this.text,Hn+($n==Hn?1:0)),$n==this.curLineStart+this.curLine.length&&this.nextLine(),($nthis.value.to)&&(!this.test||this.test($n,Hn,ke)))return this.value={from:$n,to:Hn,match:ke},this;Ce=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=$n||Hn.to<=ke){let qn=new FlattenedDoc(ke,Ce.sliceString(ke,$n));return flattened.set(Ce,qn),qn}if(Hn.from==ke&&Hn.to==$n)return Hn;let{text:zn,from:Un}=Hn;return Un>ke&&(zn=Ce.sliceString(ke,Un)+zn,Un=ke),Hn.to<$n&&(zn+=Ce.sliceString(Hn.to,$n)),flattened.set(Ce,new FlattenedDoc(Un,zn)),new FlattenedDoc(ke,zn.slice(ke-Un,$n-Un))}}class MultilineRegExpCursor{constructor(Ce,ke,$n,Hn,zn){this.text=Ce,this.to=zn,this.done=!1,this.value=empty,this.matchPos=toCharEnd(Ce,Hn),this.re=new RegExp(ke,baseFlags+($n!=null&&$n.ignoreCase?"i":"")),this.test=$n==null?void 0:$n.test,this.flat=FlattenedDoc.get(Ce,Hn,this.chunkEnd(Hn+5e3))}chunkEnd(Ce){return Ce>=this.to?this.to:this.text.lineAt(Ce).to}next(){for(;;){let Ce=this.re.lastIndex=this.matchPos-this.flat.from,ke=this.re.exec(this.flat.text);if(ke&&!ke[0]&&ke.index==Ce&&(this.re.lastIndex=Ce+1,ke=this.re.exec(this.flat.text)),ke){let $n=this.flat.from+ke.index,Hn=$n+ke[0].length;if((this.flat.to>=this.to||ke.index+ke[0].length<=this.flat.text.length-10)&&(!this.test||this.test($n,Hn,ke)))return this.value={from:$n,to:Hn,match:ke},this.matchPos=toCharEnd(this.text,Hn+($n==Hn?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=FlattenedDoc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(RegExpCursor.prototype[Symbol.iterator]=MultilineRegExpCursor.prototype[Symbol.iterator]=function(){return this});function validRegExp(_n){try{return new RegExp(_n,baseFlags),!0}catch{return!1}}function toCharEnd(_n,Ce){if(Ce>=_n.length)return Ce;let ke=_n.lineAt(Ce),$n;for(;Ce=56320&&$n<57344;)Ce++;return Ce}function createLineDialog(_n){let Ce=String(_n.state.doc.lineAt(_n.state.selection.main.head).number),ke=crelt("input",{class:"cm-textfield",name:"line",value:Ce}),$n=crelt("form",{class:"cm-gotoLine",onkeydown:zn=>{zn.keyCode==27?(zn.preventDefault(),_n.dispatch({effects:dialogEffect.of(!1)}),_n.focus()):zn.keyCode==13&&(zn.preventDefault(),Hn())},onsubmit:zn=>{zn.preventDefault(),Hn()}},crelt("label",_n.state.phrase("Go to line"),": ",ke)," ",crelt("button",{class:"cm-button",type:"submit"},_n.state.phrase("go")));function Hn(){let zn=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(ke.value);if(!zn)return;let{state:Un}=_n,qn=Un.doc.lineAt(Un.selection.main.head),[,Xn,Kn,to,io]=zn,uo=to?+to.slice(1):0,ho=Kn?+Kn:qn.number;if(Kn&&io){let So=ho/100;Xn&&(So=So*(Xn=="-"?-1:1)+qn.number/Un.doc.lines),ho=Math.round(Un.doc.lines*So)}else Kn&&Xn&&(ho=ho*(Xn=="-"?-1:1)+qn.number);let bo=Un.doc.line(Math.max(1,Math.min(Un.doc.lines,ho))),Oo=EditorSelection.cursor(bo.from+Math.max(0,Math.min(uo,bo.length)));_n.dispatch({effects:[dialogEffect.of(!1),EditorView.scrollIntoView(Oo.from,{y:"center"})],selection:Oo}),_n.focus()}return{dom:$n}}const dialogEffect=StateEffect.define(),dialogField=StateField.define({create(){return!0},update(_n,Ce){for(let ke of Ce.effects)ke.is(dialogEffect)&&(_n=ke.value);return _n},provide:_n=>showPanel.from(_n,Ce=>Ce?createLineDialog:null)}),gotoLine=_n=>{let Ce=getPanel(_n,createLineDialog);if(!Ce){let ke=[dialogEffect.of(!0)];_n.state.field(dialogField,!1)==null&&ke.push(StateEffect.appendConfig.of([dialogField,baseTheme$1$1])),_n.dispatch({effects:ke}),Ce=getPanel(_n,createLineDialog)}return Ce&&Ce.dom.querySelector("input").select(),!0},baseTheme$1$1=EditorView.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),defaultHighlightOptions={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},highlightConfig=Facet.define({combine(_n){return combineConfig(_n,defaultHighlightOptions,{highlightWordAroundCursor:(Ce,ke)=>Ce||ke,minSelectionLength:Math.min,maxMatches:Math.min})}});function highlightSelectionMatches(_n){return[defaultTheme,matchHighlighter]}const matchDeco=Decoration.mark({class:"cm-selectionMatch"}),mainMatchDeco=Decoration.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function insideWordBoundaries(_n,Ce,ke,$n){return(ke==0||_n(Ce.sliceDoc(ke-1,ke))!=CharCategory.Word)&&($n==Ce.doc.length||_n(Ce.sliceDoc($n,$n+1))!=CharCategory.Word)}function insideWord(_n,Ce,ke,$n){return _n(Ce.sliceDoc(ke,ke+1))==CharCategory.Word&&_n(Ce.sliceDoc($n-1,$n))==CharCategory.Word}const matchHighlighter=ViewPlugin.fromClass(class{constructor(_n){this.decorations=this.getDeco(_n)}update(_n){(_n.selectionSet||_n.docChanged||_n.viewportChanged)&&(this.decorations=this.getDeco(_n.view))}getDeco(_n){let Ce=_n.state.facet(highlightConfig),{state:ke}=_n,$n=ke.selection;if($n.ranges.length>1)return Decoration.none;let Hn=$n.main,zn,Un=null;if(Hn.empty){if(!Ce.highlightWordAroundCursor)return Decoration.none;let Xn=ke.wordAt(Hn.head);if(!Xn)return Decoration.none;Un=ke.charCategorizer(Hn.head),zn=ke.sliceDoc(Xn.from,Xn.to)}else{let Xn=Hn.to-Hn.from;if(Xn200)return Decoration.none;if(Ce.wholeWords){if(zn=ke.sliceDoc(Hn.from,Hn.to),Un=ke.charCategorizer(Hn.head),!(insideWordBoundaries(Un,ke,Hn.from,Hn.to)&&insideWord(Un,ke,Hn.from,Hn.to)))return Decoration.none}else if(zn=ke.sliceDoc(Hn.from,Hn.to),!zn)return Decoration.none}let qn=[];for(let Xn of _n.visibleRanges){let Kn=new SearchCursor(ke.doc,zn,Xn.from,Xn.to);for(;!Kn.next().done;){let{from:to,to:io}=Kn.value;if((!Un||insideWordBoundaries(Un,ke,to,io))&&(Hn.empty&&to<=Hn.from&&io>=Hn.to?qn.push(mainMatchDeco.range(to,io)):(to>=Hn.to||io<=Hn.from)&&qn.push(matchDeco.range(to,io)),qn.length>Ce.maxMatches))return Decoration.none}}return Decoration.set(qn)}},{decorations:_n=>_n.decorations}),defaultTheme=EditorView.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),selectWord=({state:_n,dispatch:Ce})=>{let{selection:ke}=_n,$n=EditorSelection.create(ke.ranges.map(Hn=>_n.wordAt(Hn.head)||EditorSelection.cursor(Hn.head)),ke.mainIndex);return $n.eq(ke)?!1:(Ce(_n.update({selection:$n})),!0)};function findNextOccurrence(_n,Ce){let{main:ke,ranges:$n}=_n.selection,Hn=_n.wordAt(ke.head),zn=Hn&&Hn.from==ke.from&&Hn.to==ke.to;for(let Un=!1,qn=new SearchCursor(_n.doc,Ce,$n[$n.length-1].to);;)if(qn.next(),qn.done){if(Un)return null;qn=new SearchCursor(_n.doc,Ce,0,Math.max(0,$n[$n.length-1].from-1)),Un=!0}else{if(Un&&$n.some(Xn=>Xn.from==qn.value.from))continue;if(zn){let Xn=_n.wordAt(qn.value.from);if(!Xn||Xn.from!=qn.value.from||Xn.to!=qn.value.to)continue}return qn.value}}const selectNextOccurrence=({state:_n,dispatch:Ce})=>{let{ranges:ke}=_n.selection;if(ke.some(zn=>zn.from===zn.to))return selectWord({state:_n,dispatch:Ce});let $n=_n.sliceDoc(ke[0].from,ke[0].to);if(_n.selection.ranges.some(zn=>_n.sliceDoc(zn.from,zn.to)!=$n))return!1;let Hn=findNextOccurrence(_n,$n);return Hn?(Ce(_n.update({selection:_n.selection.addRange(EditorSelection.range(Hn.from,Hn.to),!1),effects:EditorView.scrollIntoView(Hn.to)})),!0):!1},searchConfigFacet=Facet.define({combine(_n){return combineConfig(_n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:Ce=>new SearchPanel(Ce),scrollToMatch:Ce=>EditorView.scrollIntoView(Ce)})}});class SearchQuery{constructor(Ce){this.search=Ce.search,this.caseSensitive=!!Ce.caseSensitive,this.literal=!!Ce.literal,this.regexp=!!Ce.regexp,this.replace=Ce.replace||"",this.valid=!!this.search&&(!this.regexp||validRegExp(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!Ce.wholeWord}unquote(Ce){return this.literal?Ce:Ce.replace(/\\([nrt\\])/g,(ke,$n)=>$n=="n"?` +`:$n=="r"?"\r":$n=="t"?" ":"\\")}eq(Ce){return this.search==Ce.search&&this.replace==Ce.replace&&this.caseSensitive==Ce.caseSensitive&&this.regexp==Ce.regexp&&this.wholeWord==Ce.wholeWord}create(){return this.regexp?new RegExpQuery(this):new StringQuery(this)}getCursor(Ce,ke=0,$n){let Hn=Ce.doc?Ce:EditorState.create({doc:Ce});return $n==null&&($n=Hn.doc.length),this.regexp?regexpCursor(this,Hn,ke,$n):stringCursor(this,Hn,ke,$n)}}class QueryType{constructor(Ce){this.spec=Ce}}function stringCursor(_n,Ce,ke,$n){return new SearchCursor(Ce.doc,_n.unquoted,ke,$n,_n.caseSensitive?void 0:Hn=>Hn.toLowerCase(),_n.wholeWord?stringWordTest(Ce.doc,Ce.charCategorizer(Ce.selection.main.head)):void 0)}function stringWordTest(_n,Ce){return(ke,$n,Hn,zn)=>((zn>ke||zn+Hn.length<$n)&&(zn=Math.max(0,ke-2),Hn=_n.sliceString(zn,Math.min(_n.length,$n+2))),(Ce(charBefore(Hn,ke-zn))!=CharCategory.Word||Ce(charAfter(Hn,ke-zn))!=CharCategory.Word)&&(Ce(charAfter(Hn,$n-zn))!=CharCategory.Word||Ce(charBefore(Hn,$n-zn))!=CharCategory.Word))}class StringQuery extends QueryType{constructor(Ce){super(Ce)}nextMatch(Ce,ke,$n){let Hn=stringCursor(this.spec,Ce,$n,Ce.doc.length).nextOverlapping();return Hn.done&&(Hn=stringCursor(this.spec,Ce,0,ke).nextOverlapping()),Hn.done?null:Hn.value}prevMatchInRange(Ce,ke,$n){for(let Hn=$n;;){let zn=Math.max(ke,Hn-1e4-this.spec.unquoted.length),Un=stringCursor(this.spec,Ce,zn,Hn),qn=null;for(;!Un.nextOverlapping().done;)qn=Un.value;if(qn)return qn;if(zn==ke)return null;Hn-=1e4}}prevMatch(Ce,ke,$n){return this.prevMatchInRange(Ce,0,ke)||this.prevMatchInRange(Ce,$n,Ce.doc.length)}getReplacement(Ce){return this.spec.unquote(this.spec.replace)}matchAll(Ce,ke){let $n=stringCursor(this.spec,Ce,0,Ce.doc.length),Hn=[];for(;!$n.next().done;){if(Hn.length>=ke)return null;Hn.push($n.value)}return Hn}highlight(Ce,ke,$n,Hn){let zn=stringCursor(this.spec,Ce,Math.max(0,ke-this.spec.unquoted.length),Math.min($n+this.spec.unquoted.length,Ce.doc.length));for(;!zn.next().done;)Hn(zn.value.from,zn.value.to)}}function regexpCursor(_n,Ce,ke,$n){return new RegExpCursor(Ce.doc,_n.search,{ignoreCase:!_n.caseSensitive,test:_n.wholeWord?regexpWordTest(Ce.charCategorizer(Ce.selection.main.head)):void 0},ke,$n)}function charBefore(_n,Ce){return _n.slice(findClusterBreak(_n,Ce,!1),Ce)}function charAfter(_n,Ce){return _n.slice(Ce,findClusterBreak(_n,Ce))}function regexpWordTest(_n){return(Ce,ke,$n)=>!$n[0].length||(_n(charBefore($n.input,$n.index))!=CharCategory.Word||_n(charAfter($n.input,$n.index))!=CharCategory.Word)&&(_n(charAfter($n.input,$n.index+$n[0].length))!=CharCategory.Word||_n(charBefore($n.input,$n.index+$n[0].length))!=CharCategory.Word)}class RegExpQuery extends QueryType{nextMatch(Ce,ke,$n){let Hn=regexpCursor(this.spec,Ce,$n,Ce.doc.length).next();return Hn.done&&(Hn=regexpCursor(this.spec,Ce,0,ke).next()),Hn.done?null:Hn.value}prevMatchInRange(Ce,ke,$n){for(let Hn=1;;Hn++){let zn=Math.max(ke,$n-Hn*1e4),Un=regexpCursor(this.spec,Ce,zn,$n),qn=null;for(;!Un.next().done;)qn=Un.value;if(qn&&(zn==ke||qn.from>zn+10))return qn;if(zn==ke)return null}}prevMatch(Ce,ke,$n){return this.prevMatchInRange(Ce,0,ke)||this.prevMatchInRange(Ce,$n,Ce.doc.length)}getReplacement(Ce){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(ke,$n)=>$n=="$"?"$":$n=="&"?Ce.match[0]:$n!="0"&&+$n=ke)return null;Hn.push($n.value)}return Hn}highlight(Ce,ke,$n,Hn){let zn=regexpCursor(this.spec,Ce,Math.max(0,ke-250),Math.min($n+250,Ce.doc.length));for(;!zn.next().done;)Hn(zn.value.from,zn.value.to)}}const setSearchQuery=StateEffect.define(),togglePanel$1=StateEffect.define(),searchState=StateField.define({create(_n){return new SearchState(defaultQuery(_n).create(),null)},update(_n,Ce){for(let ke of Ce.effects)ke.is(setSearchQuery)?_n=new SearchState(ke.value.create(),_n.panel):ke.is(togglePanel$1)&&(_n=new SearchState(_n.query,ke.value?createSearchPanel:null));return _n},provide:_n=>showPanel.from(_n,Ce=>Ce.panel)});class SearchState{constructor(Ce,ke){this.query=Ce,this.panel=ke}}const matchMark=Decoration.mark({class:"cm-searchMatch"}),selectedMatchMark=Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),searchHighlighter=ViewPlugin.fromClass(class{constructor(_n){this.view=_n,this.decorations=this.highlight(_n.state.field(searchState))}update(_n){let Ce=_n.state.field(searchState);(Ce!=_n.startState.field(searchState)||_n.docChanged||_n.selectionSet||_n.viewportChanged)&&(this.decorations=this.highlight(Ce))}highlight({query:_n,panel:Ce}){if(!Ce||!_n.spec.valid)return Decoration.none;let{view:ke}=this,$n=new RangeSetBuilder;for(let Hn=0,zn=ke.visibleRanges,Un=zn.length;Hnzn[Hn+1].from-2*250;)Xn=zn[++Hn].to;_n.highlight(ke.state,qn,Xn,(Kn,to)=>{let io=ke.state.selection.ranges.some(uo=>uo.from==Kn&&uo.to==to);$n.add(Kn,to,io?selectedMatchMark:matchMark)})}return $n.finish()}},{decorations:_n=>_n.decorations});function searchCommand(_n){return Ce=>{let ke=Ce.state.field(searchState,!1);return ke&&ke.query.spec.valid?_n(Ce,ke):openSearchPanel(Ce)}}const findNext=searchCommand((_n,{query:Ce})=>{let{to:ke}=_n.state.selection.main,$n=Ce.nextMatch(_n.state,ke,ke);if(!$n)return!1;let Hn=EditorSelection.single($n.from,$n.to),zn=_n.state.facet(searchConfigFacet);return _n.dispatch({selection:Hn,effects:[announceMatch(_n,$n),zn.scrollToMatch(Hn.main,_n)],userEvent:"select.search"}),selectSearchInput(_n),!0}),findPrevious=searchCommand((_n,{query:Ce})=>{let{state:ke}=_n,{from:$n}=ke.selection.main,Hn=Ce.prevMatch(ke,$n,$n);if(!Hn)return!1;let zn=EditorSelection.single(Hn.from,Hn.to),Un=_n.state.facet(searchConfigFacet);return _n.dispatch({selection:zn,effects:[announceMatch(_n,Hn),Un.scrollToMatch(zn.main,_n)],userEvent:"select.search"}),selectSearchInput(_n),!0}),selectMatches=searchCommand((_n,{query:Ce})=>{let ke=Ce.matchAll(_n.state,1e3);return!ke||!ke.length?!1:(_n.dispatch({selection:EditorSelection.create(ke.map($n=>EditorSelection.range($n.from,$n.to))),userEvent:"select.search.matches"}),!0)}),selectSelectionMatches=({state:_n,dispatch:Ce})=>{let ke=_n.selection;if(ke.ranges.length>1||ke.main.empty)return!1;let{from:$n,to:Hn}=ke.main,zn=[],Un=0;for(let qn=new SearchCursor(_n.doc,_n.sliceDoc($n,Hn));!qn.next().done;){if(zn.length>1e3)return!1;qn.value.from==$n&&(Un=zn.length),zn.push(EditorSelection.range(qn.value.from,qn.value.to))}return Ce(_n.update({selection:EditorSelection.create(zn,Un),userEvent:"select.search.matches"})),!0},replaceNext=searchCommand((_n,{query:Ce})=>{let{state:ke}=_n,{from:$n,to:Hn}=ke.selection.main;if(ke.readOnly)return!1;let zn=Ce.nextMatch(ke,$n,$n);if(!zn)return!1;let Un=[],qn,Xn,Kn=[];if(zn.from==$n&&zn.to==Hn&&(Xn=ke.toText(Ce.getReplacement(zn)),Un.push({from:zn.from,to:zn.to,insert:Xn}),zn=Ce.nextMatch(ke,zn.from,zn.to),Kn.push(EditorView.announce.of(ke.phrase("replaced match on line $",ke.doc.lineAt($n).number)+"."))),zn){let to=Un.length==0||Un[0].from>=zn.to?0:zn.to-zn.from-Xn.length;qn=EditorSelection.single(zn.from-to,zn.to-to),Kn.push(announceMatch(_n,zn)),Kn.push(ke.facet(searchConfigFacet).scrollToMatch(qn.main,_n))}return _n.dispatch({changes:Un,selection:qn,effects:Kn,userEvent:"input.replace"}),!0}),replaceAll=searchCommand((_n,{query:Ce})=>{if(_n.state.readOnly)return!1;let ke=Ce.matchAll(_n.state,1e9).map(Hn=>{let{from:zn,to:Un}=Hn;return{from:zn,to:Un,insert:Ce.getReplacement(Hn)}});if(!ke.length)return!1;let $n=_n.state.phrase("replaced $ matches",ke.length)+".";return _n.dispatch({changes:ke,effects:EditorView.announce.of($n),userEvent:"input.replace.all"}),!0});function createSearchPanel(_n){return _n.state.facet(searchConfigFacet).createPanel(_n)}function defaultQuery(_n,Ce){var ke,$n,Hn,zn,Un;let qn=_n.selection.main,Xn=qn.empty||qn.to>qn.from+100?"":_n.sliceDoc(qn.from,qn.to);if(Ce&&!Xn)return Ce;let Kn=_n.facet(searchConfigFacet);return new SearchQuery({search:((ke=Ce==null?void 0:Ce.literal)!==null&&ke!==void 0?ke:Kn.literal)?Xn:Xn.replace(/\n/g,"\\n"),caseSensitive:($n=Ce==null?void 0:Ce.caseSensitive)!==null&&$n!==void 0?$n:Kn.caseSensitive,literal:(Hn=Ce==null?void 0:Ce.literal)!==null&&Hn!==void 0?Hn:Kn.literal,regexp:(zn=Ce==null?void 0:Ce.regexp)!==null&&zn!==void 0?zn:Kn.regexp,wholeWord:(Un=Ce==null?void 0:Ce.wholeWord)!==null&&Un!==void 0?Un:Kn.wholeWord})}function getSearchInput(_n){let Ce=getPanel(_n,createSearchPanel);return Ce&&Ce.dom.querySelector("[main-field]")}function selectSearchInput(_n){let Ce=getSearchInput(_n);Ce&&Ce==_n.root.activeElement&&Ce.select()}const openSearchPanel=_n=>{let Ce=_n.state.field(searchState,!1);if(Ce&&Ce.panel){let ke=getSearchInput(_n);if(ke&&ke!=_n.root.activeElement){let $n=defaultQuery(_n.state,Ce.query.spec);$n.valid&&_n.dispatch({effects:setSearchQuery.of($n)}),ke.focus(),ke.select()}}else _n.dispatch({effects:[togglePanel$1.of(!0),Ce?setSearchQuery.of(defaultQuery(_n.state,Ce.query.spec)):StateEffect.appendConfig.of(searchExtensions)]});return!0},closeSearchPanel=_n=>{let Ce=_n.state.field(searchState,!1);if(!Ce||!Ce.panel)return!1;let ke=getPanel(_n,createSearchPanel);return ke&&ke.dom.contains(_n.root.activeElement)&&_n.focus(),_n.dispatch({effects:togglePanel$1.of(!1)}),!0},searchKeymap=[{key:"Mod-f",run:openSearchPanel,scope:"editor search-panel"},{key:"F3",run:findNext,shift:findPrevious,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:findNext,shift:findPrevious,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:closeSearchPanel,scope:"editor search-panel"},{key:"Mod-Shift-l",run:selectSelectionMatches},{key:"Mod-Alt-g",run:gotoLine},{key:"Mod-d",run:selectNextOccurrence,preventDefault:!0}];class SearchPanel{constructor(Ce){this.view=Ce;let ke=this.query=Ce.state.field(searchState).query.spec;this.commit=this.commit.bind(this),this.searchField=crelt("input",{value:ke.search,placeholder:phrase(Ce,"Find"),"aria-label":phrase(Ce,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=crelt("input",{value:ke.replace,placeholder:phrase(Ce,"Replace"),"aria-label":phrase(Ce,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=crelt("input",{type:"checkbox",name:"case",form:"",checked:ke.caseSensitive,onchange:this.commit}),this.reField=crelt("input",{type:"checkbox",name:"re",form:"",checked:ke.regexp,onchange:this.commit}),this.wordField=crelt("input",{type:"checkbox",name:"word",form:"",checked:ke.wholeWord,onchange:this.commit});function $n(Hn,zn,Un){return crelt("button",{class:"cm-button",name:Hn,onclick:zn,type:"button"},Un)}this.dom=crelt("div",{onkeydown:Hn=>this.keydown(Hn),class:"cm-search"},[this.searchField,$n("next",()=>findNext(Ce),[phrase(Ce,"next")]),$n("prev",()=>findPrevious(Ce),[phrase(Ce,"previous")]),$n("select",()=>selectMatches(Ce),[phrase(Ce,"all")]),crelt("label",null,[this.caseField,phrase(Ce,"match case")]),crelt("label",null,[this.reField,phrase(Ce,"regexp")]),crelt("label",null,[this.wordField,phrase(Ce,"by word")]),...Ce.state.readOnly?[]:[crelt("br"),this.replaceField,$n("replace",()=>replaceNext(Ce),[phrase(Ce,"replace")]),$n("replaceAll",()=>replaceAll(Ce),[phrase(Ce,"replace all")])],crelt("button",{name:"close",onclick:()=>closeSearchPanel(Ce),"aria-label":phrase(Ce,"close"),type:"button"},["×"])])}commit(){let Ce=new SearchQuery({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});Ce.eq(this.query)||(this.query=Ce,this.view.dispatch({effects:setSearchQuery.of(Ce)}))}keydown(Ce){runScopeHandlers(this.view,Ce,"search-panel")?Ce.preventDefault():Ce.keyCode==13&&Ce.target==this.searchField?(Ce.preventDefault(),(Ce.shiftKey?findPrevious:findNext)(this.view)):Ce.keyCode==13&&Ce.target==this.replaceField&&(Ce.preventDefault(),replaceNext(this.view))}update(Ce){for(let ke of Ce.transactions)for(let $n of ke.effects)$n.is(setSearchQuery)&&!$n.value.eq(this.query)&&this.setQuery($n.value)}setQuery(Ce){this.query=Ce,this.searchField.value=Ce.search,this.replaceField.value=Ce.replace,this.caseField.checked=Ce.caseSensitive,this.reField.checked=Ce.regexp,this.wordField.checked=Ce.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(searchConfigFacet).top}}function phrase(_n,Ce){return _n.state.phrase(Ce)}const AnnounceMargin=30,Break=/[\s\.,:;?!]/;function announceMatch(_n,{from:Ce,to:ke}){let $n=_n.state.doc.lineAt(Ce),Hn=_n.state.doc.lineAt(ke).to,zn=Math.max($n.from,Ce-AnnounceMargin),Un=Math.min(Hn,ke+AnnounceMargin),qn=_n.state.sliceDoc(zn,Un);if(zn!=$n.from){for(let Xn=0;Xnqn.length-AnnounceMargin;Xn--)if(!Break.test(qn[Xn-1])&&Break.test(qn[Xn])){qn=qn.slice(0,Xn);break}}return EditorView.announce.of(`${_n.state.phrase("current match")}. ${qn} ${_n.state.phrase("on line")} ${$n.number}.`)}const baseTheme$2=EditorView.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),searchExtensions=[searchState,Prec.low(searchHighlighter),baseTheme$2];class CompletionContext{constructor(Ce,ke,$n,Hn){this.state=Ce,this.pos=ke,this.explicit=$n,this.view=Hn,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(Ce){let ke=syntaxTree(this.state).resolveInner(this.pos,-1);for(;ke&&Ce.indexOf(ke.name)<0;)ke=ke.parent;return ke?{from:ke.from,to:this.pos,text:this.state.sliceDoc(ke.from,this.pos),type:ke.type}:null}matchBefore(Ce){let ke=this.state.doc.lineAt(this.pos),$n=Math.max(ke.from,this.pos-250),Hn=ke.text.slice($n-ke.from,this.pos-ke.from),zn=Hn.search(ensureAnchor(Ce,!1));return zn<0?null:{from:$n+zn,to:this.pos,text:Hn.slice(zn)}}get aborted(){return this.abortListeners==null}addEventListener(Ce,ke,$n){Ce=="abort"&&this.abortListeners&&(this.abortListeners.push(ke),$n&&$n.onDocChange&&(this.abortOnDocChange=!0))}}function toSet(_n){let Ce=Object.keys(_n).join(""),ke=/\w/.test(Ce);return ke&&(Ce=Ce.replace(/\w/g,"")),`[${ke?"\\w":""}${Ce.replace(/[^\w\s]/g,"\\$&")}]`}function prefixMatch(_n){let Ce=Object.create(null),ke=Object.create(null);for(let{label:Hn}of _n){Ce[Hn[0]]=!0;for(let zn=1;zntypeof Hn=="string"?{label:Hn}:Hn),[ke,$n]=Ce.every(Hn=>/^\w+$/.test(Hn.label))?[/\w*$/,/\w+$/]:prefixMatch(Ce);return Hn=>{let zn=Hn.matchBefore($n);return zn||Hn.explicit?{from:zn?zn.from:Hn.pos,options:Ce,validFor:ke}:null}}function ifNotIn(_n,Ce){return ke=>{for(let $n=syntaxTree(ke.state).resolveInner(ke.pos,-1);$n;$n=$n.parent){if(_n.indexOf($n.name)>-1)return null;if($n.type.isTop)break}return Ce(ke)}}class Option{constructor(Ce,ke,$n,Hn){this.completion=Ce,this.source=ke,this.match=$n,this.score=Hn}}function cur(_n){return _n.selection.main.from}function ensureAnchor(_n,Ce){var ke;let{source:$n}=_n,Hn=Ce&&$n[0]!="^",zn=$n[$n.length-1]!="$";return!Hn&&!zn?_n:new RegExp(`${Hn?"^":""}(?:${$n})${zn?"$":""}`,(ke=_n.flags)!==null&&ke!==void 0?ke:_n.ignoreCase?"i":"")}const pickedCompletion=Annotation.define();function insertCompletionText(_n,Ce,ke,$n){let{main:Hn}=_n.selection,zn=ke-Hn.from,Un=$n-Hn.from;return Object.assign(Object.assign({},_n.changeByRange(qn=>qn!=Hn&&ke!=$n&&_n.sliceDoc(qn.from+zn,qn.from+Un)!=_n.sliceDoc(ke,$n)?{range:qn}:{changes:{from:qn.from+zn,to:$n==Hn.from?qn.to:qn.from+Un,insert:Ce},range:EditorSelection.cursor(qn.from+zn+Ce.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const SourceCache=new WeakMap;function asSource(_n){if(!Array.isArray(_n))return _n;let Ce=SourceCache.get(_n);return Ce||SourceCache.set(_n,Ce=completeFromList(_n)),Ce}const startCompletionEffect=StateEffect.define(),closeCompletionEffect=StateEffect.define();class FuzzyMatcher{constructor(Ce){this.pattern=Ce,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let ke=0;ke=48&&Vo<=57||Vo>=97&&Vo<=122?2:Vo>=65&&Vo<=90?1:0:(Jo=fromCodePoint(Vo))!=Jo.toLowerCase()?1:Jo!=Jo.toUpperCase()?2:0;(!Do||Mo==1&&So||Io==0&&Mo!=0)&&(ke[io]==Vo||$n[io]==Vo&&(uo=!0)?Un[io++]=Do:Un.length&&($o=!1)),Io=Mo,Do+=codePointSize(Vo)}return io==Xn&&Un[0]==0&&$o?this.result(-100+(uo?-200:0),Un,Ce):ho==Xn&&bo==0?this.ret(-200-Ce.length+(Oo==Ce.length?0:-100),[0,Oo]):qn>-1?this.ret(-700-Ce.length,[qn,qn+this.pattern.length]):ho==Xn?this.ret(-900-Ce.length,[bo,Oo]):io==Xn?this.result(-100+(uo?-200:0)+-700+($o?0:-1100),Un,Ce):ke.length==2?null:this.result((Hn[0]?-700:0)+-200+-1100,Hn,Ce)}result(Ce,ke,$n){let Hn=[],zn=0;for(let Un of ke){let qn=Un+(this.astral?codePointSize(codePointAt($n,Un)):1);zn&&Hn[zn-1]==Un?Hn[zn-1]=qn:(Hn[zn++]=Un,Hn[zn++]=qn)}return this.ret(Ce-$n.length,Hn)}}class StrictMatcher{constructor(Ce){this.pattern=Ce,this.matched=[],this.score=0,this.folded=Ce.toLowerCase()}match(Ce){if(Ce.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:defaultPositionInfo,filterStrict:!1,compareCompletions:(Ce,ke)=>Ce.label.localeCompare(ke.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(Ce,ke)=>Ce&&ke,closeOnBlur:(Ce,ke)=>Ce&&ke,icons:(Ce,ke)=>Ce&&ke,tooltipClass:(Ce,ke)=>$n=>joinClass(Ce($n),ke($n)),optionClass:(Ce,ke)=>$n=>joinClass(Ce($n),ke($n)),addToOptions:(Ce,ke)=>Ce.concat(ke),filterStrict:(Ce,ke)=>Ce||ke})}});function joinClass(_n,Ce){return _n?Ce?_n+" "+Ce:_n:Ce}function defaultPositionInfo(_n,Ce,ke,$n,Hn,zn){let Un=_n.textDirection==Direction.RTL,qn=Un,Xn=!1,Kn="top",to,io,uo=Ce.left-Hn.left,ho=Hn.right-Ce.right,bo=$n.right-$n.left,Oo=$n.bottom-$n.top;if(qn&&uo=Oo||Do>Ce.top?to=ke.bottom-Ce.top:(Kn="bottom",to=Ce.bottom-ke.top)}let So=(Ce.bottom-Ce.top)/zn.offsetHeight,$o=(Ce.right-Ce.left)/zn.offsetWidth;return{style:`${Kn}: ${to/So}px; max-width: ${io/$o}px`,class:"cm-completionInfo-"+(Xn?Un?"left-narrow":"right-narrow":qn?"left":"right")}}function optionContent(_n){let Ce=_n.addToOptions.slice();return _n.icons&&Ce.push({render(ke){let $n=document.createElement("div");return $n.classList.add("cm-completionIcon"),ke.type&&$n.classList.add(...ke.type.split(/\s+/g).map(Hn=>"cm-completionIcon-"+Hn)),$n.setAttribute("aria-hidden","true"),$n},position:20}),Ce.push({render(ke,$n,Hn,zn){let Un=document.createElement("span");Un.className="cm-completionLabel";let qn=ke.displayLabel||ke.label,Xn=0;for(let Kn=0;KnXn&&Un.appendChild(document.createTextNode(qn.slice(Xn,to)));let uo=Un.appendChild(document.createElement("span"));uo.appendChild(document.createTextNode(qn.slice(to,io))),uo.className="cm-completionMatchedText",Xn=io}return Xnke.position-$n.position).map(ke=>ke.render)}function rangeAroundSelected(_n,Ce,ke){if(_n<=ke)return{from:0,to:_n};if(Ce<0&&(Ce=0),Ce<=_n>>1){let Hn=Math.floor(Ce/ke);return{from:Hn*ke,to:(Hn+1)*ke}}let $n=Math.floor((_n-Ce)/ke);return{from:_n-($n+1)*ke,to:_n-$n*ke}}class CompletionTooltip{constructor(Ce,ke,$n){this.view=Ce,this.stateField=ke,this.applyCompletion=$n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:Xn=>this.placeInfo(Xn),key:this},this.space=null,this.currentClass="";let Hn=Ce.state.field(ke),{options:zn,selected:Un}=Hn.open,qn=Ce.state.facet(completionConfig);this.optionContent=optionContent(qn),this.optionClass=qn.optionClass,this.tooltipClass=qn.tooltipClass,this.range=rangeAroundSelected(zn.length,Un,qn.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(Ce.state),this.dom.addEventListener("mousedown",Xn=>{let{options:Kn}=Ce.state.field(ke).open;for(let to=Xn.target,io;to&&to!=this.dom;to=to.parentNode)if(to.nodeName=="LI"&&(io=/-(\d+)$/.exec(to.id))&&+io[1]{let Kn=Ce.state.field(this.stateField,!1);Kn&&Kn.tooltip&&Ce.state.facet(completionConfig).closeOnBlur&&Xn.relatedTarget!=Ce.contentDOM&&Ce.dispatch({effects:closeCompletionEffect.of(null)})}),this.showOptions(zn,Hn.id)}mount(){this.updateSel()}showOptions(Ce,ke){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(Ce,ke,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(Ce){var ke;let $n=Ce.state.field(this.stateField),Hn=Ce.startState.field(this.stateField);if(this.updateTooltipClass(Ce.state),$n!=Hn){let{options:zn,selected:Un,disabled:qn}=$n.open;(!Hn.open||Hn.open.options!=zn)&&(this.range=rangeAroundSelected(zn.length,Un,Ce.state.facet(completionConfig).maxRenderedOptions),this.showOptions(zn,$n.id)),this.updateSel(),qn!=((ke=Hn.open)===null||ke===void 0?void 0:ke.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!qn)}}updateTooltipClass(Ce){let ke=this.tooltipClass(Ce);if(ke!=this.currentClass){for(let $n of this.currentClass.split(" "))$n&&this.dom.classList.remove($n);for(let $n of ke.split(" "))$n&&this.dom.classList.add($n);this.currentClass=ke}}positioned(Ce){this.space=Ce,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let Ce=this.view.state.field(this.stateField),ke=Ce.open;if((ke.selected>-1&&ke.selected=this.range.to)&&(this.range=rangeAroundSelected(ke.options.length,ke.selected,this.view.state.facet(completionConfig).maxRenderedOptions),this.showOptions(ke.options,Ce.id)),this.updateSelectedOption(ke.selected)){this.destroyInfo();let{completion:$n}=ke.options[ke.selected],{info:Hn}=$n;if(!Hn)return;let zn=typeof Hn=="string"?document.createTextNode(Hn):Hn($n);if(!zn)return;"then"in zn?zn.then(Un=>{Un&&this.view.state.field(this.stateField,!1)==Ce&&this.addInfoPane(Un,$n)}).catch(Un=>logException(this.view.state,Un,"completion info")):this.addInfoPane(zn,$n)}}addInfoPane(Ce,ke){this.destroyInfo();let $n=this.info=document.createElement("div");if($n.className="cm-tooltip cm-completionInfo",Ce.nodeType!=null)$n.appendChild(Ce),this.infoDestroy=null;else{let{dom:Hn,destroy:zn}=Ce;$n.appendChild(Hn),this.infoDestroy=zn||null}this.dom.appendChild($n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(Ce){let ke=null;for(let $n=this.list.firstChild,Hn=this.range.from;$n;$n=$n.nextSibling,Hn++)$n.nodeName!="LI"||!$n.id?Hn--:Hn==Ce?$n.hasAttribute("aria-selected")||($n.setAttribute("aria-selected","true"),ke=$n):$n.hasAttribute("aria-selected")&&$n.removeAttribute("aria-selected");return ke&&scrollIntoView(this.list,ke),ke}measureInfo(){let Ce=this.dom.querySelector("[aria-selected]");if(!Ce||!this.info)return null;let ke=this.dom.getBoundingClientRect(),$n=this.info.getBoundingClientRect(),Hn=Ce.getBoundingClientRect(),zn=this.space;if(!zn){let Un=this.dom.ownerDocument.defaultView||window;zn={left:0,top:0,right:Un.innerWidth,bottom:Un.innerHeight}}return Hn.top>Math.min(zn.bottom,ke.bottom)-10||Hn.bottom$n.from||$n.from==0))if(zn=uo,typeof Kn!="string"&&Kn.header)Hn.appendChild(Kn.header(Kn));else{let ho=Hn.appendChild(document.createElement("completion-section"));ho.textContent=uo}}const to=Hn.appendChild(document.createElement("li"));to.id=ke+"-"+Un,to.setAttribute("role","option");let io=this.optionClass(qn);io&&(to.className=io);for(let uo of this.optionContent){let ho=uo(qn,this.view.state,this.view,Xn);ho&&to.appendChild(ho)}}return $n.from&&Hn.classList.add("cm-completionListIncompleteTop"),$n.tonew CompletionTooltip(ke,_n,Ce)}function scrollIntoView(_n,Ce){let ke=_n.getBoundingClientRect(),$n=Ce.getBoundingClientRect(),Hn=ke.height/_n.offsetHeight;$n.topke.bottom&&(_n.scrollTop+=($n.bottom-ke.bottom)/Hn)}function score(_n){return(_n.boost||0)*100+(_n.apply?10:0)+(_n.info?5:0)+(_n.type?1:0)}function sortOptions(_n,Ce){let ke=[],$n=null,Hn=Kn=>{ke.push(Kn);let{section:to}=Kn.completion;if(to){$n||($n=[]);let io=typeof to=="string"?to:to.name;$n.some(uo=>uo.name==io)||$n.push(typeof to=="string"?{name:io}:to)}},zn=Ce.facet(completionConfig);for(let Kn of _n)if(Kn.hasResult()){let to=Kn.result.getMatch;if(Kn.result.filter===!1)for(let io of Kn.result.options)Hn(new Option(io,Kn.source,to?to(io):[],1e9-ke.length));else{let io=Ce.sliceDoc(Kn.from,Kn.to),uo,ho=zn.filterStrict?new StrictMatcher(io):new FuzzyMatcher(io);for(let bo of Kn.result.options)if(uo=ho.match(bo.label)){let Oo=bo.displayLabel?to?to(bo,uo.matched):[]:uo.matched;Hn(new Option(bo,Kn.source,Oo,uo.score+(bo.boost||0)))}}}if($n){let Kn=Object.create(null),to=0,io=(uo,ho)=>{var bo,Oo;return((bo=uo.rank)!==null&&bo!==void 0?bo:1e9)-((Oo=ho.rank)!==null&&Oo!==void 0?Oo:1e9)||(uo.nameio.score-to.score||Xn(to.completion,io.completion))){let to=Kn.completion;!qn||qn.label!=to.label||qn.detail!=to.detail||qn.type!=null&&to.type!=null&&qn.type!=to.type||qn.apply!=to.apply||qn.boost!=to.boost?Un.push(Kn):score(Kn.completion)>score(qn)&&(Un[Un.length-1]=Kn),qn=Kn.completion}return Un}class CompletionDialog{constructor(Ce,ke,$n,Hn,zn,Un){this.options=Ce,this.attrs=ke,this.tooltip=$n,this.timestamp=Hn,this.selected=zn,this.disabled=Un}setSelected(Ce,ke){return Ce==this.selected||Ce>=this.options.length?this:new CompletionDialog(this.options,makeAttrs(ke,Ce),this.tooltip,this.timestamp,Ce,this.disabled)}static build(Ce,ke,$n,Hn,zn){let Un=sortOptions(Ce,ke);if(!Un.length)return Hn&&Ce.some(Xn=>Xn.state==1)?new CompletionDialog(Hn.options,Hn.attrs,Hn.tooltip,Hn.timestamp,Hn.selected,!0):null;let qn=ke.facet(completionConfig).selectOnOpen?0:-1;if(Hn&&Hn.selected!=qn&&Hn.selected!=-1){let Xn=Hn.options[Hn.selected].completion;for(let Kn=0;KnKn.hasResult()?Math.min(Xn,Kn.from):Xn,1e8),create:createTooltip,above:zn.aboveCursor},Hn?Hn.timestamp:Date.now(),qn,!1)}map(Ce){return new CompletionDialog(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:Ce.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class CompletionState{constructor(Ce,ke,$n){this.active=Ce,this.id=ke,this.open=$n}static start(){return new CompletionState(none$1,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(Ce){let{state:ke}=Ce,$n=ke.facet(completionConfig),zn=($n.override||ke.languageDataAt("autocomplete",cur(ke)).map(asSource)).map(qn=>(this.active.find(Kn=>Kn.source==qn)||new ActiveSource(qn,this.active.some(Kn=>Kn.state!=0)?1:0)).update(Ce,$n));zn.length==this.active.length&&zn.every((qn,Xn)=>qn==this.active[Xn])&&(zn=this.active);let Un=this.open;Un&&Ce.docChanged&&(Un=Un.map(Ce.changes)),Ce.selection||zn.some(qn=>qn.hasResult()&&Ce.changes.touchesRange(qn.from,qn.to))||!sameResults(zn,this.active)?Un=CompletionDialog.build(zn,ke,this.id,Un,$n):Un&&Un.disabled&&!zn.some(qn=>qn.state==1)&&(Un=null),!Un&&zn.every(qn=>qn.state!=1)&&zn.some(qn=>qn.hasResult())&&(zn=zn.map(qn=>qn.hasResult()?new ActiveSource(qn.source,0):qn));for(let qn of Ce.effects)qn.is(setSelectedEffect)&&(Un=Un&&Un.setSelected(qn.value,this.id));return zn==this.active&&Un==this.open?this:new CompletionState(zn,this.id,Un)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?baseAttrs:noAttrs}}function sameResults(_n,Ce){if(_n==Ce)return!0;for(let ke=0,$n=0;;){for(;ke<_n.length&&!_n[ke].hasResult;)ke++;for(;$n-1&&(ke["aria-activedescendant"]=_n+"-"+Ce),ke}const none$1=[];function getUpdateType(_n,Ce){if(_n.isUserEvent("input.complete")){let $n=_n.annotation(pickedCompletion);if($n&&Ce.activateOnCompletion($n))return 12}let ke=_n.isUserEvent("input.type");return ke&&Ce.activateOnTyping?5:ke?1:_n.isUserEvent("delete.backward")?2:_n.selection?8:_n.docChanged?16:0}class ActiveSource{constructor(Ce,ke,$n=-1){this.source=Ce,this.state=ke,this.explicitPos=$n}hasResult(){return!1}update(Ce,ke){let $n=getUpdateType(Ce,ke),Hn=this;($n&8||$n&16&&this.touches(Ce))&&(Hn=new ActiveSource(Hn.source,0)),$n&4&&Hn.state==0&&(Hn=new ActiveSource(this.source,1)),Hn=Hn.updateFor(Ce,$n);for(let zn of Ce.effects)if(zn.is(startCompletionEffect))Hn=new ActiveSource(Hn.source,1,zn.value?cur(Ce.state):-1);else if(zn.is(closeCompletionEffect))Hn=new ActiveSource(Hn.source,0);else if(zn.is(setActiveEffect))for(let Un of zn.value)Un.source==Hn.source&&(Hn=Un);return Hn}updateFor(Ce,ke){return this.map(Ce.changes)}map(Ce){return Ce.empty||this.explicitPos<0?this:new ActiveSource(this.source,this.state,Ce.mapPos(this.explicitPos))}touches(Ce){return Ce.changes.touchesRange(cur(Ce.state))}}class ActiveResult extends ActiveSource{constructor(Ce,ke,$n,Hn,zn){super(Ce,2,ke),this.result=$n,this.from=Hn,this.to=zn}hasResult(){return!0}updateFor(Ce,ke){var $n;if(!(ke&3))return this.map(Ce.changes);let Hn=this.result;Hn.map&&!Ce.changes.empty&&(Hn=Hn.map(Hn,Ce.changes));let zn=Ce.changes.mapPos(this.from),Un=Ce.changes.mapPos(this.to,1),qn=cur(Ce.state);if((this.explicitPos<0?qn<=zn:qnUn||!Hn||ke&2&&cur(Ce.startState)==this.from)return new ActiveSource(this.source,ke&4?1:0);let Xn=this.explicitPos<0?-1:Ce.changes.mapPos(this.explicitPos);return checkValid(Hn.validFor,Ce.state,zn,Un)?new ActiveResult(this.source,Xn,Hn,zn,Un):Hn.update&&(Hn=Hn.update(Hn,zn,Un,new CompletionContext(Ce.state,qn,Xn>=0)))?new ActiveResult(this.source,Xn,Hn,Hn.from,($n=Hn.to)!==null&&$n!==void 0?$n:cur(Ce.state)):new ActiveSource(this.source,1,Xn)}map(Ce){return Ce.empty?this:(this.result.map?this.result.map(this.result,Ce):this.result)?new ActiveResult(this.source,this.explicitPos<0?-1:Ce.mapPos(this.explicitPos),this.result,Ce.mapPos(this.from),Ce.mapPos(this.to,1)):new ActiveSource(this.source,0)}touches(Ce){return Ce.changes.touchesRange(this.from,this.to)}}function checkValid(_n,Ce,ke,$n){if(!_n)return!1;let Hn=Ce.sliceDoc(ke,$n);return typeof _n=="function"?_n(Hn,ke,$n,Ce):ensureAnchor(_n,!0).test(Hn)}const setActiveEffect=StateEffect.define({map(_n,Ce){return _n.map(ke=>ke.map(Ce))}}),setSelectedEffect=StateEffect.define(),completionState=StateField.define({create(){return CompletionState.start()},update(_n,Ce){return _n.update(Ce)},provide:_n=>[showTooltip.from(_n,Ce=>Ce.tooltip),EditorView.contentAttributes.from(_n,Ce=>Ce.attrs)]});function applyCompletion(_n,Ce){const ke=Ce.completion.apply||Ce.completion.label;let $n=_n.state.field(completionState).active.find(Hn=>Hn.source==Ce.source);return $n instanceof ActiveResult?(typeof ke=="string"?_n.dispatch(Object.assign(Object.assign({},insertCompletionText(_n.state,ke,$n.from,$n.to)),{annotations:pickedCompletion.of(Ce.completion)})):ke(_n,Ce.completion,$n.from,$n.to),!0):!1}const createTooltip=completionTooltip(completionState,applyCompletion);function moveCompletionSelection(_n,Ce="option"){return ke=>{let $n=ke.state.field(completionState,!1);if(!$n||!$n.open||$n.open.disabled||Date.now()-$n.open.timestamp-1?$n.open.selected+Hn*(_n?1:-1):_n?0:Un-1;return qn<0?qn=Ce=="page"?0:Un-1:qn>=Un&&(qn=Ce=="page"?Un-1:0),ke.dispatch({effects:setSelectedEffect.of(qn)}),!0}}const acceptCompletion=_n=>{let Ce=_n.state.field(completionState,!1);return _n.state.readOnly||!Ce||!Ce.open||Ce.open.selected<0||Ce.open.disabled||Date.now()-Ce.open.timestamp<_n.state.facet(completionConfig).interactionDelay?!1:applyCompletion(_n,Ce.open.options[Ce.open.selected])},startCompletion=_n=>_n.state.field(completionState,!1)?(_n.dispatch({effects:startCompletionEffect.of(!0)}),!0):!1,closeCompletion=_n=>{let Ce=_n.state.field(completionState,!1);return!Ce||!Ce.active.some(ke=>ke.state!=0)?!1:(_n.dispatch({effects:closeCompletionEffect.of(null)}),!0)};class RunningQuery{constructor(Ce,ke){this.active=Ce,this.context=ke,this.time=Date.now(),this.updates=[],this.done=void 0}}const MaxUpdateCount=50,MinAbortTime=1e3,completionPlugin=ViewPlugin.fromClass(class{constructor(_n){this.view=_n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let Ce of _n.state.field(completionState).active)Ce.state==1&&this.startQuery(Ce)}update(_n){let Ce=_n.state.field(completionState),ke=_n.state.facet(completionConfig);if(!_n.selectionSet&&!_n.docChanged&&_n.startState.field(completionState)==Ce)return;let $n=_n.transactions.some(zn=>{let Un=getUpdateType(zn,ke);return Un&8||(zn.selection||zn.docChanged)&&!(Un&3)});for(let zn=0;znMaxUpdateCount&&Date.now()-Un.time>MinAbortTime){for(let qn of Un.context.abortListeners)try{qn()}catch(Xn){logException(this.view.state,Xn)}Un.context.abortListeners=null,this.running.splice(zn--,1)}else Un.updates.push(..._n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),_n.transactions.some(zn=>zn.effects.some(Un=>Un.is(startCompletionEffect)))&&(this.pendingStart=!0);let Hn=this.pendingStart?50:ke.activateOnTypingDelay;if(this.debounceUpdate=Ce.active.some(zn=>zn.state==1&&!this.running.some(Un=>Un.active.source==zn.source))?setTimeout(()=>this.startUpdate(),Hn):-1,this.composing!=0)for(let zn of _n.transactions)zn.isUserEvent("input.type")?this.composing=2:this.composing==2&&zn.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:_n}=this.view,Ce=_n.field(completionState);for(let ke of Ce.active)ke.state==1&&!this.running.some($n=>$n.active.source==ke.source)&&this.startQuery(ke)}startQuery(_n){let{state:Ce}=this.view,ke=cur(Ce),$n=new CompletionContext(Ce,ke,_n.explicitPos==ke,this.view),Hn=new RunningQuery(_n,$n);this.running.push(Hn),Promise.resolve(_n.source($n)).then(zn=>{Hn.context.aborted||(Hn.done=zn||null,this.scheduleAccept())},zn=>{this.view.dispatch({effects:closeCompletionEffect.of(null)}),logException(this.view.state,zn)})}scheduleAccept(){this.running.every(_n=>_n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(completionConfig).updateSyncTime))}accept(){var _n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let Ce=[],ke=this.view.state.facet(completionConfig);for(let $n=0;$nUn.source==Hn.active.source);if(zn&&zn.state==1)if(Hn.done==null){let Un=new ActiveSource(Hn.active.source,0);for(let qn of Hn.updates)Un=Un.update(qn,ke);Un.state!=1&&Ce.push(Un)}else this.startQuery(zn)}Ce.length&&this.view.dispatch({effects:setActiveEffect.of(Ce)})}},{eventHandlers:{blur(_n){let Ce=this.view.state.field(completionState,!1);if(Ce&&Ce.tooltip&&this.view.state.facet(completionConfig).closeOnBlur){let ke=Ce.open&&getTooltip(this.view,Ce.open.tooltip);(!ke||!ke.dom.contains(_n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:closeCompletionEffect.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:startCompletionEffect.of(!1)}),20),this.composing=0}}}),windows=typeof navigator=="object"&&/Win/.test(navigator.platform),commitCharacters=Prec.highest(EditorView.domEventHandlers({keydown(_n,Ce){let ke=Ce.state.field(completionState,!1);if(!ke||!ke.open||ke.open.disabled||ke.open.selected<0||_n.key.length>1||_n.ctrlKey&&!(windows&&_n.altKey)||_n.metaKey)return!1;let $n=ke.open.options[ke.open.selected],Hn=ke.active.find(Un=>Un.source==$n.source),zn=$n.completion.commitCharacters||Hn.result.commitCharacters;return zn&&zn.indexOf(_n.key)>-1&&applyCompletion(Ce,$n),!1}})),baseTheme$1=EditorView.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class FieldPos{constructor(Ce,ke,$n,Hn){this.field=Ce,this.line=ke,this.from=$n,this.to=Hn}}class FieldRange{constructor(Ce,ke,$n){this.field=Ce,this.from=ke,this.to=$n}map(Ce){let ke=Ce.mapPos(this.from,-1,MapMode.TrackDel),$n=Ce.mapPos(this.to,1,MapMode.TrackDel);return ke==null||$n==null?null:new FieldRange(this.field,ke,$n)}}class Snippet{constructor(Ce,ke){this.lines=Ce,this.fieldPositions=ke}instantiate(Ce,ke){let $n=[],Hn=[ke],zn=Ce.doc.lineAt(ke),Un=/^\s*/.exec(zn.text)[0];for(let Xn of this.lines){if($n.length){let Kn=Un,to=/^\t*/.exec(Xn)[0].length;for(let io=0;ionew FieldRange(Xn.field,Hn[Xn.line]+Xn.from,Hn[Xn.line]+Xn.to));return{text:$n,ranges:qn}}static parse(Ce){let ke=[],$n=[],Hn=[],zn;for(let Un of Ce.split(/\r\n?|\n/)){for(;zn=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(Un);){let qn=zn[1]?+zn[1]:null,Xn=zn[2]||zn[3]||"",Kn=-1,to=Xn.replace(/\\[{}]/g,io=>io[1]);for(let io=0;io=Kn&&uo.field++}Hn.push(new FieldPos(Kn,$n.length,zn.index,zn.index+to.length)),Un=Un.slice(0,zn.index)+Xn+Un.slice(zn.index+zn[0].length)}Un=Un.replace(/\\([{}])/g,(qn,Xn,Kn)=>{for(let to of Hn)to.line==$n.length&&to.from>Kn&&(to.from--,to.to--);return Xn}),$n.push(Un)}return new Snippet($n,Hn)}}let fieldMarker=Decoration.widget({widget:new class extends WidgetType{toDOM(){let _n=document.createElement("span");return _n.className="cm-snippetFieldPosition",_n}ignoreEvent(){return!1}}}),fieldRange=Decoration.mark({class:"cm-snippetField"});class ActiveSnippet{constructor(Ce,ke){this.ranges=Ce,this.active=ke,this.deco=Decoration.set(Ce.map($n=>($n.from==$n.to?fieldMarker:fieldRange).range($n.from,$n.to)))}map(Ce){let ke=[];for(let $n of this.ranges){let Hn=$n.map(Ce);if(!Hn)return null;ke.push(Hn)}return new ActiveSnippet(ke,this.active)}selectionInsideField(Ce){return Ce.ranges.every(ke=>this.ranges.some($n=>$n.field==this.active&&$n.from<=ke.from&&$n.to>=ke.to))}}const setActive=StateEffect.define({map(_n,Ce){return _n&&_n.map(Ce)}}),moveToField=StateEffect.define(),snippetState=StateField.define({create(){return null},update(_n,Ce){for(let ke of Ce.effects){if(ke.is(setActive))return ke.value;if(ke.is(moveToField)&&_n)return new ActiveSnippet(_n.ranges,ke.value)}return _n&&Ce.docChanged&&(_n=_n.map(Ce.changes)),_n&&Ce.selection&&!_n.selectionInsideField(Ce.selection)&&(_n=null),_n},provide:_n=>EditorView.decorations.from(_n,Ce=>Ce?Ce.deco:Decoration.none)});function fieldSelection(_n,Ce){return EditorSelection.create(_n.filter(ke=>ke.field==Ce).map(ke=>EditorSelection.range(ke.from,ke.to)))}function snippet(_n){let Ce=Snippet.parse(_n);return(ke,$n,Hn,zn)=>{let{text:Un,ranges:qn}=Ce.instantiate(ke.state,Hn),Xn={changes:{from:Hn,to:zn,insert:Text.of(Un)},scrollIntoView:!0,annotations:$n?[pickedCompletion.of($n),Transaction.userEvent.of("input.complete")]:void 0};if(qn.length&&(Xn.selection=fieldSelection(qn,0)),qn.some(Kn=>Kn.field>0)){let Kn=new ActiveSnippet(qn,0),to=Xn.effects=[setActive.of(Kn)];ke.state.field(snippetState,!1)===void 0&&to.push(StateEffect.appendConfig.of([snippetState,addSnippetKeymap,snippetPointerHandler,baseTheme$1]))}ke.dispatch(ke.state.update(Xn))}}function moveField(_n){return({state:Ce,dispatch:ke})=>{let $n=Ce.field(snippetState,!1);if(!$n||_n<0&&$n.active==0)return!1;let Hn=$n.active+_n,zn=_n>0&&!$n.ranges.some(Un=>Un.field==Hn+_n);return ke(Ce.update({selection:fieldSelection($n.ranges,Hn),effects:setActive.of(zn?null:new ActiveSnippet($n.ranges,Hn)),scrollIntoView:!0})),!0}}const clearSnippet=({state:_n,dispatch:Ce})=>_n.field(snippetState,!1)?(Ce(_n.update({effects:setActive.of(null)})),!0):!1,nextSnippetField=moveField(1),prevSnippetField=moveField(-1),defaultSnippetKeymap=[{key:"Tab",run:nextSnippetField,shift:prevSnippetField},{key:"Escape",run:clearSnippet}],snippetKeymap=Facet.define({combine(_n){return _n.length?_n[0]:defaultSnippetKeymap}}),addSnippetKeymap=Prec.highest(keymap.compute([snippetKeymap],_n=>_n.facet(snippetKeymap)));function snippetCompletion(_n,Ce){return Object.assign(Object.assign({},Ce),{apply:snippet(_n)})}const snippetPointerHandler=EditorView.domEventHandlers({mousedown(_n,Ce){let ke=Ce.state.field(snippetState,!1),$n;if(!ke||($n=Ce.posAtCoords({x:_n.clientX,y:_n.clientY}))==null)return!1;let Hn=ke.ranges.find(zn=>zn.from<=$n&&zn.to>=$n);return!Hn||Hn.field==ke.active?!1:(Ce.dispatch({selection:fieldSelection(ke.ranges,Hn.field),effects:setActive.of(ke.ranges.some(zn=>zn.field>Hn.field)?new ActiveSnippet(ke.ranges,Hn.field):null),scrollIntoView:!0}),!0)}}),defaults={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},closeBracketEffect=StateEffect.define({map(_n,Ce){let ke=Ce.mapPos(_n,-1,MapMode.TrackAfter);return ke??void 0}}),closedBracket=new class extends RangeValue{};closedBracket.startSide=1;closedBracket.endSide=-1;const bracketState=StateField.define({create(){return RangeSet.empty},update(_n,Ce){if(_n=_n.map(Ce.changes),Ce.selection){let ke=Ce.state.doc.lineAt(Ce.selection.main.head);_n=_n.update({filter:$n=>$n>=ke.from&&$n<=ke.to})}for(let ke of Ce.effects)ke.is(closeBracketEffect)&&(_n=_n.update({add:[closedBracket.range(ke.value,ke.value+1)]}));return _n}});function closeBrackets(){return[inputHandler,bracketState]}const definedClosing="()[]{}<>";function closing(_n){for(let Ce=0;Ce{if((android$1?_n.composing:_n.compositionStarted)||_n.state.readOnly)return!1;let Hn=_n.state.selection.main;if($n.length>2||$n.length==2&&codePointSize(codePointAt($n,0))==1||Ce!=Hn.from||ke!=Hn.to)return!1;let zn=insertBracket(_n.state,$n);return zn?(_n.dispatch(zn),!0):!1}),deleteBracketPair=({state:_n,dispatch:Ce})=>{if(_n.readOnly)return!1;let $n=config(_n,_n.selection.main.head).brackets||defaults.brackets,Hn=null,zn=_n.changeByRange(Un=>{if(Un.empty){let qn=prevChar(_n.doc,Un.head);for(let Xn of $n)if(Xn==qn&&nextChar(_n.doc,Un.head)==closing(codePointAt(Xn,0)))return{changes:{from:Un.head-Xn.length,to:Un.head+Xn.length},range:EditorSelection.cursor(Un.head-Xn.length)}}return{range:Hn=Un}});return Hn||Ce(_n.update(zn,{scrollIntoView:!0,userEvent:"delete.backward"})),!Hn},closeBracketsKeymap=[{key:"Backspace",run:deleteBracketPair}];function insertBracket(_n,Ce){let ke=config(_n,_n.selection.main.head),$n=ke.brackets||defaults.brackets;for(let Hn of $n){let zn=closing(codePointAt(Hn,0));if(Ce==Hn)return zn==Hn?handleSame(_n,Hn,$n.indexOf(Hn+Hn+Hn)>-1,ke):handleOpen(_n,Hn,zn,ke.before||defaults.before);if(Ce==zn&&closedBracketAt(_n,_n.selection.main.from))return handleClose(_n,Hn,zn)}return null}function closedBracketAt(_n,Ce){let ke=!1;return _n.field(bracketState).between(0,_n.doc.length,$n=>{$n==Ce&&(ke=!0)}),ke}function nextChar(_n,Ce){let ke=_n.sliceString(Ce,Ce+2);return ke.slice(0,codePointSize(codePointAt(ke,0)))}function prevChar(_n,Ce){let ke=_n.sliceString(Ce-2,Ce);return codePointSize(codePointAt(ke,0))==ke.length?ke:ke.slice(1)}function handleOpen(_n,Ce,ke,$n){let Hn=null,zn=_n.changeByRange(Un=>{if(!Un.empty)return{changes:[{insert:Ce,from:Un.from},{insert:ke,from:Un.to}],effects:closeBracketEffect.of(Un.to+Ce.length),range:EditorSelection.range(Un.anchor+Ce.length,Un.head+Ce.length)};let qn=nextChar(_n.doc,Un.head);return!qn||/\s/.test(qn)||$n.indexOf(qn)>-1?{changes:{insert:Ce+ke,from:Un.head},effects:closeBracketEffect.of(Un.head+Ce.length),range:EditorSelection.cursor(Un.head+Ce.length)}:{range:Hn=Un}});return Hn?null:_n.update(zn,{scrollIntoView:!0,userEvent:"input.type"})}function handleClose(_n,Ce,ke){let $n=null,Hn=_n.changeByRange(zn=>zn.empty&&nextChar(_n.doc,zn.head)==ke?{changes:{from:zn.head,to:zn.head+ke.length,insert:ke},range:EditorSelection.cursor(zn.head+ke.length)}:$n={range:zn});return $n?null:_n.update(Hn,{scrollIntoView:!0,userEvent:"input.type"})}function handleSame(_n,Ce,ke,$n){let Hn=$n.stringPrefixes||defaults.stringPrefixes,zn=null,Un=_n.changeByRange(qn=>{if(!qn.empty)return{changes:[{insert:Ce,from:qn.from},{insert:Ce,from:qn.to}],effects:closeBracketEffect.of(qn.to+Ce.length),range:EditorSelection.range(qn.anchor+Ce.length,qn.head+Ce.length)};let Xn=qn.head,Kn=nextChar(_n.doc,Xn),to;if(Kn==Ce){if(nodeStart(_n,Xn))return{changes:{insert:Ce+Ce,from:Xn},effects:closeBracketEffect.of(Xn+Ce.length),range:EditorSelection.cursor(Xn+Ce.length)};if(closedBracketAt(_n,Xn)){let uo=ke&&_n.sliceDoc(Xn,Xn+Ce.length*3)==Ce+Ce+Ce?Ce+Ce+Ce:Ce;return{changes:{from:Xn,to:Xn+uo.length,insert:uo},range:EditorSelection.cursor(Xn+uo.length)}}}else{if(ke&&_n.sliceDoc(Xn-2*Ce.length,Xn)==Ce+Ce&&(to=canStartStringAt(_n,Xn-2*Ce.length,Hn))>-1&&nodeStart(_n,to))return{changes:{insert:Ce+Ce+Ce+Ce,from:Xn},effects:closeBracketEffect.of(Xn+Ce.length),range:EditorSelection.cursor(Xn+Ce.length)};if(_n.charCategorizer(Xn)(Kn)!=CharCategory.Word&&canStartStringAt(_n,Xn,Hn)>-1&&!probablyInString(_n,Xn,Ce,Hn))return{changes:{insert:Ce+Ce,from:Xn},effects:closeBracketEffect.of(Xn+Ce.length),range:EditorSelection.cursor(Xn+Ce.length)}}return{range:zn=qn}});return zn?null:_n.update(Un,{scrollIntoView:!0,userEvent:"input.type"})}function nodeStart(_n,Ce){let ke=syntaxTree(_n).resolveInner(Ce+1);return ke.parent&&ke.from==Ce}function probablyInString(_n,Ce,ke,$n){let Hn=syntaxTree(_n).resolveInner(Ce,-1),zn=$n.reduce((Un,qn)=>Math.max(Un,qn.length),0);for(let Un=0;Un<5;Un++){let qn=_n.sliceDoc(Hn.from,Math.min(Hn.to,Hn.from+ke.length+zn)),Xn=qn.indexOf(ke);if(!Xn||Xn>-1&&$n.indexOf(qn.slice(0,Xn))>-1){let to=Hn.firstChild;for(;to&&to.from==Hn.from&&to.to-to.from>ke.length+Xn;){if(_n.sliceDoc(to.to-ke.length,to.to)==ke)return!1;to=to.firstChild}return!0}let Kn=Hn.to==Ce&&Hn.parent;if(!Kn)break;Hn=Kn}return!1}function canStartStringAt(_n,Ce,ke){let $n=_n.charCategorizer(Ce);if($n(_n.sliceDoc(Ce-1,Ce))!=CharCategory.Word)return Ce;for(let Hn of ke){let zn=Ce-Hn.length;if(_n.sliceDoc(zn,Ce)==Hn&&$n(_n.sliceDoc(zn-1,zn))!=CharCategory.Word)return zn}return-1}function autocompletion(_n={}){return[commitCharacters,completionState,completionConfig.of(_n),completionPlugin,completionKeymapExt,baseTheme$1]}const completionKeymap=[{key:"Ctrl-Space",run:startCompletion},{key:"Escape",run:closeCompletion},{key:"ArrowDown",run:moveCompletionSelection(!0)},{key:"ArrowUp",run:moveCompletionSelection(!1)},{key:"PageDown",run:moveCompletionSelection(!0,"page")},{key:"PageUp",run:moveCompletionSelection(!1,"page")},{key:"Enter",run:acceptCompletion}],completionKeymapExt=Prec.highest(keymap.computeN([completionConfig],_n=>_n.facet(completionConfig).defaultKeymap?[completionKeymap]:[]));class SelectedDiagnostic{constructor(Ce,ke,$n){this.from=Ce,this.to=ke,this.diagnostic=$n}}class LintState{constructor(Ce,ke,$n){this.diagnostics=Ce,this.panel=ke,this.selected=$n}static init(Ce,ke,$n){let Hn=Ce,zn=$n.facet(lintConfig).markerFilter;zn&&(Hn=zn(Hn,$n));let Un=Decoration.set(Hn.map(qn=>qn.from==qn.to||qn.from==qn.to-1&&$n.doc.lineAt(qn.from).to==qn.from?Decoration.widget({widget:new DiagnosticWidget(qn),diagnostic:qn}).range(qn.from):Decoration.mark({attributes:{class:"cm-lintRange cm-lintRange-"+qn.severity+(qn.markClass?" "+qn.markClass:"")},diagnostic:qn}).range(qn.from,qn.to)),!0);return new LintState(Un,ke,findDiagnostic(Un))}}function findDiagnostic(_n,Ce=null,ke=0){let $n=null;return _n.between(ke,1e9,(Hn,zn,{spec:Un})=>{if(!(Ce&&Un.diagnostic!=Ce))return $n=new SelectedDiagnostic(Hn,zn,Un.diagnostic),!1}),$n}function hideTooltip(_n,Ce){let ke=Ce.pos,$n=Ce.end||ke,Hn=_n.state.facet(lintConfig).hideOn(_n,ke,$n);if(Hn!=null)return Hn;let zn=_n.startState.doc.lineAt(Ce.pos);return!!(_n.effects.some(Un=>Un.is(setDiagnosticsEffect))||_n.changes.touchesRange(zn.from,Math.max(zn.to,$n)))}function maybeEnableLint(_n,Ce){return _n.field(lintState,!1)?Ce:Ce.concat(StateEffect.appendConfig.of(lintExtensions))}function setDiagnostics(_n,Ce){return{effects:maybeEnableLint(_n,[setDiagnosticsEffect.of(Ce)])}}const setDiagnosticsEffect=StateEffect.define(),togglePanel=StateEffect.define(),movePanelSelection=StateEffect.define(),lintState=StateField.define({create(){return new LintState(Decoration.none,null,null)},update(_n,Ce){if(Ce.docChanged&&_n.diagnostics.size){let ke=_n.diagnostics.map(Ce.changes),$n=null,Hn=_n.panel;if(_n.selected){let zn=Ce.changes.mapPos(_n.selected.from,1);$n=findDiagnostic(ke,_n.selected.diagnostic,zn)||findDiagnostic(ke,null,zn)}!ke.size&&Hn&&Ce.state.facet(lintConfig).autoPanel&&(Hn=null),_n=new LintState(ke,Hn,$n)}for(let ke of Ce.effects)if(ke.is(setDiagnosticsEffect)){let $n=Ce.state.facet(lintConfig).autoPanel?ke.value.length?LintPanel.open:null:_n.panel;_n=LintState.init(ke.value,$n,Ce.state)}else ke.is(togglePanel)?_n=new LintState(_n.diagnostics,ke.value?LintPanel.open:null,_n.selected):ke.is(movePanelSelection)&&(_n=new LintState(_n.diagnostics,_n.panel,ke.value));return _n},provide:_n=>[showPanel.from(_n,Ce=>Ce.panel),EditorView.decorations.from(_n,Ce=>Ce.diagnostics)]}),activeMark=Decoration.mark({class:"cm-lintRange cm-lintRange-active"});function lintTooltip(_n,Ce,ke){let{diagnostics:$n}=_n.state.field(lintState),Hn=[],zn=2e8,Un=0;$n.between(Ce-(ke<0?1:0),Ce+(ke>0?1:0),(Xn,Kn,{spec:to})=>{Ce>=Xn&&Ce<=Kn&&(Xn==Kn||(Ce>Xn||ke>0)&&(CerenderDiagnostic(_n,ke,!1)))}const openLintPanel=_n=>{let Ce=_n.state.field(lintState,!1);(!Ce||!Ce.panel)&&_n.dispatch({effects:maybeEnableLint(_n.state,[togglePanel.of(!0)])});let ke=getPanel(_n,LintPanel.open);return ke&&ke.dom.querySelector(".cm-panel-lint ul").focus(),!0},closeLintPanel=_n=>{let Ce=_n.state.field(lintState,!1);return!Ce||!Ce.panel?!1:(_n.dispatch({effects:togglePanel.of(!1)}),!0)},nextDiagnostic=_n=>{let Ce=_n.state.field(lintState,!1);if(!Ce)return!1;let ke=_n.state.selection.main,$n=Ce.diagnostics.iter(ke.to+1);return!$n.value&&($n=Ce.diagnostics.iter(0),!$n.value||$n.from==ke.from&&$n.to==ke.to)?!1:(_n.dispatch({selection:{anchor:$n.from,head:$n.to},scrollIntoView:!0}),!0)},lintKeymap=[{key:"Mod-Shift-m",run:openLintPanel,preventDefault:!0},{key:"F8",run:nextDiagnostic}],lintPlugin=ViewPlugin.fromClass(class{constructor(_n){this.view=_n,this.timeout=-1,this.set=!0;let{delay:Ce}=_n.state.facet(lintConfig);this.lintTime=Date.now()+Ce,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,Ce)}run(){clearTimeout(this.timeout);let _n=Date.now();if(_nPromise.resolve($n(this.view)))).then($n=>{let Hn=$n.reduce((zn,Un)=>zn.concat(Un));this.view.state.doc==Ce.doc&&this.view.dispatch(setDiagnostics(this.view.state,Hn))},$n=>{logException(this.view.state,$n)})}}update(_n){let Ce=_n.state.facet(lintConfig);(_n.docChanged||Ce!=_n.startState.facet(lintConfig)||Ce.needsRefresh&&Ce.needsRefresh(_n))&&(this.lintTime=Date.now()+Ce.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,Ce.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),lintConfig=Facet.define({combine(_n){return Object.assign({sources:_n.map(Ce=>Ce.source).filter(Ce=>Ce!=null)},combineConfig(_n.map(Ce=>Ce.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(Ce,ke)=>Ce?ke?$n=>Ce($n)||ke($n):Ce:ke}))}});function linter(_n,Ce={}){return[lintConfig.of({source:_n,config:Ce}),lintPlugin,lintExtensions]}function assignKeys(_n){let Ce=[];if(_n)e:for(let{name:ke}of _n){for(let $n=0;$nzn.toLowerCase()==Hn.toLowerCase())){Ce.push(Hn);continue e}}Ce.push("")}return Ce}function renderDiagnostic(_n,Ce,ke){var $n;let Hn=ke?assignKeys(Ce.actions):[];return crelt("li",{class:"cm-diagnostic cm-diagnostic-"+Ce.severity},crelt("span",{class:"cm-diagnosticText"},Ce.renderMessage?Ce.renderMessage(_n):Ce.message),($n=Ce.actions)===null||$n===void 0?void 0:$n.map((zn,Un)=>{let qn=!1,Xn=uo=>{if(uo.preventDefault(),qn)return;qn=!0;let ho=findDiagnostic(_n.state.field(lintState).diagnostics,Ce);ho&&zn.apply(_n,ho.from,ho.to)},{name:Kn}=zn,to=Hn[Un]?Kn.indexOf(Hn[Un]):-1,io=to<0?Kn:[Kn.slice(0,to),crelt("u",Kn.slice(to,to+1)),Kn.slice(to+1)];return crelt("button",{type:"button",class:"cm-diagnosticAction",onclick:Xn,onmousedown:Xn,"aria-label":` Action: ${Kn}${to<0?"":` (access key "${Hn[Un]})"`}.`},io)}),Ce.source&&crelt("div",{class:"cm-diagnosticSource"},Ce.source))}class DiagnosticWidget extends WidgetType{constructor(Ce){super(),this.diagnostic=Ce}eq(Ce){return Ce.diagnostic==this.diagnostic}toDOM(){return crelt("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class PanelItem{constructor(Ce,ke){this.diagnostic=ke,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=renderDiagnostic(Ce,ke,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class LintPanel{constructor(Ce){this.view=Ce,this.items=[];let ke=Hn=>{if(Hn.keyCode==27)closeLintPanel(this.view),this.view.focus();else if(Hn.keyCode==38||Hn.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(Hn.keyCode==40||Hn.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(Hn.keyCode==36)this.moveSelection(0);else if(Hn.keyCode==35)this.moveSelection(this.items.length-1);else if(Hn.keyCode==13)this.view.focus();else if(Hn.keyCode>=65&&Hn.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:zn}=this.items[this.selectedIndex],Un=assignKeys(zn.actions);for(let qn=0;qn{for(let zn=0;zncloseLintPanel(this.view)},"×")),this.update()}get selectedIndex(){let Ce=this.view.state.field(lintState).selected;if(!Ce)return-1;for(let ke=0;ke{let Kn=-1,to;for(let io=$n;io$n&&(this.items.splice($n,Kn-$n),Hn=!0)),ke&&to.diagnostic==ke.diagnostic?to.dom.hasAttribute("aria-selected")||(to.dom.setAttribute("aria-selected","true"),zn=to):to.dom.hasAttribute("aria-selected")&&to.dom.removeAttribute("aria-selected"),$n++});$n({sel:zn.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:Un,panel:qn})=>{let Xn=qn.height/this.list.offsetHeight;Un.topqn.bottom&&(this.list.scrollTop+=(Un.bottom-qn.bottom)/Xn)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),Hn&&this.sync()}sync(){let Ce=this.list.firstChild;function ke(){let $n=Ce;Ce=$n.nextSibling,$n.remove()}for(let $n of this.items)if($n.dom.parentNode==this.list){for(;Ce!=$n.dom;)ke();Ce=$n.dom.nextSibling}else this.list.insertBefore($n.dom,Ce);for(;Ce;)ke()}moveSelection(Ce){if(this.selectedIndex<0)return;let ke=this.view.state.field(lintState),$n=findDiagnostic(ke.diagnostics,this.items[Ce].diagnostic);$n&&this.view.dispatch({selection:{anchor:$n.from,head:$n.to},scrollIntoView:!0,effects:movePanelSelection.of($n)})}static open(Ce){return new LintPanel(Ce)}}function svg(_n,Ce='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(_n)}')`}function underline(_n){return svg(``,'width="6" height="3"')}const baseTheme=EditorView.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:underline("#d11")},".cm-lintRange-warning":{backgroundImage:underline("orange")},".cm-lintRange-info":{backgroundImage:underline("#999")},".cm-lintRange-hint":{backgroundImage:underline("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function severityWeight(_n){return _n=="error"?4:_n=="warning"?3:_n=="info"?2:1}class LintGutterMarker extends GutterMarker{constructor(Ce){super(),this.diagnostics=Ce,this.severity=Ce.reduce((ke,$n)=>severityWeight(ke)gutterMarkerMouseOver(Ce,ke,$n)),ke}}function trackHoverOn(_n,Ce){let ke=$n=>{let Hn=Ce.getBoundingClientRect();if(!($n.clientX>Hn.left-10&&$n.clientXHn.top-10&&$n.clientYCe.getBoundingClientRect()}}})}),Ce.onmouseout=Ce.onmousemove=null,trackHoverOn(_n,Ce)}let{hoverTime:Hn}=_n.state.facet(lintGutterConfig),zn=setTimeout($n,Hn);Ce.onmouseout=()=>{clearTimeout(zn),Ce.onmouseout=Ce.onmousemove=null},Ce.onmousemove=()=>{clearTimeout(zn),zn=setTimeout($n,Hn)}}function markersForDiagnostics(_n,Ce){let ke=Object.create(null);for(let Hn of Ce){let zn=_n.lineAt(Hn.from);(ke[zn.from]||(ke[zn.from]=[])).push(Hn)}let $n=[];for(let Hn in ke)$n.push(new LintGutterMarker(ke[Hn]).range(+Hn));return RangeSet.of($n,!0)}const lintGutterExtension=gutter({class:"cm-gutter-lint",markers:_n=>_n.state.field(lintGutterMarkers)}),lintGutterMarkers=StateField.define({create(){return RangeSet.empty},update(_n,Ce){_n=_n.map(Ce.changes);let ke=Ce.state.facet(lintGutterConfig).markerFilter;for(let $n of Ce.effects)if($n.is(setDiagnosticsEffect)){let Hn=$n.value;ke&&(Hn=ke(Hn||[],Ce.state)),_n=markersForDiagnostics(Ce.state.doc,Hn.slice(0))}return _n}}),setLintGutterTooltip=StateEffect.define(),lintGutterTooltip=StateField.define({create(){return null},update(_n,Ce){return _n&&Ce.docChanged&&(_n=hideTooltip(Ce,_n)?null:Object.assign(Object.assign({},_n),{pos:Ce.changes.mapPos(_n.pos)})),Ce.effects.reduce((ke,$n)=>$n.is(setLintGutterTooltip)?$n.value:ke,_n)},provide:_n=>showTooltip.from(_n)}),lintGutterTheme=EditorView.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:svg('')},".cm-lint-marker-warning":{content:svg('')},".cm-lint-marker-error":{content:svg('')}}),lintExtensions=[lintState,EditorView.decorations.compute([lintState],_n=>{let{selected:Ce,panel:ke}=_n.field(lintState);return!Ce||!ke||Ce.from==Ce.to?Decoration.none:Decoration.set([activeMark.range(Ce.from,Ce.to)])}),hoverTooltip(lintTooltip,{hideOn:hideTooltip}),baseTheme],lintGutterConfig=Facet.define({combine(_n){return combineConfig(_n,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function lintGutter(_n={}){return[lintGutterConfig.of(_n),lintGutterMarkers,lintGutterExtension,lintGutterTheme,lintGutterTooltip]}const basicSetup=[lineNumbers(),highlightActiveLineGutter(),highlightSpecialChars(),history$1(),foldGutter(),drawSelection(),dropCursor(),EditorState.allowMultipleSelections.of(!0),indentOnInput(),syntaxHighlighting(defaultHighlightStyle,{fallback:!0}),bracketMatching(),closeBrackets(),autocompletion(),rectangularSelection(),crosshairCursor(),highlightActiveLine(),highlightSelectionMatches(),keymap.of([...closeBracketsKeymap,...defaultKeymap,...searchKeymap,...historyKeymap,...foldKeymap,...completionKeymap,...lintKeymap])];var define_process_env_default={};class Stack{constructor(Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to=0,io){this.p=Ce,this.stack=ke,this.state=$n,this.reducePos=Hn,this.pos=zn,this.score=Un,this.buffer=qn,this.bufferBase=Xn,this.curContext=Kn,this.lookAhead=to,this.parent=io}toString(){return`[${this.stack.filter((Ce,ke)=>ke%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(Ce,ke,$n=0){let Hn=Ce.parser.context;return new Stack(Ce,[],ke,$n,$n,0,[],0,Hn?new StackContext(Hn,Hn.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(Ce,ke){this.stack.push(this.state,ke,this.bufferBase+this.buffer.length),this.state=Ce}reduce(Ce){var ke;let $n=Ce>>19,Hn=Ce&65535,{parser:zn}=this.p,Un=this.reducePos=2e3&&!(!((ke=this.p.parser.nodeSet.types[Hn])===null||ke===void 0)&&ke.isAnonymous)&&(Kn==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=to):this.p.lastBigReductionSizeXn;)this.stack.pop();this.reduceContext(Hn,Kn)}storeNode(Ce,ke,$n,Hn=4,zn=!1){if(Ce==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&Un.buffer[qn-4]==0&&Un.buffer[qn-1]>-1){if(ke==$n)return;if(Un.buffer[qn-2]>=ke){Un.buffer[qn-2]=$n;return}}}if(!zn||this.pos==$n)this.buffer.push(Ce,ke,$n,Hn);else{let Un=this.buffer.length;if(Un>0&&this.buffer[Un-4]!=0){let qn=!1;for(let Xn=Un;Xn>0&&this.buffer[Xn-2]>$n;Xn-=4)if(this.buffer[Xn-1]>=0){qn=!0;break}if(qn)for(;Un>0&&this.buffer[Un-2]>$n;)this.buffer[Un]=this.buffer[Un-4],this.buffer[Un+1]=this.buffer[Un-3],this.buffer[Un+2]=this.buffer[Un-2],this.buffer[Un+3]=this.buffer[Un-1],Un-=4,Hn>4&&(Hn-=4)}this.buffer[Un]=Ce,this.buffer[Un+1]=ke,this.buffer[Un+2]=$n,this.buffer[Un+3]=Hn}}shift(Ce,ke,$n,Hn){if(Ce&131072)this.pushState(Ce&65535,this.pos);else if(Ce&262144)this.pos=Hn,this.shiftContext(ke,$n),ke<=this.p.parser.maxNode&&this.buffer.push(ke,$n,Hn,4);else{let zn=Ce,{parser:Un}=this.p;(Hn>this.pos||ke<=Un.maxNode)&&(this.pos=Hn,Un.stateFlag(zn,1)||(this.reducePos=Hn)),this.pushState(zn,$n),this.shiftContext(ke,$n),ke<=Un.maxNode&&this.buffer.push(ke,$n,Hn,4)}}apply(Ce,ke,$n,Hn){Ce&65536?this.reduce(Ce):this.shift(Ce,ke,$n,Hn)}useNode(Ce,ke){let $n=this.p.reused.length-1;($n<0||this.p.reused[$n]!=Ce)&&(this.p.reused.push(Ce),$n++);let Hn=this.pos;this.reducePos=this.pos=Hn+Ce.length,this.pushState(ke,Hn),this.buffer.push($n,Hn,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,Ce,this,this.p.stream.reset(this.pos-Ce.length)))}split(){let Ce=this,ke=Ce.buffer.length;for(;ke>0&&Ce.buffer[ke-2]>Ce.reducePos;)ke-=4;let $n=Ce.buffer.slice(ke),Hn=Ce.bufferBase+ke;for(;Ce&&Hn==Ce.bufferBase;)Ce=Ce.parent;return new Stack(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,$n,Hn,this.curContext,this.lookAhead,Ce)}recoverByDelete(Ce,ke){let $n=Ce<=this.p.parser.maxNode;$n&&this.storeNode(Ce,this.pos,ke,4),this.storeNode(0,this.pos,ke,$n?8:4),this.pos=this.reducePos=ke,this.score-=190}canShift(Ce){for(let ke=new SimulatedStack(this);;){let $n=this.p.parser.stateSlot(ke.state,4)||this.p.parser.hasAction(ke.state,Ce);if($n==0)return!1;if(!($n&65536))return!0;ke.reduce($n)}}recoverByInsert(Ce){if(this.stack.length>=300)return[];let ke=this.p.parser.nextStates(this.state);if(ke.length>8||this.stack.length>=120){let Hn=[];for(let zn=0,Un;znXn&1&&qn==Un)||Hn.push(ke[zn],Un)}ke=Hn}let $n=[];for(let Hn=0;Hn>19,Hn=ke&65535,zn=this.stack.length-$n*3;if(zn<0||Ce.getGoto(this.stack[zn],Hn,!1)<0){let Un=this.findForcedReduction();if(Un==null)return!1;ke=Un}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(ke),!0}findForcedReduction(){let{parser:Ce}=this.p,ke=[],$n=(Hn,zn)=>{if(!ke.includes(Hn))return ke.push(Hn),Ce.allActions(Hn,Un=>{if(!(Un&393216))if(Un&65536){let qn=(Un>>19)-zn;if(qn>1){let Xn=Un&65535,Kn=this.stack.length-qn*3;if(Kn>=0&&Ce.getGoto(this.stack[Kn],Xn,!1)>=0)return qn<<19|65536|Xn}}else{let qn=$n(Un,zn+1);if(qn!=null)return qn}})};return $n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:Ce}=this.p;return Ce.data[Ce.stateSlot(this.state,1)]==65535&&!Ce.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(Ce){if(this.state!=Ce.state||this.stack.length!=Ce.stack.length)return!1;for(let ke=0;kethis.lookAhead&&(this.emitLookAhead(),this.lookAhead=Ce)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class StackContext{constructor(Ce,ke){this.tracker=Ce,this.context=ke,this.hash=Ce.strict?Ce.hash(ke):0}}class SimulatedStack{constructor(Ce){this.start=Ce,this.state=Ce.state,this.stack=Ce.stack,this.base=this.stack.length}reduce(Ce){let ke=Ce&65535,$n=Ce>>19;$n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=($n-1)*3;let Hn=this.start.p.parser.getGoto(this.stack[this.base-3],ke,!0);this.state=Hn}}class StackBufferCursor{constructor(Ce,ke,$n){this.stack=Ce,this.pos=ke,this.index=$n,this.buffer=Ce.buffer,this.index==0&&this.maybeNext()}static create(Ce,ke=Ce.bufferBase+Ce.buffer.length){return new StackBufferCursor(Ce,ke,ke-Ce.bufferBase)}maybeNext(){let Ce=this.stack.parent;Ce!=null&&(this.index=this.stack.bufferBase-Ce.bufferBase,this.stack=Ce,this.buffer=Ce.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new StackBufferCursor(this.stack,this.pos,this.index)}}function decodeArray(_n,Ce=Uint16Array){if(typeof _n!="string")return _n;let ke=null;for(let $n=0,Hn=0;$n<_n.length;){let zn=0;for(;;){let Un=_n.charCodeAt($n++),qn=!1;if(Un==126){zn=65535;break}Un>=92&&Un--,Un>=34&&Un--;let Xn=Un-32;if(Xn>=46&&(Xn-=46,qn=!0),zn+=Xn,qn)break;zn*=46}ke?ke[Hn++]=zn:ke=new Ce(zn)}return ke}class CachedToken{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const nullToken=new CachedToken;class InputStream{constructor(Ce,ke){this.input=Ce,this.ranges=ke,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=nullToken,this.rangeIndex=0,this.pos=this.chunkPos=ke[0].from,this.range=ke[0],this.end=ke[ke.length-1].to,this.readNext()}resolveOffset(Ce,ke){let $n=this.range,Hn=this.rangeIndex,zn=this.pos+Ce;for(;zn<$n.from;){if(!Hn)return null;let Un=this.ranges[--Hn];zn-=$n.from-Un.to,$n=Un}for(;ke<0?zn>$n.to:zn>=$n.to;){if(Hn==this.ranges.length-1)return null;let Un=this.ranges[++Hn];zn+=Un.from-$n.to,$n=Un}return zn}clipPos(Ce){if(Ce>=this.range.from&&CeCe)return Math.max(Ce,ke.from);return this.end}peek(Ce){let ke=this.chunkOff+Ce,$n,Hn;if(ke>=0&&ke=this.chunk2Pos&&$nqn.to&&(this.chunk2=this.chunk2.slice(0,qn.to-$n)),Hn=this.chunk2.charCodeAt(0)}}return $n>=this.token.lookAhead&&(this.token.lookAhead=$n+1),Hn}acceptToken(Ce,ke=0){let $n=ke?this.resolveOffset(ke,-1):this.pos;if($n==null||$n=this.chunk2Pos&&this.posthis.range.to?Ce.slice(0,this.range.to-this.pos):Ce,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(Ce=1){for(this.chunkOff+=Ce;this.pos+Ce>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();Ce-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=Ce,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(Ce,ke){if(ke?(this.token=ke,ke.start=Ce,ke.lookAhead=Ce+1,ke.value=ke.extended=-1):this.token=nullToken,this.pos!=Ce){if(this.pos=Ce,Ce==this.end)return this.setDone(),this;for(;Ce=this.range.to;)this.range=this.ranges[++this.rangeIndex];Ce>=this.chunkPos&&Ce=this.chunkPos&&ke<=this.chunkPos+this.chunk.length)return this.chunk.slice(Ce-this.chunkPos,ke-this.chunkPos);if(Ce>=this.chunk2Pos&&ke<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(Ce-this.chunk2Pos,ke-this.chunk2Pos);if(Ce>=this.range.from&&ke<=this.range.to)return this.input.read(Ce,ke);let $n="";for(let Hn of this.ranges){if(Hn.from>=ke)break;Hn.to>Ce&&($n+=this.input.read(Math.max(Hn.from,Ce),Math.min(Hn.to,ke)))}return $n}}class TokenGroup{constructor(Ce,ke){this.data=Ce,this.id=ke}token(Ce,ke){let{parser:$n}=ke.p;readToken(this.data,Ce,ke,this.id,$n.data,$n.tokenPrecTable)}}TokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;class LocalTokenGroup{constructor(Ce,ke,$n){this.precTable=ke,this.elseToken=$n,this.data=typeof Ce=="string"?decodeArray(Ce):Ce}token(Ce,ke){let $n=Ce.pos,Hn=0;for(;;){let zn=Ce.next<0,Un=Ce.resolveOffset(1,1);if(readToken(this.data,Ce,ke,0,this.data,this.precTable),Ce.token.value>-1)break;if(this.elseToken==null)return;if(zn||Hn++,Un==null)break;Ce.reset(Un,Ce.token)}Hn&&(Ce.reset($n,Ce.token),Ce.acceptToken(this.elseToken,Hn))}}LocalTokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;class ExternalTokenizer{constructor(Ce,ke={}){this.token=Ce,this.contextual=!!ke.contextual,this.fallback=!!ke.fallback,this.extend=!!ke.extend}}function readToken(_n,Ce,ke,$n,Hn,zn){let Un=0,qn=1<<$n,{dialect:Xn}=ke.p.parser;e:for(;qn&_n[Un];){let Kn=_n[Un+1];for(let ho=Un+3;ho0){let bo=_n[ho];if(Xn.allows(bo)&&(Ce.token.value==-1||Ce.token.value==bo||overrides(bo,Ce.token.value,Hn,zn))){Ce.acceptToken(bo);break}}let to=Ce.next,io=0,uo=_n[Un+2];if(Ce.next<0&&uo>io&&_n[Kn+uo*3-3]==65535){Un=_n[Kn+uo*3-1];continue e}for(;io>1,bo=Kn+ho+(ho<<1),Oo=_n[bo],So=_n[bo+1]||65536;if(to=So)io=ho+1;else{Un=_n[bo+2],Ce.advance();continue e}}break}}function findOffset(_n,Ce,ke){for(let $n=Ce,Hn;(Hn=_n[$n])!=65535;$n++)if(Hn==ke)return $n-Ce;return-1}function overrides(_n,Ce,ke,$n){let Hn=findOffset(ke,$n,Ce);return Hn<0||findOffset(ke,$n,_n)Ce)&&!$n.type.isError)return ke<0?Math.max(0,Math.min($n.to-1,Ce-25)):Math.min(_n.length,Math.max($n.from+1,Ce+25));if(ke<0?$n.prevSibling():$n.nextSibling())break;if(!$n.parent())return ke<0?0:_n.length}}let FragmentCursor$1=class{constructor(Ce,ke){this.fragments=Ce,this.nodeSet=ke,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let Ce=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(Ce){for(this.safeFrom=Ce.openStart?cutAt(Ce.tree,Ce.from+Ce.offset,1)-Ce.offset:Ce.from,this.safeTo=Ce.openEnd?cutAt(Ce.tree,Ce.to+Ce.offset,-1)-Ce.offset:Ce.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(Ce.tree),this.start.push(-Ce.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(Ce){if(CeCe)return this.nextStart=Un,null;if(zn instanceof Tree){if(Un==Ce){if(Un=Math.max(this.safeFrom,Ce)&&(this.trees.push(zn),this.start.push(Un),this.index.push(0))}else this.index[ke]++,this.nextStart=Un+zn.length}}};class TokenCache{constructor(Ce,ke){this.stream=ke,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=Ce.tokenizers.map($n=>new CachedToken)}getActions(Ce){let ke=0,$n=null,{parser:Hn}=Ce.p,{tokenizers:zn}=Hn,Un=Hn.stateSlot(Ce.state,3),qn=Ce.curContext?Ce.curContext.hash:0,Xn=0;for(let Kn=0;Knio.end+25&&(Xn=Math.max(io.lookAhead,Xn)),io.value!=0)){let uo=ke;if(io.extended>-1&&(ke=this.addActions(Ce,io.extended,io.end,ke)),ke=this.addActions(Ce,io.value,io.end,ke),!to.extend&&($n=io,ke>uo))break}}for(;this.actions.length>ke;)this.actions.pop();return Xn&&Ce.setLookAhead(Xn),!$n&&Ce.pos==this.stream.end&&($n=new CachedToken,$n.value=Ce.p.parser.eofTerm,$n.start=$n.end=Ce.pos,ke=this.addActions(Ce,$n.value,$n.end,ke)),this.mainToken=$n,this.actions}getMainToken(Ce){if(this.mainToken)return this.mainToken;let ke=new CachedToken,{pos:$n,p:Hn}=Ce;return ke.start=$n,ke.end=Math.min($n+1,Hn.stream.end),ke.value=$n==Hn.stream.end?Hn.parser.eofTerm:0,ke}updateCachedToken(Ce,ke,$n){let Hn=this.stream.clipPos($n.pos);if(ke.token(this.stream.reset(Hn,Ce),$n),Ce.value>-1){let{parser:zn}=$n.p;for(let Un=0;Un=0&&$n.p.parser.dialect.allows(qn>>1)){qn&1?Ce.extended=qn>>1:Ce.value=qn>>1;break}}}else Ce.value=0,Ce.end=this.stream.clipPos(Hn+1)}putAction(Ce,ke,$n,Hn){for(let zn=0;znCe.bufferLength*4?new FragmentCursor$1($n,Ce.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let Ce=this.stacks,ke=this.minStackPos,$n=this.stacks=[],Hn,zn;if(this.bigReductionCount>300&&Ce.length==1){let[Un]=Ce;for(;Un.forceReduce()&&Un.stack.length&&Un.stack[Un.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let Un=0;Unke)$n.push(qn);else{if(this.advanceStack(qn,$n,Ce))continue;{Hn||(Hn=[],zn=[]),Hn.push(qn);let Xn=this.tokens.getMainToken(qn);zn.push(Xn.value,Xn.end)}}break}}if(!$n.length){let Un=Hn&&findFinished(Hn);if(Un)return verbose&&console.log("Finish with "+this.stackID(Un)),this.stackToTree(Un);if(this.parser.strict)throw verbose&&Hn&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+ke);this.recovering||(this.recovering=5)}if(this.recovering&&Hn){let Un=this.stoppedAt!=null&&Hn[0].pos>this.stoppedAt?Hn[0]:this.runRecovery(Hn,zn,$n);if(Un)return verbose&&console.log("Force-finish "+this.stackID(Un)),this.stackToTree(Un.forceAll())}if(this.recovering){let Un=this.recovering==1?1:this.recovering*3;if($n.length>Un)for($n.sort((qn,Xn)=>Xn.score-qn.score);$n.length>Un;)$n.pop();$n.some(qn=>qn.reducePos>ke)&&this.recovering--}else if($n.length>1){e:for(let Un=0;Un<$n.length-1;Un++){let qn=$n[Un];for(let Xn=Un+1;Xn<$n.length;Xn++){let Kn=$n[Xn];if(qn.sameState(Kn)||qn.buffer.length>500&&Kn.buffer.length>500)if((qn.score-Kn.score||qn.buffer.length-Kn.buffer.length)>0)$n.splice(Xn--,1);else{$n.splice(Un--,1);continue e}}}$n.length>12&&$n.splice(12,$n.length-12)}this.minStackPos=$n[0].pos;for(let Un=1;Un<$n.length;Un++)$n[Un].pos ":"";if(this.stoppedAt!=null&&Hn>this.stoppedAt)return Ce.forceReduce()?Ce:null;if(this.fragments){let Kn=Ce.curContext&&Ce.curContext.tracker.strict,to=Kn?Ce.curContext.hash:0;for(let io=this.fragments.nodeAt(Hn);io;){let uo=this.parser.nodeSet.types[io.type.id]==io.type?zn.getGoto(Ce.state,io.type.id):-1;if(uo>-1&&io.length&&(!Kn||(io.prop(NodeProp.contextHash)||0)==to))return Ce.useNode(io,uo),verbose&&console.log(Un+this.stackID(Ce)+` (via reuse of ${zn.getName(io.type.id)})`),!0;if(!(io instanceof Tree)||io.children.length==0||io.positions[0]>0)break;let ho=io.children[0];if(ho instanceof Tree&&io.positions[0]==0)io=ho;else break}}let qn=zn.stateSlot(Ce.state,4);if(qn>0)return Ce.reduce(qn),verbose&&console.log(Un+this.stackID(Ce)+` (via always-reduce ${zn.getName(qn&65535)})`),!0;if(Ce.stack.length>=8400)for(;Ce.stack.length>6e3&&Ce.forceReduce(););let Xn=this.tokens.getActions(Ce);for(let Kn=0;KnHn?ke.push(bo):$n.push(bo)}return!1}advanceFully(Ce,ke){let $n=Ce.pos;for(;;){if(!this.advanceStack(Ce,null,null))return!1;if(Ce.pos>$n)return pushStackDedup(Ce,ke),!0}}runRecovery(Ce,ke,$n){let Hn=null,zn=!1;for(let Un=0;Un ":"";if(qn.deadEnd&&(zn||(zn=!0,qn.restart(),verbose&&console.log(to+this.stackID(qn)+" (restarted)"),this.advanceFully(qn,$n))))continue;let io=qn.split(),uo=to;for(let ho=0;io.forceReduce()&&ho<10&&(verbose&&console.log(uo+this.stackID(io)+" (via force-reduce)"),!this.advanceFully(io,$n));ho++)verbose&&(uo=this.stackID(io)+" -> ");for(let ho of qn.recoverByInsert(Xn))verbose&&console.log(to+this.stackID(ho)+" (via recover-insert)"),this.advanceFully(ho,$n);this.stream.end>qn.pos?(Kn==qn.pos&&(Kn++,Xn=0),qn.recoverByDelete(Xn,Kn),verbose&&console.log(to+this.stackID(qn)+` (via recover-delete ${this.parser.getName(Xn)})`),pushStackDedup(qn,$n)):(!Hn||Hn.score_n;class ContextTracker{constructor(Ce){this.start=Ce.start,this.shift=Ce.shift||id,this.reduce=Ce.reduce||id,this.reuse=Ce.reuse||id,this.hash=Ce.hash||(()=>0),this.strict=Ce.strict!==!1}}class LRParser extends Parser{constructor(Ce){if(super(),this.wrappers=[],Ce.version!=14)throw new RangeError(`Parser version (${Ce.version}) doesn't match runtime version (14)`);let ke=Ce.nodeNames.split(" ");this.minRepeatTerm=ke.length;for(let qn=0;qnCe.topRules[qn][1]),Hn=[];for(let qn=0;qn=0)zn(to,Xn,qn[Kn++]);else{let io=qn[Kn+-to];for(let uo=-to;uo>0;uo--)zn(qn[Kn++],Xn,io);Kn++}}}this.nodeSet=new NodeSet(ke.map((qn,Xn)=>NodeType.define({name:Xn>=this.minRepeatTerm?void 0:qn,id:Xn,props:Hn[Xn],top:$n.indexOf(Xn)>-1,error:Xn==0,skipped:Ce.skippedNodes&&Ce.skippedNodes.indexOf(Xn)>-1}))),Ce.propSources&&(this.nodeSet=this.nodeSet.extend(...Ce.propSources)),this.strict=!1,this.bufferLength=DefaultBufferLength;let Un=decodeArray(Ce.tokenData);this.context=Ce.context,this.specializerSpecs=Ce.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let qn=0;qntypeof qn=="number"?new TokenGroup(Un,qn):qn),this.topRules=Ce.topRules,this.dialects=Ce.dialects||{},this.dynamicPrecedences=Ce.dynamicPrecedences||null,this.tokenPrecTable=Ce.tokenPrec,this.termNames=Ce.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(Ce,ke,$n){let Hn=new Parse(this,Ce,ke,$n);for(let zn of this.wrappers)Hn=zn(Hn,Ce,ke,$n);return Hn}getGoto(Ce,ke,$n=!1){let Hn=this.goto;if(ke>=Hn[0])return-1;for(let zn=Hn[ke+1];;){let Un=Hn[zn++],qn=Un&1,Xn=Hn[zn++];if(qn&&$n)return Xn;for(let Kn=zn+(Un>>1);zn0}validAction(Ce,ke){return!!this.allActions(Ce,$n=>$n==ke?!0:null)}allActions(Ce,ke){let $n=this.stateSlot(Ce,4),Hn=$n?ke($n):void 0;for(let zn=this.stateSlot(Ce,1);Hn==null;zn+=3){if(this.data[zn]==65535)if(this.data[zn+1]==1)zn=pair(this.data,zn+2);else break;Hn=ke(pair(this.data,zn+1))}return Hn}nextStates(Ce){let ke=[];for(let $n=this.stateSlot(Ce,1);;$n+=3){if(this.data[$n]==65535)if(this.data[$n+1]==1)$n=pair(this.data,$n+2);else break;if(!(this.data[$n+2]&1)){let Hn=this.data[$n+1];ke.some((zn,Un)=>Un&1&&zn==Hn)||ke.push(this.data[$n],Hn)}}return ke}configure(Ce){let ke=Object.assign(Object.create(LRParser.prototype),this);if(Ce.props&&(ke.nodeSet=this.nodeSet.extend(...Ce.props)),Ce.top){let $n=this.topRules[Ce.top];if(!$n)throw new RangeError(`Invalid top rule name ${Ce.top}`);ke.top=$n}return Ce.tokenizers&&(ke.tokenizers=this.tokenizers.map($n=>{let Hn=Ce.tokenizers.find(zn=>zn.from==$n);return Hn?Hn.to:$n})),Ce.specializers&&(ke.specializers=this.specializers.slice(),ke.specializerSpecs=this.specializerSpecs.map(($n,Hn)=>{let zn=Ce.specializers.find(qn=>qn.from==$n.external);if(!zn)return $n;let Un=Object.assign(Object.assign({},$n),{external:zn.to});return ke.specializers[Hn]=getSpecializer(Un),Un})),Ce.contextTracker&&(ke.context=Ce.contextTracker),Ce.dialect&&(ke.dialect=this.parseDialect(Ce.dialect)),Ce.strict!=null&&(ke.strict=Ce.strict),Ce.wrap&&(ke.wrappers=ke.wrappers.concat(Ce.wrap)),Ce.bufferLength!=null&&(ke.bufferLength=Ce.bufferLength),ke}hasWrappers(){return this.wrappers.length>0}getName(Ce){return this.termNames?this.termNames[Ce]:String(Ce<=this.maxNode&&this.nodeSet.types[Ce].name||Ce)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(Ce){let ke=this.dynamicPrecedences;return ke==null?0:ke[Ce]||0}parseDialect(Ce){let ke=Object.keys(this.dialects),$n=ke.map(()=>!1);if(Ce)for(let zn of Ce.split(" ")){let Un=ke.indexOf(zn);Un>=0&&($n[Un]=!0)}let Hn=null;for(let zn=0;zn$n)&&ke.p.parser.stateFlag(ke.state,2)&&(!Ce||Ce.score_n.external(ke,$n)<<1|Ce}return _n.get}const jsonHighlighting=styleTags({String:tags$1.string,Number:tags$1.number,"True False":tags$1.bool,PropertyName:tags$1.propertyName,Null:tags$1.null,",":tags$1.separator,"[ ]":tags$1.squareBracket,"{ }":tags$1.brace}),parser$4=LRParser.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[jsonHighlighting],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),jsonParseLinter=()=>_n=>{try{JSON.parse(_n.state.doc.toString())}catch(Ce){if(!(Ce instanceof SyntaxError))throw Ce;const ke=getErrorPosition(Ce,_n.state.doc);return[{from:ke,message:Ce.message,severity:"error",to:ke}]}return[]};function getErrorPosition(_n,Ce){let ke;return(ke=_n.message.match(/at position (\d+)/))?Math.min(+ke[1],Ce.length):(ke=_n.message.match(/at line (\d+) column (\d+)/))?Math.min(Ce.line(+ke[1]).from+ +ke[2]-1,Ce.length):0}const jsonLanguage=LRLanguage.define({name:"json",parser:parser$4.configure({props:[indentNodeProp.add({Object:continuedIndent({except:/^\s*\}/}),Array:continuedIndent({except:/^\s*\]/})}),foldNodeProp.add({"Object Array":foldInside})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function json(){return new LanguageSupport(jsonLanguage)}function create_fragment$i(_n){let Ce,ke;return{c(){Ce=element("div"),attr(Ce,"class",ke="is-editable-"+_n[0])},m($n,Hn){insert$1($n,Ce,Hn),_n[3](Ce)},p($n,[Hn]){Hn&1&&ke!==(ke="is-editable-"+$n[0])&&attr(Ce,"class",ke)},i:noop,o:noop,d($n){$n&&detach(Ce),_n[3](null)}}}function instance$i(_n,Ce,ke){let $n,Hn,{value:zn}=Ce,{editable:Un=!0}=Ce;onMount(()=>{let Xn=new Compartment,Kn=new Compartment,to=EditorState.create({doc:JSON.stringify(zn,null,4),extensions:[basicSetup,keymap.of([indentWithTab]),Xn.of(json()),json(),Kn.of(EditorState.tabSize.of(4)),lintGutter(),basicSetup,EditorView.editable.of(Un),EditorView.updateListener.of(function(io){io.docChanged&&ke(2,zn=io.state.doc.toString())}),linter(jsonParseLinter())]});Hn=new EditorView({state:to,parent:$n})}),onDestroy(()=>{Hn&&Hn.destroy()});function qn(Xn){binding_callbacks[Xn?"unshift":"push"](()=>{$n=Xn,ke(1,$n)})}return _n.$$set=Xn=>{"value"in Xn&&ke(2,zn=Xn.value),"editable"in Xn&&ke(0,Un=Xn.editable)},[Un,$n,zn,qn]}class Codemirror extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$i,create_fragment$i,safe_not_equal,{value:2,editable:0})}}function create_if_block$c(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[3]),attr(Ce,"class","invalid-feedback d-block")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,Hn){Hn&8&&set_data(ke,$n[3])},d($n){$n&&detach(Ce)}}}function create_fragment$h(_n){let Ce,ke,$n,Hn,zn;function Un(Kn){_n[5](Kn)}let qn={editable:!_n[1].readonly||_n[2]};_n[0]!==void 0&&(qn.value=_n[0]),ke=new Codemirror({props:qn}),binding_callbacks.push(()=>bind(ke,"value",Un));let Xn=_n[3]&&create_if_block$c(_n);return{c(){Ce=element("div"),create_component(ke.$$.fragment),Hn=space$3(),Xn&&Xn.c(),attr(Ce,"class","mb-3")},m(Kn,to){insert$1(Kn,Ce,to),mount_component(ke,Ce,null),append(Ce,Hn),Xn&&Xn.m(Ce,null),zn=!0},p(Kn,[to]){const io={};to&6&&(io.editable=!Kn[1].readonly||Kn[2]),!$n&&to&1&&($n=!0,io.value=Kn[0],add_flush_callback(()=>$n=!1)),ke.$set(io),Kn[3]?Xn?Xn.p(Kn,to):(Xn=create_if_block$c(Kn),Xn.c(),Xn.m(Ce,null)):Xn&&(Xn.d(1),Xn=null)},i(Kn){zn||(transition_in(ke.$$.fragment,Kn),zn=!0)},o(Kn){transition_out(ke.$$.fragment,Kn),zn=!1},d(Kn){Kn&&detach(Ce),destroy_component(ke),Xn&&Xn.d()}}}function instance$h(_n,Ce,ke){let $n,{value:Hn}=Ce,{field:zn}=Ce,{isCreateMode:Un}=Ce,{validationErrors:qn}=Ce;function Xn(Kn){Hn=Kn,ke(0,Hn)}return _n.$$set=Kn=>{"value"in Kn&&ke(0,Hn=Kn.value),"field"in Kn&&ke(1,zn=Kn.field),"isCreateMode"in Kn&&ke(2,Un=Kn.isCreateMode),"validationErrors"in Kn&&ke(4,qn=Kn.validationErrors)},_n.$$.update=()=>{_n.$$.dirty&18&&ke(3,$n=getErrorMessage(qn,zn.name))},[Hn,zn,Un,$n,qn,Xn]}let JSON$1=class extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$h,create_fragment$h,safe_not_equal,{value:0,field:1,isCreateMode:2,validationErrors:4})}};class CompositeBlock{static create(Ce,ke,$n,Hn,zn){let Un=Hn+(Hn<<8)+Ce+(ke<<4)|0;return new CompositeBlock(Ce,ke,$n,Un,zn,[],[])}constructor(Ce,ke,$n,Hn,zn,Un,qn){this.type=Ce,this.value=ke,this.from=$n,this.hash=Hn,this.end=zn,this.children=Un,this.positions=qn,this.hashProp=[[NodeProp.contextHash,Hn]]}addChild(Ce,ke){Ce.prop(NodeProp.contextHash)!=this.hash&&(Ce=new Tree(Ce.type,Ce.children,Ce.positions,Ce.length,this.hashProp)),this.children.push(Ce),this.positions.push(ke)}toTree(Ce,ke=this.end){let $n=this.children.length-1;return $n>=0&&(ke=Math.max(ke,this.positions[$n]+this.children[$n].length+this.from)),new Tree(Ce.types[this.type],this.children,this.positions,ke-this.from).balance({makeTree:(Hn,zn,Un)=>new Tree(NodeType.none,Hn,zn,Un,this.hashProp)})}}var Type;(function(_n){_n[_n.Document=1]="Document",_n[_n.CodeBlock=2]="CodeBlock",_n[_n.FencedCode=3]="FencedCode",_n[_n.Blockquote=4]="Blockquote",_n[_n.HorizontalRule=5]="HorizontalRule",_n[_n.BulletList=6]="BulletList",_n[_n.OrderedList=7]="OrderedList",_n[_n.ListItem=8]="ListItem",_n[_n.ATXHeading1=9]="ATXHeading1",_n[_n.ATXHeading2=10]="ATXHeading2",_n[_n.ATXHeading3=11]="ATXHeading3",_n[_n.ATXHeading4=12]="ATXHeading4",_n[_n.ATXHeading5=13]="ATXHeading5",_n[_n.ATXHeading6=14]="ATXHeading6",_n[_n.SetextHeading1=15]="SetextHeading1",_n[_n.SetextHeading2=16]="SetextHeading2",_n[_n.HTMLBlock=17]="HTMLBlock",_n[_n.LinkReference=18]="LinkReference",_n[_n.Paragraph=19]="Paragraph",_n[_n.CommentBlock=20]="CommentBlock",_n[_n.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",_n[_n.Escape=22]="Escape",_n[_n.Entity=23]="Entity",_n[_n.HardBreak=24]="HardBreak",_n[_n.Emphasis=25]="Emphasis",_n[_n.StrongEmphasis=26]="StrongEmphasis",_n[_n.Link=27]="Link",_n[_n.Image=28]="Image",_n[_n.InlineCode=29]="InlineCode",_n[_n.HTMLTag=30]="HTMLTag",_n[_n.Comment=31]="Comment",_n[_n.ProcessingInstruction=32]="ProcessingInstruction",_n[_n.Autolink=33]="Autolink",_n[_n.HeaderMark=34]="HeaderMark",_n[_n.QuoteMark=35]="QuoteMark",_n[_n.ListMark=36]="ListMark",_n[_n.LinkMark=37]="LinkMark",_n[_n.EmphasisMark=38]="EmphasisMark",_n[_n.CodeMark=39]="CodeMark",_n[_n.CodeText=40]="CodeText",_n[_n.CodeInfo=41]="CodeInfo",_n[_n.LinkTitle=42]="LinkTitle",_n[_n.LinkLabel=43]="LinkLabel",_n[_n.URL=44]="URL"})(Type||(Type={}));class LeafBlock{constructor(Ce,ke){this.start=Ce,this.content=ke,this.marks=[],this.parsers=[]}}class Line{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let Ce=this.skipSpace(this.basePos);this.indent=this.countIndent(Ce,this.pos,this.indent),this.pos=Ce,this.next=Ce==this.text.length?-1:this.text.charCodeAt(Ce)}skipSpace(Ce){return skipSpace(this.text,Ce)}reset(Ce){for(this.text=Ce,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(Ce){this.basePos=Ce,this.baseIndent=this.countIndent(Ce,this.pos,this.indent)}moveBaseColumn(Ce){this.baseIndent=Ce,this.basePos=this.findColumn(Ce)}addMarker(Ce){this.markers.push(Ce)}countIndent(Ce,ke=0,$n=0){for(let Hn=ke;Hn=Ce.stack[ke.depth+1].value+ke.baseIndent)return!0;if(ke.indent>=ke.baseIndent+4)return!1;let $n=(_n.type==Type.OrderedList?isOrderedList:isBulletList)(ke,Ce,!1);return $n>0&&(_n.type!=Type.BulletList||isHorizontalRule(ke,Ce,!1)<0)&&ke.text.charCodeAt(ke.pos+$n-1)==_n.value}const DefaultSkipMarkup={[Type.Blockquote](_n,Ce,ke){return ke.next!=62?!1:(ke.markers.push(elt(Type.QuoteMark,Ce.lineStart+ke.pos,Ce.lineStart+ke.pos+1)),ke.moveBase(ke.pos+(space$2(ke.text.charCodeAt(ke.pos+1))?2:1)),_n.end=Ce.lineStart+ke.text.length,!0)},[Type.ListItem](_n,Ce,ke){return ke.indent-1?!1:(ke.moveBaseColumn(ke.baseIndent+_n.value),!0)},[Type.OrderedList]:skipForList,[Type.BulletList]:skipForList,[Type.Document](){return!0}};function space$2(_n){return _n==32||_n==9||_n==10||_n==13}function skipSpace(_n,Ce=0){for(;Ce<_n.length&&space$2(_n.charCodeAt(Ce));)Ce++;return Ce}function skipSpaceBack(_n,Ce,ke){for(;Ce>ke&&space$2(_n.charCodeAt(Ce-1));)Ce--;return Ce}function isFencedCode(_n){if(_n.next!=96&&_n.next!=126)return-1;let Ce=_n.pos+1;for(;Ce<_n.text.length&&_n.text.charCodeAt(Ce)==_n.next;)Ce++;if(Ce<_n.pos+3)return-1;if(_n.next==96){for(let ke=Ce;ke<_n.text.length;ke++)if(_n.text.charCodeAt(ke)==96)return-1}return Ce}function isBlockquote(_n){return _n.next!=62?-1:_n.text.charCodeAt(_n.pos+1)==32?2:1}function isHorizontalRule(_n,Ce,ke){if(_n.next!=42&&_n.next!=45&&_n.next!=95)return-1;let $n=1;for(let Hn=_n.pos+1;Hn<_n.text.length;Hn++){let zn=_n.text.charCodeAt(Hn);if(zn==_n.next)$n++;else if(!space$2(zn))return-1}return ke&&_n.next==45&&isSetextUnderline(_n)>-1&&_n.depth==Ce.stack.length||$n<3?-1:1}function inList(_n,Ce){for(let ke=_n.stack.length-1;ke>=0;ke--)if(_n.stack[ke].type==Ce)return!0;return!1}function isBulletList(_n,Ce,ke){return(_n.next==45||_n.next==43||_n.next==42)&&(_n.pos==_n.text.length-1||space$2(_n.text.charCodeAt(_n.pos+1)))&&(!ke||inList(Ce,Type.BulletList)||_n.skipSpace(_n.pos+2)<_n.text.length)?1:-1}function isOrderedList(_n,Ce,ke){let $n=_n.pos,Hn=_n.next;for(;Hn>=48&&Hn<=57;){$n++;if($n==_n.text.length)return-1;Hn=_n.text.charCodeAt($n)}return $n==_n.pos||$n>_n.pos+9||Hn!=46&&Hn!=41||$n<_n.text.length-1&&!space$2(_n.text.charCodeAt($n+1))||ke&&!inList(Ce,Type.OrderedList)&&(_n.skipSpace($n+1)==_n.text.length||$n>_n.pos+1||_n.next!=49)?-1:$n+1-_n.pos}function isAtxHeading(_n){if(_n.next!=35)return-1;let Ce=_n.pos+1;for(;Ce<_n.text.length&&_n.text.charCodeAt(Ce)==35;)Ce++;if(Ce<_n.text.length&&_n.text.charCodeAt(Ce)!=32)return-1;let ke=Ce-_n.pos;return ke>6?-1:ke}function isSetextUnderline(_n){if(_n.next!=45&&_n.next!=61||_n.indent>=_n.baseIndent+4)return-1;let Ce=_n.pos+1;for(;Ce<_n.text.length&&_n.text.charCodeAt(Ce)==_n.next;)Ce++;let ke=Ce;for(;Ce<_n.text.length&&space$2(_n.text.charCodeAt(Ce));)Ce++;return Ce==_n.text.length?ke:-1}const EmptyLine=/^[ \t]*$/,CommentEnd=/-->/,ProcessingEnd=/\?>/,HTMLBlockStyle=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec($n);if(zn)return _n.append(elt(Type.Comment,ke,ke+1+zn[0].length));let Un=/^\?[^]*?\?>/.exec($n);if(Un)return _n.append(elt(Type.ProcessingInstruction,ke,ke+1+Un[0].length));let qn=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec($n);return qn?_n.append(elt(Type.HTMLTag,ke,ke+1+qn[0].length)):-1},Emphasis(_n,Ce,ke){if(Ce!=95&&Ce!=42)return-1;let $n=ke+1;for(;_n.char($n)==Ce;)$n++;let Hn=_n.slice(ke-1,ke),zn=_n.slice($n,$n+1),Un=Punctuation.test(Hn),qn=Punctuation.test(zn),Xn=/\s|^$/.test(Hn),Kn=/\s|^$/.test(zn),to=!Kn&&(!qn||Xn||Un),io=!Xn&&(!Un||Kn||qn),uo=to&&(Ce==42||!io||Un),ho=io&&(Ce==42||!to||qn);return _n.append(new InlineDelimiter(Ce==95?EmphasisUnderscore:EmphasisAsterisk,ke,$n,(uo?1:0)|(ho?2:0)))},HardBreak(_n,Ce,ke){if(Ce==92&&_n.char(ke+1)==10)return _n.append(elt(Type.HardBreak,ke,ke+2));if(Ce==32){let $n=ke+1;for(;_n.char($n)==32;)$n++;if(_n.char($n)==10&&$n>=ke+2)return _n.append(elt(Type.HardBreak,ke,$n+1))}return-1},Link(_n,Ce,ke){return Ce==91?_n.append(new InlineDelimiter(LinkStart,ke,ke+1,1)):-1},Image(_n,Ce,ke){return Ce==33&&_n.char(ke+1)==91?_n.append(new InlineDelimiter(ImageStart,ke,ke+2,1)):-1},LinkEnd(_n,Ce,ke){if(Ce!=93)return-1;for(let $n=_n.parts.length-1;$n>=0;$n--){let Hn=_n.parts[$n];if(Hn instanceof InlineDelimiter&&(Hn.type==LinkStart||Hn.type==ImageStart)){if(!Hn.side||_n.skipSpace(Hn.to)==ke&&!/[(\[]/.test(_n.slice(ke+1,ke+2)))return _n.parts[$n]=null,-1;let zn=_n.takeContent($n),Un=_n.parts[$n]=finishLink(_n,zn,Hn.type==LinkStart?Type.Link:Type.Image,Hn.from,ke+1);if(Hn.type==LinkStart)for(let qn=0;qn<$n;qn++){let Xn=_n.parts[qn];Xn instanceof InlineDelimiter&&Xn.type==LinkStart&&(Xn.side=0)}return Un.to}}return-1}};function finishLink(_n,Ce,ke,$n,Hn){let{text:zn}=_n,Un=_n.char(Hn),qn=Hn;if(Ce.unshift(elt(Type.LinkMark,$n,$n+(ke==Type.Image?2:1))),Ce.push(elt(Type.LinkMark,Hn-1,Hn)),Un==40){let Xn=_n.skipSpace(Hn+1),Kn=parseURL(zn,Xn-_n.offset,_n.offset),to;Kn&&(Xn=_n.skipSpace(Kn.to),Xn!=Kn.to&&(to=parseLinkTitle(zn,Xn-_n.offset,_n.offset),to&&(Xn=_n.skipSpace(to.to)))),_n.char(Xn)==41&&(Ce.push(elt(Type.LinkMark,Hn,Hn+1)),qn=Xn+1,Kn&&Ce.push(Kn),to&&Ce.push(to),Ce.push(elt(Type.LinkMark,Xn,qn)))}else if(Un==91){let Xn=parseLinkLabel(zn,Hn-_n.offset,_n.offset,!1);Xn&&(Ce.push(Xn),qn=Xn.to)}return elt(ke,$n,qn,Ce)}function parseURL(_n,Ce,ke){if(_n.charCodeAt(Ce)==60){for(let Hn=Ce+1;Hn<_n.length;Hn++){let zn=_n.charCodeAt(Hn);if(zn==62)return elt(Type.URL,Ce+ke,Hn+1+ke);if(zn==60||zn==10)return!1}return null}else{let Hn=0,zn=Ce;for(let Un=!1;zn<_n.length;zn++){let qn=_n.charCodeAt(zn);if(space$2(qn))break;if(Un)Un=!1;else if(qn==40)Hn++;else if(qn==41){if(!Hn)break;Hn--}else qn==92&&(Un=!0)}return zn>Ce?elt(Type.URL,Ce+ke,zn+ke):zn==_n.length?null:!1}}function parseLinkTitle(_n,Ce,ke){let $n=_n.charCodeAt(Ce);if($n!=39&&$n!=34&&$n!=40)return!1;let Hn=$n==40?41:$n;for(let zn=Ce+1,Un=!1;zn<_n.length;zn++){let qn=_n.charCodeAt(zn);if(Un)Un=!1;else{if(qn==Hn)return elt(Type.LinkTitle,Ce+ke,zn+1+ke);qn==92&&(Un=!0)}}return null}function parseLinkLabel(_n,Ce,ke,$n){for(let Hn=!1,zn=Ce+1,Un=Math.min(_n.length,zn+999);zn=this.end?-1:this.text.charCodeAt(Ce-this.offset)}get end(){return this.offset+this.text.length}slice(Ce,ke){return this.text.slice(Ce-this.offset,ke-this.offset)}append(Ce){return this.parts.push(Ce),Ce.to}addDelimiter(Ce,ke,$n,Hn,zn){return this.append(new InlineDelimiter(Ce,ke,$n,(Hn?1:0)|(zn?2:0)))}get hasOpenLink(){for(let Ce=this.parts.length-1;Ce>=0;Ce--){let ke=this.parts[Ce];if(ke instanceof InlineDelimiter&&(ke.type==LinkStart||ke.type==ImageStart))return!0}return!1}addElement(Ce){return this.append(Ce)}resolveMarkers(Ce){for(let $n=Ce;$n=Ce;Xn--){let Oo=this.parts[Xn];if(Oo instanceof InlineDelimiter&&Oo.side&1&&Oo.type==Hn.type&&!(zn&&(Hn.side&1||Oo.side&2)&&(Oo.to-Oo.from+Un)%3==0&&((Oo.to-Oo.from)%3||Un%3))){qn=Oo;break}}if(!qn)continue;let Kn=Hn.type.resolve,to=[],io=qn.from,uo=Hn.to;if(zn){let Oo=Math.min(2,qn.to-qn.from,Un);io=qn.to-Oo,uo=Hn.from+Oo,Kn=Oo==1?"Emphasis":"StrongEmphasis"}qn.type.mark&&to.push(this.elt(qn.type.mark,io,qn.to));for(let Oo=Xn+1;Oo<$n;Oo++)this.parts[Oo]instanceof Element$2&&to.push(this.parts[Oo]),this.parts[Oo]=null;Hn.type.mark&&to.push(this.elt(Hn.type.mark,Hn.from,uo));let ho=this.elt(Kn,io,uo,to);this.parts[Xn]=zn&&qn.from!=io?new InlineDelimiter(qn.type,qn.from,io,qn.side):null,(this.parts[$n]=zn&&Hn.to!=uo?new InlineDelimiter(Hn.type,uo,Hn.to,Hn.side):null)?this.parts.splice($n,0,ho):this.parts[$n]=ho}let ke=[];for(let $n=Ce;$n=0;ke--){let $n=this.parts[ke];if($n instanceof InlineDelimiter&&$n.type==Ce)return ke}return null}takeContent(Ce){let ke=this.resolveMarkers(Ce);return this.parts.length=Ce,ke}skipSpace(Ce){return skipSpace(this.text,Ce-this.offset)+this.offset}elt(Ce,ke,$n,Hn){return typeof Ce=="string"?elt(this.parser.getNodeType(Ce),ke,$n,Hn):new TreeElement(Ce,ke)}}function injectMarks(_n,Ce){if(!Ce.length)return _n;if(!_n.length)return Ce;let ke=_n.slice(),$n=0;for(let Hn of Ce){for(;$n(Ce?Ce-1:0))return!1;if(this.fragmentEnd<0){let zn=this.fragment.to;for(;zn>0&&this.input.read(zn-1,zn)!=` +`;)zn--;this.fragmentEnd=zn?zn-1:0}let $n=this.cursor;$n||($n=this.cursor=this.fragment.tree.cursor(),$n.firstChild());let Hn=Ce+this.fragment.offset;for(;$n.to<=Hn;)if(!$n.parent())return!1;for(;;){if($n.from>=Hn)return this.fragment.from<=ke;if(!$n.childAfter(Hn))return!1}}matches(Ce){let ke=this.cursor.tree;return ke&&ke.prop(NodeProp.contextHash)==Ce}takeNodes(Ce){let ke=this.cursor,$n=this.fragment.offset,Hn=this.fragmentEnd-(this.fragment.openEnd?1:0),zn=Ce.absoluteLineStart,Un=zn,qn=Ce.block.children.length,Xn=Un,Kn=qn;for(;;){if(ke.to-$n>Hn){if(ke.type.isAnonymous&&ke.firstChild())continue;break}let to=toRelative(ke.from-$n,Ce.ranges);if(ke.to-$n<=Ce.ranges[Ce.rangeI].to)Ce.addNode(ke.tree,to);else{let io=new Tree(Ce.parser.nodeSet.types[Type.Paragraph],[],[],0,Ce.block.hashProp);Ce.reusePlaceholders.set(io,ke.tree),Ce.addNode(io,to)}if(ke.type.is("Block")&&(NotLast.indexOf(ke.type.id)<0?(Un=ke.to-$n,qn=Ce.block.children.length):(Un=Xn,qn=Kn,Xn=ke.to-$n,Kn=Ce.block.children.length)),!ke.nextSibling())break}for(;Ce.block.children.length>qn;)Ce.block.children.pop(),Ce.block.positions.pop();return Un-zn}}function toRelative(_n,Ce){let ke=_n;for(let $n=1;$nDefaultBlockParsers[_n]),Object.keys(DefaultBlockParsers).map(_n=>DefaultLeafBlocks[_n]),Object.keys(DefaultBlockParsers),DefaultEndLeaf,DefaultSkipMarkup,Object.keys(DefaultInline).map(_n=>DefaultInline[_n]),Object.keys(DefaultInline),[]);function leftOverSpace(_n,Ce,ke){let $n=[];for(let Hn=_n.firstChild,zn=Ce;;Hn=Hn.nextSibling){let Un=Hn?Hn.from:ke;if(Un>zn&&$n.push({from:zn,to:Un}),!Hn)break;zn=Hn.to}return $n}function parseCode(_n){let{codeParser:Ce,htmlParser:ke}=_n;return{wrap:parseMixed((Hn,zn)=>{let Un=Hn.type.id;if(Ce&&(Un==Type.CodeBlock||Un==Type.FencedCode)){let qn="";if(Un==Type.FencedCode){let Kn=Hn.node.getChild(Type.CodeInfo);Kn&&(qn=zn.read(Kn.from,Kn.to))}let Xn=Ce(qn);if(Xn)return{parser:Xn,overlay:Kn=>Kn.type.id==Type.CodeText}}else if(ke&&(Un==Type.HTMLBlock||Un==Type.HTMLTag))return{parser:ke,overlay:leftOverSpace(Hn.node,Hn.from,Hn.to)};return null})}}const StrikethroughDelim={resolve:"Strikethrough",mark:"StrikethroughMark"},Strikethrough={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":tags$1.strikethrough}},{name:"StrikethroughMark",style:tags$1.processingInstruction}],parseInline:[{name:"Strikethrough",parse(_n,Ce,ke){if(Ce!=126||_n.char(ke+1)!=126||_n.char(ke+2)==126)return-1;let $n=_n.slice(ke-1,ke),Hn=_n.slice(ke+2,ke+3),zn=/\s|^$/.test($n),Un=/\s|^$/.test(Hn),qn=Punctuation.test($n),Xn=Punctuation.test(Hn);return _n.addDelimiter(StrikethroughDelim,ke,ke+2,!Un&&(!Xn||zn||qn),!zn&&(!qn||Un||Xn))},after:"Emphasis"}]};function parseRow(_n,Ce,ke=0,$n,Hn=0){let zn=0,Un=!0,qn=-1,Xn=-1,Kn=!1,to=()=>{$n.push(_n.elt("TableCell",Hn+qn,Hn+Xn,_n.parser.parseInline(Ce.slice(qn,Xn),Hn+qn)))};for(let io=ke;io-1)&&zn++,Un=!1,$n&&(qn>-1&&to(),$n.push(_n.elt("TableDelimiter",io+Hn,io+Hn+1))),qn=Xn=-1):(Kn||uo!=32&&uo!=9)&&(qn<0&&(qn=io),Xn=io+1),Kn=!Kn&&uo==92}return qn>-1&&(zn++,$n&&to()),zn}function hasPipe(_n,Ce){for(let ke=Ce;ke<_n.length;ke++){let $n=_n.charCodeAt(ke);if($n==124)return!0;$n==92&&ke++}return!1}const delimiterLine=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class TableParser{constructor(){this.rows=null}nextLine(Ce,ke,$n){if(this.rows==null){this.rows=!1;let Hn;if((ke.next==45||ke.next==58||ke.next==124)&&delimiterLine.test(Hn=ke.text.slice(ke.pos))){let zn=[];parseRow(Ce,$n.content,0,zn,$n.start)==parseRow(Ce,Hn,ke.pos)&&(this.rows=[Ce.elt("TableHeader",$n.start,$n.start+$n.content.length,zn),Ce.elt("TableDelimiter",Ce.lineStart+ke.pos,Ce.lineStart+ke.text.length)])}}else if(this.rows){let Hn=[];parseRow(Ce,ke.text,ke.pos,Hn,Ce.lineStart),this.rows.push(Ce.elt("TableRow",Ce.lineStart+ke.pos,Ce.lineStart+ke.text.length,Hn))}return!1}finish(Ce,ke){return this.rows?(Ce.addLeafElement(ke,Ce.elt("Table",ke.start,ke.start+ke.content.length,this.rows)),!0):!1}}const Table={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":tags$1.heading}},"TableRow",{name:"TableCell",style:tags$1.content},{name:"TableDelimiter",style:tags$1.processingInstruction}],parseBlock:[{name:"Table",leaf(_n,Ce){return hasPipe(Ce.content,0)?new TableParser:null},endLeaf(_n,Ce,ke){if(ke.parsers.some(Hn=>Hn instanceof TableParser)||!hasPipe(Ce.text,Ce.basePos))return!1;let $n=_n.scanLine(_n.absoluteLineEnd+1).text;return delimiterLine.test($n)&&parseRow(_n,Ce.text,Ce.basePos)==parseRow(_n,$n,Ce.basePos)},before:"SetextHeading"}]};class TaskParser{nextLine(){return!1}finish(Ce,ke){return Ce.addLeafElement(ke,Ce.elt("Task",ke.start,ke.start+ke.content.length,[Ce.elt("TaskMarker",ke.start,ke.start+3),...Ce.parser.parseInline(ke.content.slice(3),ke.start+3)])),!0}}const TaskList={defineNodes:[{name:"Task",block:!0,style:tags$1.list},{name:"TaskMarker",style:tags$1.atom}],parseBlock:[{name:"TaskList",leaf(_n,Ce){return/^\[[ xX]\][ \t]/.test(Ce.content)&&_n.parentType().name=="ListItem"?new TaskParser:null},after:"SetextHeading"}]},autolinkRE=/(www\.)|(https?:\/\/)|([\w.+-]+@)|(mailto:|xmpp:)/gy,urlRE=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,lastTwoDomainWords=/[\w-]+\.[\w-]+($|\/)/,emailRE=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,xmppResourceRE=/\/[a-zA-Z\d@.]+/gy;function count(_n,Ce,ke,$n){let Hn=0;for(let zn=Ce;zn-1)return-1;let $n=Ce+ke[0].length;for(;;){let Hn=_n[$n-1],zn;if(/[?!.,:*_~]/.test(Hn)||Hn==")"&&count(_n,Ce,$n,")")>count(_n,Ce,$n,"("))$n--;else if(Hn==";"&&(zn=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(_n.slice(Ce,$n))))$n=Ce+zn.index;else break}return $n}function autolinkEmailEnd(_n,Ce){emailRE.lastIndex=Ce;let ke=emailRE.exec(_n);if(!ke)return-1;let $n=ke[0][ke[0].length-1];return $n=="_"||$n=="-"?-1:Ce+ke[0].length-($n=="."?1:0)}const Autolink={parseInline:[{name:"Autolink",parse(_n,Ce,ke){let $n=ke-_n.offset;autolinkRE.lastIndex=$n;let Hn=autolinkRE.exec(_n.text),zn=-1;if(!Hn)return-1;if(Hn[1]||Hn[2]){if(zn=autolinkURLEnd(_n.text,$n+Hn[0].length),zn>-1&&_n.hasOpenLink){let Un=/([^\[\]]|\[[^\]]*\])*/.exec(_n.text.slice($n,zn));zn=$n+Un[0].length}}else Hn[3]?zn=autolinkEmailEnd(_n.text,$n):(zn=autolinkEmailEnd(_n.text,$n+Hn[0].length),zn>-1&&Hn[0]=="xmpp:"&&(xmppResourceRE.lastIndex=zn,Hn=xmppResourceRE.exec(_n.text),Hn&&(zn=Hn.index+Hn[0].length)));return zn<0?-1:(_n.addElement(_n.elt("URL",ke,zn+_n.offset)),zn+_n.offset)}}]},GFM=[Table,TaskList,Strikethrough,Autolink];function parseSubSuper(_n,Ce,ke){return($n,Hn,zn)=>{if(Hn!=_n||$n.char(zn+1)==_n)return-1;let Un=[$n.elt(ke,zn,zn+1)];for(let qn=zn+1;qn<$n.end;qn++){let Xn=$n.char(qn);if(Xn==_n)return $n.addElement($n.elt(Ce,zn,qn+1,Un.concat($n.elt(ke,qn,qn+1))));if(Xn==92&&Un.push($n.elt("Escape",qn,qn+++2)),space$2(Xn))break}return-1}}const Superscript={defineNodes:[{name:"Superscript",style:tags$1.special(tags$1.content)},{name:"SuperscriptMark",style:tags$1.processingInstruction}],parseInline:[{name:"Superscript",parse:parseSubSuper(94,"Superscript","SuperscriptMark")}]},Subscript={defineNodes:[{name:"Subscript",style:tags$1.special(tags$1.content)},{name:"SubscriptMark",style:tags$1.processingInstruction}],parseInline:[{name:"Subscript",parse:parseSubSuper(126,"Subscript","SubscriptMark")}]},Emoji={defineNodes:[{name:"Emoji",style:tags$1.character}],parseInline:[{name:"Emoji",parse(_n,Ce,ke){let $n;return Ce!=58||!($n=/^[a-zA-Z_0-9]+:/.exec(_n.slice(ke+1,_n.end)))?-1:_n.addElement(_n.elt("Emoji",ke,ke+1+$n[0].length))}}]},scriptText=54,StartCloseScriptTag=1,styleText=55,StartCloseStyleTag=2,textareaText=56,StartCloseTextareaTag=3,EndTag=4,SelfClosingEndTag=5,StartTag=6,StartScriptTag=7,StartStyleTag=8,StartTextareaTag=9,StartSelfClosingTag=10,StartCloseTag=11,NoMatchStartCloseTag=12,MismatchedStartCloseTag=13,missingCloseTag=57,IncompleteCloseTag=14,commentContent$1=58,Element$1=20,TagName=22,Attribute=23,AttributeName=24,AttributeValue=26,UnquotedAttributeValue=27,ScriptText=28,StyleText=31,TextareaText=34,OpenTag=36,CloseTag=37,Dialect_noMatch=0,Dialect_selfClosing=1,selfClosers$1={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},closeOnOpen={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function nameChar(_n){return _n==45||_n==46||_n==58||_n>=65&&_n<=90||_n==95||_n>=97&&_n<=122||_n>=161}function isSpace(_n){return _n==9||_n==10||_n==13||_n==32}let cachedName=null,cachedInput=null,cachedPos=0;function tagNameAfter(_n,Ce){let ke=_n.pos+Ce;if(cachedPos==ke&&cachedInput==_n)return cachedName;let $n=_n.peek(Ce);for(;isSpace($n);)$n=_n.peek(++Ce);let Hn="";for(;nameChar($n);)Hn+=String.fromCharCode($n),$n=_n.peek(++Ce);return cachedInput=_n,cachedPos=ke,cachedName=Hn?Hn.toLowerCase():$n==question$1||$n==bang?void 0:null}const lessThan=60,greaterThan=62,slash$1=47,question$1=63,bang=33,dash$1=45;function ElementContext(_n,Ce){this.name=_n,this.parent=Ce}const startTagTerms=[StartTag,StartSelfClosingTag,StartScriptTag,StartStyleTag,StartTextareaTag],elementContext=new ContextTracker({start:null,shift(_n,Ce,ke,$n){return startTagTerms.indexOf(Ce)>-1?new ElementContext(tagNameAfter($n,1)||"",_n):_n},reduce(_n,Ce){return Ce==Element$1&&_n?_n.parent:_n},reuse(_n,Ce,ke,$n){let Hn=Ce.type.id;return Hn==StartTag||Hn==OpenTag?new ElementContext(tagNameAfter($n,1)||"",_n):_n},strict:!1}),tagStart=new ExternalTokenizer((_n,Ce)=>{if(_n.next!=lessThan){_n.next<0&&Ce.context&&_n.acceptToken(missingCloseTag);return}_n.advance();let ke=_n.next==slash$1;ke&&_n.advance();let $n=tagNameAfter(_n,0);if($n===void 0)return;if(!$n)return _n.acceptToken(ke?IncompleteCloseTag:StartTag);let Hn=Ce.context?Ce.context.name:null;if(ke){if($n==Hn)return _n.acceptToken(StartCloseTag);if(Hn&&implicitlyClosed[Hn])return _n.acceptToken(missingCloseTag,-2);if(Ce.dialectEnabled(Dialect_noMatch))return _n.acceptToken(NoMatchStartCloseTag);for(let zn=Ce.context;zn;zn=zn.parent)if(zn.name==$n)return;_n.acceptToken(MismatchedStartCloseTag)}else{if($n=="script")return _n.acceptToken(StartScriptTag);if($n=="style")return _n.acceptToken(StartStyleTag);if($n=="textarea")return _n.acceptToken(StartTextareaTag);if(selfClosers$1.hasOwnProperty($n))return _n.acceptToken(StartSelfClosingTag);Hn&&closeOnOpen[Hn]&&closeOnOpen[Hn][$n]?_n.acceptToken(missingCloseTag,-1):_n.acceptToken(StartTag)}},{contextual:!0}),commentContent=new ExternalTokenizer(_n=>{for(let Ce=0,ke=0;;ke++){if(_n.next<0){ke&&_n.acceptToken(commentContent$1);break}if(_n.next==dash$1)Ce++;else if(_n.next==greaterThan&&Ce>=2){ke>=3&&_n.acceptToken(commentContent$1,-2);break}else Ce=0;_n.advance()}});function inForeignElement(_n){for(;_n;_n=_n.parent)if(_n.name=="svg"||_n.name=="math")return!0;return!1}const endTag=new ExternalTokenizer((_n,Ce)=>{if(_n.next==slash$1&&_n.peek(1)==greaterThan){let ke=Ce.dialectEnabled(Dialect_selfClosing)||inForeignElement(Ce.context);_n.acceptToken(ke?SelfClosingEndTag:EndTag,2)}else _n.next==greaterThan&&_n.acceptToken(EndTag,1)});function contentTokenizer(_n,Ce,ke){let $n=2+_n.length;return new ExternalTokenizer(Hn=>{for(let zn=0,Un=0,qn=0;;qn++){if(Hn.next<0){qn&&Hn.acceptToken(Ce);break}if(zn==0&&Hn.next==lessThan||zn==1&&Hn.next==slash$1||zn>=2&&zn<$n&&Hn.next==_n.charCodeAt(zn-2))zn++,Un++;else if((zn==2||zn==$n)&&isSpace(Hn.next))Un++;else if(zn==$n&&Hn.next==greaterThan){qn>Un?Hn.acceptToken(Ce,-Un):Hn.acceptToken(ke,-(Un-2));break}else if((Hn.next==10||Hn.next==13)&&qn){Hn.acceptToken(Ce,1);break}else zn=Un=0;Hn.advance()}})}const scriptTokens=contentTokenizer("script",scriptText,StartCloseScriptTag),styleTokens=contentTokenizer("style",styleText,StartCloseStyleTag),textareaTokens=contentTokenizer("textarea",textareaText,StartCloseTextareaTag),htmlHighlighting=styleTags({"Text RawText":tags$1.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":tags$1.angleBracket,TagName:tags$1.tagName,"MismatchedCloseTag/TagName":[tags$1.tagName,tags$1.invalid],AttributeName:tags$1.attributeName,"AttributeValue UnquotedAttributeValue":tags$1.attributeValue,Is:tags$1.definitionOperator,"EntityReference CharacterReference":tags$1.character,Comment:tags$1.blockComment,ProcessingInst:tags$1.processingInstruction,DoctypeDecl:tags$1.documentMeta}),parser$2=LRParser.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:elementContext,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[htmlHighlighting],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Kn=qn.type.id;if(Kn==ScriptText)return maybeNest(qn,Xn,ke);if(Kn==StyleText)return maybeNest(qn,Xn,$n);if(Kn==TextareaText)return maybeNest(qn,Xn,Hn);if(Kn==Element$1&&zn.length){let to=qn.node,io=to.firstChild,uo=io&&findTagName(io,Xn),ho;if(uo){for(let bo of zn)if(bo.tag==uo&&(!bo.attrs||bo.attrs(ho||(ho=getAttrs(io,Xn))))){let Oo=to.lastChild,So=Oo.type.id==CloseTag?Oo.from:to.to;if(So>io.to)return{parser:bo.parser,overlay:[{from:io.to,to:So}]}}}}if(Un&&Kn==Attribute){let to=qn.node,io;if(io=to.firstChild){let uo=Un[Xn.read(io.from,io.to)];if(uo)for(let ho of uo){if(ho.tagName&&ho.tagName!=findTagName(to.parent,Xn))continue;let bo=to.lastChild;if(bo.type.id==AttributeValue){let Oo=bo.from+1,So=bo.lastChild,$o=bo.to-(So&&So.isError?0:1);if($o>Oo)return{parser:ho.parser,overlay:[{from:Oo,to:$o}]}}else if(bo.type.id==UnquotedAttributeValue)return{parser:ho.parser,overlay:[{from:bo.from,to:bo.to}]}}}}return null})}const descendantOp=99,Unit=1,callee=100,identifier$2=101,VariableName=2,space$1=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],colon=58,parenL=40,underscore=95,bracketL=91,dash=45,period=46,hash=35,percent=37,ampersand=38,backslash=92,newline$1=10;function isAlpha(_n){return _n>=65&&_n<=90||_n>=97&&_n<=122||_n>=161}function isDigit(_n){return _n>=48&&_n<=57}const identifiers=new ExternalTokenizer((_n,Ce)=>{for(let ke=!1,$n=0,Hn=0;;Hn++){let{next:zn}=_n;if(isAlpha(zn)||zn==dash||zn==underscore||ke&&isDigit(zn))!ke&&(zn!=dash||Hn>0)&&(ke=!0),$n===Hn&&zn==dash&&$n++,_n.advance();else if(zn==backslash&&_n.peek(1)!=newline$1)_n.advance(),_n.next>-1&&_n.advance(),ke=!0;else{ke&&_n.acceptToken(zn==parenL?callee:$n==2&&Ce.canShift(VariableName)?VariableName:identifier$2);break}}}),descendant=new ExternalTokenizer(_n=>{if(space$1.includes(_n.peek(-1))){let{next:Ce}=_n;(isAlpha(Ce)||Ce==underscore||Ce==hash||Ce==period||Ce==bracketL||Ce==colon&&isAlpha(_n.peek(1))||Ce==dash||Ce==ampersand)&&_n.acceptToken(descendantOp)}}),unitToken=new ExternalTokenizer(_n=>{if(!space$1.includes(_n.peek(-1))){let{next:Ce}=_n;if(Ce==percent&&(_n.advance(),_n.acceptToken(Unit)),isAlpha(Ce)){do _n.advance();while(isAlpha(_n.next)||isDigit(_n.next));_n.acceptToken(Unit)}}}),cssHighlighting=styleTags({"AtKeyword import charset namespace keyframes media supports":tags$1.definitionKeyword,"from to selector":tags$1.keyword,NamespaceName:tags$1.namespace,KeyframeName:tags$1.labelName,KeyframeRangeName:tags$1.operatorKeyword,TagName:tags$1.tagName,ClassName:tags$1.className,PseudoClassName:tags$1.constant(tags$1.className),IdName:tags$1.labelName,"FeatureName PropertyName":tags$1.propertyName,AttributeName:tags$1.attributeName,NumberLiteral:tags$1.number,KeywordQuery:tags$1.keyword,UnaryQueryOp:tags$1.operatorKeyword,"CallTag ValueName":tags$1.atom,VariableName:tags$1.variableName,Callee:tags$1.operatorKeyword,Unit:tags$1.unit,"UniversalSelector NestingSelector":tags$1.definitionOperator,MatchOp:tags$1.compareOperator,"ChildOp SiblingOp, LogicOp":tags$1.logicOperator,BinOp:tags$1.arithmeticOperator,Important:tags$1.modifier,Comment:tags$1.blockComment,ColorLiteral:tags$1.color,"ParenthesizedContent StringLiteral":tags$1.string,":":tags$1.punctuation,"PseudoOp #":tags$1.derefOperator,"; ,":tags$1.separator,"( )":tags$1.paren,"[ ]":tags$1.squareBracket,"{ }":tags$1.brace}),spec_callee={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},spec_AtKeyword={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},spec_identifier$1={__proto__:null,not:132,only:132},parser$1=LRParser.deserialize({version:14,states:":^QYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO${QdO,59}O-kQ[O'#E^O-xQWO,5;_O-xQWO,5;_POOO'#EV'#EVP.TO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.zQXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/XQ`O1G/^O/rQXO1G/aO0YQXO1G/cO0pQXO1G/dO1WQWO,59|O1]Q[O'#DSO1dQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1kQpO,59]OOQS,59_,59_O${QdO,59aO1sQWO1G/mOOQS,59c,59cO1xQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2QQ[O,59jOOQS,59j,59jO2YQWO'#DjO2eQWO,5:VO2jQWO,5:]O&`Q[O,5:XO&`Q[O'#E_O2rQWO,5;`O2}QWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3`QWO1G0OO3eQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO3pQtO1G/iOOQO,5:x,5:xO4WQ[O,5:xOOQO-E8[-E8[O4eQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO4pQXO'#ErO4wQWO,59nO4|QtO'#EXO5tQdO'#EoO6OQWO,59ZO6TQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XO6]QWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6bQWO,5:yOOQO-E8]-E8]O6pQXO1G/xOOQS7+%j7+%jO6wQYO'#CsOOQO'#EQ'#EQO7SQ`O'#EPOOQO'#EP'#EPO7_QWO'#E`O7gQdO,5:jOOQS,5:j,5:jO7rQtO'#E]O${QdO'#E]O8sQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9WQpO<OAN>OO:xQdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[descendant,unitToken,identifiers,1,2,3,4,new LocalTokenGroup("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:_n=>spec_callee[_n]||-1},{term:58,get:_n=>spec_AtKeyword[_n]||-1},{term:101,get:_n=>spec_identifier$1[_n]||-1}],tokenPrec:1200});let _properties=null;function properties(){if(!_properties&&typeof document=="object"&&document.body){let{style:_n}=document.body,Ce=[],ke=new Set;for(let $n in _n)$n!="cssText"&&$n!="cssFloat"&&typeof _n[$n]=="string"&&(/[A-Z]/.test($n)&&($n=$n.replace(/[A-Z]/g,Hn=>"-"+Hn.toLowerCase())),ke.has($n)||(Ce.push($n),ke.add($n)));_properties=Ce.sort().map($n=>({type:"property",label:$n}))}return _properties||[]}const pseudoClasses=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(_n=>({type:"class",label:_n})),values=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(_n=>({type:"keyword",label:_n})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(_n=>({type:"constant",label:_n}))),tags=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(_n=>({type:"type",label:_n})),identifier$1=/^(\w[\w-]*|-\w[\w-]*|)$/,variable=/^-(-[\w-]*)?$/;function isVarArg(_n,Ce){var ke;if((_n.name=="("||_n.type.isError)&&(_n=_n.parent||_n),_n.name!="ArgList")return!1;let $n=(ke=_n.parent)===null||ke===void 0?void 0:ke.firstChild;return($n==null?void 0:$n.name)!="Callee"?!1:Ce.sliceString($n.from,$n.to)=="var"}const VariablesByNode=new NodeWeakMap,declSelector=["Declaration"];function astTop(_n){for(let Ce=_n;;){if(Ce.type.isTop)return Ce;if(!(Ce=Ce.parent))return _n}}function variableNames(_n,Ce,ke){if(Ce.to-Ce.from>4096){let $n=VariablesByNode.get(Ce);if($n)return $n;let Hn=[],zn=new Set,Un=Ce.cursor(IterMode.IncludeAnonymous);if(Un.firstChild())do for(let qn of variableNames(_n,Un.node,ke))zn.has(qn.label)||(zn.add(qn.label),Hn.push(qn));while(Un.nextSibling());return VariablesByNode.set(Ce,Hn),Hn}else{let $n=[],Hn=new Set;return Ce.cursor().iterate(zn=>{var Un;if(ke(zn)&&zn.matchContext(declSelector)&&((Un=zn.node.nextSibling)===null||Un===void 0?void 0:Un.name)==":"){let qn=_n.sliceString(zn.from,zn.to);Hn.has(qn)||(Hn.add(qn),$n.push({label:qn,type:"variable"}))}}),$n}}const defineCSSCompletionSource=_n=>Ce=>{let{state:ke,pos:$n}=Ce,Hn=syntaxTree(ke).resolveInner($n,-1),zn=Hn.type.isError&&Hn.from==Hn.to-1&&ke.doc.sliceString(Hn.from,Hn.to)=="-";if(Hn.name=="PropertyName"||(zn||Hn.name=="TagName")&&/^(Block|Styles)$/.test(Hn.resolve(Hn.to).name))return{from:Hn.from,options:properties(),validFor:identifier$1};if(Hn.name=="ValueName")return{from:Hn.from,options:values,validFor:identifier$1};if(Hn.name=="PseudoClassName")return{from:Hn.from,options:pseudoClasses,validFor:identifier$1};if(_n(Hn)||(Ce.explicit||zn)&&isVarArg(Hn,ke.doc))return{from:_n(Hn)||zn?Hn.from:$n,options:variableNames(ke.doc,astTop(Hn),_n),validFor:variable};if(Hn.name=="TagName"){for(let{parent:Xn}=Hn;Xn;Xn=Xn.parent)if(Xn.name=="Block")return{from:Hn.from,options:properties(),validFor:identifier$1};return{from:Hn.from,options:tags,validFor:identifier$1}}if(!Ce.explicit)return null;let Un=Hn.resolve($n),qn=Un.childBefore($n);return qn&&qn.name==":"&&Un.name=="PseudoClassSelector"?{from:$n,options:pseudoClasses,validFor:identifier$1}:qn&&qn.name==":"&&Un.name=="Declaration"||Un.name=="ArgList"?{from:$n,options:values,validFor:identifier$1}:Un.name=="Block"||Un.name=="Styles"?{from:$n,options:properties(),validFor:identifier$1}:null},cssCompletionSource=defineCSSCompletionSource(_n=>_n.name=="VariableName"),cssLanguage=LRLanguage.define({name:"css",parser:parser$1.configure({props:[indentNodeProp.add({Declaration:continuedIndent()}),foldNodeProp.add({"Block KeyframeList":foldInside})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function css(){return new LanguageSupport(cssLanguage,cssLanguage.data.of({autocomplete:cssCompletionSource}))}const noSemi=312,incdec=1,incdecPrefix=2,questionDot=3,JSXStartTag=4,insertSemi=313,spaces=315,newline=316,LineComment=5,BlockComment=6,Dialect_jsx=0,space=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],braceR=125,semicolon=59,slash=47,star=42,plus=43,minus=45,lt=60,comma=44,question=63,dot=46,trackNewline=new ContextTracker({start:!1,shift(_n,Ce){return Ce==LineComment||Ce==BlockComment||Ce==spaces?_n:Ce==newline},strict:!1}),insertSemicolon=new ExternalTokenizer((_n,Ce)=>{let{next:ke}=_n;(ke==braceR||ke==-1||Ce.context)&&_n.acceptToken(insertSemi)},{contextual:!0,fallback:!0}),noSemicolon=new ExternalTokenizer((_n,Ce)=>{let{next:ke}=_n,$n;space.indexOf(ke)>-1||ke==slash&&(($n=_n.peek(1))==slash||$n==star)||ke!=braceR&&ke!=semicolon&&ke!=-1&&!Ce.context&&_n.acceptToken(noSemi)},{contextual:!0}),operatorToken=new ExternalTokenizer((_n,Ce)=>{let{next:ke}=_n;if(ke==plus||ke==minus){if(_n.advance(),ke==_n.next){_n.advance();let $n=!Ce.context&&Ce.canShift(incdec);_n.acceptToken($n?incdec:incdecPrefix)}}else ke==question&&_n.peek(1)==dot&&(_n.advance(),_n.advance(),(_n.next<48||_n.next>57)&&_n.acceptToken(questionDot))},{contextual:!0});function identifierChar(_n,Ce){return _n>=65&&_n<=90||_n>=97&&_n<=122||_n==95||_n>=192||!Ce&&_n>=48&&_n<=57}const jsx=new ExternalTokenizer((_n,Ce)=>{if(_n.next!=lt||!Ce.dialectEnabled(Dialect_jsx)||(_n.advance(),_n.next==slash))return;let ke=0;for(;space.indexOf(_n.next)>-1;)_n.advance(),ke++;if(identifierChar(_n.next,!0)){for(_n.advance(),ke++;identifierChar(_n.next,!1);)_n.advance(),ke++;for(;space.indexOf(_n.next)>-1;)_n.advance(),ke++;if(_n.next==comma)return;for(let $n=0;;$n++){if($n==7){if(!identifierChar(_n.next,!0))return;break}if(_n.next!="extends".charCodeAt($n))break;_n.advance(),ke++}}_n.acceptToken(JSXStartTag,-ke)}),jsHighlight=styleTags({"get set async static":tags$1.modifier,"for while do if else switch try catch finally return throw break continue default case":tags$1.controlKeyword,"in of await yield void typeof delete instanceof":tags$1.operatorKeyword,"let var const using function class extends":tags$1.definitionKeyword,"import export from":tags$1.moduleKeyword,"with debugger as new":tags$1.keyword,TemplateString:tags$1.special(tags$1.string),super:tags$1.atom,BooleanLiteral:tags$1.bool,this:tags$1.self,null:tags$1.null,Star:tags$1.modifier,VariableName:tags$1.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":tags$1.function(tags$1.variableName),VariableDefinition:tags$1.definition(tags$1.variableName),Label:tags$1.labelName,PropertyName:tags$1.propertyName,PrivatePropertyName:tags$1.special(tags$1.propertyName),"CallExpression/MemberExpression/PropertyName":tags$1.function(tags$1.propertyName),"FunctionDeclaration/VariableDefinition":tags$1.function(tags$1.definition(tags$1.variableName)),"ClassDeclaration/VariableDefinition":tags$1.definition(tags$1.className),PropertyDefinition:tags$1.definition(tags$1.propertyName),PrivatePropertyDefinition:tags$1.definition(tags$1.special(tags$1.propertyName)),UpdateOp:tags$1.updateOperator,"LineComment Hashbang":tags$1.lineComment,BlockComment:tags$1.blockComment,Number:tags$1.number,String:tags$1.string,Escape:tags$1.escape,ArithOp:tags$1.arithmeticOperator,LogicOp:tags$1.logicOperator,BitOp:tags$1.bitwiseOperator,CompareOp:tags$1.compareOperator,RegExp:tags$1.regexp,Equals:tags$1.definitionOperator,Arrow:tags$1.function(tags$1.punctuation),": Spread":tags$1.punctuation,"( )":tags$1.paren,"[ ]":tags$1.squareBracket,"{ }":tags$1.brace,"InterpolationStart InterpolationEnd":tags$1.special(tags$1.brace),".":tags$1.derefOperator,", ;":tags$1.separator,"@":tags$1.meta,TypeName:tags$1.typeName,TypeDefinition:tags$1.definition(tags$1.typeName),"type enum interface implements namespace module declare":tags$1.definitionKeyword,"abstract global Privacy readonly override":tags$1.modifier,"is keyof unique infer":tags$1.operatorKeyword,JSXAttributeValue:tags$1.attributeValue,JSXText:tags$1.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":tags$1.angleBracket,"JSXIdentifier JSXNameSpacedName":tags$1.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":tags$1.attributeName,"JSXBuiltin/JSXIdentifier":tags$1.standard(tags$1.tagName)}),spec_identifier={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},spec_word={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},spec_LessThan={__proto__:null,"<":187},parser=LRParser.deserialize({version:14,states:"$@QO%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ?NdO'#CiO+RO!bO'#CjO+aO#tO'#CjO+oO!0LbO'#D^O.QQ^O'#DdO.bQ^O'#DoO%[Q^O'#DwO0fQ^O'#EPOOQ?Mr'#EX'#EXO1PQWO'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQWO'#GpO1dQWO'#ElO1iQWO'#ElO3hQ?NdO'#JmO6[Q?NdO'#JnO6uQWO'#F[O6zQ&jO'#FsOOQ?Mr'#Fe'#FeO7VO,YO'#FeO7eQ7[O'#FzO9RQWO'#FyOOQ?Mr'#Jn'#JnOOQ?Mp'#Jm'#JmO9WQWO'#GtOOQU'#KZ'#KZO9cQWO'#IUO9hQ?MxO'#IVOOQU'#JZ'#JZOOQU'#IZ'#IZQ`Q^OOO`Q^OOO9pQMnO'#DsO9wQ^O'#D{O:OQ^O'#D}O9^QWO'#GpO:VQ7[O'#CoO:eQWO'#EkO:pQWO'#EvO:uQ7[O'#FdO;dQWO'#GpOOQO'#K['#K[O;iQWO'#K[O;wQWO'#GxO;wQWO'#GyO;wQWO'#G{O9^QWO'#HOOVQWO'#CeO>gQWO'#H_O>oQWO'#HeO>oQWO'#HgO`Q^O'#HiO>oQWO'#HkO>oQWO'#HnO>tQWO'#HtO>yQ?MyO'#HzO%[Q^O'#H|O?UQ?MyO'#IOO?aQ?MyO'#IQO9hQ?MxO'#ISO?lQ?NdO'#CiO@nQ`O'#DiQOQWOOO%[Q^O'#D}OAUQWO'#EQO:VQ7[O'#EkOAaQWO'#EkOAlQpO'#FdOOQU'#Cg'#CgOOQ?Mp'#Dn'#DnOOQ?Mp'#Jq'#JqO%[Q^O'#JqOOQO'#Jt'#JtOOQO'#Id'#IdOBlQ`O'#EdOOQ?Mp'#Ec'#EcOOQ?Mp'#Jx'#JxOChQ?NQO'#EdOCrQ`O'#ETOOQO'#Js'#JsODWQ`O'#JtOEeQ`O'#ETOCrQ`O'#EdPErO#@ItO'#CbPOOO)CDx)CDxOOOO'#I['#I[OE}O!bO,59UOOQ?Mr,59U,59UOOOO'#I]'#I]OF]O#tO,59UO%[Q^O'#D`OOOO'#I_'#I_OFkO!0LbO,59xOOQ?Mr,59x,59xOFyQ^O'#I`OG^QWO'#JoOI]QrO'#JoO+}Q^O'#JoOIdQWO,5:OOIzQWO'#EmOJXQWO'#KOOJdQWO'#J}OJdQWO'#J}OJlQWO,5;ZOJqQWO'#J|OOQ?Mv,5:Z,5:ZOJxQ^O,5:ZOLvQ?NdO,5:cOMgQWO,5:kONQQ?MxO'#J{ONXQWO'#JzO9WQWO'#JzONmQWO'#JzONuQWO,5;YONzQWO'#JzO!#PQrO'#JnOOQ?Mr'#Ci'#CiO%[Q^O'#EPO!#oQrO,5:pOOQQ'#Ju'#JuOOQO-EpOOQU'#Jc'#JcOOQU,5>q,5>qOOQU-EtQWO'#HTO9^QWO'#HVO!DgQWO'#HVO:VQ7[O'#HXO!DlQWO'#HXOOQU,5=m,5=mO!DqQWO'#HYO!ESQWO'#CoO!EXQWO,59PO!EcQWO,59PO!GhQ^O,59POOQU,59P,59PO!GxQ?MxO,59PO%[Q^O,59PO!JTQ^O'#HaOOQU'#Hb'#HbOOQU'#Hc'#HcO`Q^O,5=yO!JkQWO,5=yO`Q^O,5>PO`Q^O,5>RO!JpQWO,5>TO`Q^O,5>VO!JuQWO,5>YO!JzQ^O,5>`OOQU,5>f,5>fO%[Q^O,5>fO9hQ?MxO,5>hOOQU,5>j,5>jO# UQWO,5>jOOQU,5>l,5>lO# UQWO,5>lOOQU,5>n,5>nO# rQ`O'#D[O%[Q^O'#JqO# |Q`O'#JqO#!kQ`O'#DjO#!|Q`O'#DjO#%_Q^O'#DjO#%fQWO'#JpO#%nQWO,5:TO#%sQWO'#EqO#&RQWO'#KPO#&ZQWO,5;[O#&`Q`O'#DjO#&mQ`O'#ESOOQ?Mr,5:l,5:lO%[Q^O,5:lO#&tQWO,5:lO>tQWO,5;VO!A}Q`O,5;VO!BVQ7[O,5;VO:VQ7[O,5;VO#&|QWO,5@]O#'RQ(CYO,5:pOOQO-EzO+}Q^O,5>zOOQO,5?Q,5?QO#*ZQ^O'#I`OOQO-E<^-E<^O#*hQWO,5@ZO#*pQrO,5@ZO#*wQWO,5@iOOQ?Mr1G/j1G/jO%[Q^O,5@jO#+PQWO'#IfOOQO-EuQ?NdO1G0|O#>|Q?NdO1G0|O#AZQ07bO'#CiO#CUQ07bO1G1_O#C]Q07bO'#JnO#CpQ?NdO,5?WOOQ?Mp-EoQWO1G3oO$3VQ^O1G3qO$7ZQ^O'#HpOOQU1G3t1G3tO$7hQWO'#HvO>tQWO'#HxOOQU1G3z1G3zO$7pQ^O1G3zO9hQ?MxO1G4QOOQU1G4S1G4SOOQ?Mp'#G]'#G]O9hQ?MxO1G4UO9hQ?MxO1G4WO$;wQWO,5@]O!(oQ^O,5;]O9WQWO,5;]O>tQWO,5:UO!(oQ^O,5:UO!A}Q`O,5:UO$;|Q07bO,5:UOOQO,5;],5;]O$tQWO1G0qO!A}Q`O1G0qO!BVQ7[O1G0qOOQ?Mp1G5w1G5wO!ArQ?MxO1G0ZOOQO1G0j1G0jO%[Q^O1G0jO$=aQ?MxO1G0jO$=lQ?MxO1G0jO!A}Q`O1G0ZOCrQ`O1G0ZO$=zQ?MxO1G0jOOQO1G0Z1G0ZO$>`Q?NdO1G0jPOOO-EjQpO,5rQrO1G4fOOQO1G4l1G4lO%[Q^O,5>zO$>|QWO1G5uO$?UQWO1G6TO$?^QrO1G6UO9WQWO,5?QO$?hQ?NdO1G6RO%[Q^O1G6RO$?xQ?MxO1G6RO$@ZQWO1G6QO$@ZQWO1G6QO9WQWO1G6QO$@cQWO,5?TO9WQWO,5?TOOQO,5?T,5?TO$@wQWO,5?TO$(PQWO,5?TOOQO-E[OOQU,5>[,5>[O%[Q^O'#HqO%8mQWO'#HsOOQU,5>b,5>bO9WQWO,5>bOOQU,5>d,5>dOOQU7+)f7+)fOOQU7+)l7+)lOOQU7+)p7+)pOOQU7+)r7+)rO%8rQ`O1G5wO%9WQ07bO1G0wO%9bQWO1G0wOOQO1G/p1G/pO%9mQ07bO1G/pO>tQWO1G/pO!(oQ^O'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQWO7+&]O!A}Q`O7+&]OOQO7+%u7+%uO$>`Q?NdO7+&UOOQO7+&U7+&UO%[Q^O7+&UO%9wQ?MxO7+&UO!ArQ?MxO7+%uO!A}Q`O7+%uO%:SQ?MxO7+&UO%:bQ?NdO7++mO%[Q^O7++mO%:rQWO7++lO%:rQWO7++lOOQO1G4o1G4oO9WQWO1G4oO%:zQWO1G4oOOQQ7+%z7+%zO#&wQWO<|O%[Q^O,5>|OOQO-E<`-E<`O%FwQWO1G5xOOQ?Mr<]OOQU,5>_,5>_O&8uQWO1G3|O9WQWO7+&cO!(oQ^O7+&cOOQO7+%[7+%[O&8zQ07bO1G6UO>tQWO7+%[OOQ?Mr<tQWO<`Q?NdO<pQ?NdO,5?_O&@xQ?NdO7+'zO&CWQrO1G4hO&CbQ07bO7+&^O&EcQ07bO,5=UO&GgQ07bO,5=WO&GwQ07bO,5=UO&HXQ07bO,5=WO&HiQ07bO,59rO&JlQ07bO,5tQWO7+)hO'(OQWO<`Q?NdOAN?[OOQOAN>{AN>{O%[Q^OAN?[OOQO<`Q?NdOG24vO#&wQWOLD,nOOQULD,nLD,nO!&_Q7[OLD,nO'5TQrOLD,nO'5[Q07bO7+'xO'6}Q07bO,5?]O'8}Q07bO,5?_O':}Q07bO7+'zO'kOh%VOk+aO![']O%f+`O~O!d+cOa(WX![(WX'u(WX!Y(WX~Oa%lO![XO'u%lO~Oh%VO!i%cO~Oh%VO!i%cO(O%eO~O!d#vO#h(tO~Ob+nO%g+oO(O+kO(QTO(TUO!Z)TP~O!Y+pO`)SX~O[+tO~O`+uO~O![%}O(O%eO(P!lO`)SP~Oh%VO#]+zO~Oh%VOk+}O![$|O~O![,PO~O},RO![XO~O%k%tO~O!u,WO~Oe,]O~Ob,^O(O#nO(QTO(TUO!Z)RP~Oe%{O~O%g!QO(O&WO~P=RO[,cO`,bO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(QTO(TUO([VO(j[O(yiO~O![!eO!r!gO$V!kO(O!dO~P!EkO`,bOa%lO'u%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(O!dO(QTO(TUO([VO(j[O(yiO~Oa,hO!rwO#t!OO%i!OO%j!OO%k!OO~P!HTO!i&lO~O&Y,nO~O![,pO~O&k,rO&m,sOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(O&ha(Q&ha(T&ha([&ha(j&ha(y&ha!Z&ha&a&hab&ha&f&ha~O(O,xO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# ZO!d,}O#],|Oh(eX!Y#eX!Y(eX!Z#eX!Z(eX!d(eX!i(eX~Oh%VO!d-PO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(QTO(TUO(`!mO~OP;POQ;POSfOdkOg'XX!Y'XX~P!+hO!Y.wOg(ka~OSfO![3uO$c3vO~O!Z3zO~Os3{O~P#.aOa$lq!Y$lq'u$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9mO!V3|O~P#.aO})zO!P){O(u%POk'ea(t'ea!Y'ea#]'ea~Og'ea#}'ea~P%)nO})zO!P){Ok'ga(t'ga(u'ga!Y'ga#]'ga~Og'ga#}'ga~P%*aO(m$YO~P#.aO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/gO(OQ#>g#@V#@e#@l#BR#Ba#C|#D[#Db#Dh#Dn#Dx#EO#EU#E`#Er#ExPPPPPPPPPP#FOPPPPPPP#Fs#Iz#KZ#Kb#KjPPP$!sP$!|$%t$,^$,a$,d$-P$-S$-Z$-cP$-i$-lP$.Y$.^$/U$0d$0i$1PPP$1U$1[$1`P$1c$1g$1k$2a$2x$3a$3e$3h$3k$3q$3t$3x$3|R!|RoqOXst!Z#d%k&o&q&r&t,k,p1|2PY!vQ']-]1a5eQ%rvQ%zyQ&R|Q&g!VS'T!e-TQ'c!iS'i!r!yU*e$|*V*jQ+i%{Q+v&TQ,[&aQ-Z'[Q-e'dQ-m'jQ0R*lQ1k,]R;v;T%QdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%k%r&P&h&k&o&q&r&t&x'Q'_'o(P(R(X(`(t(v(z)y+R+V,h,k,p-a-i-w-}.l.s/f0a0g0v1d1t1u1w1y1|2P2R2r2x3^5b5m5}6O6R6f8R8X8h8rS#q];Q!r)Z$Z$n'U)o,|-P.}2b3u5`6]9h9y;P;S;T;W;X;Y;Z;[;];^;_;`;a;b;c;d;f;i;v;x;y;{ < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:376,context:trackNewline,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[jsHighlight],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(RpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(RpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Rp(U!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Rp(U!b'w0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(S#S$h&j'x0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Rp(U!b'x0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(Q':f$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(U!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Rp(U!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(U!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(RpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(RpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Rp(U!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(U!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(U!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(U!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(U!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(U!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-spec_identifier[_n]||-1},{term:338,get:_n=>spec_word[_n]||-1},{term:92,get:_n=>spec_LessThan[_n]||-1}],tokenPrec:14749}),snippets=[snippetCompletion("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),snippetCompletion("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),snippetCompletion("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),snippetCompletion("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),snippetCompletion("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),snippetCompletion(`try { + \${} +} catch (\${error}) { + \${} +}`,{label:"try",detail:"/ catch block",type:"keyword"}),snippetCompletion("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),snippetCompletion(`if (\${}) { + \${} +} else { + \${} +}`,{label:"if",detail:"/ else block",type:"keyword"}),snippetCompletion(`class \${name} { + constructor(\${params}) { + \${} + } +}`,{label:"class",detail:"definition",type:"keyword"}),snippetCompletion('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),snippetCompletion('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],typescriptSnippets=snippets.concat([snippetCompletion("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),snippetCompletion("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),snippetCompletion("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),cache=new NodeWeakMap,ScopeNodes=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function defID(_n){return(Ce,ke)=>{let $n=Ce.node.getChild("VariableDefinition");return $n&&ke($n,_n),!0}}const functionContext=["FunctionDeclaration"],gatherCompletions={FunctionDeclaration:defID("function"),ClassDeclaration:defID("class"),ClassExpression:()=>!0,EnumDeclaration:defID("constant"),TypeAliasDeclaration:defID("type"),NamespaceDeclaration:defID("namespace"),VariableDefinition(_n,Ce){_n.matchContext(functionContext)||Ce(_n,"variable")},TypeDefinition(_n,Ce){Ce(_n,"type")},__proto__:null};function getScope(_n,Ce){let ke=cache.get(Ce);if(ke)return ke;let $n=[],Hn=!0;function zn(Un,qn){let Xn=_n.sliceString(Un.from,Un.to);$n.push({label:Xn,type:qn})}return Ce.cursor(IterMode.IncludeAnonymous).iterate(Un=>{if(Hn)Hn=!1;else if(Un.name){let qn=gatherCompletions[Un.name];if(qn&&qn(Un,zn)||ScopeNodes.has(Un.name))return!1}else if(Un.to-Un.from>8192){for(let qn of getScope(_n,Un.node))$n.push(qn);return!1}}),cache.set(Ce,$n),$n}const Identifier=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,dontComplete=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function localCompletionSource(_n){let Ce=syntaxTree(_n.state).resolveInner(_n.pos,-1);if(dontComplete.indexOf(Ce.name)>-1)return null;let ke=Ce.name=="VariableName"||Ce.to-Ce.from<20&&Identifier.test(_n.state.sliceDoc(Ce.from,Ce.to));if(!ke&&!_n.explicit)return null;let $n=[];for(let Hn=Ce;Hn;Hn=Hn.parent)ScopeNodes.has(Hn.name)&&($n=$n.concat(getScope(_n.state.doc,Hn)));return{options:$n,from:ke?Ce.from:_n.pos,validFor:Identifier}}const javascriptLanguage=LRLanguage.define({name:"javascript",parser:parser.configure({props:[indentNodeProp.add({IfStatement:continuedIndent({except:/^\s*({|else\b)/}),TryStatement:continuedIndent({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:flatIndent,SwitchBody:_n=>{let Ce=_n.textAfter,ke=/^\s*\}/.test(Ce),$n=/^\s*(case|default)\b/.test(Ce);return _n.baseIndent+(ke?0:$n?1:2)*_n.unit},Block:delimitedIndent({closing:"}"}),ArrowFunction:_n=>_n.baseIndent+_n.unit,"TemplateString BlockComment":()=>null,"Statement Property":continuedIndent({except:/^{/}),JSXElement(_n){let Ce=/^\s*<\//.test(_n.textAfter);return _n.lineIndent(_n.node.from)+(Ce?0:_n.unit)},JSXEscape(_n){let Ce=/\s*\}/.test(_n.textAfter);return _n.lineIndent(_n.node.from)+(Ce?0:_n.unit)},"JSXOpenTag JSXSelfClosingTag"(_n){return _n.column(_n.node.from)+_n.unit}}),foldNodeProp.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":foldInside,BlockComment(_n){return{from:_n.from+2,to:_n.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),jsxSublanguage={test:_n=>/^JSX/.test(_n.name),facet:defineLanguageFacet({commentTokens:{block:{open:"{/*",close:"*/}"}}})},typescriptLanguage=javascriptLanguage.configure({dialect:"ts"},"typescript"),jsxLanguage=javascriptLanguage.configure({dialect:"jsx",props:[sublanguageProp.add(_n=>_n.isTop?[jsxSublanguage]:void 0)]}),tsxLanguage=javascriptLanguage.configure({dialect:"jsx ts",props:[sublanguageProp.add(_n=>_n.isTop?[jsxSublanguage]:void 0)]},"typescript");let kwCompletion=_n=>({label:_n,type:"keyword"});const keywords="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(kwCompletion),typescriptKeywords=keywords.concat(["declare","implements","private","protected","public"].map(kwCompletion));function javascript(_n={}){let Ce=_n.jsx?_n.typescript?tsxLanguage:jsxLanguage:_n.typescript?typescriptLanguage:javascriptLanguage,ke=_n.typescript?typescriptSnippets.concat(typescriptKeywords):snippets.concat(keywords);return new LanguageSupport(Ce,[javascriptLanguage.data.of({autocomplete:ifNotIn(dontComplete,completeFromList(ke))}),javascriptLanguage.data.of({autocomplete:localCompletionSource}),_n.jsx?autoCloseTags$1:[]])}function findOpenTag(_n){for(;;){if(_n.name=="JSXOpenTag"||_n.name=="JSXSelfClosingTag"||_n.name=="JSXFragmentTag")return _n;if(_n.name=="JSXEscape"||!_n.parent)return null;_n=_n.parent}}function elementName$1(_n,Ce,ke=_n.length){for(let $n=Ce==null?void 0:Ce.firstChild;$n;$n=$n.nextSibling)if($n.name=="JSXIdentifier"||$n.name=="JSXBuiltin"||$n.name=="JSXNamespacedName"||$n.name=="JSXMemberExpression")return _n.sliceString($n.from,Math.min($n.to,ke));return""}const android=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),autoCloseTags$1=EditorView.inputHandler.of((_n,Ce,ke,$n,Hn)=>{if((android?_n.composing:_n.compositionStarted)||_n.state.readOnly||Ce!=ke||$n!=">"&&$n!="/"||!javascriptLanguage.isActiveAt(_n.state,Ce,-1))return!1;let zn=Hn(),{state:Un}=zn,qn=Un.changeByRange(Xn=>{var Kn;let{head:to}=Xn,io=syntaxTree(Un).resolveInner(to-1,-1),uo;if(io.name=="JSXStartTag"&&(io=io.parent),!(Un.doc.sliceString(to-1,to)!=$n||io.name=="JSXAttributeValue"&&io.to>to)){if($n==">"&&io.name=="JSXFragmentTag")return{range:Xn,changes:{from:to,insert:""}};if($n=="/"&&io.name=="JSXStartCloseTag"){let ho=io.parent,bo=ho.parent;if(bo&&ho.from==to-2&&((uo=elementName$1(Un.doc,bo.firstChild,to))||((Kn=bo.firstChild)===null||Kn===void 0?void 0:Kn.name)=="JSXFragmentTag")){let Oo=`${uo}>`;return{range:EditorSelection.cursor(to+Oo.length,-1),changes:{from:to,insert:Oo}}}}else if($n==">"){let ho=findOpenTag(io);if(ho&&ho.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(Un.doc.sliceString(to,to+2))&&(uo=elementName$1(Un.doc,ho,to)))return{range:Xn,changes:{from:to,insert:``}}}}return{range:Xn}});return qn.changes.empty?!1:(_n.dispatch([zn,Un.update(qn,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Targets=["_blank","_self","_top","_parent"],Charsets=["ascii","utf-8","utf-16","latin1","latin1"],Methods=["get","post","put","delete"],Encs=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Bool=["true","false"],S={},Tags={a:{attrs:{href:null,ping:null,type:null,media:null,target:Targets,hreflang:null}},abbr:S,address:S,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:S,aside:S,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:S,base:{attrs:{href:null,target:Targets}},bdi:S,bdo:S,blockquote:{attrs:{cite:null}},body:S,br:S,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Encs,formmethod:Methods,formnovalidate:["novalidate"],formtarget:Targets,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:S,center:S,cite:S,code:S,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:S,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:S,div:S,dl:S,dt:S,em:S,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:S,figure:S,footer:S,form:{attrs:{action:null,name:null,"accept-charset":Charsets,autocomplete:["on","off"],enctype:Encs,method:Methods,novalidate:["novalidate"],target:Targets}},h1:S,h2:S,h3:S,h4:S,h5:S,h6:S,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:S,hgroup:S,hr:S,html:{attrs:{manifest:null}},i:S,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Encs,formmethod:Methods,formnovalidate:["novalidate"],formtarget:Targets,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:S,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:S,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:S,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Charsets,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:S,noscript:S,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:S,param:{attrs:{name:null,value:null}},pre:S,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:S,rt:S,ruby:S,samp:S,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Charsets}},section:S,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:S,source:{attrs:{src:null,type:null,media:null}},span:S,strong:S,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:S,summary:S,sup:S,table:S,tbody:S,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:S,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:S,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:S,time:{attrs:{datetime:null}},title:S,tr:S,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:S,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:S},GlobalAttrs={accesskey:null,class:null,contenteditable:Bool,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Bool,autocorrect:Bool,autocapitalize:Bool,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Bool,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Bool,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Bool,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Bool,"aria-hidden":Bool,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Bool,"aria-multiselectable":Bool,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Bool,"aria-relevant":null,"aria-required":Bool,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},eventAttributes="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(_n=>"on"+_n);for(let _n of eventAttributes)GlobalAttrs[_n]=null;class Schema{constructor(Ce,ke){this.tags=Object.assign(Object.assign({},Tags),Ce),this.globalAttrs=Object.assign(Object.assign({},GlobalAttrs),ke),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Schema.default=new Schema;function elementName(_n,Ce,ke=_n.length){if(!Ce)return"";let $n=Ce.firstChild,Hn=$n&&$n.getChild("TagName");return Hn?_n.sliceString(Hn.from,Math.min(Hn.to,ke)):""}function findParentElement(_n,Ce=!1){for(;_n;_n=_n.parent)if(_n.name=="Element")if(Ce)Ce=!1;else return _n;return null}function allowedChildren(_n,Ce,ke){let $n=ke.tags[elementName(_n,findParentElement(Ce))];return($n==null?void 0:$n.children)||ke.allTags}function openTags(_n,Ce){let ke=[];for(let $n=findParentElement(Ce);$n&&!$n.type.isTop;$n=findParentElement($n.parent)){let Hn=elementName(_n,$n);if(Hn&&$n.lastChild.name=="CloseTag")break;Hn&&ke.indexOf(Hn)<0&&(Ce.name=="EndTag"||Ce.from>=$n.firstChild.to)&&ke.push(Hn)}return ke}const identifier=/^[:\-\.\w\u00b7-\uffff]*$/;function completeTag(_n,Ce,ke,$n,Hn){let zn=/\s*>/.test(_n.sliceDoc(Hn,Hn+5))?"":">",Un=findParentElement(ke,!0);return{from:$n,to:Hn,options:allowedChildren(_n.doc,Un,Ce).map(qn=>({label:qn,type:"type"})).concat(openTags(_n.doc,ke).map((qn,Xn)=>({label:"/"+qn,apply:"/"+qn+zn,type:"type",boost:99-Xn}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function completeCloseTag(_n,Ce,ke,$n){let Hn=/\s*>/.test(_n.sliceDoc($n,$n+5))?"":">";return{from:ke,to:$n,options:openTags(_n.doc,Ce).map((zn,Un)=>({label:zn,apply:zn+Hn,type:"type",boost:99-Un})),validFor:identifier}}function completeStartTag(_n,Ce,ke,$n){let Hn=[],zn=0;for(let Un of allowedChildren(_n.doc,ke,Ce))Hn.push({label:"<"+Un,type:"type"});for(let Un of openTags(_n.doc,ke))Hn.push({label:"",type:"type",boost:99-zn++});return{from:$n,to:$n,options:Hn,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function completeAttrName(_n,Ce,ke,$n,Hn){let zn=findParentElement(ke),Un=zn?Ce.tags[elementName(_n.doc,zn)]:null,qn=Un&&Un.attrs?Object.keys(Un.attrs):[],Xn=Un&&Un.globalAttrs===!1?qn:qn.length?qn.concat(Ce.globalAttrNames):Ce.globalAttrNames;return{from:$n,to:Hn,options:Xn.map(Kn=>({label:Kn,type:"property"})),validFor:identifier}}function completeAttrValue(_n,Ce,ke,$n,Hn){var zn;let Un=(zn=ke.parent)===null||zn===void 0?void 0:zn.getChild("AttributeName"),qn=[],Xn;if(Un){let Kn=_n.sliceDoc(Un.from,Un.to),to=Ce.globalAttrs[Kn];if(!to){let io=findParentElement(ke),uo=io?Ce.tags[elementName(_n.doc,io)]:null;to=(uo==null?void 0:uo.attrs)&&uo.attrs[Kn]}if(to){let io=_n.sliceDoc($n,Hn).toLowerCase(),uo='"',ho='"';/^['"]/.test(io)?(Xn=io[0]=='"'?/^[^"]*$/:/^[^']*$/,uo="",ho=_n.sliceDoc(Hn,Hn+1)==io[0]?"":io[0],io=io.slice(1),$n++):Xn=/^[^\s<>='"]*$/;for(let bo of to)qn.push({label:bo,apply:uo+bo+ho,type:"constant"})}}return{from:$n,to:Hn,options:qn,validFor:Xn}}function htmlCompletionFor(_n,Ce){let{state:ke,pos:$n}=Ce,Hn=syntaxTree(ke).resolveInner($n,-1),zn=Hn.resolve($n);for(let Un=$n,qn;zn==Hn&&(qn=Hn.childBefore(Un));){let Xn=qn.lastChild;if(!Xn||!Xn.type.isError||Xn.fromhtmlCompletionFor($n,Hn)}const jsonParser=javascriptLanguage.parser.configure({top:"SingleExpression"}),defaultNesting=[{tag:"script",attrs:_n=>_n.type=="text/typescript"||_n.lang=="ts",parser:typescriptLanguage.parser},{tag:"script",attrs:_n=>_n.type=="text/babel"||_n.type=="text/jsx",parser:jsxLanguage.parser},{tag:"script",attrs:_n=>_n.type=="text/typescript-jsx",parser:tsxLanguage.parser},{tag:"script",attrs(_n){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(_n.type)},parser:jsonParser},{tag:"script",attrs(_n){return!_n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(_n.type)},parser:javascriptLanguage.parser},{tag:"style",attrs(_n){return(!_n.lang||_n.lang=="css")&&(!_n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(_n.type))},parser:cssLanguage.parser}],defaultAttrs=[{name:"style",parser:cssLanguage.parser.configure({top:"Styles"})}].concat(eventAttributes.map(_n=>({name:_n,parser:javascriptLanguage.parser}))),htmlPlain=LRLanguage.define({name:"html",parser:parser$2.configure({props:[indentNodeProp.add({Element(_n){let Ce=/^(\s*)(<\/)?/.exec(_n.textAfter);return _n.node.to<=_n.pos+Ce[0].length?_n.continue():_n.lineIndent(_n.node.from)+(Ce[2]?0:_n.unit)},"OpenTag CloseTag SelfClosingTag"(_n){return _n.column(_n.node.from)+_n.unit},Document(_n){if(_n.pos+/\s*/.exec(_n.textAfter)[0].length<_n.node.to)return _n.continue();let Ce=null,ke;for(let $n=_n.node;;){let Hn=$n.lastChild;if(!Hn||Hn.name!="Element"||Hn.to!=$n.to)break;Ce=$n=Hn}return Ce&&!((ke=Ce.lastChild)&&(ke.name=="CloseTag"||ke.name=="SelfClosingTag"))?_n.lineIndent(Ce.from)+_n.unit:null}}),foldNodeProp.add({Element(_n){let Ce=_n.firstChild,ke=_n.lastChild;return!Ce||Ce.name!="OpenTag"?null:{from:Ce.to,to:ke.name=="CloseTag"?ke.from:_n.to}}}),bracketMatchingHandle.add({"OpenTag CloseTag":_n=>_n.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),htmlLanguage=htmlPlain.configure({wrap:configureNesting(defaultNesting,defaultAttrs)});function html(_n={}){let Ce="",ke;_n.matchClosingTags===!1&&(Ce="noMatch"),_n.selfClosingTags===!0&&(Ce=(Ce?Ce+" ":"")+"selfClosing"),(_n.nestedLanguages&&_n.nestedLanguages.length||_n.nestedAttributes&&_n.nestedAttributes.length)&&(ke=configureNesting((_n.nestedLanguages||[]).concat(defaultNesting),(_n.nestedAttributes||[]).concat(defaultAttrs)));let $n=ke?htmlPlain.configure({wrap:ke,dialect:Ce}):Ce?htmlLanguage.configure({dialect:Ce}):htmlLanguage;return new LanguageSupport($n,[htmlLanguage.data.of({autocomplete:htmlCompletionSourceWith(_n)}),_n.autoCloseTags!==!1?autoCloseTags:[],javascript().support,css().support])}const selfClosers=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),autoCloseTags=EditorView.inputHandler.of((_n,Ce,ke,$n,Hn)=>{if(_n.composing||_n.state.readOnly||Ce!=ke||$n!=">"&&$n!="/"||!htmlLanguage.isActiveAt(_n.state,Ce,-1))return!1;let zn=Hn(),{state:Un}=zn,qn=Un.changeByRange(Xn=>{var Kn,to,io;let uo=Un.doc.sliceString(Xn.from-1,Xn.to)==$n,{head:ho}=Xn,bo=syntaxTree(Un).resolveInner(ho,-1),Oo;if(uo&&$n==">"&&bo.name=="EndTag"){let So=bo.parent;if(((to=(Kn=So.parent)===null||Kn===void 0?void 0:Kn.lastChild)===null||to===void 0?void 0:to.name)!="CloseTag"&&(Oo=elementName(Un.doc,So.parent,ho))&&!selfClosers.has(Oo)){let $o=ho+(Un.doc.sliceString(ho,ho+1)===">"?1:0),Do=``;return{range:Xn,changes:{from:ho,to:$o,insert:Do}}}}else if(uo&&$n=="/"&&bo.name=="IncompleteCloseTag"){let So=bo.parent;if(bo.from==ho-2&&((io=So.lastChild)===null||io===void 0?void 0:io.name)!="CloseTag"&&(Oo=elementName(Un.doc,So,ho))&&!selfClosers.has(Oo)){let $o=ho+(Un.doc.sliceString(ho,ho+1)===">"?1:0),Do=`${Oo}>`;return{range:EditorSelection.cursor(ho+Do.length,-1),changes:{from:ho,to:$o,insert:Do}}}}return{range:Xn}});return qn.changes.empty?!1:(_n.dispatch([zn,Un.update(qn,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),data=defineLanguageFacet({commentTokens:{block:{open:""}}}),headingProp=new NodeProp,commonmark=parser$3.configure({props:[foldNodeProp.add(_n=>!_n.is("Block")||_n.is("Document")||isHeading(_n)!=null||isList(_n)?void 0:(Ce,ke)=>({from:ke.doc.lineAt(Ce.from).to,to:Ce.to})),headingProp.add(isHeading),indentNodeProp.add({Document:()=>null}),languageDataProp.add({Document:data})]});function isHeading(_n){let Ce=/^(?:ATX|Setext)Heading(\d)$/.exec(_n.name);return Ce?+Ce[1]:void 0}function isList(_n){return _n.name=="OrderedList"||_n.name=="BulletList"}function findSectionEnd(_n,Ce){let ke=_n;for(;;){let $n=ke.nextSibling,Hn;if(!$n||(Hn=isHeading($n.type))!=null&&Hn<=Ce)break;ke=$n}return ke.to}const headerIndent=foldService.of((_n,Ce,ke)=>{for(let $n=syntaxTree(_n).resolveInner(ke,-1);$n&&!($n.fromke)return{from:ke,to:zn}}return null});function mkLang(_n){return new Language(data,_n,[headerIndent],"markdown")}const commonmarkLanguage=mkLang(commonmark),extended=commonmark.configure([GFM,Subscript,Superscript,Emoji,{props:[foldNodeProp.add({Table:(_n,Ce)=>({from:Ce.doc.lineAt(_n.from).to,to:_n.to})})]}]),markdownLanguage=mkLang(extended);function getCodeParser(_n,Ce){return ke=>{if(ke&&_n){let $n=null;if(ke=/\S*/.exec(ke)[0],typeof _n=="function"?$n=_n(ke):$n=LanguageDescription.matchLanguageName(_n,ke,!0),$n instanceof LanguageDescription)return $n.support?$n.support.language.parser:ParseContext.getSkippingParser($n.load());if($n)return $n.parser}return Ce?Ce.parser:null}}class Context{constructor(Ce,ke,$n,Hn,zn,Un,qn){this.node=Ce,this.from=ke,this.to=$n,this.spaceBefore=Hn,this.spaceAfter=zn,this.type=Un,this.item=qn}blank(Ce,ke=!0){let $n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(Ce!=null){for(;$n.length0;Hn--)$n+=" ";return $n+(ke?this.spaceAfter:"")}}marker(Ce,ke){let $n=this.node.name=="OrderedList"?String(+itemNumber(this.item,Ce)[2]+ke):"";return this.spaceBefore+$n+this.type+this.spaceAfter}}function getContext(_n,Ce){let ke=[];for(let Hn=_n;Hn&&Hn.name!="Document";Hn=Hn.parent)(Hn.name=="ListItem"||Hn.name=="Blockquote"||Hn.name=="FencedCode")&&ke.push(Hn);let $n=[];for(let Hn=ke.length-1;Hn>=0;Hn--){let zn=ke[Hn],Un,qn=Ce.lineAt(zn.from),Xn=zn.from-qn.from;if(zn.name=="FencedCode")$n.push(new Context(zn,Xn,Xn,"","","",null));else if(zn.name=="Blockquote"&&(Un=/^ *>( ?)/.exec(qn.text.slice(Xn))))$n.push(new Context(zn,Xn,Xn+Un[0].length,"",Un[1],">",null));else if(zn.name=="ListItem"&&zn.parent.name=="OrderedList"&&(Un=/^( *)\d+([.)])( *)/.exec(qn.text.slice(Xn)))){let Kn=Un[3],to=Un[0].length;Kn.length>=4&&(Kn=Kn.slice(0,Kn.length-4),to-=4),$n.push(new Context(zn.parent,Xn,Xn+to,Un[1],Kn,Un[2],zn))}else if(zn.name=="ListItem"&&zn.parent.name=="BulletList"&&(Un=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(qn.text.slice(Xn)))){let Kn=Un[4],to=Un[0].length;Kn.length>4&&(Kn=Kn.slice(0,Kn.length-4),to-=4);let io=Un[2];Un[3]&&(io+=Un[3].replace(/[xX]/," ")),$n.push(new Context(zn.parent,Xn,Xn+to,Un[1],Kn,io,zn))}}return $n}function itemNumber(_n,Ce){return/^(\s*)(\d+)(?=[.)])/.exec(Ce.sliceString(_n.from,_n.from+10))}function renumberList(_n,Ce,ke,$n=0){for(let Hn=-1,zn=_n;;){if(zn.name=="ListItem"){let qn=itemNumber(zn,Ce),Xn=+qn[2];if(Hn>=0){if(Xn!=Hn+1)return;ke.push({from:zn.from+qn[1].length,to:zn.from+qn[0].length,insert:String(Hn+2+$n)})}Hn=Xn}let Un=zn.nextSibling;if(!Un)break;zn=Un}}function normalizeIndent(_n,Ce){let ke=/^[ \t]*/.exec(_n)[0].length;if(!ke||Ce.facet(indentUnit)!=" ")return _n;let $n=countColumn(_n,4,ke),Hn="";for(let zn=$n;zn>0;)zn>=4?(Hn+=" ",zn-=4):(Hn+=" ",zn--);return Hn+_n.slice(ke)}const insertNewlineContinueMarkup=({state:_n,dispatch:Ce})=>{let ke=syntaxTree(_n),{doc:$n}=_n,Hn=null,zn=_n.changeByRange(Un=>{if(!Un.empty||!markdownLanguage.isActiveAt(_n,Un.from))return Hn={range:Un};let qn=Un.from,Xn=$n.lineAt(qn),Kn=getContext(ke.resolveInner(qn,-1),$n);for(;Kn.length&&Kn[Kn.length-1].from>qn-Xn.from;)Kn.pop();if(!Kn.length)return Hn={range:Un};let to=Kn[Kn.length-1];if(to.to-to.spaceAfter.length>qn-Xn.from)return Hn={range:Un};let io=qn>=to.to-to.spaceAfter.length&&!/\S/.test(Xn.text.slice(to.to));if(to.item&&io){let So=to.node.firstChild,$o=to.node.getChild("ListItem","ListItem");if(So.to>=qn||$o&&$o.to0&&!/[^\s>]/.test($n.lineAt(Xn.from-1).text)){let Do=Kn.length>1?Kn[Kn.length-2]:null,xo,Io="";Do&&Do.item?(xo=Xn.from+Do.from,Io=Do.marker($n,1)):xo=Xn.from+(Do?Do.to:0);let Vo=[{from:xo,to:qn,insert:Io}];return to.node.name=="OrderedList"&&renumberList(to.item,$n,Vo,-2),Do&&Do.node.name=="OrderedList"&&renumberList(Do.item,$n,Vo),{range:EditorSelection.cursor(xo+Io.length),changes:Vo}}else{let Do=blankLine(Kn,_n,Xn);return{range:EditorSelection.cursor(qn+Do.length+1),changes:{from:Xn.from,insert:Do+_n.lineBreak}}}}if(to.node.name=="Blockquote"&&io&&Xn.from){let So=$n.lineAt(Xn.from-1),$o=/>\s*$/.exec(So.text);if($o&&$o.index==to.from){let Do=_n.changes([{from:So.from+$o.index,to:So.to},{from:Xn.from+to.from,to:Xn.to}]);return{range:Un.map(Do),changes:Do}}}let uo=[];to.node.name=="OrderedList"&&renumberList(to.item,$n,uo);let ho=to.item&&to.item.from]*/.exec(Xn.text)[0].length>=to.to)for(let So=0,$o=Kn.length-1;So<=$o;So++)bo+=So==$o&&!ho?Kn[So].marker($n,1):Kn[So].blank(So<$o?countColumn(Xn.text,4,Kn[So+1].from)-bo.length:null);let Oo=qn;for(;Oo>Xn.from&&/\s/.test(Xn.text.charAt(Oo-Xn.from-1));)Oo--;return bo=normalizeIndent(bo,_n),nonTightList(to.node,_n.doc)&&(bo=blankLine(Kn,_n,Xn)+_n.lineBreak+bo),uo.push({from:Oo,to:qn,insert:_n.lineBreak+bo}),{range:EditorSelection.cursor(Oo+bo.length+1),changes:uo}});return Hn?!1:(Ce(_n.update(zn,{scrollIntoView:!0,userEvent:"input"})),!0)};function isMark(_n){return _n.name=="QuoteMark"||_n.name=="ListMark"}function nonTightList(_n,Ce){if(_n.name!="OrderedList"&&_n.name!="BulletList")return!1;let ke=_n.firstChild,$n=_n.getChild("ListItem","ListItem");if(!$n)return!1;let Hn=Ce.lineAt(ke.to),zn=Ce.lineAt($n.from),Un=/^[\s>]*$/.test(Hn.text);return Hn.number+(Un?0:1){let ke=syntaxTree(_n),$n=null,Hn=_n.changeByRange(zn=>{let Un=zn.from,{doc:qn}=_n;if(zn.empty&&markdownLanguage.isActiveAt(_n,zn.from)){let Xn=qn.lineAt(Un),Kn=getContext(contextNodeForDelete(ke,Un),qn);if(Kn.length){let to=Kn[Kn.length-1],io=to.to-to.spaceAfter.length+(to.spaceAfter?1:0);if(Un-Xn.from>io&&!/\S/.test(Xn.text.slice(io,Un-Xn.from)))return{range:EditorSelection.cursor(Xn.from+io),changes:{from:Xn.from+io,to:Un}};if(Un-Xn.from==io&&(!to.item||Xn.from<=to.item.from||!/\S/.test(Xn.text.slice(0,to.to)))){let uo=Xn.from+to.from;if(to.item&&to.node.from0?to=`![${Kn.record._file.originalName}](${Kn.url})`:to=`[${Kn.record._file.originalName}](${Kn.originalUrl})`;const io=Hn.state.selection.main.head,uo=Hn.state.update({changes:{from:io,insert:to},selection:{anchor:io+1},scrollIntoView:!0});uo&&Hn.dispatch(uo)}onMount(()=>{let Kn=new Compartment,to=new Compartment,io=EditorState.create({doc:zn,extensions:[basicSetup,keymap.of([indentWithTab,...lintKeymap,...completionKeymap]),Kn.of(markdown()),markdown(),autocompletion(),to.of(EditorState.tabSize.of(4)),basicSetup,EditorView.editable.of(Un),EditorView.updateListener.of(function(uo){uo.docChanged&&ke(2,zn=uo.state.doc.toString())}),EditorView.lineWrapping,EditorView.contentAttributes.of({spellcheck:"true"})]});Hn=new EditorView({state:io,parent:$n})}),onDestroy(()=>{Hn&&Hn.destroy()});function Xn(Kn){binding_callbacks[Kn?"unshift":"push"](()=>{$n=Kn,ke(1,$n)})}return _n.$$set=Kn=>{"value"in Kn&&ke(2,zn=Kn.value),"editable"in Kn&&ke(0,Un=Kn.editable)},[Un,$n,zn,qn,Xn]}class CodemirrorMarkdown extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$g,create_fragment$g,safe_not_equal,{value:2,editable:0,insertMedia:3})}get insertMedia(){return this.$$.ctx[3]}}function create_if_block_1$8(_n){let Ce,ke,$n;function Hn(Un){_n[11](Un)}let zn={record:_n[3],field:_n[2],validationErrors:_n[5]};return _n[1]!==void 0&&(zn.graph=_n[1]),Ce=new RichEditorFiles({props:zn}),binding_callbacks.push(()=>bind(Ce,"graph",Hn)),Ce.$on("editor-insert",_n[8]),{c(){create_component(Ce.$$.fragment)},m(Un,qn){mount_component(Ce,Un,qn),$n=!0},p(Un,qn){const Xn={};qn&8&&(Xn.record=Un[3]),qn&4&&(Xn.field=Un[2]),qn&32&&(Xn.validationErrors=Un[5]),!ke&&qn&2&&(ke=!0,Xn.graph=Un[1],add_flush_callback(()=>ke=!1)),Ce.$set(Xn)},i(Un){$n||(transition_in(Ce.$$.fragment,Un),$n=!0)},o(Un){transition_out(Ce.$$.fragment,Un),$n=!1},d(Un){destroy_component(Ce,Un)}}}function create_if_block$b(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[7]),attr(Ce,"class","invalid-feedback d-block")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,Hn){Hn&128&&set_data(ke,$n[7])},d($n){$n&&detach(Ce)}}}function create_fragment$f(_n){let Ce,ke,$n,Hn,zn,Un;function qn(io){_n[10](io)}let Xn={editable:!_n[2].readonly||_n[4]};_n[0]!==void 0&&(Xn.value=_n[0]),ke=new CodemirrorMarkdown({props:Xn}),_n[9](ke),binding_callbacks.push(()=>bind(ke,"value",qn));let Kn=_n[2].collections.length>0&&create_if_block_1$8(_n),to=_n[7]&&create_if_block$b(_n);return{c(){Ce=element("div"),create_component(ke.$$.fragment),Hn=space$3(),Kn&&Kn.c(),zn=space$3(),to&&to.c(),attr(Ce,"class","mb-3")},m(io,uo){insert$1(io,Ce,uo),mount_component(ke,Ce,null),append(Ce,Hn),Kn&&Kn.m(Ce,null),append(Ce,zn),to&&to.m(Ce,null),Un=!0},p(io,[uo]){const ho={};uo&20&&(ho.editable=!io[2].readonly||io[4]),!$n&&uo&1&&($n=!0,ho.value=io[0],add_flush_callback(()=>$n=!1)),ke.$set(ho),io[2].collections.length>0?Kn?(Kn.p(io,uo),uo&4&&transition_in(Kn,1)):(Kn=create_if_block_1$8(io),Kn.c(),transition_in(Kn,1),Kn.m(Ce,zn)):Kn&&(group_outros(),transition_out(Kn,1,1,()=>{Kn=null}),check_outros()),io[7]?to?to.p(io,uo):(to=create_if_block$b(io),to.c(),to.m(Ce,null)):to&&(to.d(1),to=null)},i(io){Un||(transition_in(ke.$$.fragment,io),transition_in(Kn),Un=!0)},o(io){transition_out(ke.$$.fragment,io),transition_out(Kn),Un=!1},d(io){io&&detach(Ce),_n[9](null),destroy_component(ke),Kn&&Kn.d(),to&&to.d()}}}function instance$f(_n,Ce,ke){let $n,{value:Hn}=Ce,{field:zn}=Ce,{graph:Un}=Ce,{record:qn}=Ce,{isCreateMode:Xn}=Ce,{validationErrors:Kn}=Ce,to;function io(Oo){to.insertMedia(Oo.detail)}function uo(Oo){binding_callbacks[Oo?"unshift":"push"](()=>{to=Oo,ke(6,to)})}function ho(Oo){Hn=Oo,ke(0,Hn)}function bo(Oo){Un=Oo,ke(1,Un)}return _n.$$set=Oo=>{"value"in Oo&&ke(0,Hn=Oo.value),"field"in Oo&&ke(2,zn=Oo.field),"graph"in Oo&&ke(1,Un=Oo.graph),"record"in Oo&&ke(3,qn=Oo.record),"isCreateMode"in Oo&&ke(4,Xn=Oo.isCreateMode),"validationErrors"in Oo&&ke(5,Kn=Oo.validationErrors)},_n.$$.update=()=>{_n.$$.dirty&36&&ke(7,$n=getErrorMessage(Kn,zn.name))},[Hn,Un,zn,qn,Xn,Kn,to,$n,io,uo,ho,bo]}class Markdown extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$f,create_fragment$f,safe_not_equal,{value:0,field:2,graph:1,record:3,isCreateMode:4,validationErrors:5})}}function create_if_block$a(_n){let Ce,ke=_n[0].help+"",$n;return{c(){Ce=element("small"),$n=text(ke),attr(Ce,"class","help-text light-text")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,$n)},p(Hn,zn){zn&1&&ke!==(ke=Hn[0].help+"")&&set_data($n,ke)},d(Hn){Hn&&detach(Ce)}}}function create_fragment$e(_n){let Ce,ke,$n,Hn,zn=_n[0].label+"",Un,qn,Xn,Kn,to,io=_n[0].name+"",uo,ho=_n[0].help&&create_if_block$a(_n);return{c(){Ce=element("div"),ke=element("div"),$n=element("div"),Hn=element("label"),Un=text(zn),qn=space$3(),ho&&ho.c(),Xn=space$3(),Kn=element("span"),to=element("code"),uo=text(io),attr(Hn,"for",_n[1]),attr($n,"class","label-and-help"),attr(to,"class","field-id"),attr(Kn,"tabindex","-1"),attr(Kn,"class","text-decoration-none"),attr(ke,"class","labels"),attr(Ce,"class","field-header")},m(bo,Oo){insert$1(bo,Ce,Oo),append(Ce,ke),append(ke,$n),append($n,Hn),append(Hn,Un),append($n,qn),ho&&ho.m($n,null),append(ke,Xn),append(ke,Kn),append(Kn,to),append(to,uo)},p(bo,[Oo]){Oo&1&&zn!==(zn=bo[0].label+"")&&set_data(Un,zn),Oo&2&&attr(Hn,"for",bo[1]),bo[0].help?ho?ho.p(bo,Oo):(ho=create_if_block$a(bo),ho.c(),ho.m($n,null)):ho&&(ho.d(1),ho=null),Oo&1&&io!==(io=bo[0].name+"")&&set_data(uo,io)},i:noop,o:noop,d(bo){bo&&detach(Ce),ho&&ho.d()}}}function instance$e(_n,Ce,ke){let{field:$n}=Ce,{id:Hn}=Ce;return _n.$$set=zn=>{"field"in zn&&ke(0,$n=zn.field),"id"in zn&&ke(1,Hn=zn.id)},[$n,Hn]}class FieldHeader extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$e,create_fragment$e,safe_not_equal,{field:0,id:1})}}function get_each_context$7(_n,Ce,ke){const $n=_n.slice();return $n[3]=Ce[ke],$n}function get_each_context_1$1(_n,Ce,ke){const $n=_n.slice();return $n[24]=Ce[ke],$n}function create_if_block_3$4(_n){let Ce,ke;return{c(){Ce=element("div"),ke=text(_n[8]),attr(Ce,"class","invalid-feedback d-block mb-3")},m($n,Hn){insert$1($n,Ce,Hn),append(Ce,ke)},p($n,Hn){Hn&256&&set_data(ke,$n[8])},d($n){$n&&detach(Ce)}}}function create_if_block_2$4(_n){let Ce=[],ke=new Map,$n,Hn=ensure_array_like(_n[6]);const zn=qn=>qn[24].id;for(let qn=0;qnqn[3].id;for(let qn=0;qn0&&create_if_block$9(_n);return{c(){Ce=element("div"),ho&&ho.c(),ke=space$3(),$n=element("input"),zn=space$3(),Un=element("div"),bo&&bo.c(),qn=space$3(),Oo&&Oo.c(),Xn=space$3(),So&&So.c(),Kn=empty$1(),attr($n,"type","search"),attr($n,"id",_n[2]),attr($n,"placeholder",Hn="Search for "+_n[1].label),attr($n,"autocomplete","off"),toggle_class($n,"is-invalid",_n[8]),attr(Un,"class","reference-tags-results"),attr(Ce,"class","reference-tags")},m($o,Do){insert$1($o,Ce,Do),ho&&ho.m(Ce,null),append(Ce,ke),append(Ce,$n),_n[15]($n),set_input_value($n,_n[5]),append(Ce,zn),append(Ce,Un),bo&&bo.m(Un,null),append(Un,qn),Oo&&Oo.m(Un,null),insert$1($o,Xn,Do),So&&So.m($o,Do),insert$1($o,Kn,Do),to=!0,io||(uo=[listen($n,"keyup",_n[13]),listen($n,"input",_n[16])],io=!0)},p($o,[Do]){$o[8]?ho?ho.p($o,Do):(ho=create_if_block_3$4($o),ho.c(),ho.m(Ce,ke)):ho&&(ho.d(1),ho=null),(!to||Do&4)&&attr($n,"id",$o[2]),(!to||Do&2&&Hn!==(Hn="Search for "+$o[1].label))&&attr($n,"placeholder",Hn),Do&32&&$n.value!==$o[5]&&set_input_value($n,$o[5]),(!to||Do&256)&&toggle_class($n,"is-invalid",$o[8]),$o[6]?bo?bo.p($o,Do):(bo=create_if_block_2$4($o),bo.c(),bo.m(Un,qn)):bo&&(bo.d(1),bo=null),$o[5]?Oo?Oo.p($o,Do):(Oo=create_if_block_1$7($o),Oo.c(),Oo.m(Un,null)):Oo&&(Oo.d(1),Oo=null),$o[7].length>0?So?(So.p($o,Do),Do&128&&transition_in(So,1)):(So=create_if_block$9($o),So.c(),transition_in(So,1),So.m(Kn.parentNode,Kn)):So&&(group_outros(),transition_out(So,1,1,()=>{So=null}),check_outros())},i($o){to||(transition_in(So),to=!0)},o($o){transition_out(So),to=!1},d($o){$o&&(detach(Ce),detach(Xn),detach(Kn)),ho&&ho.d(),_n[15](null),bo&&bo.d(),Oo&&Oo.d(),So&&So.d($o),io=!1,run_all(uo)}}}function instance$d(_n,Ce,ke){let $n,Hn,zn;const Un=getContext$1("channel");let{field:qn}=Ce,{id:Xn}=Ce,{record:Kn}=Ce,{graph:to}=Ce,io,{validationErrors:uo}=Ce,ho="";function bo(os,ms){os.preventDefault(),ke(0,to.edges=to.edges.filter(is=>!(is.target===ms&&is.field===qn.name)),to)}function Oo(os,ms){os.preventDefault(),axios.post(Un.lucentUrl+"/records",{isCreateMode:!0,record:{schema:qn.collections[0],status:"published",data:{[qn.searchField]:ms}}}).then(is=>{ke(6,zn=[]),So(os,is.data.records[0]),console.log(is)}).catch(is=>{ke(6,zn=[]),console.log(is)})}function So(os,ms){os.preventDefault(),ke(0,to=insertEdges(to,Kn,[ms],qn.name,os.detail.action)),ke(5,ho=""),io.focus(),io.blur()}const $o=lodashExports.debounce(os=>{axios.get(Un.lucentUrl+"/records/suggestions",{params:{schema:qn.collections[0],field:qn.searchField,value:ho,ui:"text"}}).then(ms=>{ke(6,zn=ms.data)}).catch(ms=>{ke(6,zn=[]),console.log(ms)})},500);function Do(os){binding_callbacks[os?"unshift":"push"](()=>{io=os,ke(4,io)})}function xo(){ho=this.value,ke(5,ho)}const Io=(os,ms)=>So(ms,os),Vo=(os,ms)=>So(ms,os),Jo=os=>Oo(os,ho),Mo=os=>Oo(os,ho),Go=(os,ms)=>bo(ms,os.id);return _n.$$set=os=>{"field"in os&&ke(1,qn=os.field),"id"in os&&ke(2,Xn=os.id),"record"in os&&ke(3,Kn=os.record),"graph"in os&&ke(0,to=os.graph),"validationErrors"in os&&ke(14,uo=os.validationErrors)},_n.$$.update=()=>{_n.$$.dirty&16386&&ke(8,$n=getErrorMessage(uo,qn.name)),_n.$$.dirty&11&&ke(7,Hn=to.edges.filter(os=>os.field===qn.name).map(os=>to.records.find(ms=>ms.id==os.target&&Kn.id==os.source)).filter(os=>!!(os!=null&&os.id))??[])},ke(6,zn=[]),[to,qn,Xn,Kn,io,ho,zn,Hn,$n,Un,bo,Oo,So,$o,uo,Do,xo,Io,Vo,Jo,Mo,Go]}class ReferenceTags extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$d,create_fragment$d,safe_not_equal,{field:1,id:2,record:3,graph:0,validationErrors:14})}}function create_else_block$5(_n){let Ce,ke,$n,Hn;function zn(Xn){_n[19](Xn)}var Un=_n[7];function qn(Xn,Kn){let to={schema:Xn[3],field:Xn[2],validationErrors:Xn[5],isCreateMode:Xn[6],id:Xn[8]};return Xn[0][Xn[2].name]!==void 0&&(to.value=Xn[0][Xn[2].name]),{props:to}}return Un&&(Ce=construct_svelte_component(Un,qn(_n)),binding_callbacks.push(()=>bind(Ce,"value",zn))),{c(){Ce&&create_component(Ce.$$.fragment),$n=empty$1()},m(Xn,Kn){Ce&&mount_component(Ce,Xn,Kn),insert$1(Xn,$n,Kn),Hn=!0},p(Xn,Kn){if(Un!==(Un=Xn[7])){if(Ce){group_outros();const to=Ce;transition_out(to.$$.fragment,1,0,()=>{destroy_component(to,1)}),check_outros()}Un?(Ce=construct_svelte_component(Un,qn(Xn)),binding_callbacks.push(()=>bind(Ce,"value",zn)),create_component(Ce.$$.fragment),transition_in(Ce.$$.fragment,1),mount_component(Ce,$n.parentNode,$n)):Ce=null}else if(Un){const to={};Kn&8&&(to.schema=Xn[3]),Kn&4&&(to.field=Xn[2]),Kn&32&&(to.validationErrors=Xn[5]),Kn&64&&(to.isCreateMode=Xn[6]),!ke&&Kn&5&&(ke=!0,to.value=Xn[0][Xn[2].name],add_flush_callback(()=>ke=!1)),Ce.$set(to)}},i(Xn){Hn||(Ce&&transition_in(Ce.$$.fragment,Xn),Hn=!0)},o(Xn){Ce&&transition_out(Ce.$$.fragment,Xn),Hn=!1},d(Xn){Xn&&detach($n),Ce&&destroy_component(Ce,Xn)}}}function create_if_block_7(_n){let Ce,ke,$n,Hn;function zn(Xn){_n[17](Xn)}function Un(Xn){_n[18](Xn)}let qn={schema:_n[3],field:_n[2],validationErrors:_n[5],isCreateMode:_n[6],record:_n[4]};return _n[0][_n[2].name]!==void 0&&(qn.value=_n[0][_n[2].name]),_n[1]!==void 0&&(qn.graph=_n[1]),Ce=new Markdown({props:qn}),binding_callbacks.push(()=>bind(Ce,"value",zn)),binding_callbacks.push(()=>bind(Ce,"graph",Un)),{c(){create_component(Ce.$$.fragment)},m(Xn,Kn){mount_component(Ce,Xn,Kn),Hn=!0},p(Xn,Kn){const to={};Kn&8&&(to.schema=Xn[3]),Kn&4&&(to.field=Xn[2]),Kn&32&&(to.validationErrors=Xn[5]),Kn&64&&(to.isCreateMode=Xn[6]),Kn&16&&(to.record=Xn[4]),!ke&&Kn&5&&(ke=!0,to.value=Xn[0][Xn[2].name],add_flush_callback(()=>ke=!1)),!$n&&Kn&2&&($n=!0,to.graph=Xn[1],add_flush_callback(()=>$n=!1)),Ce.$set(to)},i(Xn){Hn||(transition_in(Ce.$$.fragment,Xn),Hn=!0)},o(Xn){transition_out(Ce.$$.fragment,Xn),Hn=!1},d(Xn){destroy_component(Ce,Xn)}}}function create_if_block_6(_n){let Ce,ke,$n,Hn;function zn(Xn){_n[15](Xn)}function Un(Xn){_n[16](Xn)}let qn={schema:_n[3],field:_n[2],validationErrors:_n[5],isCreateMode:_n[6],record:_n[4]};return _n[0][_n[2].name]!==void 0&&(qn.value=_n[0][_n[2].name]),_n[1]!==void 0&&(qn.graph=_n[1]),Ce=new RichEditor({props:qn}),binding_callbacks.push(()=>bind(Ce,"value",zn)),binding_callbacks.push(()=>bind(Ce,"graph",Un)),{c(){create_component(Ce.$$.fragment)},m(Xn,Kn){mount_component(Ce,Xn,Kn),Hn=!0},p(Xn,Kn){const to={};Kn&8&&(to.schema=Xn[3]),Kn&4&&(to.field=Xn[2]),Kn&32&&(to.validationErrors=Xn[5]),Kn&64&&(to.isCreateMode=Xn[6]),Kn&16&&(to.record=Xn[4]),!ke&&Kn&5&&(ke=!0,to.value=Xn[0][Xn[2].name],add_flush_callback(()=>ke=!1)),!$n&&Kn&2&&($n=!0,to.graph=Xn[1],add_flush_callback(()=>$n=!1)),Ce.$set(to)},i(Xn){Hn||(transition_in(Ce.$$.fragment,Xn),Hn=!0)},o(Xn){transition_out(Ce.$$.fragment,Xn),Hn=!1},d(Xn){destroy_component(Ce,Xn)}}}function create_if_block_5$1(_n){let Ce,ke,$n;function Hn(Un){_n[14](Un)}let zn={field:_n[2],validationErrors:_n[5],isCreateMode:_n[6],id:_n[8]};return _n[0][_n[2].name]!==void 0&&(zn.value=_n[0][_n[2].name]),Ce=new Textarea({props:zn}),binding_callbacks.push(()=>bind(Ce,"value",Hn)),{c(){create_component(Ce.$$.fragment)},m(Un,qn){mount_component(Ce,Un,qn),$n=!0},p(Un,qn){const Xn={};qn&4&&(Xn.field=Un[2]),qn&32&&(Xn.validationErrors=Un[5]),qn&64&&(Xn.isCreateMode=Un[6]),!ke&&qn&5&&(ke=!0,Xn.value=Un[0][Un[2].name],add_flush_callback(()=>ke=!1)),Ce.$set(Xn)},i(Un){$n||(transition_in(Ce.$$.fragment,Un),$n=!0)},o(Un){transition_out(Ce.$$.fragment,Un),$n=!1},d(Un){destroy_component(Ce,Un)}}}function create_if_block_4$2(_n){let Ce,ke,$n;function Hn(Un){_n[13](Un)}let zn={field:_n[2],id:_n[8],validationErrors:_n[5],isCreateMode:_n[6]};return _n[0][_n[2].name]!==void 0&&(zn.value=_n[0][_n[2].name]),Ce=new Slug({props:zn}),binding_callbacks.push(()=>bind(Ce,"value",Hn)),{c(){create_component(Ce.$$.fragment)},m(Un,qn){mount_component(Ce,Un,qn),$n=!0},p(Un,qn){const Xn={};qn&4&&(Xn.field=Un[2]),qn&32&&(Xn.validationErrors=Un[5]),qn&64&&(Xn.isCreateMode=Un[6]),!ke&&qn&5&&(ke=!0,Xn.value=Un[0][Un[2].name],add_flush_callback(()=>ke=!1)),Ce.$set(Xn)},i(Un){$n||(transition_in(Ce.$$.fragment,Un),$n=!0)},o(Un){transition_out(Ce.$$.fragment,Un),$n=!1},d(Un){destroy_component(Ce,Un)}}}function create_if_block_3$3(_n){let Ce,ke,$n;function Hn(Un){_n[12](Un)}let zn={field:_n[2],id:_n[8],validationErrors:_n[5],isCreateMode:_n[6]};return _n[0][_n[2].name]!==void 0&&(zn.value=_n[0][_n[2].name]),Ce=new Text$2({props:zn}),binding_callbacks.push(()=>bind(Ce,"value",Hn)),{c(){create_component(Ce.$$.fragment)},m(Un,qn){mount_component(Ce,Un,qn),$n=!0},p(Un,qn){const Xn={};qn&4&&(Xn.field=Un[2]),qn&32&&(Xn.validationErrors=Un[5]),qn&64&&(Xn.isCreateMode=Un[6]),!ke&&qn&5&&(ke=!0,Xn.value=Un[0][Un[2].name],add_flush_callback(()=>ke=!1)),Ce.$set(Xn)},i(Un){$n||(transition_in(Ce.$$.fragment,Un),$n=!0)},o(Un){transition_out(Ce.$$.fragment,Un),$n=!1},d(Un){destroy_component(Ce,Un)}}}function create_if_block_2$3(_n){let Ce,ke,$n;function Hn(Un){_n[11](Un)}let zn={record:_n[4],field:_n[2],validationErrors:_n[5]};return _n[1]!==void 0&&(zn.graph=_n[1]),Ce=new File$1({props:zn}),binding_callbacks.push(()=>bind(Ce,"graph",Hn)),{c(){create_component(Ce.$$.fragment)},m(Un,qn){mount_component(Ce,Un,qn),$n=!0},p(Un,qn){const Xn={};qn&16&&(Xn.record=Un[4]),qn&4&&(Xn.field=Un[2]),qn&32&&(Xn.validationErrors=Un[5]),!ke&&qn&2&&(ke=!0,Xn.graph=Un[1],add_flush_callback(()=>ke=!1)),Ce.$set(Xn)},i(Un){$n||(transition_in(Ce.$$.fragment,Un),$n=!0)},o(Un){transition_out(Ce.$$.fragment,Un),$n=!1},d(Un){destroy_component(Ce,Un)}}}function create_if_block_1$6(_n){let Ce,ke,$n;function Hn(Un){_n[10](Un)}let zn={id:_n[8],record:_n[4],field:_n[2],validationErrors:_n[5]};return _n[1]!==void 0&&(zn.graph=_n[1]),Ce=new Reference({props:zn}),binding_callbacks.push(()=>bind(Ce,"graph",Hn)),{c(){create_component(Ce.$$.fragment)},m(Un,qn){mount_component(Ce,Un,qn),$n=!0},p(Un,qn){const Xn={};qn&16&&(Xn.record=Un[4]),qn&4&&(Xn.field=Un[2]),qn&32&&(Xn.validationErrors=Un[5]),!ke&&qn&2&&(ke=!0,Xn.graph=Un[1],add_flush_callback(()=>ke=!1)),Ce.$set(Xn)},i(Un){$n||(transition_in(Ce.$$.fragment,Un),$n=!0)},o(Un){transition_out(Ce.$$.fragment,Un),$n=!1},d(Un){destroy_component(Ce,Un)}}}function create_if_block$8(_n){let Ce,ke,$n;function Hn(Un){_n[9](Un)}let zn={id:_n[8],record:_n[4],field:_n[2],validationErrors:_n[5]};return _n[1]!==void 0&&(zn.graph=_n[1]),Ce=new ReferenceTags({props:zn}),binding_callbacks.push(()=>bind(Ce,"graph",Hn)),{c(){create_component(Ce.$$.fragment)},m(Un,qn){mount_component(Ce,Un,qn),$n=!0},p(Un,qn){const Xn={};qn&16&&(Xn.record=Un[4]),qn&4&&(Xn.field=Un[2]),qn&32&&(Xn.validationErrors=Un[5]),!ke&&qn&2&&(ke=!0,Xn.graph=Un[1],add_flush_callback(()=>ke=!1)),Ce.$set(Xn)},i(Un){$n||(transition_in(Ce.$$.fragment,Un),$n=!0)},o(Un){transition_out(Ce.$$.fragment,Un),$n=!1},d(Un){destroy_component(Ce,Un)}}}function create_fragment$c(_n){let Ce,ke,$n,Hn,zn,Un;ke=new FieldHeader({props:{field:_n[2],id:_n[8]}});const qn=[create_if_block$8,create_if_block_1$6,create_if_block_2$3,create_if_block_3$3,create_if_block_4$2,create_if_block_5$1,create_if_block_6,create_if_block_7,create_else_block$5],Xn=[];function Kn(to,io){return to[2].info.name==="reference"&&to[2].layout==="tags"?0:to[2].info.name==="reference"?1:to[2].info.name==="file"?2:to[2].info.name==="text"?3:to[2].info.name==="slug"?4:to[2].info.name==="textarea"?5:to[2].info.name==="rich"?6:to[2].info.name==="markdown"?7:8}return Hn=Kn(_n),zn=Xn[Hn]=qn[Hn](_n),{c(){Ce=element("div"),create_component(ke.$$.fragment),$n=space$3(),zn.c(),attr(Ce,"class","editor-field")},m(to,io){insert$1(to,Ce,io),mount_component(ke,Ce,null),append(Ce,$n),Xn[Hn].m(Ce,null),Un=!0},p(to,[io]){const uo={};io&4&&(uo.field=to[2]),ke.$set(uo);let ho=Hn;Hn=Kn(to),Hn===ho?Xn[Hn].p(to,io):(group_outros(),transition_out(Xn[ho],1,1,()=>{Xn[ho]=null}),check_outros(),zn=Xn[Hn],zn?zn.p(to,io):(zn=Xn[Hn]=qn[Hn](to),zn.c()),transition_in(zn,1),zn.m(Ce,null))},i(to){Un||(transition_in(ke.$$.fragment,to),transition_in(zn),Un=!0)},o(to){transition_out(ke.$$.fragment,to),transition_out(zn),Un=!1},d(to){to&&detach(Ce),destroy_component(ke),Xn[Hn].d()}}}function instance$c(_n,Ce,ke){const $n={text:Text$2,slug:Slug,textarea:Textarea,rich:RichEditor,color:Color,checkbox:Checkbox,number:Number$1,url:Url,date:Date$1,datetime:Datetime,uuid:UUID,json:JSON$1,markdown:Markdown};let{field:Hn}=Ce,{data:zn}=Ce,{schema:Un}=Ce,{record:qn}=Ce,{graph:Xn}=Ce,{validationErrors:Kn}=Ce,{isCreateMode:to}=Ce,io=$n[Hn.info.name];const uo=`field-${Hn.name}-${qn.id}`;function ho(Go){Xn=Go,ke(1,Xn)}function bo(Go){Xn=Go,ke(1,Xn)}function Oo(Go){Xn=Go,ke(1,Xn)}function So(Go){_n.$$.not_equal(zn[Hn.name],Go)&&(zn[Hn.name]=Go,ke(0,zn))}function $o(Go){_n.$$.not_equal(zn[Hn.name],Go)&&(zn[Hn.name]=Go,ke(0,zn))}function Do(Go){_n.$$.not_equal(zn[Hn.name],Go)&&(zn[Hn.name]=Go,ke(0,zn))}function xo(Go){_n.$$.not_equal(zn[Hn.name],Go)&&(zn[Hn.name]=Go,ke(0,zn))}function Io(Go){Xn=Go,ke(1,Xn)}function Vo(Go){_n.$$.not_equal(zn[Hn.name],Go)&&(zn[Hn.name]=Go,ke(0,zn))}function Jo(Go){Xn=Go,ke(1,Xn)}function Mo(Go){_n.$$.not_equal(zn[Hn.name],Go)&&(zn[Hn.name]=Go,ke(0,zn))}return _n.$$set=Go=>{"field"in Go&&ke(2,Hn=Go.field),"data"in Go&&ke(0,zn=Go.data),"schema"in Go&&ke(3,Un=Go.schema),"record"in Go&&ke(4,qn=Go.record),"graph"in Go&&ke(1,Xn=Go.graph),"validationErrors"in Go&&ke(5,Kn=Go.validationErrors),"isCreateMode"in Go&&ke(6,to=Go.isCreateMode)},[zn,Xn,Hn,Un,qn,Kn,to,io,uo,ho,bo,Oo,So,$o,Do,xo,Io,Vo,Jo,Mo]}class FormField extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$c,create_fragment$c,safe_not_equal,{field:2,data:0,schema:3,record:4,graph:1,validationErrors:5,isCreateMode:6})}}function get_each_context$6(_n,Ce,ke){const $n=_n.slice();return $n[3]=Ce[ke],$n}function create_else_block$4(_n){let Ce;return{c(){Ce=text("Nothing links to this record")},m(ke,$n){insert$1(ke,Ce,$n)},d(ke){ke&&detach(Ce)}}}function create_each_block$6(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn;return qn=new PreviewReference({props:{record:_n[3].record,hasDelete:!1,graph:_n[0]}}),{c(){Ce=element("div"),ke=element("span"),$n=text("In "),Hn=element("i"),Hn.textContent=`${_n[3].field}`,zn=text(" of"),Un=space$3(),create_component(qn.$$.fragment),Xn=space$3(),set_style(ke,"font-size","14px"),set_style(ke,"margin-bottom","5px"),set_style(ke,"display","block"),set_style(Ce,"margin","0 0 15px"),set_style(Ce,"position","relative")},m(to,io){insert$1(to,Ce,io),append(Ce,ke),append(ke,$n),append(ke,Hn),append(ke,zn),append(Ce,Un),mount_component(qn,Ce,null),append(Ce,Xn),Kn=!0},p(to,io){const uo={};io&1&&(uo.graph=to[0]),qn.$set(uo)},i(to){Kn||(transition_in(qn.$$.fragment,to),Kn=!0)},o(to){transition_out(qn.$$.fragment,to),Kn=!1},d(to){to&&detach(Ce),destroy_component(qn)}}}function create_fragment$b(_n){let Ce,ke,$n=ensure_array_like(_n[1]),Hn=[];for(let qn=0;qn<$n.length;qn+=1)Hn[qn]=create_each_block$6(get_each_context$6(_n,$n,qn));const zn=qn=>transition_out(Hn[qn],1,1,()=>{Hn[qn]=null});let Un=null;return $n.length||(Un=create_else_block$4()),{c(){Ce=element("div");for(let qn=0;qnke.name===Ce)}function instance$b(_n,Ce,ke){const $n=getContext$1("channel");let{graph:Hn}=Ce,zn=Hn.parentEdges.map(Un=>{let qn=$n.schemas.find(Kn=>Kn.name===Un.sourceSchema),Xn=findEdgeField(qn,Un.field);return Xn?{field:Xn.label,record:Hn.records.find(Kn=>Kn.id===Un.source)}:null}).filter(Un=>!!Un);return _n.$$set=Un=>{"graph"in Un&&ke(0,Hn=Un.graph)},[Hn,zn]}class Graph extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$b,create_fragment$b,safe_not_equal,{graph:0})}}function get_each_context$5(_n,Ce,ke){const $n=_n.slice();return $n[4]=Ce[ke],$n}function create_else_block_1$1(_n){let Ce,ke=(JSON.stringify(_n[1])??"")+"",$n,Hn;return{c(){Ce=element("div"),$n=text(ke),attr(Ce,"class",Hn=_n[3]+" field-content svelte-md34ba")},m(zn,Un){insert$1(zn,Ce,Un),append(Ce,$n)},p(zn,Un){Un&2&&ke!==(ke=(JSON.stringify(zn[1])??"")+"")&&set_data($n,ke),Un&8&&Hn!==(Hn=zn[3]+" field-content svelte-md34ba")&&attr(Ce,"class",Hn)},i:noop,o:noop,d(zn){zn&&detach(Ce)}}}function create_if_block_3$2(_n){let Ce,ke=(_n[1]??"")+"",$n;return{c(){Ce=element("div"),attr(Ce,"class",$n=_n[3]+" field-content svelte-md34ba")},m(Hn,zn){insert$1(Hn,Ce,zn),Ce.innerHTML=ke},p(Hn,zn){zn&2&&ke!==(ke=(Hn[1]??"")+"")&&(Ce.innerHTML=ke),zn&8&&$n!==($n=Hn[3]+" field-content svelte-md34ba")&&attr(Ce,"class",$n)},i:noop,o:noop,d(Hn){Hn&&detach(Ce)}}}function create_if_block_2$2(_n){let Ce,ke=(JSON.stringify(_n[1],null,2)??"")+"",$n,Hn;return{c(){Ce=element("div"),$n=text(ke),attr(Ce,"class",Hn=_n[3]+" field-content svelte-md34ba"),set_style(Ce,"white-space","break-spaces")},m(zn,Un){insert$1(zn,Ce,Un),append(Ce,$n)},p(zn,Un){Un&2&&ke!==(ke=(JSON.stringify(zn[1],null,2)??"")+"")&&set_data($n,ke),Un&8&&Hn!==(Hn=zn[3]+" field-content svelte-md34ba")&&attr(Ce,"class",Hn)},i:noop,o:noop,d(zn){zn&&detach(Ce)}}}function create_if_block$7(_n){let Ce,ke,$n,Hn,zn=ensure_array_like(_n[2][_n[0].name]),Un=[];for(let Xn=0;Xntransition_out(Un[Xn],1,1,()=>{Un[Xn]=null});return{c(){Ce=element("div"),ke=element("div");for(let Xn=0;Xn{Un[to]=null}),check_outros(),ke=Un[Ce],ke?ke.p(Xn,Kn):(ke=Un[Ce]=zn[Ce](Xn),ke.c()),transition_in(ke,1),ke.m($n.parentNode,$n))},i(Xn){Hn||(transition_in(ke),Hn=!0)},o(Xn){transition_out(ke),Hn=!1},d(Xn){Xn&&detach($n),Un[Ce].d(Xn)}}}function create_fragment$a(_n){let Ce,ke,$n,Hn,zn,Un;const qn=[create_if_block$7,create_if_block_2$2,create_if_block_3$2,create_else_block_1$1],Xn=[];function Kn(to,io){return io&1&&(Ce=null),io&1&&(ke=null),Ce==null&&(Ce=!!["reference","file"].includes(to[0].info.name)),Ce?0:(ke==null&&(ke=!!["json","block"].includes(to[0].info.name)),ke?1:to[0].info.name==="rich"?2:3)}return $n=Kn(_n,-1),Hn=Xn[$n]=qn[$n](_n),{c(){Hn.c(),zn=empty$1()},m(to,io){Xn[$n].m(to,io),insert$1(to,zn,io),Un=!0},p(to,[io]){let uo=$n;$n=Kn(to,io),$n===uo?Xn[$n].p(to,io):(group_outros(),transition_out(Xn[uo],1,1,()=>{Xn[uo]=null}),check_outros(),Hn=Xn[$n],Hn?Hn.p(to,io):(Hn=Xn[$n]=qn[$n](to),Hn.c()),transition_in(Hn,1),Hn.m(zn.parentNode,zn))},i(to){Un||(transition_in(Hn),Un=!0)},o(to){transition_out(Hn),Un=!1},d(to){to&&detach(zn),Xn[$n].d(to)}}}function instance$a(_n,Ce,ke){let{field:$n}=Ce,{side:Hn}=Ce,{edges:zn}=Ce,{colorClass:Un}=Ce;return _n.$$set=qn=>{"field"in qn&&ke(0,$n=qn.field),"side"in qn&&ke(1,Hn=qn.side),"edges"in qn&&ke(2,zn=qn.edges),"colorClass"in qn&&ke(3,Un=qn.colorClass)},[$n,Hn,zn,Un]}class RevisionCell extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$a,create_fragment$a,safe_not_equal,{field:0,side:1,edges:2,colorClass:3})}}function create_fragment$9(_n){let Ce,ke,$n,Hn=_n[0].rank+"",zn,Un,qn,Xn,Kn,to=_n[0].target+"",io,uo;return{c(){Ce=element("div"),ke=element("span"),$n=text("Rank: "),zn=text(Hn),Un=space$3(),qn=element("span"),qn.textContent="id:",Xn=space$3(),Kn=element("a"),io=text(to),attr(ke,"class","me-3"),attr(Kn,"href",uo=_n[1].lucentUrl+"/records/"+_n[0].target),attr(Kn,"target","_blank")},m(ho,bo){insert$1(ho,Ce,bo),append(Ce,ke),append(ke,$n),append(ke,zn),append(Ce,Un),append(Ce,qn),append(Ce,Xn),append(Ce,Kn),append(Kn,io)},p(ho,[bo]){bo&1&&Hn!==(Hn=ho[0].rank+"")&&set_data(zn,Hn),bo&1&&to!==(to=ho[0].target+"")&&set_data(io,to),bo&1&&uo!==(uo=ho[1].lucentUrl+"/records/"+ho[0].target)&&attr(Kn,"href",uo)},i:noop,o:noop,d(ho){ho&&detach(Ce)}}}function instance$9(_n,Ce,ke){const $n=getContext$1("channel");let{edge:Hn}=Ce;return _n.$$set=zn=>{"edge"in zn&&ke(0,Hn=zn.edge)},[Hn,$n]}class RevisionEdgeRow extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$9,create_fragment$9,safe_not_equal,{edge:0})}}function get_each_context$4(_n,Ce,ke){const $n=_n.slice();return $n[16]=Ce[ke][0],$n[17]=Ce[ke][1],$n}function get_each_context_1(_n,Ce,ke){const $n=_n.slice();return $n[20]=Ce[ke],$n}function get_each_context_2(_n,Ce,ke){const $n=_n.slice();return $n[20]=Ce[ke],$n}function get_each_context_3(_n,Ce,ke){const $n=_n.slice();return $n[16]=Ce[ke],$n}function get_each_context_4(_n,Ce,ke){const $n=_n.slice();return $n[27]=Ce[ke],$n}function create_else_block_3(_n){let Ce;return{c(){Ce=element("div"),Ce.innerHTML="Revisions are not enabled for this Schema",attr(Ce,"class","card-body")},m(ke,$n){insert$1(ke,Ce,$n)},p:noop,i:noop,o:noop,d(ke){ke&&detach(Ce)}}}function create_if_block_3$1(_n){let Ce,ke,$n,Hn,zn=ensure_array_like(_n[8]),Un=[];for(let Xn=0;Xntransition_out(Un[Xn],1,1,()=>{Un[Xn]=null});return{c(){Ce=element("div"),Ce.textContent="Revisions",ke=space$3();for(let Xn=0;Xn{$n=null}),check_outros())},i(Hn){ke||(transition_in($n),ke=!0)},o(Hn){transition_out($n),ke=!1},d(Hn){Hn&&detach(Ce),$n&&$n.d(Hn)}}}function create_if_block$6(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn;const Kn=[create_if_block_1$4,create_else_block_2],to=[];function io(Oo,So){return Oo[6].length>0?0:1}ke=io(_n),$n=to[ke]=Kn[ke](_n);let uo=ensure_array_like(Object.entries(_n[7])),ho=[];for(let Oo=0;Ootransition_out(ho[Oo],1,1,()=>{ho[Oo]=null});return{c(){Ce=element("div"),$n.c(),Hn=space$3(),zn=element("div"),Un=element("p"),Un.textContent="Record References",qn=space$3();for(let Oo=0;Oo{to[$o]=null}),check_outros(),$n=to[ke],$n?$n.p(Oo,So):($n=to[ke]=Kn[ke](Oo),$n.c()),transition_in($n,1),$n.m(Ce,Hn)),So&128){uo=ensure_array_like(Object.entries(Oo[7]));let Do;for(Do=0;DoNothing will change
    ",attr(Ce,"class","lx-card text-center")},m(ke,$n){insert$1(ke,Ce,$n)},p:noop,i:noop,o:noop,d(ke){ke&&detach(Ce)}}}function create_if_block_1$4(_n){let Ce,ke,$n,Hn,zn=_n[5]._sys.version+"",Un,qn,Xn,Kn,to,io,uo,ho=_n[4]&&create_if_block_2$1(_n),bo=ensure_array_like(_n[6]),Oo=[];for(let $o=0;$otransition_out(Oo[$o],1,1,()=>{Oo[$o]=null});return{c(){Ce=element("p"),Ce.textContent="If you choose to rollback to this revision",ke=space$3(),$n=element("button"),Hn=text("Rollback to version "),Un=text(zn),qn=space$3(),ho&&ho.c(),Xn=space$3(),Kn=element("div");for(let $o=0;$otransition_out($o[Go],1,1,()=>{$o[Go]=null});let xo=null;So.length||(xo=create_else_block_1());let Io=ensure_array_like(_n[17].revision),Vo=[];for(let Go=0;Gotransition_out(Vo[Go],1,1,()=>{Vo[Go]=null});let Mo=null;return Io.length||(Mo=create_else_block$2()),{c(){Ce=element("div"),ke=element("div"),Hn=text($n),zn=text(":"),Un=space$3(),qn=element("div"),Xn=element("p"),Xn.textContent="Record",Kn=space$3();for(let Go=0;Go<$o.length;Go+=1)$o[Go].c();xo&&xo.c(),to=space$3(),io=element("div"),uo=element("p"),uo.textContent="Revision",ho=space$3();for(let Go=0;Go0?0:1}Qs=Zs(_n),zo=Il[Qs]=za[Qs](_n);let Sr=_n[5]&&create_if_block$6(_n);return{c(){Ce=element("div"),ke=element("div"),$n=element("div"),Hn=element("div"),zn=element("span"),zn.textContent="record id",Un=space$3(),qn=element("small"),Kn=text(Xn),to=space$3(),io=element("div"),uo=element("span"),uo.textContent="current version",ho=space$3(),Oo=text(bo),So=space$3(),$o=element("div"),Do=element("span"),Do.textContent="created",xo=space$3(),create_component(Io.$$.fragment),Vo=space$3(),Mo=text(Jo),Go=space$3(),os=element("div"),ms=element("span"),ms.textContent="updated",is=space$3(),create_component(Yo.$$.fragment),Ys=space$3(),Js=text(sr),ko=space$3(),gs=element("div"),xs=element("span"),xs.textContent="Rules for this schema",Qr=space$3(),cr=element("small"),ws=text("Each record maintains the last "),Br=text(Fs),_r=text(` + versions`),ha=space$3(),hs=element("div"),zo.c(),el=space$3(),ga=element("div"),Sr&&Sr.c(),attr(zn,"class","label text-end text-muted"),attr(uo,"class","label text-end text-muted"),attr(Do,"class","label text-end text-muted"),attr(ms,"class","label text-end text-muted"),attr($n,"class","col-8"),attr(xs,"class","label d-block text-muted "),attr(gs,"class","col-4"),attr(ke,"class","row"),attr(Ce,"class","lx-card "),attr(hs,"class","revisions")},m(Us,fs){insert$1(Us,Ce,fs),append(Ce,ke),append(ke,$n),append($n,Hn),append(Hn,zn),append(Hn,Un),append(Hn,qn),append(qn,Kn),append($n,to),append($n,io),append(io,uo),append(io,ho),append(io,Oo),append($n,So),append($n,$o),append($o,Do),append($o,xo),mount_component(Io,$o,null),append($o,Vo),append($o,Mo),append($n,Go),append($n,os),append(os,ms),append(os,is),mount_component(Yo,os,null),append(os,Ys),append(os,Js),append(ke,ko),append(ke,gs),append(gs,xs),append(gs,Qr),append(gs,cr),append(cr,ws),append(cr,Br),append(cr,_r),insert$1(Us,ha,fs),insert$1(Us,hs,fs),Il[Qs].m(hs,null),insert$1(Us,el,fs),insert$1(Us,ga,fs),Sr&&Sr.m(ga,null),_n[13](ga),Ca=!0},p(Us,[fs]){(!Ca||fs&1)&&Xn!==(Xn=Us[0].id+"")&&set_data(Kn,Xn),(!Ca||fs&1)&&bo!==(bo=Us[0]._sys.version+"")&&set_data(Oo,bo);const dr={};fs&3&&(dr.name=usernameById(Us[1],Us[0]._sys.createdBy)),Io.$set(dr),(!Ca||fs&1)&&Jo!==(Jo=friendlyDate(Us[0]._sys.createdAt)+"")&&set_data(Mo,Jo);const Vr={};fs&3&&(Vr.name=usernameById(Us[1],Us[0]._sys.updatedBy)),Yo.$set(Vr),(!Ca||fs&1)&&sr!==(sr=friendlyDate(Us[0]._sys.updatedAt)+"")&&set_data(Js,sr),(!Ca||fs&4)&&Fs!==(Fs=Us[2].revisions+"")&&set_data(Br,Fs);let nr=Qs;Qs=Zs(Us),Qs===nr?Il[Qs].p(Us,fs):(group_outros(),transition_out(Il[nr],1,1,()=>{Il[nr]=null}),check_outros(),zo=Il[Qs],zo?zo.p(Us,fs):(zo=Il[Qs]=za[Qs](Us),zo.c()),transition_in(zo,1),zo.m(hs,null)),Us[5]?Sr?(Sr.p(Us,fs),fs&32&&transition_in(Sr,1)):(Sr=create_if_block$6(Us),Sr.c(),transition_in(Sr,1),Sr.m(ga,null)):Sr&&(group_outros(),transition_out(Sr,1,1,()=>{Sr=null}),check_outros())},i(Us){Ca||(transition_in(Io.$$.fragment,Us),transition_in(Yo.$$.fragment,Us),transition_in(zo),transition_in(Sr),Ca=!0)},o(Us){transition_out(Io.$$.fragment,Us),transition_out(Yo.$$.fragment,Us),transition_out(zo),transition_out(Sr),Ca=!1},d(Us){Us&&(detach(Ce),detach(ha),detach(hs),detach(el),detach(ga)),destroy_component(Io),destroy_component(Yo),Il[Qs].d(),Sr&&Sr.d(),_n[13](null)}}}function instance$8(_n,Ce,ke){let $n,Hn,zn,Un;const qn=getContext$1("channel");let{record:Xn}=Ce,{graph:Kn}=Ce,{users:to}=Ce,{schema:io}=Ce,uo,ho="";axios.get(`${qn.lucentUrl}/records/${Xn.id}/revisions`).then(xo=>{ke(8,$n=xo.data)}).catch(xo=>{console.log(xo)});function bo(xo,Io){ke(7,Un=Kn.edges.filter(Vo=>Vo.depth===1).reduce((Vo,Jo)=>(Vo[Jo.field]||(Vo[Jo.field]={record:[],revision:[]}),Vo[Jo.field].record.push(Jo),Vo),{})),ke(7,Un=Io._edges.reduce((Vo,Jo)=>(Vo[Jo.field]||(Vo[Jo.field]={record:[],revision:[]}),Vo[Jo.field].revision.push(Jo),Vo),Un))}function Oo(xo,Io){xo.preventDefault(),ke(5,zn=Io),ke(6,Hn=io.fields.filter(Vo=>!lodashExports.isEqual(zn.data[Vo.name],Xn.data[Vo.name]))),bo(Hn,Io),uo.scrollIntoView()}function So(xo){xo.preventDefault(),ke(4,ho=""),axios.post(`${qn.lucentUrl}/records/${Xn.id}/rollback/${zn._sys.version}`).then(Io=>{window.location.reload()}).catch(Io=>{const Vo=Io.response.data.error;ke(4,ho=Vo.fieldLabel+": "+Vo.message)})}const $o=(xo,Io)=>Oo(Io,xo);function Do(xo){binding_callbacks[xo?"unshift":"push"](()=>{uo=xo,ke(3,uo)})}return _n.$$set=xo=>{"record"in xo&&ke(0,Xn=xo.record),"graph"in xo&&ke(11,Kn=xo.graph),"users"in xo&&ke(1,to=xo.users),"schema"in xo&&ke(2,io=xo.schema)},ke(8,$n=[]),ke(6,Hn=[]),ke(5,zn=null),ke(7,Un={}),[Xn,to,io,uo,ho,zn,Hn,Un,$n,Oo,So,Kn,$o,Do]}class Info extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$8,create_fragment$8,safe_not_equal,{record:0,graph:11,users:1,schema:2})}}const{window:window_1}=globals;function get_each_context$3(_n,Ce,ke){const $n=_n.slice();return $n[21]=Ce[ke],$n}function create_if_block_5(_n){let Ce,ke,$n;return{c(){Ce=element("button"),Ce.innerHTML=` + Save`,attr(Ce,"type","button"),attr(Ce,"class","button primary ms-2 btn btn-primary btn-spinner")},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"click",_n[11]),ke=!0)},p:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function create_if_block_4(_n){let Ce,ke,$n;return{c(){Ce=element("button"),Ce.innerHTML=` + Create`,attr(Ce,"class","button primary btn-spinner")},m(Hn,zn){insert$1(Hn,Ce,zn),ke||($n=listen(Ce,"click",_n[11]),ke=!0)},p:noop,d(Hn){Hn&&detach(Ce),ke=!1,$n()}}}function create_if_block_3(_n){let Ce,ke;return Ce=new Info({props:{record:_n[0],graph:_n[1],users:_n[4],schema:_n[2]}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&1&&(zn.record=$n[0]),Hn&2&&(zn.graph=$n[1]),Hn&16&&(zn.users=$n[4]),Hn&4&&(zn.schema=$n[2]),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_if_block_2(_n){let Ce,ke;return Ce=new Graph({props:{graph:_n[1],record:_n[0]}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&2&&(zn.graph=$n[1]),Hn&1&&(zn.record=$n[0]),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_if_block$5(_n){let Ce,ke,$n=[],Hn=new Map,zn,Un;Ce=new FilePreview({props:{record:_n[0],schema:_n[2]}});let qn=ensure_array_like(_n[9]);const Xn=Kn=>Kn[21].name;for(let Kn=0;Knbind(Ce,"data",zn)),binding_callbacks.push(()=>bind(Ce,"graph",Un)),{c(){create_component(Ce.$$.fragment)},m(Xn,Kn){mount_component(Ce,Xn,Kn),Hn=!0},p(Xn,Kn){const to={};Kn&4&&(to.schema=Xn[2]),Kn&1&&(to.record=Xn[0]),Kn&32&&(to.validationErrors=Xn[5]),Kn&8&&(to.isCreateMode=Xn[3]),!ke&&Kn&1&&(ke=!0,to.data=Xn[0].data,add_flush_callback(()=>ke=!1)),!$n&&Kn&2&&($n=!0,to.graph=Xn[1],add_flush_callback(()=>$n=!1)),Ce.$set(to)},i(Xn){Hn||(transition_in(Ce.$$.fragment,Xn),Hn=!0)},o(Xn){transition_out(Ce.$$.fragment,Xn),Hn=!1},d(Xn){destroy_component(Ce,Xn)}}}function create_each_block$3(_n,Ce){let ke,$n,Hn,zn=Ce[6]===Ce[21].group&&create_if_block_1$3(Ce);return{key:_n,first:null,c(){ke=empty$1(),zn&&zn.c(),$n=empty$1(),this.first=ke},m(Un,qn){insert$1(Un,ke,qn),zn&&zn.m(Un,qn),insert$1(Un,$n,qn),Hn=!0},p(Un,qn){Ce=Un,Ce[6]===Ce[21].group?zn?(zn.p(Ce,qn),qn&64&&transition_in(zn,1)):(zn=create_if_block_1$3(Ce),zn.c(),transition_in(zn,1),zn.m($n.parentNode,$n)):zn&&(group_outros(),transition_out(zn,1,1,()=>{zn=null}),check_outros())},i(Un){Hn||(transition_in(zn),Hn=!0)},o(Un){transition_out(zn),Hn=!1},d(Un){Un&&(detach(ke),detach($n)),zn&&zn.d(Un)}}}function create_fragment$7(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo,So,$o,Do,xo,Io,Vo;function Jo(gs){_n[12](gs)}function Mo(gs){_n[13](gs)}let Go={schema:_n[2],isCreateMode:_n[3]};_n[0]!==void 0&&(Go.record=_n[0]),_n[6]!==void 0&&(Go.activeContentTab=_n[6]),$n=new EditHeader({props:Go}),binding_callbacks.push(()=>bind($n,"record",Jo)),binding_callbacks.push(()=>bind($n,"activeContentTab",Mo));function os(gs,xs){if(gs[3])return create_if_block_4;if(gs[8])return create_if_block_5}let ms=os(_n),is=ms&&ms(_n);Xn=new Title({props:{schema:_n[2],record:_n[0],isCreateMode:_n[3]}}),to=new ErrorAlert({props:{message:_n[7]}});function Yo(gs){_n[14](gs)}let Ys={schema:_n[2],isCreateMode:_n[3]};_n[6]!==void 0&&(Ys.active=_n[6]),ho=new ContentTabs({props:Ys}),binding_callbacks.push(()=>bind(ho,"active",Yo));const sr=[create_if_block$5,create_if_block_2,create_if_block_3],Js=[];function ko(gs,xs){return xs&64&&(So=null),So==null&&(So=!["_graph","_info"].includes(gs[6])),So?0:gs[6]==="_graph"?1:gs[6]==="_info"?2:-1}return~($o=ko(_n,-1))&&(Do=Js[$o]=sr[$o](_n)),{c(){Ce=element("div"),ke=element("div"),create_component($n.$$.fragment),Un=space$3(),is&&is.c(),qn=space$3(),create_component(Xn.$$.fragment),Kn=space$3(),create_component(to.$$.fragment),io=space$3(),uo=element("div"),create_component(ho.$$.fragment),Oo=space$3(),Do&&Do.c(),attr(ke,"class","tools-header"),attr(uo,"class","mt-4"),set_style(uo,"margin-bottom","150px"),set_style(uo,"position","relative"),attr(Ce,"class","record-edit")},m(gs,xs){insert$1(gs,Ce,xs),append(Ce,ke),mount_component($n,ke,null),append(ke,Un),is&&is.m(ke,null),append(Ce,qn),mount_component(Xn,Ce,null),append(Ce,Kn),mount_component(to,Ce,null),append(Ce,io),append(Ce,uo),mount_component(ho,uo,null),append(uo,Oo),~$o&&Js[$o].m(uo,null),xo=!0,Io||(Vo=listen(window_1,"beforeunload",_n[10]),Io=!0)},p(gs,[xs]){const Qr={};xs&4&&(Qr.schema=gs[2]),xs&8&&(Qr.isCreateMode=gs[3]),!Hn&&xs&1&&(Hn=!0,Qr.record=gs[0],add_flush_callback(()=>Hn=!1)),!zn&&xs&64&&(zn=!0,Qr.activeContentTab=gs[6],add_flush_callback(()=>zn=!1)),$n.$set(Qr),ms===(ms=os(gs))&&is?is.p(gs,xs):(is&&is.d(1),is=ms&&ms(gs),is&&(is.c(),is.m(ke,null)));const cr={};xs&4&&(cr.schema=gs[2]),xs&1&&(cr.record=gs[0]),xs&8&&(cr.isCreateMode=gs[3]),Xn.$set(cr);const ws={};xs&128&&(ws.message=gs[7]),to.$set(ws);const Fs={};xs&4&&(Fs.schema=gs[2]),xs&8&&(Fs.isCreateMode=gs[3]),!bo&&xs&64&&(bo=!0,Fs.active=gs[6],add_flush_callback(()=>bo=!1)),ho.$set(Fs);let Br=$o;$o=ko(gs,xs),$o===Br?~$o&&Js[$o].p(gs,xs):(Do&&(group_outros(),transition_out(Js[Br],1,1,()=>{Js[Br]=null}),check_outros()),~$o?(Do=Js[$o],Do?Do.p(gs,xs):(Do=Js[$o]=sr[$o](gs),Do.c()),transition_in(Do,1),Do.m(uo,null)):Do=null)},i(gs){xo||(transition_in($n.$$.fragment,gs),transition_in(Xn.$$.fragment,gs),transition_in(to.$$.fragment,gs),transition_in(ho.$$.fragment,gs),transition_in(Do),xo=!0)},o(gs){transition_out($n.$$.fragment,gs),transition_out(Xn.$$.fragment,gs),transition_out(to.$$.fragment,gs),transition_out(ho.$$.fragment,gs),transition_out(Do),xo=!1},d(gs){gs&&detach(Ce),destroy_component($n),is&&is.d(),destroy_component(Xn),destroy_component(to),destroy_component(ho),~$o&&Js[$o].d(),Io=!1,Vo()}}}function instance$7(_n,Ce,ke){let $n,Hn,zn;const Un=getContext$1("channel");let{schema:qn}=Ce,{record:Xn}=Ce,{graph:Kn={records:[],edges:[]}}=Ce,{isCreateMode:to}=Ce,{users:io}=Ce,uo,ho="",bo=qn.fields.filter(Go=>Go.name!=="id");onMount(()=>{Oo()});function Oo(){uo={data:JSON.parse(JSON.stringify(Xn.data)),schema:Xn.schema,status:Xn.status,_sys:JSON.parse(JSON.stringify(Xn._sys)),_file:JSON.parse(JSON.stringify(Xn._file)),edges:JSON.parse(JSON.stringify(Kn.edges))}}afterUpdate(()=>{ke(8,$n=$o())});function So(Go){return $n?Go.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete Go.returnValue,"...")}function $o(){return to?!1:!lodashExports.isEqual(uo,{data:Xn.data,schema:Xn.schema,status:Xn.status,_sys:Xn._sys,_file:Xn._file,edges:Kn.edges})}function Do(Go){return Go.preventDefault(),console.log("SAVE: Attempt"),ke(5,Hn=null),ke(7,zn=""),new Promise(function(os,ms){var is;if(!$n&&!to){os(null);return}if(!Xn){os(null);return}ke(1,Kn.edges=(is=Kn.edges)==null?void 0:is.filter(Yo=>!Yo._isTrashed&&Yo.source===Xn.id),Kn),axios$1.post(Un.lucentUrl+"/records",{record:Xn,edges:Kn.edges,isCreateMode:to}).then(function(Yo){if(console.log("SAVE: SAVED"),to)window.location=Un.lucentUrl+"/records/"+Xn.id;else{if(ke(0,Xn=Yo.data.records[0]??null),!Xn){ke(8,$n=!1),window.location=Un.lucentUrl;return}ke(1,Kn=Yo.data),Oo()}os(null)}).catch(function(Yo){Yo.response&&(typeof Yo.response.data.error=="string"?ke(7,zn=Yo.response.data.error):(ke(5,Hn=Yo.response.data.error),console.log(Hn))),os(null)})})}function xo(Go){Xn=Go,ke(0,Xn)}function Io(Go){ho=Go,ke(6,ho)}function Vo(Go){ho=Go,ke(6,ho)}function Jo(Go){_n.$$.not_equal(Xn.data,Go)&&(Xn.data=Go,ke(0,Xn))}function Mo(Go){Kn=Go,ke(1,Kn)}return _n.$$set=Go=>{"schema"in Go&&ke(2,qn=Go.schema),"record"in Go&&ke(0,Xn=Go.record),"graph"in Go&&ke(1,Kn=Go.graph),"isCreateMode"in Go&&ke(3,to=Go.isCreateMode),"users"in Go&&ke(4,io=Go.users)},_n.$$.update=()=>{_n.$$.dirty&32&&ke(7,zn=Hn?`Record submission failed. ${Object.entries(Hn).length} error(s)`:null)},ke(8,$n=!1),ke(5,Hn=null),[Xn,Kn,qn,to,io,Hn,ho,zn,$n,bo,So,Do,xo,Io,Vo,Jo,Mo]}class Edit extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$7,create_fragment$7,safe_not_equal,{schema:2,record:0,graph:1,isCreateMode:3,users:4})}}function get_each_context$2(_n,Ce,ke){const $n=_n.slice();return $n[6]=Ce[ke],$n}function create_else_block$1(_n){let Ce,ke;return Ce=new Icon({props:{icon:"circle-chevron-down"}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_if_block_1$2(_n){let Ce,ke;return Ce=new Icon({props:{icon:"circle-chevron-up"}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_if_block$4(_n){let Ce,ke=ensure_array_like(_n[1]),$n=[];for(let Hn=0;Hn{uo[$o]=null}),check_outros(),zn=uo[Hn],zn||(zn=uo[Hn]=io[Hn](Oo),zn.c()),transition_in(zn,1),zn.m(Ce,null)),Oo[0]?bo?bo.p(Oo,So):(bo=create_if_block$4(Oo),bo.c(),bo.m(qn.parentNode,qn)):bo&&(bo.d(1),bo=null)},i(Oo){Xn||(transition_in(zn),Xn=!0)},o(Oo){transition_out(zn),Xn=!1},d(Oo){Oo&&(detach(Ce),detach(Un),detach(qn)),uo[Hn].d(),bo&&bo.d(Oo),Kn=!1,to()}}}function instance$6(_n,Ce,ke){const $n=getContext$1("channel");let{schemas:Hn}=Ce,{title:zn}=Ce,{schema:Un}=Ce,{expanded:qn=!1}=Ce;Hn.find(Kn=>Kn.name===(Un==null?void 0:Un.name))&&(qn=!0);function Xn(){ke(0,qn=!qn)}return _n.$$set=Kn=>{"schemas"in Kn&&ke(1,Hn=Kn.schemas),"title"in Kn&&ke(2,zn=Kn.title),"schema"in Kn&&ke(3,Un=Kn.schema),"expanded"in Kn&&ke(0,qn=Kn.expanded)},[qn,Hn,zn,Un,$n,Xn]}class NavbarMenu extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$6,create_fragment$6,safe_not_equal,{schemas:1,title:2,schema:3,expanded:0})}}function create_fragment$5(_n){let Ce,ke,$n=_n[1].name+"",Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo;return Kn=new NavbarMenu({props:{title:"Content",schemas:_n[2].filter(func),schema:_n[0],expanded:!0}}),io=new NavbarMenu({props:{title:"Files",schemas:_n[3],schema:_n[0]}}),ho=new NavbarMenu({props:{title:"Other",schemas:_n[4],schema:_n[0]}}),{c(){Ce=element("div"),ke=element("a"),Hn=text($n),zn=space$3(),Un=element("a"),qn=space$3(),Xn=element("div"),create_component(Kn.$$.fragment),to=space$3(),create_component(io.$$.fragment),uo=space$3(),create_component(ho.$$.fragment),attr(ke,"class","logo"),attr(ke,"href",_n[1].lucentUrl),attr(Un,"class","nav-item"),attr(Un,"href",_n[1].lucentUrl+"/profile"),attr(Ce,"class","sidebar-top"),attr(Xn,"class","sidebar")},m(Oo,So){insert$1(Oo,Ce,So),append(Ce,ke),append(ke,Hn),append(Ce,zn),append(Ce,Un),insert$1(Oo,qn,So),insert$1(Oo,Xn,So),mount_component(Kn,Xn,null),append(Xn,to),mount_component(io,Xn,null),append(Xn,uo),mount_component(ho,Xn,null),bo=!0},p(Oo,[So]){const $o={};So&1&&($o.schema=Oo[0]),Kn.$set($o);const Do={};So&1&&(Do.schema=Oo[0]),io.$set(Do);const xo={};So&1&&(xo.schema=Oo[0]),ho.$set(xo)},i(Oo){bo||(transition_in(Kn.$$.fragment,Oo),transition_in(io.$$.fragment,Oo),transition_in(ho.$$.fragment,Oo),bo=!0)},o(Oo){transition_out(Kn.$$.fragment,Oo),transition_out(io.$$.fragment,Oo),transition_out(ho.$$.fragment,Oo),bo=!1},d(Oo){Oo&&(detach(Ce),detach(qn),detach(Xn)),destroy_component(Kn),destroy_component(io),destroy_component(ho)}}}const func=_n=>_n.isEntry;function instance$5(_n,Ce,ke){let{schema:$n}=Ce;const Hn=getContext$1("channel"),zn=getContext$1("readableSchemas"),Un=zn.filter(Xn=>Xn.type==="files"),qn=zn.filter(Xn=>!Xn.isEntry&&Xn.type==="collection");return _n.$$set=Xn=>{"schema"in Xn&&ke(0,$n=Xn.schema)},[$n,Hn,zn,Un,qn]}class Navbar extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$5,create_fragment$5,safe_not_equal,{schema:0})}}function create_if_block_1$1(_n){let Ce;return{c(){Ce=element("span"),Ce.textContent="DRAFT",attr(Ce,"class","status")},m(ke,$n){insert$1(ke,Ce,$n)},d(ke){ke&&detach(Ce)}}}function create_else_block(_n){let Ce,ke=previewTitle(_n[3].schemas,_n[2],_n[1])+"",$n,Hn;return{c(){Ce=element("a"),$n=text(ke),attr(Ce,"href",Hn=_n[3].lucentUrl+"/records/"+_n[2].id)},m(zn,Un){insert$1(zn,Ce,Un),append(Ce,$n)},p(zn,Un){Un&6&&ke!==(ke=previewTitle(zn[3].schemas,zn[2],zn[1])+"")&&set_data($n,ke),Un&4&&Hn!==(Hn=zn[3].lucentUrl+"/records/"+zn[2].id)&&attr(Ce,"href",Hn)},i:noop,o:noop,d(zn){zn&&detach(Ce)}}}function create_if_block$3(_n){let Ce,ke;return Ce=new Preview({props:{record:_n[2],size:"tiny",showFilename:!0}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&4&&(zn.record=$n[2]),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_fragment$4(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn=_n[4].label+"",to,io,uo,ho,bo,Oo,So,$o,Do=_n[2].status==="draft"&&create_if_block_1$1();const xo=[create_if_block$3,create_else_block],Io=[];function Vo(Jo,Mo){return Jo[4].type==="files"?0:1}return Hn=Vo(_n),zn=Io[Hn]=xo[Hn](_n),bo=new Avatar({props:{name:usernameById(_n[0],_n[2]._sys.updatedBy),side:24}}),{c(){Ce=element("td"),ke=element("div"),Do&&Do.c(),$n=space$3(),zn.c(),Un=space$3(),qn=element("td"),Xn=element("a"),to=text(Kn),io=space$3(),uo=element("td"),ho=element("div"),create_component(bo.$$.fragment),Oo=space$3(),So=element("div"),So.textContent=`${_n[5]}`,attr(ke,"class","row-name"),attr(Xn,"href",_n[3].lucentUrl+"/content/"+_n[4].name),attr(So,"class","ms-2"),set_style(ho,"display","flex"),set_style(ho,"gap","14px")},m(Jo,Mo){insert$1(Jo,Ce,Mo),append(Ce,ke),Do&&Do.m(ke,null),append(ke,$n),Io[Hn].m(ke,null),insert$1(Jo,Un,Mo),insert$1(Jo,qn,Mo),append(qn,Xn),append(Xn,to),insert$1(Jo,io,Mo),insert$1(Jo,uo,Mo),append(uo,ho),mount_component(bo,ho,null),append(ho,Oo),append(ho,So),$o=!0},p(Jo,[Mo]){Jo[2].status==="draft"?Do||(Do=create_if_block_1$1(),Do.c(),Do.m(ke,$n)):Do&&(Do.d(1),Do=null),zn.p(Jo,Mo);const Go={};Mo&5&&(Go.name=usernameById(Jo[0],Jo[2]._sys.updatedBy)),bo.$set(Go)},i(Jo){$o||(transition_in(zn),transition_in(bo.$$.fragment,Jo),$o=!0)},o(Jo){transition_out(zn),transition_out(bo.$$.fragment,Jo),$o=!1},d(Jo){Jo&&(detach(Ce),detach(Un),detach(qn),detach(io),detach(uo)),Do&&Do.d(),Io[Hn].d(),destroy_component(bo)}}}function instance$4(_n,Ce,ke){const $n=getContext$1("channel");let{users:Hn}=Ce,{graph:zn}=Ce,{record:Un}=Ce,qn=$n.schemas.find(Kn=>Kn.name===Un.schema),Xn=formatDistanceToNow(parseJSON(Un._sys.updatedAt),{addSuffix:!0});return _n.$$set=Kn=>{"users"in Kn&&ke(0,Hn=Kn.users),"graph"in Kn&&ke(1,zn=Kn.graph),"record"in Kn&&ke(2,Un=Kn.record)},[Hn,zn,Un,$n,qn,Xn]}class RecordRow extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$4,create_fragment$4,safe_not_equal,{users:0,graph:1,record:2})}}function get_each_context$1(_n,Ce,ke){const $n=_n.slice();return $n[4]=Ce[ke],$n}function create_if_block$2(_n){let Ce,ke,$n,Hn=[],zn=new Map,Un,qn=ensure_array_like(_n[0]);const Xn=Kn=>Kn[4].id;for(let Kn=0;Kn0&&create_if_block$2(_n);return{c(){Ce=element("h3"),Ce.textContent="Latest Content changes",ke=space$3(),zn&&zn.c(),$n=empty$1(),attr(Ce,"class","header-small mb-4 mt-5")},m(Un,qn){insert$1(Un,Ce,qn),insert$1(Un,ke,qn),zn&&zn.m(Un,qn),insert$1(Un,$n,qn),Hn=!0},p(Un,[qn]){Un[0].length>0?zn?(zn.p(Un,qn),qn&1&&transition_in(zn,1)):(zn=create_if_block$2(Un),zn.c(),transition_in(zn,1),zn.m($n.parentNode,$n)):zn&&(group_outros(),transition_out(zn,1,1,()=>{zn=null}),check_outros())},i(Un){Hn||(transition_in(zn),Hn=!0)},o(Un){transition_out(zn),Hn=!1},d(Un){Un&&(detach(Ce),detach(ke),detach($n)),zn&&zn.d(Un)}}}function instance$3(_n,Ce,ke){const $n=getContext$1("channel");let Hn=[],zn=null,Un=[];return onMount(()=>{axios.get($n.lucentUrl+"/home/records").then(qn=>{ke(0,Hn=qn.data.records),ke(1,zn=qn.data.graph),ke(2,Un=qn.data.users)}).catch(qn=>{console.log(qn)})}),[Hn,zn,Un]}class Index extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$3,create_fragment$3,safe_not_equal,{})}}function create_if_block_1(_n){let Ce;return{c(){Ce=element("span"),Ce.textContent="Action in progress",attr(Ce,"class","badge text-bg-warning")},m(ke,$n){insert$1(ke,Ce,$n)},d(ke){ke&&detach(Ce)}}}function create_if_block$1(_n){let Ce;return{c(){Ce=element("span"),Ce.textContent="Action completed",attr(Ce,"class","badge text-bg-info")},m(ke,$n){insert$1(ke,Ce,$n)},d(ke){ke&&detach(Ce)}}}function create_fragment$2(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn,to,io,uo,ho,bo,Oo,So,$o,Do,xo=_n[2]&&create_if_block_1(),Io=!_n[2]&&_n[3]&&create_if_block$1();return{c(){Ce=element("div"),ke=element("div"),$n=element("h3"),Hn=text(_n[0]),zn=space$3(),Un=element("button"),qn=text("Start"),Xn=space$3(),Kn=element("div"),xo&&xo.c(),to=space$3(),Io&&Io.c(),io=space$3(),uo=element("pre"),ho=text(_n[3]),bo=text(` + `),Oo=element("div"),Oo.textContent=" ",So=text(` + `),attr($n,"class","header-small mb-5"),attr(Un,"class","button primary mb-3"),Un.disabled=_n[2],attr(Kn,"class","mb-3"),attr(uo,"class","logs svelte-a3cwpi"),attr(ke,"class","lx-card mt-5"),attr(Ce,"class","common-wrapper")},m(Vo,Jo){insert$1(Vo,Ce,Jo),append(Ce,ke),append(ke,$n),append($n,Hn),append(ke,zn),append(ke,Un),append(Un,qn),append(ke,Xn),append(ke,Kn),xo&&xo.m(Kn,null),append(Kn,to),Io&&Io.m(Kn,null),append(ke,io),append(ke,uo),append(uo,ho),append(uo,bo),append(uo,Oo),_n[6](Oo),append(uo,So),$o||(Do=listen(Un,"click",_n[4]),$o=!0)},p(Vo,[Jo]){Jo&1&&set_data(Hn,Vo[0]),Jo&4&&(Un.disabled=Vo[2]),Vo[2]?xo||(xo=create_if_block_1(),xo.c(),xo.m(Kn,to)):xo&&(xo.d(1),xo=null),!Vo[2]&&Vo[3]?Io||(Io=create_if_block$1(),Io.c(),Io.m(Kn,null)):Io&&(Io.d(1),Io=null),Jo&8&&set_data(ho,Vo[3])},i:noop,o:noop,d(Vo){Vo&&detach(Ce),xo&&xo.d(),Io&&Io.d(),_n[6](null),$o=!1,Do()}}}function instance$2(_n,Ce,ke){let $n;const Hn=getContext$1("channel");let{title:zn}=Ce,{command:Un}=Ce,qn,Xn=!1;function Kn(){const uo=new EventSource(Hn.lucentUrl+"/command-report-source/"+Un.signature);uo.onmessage=function(ho){ke(2,Xn=!0);const bo=JSON.parse(ho.data);bo.date,ke(3,$n=bo.logs),qn.scrollIntoView()},uo.onerror=ho=>{console.log(ho),uo.close(),ke(2,Xn=!1)}}function to(uo){uo.preventDefault(),ke(2,Xn=!0),axios$1.post(Hn.lucentUrl+"/command/"+Un.signature).then(ho=>{Kn()})}onMount(()=>{Kn()});function io(uo){binding_callbacks[uo?"unshift":"push"](()=>{qn=uo,ke(1,qn)})}return _n.$$set=uo=>{"title"in uo&&ke(0,zn=uo.title),"command"in uo&&ke(5,Un=uo.command)},ke(3,$n=""),[zn,qn,Xn,$n,to,Un,io]}class Report extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$2,create_fragment$2,safe_not_equal,{title:0,command:5})}}function get_each_context(_n,Ce,ke){const $n=_n.slice();return $n[2]=Ce[ke],$n}function create_if_block(_n){let Ce,ke;return Ce=new Dropdown({props:{$$slots:{button:[create_button_slot],default:[create_default_slot]},$$scope:{ctx:_n}}}),{c(){create_component(Ce.$$.fragment)},m($n,Hn){mount_component(Ce,$n,Hn),ke=!0},p($n,Hn){const zn={};Hn&32&&(zn.$$scope={dirty:Hn,ctx:$n}),Ce.$set(zn)},i($n){ke||(transition_in(Ce.$$.fragment,$n),ke=!0)},o($n){transition_out(Ce.$$.fragment,$n),ke=!1},d($n){destroy_component(Ce,$n)}}}function create_each_block(_n){let Ce,ke=_n[2].name+"",$n;return{c(){Ce=element("a"),$n=text(ke),attr(Ce,"href",_n[0].lucentUrl+"/command-report/"+_n[2].signature),attr(Ce,"class","top-nav-item")},m(Hn,zn){insert$1(Hn,Ce,zn),append(Ce,$n)},p:noop,d(Hn){Hn&&detach(Ce)}}}function create_default_slot(_n){let Ce,ke=ensure_array_like(_n[0].commands),$n=[];for(let Hn=0;Hn0&&create_if_block(_n);return qn=new Avatar({props:{side:"28",name:_n[1].name}}),{c(){Ce=element("div"),ke=element("a"),$n=text("Members"),Hn=space$3(),Kn&&Kn.c(),zn=space$3(),Un=element("a"),create_component(qn.$$.fragment),attr(ke,"class","top-nav-item"),attr(ke,"href",_n[0].lucentUrl+"/members"),attr(Un,"href",_n[0].lucentUrl+"/profile"),attr(Ce,"class","top-nav ")},m(to,io){insert$1(to,Ce,io),append(Ce,ke),append(ke,$n),append(Ce,Hn),Kn&&Kn.m(Ce,null),append(Ce,zn),append(Ce,Un),mount_component(qn,Un,null),Xn=!0},p(to,[io]){to[0].commands.length>0&&Kn.p(to,io)},i(to){Xn||(transition_in(Kn),transition_in(qn.$$.fragment,to),Xn=!0)},o(to){transition_out(Kn),transition_out(qn.$$.fragment,to),Xn=!1},d(to){to&&detach(Ce),Kn&&Kn.d(),destroy_component(qn)}}}function instance$1(_n){const Ce=getContext$1("channel"),ke=getContext$1("user");return console.log(Ce.commands),[Ce,ke]}class Header extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance$1,create_fragment$1,safe_not_equal,{})}}function create_fragment(_n){let Ce,ke,$n,Hn,zn,Un,qn,Xn,Kn;$n=new Navbar({props:{schema:_n[2].schema}}),Un=new Header({});const to=[{title:_n[0]},_n[2]];var io=_n[3][_n[1]];function uo(ho,bo){let Oo={};for(let So=0;So{destroy_component(So,1)}),check_outros()}io?(Xn=construct_svelte_component(io,uo(ho,bo)),create_component(Xn.$$.fragment),transition_in(Xn.$$.fragment,1),mount_component(Xn,zn,null)):Xn=null}else if(io){const So=bo&5?get_spread_update(to,[bo&1&&{title:ho[0]},bo&4&&get_spread_object(ho[2])]):{};Xn.$set(So)}},i(ho){Kn||(transition_in($n.$$.fragment,ho),transition_in(Un.$$.fragment,ho),Xn&&transition_in(Xn.$$.fragment,ho),Kn=!0)},o(ho){transition_out($n.$$.fragment,ho),transition_out(Un.$$.fragment,ho),Xn&&transition_out(Xn.$$.fragment,ho),Kn=!1},d(ho){ho&&detach(Ce),destroy_component($n),destroy_component(Un),Xn&&destroy_component(Xn)}}}function instance(_n,Ce,ke){const $n={members:Members,recordEdit:Edit,recordNotFound:NotFound,contentIndex:Index$1,homeIndex:Index,buildReport:Report};let{title:Hn}=Ce,{view:zn}=Ce,{user:Un}=Ce,{data:qn}=Ce,{channel:Xn}=Ce,{axios:Kn}=Ce,{readableSchemas:to}=Ce;return setContext("axios",Kn),setContext("channel",Xn),setContext("readableSchemas",Xn.schemas.filter(io=>to.includes(io.name))),setContext("user",Un),_n.$$set=io=>{"title"in io&&ke(0,Hn=io.title),"view"in io&&ke(1,zn=io.view),"user"in io&&ke(4,Un=io.user),"data"in io&&ke(2,qn=io.data),"channel"in io&&ke(5,Xn=io.channel),"axios"in io&&ke(6,Kn=io.axios),"readableSchemas"in io&&ke(7,to=io.readableSchemas)},[Hn,zn,qn,$n,Un,Xn,Kn,to]}class Channel extends SvelteComponent{constructor(Ce){super(),init(this,Ce,instance,create_fragment,safe_not_equal,{title:0,view:1,user:4,data:2,channel:5,axios:6,readableSchemas:7})}}(function(){const htmx={onLoad:null,process:null,on:null,off:null,trigger:null,ajax:null,find:null,findAll:null,closest:null,values:function(_n,Ce){return getInputValues(_n,Ce||"post").values},remove:null,addClass:null,removeClass:null,toggleClass:null,takeClass:null,swap:null,defineExtension:null,removeExtension:null,logAll:null,logNone:null,logger:null,config:{historyEnabled:!0,historyCacheSize:10,refreshOnHistoryMiss:!1,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:!0,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:!0,allowScriptTags:!0,inlineScriptNonce:"",inlineStyleNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:!1,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",scrollBehavior:"instant",defaultFocusScroll:!1,getCacheBusterParam:!1,globalViewTransitions:!1,methodsThatUseUrlParams:["get","delete"],selfRequestsOnly:!0,ignoreTitle:!1,scrollIntoViewOnBoost:!0,triggerSpecsCache:null,disableInheritance:!1,responseHandling:[{code:"204",swap:!1},{code:"[23]..",swap:!0},{code:"[45]..",swap:!1,error:!0}],allowNestedOobSwaps:!0},parseInterval:null,_:null,version:"2.0.2"};htmx.onLoad=onLoadHelper,htmx.process=processNode,htmx.on=addEventListenerImpl,htmx.off=removeEventListenerImpl,htmx.trigger=triggerEvent,htmx.ajax=ajaxHelper,htmx.find=find,htmx.findAll=findAll,htmx.closest=closest,htmx.remove=removeElement,htmx.addClass=addClassToElement,htmx.removeClass=removeClassFromElement,htmx.toggleClass=toggleClassOnElement,htmx.takeClass=takeClassForElement,htmx.swap=swap,htmx.defineExtension=defineExtension,htmx.removeExtension=removeExtension,htmx.logAll=logAll,htmx.logNone=logNone,htmx.parseInterval=parseInterval,htmx._=internalEval;const internalAPI={addTriggerHandler,bodyContains,canAccessLocalStorage,findThisElement,filterValues,swap,hasAttribute,getAttributeValue,getClosestAttributeValue,getClosestMatch,getExpressionVars,getHeaders,getInputValues,getInternalData,getSwapSpecification,getTriggerSpecs,getTarget,makeFragment,mergeObjects,makeSettleInfo,oobSwap,querySelectorExt,settleImmediately,shouldCancel,triggerEvent,triggerErrorEvent,withExtensions},VERBS=["get","post","put","delete","patch"],VERB_SELECTOR=VERBS.map(function(_n){return"[hx-"+_n+"], [data-hx-"+_n+"]"}).join(", "),HEAD_TAG_REGEX=makeTagRegEx("head");function makeTagRegEx(_n,Ce=!1){return new RegExp(`<${_n}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${_n}>`,Ce?"gim":"im")}function parseInterval(_n){if(_n==null)return;let Ce=NaN;return _n.slice(-2)=="ms"?Ce=parseFloat(_n.slice(0,-2)):_n.slice(-1)=="s"?Ce=parseFloat(_n.slice(0,-1))*1e3:_n.slice(-1)=="m"?Ce=parseFloat(_n.slice(0,-1))*1e3*60:Ce=parseFloat(_n),isNaN(Ce)?void 0:Ce}function getRawAttribute(_n,Ce){return _n instanceof Element&&_n.getAttribute(Ce)}function hasAttribute(_n,Ce){return!!_n.hasAttribute&&(_n.hasAttribute(Ce)||_n.hasAttribute("data-"+Ce))}function getAttributeValue(_n,Ce){return getRawAttribute(_n,Ce)||getRawAttribute(_n,"data-"+Ce)}function parentElt(_n){const Ce=_n.parentElement;return!Ce&&_n.parentNode instanceof ShadowRoot?_n.parentNode:Ce}function getDocument(){return document}function getRootNode(_n,Ce){return _n.getRootNode?_n.getRootNode({composed:Ce}):getDocument()}function getClosestMatch(_n,Ce){for(;_n&&!Ce(_n);)_n=parentElt(_n);return _n||null}function getAttributeValueWithDisinheritance(_n,Ce,ke){const $n=getAttributeValue(Ce,ke),Hn=getAttributeValue(Ce,"hx-disinherit");var zn=getAttributeValue(Ce,"hx-inherit");if(_n!==Ce){if(htmx.config.disableInheritance)return zn&&(zn==="*"||zn.split(" ").indexOf(ke)>=0)?$n:null;if(Hn&&(Hn==="*"||Hn.split(" ").indexOf(ke)>=0))return"unset"}return $n}function getClosestAttributeValue(_n,Ce){let ke=null;if(getClosestMatch(_n,function($n){return!!(ke=getAttributeValueWithDisinheritance(_n,asElement($n),Ce))}),ke!=="unset")return ke}function matches(_n,Ce){const ke=_n instanceof Element&&(_n.matches||_n.matchesSelector||_n.msMatchesSelector||_n.mozMatchesSelector||_n.webkitMatchesSelector||_n.oMatchesSelector);return!!ke&&ke.call(_n,Ce)}function getStartTag(_n){const ke=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i.exec(_n);return ke?ke[1].toLowerCase():""}function parseHTML(_n){return new DOMParser().parseFromString(_n,"text/html")}function takeChildrenFor(_n,Ce){for(;Ce.childNodes.length>0;)_n.append(Ce.childNodes[0])}function duplicateScript(_n){const Ce=getDocument().createElement("script");return forEach(_n.attributes,function(ke){Ce.setAttribute(ke.name,ke.value)}),Ce.textContent=_n.textContent,Ce.async=!1,htmx.config.inlineScriptNonce&&(Ce.nonce=htmx.config.inlineScriptNonce),Ce}function isJavaScriptScriptNode(_n){return _n.matches("script")&&(_n.type==="text/javascript"||_n.type==="module"||_n.type==="")}function normalizeScriptTags(_n){Array.from(_n.querySelectorAll("script")).forEach(Ce=>{if(isJavaScriptScriptNode(Ce)){const ke=duplicateScript(Ce),$n=Ce.parentNode;try{$n.insertBefore(ke,Ce)}catch(Hn){logError(Hn)}finally{Ce.remove()}}})}function makeFragment(_n){const Ce=_n.replace(HEAD_TAG_REGEX,""),ke=getStartTag(Ce);let $n;if(ke==="html"){$n=new DocumentFragment;const zn=parseHTML(_n);takeChildrenFor($n,zn.body),$n.title=zn.title}else if(ke==="body"){$n=new DocumentFragment;const zn=parseHTML(Ce);takeChildrenFor($n,zn.body),$n.title=zn.title}else{const zn=parseHTML('");$n=zn.querySelector("template").content,$n.title=zn.title;var Hn=$n.querySelector("title");Hn&&Hn.parentNode===$n&&(Hn.remove(),$n.title=Hn.innerText)}return $n&&(htmx.config.allowScriptTags?normalizeScriptTags($n):$n.querySelectorAll("script").forEach(zn=>zn.remove())),$n}function maybeCall(_n){_n&&_n()}function isType(_n,Ce){return Object.prototype.toString.call(_n)==="[object "+Ce+"]"}function isFunction(_n){return typeof _n=="function"}function isRawObject(_n){return isType(_n,"Object")}function getInternalData(_n){const Ce="htmx-internal-data";let ke=_n[Ce];return ke||(ke=_n[Ce]={}),ke}function toArray(_n){const Ce=[];if(_n)for(let ke=0;ke<_n.length;ke++)Ce.push(_n[ke]);return Ce}function forEach(_n,Ce){if(_n)for(let ke=0;ke<_n.length;ke++)Ce(_n[ke])}function isScrolledIntoView(_n){const Ce=_n.getBoundingClientRect(),ke=Ce.top,$n=Ce.bottom;return ke=0}function bodyContains(_n){const Ce=_n.getRootNode&&_n.getRootNode();return Ce&&Ce instanceof window.ShadowRoot?getDocument().body.contains(Ce.host):getDocument().body.contains(_n)}function splitOnWhitespace(_n){return _n.trim().split(/\s+/)}function mergeObjects(_n,Ce){for(const ke in Ce)Ce.hasOwnProperty(ke)&&(_n[ke]=Ce[ke]);return _n}function parseJSON(_n){try{return JSON.parse(_n)}catch(Ce){return logError(Ce),null}}function canAccessLocalStorage(){const _n="htmx:localStorageTest";try{return localStorage.setItem(_n,_n),localStorage.removeItem(_n),!0}catch{return!1}}function normalizePath(_n){try{const Ce=new URL(_n);return Ce&&(_n=Ce.pathname+Ce.search),/^\/$/.test(_n)||(_n=_n.replace(/\/+$/,"")),_n}catch{return _n}}function internalEval(str){return maybeEval(getDocument().body,function(){return eval(str)})}function onLoadHelper(_n){return htmx.on("htmx:load",function(ke){_n(ke.detail.elt)})}function logAll(){htmx.logger=function(_n,Ce,ke){console&&console.log(Ce,_n,ke)}}function logNone(){htmx.logger=null}function find(_n,Ce){return typeof _n!="string"?_n.querySelector(Ce):find(getDocument(),_n)}function findAll(_n,Ce){return typeof _n!="string"?_n.querySelectorAll(Ce):findAll(getDocument(),_n)}function getWindow(){return window}function removeElement(_n,Ce){_n=resolveTarget(_n),Ce?getWindow().setTimeout(function(){removeElement(_n),_n=null},Ce):parentElt(_n).removeChild(_n)}function asElement(_n){return _n instanceof Element?_n:null}function asHtmlElement(_n){return _n instanceof HTMLElement?_n:null}function asString(_n){return typeof _n=="string"?_n:null}function asParentNode(_n){return _n instanceof Element||_n instanceof Document||_n instanceof DocumentFragment?_n:null}function addClassToElement(_n,Ce,ke){_n=asElement(resolveTarget(_n)),_n&&(ke?getWindow().setTimeout(function(){addClassToElement(_n,Ce),_n=null},ke):_n.classList&&_n.classList.add(Ce))}function removeClassFromElement(_n,Ce,ke){let $n=asElement(resolveTarget(_n));$n&&(ke?getWindow().setTimeout(function(){removeClassFromElement($n,Ce),$n=null},ke):$n.classList&&($n.classList.remove(Ce),$n.classList.length===0&&$n.removeAttribute("class")))}function toggleClassOnElement(_n,Ce){_n=resolveTarget(_n),_n.classList.toggle(Ce)}function takeClassForElement(_n,Ce){_n=resolveTarget(_n),forEach(_n.parentElement.children,function(ke){removeClassFromElement(ke,Ce)}),addClassToElement(asElement(_n),Ce)}function closest(_n,Ce){if(_n=asElement(resolveTarget(_n)),_n&&_n.closest)return _n.closest(Ce);do if(_n==null||matches(_n,Ce))return _n;while(_n=_n&&asElement(parentElt(_n)));return null}function startsWith(_n,Ce){return _n.substring(0,Ce.length)===Ce}function endsWith(_n,Ce){return _n.substring(_n.length-Ce.length)===Ce}function normalizeSelector(_n){const Ce=_n.trim();return startsWith(Ce,"<")&&endsWith(Ce,"/>")?Ce.substring(1,Ce.length-2):Ce}function querySelectorAllExt(_n,Ce,ke){return _n=resolveTarget(_n),Ce.indexOf("closest ")===0?[closest(asElement(_n),normalizeSelector(Ce.substr(8)))]:Ce.indexOf("find ")===0?[find(asParentNode(_n),normalizeSelector(Ce.substr(5)))]:Ce==="next"?[asElement(_n).nextElementSibling]:Ce.indexOf("next ")===0?[scanForwardQuery(_n,normalizeSelector(Ce.substr(5)),!!ke)]:Ce==="previous"?[asElement(_n).previousElementSibling]:Ce.indexOf("previous ")===0?[scanBackwardsQuery(_n,normalizeSelector(Ce.substr(9)),!!ke)]:Ce==="document"?[document]:Ce==="window"?[window]:Ce==="body"?[document.body]:Ce==="root"?[getRootNode(_n,!!ke)]:Ce.indexOf("global ")===0?querySelectorAllExt(_n,Ce.slice(7),!0):toArray(asParentNode(getRootNode(_n,!!ke)).querySelectorAll(normalizeSelector(Ce)))}var scanForwardQuery=function(_n,Ce,ke){const $n=asParentNode(getRootNode(_n,ke)).querySelectorAll(Ce);for(let Hn=0;Hn<$n.length;Hn++){const zn=$n[Hn];if(zn.compareDocumentPosition(_n)===Node.DOCUMENT_POSITION_PRECEDING)return zn}},scanBackwardsQuery=function(_n,Ce,ke){const $n=asParentNode(getRootNode(_n,ke)).querySelectorAll(Ce);for(let Hn=$n.length-1;Hn>=0;Hn--){const zn=$n[Hn];if(zn.compareDocumentPosition(_n)===Node.DOCUMENT_POSITION_FOLLOWING)return zn}};function querySelectorExt(_n,Ce){return typeof _n!="string"?querySelectorAllExt(_n,Ce)[0]:querySelectorAllExt(getDocument().body,_n)[0]}function resolveTarget(_n,Ce){return typeof _n=="string"?find(asParentNode(Ce)||document,_n):_n}function processEventArgs(_n,Ce,ke){return isFunction(Ce)?{target:getDocument().body,event:asString(_n),listener:Ce}:{target:resolveTarget(_n),event:asString(Ce),listener:ke}}function addEventListenerImpl(_n,Ce,ke){return ready(function(){const Hn=processEventArgs(_n,Ce,ke);Hn.target.addEventListener(Hn.event,Hn.listener)}),isFunction(Ce)?Ce:ke}function removeEventListenerImpl(_n,Ce,ke){return ready(function(){const $n=processEventArgs(_n,Ce,ke);$n.target.removeEventListener($n.event,$n.listener)}),isFunction(Ce)?Ce:ke}const DUMMY_ELT=getDocument().createElement("output");function findAttributeTargets(_n,Ce){const ke=getClosestAttributeValue(_n,Ce);if(ke){if(ke==="this")return[findThisElement(_n,Ce)];{const $n=querySelectorAllExt(_n,ke);return $n.length===0?(logError('The selector "'+ke+'" on '+Ce+" returned no matches!"),[DUMMY_ELT]):$n}}}function findThisElement(_n,Ce){return asElement(getClosestMatch(_n,function(ke){return getAttributeValue(asElement(ke),Ce)!=null}))}function getTarget(_n){const Ce=getClosestAttributeValue(_n,"hx-target");return Ce?Ce==="this"?findThisElement(_n,"hx-target"):querySelectorExt(_n,Ce):getInternalData(_n).boosted?getDocument().body:_n}function shouldSettleAttribute(_n){const Ce=htmx.config.attributesToSettle;for(let ke=0;ke0?(Hn=_n.substr(0,_n.indexOf(":")),$n=_n.substr(_n.indexOf(":")+1,_n.length)):Hn=_n);const zn=getDocument().querySelectorAll($n);return zn?(forEach(zn,function(Un){let qn;const Xn=Ce.cloneNode(!0);qn=getDocument().createDocumentFragment(),qn.appendChild(Xn),isInlineSwap(Hn,Un)||(qn=asParentNode(Xn));const Kn={shouldSwap:!0,target:Un,fragment:qn};triggerEvent(Un,"htmx:oobBeforeSwap",Kn)&&(Un=Kn.target,Kn.shouldSwap&&swapWithStyle(Hn,Un,Un,qn,ke),forEach(ke.elts,function(to){triggerEvent(to,"htmx:oobAfterSwap",Kn)}))}),Ce.parentNode.removeChild(Ce)):(Ce.parentNode.removeChild(Ce),triggerErrorEvent(getDocument().body,"htmx:oobErrorNoTarget",{content:Ce})),_n}function handlePreservedElements(_n){forEach(findAll(_n,"[hx-preserve], [data-hx-preserve]"),function(Ce){const ke=getAttributeValue(Ce,"id"),$n=getDocument().getElementById(ke);$n!=null&&Ce.parentNode.replaceChild($n,Ce)})}function handleAttributes(_n,Ce,ke){forEach(Ce.querySelectorAll("[id]"),function($n){const Hn=getRawAttribute($n,"id");if(Hn&&Hn.length>0){const zn=Hn.replace("'","\\'"),Un=$n.tagName.replace(":","\\:"),qn=asParentNode(_n),Xn=qn&&qn.querySelector(Un+"[id='"+zn+"']");if(Xn&&Xn!==qn){const Kn=$n.cloneNode();cloneAttributes($n,Xn),ke.tasks.push(function(){cloneAttributes($n,Kn)})}}})}function makeAjaxLoadTask(_n){return function(){removeClassFromElement(_n,htmx.config.addedClass),processNode(asElement(_n)),processFocus(asParentNode(_n)),triggerEvent(_n,"htmx:load")}}function processFocus(_n){const Ce="[autofocus]",ke=asHtmlElement(matches(_n,Ce)?_n:_n.querySelector(Ce));ke!=null&&ke.focus()}function insertNodesBefore(_n,Ce,ke,$n){for(handleAttributes(_n,ke,$n);ke.childNodes.length>0;){const Hn=ke.firstChild;addClassToElement(asElement(Hn),htmx.config.addedClass),_n.insertBefore(Hn,Ce),Hn.nodeType!==Node.TEXT_NODE&&Hn.nodeType!==Node.COMMENT_NODE&&$n.tasks.push(makeAjaxLoadTask(Hn))}}function stringHash(_n,Ce){let ke=0;for(;ke<_n.length;)Ce=(Ce<<5)-Ce+_n.charCodeAt(ke++)|0;return Ce}function attributeHash(_n){let Ce=0;if(_n.attributes)for(let ke=0;ke<_n.attributes.length;ke++){const $n=_n.attributes[ke];$n.value&&(Ce=stringHash($n.name,Ce),Ce=stringHash($n.value,Ce))}return Ce}function deInitOnHandlers(_n){const Ce=getInternalData(_n);if(Ce.onHandlers){for(let ke=0;ke0}function swap(_n,Ce,ke,$n){$n||($n={}),_n=resolveTarget(_n);const Hn=document.activeElement;let zn={};try{zn={elt:Hn,start:Hn?Hn.selectionStart:null,end:Hn?Hn.selectionEnd:null}}catch{}const Un=makeSettleInfo(_n);if(ke.swapStyle==="textContent")_n.textContent=Ce;else{let Xn=makeFragment(Ce);if(Un.title=Xn.title,$n.selectOOB){const Kn=$n.selectOOB.split(",");for(let to=0;to0?getWindow().setTimeout(qn,ke.settleDelay):qn()}function handleTriggerHeader(_n,Ce,ke){const $n=_n.getResponseHeader(Ce);if($n.indexOf("{")===0){const Hn=parseJSON($n);for(const zn in Hn)if(Hn.hasOwnProperty(zn)){let Un=Hn[zn];isRawObject(Un)?ke=Un.target!==void 0?Un.target:ke:Un={value:Un},triggerEvent(ke,zn,Un)}}else{const Hn=$n.split(",");for(let zn=0;zn0;){const Un=Ce[0];if(Un==="]"){if($n--,$n===0){zn===null&&(Hn=Hn+"true"),Ce.shift(),Hn+=")})";try{const qn=maybeEval(_n,function(){return Function(Hn)()},function(){return!0});return qn.source=Hn,qn}catch(qn){return triggerErrorEvent(getDocument().body,"htmx:syntax:error",{error:qn,source:Hn}),null}}}else Un==="["&&$n++;isPossibleRelativeReference(Un,zn,ke)?Hn+="(("+ke+"."+Un+") ? ("+ke+"."+Un+") : (window."+Un+"))":Hn=Hn+Un,zn=Ce.shift()}}}function consumeUntil(_n,Ce){let ke="";for(;_n.length>0&&!Ce.test(_n[0]);)ke+=_n.shift();return ke}function consumeCSSSelector(_n){let Ce;return _n.length>0&&COMBINED_SELECTOR_START.test(_n[0])?(_n.shift(),Ce=consumeUntil(_n,COMBINED_SELECTOR_END).trim(),_n.shift()):Ce=consumeUntil(_n,WHITESPACE_OR_COMMA),Ce}const INPUT_SELECTOR="input, textarea, select";function parseAndCacheTrigger(_n,Ce,ke){const $n=[],Hn=tokenizeString(Ce);do{consumeUntil(Hn,NOT_WHITESPACE);const qn=Hn.length,Xn=consumeUntil(Hn,/[,\[\s]/);if(Xn!=="")if(Xn==="every"){const Kn={trigger:"every"};consumeUntil(Hn,NOT_WHITESPACE),Kn.pollInterval=parseInterval(consumeUntil(Hn,/[,\[\s]/)),consumeUntil(Hn,NOT_WHITESPACE);var zn=maybeGenerateConditional(_n,Hn,"event");zn&&(Kn.eventFilter=zn),$n.push(Kn)}else{const Kn={trigger:Xn};var zn=maybeGenerateConditional(_n,Hn,"event");for(zn&&(Kn.eventFilter=zn);Hn.length>0&&Hn[0]!==",";){consumeUntil(Hn,NOT_WHITESPACE);const io=Hn.shift();if(io==="changed")Kn.changed=!0;else if(io==="once")Kn.once=!0;else if(io==="consume")Kn.consume=!0;else if(io==="delay"&&Hn[0]===":")Hn.shift(),Kn.delay=parseInterval(consumeUntil(Hn,WHITESPACE_OR_COMMA));else if(io==="from"&&Hn[0]===":"){if(Hn.shift(),COMBINED_SELECTOR_START.test(Hn[0]))var Un=consumeCSSSelector(Hn);else{var Un=consumeUntil(Hn,WHITESPACE_OR_COMMA);if(Un==="closest"||Un==="find"||Un==="next"||Un==="previous"){Hn.shift();const ho=consumeCSSSelector(Hn);ho.length>0&&(Un+=" "+ho)}}Kn.from=Un}else io==="target"&&Hn[0]===":"?(Hn.shift(),Kn.target=consumeCSSSelector(Hn)):io==="throttle"&&Hn[0]===":"?(Hn.shift(),Kn.throttle=parseInterval(consumeUntil(Hn,WHITESPACE_OR_COMMA))):io==="queue"&&Hn[0]===":"?(Hn.shift(),Kn.queue=consumeUntil(Hn,WHITESPACE_OR_COMMA)):io==="root"&&Hn[0]===":"?(Hn.shift(),Kn[io]=consumeCSSSelector(Hn)):io==="threshold"&&Hn[0]===":"?(Hn.shift(),Kn[io]=consumeUntil(Hn,WHITESPACE_OR_COMMA)):triggerErrorEvent(_n,"htmx:syntax:error",{token:Hn.shift()})}$n.push(Kn)}Hn.length===qn&&triggerErrorEvent(_n,"htmx:syntax:error",{token:Hn.shift()}),consumeUntil(Hn,NOT_WHITESPACE)}while(Hn[0]===","&&Hn.shift());return ke&&(ke[Ce]=$n),$n}function getTriggerSpecs(_n){const Ce=getAttributeValue(_n,"hx-trigger");let ke=[];if(Ce){const $n=htmx.config.triggerSpecsCache;ke=$n&&$n[Ce]||parseAndCacheTrigger(_n,Ce,$n)}return ke.length>0?ke:matches(_n,"form")?[{trigger:"submit"}]:matches(_n,'input[type="button"], input[type="submit"]')?[{trigger:"click"}]:matches(_n,INPUT_SELECTOR)?[{trigger:"change"}]:[{trigger:"click"}]}function cancelPolling(_n){getInternalData(_n).cancelled=!0}function processPolling(_n,Ce,ke){const $n=getInternalData(_n);$n.timeout=getWindow().setTimeout(function(){bodyContains(_n)&&$n.cancelled!==!0&&(maybeFilterEvent(ke,_n,makeEvent("hx:poll:trigger",{triggerSpec:ke,target:_n}))||Ce(_n),processPolling(_n,Ce,ke))},ke.pollInterval)}function isLocalLink(_n){return location.hostname===_n.hostname&&getRawAttribute(_n,"href")&&getRawAttribute(_n,"href").indexOf("#")!==0}function eltIsDisabled(_n){return closest(_n,htmx.config.disableSelector)}function boostElement(_n,Ce,ke){if(_n instanceof HTMLAnchorElement&&isLocalLink(_n)&&(_n.target===""||_n.target==="_self")||_n.tagName==="FORM"&&String(getRawAttribute(_n,"method")).toLowerCase()!=="dialog"){Ce.boosted=!0;let $n,Hn;if(_n.tagName==="A")$n="get",Hn=getRawAttribute(_n,"href");else{const zn=getRawAttribute(_n,"method");$n=zn?zn.toLowerCase():"get",Hn=getRawAttribute(_n,"action")}ke.forEach(function(zn){addEventListener(_n,function(Un,qn){const Xn=asElement(Un);if(eltIsDisabled(Xn)){cleanUpElement(Xn);return}issueAjaxRequest($n,Hn,Xn,qn)},Ce,zn,!0)})}}function shouldCancel(_n,Ce){const ke=asElement(Ce);return ke?!!((_n.type==="submit"||_n.type==="click")&&(ke.tagName==="FORM"||matches(ke,'input[type="submit"], button')&&closest(ke,"form")!==null||ke instanceof HTMLAnchorElement&&ke.href&&(ke.getAttribute("href")==="#"||ke.getAttribute("href").indexOf("#")!==0))):!1}function ignoreBoostedAnchorCtrlClick(_n,Ce){return getInternalData(_n).boosted&&_n instanceof HTMLAnchorElement&&Ce.type==="click"&&(Ce.ctrlKey||Ce.metaKey)}function maybeFilterEvent(_n,Ce,ke){const $n=_n.eventFilter;if($n)try{return $n.call(Ce,ke)!==!0}catch(Hn){const zn=$n.source;return triggerErrorEvent(getDocument().body,"htmx:eventFilter:error",{error:Hn,source:zn}),!0}return!1}function addEventListener(_n,Ce,ke,$n,Hn){const zn=getInternalData(_n);let Un;$n.from?Un=querySelectorAllExt(_n,$n.from):Un=[_n],$n.changed&&Un.forEach(function(qn){const Xn=getInternalData(qn);Xn.lastValue=qn.value}),forEach(Un,function(qn){const Xn=function(Kn){if(!bodyContains(_n)){qn.removeEventListener($n.trigger,Xn);return}if(ignoreBoostedAnchorCtrlClick(_n,Kn)||((Hn||shouldCancel(Kn,_n))&&Kn.preventDefault(),maybeFilterEvent($n,_n,Kn)))return;const to=getInternalData(Kn);if(to.triggerSpec=$n,to.handledFor==null&&(to.handledFor=[]),to.handledFor.indexOf(_n)<0){if(to.handledFor.push(_n),$n.consume&&Kn.stopPropagation(),$n.target&&Kn.target&&!matches(asElement(Kn.target),$n.target))return;if($n.once){if(zn.triggeredOnce)return;zn.triggeredOnce=!0}if($n.changed){const io=getInternalData(qn),uo=qn.value;if(io.lastValue===uo)return;io.lastValue=uo}if(zn.delayed&&clearTimeout(zn.delayed),zn.throttle)return;$n.throttle>0?zn.throttle||(triggerEvent(_n,"htmx:trigger"),Ce(_n,Kn),zn.throttle=getWindow().setTimeout(function(){zn.throttle=null},$n.throttle)):$n.delay>0?zn.delayed=getWindow().setTimeout(function(){triggerEvent(_n,"htmx:trigger"),Ce(_n,Kn)},$n.delay):(triggerEvent(_n,"htmx:trigger"),Ce(_n,Kn))}};ke.listenerInfos==null&&(ke.listenerInfos=[]),ke.listenerInfos.push({trigger:$n.trigger,listener:Xn,on:qn}),qn.addEventListener($n.trigger,Xn)})}let windowIsScrolling=!1,scrollHandler=null;function initScrollHandler(){scrollHandler||(scrollHandler=function(){windowIsScrolling=!0},window.addEventListener("scroll",scrollHandler),setInterval(function(){windowIsScrolling&&(windowIsScrolling=!1,forEach(getDocument().querySelectorAll("[hx-trigger*='revealed'],[data-hx-trigger*='revealed']"),function(_n){maybeReveal(_n)}))},200))}function maybeReveal(_n){!hasAttribute(_n,"data-hx-revealed")&&isScrolledIntoView(_n)&&(_n.setAttribute("data-hx-revealed","true"),getInternalData(_n).initHash?triggerEvent(_n,"revealed"):_n.addEventListener("htmx:afterProcessNode",function(){triggerEvent(_n,"revealed")},{once:!0}))}function loadImmediately(_n,Ce,ke,$n){const Hn=function(){ke.loaded||(ke.loaded=!0,Ce(_n))};$n>0?getWindow().setTimeout(Hn,$n):Hn()}function processVerbs(_n,Ce,ke){let $n=!1;return forEach(VERBS,function(Hn){if(hasAttribute(_n,"hx-"+Hn)){const zn=getAttributeValue(_n,"hx-"+Hn);$n=!0,Ce.path=zn,Ce.verb=Hn,ke.forEach(function(Un){addTriggerHandler(_n,Un,Ce,function(qn,Xn){const Kn=asElement(qn);if(closest(Kn,htmx.config.disableSelector)){cleanUpElement(Kn);return}issueAjaxRequest(Hn,zn,Kn,Xn)})})}}),$n}function addTriggerHandler(_n,Ce,ke,$n){if(Ce.trigger==="revealed")initScrollHandler(),addEventListener(_n,$n,ke,Ce),maybeReveal(asElement(_n));else if(Ce.trigger==="intersect"){const Hn={};Ce.root&&(Hn.root=querySelectorExt(_n,Ce.root)),Ce.threshold&&(Hn.threshold=parseFloat(Ce.threshold)),new IntersectionObserver(function(Un){for(let qn=0;qn0?(ke.polling=!0,processPolling(asElement(_n),$n,Ce)):addEventListener(_n,$n,ke,Ce)}function shouldProcessHxOn(_n){const Ce=asElement(_n);if(!Ce)return!1;const ke=Ce.attributes;for(let $n=0;$n", "+zn).join(""))}else return[]}function maybeSetLastButtonClicked(_n){const Ce=closest(asElement(_n.target),"button, input[type='submit']"),ke=getRelatedFormData(_n);ke&&(ke.lastButtonClicked=Ce)}function maybeUnsetLastButtonClicked(_n){const Ce=getRelatedFormData(_n);Ce&&(Ce.lastButtonClicked=null)}function getRelatedFormData(_n){const Ce=closest(asElement(_n.target),"button, input[type='submit']");if(!Ce)return;const ke=resolveTarget("#"+getRawAttribute(Ce,"form"),Ce.getRootNode())||closest(Ce,"form");if(ke)return getInternalData(ke)}function initButtonTracking(_n){_n.addEventListener("click",maybeSetLastButtonClicked),_n.addEventListener("focusin",maybeSetLastButtonClicked),_n.addEventListener("focusout",maybeUnsetLastButtonClicked)}function addHxOnEventHandler(_n,Ce,ke){const $n=getInternalData(_n);Array.isArray($n.onHandlers)||($n.onHandlers=[]);let Hn;const zn=function(Un){maybeEval(_n,function(){eltIsDisabled(_n)||(Hn||(Hn=new Function("event",ke)),Hn.call(_n,Un))})};_n.addEventListener(Ce,zn),$n.onHandlers.push({event:Ce,listener:zn})}function processHxOnWildcard(_n){deInitOnHandlers(_n);for(let Ce=0;Ce<_n.attributes.length;Ce++){const ke=_n.attributes[Ce].name,$n=_n.attributes[Ce].value;if(startsWith(ke,"hx-on")||startsWith(ke,"data-hx-on")){const Hn=ke.indexOf("-on")+3,zn=ke.slice(Hn,Hn+1);if(zn==="-"||zn===":"){let Un=ke.slice(Hn+1);startsWith(Un,":")?Un="htmx"+Un:startsWith(Un,"-")?Un="htmx:"+Un.slice(1):startsWith(Un,"htmx-")&&(Un="htmx:"+Un.slice(5)),addHxOnEventHandler(_n,Un,$n)}}}}function initNode(_n){if(closest(_n,htmx.config.disableSelector)){cleanUpElement(_n);return}const Ce=getInternalData(_n);if(Ce.initHash!==attributeHash(_n)){deInitNode(_n),Ce.initHash=attributeHash(_n),triggerEvent(_n,"htmx:beforeProcessNode"),_n.value&&(Ce.lastValue=_n.value);const ke=getTriggerSpecs(_n);processVerbs(_n,Ce,ke)||(getClosestAttributeValue(_n,"hx-boost")==="true"?boostElement(_n,Ce,ke):hasAttribute(_n,"hx-trigger")&&ke.forEach(function(Hn){addTriggerHandler(_n,Hn,Ce,function(){})})),(_n.tagName==="FORM"||getRawAttribute(_n,"type")==="submit"&&hasAttribute(_n,"form"))&&initButtonTracking(_n),triggerEvent(_n,"htmx:afterProcessNode")}}function processNode(_n){if(_n=resolveTarget(_n),closest(_n,htmx.config.disableSelector)){cleanUpElement(_n);return}initNode(_n),forEach(findElementsToProcess(_n),function(Ce){initNode(Ce)}),forEach(findHxOnWildcardElements(_n),processHxOnWildcard)}function kebabEventName(_n){return _n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function makeEvent(_n,Ce){let ke;return window.CustomEvent&&typeof window.CustomEvent=="function"?ke=new CustomEvent(_n,{bubbles:!0,cancelable:!0,composed:!0,detail:Ce}):(ke=getDocument().createEvent("CustomEvent"),ke.initCustomEvent(_n,!0,!0,Ce)),ke}function triggerErrorEvent(_n,Ce,ke){triggerEvent(_n,Ce,mergeObjects({error:Ce},ke))}function ignoreEventForLogging(_n){return _n==="htmx:afterProcessNode"}function withExtensions(_n,Ce){forEach(getExtensions(_n),function(ke){try{Ce(ke)}catch($n){logError($n)}})}function logError(_n){console.error?console.error(_n):console.log&&console.log("ERROR: ",_n)}function triggerEvent(_n,Ce,ke){_n=resolveTarget(_n),ke==null&&(ke={}),ke.elt=_n;const $n=makeEvent(Ce,ke);htmx.logger&&!ignoreEventForLogging(Ce)&&htmx.logger(_n,Ce,ke),ke.error&&(logError(ke.error),triggerEvent(_n,"htmx:error",{errorInfo:ke}));let Hn=_n.dispatchEvent($n);const zn=kebabEventName(Ce);if(Hn&&zn!==Ce){const Un=makeEvent(zn,$n.detail);Hn=Hn&&_n.dispatchEvent(Un)}return withExtensions(asElement(_n),function(Un){Hn=Hn&&Un.onEvent(Ce,$n)!==!1&&!$n.defaultPrevented}),Hn}let currentPathForHistory=location.pathname+location.search;function getHistoryElement(){return getDocument().querySelector("[hx-history-elt],[data-hx-history-elt]")||getDocument().body}function saveToHistoryCache(_n,Ce){if(!canAccessLocalStorage())return;const ke=cleanInnerHtmlForHistory(Ce),$n=getDocument().title,Hn=window.scrollY;if(htmx.config.historyCacheSize<=0){localStorage.removeItem("htmx-history-cache");return}_n=normalizePath(_n);const zn=parseJSON(localStorage.getItem("htmx-history-cache"))||[];for(let qn=0;qnhtmx.config.historyCacheSize;)zn.shift();for(;zn.length>0;)try{localStorage.setItem("htmx-history-cache",JSON.stringify(zn));break}catch(qn){triggerErrorEvent(getDocument().body,"htmx:historyCacheError",{cause:qn,cache:zn}),zn.shift()}}function getCachedHistory(_n){if(!canAccessLocalStorage())return null;_n=normalizePath(_n);const Ce=parseJSON(localStorage.getItem("htmx-history-cache"))||[];for(let ke=0;ke=200&&this.status<400){triggerEvent(getDocument().body,"htmx:historyCacheMissLoad",ke);const $n=makeFragment(this.response),Hn=$n.querySelector("[hx-history-elt],[data-hx-history-elt]")||$n,zn=getHistoryElement(),Un=makeSettleInfo(zn);handleTitle($n.title),swapInnerHTML(zn,Hn,Un),settleImmediately(Un.tasks),currentPathForHistory=_n,triggerEvent(getDocument().body,"htmx:historyRestore",{path:_n,cacheMiss:!0,serverResponse:this.response})}else triggerErrorEvent(getDocument().body,"htmx:historyCacheMissLoadError",ke)},Ce.send()}function restoreHistory(_n){saveCurrentPageToHistory(),_n=_n||location.pathname+location.search;const Ce=getCachedHistory(_n);if(Ce){const ke=makeFragment(Ce.content),$n=getHistoryElement(),Hn=makeSettleInfo($n);handleTitle(ke.title),swapInnerHTML($n,ke,Hn),settleImmediately(Hn.tasks),getWindow().setTimeout(function(){window.scrollTo(0,Ce.scroll)},0),currentPathForHistory=_n,triggerEvent(getDocument().body,"htmx:historyRestore",{path:_n,item:Ce})}else htmx.config.refreshOnHistoryMiss?window.location.reload(!0):loadHistoryFromServer(_n)}function addRequestIndicatorClasses(_n){let Ce=findAttributeTargets(_n,"hx-indicator");return Ce==null&&(Ce=[_n]),forEach(Ce,function(ke){const $n=getInternalData(ke);$n.requestCount=($n.requestCount||0)+1,ke.classList.add.call(ke.classList,htmx.config.requestClass)}),Ce}function disableElements(_n){let Ce=findAttributeTargets(_n,"hx-disabled-elt");return Ce==null&&(Ce=[]),forEach(Ce,function(ke){const $n=getInternalData(ke);$n.requestCount=($n.requestCount||0)+1,ke.setAttribute("disabled",""),ke.setAttribute("data-disabled-by-htmx","")}),Ce}function removeRequestIndicators(_n,Ce){forEach(_n,function(ke){const $n=getInternalData(ke);$n.requestCount=($n.requestCount||0)-1,$n.requestCount===0&&ke.classList.remove.call(ke.classList,htmx.config.requestClass)}),forEach(Ce,function(ke){const $n=getInternalData(ke);$n.requestCount=($n.requestCount||0)-1,$n.requestCount===0&&(ke.removeAttribute("disabled"),ke.removeAttribute("data-disabled-by-htmx"))})}function haveSeenNode(_n,Ce){for(let ke=0;ke<_n.length;ke++)if(_n[ke].isSameNode(Ce))return!0;return!1}function shouldInclude(_n){const Ce=_n;return Ce.name===""||Ce.name==null||Ce.disabled||closest(Ce,"fieldset[disabled]")||Ce.type==="button"||Ce.type==="submit"||Ce.tagName==="image"||Ce.tagName==="reset"||Ce.tagName==="file"?!1:Ce.type==="checkbox"||Ce.type==="radio"?Ce.checked:!0}function addValueToFormData(_n,Ce,ke){_n!=null&&Ce!=null&&(Array.isArray(Ce)?Ce.forEach(function($n){ke.append(_n,$n)}):ke.append(_n,Ce))}function removeValueFromFormData(_n,Ce,ke){if(_n!=null&&Ce!=null){let $n=ke.getAll(_n);Array.isArray(Ce)?$n=$n.filter(Hn=>Ce.indexOf(Hn)<0):$n=$n.filter(Hn=>Hn!==Ce),ke.delete(_n),forEach($n,Hn=>ke.append(_n,Hn))}}function processInputValue(_n,Ce,ke,$n,Hn){if(!($n==null||haveSeenNode(_n,$n))){if(_n.push($n),shouldInclude($n)){const zn=getRawAttribute($n,"name");let Un=$n.value;$n instanceof HTMLSelectElement&&$n.multiple&&(Un=toArray($n.querySelectorAll("option:checked")).map(function(qn){return qn.value})),$n instanceof HTMLInputElement&&$n.files&&(Un=toArray($n.files)),addValueToFormData(zn,Un,Ce),Hn&&validateElement($n,ke)}$n instanceof HTMLFormElement&&(forEach($n.elements,function(zn){_n.indexOf(zn)>=0?removeValueFromFormData(zn.name,zn.value,Ce):_n.push(zn),Hn&&validateElement(zn,ke)}),new FormData($n).forEach(function(zn,Un){zn instanceof File&&zn.name===""||addValueToFormData(Un,zn,Ce)}))}}function validateElement(_n,Ce){const ke=_n;ke.willValidate&&(triggerEvent(ke,"htmx:validation:validate"),ke.checkValidity()||(Ce.push({elt:ke,message:ke.validationMessage,validity:ke.validity}),triggerEvent(ke,"htmx:validation:failed",{message:ke.validationMessage,validity:ke.validity})))}function overrideFormData(_n,Ce){for(const ke of Ce.keys())_n.delete(ke);return Ce.forEach(function(ke,$n){_n.append($n,ke)}),_n}function getInputValues(_n,Ce){const ke=[],$n=new FormData,Hn=new FormData,zn=[],Un=getInternalData(_n);Un.lastButtonClicked&&!bodyContains(Un.lastButtonClicked)&&(Un.lastButtonClicked=null);let qn=_n instanceof HTMLFormElement&&_n.noValidate!==!0||getAttributeValue(_n,"hx-validate")==="true";if(Un.lastButtonClicked&&(qn=qn&&Un.lastButtonClicked.formNoValidate!==!0),Ce!=="get"&&processInputValue(ke,Hn,zn,closest(_n,"form"),qn),processInputValue(ke,$n,zn,_n,qn),Un.lastButtonClicked||_n.tagName==="BUTTON"||_n.tagName==="INPUT"&&getRawAttribute(_n,"type")==="submit"){const Kn=Un.lastButtonClicked||_n,to=getRawAttribute(Kn,"name");addValueToFormData(to,Kn.value,Hn)}const Xn=findAttributeTargets(_n,"hx-include");return forEach(Xn,function(Kn){processInputValue(ke,$n,zn,asElement(Kn),qn),matches(Kn,"form")||forEach(asParentNode(Kn).querySelectorAll(INPUT_SELECTOR),function(to){processInputValue(ke,$n,zn,to,qn)})}),overrideFormData($n,Hn),{errors:zn,formData:$n,values:formDataProxy($n)}}function appendParam(_n,Ce,ke){_n!==""&&(_n+="&"),String(ke)==="[object Object]"&&(ke=JSON.stringify(ke));const $n=encodeURIComponent(ke);return _n+=encodeURIComponent(Ce)+"="+$n,_n}function urlEncode(_n){_n=formDataFromObject(_n);let Ce="";return _n.forEach(function(ke,$n){Ce=appendParam(Ce,$n,ke)}),Ce}function getHeaders(_n,Ce,ke){const $n={"HX-Request":"true","HX-Trigger":getRawAttribute(_n,"id"),"HX-Trigger-Name":getRawAttribute(_n,"name"),"HX-Target":getAttributeValue(Ce,"id"),"HX-Current-URL":getDocument().location.href};return getValuesForElement(_n,"hx-headers",!1,$n),ke!==void 0&&($n["HX-Prompt"]=ke),getInternalData(_n).boosted&&($n["HX-Boosted"]="true"),$n}function filterValues(_n,Ce){const ke=getClosestAttributeValue(Ce,"hx-params");if(ke){if(ke==="none")return new FormData;if(ke==="*")return _n;if(ke.indexOf("not ")===0)return forEach(ke.substr(4).split(","),function($n){$n=$n.trim(),_n.delete($n)}),_n;{const $n=new FormData;return forEach(ke.split(","),function(Hn){Hn=Hn.trim(),_n.has(Hn)&&_n.getAll(Hn).forEach(function(zn){$n.append(Hn,zn)})}),$n}}else return _n}function isAnchorLink(_n){return!!getRawAttribute(_n,"href")&&getRawAttribute(_n,"href").indexOf("#")>=0}function getSwapSpecification(_n,Ce){const ke=Ce||getClosestAttributeValue(_n,"hx-swap"),$n={swapStyle:getInternalData(_n).boosted?"innerHTML":htmx.config.defaultSwapStyle,swapDelay:htmx.config.defaultSwapDelay,settleDelay:htmx.config.defaultSettleDelay};if(htmx.config.scrollIntoViewOnBoost&&getInternalData(_n).boosted&&!isAnchorLink(_n)&&($n.show="top"),ke){const Un=splitOnWhitespace(ke);if(Un.length>0)for(let qn=0;qn0?Hn.join(":"):null;$n.scroll=to,$n.scrollTarget=zn}else if(Xn.indexOf("show:")===0){var Hn=Xn.substr(5).split(":");const io=Hn.pop();var zn=Hn.length>0?Hn.join(":"):null;$n.show=io,$n.showTarget=zn}else if(Xn.indexOf("focus-scroll:")===0){const Kn=Xn.substr(13);$n.focusScroll=Kn=="true"}else qn==0?$n.swapStyle=Xn:logError("Unknown modifier in hx-swap: "+Xn)}}return $n}function usesFormData(_n){return getClosestAttributeValue(_n,"hx-encoding")==="multipart/form-data"||matches(_n,"form")&&getRawAttribute(_n,"enctype")==="multipart/form-data"}function encodeParamsForBody(_n,Ce,ke){let $n=null;return withExtensions(Ce,function(Hn){$n==null&&($n=Hn.encodeParameters(_n,ke,Ce))}),$n??(usesFormData(Ce)?overrideFormData(new FormData,formDataFromObject(ke)):urlEncode(ke))}function makeSettleInfo(_n){return{tasks:[],elts:[_n]}}function updateScrollState(_n,Ce){const ke=_n[0],$n=_n[_n.length-1];if(Ce.scroll){var Hn=null;Ce.scrollTarget&&(Hn=asElement(querySelectorExt(ke,Ce.scrollTarget))),Ce.scroll==="top"&&(ke||Hn)&&(Hn=Hn||ke,Hn.scrollTop=0),Ce.scroll==="bottom"&&($n||Hn)&&(Hn=Hn||$n,Hn.scrollTop=Hn.scrollHeight)}if(Ce.show){var Hn=null;if(Ce.showTarget){let Un=Ce.showTarget;Ce.showTarget==="window"&&(Un="body"),Hn=asElement(querySelectorExt(ke,Un))}Ce.show==="top"&&(ke||Hn)&&(Hn=Hn||ke,Hn.scrollIntoView({block:"start",behavior:htmx.config.scrollBehavior})),Ce.show==="bottom"&&($n||Hn)&&(Hn=Hn||$n,Hn.scrollIntoView({block:"end",behavior:htmx.config.scrollBehavior}))}}function getValuesForElement(_n,Ce,ke,$n){if($n==null&&($n={}),_n==null)return $n;const Hn=getAttributeValue(_n,Ce);if(Hn){let zn=Hn.trim(),Un=ke;if(zn==="unset")return null;zn.indexOf("javascript:")===0?(zn=zn.substr(11),Un=!0):zn.indexOf("js:")===0&&(zn=zn.substr(3),Un=!0),zn.indexOf("{")!==0&&(zn="{"+zn+"}");let qn;Un?qn=maybeEval(_n,function(){return Function("return ("+zn+")")()},{}):qn=parseJSON(zn);for(const Xn in qn)qn.hasOwnProperty(Xn)&&$n[Xn]==null&&($n[Xn]=qn[Xn])}return getValuesForElement(asElement(parentElt(_n)),Ce,ke,$n)}function maybeEval(_n,Ce,ke){return htmx.config.allowEval?Ce():(triggerErrorEvent(_n,"htmx:evalDisallowedError"),ke)}function getHXVarsForElement(_n,Ce){return getValuesForElement(_n,"hx-vars",!0,Ce)}function getHXValsForElement(_n,Ce){return getValuesForElement(_n,"hx-vals",!1,Ce)}function getExpressionVars(_n){return mergeObjects(getHXVarsForElement(_n),getHXValsForElement(_n))}function safelySetHeaderValue(_n,Ce,ke){if(ke!==null)try{_n.setRequestHeader(Ce,ke)}catch{_n.setRequestHeader(Ce,encodeURIComponent(ke)),_n.setRequestHeader(Ce+"-URI-AutoEncoded","true")}}function getPathFromResponse(_n){if(_n.responseURL&&typeof URL<"u")try{const Ce=new URL(_n.responseURL);return Ce.pathname+Ce.search}catch{triggerErrorEvent(getDocument().body,"htmx:badResponseUrl",{url:_n.responseURL})}}function hasHeader(_n,Ce){return Ce.test(_n.getAllResponseHeaders())}function ajaxHelper(_n,Ce,ke){return _n=_n.toLowerCase(),ke?ke instanceof Element||typeof ke=="string"?issueAjaxRequest(_n,Ce,null,null,{targetOverride:resolveTarget(ke),returnPromise:!0}):issueAjaxRequest(_n,Ce,resolveTarget(ke.source),ke.event,{handler:ke.handler,headers:ke.headers,values:ke.values,targetOverride:resolveTarget(ke.target),swapOverride:ke.swap,select:ke.select,returnPromise:!0}):issueAjaxRequest(_n,Ce,null,null,{returnPromise:!0})}function hierarchyForElt(_n){const Ce=[];for(;_n;)Ce.push(_n),_n=_n.parentElement;return Ce}function verifyPath(_n,Ce,ke){let $n,Hn;return typeof URL=="function"?(Hn=new URL(Ce,document.location.href),$n=document.location.origin===Hn.origin):(Hn=Ce,$n=startsWith(Ce,document.location.origin)),htmx.config.selfRequestsOnly&&!$n?!1:triggerEvent(_n,"htmx:validateUrl",mergeObjects({url:Hn,sameHost:$n},ke))}function formDataFromObject(_n){if(_n instanceof FormData)return _n;const Ce=new FormData;for(const ke in _n)_n.hasOwnProperty(ke)&&(typeof _n[ke].forEach=="function"?_n[ke].forEach(function($n){Ce.append(ke,$n)}):typeof _n[ke]=="object"&&!(_n[ke]instanceof Blob)?Ce.append(ke,JSON.stringify(_n[ke])):Ce.append(ke,_n[ke]));return Ce}function formDataArrayProxy(_n,Ce,ke){return new Proxy(ke,{get:function($n,Hn){return typeof Hn=="number"?$n[Hn]:Hn==="length"?$n.length:Hn==="push"?function(zn){$n.push(zn),_n.append(Ce,zn)}:typeof $n[Hn]=="function"?function(){$n[Hn].apply($n,arguments),_n.delete(Ce),$n.forEach(function(zn){_n.append(Ce,zn)})}:$n[Hn]&&$n[Hn].length===1?$n[Hn][0]:$n[Hn]},set:function($n,Hn,zn){return $n[Hn]=zn,_n.delete(Ce),$n.forEach(function(Un){_n.append(Ce,Un)}),!0}})}function formDataProxy(_n){return new Proxy(_n,{get:function(Ce,ke){if(typeof ke=="symbol")return Reflect.get(Ce,ke);if(ke==="toJSON")return()=>Object.fromEntries(_n);if(ke in Ce)return typeof Ce[ke]=="function"?function(){return _n[ke].apply(_n,arguments)}:Ce[ke];const $n=_n.getAll(ke);if($n.length!==0)return $n.length===1?$n[0]:formDataArrayProxy(Ce,ke,$n)},set:function(Ce,ke,$n){return typeof ke!="string"?!1:(Ce.delete(ke),typeof $n.forEach=="function"?$n.forEach(function(Hn){Ce.append(ke,Hn)}):typeof $n=="object"&&!($n instanceof Blob)?Ce.append(ke,JSON.stringify($n)):Ce.append(ke,$n),!0)},deleteProperty:function(Ce,ke){return typeof ke=="string"&&Ce.delete(ke),!0},ownKeys:function(Ce){return Reflect.ownKeys(Object.fromEntries(Ce))},getOwnPropertyDescriptor:function(Ce,ke){return Reflect.getOwnPropertyDescriptor(Object.fromEntries(Ce),ke)}})}function issueAjaxRequest(_n,Ce,ke,$n,Hn,zn){let Un=null,qn=null;if(Hn=Hn??{},Hn.returnPromise&&typeof Promise<"u")var Xn=new Promise(function(hs,Qs){Un=hs,qn=Qs});ke==null&&(ke=getDocument().body);const Kn=Hn.handler||handleAjaxResponse,to=Hn.select||null;if(!bodyContains(ke))return maybeCall(Un),Xn;const io=Hn.targetOverride||asElement(getTarget(ke));if(io==null||io==DUMMY_ELT)return triggerErrorEvent(ke,"htmx:targetError",{target:getAttributeValue(ke,"hx-target")}),maybeCall(qn),Xn;let uo=getInternalData(ke);const ho=uo.lastButtonClicked;if(ho){const hs=getRawAttribute(ho,"formaction");hs!=null&&(Ce=hs);const Qs=getRawAttribute(ho,"formmethod");Qs!=null&&Qs.toLowerCase()!=="dialog"&&(_n=Qs)}const bo=getClosestAttributeValue(ke,"hx-confirm");if(zn===void 0&&triggerEvent(ke,"htmx:confirm",{target:io,elt:ke,path:Ce,verb:_n,triggeringEvent:$n,etc:Hn,issueRequest:function(zo){return issueAjaxRequest(_n,Ce,ke,$n,Hn,!!zo)},question:bo})===!1)return maybeCall(Un),Xn;let Oo=ke,So=getClosestAttributeValue(ke,"hx-sync"),$o=null,Do=!1;if(So){const hs=So.split(":"),Qs=hs[0].trim();if(Qs==="this"?Oo=findThisElement(ke,"hx-sync"):Oo=asElement(querySelectorExt(ke,Qs)),So=(hs[1]||"drop").trim(),uo=getInternalData(Oo),So==="drop"&&uo.xhr&&uo.abortable!==!0)return maybeCall(Un),Xn;if(So==="abort"){if(uo.xhr)return maybeCall(Un),Xn;Do=!0}else So==="replace"?triggerEvent(Oo,"htmx:abort"):So.indexOf("queue")===0&&($o=(So.split(" ")[1]||"last").trim())}if(uo.xhr)if(uo.abortable)triggerEvent(Oo,"htmx:abort");else{if($o==null){if($n){const hs=getInternalData($n);hs&&hs.triggerSpec&&hs.triggerSpec.queue&&($o=hs.triggerSpec.queue)}$o==null&&($o="last")}return uo.queuedRequests==null&&(uo.queuedRequests=[]),$o==="first"&&uo.queuedRequests.length===0?uo.queuedRequests.push(function(){issueAjaxRequest(_n,Ce,ke,$n,Hn)}):$o==="all"?uo.queuedRequests.push(function(){issueAjaxRequest(_n,Ce,ke,$n,Hn)}):$o==="last"&&(uo.queuedRequests=[],uo.queuedRequests.push(function(){issueAjaxRequest(_n,Ce,ke,$n,Hn)})),maybeCall(Un),Xn}const xo=new XMLHttpRequest;uo.xhr=xo,uo.abortable=Do;const Io=function(){uo.xhr=null,uo.abortable=!1,uo.queuedRequests!=null&&uo.queuedRequests.length>0&&uo.queuedRequests.shift()()},Vo=getClosestAttributeValue(ke,"hx-prompt");if(Vo){var Jo=prompt(Vo);if(Jo===null||!triggerEvent(ke,"htmx:prompt",{prompt:Jo,target:io}))return maybeCall(Un),Io(),Xn}if(bo&&!zn&&!confirm(bo))return maybeCall(Un),Io(),Xn;let Mo=getHeaders(ke,io,Jo);_n!=="get"&&!usesFormData(ke)&&(Mo["Content-Type"]="application/x-www-form-urlencoded"),Hn.headers&&(Mo=mergeObjects(Mo,Hn.headers));const Go=getInputValues(ke,_n);let os=Go.errors;const ms=Go.formData;Hn.values&&overrideFormData(ms,formDataFromObject(Hn.values));const is=formDataFromObject(getExpressionVars(ke)),Yo=overrideFormData(ms,is);let Ys=filterValues(Yo,ke);htmx.config.getCacheBusterParam&&_n==="get"&&Ys.set("org.htmx.cache-buster",getRawAttribute(io,"id")||"true"),(Ce==null||Ce==="")&&(Ce=getDocument().location.href);const sr=getValuesForElement(ke,"hx-request"),Js=getInternalData(ke).boosted;let ko=htmx.config.methodsThatUseUrlParams.indexOf(_n)>=0;const gs={boosted:Js,useUrlParams:ko,formData:Ys,parameters:formDataProxy(Ys),unfilteredFormData:Yo,unfilteredParameters:formDataProxy(Yo),headers:Mo,target:io,verb:_n,errors:os,withCredentials:Hn.credentials||sr.credentials||htmx.config.withCredentials,timeout:Hn.timeout||sr.timeout||htmx.config.timeout,path:Ce,triggeringEvent:$n};if(!triggerEvent(ke,"htmx:configRequest",gs))return maybeCall(Un),Io(),Xn;if(Ce=gs.path,_n=gs.verb,Mo=gs.headers,Ys=formDataFromObject(gs.parameters),os=gs.errors,ko=gs.useUrlParams,os&&os.length>0)return triggerEvent(ke,"htmx:validation:halted",gs),maybeCall(Un),Io(),Xn;const xs=Ce.split("#"),Qr=xs[0],cr=xs[1];let ws=Ce;if(ko&&(ws=Qr,!Ys.keys().next().done&&(ws.indexOf("?")<0?ws+="?":ws+="&",ws+=urlEncode(Ys),cr&&(ws+="#"+cr))),!verifyPath(ke,ws,gs))return triggerErrorEvent(ke,"htmx:invalidPath",gs),maybeCall(qn),Xn;if(xo.open(_n.toUpperCase(),ws,!0),xo.overrideMimeType("text/html"),xo.withCredentials=gs.withCredentials,xo.timeout=gs.timeout,!sr.noHeaders){for(const hs in Mo)if(Mo.hasOwnProperty(hs)){const Qs=Mo[hs];safelySetHeaderValue(xo,hs,Qs)}}const Fs={xhr:xo,target:io,requestConfig:gs,etc:Hn,boosted:Js,select:to,pathInfo:{requestPath:Ce,finalRequestPath:ws,responsePath:null,anchor:cr}};if(xo.onload=function(){try{const hs=hierarchyForElt(ke);if(Fs.pathInfo.responsePath=getPathFromResponse(xo),Kn(ke,Fs),Fs.keepIndicators!==!0&&removeRequestIndicators(Br,_r),triggerEvent(ke,"htmx:afterRequest",Fs),triggerEvent(ke,"htmx:afterOnLoad",Fs),!bodyContains(ke)){let Qs=null;for(;hs.length>0&&Qs==null;){const zo=hs.shift();bodyContains(zo)&&(Qs=zo)}Qs&&(triggerEvent(Qs,"htmx:afterRequest",Fs),triggerEvent(Qs,"htmx:afterOnLoad",Fs))}maybeCall(Un),Io()}catch(hs){throw triggerErrorEvent(ke,"htmx:onLoadError",mergeObjects({error:hs},Fs)),hs}},xo.onerror=function(){removeRequestIndicators(Br,_r),triggerErrorEvent(ke,"htmx:afterRequest",Fs),triggerErrorEvent(ke,"htmx:sendError",Fs),maybeCall(qn),Io()},xo.onabort=function(){removeRequestIndicators(Br,_r),triggerErrorEvent(ke,"htmx:afterRequest",Fs),triggerErrorEvent(ke,"htmx:sendAbort",Fs),maybeCall(qn),Io()},xo.ontimeout=function(){removeRequestIndicators(Br,_r),triggerErrorEvent(ke,"htmx:afterRequest",Fs),triggerErrorEvent(ke,"htmx:timeout",Fs),maybeCall(qn),Io()},!triggerEvent(ke,"htmx:beforeRequest",Fs))return maybeCall(Un),Io(),Xn;var Br=addRequestIndicatorClasses(ke),_r=disableElements(ke);forEach(["loadstart","loadend","progress","abort"],function(hs){forEach([xo,xo.upload],function(Qs){Qs.addEventListener(hs,function(zo){triggerEvent(ke,"htmx:xhr:"+hs,{lengthComputable:zo.lengthComputable,loaded:zo.loaded,total:zo.total})})})}),triggerEvent(ke,"htmx:beforeSend",Fs);const ha=ko?null:encodeParamsForBody(xo,ke,Ys);return xo.send(ha),Xn}function determineHistoryUpdates(_n,Ce){const ke=Ce.xhr;let $n=null,Hn=null;if(hasHeader(ke,/HX-Push:/i)?($n=ke.getResponseHeader("HX-Push"),Hn="push"):hasHeader(ke,/HX-Push-Url:/i)?($n=ke.getResponseHeader("HX-Push-Url"),Hn="push"):hasHeader(ke,/HX-Replace-Url:/i)&&($n=ke.getResponseHeader("HX-Replace-Url"),Hn="replace"),$n)return $n==="false"?{}:{type:Hn,path:$n};const zn=Ce.pathInfo.finalRequestPath,Un=Ce.pathInfo.responsePath,qn=getClosestAttributeValue(_n,"hx-push-url"),Xn=getClosestAttributeValue(_n,"hx-replace-url"),Kn=getInternalData(_n).boosted;let to=null,io=null;return qn?(to="push",io=qn):Xn?(to="replace",io=Xn):Kn&&(to="push",io=Un||zn),io?io==="false"?{}:(io==="true"&&(io=Un||zn),Ce.pathInfo.anchor&&io.indexOf("#")===-1&&(io=io+"#"+Ce.pathInfo.anchor),{type:to,path:io}):{}}function codeMatches(_n,Ce){var ke=new RegExp(_n.code);return ke.test(Ce.toString(10))}function resolveResponseHandling(_n){for(var Ce=0;Ce0?getWindow().setTimeout(Jo,$o.swapDelay):Jo()}io&&triggerErrorEvent(_n,"htmx:responseError",mergeObjects({error:"Response Status Error Code "+ke.status+" from "+Ce.pathInfo.requestPath},Ce))}}const extensions={};function extensionBase(){return{init:function(_n){return null},getSelectors:function(){return null},onEvent:function(_n,Ce){return!0},transformResponse:function(_n,Ce,ke){return _n},isInlineSwap:function(_n){return!1},handleSwap:function(_n,Ce,ke,$n){return!1},encodeParameters:function(_n,Ce,ke){return null}}}function defineExtension(_n,Ce){Ce.init&&Ce.init(internalAPI),extensions[_n]=mergeObjects(extensionBase(),Ce)}function removeExtension(_n){delete extensions[_n]}function getExtensions(_n,Ce,ke){if(Ce==null&&(Ce=[]),_n==null)return Ce;ke==null&&(ke=[]);const $n=getAttributeValue(_n,"hx-ext");return $n&&forEach($n.split(","),function(Hn){if(Hn=Hn.replace(/ /g,""),Hn.slice(0,7)=="ignore:"){ke.push(Hn.slice(7));return}if(ke.indexOf(Hn)<0){const zn=extensions[Hn];zn&&Ce.indexOf(zn)<0&&Ce.push(zn)}}),getExtensions(asElement(parentElt(_n)),Ce,ke)}var isReady=!1;getDocument().addEventListener("DOMContentLoaded",function(){isReady=!0});function ready(_n){isReady||getDocument().readyState==="complete"?_n():getDocument().addEventListener("DOMContentLoaded",_n)}function insertIndicatorStyles(){if(htmx.config.includeIndicatorStyles!==!1){const _n=htmx.config.inlineStyleNonce?` nonce="${htmx.config.inlineStyleNonce}"`:"";getDocument().head.insertAdjacentHTML("beforeend"," ."+htmx.config.indicatorClass+"{opacity:0} ."+htmx.config.requestClass+" ."+htmx.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} ."+htmx.config.requestClass+"."+htmx.config.indicatorClass+"{opacity:1; transition: opacity 200ms ease-in;} ")}}function getMetaConfig(){const _n=getDocument().querySelector('meta[name="htmx-config"]');return _n?parseJSON(_n.content):null}function mergeMetaConfig(){const _n=getMetaConfig();_n&&(htmx.config=mergeObjects(htmx.config,_n))}return ready(function(){mergeMetaConfig(),insertIndicatorStyles();let _n=getDocument().body;processNode(_n);const Ce=getDocument().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");_n.addEventListener("htmx:abort",function($n){const Hn=$n.target,zn=getInternalData(Hn);zn&&zn.xhr&&zn.xhr.abort()});const ke=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function($n){$n.state&&$n.state.htmx?(restoreHistory(),forEach(Ce,function(Hn){triggerEvent(Hn,"htmx:restored",{document:getDocument(),triggerEvent})})):ke&&ke($n)},getWindow().setTimeout(function(){triggerEvent(_n,"htmx:load",{}),_n=null},0)}),htmx})();mustache.escape=function(_n){return _n};const entryComponents={account:Account,channel:Channel};let loadedComponents=[],loadSvelte=function(){loadedComponents.map(ke=>ke.$destroy()),loadedComponents=[];const _n=document.body.querySelectorAll(".lucent-component");if(_n.length===0)return;const Ce=function(ke){const $n=ke.attributes["data-layout"].value,[Hn,zn]=Object.entries(entryComponents).find(([Kn,to])=>$n===Kn);if(!zn)return[];const Un=document.getElementById("json-"+$n).innerHTML,qn=JSON.parse(Un);qn.axios=axiosInstance;const Xn={target:ke,props:qn};loadedComponents=[...loadedComponents,new zn(Xn)]};Array.from(_n).map(Ce)};document.addEventListener("DOMContentLoaded",loadSvelte); diff --git a/public/vendor/lucent/dist/assets/main-Dk7njt4m.css b/public/vendor/lucent/dist/assets/main-Dk7njt4m.css new file mode 100755 index 0000000..791a66f --- /dev/null +++ b/public/vendor/lucent/dist/assets/main-Dk7njt4m.css @@ -0,0 +1 @@ +@charset "UTF-8";:root{--p10: #f4f9ff;--p20: #eaf1f9;--p30: #b3ceff;--p40: #8db5ff;--p50: #70a2ff;--p60: #679cff;--p70: #4284ff;--p80: #1c6bff;--p90: #002b7a;--p100: #000C23;--suc10: #d1ffb8;--suc20: #d1ffb8;--suc30: #b5ff8d;--suc40: #a2ff70;--suc50: #82cc5a;--suc80: #71b34e;--suc90: #314c22;--err10: #ffb9d0;--err20: #ff9bb3;--err30: #fe7e97;--err40: #de617b;--err50: #be4461;--err80: #61001a;--err90: #560012;--grey-dark: #424656;--grey-light: #a6abbd;--text: var(--p100);--text-light: var(--grey-dark);--text-error: var(--err50);--main-font: ‘Open Sans‘, Arial, Helvetica, sans-serif}*,*:before,*:after{box-sizing:border-box}*{margin:0}body{line-height:1.5;-webkit-font-smoothing:antialiased}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}#root,#__next{isolation:isolate}.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-5{margin-top:20px}.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-5{margin-bottom:20px}.pt-1{padding-top:4px}.pt-2{padding-top:8px}.pt-3{padding-top:12px}.pt-4{padding-top:16px}.pt-5{padding-top:20px}.pb-1{padding-bottom:4px}.pb-2{padding-bottom:8px}.pb-3{padding-bottom:12px}.pb-4{padding-bottom:16px}.pb-5{padding-bottom:20px}.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-5{gap:20px}.hide{display:none!important}.hidden{visibility:hidden}.d-block{display:block}.d-inline-block{display:inline-block}.is-bold{font-weight:700}.in-place{padding:36px}.notice{background-color:var(--p20);padding:14px;margin:2rem 0;position:relative;font-size:16px;line-height:24px;border-radius:12px}.notice .title{content:"NOTE";border-radius:12px;display:block;font-weight:700}.notice.notice-success{background:var(--suc20)}.notice.notice-error{background:var(--err10)}.scope-login{display:flex;height:100vh}.scope-login .bg-image{width:50%;background:url(/vendor/lucent/public/art.jpg);background-size:cover;background-repeat:no-repeat;background-position:center center}.scope-login .login-form{width:50%;height:100vh;display:flex;align-items:center;justify-content:center}.content{font-size:16px;line-height:20px;font-family:var(--main-font);color:var(--text)}.content p{margin-bottom:14px}.content p:last-child{margin-bottom:0}.content h1{font-size:24px;line-height:34px}.content h2{font-size:20px;line-height:30px}.content h3{font-size:18px;line-height:28px}.content ul{padding:0 0 0 16px;list-style:none outside none}.content ul li:before{content:"—";opacity:.5;font-size:12px;padding-right:6px;vertical-align:10%}.content ul li{list-style:none;padding:0}.content code{background:var(--p30);padding:0 6px;border-radius:12px}.content img{margin-bottom:14px}.content blockquote{border:1px solid var(--p30);border-radius:12px;padding:12px 40px;position:relative}.content blockquote:before{content:"“";color:var(--p60);font-size:4em;position:absolute;left:10px;top:20px}.content blockquote:after{content:""}.content pre{background:var(--grey-light);border-radius:.5rem;color:var(--white);font-family:JetBrainsMono,monospace;margin:1.5rem 0;padding:.75rem 1rem}.content pre code{background:none;color:inherit;font-size:.8rem;padding:0}.lx-small-text{font-size:12px;line-height:15px}.light-text{color:var(--text-light)}.sidebar-top{border:0px solid var(--p30);font-size:18px;padding:20px;display:flex;align-items:center;justify-content:space-between;background:var(--p20);margin-bottom:15px;border-radius:12px}.sidebar{border-radius:12px;font-size:15px;line-height:28px;padding:20px;background:var(--p20);display:flex;flex-direction:column;gap:3px}.sidebar-header{display:flex;cursor:pointer;justify-content:space-between;align-items:center;background:var(--p30);font-size:16px;padding:3px 12px;color:var(--text);border:none;border-radius:12px}.sidebar-header:focus{box-shadow:none}.sidebar-header:hover{background:var(--p40)}.sidebar-header:last-child{border-bottom:none}.sidebar-item{color:var(--text);display:block;font-size:14px;padding:3px 12px;text-decoration:none;transition:.6s;border-radius:12px}.sidebar-item:last-child{border-bottom:none}.sidebar-item:hover{background:var(--p30)}.sidebar-item.active{background:var(--p40)}.top-nav{display:flex;justify-content:end;align-items:center;gap:10px}.top-nav-item{border-radius:12px;font-size:14px;background:var(--p20);padding:3px 10px}.top-nav-item:hover{background:var(--p30)}label{display:block;font-weight:700;margin-bottom:4px}input[type=text],input[type=number],input[type=search],input[type=email],textarea{width:100%;background:var(--p20);border:1px solid var(--p50);border-radius:5px;padding:5px 7px;font-size:16px}input[type=text]:focus,input[type=number]:focus,input[type=search]:focus,input[type=email]:focus,textarea:focus{background:var(--p10)}textarea{resize:none}select{width:100%;background:var(--p20);border:1px solid var(--p50);border-radius:5px;padding:5px 7px;font-size:16px}select:focus{background:var(--p10)}.htmx-indicator{display:none}.htmx-request .htmx-indicator,.htmx-request.htmx-indicator{display:inline}.bt{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#000;background-image:none;border:1px solid #000;border-radius:4px;box-shadow:#fff 4px 4px,#000 4px 4px 0 1px;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-family:ITCAvantGardeStd-Bk,Arial,sans-serif;font-size:16px;font-weight:400;line-height:20px;margin:0 5px 10px 0;overflow:visible;padding:8px 40px;text-align:center;text-transform:none;touch-action:manipulation;user-select:none;-webkit-user-select:none;vertical-align:middle;white-space:nowrap}.bt:focus{text-decoration:none}.bt:hover{text-decoration:none}.bt:active{box-shadow:#00000020 0 3px 5px inset;outline:0}.bt:not([disabled]):active{box-shadow:#fff 2px 2px,#000 2px 2px 0 1px;transform:translate(2px,2px)}.table{min-width:600px;overflow:auto;background:var(--p20);padding:1px;font-size:14px;border-radius:12px}.table table{background:var(--p20);width:100%;border-collapse:separate;border:none;border-spacing:0}.table thead,.table thead tr{border-radius:12px}.table th{font-size:14px;font-weight:400;white-space:nowrap;max-width:400px;border:none;background:var(--p20);text-align:left;padding:8px 16px}.table th.is-sort{font-weight:700}.table th:first-child{border-radius:12px 0 0}.table th:last-child{border-radius:0 12px 0 0}.table td{font-weight:400;white-space:nowrap;max-width:400px;height:48px;padding:4px 16px;border:none;overflow:hidden}.table td .status{color:var(--text);font-size:80%}.table td .row-name{display:flex;align-items:center;gap:6px}.table td .title-td-contents{display:flex;align-items:center;gap:6px;font-size:14px;line-height:14px}.table tbody tr{border-radius:12px;background:var(--p10);border:none}.table tbody tr:has(input:checked){background:var(--p30)}.table tbody tr:hover{background:var(--p20)}.table .field-ui-number{text-align:right}.table .references{display:flex;gap:4px}.table .references .reference{font-size:13px;border-radius:12px;background:var(--p30);padding:1px 5px}.file-table-row{display:flex;align-items:center;gap:5px}.file-table-row>div{display:flex;flex-flow:column;gap:5px}.avatar{display:inline-block;vertical-align:middle;position:relative;color:#fff;border-radius:50%}.avatar__letters{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.avatars-compact{position:relative}.avatars-compact .avatar{margin-left:-9px}.is-editable-false .cm-content{background-color:var(--p10)}.cm-focused .cm-content{background-color:var(--p10);color:var(--p100)}.cm-content{background-color:var(--p20)}.ͼ4 .cm-line ::selection,.ͼ4 .cm-line::selection{background:var(--p40)!important}.cm-activeLine{background-color:var(--p20)!important}.tiptap{width:100%;background:var(--p20);border:1px solid var(--p50);border-radius:0 0 5px 5px;padding:15px;font-size:16px}.tiptap :first-child{margin-top:0}.tiptap:focus{background:var(--p10)}.tiptap img.ProseMirror-selectednode{box-shadow:0 0 1px 2px var(--p70)}.editor-field .editor-toolbar{display:flex;gap:4px;background:var(--p30);border-radius:5px 5px 0 0;padding:5px 7px}.editor-field .editor-toolbar .button:not(.primary){font-weight:700}.editor-field .editor-toolbar .button:not(.primary).active{background:var(--p40)}.content .tiptap li>p{display:inline}trix-editor{background:var(--p20)!important;border:1px solid var(--p50)!important;border-radius:0 0 5px 5px!important;padding:15px!important}trix-editor>div{margin-bottom:14px;font-size:16px;line-height:23px}trix-editor:focus{background:var(--p10)!important}trix-editor figure.attachment{display:flex!important;flex-direction:column!important;justify-content:center;align-items:center;gap:10px}trix-editor .attachment{background:var(--p20);padding:12px 0;text-align:center;display:flex;justify-content:center}trix-editor .attachment img{margin-bottom:0}trix-editor [data-trix-mutable].attachment img{box-shadow:0 0 1px 2px var(--p70)!important}trix-editor .trix-button--remove{box-shadow:none!important;border:2px solid var(--p40)!important}trix-editor .trix-button--remove:hover{border:2px solid var(--p40)}trix-editor a{color:var(--p80)}trix-toolbar .trix-button-row{display:flex}trix-toolbar .trix-button-group{background:transparent!important;border:none!important;display:flex!important;gap:4px}trix-toolbar .trix-button-group--history-tools,trix-toolbar .trix-button-group--file-tools{display:none!important}trix-toolbar .trix-button{border-radius:6px!important;background:var(--p30)!important;padding:14px 22px!important;margin:0!important;cursor:pointer;border:0px solid var(--p30)!important;font-size:14px!important;min-height:27px!important;display:flex!important;align-items:center!important;gap:4px;color:var(--text)!important}trix-toolbar .trix-button:before{background-size:22px!important}trix-toolbar .trix-button:hover{background:var(--p40)!important}trix-toolbar .trix-button.trix-active{background:var(--p50)!important}.sidebar-content{min-width:300px;max-width:400px;position:relative}.main-content{position:relative;width:fit-content;min-width:900px}.main-wrapper{display:flex;justify-content:center;gap:40px;padding:20px;position:relative}.wrapper-tiny{background-color:var(--p20);border-radius:12px;margin:44px auto;width:600px;padding:44px}.common-wrapper{background-color:var(--p20);margin:20px 0;padding:20px;border-radius:12px}.wrapper-normal{background-color:#fff;border-radius:32px;margin:44px auto;width:1000px;padding:44px}.wrapper-normal.transparent{margin:0 auto;padding:0;background-color:transparent}.wrapper-large{background-color:#fff;border-radius:32px;margin:44px auto;max-width:1920px;min-width:1000px;padding:44px;width:fit-content}.wrapper-large.transparent{padding:0;margin:0 auto;background-color:transparent}@media only screen and (max-width: 1800px){.wrapper-normal{margin:0 0 0 auto;padding:20px}.wrapper-normal.transparent{margin:0 0 0 auto;padding:40px}.wrapper-large{margin:44px 0 0 auto;padding:44px}.wrapper-large.transparent{margin:0 0 0 auto;padding:40px}}@media only screen and (max-width: 1390px){.wrapper-normal{margin:0 auto;padding:20px}.wrapper-normal.transparent{margin:0 auto;padding:40px}.wrapper-large{margin:44px 0 0 auto;padding:44px}.wrapper-large.transparent{margin:0 0 0 auto;padding:40px}}.section-actions{text-align:center;padding:32px 0}.header-normal,.header-small{text-align:left;font-weight:400;font-size:20px}.toolbar{display:flex;align-items:center;gap:5px;justify-content:space-between}.toolbar input.search{border-radius:12px;background:var(--p20);padding:4px 10px;cursor:pointer;border:none;font-size:14px}.toolbar .selected-filter{font-size:13px;border-radius:12px;margin:2px 0;background:var(--p30);padding:3px 10px;display:flex;gap:4px;line-height:22px}.toolbar .filter-input{margin:10px 0}.toolbar .filter-input input{font-size:13px}.toolbar .applied-filter{background:var(--p30)}.toolbar-filters{display:flex;align-items:center;gap:5px}.applied-filters{display:flex;gap:4px;margin-top:10px}.applied-filters .applied-filter{font-size:13px;border-radius:12px;background:var(--p20);padding:3px 10px;display:flex;justify-content:center;gap:4px;line-height:22px}.applied-filters .applied-filter:hover{background-color:var(--p30)}.dropdown{position:relative;overflow:visible}.dropdown-button>div{display:flex;align-items:center;gap:3px}.dropdown-menu{display:flex;flex-direction:column;padding:10px;overflow:visible;position:absolute;border-radius:12px;z-index:22;background:var(--p20);transition:.6s;flex-grow:1;top:35px;min-width:max-content;border:1px solid var(--p30)}.dropdown-menu.orientation-right{right:0}.dropdown-menu.orientation-left{left:0}.dropdown-header,.dropdown-item{display:flex;align-items:center;gap:3px;text-wrap:nowrap}.dropdown-header{padding:10px}.dropdown-item{font-size:14px;padding:3px 10px}.dropdown-item:hover{background:var(--p30);border-radius:12px}.dropdown-item:hover button{background:var(--p30)}.dropdown-item .button-icon{flex-shrink:0}.editor-field .dropdown-menu{background:var(--p30)}.button{border-radius:12px;background:var(--p20);padding:3px 10px;cursor:pointer;border:0px solid var(--p30);font-size:14px;min-height:27px;display:flex;align-items:center;gap:4px;color:var(--text)}.button:hover{background:var(--p30)}.button:active{background:var(--p50)!important;box-shadow:none}.button.active,.button.secondary{background:var(--p30)}.button.secondary:hover{background:var(--p40)}.button.primary{background:var(--p70);color:var(--p10)}.button.primary:hover{background:var(--p90)}.button[disabled]{pointer-events:none;opacity:.7;color:var(--text)}.upload-button{padding:0;border:none}.upload-button label{font-size:14px;line-height:14px;font-weight:400;background:var(--p80)!important;color:var(--p10)}.button-text{border:none;padding:0;background:transparent;cursor:pointer}.spinner-border{width:12px;height:12px;border:2px solid var(--p10);border-bottom-color:var(--p30);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@supports (-webkit-appearance: none) or (-moz-appearance: none){.checkbox-wrapper input[type=checkbox]{--active-inner: var(--p10);--focus: 2px var(--p30);--border-hover: var(--p30);--disabled: #F6F8FF;--disabled-inner: #E1E6F9;-webkit-appearance:none;-moz-appearance:none;height:21px;outline:none;display:inline-block;vertical-align:top;position:relative;margin:0;cursor:pointer;border:1px solid var(--bc, var(--p30));background:var(--b, var(--p10));transition:background .3s,border-color .3s,box-shadow .2s}.checkbox-wrapper input[type=checkbox]:after{content:"";display:block;left:0;top:0;position:absolute;transition:transform var(--d-t, .3s) var(--d-t-e, ease),opacity var(--d-o, .2s)}.checkbox-wrapper input[type=checkbox]:checked{--b: var(--p40);--bc: var(--p40);--d-o: .3s;--d-t: .6s;--d-t-e: cubic-bezier(.2, .85, .32, 1.2)}.checkbox-wrapper input[type=checkbox]:disabled{--b: var(--disabled);cursor:not-allowed;opacity:.9}.checkbox-wrapper input[type=checkbox]:disabled:checked{--b: var(--disabled-inner);--bc: var(--p40)}.checkbox-wrapper input[type=checkbox]:disabled+label{cursor:not-allowed}.checkbox-wrapper input[type=checkbox]:hover:not(:checked):not(:disabled){--bc: var(--border-hover)}.checkbox-wrapper input[type=checkbox]:focus{box-shadow:0 0 0 var(--focus)}.checkbox-wrapper input[type=checkbox]:not(.switch){width:21px}.checkbox-wrapper input[type=checkbox]:not(.switch):after{opacity:var(--o, 0)}.checkbox-wrapper input[type=checkbox]:not(.switch):checked{--o: 1}.checkbox-wrapper input[type=checkbox]+label{display:inline-block;vertical-align:middle;cursor:pointer;margin-left:4px}.checkbox-wrapper input[type=checkbox]:not(.switch){border-radius:7px}.checkbox-wrapper input[type=checkbox]:not(.switch):after{width:5px;height:9px;border:2px solid var(--active-inner);border-top:0;border-left:0;left:7px;top:4px;transform:rotate(var(--r, 20deg))}.checkbox-wrapper input[type=checkbox]:not(.switch):checked{--r: 43deg}}.checkbox-wrapper *{box-sizing:inherit}.checkbox-wrapper *:before,.checkbox-wrapper *:after{box-sizing:inherit}.checkbox-wrapper input[type=checkbox]:indeterminate{--b: var(--p40);--bc: var(--p40);--d-o: .3s;--d-t: .6s;--d-t-e: cubic-bezier(.2, .85, .32, 1.2)}.pagination{margin:20px auto 10px;display:flex;justify-content:center;align-items:center;gap:4px;list-style:none;padding:0}.pagination li a,.pagination li span{font-size:14px;border-radius:12px;padding:4px 18px;background:var(--p20)}.pagination li a:hover,.pagination li span:hover{background:var(--p30)}.pagination li.disabled{pointer-events:none;opacity:.7}.pagination li.active span{background:var(--p30)}.record-edit{position:relative;max-width:900px}.record-edit .invalid-feedback{color:var(--text-error);font-size:15px;line-height:20px;margin-top:10px}.record-header{margin:10px 0 0}.record-header .schema-name{font-size:14px}.record-header .record-title{font-size:18px;display:block}.tools-header{margin:30px 0 0;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px;position:relative;z-index:20;padding:10px;border-radius:12px;background:var(--p20)}.editor-field{background:var(--p20);padding:18px;position:relative;border-radius:12px;margin:6px 0;border-color:transparent}.editor-field .button:not(.primary){background:var(--p30)}.editor-field .button:not(.primary):hover{background:var(--p40)}.editor-field dialog .button:not(.primary){background:var(--p20)}.editor-field dialog .button:not(.primary):hover{background:var(--p30)}.field-header{margin-bottom:4px;position:relative}.field-header .labels{display:flex;justify-content:space-between;align-items:center}.field-header .label-and-help{display:flex;align-items:center;gap:6px}.field-header label{font-size:14px;line-height:14px;margin:0;font-weight:700}.field-header .help-text{font-size:14px;line-height:14px}.system-help-text{font-size:14px;line-height:14px;margin-top:10px}.field-checkbox{display:flex;gap:20px;align-items:center}.field-checkbox .form-check-inline{display:flex;align-items:center;gap:4px}.field-checkbox .form-check-label{font-size:14px;line-height:14px}.record-edit-file-preview{display:flex;gap:20px}.record-edit-file-preview .file-details{width:50%;display:flex;flex-direction:column;gap:5px}.record-edit-file-preview .file-details-item .text-muted{color:var(--grey-dark)}.tabs{padding:0;margin:20px 0;display:flex;gap:4px;flex-wrap:wrap}.tabs .tab{list-style:none}input.switch{-webkit-appearance:none;width:34px;height:18px;border:1px solid var(--p40);position:relative;border-radius:50px;box-sizing:content-box;cursor:pointer;transition:background .15s ease-in-out;background:#fff}input.switch:after{top:2px;left:2px;transition:left .15s ease-in-out;content:" ";width:14px;height:14px;background:var(--p40);box-shadow:inset 0 0 0 1px var(--p40);position:absolute;border-radius:50px}input.switch:checked{background:var(--p50)}input.switch:checked:after{left:calc(100% - 17px);background:var(--p10)}.preview-file,.preview-reference{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--p10);border-radius:12px}.preview-file .image,.preview-reference .image{display:flex}.preview-file .reference-action,.preview-reference .reference-action{display:none}.preview-file:hover,.preview-reference:hover{background:var(--p30)}.preview-file:hover .reference-action,.preview-reference:hover .reference-action{display:block}.file-preview-small{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;border-radius:12px;padding:4px}.preview-reference{background:var(--p10);padding:10px 20px}.sortable-container{display:flex;flex-direction:column;gap:5px}.sortable-ghost{border:2px dashed var(--p60)}.sortable-drag{opacity:0!important}.sortable-ghost{opacity:1!important}body:has(dialog[open]){overflow:hidden}dialog{margin:2vh auto;background-color:var(--p10);padding:34px;border:none;border-radius:12px;overflow:auto;max-height:96vh;box-shadow:none!important}dialog .close{position:absolute;top:10px;right:0}dialog .dialog-body{width:fit-content}dialog::backdrop{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.dialog-header{margin-bottom:20px;display:flex;align-items:center;gap:8px;position:sticky;top:-34px;z-index:999;background-color:var(--p10);padding:10px 0}.autocomplete{position:relative;z-index:1000;overflow:visible}.autocomplete .autocomplete-option{cursor:pointer;font-size:14px;padding:3px 10px}.autocomplete .autocomplete-option:hover{background:var(--p40);border-radius:12px}.autocomplete:focus-within .autocomplete-results{display:flex}.autocomplete-selected-value{font-size:13px;margin-top:10px;border-radius:12px;background:var(--p30);padding:3px 10px;display:inline-flex;justify-content:center;gap:4px;line-height:22px}.autocomplete-selected-value:hover{background:var(--p40)}.autocomplete-results{display:none;flex-direction:column;padding:10px;overflow:visible;position:absolute;border-radius:12px;z-index:20;background:var(--p30);transition:.6s;flex-grow:1;top:45px;width:100%}.reference-tags{position:relative;z-index:20}.reference-tags .reference-tags-option{cursor:pointer;font-size:14px;padding:3px 10px}.reference-tags .reference-tags-option:hover{background:var(--p40);border-radius:12px}.reference-tags:focus-within .reference-tags-results{display:flex}.reference-tags-selected-value{font-size:13px;margin-top:10px;border-radius:12px;background:var(--p30);padding:3px 10px;display:inline-flex;justify-content:center;gap:4px;line-height:22px}.reference-tags-selected-value:hover{background:var(--p40)}.reference-tags-results{display:none;flex-direction:column;padding:10px;overflow:visible;position:absolute;border-radius:12px;z-index:20;background:var(--p30);transition:.6s;flex-grow:1;top:45px;width:100%}.reference-tags-results .start-typing{font-style:italic;font-size:13px}.member-list{display:flex;flex-direction:column;gap:5px}.member-item{background:var(--p30);border-radius:12px;padding:12px;display:flex;justify-content:space-between;align-items:center}.member-item .member-name{display:flex;align-items:center;gap:10px}.revisions{display:flex;flex-direction:column;gap:5px}.revisions .revision{justify-content:space-between;display:flex;gap:20px;align-items:center;background:var(--p20);padding:12px;border-radius:12px}.revisions .revision .version{display:flex;gap:10px}.revisions .revision.active{background:var(--p30)}.selected-revision{margin-top:30px;align-items:center;background:var(--p20);padding:12px;border-radius:12px}.selected-revision .button{background:var(--p30)}.selected-revision .revision-field{display:flex;gap:20px;align-items:center;padding:20px 0;border-bottom:1px solid var(--p30);flex:1}.selected-revision .revision-field .compare-left,.selected-revision .revision-field .compare-right{width:45%;border-radius:12px;padding:20px;background:var(--p30)}.selected-revision .revision-field .compare-center{width:10%;height:100%;display:flex;gap:20px;align-items:center}.reference-field{width:100px}.revision-references{display:flex;gap:20px;align-items:center;padding:20px 0;border-bottom:1px solid var(--p30)}.reference-compare{width:45%;border-radius:12px;padding:20px;background:var(--p30)}.flatpickr-wrapper{display:block!important}.editor-field .flatpickr-calendar{border-radius:12px!important}.editor-field .flatpickr-months .flatpickr-month{background:var(--p30);color:var(--text);font-size:12px}.editor-field .flatpickr-current-month .flatpickr-monthDropdown-months{background:var(--p30)}.editor-field .flatpickr-weekdays,.editor-field .flatpickr-weekdaycontainer .flatpickr-weekday{background:var(--p30);color:var(--text)}.editor-field .flatpickr-days,.editor-field .flatpickr-time{background:var(--p10);color:var(--text)}body{background-color:var(--p10);font-family:var(--main-font),sans-serif;color:var(--text)}body :focus{outline:none;box-shadow:0 0 1px 2px var(--p70)}.btn-spinner .spinner-border{display:none}.btn-spinner.spinner-on .spinner-border{display:inline-block}.cursor-pointer{cursor:pointer}a{color:var(--text);text-decoration:none}.lucent-component{position:relative}svg.svelte-r4pd9j{vertical-align:text-top}.step-success.svelte-igosv7 .step-icon.svelte-igosv7{background:var(--suc10);color:var(--suc100)}.step-fail.svelte-igosv7 .step-icon.svelte-igosv7{background:var(--err10);color:var(--err100)}.step-icon.svelte-igosv7.svelte-igosv7{padding:12px;border-radius:12px}.step.svelte-igosv7.svelte-igosv7{width:100%;display:flex;align-items:start;gap:10px;justify-content:space-between;padding:12px;border-radius:12px}details.svelte-igosv7.svelte-igosv7{width:100%}.instructions.svelte-igosv7.svelte-igosv7{margin-top:20px;padding:12px;border-radius:12px;background:var(--p10);white-space:break-spaces;display:block}.status-removed.svelte-1jo1k1d{opacity:.5}img.svelte-1mb3bsz{border-radius:12px;padding:4px}.color.svelte-78o2k4{width:18px;height:18px;display:inline-block;position:relative;top:3px}a.svelte-nbbgyi{max-width:200px;overflow:hidden;text-overflow:ellipsis;font-size:13px;color:#333}a.svelte-nbbgyi:hover{opacity:.5}div.references.svelte-15ilpfz{max-height:48px;overflow-x:hidden;overflow-y:hidden}div.svelte-1ft053t{max-height:24px;text-overflow:ellipsis;overflow:hidden}.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08);box-shadow:1px 0 #e6e6e6,-1px 0 #e6e6e6,0 1px #e6e6e6,0 -1px #e6e6e6,0 3px 13px #00000014}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-months .flatpickr-month{background:transparent;color:#000000e6;fill:#000000e6;height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:#000000e6;fill:#000000e6}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,.6);top:26%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,.6);top:40%}.numInputWrapper span svg path{fill:#00000080}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:#000000e6}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:#000000e6}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:#00000080;background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:#0000008a;line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 #569ff7}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 #e6e6e6,5px 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:#3939394d;background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:#3939391a}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 #569ff7,5px 0 #569ff7}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 #e6e6e6}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:#3939394d;background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:700;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-box-shadow:0 3px 13px rgba(0,0,0,.08);box-shadow:0 3px 13px #00000014}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1);animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none!important;box-shadow:none!important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 #e6e6e6,5px 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #eceef1}.flatpickr-calendar.hasTime .flatpickr-innerContainer{border-bottom:0}.flatpickr-calendar.hasTime .flatpickr-time{border:1px solid #eceef1}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:"";height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#eceef1}.flatpickr-calendar.arrowTop:after{border-bottom-color:#eceef1}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#eceef1}.flatpickr-calendar.arrowBottom:after{border-top-color:#eceef1}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{border-radius:5px 5px 0 0;background:#eceef1;color:#5a6171;fill:#5a6171;height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:#5a6171;fill:#5a6171}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#bbb}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(72,72,72,.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:#0000001a}.numInputWrapper span:active{background:#0003}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(72,72,72,.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(72,72,72,.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:#5a617180}.numInputWrapper:hover{background:#0000000d}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0px,0px,0px);transform:translateZ(0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:#0000000d}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch�;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:#5a6171}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:#5a6171}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:#5a617180;background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:#eceef1;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:#0000000d}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:#eceef1;outline:none;padding:0}.flatpickr-weekdays{background:#eceef1;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:#eceef1;color:#5a6171;line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px;border-left:1px solid #eceef1;border-right:1px solid #eceef1}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0px,0px,0px);transform:translateZ(0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #eceef1;box-shadow:-1px 0 #eceef1}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#484848;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e2e2e2;border-color:#e2e2e2}.flatpickr-day.today{border-color:#bbb}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#bbb;background:#bbb;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#ff5a5f;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#ff5a5f}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #ff5a5f;box-shadow:-10px 0 #ff5a5f}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e2e2e2,5px 0 0 #e2e2e2;box-shadow:-5px 0 #e2e2e2,5px 0 #e2e2e2}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:#4848484d;background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:#4848481a}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #ff5a5f,5px 0 0 #ff5a5f;box-shadow:-5px 0 #ff5a5f,5px 0 #ff5a5f}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;border-left:1px solid #eceef1}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:#4848484d;background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;background:#fff;border-bottom:1px solid #eceef1}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;background:#fff;border-radius:0 0 5px 5px}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#484848}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#484848}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#484848;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:700}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#484848;font-weight:700;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eaeaea}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}@keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}span.flatpickr-day.selected{font-weight:700}textarea.svelte-1er4ovm{resize:none}.tox{box-shadow:none;box-sizing:content-box;color:#222f3e;cursor:auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:normal;-webkit-tap-highlight-color:transparent;text-decoration:none;text-shadow:none;text-transform:none;vertical-align:initial;white-space:normal}.tox *:not(svg):not(rect){box-sizing:inherit;color:inherit;cursor:inherit;direction:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;line-height:inherit;-webkit-tap-highlight-color:inherit;text-align:inherit;text-decoration:inherit;text-shadow:inherit;text-transform:inherit;vertical-align:inherit;white-space:inherit}.tox *:not(svg):not(rect){background:transparent;border:0;box-shadow:none;float:none;height:auto;margin:0;max-width:none;outline:0;padding:0;position:static;width:auto}.tox:not([dir=rtl]){direction:ltr;text-align:left}.tox[dir=rtl]{direction:rtl;text-align:right}.tox-tinymce{border:2px solid #eeeeee;border-radius:10px;box-shadow:none;box-sizing:border-box;display:flex;flex-direction:column;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;overflow:hidden;position:relative;visibility:inherit!important}.tox.tox-tinymce-inline{border:none;box-shadow:none;overflow:initial}.tox.tox-tinymce-inline .tox-editor-container{overflow:initial}.tox.tox-tinymce-inline .tox-editor-header{background-color:#fff;border:2px solid #eeeeee;border-radius:10px;box-shadow:none;overflow:hidden}.tox-tinymce-aux{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;z-index:1300}.tox-tinymce *:focus,.tox-tinymce-aux *:focus{outline:none}button::-moz-focus-inner{border:0}.tox[dir=rtl] .tox-icon--flip svg{transform:rotateY(180deg)}.tox .accessibility-issue__header{align-items:center;display:flex;margin-bottom:4px}.tox .accessibility-issue__description{align-items:stretch;border-radius:6px;display:flex;justify-content:space-between}.tox .accessibility-issue__description>div{padding-bottom:4px}.tox .accessibility-issue__description>div>div{align-items:center;display:flex;margin-bottom:4px}.tox .accessibility-issue__description>div>div .tox-icon svg{display:block}.tox .accessibility-issue__repair{margin-top:16px}.tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description{background-color:#0065d81a;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--info .tox-form__group h2{color:#006ce7}.tox .tox-dialog__body-content .accessibility-issue--info .tox-icon svg{fill:#006ce7}.tox .tox-dialog__body-content .accessibility-issue--info a.tox-button--naked.tox-button--icon{background-color:#006ce7;color:#fff}.tox .tox-dialog__body-content .accessibility-issue--info a.tox-button--naked.tox-button--icon:hover,.tox .tox-dialog__body-content .accessibility-issue--info a.tox-button--naked.tox-button--icon:focus{background-color:#0060ce}.tox .tox-dialog__body-content .accessibility-issue--info a.tox-button--naked.tox-button--icon:active{background-color:#0054b4}.tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description{background-color:#ffa50014;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--warn .tox-form__group h2{color:#8f5d00}.tox .tox-dialog__body-content .accessibility-issue--warn .tox-icon svg{fill:#8f5d00}.tox .tox-dialog__body-content .accessibility-issue--warn a.tox-button--naked.tox-button--icon{background-color:#ffe89d;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--warn a.tox-button--naked.tox-button--icon:hover,.tox .tox-dialog__body-content .accessibility-issue--warn a.tox-button--naked.tox-button--icon:focus{background-color:#f2d574;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--warn a.tox-button--naked.tox-button--icon:active{background-color:#e8c657;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description{background-color:#cc00001a;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--error .tox-form__group h2{color:#c00}.tox .tox-dialog__body-content .accessibility-issue--error .tox-icon svg{fill:#c00}.tox .tox-dialog__body-content .accessibility-issue--error a.tox-button--naked.tox-button--icon{background-color:#f2bfbf;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--error a.tox-button--naked.tox-button--icon:hover,.tox .tox-dialog__body-content .accessibility-issue--error a.tox-button--naked.tox-button--icon:focus{background-color:#e9a4a4;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--error a.tox-button--naked.tox-button--icon:active{background-color:#ee9494;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description{background-color:#78ab461a;color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description>*:last-child{display:none}.tox .tox-dialog__body-content .accessibility-issue--success .tox-form__group h2{color:#527530}.tox .tox-dialog__body-content .accessibility-issue--success .tox-icon svg{fill:#527530}.tox .tox-dialog__body-content .accessibility-issue__header .tox-form__group h1,.tox .tox-dialog__body-content .tox-form__group .accessibility-issue__description h2{font-size:14px;margin-top:0}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header .tox-button{margin-left:4px}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header>*:nth-last-child(2){margin-left:auto}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description{padding:4px 4px 4px 8px}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header .tox-button{margin-right:4px}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header>*:nth-last-child(2){margin-right:auto}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description{padding:4px 8px 4px 4px}.tox .tox-advtemplate .tox-form__grid{flex:1}.tox .tox-advtemplate .tox-form__grid>div:first-child{display:flex;flex-direction:column;width:30%}.tox .tox-advtemplate .tox-form__grid>div:first-child>div:nth-child(2){flex-basis:0;flex-grow:1;overflow:auto}@media only screen and (max-width: 767px){body:not(.tox-force-desktop) .tox .tox-advtemplate .tox-form__grid>div:first-child{width:100%}}.tox .tox-advtemplate iframe{border-color:#eee;border-radius:10px;border-style:solid;border-width:1px;margin:0 10px}.tox .tox-anchorbar,.tox .tox-bottom-anchorbar,.tox .tox-bar{display:flex;flex:0 0 auto}.tox .tox-button{background-color:#006ce7;background-image:none;background-position:0 0;background-repeat:repeat;border-color:#006ce7;border-radius:6px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:14px;font-style:normal;font-weight:700;letter-spacing:normal;line-height:24px;margin:0;outline:none;padding:4px 16px;position:relative;text-align:center;text-decoration:none;text-transform:none;white-space:nowrap}.tox .tox-button:before{border-radius:6px;bottom:-1px;box-shadow:inset 0 0 0 2px #fff,0 0 0 1px #006ce7,0 0 0 3px #006ce740;content:"";left:-1px;opacity:0;pointer-events:none;position:absolute;right:-1px;top:-1px}.tox .tox-button[disabled]{background-color:#006ce7;background-image:none;border-color:#006ce7;box-shadow:none;color:#ffffff80;cursor:not-allowed}.tox .tox-button:focus:not(:disabled){background-color:#0060ce;background-image:none;border-color:#0060ce;box-shadow:none;color:#fff}.tox .tox-button:focus-visible:not(:disabled):before{opacity:1}.tox .tox-button:hover:not(:disabled){background-color:#0060ce;background-image:none;border-color:#0060ce;box-shadow:none;color:#fff}.tox .tox-button:active:not(:disabled){background-color:#0054b4;background-image:none;border-color:#0054b4;box-shadow:none;color:#fff}.tox .tox-button.tox-button--enabled{background-color:#0054b4;background-image:none;border-color:#0054b4;box-shadow:none;color:#fff}.tox .tox-button.tox-button--enabled[disabled]{background-color:#0054b4;background-image:none;border-color:#0054b4;box-shadow:none;color:#ffffff80;cursor:not-allowed}.tox .tox-button.tox-button--enabled:focus:not(:disabled){background-color:#00489b;background-image:none;border-color:#00489b;box-shadow:none;color:#fff}.tox .tox-button.tox-button--enabled:hover:not(:disabled){background-color:#00489b;background-image:none;border-color:#00489b;box-shadow:none;color:#fff}.tox .tox-button.tox-button--enabled:active:not(:disabled){background-color:#003c81;background-image:none;border-color:#003c81;box-shadow:none;color:#fff}.tox .tox-button--icon-and-text,.tox .tox-button.tox-button--icon-and-text,.tox .tox-button.tox-button--secondary.tox-button--icon-and-text{display:flex;padding:5px 4px}.tox .tox-button--icon-and-text .tox-icon svg,.tox .tox-button.tox-button--icon-and-text .tox-icon svg,.tox .tox-button.tox-button--secondary.tox-button--icon-and-text .tox-icon svg{display:block;fill:currentColor}.tox .tox-button--secondary{background-color:#f0f0f0;background-image:none;background-position:0 0;background-repeat:repeat;border-color:#f0f0f0;border-radius:6px;border-style:solid;border-width:1px;box-shadow:none;color:#222f3e;font-size:14px;font-style:normal;font-weight:700;letter-spacing:normal;outline:none;padding:4px 16px;text-decoration:none;text-transform:none}.tox .tox-button--secondary[disabled]{background-color:#f0f0f0;background-image:none;border-color:#f0f0f0;box-shadow:none;color:#222f3e80}.tox .tox-button--secondary:focus:not(:disabled){background-color:#e3e3e3;background-image:none;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--secondary:hover:not(:disabled){background-color:#e3e3e3;background-image:none;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--secondary:active:not(:disabled){background-color:#d6d6d6;background-image:none;border-color:#d6d6d6;box-shadow:none;color:#222f3e}.tox .tox-button--secondary.tox-button--enabled{background-color:#a8c8ed;background-image:none;border-color:#a8c8ed;box-shadow:none;color:#222f3e}.tox .tox-button--secondary.tox-button--enabled[disabled]{background-color:#a8c8ed;background-image:none;border-color:#a8c8ed;box-shadow:none;color:#222f3e80}.tox .tox-button--secondary.tox-button--enabled:focus:not(:disabled){background-color:#93bbe9;background-image:none;border-color:#93bbe9;box-shadow:none;color:#222f3e}.tox .tox-button--secondary.tox-button--enabled:hover:not(:disabled){background-color:#93bbe9;background-image:none;border-color:#93bbe9;box-shadow:none;color:#222f3e}.tox .tox-button--secondary.tox-button--enabled:active:not(:disabled){background-color:#7daee4;background-image:none;border-color:#7daee4;box-shadow:none;color:#222f3e}.tox .tox-button--icon,.tox .tox-button.tox-button--icon,.tox .tox-button.tox-button--secondary.tox-button--icon{padding:4px}.tox .tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg{display:block;fill:currentColor}.tox .tox-button-link{background:0;border:none;box-sizing:border-box;cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;white-space:nowrap}.tox .tox-button-link--sm{font-size:14px}.tox .tox-button--naked{background-color:transparent;border-color:transparent;box-shadow:unset;color:#222f3e}.tox .tox-button--naked[disabled]{background-color:#222f3e1f;border-color:transparent;box-shadow:unset;color:#222f3e80}.tox .tox-button--naked:hover:not(:disabled){background-color:#222f3e1f;border-color:transparent;box-shadow:unset;color:#222f3e}.tox .tox-button--naked:focus:not(:disabled){background-color:#222f3e1f;border-color:transparent;box-shadow:unset;color:#222f3e}.tox .tox-button--naked:active:not(:disabled){background-color:#222f3e2e;border-color:transparent;box-shadow:unset;color:#222f3e}.tox .tox-button--naked .tox-icon svg{fill:currentColor}.tox .tox-button--naked.tox-button--icon:hover:not(:disabled){color:#222f3e}.tox .tox-checkbox{align-items:center;border-radius:6px;cursor:pointer;display:flex;height:36px;min-width:36px}.tox .tox-checkbox__input{height:1px;overflow:hidden;position:absolute;top:auto;width:1px}.tox .tox-checkbox__icons{align-items:center;border-radius:6px;box-shadow:0 0 0 2px transparent;box-sizing:content-box;display:flex;height:24px;justify-content:center;padding:3px;width:24px}.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:block;fill:#222f3e4d}.tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:none;fill:#006ce7}.tox .tox-checkbox__icons .tox-checkbox-icon__checked svg{display:none;fill:#006ce7}.tox .tox-checkbox--disabled{color:#222f3e80;cursor:not-allowed}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__checked svg{fill:#222f3e80}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{fill:#222f3e80}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{fill:#222f3e80}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__checked svg{display:block}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:block}.tox input.tox-checkbox__input:focus+.tox-checkbox__icons{border-radius:6px;box-shadow:inset 0 0 0 1px #006ce7;padding:3px}.tox:not([dir=rtl]) .tox-checkbox__label{margin-left:4px}.tox:not([dir=rtl]) .tox-checkbox__input{left:-10000px}.tox:not([dir=rtl]) .tox-bar .tox-checkbox{margin-left:4px}.tox[dir=rtl] .tox-checkbox__label{margin-right:4px}.tox[dir=rtl] .tox-checkbox__input{right:-10000px}.tox[dir=rtl] .tox-bar .tox-checkbox{margin-right:4px}.tox .tox-collection--toolbar .tox-collection__group{display:flex;padding:0}.tox .tox-collection--grid .tox-collection__group{display:flex;flex-wrap:wrap;max-height:208px;overflow-x:hidden;overflow-y:auto;padding:0}.tox .tox-collection--list .tox-collection__group{border-bottom-width:0;border-color:#e3e3e3;border-left-width:0;border-right-width:0;border-style:solid;border-top-width:1px;padding:4px 0}.tox .tox-collection--list .tox-collection__group:first-child{border-top-width:0}.tox .tox-collection__group-heading{background-color:#fcfcfc;color:#222f3eb3;cursor:default;font-size:12px;font-style:normal;font-weight:400;margin-bottom:4px;margin-top:-4px;padding:4px 8px;text-transform:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.tox .tox-collection__item{align-items:center;border-radius:3px;color:#222f3e;display:flex;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.tox .tox-collection--list .tox-collection__item{padding:4px 8px}.tox .tox-collection--toolbar .tox-collection__item,.tox .tox-collection--grid .tox-collection__item{border-radius:3px;padding:4px}.tox .tox-collection--list .tox-collection__item--enabled{background-color:#fff;color:#222f3e}.tox .tox-collection--list .tox-collection__item--active{background-color:#cce2fa}.tox .tox-collection--toolbar .tox-collection__item--enabled{background-color:#a6ccf7;color:#222f3e}.tox .tox-collection--toolbar .tox-collection__item--active{background-color:#cce2fa}.tox .tox-collection--grid .tox-collection__item--enabled{background-color:#a6ccf7;color:#222f3e}.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled){background-color:#cce2fa;color:#222f3e}.tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#222f3e}.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#222f3e}.tox .tox-collection__item-icon,.tox .tox-collection__item-checkmark{align-items:center;display:flex;height:24px;justify-content:center;width:24px}.tox .tox-collection__item-icon svg,.tox .tox-collection__item-checkmark svg{fill:currentColor}.tox .tox-collection--toolbar-lg .tox-collection__item-icon{height:48px;width:48px}.tox .tox-collection__item-label{color:currentColor;display:inline-block;flex:1;font-size:14px;font-style:normal;font-weight:400;line-height:24px;max-width:100%;text-transform:none;word-break:break-all}.tox .tox-collection__item-accessory{color:#222f3eb3;display:inline-block;font-size:14px;height:24px;line-height:24px;text-transform:none}.tox .tox-collection__item-caret{align-items:center;display:flex;min-height:24px}.tox .tox-collection__item-caret:after{content:"";font-size:0;min-height:inherit}.tox .tox-collection__item-caret svg{fill:#222f3e}.tox .tox-collection__item--state-disabled{background-color:transparent;color:#222f3e80;cursor:not-allowed}.tox .tox-collection__item--state-disabled .tox-collection__item-caret svg{fill:#222f3e80}.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg{display:none}.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-accessory+.tox-collection__item-checkmark{display:none}.tox .tox-collection--horizontal{background-color:#fff;border:1px solid #e3e3e3;border-radius:6px;box-shadow:0 0 2px #222f3e33,0 4px 8px #222f3e26;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:nowrap;margin-bottom:0;overflow-x:auto;padding:0}.tox .tox-collection--horizontal .tox-collection__group{align-items:center;display:flex;flex-wrap:nowrap;margin:0;padding:0 4px}.tox .tox-collection--horizontal .tox-collection__item{height:28px;margin:6px 1px 5px 0;padding:0 4px}.tox .tox-collection--horizontal .tox-collection__item-label{white-space:nowrap}.tox .tox-collection--horizontal .tox-collection__item-caret{margin-left:4px}.tox .tox-collection__item-container{display:flex}.tox .tox-collection__item-container--row{align-items:center;flex:1 1 auto;flex-direction:row}.tox .tox-collection__item-container--row.tox-collection__item-container--align-left{margin-right:auto}.tox .tox-collection__item-container--row.tox-collection__item-container--align-right{justify-content:flex-end;margin-left:auto}.tox .tox-collection__item-container--row.tox-collection__item-container--valign-top{align-items:flex-start;margin-bottom:auto}.tox .tox-collection__item-container--row.tox-collection__item-container--valign-middle{align-items:center}.tox .tox-collection__item-container--row.tox-collection__item-container--valign-bottom{align-items:flex-end;margin-top:auto}.tox .tox-collection__item-container--column{align-self:center;flex:1 1 auto;flex-direction:column}.tox .tox-collection__item-container--column.tox-collection__item-container--align-left{align-items:flex-start}.tox .tox-collection__item-container--column.tox-collection__item-container--align-right{align-items:flex-end}.tox .tox-collection__item-container--column.tox-collection__item-container--valign-top{align-self:flex-start}.tox .tox-collection__item-container--column.tox-collection__item-container--valign-middle{align-self:center}.tox .tox-collection__item-container--column.tox-collection__item-container--valign-bottom{align-self:flex-end}.tox:not([dir=rtl]) .tox-collection--horizontal .tox-collection__group:not(:last-of-type){border-right:1px solid transparent}.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item>*:not(:first-child){margin-left:8px}.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item>.tox-collection__item-label:first-child{margin-left:4px}.tox:not([dir=rtl]) .tox-collection__item-accessory{margin-left:16px;text-align:right}.tox:not([dir=rtl]) .tox-collection .tox-collection__item-caret{margin-left:16px}.tox[dir=rtl] .tox-collection--horizontal .tox-collection__group:not(:last-of-type){border-left:1px solid transparent}.tox[dir=rtl] .tox-collection--list .tox-collection__item>*:not(:first-child){margin-right:8px}.tox[dir=rtl] .tox-collection--list .tox-collection__item>.tox-collection__item-label:first-child{margin-right:4px}.tox[dir=rtl] .tox-collection__item-accessory{margin-right:16px;text-align:left}.tox[dir=rtl] .tox-collection .tox-collection__item-caret{margin-right:16px;transform:rotateY(180deg)}.tox[dir=rtl] .tox-collection--horizontal .tox-collection__item-caret{margin-right:4px}.tox .tox-color-picker-container{display:flex;flex-direction:row;height:225px;margin:0}.tox .tox-sv-palette{box-sizing:border-box;display:flex;height:100%}.tox .tox-sv-palette-spectrum{height:100%}.tox .tox-sv-palette,.tox .tox-sv-palette-spectrum{width:225px}.tox .tox-sv-palette-thumb{background:none;border:1px solid black;border-radius:50%;box-sizing:content-box;height:12px;position:absolute;width:12px}.tox .tox-sv-palette-inner-thumb{border:1px solid white;border-radius:50%;height:10px;position:absolute;width:10px}.tox .tox-hue-slider{box-sizing:border-box;height:100%;width:25px}.tox .tox-hue-slider-spectrum{background:linear-gradient(to bottom,red,#ff0080,#f0f,#8000ff,#00f,#0080ff,#0ff,#00ff80,#0f0,#80ff00,#ff0,#ff8000,red);height:100%;width:100%}.tox .tox-hue-slider,.tox .tox-hue-slider-spectrum{width:20px}.tox .tox-hue-slider-spectrum:focus,.tox .tox-sv-palette-spectrum:focus{outline:#08f solid}.tox .tox-hue-slider-thumb{background:#fff;border:1px solid black;box-sizing:content-box;height:4px;width:100%}.tox .tox-rgb-form{display:flex;flex-direction:column;justify-content:space-between}.tox .tox-rgb-form div{align-items:center;display:flex;justify-content:space-between;margin-bottom:5px;width:inherit}.tox .tox-rgb-form input{width:6em}.tox .tox-rgb-form input.tox-invalid{border:1px solid red!important}.tox .tox-rgb-form .tox-rgba-preview{border:1px solid black;flex-grow:2;margin-bottom:0}.tox:not([dir=rtl]) .tox-sv-palette{margin-right:15px}.tox:not([dir=rtl]) .tox-hue-slider{margin-right:15px}.tox:not([dir=rtl]) .tox-hue-slider-thumb{margin-left:-1px}.tox:not([dir=rtl]) .tox-rgb-form label{margin-right:.5em}.tox[dir=rtl] .tox-sv-palette,.tox[dir=rtl] .tox-hue-slider{margin-left:15px}.tox[dir=rtl] .tox-hue-slider-thumb{margin-right:-1px}.tox[dir=rtl] .tox-rgb-form label{margin-left:.5em}.tox .tox-toolbar .tox-swatches,.tox .tox-toolbar__primary .tox-swatches,.tox .tox-toolbar__overflow .tox-swatches{margin:5px 0 6px 11px}.tox .tox-collection--list .tox-collection__group .tox-swatches-menu{border:0;margin:-4px}.tox .tox-swatches__row{display:flex}.tox .tox-swatch{height:30px;transition:transform .15s,box-shadow .15s;width:30px}.tox .tox-swatch:hover,.tox .tox-swatch:focus{box-shadow:0 0 0 1px #7f7f7f4d inset;transform:scale(.8)}.tox .tox-swatch--remove{align-items:center;display:flex;justify-content:center}.tox .tox-swatch--remove svg path{stroke:#e74c3c}.tox .tox-swatches__picker-btn{align-items:center;background-color:transparent;border:0;cursor:pointer;display:flex;height:30px;justify-content:center;outline:none;padding:0;width:30px}.tox .tox-swatches__picker-btn svg{fill:#222f3e;height:24px;width:24px}.tox .tox-swatches__picker-btn:hover{background:#cce2fa}.tox div.tox-swatch:not(.tox-swatch--remove) svg{display:none;fill:#222f3e;height:24px;margin:3px;width:24px}.tox div.tox-swatch:not(.tox-swatch--remove) svg path{fill:#fff;paint-order:stroke;stroke:#222f3e;stroke-width:2px}.tox div.tox-swatch:not(.tox-swatch--remove).tox-collection__item--enabled svg{display:block}.tox:not([dir=rtl]) .tox-swatches__picker-btn{margin-left:auto}.tox[dir=rtl] .tox-swatches__picker-btn{margin-right:auto}.tox .tox-comment-thread{background:#fff;position:relative}.tox .tox-comment-thread>*:not(:first-child){margin-top:8px}.tox .tox-comment{background:#fff;border:1px solid #eeeeee;border-radius:6px;box-shadow:0 4px 8px #222f3e1a;padding:8px 8px 16px;position:relative}.tox .tox-comment__header{align-items:center;color:#222f3e;display:flex;justify-content:space-between}.tox .tox-comment__date{color:#222f3e;font-size:12px;line-height:18px}.tox .tox-comment__body{color:#222f3e;font-size:14px;font-style:normal;font-weight:400;line-height:1.3;margin-top:8px;position:relative;text-transform:initial}.tox .tox-comment__body textarea{resize:none;white-space:normal;width:100%}.tox .tox-comment__expander{padding-top:8px}.tox .tox-comment__expander p{color:#222f3eb3;font-size:14px;font-style:normal}.tox .tox-comment__body p{margin:0}.tox .tox-comment__buttonspacing{padding-top:16px;text-align:center}.tox .tox-comment-thread__overlay:after{background:#fff;bottom:0;content:"";display:flex;left:0;opacity:.9;position:absolute;right:0;top:0;z-index:5}.tox .tox-comment__reply{display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end;margin-top:8px}.tox .tox-comment__reply>*:first-child{margin-bottom:8px;width:100%}.tox .tox-comment__edit{display:flex;flex-wrap:wrap;justify-content:flex-end;margin-top:16px}.tox .tox-comment__gradient:after{background:linear-gradient(#fff0,#fff);bottom:0;content:"";display:block;height:5em;margin-top:-40px;position:absolute;width:100%}.tox .tox-comment__overlay{background:#fff;bottom:0;display:flex;flex-direction:column;flex-grow:1;left:0;opacity:.9;position:absolute;right:0;text-align:center;top:0;z-index:5}.tox .tox-comment__loading-text{align-items:center;color:#222f3e;display:flex;flex-direction:column;position:relative}.tox .tox-comment__loading-text>div{padding-bottom:16px}.tox .tox-comment__overlaytext{bottom:0;flex-direction:column;font-size:14px;left:0;padding:1em;position:absolute;right:0;top:0;z-index:10}.tox .tox-comment__overlaytext p{background-color:#fff;box-shadow:0 0 8px 8px #fff;color:#222f3e;text-align:center}.tox .tox-comment__overlaytext div:nth-of-type(2){font-size:.8em}.tox .tox-comment__busy-spinner{align-items:center;background-color:#fff;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:20}.tox .tox-comment__scroll{display:flex;flex-direction:column;flex-shrink:1;overflow:auto}.tox .tox-conversations{margin:8px}.tox:not([dir=rtl]) .tox-comment__edit{margin-left:8px}.tox:not([dir=rtl]) .tox-comment__buttonspacing>*:last-child,.tox:not([dir=rtl]) .tox-comment__edit>*:last-child,.tox:not([dir=rtl]) .tox-comment__reply>*:last-child{margin-left:8px}.tox[dir=rtl] .tox-comment__edit{margin-right:8px}.tox[dir=rtl] .tox-comment__buttonspacing>*:last-child,.tox[dir=rtl] .tox-comment__edit>*:last-child,.tox[dir=rtl] .tox-comment__reply>*:last-child{margin-right:8px}.tox .tox-user{align-items:center;display:flex}.tox .tox-user__avatar svg{fill:#222f3eb3}.tox .tox-user__avatar img{border-radius:50%;height:36px;object-fit:cover;vertical-align:middle;width:36px}.tox .tox-user__name{color:#222f3e;font-size:14px;font-style:normal;font-weight:700;line-height:18px;text-transform:none}.tox:not([dir=rtl]) .tox-user__avatar svg,.tox:not([dir=rtl]) .tox-user__avatar img{margin-right:8px}.tox:not([dir=rtl]) .tox-user__avatar+.tox-user__name{margin-left:8px}.tox[dir=rtl] .tox-user__avatar svg,.tox[dir=rtl] .tox-user__avatar img{margin-left:8px}.tox[dir=rtl] .tox-user__avatar+.tox-user__name{margin-right:8px}.tox .tox-dialog-wrap{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:1100}.tox .tox-dialog-wrap__backdrop{background-color:#ffffffbf;bottom:0;left:0;position:absolute;right:0;top:0;z-index:1}.tox .tox-dialog-wrap__backdrop--opaque{background-color:#fff}.tox .tox-dialog{background-color:#fff;border-color:#eee;border-radius:10px;border-style:solid;border-width:0px;box-shadow:0 16px 16px -10px #222f3e26,0 0 40px 1px #222f3e26;display:flex;flex-direction:column;max-height:100%;max-width:480px;overflow:hidden;position:relative;width:95vw;z-index:2}@media only screen and (max-width: 767px){body:not(.tox-force-desktop) .tox .tox-dialog{align-self:flex-start;margin:8px auto;max-height:calc(100vh - 16px);width:calc(100vw - 16px)}}.tox .tox-dialog-inline{z-index:1100}.tox .tox-dialog__header{align-items:center;background-color:#fff;border-bottom:none;color:#222f3e;display:flex;font-size:16px;justify-content:space-between;padding:8px 16px 0;position:relative}.tox .tox-dialog__header .tox-button{z-index:1}.tox .tox-dialog__draghandle{cursor:grab;height:100%;left:0;position:absolute;top:0;width:100%}.tox .tox-dialog__draghandle:active{cursor:grabbing}.tox .tox-dialog__dismiss{margin-left:auto}.tox .tox-dialog__title{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:20px;font-style:normal;font-weight:400;line-height:1.3;margin:0;text-transform:none}.tox .tox-dialog__body{color:#222f3e;display:flex;flex:1;font-size:16px;font-style:normal;font-weight:400;line-height:1.3;min-width:0;text-align:left;text-transform:none}@media only screen and (max-width: 767px){body:not(.tox-force-desktop) .tox .tox-dialog__body{flex-direction:column}}.tox .tox-dialog__body-nav{align-items:flex-start;display:flex;flex-direction:column;flex-shrink:0;padding:16px}@media only screen and (min-width: 768px){.tox .tox-dialog__body-nav{max-width:11em}}@media only screen and (max-width: 767px){body:not(.tox-force-desktop) .tox .tox-dialog__body-nav{flex-direction:row;-webkit-overflow-scrolling:touch;overflow-x:auto;padding-bottom:0}}.tox .tox-dialog__body-nav-item{border-bottom:2px solid transparent;color:#222f3eb3;display:inline-block;flex-shrink:0;font-size:14px;line-height:1.3;margin-bottom:8px;max-width:13em;text-decoration:none}.tox .tox-dialog__body-nav-item:focus{background-color:#006ce71a}.tox .tox-dialog__body-nav-item--active{border-bottom:2px solid #006ce7;color:#006ce7}.tox .tox-dialog__body-content{box-sizing:border-box;display:flex;flex:1;flex-direction:column;max-height:min(650px,calc(100vh - 110px));overflow:auto;-webkit-overflow-scrolling:touch;padding:16px}.tox .tox-dialog__body-content>*{margin-bottom:0;margin-top:16px}.tox .tox-dialog__body-content>*:first-child{margin-top:0}.tox .tox-dialog__body-content>*:last-child{margin-bottom:0}.tox .tox-dialog__body-content>*:only-child{margin-bottom:0;margin-top:0}.tox .tox-dialog__body-content a{color:#006ce7;cursor:pointer;text-decoration:underline}.tox .tox-dialog__body-content a:hover,.tox .tox-dialog__body-content a:focus{color:#003c81;text-decoration:underline}.tox .tox-dialog__body-content a:focus-visible{border-radius:1px;outline:2px solid #006ce7;outline-offset:2px}.tox .tox-dialog__body-content a:active{color:#00244e;text-decoration:underline}.tox .tox-dialog__body-content svg{fill:#222f3e}.tox .tox-dialog__body-content strong{font-weight:700}.tox .tox-dialog__body-content ul{list-style-type:disc}.tox .tox-dialog__body-content ul,.tox .tox-dialog__body-content ol,.tox .tox-dialog__body-content dd{padding-inline-start:2.5rem}.tox .tox-dialog__body-content ul,.tox .tox-dialog__body-content ol,.tox .tox-dialog__body-content dl{margin-bottom:16px}.tox .tox-dialog__body-content ul,.tox .tox-dialog__body-content ol,.tox .tox-dialog__body-content dl,.tox .tox-dialog__body-content dd,.tox .tox-dialog__body-content dt{display:block;margin-inline-end:0;margin-inline-start:0}.tox .tox-dialog__body-content .tox-form__group h1{color:#222f3e;font-size:20px;font-style:normal;font-weight:700;letter-spacing:normal;margin-bottom:16px;margin-top:2rem;text-transform:none}.tox .tox-dialog__body-content .tox-form__group h2{color:#222f3e;font-size:16px;font-style:normal;font-weight:700;letter-spacing:normal;margin-bottom:16px;margin-top:2rem;text-transform:none}.tox .tox-dialog__body-content .tox-form__group p{margin-bottom:16px}.tox .tox-dialog__body-content .tox-form__group h1:first-child,.tox .tox-dialog__body-content .tox-form__group h2:first-child,.tox .tox-dialog__body-content .tox-form__group p:first-child{margin-top:0}.tox .tox-dialog__body-content .tox-form__group h1:last-child,.tox .tox-dialog__body-content .tox-form__group h2:last-child,.tox .tox-dialog__body-content .tox-form__group p:last-child{margin-bottom:0}.tox .tox-dialog__body-content .tox-form__group h1:only-child,.tox .tox-dialog__body-content .tox-form__group h2:only-child,.tox .tox-dialog__body-content .tox-form__group p:only-child{margin-bottom:0;margin-top:0}.tox .tox-dialog__body-content .tox-form__group .tox-label.tox-label--center{text-align:center}.tox .tox-dialog__body-content .tox-form__group .tox-label.tox-label--end{text-align:end}.tox .tox-dialog--width-lg{height:650px;max-width:1200px}.tox .tox-dialog--fullscreen{height:100%;max-width:100%}.tox .tox-dialog--fullscreen .tox-dialog__body-content{max-height:100%}.tox .tox-dialog--width-md{max-width:800px}.tox .tox-dialog--width-md .tox-dialog__body-content{overflow:auto}.tox .tox-dialog__body-content--centered{text-align:center}.tox .tox-dialog__footer{align-items:center;background-color:#fff;border-top:none;display:flex;justify-content:space-between;padding:8px 16px}.tox .tox-dialog__footer-start,.tox .tox-dialog__footer-end{display:flex}.tox .tox-dialog__busy-spinner{align-items:center;background-color:#ffffffbf;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:3}.tox .tox-dialog__table{border-collapse:collapse;width:100%}.tox .tox-dialog__table thead th{font-weight:700;padding-bottom:8px}.tox .tox-dialog__table thead th:first-child{padding-right:8px}.tox .tox-dialog__table tbody tr{border-bottom:1px solid #626262}.tox .tox-dialog__table tbody tr:last-child{border-bottom:none}.tox .tox-dialog__table td{padding-bottom:8px;padding-top:8px}.tox .tox-dialog__table td:first-child{padding-right:8px}.tox .tox-dialog__iframe{min-height:200px}.tox .tox-dialog__iframe.tox-dialog__iframe--opaque{background:#fff}.tox .tox-navobj-bordered{position:relative}.tox .tox-navobj-bordered:before{border:1px solid #eeeeee;border-radius:6px;content:"";top:0;right:0;bottom:0;left:0;opacity:1;pointer-events:none;position:absolute;z-index:1}.tox .tox-navobj-bordered-focus.tox-navobj-bordered:before{border-color:#006ce7;box-shadow:0 0 0 2px #006ce740;outline:none}.tox .tox-dialog__popups{position:absolute;width:100%;z-index:1100}.tox .tox-dialog__body-iframe{display:flex;flex:1;flex-direction:column}.tox .tox-dialog__body-iframe .tox-navobj{display:flex;flex:1}.tox .tox-dialog__body-iframe .tox-navobj :nth-child(2){flex:1;height:100%}.tox .tox-dialog-dock-fadeout{opacity:0;visibility:hidden}.tox .tox-dialog-dock-fadein{opacity:1;visibility:visible}.tox .tox-dialog-dock-transition{transition:visibility 0s linear .3s,opacity .3s ease}.tox .tox-dialog-dock-transition.tox-dialog-dock-fadein{transition-delay:0s}@media only screen and (max-width: 767px){body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav{margin-right:0}}@media only screen and (max-width: 767px){body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child){margin-left:8px}}.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start>*,.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end>*{margin-left:8px}.tox[dir=rtl] .tox-dialog__body{text-align:right}@media only screen and (max-width: 767px){body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav{margin-left:0}}@media only screen and (max-width: 767px){body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child){margin-right:8px}}.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start>*,.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end>*{margin-right:8px}body.tox-dialog__disable-scroll{overflow:hidden}.tox .tox-dropzone-container{display:flex;flex:1}.tox .tox-dropzone{align-items:center;background:#fff;border:2px dashed #eeeeee;box-sizing:border-box;display:flex;flex-direction:column;flex-grow:1;justify-content:center;min-height:100px;padding:10px}.tox .tox-dropzone p{color:#222f3eb3;margin:0 0 16px}.tox .tox-edit-area{display:flex;flex:1;overflow:hidden;position:relative}.tox .tox-edit-area:before{border:2px solid #2D6ADF;border-radius:4px;content:"";top:0;right:0;bottom:0;left:0;opacity:0;pointer-events:none;position:absolute;transition:opacity .15s;z-index:1}.tox .tox-edit-area__iframe{background-color:#fff;border:0;box-sizing:border-box;flex:1;height:100%;position:absolute;width:100%}.tox.tox-edit-focus .tox-edit-area:before{opacity:1}.tox.tox-inline-edit-area{border:1px dotted #eeeeee}.tox .tox-editor-container{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.tox .tox-editor-header{display:grid;grid-template-columns:1fr min-content;z-index:2}.tox:not(.tox-tinymce-inline) .tox-editor-header{background-color:#fff;border-bottom:none;box-shadow:0 2px 2px -2px #222f3e1a,0 8px 8px -4px #222f3e12;padding:4px 0}.tox:not(.tox-tinymce-inline) .tox-editor-header:not(.tox-editor-dock-transition){transition:box-shadow .5s}.tox:not(.tox-tinymce-inline).tox-tinymce--toolbar-bottom .tox-editor-header{border-top:1px solid #e3e3e3;box-shadow:none}.tox:not(.tox-tinymce-inline).tox-tinymce--toolbar-sticky-on .tox-editor-header{background-color:#fff;box-shadow:0 2px 2px -2px #222f3e33,0 8px 8px -4px #222f3e26;padding:4px 0}.tox:not(.tox-tinymce-inline).tox-tinymce--toolbar-sticky-on.tox-tinymce--toolbar-bottom .tox-editor-header{box-shadow:0 2px 2px -2px #222f3e33,0 8px 8px -4px #222f3e26}.tox.tox:not(.tox-tinymce-inline) .tox-editor-header.tox-editor-header--empty{background:none;border:none;box-shadow:none;padding:0}.tox-editor-dock-fadeout{opacity:0;visibility:hidden}.tox-editor-dock-fadein{opacity:1;visibility:visible}.tox-editor-dock-transition{transition:visibility 0s linear .25s,opacity .25s ease}.tox-editor-dock-transition.tox-editor-dock-fadein{transition-delay:0s}.tox .tox-control-wrap{flex:1;position:relative}.tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid,.tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown,.tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid{display:none}.tox .tox-control-wrap svg{display:block}.tox .tox-control-wrap__status-icon-wrap{position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-control-wrap__status-icon-invalid svg{fill:#c00}.tox .tox-control-wrap__status-icon-unknown svg{fill:orange}.tox .tox-control-wrap__status-icon-valid svg{fill:green}.tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield{padding-right:32px}.tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap{right:4px}.tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield{padding-left:32px}.tox[dir=rtl] .tox-control-wrap__status-icon-wrap{left:4px}.tox .tox-autocompleter{max-width:25em}.tox .tox-autocompleter .tox-menu{box-sizing:border-box;max-width:25em}.tox .tox-autocompleter .tox-autocompleter-highlight{font-weight:700}.tox .tox-color-input{display:flex;position:relative;z-index:1}.tox .tox-color-input .tox-textfield{z-index:-1}.tox .tox-color-input span{border-color:#222f3e33;border-radius:6px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;height:24px;position:absolute;top:6px;width:24px}.tox .tox-color-input span:hover:not([aria-disabled=true]),.tox .tox-color-input span:focus:not([aria-disabled=true]){border-color:#006ce7;cursor:pointer}.tox .tox-color-input span:before{background-image:linear-gradient(45deg,rgba(0,0,0,.25) 25%,transparent 25%),linear-gradient(-45deg,rgba(0,0,0,.25) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.25) 75%),linear-gradient(-45deg,transparent 75%,rgba(0,0,0,.25) 75%);background-position:0 0,0 6px,6px -6px,-6px 0;background-size:12px 12px;border:1px solid #fff;border-radius:6px;box-sizing:border-box;content:"";height:24px;left:-1px;position:absolute;top:-1px;width:24px;z-index:-1}.tox .tox-color-input span[aria-disabled=true]{cursor:not-allowed}.tox:not([dir=rtl]) .tox-color-input .tox-textfield{padding-left:36px}.tox:not([dir=rtl]) .tox-color-input span{left:6px}.tox[dir=rtl] .tox-color-input .tox-textfield{padding-right:36px}.tox[dir=rtl] .tox-color-input span{right:6px}.tox .tox-label,.tox .tox-toolbar-label{color:#222f3eb3;display:block;font-size:14px;font-style:normal;font-weight:400;line-height:1.3;padding:0 8px 0 0;text-transform:none;white-space:nowrap}.tox .tox-toolbar-label{padding:0 8px}.tox[dir=rtl] .tox-label{padding:0 0 0 8px}.tox .tox-form{display:flex;flex:1;flex-direction:column}.tox .tox-form__group{box-sizing:border-box;margin-bottom:4px}.tox .tox-form-group--maximize{flex:1}.tox .tox-form__group--error{color:#c00}.tox .tox-form__group--collection{display:flex}.tox .tox-form__grid{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}.tox .tox-form__grid--2col>.tox-form__group{width:calc(50% - 4px)}.tox .tox-form__grid--3col>.tox-form__group{width:calc(100% / 3 - (8px / 2))}.tox .tox-form__grid--4col>.tox-form__group{width:calc(25% - 4px)}.tox .tox-form__controls-h-stack,.tox .tox-form__group--inline{align-items:center;display:flex}.tox .tox-form__group--stretched{display:flex;flex:1;flex-direction:column}.tox .tox-form__group--stretched .tox-textarea{flex:1}.tox .tox-form__group--stretched .tox-navobj{display:flex;flex:1}.tox .tox-form__group--stretched .tox-navobj :nth-child(2){flex:1;height:100%}.tox:not([dir=rtl]) .tox-form__controls-h-stack>*:not(:first-child){margin-left:4px}.tox[dir=rtl] .tox-form__controls-h-stack>*:not(:first-child){margin-right:4px}.tox .tox-lock.tox-locked .tox-lock-icon__unlock,.tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock{display:none}.tox .tox-textfield,.tox .tox-toolbar-textfield,.tox .tox-listboxfield .tox-listbox--select,.tox .tox-textarea,.tox .tox-textarea-wrap .tox-textarea:focus{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#eee;border-radius:6px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#222f3e;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:24px;margin:0;min-height:34px;outline:none;padding:5px 5.5px;resize:none;width:100%}.tox .tox-textfield[disabled],.tox .tox-textarea[disabled]{background-color:#f2f2f2;color:#222f3ed9;cursor:not-allowed}.tox .tox-textfield:focus,.tox .tox-listboxfield .tox-listbox--select:focus,.tox .tox-textarea-wrap:focus-within,.tox .tox-textarea:focus,.tox .tox-custom-editor:focus-within{background-color:#fff;border-color:#006ce7;box-shadow:0 0 0 2px #006ce740;outline:none}.tox .tox-toolbar-textfield{border-width:0;margin-bottom:3px;margin-top:2px;max-width:250px}.tox .tox-naked-btn{background-color:transparent;border:0;border-color:transparent;box-shadow:unset;color:#006ce7;cursor:pointer;display:block;margin:0;padding:0}.tox .tox-naked-btn svg{display:block;fill:#222f3e}.tox:not([dir=rtl]) .tox-toolbar-textfield+*{margin-left:4px}.tox[dir=rtl] .tox-toolbar-textfield+*{margin-right:4px}.tox .tox-listboxfield{cursor:pointer;position:relative}.tox .tox-listboxfield .tox-listbox--select[disabled]{background-color:#f2f2f2;color:#222f3ed9;cursor:not-allowed}.tox .tox-listbox__select-label{cursor:default;flex:1;margin:0 4px}.tox .tox-listbox__select-chevron{align-items:center;display:flex;justify-content:center;width:16px}.tox .tox-listbox__select-chevron svg{fill:#222f3e}.tox .tox-listboxfield .tox-listbox--select{align-items:center;display:flex}.tox:not([dir=rtl]) .tox-listboxfield svg{right:8px}.tox[dir=rtl] .tox-listboxfield svg{left:8px}.tox .tox-selectfield{cursor:pointer;position:relative}.tox .tox-selectfield select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#eee;border-radius:6px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#222f3e;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:24px;margin:0;min-height:34px;outline:none;padding:5px 5.5px;resize:none;width:100%}.tox .tox-selectfield select[disabled]{background-color:#f2f2f2;color:#222f3ed9;cursor:not-allowed}.tox .tox-selectfield select::-ms-expand{display:none}.tox .tox-selectfield select:focus{background-color:#fff;border-color:#006ce7;box-shadow:0 0 0 2px #006ce740;outline:none}.tox .tox-selectfield svg{pointer-events:none;position:absolute;top:50%;transform:translateY(-50%)}.tox:not([dir=rtl]) .tox-selectfield select[size="0"],.tox:not([dir=rtl]) .tox-selectfield select[size="1"]{padding-right:24px}.tox:not([dir=rtl]) .tox-selectfield svg{right:8px}.tox[dir=rtl] .tox-selectfield select[size="0"],.tox[dir=rtl] .tox-selectfield select[size="1"]{padding-left:24px}.tox[dir=rtl] .tox-selectfield svg{left:8px}.tox .tox-textarea-wrap{border-color:#eee;border-radius:6px;border-style:solid;border-width:1px;display:flex;flex:1;overflow:hidden}.tox .tox-textarea{-webkit-appearance:textarea;-moz-appearance:textarea;appearance:textarea;white-space:pre-wrap}.tox .tox-textarea-wrap .tox-textarea{border:none}.tox .tox-textarea-wrap .tox-textarea:focus{border:none}.tox-fullscreen{border:0;height:100%;margin:0;overflow:hidden;overscroll-behavior:none;padding:0;touch-action:pinch-zoom;width:100%}.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox.tox-tinymce.tox-fullscreen,.tox-shadowhost.tox-fullscreen{left:0;position:fixed;top:0;z-index:1200}.tox.tox-tinymce.tox-fullscreen{background-color:transparent}.tox-fullscreen .tox.tox-tinymce-aux,.tox-fullscreen~.tox.tox-tinymce-aux{z-index:1201}.tox .tox-help__more-link{list-style:none;margin-top:1em}.tox .tox-imagepreview{background-color:#666;height:380px;overflow:hidden;position:relative;width:100%}.tox .tox-imagepreview.tox-imagepreview__loaded{overflow:auto}.tox .tox-imagepreview__container{display:flex;left:100vw;position:absolute;top:100vw}.tox .tox-imagepreview__image{background:url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==)}.tox .tox-image-tools .tox-spacer{flex:1}.tox .tox-image-tools .tox-bar{align-items:center;display:flex;height:60px;justify-content:center}.tox .tox-image-tools .tox-imagepreview,.tox .tox-image-tools .tox-imagepreview+.tox-bar{margin-top:8px}.tox .tox-image-tools .tox-croprect-block{background:#000;filter:alpha(opacity=50);opacity:.5;position:absolute;zoom:1}.tox .tox-image-tools .tox-croprect-handle{border:2px solid white;height:20px;left:0;position:absolute;top:0;width:20px}.tox .tox-image-tools .tox-croprect-handle-move{border:0;cursor:move;position:absolute}.tox .tox-image-tools .tox-croprect-handle-nw{border-width:2px 0 0 2px;cursor:nw-resize;left:100px;margin:-2px 0 0 -2px;top:100px}.tox .tox-image-tools .tox-croprect-handle-ne{border-width:2px 2px 0 0;cursor:ne-resize;left:200px;margin:-2px 0 0 -20px;top:100px}.tox .tox-image-tools .tox-croprect-handle-sw{border-width:0 0 2px 2px;cursor:sw-resize;left:100px;margin:-20px 2px 0 -2px;top:200px}.tox .tox-image-tools .tox-croprect-handle-se{border-width:0 2px 2px 0;cursor:se-resize;left:200px;margin:-20px 0 0 -20px;top:200px}.tox .tox-insert-table-picker{display:flex;flex-wrap:wrap;width:170px}.tox .tox-insert-table-picker>div{border-color:#eee;border-style:solid;border-width:0 1px 1px 0;box-sizing:border-box;height:17px;width:17px}.tox .tox-collection--list .tox-collection__group .tox-insert-table-picker{margin:-4px}.tox .tox-insert-table-picker .tox-insert-table-picker__selected{background-color:#006ce780;border-color:#006ce780}.tox .tox-insert-table-picker__label{color:#222f3eb3;display:block;font-size:14px;padding:4px;text-align:center;width:100%}.tox:not([dir=rtl]) .tox-insert-table-picker>div:nth-child(10n){border-right:0}.tox[dir=rtl] .tox-insert-table-picker>div:nth-child(10n+1){border-right:0}.tox .tox-menu{background-color:#fff;border:1px solid transparent;border-radius:6px;box-shadow:0 0 2px #222f3e33,0 4px 8px #222f3e26;display:inline-block;overflow:hidden;vertical-align:top;z-index:1150}.tox .tox-menu.tox-collection.tox-collection--list{padding:0 4px}.tox .tox-menu.tox-collection.tox-collection--toolbar,.tox .tox-menu.tox-collection.tox-collection--grid{padding:8px}@media only screen and (min-width: 768px){.tox .tox-menu .tox-collection__item-label{overflow-wrap:break-word;word-break:normal}.tox .tox-dialog__popups .tox-menu .tox-collection__item-label{word-break:break-all}}.tox .tox-menu__label h1,.tox .tox-menu__label h2,.tox .tox-menu__label h3,.tox .tox-menu__label h4,.tox .tox-menu__label h5,.tox .tox-menu__label h6,.tox .tox-menu__label p,.tox .tox-menu__label blockquote,.tox .tox-menu__label code{margin:0}.tox .tox-menubar{background:repeating-linear-gradient(transparent 0px 1px,transparent 1px 39px) center top 39px / 100% calc(100% - 39px) no-repeat;background-color:#fff;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;grid-column:1 / -1;grid-row:1;padding:0 11px 0 12px}.tox .tox-promotion+.tox-menubar{grid-column:1}.tox .tox-promotion{background:repeating-linear-gradient(transparent 0px 1px,transparent 1px 39px) center top 39px / 100% calc(100% - 39px) no-repeat;background-color:#fff;grid-column:2;grid-row:1;padding-inline-end:8px;padding-inline-start:4px;padding-top:5px}.tox .tox-promotion-link{align-items:unsafe center;background-color:#e8f1f8;border-radius:5px;color:#086be6;cursor:pointer;display:flex;font-size:14px;height:26.6px;padding:4px 8px;white-space:nowrap}.tox .tox-promotion-link:hover{background-color:#b4d7ff}.tox .tox-promotion-link:focus{background-color:#d9edf7}.tox .tox-mbtn{align-items:center;background:transparent;border:0;border-radius:3px;box-shadow:none;color:#222f3e;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:28px;justify-content:center;margin:5px 1px 6px 0;outline:none;overflow:hidden;padding:0 4px;text-transform:none;width:auto}.tox .tox-mbtn[disabled]{background-color:transparent;border:0;box-shadow:none;color:#222f3e80;cursor:not-allowed}.tox .tox-mbtn:focus:not(:disabled){background:#cce2fa;border:0;box-shadow:none;color:#222f3e}.tox .tox-mbtn--active{background:#a6ccf7;border:0;box-shadow:none;color:#222f3e}.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active){background:#cce2fa;border:0;box-shadow:none;color:#222f3e}.tox .tox-mbtn__select-label{cursor:default;font-weight:400;margin:0 4px}.tox .tox-mbtn[disabled] .tox-mbtn__select-label{cursor:not-allowed}.tox .tox-mbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px;display:none}.tox .tox-notification{border-radius:6px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;display:grid;font-size:14px;font-weight:400;grid-template-columns:minmax(40px,1fr) auto minmax(40px,1fr);margin-top:4px;opacity:0;padding:4px;transition:transform .1s ease-in,opacity .15s ease-in}.tox .tox-notification p{font-size:14px;font-weight:400}.tox .tox-notification a{cursor:pointer;text-decoration:underline}.tox .tox-notification--in{opacity:1}.tox .tox-notification--success{background-color:#e4eeda;border-color:#d7e6c8;color:#222f3e}.tox .tox-notification--success p{color:#222f3e}.tox .tox-notification--success a{color:#517342}.tox .tox-notification--success svg{fill:#222f3e}.tox .tox-notification--error{background-color:#f5cccc;border-color:#f0b3b3;color:#222f3e}.tox .tox-notification--error p{color:#222f3e}.tox .tox-notification--error a{color:#77181f}.tox .tox-notification--error svg{fill:#222f3e}.tox .tox-notification--warn,.tox .tox-notification--warning{background-color:#fff5cc;border-color:#fff0b3;color:#222f3e}.tox .tox-notification--warn p,.tox .tox-notification--warning p{color:#222f3e}.tox .tox-notification--warn a,.tox .tox-notification--warning a{color:#7a6e25}.tox .tox-notification--warn svg,.tox .tox-notification--warning svg{fill:#222f3e}.tox .tox-notification--info{background-color:#d6e7fb;border-color:#c1dbf9;color:#222f3e}.tox .tox-notification--info p{color:#222f3e}.tox .tox-notification--info a{color:#2a64a6}.tox .tox-notification--info svg{fill:#222f3e}.tox .tox-notification__body{align-self:center;color:#222f3e;font-size:14px;grid-column-end:3;grid-column-start:2;grid-row-end:2;grid-row-start:1;text-align:center;white-space:normal;word-break:break-all;word-break:break-word}.tox .tox-notification__body>*{margin:0}.tox .tox-notification__body>*+*{margin-top:1rem}.tox .tox-notification__icon{align-self:center;grid-column-end:2;grid-column-start:1;grid-row-end:2;grid-row-start:1;justify-self:end}.tox .tox-notification__icon svg{display:block}.tox .tox-notification__dismiss{align-self:start;grid-column-end:4;grid-column-start:3;grid-row-end:2;grid-row-start:1;justify-self:end}.tox .tox-notification .tox-progress-bar{grid-column-end:4;grid-column-start:1;grid-row-end:3;grid-row-start:2;justify-self:center}.tox .tox-pop{display:inline-block;position:relative}.tox .tox-pop--resizing{transition:width .1s ease}.tox .tox-pop--resizing .tox-toolbar,.tox .tox-pop--resizing .tox-toolbar__group{flex-wrap:nowrap}.tox .tox-pop--transition{transition:.15s ease;transition-property:left,right,top,bottom}.tox .tox-pop--transition:before,.tox .tox-pop--transition:after{transition:all .15s,visibility 0s,opacity 75ms ease 75ms}.tox .tox-pop__dialog{background-color:#fff;border:1px solid #eeeeee;border-radius:6px;box-shadow:0 0 2px #222f3e33,0 4px 8px #222f3e26;min-width:0;overflow:hidden}.tox .tox-pop__dialog>*:not(.tox-toolbar){margin:4px 4px 4px 8px}.tox .tox-pop__dialog .tox-toolbar{background-color:transparent;margin-bottom:-1px}.tox .tox-pop:before,.tox .tox-pop:after{border-style:solid;content:"";display:block;height:0;opacity:1;position:absolute;width:0}.tox .tox-pop.tox-pop--inset:before,.tox .tox-pop.tox-pop--inset:after{opacity:0;transition:all 0s .15s,visibility 0s,opacity 75ms ease}.tox .tox-pop.tox-pop--bottom:before,.tox .tox-pop.tox-pop--bottom:after{left:50%;top:100%}.tox .tox-pop.tox-pop--bottom:after{border-color:#fff transparent transparent transparent;border-width:8px;margin-left:-8px;margin-top:-1px}.tox .tox-pop.tox-pop--bottom:before{border-color:#eeeeee transparent transparent transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--top:before,.tox .tox-pop.tox-pop--top:after{left:50%;top:0;transform:translateY(-100%)}.tox .tox-pop.tox-pop--top:after{border-color:transparent transparent #fff transparent;border-width:8px;margin-left:-8px;margin-top:1px}.tox .tox-pop.tox-pop--top:before{border-color:transparent transparent #eeeeee transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--left:before,.tox .tox-pop.tox-pop--left:after{left:0;top:calc(50% - 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--left:after{border-color:transparent #fff transparent transparent;border-width:8px;margin-left:-15px}.tox .tox-pop.tox-pop--left:before{border-color:transparent #eeeeee transparent transparent;border-width:10px;margin-left:-19px}.tox .tox-pop.tox-pop--right:before,.tox .tox-pop.tox-pop--right:after{left:100%;top:calc(50% + 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--right:after{border-color:transparent transparent transparent #fff;border-width:8px;margin-left:-1px}.tox .tox-pop.tox-pop--right:before{border-color:transparent transparent transparent #eeeeee;border-width:10px;margin-left:-1px}.tox .tox-pop.tox-pop--align-left:before,.tox .tox-pop.tox-pop--align-left:after{left:20px}.tox .tox-pop.tox-pop--align-right:before,.tox .tox-pop.tox-pop--align-right:after{left:calc(100% - 20px)}.tox .tox-sidebar-wrap{display:flex;flex-direction:row;flex-grow:1;min-height:0}.tox .tox-sidebar{background-color:#fff;display:flex;flex-direction:row;justify-content:flex-end}.tox .tox-sidebar__slider{display:flex;overflow:hidden}.tox .tox-sidebar__pane-container,.tox .tox-sidebar__pane{display:flex}.tox .tox-sidebar--sliding-closed{opacity:0}.tox .tox-sidebar--sliding-open{opacity:1}.tox .tox-sidebar--sliding-growing,.tox .tox-sidebar--sliding-shrinking{transition:width .5s ease,opacity .5s ease}.tox .tox-selector{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;display:inline-block;height:10px;position:absolute;width:10px}.tox.tox-platform-touch .tox-selector{height:12px;width:12px}.tox .tox-slider{align-items:center;display:flex;flex:1;height:24px;justify-content:center;position:relative}.tox .tox-slider__rail{background-color:transparent;border:1px solid #eeeeee;border-radius:6px;height:10px;min-width:120px;width:100%}.tox .tox-slider__handle{background-color:#006ce7;border:2px solid #0054b4;border-radius:6px;box-shadow:none;height:24px;left:50%;position:absolute;top:50%;transform:translate(-50%) translateY(-50%);width:14px}.tox .tox-form__controls-h-stack>.tox-slider:not(:first-of-type){margin-inline-start:8px}.tox .tox-form__controls-h-stack>.tox-form__group+.tox-slider{margin-inline-start:32px}.tox .tox-form__controls-h-stack>.tox-slider+.tox-form__group{margin-inline-start:32px}.tox .tox-source-code{overflow:auto}.tox .tox-spinner{display:flex}.tox .tox-spinner>div{animation:tam-bouncing-dots 1.5s ease-in-out 0s infinite both;background-color:#222f3eb3;border-radius:100%;height:8px;width:8px}.tox .tox-spinner>div:nth-child(1){animation-delay:-.32s}.tox .tox-spinner>div:nth-child(2){animation-delay:-.16s}@keyframes tam-bouncing-dots{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}.tox:not([dir=rtl]) .tox-spinner>div:not(:first-child){margin-left:4px}.tox[dir=rtl] .tox-spinner>div:not(:first-child){margin-right:4px}.tox .tox-statusbar{align-items:center;background-color:#fff;border-top:1px solid #e3e3e3;color:#222f3eb3;display:flex;flex:0 0 auto;font-size:14px;font-weight:400;height:25px;overflow:hidden;padding:0 8px;position:relative;text-transform:none}.tox .tox-statusbar__path{display:flex;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tox .tox-statusbar__right-container{display:flex;justify-content:flex-end;white-space:nowrap}.tox .tox-statusbar__help-text{text-align:center}.tox .tox-statusbar__text-container{display:flex;flex:1 1 auto;justify-content:space-between;overflow:hidden}@media only screen and (min-width: 768px){.tox .tox-statusbar__text-container.tox-statusbar__text-container-3-cols>.tox-statusbar__help-text,.tox .tox-statusbar__text-container.tox-statusbar__text-container-3-cols>.tox-statusbar__right-container,.tox .tox-statusbar__text-container.tox-statusbar__text-container-3-cols>.tox-statusbar__path{flex:0 0 calc(100% / 3)}}.tox .tox-statusbar__text-container.tox-statusbar__text-container--flex-end{justify-content:flex-end}.tox .tox-statusbar__text-container.tox-statusbar__text-container--flex-start{justify-content:flex-start}.tox .tox-statusbar__text-container.tox-statusbar__text-container--space-around{justify-content:space-around}.tox .tox-statusbar__path>*{display:inline;white-space:nowrap}.tox .tox-statusbar__wordcount{flex:0 0 auto;margin-left:1ch}@media only screen and (max-width: 767px){.tox .tox-statusbar__text-container .tox-statusbar__help-text{display:none}.tox .tox-statusbar__text-container .tox-statusbar__help-text:only-child{display:block}}.tox .tox-statusbar a,.tox .tox-statusbar__path-item,.tox .tox-statusbar__wordcount{color:#222f3eb3;text-decoration:none}.tox .tox-statusbar a:hover:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__path-item:hover:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__wordcount:hover:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar a:focus:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__path-item:focus:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__wordcount:focus:not(:disabled):not([aria-disabled=true]){color:#222f3e;cursor:pointer}.tox .tox-statusbar__branding svg{fill:#222f3ecc;height:1.14em;vertical-align:-.28em;width:3.6em}.tox .tox-statusbar__branding a:hover:not(:disabled):not([aria-disabled=true]) svg,.tox .tox-statusbar__branding a:focus:not(:disabled):not([aria-disabled=true]) svg{fill:#222f3e}.tox .tox-statusbar__resize-handle{align-items:flex-end;align-self:stretch;cursor:nwse-resize;display:flex;flex:0 0 auto;justify-content:flex-end;margin-left:auto;margin-right:-8px;padding-bottom:3px;padding-left:1ch;padding-right:3px}.tox .tox-statusbar__resize-handle svg{display:block;fill:#222f3e80}.tox .tox-statusbar__resize-handle:focus svg{background-color:#dee0e2;border-radius:1px 1px 5px;box-shadow:0 0 0 2px #dee0e2}.tox:not([dir=rtl]) .tox-statusbar__path>*{margin-right:4px}.tox:not([dir=rtl]) .tox-statusbar__branding{margin-left:2ch}.tox[dir=rtl] .tox-statusbar{flex-direction:row-reverse}.tox[dir=rtl] .tox-statusbar__path>*{margin-left:4px}.tox .tox-throbber{z-index:1299}.tox .tox-throbber__busy-spinner{align-items:center;background-color:#fff9;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.tox .tox-tbtn{align-items:center;background:transparent;border:0;border-radius:3px;box-shadow:none;color:#222f3e;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:28px;justify-content:center;margin:6px 1px 5px 0;outline:none;overflow:hidden;padding:0;text-transform:none;width:34px}.tox .tox-tbtn svg{display:block;fill:#222f3e}.tox .tox-tbtn.tox-tbtn-more{padding-left:5px;padding-right:5px;width:inherit}.tox .tox-tbtn:focus{background:#cce2fa;border:0;box-shadow:none}.tox .tox-tbtn:hover{background:#cce2fa;border:0;box-shadow:none;color:#222f3e}.tox .tox-tbtn:hover svg{fill:#222f3e}.tox .tox-tbtn:active{background:#a6ccf7;border:0;box-shadow:none;color:#222f3e}.tox .tox-tbtn:active svg{fill:#222f3e}.tox .tox-tbtn--disabled .tox-tbtn--enabled svg{fill:#222f3e80}.tox .tox-tbtn--disabled,.tox .tox-tbtn--disabled:hover,.tox .tox-tbtn:disabled,.tox .tox-tbtn:disabled:hover{background:transparent;border:0;box-shadow:none;color:#222f3e80;cursor:not-allowed}.tox .tox-tbtn--disabled svg,.tox .tox-tbtn--disabled:hover svg,.tox .tox-tbtn:disabled svg,.tox .tox-tbtn:disabled:hover svg{fill:#222f3e80}.tox .tox-tbtn--enabled,.tox .tox-tbtn--enabled:hover{background:#a6ccf7;border:0;box-shadow:none;color:#222f3e}.tox .tox-tbtn--enabled>*,.tox .tox-tbtn--enabled:hover>*{transform:none}.tox .tox-tbtn--enabled svg,.tox .tox-tbtn--enabled:hover svg{fill:#222f3e}.tox .tox-tbtn--enabled.tox-tbtn--disabled svg,.tox .tox-tbtn--enabled:hover.tox-tbtn--disabled svg{fill:#222f3e80}.tox .tox-tbtn:focus:not(.tox-tbtn--disabled){color:#222f3e}.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) svg{fill:#222f3e}.tox .tox-tbtn:active>*{transform:none}.tox .tox-tbtn--md{height:42px;width:51px}.tox .tox-tbtn--lg{flex-direction:column;height:56px;width:68px}.tox .tox-tbtn--return{align-self:stretch;height:unset;width:16px}.tox .tox-tbtn--labeled{padding:0 4px;width:unset}.tox .tox-tbtn__vlabel{display:block;font-size:10px;font-weight:400;letter-spacing:-.025em;margin-bottom:4px;white-space:nowrap}.tox .tox-number-input{border-radius:3px;display:flex;margin:6px 1px 5px 0;padding:0 4px;width:auto}.tox .tox-number-input .tox-input-wrapper{background:#f7f7f7;display:flex;pointer-events:none;text-align:center}.tox .tox-number-input .tox-input-wrapper:focus{background:#cce2fa}.tox .tox-number-input input{border-radius:3px;color:#222f3e;font-size:14px;margin:2px 0;pointer-events:all;width:60px}.tox .tox-number-input input:hover{background:#cce2fa;color:#222f3e}.tox .tox-number-input input:focus{background:#fff;color:#222f3e}.tox .tox-number-input input:disabled{background:transparent;border:0;box-shadow:none;color:#222f3e80;cursor:not-allowed}.tox .tox-number-input button{background:#f7f7f7;color:#222f3e;height:28px;text-align:center;width:24px}.tox .tox-number-input button svg{display:block;fill:#222f3e;margin:0 auto;transform:scale(.67)}.tox .tox-number-input button:focus{background:#cce2fa}.tox .tox-number-input button:hover{background:#cce2fa;border:0;box-shadow:none;color:#222f3e}.tox .tox-number-input button:hover svg{fill:#222f3e}.tox .tox-number-input button:active{background:#a6ccf7;border:0;box-shadow:none;color:#222f3e}.tox .tox-number-input button:active svg{fill:#222f3e}.tox .tox-number-input button:disabled{background:transparent;border:0;box-shadow:none;color:#222f3e80;cursor:not-allowed}.tox .tox-number-input button:disabled svg{fill:#222f3e80}.tox .tox-number-input button.minus{border-radius:3px 0 0 3px}.tox .tox-number-input button.plus{border-radius:0 3px 3px 0}.tox .tox-number-input:focus:not(:active)>button,.tox .tox-number-input:focus:not(:active)>.tox-input-wrapper{background:#cce2fa}.tox .tox-tbtn--select{margin:6px 1px 5px 0;padding:0 4px;width:auto}.tox .tox-tbtn__select-label{cursor:default;font-weight:400;height:initial;margin:0 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tox .tox-tbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px}.tox .tox-tbtn__select-chevron svg{fill:#222f3e80}.tox .tox-tbtn--bespoke{background:#f7f7f7}.tox .tox-tbtn--bespoke+.tox-tbtn--bespoke{margin-inline-start:4px}.tox .tox-tbtn--bespoke .tox-tbtn__select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:7em}.tox .tox-tbtn--disabled .tox-tbtn__select-label,.tox .tox-tbtn--select:disabled .tox-tbtn__select-label{cursor:not-allowed}.tox .tox-split-button{border:0;border-radius:3px;box-sizing:border-box;display:flex;margin:6px 1px 5px 0;overflow:hidden}.tox .tox-split-button:hover{box-shadow:0 0 0 1px #cce2fa inset}.tox .tox-split-button:focus{background:#cce2fa;box-shadow:none;color:#222f3e}.tox .tox-split-button>*{border-radius:0}.tox .tox-split-button__chevron{width:16px}.tox .tox-split-button__chevron svg{fill:#222f3e80}.tox .tox-split-button .tox-tbtn{margin:0}.tox .tox-split-button.tox-tbtn--disabled:hover,.tox .tox-split-button.tox-tbtn--disabled:focus,.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover,.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus{background:transparent;box-shadow:none;color:#222f3e80}.tox.tox-platform-touch .tox-split-button .tox-tbtn--select{padding:0}.tox.tox-platform-touch .tox-split-button .tox-tbtn:not(.tox-tbtn--select):first-child{width:30px}.tox.tox-platform-touch .tox-split-button__chevron{width:20px}.tox .tox-split-button.tox-tbtn--disabled svg #tox-icon-text-color__color,.tox .tox-split-button.tox-tbtn--disabled svg #tox-icon-highlight-bg-color__color{opacity:.6}.tox .tox-toolbar-overlord{background-color:#fff}.tox .tox-toolbar,.tox .tox-toolbar__primary,.tox .tox-toolbar__overflow{background-attachment:local;background-color:#fff;background-image:repeating-linear-gradient(#e3e3e3 0px 1px,transparent 1px 39px);background-position:center top 40px;background-repeat:no-repeat;background-size:calc(100% - 22px) calc(100% - 41px);display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;padding:0;transform:perspective(1px)}.tox .tox-toolbar-overlord>.tox-toolbar,.tox .tox-toolbar-overlord>.tox-toolbar__primary,.tox .tox-toolbar-overlord>.tox-toolbar__overflow{background-position:center top 0px;background-size:calc(100% - 22px) calc(100% + -0px)}.tox .tox-toolbar__overflow.tox-toolbar__overflow--closed{height:0;opacity:0;padding-bottom:0;padding-top:0;visibility:hidden}.tox .tox-toolbar__overflow--growing{transition:height .3s ease,opacity .2s linear .1s}.tox .tox-toolbar__overflow--shrinking{transition:opacity .3s ease,height .2s linear .1s,visibility 0s linear .3s}.tox .tox-toolbar-overlord,.tox .tox-anchorbar{grid-column:1 / -1}.tox .tox-menubar+.tox-toolbar,.tox .tox-menubar+.tox-toolbar-overlord{border-top:1px solid transparent;margin-top:-1px;padding-bottom:1px;padding-top:1px}.tox .tox-toolbar--scrolling{flex-wrap:nowrap;overflow-x:auto}.tox .tox-pop .tox-toolbar{border-width:0}.tox .tox-toolbar--no-divider{background-image:none}.tox .tox-toolbar-overlord .tox-toolbar:not(.tox-toolbar--scrolling):first-child,.tox .tox-toolbar-overlord .tox-toolbar__primary{background-position:center top 39px}.tox .tox-editor-header>.tox-toolbar--scrolling,.tox .tox-toolbar-overlord .tox-toolbar--scrolling:first-child{background-image:none}.tox.tox-tinymce-aux .tox-toolbar__overflow{background-color:#fff;background-position:center top 43px;background-size:calc(100% - 16px) calc(100% - 51px);border:none;border-radius:6px;box-shadow:0 0 2px #222f3e33,0 4px 8px #222f3e26;overscroll-behavior:none;padding:4px 0}.tox-pop .tox-pop__dialog .tox-toolbar{background-position:center top 43px;background-size:calc(100% - 22px) calc(100% - 51px);padding:4px 0}.tox .tox-toolbar__group{align-items:center;display:flex;flex-wrap:wrap;margin:0;padding:0 11px 0 12px}.tox .tox-toolbar__group--pull-right{margin-left:auto}.tox .tox-toolbar--scrolling .tox-toolbar__group{flex-shrink:0;flex-wrap:nowrap}.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type){border-right:1px solid transparent}.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type){border-left:1px solid transparent}.tox .tox-tooltip{display:inline-block;padding:8px;position:relative}.tox .tox-tooltip__body{background-color:#222f3e;border-radius:6px;box-shadow:0 2px 4px #222f3e4d;color:#ffffffbf;font-size:14px;font-style:normal;font-weight:400;padding:4px 8px;text-transform:none}.tox .tox-tooltip__arrow{position:absolute}.tox .tox-tooltip--down .tox-tooltip__arrow{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #222f3e;bottom:0;left:50%;position:absolute;transform:translate(-50%)}.tox .tox-tooltip--up .tox-tooltip__arrow{border-bottom:8px solid #222f3e;border-left:8px solid transparent;border-right:8px solid transparent;left:50%;position:absolute;top:0;transform:translate(-50%)}.tox .tox-tooltip--right .tox-tooltip__arrow{border-bottom:8px solid transparent;border-left:8px solid #222f3e;border-top:8px solid transparent;position:absolute;right:0;top:50%;transform:translateY(-50%)}.tox .tox-tooltip--left .tox-tooltip__arrow{border-bottom:8px solid transparent;border-right:8px solid #222f3e;border-top:8px solid transparent;left:0;position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-tree{display:flex;flex-direction:column}.tox .tox-tree .tox-trbtn{align-items:center;background:transparent;border:0;border-radius:4px;box-shadow:none;color:#222f3e;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:28px;margin-bottom:4px;margin-top:4px;outline:none;overflow:hidden;padding:0 0 0 8px;text-transform:none}.tox .tox-tree .tox-trbtn .tox-tree__label{cursor:default;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tox .tox-tree .tox-trbtn svg{display:block;fill:#222f3e}.tox .tox-tree .tox-trbtn:focus{background:#cce2fa;border:0;box-shadow:none}.tox .tox-tree .tox-trbtn:hover{background:#cce2fa;border:0;box-shadow:none;color:#222f3e}.tox .tox-tree .tox-trbtn:hover svg{fill:#222f3e}.tox .tox-tree .tox-trbtn:active{background:#a6ccf7;border:0;box-shadow:none;color:#222f3e}.tox .tox-tree .tox-trbtn:active svg{fill:#222f3e}.tox .tox-tree .tox-trbtn--disabled,.tox .tox-tree .tox-trbtn--disabled:hover,.tox .tox-tree .tox-trbtn:disabled,.tox .tox-tree .tox-trbtn:disabled:hover{background:transparent;border:0;box-shadow:none;color:#222f3e80;cursor:not-allowed}.tox .tox-tree .tox-trbtn--disabled svg,.tox .tox-tree .tox-trbtn--disabled:hover svg,.tox .tox-tree .tox-trbtn:disabled svg,.tox .tox-tree .tox-trbtn:disabled:hover svg{fill:#222f3e80}.tox .tox-tree .tox-trbtn--enabled,.tox .tox-tree .tox-trbtn--enabled:hover{background:#a6ccf7;border:0;box-shadow:none;color:#222f3e}.tox .tox-tree .tox-trbtn--enabled>*,.tox .tox-tree .tox-trbtn--enabled:hover>*{transform:none}.tox .tox-tree .tox-trbtn--enabled svg,.tox .tox-tree .tox-trbtn--enabled:hover svg{fill:#222f3e}.tox .tox-tree .tox-trbtn:focus:not(.tox-trbtn--disabled){color:#222f3e}.tox .tox-tree .tox-trbtn:focus:not(.tox-trbtn--disabled) svg{fill:#222f3e}.tox .tox-tree .tox-trbtn:active>*{transform:none}.tox .tox-tree .tox-trbtn--return{align-self:stretch;height:unset;width:16px}.tox .tox-tree .tox-trbtn--labeled{padding:0 4px;width:unset}.tox .tox-tree .tox-trbtn__vlabel{display:block;font-size:10px;font-weight:400;letter-spacing:-.025em;margin-bottom:4px;white-space:nowrap}.tox .tox-tree .tox-tree--directory{display:flex;flex-direction:column}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label{font-weight:700}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label .tox-mbtn{margin-left:auto}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label .tox-mbtn svg{fill:transparent}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label .tox-mbtn.tox-mbtn--active svg,.tox .tox-tree .tox-tree--directory .tox-tree--directory__label .tox-mbtn:focus svg{fill:#222f3e}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:hover .tox-mbtn svg,.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:focus .tox-mbtn svg{fill:#222f3e}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:hover:has(.tox-mbtn:hover){background-color:transparent;color:#222f3e}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:hover:has(.tox-mbtn:hover) .tox-chevron svg{fill:#222f3e}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label .tox-chevron{margin-right:6px}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:has(+.tox-tree--directory__children--growing) .tox-chevron,.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:has(+.tox-tree--directory__children--shrinking) .tox-chevron{transition:transform .5s ease-in-out}.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:has(+.tox-tree--directory__children--growing) .tox-chevron,.tox .tox-tree .tox-tree--directory .tox-tree--directory__label:has(+.tox-tree--directory__children--open) .tox-chevron{transform:rotate(90deg)}.tox .tox-tree .tox-tree--leaf__label{font-weight:400}.tox .tox-tree .tox-tree--leaf__label .tox-mbtn{margin-left:auto}.tox .tox-tree .tox-tree--leaf__label .tox-mbtn svg{fill:transparent}.tox .tox-tree .tox-tree--leaf__label .tox-mbtn.tox-mbtn--active svg,.tox .tox-tree .tox-tree--leaf__label .tox-mbtn:focus svg{fill:#222f3e}.tox .tox-tree .tox-tree--leaf__label:hover .tox-mbtn svg{fill:#222f3e}.tox .tox-tree .tox-tree--leaf__label:hover:has(.tox-mbtn:hover){background-color:transparent;color:#222f3e}.tox .tox-tree .tox-tree--leaf__label:hover:has(.tox-mbtn:hover) .tox-chevron svg{fill:#222f3e}.tox .tox-tree .tox-tree--directory__children{overflow:hidden;padding-left:16px}.tox .tox-tree .tox-tree--directory__children.tox-tree--directory__children--growing,.tox .tox-tree .tox-tree--directory__children.tox-tree--directory__children--shrinking{transition:height .5s ease-in-out}.tox .tox-tree .tox-trbtn.tox-tree--leaf__label{display:flex;justify-content:space-between}.tox .tox-view-wrap,.tox .tox-view-wrap__slot-container{background-color:#fff;display:flex;flex:1;flex-direction:column}.tox .tox-view{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.tox .tox-view__header{align-items:center;display:flex;font-size:16px;justify-content:space-between;padding:8px 8px 0;position:relative}.tox .tox-view--mobile.tox-view__header,.tox .tox-view--mobile.tox-view__toolbar{padding:8px}.tox .tox-view--scrolling{flex-wrap:nowrap;overflow-x:auto}.tox .tox-view__toolbar{display:flex;flex-direction:row;gap:8px;justify-content:space-between;padding:8px 8px 0}.tox .tox-view__toolbar__group{display:flex;flex-direction:row;gap:12px}.tox .tox-view__header-start,.tox .tox-view__header-end{display:flex}.tox .tox-view__pane{height:100%;padding:8px;width:100%}.tox .tox-view__pane_panel{border:1px solid #eeeeee;border-radius:6px}.tox:not([dir=rtl]) .tox-view__header .tox-view__header-start>*,.tox:not([dir=rtl]) .tox-view__header .tox-view__header-end>*{margin-left:8px}.tox[dir=rtl] .tox-view__header .tox-view__header-start>*,.tox[dir=rtl] .tox-view__header .tox-view__header-end>*{margin-right:8px}.tox .tox-well{border:1px solid #eeeeee;border-radius:6px;padding:8px;width:100%}.tox .tox-well>*:first-child{margin-top:0}.tox .tox-well>*:last-child{margin-bottom:0}.tox .tox-well>*:only-child{margin:0}.tox .tox-custom-editor{border:1px solid #eeeeee;border-radius:6px;display:flex;flex:1;overflow:hidden;position:relative}.tox .tox-dialog-loading:before{background-color:#00000080;content:"";height:100%;position:absolute;width:100%;z-index:1000}.tox .tox-tab{cursor:pointer}.tox .tox-dialog__content-js,.tox .tox-dialog__body-content .tox-collection{display:flex;flex:1}.tox:not(.tox-tinymce-inline) .tox-editor-header{background-color:#fff;border-bottom:1px solid #ced4da;box-shadow:none;padding:4px 0;transition:box-shadow .5s}.tox-tinymce{border:1px solid #ced4da}trix-editor{border:1px solid #bbb;border-radius:3px;margin:0;padding:.4em .6em;min-height:5em;outline:none}trix-toolbar *{box-sizing:border-box}trix-toolbar .trix-button-row{display:flex;flex-wrap:nowrap;justify-content:space-between;overflow-x:auto}trix-toolbar .trix-button-group{display:flex;margin-bottom:10px;border:1px solid #bbb;border-top-color:#ccc;border-bottom-color:#888;border-radius:3px}trix-toolbar .trix-button-group:not(:first-child){margin-left:1.5vw}@media (max-width: 768px){trix-toolbar .trix-button-group:not(:first-child){margin-left:0}}trix-toolbar .trix-button-group-spacer{flex-grow:1}@media (max-width: 768px){trix-toolbar .trix-button-group-spacer{display:none}}trix-toolbar .trix-button{position:relative;float:left;color:#0009;font-size:.75em;font-weight:600;white-space:nowrap;padding:0 .5em;margin:0;outline:none;border:none;border-bottom:1px solid #ddd;border-radius:0;background:transparent}trix-toolbar .trix-button:not(:first-child){border-left:1px solid #ccc}trix-toolbar .trix-button.trix-active{background:#cbeefa;color:#000}trix-toolbar .trix-button:not(:disabled){cursor:pointer}trix-toolbar .trix-button:disabled{color:#00000020}@media (max-width: 768px){trix-toolbar .trix-button{letter-spacing:-.01em;padding:0 .3em}}trix-toolbar .trix-button--icon{font-size:inherit;width:2.6em;height:1.6em;max-width:calc(.8em + 4vw);text-indent:-9999px}@media (max-width: 768px){trix-toolbar .trix-button--icon{height:2em;max-width:calc(.8em + 3.5vw)}}trix-toolbar .trix-button--icon:before{display:inline-block;position:absolute;top:0;right:0;bottom:0;left:0;opacity:.6;content:"";background-position:center;background-repeat:no-repeat;background-size:contain}@media (max-width: 768px){trix-toolbar .trix-button--icon:before{right:6%;left:6%}}trix-toolbar .trix-button--icon.trix-active:before{opacity:1}trix-toolbar .trix-button--icon:disabled:before{opacity:.125}trix-toolbar .trix-button--icon-attach:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.5%2018V7.5c0-2.25%203-2.25%203%200V18c0%204.125-6%204.125-6%200V7.5c0-6.375%209-6.375%209%200V18%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-miterlimit%3D%2210%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E);top:8%;bottom:4%}trix-toolbar .trix-button--icon-bold:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.522%2019.242a.5.5%200%200%201-.5-.5V5.35a.5.5%200%200%201%20.5-.5h5.783c1.347%200%202.46.345%203.24.982.783.64%201.216%201.562%201.216%202.683%200%201.13-.587%202.129-1.476%202.71a.35.35%200%200%200%20.049.613c1.259.56%202.101%201.742%202.101%203.22%200%201.282-.483%202.334-1.363%203.063-.876.726-2.132%201.12-3.66%201.12h-5.89ZM9.27%207.347v3.362h1.97c.766%200%201.347-.17%201.733-.464.38-.291.587-.716.587-1.27%200-.53-.183-.928-.513-1.198-.334-.273-.838-.43-1.505-.43H9.27Zm0%205.606v3.791h2.389c.832%200%201.448-.177%201.853-.497.399-.315.614-.786.614-1.423%200-.62-.22-1.077-.63-1.385-.418-.313-1.053-.486-1.905-.486H9.27Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-italic:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9%205h6.5v2h-2.23l-2.31%2010H13v2H6v-2h2.461l2.306-10H9V5Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-link:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.948%205.258a4.337%204.337%200%200%200-6.108%200L11.217%206.87a.993.993%200%200%200%200%201.41c.392.39%201.027.39%201.418%200l1.623-1.613a2.323%202.323%200%200%201%203.271%200%202.29%202.29%200%200%201%200%203.251l-2.393%202.38a3.021%203.021%200%200%201-4.255%200l-.05-.049a1.007%201.007%200%200%200-1.418%200%20.993.993%200%200%200%200%201.41l.05.049a5.036%205.036%200%200%200%207.091%200l2.394-2.38a4.275%204.275%200%200%200%200-6.072Zm-13.683%2013.6a4.337%204.337%200%200%200%206.108%200l1.262-1.255a.993.993%200%200%200%200-1.41%201.007%201.007%200%200%200-1.418%200L9.954%2017.45a2.323%202.323%200%200%201-3.27%200%202.29%202.29%200%200%201%200-3.251l2.344-2.331a2.579%202.579%200%200%201%203.631%200c.392.39%201.027.39%201.419%200a.993.993%200%200%200%200-1.41%204.593%204.593%200%200%200-6.468%200l-2.345%202.33a4.275%204.275%200%200%200%200%206.072Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-strike:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6%2014.986c.088%202.647%202.246%204.258%205.635%204.258%203.496%200%205.713-1.728%205.713-4.463%200-.275-.02-.536-.062-.781h-3.461c.398.293.573.654.573%201.123%200%201.035-1.074%201.787-2.646%201.787-1.563%200-2.773-.762-2.91-1.924H6ZM6.432%2010h3.763c-.632-.314-.914-.715-.914-1.273%200-1.045.977-1.739%202.432-1.739%201.475%200%202.52.723%202.617%201.914h2.764c-.05-2.548-2.11-4.238-5.39-4.238-3.145%200-5.392%201.719-5.392%204.316%200%20.363.04.703.12%201.02ZM4%2011a1%201%200%201%200%200%202h15a1%201%200%201%200%200-2H4Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-quote:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.581%208.471c.44-.5%201.056-.834%201.758-.995C8.074%207.17%209.201%207.822%2010%208.752c1.354%201.578%201.33%203.555.394%205.277-.941%201.731-2.788%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.121-.49.16-.764.294-.286.567-.566.791-.835.222-.266.413-.54.524-.815.113-.28.156-.597.026-.908-.128-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.674-2.7c0-.905.283-1.59.72-2.088Zm9.419%200c.44-.5%201.055-.834%201.758-.995%201.734-.306%202.862.346%203.66%201.276%201.355%201.578%201.33%203.555.395%205.277-.941%201.731-2.789%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.122-.49.16-.764.294-.286.567-.566.791-.835.222-.266.412-.54.523-.815.114-.28.157-.597.026-.908-.127-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.672-2.701c0-.905.283-1.59.72-2.088Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-heading-1:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.5%207.5v-3h-12v3H14v13h3v-13h4.5ZM9%2013.5h3.5v-3h-10v3H6v7h3v-7Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-code:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.293%2011.293a1%201%200%200%200%200%201.414l4%204a1%201%200%201%200%201.414-1.414L5.414%2012l3.293-3.293a1%201%200%200%200-1.414-1.414l-4%204Zm13.414%205.414%204-4a1%201%200%200%200%200-1.414l-4-4a1%201%200%201%200-1.414%201.414L18.586%2012l-3.293%203.293a1%201%200%200%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-bullet-list:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%207.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203ZM8%206a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-2.5-5a1.5%201.5%200%201%201-3%200%201.5%201.5%200%200%201%203%200ZM5%2019.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-number-list:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%204h2v4H4V5H3V4Zm5%202a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-3.5-7H6v1l-1.5%202H6v1H3v-1l1.667-2H3v-1h2.5ZM3%2017v-1h3v4H3v-1h2v-.5H4v-1h1V17H3Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-undo:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%2014a1%201%200%200%200%201%201h6a1%201%200%201%200%200-2H6.257c2.247-2.764%205.151-3.668%207.579-3.264%202.589.432%204.739%202.356%205.174%205.405a1%201%200%200%200%201.98-.283c-.564-3.95-3.415-6.526-6.825-7.095C11.084%207.25%207.63%208.377%205%2011.39V8a1%201%200%200%200-2%200v6Zm2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-redo:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21%2014a1%201%200%200%201-1%201h-6a1%201%200%201%201%200-2h3.743c-2.247-2.764-5.151-3.668-7.579-3.264-2.589.432-4.739%202.356-5.174%205.405a1%201%200%200%201-1.98-.283c.564-3.95%203.415-6.526%206.826-7.095%203.08-.513%206.534.614%209.164%203.626V8a1%201%200%201%201%202%200v6Zm-2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-decrease-nesting-level:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-3.707-5.707a1%201%200%200%200%200%201.414l2%202a1%201%200%201%200%201.414-1.414L4.414%2012l1.293-1.293a1%201%200%200%200-1.414-1.414l-2%202Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-increase-nesting-level:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-2.293-2.293%202-2a1%201%200%200%200%200-1.414l-2-2a1%201%200%201%200-1.414%201.414L3.586%2012l-1.293%201.293a1%201%200%201%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-dialogs{position:relative}trix-toolbar .trix-dialog{position:absolute;top:0;left:0;right:0;font-size:.75em;padding:15px 10px;background:#fff;box-shadow:0 .3em 1em #ccc;border-top:2px solid #888;border-radius:5px;z-index:5}trix-toolbar .trix-input--dialog{font-size:inherit;font-weight:400;padding:.5em .8em;margin:0 10px 0 0;border-radius:3px;border:1px solid #bbb;background-color:#fff;box-shadow:none;outline:none;-webkit-appearance:none;-moz-appearance:none}trix-toolbar .trix-input--dialog.validate:invalid{box-shadow:red 0 0 1.5px 1px}trix-toolbar .trix-button--dialog{font-size:inherit;padding:.5em;border-bottom:none}trix-toolbar .trix-dialog--link{max-width:600px}trix-toolbar .trix-dialog__link-fields{display:flex;align-items:baseline}trix-toolbar .trix-dialog__link-fields .trix-input{flex:1}trix-toolbar .trix-dialog__link-fields .trix-button-group{flex:0 0 content;margin:0}trix-editor [data-trix-mutable]:not(.attachment__caption-editor){-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}trix-editor [data-trix-mutable]::-moz-selection,trix-editor [data-trix-cursor-target]::-moz-selection,trix-editor [data-trix-mutable] ::-moz-selection{background:none}trix-editor [data-trix-mutable]::selection,trix-editor [data-trix-cursor-target]::selection,trix-editor [data-trix-mutable] ::selection{background:none}trix-editor .attachment__caption-editor:focus[data-trix-mutable]::-moz-selection{background:highlight}trix-editor .attachment__caption-editor:focus[data-trix-mutable]::selection{background:highlight}trix-editor [data-trix-mutable].attachment.attachment--file{box-shadow:0 0 0 2px highlight;border-color:transparent}trix-editor [data-trix-mutable].attachment img{box-shadow:0 0 0 2px highlight}trix-editor .attachment{position:relative}trix-editor .attachment:hover{cursor:default}trix-editor .attachment--preview .attachment__caption:hover{cursor:text}trix-editor .attachment__progress{position:absolute;z-index:1;height:20px;top:calc(50% - 10px);left:5%;width:90%;opacity:.9;transition:opacity .2s ease-in}trix-editor .attachment__progress[value="100"]{opacity:0}trix-editor .attachment__caption-editor{display:inline-block;width:100%;margin:0;padding:0;font-size:inherit;font-family:inherit;line-height:inherit;color:inherit;text-align:center;vertical-align:top;border:none;outline:none;-webkit-appearance:none;-moz-appearance:none}trix-editor .attachment__toolbar{position:absolute;z-index:1;top:-.9em;left:0;width:100%;text-align:center}trix-editor .trix-button-group{display:inline-flex}trix-editor .trix-button{position:relative;float:left;color:#666;white-space:nowrap;font-size:80%;padding:0 .8em;margin:0;outline:none;border:none;border-radius:0;background:transparent}trix-editor .trix-button:not(:first-child){border-left:1px solid #ccc}trix-editor .trix-button.trix-active{background:#cbeefa}trix-editor .trix-button:not(:disabled){cursor:pointer}trix-editor .trix-button--remove{text-indent:-9999px;display:inline-block;padding:0;outline:none;width:1.8em;height:1.8em;line-height:1.8em;border-radius:50%;background-color:#fff;border:2px solid highlight;box-shadow:1px 1px 6px #00000040}trix-editor .trix-button--remove:before{display:inline-block;position:absolute;top:0;right:0;bottom:0;left:0;opacity:.7;content:"";background-image:url(data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M19%206.41%2017.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22%2F%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%2F%3E%3C%2Fsvg%3E);background-position:center;background-repeat:no-repeat;background-size:90%}trix-editor .trix-button--remove:hover{border-color:#333}trix-editor .trix-button--remove:hover:before{opacity:1}trix-editor .attachment__metadata-container{position:relative}trix-editor .attachment__metadata{position:absolute;left:50%;top:2em;transform:translate(-50%);max-width:90%;padding:.1em .6em;font-size:.8em;color:#fff;background-color:#000000b3;border-radius:3px}trix-editor .attachment__metadata .attachment__name{display:inline-block;max-width:100%;vertical-align:bottom;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}trix-editor .attachment__metadata .attachment__size{margin-left:.2em;white-space:nowrap}.trix-content{line-height:1.5;overflow-wrap:break-word;word-break:break-word}.trix-content *{box-sizing:border-box;margin:0;padding:0}.trix-content h1{font-size:1.2em;line-height:1.2}.trix-content blockquote{border:0 solid #ccc;border-left-width:.3em;margin-left:.3em;padding-left:.6em}.trix-content [dir=rtl] blockquote,.trix-content blockquote[dir=rtl]{border-width:0;border-right-width:.3em;margin-right:.3em;padding-right:.6em}.trix-content li{margin-left:1em}.trix-content [dir=rtl] li{margin-right:1em}.trix-content pre{display:inline-block;width:100%;vertical-align:top;font-family:monospace;font-size:.9em;padding:.5em;white-space:pre;background-color:#eee;overflow-x:auto}.trix-content img{max-width:100%;height:auto}.trix-content .attachment{display:inline-block;position:relative;max-width:100%}.trix-content .attachment a{color:inherit;text-decoration:none}.trix-content .attachment a:hover,.trix-content .attachment a:visited:hover{color:inherit}.trix-content .attachment__caption{text-align:center}.trix-content .attachment__caption .attachment__name+.attachment__size:before{content:" •"}.trix-content .attachment--preview{width:100%;text-align:center}.trix-content .attachment--preview .attachment__caption{color:#666;font-size:.9em;line-height:1.2}.trix-content .attachment--file{color:#333;line-height:1;margin:0 2px 2px;padding:.4em 1em;border:1px solid #bbb;border-radius:5px}.trix-content .attachment-gallery{display:flex;flex-wrap:wrap;position:relative}.trix-content .attachment-gallery .attachment{flex:1 0 33%;padding:0 .5em;max-width:33%}.trix-content .attachment-gallery.attachment-gallery--2 .attachment,.trix-content .attachment-gallery.attachment-gallery--4 .attachment{flex-basis:50%;max-width:50%}.field-content.svelte-md34ba{max-height:200px;overflow-y:scroll}.logs.svelte-a3cwpi{max-height:70vh;overflow:scroll;background:var(--p90);color:var(--p10);padding:10px} diff --git a/public/vendor/lucent/dist/manifest.json b/public/vendor/lucent/dist/manifest.json new file mode 100755 index 0000000..6f8e15c --- /dev/null +++ b/public/vendor/lucent/dist/manifest.json @@ -0,0 +1,11 @@ +{ + "main.js": { + "file": "assets/main-BJyanQ7P.js", + "name": "main", + "src": "main.js", + "isEntry": true, + "css": [ + "assets/main-Dk7njt4m.css" + ] + } +} \ No newline at end of file diff --git a/public/vendor/lucent/public/art.jpg b/public/vendor/lucent/public/art.jpg new file mode 100755 index 0000000..f4c59aa Binary files /dev/null and b/public/vendor/lucent/public/art.jpg differ diff --git a/public/vendor/lucent/public/moon.jpg b/public/vendor/lucent/public/moon.jpg new file mode 100755 index 0000000..f48ca0d Binary files /dev/null and b/public/vendor/lucent/public/moon.jpg differ diff --git a/public/vendor/lucent/public/spinner.svg b/public/vendor/lucent/public/spinner.svg new file mode 100755 index 0000000..76a3b2f --- /dev/null +++ b/public/vendor/lucent/public/spinner.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/dist/assets/main-B5jYqaDF.css b/resources/dist/assets/main-B5jYqaDF.css new file mode 100755 index 0000000..e676611 --- /dev/null +++ b/resources/dist/assets/main-B5jYqaDF.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Figtree,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.-bottom-16{bottom:-4rem}.-left-16{left:-4rem}.-left-20{left:-5rem}.right-0{right:0}.top-0{top:0}.z-0{z-index:0}.z-10{z-index:10}.\!row-span-1{grid-row:span 1 / span 1!important}.-mx-3{margin-left:-.75rem;margin-right:-.75rem}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-3{margin-top:.75rem;margin-bottom:.75rem}.-ml-px{margin-left:-1px}.-mt-2{margin-top:-.5rem}.-mt-px{margin-top:-1px}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.ml-1{margin-left:.25rem}.ml-12{margin-left:3rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.\!hidden{display:none!important}.hidden{display:none}.aspect-video{aspect-ratio:16 / 9}.size-12{width:3rem;height:3rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-\[32\.5rem\]{height:32.5rem}.h-\[35\.5rem\]{height:35.5rem}.h-full{height:100%}.max-h-32{max-height:8rem}.min-h-screen{min-height:100vh}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-\[8rem\]{width:8rem}.w-\[calc\(100\%\+8rem\)\]{width:calc(100% + 8rem)}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-2xl{max-width:42rem}.max-w-6xl{max-width:72rem}.max-w-\[877px\]{max-width:877px}.max-w-full{max-width:100%}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.origin-top-right{transform-origin:top right}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\!flex-row{flex-direction:row!important}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-items-center{justify-items:center}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-hidden{overflow-y:hidden}.overflow-x-scroll{overflow-x:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-\[10px\]{border-radius:10px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-l-md{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.border{border-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-l-red-500{--tw-border-opacity: 1;border-left-color:rgb(239 68 68 / var(--tw-border-opacity))}.bg-\[\#FF2D20\]\/10{background-color:#ff2d201a}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.bg-gray-200\/80{background-color:#e5e7ebcc}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-red-500\/20{background-color:#ef444433}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-white{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #fff var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-white{--tw-gradient-to: #fff var(--tw-gradient-to-position)}.to-zinc-900{--tw-gradient-to: #18181b var(--tw-gradient-to-position)}.fill-red-500{fill:#ef4444}.stroke-\[\#FF2D20\]{stroke:#ff2d20}.object-cover{-o-object-fit:cover;object-fit:cover}.object-top{-o-object-position:top;object-position:top}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-12{padding-bottom:3rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:Figtree,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-sm\/relaxed{font-size:.875rem;line-height:1.625}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-5{line-height:1.25rem}.leading-7{line-height:1.75rem}.tracking-wider{letter-spacing:.05em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-black\/50{color:#00000080}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0px_14px_34px_0px_rgba\(0\,0\,0\,0\.08\)\]{--tw-shadow: 0px 14px 34px 0px rgba(0,0,0,.08);--tw-shadow-colored: 0px 14px 34px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-black{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity))}.ring-gray-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.ring-gray-900\/5{--tw-ring-color: rgb(17 24 39 / .05)}.ring-transparent{--tw-ring-color: transparent}.ring-white{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity))}.ring-white\/\[0\.05\]{--tw-ring-color: rgb(255 255 255 / .05)}.drop-shadow-\[0px_4px_34px_rgba\(0\,0\,0\,0\.06\)\]{--tw-drop-shadow: drop-shadow(0px 4px 34px rgba(0,0,0,.06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-\[0px_4px_34px_rgba\(0\,0\,0\,0\.25\)\]{--tw-drop-shadow: drop-shadow(0px 4px 34px rgba(0,0,0,.25));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.selection\:bg-\[\#FF2D20\] *::-moz-selection{--tw-bg-opacity: 1;background-color:rgb(255 45 32 / var(--tw-bg-opacity))}.selection\:bg-\[\#FF2D20\] *::selection{--tw-bg-opacity: 1;background-color:rgb(255 45 32 / var(--tw-bg-opacity))}.selection\:text-white *::-moz-selection{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.selection\:text-white *::selection{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.selection\:bg-\[\#FF2D20\]::-moz-selection{--tw-bg-opacity: 1;background-color:rgb(255 45 32 / var(--tw-bg-opacity))}.selection\:bg-\[\#FF2D20\]::selection{--tw-bg-opacity: 1;background-color:rgb(255 45 32 / var(--tw-bg-opacity))}.selection\:text-white::-moz-selection{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.selection\:text-white::selection{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.default\:col-span-full:default{grid-column:1 / -1}.default\:row-span-1:default{grid-row:span 1 / span 1}.hover\:rounded-b-md:hover{border-bottom-right-radius:.375rem;border-bottom-left-radius:.375rem}.hover\:rounded-t-md:hover{border-top-left-radius:.375rem;border-top-right-radius:.375rem}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\:bg-gray-100\/75:hover{background-color:#f3f4f6bf}.hover\:text-black:hover{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.hover\:text-black\/70:hover{color:#000000b3}.hover\:text-gray-400:hover{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.hover\:text-gray-500:hover{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:ring-black\/20:hover{--tw-ring-color: rgb(0 0 0 / .2)}.focus\:z-10:focus{z-index:10}.focus\:border-blue-300:focus{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity))}.focus\:text-gray-500:focus{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-\[\#FF2D20\]:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 45 32 / var(--tw-ring-opacity))}.active\:bg-gray-100:active{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.active\:text-gray-500:active{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.active\:text-gray-700:active{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\:col-span-1{grid-column:span 1 / span 1}.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:mt-10{margin-top:2.5rem}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:size-16{width:4rem;height:4rem}.sm\:size-6{width:1.5rem;height:1.5rem}.sm\:flex-1{flex:1 1 0%}.sm\:items-center{align-items:center}.sm\:justify-start{justify-content:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:gap-6{gap:1.5rem}.sm\:p-12{padding:3rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-5{padding-top:1.25rem;padding-bottom:1.25rem}.sm\:pt-0{padding-top:0}.sm\:pt-5{padding-top:1.25rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}}@media (min-width: 768px){.md\:row-span-3{grid-row:span 3 / span 3}.md\:block{display:block}.md\:inline{display:inline}.md\:flex{display:flex}.md\:hidden{display:none}.md\:min-w-64{min-width:16rem}.md\:max-w-80{max-width:20rem}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:gap-2{gap:.5rem}}@media (min-width: 1024px){.lg\:col-start-2{grid-column-start:2}.lg\:block{display:block}.lg\:inline-block{display:inline-block}.lg\:h-16{height:4rem}.lg\:w-\[12rem\]{width:12rem}.lg\:max-w-7xl{max-width:80rem}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:flex-col{flex-direction:column}.lg\:items-end{align-items:flex-end}.lg\:justify-center{justify-content:center}.lg\:gap-8{gap:2rem}.lg\:p-10{padding:2.5rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:pb-10{padding-bottom:2.5rem}.lg\:pt-0{padding-top:0}.lg\:text-2xl{font-size:1.5rem;line-height:2rem}.lg\:text-base{font-size:1rem;line-height:1.5rem}.lg\:text-sm{font-size:.875rem;line-height:1.25rem}.lg\:text-\[\#FF2D20\]{--tw-text-opacity: 1;color:rgb(255 45 32 / var(--tw-text-opacity))}.default\:lg\:col-span-6:default{grid-column:span 6 / span 6}}.rtl\:flex-row-reverse:where([dir=rtl],[dir=rtl] *){flex-direction:row-reverse}@media (prefers-color-scheme: dark){.dark\:block{display:block}.dark\:hidden{display:none}.dark\:border{border-width:1px}.dark\:border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.dark\:border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.dark\:border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity))}.dark\:border-gray-900{--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity))}.dark\:border-l-red-500{--tw-border-opacity: 1;border-left-color:rgb(239 68 68 / var(--tw-border-opacity))}.dark\:bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.dark\:bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.dark\:bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.dark\:bg-gray-900\/80{background-color:#111827cc}.dark\:bg-gray-950\/95{background-color:#030712f2}.dark\:bg-red-500\/20{background-color:#ef444433}.dark\:bg-zinc-900{--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity))}.dark\:via-zinc-900{--tw-gradient-to: rgb(24 24 27 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #18181b var(--tw-gradient-via-position), var(--tw-gradient-to)}.dark\:to-zinc-900{--tw-gradient-to: #18181b var(--tw-gradient-to-position)}.dark\:text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity))}.dark\:text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.dark\:text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.dark\:text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.dark\:text-gray-950{--tw-text-opacity: 1;color:rgb(3 7 18 / var(--tw-text-opacity))}.dark\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:text-white\/50{color:#ffffff80}.dark\:text-white\/70{color:#ffffffb3}.dark\:ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.dark\:ring-gray-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity))}.dark\:ring-zinc-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(39 39 42 / var(--tw-ring-opacity))}.dark\:hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.dark\:hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.dark\:hover\:bg-gray-800\/75:hover{background-color:#1f2937bf}.dark\:hover\:text-gray-300:hover{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.dark\:hover\:text-gray-500:hover{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.dark\:hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:hover\:text-white\/70:hover{color:#ffffffb3}.dark\:hover\:text-white\/80:hover{color:#fffc}.dark\:hover\:ring-zinc-700:hover{--tw-ring-opacity: 1;--tw-ring-color: rgb(63 63 70 / var(--tw-ring-opacity))}.dark\:focus\:border-blue-700:focus{--tw-border-opacity: 1;border-color:rgb(29 78 216 / var(--tw-border-opacity))}.dark\:focus\:border-blue-800:focus{--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity))}.dark\:focus\:text-gray-500:focus{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.dark\:focus-visible\:ring-\[\#FF2D20\]:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 45 32 / var(--tw-ring-opacity))}.dark\:focus-visible\:ring-white:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity))}.dark\:active\:bg-gray-700:active{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.dark\:active\:text-gray-300:active{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}} diff --git a/resources/dist/assets/main-CgZyxSqq.js b/resources/dist/assets/main-CgZyxSqq.js new file mode 100755 index 0000000..9af1f51 --- /dev/null +++ b/resources/dist/assets/main-CgZyxSqq.js @@ -0,0 +1,6 @@ +function pt(e,t){return function(){return e.apply(t,arguments)}}const{toString:tn}=Object.prototype,{getPrototypeOf:Ie}=Object,we=(e=>t=>{const n=tn.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),F=e=>(e=e.toLowerCase(),t=>we(t)===e),Ee=e=>t=>typeof t===e,{isArray:V}=Array,Z=Ee("undefined");function nn(e){return e!==null&&!Z(e)&&e.constructor!==null&&!Z(e.constructor)&&C(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ht=F("ArrayBuffer");function rn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ht(e.buffer),t}const sn=Ee("string"),C=Ee("function"),mt=Ee("number"),be=e=>e!==null&&typeof e=="object",on=e=>e===!0||e===!1,ce=e=>{if(we(e)!=="object")return!1;const t=Ie(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},an=F("Date"),ln=F("File"),un=F("Blob"),cn=F("FileList"),fn=e=>be(e)&&C(e.pipe),dn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||C(e.append)&&((t=we(e))==="formdata"||t==="object"&&C(e.toString)&&e.toString()==="[object FormData]"))},pn=F("URLSearchParams"),[hn,mn,yn,_n]=["ReadableStream","Request","Response","Headers"].map(F),wn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function te(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),V(e))for(r=0,s=e.length;r0;)if(s=n[r],t===s.toLowerCase())return s;return null}const q=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,_t=e=>!Z(e)&&e!==q;function Pe(){const{caseless:e}=_t(this)&&this||{},t={},n=(r,s)=>{const o=e&&yt(t,s)||s;ce(t[o])&&ce(r)?t[o]=Pe(t[o],r):ce(r)?t[o]=Pe({},r):V(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r(te(t,(s,o)=>{n&&C(s)?e[o]=pt(s,n):e[o]=s},{allOwnKeys:r}),e),bn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),gn=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Rn=(e,t,n,r)=>{let s,o,i;const l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!l[i]&&(t[i]=e[i],l[i]=!0);e=n!==!1&&Ie(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Sn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},vn=e=>{if(!e)return null;if(V(e))return e;let t=e.length;if(!mt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Tn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ie(Uint8Array)),On=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},An=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},xn=F("HTMLFormElement"),Cn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ye=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Nn=F("RegExp"),wt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};te(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},Pn=e=>{wt(e,(t,n)=>{if(C(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(C(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Fn=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return V(e)?r(e):r(String(e).split(t)),n},Dn=()=>{},Ln=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Oe="abcdefghijklmnopqrstuvwxyz",Qe="0123456789",Et={DIGIT:Qe,ALPHA:Oe,ALPHA_DIGIT:Oe+Oe.toUpperCase()+Qe},Bn=(e=16,t=Et.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function kn(e){return!!(e&&C(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Un=e=>{const t=new Array(10),n=(r,s)=>{if(be(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=V(r)?[]:{};return te(r,(i,l)=>{const f=n(i,s+1);!Z(f)&&(o[l]=f)}),t[s]=void 0,o}}return r};return n(e,0)},qn=F("AsyncFunction"),jn=e=>e&&(be(e)||C(e))&&C(e.then)&&C(e.catch),bt=((e,t)=>e?setImmediate:t?((n,r)=>(q.addEventListener("message",({source:s,data:o})=>{s===q&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),q.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",C(q.postMessage)),In=typeof queueMicrotask<"u"?queueMicrotask.bind(q):typeof process<"u"&&process.nextTick||bt,a={isArray:V,isArrayBuffer:ht,isBuffer:nn,isFormData:dn,isArrayBufferView:rn,isString:sn,isNumber:mt,isBoolean:on,isObject:be,isPlainObject:ce,isReadableStream:hn,isRequest:mn,isResponse:yn,isHeaders:_n,isUndefined:Z,isDate:an,isFile:ln,isBlob:un,isRegExp:Nn,isFunction:C,isStream:fn,isURLSearchParams:pn,isTypedArray:Tn,isFileList:cn,forEach:te,merge:Pe,extend:En,trim:wn,stripBOM:bn,inherits:gn,toFlatObject:Rn,kindOf:we,kindOfTest:F,endsWith:Sn,toArray:vn,forEachEntry:On,matchAll:An,isHTMLForm:xn,hasOwnProperty:Ye,hasOwnProp:Ye,reduceDescriptors:wt,freezeMethods:Pn,toObjectSet:Fn,toCamelCase:Cn,noop:Dn,toFiniteNumber:Ln,findKey:yt,global:q,isContextDefined:_t,ALPHABET:Et,generateString:Bn,isSpecCompliantForm:kn,toJSONObject:Un,isAsyncFn:qn,isThenable:jn,setImmediate:bt,asap:In};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const gt=y.prototype,Rt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Rt[e]={value:e}});Object.defineProperties(y,Rt);Object.defineProperty(gt,"isAxiosError",{value:!0});y.from=(e,t,n,r,s,o)=>{const i=Object.create(gt);return a.toFlatObject(e,i,function(f){return f!==Error.prototype},l=>l!=="isAxiosError"),y.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const Hn=null;function Fe(e){return a.isPlainObject(e)||a.isArray(e)}function St(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ze(e,t,n){return e?e.concat(t).map(function(s,o){return s=St(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function Mn(e){return a.isArray(e)&&!e.some(Fe)}const zn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ge(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!a.isUndefined(h[m])});const r=n.metaTokens,s=n.visitor||u,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(a.isDate(p))return p.toISOString();if(!f&&a.isBlob(p))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(p)||a.isTypedArray(p)?f&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,h){let E=p;if(p&&!h&&typeof p=="object"){if(a.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(a.isArray(p)&&Mn(p)||(a.isFileList(p)||a.endsWith(m,"[]"))&&(E=a.toArray(p)))return m=St(m),E.forEach(function(R,D){!(a.isUndefined(R)||R===null)&&t.append(i===!0?Ze([m],D,o):i===null?m:m+"[]",c(R))}),!1}return Fe(p)?!0:(t.append(Ze(h,m,o),c(p)),!1)}const d=[],_=Object.assign(zn,{defaultVisitor:u,convertValue:c,isVisitable:Fe});function w(p,m){if(!a.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),a.forEach(p,function(E,g){(!(a.isUndefined(E)||E===null)&&s.call(t,E,a.isString(g)?g.trim():g,m,_))===!0&&w(E,m?m.concat(g):[g])}),d.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return w(e),t}function et(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function He(e,t){this._pairs=[],e&&ge(e,this,t)}const vt=He.prototype;vt.append=function(t,n){this._pairs.push([t,n])};vt.toString=function(t){const n=t?function(r){return t.call(this,r,et)}:et;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Jn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Tt(e,t,n){if(!t)return e;const r=n&&n.encode||Jn,s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new He(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class tt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ot={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Vn=typeof URLSearchParams<"u"?URLSearchParams:He,Wn=typeof FormData<"u"?FormData:null,Kn=typeof Blob<"u"?Blob:null,$n={isBrowser:!0,classes:{URLSearchParams:Vn,FormData:Wn,Blob:Kn},protocols:["http","https","file","blob","url","data"]},Me=typeof window<"u"&&typeof document<"u",De=typeof navigator=="object"&&navigator||void 0,Xn=Me&&(!De||["ReactNative","NativeScript","NS"].indexOf(De.product)<0),Gn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Yn=Me&&window.location.href||"http://localhost",Qn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Me,hasStandardBrowserEnv:Xn,hasStandardBrowserWebWorkerEnv:Gn,navigator:De,origin:Yn},Symbol.toStringTag,{value:"Module"})),O={...Qn,...$n};function Zn(e,t){return ge(e,new O.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return O.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function er(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function tr(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!l):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=tr(s[i])),!l)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(er(r),s,n,0)}),n}return null}function nr(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const ne={transitional:Ot,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(At(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Zn(t,this.formSerializer).toString();if((l=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return ge(l?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),nr(t)):t}],transformResponse:[function(t){const n=this.transitional||ne.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(l){if(i)throw l.name==="SyntaxError"?y.from(l,y.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:O.classes.FormData,Blob:O.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{ne.headers[e]={}});const rr=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),sr=e=>{const t={};let n,r,s;return e&&e.split(` +`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&rr[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},nt=Symbol("internals");function K(e){return e&&String(e).trim().toLowerCase()}function fe(e){return e===!1||e==null?e:a.isArray(e)?e.map(fe):String(e)}function or(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const ir=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ae(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function ar(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function lr(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}class A{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(l,f,c){const u=K(f);if(!u)throw new Error("header name must be a non-empty string");const d=a.findKey(s,u);(!d||s[d]===void 0||c===!0||c===void 0&&s[d]!==!1)&&(s[d||f]=fe(l))}const i=(l,f)=>a.forEach(l,(c,u)=>o(c,u,f));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!ir(t))i(sr(t),n);else if(a.isHeaders(t))for(const[l,f]of t.entries())o(f,l,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=K(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return or(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=K(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Ae(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=K(i),i){const l=a.findKey(r,i);l&&(!n||Ae(r,r[l],l,n))&&(delete r[l],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||Ae(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=fe(s),delete n[o];return}const l=t?ar(o):String(o).trim();l!==o&&delete n[o],n[l]=fe(s),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[nt]=this[nt]={accessors:{}}).accessors,s=this.prototype;function o(i){const l=K(i);r[l]||(lr(s,i),r[l]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}}A.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(A.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(A);function xe(e,t){const n=this||ne,r=t||n,s=A.from(r.headers);let o=r.data;return a.forEach(e,function(l){o=l.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function xt(e){return!!(e&&e.__CANCEL__)}function W(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(W,y,{__CANCEL__:!0});function Ct(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ur(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function cr(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const c=Date.now(),u=r[o];i||(i=c),n[s]=f,r[s]=c;let d=o,_=0;for(;d!==s;)_+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),c-i{n=u,s=null,o&&(clearTimeout(o),o=null),e.apply(null,c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=r?i(c,u):(s=c,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const de=(e,t,n=3)=>{let r=0;const s=cr(50,250);return fr(o=>{const i=o.loaded,l=o.lengthComputable?o.total:void 0,f=i-r,c=s(f),u=i<=l;r=i;const d={loaded:i,total:l,progress:l?i/l:void 0,bytes:f,rate:c||void 0,estimated:c&&l&&u?(l-i)/c:void 0,event:o,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(d)},n)},rt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},st=e=>(...t)=>a.asap(()=>e(...t)),dr=O.hasStandardBrowserEnv?function(){const t=O.navigator&&/(msie|trident)/i.test(O.navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const l=a.isString(i)?s(i):i;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}(),pr=O.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(r)&&i.push("path="+r),a.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function hr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function mr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Nt(e,t){return e&&!hr(t)?mr(e,t):t}const ot=e=>e instanceof A?{...e}:e;function I(e,t){t=t||{};const n={};function r(c,u,d){return a.isPlainObject(c)&&a.isPlainObject(u)?a.merge.call({caseless:d},c,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(c,u,d){if(a.isUndefined(u)){if(!a.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function o(c,u){if(!a.isUndefined(u))return r(void 0,u)}function i(c,u){if(a.isUndefined(u)){if(!a.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function l(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(c,u)=>s(ot(c),ot(u),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=f[u]||s,_=d(e[u],t[u],u);a.isUndefined(_)&&d!==l||(n[u]=_)}),n}const Pt=e=>{const t=I({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:l}=t;t.headers=i=A.from(i),t.url=Tt(Nt(t.baseURL,t.url),e.params,e.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let f;if(a.isFormData(n)){if(O.hasStandardBrowserEnv||O.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[c,...u]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([c||"multipart/form-data",...u].join("; "))}}if(O.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&dr(t.url))){const c=s&&o&&pr.read(o);c&&i.set(s,c)}return t},yr=typeof XMLHttpRequest<"u",_r=yr&&function(e){return new Promise(function(n,r){const s=Pt(e);let o=s.data;const i=A.from(s.headers).normalize();let{responseType:l,onUploadProgress:f,onDownloadProgress:c}=s,u,d,_,w,p;function m(){w&&w(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function E(){if(!h)return;const R=A.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),v={data:!l||l==="text"||l==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:R,config:e,request:h};Ct(function(U){n(U),m()},function(U){r(U),m()},v),h=null}"onloadend"in h?h.onloadend=E:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(E)},h.onabort=function(){h&&(r(new y("Request aborted",y.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new y("Network Error",y.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let D=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const v=s.transitional||Ot;s.timeoutErrorMessage&&(D=s.timeoutErrorMessage),r(new y(D,v.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&a.forEach(i.toJSON(),function(D,v){h.setRequestHeader(v,D)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),l&&l!=="json"&&(h.responseType=s.responseType),c&&([_,p]=de(c,!0),h.addEventListener("progress",_)),f&&h.upload&&([d,w]=de(f),h.upload.addEventListener("progress",d),h.upload.addEventListener("loadend",w)),(s.cancelToken||s.signal)&&(u=R=>{h&&(r(!R||R.type?new W(null,e,h):R),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const g=ur(s.url);if(g&&O.protocols.indexOf(g)===-1){r(new y("Unsupported protocol "+g+":",y.ERR_BAD_REQUEST,e));return}h.send(o||null)})},wr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(c){if(!s){s=!0,l();const u=c instanceof Error?c:this.reason;r.abort(u instanceof y?u:new W(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,o(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const l=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(o):c.removeEventListener("abort",o)}),e=null)};e.forEach(c=>c.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>a.asap(l),f}},Er=function*(e,t){let n=e.byteLength;if(n{const s=br(e,t);let o=0,i,l=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:c,value:u}=await s.next();if(c){l(),f.close();return}let d=u.byteLength;if(n){let _=o+=d;n(_)}f.enqueue(new Uint8Array(u))}catch(c){throw l(c),c}},cancel(f){return l(f),s.return()}},{highWaterMark:2})},Re=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ft=Re&&typeof ReadableStream=="function",Rr=Re&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Dt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Sr=Ft&&Dt(()=>{let e=!1;const t=new Request(O.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),at=64*1024,Le=Ft&&Dt(()=>a.isReadableStream(new Response("").body)),pe={stream:Le&&(e=>e.body)};Re&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!pe[t]&&(pe[t]=a.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new y(`Response type '${t}' is not supported`,y.ERR_NOT_SUPPORT,r)})})})(new Response);const vr=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(O.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await Rr(e)).byteLength},Tr=async(e,t)=>{const n=a.toFiniteNumber(e.getContentLength());return n??vr(t)},Or=Re&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:l,onUploadProgress:f,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:_}=Pt(e);c=c?(c+"").toLowerCase():"text";let w=wr([s,o&&o.toAbortSignal()],i),p;const m=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let h;try{if(f&&Sr&&n!=="get"&&n!=="head"&&(h=await Tr(u,r))!==0){let v=new Request(t,{method:"POST",body:r,duplex:"half"}),L;if(a.isFormData(r)&&(L=v.headers.get("content-type"))&&u.setContentType(L),v.body){const[U,ae]=rt(h,de(st(f)));r=it(v.body,at,U,ae)}}a.isString(d)||(d=d?"include":"omit");const E="credentials"in Request.prototype;p=new Request(t,{..._,signal:w,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:E?d:void 0});let g=await fetch(p);const R=Le&&(c==="stream"||c==="response");if(Le&&(l||R&&m)){const v={};["status","statusText","headers"].forEach(Ge=>{v[Ge]=g[Ge]});const L=a.toFiniteNumber(g.headers.get("content-length")),[U,ae]=l&&rt(L,de(st(l),!0))||[];g=new Response(it(g.body,at,U,()=>{ae&&ae(),m&&m()}),v)}c=c||"text";let D=await pe[a.findKey(pe,c)||"text"](g,e);return!R&&m&&m(),await new Promise((v,L)=>{Ct(v,L,{data:D,headers:A.from(g.headers),status:g.status,statusText:g.statusText,config:e,request:p})})}catch(E){throw m&&m(),E&&E.name==="TypeError"&&/fetch/i.test(E.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,e,p),{cause:E.cause||E}):y.from(E,E&&E.code,e,p)}}),Be={http:Hn,xhr:_r,fetch:Or};a.forEach(Be,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const lt=e=>`- ${e}`,Ar=e=>a.isFunction(e)||e===null||e===!1,Lt={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o`adapter ${l} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since : +`+o.map(lt).join(` +`):" "+lt(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:Be};function Ce(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new W(null,e)}function ut(e){return Ce(e),e.headers=A.from(e.headers),e.data=xe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Lt.getAdapter(e.adapter||ne.adapter)(e).then(function(r){return Ce(e),r.data=xe.call(e,e.transformResponse,r),r.headers=A.from(r.headers),r},function(r){return xt(r)||(Ce(e),r&&r.response&&(r.response.data=xe.call(e,e.transformResponse,r.response),r.response.headers=A.from(r.response.headers))),Promise.reject(r)})}const Bt="1.7.7",ze={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ze[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ct={};ze.transitional=function(t,n,r){function s(o,i){return"[Axios v"+Bt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,l)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!ct[i]&&(ct[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,l):!0}};function xr(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const l=e[o],f=l===void 0||i(l,o,e);if(f!==!0)throw new y("option "+o+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const ke={assertOptions:xr,validators:ze},B=ke.validators;class j{constructor(t){this.defaults=t,this.interceptors={request:new tt,response:new tt}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=I(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ke.assertOptions(r,{silentJSONParsing:B.transitional(B.boolean),forcedJSONParsing:B.transitional(B.boolean),clarifyTimeoutError:B.transitional(B.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ke.assertOptions(s,{encode:B.function,serialize:B.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=A.concat(i,o);const l=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,_;if(!f){const p=[ut.bind(this),void 0];for(p.unshift.apply(p,l),p.push.apply(p,c),_=p.length,u=Promise.resolve(n);d<_;)u=u.then(p[d++],p[d++]);return u}_=l.length;let w=n;for(d=0;d<_;){const p=l[d++],m=l[d++];try{w=p(w)}catch(h){m.call(this,h);break}}try{u=ut.call(this,w)}catch(p){return Promise.reject(p)}for(d=0,_=c.length;d<_;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=I(this.defaults,t);const n=Nt(t.baseURL,t.url);return Tt(n,t.params,t.paramsSerializer)}}a.forEach(["delete","get","head","options"],function(t){j.prototype[t]=function(n,r){return this.request(I(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,l){return this.request(I(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}j.prototype[t]=n(),j.prototype[t+"Form"]=n(!0)});class Je{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(l=>{r.subscribe(l),o=l}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,l){r.reason||(r.reason=new W(o,i,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Je(function(s){t=s}),cancel:t}}}function Cr(e){return function(n){return e.apply(null,n)}}function Nr(e){return a.isObject(e)&&e.isAxiosError===!0}const Ue={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ue).forEach(([e,t])=>{Ue[t]=e});function kt(e){const t=new j(e),n=pt(j.prototype.request,t);return a.extend(n,j.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return kt(I(e,s))},n}const b=kt(ne);b.Axios=j;b.CanceledError=W;b.CancelToken=Je;b.isCancel=xt;b.VERSION=Bt;b.toFormData=ge;b.AxiosError=y;b.Cancel=b.CanceledError;b.all=function(t){return Promise.all(t)};b.spread=Cr;b.isAxiosError=Nr;b.mergeConfig=I;b.AxiosHeaders=A;b.formToJSON=e=>At(a.isHTMLForm(e)?new FormData(e):e);b.getAdapter=Lt.getAdapter;b.HttpStatusCode=Ue;b.default=b;loadHtmxFormsBehaviour();window.axios=b;const Pr=b;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.axios.interceptors.request.use(function(e){let t;t=document.querySelectorAll(".btn-spinner");for(let n=0;n{ie(e)})}function Zr(e,t){var n=e.length;if(n>0){var r=()=>--n||t();for(var s of e)s.out(r)}else t()}function Xt(e,t,n){if(!(e.f&me)){if(e.f^=me,e.transitions!==null)for(const i of e.transitions)(i.is_global||n)&&t.push(i);for(var r=e.first;r!==null;){var s=r.next,o=(r.f&qt)!==0||(r.f&k)!==0;Xt(r,t,o?n:!1),r=s}}}let ye=!1,z=!1;function ft(e){z=e}let je=[],X=0;let N=null;function dt(e){N=e}let S=null;function _e(e){S=e}let G=null,T=null,x=0,Y=null,Gt=0,M=!1,Q=null;function es(){return++Gt}function Te(e){var i,l;var t=e.f;if(t&se)return!0;if(t&ve){var n=e.deps,r=(t&re)!==0;if(n!==null){var s;if(t&he){for(s=0;se.version)return!0}}r||H(e,P)}return!1}function ts(e,t,n){throw e}function Yt(e){var _;var t=T,n=x,r=Y,s=N,o=M,i=G,l=Q,f=e.f;T=null,x=0,Y=null,N=f&(k|Se)?null:e,M=!z&&(f&re)!==0,G=null,Q=e.ctx;try{var c=(0,e.fn)(),u=e.deps;if(T!==null){var d;if(ee(e,x),u!==null&&x>0)for(u.length=x+T.length,d=0;d1e3&&(X=0,Jr()),X++}function ss(e){var t=e.length;if(t!==0){rs();var n=z;z=!0;try{for(var r=0;r1001)return;const e=je;je=[],ss(e),ye||(X=0)}function as(e){ye||(ye=!0,queueMicrotask(is));for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(n&(Se|k)){if(!(n&P))return;t.f^=P}}je.push(t)}function Qt(e,t){var n=e.first,r=[];e:for(;n!==null;){var s=n.f,o=(s&k)!==0,i=o&&(s&P)!==0;if(!i&&!(s&me))if(s&Ve){o?n.f^=P:Te(n)&&Ke(n);var l=n.first;if(l!==null){n=l;continue}}else s&Ur&&r.push(n);var f=n.next;if(f===null){let d=n.parent;for(;d!==null;){if(e===d)break e;var c=d.next;if(c!==null){n=c;continue e}d=d.parent}}n=f}for(var u=0;u");return()=>{r===void 0&&(r=ys(s?e:""+e));var o=n?document.importNode(r,!0):r.cloneNode(!0);{var i=$e(o),l=o.lastChild;Zt(i,l)}return o}}function ws(e=""){{var t=ds(e+"");return Zt(t,t),t}}function en(e,t){e!==null&&e.before(t)}function Es(e,t,n){var r=e,s,o;Xr(()=>{s!==(s=t())&&(o&&(Qr(o),o=null),s&&(o=Gr(()=>n(r,s))))},qt)}let le=!1;function bs(e){var t=le;try{return le=!1,[e(),le]}finally{le=t}}const gs={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if($(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let s=e.props[r];$(s)&&(s=s());const o=qe(s,t);if(o&&o.set)return o.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if($(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r){const s=qe(r,t);return s&&!s.configurable&&(s.configurable=!0),s}}},has(e,t){for(let n of e.props)if($(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props){$(n)&&(n=n());for(const r in n)t.includes(r)||t.push(r)}return t}};function Rs(...e){return new Proxy({props:e},gs)}function Ss(e){for(var t=S,n=S;t!==null&&!(t.f&(k|Se));)t=t.parent;try{return _e(t),e()}finally{_e(n)}}function Ne(e,t,n,r){var p;var s=(n&Dr)!==0,o=(n&Lr)!==0,i=!1,l;[l,i]=bs(()=>e[t]);var f=(p=qe(e,t))==null?void 0:p.set,c=r,u=!0,d=()=>(u&&(u=!1,c=r),c);l===void 0&&r!==void 0&&(f&&o&&Vr(),l=d(),f&&f(l));var _;{var w=Ss(()=>(s?It:Kr)(()=>e[t]));w.f|=jr,_=()=>{var m=ls(w);return m!==void 0&&(c=void 0),m===void 0?c:m}}return _}function vs(e){var t=ws("hiii");en(e,t)}var Ts=_s('
    ',1);function Os(e,t){const n={landing:vs};let r=Ne(t,"title",8),s=Ne(t,"view",8),o=Ne(t,"data",8);var i=Ts(),l=ms(hs(i),2),f=ps(l);Es(f,()=>n[s()],(c,u)=>{u(c,Rs({get title(){return r()}},o))}),en(e,i)}const As={homepage:Os};let ue=[],xs=function(){ue.map(n=>n.$destroy()),ue=[];const e=document.body.querySelectorAll(".hive-component");if(e.length===0)return;const t=function(n){const r=n.attributes["data-layout"].value,[s,o]=Object.entries(As).find(([c,u])=>r===c);if(!o)return[];const i=document.getElementById("json-"+r).innerHTML,l=JSON.parse(i);l.axios=Pr;const f={target:n,props:l};ue=[...ue,new o(f)]};Array.from(e).map(t)};document.addEventListener("DOMContentLoaded",xs); diff --git a/resources/dist/manifest.json b/resources/dist/manifest.json new file mode 100755 index 0000000..dd5cdf0 --- /dev/null +++ b/resources/dist/manifest.json @@ -0,0 +1,11 @@ +{ + "main.js": { + "file": "assets/main-CgZyxSqq.js", + "name": "main", + "src": "main.js", + "isEntry": true, + "css": [ + "assets/main-B5jYqaDF.css" + ] + } +} \ No newline at end of file diff --git a/resources/js/Welcome.svelte b/resources/js/Welcome.svelte new file mode 100755 index 0000000..09a7a3a --- /dev/null +++ b/resources/js/Welcome.svelte @@ -0,0 +1,10 @@ + + +
    +
    + {@html footer.text} +
    +
    diff --git a/resources/js/app.js b/resources/js/app.js new file mode 100755 index 0000000..cd8634e --- /dev/null +++ b/resources/js/app.js @@ -0,0 +1 @@ +import '../../node_modules/trix/dist/trix.esm' diff --git a/resources/js/main.js b/resources/js/main.js new file mode 100755 index 0000000..e69de29 diff --git a/resources/sass/app.scss b/resources/sass/app.scss new file mode 100755 index 0000000..a4e8a19 --- /dev/null +++ b/resources/sass/app.scss @@ -0,0 +1,82 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@import 'variables.scss'; +@import 'menu.scss'; +@import 'login.scss'; +@import 'inputs.scss'; +@import 'texts.scss'; +@import 'buttons.scss'; +@import 'dashboard.scss'; +@import 'trix.scss'; + +html{ + font-family: "Fira Mono", serif; + background-color: $yellow; +} + +body { + display: flex; + flex-wrap: nowrap; +} + +a { + font-weight: bold; + font-size: large; + color: $grey-dark; +} + +main{ + width: 100%; + padding: 25px; +} + +.container { + color: $grey-dark; + background-color: white; + display: block; + width: 100%; + height: 100%; + border-radius: 25px; + outline: 0px solid; + padding: 1rem; +} + +.flex{ + display: flex; + + &--end { + justify-content: flex-end; + } + + &.column { + flex-direction: column; + } +} + +.inline{ + display: inline-flex; +} + +.center { + align-items: center; +} + + +.right{ + float: right; +} + +.circle{ + border-radius: 30px; + outline: 2px solid $yellow; + height: 25px; + width: 25px; + background-color:$grey-dark; + +} + +.none{ + display: none; +} \ No newline at end of file diff --git a/resources/sass/buttons.scss b/resources/sass/buttons.scss new file mode 100755 index 0000000..b825e24 --- /dev/null +++ b/resources/sass/buttons.scss @@ -0,0 +1,50 @@ +button, +a { + &.primary { + background-color: $yellow; + color: $grey-dark; + padding: 5px; + border-radius: 10px; + border: 2px solid transparent; + + &:hover { + border: 2px solid $grey-dark; + } + + &:active { + border: 2px solid $grey-dark; + background-color: $grey-dark; + color: $yellow; + img { + content: url("../../public/images/honeycomb-yellow.png"); + } + } + + &-outlined { + background-color: $grey-dark; + color: $yellow; + padding: 5px; + border-radius: 10px; + border: 2px solid $grey-light; + + &:hover { + border: 2px solid $yellow; + } + + &:active { + border: 2px solid $yellow; + background-color: $yellow; + color: $grey-dark; + + img{ + content: url("../../public/images/honeycomb-yellow.png"); + } + } + + } + img { + display: inline; + width: 20px; + } + } +} diff --git a/resources/sass/dashboard.scss b/resources/sass/dashboard.scss new file mode 100755 index 0000000..1a19797 --- /dev/null +++ b/resources/sass/dashboard.scss @@ -0,0 +1,102 @@ +.grid { + flex-wrap: wrap; + margin-top: 15px; + &--item { + margin-bottom: 20px; + width: 50%; + padding: 15px; + flex: 1 0 40%; + height: 37.5vh; + + &--heading { + display: inline-flex; + align-items: center; + width: 80%; + padding-left: 10px; + + div { + display: inline-flex; + float: right; + margin-left: 30px; + + img { + margin: 0; + } + } + img { + margin-left: 10px; + width: 40px; + } + } + + &--content { + color: black; + text-decoration: none; + width: 90%; + height: 100%; + background-color: white; + border-radius: 10px; + height: 100%; + margin-top: 5px; + &--table { + color: $grey-dark; + padding: 20px; + align-self: center; + width: 100%; + height: 85%; + border-collapse: collapse; + border-collapse: collapse; + border: 1px solid $yellow; + } + thead tr { + color: $grey-dark; + text-align: left; + } + + thead { + border-radius: 15px; + background-color: $yellow; + } + + th, + td { + padding: 12px 15px; + } + + tbody tr { + border-bottom: 1px solid $grey-dark; + } + + tbody tr:nth-of-type(even) { + background-color: $grey-dark; + color: $yellow; + } + + tbody tr:last-of-type { + border-bottom: 2px solid $yellow; + } + } + + &--end { + float: inline-end; + margin: 10px; + a { + flex-direction: row; + display: inline-flex; + img { + width: 20px; + } + } + + .add:mouseup{ + img{ + content: url('../../public/images/add-black.png'); + } + } + } + } +} + +.border { + border: 1px solid $yellow; +} diff --git a/resources/sass/inputs.scss b/resources/sass/inputs.scss new file mode 100755 index 0000000..a539feb --- /dev/null +++ b/resources/sass/inputs.scss @@ -0,0 +1,82 @@ +.formGroup { + align-items: flex-start; + margin-bottom: 10px; + input, + textarea { + margin-top: 0px; + border: 2px solid $grey-light; + border-radius: 6px; + height: 2.25rem; + padding: 5px; + color: $grey-dark; + font-size: medium; + width: 400px; + &::placeholder { + color: $grey-dark; + font-size: small; + } + + &:focus { + border: 2px solid $grey-dark; + outline: none; + color: $grey-dark; + } + } + + textarea{ + height: 15rem; + width: 40rem; + } + + input#assignTo { + overflow: hidden; + background-color: white; + margin-left: 0px; + border: 2px solid $grey-light; + border-radius: 30px; + padding: 5px; + font-size: small; + color: $grey-dark; + left: 10px; + width: 250px; + margin-top: 0; + + &:focus { + margin-left: none; + outline: none; + border: 2px solid $grey-dark; + } + + &::placeholder { + color: $grey-light; + } + } + img { + position: relative; + background-color: transparent; + cursor: pointer; + width: 25px; + height: 100%; + right: -215px; + top:-32.5px; + } + + .ql-container{ + height:500px; + } +} + +.queryResponses{ + position: relative; + z-index: 10; + top:10px +} + +.selection{ + position: relative; +} + +.honeycombDescription{ + width: 100%; + height: 450px; +} diff --git a/resources/sass/login.scss b/resources/sass/login.scss new file mode 100755 index 0000000..c2383d8 --- /dev/null +++ b/resources/sass/login.scss @@ -0,0 +1,72 @@ +.login { + background-color: $grey-dark; + width: 100%; + height: 100vh; + justify-content: space-between; + overflow: hidden; +} + +.loginLeft { + position: relative; +} + +.loginCircle, +.infoPane { + position: absolute; +} + +.loginCircle { + border-radius: 1000px; + border: 600px solid $yellow; + top: -200px; + left: -450px; + width: 100%; + height: 100vh; + color: $yellow; + background-color: $yellow; +} + +.infoPane { + z-index: 9; + width: 100%; + height: 100%; + flex-direction: column; + align-items: flex-start; + left: 200px; + top: -100px; + img { + position: relative; + max-width: 200px; + width: 200px; + left: -165px; + } + + .welcomeText { + margin-top: 15px; + color: $grey-dark; + align-self: center; + justify-content: center; + font-size: larger; + position: relative; + font-weight: bold; + width: 280px; + } +} + +.loginForm { + position: relative; + align-self: center; + left: -125px; + padding: 10px; + + &.welcomeText{ + color: white; + } + + form { + display: flex; + flex-direction: column; + gap: 10px; + align-items: flex-start; + } +} diff --git a/resources/sass/menu.scss b/resources/sass/menu.scss new file mode 100755 index 0000000..23e3674 --- /dev/null +++ b/resources/sass/menu.scss @@ -0,0 +1,152 @@ +.nav { + // display: box; + align-items: center; + background: $yellow; + height: 50px; + justify-content: space-between; + padding: 2rem 0rem 2rem 1rem; + top: 15px; + width: 18.5rem; + min-height: 100vh; + height: 100%; + + ul.sidemenu { + .sidemenuLink { + border: 5px solid transparent; + height: 4.25rem; + padding-left: 5px; + // padding: 1rem; + p { + color: $grey-dark; + font-weight: bold; + + + } + + .menuIcon{ + width: 40px; + margin-right: 15px; + } + + &.active { + p { + color: $yellow; + } + border-radius: 2rem; + background-color: $grey-dark; + border: 5px solid $grey-dark; + + } + margin-top: 15px; + + &:hover { + p { + color: $yellow; + } + border-radius: 2rem; + background-color: $grey-dark; + border: 5px solid $grey-dark; + } + } + } + + .honeycombs:hover, .honeycombs.active{ + img{ + content: url('../../public/images/honeycomb-yellow.png'); + } + } +} + +#logoLink { + padding-left: 5px; + align-items: center; + display: inline-flex; + font-size: 20px; + + p { + top: 10px; + color: $grey-dark; + } +} + +.logo{ + width: 50px; + margin-right: 10px; + margin-bottom: 10px; +} + +.separator { + width: 100%; + height: 2px; + background: $grey-dark; + z-index: 10; + position: relative; + border-radius: 25px; + border: 0px solid; + margin: 5 0 25 0; + + &.yellow { + margin-bottom: 15px; + background: $yellow; + top: 10px; + } +} + +.innerMenu { + height: 2.5rem; + align-items: center; + gap: 30%; + font-weight: 1; + + &--right { + gap: 20px; + position: fixed; + right: 2.7rem; + padding-right: 10px; + } +} + +.breadcrumb { + gap: 400px; +} + +.searchBar { + form { + margin: 0; + + input { + overflow: hidden; + background-color: white; + margin-left: 15px; + border: 2px solid $grey-light; + border-radius: 30px; + padding: 5px; + font-size: small; + color: $grey-dark; + left: 10px; + width: 250px; + margin-top: 0; + + &:focus { + margin-left: none; + outline: none; + border: 2px solid $grey-dark; + } + + &::placeholder { + color: $grey-light; + } + } + } + img { + position: relative; + right: 35px; + background-color: transparent; + cursor: pointer; + width: 25px; + height: 100%; + top:5px; + } +} + + diff --git a/resources/sass/texts.scss b/resources/sass/texts.scss new file mode 100755 index 0000000..f86b35d --- /dev/null +++ b/resources/sass/texts.scss @@ -0,0 +1,12 @@ +.blue{ + color: $grey-dark; +} + +.bold{ + font-weight: bold; + font-size: large; +} + +.small{ + font-size: small; +} diff --git a/resources/sass/trix.scss b/resources/sass/trix.scss new file mode 100644 index 0000000..eefcd0d --- /dev/null +++ b/resources/sass/trix.scss @@ -0,0 +1,513 @@ +trix-editor { + border: 1px solid #bbb; + border-radius: 3px; + margin: 0; + padding: 0.4em 0.6em; + min-height: 5em; + outline: none; +} + +trix-toolbar * { + box-sizing: border-box; +} + +trix-toolbar .trix-button-row { + display: flex; + flex-wrap: nowrap; + justify-content: space-between; + overflow-x: auto; +} + +trix-toolbar .trix-button-group { + display: flex; + margin-bottom: 10px; + border: 1px solid #bbb; + border-top-color: #ccc; + border-bottom-color: #888; + border-radius: 3px; +} +trix-toolbar .trix-button-group:not(:first-child) { + margin-left: 1.5vw; +} +@media (max-width: 768px) { + trix-toolbar .trix-button-group:not(:first-child) { + margin-left: 0; + } +} + +trix-toolbar .trix-button-group-spacer { + flex-grow: 1; +} +@media (max-width: 768px) { + trix-toolbar .trix-button-group-spacer { + display: none; + } +} + +trix-toolbar .trix-button { + position: relative; + float: left; + color: rgba(0, 0, 0, 0.6); + font-size: 0.75em; + font-weight: 600; + white-space: nowrap; + padding: 0 0.5em; + margin: 0; + outline: none; + border: none; + border-bottom: 1px solid #ddd; + border-radius: 0; + background: transparent; +} +trix-toolbar .trix-button:not(:first-child) { + border-left: 1px solid #ccc; +} +trix-toolbar .trix-button.trix-active { + background: #cbeefa; + color: black; +} +trix-toolbar .trix-button:not(:disabled) { + cursor: pointer; +} +trix-toolbar .trix-button:disabled { + color: rgba(0, 0, 0, 0.125); +} +@media (max-width: 768px) { + trix-toolbar .trix-button { + letter-spacing: -0.01em; + padding: 0 0.3em; + } +} + +trix-toolbar .trix-button--icon { + font-size: inherit; + width: 2.6em; + height: 1.6em; + max-width: calc(0.8em + 4vw); + text-indent: -9999px; +} +@media (max-width: 768px) { + trix-toolbar .trix-button--icon { + height: 2em; + max-width: calc(0.8em + 3.5vw); + } +} +trix-toolbar .trix-button--icon::before { + display: inline-block; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + opacity: 0.6; + content: ""; + background-position: center; + background-repeat: no-repeat; + background-size: contain; +} +@media (max-width: 768px) { + trix-toolbar .trix-button--icon::before { + right: 6%; + left: 6%; + } +} +trix-toolbar .trix-button--icon.trix-active::before { + opacity: 1; +} +trix-toolbar .trix-button--icon:disabled::before { + opacity: 0.125; +} + +trix-toolbar .trix-button--icon-attach::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.5%2018V7.5c0-2.25%203-2.25%203%200V18c0%204.125-6%204.125-6%200V7.5c0-6.375%209-6.375%209%200V18%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-miterlimit%3D%2210%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E"); + top: 8%; + bottom: 4%; +} + +trix-toolbar .trix-button--icon-bold::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.522%2019.242a.5.5%200%200%201-.5-.5V5.35a.5.5%200%200%201%20.5-.5h5.783c1.347%200%202.46.345%203.24.982.783.64%201.216%201.562%201.216%202.683%200%201.13-.587%202.129-1.476%202.71a.35.35%200%200%200%20.049.613c1.259.56%202.101%201.742%202.101%203.22%200%201.282-.483%202.334-1.363%203.063-.876.726-2.132%201.12-3.66%201.12h-5.89ZM9.27%207.347v3.362h1.97c.766%200%201.347-.17%201.733-.464.38-.291.587-.716.587-1.27%200-.53-.183-.928-.513-1.198-.334-.273-.838-.43-1.505-.43H9.27Zm0%205.606v3.791h2.389c.832%200%201.448-.177%201.853-.497.399-.315.614-.786.614-1.423%200-.62-.22-1.077-.63-1.385-.418-.313-1.053-.486-1.905-.486H9.27Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); +} + +trix-toolbar .trix-button--icon-italic::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9%205h6.5v2h-2.23l-2.31%2010H13v2H6v-2h2.461l2.306-10H9V5Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); +} + +trix-toolbar .trix-button--icon-link::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.948%205.258a4.337%204.337%200%200%200-6.108%200L11.217%206.87a.993.993%200%200%200%200%201.41c.392.39%201.027.39%201.418%200l1.623-1.613a2.323%202.323%200%200%201%203.271%200%202.29%202.29%200%200%201%200%203.251l-2.393%202.38a3.021%203.021%200%200%201-4.255%200l-.05-.049a1.007%201.007%200%200%200-1.418%200%20.993.993%200%200%200%200%201.41l.05.049a5.036%205.036%200%200%200%207.091%200l2.394-2.38a4.275%204.275%200%200%200%200-6.072Zm-13.683%2013.6a4.337%204.337%200%200%200%206.108%200l1.262-1.255a.993.993%200%200%200%200-1.41%201.007%201.007%200%200%200-1.418%200L9.954%2017.45a2.323%202.323%200%200%201-3.27%200%202.29%202.29%200%200%201%200-3.251l2.344-2.331a2.579%202.579%200%200%201%203.631%200c.392.39%201.027.39%201.419%200a.993.993%200%200%200%200-1.41%204.593%204.593%200%200%200-6.468%200l-2.345%202.33a4.275%204.275%200%200%200%200%206.072Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); +} + +trix-toolbar .trix-button--icon-strike::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6%2014.986c.088%202.647%202.246%204.258%205.635%204.258%203.496%200%205.713-1.728%205.713-4.463%200-.275-.02-.536-.062-.781h-3.461c.398.293.573.654.573%201.123%200%201.035-1.074%201.787-2.646%201.787-1.563%200-2.773-.762-2.91-1.924H6ZM6.432%2010h3.763c-.632-.314-.914-.715-.914-1.273%200-1.045.977-1.739%202.432-1.739%201.475%200%202.52.723%202.617%201.914h2.764c-.05-2.548-2.11-4.238-5.39-4.238-3.145%200-5.392%201.719-5.392%204.316%200%20.363.04.703.12%201.02ZM4%2011a1%201%200%201%200%200%202h15a1%201%200%201%200%200-2H4Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); +} + +trix-toolbar .trix-button--icon-quote::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.581%208.471c.44-.5%201.056-.834%201.758-.995C8.074%207.17%209.201%207.822%2010%208.752c1.354%201.578%201.33%203.555.394%205.277-.941%201.731-2.788%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.121-.49.16-.764.294-.286.567-.566.791-.835.222-.266.413-.54.524-.815.113-.28.156-.597.026-.908-.128-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.674-2.7c0-.905.283-1.59.72-2.088Zm9.419%200c.44-.5%201.055-.834%201.758-.995%201.734-.306%202.862.346%203.66%201.276%201.355%201.578%201.33%203.555.395%205.277-.941%201.731-2.789%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.122-.49.16-.764.294-.286.567-.566.791-.835.222-.266.412-.54.523-.815.114-.28.157-.597.026-.908-.127-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.672-2.701c0-.905.283-1.59.72-2.088Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); +} + +trix-toolbar .trix-button--icon-heading-1::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.5%207.5v-3h-12v3H14v13h3v-13h4.5ZM9%2013.5h3.5v-3h-10v3H6v7h3v-7Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); +} + +trix-toolbar .trix-button--icon-code::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.293%2011.293a1%201%200%200%200%200%201.414l4%204a1%201%200%201%200%201.414-1.414L5.414%2012l3.293-3.293a1%201%200%200%200-1.414-1.414l-4%204Zm13.414%205.414%204-4a1%201%200%200%200%200-1.414l-4-4a1%201%200%201%200-1.414%201.414L18.586%2012l-3.293%203.293a1%201%200%200%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); +} + +trix-toolbar .trix-button--icon-bullet-list::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%207.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203ZM8%206a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-2.5-5a1.5%201.5%200%201%201-3%200%201.5%201.5%200%200%201%203%200ZM5%2019.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); +} + +trix-toolbar .trix-button--icon-number-list::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%204h2v4H4V5H3V4Zm5%202a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-3.5-7H6v1l-1.5%202H6v1H3v-1l1.667-2H3v-1h2.5ZM3%2017v-1h3v4H3v-1h2v-.5H4v-1h1V17H3Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); +} + +trix-toolbar .trix-button--icon-undo::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%2014a1%201%200%200%200%201%201h6a1%201%200%201%200%200-2H6.257c2.247-2.764%205.151-3.668%207.579-3.264%202.589.432%204.739%202.356%205.174%205.405a1%201%200%200%200%201.98-.283c-.564-3.95-3.415-6.526-6.825-7.095C11.084%207.25%207.63%208.377%205%2011.39V8a1%201%200%200%200-2%200v6Zm2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); +} + +trix-toolbar .trix-button--icon-redo::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21%2014a1%201%200%200%201-1%201h-6a1%201%200%201%201%200-2h3.743c-2.247-2.764-5.151-3.668-7.579-3.264-2.589.432-4.739%202.356-5.174%205.405a1%201%200%200%201-1.98-.283c.564-3.95%203.415-6.526%206.826-7.095%203.08-.513%206.534.614%209.164%203.626V8a1%201%200%201%201%202%200v6Zm-2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); +} + +trix-toolbar .trix-button--icon-decrease-nesting-level::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-3.707-5.707a1%201%200%200%200%200%201.414l2%202a1%201%200%201%200%201.414-1.414L4.414%2012l1.293-1.293a1%201%200%200%200-1.414-1.414l-2%202Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); +} + +trix-toolbar .trix-button--icon-increase-nesting-level::before { + background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-2.293-2.293%202-2a1%201%200%200%200%200-1.414l-2-2a1%201%200%201%200-1.414%201.414L3.586%2012l-1.293%201.293a1%201%200%201%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E"); +} + +trix-toolbar .trix-dialogs { + position: relative; +} + +trix-toolbar .trix-dialog { + position: absolute; + top: 0; + left: 0; + right: 0; + font-size: 0.75em; + padding: 15px 10px; + background: #fff; + box-shadow: 0 0.3em 1em #ccc; + border-top: 2px solid #888; + border-radius: 5px; + z-index: 5; +} + +trix-toolbar .trix-input--dialog { + font-size: inherit; + font-weight: normal; + padding: 0.5em 0.8em; + margin: 0 10px 0 0; + border-radius: 3px; + border: 1px solid #bbb; + background-color: #fff; + box-shadow: none; + outline: none; + -webkit-appearance: none; + -moz-appearance: none; +} +trix-toolbar .trix-input--dialog.validate:invalid { + box-shadow: #f00 0px 0px 1.5px 1px; +} + +trix-toolbar .trix-button--dialog { + font-size: inherit; + padding: 0.5em; + border-bottom: none; +} + +trix-toolbar .trix-dialog--link { + max-width: 600px; +} + +trix-toolbar .trix-dialog__link-fields { + display: flex; + align-items: baseline; +} +trix-toolbar .trix-dialog__link-fields .trix-input { + flex: 1; +} +trix-toolbar .trix-dialog__link-fields .trix-button-group { + flex: 0 0 content; + margin: 0; +} + +trix-editor [data-trix-mutable]:not(.attachment__caption-editor) { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +trix-editor [data-trix-mutable]::-moz-selection, +trix-editor [data-trix-cursor-target]::-moz-selection, +trix-editor [data-trix-mutable] ::-moz-selection { + background: none; +} + +trix-editor [data-trix-mutable]::selection, +trix-editor [data-trix-cursor-target]::selection, +trix-editor [data-trix-mutable] ::selection { + background: none; +} + +trix-editor + .attachment__caption-editor:focus[data-trix-mutable]::-moz-selection { + background: highlight; +} + +trix-editor .attachment__caption-editor:focus[data-trix-mutable]::selection { + background: highlight; +} + +trix-editor [data-trix-mutable].attachment.attachment--file { + box-shadow: 0 0 0 2px highlight; + border-color: transparent; +} + +trix-editor [data-trix-mutable].attachment img { + box-shadow: 0 0 0 2px highlight; +} + +trix-editor .attachment { + position: relative; +} +trix-editor .attachment:hover { + cursor: default; +} + +trix-editor .attachment--preview .attachment__caption:hover { + cursor: text; +} + +trix-editor .attachment__progress { + position: absolute; + z-index: 1; + height: 20px; + top: calc(50% - 10px); + left: 5%; + width: 90%; + opacity: 0.9; + transition: opacity 200ms ease-in; +} +trix-editor .attachment__progress[value="100"] { + opacity: 0; +} + +trix-editor .attachment__caption-editor { + display: inline-block; + width: 100%; + margin: 0; + padding: 0; + font-size: inherit; + font-family: inherit; + line-height: inherit; + color: inherit; + text-align: center; + vertical-align: top; + border: none; + outline: none; + -webkit-appearance: none; + -moz-appearance: none; +} + +trix-editor .attachment__toolbar { + position: absolute; + z-index: 1; + top: -0.9em; + left: 0; + width: 100%; + text-align: center; +} + +trix-editor .trix-button-group { + display: inline-flex; +} + +trix-editor .trix-button { + position: relative; + float: left; + color: #666; + white-space: nowrap; + font-size: 80%; + padding: 0 0.8em; + margin: 0; + outline: none; + border: none; + border-radius: 0; + background: transparent; +} +trix-editor .trix-button:not(:first-child) { + border-left: 1px solid #ccc; +} +trix-editor .trix-button.trix-active { + background: #cbeefa; +} +trix-editor .trix-button:not(:disabled) { + cursor: pointer; +} + +trix-editor .trix-button--remove { + text-indent: -9999px; + display: inline-block; + padding: 0; + outline: none; + width: 1.8em; + height: 1.8em; + line-height: 1.8em; + border-radius: 50%; + background-color: #fff; + border: 2px solid highlight; + box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.25); +} +trix-editor .trix-button--remove::before { + display: inline-block; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + opacity: 0.7; + content: ""; + background-image: url("data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M19%206.41%2017.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22%2F%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%2F%3E%3C%2Fsvg%3E"); + background-position: center; + background-repeat: no-repeat; + background-size: 90%; +} +trix-editor .trix-button--remove:hover { + border-color: #333; +} +trix-editor .trix-button--remove:hover::before { + opacity: 1; +} + +trix-editor .attachment__metadata-container { + position: relative; +} + +trix-editor .attachment__metadata { + position: absolute; + left: 50%; + top: 2em; + transform: translate(-50%, 0); + max-width: 90%; + padding: 0.1em 0.6em; + font-size: 0.8em; + color: #fff; + background-color: rgba(0, 0, 0, 0.7); + border-radius: 3px; +} +trix-editor .attachment__metadata .attachment__name { + display: inline-block; + max-width: 100%; + vertical-align: bottom; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +trix-editor .attachment__metadata .attachment__size { + margin-left: 0.2em; + white-space: nowrap; +} + +.trix-content { + line-height: 1.5; +} +.trix-content * { + box-sizing: border-box; + margin: 0; + padding: 0; +} +.trix-content h1 { + font-size: 1.2em; + line-height: 1.2; +} +.trix-content blockquote { + border: 0 solid #ccc; + border-left-width: 0.3em; + margin-left: 0.3em; + padding-left: 0.6em; +} +.trix-content [dir="rtl"] blockquote, +.trix-content blockquote[dir="rtl"] { + border-width: 0; + border-right-width: 0.3em; + margin-right: 0.3em; + padding-right: 0.6em; +} +.trix-content li { + margin-left: 1em; +} +.trix-content [dir="rtl"] li { + margin-right: 1em; +} +.trix-content pre { + display: inline-block; + width: 100%; + vertical-align: top; + font-family: monospace; + font-size: 0.9em; + padding: 0.5em; + white-space: pre; + background-color: #eee; + overflow-x: auto; +} +.trix-content img { + max-width: 100%; + height: auto; +} +.trix-content .attachment { + display: inline-block; + position: relative; + max-width: 100%; +} +.trix-content .attachment a { + color: inherit; + text-decoration: none; +} +.trix-content .attachment a:hover, +.trix-content .attachment a:visited:hover { + color: inherit; +} +.trix-content .attachment__caption { + text-align: center; +} +.trix-content + .attachment__caption + .attachment__name + + .attachment__size::before { + content: " \2022 "; +} +.trix-content .attachment--preview { + width: 100%; + text-align: center; +} +.trix-content .attachment--preview .attachment__caption { + color: #666; + font-size: 0.9em; + line-height: 1.2; +} +.trix-content .attachment--file { + color: #333; + line-height: 1; + margin: 0 2px 2px 2px; + padding: 0.4em 1em; + border: 1px solid #bbb; + border-radius: 5px; +} +.trix-content .attachment-gallery { + display: flex; + flex-wrap: wrap; + position: relative; +} +.trix-content .attachment-gallery .attachment { + flex: 1 0 33%; + padding: 0 0.5em; + max-width: 33%; +} +.trix-content .attachment-gallery.attachment-gallery--2 .attachment, +.trix-content .attachment-gallery.attachment-gallery--4 .attachment { + flex-basis: 50%; + max-width: 50%; +} diff --git a/resources/sass/variables.scss b/resources/sass/variables.scss new file mode 100755 index 0000000..925ec77 --- /dev/null +++ b/resources/sass/variables.scss @@ -0,0 +1,12 @@ +$yellow:#FFE000; +$yellow-dark: #f0d400; +$yellower: #faeb7a; + +$emerald:#50c47d; + +$orange: #ef5924; + +$blue-light: #7091E6; +$grey: #8697C4; +$grey-light: #bcbdbc; +$grey-dark: #363A43; diff --git a/resources/views/auth/login-success.blade.php b/resources/views/auth/login-success.blade.php new file mode 100755 index 0000000..059ebd3 --- /dev/null +++ b/resources/views/auth/login-success.blade.php @@ -0,0 +1,46 @@ + + + + + + + + Login - Radical Hive + + @if (env('APP_ENV') === 'production') + + + + @else + + @vite(['resources/sass/app.scss', 'resources/js/app.js']) + @endif + + + + + {{-- --}} + + + + + + + + + diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php new file mode 100755 index 0000000..efe18c0 --- /dev/null +++ b/resources/views/auth/login.blade.php @@ -0,0 +1,51 @@ + + + + + + + + Login - Radical Hive + + @if (env('APP_ENV') === 'production') + + + + @else + + @vite(['resources/sass/app.scss', 'resources/js/app.js']) + @endif + + + + + {{-- --}} + + + + + + + + + diff --git a/resources/views/auth/verify.blade.php b/resources/views/auth/verify.blade.php new file mode 100755 index 0000000..250526c --- /dev/null +++ b/resources/views/auth/verify.blade.php @@ -0,0 +1,50 @@ + + + + + + + + Login - Radical Hive + + @if (env('APP_ENV') === 'production') + + + + @else + + @vite(['resources/sass/app.scss', 'resources/js/app.js']) + @endif + + + + + {{-- --}} + + + + + + + + diff --git a/resources/views/components/forms/inputs/searchBar.blade.php b/resources/views/components/forms/inputs/searchBar.blade.php new file mode 100644 index 0000000..cf26dfb --- /dev/null +++ b/resources/views/components/forms/inputs/searchBar.blade.php @@ -0,0 +1,7 @@ + diff --git a/resources/views/components/forms/inputs/text.blade.php b/resources/views/components/forms/inputs/text.blade.php new file mode 100755 index 0000000..8ff3d4d --- /dev/null +++ b/resources/views/components/forms/inputs/text.blade.php @@ -0,0 +1,4 @@ +
    + + +
    \ No newline at end of file diff --git a/resources/views/components/forms/inputs/textarea.blade.php b/resources/views/components/forms/inputs/textarea.blade.php new file mode 100755 index 0000000..f4e0f0d --- /dev/null +++ b/resources/views/components/forms/inputs/textarea.blade.php @@ -0,0 +1,4 @@ +
    + +
    +
    \ No newline at end of file diff --git a/resources/views/components/menu/menuItem.blade.php b/resources/views/components/menu/menuItem.blade.php new file mode 100755 index 0000000..dfad6f9 --- /dev/null +++ b/resources/views/components/menu/menuItem.blade.php @@ -0,0 +1,4 @@ + + +

    {{ucfirst($key)}}

    +
    \ No newline at end of file diff --git a/resources/views/homepage/homepage.blade.php b/resources/views/homepage/homepage.blade.php new file mode 100755 index 0000000..ca8d5f6 --- /dev/null +++ b/resources/views/homepage/homepage.blade.php @@ -0,0 +1,110 @@ +@extends('layouts.main') +@section('title') + {{ $title }} +@endsection + +@section('content') +
    +
    +
    +

    Your honeycombs

    +
    +
    + + + + + + + + + + @if (isset($honeycombs) && !empty($honeycombs->toArray())) + @foreach ($honeycombs as $honeycomb) + + + {{-- @if (!is_string($honeycomb->createdBy)) + {{dump((array)$honeycomb)}} --}} + + {{-- @else + + @endif --}} + + + @endforeach + @else + + @endif + + +
    + Honeycomb name + + Created by + + Due Date +
    + {{ $honeycomb->name }} + + + {{ $honeycomb->createdBy}}Alex Lingris25/10/25
    + You have no honeycombs +
    + + +
    +
    +
    +
    +

    Your honeycombs

    +
    + {{--
    + +
    --}} +
    +
    +
    +

    Your honeycombs

    +
    +
    + + {{-- @foreach ($tasks as $task) + + + + + + @endforeach --}} +
    {{ $task->taskName }}
    +
    +
    +
    +
    +

    Your honeycombs

    +
    +
    + {{-- --}} +
    +
    +
    + + +@endsection diff --git a/resources/views/homepage/honeycombs.blade.php b/resources/views/homepage/honeycombs.blade.php new file mode 100755 index 0000000..ce1c7c1 --- /dev/null +++ b/resources/views/homepage/honeycombs.blade.php @@ -0,0 +1,112 @@ +@extends('layouts.main') + +@section('title') + {{ $title }} +@endsection + +@section('content') +
    +
    +
    + +

    Honeycombs assigned to you +

    +
    + + +
    +
    +
    + + + + + + + + + + @if (isset($assignedToMe) && !empty($assignedToMe->toArray())) + @foreach ($assignedToMe as $honeycomb) + + + + + + @endforeach + @else + + @endif + + +
    + Honeycomb name + + Created by + + Due Date +
    + {{ $honeycomb->name }} + + + {{ $honeycomb->createdBy->name->value}}25/10/25
    + You have no honeycombs +
    +
    +
    +
    +
    + +

    + Honeycombs created by you +

    +
    + + +
    +
    +
    + + + + + + + + + + @if (isset($honeycombs) && !empty($honeycombs->toArray())) + @foreach ($honeycombs as $honeycomb) + + + + + + @endforeach + @else + + @endif + + +
    + Honeycomb name + + Created by + + Due Date +
    + {{ $honeycomb->name }} + + + {{ $honeycomb->createdBy->name->value}}25/10/25
    + You have no honeycombs +
    + + +
    +
    +
    +@endsection diff --git a/resources/views/homepage/honeycombsNew.blade.php b/resources/views/homepage/honeycombsNew.blade.php new file mode 100755 index 0000000..38483a5 --- /dev/null +++ b/resources/views/homepage/honeycombsNew.blade.php @@ -0,0 +1,25 @@ + +@extends('layouts.main') + +@section('title') + {{ $title }} +@endsection + +@section('content') +
    +
    + @csrf + + + +
    + + +
    + + + +
    +@endsection + diff --git a/resources/views/homepage/honeycombsShow.blade.php b/resources/views/homepage/honeycombsShow.blade.php new file mode 100644 index 0000000..0ce1841 --- /dev/null +++ b/resources/views/homepage/honeycombsShow.blade.php @@ -0,0 +1,19 @@ + +@extends('layouts.main') + +@section('title') + {{ $honeycomb->name }} +@endsection + +@section('content') +
    +

    {{$honeycomb->name}}

    + {!! $honeycomb->description !!} + {{$honeycomb->dueDate}} + @foreach($honeycomb->assignTo as $assigned) + Assigned To + @endforeach +
    +@endsection + diff --git a/resources/views/layouts/main.blade.php b/resources/views/layouts/main.blade.php new file mode 100755 index 0000000..ef9463b --- /dev/null +++ b/resources/views/layouts/main.blade.php @@ -0,0 +1,62 @@ + + + + + + + + @yield('title') - Radical Hive + + @if (env('APP_ENV') === 'production') + + + + @else + + @vite(['resources/sass/app.scss', 'resources/js/app.js', 'resources/js/main.js']) + @endif + + + + + {{-- --}} + @livewireStyles + + + + @include('menus.desktop') + + @section('content') +
    +
    +
    + +
    + +
    +
    AK
    +
    +
    +
    KL
    +
    +
    +
    +
    + @yield('content') + @livewireScripts + + + diff --git a/resources/views/livewire/assign-to.blade.php b/resources/views/livewire/assign-to.blade.php new file mode 100644 index 0000000..d55b4aa --- /dev/null +++ b/resources/views/livewire/assign-to.blade.php @@ -0,0 +1,20 @@ + + + +
    + + + +
    + @foreach ($queryResults as $result) + + @endforeach +
    + +
    + @foreach ($selection as $selected) + + @endforeach +
    +
    \ No newline at end of file diff --git a/resources/views/livewire/trix.blade.php b/resources/views/livewire/trix.blade.php new file mode 100644 index 0000000..84025eb --- /dev/null +++ b/resources/views/livewire/trix.blade.php @@ -0,0 +1,65 @@ +
    + @csrf + +
    +@script + +@endscript diff --git a/resources/views/menus/desktop.blade.php b/resources/views/menus/desktop.blade.php new file mode 100755 index 0000000..ce86dc7 --- /dev/null +++ b/resources/views/menus/desktop.blade.php @@ -0,0 +1,11 @@ + diff --git a/routes/console.php b/routes/console.php new file mode 100755 index 0000000..eff2ed2 --- /dev/null +++ b/routes/console.php @@ -0,0 +1,8 @@ +comment(Inspiring::quote()); +})->purpose('Display an inspiring quote')->hourly(); diff --git a/routes/web.php b/routes/web.php new file mode 100755 index 0000000..281fe23 --- /dev/null +++ b/routes/web.php @@ -0,0 +1,31 @@ + ['web'], +], function () { + Route::middleware([GuestMiddleware::class])->group(function () { + Route::get('/login', "\Hive\Controllers\AuthController@login"); + Route::post('/login', "\Hive\Controllers\AuthController@postLogin"); + Route::get('/verify', "\Hive\Controllers\AuthController@verify"); + Route::post('/verify', "\Hive\Controllers\AuthController@postVerify"); + }); + Route::middleware([AuthMiddleware::class])->group(function () { + Route::get('/logout', "\Hive\Controllers\AuthController@logout"); + Route::get('/', "\Hive\Controllers\HomepageController@index"); + Route::get('/honeycombs', "\Hive\Controllers\HoneycombController@index"); + Route::get('/honeycombs/new', "\Hive\Controllers\HoneycombController@new"); + Route::post('/honeycombs/new', "\Hive\Controllers\HoneycombController@create"); + Route::get('/honeycombs/{id}', "\Hive\Controllers\HoneycombController@show"); + Route::post('/uploadImages', "\Hive\Controllers\ImageController@upload"); + }); +}); + + + +// Route::get('/', function () { +// return view('welcome'); +// }); diff --git a/src/Controllers/AuthController.php b/src/Controllers/AuthController.php new file mode 100755 index 0000000..6cfffd3 --- /dev/null +++ b/src/Controllers/AuthController.php @@ -0,0 +1,56 @@ +service->sendLoginEmail($this->request->input('email')); + + return view("auth.login-success"); + } + + function verify() + { + return view("auth.verify", [ + "email" => $this->request->input("email"), + "token" => $this->request->input("token"), + ]); + } + + function postVerify() + { + try { + $this->service->login($this->request->input("email"), $this->request->input("token")); + } catch (LucentException $th) { + return ResponseFormError::fromException($th); + } + return redirect("/"); + } + + public function logout(): RedirectResponse + { + $this->session->flush(); + return redirect("/login"); + } +} \ No newline at end of file diff --git a/src/Controllers/HomepageController.php b/src/Controllers/HomepageController.php new file mode 100755 index 0000000..3f5a159 --- /dev/null +++ b/src/Controllers/HomepageController.php @@ -0,0 +1,31 @@ +maker->create('honeycombs'); + $menuLinks = config('sidebar'); + return view('homepage.homepage', [ + 'title' => "Hi", + 'menuLinks' => $menuLinks, + 'breadcrumb' => [ + "Homepage", + "Dashboard" + ], + 'honeycombs' => $honeycombs->withMapper()->getAll() + ]); + } +} diff --git a/src/Controllers/HoneycombController.php b/src/Controllers/HoneycombController.php new file mode 100755 index 0000000..c72c6ea --- /dev/null +++ b/src/Controllers/HoneycombController.php @@ -0,0 +1,141 @@ +schemaMaker->create("honeycombs"); + $allHoneycombs = $honeycombs->withMapper()->getAll(); + $allHoneycombs = collect($allHoneycombs)->map(function(Honeycomb $honeycomb) { + $honeycomb->assignTo = collect($honeycomb->assignTo)->map(function ($assignedTo){ + return new User( + id: $assignedTo->id, + name: $this->userService->getById($assignedTo->userId)->name->value, + userId: $assignedTo->userId + ); + }); + $honeycomb->createdBy = $this->userService->getById($honeycomb->createdBy); + return $honeycomb; + }); + $assignedToMe = $honeycombs->queryByKeyValue("children.assignTo.data.userId", $this->session->get("user.id"), "")->withMapper()->getAll(); + $assignedToMe = collect($assignedToMe)->map(function(Honeycomb $honeycomb) { + $honeycomb->assignTo = collect($honeycomb->assignTo)->map(function ($assignedTo){ + return new User( + id: $assignedTo->id, + name: $this->userService->getById($assignedTo->userId)->name->value, + userId: $assignedTo->userId + ); + }); + $honeycomb->createdBy = $this->userService->getById($honeycomb->createdBy); + return $honeycomb; + }); + $menuLinks = config("sidebar"); + return view('homepage.honeycombs', [ + "title" => "Honeycombs", + "menuLinks" => $menuLinks, + "breadcrumb" => [ + "Homepage", + "Honeycombs" + ], + "honeycombs" => $allHoneycombs, + "assignedToMe" => $assignedToMe + ]); + } + + function new() + { + $menuLinks = config("sidebar"); + return view('homepage.honeycombsNew', [ + + "title" => "Create new Honeycomb", + "menuLinks" => $menuLinks, + "breadcrumb" => [ + "Homepage", + "Honeycombs", + "Create New" + ], + ]); + } + + function create() + { + $userId = $this->session->get("user.id"); + $this->request->validate([ + 'name' => 'required', + ]); + $data = $this->request->all(); + config([ + "lucent" => [ + "systemUserId" => $userId + ] + ]); + if ($this->request->input("assignTo")) { + $assignTo = array_filter(explode("|", $this->request->input("assignTo"))); + $edges = []; + $assignedToArray = []; + foreach ($assignTo as $assignedTo) { + $assignToRecord = $this->manager->findOrCreate("userIds", "userId", $assignedTo); + $assignedToArray[] = $assignedTo; + $edges[] = + new EdgeInputData( + target: $assignToRecord, + targetSchema: "userIds", + field: "assignTo" + ); + } + + $recordId = $this->manager->createDraft("honeycombs", $data, $edges); + $event = new HoneycombAssigned($recordId, $assignedToArray); + } else { + $this->manager->createDraft("honeycombs", $data); + } + + return redirect("/honeycombs"); + } + + + function show($id) + { + $schema = $this->schemaMaker->create("honeycombs"); + + $honeycomb = $schema->withMapper()->getOne($id); + + $honeycomb->assignTo = collect($honeycomb->assignTo)->map(function ($assignedTo){ + return new User( + id: $assignedTo->id, + name: $this->userService->getById($assignedTo->userId)->name->value, + userId: $assignedTo->userId + ); + }); + if (!$honeycomb) { + throw new Exception("Honeycomb not found"); + } + + return view("homepage.honeycombsShow", [ + 'honeycomb' => $honeycomb, + 'menuLinks' => config("sidebar"), + "breadcrumb" => [ + "Homepage", + "Honeycombs", + $honeycomb->name + ], + ]); + } +} diff --git a/src/Controllers/ImageController.php b/src/Controllers/ImageController.php new file mode 100644 index 0000000..552c140 --- /dev/null +++ b/src/Controllers/ImageController.php @@ -0,0 +1,30 @@ +request->file; + $fileId = $this->manager->uploadImage("trixImages", $file); + $fileDocument = $this->query->filter([ + 'schema' => 'trixImages', + 'id' => $fileId + ])->tree()->first(); + return response($fileDocument->_file->path, 201); + } +} diff --git a/src/Events/HoneycombAssigned.php b/src/Events/HoneycombAssigned.php new file mode 100644 index 0000000..e4f98cf --- /dev/null +++ b/src/Events/HoneycombAssigned.php @@ -0,0 +1,13 @@ + $view, + 'data' => $data, + 'title' => $title, + 'layout' => $layout, + ]); + } +} \ No newline at end of file diff --git a/src/Lucent/comments.json b/src/Lucent/comments.json new file mode 100755 index 0000000..009fead --- /dev/null +++ b/src/Lucent/comments.json @@ -0,0 +1,22 @@ +{ + "type": "collection", + "name": "comments", + "label": "Comments", + "visible": [], + "groups": [], + "fields": [ + { + "name": "comment", + "label": "Comment", + "ui": "text" + } + ], + "isEntry": true, + "color": "", + "sortBy": "-_sys.updatedAt", + "cardTitle": null, + "cardImage": null, + "revisions": 0, + "read": [], + "write": [] +} \ No newline at end of file diff --git a/src/Lucent/honeycombStatuses.json b/src/Lucent/honeycombStatuses.json new file mode 100755 index 0000000..51f100a --- /dev/null +++ b/src/Lucent/honeycombStatuses.json @@ -0,0 +1,22 @@ +{ + "type": "collection", + "name": "honeycombStatuses", + "label": "Honeycomb Statuses", + "visible": [], + "groups": [], + "fields": [ + { + "name": "status", + "label": "Status", + "ui": "text" + } + ], + "isEntry": true, + "color": "", + "sortBy": "-_sys.updatedAt", + "cardTitle": null, + "cardImage": null, + "revisions": 0, + "read": [], + "write": [] +} \ No newline at end of file diff --git a/src/Lucent/honeycombs.json b/src/Lucent/honeycombs.json new file mode 100755 index 0000000..3840203 --- /dev/null +++ b/src/Lucent/honeycombs.json @@ -0,0 +1,57 @@ +{ + "type": "collection", + "name": "honeycombs", + "label": "Honeycombs", + "visible": [], + "groups": [], + "fields": [ + { + "name": "name", + "label": "Name", + "ui": "text" + }, + { + "name": "description", + "label": "Description", + "ui": "rich" + }, + { + "name": "dueDate", + "label": "Due Date", + "ui": "datetime" + }, + { + "name": "assignTo", + "label": "Assign To", + "ui": "reference", + "collections": ["userIds"] + }, + { + "name": "comments", + "label": "Comments", + "ui": "reference", + "collections": ["comments"] + }, + { + "name": "followers", + "label": "Followers", + "ui": "reference", + "collections": ["userIds"] + }, + { + "name": "status", + "label": "Status", + "ui": "reference", + "collections": ["honeycombStatuses"], + "max": 1 + } + ], + "isEntry": true, + "color": "", + "sortBy": "-_sys.updatedAt", + "cardTitle": null, + "cardImage": null, + "revisions": 0, + "read": [], + "write": [] +} \ No newline at end of file diff --git a/src/Lucent/trixImages.json b/src/Lucent/trixImages.json new file mode 100644 index 0000000..beb3b40 --- /dev/null +++ b/src/Lucent/trixImages.json @@ -0,0 +1,17 @@ +{ + "type": "files", + "name": "trixImages", + "label": "trixImages", + "fields": [], + "disk": "lucent", + "path": "trixImages", + "groups": [], + "isEntry": false, + "sortBy": "-_sys.updatedAt", + "color": "", + "cardTitle": null, + "cardImage": null, + "revisions": 0, + "read": [], + "write": [] +} \ No newline at end of file diff --git a/src/Lucent/userIds.json b/src/Lucent/userIds.json new file mode 100755 index 0000000..21555df --- /dev/null +++ b/src/Lucent/userIds.json @@ -0,0 +1,22 @@ +{ + "type": "collection", + "name": "userIds", + "label": "User Ids", + "visible": [], + "groups": [], + "fields": [ + { + "name": "userId", + "label": "userId", + "ui": "text" + } + ], + "isEntry": true, + "color": "", + "sortBy": "-_sys.updatedAt", + "cardTitle": null, + "cardImage": null, + "revisions": 0, + "read": [], + "write": [] +} \ No newline at end of file diff --git a/src/Mails/LoginMail.php b/src/Mails/LoginMail.php new file mode 100755 index 0000000..6d0bb89 --- /dev/null +++ b/src/Mails/LoginMail.php @@ -0,0 +1,36 @@ +url = env('APP_URL'); + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + return $this->subject('Login to The Hive')->text('lucent::emails.login'); + } +} diff --git a/src/Middleware/AuthMiddleware.php b/src/Middleware/AuthMiddleware.php new file mode 100755 index 0000000..1cf1082 --- /dev/null +++ b/src/Middleware/AuthMiddleware.php @@ -0,0 +1,26 @@ +authService->isLoggedIn()) { + return redirect("/login"); + } + $this->authService->refreshSession(); + + return $next($request); + } +} diff --git a/src/Middleware/GuestMiddleware.php b/src/Middleware/GuestMiddleware.php new file mode 100755 index 0000000..e782b31 --- /dev/null +++ b/src/Middleware/GuestMiddleware.php @@ -0,0 +1,22 @@ +authService->isLoggedIn()) { + return redirect("/"); + } + return $next($request); + } +} \ No newline at end of file diff --git a/src/Models/Honeycomb.php b/src/Models/Honeycomb.php new file mode 100755 index 0000000..7e20e55 --- /dev/null +++ b/src/Models/Honeycomb.php @@ -0,0 +1,33 @@ +createdBy = new User(...$userService->getById($this->createdBy)); + $this->dueDate = Carbon::parse($this->dueDate); + } +} \ No newline at end of file diff --git a/src/Models/HoneycombStatus.php b/src/Models/HoneycombStatus.php new file mode 100755 index 0000000..25a34a9 --- /dev/null +++ b/src/Models/HoneycombStatus.php @@ -0,0 +1,10 @@ +runningInConsole()) { + return config("lucent.systemUserId"); + // } elseif(request()->segment(1) !== "lucent") { + // return config("lucent.systemUserId"); + } else { + return $this->session->get("user.id"); + } + + } + + public + function currentUserRoles(): array + { + return $this->session->get("user.roles") ?? []; + } + + public + function isLoggedIn(): bool + { + return !empty($this->currentUserId()); + } + + + public + function refreshSession() + { + + $user = $this->userRepo->findById($this->currentUserId()); + + if ($user->isEmpty()) { + throw new LucentException("Your account was not found"); + } + + if ($user->get()->isRemoved()) { + throw new LucentException("Your account is not active"); + } + + $newUser = $user->get(); + $this->session->put(["user" => $user->get()->safe()]); + } + + public function sendLoginEmail(string $email): void + { + $emailAddress = (new Email($email)); + $user = $this->userRepo->findByEmail($emailAddress); + + if ($user->isEmpty()) { + return; + } + + if ($user->get()->isRemoved()) { + return; + } + $newToken = $this->userRepo->updateLoginToken($user->get()->id); + + Mail::to($email)->send( + new LoginMail( + $email, + $newToken + ) + ); + } + + /** + * @throws LucentException + */ + public + function login(string $email, string $token): void + { + + $user = $this->userRepo->findByEmail(new Email($email)); + + if ($user->isEmpty()) { + throw new LucentException("Your account was not found"); + } + + if ($user->get()->isRemoved()) { + throw new LucentException("Your account is not active"); + } + + if ($user->get()->mailToken !== $token) { + throw new LucentException("Token has expired or is invalid"); + } + + if (Carbon::parse($user->get()->loggedInAt)->lte(Carbon::now()->subHours(1))) { + throw new LucentException("Token has expired."); + } + + $newUser = $user->get(); + $newUser->updatedAt = Carbon::now()->toJson(); + $newUser->mailToken = null; + $this->userRepo->update($newUser); + $this->session->put(["user" => $user->get()->safe()]); + } +} \ No newline at end of file diff --git a/src/Services/UserService.php b/src/Services/UserService.php new file mode 100755 index 0000000..8fe8002 --- /dev/null +++ b/src/Services/UserService.php @@ -0,0 +1,32 @@ +accountService->all()->where("id", $id)->first(); + } + + function search(string $term) + { + return $this->accountService->all()->filter(function ($account) use ($term) { + $namePart = explode(" ", $account->name); + if (str_contains(strtolower($account->email), strtolower($term))) { + return true; + } + foreach ($namePart as $part) { + if (str_contains(strtolower($part), strtolower($term))) { + return true; + }; + } + return false; + })->values(); + } +} diff --git a/src/Svelte/Svelte.php b/src/Svelte/Svelte.php new file mode 100755 index 0000000..954e36e --- /dev/null +++ b/src/Svelte/Svelte.php @@ -0,0 +1,39 @@ +
    ', $layout); + $jsonTag = sprintf('', $layout, $json); + + $divTag = sprintf('
    ', $layout); + + $svelte = $divTag . $jsonTag; + + return view('svelte', [ + 'svelte' => $svelte, + 'view' => $view, + 'data' => $data, + 'title' => $title, + 'layout' => $layout, + ]); + } + +} + diff --git a/storage/app/.gitignore b/storage/app/.gitignore new file mode 100755 index 0000000..fedb287 --- /dev/null +++ b/storage/app/.gitignore @@ -0,0 +1,4 @@ +* +!private/ +!public/ +!.gitignore diff --git a/storage/app/private/.gitignore b/storage/app/private/.gitignore new file mode 100755 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/app/private/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/app/public/.gitignore b/storage/app/public/.gitignore new file mode 100755 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/app/public/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/.gitignore b/storage/framework/.gitignore new file mode 100755 index 0000000..05c4471 --- /dev/null +++ b/storage/framework/.gitignore @@ -0,0 +1,9 @@ +compiled.php +config.php +down +events.scanned.php +maintenance.php +routes.php +routes.scanned.php +schedule-* +services.json diff --git a/storage/framework/cache/.gitignore b/storage/framework/cache/.gitignore new file mode 100755 index 0000000..01e4a6c --- /dev/null +++ b/storage/framework/cache/.gitignore @@ -0,0 +1,3 @@ +* +!data/ +!.gitignore diff --git a/storage/framework/cache/data/.gitignore b/storage/framework/cache/data/.gitignore new file mode 100755 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/framework/cache/data/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/sessions/.gitignore b/storage/framework/sessions/.gitignore new file mode 100755 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/framework/sessions/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/testing/.gitignore b/storage/framework/testing/.gitignore new file mode 100755 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/framework/testing/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/views/.gitignore b/storage/framework/views/.gitignore new file mode 100755 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/framework/views/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/logs/.gitignore b/storage/logs/.gitignore new file mode 100755 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/logs/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/lucent/lucent.schemas.json b/storage/lucent/lucent.schemas.json new file mode 100755 index 0000000..c7203ed --- /dev/null +++ b/storage/lucent/lucent.schemas.json @@ -0,0 +1 @@ +{"schemas":[{"type":"collection","name":"comments","label":"Comments","visible":[],"groups":[],"fields":[{"name":"comment","label":"Comment","ui":"text"}],"isEntry":true,"color":"","sortBy":"-_sys.updatedAt","cardTitle":null,"cardImage":null,"revisions":0,"read":[],"write":[]},{"type":"collection","name":"honeycombStatuses","label":"Honeycomb Statuses","visible":[],"groups":[],"fields":[{"name":"status","label":"Status","ui":"text"}],"isEntry":true,"color":"","sortBy":"-_sys.updatedAt","cardTitle":null,"cardImage":null,"revisions":0,"read":[],"write":[]},{"type":"collection","name":"honeycombs","label":"Honeycombs","visible":[],"groups":[],"fields":[{"name":"name","label":"Name","ui":"text"},{"name":"description","label":"Description","ui":"rich"},{"name":"dueDate","label":"Due Date","ui":"datetime"},{"name":"assignTo","label":"Assign To","ui":"reference","collections":["userIds"]},{"name":"comments","label":"Comments","ui":"reference","collections":["comments"]},{"name":"followers","label":"Followers","ui":"reference","collections":["userIds"]},{"name":"status","label":"Status","ui":"reference","collections":["honeycombStatuses"],"max":1}],"isEntry":true,"color":"","sortBy":"-_sys.updatedAt","cardTitle":null,"cardImage":null,"revisions":0,"read":[],"write":[]},{"type":"collection","name":"userIds","label":"User Ids","visible":[],"groups":[],"fields":[{"name":"userId","label":"userId","ui":"text"}],"isEntry":true,"color":"","sortBy":"-_sys.updatedAt","cardTitle":null,"cardImage":null,"revisions":0,"read":[],"write":[]},{"type":"files","name":"trixImages","label":"trixImages","fields":[],"disk":"lucent","path":"trixImages","groups":[],"isEntry":false,"sortBy":"-_sys.updatedAt","color":"","cardTitle":null,"cardImage":null,"revisions":0,"read":[],"write":[]}],"roles":["admin","removed"]} \ No newline at end of file diff --git a/svelte.config.js b/svelte.config.js new file mode 100755 index 0000000..2eb2dec --- /dev/null +++ b/svelte.config.js @@ -0,0 +1,8 @@ +import { vitePreprocess } from '@sveltejs/vite-plugin-svelte' + +export default { + // Consult https://svelte.dev/docs#compile-time-svelte-preprocess + // for more information about preprocessors + preprocess: vitePreprocess(), +} + \ No newline at end of file diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100755 index 0000000..ce0c57f --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,20 @@ +import defaultTheme from 'tailwindcss/defaultTheme'; + +/** @type {import('tailwindcss').Config} */ +export default { + content: [ + './vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php', + './storage/framework/views/*.php', + './resources/**/*.blade.php', + './resources/**/*.js', + './resources/**/*.vue', + ], + theme: { + extend: { + fontFamily: { + sans: ['Figtree', ...defaultTheme.fontFamily.sans], + }, + }, + }, + plugins: [], +}; diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php new file mode 100755 index 0000000..8364a84 --- /dev/null +++ b/tests/Feature/ExampleTest.php @@ -0,0 +1,19 @@ +get('/'); + + $response->assertStatus(200); + } +} diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100755 index 0000000..fe1ffc2 --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,10 @@ +assertTrue(true); + } +} diff --git a/vite.config.js b/vite.config.js new file mode 100755 index 0000000..c82341d --- /dev/null +++ b/vite.config.js @@ -0,0 +1,12 @@ +import { defineConfig } from "vite"; + +import laravel from "laravel-vite-plugin"; + +export default defineConfig({ + plugins: [ + laravel({ + input: ["resources/sass/app.scss", "resources/js/app.js"], + refresh: true, + }) + ], +});