diff --git a/composer.json b/composer.json index 5b37f5e..c468442 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,11 @@ ], "require": { "php": ">=7.3.0 <8.1.0", - "getkirby/cms": "^3.5", - "amteich/kirby-twig": "^4.1", - "sylvainjule/matomo": "^1.0", - "kirbyzone/sitemapper": "^1.2", - "mullema/k3-image-clip": "^3.0" + "getkirby/cms": "^3.9.3", + "sylvainjule/matomo": "^1.0.7", + "kirbyzone/sitemapper": "^1.2.1", + "mullema/k3-image-clip": "^3.2", + "wearejust/kirby-twig": "^5.0" }, "scripts": { "start": [ diff --git a/composer.lock b/composer.lock index 83da89c..82255e0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,71 +4,30 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fac28f73cea5cec843631a10a9a4e395", + "content-hash": "1eea08bbd27b19165eede332e5e42d26", "packages": [ - { - "name": "amteich/kirby-twig", - "version": "4.2.0", - "source": { - "type": "git", - "url": "https://github.com/amteich/kirby-twig.git", - "reference": "7cdc1e5d78a19e8e395c1d3516fe90bf512c20fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amteich/kirby-twig/zipball/7cdc1e5d78a19e8e395c1d3516fe90bf512c20fb", - "reference": "7cdc1e5d78a19e8e395c1d3516fe90bf512c20fb", - "shasum": "" - }, - "require": { - "getkirby/composer-installer": "^1.1", - "twig/twig": "^3.4" - }, - "type": "kirby-plugin", - "autoload": { - "psr-4": { - "amteich\\Twig\\": "src/classes/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Zehetner", - "email": "christian@am-teich.com" - }, - { - "name": "Florens Verschelde", - "email": "florens@fvsch.com" - } - ], - "description": "Twig templating support for Kirby CMS", - "support": { - "issues": "https://github.com/amteich/kirby-twig/issues", - "source": "https://github.com/amteich/kirby-twig/tree/4.2.0" - }, - "time": "2022-12-09T21:39:13+00:00" - }, { "name": "claviska/simpleimage", - "version": "3.7.0", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/claviska/SimpleImage.git", - "reference": "abd15ced313c7b8041d7d73d8d2398b4f2510cf1" + "reference": "226d507cca0c8400d69bee7eb324158e3cbe246e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/claviska/SimpleImage/zipball/abd15ced313c7b8041d7d73d8d2398b4f2510cf1", - "reference": "abd15ced313c7b8041d7d73d8d2398b4f2510cf1", + "url": "https://api.github.com/repos/claviska/SimpleImage/zipball/226d507cca0c8400d69bee7eb324158e3cbe246e", + "reference": "226d507cca0c8400d69bee7eb324158e3cbe246e", "shasum": "" }, "require": { "ext-gd": "*", - "league/color-extractor": "0.3.*", - "php": ">=5.6.0" + "league/color-extractor": "0.4.*", + "php": ">=8.0" + }, + "require-dev": { + "laravel/pint": "^1.5", + "phpstan/phpstan": "^1.10" }, "type": "library", "autoload": { @@ -90,7 +49,7 @@ "description": "A PHP class that makes working with images as simple as possible.", "support": { "issues": "https://github.com/claviska/SimpleImage/issues", - "source": "https://github.com/claviska/SimpleImage/tree/3.7.0" + "source": "https://github.com/claviska/SimpleImage/tree/4.0.2" }, "funding": [ { @@ -98,7 +57,7 @@ "type": "github" } ], - "time": "2022-07-05T13:18:44+00:00" + "time": "2023-03-20T15:27:20+00:00" }, { "name": "composer/semver", @@ -183,16 +142,16 @@ }, { "name": "filp/whoops", - "version": "2.14.6", + "version": "2.15.1", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "f7948baaa0330277c729714910336383286305da" + "reference": "e864ac957acd66e1565f25efda61e37791a5db0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/f7948baaa0330277c729714910336383286305da", - "reference": "f7948baaa0330277c729714910336383286305da", + "url": "https://api.github.com/repos/filp/whoops/zipball/e864ac957acd66e1565f25efda61e37791a5db0b", + "reference": "e864ac957acd66e1565f25efda61e37791a5db0b", "shasum": "" }, "require": { @@ -242,7 +201,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.14.6" + "source": "https://github.com/filp/whoops/tree/2.15.1" }, "funding": [ { @@ -250,24 +209,24 @@ "type": "github" } ], - "time": "2022-11-02T16:23:29+00:00" + "time": "2023-03-06T18:09:13+00:00" }, { "name": "getkirby/cms", - "version": "3.8.3", + "version": "3.9.3", "source": { "type": "git", "url": "https://github.com/getkirby/kirby.git", - "reference": "41719bd54310dfc2e321a75a8549da98ccf5cd1d" + "reference": "ce4aaace87ceca1f019a9cfc0293a69e662f9648" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getkirby/kirby/zipball/41719bd54310dfc2e321a75a8549da98ccf5cd1d", - "reference": "41719bd54310dfc2e321a75a8549da98ccf5cd1d", + "url": "https://api.github.com/repos/getkirby/kirby/zipball/ce4aaace87ceca1f019a9cfc0293a69e662f9648", + "reference": "ce4aaace87ceca1f019a9cfc0293a69e662f9648", "shasum": "" }, "require": { - "claviska/simpleimage": "3.7.0", + "claviska/simpleimage": "4.0.2", "composer/semver": "3.3.2", "ext-ctype": "*", "ext-curl": "*", @@ -280,14 +239,14 @@ "ext-mbstring": "*", "ext-openssl": "*", "ext-simplexml": "*", - "filp/whoops": "2.14.6", + "filp/whoops": "2.15.1", "getkirby/composer-installer": "^1.2.1", "laminas/laminas-escaper": "2.12.0", "michelf/php-smartypants": "1.8.1", - "php": ">=8.0.0 <8.2.0", - "phpmailer/phpmailer": "6.6.5", - "symfony/polyfill-intl-idn": "1.26.0", - "symfony/polyfill-mbstring": "1.26.0" + "php": ">=8.0.0 <8.3.0", + "phpmailer/phpmailer": "6.8.0", + "symfony/polyfill-intl-idn": "1.27.0", + "symfony/polyfill-mbstring": "1.27.0" }, "replace": { "symfony/polyfill-php72": "*" @@ -350,7 +309,7 @@ "type": "custom" } ], - "time": "2022-12-06T14:31:06+00:00" + "time": "2023-03-30T13:10:22+00:00" }, { "name": "getkirby/composer-installer", @@ -500,33 +459,36 @@ }, { "name": "league/color-extractor", - "version": "0.3.2", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/thephpleague/color-extractor.git", - "reference": "837086ec60f50c84c611c613963e4ad2e2aec806" + "reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/color-extractor/zipball/837086ec60f50c84c611c613963e4ad2e2aec806", - "reference": "837086ec60f50c84c611c613963e4ad2e2aec806", + "url": "https://api.github.com/repos/thephpleague/color-extractor/zipball/21fcac6249c5ef7d00eb83e128743ee6678fe505", + "reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505", "shasum": "" }, "require": { "ext-gd": "*", - "php": ">=5.4.0" + "php": "^7.3 || ^8.0" }, "replace": { "matthecat/colorextractor": "*" }, "require-dev": { "friendsofphp/php-cs-fixer": "~2", - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^9.5" + }, + "suggest": { + "ext-curl": "To download images from remote URLs if allow_url_fopen is disabled for security reasons" }, "type": "library", "autoload": { "psr-4": { - "": "src" + "League\\ColorExtractor\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -552,9 +514,9 @@ ], "support": { "issues": "https://github.com/thephpleague/color-extractor/issues", - "source": "https://github.com/thephpleague/color-extractor/tree/master" + "source": "https://github.com/thephpleague/color-extractor/tree/0.4.0" }, - "time": "2016-12-15T09:30:02+00:00" + "time": "2022-09-24T15:57:16+00:00" }, { "name": "michelf/php-smartypants", @@ -654,16 +616,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.6.5", + "version": "v6.8.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627" + "reference": "df16b615e371d81fb79e506277faea67a1be18f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/8b6386d7417526d1ea4da9edb70b8352f7543627", - "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/df16b615e371d81fb79e506277faea67a1be18f1", + "reference": "df16b615e371d81fb79e506277faea67a1be18f1", "shasum": "" }, "require": { @@ -673,17 +635,19 @@ "php": ">=5.5.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.2", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "doctrine/annotations": "^1.2.6 || ^1.13.3", "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.6.2", - "yoast/phpunit-polyfills": "^1.0.0" + "squizlabs/php_codesniffer": "^3.7.1", + "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", @@ -720,7 +684,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.5" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.0" }, "funding": [ { @@ -728,7 +692,7 @@ "type": "github" } ], - "time": "2022-10-07T12:23:10+00:00" + "time": "2023-03-06T14:43:22+00:00" }, { "name": "psr/log", @@ -902,16 +866,16 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8" + "reference": "639084e360537a19f9ee352433b84ce831f3d2da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/59a8d271f00dd0e4c2e518104cc7963f655a1aa8", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", + "reference": "639084e360537a19f9ee352433b84ce831f3d2da", "shasum": "" }, "require": { @@ -925,7 +889,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -969,7 +933,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.27.0" }, "funding": [ { @@ -985,7 +949,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-normalizer", @@ -1073,16 +1037,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "shasum": "" }, "require": { @@ -1097,7 +1061,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1136,7 +1100,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" }, "funding": [ { @@ -1152,20 +1116,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "twig/twig", - "version": "v3.4.3", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58" + "reference": "a6e0510cc793912b451fd40ab983a1d28f611c15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/c38fd6b0b7f370c198db91ffd02e23b517426b58", - "reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/a6e0510cc793912b451fd40ab983a1d28f611c15", + "reference": "a6e0510cc793912b451fd40ab983a1d28f611c15", "shasum": "" }, "require": { @@ -1180,7 +1144,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.5-dev" } }, "autoload": { @@ -1216,7 +1180,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.4.3" + "source": "https://github.com/twigphp/Twig/tree/v3.5.1" }, "funding": [ { @@ -1228,7 +1192,55 @@ "type": "tidelift" } ], - "time": "2022-09-28T08:42:51+00:00" + "time": "2023-02-08T07:49:20+00:00" + }, + { + "name": "wearejust/kirby-twig", + "version": "5.0", + "source": { + "type": "git", + "url": "https://github.com/wearejust/kirby-twig.git", + "reference": "b8951bb5bdbeb829f492ee55709a2bdcc9d7475e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wearejust/kirby-twig/zipball/b8951bb5bdbeb829f492ee55709a2bdcc9d7475e", + "reference": "b8951bb5bdbeb829f492ee55709a2bdcc9d7475e", + "shasum": "" + }, + "require": { + "getkirby/composer-installer": "^1.1", + "twig/twig": "^3.4" + }, + "type": "kirby-plugin", + "autoload": { + "psr-4": { + "Wearejust\\Kirby\\Twig\\": "src/classes/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Cees van Egmond", + "email": "cees.vanegmond@wearejust.com" + }, + { + "name": "Sietse Veenman", + "email": "sietse.veenman@wearejust.com" + }, + { + "name": "Duncan Pronk", + "email": "duncan.pronk@wearejust.com" + } + ], + "description": "Twig templating support for Kirby CMS", + "support": { + "source": "https://github.com/wearejust/kirby-twig/tree/5.0" + }, + "time": "2023-02-24T12:16:24+00:00" } ], "packages-dev": [], diff --git a/kirby/CONTRIBUTING.md b/kirby/CONTRIBUTING.md index 06ddc3a..a3bd4a2 100644 --- a/kirby/CONTRIBUTING.md +++ b/kirby/CONTRIBUTING.md @@ -20,7 +20,7 @@ We will review all pull requests (PRs) to `develop` and merge them if accepted, ### Report a bug -When you find a bug, the first step to fixing it is to help us understand and reproduce the bug as best as possible. When you create a bug report, please include as many details as possible. Fill out [the template](ISSUE_TEMPLATE/bug_report.md) because the requested information helps us resolve issues so much faster. +When you find a bug, the first step to fixing it is to help us understand and reproduce the bug as best as possible. When you create a bug report, please include as many details as possible. Fill out [the template](https://github.com/getkirby/kirby/issues/new?template=bug_report.md) because the requested information helps us resolve issues so much faster. ### Bug fixes diff --git a/kirby/LICENSE.md b/kirby/LICENSE.md index eb852a4..8d109fe 100644 --- a/kirby/LICENSE.md +++ b/kirby/LICENSE.md @@ -1,7 +1,7 @@ # Kirby License Agreement -Published: March 15, 2022 -Source: https://getkirby.com/license/2022-03-15 +Published: March 21, 2023 +Source: https://getkirby.com/license/2023-03-21 ## About this Agreement @@ -37,7 +37,7 @@ As Kirby is software and software is intangible, We don't sell it as such. Inste The license is **non-exclusive** (meaning that You are not the only one who We will issue a license) and **generally non-transferable** (meaning that the one who purchases the license is the licensee). -On request, We will **transfer** a license to anyone who is also allowed to buy Kirby licenses by law and this Agreement. +On request, We will **transfer** a license to anyone who is also allowed to buy Kirby licenses by law and this Agreement. The new licensee will take over all rights and obligations of this Agreement from You at the moment We confirm the license transfer. We will also **reassign** a license to another Website domain and root directory of Your choice, provided that You confirm that the previous Website is no longer in operation and will not be operated with the same license in the future. @@ -98,13 +98,18 @@ You may only use Kirby in a manner that complies with any and all **applicable l ### Making Copies -You may make **copies of Kirby** in any machine readable form solely for purposes of **deploying a Website to a server, developing a Website on a personal computer or server or as a backup**, provided that You reproduce Kirby in its original form and with all proprietary notices on the copy. +You may make **copies of Kirby** in any machine readable form solely for the **following purposes**, provided that You reproduce Kirby in its original form and with all proprietary notices on the copy: + +- when deploying a Website to a server, +- when developing a Website on a personal computer or server, +- when working on code contributions to Kirby or +- as a backup. You may _not_ reproduce Kirby or its Source Code, in whole or in part, for **any other purpose**. ### Modification of the Source Code -You may **alter, modify or extend the Source Code** for Your own use. You may also **commission a third party** to perform those modifications for You. +You may **alter, modify or extend the Source Code** for Your own use or with the intention to contribute Your changes back to Kirby. You may also **commission a third party** to perform those modifications for You. However You may _not_: @@ -177,7 +182,13 @@ KIRBY IS OFFERED ON AN **"AS-IS" BASIS** AND **NO WARRANTY**, EITHER EXPRESSED O ## Term, Termination and Modification -You may use Kirby under this Agreement until either party terminates this Agreement as described in this paragraph. Either party may **terminate the Agreement** at any time, upon notice to the other party in textual form (via email or letter). Upon termination, all or the specified **licenses granted to You will terminate**, and You will **immediately uninstall and cease all use** of Kirby. If not all licenses are terminated, You may continue to use Kirby for the Websites with active licenses. The sections entitled "No Warranty", "Indemnification" and "Limitation of Liability" will **survive any termination** of this Agreement. +You may **indefinitely use** all Kirby versions that are covered by Your license under this Agreement until either party **terminates this Agreement** as described in this section. + +**You** may terminate the Agreement at any time. + +**We** may only terminate the Agreement if You or any individual or company who works with Kirby or uses it on Your behalf has violated or failed to comply with terms of this Agreement. If Your compliance with the Agreement can be restored by fixing the violation or non-compliance, We will first contact You with information on the specific term that was violated or not complied with and will allow reasonable time of at least 14 days before We will decide on a license termination. Should We be in the position to terminate a license according to this paragraph, other or all licenses granted to You may be terminated for the same reason(s) at the same time or at any later date. + +Termination takes effect upon notice to the other party in textual form (via email or letter). Upon termination, the specified **licenses granted to You will terminate**, and You will **immediately uninstall and cease all use** of Kirby. If not all licenses are terminated, You may continue to use Kirby for the Websites with active licenses. The sections entitled "No Warranty", "Indemnification" and "Limitation of Liability" will **survive any termination** of this Agreement. We may **modify Kirby and this Agreement** with notice to You either via email or by publishing content on the Kirby website at https://getkirby.com, including but not limited to changing the functionality or appearance of Kirby. Any such modification will **become binding on You** unless You terminate this Agreement. Changes to this Agreement that constrain Your rights to a great extent will only become effective with Your approval in textual or electronic form. diff --git a/kirby/README.md b/kirby/README.md index 2075a4f..a45e644 100644 --- a/kirby/README.md +++ b/kirby/README.md @@ -1,10 +1,9 @@ -[](https://getkirby.com) +[](https://getkirby.com) -[![Release](https://badgen.net/github/release/getkirby/kirby/stable?color=yellow)](https://github.com/getkirby/kirby/releases/latest) -[![CI Status](https://github.com/getkirby/kirby/workflows/CI/badge.svg)](https://github.com/getkirby/kirby/actions?query=workflow%3ACI) -[![Coverage Status](https://badgen.net/codecov/c/gh/getkirby/kirby/main?label=coverage)](https://codecov.io/gh/getkirby/kirby) -[![Downloads](https://badgen.net/packagist/dt/getkirby/cms?color=red)](https://github.com/getkirby/kirby/releases/latest) -[![Twitter](https://badgen.net/twitter/follow/getkirby?color=cyan)](https://twitter.com/getkirby) +[![Release](https://img.shields.io/github/v/release/getkirby/kirby)](https://github.com/getkirby/kirby/releases/latest) +[![CI Status](https://img.shields.io/github/actions/workflow/status/getkirby/kirby/ci.yml?branch=main&label=CI)](https://github.com/getkirby/kirby/actions?query=workflow%3ACI+branch%3Amain) +[![Coverage Status](https://img.shields.io/codecov/c/gh/getkirby/kirby?token=ROZ2RVA0OF)](https://codecov.io/gh/getkirby/kirby) +[![Downloads](https://img.shields.io/packagist/dt/getkirby/cms?color=red)](https://github.com/getkirby/kirby/releases/latest) **Kirby: the CMS that adapts to any project, loved by developers and editors alike.** With Kirby, you build your own ideal interface. Combine forms, galleries, articles, spreadsheets and more into an amazing editing experience. You can learn more about Kirby at [getkirby.com](https://getkirby.com). @@ -14,7 +13,7 @@ This is Kirby's core application folder. Get started with one of the following r - [Starterkit](https://github.com/getkirby/starterkit) - [Plainkit](https://github.com/getkirby/plainkit) - + ### Try Kirby for free Kirby is not free software. However, you can try Kirby and the Starterkit on your local machine or on a test server as long as you need to make sure it is the right tool for your next project. … and when you’re convinced, [buy your license](https://getkirby.com/buy). @@ -30,8 +29,6 @@ If you have ideas for a feature or enhancement for Kirby, please use our [feedba **Translations, bug fixes, code contributions ...** Read about how to contribute to the development in our [contributing guide](/CONTRIBUTING.md). - - ## What's Kirby? - **[getkirby.com](https://getkirby.com)** – Get to know the CMS. - **[Try it](https://getkirby.com/try)** – Take a test ride with our online demo. Or download one of our kits to get started. @@ -40,10 +37,11 @@ Read about how to contribute to the development in our [contributing guide](/CON - **[Feedback](https://feedback.getkirby.com)** – You have an idea for Kirby? Share it. - **[Forum](https://forum.getkirby.com)** – Whenever you get stuck, don't hesitate to reach out for questions and support. - **[Discord](https://chat.getkirby.com)** – Hang out and meet the community. -- **[Twitter](https://twitter.com/getkirby)** – Spread the word. +- **[YouTube](https://youtube.com/kirbyCasts)** - Watch the latest video tutorials visually with Bastian. +- **[Mastodon](https://mastodon.social/@getkirby)** – Spread the word. - **[Instagram](https://www.instagram.com/getkirby/)** – Share your creations: #madewithkirby. --- -© 2009-2022 Bastian Allgeier +© 2009-2023 Bastian Allgeier [getkirby.com](https://getkirby.com) · [License agreement](https://getkirby.com/license) diff --git a/kirby/bootstrap.php b/kirby/bootstrap.php index 472c0ad..d61e5e5 100644 --- a/kirby/bootstrap.php +++ b/kirby/bootstrap.php @@ -6,7 +6,7 @@ */ if ( version_compare(PHP_VERSION, '8.0.0', '>=') === false || - version_compare(PHP_VERSION, '8.2.0', '<') === false + version_compare(PHP_VERSION, '8.3.0', '<') === false ) { die(include __DIR__ . '/views/php.php'); } diff --git a/kirby/cacert.pem b/kirby/cacert.pem index 0c69f9f..2ae7b6c 100644 --- a/kirby/cacert.pem +++ b/kirby/cacert.pem @@ -1,7 +1,7 @@ ## ## Bundle of CA Root Certificates ## -## Certificate data from Mozilla as of: Tue Oct 11 03:12:05 2022 GMT +## Certificate data from Mozilla as of: Tue Jan 10 04:12:06 2023 GMT ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates @@ -14,7 +14,7 @@ ## Just configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version 1.29. -## SHA256: 3ff8bd209b5f2e739b9f2b96eacb694a774114685b02978257824f37ff528f71 +## SHA256: 90c470e705b4b5f36f09684dc50e2b79c8b86989a848b62cd1a7bd6460ee65f6 ## @@ -489,29 +489,6 @@ IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN +8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== -----END CERTIFICATE----- -Network Solutions Certificate Authority -======================================= ------BEGIN CERTIFICATE----- -MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG -EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr -IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx -MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu -MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx -jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT -aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT -crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc -/Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB -AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP -BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv -bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA -A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q -4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/ -GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv -wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD -ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey ------END CERTIFICATE----- - COMODO ECC Certification Authority ================================== -----BEGIN CERTIFICATE----- @@ -1654,36 +1631,6 @@ uglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7 yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL+SvzZpA3 -----END CERTIFICATE----- -Staat der Nederlanden EV Root CA -================================ ------BEGIN CERTIFICATE----- -MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJOTDEeMBwGA1UE -CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFhdCBkZXIgTmVkZXJsYW5kZW4g -RVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0yMjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5M -MR4wHAYDVQQKDBVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRl -cmxhbmRlbiBFViBSb290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkk -SzrSM4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nCUiY4iKTW -O0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZmdO3dZ//BYY1jTw+bbRcwJu+r -0h8QoPnFfxZpgQNH7R5ojXKhTbImxrpsX23Wr9GxE46prfNeaXUmGD5BKyF/7otdBwadQ8QpCiv8 -Kj6GyzyDOvnJDdrFmeK8eEEzduG/L13lpJhQDBXd4Pqcfzho0LKmeqfRMb1+ilgnQ7O6M5HTp5gV -XJrm0w912fxBmJc+qiXbj5IusHsMX/FjqTf5m3VpTCgmJdrV8hJwRVXj33NeN/UhbJCONVrJ0yPr -08C+eKxCKFhmpUZtcALXEPlLVPxdhkqHz3/KRawRWrUgUY0viEeXOcDPusBCAUCZSCELa6fS/ZbV -0b5GnUngC6agIk440ME8MLxwjyx1zNDFjFE7PZQIZCZhfbnDZY8UnCHQqv0XcgOPvZuM5l5Tnrmd -74K74bzickFbIZTTRTeU0d8JOV3nI6qaHcptqAqGhYqCvkIH1vI4gnPah1vlPNOePqc7nvQDs/nx -fRN0Av+7oeX6AHkcpmZBiFxgV6YuCcS6/ZrPpx9Aw7vMWgpVSzs4dlG4Y4uElBbmVvMCAwEAAaNC -MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFP6rAJCYniT8qcwa -ivsnuL8wbqg7MA0GCSqGSIb3DQEBCwUAA4ICAQDPdyxuVr5Os7aEAJSrR8kN0nbHhp8dB9O2tLsI -eK9p0gtJ3jPFrK3CiAJ9Brc1AsFgyb/E6JTe1NOpEyVa/m6irn0F3H3zbPB+po3u2dfOWBfoqSmu -c0iH55vKbimhZF8ZE/euBhD/UcabTVUlT5OZEAFTdfETzsemQUHSv4ilf0X8rLiltTMMgsT7B/Zq -5SWEXwbKwYY5EdtYzXc7LMJMD16a4/CrPmEbUCTCwPTxGfARKbalGAKb12NMcIxHowNDXLldRqAN -b/9Zjr7dn3LDWyvfjFvO5QxGbJKyCqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW2HNnh/tN -f1zuacpzEPuKqf2evTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi -5Dp6Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIaGl6I6lD4 -WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeLeG9QgkRQP2YGiqtDhFZK -DyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGy -eUN51q1veieQA6TqJIc/2b3Z6fJfUEkc7uzXLg== ------END CERTIFICATE----- - IdenTrust Commercial Root CA 1 ============================== -----BEGIN CERTIFICATE----- @@ -2135,87 +2082,6 @@ F8Io2c9Si1vIY9RCPqAzekYu9wogRlR+ak8x8YF+QnQ4ZXMn7sZ8uI7XpTrXmKGcjBBV09tL7ECQ aaApJUqlyyvdimYHFngVV3Eb7PVHhPOeMTd61X8kreS8/f3MboPoDKi3QWwH3b08hpcv0g== -----END CERTIFICATE----- -TrustCor RootCert CA-1 -====================== ------BEGIN CERTIFICATE----- -MIIEMDCCAxigAwIBAgIJANqb7HHzA7AZMA0GCSqGSIb3DQEBCwUAMIGkMQswCQYDVQQGEwJQQTEP -MA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEkMCIGA1UECgwbVHJ1c3RDb3Ig -U3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5UcnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3Jp -dHkxHzAdBgNVBAMMFlRydXN0Q29yIFJvb3RDZXJ0IENBLTEwHhcNMTYwMjA0MTIzMjE2WhcNMjkx -MjMxMTcyMzE2WjCBpDELMAkGA1UEBhMCUEExDzANBgNVBAgMBlBhbmFtYTEUMBIGA1UEBwwLUGFu -YW1hIENpdHkxJDAiBgNVBAoMG1RydXN0Q29yIFN5c3RlbXMgUy4gZGUgUi5MLjEnMCUGA1UECwwe -VHJ1c3RDb3IgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYDVQQDDBZUcnVzdENvciBSb290Q2Vy -dCBDQS0xMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv463leLCJhJrMxnHQFgKq1mq -jQCj/IDHUHuO1CAmujIS2CNUSSUQIpidRtLByZ5OGy4sDjjzGiVoHKZaBeYei0i/mJZ0PmnK6bV4 -pQa81QBeCQryJ3pS/C3Vseq0iWEk8xoT26nPUu0MJLq5nux+AHT6k61sKZKuUbS701e/s/OojZz0 -JEsq1pme9J7+wH5COucLlVPat2gOkEz7cD+PSiyU8ybdY2mplNgQTsVHCJCZGxdNuWxu72CVEY4h -gLW9oHPY0LJ3xEXqWib7ZnZ2+AYfYW0PVcWDtxBWcgYHpfOxGgMFZA6dWorWhnAbJN7+KIor0Gqw -/Hqi3LJ5DotlDwIDAQABo2MwYTAdBgNVHQ4EFgQU7mtJPHo/DeOxCbeKyKsZn3MzUOcwHwYDVR0j -BBgwFoAU7mtJPHo/DeOxCbeKyKsZn3MzUOcwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AYYwDQYJKoZIhvcNAQELBQADggEBACUY1JGPE+6PHh0RU9otRCkZoB5rMZ5NDp6tPVxBb5UrJKF5 -mDo4Nvu7Zp5I/5CQ7z3UuJu0h3U/IJvOcs+hVcFNZKIZBqEHMwwLKeXx6quj7LUKdJDHfXLy11yf -ke+Ri7fc7Waiz45mO7yfOgLgJ90WmMCV1Aqk5IGadZQ1nJBfiDcGrVmVCrDRZ9MZyonnMlo2HD6C -qFqTvsbQZJG2z9m2GM/bftJlo6bEjhcxwft+dtvTheNYsnd6djtsL1Ac59v2Z3kf9YKVmgenFK+P -3CghZwnS1k1aHBkcjndcw5QkPTJrS37UeJSDvjdNzl/HHk484IkzlQsPpTLWPFp5LBk= ------END CERTIFICATE----- - -TrustCor RootCert CA-2 -====================== ------BEGIN CERTIFICATE----- -MIIGLzCCBBegAwIBAgIIJaHfyjPLWQIwDQYJKoZIhvcNAQELBQAwgaQxCzAJBgNVBAYTAlBBMQ8w -DQYDVQQIDAZQYW5hbWExFDASBgNVBAcMC1BhbmFtYSBDaXR5MSQwIgYDVQQKDBtUcnVzdENvciBT -eXN0ZW1zIFMuIGRlIFIuTC4xJzAlBgNVBAsMHlRydXN0Q29yIENlcnRpZmljYXRlIEF1dGhvcml0 -eTEfMB0GA1UEAwwWVHJ1c3RDb3IgUm9vdENlcnQgQ0EtMjAeFw0xNjAyMDQxMjMyMjNaFw0zNDEy -MzExNzI2MzlaMIGkMQswCQYDVQQGEwJQQTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5h -bWEgQ2l0eTEkMCIGA1UECgwbVHJ1c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5U -cnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxHzAdBgNVBAMMFlRydXN0Q29yIFJvb3RDZXJ0 -IENBLTIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCnIG7CKqJiJJWQdsg4foDSq8Gb -ZQWU9MEKENUCrO2fk8eHyLAnK0IMPQo+QVqedd2NyuCb7GgypGmSaIwLgQ5WoD4a3SwlFIIvl9Nk -RvRUqdw6VC0xK5mC8tkq1+9xALgxpL56JAfDQiDyitSSBBtlVkxs1Pu2YVpHI7TYabS3OtB0PAx1 -oYxOdqHp2yqlO/rOsP9+aij9JxzIsekp8VduZLTQwRVtDr4uDkbIXvRR/u8OYzo7cbrPb1nKDOOb -XUm4TOJXsZiKQlecdu/vvdFoqNL0Cbt3Nb4lggjEFixEIFapRBF37120Hapeaz6LMvYHL1cEksr1 -/p3C6eizjkxLAjHZ5DxIgif3GIJ2SDpxsROhOdUuxTTCHWKF3wP+TfSvPd9cW436cOGlfifHhi5q -jxLGhF5DUVCcGZt45vz27Ud+ez1m7xMTiF88oWP7+ayHNZ/zgp6kPwqcMWmLmaSISo5uZk3vFsQP -eSghYA2FFn3XVDjxklb9tTNMg9zXEJ9L/cb4Qr26fHMC4P99zVvh1Kxhe1fVSntb1IVYJ12/+Ctg -rKAmrhQhJ8Z3mjOAPF5GP/fDsaOGM8boXg25NSyqRsGFAnWAoOsk+xWq5Gd/bnc/9ASKL3x74xdh -8N0JqSDIvgmk0H5Ew7IwSjiqqewYmgeCK9u4nBit2uBGF6zPXQIDAQABo2MwYTAdBgNVHQ4EFgQU -2f4hQG6UnrybPZx9mCAZ5YwwYrIwHwYDVR0jBBgwFoAU2f4hQG6UnrybPZx9mCAZ5YwwYrIwDwYD -VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIBAJ5Fngw7tu/h -Osh80QA9z+LqBrWyOrsGS2h60COXdKcs8AjYeVrXWoSK2BKaG9l9XE1wxaX5q+WjiYndAfrs3fnp -kpfbsEZC89NiqpX+MWcUaViQCqoL7jcjx1BRtPV+nuN79+TMQjItSQzL/0kMmx40/W5ulop5A7Zv -2wnL/V9lFDfhOPXzYRZY5LVtDQsEGz9QLX+zx3oaFoBg+Iof6Rsqxvm6ARppv9JYx1RXCI/hOWB3 -S6xZhBqI8d3LT3jX5+EzLfzuQfogsL7L9ziUwOHQhQ+77Sxzq+3+knYaZH9bDTMJBzN7Bj8RpFxw -PIXAz+OQqIN3+tvmxYxoZxBnpVIt8MSZj3+/0WvitUfW2dCFmU2Umw9Lje4AWkcdEQOsQRivh7dv -DDqPys/cA8GiCcjl/YBeyGBCARsaU1q7N6a3vLqE6R5sGtRk2tRD/pOLS/IseRYQ1JMLiI+h2IYU -RpFHmygk71dSTlxCnKr3Sewn6EAes6aJInKc9Q0ztFijMDvd1GpUk74aTfOTlPf8hAs/hCBcNANE -xdqtvArBAs8e5ZTZ845b2EzwnexhF7sUMlQMAimTHpKG9n/v55IFDlndmQguLvqcAFLTxWYp5KeX -RKQOKIETNcX2b2TmQcTVL8w0RSXPQQCWPUouwpaYT05KnJe32x+SMsj/D1Fu1uwJ ------END CERTIFICATE----- - -TrustCor ECA-1 -============== ------BEGIN CERTIFICATE----- -MIIEIDCCAwigAwIBAgIJAISCLF8cYtBAMA0GCSqGSIb3DQEBCwUAMIGcMQswCQYDVQQGEwJQQTEP -MA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEkMCIGA1UECgwbVHJ1c3RDb3Ig -U3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5UcnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3Jp -dHkxFzAVBgNVBAMMDlRydXN0Q29yIEVDQS0xMB4XDTE2MDIwNDEyMzIzM1oXDTI5MTIzMTE3Mjgw -N1owgZwxCzAJBgNVBAYTAlBBMQ8wDQYDVQQIDAZQYW5hbWExFDASBgNVBAcMC1BhbmFtYSBDaXR5 -MSQwIgYDVQQKDBtUcnVzdENvciBTeXN0ZW1zIFMuIGRlIFIuTC4xJzAlBgNVBAsMHlRydXN0Q29y -IENlcnRpZmljYXRlIEF1dGhvcml0eTEXMBUGA1UEAwwOVHJ1c3RDb3IgRUNBLTEwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDPj+ARtZ+odnbb3w9U73NjKYKtR8aja+3+XzP4Q1HpGjOR -MRegdMTUpwHmspI+ap3tDvl0mEDTPwOABoJA6LHip1GnHYMma6ve+heRK9jGrB6xnhkB1Zem6g23 -xFUfJ3zSCNV2HykVh0A53ThFEXXQmqc04L/NyFIduUd+Dbi7xgz2c1cWWn5DkR9VOsZtRASqnKmc -p0yJF4OuowReUoCLHhIlERnXDH19MURB6tuvsBzvgdAsxZohmz3tQjtQJvLsznFhBmIhVE5/wZ0+ -fyCMgMsq2JdiyIMzkX2woloPV+g7zPIlstR8L+xNxqE6FXrntl019fZISjZFZtS6mFjBAgMBAAGj -YzBhMB0GA1UdDgQWBBREnkj1zG1I1KBLf/5ZJC+Dl5mahjAfBgNVHSMEGDAWgBREnkj1zG1I1KBL -f/5ZJC+Dl5mahjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsF -AAOCAQEABT41XBVwm8nHc2FvcivUwo/yQ10CzsSUuZQRg2dd4mdsdXa/uwyqNsatR5Nj3B5+1t4u -/ukZMjgDfxT2AHMsWbEhBuH7rBiVDKP/mZb3Kyeb1STMHd3BOuCYRLDE5D53sXOpZCz2HAF8P11F -hcCF5yWPldwX8zyfGm6wyuMdKulMY/okYWLW2n62HGz1Ah3UKt1VkOsqEUc8Ll50soIipX1TH0Xs -J5F95yIW6MBoNtjG8U+ARDL54dHRHareqKucBK+tIA5kmE2la8BIWJZpTdwHjFGTot+fDz2LYLSC -jaoITmJF4PkL0uDgPFveXHEnJcLmA4GLEFPjx1WitJ/X5g== ------END CERTIFICATE----- - SSL.com Root Certification Authority RSA ======================================== -----BEGIN CERTIFICATE----- diff --git a/kirby/composer.json b/kirby/composer.json index c010c7b..42f6c61 100644 --- a/kirby/composer.json +++ b/kirby/composer.json @@ -3,7 +3,7 @@ "description": "The Kirby 3 core", "license": "proprietary", "type": "kirby-cms", - "version": "3.8.3", + "version": "3.9.3", "keywords": [ "kirby", "cms", @@ -24,7 +24,7 @@ "source": "https://github.com/getkirby/kirby" }, "require": { - "php": ">=8.0.0 <8.2.0", + "php": ">=8.0.0 <8.3.0", "ext-SimpleXML": "*", "ext-ctype": "*", "ext-curl": "*", @@ -36,15 +36,15 @@ "ext-libxml": "*", "ext-mbstring": "*", "ext-openssl": "*", - "claviska/simpleimage": "3.7.0", + "claviska/simpleimage": "4.0.2", "composer/semver": "3.3.2", - "filp/whoops": "2.14.6", + "filp/whoops": "2.15.1", "getkirby/composer-installer": "^1.2.1", "laminas/laminas-escaper": "2.12.0", "michelf/php-smartypants": "1.8.1", - "phpmailer/phpmailer": "6.6.5", - "symfony/polyfill-intl-idn": "1.26.0", - "symfony/polyfill-mbstring": "1.26.0" + "phpmailer/phpmailer": "6.8.0", + "symfony/polyfill-intl-idn": "1.27.0", + "symfony/polyfill-mbstring": "1.27.0" }, "replace": { "symfony/polyfill-php72": "*" @@ -105,7 +105,8 @@ "@test" ], "fix": "php-cs-fixer fix", - "test": "phpunit --stderr --coverage-html=tests/coverage", + "test": "phpunit --stderr", + "test:coverage": "phpunit --stderr --coverage-html=tests/coverage", "zip": "composer archive --format=zip --file=dist" } } diff --git a/kirby/composer.lock b/kirby/composer.lock index 0489fb9..1bf005e 100644 --- a/kirby/composer.lock +++ b/kirby/composer.lock @@ -4,26 +4,30 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a2b48616382734757b5cf4a9bd73ccdb", + "content-hash": "b6d2cf1d95980cd8e5109f436f393339", "packages": [ { "name": "claviska/simpleimage", - "version": "3.7.0", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/claviska/SimpleImage.git", - "reference": "abd15ced313c7b8041d7d73d8d2398b4f2510cf1" + "reference": "226d507cca0c8400d69bee7eb324158e3cbe246e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/claviska/SimpleImage/zipball/abd15ced313c7b8041d7d73d8d2398b4f2510cf1", - "reference": "abd15ced313c7b8041d7d73d8d2398b4f2510cf1", + "url": "https://api.github.com/repos/claviska/SimpleImage/zipball/226d507cca0c8400d69bee7eb324158e3cbe246e", + "reference": "226d507cca0c8400d69bee7eb324158e3cbe246e", "shasum": "" }, "require": { "ext-gd": "*", - "league/color-extractor": "0.3.*", - "php": ">=5.6.0" + "league/color-extractor": "0.4.*", + "php": ">=8.0" + }, + "require-dev": { + "laravel/pint": "^1.5", + "phpstan/phpstan": "^1.10" }, "type": "library", "autoload": { @@ -45,7 +49,7 @@ "description": "A PHP class that makes working with images as simple as possible.", "support": { "issues": "https://github.com/claviska/SimpleImage/issues", - "source": "https://github.com/claviska/SimpleImage/tree/3.7.0" + "source": "https://github.com/claviska/SimpleImage/tree/4.0.2" }, "funding": [ { @@ -53,7 +57,7 @@ "type": "github" } ], - "time": "2022-07-05T13:18:44+00:00" + "time": "2023-03-20T15:27:20+00:00" }, { "name": "composer/semver", @@ -138,16 +142,16 @@ }, { "name": "filp/whoops", - "version": "2.14.6", + "version": "2.15.1", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "f7948baaa0330277c729714910336383286305da" + "reference": "e864ac957acd66e1565f25efda61e37791a5db0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/f7948baaa0330277c729714910336383286305da", - "reference": "f7948baaa0330277c729714910336383286305da", + "url": "https://api.github.com/repos/filp/whoops/zipball/e864ac957acd66e1565f25efda61e37791a5db0b", + "reference": "e864ac957acd66e1565f25efda61e37791a5db0b", "shasum": "" }, "require": { @@ -197,7 +201,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.14.6" + "source": "https://github.com/filp/whoops/tree/2.15.1" }, "funding": [ { @@ -205,7 +209,7 @@ "type": "github" } ], - "time": "2022-11-02T16:23:29+00:00" + "time": "2023-03-06T18:09:13+00:00" }, { "name": "getkirby/composer-installer", @@ -318,33 +322,36 @@ }, { "name": "league/color-extractor", - "version": "0.3.2", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/thephpleague/color-extractor.git", - "reference": "837086ec60f50c84c611c613963e4ad2e2aec806" + "reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/color-extractor/zipball/837086ec60f50c84c611c613963e4ad2e2aec806", - "reference": "837086ec60f50c84c611c613963e4ad2e2aec806", + "url": "https://api.github.com/repos/thephpleague/color-extractor/zipball/21fcac6249c5ef7d00eb83e128743ee6678fe505", + "reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505", "shasum": "" }, "require": { "ext-gd": "*", - "php": ">=5.4.0" + "php": "^7.3 || ^8.0" }, "replace": { "matthecat/colorextractor": "*" }, "require-dev": { "friendsofphp/php-cs-fixer": "~2", - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^9.5" + }, + "suggest": { + "ext-curl": "To download images from remote URLs if allow_url_fopen is disabled for security reasons" }, "type": "library", "autoload": { "psr-4": { - "": "src" + "League\\ColorExtractor\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -370,9 +377,9 @@ ], "support": { "issues": "https://github.com/thephpleague/color-extractor/issues", - "source": "https://github.com/thephpleague/color-extractor/tree/master" + "source": "https://github.com/thephpleague/color-extractor/tree/0.4.0" }, - "time": "2016-12-15T09:30:02+00:00" + "time": "2022-09-24T15:57:16+00:00" }, { "name": "michelf/php-smartypants", @@ -430,16 +437,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.6.5", + "version": "v6.8.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627" + "reference": "df16b615e371d81fb79e506277faea67a1be18f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/8b6386d7417526d1ea4da9edb70b8352f7543627", - "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/df16b615e371d81fb79e506277faea67a1be18f1", + "reference": "df16b615e371d81fb79e506277faea67a1be18f1", "shasum": "" }, "require": { @@ -449,17 +456,19 @@ "php": ">=5.5.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.2", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "doctrine/annotations": "^1.2.6 || ^1.13.3", "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.6.2", - "yoast/phpunit-polyfills": "^1.0.0" + "squizlabs/php_codesniffer": "^3.7.1", + "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", @@ -496,7 +505,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.5" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.0" }, "funding": [ { @@ -504,7 +513,7 @@ "type": "github" } ], - "time": "2022-10-07T12:23:10+00:00" + "time": "2023-03-06T14:43:22+00:00" }, { "name": "psr/log", @@ -558,16 +567,16 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8" + "reference": "639084e360537a19f9ee352433b84ce831f3d2da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/59a8d271f00dd0e4c2e518104cc7963f655a1aa8", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", + "reference": "639084e360537a19f9ee352433b84ce831f3d2da", "shasum": "" }, "require": { @@ -581,7 +590,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -625,7 +634,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.27.0" }, "funding": [ { @@ -641,7 +650,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-normalizer", @@ -729,16 +738,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "shasum": "" }, "require": { @@ -753,7 +762,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -792,7 +801,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" }, "funding": [ { @@ -808,7 +817,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" } ], "packages-dev": [], @@ -818,7 +827,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.0.0 <8.2.0", + "php": ">=8.0.0 <8.3.0", "ext-simplexml": "*", "ext-ctype": "*", "ext-curl": "*", diff --git a/kirby/config/aliases.php b/kirby/config/aliases.php index 527ede1..cadd7d0 100644 --- a/kirby/config/aliases.php +++ b/kirby/config/aliases.php @@ -53,6 +53,10 @@ return [ // panel classes 'panel' => 'Kirby\Panel\Panel', + // template classes + 'snippet' => 'Kirby\Template\Snippet', + 'slot' => 'Kirby\Template\Slot', + // toolkit classes 'a' => 'Kirby\Toolkit\A', 'c' => 'Kirby\Toolkit\Config', @@ -73,6 +77,7 @@ return [ 'kirby\cms\form' => 'Kirby\Form\Form', 'kirby\cms\kirbytag' => 'Kirby\Text\KirbyTag', 'kirby\cms\kirbytags' => 'Kirby\Text\KirbyTags', + 'kirby\cms\template' => 'Kirby\Template\Template', 'kirby\toolkit\dir' => 'Kirby\Filesystem\Dir', 'kirby\toolkit\f' => 'Kirby\Filesystem\F', 'kirby\toolkit\file' => 'Kirby\Filesystem\File', diff --git a/kirby/config/api/models/System.php b/kirby/config/api/models/System.php index c69a23d..725d3ed 100644 --- a/kirby/config/api/models/System.php +++ b/kirby/config/api/models/System.php @@ -35,8 +35,9 @@ return [ $code = $this->user()?->language() ?? $this->kirby()->panelLanguage(); - return $this->kirby()->translation($code) ?? - $this->kirby()->translation('en'); + return + $this->kirby()->translation($code) ?? + $this->kirby()->translation('en'); }, 'kirbytext' => fn () => $this->kirby()->option('panel.kirbytext') ?? true, 'user' => fn () => $this->user(), diff --git a/kirby/config/api/routes/files.php b/kirby/config/api/routes/files.php index 3194b88..78d46da 100644 --- a/kirby/config/api/routes/files.php +++ b/kirby/config/api/routes/files.php @@ -38,14 +38,17 @@ return [ // move_uploaded_file() not working with unit test // @codeCoverageIgnoreStart return $this->upload(function ($source, $filename) use ($path) { - return $this->parent($path)->createFile([ + $props = [ 'content' => [ 'sort' => $this->requestBody('sort') ], 'source' => $source, 'template' => $this->requestBody('template'), 'filename' => $filename - ]); + ]; + + // move the source file from the temp dir + return $this->parent($path)->createFile($props, true); }); // @codeCoverageIgnoreEnd } @@ -95,8 +98,9 @@ return [ 'pattern' => $pattern . '/files/(:any)', 'method' => 'POST', 'action' => function (string $path, string $filename) { + // move the source file from the temp dir return $this->upload( - fn ($source) => $this->file($path, $filename)->replace($source) + fn ($source) => $this->file($path, $filename)->replace($source, true) ); } ], diff --git a/kirby/config/api/routes/lock.php b/kirby/config/api/routes/lock.php index 71ff785..c7095d9 100644 --- a/kirby/config/api/routes/lock.php +++ b/kirby/config/api/routes/lock.php @@ -4,6 +4,9 @@ /** * Content Lock Routes */ + +use Kirby\Exception\NotFoundException; + return [ [ 'pattern' => '(:all)/lock', @@ -25,7 +28,11 @@ return [ 'pattern' => '(:all)/lock', 'method' => 'DELETE', 'action' => function (string $path) { - return $this->parent($path)->lock()?->remove(); + try { + return $this->parent($path)->lock()?->remove(); + } catch (NotFoundException) { + return true; + } } ], [ @@ -39,7 +46,11 @@ return [ 'pattern' => '(:all)/unlock', 'method' => 'DELETE', 'action' => function (string $path) { - return $this->parent($path)->lock()?->resolve(); + try { + return $this->parent($path)->lock()?->resolve(); + } catch (NotFoundException) { + return true; + } } ], ]; diff --git a/kirby/config/api/routes/users.php b/kirby/config/api/routes/users.php index c36ad31..0f97f2b 100644 --- a/kirby/config/api/routes/users.php +++ b/kirby/config/api/routes/users.php @@ -82,11 +82,16 @@ return [ $this->user($id)->avatar()?->delete(); return $this->upload( - fn ($source, $filename) => $this->user($id)->createFile([ - 'filename' => 'profile.' . F::extension($filename), - 'template' => 'avatar', - 'source' => $source - ]), + function ($source, $filename) use ($id) { + $props = [ + 'filename' => 'profile.' . F::extension($filename), + 'template' => 'avatar', + 'source' => $source + ]; + + // move the source file from the temp dir + return $this->user($id)->createFile($props, true); + }, single: true ); } diff --git a/kirby/config/areas/system/dialogs.php b/kirby/config/areas/system/dialogs.php index 35a3f9a..00502a8 100644 --- a/kirby/config/areas/system/dialogs.php +++ b/kirby/config/areas/system/dialogs.php @@ -44,10 +44,17 @@ return [ // license registration 'registration' => [ 'load' => function () { + $system = App::instance()->system(); + return [ 'component' => 'k-form-dialog', 'props' => [ 'fields' => [ + 'domain' => [ + 'type' => 'info', + 'theme' => $system->isLocal() ? 'notice' : 'info', + 'text' => I18n::template('license.register.' . ($system->isLocal() ? 'local' : 'domain'), ['host' => $system->indexUrl()]) + ], 'license' => [ 'label' => I18n::translate('license.register.label'), 'type' => 'text', @@ -56,9 +63,7 @@ return [ 'placeholder' => 'K3-', 'help' => I18n::translate('license.register.help') ], - 'email' => Field::email([ - 'required' => true - ]) + 'email' => Field::email(['required' => true]) ], 'submitButton' => I18n::translate('license.register'), 'value' => [ diff --git a/kirby/config/components.php b/kirby/config/components.php index 042a426..1019968 100644 --- a/kirby/config/components.php +++ b/kirby/config/components.php @@ -5,7 +5,6 @@ use Kirby\Cms\Collection; use Kirby\Cms\File; use Kirby\Cms\FileVersion; use Kirby\Cms\Page; -use Kirby\Cms\Template; use Kirby\Cms\User; use Kirby\Data\Data; use Kirby\Email\PHPMailer as Emailer; @@ -14,11 +13,12 @@ use Kirby\Filesystem\Filename; use Kirby\Http\Uri; use Kirby\Http\Url; use Kirby\Image\Darkroom; +use Kirby\Template\Snippet; +use Kirby\Template\Template; use Kirby\Text\Markdown; use Kirby\Text\SmartyPants; use Kirby\Toolkit\A; use Kirby\Toolkit\Str; -use Kirby\Toolkit\Tpl as Snippet; return [ @@ -142,6 +142,7 @@ return [ * @return \Kirby\Cms\Collection|bool */ 'search' => function (App $kirby, Collection $collection, string $query = null, $params = []) { + // empty search query if (empty(trim($query ?? '')) === true) { return $collection->limit(0); } @@ -159,28 +160,31 @@ return [ $options = array_merge($defaults, $params); $collection = clone $collection; - $searchWords = preg_replace('/(\s)/u', ',', $query); - $searchWords = Str::split($searchWords, ',', $options['minlength']); - $lowerQuery = Str::lower($query); - $exactQuery = $options['words'] ? '(\b' . preg_quote($query) . '\b)' : preg_quote($query); + + $words = preg_replace('/(\s)/u', ',', $query); + $words = Str::split($words, ',', $options['minlength']); + $exact = $options['words'] ? '(\b' . preg_quote($query) . '\b)' : preg_quote($query); + $query = Str::lower($query); if (empty($options['stopwords']) === false) { - $searchWords = array_diff($searchWords, $options['stopwords']); + $words = array_diff($words, $options['stopwords']); } - $searchWords = array_map(function ($value) use ($options) { - return $options['words'] ? '\b' . preg_quote($value) . '\b' : preg_quote($value); - }, $searchWords); + $words = A::map( + $words, + fn ($value) => $options['words'] ? '\b' . preg_quote($value) . '\b' : preg_quote($value) + ); // returns an empty collection if there is no search word - if (empty($searchWords) === true) { + if (empty($words) === true) { return $collection->limit(0); } - $preg = '!(' . implode('|', $searchWords) . ')!i'; - $results = $collection->filter(function ($item) use ($query, $preg, $options, $lowerQuery, $exactQuery) { - $data = $item->content()->toArray(); - $keys = array_keys($data); + $preg = '!(' . implode('|', $words) . ')!i'; + $scores = []; + $results = $collection->filter(function ($item) use ($query, $exact, $preg, $options, &$scores) { + $data = $item->content()->toArray(); + $keys = array_keys($data); $keys[] = 'id'; if ($item instanceof User) { @@ -200,8 +204,10 @@ return [ $keys = array_intersect($keys, $fields); } - $item->searchHits = 0; - $item->searchScore = 0; + $scoring = [ + 'hits' => 0, + 'score' => 0 + ]; foreach ($keys as $key) { $score = $options['score'][$key] ?? 1; @@ -210,32 +216,39 @@ return [ $lowerValue = Str::lower($value); // check for exact matches - if ($lowerQuery == $lowerValue) { - $item->searchScore += 16 * $score; - $item->searchHits += 1; + if ($query == $lowerValue) { + $scoring['score'] += 16 * $score; + $scoring['hits'] += 1; // check for exact beginning matches - } elseif ($options['words'] === false && Str::startsWith($lowerValue, $lowerQuery) === true) { - $item->searchScore += 8 * $score; - $item->searchHits += 1; + } elseif ( + $options['words'] === false && + Str::startsWith($lowerValue, $query) === true + ) { + $scoring['score'] += 8 * $score; + $scoring['hits'] += 1; // check for exact query matches - } elseif ($matches = preg_match_all('!' . $exactQuery . '!i', $value, $r)) { - $item->searchScore += 2 * $score; - $item->searchHits += $matches; + } elseif ($matches = preg_match_all('!' . $exact . '!i', $value, $r)) { + $scoring['score'] += 2 * $score; + $scoring['hits'] += $matches; } // check for any match if ($matches = preg_match_all($preg, $value, $r)) { - $item->searchHits += $matches; - $item->searchScore += $matches * $score; + $scoring['score'] += $matches * $score; + $scoring['hits'] += $matches; } } - return $item->searchHits > 0; + $scores[$item->id()] = $scoring; + return $scoring['hits'] > 0; }); - return $results->sort('searchScore', 'desc'); + return $results->sort( + fn ($item) => $scores[$item->id()]['score'], + 'desc' + ); }, /** @@ -267,23 +280,8 @@ return [ * @param string|array $name Snippet name * @param array $data Data array for the snippet */ - 'snippet' => function (App $kirby, $name, array $data = []): string { - $snippets = A::wrap($name); - - foreach ($snippets as $name) { - $name = (string)$name; - $file = $kirby->root('snippets') . '/' . $name . '.php'; - - if (file_exists($file) === false) { - $file = $kirby->extensions('snippets')[$name] ?? null; - } - - if ($file) { - break; - } - } - - return Snippet::load($file, $data); + 'snippet' => function (App $kirby, string|array|null $name, array $data = [], bool $slots = false): Snippet|string { + return Snippet::factory($name, $data, $slots); }, /** @@ -293,7 +291,7 @@ return [ * @param string $name Template name * @param string $type Extension type * @param string $defaultType Default extension type - * @return \Kirby\Cms\Template + * @return \Kirby\Template\Template */ 'template' => function (App $kirby, string $name, string $type = 'html', string $defaultType = 'html') { return new Template($name, $type, $defaultType); diff --git a/kirby/config/fields/mixins/upload.php b/kirby/config/fields/mixins/upload.php index 10cfc7b..daa0fef 100644 --- a/kirby/config/fields/mixins/upload.php +++ b/kirby/config/fields/mixins/upload.php @@ -56,11 +56,14 @@ return [ } return $api->upload(function ($source, $filename) use ($parent, $params, $map) { - $file = $parent->createFile([ + $props = [ 'source' => $source, 'template' => $params['template'] ?? null, 'filename' => $filename, - ]); + ]; + + // move the source file from the temp dir + $file = $parent->createFile($props, true); if ($file instanceof File === false) { throw new Exception('The file could not be uploaded'); diff --git a/kirby/config/fields/select.php b/kirby/config/fields/select.php index 04b468d..4c06b5b 100644 --- a/kirby/config/fields/select.php +++ b/kirby/config/fields/select.php @@ -1,5 +1,7 @@ 'radio', 'props' => [ @@ -20,5 +22,16 @@ return [ 'placeholder' => function (string $placeholder = '—') { return $placeholder; }, + ], + 'methods' => [ + 'getOptions' => function () { + $props = FieldOptions::polyfill($this->props); + + // disable safe mode as the select field does not + // render HTML for the option text + $options = FieldOptions::factory($props['options'], false); + + return $options->render($this->model()); + } ] ]; diff --git a/kirby/config/fields/text.php b/kirby/config/fields/text.php index 7abd86f..0585af2 100644 --- a/kirby/config/fields/text.php +++ b/kirby/config/fields/text.php @@ -10,7 +10,7 @@ return [ * The field value will be converted with the selected converter before the value gets saved. Available converters: `lower`, `upper`, `ucfirst`, `slug` */ 'converter' => function ($value = null) { - if ($value !== null && in_array($value, array_keys($this->converters())) === false) { + if ($value !== null && array_key_exists($value, $this->converters()) === false) { throw new InvalidArgumentException([ 'key' => 'field.converter.invalid', 'data' => ['converter' => $value] diff --git a/kirby/config/helpers.php b/kirby/config/helpers.php index 3bb94af..b051f42 100644 --- a/kirby/config/helpers.php +++ b/kirby/config/helpers.php @@ -1,13 +1,20 @@ collection($name); } @@ -61,7 +64,7 @@ if (Helpers::hasOverride('csrf') === false) { // @codeCoverageIgnore * @param string|null $check Pass a token here to compare it to the one in the session * @return string|bool Either the token or a boolean check result */ - function csrf(string|null $check = null) + function csrf(string|null $check = null): string|bool { // check explicitly if there have been no arguments at all; // checking for null introduces a security issue because null could come @@ -79,11 +82,12 @@ if (Helpers::hasOverride('css') === false) { // @codeCoverageIgnore * Creates one or multiple CSS link tags * * @param string|array $url Relative or absolute URLs, an array of URLs or `@auto` for automatic template css loading - * @param string|array $options Pass an array of attributes for the link tag or a media attribute string - * @return string|null + * @param string|array|null $options Pass an array of attributes for the link tag or a media attribute string */ - function css($url, $options = null): string|null - { + function css( + string|array $url, + string|array|null $options = null + ): string|null { return Html::css($url, $options); } } @@ -93,7 +97,6 @@ if (Helpers::hasOverride('deprecated') === false) { // @codeCoverageIgnore * Triggers a deprecation warning if debug mode is active * @since 3.3.0 * - * @param string $message * @return bool Whether the warning was triggered */ function deprecated(string $message): bool @@ -106,12 +109,8 @@ if (Helpers::hasOverride('dump') === false) { // @codeCoverageIgnore /** * Simple object and variable dumper * to help with debugging. - * - * @param mixed $variable - * @param bool $echo - * @return string */ - function dump($variable, bool $echo = true): string + function dump(mixed $variable, bool $echo = true): string { return Helpers::dump($variable, $echo); } @@ -121,16 +120,35 @@ if (Helpers::hasOverride('e') === false) { // @codeCoverageIgnore /** * Smart version of echo with an if condition as first argument * - * @param mixed $condition * @param mixed $value The string to be echoed if the condition is true * @param mixed $alternative An alternative string which should be echoed when the condition is false */ - function e($condition, $value, $alternative = null) + function e(mixed $condition, mixed $value, mixed $alternative = null): void { echo $condition ? $value : $alternative; } } +if (Helpers::hasOverride('endslot') === false) { // @codeCoverageIgnore + /** + * Ends the last started template slot + */ + function endslot(): void + { + Slot::end(); + } +} + +if (Helpers::hasOverride('endsnippet') === false) { // @codeCoverageIgnore + /** + * Renders the currently active snippet with slots + */ + function endsnippet(): void + { + Snippet::end(); + } +} + if (Helpers::hasOverride('esc') === false) { // @codeCoverageIgnore /** * Escape context specific output @@ -151,9 +169,8 @@ if (Helpers::hasOverride('get') === false) { // @codeCoverageIgnore * * @param mixed $key The key to look for. Pass false or null to return the entire request array. * @param mixed $default Optional default value, which should be returned if no element has been found - * @return mixed */ - function get($key = null, $default = null) + function get(mixed $key = null, mixed $default = null): mixed { return App::instance()->request()->get($key, $default); } @@ -162,10 +179,6 @@ if (Helpers::hasOverride('get') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('gist') === false) { // @codeCoverageIgnore /** * Embeds a Github Gist - * - * @param string $url - * @param string|null $file - * @return string */ function gist(string $url, string|null $file = null): string { @@ -181,11 +194,9 @@ if (Helpers::hasOverride('go') === false) { // @codeCoverageIgnore * Redirects to the given Urls * Urls can be relative or absolute. * - * @param string $url - * @param int $code - * @return void + * @todo Change return type to `never` once support for PHP 8.0 is dropped */ - function go(string $url = '/', int $code = 302) + function go(string $url = '/', int $code = 302): void { Response::go($url, $code); } @@ -196,8 +207,6 @@ if (Helpers::hasOverride('h') === false) { // @codeCoverageIgnore * Shortcut for html() * * @param string|null $string unencoded text - * @param bool $keepTags - * @return string */ function h(string|null $string, bool $keepTags = false): string { @@ -210,8 +219,6 @@ if (Helpers::hasOverride('html') === false) { // @codeCoverageIgnore * Creates safe html by encoding special characters * * @param string|null $string unencoded text - * @param bool $keepTags - * @return string */ function html(string|null $string, bool $keepTags = false): string { @@ -226,11 +233,8 @@ if (Helpers::hasOverride('image') === false) { // @codeCoverageIgnore * * Example: * - * - * @param string|null $path - * @return \Kirby\Cms\File|null */ - function image(string|null $path = null) + function image(string|null $path = null): File|null { return App::instance()->image($path); } @@ -239,14 +243,12 @@ if (Helpers::hasOverride('image') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('invalid') === false) { // @codeCoverageIgnore /** * Runs a number of validators on a set of data and checks if the data is invalid - * - * @param array $data - * @param array $rules - * @param array $messages - * @return array */ - function invalid(array $data = [], array $rules = [], array $messages = []): array - { + function invalid( + array $data = [], + array $rules = [], + array $messages = [] + ): array { return V::invalid($data, $rules, $messages); } } @@ -254,13 +256,11 @@ if (Helpers::hasOverride('invalid') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('js') === false) { // @codeCoverageIgnore /** * Creates a script tag to load a javascript file - * - * @param string|array $url - * @param string|array $options - * @return string|null */ - function js($url, $options = null): string|null - { + function js( + string|array $url, + string|array|bool|null $options = null + ): string|null { return Html::js($url, $options); } } @@ -268,10 +268,8 @@ if (Helpers::hasOverride('js') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('kirby') === false) { // @codeCoverageIgnore /** * Returns the Kirby object in any situation - * - * @return \Kirby\Cms\App */ - function kirby() + function kirby(): App { return App::instance(); } @@ -280,15 +278,13 @@ if (Helpers::hasOverride('kirby') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('kirbytag') === false) { // @codeCoverageIgnore /** * Makes it possible to use any defined Kirbytag as standalone function - * - * @param string|array $type - * @param string|null $value - * @param array $attr - * @param array $data - * @return string */ - function kirbytag($type, string|null $value = null, array $attr = [], array $data = []): string - { + function kirbytag( + string|array $type, + string|null $value = null, + array $attr = [], + array $data = [] + ): string { return App::instance()->kirbytag($type, $value, $attr, $data); } } @@ -297,10 +293,6 @@ if (Helpers::hasOverride('kirbytags') === false) { // @codeCoverageIgnore /** * Parses KirbyTags in the given string. Shortcut * for `$kirby->kirbytags($text, $data)` - * - * @param string|null $text - * @param array $data - * @return string */ function kirbytags(string|null $text = null, array $data = []): string { @@ -312,10 +304,6 @@ if (Helpers::hasOverride('kirbytext') === false) { // @codeCoverageIgnore /** * Parses KirbyTags and Markdown in the * given string. Shortcut for `$kirby->kirbytext()` - * - * @param string|null $text - * @param array $data - * @return string */ function kirbytext(string|null $text = null, array $data = []): string { @@ -328,10 +316,6 @@ if (Helpers::hasOverride('kirbytextinline') === false) { // @codeCoverageIgnore * Parses KirbyTags and inline Markdown in the * given string. * @since 3.1.0 - * - * @param string|null $text - * @param array $options - * @return string */ function kirbytextinline(string|null $text = null, array $options = []): string { @@ -343,10 +327,6 @@ if (Helpers::hasOverride('kirbytextinline') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('kt') === false) { // @codeCoverageIgnore /** * Shortcut for `kirbytext()` helper - * - * @param string|null $text - * @param array $data - * @return string */ function kt(string|null $text = null, array $data = []): string { @@ -358,10 +338,6 @@ if (Helpers::hasOverride('kti') === false) { // @codeCoverageIgnore /** * Shortcut for `kirbytextinline()` helper * @since 3.1.0 - * - * @param string|null $text - * @param array $options - * @return string */ function kti(string|null $text = null, array $options = []): string { @@ -373,10 +349,6 @@ if (Helpers::hasOverride('kti') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('load') === false) { // @codeCoverageIgnore /** * A super simple class autoloader - * - * @param array $classmap - * @param string|null $base - * @return void */ function load(array $classmap, string|null $base = null): void { @@ -388,10 +360,6 @@ if (Helpers::hasOverride('markdown') === false) { // @codeCoverageIgnore /** * Parses markdown in the given string. Shortcut for * `$kirby->markdown($text)` - * - * @param string|null $text - * @param array $options - * @return string */ function markdown(string|null $text = null, array $options = []): string { @@ -402,12 +370,8 @@ if (Helpers::hasOverride('markdown') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('option') === false) { // @codeCoverageIgnore /** * Shortcut for `$kirby->option($key, $default)` - * - * @param string $key - * @param mixed $default - * @return mixed */ - function option(string $key, $default = null) + function option(string $key, mixed $default = null): mixed { return App::instance()->option($key, $default); } @@ -417,11 +381,8 @@ if (Helpers::hasOverride('page') === false) { // @codeCoverageIgnore /** * Fetches a single page by id or * the current page when no id is specified - * - * @param string|null $id - * @return \Kirby\Cms\Page|null */ - function page(string|null $id = null) + function page(string|null $id = null): Page|null { if (empty($id) === true) { return App::instance()->site()->page(); @@ -434,11 +395,8 @@ if (Helpers::hasOverride('page') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('pages') === false) { // @codeCoverageIgnore /** * Helper to build pages collection - * - * @param string|array ...$id - * @return \Kirby\Cms\Pages|null */ - function pages(...$id) + function pages(string|array ...$id): Pages|null { // ensure that a list of string arguments and an array // as the first argument are treated the same @@ -456,9 +414,6 @@ if (Helpers::hasOverride('param') === false) { // @codeCoverageIgnore /** * Returns a single param from the URL * - * @param string $key - * @param string|null $fallback - * @return string|null * @psalm-return ($fallback is string ? string : string|null) */ function param(string $key, string|null $fallback = null): string|null @@ -470,8 +425,6 @@ if (Helpers::hasOverride('param') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('params') === false) { // @codeCoverageIgnore /** * Returns all params from the current Url - * - * @return array */ function params(): array { @@ -483,12 +436,10 @@ if (Helpers::hasOverride('r') === false) { // @codeCoverageIgnore /** * Smart version of return with an if condition as first argument * - * @param mixed $condition * @param mixed $value The string to be returned if the condition is true * @param mixed $alternative An alternative string which should be returned when the condition is false - * @return mixed */ - function r($condition, $value, $alternative = null) + function r(mixed $condition, mixed $value, mixed $alternative = null): mixed { return $condition ? $value : $alternative; } @@ -499,15 +450,13 @@ if (Helpers::hasOverride('router') === false) { // @codeCoverageIgnore * Creates a micro-router and executes * the routing action immediately * @since 3.6.0 - * - * @param string|null $path - * @param string $method - * @param array $routes - * @param \Closure|null $callback - * @return mixed */ - function router(string|null $path = null, string $method = 'GET', array $routes = [], Closure|null $callback = null) - { + function router( + string|null $path = null, + string $method = 'GET', + array $routes = [], + Closure|null $callback = null + ): mixed { return Router::execute($path, $method, $routes, $callback); } } @@ -515,10 +464,8 @@ if (Helpers::hasOverride('router') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('site') === false) { // @codeCoverageIgnore /** * Returns the current site object - * - * @return \Kirby\Cms\Site */ - function site() + function site(): Site { return App::instance()->site(); } @@ -527,24 +474,27 @@ if (Helpers::hasOverride('site') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('size') === false) { // @codeCoverageIgnore /** * Determines the size/length of numbers, strings, arrays and countable objects - * - * @param mixed $value - * @return int - * @throws \Kirby\Exception\InvalidArgumentException */ - function size($value): int + function size(mixed $value): int { return Helpers::size($value); } } +if (Helpers::hasOverride('slot') === false) { // @codeCoverageIgnore + /** + * Starts a new template slot + */ + function slot(string $name = 'default'): void + { + Slot::begin($name); + } +} + if (Helpers::hasOverride('smartypants') === false) { // @codeCoverageIgnore /** * Enhances the given string with * smartypants. Shortcut for `$kirby->smartypants($text)` - * - * @param string|null $text - * @return string */ function smartypants(string|null $text = null): string { @@ -555,15 +505,14 @@ if (Helpers::hasOverride('smartypants') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('snippet') === false) { // @codeCoverageIgnore /** * Embeds a snippet from the snippet folder - * - * @param string|array $name - * @param array|object $data - * @param bool $return - * @return string|null */ - function snippet($name, $data = [], bool $return = false): string|null - { - return App::instance()->snippet($name, $data, $return); + function snippet( + $name, + $data = [], + bool $return = false, + bool $slots = false + ): Snippet|string|null { + return App::instance()->snippet($name, $data, $return, $slots); } } @@ -571,11 +520,8 @@ if (Helpers::hasOverride('svg') === false) { // @codeCoverageIgnore /** * Includes an SVG file by absolute or * relative file path. - * - * @param string|\Kirby\Cms\File $file - * @return string|false */ - function svg($file) + function svg(string|File $file): string|false { return Html::svg($file); } @@ -584,14 +530,12 @@ if (Helpers::hasOverride('svg') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('t') === false) { // @codeCoverageIgnore /** * Returns translate string for key from translation file - * - * @param string|array $key - * @param string|null $fallback - * @param string|null $locale - * @return array|string|null */ - function t($key, string $fallback = null, string $locale = null) - { + function t( + string|array $key, + string|null $fallback = null, + string|null $locale = null + ): string|array|Closure|null { return I18n::translate($key, $fallback, $locale); } } @@ -600,18 +544,14 @@ if (Helpers::hasOverride('tc') === false) { // @codeCoverageIgnore /** * Translates a count * - * @param string $key - * @param int $count - * @param string|null $locale * @param bool $formatNumber If set to `false`, the count is not formatted - * @return mixed */ function tc( string $key, int $count, - string $locale = null, + string|null $locale = null, bool $formatNumber = true - ) { + ): mixed { return I18n::translateCount($key, $count, $locale, $formatNumber); } } @@ -621,12 +561,12 @@ if (Helpers::hasOverride('timestamp') === false) { // @codeCoverageIgnore * Rounds the minutes of the given date * by the defined step * - * @param string|null $date * @param int|array|null $step array of `unit` and `size` to round to nearest - * @return int|null */ - function timestamp(string|null $date = null, $step = null): int|null - { + function timestamp( + string|null $date = null, + int|array|null $step = null + ): int|null { return Date::roundedTimestamp($date, $step); } } @@ -635,15 +575,13 @@ if (Helpers::hasOverride('tt') === false) { // @codeCoverageIgnore /** * Translate by key and then replace * placeholders in the text - * - * @param string $key - * @param string|array|null $fallback - * @param array|null $replace - * @param string|null $locale - * @return string */ - function tt(string $key, $fallback = null, array|null $replace = null, string|null $locale = null): string - { + function tt( + string $key, + string|array|null $fallback = null, + array|null $replace = null, + string|null $locale = null + ): string { return I18n::template($key, $fallback, $replace, $locale); } } @@ -651,15 +589,13 @@ if (Helpers::hasOverride('tt') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('twitter') === false) { // @codeCoverageIgnore /** * Builds a Twitter link - * - * @param string $username - * @param string|null $text - * @param string|null $title - * @param string|null $class - * @return string */ - function twitter(string $username, string|null $text = null, string|null $title = null, string|null $class = null): string - { + function twitter( + string $username, + string|null $text = null, + string|null $title = null, + string|null $class = null + ): string { return App::instance()->kirbytag([ 'twitter' => $username, 'text' => $text, @@ -672,13 +608,11 @@ if (Helpers::hasOverride('twitter') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('u') === false) { // @codeCoverageIgnore /** * Shortcut for url() - * - * @param string|null $path - * @param array|string|null $options - * @return string */ - function u(string|null $path = null, $options = null): string - { + function u( + string|null $path = null, + array|string|null $options = null + ): string { return Url::to($path, $options); } } @@ -686,13 +620,11 @@ if (Helpers::hasOverride('u') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('url') === false) { // @codeCoverageIgnore /** * Builds an absolute URL for a given path - * - * @param string|null $path - * @param array|string|null $options - * @return string */ - function url(string|null $path = null, $options = null): string - { + function url( + string|null $path = null, + array|string|null $options = null + ): string { return Url::to($path, $options); } } @@ -700,8 +632,6 @@ if (Helpers::hasOverride('url') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('uuid') === false) { // @codeCoverageIgnore /** * Creates a compliant v4 UUID - * - * @return string */ function uuid(): string { @@ -714,11 +644,6 @@ if (Helpers::hasOverride('video') === false) { // @codeCoverageIgnore * Creates a video embed via iframe for Youtube or Vimeo * videos. The embed Urls are automatically detected from * the given Url. - * - * @param string $url - * @param array $options - * @param array $attr - * @return string|null */ function video(string $url, array $options = [], array $attr = []): string|null { @@ -729,11 +654,6 @@ if (Helpers::hasOverride('video') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('vimeo') === false) { // @codeCoverageIgnore /** * Embeds a Vimeo video by URL in an iframe - * - * @param string $url - * @param array $options - * @param array $attr - * @return string|null */ function vimeo(string $url, array $options = [], array $attr = []): string|null { @@ -746,11 +666,8 @@ if (Helpers::hasOverride('widont') === false) { // @codeCoverageIgnore * The widont function makes sure that there are no * typographical widows at the end of a paragraph – * that's a single word in the last line - * - * @param string|null $string - * @return string */ - function widont(string $string = null): string + function widont(string|null $string = null): string { return Str::widont($string); } @@ -759,11 +676,6 @@ if (Helpers::hasOverride('widont') === false) { // @codeCoverageIgnore if (Helpers::hasOverride('youtube') === false) { // @codeCoverageIgnore /** * Embeds a Youtube video by URL in an iframe - * - * @param string $url - * @param array $options - * @param array $attr - * @return string|null */ function youtube(string $url, array $options = [], array $attr = []): string|null { diff --git a/kirby/config/methods.php b/kirby/config/methods.php index ab63592..a81780e 100644 --- a/kirby/config/methods.php +++ b/kirby/config/methods.php @@ -66,7 +66,8 @@ return function (App $app) { try { $blocks = Blocks::parse($field->value()); $blocks = Blocks::factory($blocks, [ - 'parent' => $field->parent() + 'parent' => $field->parent(), + 'field' => $field, ]); return $blocks->filter('isHidden', false); } catch (Throwable) { @@ -192,7 +193,8 @@ return function (App $app) { */ 'toLayouts' => function (Field $field) { return Layouts::factory(Layouts::parse($field->value()), [ - 'parent' => $field->parent() + 'parent' => $field->parent(), + 'field' => $field, ]); }, @@ -276,10 +278,10 @@ return function (App $app) { * Converts the field value to a Unix timestamp * * @param \Kirby\Cms\Field $field - * @return int + * @return int|false */ - 'toTimestamp' => function (Field $field): int { - return strtotime($field->value); + 'toTimestamp' => function (Field $field): int|false { + return strtotime($field->value ?? ''); }, /** @@ -326,7 +328,7 @@ return function (App $app) { * Returns the number of words in the text */ 'words' => function (Field $field) { - return str_word_count(strip_tags($field->value)); + return str_word_count(strip_tags($field->value ?? '')); }, // manipulators @@ -394,7 +396,7 @@ return function (App $app) { // Obsolete elements, script tags, image maps and form elements have // been excluded for safety reasons and as they are most likely not // needed in most cases. - $field->value = strip_tags($field->value, Html::$inlineList); + $field->value = strip_tags($field->value ?? '', Html::$inlineList); return $field; }, @@ -481,7 +483,7 @@ return function (App $app) { * @return \Kirby\Cms\Field */ 'nl2br' => function (Field $field) { - $field->value = nl2br($field->value, false); + $field->value = nl2br($field->value ?? '', false); return $field; }, diff --git a/kirby/config/sections/files.php b/kirby/config/sections/files.php index eeb5347..1b123d7 100644 --- a/kirby/config/sections/files.php +++ b/kirby/config/sections/files.php @@ -57,6 +57,11 @@ return [ // search if ($this->search === true && empty($this->searchterm()) === false) { $files = $files->search($this->searchterm()); + + // disable flip and sortBy while searching + // to show most relevant results + $this->flip = false; + $this->sortBy = null; } // sort @@ -157,10 +162,9 @@ return [ } // count all uploaded files - $total = count($this->data); - $max = $this->max ? $this->max - $total : null; + $max = $this->max ? $this->max - $this->total : null; - if ($this->max && $total === $this->max - 1) { + if ($this->max && $this->total === $this->max - 1) { $multiple = false; } else { $multiple = true; @@ -174,7 +178,10 @@ return [ 'max' => $max, 'api' => $this->parent->apiUrl(true) . '/files', 'attributes' => array_filter([ - 'sort' => $this->sortable === true ? $total + 1 : null, + // TODO: an edge issue that needs to be solved: + // if multiple users load the same section at the same time + // and upload a file, uploaded files have the same sort number + 'sort' => $this->sortable === true ? $this->total + 1 : null, 'template' => $template ]) ]; diff --git a/kirby/config/sections/pages.php b/kirby/config/sections/pages.php index 5f5a367..c9b23b7 100644 --- a/kirby/config/sections/pages.php +++ b/kirby/config/sections/pages.php @@ -94,6 +94,11 @@ return [ // search if ($this->search === true && empty($this->searchterm()) === false) { $pages = $pages->search($this->searchterm()); + + // disable flip and sortBy while searching + // to show most relevant results + $this->flip = false; + $this->sortBy = null; } // sort diff --git a/kirby/dependencies/parsedown-extra/ParsedownExtra.php b/kirby/dependencies/parsedown-extra/ParsedownExtra.php index 6328eac..2f9c62d 100644 --- a/kirby/dependencies/parsedown-extra/ParsedownExtra.php +++ b/kirby/dependencies/parsedown-extra/ParsedownExtra.php @@ -570,8 +570,18 @@ class ParsedownExtra extends Parsedown $DOMDocument = new DOMDocument(); - # http://stackoverflow.com/q/11309194/200145 - $elementMarkup = mb_convert_encoding($elementMarkup, 'HTML-ENTITIES', 'UTF-8'); + // Migrating away from `mb_convert_encoding($elementMarkup, + //'HTML-ENTITIES', 'UTF-8');` has caused multibyte characters like + // emojis not to be converted into entities, which is needed so that + // the `DOM` extension can properly parse the markup. + // The following line works like this: It treats the input string + // as UTF-8 and converts every Unicode character with 8 or more bits + // (= character code starting at 128 or 0x80 up to the Unicode limit + // of 0x10ffff) to an entity; the third and fourth arguments for the + // map are not needed for our use case and are set to the default values + // (no offset and a full mask) + // [http://stackoverflow.com/q/11309194/200145] + $elementMarkup = mb_encode_numericentity($elementMarkup, [0x80, 0x10ffff, 0, 0xffffff], 'UTF-8'); # Ensure that saveHTML() is not remove new line characters. New lines will be split by this character. $DOMDocument->formatOutput = true; diff --git a/kirby/i18n/translations/bg.json b/kirby/i18n/translations/bg.json index 5fcd118..e384e9f 100644 --- a/kirby/i18n/translations/bg.json +++ b/kirby/i18n/translations/bg.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "You must add at least one block", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "Email шаблонът \"{name}\" не може да бъде открит", "error.field.converter.invalid": "Невалиден конвертор \"{converter}\"", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "The name must not be empty", "error.file.changeName.permission": "Не можете да смените името на \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Все още не са избрани страници", "field.structure.delete.confirm": "Сигурни ли сте, че искате да изтриете това вписване?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Все още няма статии", "field.users.empty": "Все още не са избрани потребители", @@ -318,7 +322,7 @@ "installation.issues.headline": "Панелът не може да бъде инсталиран", "installation.issues.mbstring": "Изисква се разширението MB String", "installation.issues.media": "Папката /media не съществува или няма права за запис", - "installation.issues.php": "Бъдете сигурни, че използвате PHP 7+", + "installation.issues.php": "Бъдете сигурни, че използвате PHP 8+", "installation.issues.server": "Kirby изисква Apache, Nginx или Caddy", "installation.issues.sessions": "The /site/sessions folder does not exist or is not writable", @@ -349,6 +353,8 @@ "license.manage": "Manage your licenses", "license.register.help": "You received your license code after the purchase via email. Please copy and paste it to register.", "license.register.label": "Please enter your license code", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Thank you for supporting Kirby", "license.unregistered": "Това е нерегистрирана демо версия на Kirby", "license.unregistered.label": "Unregistered", diff --git a/kirby/i18n/translations/ca.json b/kirby/i18n/translations/ca.json index ce9a2cc..33fb1e7 100644 --- a/kirby/i18n/translations/ca.json +++ b/kirby/i18n/translations/ca.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "You must add at least one block", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "No es pot trobar la configuració de correu electrònic \"{name}\"", "error.field.converter.invalid": "Convertidor no vàlid \"{converter}\"", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "El nom no pot estar buit", "error.file.changeName.permission": "No tens permís per canviar el nom de \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Encara no s'ha seleccionat cap pàgina", "field.structure.delete.confirm": "Segur que voleu eliminar aquesta fila?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Encara no hi ha entrades.", "field.users.empty": "Encara no s'ha seleccionat cap usuari", @@ -318,7 +322,7 @@ "installation.issues.headline": "El panell no es pot instal·lar", "installation.issues.mbstring": "Es requereix l'extensió de MB String", "installation.issues.media": "La carpeta /media no existeix o no es pot escriure", - "installation.issues.php": "Assegureu-vos d'utilitzar PHP 7+", + "installation.issues.php": "Assegureu-vos d'utilitzar PHP 8+", "installation.issues.server": "Kirby requereix Apache, Nginx o Caddy", "installation.issues.sessions": "La carpeta /site/sessions no existeix o no es pot escriure", @@ -349,6 +353,8 @@ "license.manage": "Manage your licenses", "license.register.help": "Heu rebut el codi de la vostra llicència després de la compra, per correu electrònic. Copieu-lo i enganxeu-lo per registrar-vos.", "license.register.label": "Si us plau, introdueixi el seu codi de llicència", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Gràcies per donar suport a Kirby", "license.unregistered": "Aquesta és una demo no registrada de Kirby", "license.unregistered.label": "Unregistered", @@ -382,7 +388,7 @@ "login.toggleText.password-reset.email": "Forgot your password?", "login.toggleText.password-reset.email-password": "← Back to login", - "logout": "Tancar sessi\u00f3", + "logout": "Tancar sessió", "menu": "Menú", "meridiem": "AM/PM", diff --git a/kirby/i18n/translations/cs.json b/kirby/i18n/translations/cs.json index 8487826..9d49e41 100644 --- a/kirby/i18n/translations/cs.json +++ b/kirby/i18n/translations/cs.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Musíte přidat alespoň jeden blok", "error.blocks.validation": "V poli \"{field}\" v bloku {index} je při použití \"{fieldset}\" typu chyba", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "Nelze nalézt emailové přednastavení \"{name}\"", "error.field.converter.invalid": "Neplatný konvertor \"{converter}\"", + "error.field.type.missing": "Pole \"{ name }\": Typ pole \"{ type }\" neexistuje", "error.file.changeName.empty": "Toto jméno nesmí být prázdné", "error.file.changeName.permission": "Nemáte povoleno změnit jméno souboru \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Nebyly zatím vybrány žádné stránky", "field.structure.delete.confirm": "Opravdu chcete smazat tento z\u00e1znam?", + "field.structure.delete.confirm.all": "Opravdu chcete smazat všechny záznamy?", "field.structure.empty": "Zat\u00edm nejsou \u017e\u00e1dn\u00e9 z\u00e1znamy.", "field.users.empty": "Nebyli zatím vybráni žádní uživatelé", @@ -318,7 +322,7 @@ "installation.issues.headline": "Panel nelze nainstalovat", "installation.issues.mbstring": "Je vyžadováno rozšířeníMB String", "installation.issues.media": "Složka/media neexistuje, nebo nemá povolený zápis", - "installation.issues.php": "Ujistěte se, že používátePHP 7+", + "installation.issues.php": "Ujistěte se, že používátePHP 8+", "installation.issues.server": "Kirby vyžadujeApache, Nginx neboCaddy", "installation.issues.sessions": "Složka/site/sessions neexistuje, nebo nemá povolený zápis", @@ -349,6 +353,8 @@ "license.manage": "Spravovat licence", "license.register.help": "Licenční kód jste po zakoupení obdrželi na email. Vložte prosím kód a zaregistrujte Vaší kopii.", "license.register.label": "Zadejte prosím licenční kód", + "license.register.domain": "Vaše licence bude zaregistrována na {host}.", + "license.register.local": "Chystáte se registrovat licenci na Vaší lokální doméně {host}. Pokud bude tato stránka nasazena na veřejnou doménu, registrujte prosím licenci až tam. Pokud je {host} opravdu doménou, na které si přejete licenci registrovat, pokračujte prosím dále.", "license.register.success": "Děkujeme Vám za podporu Kirby", "license.unregistered": "Toto je neregistrovaná kopie Kirby", "license.unregistered.label": "Neregistrovaný", @@ -382,7 +388,7 @@ "login.toggleText.password-reset.email": "Zapomenuté heslo?", "login.toggleText.password-reset.email-password": "← Zpět na přihlášení", - "logout": "Odhl\u00e1sit se", + "logout": "Odhlásit se", "menu": "Menu", "meridiem": "AM/PM", @@ -454,7 +460,7 @@ "paste": "Vložit", "paste.after": "Vložit za", "pixel": "Pixel", - "plugin": "Plugin", + "plugin": "Doplňek", "plugins": "Doplňky", "prev": "Předchozí", "preview": "Náhled", @@ -494,24 +500,24 @@ "stats.empty": "Žádná hlášení", "system.issues.content": "Složka content je zřejmě přístupná zvenčí", - "system.issues.eol.kirby": "Your installed Kirby version has reached end-of-life and will not receive further security updates", - "system.issues.eol.plugin": "Your installed version of the { plugin } plugin is has reached end-of-life and will not receive further security updates", + "system.issues.eol.kirby": "Instalovaná verze Kirby dosáhla konce životnosti a nebude již dále dostávat bezpečnostní aktualizace", + "system.issues.eol.plugin": "Instalovaná verze doplňku { plugin } dosáhla konce životnosti a nebude již dále dostávat bezpečnostní aktualizace", "system.issues.debug": "Debug mode musí být v produkci vypnutý", "system.issues.git": "Složka .git je zřejmě přístupná zvenčí", - "system.issues.https": "Při všechny stránky doporučujeme používat protokol HTTPS", + "system.issues.https": "Pro všechny stránky doporučujeme používat protokol HTTPS", "system.issues.kirby": "Složka kirby je zřejmě přístupná zvenčí", "system.issues.site": "Složka site je zřejmě přístupná zvenčí", - "system.issues.vulnerability.kirby": "Your installation might be affected by the following vulnerability ({ severity } severity): { description }", - "system.issues.vulnerability.plugin": "Your installation might be affected by the following vulnerability in the { plugin } plugin ({ severity } severity): { description }", - "system.updateStatus": "Update status", - "system.updateStatus.error": "Could not check for updates", - "system.updateStatus.not-vulnerable": "No known vulnerabilities", - "system.updateStatus.security-update": "Free security update { version } available", - "system.updateStatus.security-upgrade": "Upgrade { version } with security fixes available", - "system.updateStatus.unreleased": "Unreleased version", - "system.updateStatus.up-to-date": "Up to date", - "system.updateStatus.update": "Free update { version } available", - "system.updateStatus.upgrade": "Upgrade { version } available", + "system.issues.vulnerability.kirby": "Vaše instalace může být ovlivněna následující zranitelností (stupeň vážnosti - { severity }): { description }", + "system.issues.vulnerability.plugin": "Vaše instalace může být ovlivněna následující zranitelností v doplňku { plugin } (stupeň vážnosti - { severity }): { description }", + "system.updateStatus": "Status aktualizací", + "system.updateStatus.error": "Nepodařilo se zkontrolovat aktualizace", + "system.updateStatus.not-vulnerable": "Žádné známé zranitelnosti", + "system.updateStatus.security-update": "Je dostupná bezplatná bezpečnostní aktualizace { version }", + "system.updateStatus.security-upgrade": "Je dostupný upgrade { version } s bezpečnostními opravami", + "system.updateStatus.unreleased": "Nevydaná verze", + "system.updateStatus.up-to-date": "Aktuální", + "system.updateStatus.update": "Je dostupná bezplatná nová verze { version }", + "system.updateStatus.upgrade": "Je dostupný upgrade na verzi { version }", "title": "Název", "template": "\u0160ablona", @@ -578,9 +584,9 @@ "users": "Uživatelé", "version": "Verze Kirby", - "version.current": "Current version", - "version.latest": "Latest version", - "versionInformation": "Version information", + "version.current": "Současná verze", + "version.latest": "Poslední verze", + "versionInformation": "Informace o verzi", "view.account": "V\u00e1\u0161 \u00fa\u010det", "view.installation": "Instalace", diff --git a/kirby/i18n/translations/da.json b/kirby/i18n/translations/da.json index 8493067..540a6b6 100644 --- a/kirby/i18n/translations/da.json +++ b/kirby/i18n/translations/da.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Du skal tilføje minimum een blok", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "Email preset \"{name}\" findes ikke", "error.field.converter.invalid": "Ugyldig converter \"{converter}\"", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "Navn kan ikke efterlades tomt", "error.file.changeName.permission": "Du har ikke tilladelse til at ændre navnet på filen \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Ingen sider valgt endnu", "field.structure.delete.confirm": "\u00d8nsker du virkelig at slette denne indtastning?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Ingen indtastninger endnu.", "field.users.empty": "Ingen brugere er valgt", @@ -318,7 +322,7 @@ "installation.issues.headline": "Panelet kan ikke installeres", "installation.issues.mbstring": "MB String extension er påkrævet", "installation.issues.media": "/media mappen eksisterer ikke eller er ikke skrivbar", - "installation.issues.php": "Sikre dig at der benyttes PHP 7+", + "installation.issues.php": "Sikre dig at der benyttes PHP 8+", "installation.issues.server": "Kirby kræver Apache, Nginx eller Caddy", "installation.issues.sessions": "/site/sessions mappen eksisterer ikke eller er ikke skrivbar", @@ -349,6 +353,8 @@ "license.manage": "Manage your licenses", "license.register.help": "Du modtog din licenskode efter købet via email. Venligst kopier og indsæt den for at registrere.", "license.register.label": "Indtast venligst din licenskode", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Tak for din støtte af Kirby", "license.unregistered": "Dette er en uregistreret demo af Kirby", "license.unregistered.label": "Unregistered", diff --git a/kirby/i18n/translations/de.json b/kirby/i18n/translations/de.json index 80c969d..17a283c 100644 --- a/kirby/i18n/translations/de.json +++ b/kirby/i18n/translations/de.json @@ -1,7 +1,7 @@ { "account.changeName": "Deinen Namen ändern", "account.delete": "Deinen Account löschen", - "account.delete.confirm": "Willst du deinen Account wirklich löschen? Du wirst sofort danach abgemeldet. Dein Account kann nicht wieder hergestellt werden. ", + "account.delete.confirm": "Willst du deinen Account wirklich löschen? Du wirst sofort danach abgemeldet. Dein Account kann nicht wieder hergestellt werden.", "add": "Hinzuf\u00fcgen", "author": "Autor", @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Bitte füge mindestens einen Block hinzu", "error.blocks.validation": "Fehler im \"{field}\" Feld in Block {index} mit dem Block Typ \"{fieldset}\"", + "error.cache.type.invalid": "Ungültiger Cachetyp: \"{type}\"", + "error.email.preset.notFound": "Die E-Mailvorlage \"{name}\" wurde nicht gefunden", "error.field.converter.invalid": "Ungültiger Konverter: \"{converter}\"", + "error.field.type.missing": "Feld \"{ name }\": Der Feldtyp \"{ type }\" existiert nicht", "error.file.changeName.empty": "Bitte gib einen Namen an", "error.file.changeName.permission": "Du darfst den Dateinamen von \"{filename}\" nicht ändern", @@ -107,7 +110,7 @@ "error.language.name": "Bitte gib einen gültigen Namen für die Sprache an", "error.language.notFound": "Die Sprache konnte nicht gefunden werden", - "error.layout.validation.block": "Fehler im \"{field}\" Feld in Block {blockIndex} mit dem Block Typ \"{fieldset}\" in Layout {layoutIndex}", + "error.layout.validation.block": "Fehler im \"{field}\" Feld in Block {blockIndex} mit dem Blocktyp \"{fieldset}\" in Layout {layoutIndex}", "error.layout.validation.settings": "Fehler in den Einstellungen von Layout {index}", "error.license.format": "Bitte gib einen gültigen Lizenzschlüssel ein", @@ -162,7 +165,7 @@ "error.template.default.notFound": "Die \"Default\"-Vorlage existiert nicht", - "error.unexpected": "Ein unerwarteter Fehler ist aufgetreten. Aktiviere den Debug Modus für weitere Informationen: https://getkirby.com/docs/reference/system/options/debug", + "error.unexpected": "Ein unerwarteter Fehler ist aufgetreten. Aktiviere den Debug-Modus für weitere Informationen: https://getkirby.com/docs/reference/system/options/debug", "error.user.changeEmail.permission": "Du kannst die E-Mailadresse für den Account \"{name}\" nicht ändern", "error.user.changeLanguage.permission": "Du kannst die Sprache für den Account \"{name}\" nicht ändern", @@ -289,6 +292,7 @@ "field.pages.empty": "Keine Seiten ausgewählt", "field.structure.delete.confirm": "Willst du diesen Eintrag wirklich l\u00f6schen?", + "field.structure.delete.confirm.all": "Möchtest du wirklich alle Einträge löschen?", "field.structure.empty": "Es bestehen keine Eintr\u00e4ge.", "field.users.empty": "Keine Accounts ausgewählt", @@ -318,7 +322,7 @@ "installation.issues.headline": "Das Panel kann nicht installiert werden", "installation.issues.mbstring": "Die MB String Erweiterung wird benötigt", "installation.issues.media": "Der /media Ordner ist nicht beschreibbar", - "installation.issues.php": "Bitte verwende PHP 7+", + "installation.issues.php": "Bitte verwende PHP 8+", "installation.issues.server": "Kirby benötigt Apache, Nginx or Caddy", "installation.issues.sessions": "/site/sessions ist nicht beschreibbar", @@ -349,6 +353,8 @@ "license.manage": "Verwalte deine Lizenzen", "license.register.help": "Den Lizenzcode findest du in der Bestätigungsmail zu deinem Kauf. Bitte kopiere und füge ihn ein, um Kirby zu registrieren.", "license.register.label": "Bitte gib deinen Lizenzcode ein", + "license.register.domain": "Deine Lizenz wird unter der Domain {host} registriert", + "license.register.local": "Du bist dabei, deine Lizenz unter der lokalen Domain {host} zu registrieren. Wenn diese Seite unter einer anderen Domain veröffentlicht werden soll, registriere die Lizenz statt dessen bitte dort. Wenn du {host} als Domain verwenden möchtest, fahre bitte fort. ", "license.register.success": "Vielen Dank für deine Unterstützung", "license.unregistered": "Dies ist eine unregistrierte Kirby-Demo", "license.unregistered.label": "Unregistriert", diff --git a/kirby/i18n/translations/el.json b/kirby/i18n/translations/el.json index dd1bb36..f55b00f 100644 --- a/kirby/i18n/translations/el.json +++ b/kirby/i18n/translations/el.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "You must add at least one block", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "Δεν είναι δυνατή η εύρεση της προεπιλογής διεύθινσης ηλεκτρονικού ταχυδρομείου \"{name}\"", "error.field.converter.invalid": "Μη έγκυρος μετατροπέας \"{converter}\"", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "The name must not be empty", "error.file.changeName.permission": "Δεν επιτρέπεται να αλλάξετε το όνομα του \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Δεν έχουν επιλεγεί ακόμη σελίδες", "field.structure.delete.confirm": "\u0395\u03af\u03c3\u03c4\u03b5 \u03c3\u03af\u03b3\u03bf\u03c5\u03c1\u03bf\u03c2 \u03cc\u03c4\u03b9 \u03b8\u03ad\u03bb\u03b5\u03c4\u03b5 \u03bd\u03b1 \u03b4\u03b9\u03b1\u03b3\u03c1\u03ac\u03c8\u03b5\u03c4\u03b5 \u03b1\u03c5\u03c4\u03ae\u03bd \u03c4\u03b7\u03bd \u03ba\u03b1\u03c4\u03b1\u03c7\u03ce\u03c1\u03b9\u03c3\u03b7;", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "\u0394\u03b5\u03bd \u03c5\u03c0\u03ac\u03c1\u03c7\u03bf\u03c5\u03bd \u03b1\u03ba\u03cc\u03bc\u03b7 \u03ba\u03b1\u03c4\u03b1\u03c7\u03c9\u03c1\u03af\u03c3\u03b5\u03b9\u03c2.", "field.users.empty": "Δεν έχουν επιλεγεί ακόμη χρήστες", @@ -318,7 +322,7 @@ "installation.issues.headline": "Ο πίνακας ελέγχου δεν μπορεί να εγκατασταθεί", "installation.issues.mbstring": "Απαιτείται η επέκταση MB String ", "installation.issues.media": "Ο φάκελος /media δεν υπάρχει ή δεν είναι εγγράψιμος", - "installation.issues.php": "Βεβαιωθείτε ότι χρησιμοποιήτε PHP 7+", + "installation.issues.php": "Βεβαιωθείτε ότι χρησιμοποιήτε PHP 8+", "installation.issues.server": "To Kirby απαιτεί Apache, Nginx ή Caddy", "installation.issues.sessions": "Ο φάκελος /site/sessions δεν υπάρχει ή δεν είναι εγγράψιμος", @@ -349,6 +353,8 @@ "license.manage": "Manage your licenses", "license.register.help": "Έχετε λάβει τον κωδικό άδειας χρήσης μετά την αγορά μέσω ηλεκτρονικού ταχυδρομείου. Παρακαλώ αντιγράψτε και επικολλήστε τον για να εγγραφείτε.", "license.register.label": "Παρακαλώ εισαγάγετε τον κωδικό άδειας χρήσης", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Σας ευχαριστούμε για την υποστήριξη του Kirby", "license.unregistered": "Αυτό είναι ένα μη καταχωρημένο demo του Kirby", "license.unregistered.label": "Unregistered", @@ -382,7 +388,7 @@ "login.toggleText.password-reset.email": "Forgot your password?", "login.toggleText.password-reset.email-password": "← Back to login", - "logout": "\u0391\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7", + "logout": "Αποσύνδεση", "menu": "Μενού", "meridiem": "Π.Μ./Μ.Μ", diff --git a/kirby/i18n/translations/en.json b/kirby/i18n/translations/en.json index 96015cf..06f93e6 100644 --- a/kirby/i18n/translations/en.json +++ b/kirby/i18n/translations/en.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "You must add at least one block", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "The email preset \"{name}\" cannot be found", "error.field.converter.invalid": "Invalid converter \"{converter}\"", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "The name must not be empty", "error.file.changeName.permission": "You are not allowed to change the name of \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "No pages selected yet", "field.structure.delete.confirm": "Do you really want to delete this row?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "No entries yet", "field.users.empty": "No users selected yet", @@ -318,7 +322,7 @@ "installation.issues.headline": "The panel cannot be installed", "installation.issues.mbstring": "The MB String extension is required", "installation.issues.media": "The /media folder does not exist or is not writable", - "installation.issues.php": "Make sure to use PHP 7+", + "installation.issues.php": "Make sure to use PHP 8+", "installation.issues.server": "Kirby requires Apache, Nginx or Caddy", "installation.issues.sessions": "The /site/sessions folder does not exist or is not writable", @@ -349,6 +353,8 @@ "license.manage": "Manage your licenses", "license.register.help": "You received your license code after the purchase via email. Please copy and paste it to register.", "license.register.label": "Please enter your license code", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Thank you for supporting Kirby", "license.unregistered": "This is an unregistered demo of Kirby", "license.unregistered.label": "Unregistered", @@ -382,7 +388,7 @@ "login.toggleText.password-reset.email": "Forgot your password?", "login.toggleText.password-reset.email-password": "← Back to login", - "logout": "Logout", + "logout": "Log out", "menu": "Menu", "meridiem": "AM/PM", @@ -393,7 +399,7 @@ "months.april": "April", "months.august": "August", "months.december": "December", - "months.february": "Feburary", + "months.february": "February", "months.january": "January", "months.july": "July", "months.june": "June", diff --git a/kirby/i18n/translations/eo.json b/kirby/i18n/translations/eo.json index 1ada41f..8d0ee25 100644 --- a/kirby/i18n/translations/eo.json +++ b/kirby/i18n/translations/eo.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Oni devas aldoni almenaŭ unu blokon", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "La retpoŝta antaŭagordo \"{name}\" ne estas trovebla", "error.field.converter.invalid": "Nevalida konvertilo \"{converter}\"", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "La nomo ne rajtas esti malplena", "error.file.changeName.permission": "Vi ne rajtas ŝanĝi la nomon de \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Ankoraŭ neniu paĝo elektita", "field.structure.delete.confirm": "Ĉu vi certe volas forigi ĉi tiun vicon?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Ankoraŭ neniu enigo", "field.users.empty": "Ankoraŭ neniu uzanto elektita", @@ -318,7 +322,7 @@ "installation.issues.headline": "Ne eblas instali la panelon", "installation.issues.mbstring": "La kromprogramo MB String estas deviga", "installation.issues.media": "La dosierujo /media ne ekzistas, aũ ne estas skribebla", - "installation.issues.php": "Nepre uzu PHP 7+", + "installation.issues.php": "Nepre uzu PHP 8+", "installation.issues.server": "Kirby bezonas Apache, NginxCaddy", "installation.issues.sessions": "La dosierujo /site/sessions ne ekzistas, aŭ ne estas skribebla", @@ -349,6 +353,8 @@ "license.manage": "Manage your licenses", "license.register.help": "Vi ricevis vian kodon de permisilo retpoŝte, post aĉeti ĝin. Bonvolu kopii kaj alglui ĝin por registriĝi.", "license.register.label": "Bonvolu entajpi vian kodon de permisilo", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Dankon pro subteni Kirby", "license.unregistered": "Ĉi tiu estas neregistrita kopio de Kirby", "license.unregistered.label": "Unregistered", diff --git a/kirby/i18n/translations/es_419.json b/kirby/i18n/translations/es_419.json index cc2101f..dc0b07e 100644 --- a/kirby/i18n/translations/es_419.json +++ b/kirby/i18n/translations/es_419.json @@ -29,7 +29,7 @@ "days.tue": "Mar", "days.wed": "Mi\u00e9", - "debugging": "Debugging", + "debugging": "Depuración", "delete": "Eliminar", "delete.all": "Eliminar todos", @@ -49,8 +49,8 @@ "email": "Correo Electrónico", "email.placeholder": "correo@ejemplo.com", - "entries": "Entries", - "entry": "Entry", + "entries": "Entradas", + "entry": "Entrada", "environment": "Ambiente", @@ -70,11 +70,14 @@ "error.blocks.max.singular": "No debes añadir más de un bloque", "error.blocks.min.plural": "Debes añadir al menos {min} bloques ", "error.blocks.min.singular": "Debes añadir al menos un bloque", - "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.blocks.validation": "Hay un error en el campo \"{field}\" del bloque {index} que utiliza el tipo de bloque \"{fieldset}\"", + + "error.cache.type.invalid": "Tipo de caché \"{tipo}\" no válido", "error.email.preset.notFound": "El preajuste de email \"{name}\" no se pudo encontrar.", "error.field.converter.invalid": "Convertidor inválido \"{converter}\"", + "error.field.type.missing": "Campo \"{ name }\": El tipo de campo \"{ type }\" no existe", "error.file.changeName.empty": "El nombre no debe estar vacío", "error.file.changeName.permission": "No tienes permitido cambiar el nombre de \"{filename}\"", @@ -107,14 +110,14 @@ "error.language.name": "Por favor introduce un nombre válido para el idioma", "error.language.notFound": "No se pudo encontrar el idioma", - "error.layout.validation.block": "There's an error on the \"{field}\" field in block {blockIndex} using the \"{fieldset}\" block type in layout {layoutIndex}", - "error.layout.validation.settings": "There's an error in layout {index} settings", + "error.layout.validation.block": "Hay un error en el campo \"{field}\" del bloque {blockIndex} que utiliza el tipo de bloque \"{fieldset}\" en el layout {layoutIndex}", + "error.layout.validation.settings": "Hay un error en los ajustes del layout {index}", "error.license.format": "Por favor introduce una llave de licencia válida", "error.license.email": "Por favor ingresa un correo electrónico valido", "error.license.verification": "La licencia no pude ser verificada", - "error.object.validation": "There’s an error in the \"{label}\" field:\n{message}", + "error.object.validation": "Hay un error en el campo \"{label}\":\n{message}", "error.offline": "El Panel se encuentra fuera de linea ", @@ -136,8 +139,8 @@ "error.page.duplicate.permission": "No tienes permitido duplicar \"{slug}\"", "error.page.notFound": "La página \"{slug}\" no se encuentra", "error.page.num.invalid": "Por favor, introduce un número de posición válido. Los números no deben ser negativos.", - "error.page.slug.invalid": "Please enter a valid URL appendix", - "error.page.slug.maxlength": "Slug length must be less than \"{length}\" characters", + "error.page.slug.invalid": "Por favor, introduce un apéndice de URL válido", + "error.page.slug.maxlength": "La longitud del slug debe ser inferior a \"{length}\" caracteres", "error.page.sort.permission": "La página \"{slug}\" no se puede ordenar", "error.page.status.invalid": "Por favor, establece una estado de página válido", "error.page.undefined": "La p\u00e1gina no fue encontrada", @@ -162,7 +165,7 @@ "error.template.default.notFound": "La plantilla predeterminada no existe", - "error.unexpected": "An unexpected error occurred! Enable debug mode for more info: https://getkirby.com/docs/reference/system/options/debug", + "error.unexpected": "¡Se ha producido un error inesperado! Activa el modo de depuración para obtener más información: https://getkirby.com/docs/reference/system/options/debug", "error.user.changeEmail.permission": "No tienes permiso para cambiar el email del usuario \"{name}\"", "error.user.changeLanguage.permission": "No tienes permiso para cambiar el idioma del usuario \"{name}\"", @@ -267,46 +270,47 @@ "field.blocks.quote.name": "Cita", "field.blocks.quote.text.label": "Texto", "field.blocks.quote.text.placeholder": "Cita...", - "field.blocks.quote.citation.label": "Citation", + "field.blocks.quote.citation.label": "Cita", "field.blocks.quote.citation.placeholder": "Por ...", "field.blocks.text.name": "Texto", - "field.blocks.text.placeholder": "Text …", + "field.blocks.text.placeholder": "Texto ...", "field.blocks.video.caption": "Leyenda", "field.blocks.video.name": "Video", - "field.blocks.video.placeholder": "Enter a video URL", - "field.blocks.video.url.label": "Video-URL", + "field.blocks.video.placeholder": "Introduce la URL de un vídeo", + "field.blocks.video.url.label": "Vídeo-URL", "field.blocks.video.url.placeholder": "https://youtube.com/?v=", "field.files.empty": "Aún no ha seleccionado ningún archivo", - "field.layout.delete": "Delete layout", - "field.layout.delete.confirm": "Do you really want to delete this layout?", - "field.layout.empty": "No rows yet", - "field.layout.select": "Select a layout", + "field.layout.delete": "Eliminar layout", + "field.layout.delete.confirm": "¿Realmente quieres eliminar este layout?", + "field.layout.empty": "Aún no hay filas", + "field.layout.select": "Seleccionar layout", - "field.object.empty": "No information yet", + "field.object.empty": "Aún no hay información", "field.pages.empty": "Aún no ha seleccionado ningúna pagina", "field.structure.delete.confirm": "\u00bfEn realidad desea borrar esta entrada?", + "field.structure.delete.confirm.all": "¿Realmente quieres eliminar todas las entradas?", "field.structure.empty": "A\u00fan no existen entradas.", "field.users.empty": "Aún no ha seleccionado ningún usuario", - "file.blueprint": "This file has no blueprint yet. You can define the setup in /site/blueprints/files/{blueprint}.yml", + "file.blueprint": "Este archivo aún no tiene blueprint. Puedes definir la configuración en /site/blueprints/files/{blueprint}.yml", "file.delete.confirm": "\u00bfEst\u00e1s seguro que deseas eliminar este archivo?", - "file.sort": "Change position", + "file.sort": "Cambiar posición", "files": "Archivos", "files.empty": "Aún no existen archivos", - "hide": "Hide", + "hide": "Ocultar", "hour": "Hora", - "import": "Import", + "import": "Importar", "info": "Info", "insert": "Insertar", - "insert.after": "Insert after", - "insert.before": "Insert before", + "insert.after": "Insertar después", + "insert.before": "Insertar antes", "install": "Instalar", "installation": "Instalación", @@ -318,7 +322,7 @@ "installation.issues.headline": "El panel no puede ser instalado.", "installation.issues.mbstring": "Se requiere la extensión MB String.", "installation.issues.media": "La carpeta /media no existe o no posee permisos de escritura.", - "installation.issues.php": "Asegurese de estar usando PHP 7+", + "installation.issues.php": "Asegurese de estar usando PHP 8+", "installation.issues.server": "Kirby requiere Apache, Nginx, Caddy", "installation.issues.sessions": "La carpeta /site/sessions no existe o no posee permisos de escritura.", @@ -346,12 +350,14 @@ "license": "Licencia", "license.buy": "Comprar una licencia", "license.register": "Registrar", - "license.manage": "Manage your licenses", + "license.manage": "Gestiona tus licencias", "license.register.help": "Recibió su código de licencia después de la compra por correo electrónico. Por favor copie y pegue para registrarse.", "license.register.label": "Por favor, ingresa tu código de licencia", + "license.register.domain": "Tu licencia será registrada para {host}.", + "license.register.local": "Estás a punto de registrar tu licencia para el dominio local {host}. Si este sitio va a ser desplegado en un dominio público, por favor regístralo allí. Si {host} es el dominio en el que quiere registrar Kirby, por favor continúa.", "license.register.success": "Gracias por apoyar a Kirby", "license.unregistered": "Este es un demo no registrado de Kirby", - "license.unregistered.label": "Unregistered", + "license.unregistered.label": "No registrado", "link": "Enlace", "link.text": "Texto de Enlace", @@ -367,22 +373,22 @@ "lock.isUnlocked": "Tus cambios sin guardar han sido sobrescritos por otro usuario. Puedes descargar los cambios y fusionarlos manualmente.", "login": "Iniciar sesión", - "login.code.label.login": "Login code", - "login.code.label.password-reset": "Password reset code", + "login.code.label.login": "Código de inicio de sesión", + "login.code.label.password-reset": "Código de restablecimiento de contraseña", "login.code.placeholder.email": "000 000", - "login.code.text.email": "If your email address is registered, the requested code was sent via email.", - "login.email.login.body": "Hi {user.nameOrEmail},\n\nYou recently requested a login code for the Panel of {site}.\nThe following login code will be valid for {timeout} minutes:\n\n{code}\n\nIf you did not request a login code, please ignore this email or contact your administrator if you have questions.\nFor security, please DO NOT forward this email.", - "login.email.login.subject": "Your login code", - "login.email.password-reset.body": "Hi {user.nameOrEmail},\n\nYou recently requested a password reset code for the Panel of {site}.\nThe following password reset code will be valid for {timeout} minutes:\n\n{code}\n\nIf you did not request a password reset code, please ignore this email or contact your administrator if you have questions.\nFor security, please DO NOT forward this email.", - "login.email.password-reset.subject": "Your password reset code", + "login.code.text.email": "Si tu dirección de correo electrónico está registrada, el código solicitado fue enviado por correo electrónico.", + "login.email.login.body": "Hola {user.nameOrEmail},\n\nHas pedido, recientemente, un código de restablecimiento de contraseña para el Panel del sitio {site}.\nEl siguiente código de restablecimiento de contraseña será válido por {timeout} minutos:\n\n{code}\n\nSi no pediste un código de restablecimiento de contraseña, por favor ignora este correo o contacta a tu administrador si tienes dudas.\nPor seguridad, por favor NO reenvíes este correo.", + "login.email.login.subject": "Tu código de inicio de sesión", + "login.email.password-reset.body": "Hola {user.nameOrEmail},\n\nHas pedido, recientemente, un código de restablecimiento de contraseña para el Panel del sitio {site}.\nEl siguiente código de restablecimiento de contraseña será válido por {timeout} minutos:\n\n{code}\n\nSi no pediste un código de restablecimiento de contraseña, por favor ignora este correo o contacta a tu administrador si tienes dudas.\nPor seguridad, por favor NO reenvíes este correo.", + "login.email.password-reset.subject": "Tu código de restablecimiento de contraseña", "login.remember": "Mantener mi sesión iniciada", - "login.reset": "Reset password", - "login.toggleText.code.email": "Login via email", - "login.toggleText.code.email-password": "Login with password", - "login.toggleText.password-reset.email": "Forgot your password?", - "login.toggleText.password-reset.email-password": "← Back to login", + "login.reset": "Restablecer contraseña", + "login.toggleText.code.email": "Iniciar sesión por correo electrónico", + "login.toggleText.code.email-password": "Iniciar sesión con contraseña", + "login.toggleText.password-reset.email": "¿Olvidaste tu contraseña?", + "login.toggleText.password-reset.email-password": "← Volver al inicio de sesión", - "logout": "Cerrar sesi\u00f3n", + "logout": "Cerrar sesión", "menu": "Menù", "meridiem": "AM/PM", @@ -410,16 +416,16 @@ "off": "Apagado", "on": "Encendido", "open": "Abrir", - "open.newWindow": "Open in new window", + "open.newWindow": "Abrir en una ventana nueva", "options": "Opciones", - "options.none": "No options", + "options.none": "Sin opciones", "orientation": "Orientación", "orientation.landscape": "Paisaje", "orientation.portrait": "Retrato", "orientation.square": "Diapositiva", - "page.blueprint": "This page has no blueprint yet. You can define the setup in /site/blueprints/pages/{blueprint}.yml", + "page.blueprint": "Este archivo aún no tiene blueprint. Puedes definir la configuración en /site/blueprints/pages/{blueprint}.yml", "page.changeSlug": "Cambiar URL", "page.changeSlug.fromTitle": "Crear a partir del t\u00edtulo", "page.changeStatus": "Cambiar estado", @@ -433,10 +439,10 @@ "page.duplicate.appendix": "Copiar", "page.duplicate.files": "Copiar archivos", "page.duplicate.pages": "Copiar páginas", - "page.sort": "Change position", + "page.sort": "Cambiar posición", "page.status": "Estado", "page.status.draft": "Borrador", - "page.status.draft.description": "The page is in draft mode and only visible for logged in editors or via secret link", + "page.status.draft.description": "La página está en modo borrador y solo es visible para editores conectados o mediante enlace secreto.", "page.status.listed": "Pública", "page.status.listed.description": "La página es pública para cualquiera", "page.status.unlisted": "No publicada", @@ -451,19 +457,19 @@ "pagination.page": "Página", "password": "Contrase\u00f1a", - "paste": "Paste", - "paste.after": "Paste after", + "paste": "Pegar", + "paste.after": "Pegar después", "pixel": "Pixel", "plugin": "Plugin", "plugins": "Plugins", "prev": "Anterior", - "preview": "Preview", + "preview": "Previsualizar", "remove": "Eliminar", "rename": "Renombrar", "replace": "Reemplazar", "retry": "Reintentar", "revert": "Revertir", - "revert.confirm": "Do you really want to delete all unsaved changes?", + "revert.confirm": "¿Realmente quieres eliminar todos los cambios sin guardar?", "role": "Rol", "role.admin.description": "El administrador tiene todos los derechos", @@ -476,42 +482,42 @@ "save": "Guardar", "search": "Buscar", - "search.min": "Enter {min} characters to search", - "search.all": "Show all", - "search.results.none": "No results", + "search.min": "Introduce {min} caracteres para buscar", + "search.all": "Mostrar todo", + "search.results.none": "Sin resultados", "section.required": "Esta sección es requerida", - "security": "Security", + "security": "Seguridad", "select": "Seleccionar", - "server": "Server", + "server": "Servidor", "settings": "Ajustes", - "show": "Show", - "site.blueprint": "The site has no blueprint yet. You can define the setup in /site/blueprints/site.yml", + "show": "Mostrar", + "site.blueprint": "Este archivo aún no tiene blueprint. Puedes definir la configuración en /site/blueprints/site.yml", "size": "Tamaño", "slug": "Apéndice URL", "sort": "Ordenar", - "stats.empty": "No reports", - "system.issues.content": "The content folder seems to be exposed", - "system.issues.eol.kirby": "Your installed Kirby version has reached end-of-life and will not receive further security updates", - "system.issues.eol.plugin": "Your installed version of the { plugin } plugin is has reached end-of-life and will not receive further security updates", - "system.issues.debug": "Debugging must be turned off in production", - "system.issues.git": "The .git folder seems to be exposed", - "system.issues.https": "We recommend HTTPS for all your sites", - "system.issues.kirby": "The kirby folder seems to be exposed", - "system.issues.site": "The site folder seems to be exposed", - "system.issues.vulnerability.kirby": "Your installation might be affected by the following vulnerability ({ severity } severity): { description }", - "system.issues.vulnerability.plugin": "Your installation might be affected by the following vulnerability in the { plugin } plugin ({ severity } severity): { description }", - "system.updateStatus": "Update status", - "system.updateStatus.error": "Could not check for updates", - "system.updateStatus.not-vulnerable": "No known vulnerabilities", - "system.updateStatus.security-update": "Free security update { version } available", - "system.updateStatus.security-upgrade": "Upgrade { version } with security fixes available", - "system.updateStatus.unreleased": "Unreleased version", - "system.updateStatus.up-to-date": "Up to date", - "system.updateStatus.update": "Free update { version } available", - "system.updateStatus.upgrade": "Upgrade { version } available", + "stats.empty": "Sin informes", + "system.issues.content": "La carpeta content parece estar expuesta", + "system.issues.eol.kirby": "La versión de Kirby que tienes instalada ha llegado al final de su vida útil y no recibirá más actualizaciones de seguridad.", + "system.issues.eol.plugin": "Tu versión instalada del plugin { plugin } ha llegado al final de su vida útil y no recibirá más actualizaciones de seguridad.", + "system.issues.debug": "La depuración debe estar desactivada en producción", + "system.issues.git": "La carpeta .git parece estar expuesta", + "system.issues.https": "Recomendamos HTTPS para todos tus sitios web", + "system.issues.kirby": "La carpeta kirby parece estar expuesta", + "system.issues.site": "La carpeta site parece estar expuesta", + "system.issues.vulnerability.kirby": "Tu instalación podría estar afectada por la siguiente vulnerabilidad ({ severity } gravedad): { description }", + "system.issues.vulnerability.plugin": "Tu instalación podría estar afectada por la siguiente vulnerabilidad en el plugin { plugin } ({ severity } gravedad): { description }", + "system.updateStatus": "Estado de actualización", + "system.updateStatus.error": "No se ha podido comprobar si hay actualizaciones", + "system.updateStatus.not-vulnerable": "No hay vulnerabilidades conocidas", + "system.updateStatus.security-update": "Actualización gratuita de seguridad { version } disponible", + "system.updateStatus.security-upgrade": "Actualización { versión } con correcciones de seguridad disponibles", + "system.updateStatus.unreleased": "Versión no publicada", + "system.updateStatus.up-to-date": "Actualizado", + "system.updateStatus.update": "Actualización gratuita {version} disponible", + "system.updateStatus.upgrade": "Actualización {versión} disponible", "title": "Título", "template": "Plantilla", @@ -532,10 +538,10 @@ "toolbar.button.file.select": "Selecciona un archivo", "toolbar.button.file.upload": "Sube un archivo", "toolbar.button.link": "Enlace", - "toolbar.button.paragraph": "Paragraph", - "toolbar.button.strike": "Strike-through", + "toolbar.button.paragraph": "Parágrafo", + "toolbar.button.strike": "Tachado", "toolbar.button.ol": "Lista en orden", - "toolbar.button.underline": "Underline", + "toolbar.button.underline": "Subrayado", "toolbar.button.ul": "Lista de viñetas", "translation.author": "Equipo Kirby", @@ -562,7 +568,7 @@ "url.placeholder": "https://ejemplo.com", "user": "Usuario", - "user.blueprint": "You can define additional sections and form fields for this user role in /site/blueprints/users/{blueprint}.yml", + "user.blueprint": "Puedes definir secciones y campos de formulario adicionales para este rol de usuario en /site/blueprints/users/{blueprint}.yml", "user.changeEmail": "Cambiar correo electrónico", "user.changeLanguage": "Cambiar idioma", "user.changeName": "Renombrar este usuario", @@ -578,19 +584,19 @@ "users": "Usuarios", "version": "Versión", - "version.current": "Current version", - "version.latest": "Latest version", - "versionInformation": "Version information", + "version.current": "Versión actual", + "version.latest": "Última versión", + "versionInformation": "información sobre la versión", "view.account": "Tu cuenta", "view.installation": "Instalaci\u00f3n", "view.languages": "Idiomas", - "view.resetPassword": "Reset password", + "view.resetPassword": "Restablecer contraseña", "view.site": "Sitio", - "view.system": "System", + "view.system": "Sistema", "view.users": "Usuarios", "welcome": "Bienvenido", "year": "Año", - "yes": "yes" + "yes": "Sí" } diff --git a/kirby/i18n/translations/es_ES.json b/kirby/i18n/translations/es_ES.json index 7fe8012..134b2f0 100644 --- a/kirby/i18n/translations/es_ES.json +++ b/kirby/i18n/translations/es_ES.json @@ -1,6 +1,6 @@ { - "account.changeName": "Cambia tu nombre", - "account.delete": "Borrar tu cuenta", + "account.changeName": "Cambiar nombre", + "account.delete": "Borrar cuenta", "account.delete.confirm": "¿Realmente quieres eliminar tu cuenta? Tu sesión se cerrará inmediatamente. La cuenta no podrá ser recuperada.", "add": "Añadir", @@ -12,7 +12,7 @@ "close": "Cerrar", "confirm": "Confirmar", "collapse": "Colapsar", - "collapse.all": "Colapsar todos", + "collapse.all": "Colapsar todo", "copy": "Copiar", "copy.all": "Copiar todo", "create": "Crear", @@ -29,14 +29,14 @@ "days.tue": "Ma", "days.wed": "Mi", - "debugging": "Debugging", + "debugging": "Depuración", - "delete": "Borrar", - "delete.all": "Eliminar todos", + "delete": "Eliminar", + "delete.all": "Eliminar todo", - "dialog.files.empty": "No se ha seleccionado ningún archivo", - "dialog.pages.empty": "No se ha seleccionado ninguna página", - "dialog.users.empty": "No se ha seleccionado ningún usuario", + "dialog.files.empty": "No hay archivos para seleccionar", + "dialog.pages.empty": "No hay páginas para seleccionar", + "dialog.users.empty": "No hay usuarios para seleccionar", "dimensions": "Dimensiones", "disabled": "Desabilitado", @@ -49,19 +49,19 @@ "email": "Correo electrónico", "email.placeholder": "correo@ejemplo.com", - "entries": "Entries", - "entry": "Entry", + "entries": "Entradas", + "entry": "Entrada", - "environment": "Ambiente", + "environment": "Entorno", "error.access.code": "Código inválido", - "error.access.login": "Ingreso inválido", - "error.access.panel": "No estás autorizado para acceder al panel", + "error.access.login": "Inicio de sesión inválido", + "error.access.panel": "No tienes permiso para acceder al panel", "error.access.view": "No tienes permiso para acceder a esta parte del panel", "error.avatar.create.fail": "No se pudo subir la foto de perfil.", "error.avatar.delete.fail": "No se pudo borrar la foto de perfil", - "error.avatar.dimensions.invalid": "Por favor, mantenga el ancho y la altura de la imagen de perfil debajo de 3000 píxeles", + "error.avatar.dimensions.invalid": "Por favor, mantén el ancho y la altura de la imagen de perfil por debajo de 3000 píxeles", "error.avatar.mime.forbidden": "La imagen del perfil debe ser JPEG o PNG.", "error.blueprint.notFound": "El blueprint \"{name}\" no pudo ser cargado", @@ -70,86 +70,89 @@ "error.blocks.max.singular": "No debes añadir más de un bloque", "error.blocks.min.plural": "Debes añadir al menos {min} bloques ", "error.blocks.min.singular": "Debes añadir al menos un bloque", - "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.blocks.validation": "Hay un error en el campo \"{field}\" del bloque {index} que utiliza el tipo de bloque \"{fieldset}\"", - "error.email.preset.notFound": "El preset del correo \"{name}\" no pudo ser encontrado", + "error.cache.type.invalid": "Tipo de caché inválido \"{tipo}\"", + + "error.email.preset.notFound": "El preset del correo \"{name}\" no puede ser encontrado", "error.field.converter.invalid": "Convertidor \"{converter}\" inválido", + "error.field.type.missing": "Campo \"{ name }\": El tipo de campo \"{ type }\" no existe", "error.file.changeName.empty": "El nombre no debe estar vacío", - "error.file.changeName.permission": "No tienes permitido cambiar el nombre de \"{filename}\"", + "error.file.changeName.permission": "No tienes permiso para cambiar el nombre de \"{filename}\"", "error.file.duplicate": "Ya existe un archivo con el nombre \"{filename}\"", "error.file.extension.forbidden": "La extensión \"{extension}\" no está permitida", "error.file.extension.invalid": "Extensión inválida: {extension}", "error.file.extension.missing": "Falta la extensión para \"{filename}\"", "error.file.maxheight": "La altura de la imagen no debe exceder {height} pixeles", - "error.file.maxsize": "El archivo es muy grande", + "error.file.maxsize": "El archivo es demasiado grande", "error.file.maxwidth": "El ancho de la imagen no debe exceder {width} pixeles", "error.file.mime.differs": "El archivo cargado debe ser del mismo tipo mime \"{mime}\"", "error.file.mime.forbidden": "Los medios tipo \"{mime}\" no están permitidos", - "error.file.mime.invalid": "Tipo invalido de mime: {mime}", - "error.file.mime.missing": "El tipo de medio para \"{filename}\" no pudo ser detectado", + "error.file.mime.invalid": "Tipo de mime inválido: {mime}", + "error.file.mime.missing": "El tipo de medio para \"{filename}\" no puede ser detectado", "error.file.minheight": "La altura de la imagen debe ser de al menos {height} pixeles", - "error.file.minsize": "El archivo es muy pequeño", + "error.file.minsize": "El archivo es demasiado pequeño", "error.file.minwidth": "El ancho de la imagen debe ser de al menos {width} pixeles", "error.file.name.missing": "El nombre de archivo no debe estar vacío", - "error.file.notFound": "El archivo \"{filename}\" no pudo ser encontrado", - "error.file.orientation": "The orientation of the image must be \"{orientation}\"", - "error.file.type.forbidden": "No está permitido subir archivos {type}", + "error.file.notFound": "El archivo \"{filename}\" no puede ser encontrado", + "error.file.orientation": "La orientación de la imagen debe ser \"{orientation}", + "error.file.type.forbidden": "No tienes permiso para subir archivos {type}", "error.file.type.invalid": "Tipo de archivo inválido: {type}", - "error.file.undefined": "El archivo no pudo ser encontrado", + "error.file.undefined": "El archivo no puede ser encontrado", - "error.form.incomplete": "Por favor, corrija todos los errores del formulario…", + "error.form.incomplete": "Por favor, corrige todos los errores del formulario…", "error.form.notSaved": "El formulario no pudo ser guardado", - "error.language.code": "Por favor introduce un código válido para el idioma", + "error.language.code": "Por favor, introduce un código válido para el idioma", "error.language.duplicate": "El idioma ya existe", - "error.language.name": "Por favor introduce un nombre válido para el idioma", + "error.language.name": "Por favor, introduce un nombre válido para el idioma", "error.language.notFound": "No se pudo encontrar el idioma", - "error.layout.validation.block": "There's an error on the \"{field}\" field in block {blockIndex} using the \"{fieldset}\" block type in layout {layoutIndex}", - "error.layout.validation.settings": "There's an error in layout {index} settings", + "error.layout.validation.block": "Hay un error en el campo \"{field}\" del bloque {blockIndex} que utiliza el tipo de bloque \"{fieldset}\" en el layout {layoutIndex}", + "error.layout.validation.settings": "Hay un error en los ajustes del layout {index}", - "error.license.format": "Por favor introduce una llave de licencia válida", + "error.license.format": "Por favor, introduce una llave de licencia válida", "error.license.email": "Por favor, introduce un correo electrónico válido", - "error.license.verification": "La licencia no pude ser verificada", + "error.license.verification": "La licencia no pudo ser verificada", - "error.object.validation": "There’s an error in the \"{label}\" field:\n{message}", + "error.object.validation": "Hay un error en el campo \"{label}\":\n{message}", - "error.offline": "El Panel se encuentra fuera de linea ", + "error.offline": "El Panel se encuentra actualmente fuera de línea ", - "error.page.changeSlug.permission": "No está permitido cambiar el apéndice de URL para \"{slug}\"", + "error.page.changeSlug.permission": "No tienes permiso para cambiar el apéndice de URL para \"{slug}\"", "error.page.changeStatus.incomplete": "La página tiene errores y no puede ser publicada.", "error.page.changeStatus.permission": "El estado de esta página no se puede cambiar", "error.page.changeStatus.toDraft.invalid": "La página \"{slug}\" no se puede convertir a borrador", "error.page.changeTemplate.invalid": "La plantilla para la página \"{slug}\" no se puede cambiar", - "error.page.changeTemplate.permission": "No tienes permitido cambiar la plantilla para \"{slug}\"", + "error.page.changeTemplate.permission": "No tienes permiso para cambiar la plantilla para \"{slug}\"", "error.page.changeTitle.empty": "El título no debe estar vacío.", - "error.page.changeTitle.permission": "No tienes permitido cambiar el título por \"{slug}\"", - "error.page.create.permission": "No tienes permitido crear \"{slug}\"", - "error.page.delete": "La página \"{slug}\" no puede ser eliminada", - "error.page.delete.confirm": "Por favor, introduzca el título de la página para confirmar", + "error.page.changeTitle.permission": "No tienes permiso para cambiar el título por \"{slug}\"", + "error.page.create.permission": "No tienes permiso para crear \"{slug}\"", + "error.page.delete": "La página \"{slug}\" no se puede eliminar", + "error.page.delete.confirm": "Por favor, introduce el título de la página para confirmar", "error.page.delete.hasChildren": "La página tiene subpáginas y no se puede eliminar", - "error.page.delete.permission": "No tienes permiso de eliminar \"{slug}\"", + "error.page.delete.permission": "No tienes permiso para eliminar \"{slug}\"", "error.page.draft.duplicate": "Un borrador de página con el apéndice de URL \"{slug}\" ya existe", - "error.page.duplicate": "Una página con el apéndice de URL. \"{slug}\" ya existe", - "error.page.duplicate.permission": "You are not allowed to duplicate \"{slug}\"", - "error.page.notFound": "La página \"{slug}\" no puede ser encontrada", - "error.page.num.invalid": "Por favor, introduzca un número válido. Estos no deben ser negativos.", - "error.page.slug.invalid": "Please enter a valid URL appendix", - "error.page.slug.maxlength": "Slug length must be less than \"{length}\" characters", - "error.page.sort.permission": "La página \"{slug}\" no se puede ordenar", - "error.page.status.invalid": "Por favor, establezca un estado de página válido", - "error.page.undefined": "La página no se puede encontrar", - "error.page.update.permission": "No tienes permitido actualizar \"{slug}\"", + "error.page.duplicate": "Una página con el apéndice de URL \"{slug}\" ya existe", + "error.page.duplicate.permission": "No tienes permiso para duplicar \"{slug}\"", + "error.page.notFound": "No se puede encontrar la página \"{slug}\"", + "error.page.num.invalid": "Por favor, introduce un número de ordenación válido. Los números no deben ser negativos.", + "error.page.slug.invalid": "Por favor, introduce un apéndice de URL válido", + "error.page.slug.maxlength": "La longitud del slug debe ser inferior a \"{length}\" caracteres", + "error.page.sort.permission": "No se puede encontrar la página \"{slug}\"", + "error.page.status.invalid": "Por favor, establece un estado de página válido", + "error.page.undefined": "No se puede encontrar la página", + "error.page.update.permission": "No tienes permiso para actualizar \"{slug}\"", "error.section.files.max.plural": "No debes agregar más de {max} archivos a la sección \"{section}\"", "error.section.files.max.singular": "No debes agregar más de 1 archivo a la sección \"{section}\"", "error.section.files.min.plural": "La sección \"{section}\" requiere al menos {min} archivos", "error.section.files.min.singular": "La sección \"{section}\" requiere al menos un archivo", - "error.section.pages.max.plural": "No debe agregar más de {max} páginas a la sección \"{section}\"", - "error.section.pages.max.singular": "No debe agregar más de una página a la sección \"{section}\"", + "error.section.pages.max.plural": "No debes agregar más de {max} páginas a la sección \"{section}\"", + "error.section.pages.max.singular": "No debes agregar más de una página a la sección \"{section}\"", "error.section.pages.min.plural": "La sección \"{section}\" requiere al menos {min} páginas", "error.section.pages.min.singular": "La sección \"{section}\" requiere al menos una página", @@ -157,94 +160,94 @@ "error.section.type.invalid": "El sección tipo \"{tipo}\" no es válido", "error.site.changeTitle.empty": "El título no debe estar vacío.", - "error.site.changeTitle.permission": "No está permitido cambiar el título del sitio", - "error.site.update.permission": "No tienes permitido actualizar el sitio", + "error.site.changeTitle.permission": "No tienes permiso para cambiar el título del sitio", + "error.site.update.permission": "No tienes permiso para actualizar el sitio", "error.template.default.notFound": "La plantilla por defecto no existe", - "error.unexpected": "An unexpected error occurred! Enable debug mode for more info: https://getkirby.com/docs/reference/system/options/debug", + "error.unexpected": "¡Se ha producido un error inesperado! Activa el modo de depuración para obtener más información: https://getkirby.com/docs/reference/system/options/debug", - "error.user.changeEmail.permission": "No tienes permitido cambiar el correo electrónico para el usuario \"{name}\"", - "error.user.changeLanguage.permission": "No tienes permitido cambiar el idioma para el usuario \"{name}\"", - "error.user.changeName.permission": "No tienes permitido cambiar el nombre del usuario \"{name}\"", - "error.user.changePassword.permission": "No tienes permitido cambiar la contraseña del usuario \"{name}\"", - "error.user.changeRole.lastAdmin": "El rol para el último administrador no puede ser cambiado", - "error.user.changeRole.permission": "No tienes permitido cambiar el rol del usuario \"{name}\"", - "error.user.changeRole.toAdmin": "No tienes permitido promover a alguien al rol de admin", + "error.user.changeEmail.permission": "No tienes permiso para cambiar el correo electrónico para el usuario \"{name}\"", + "error.user.changeLanguage.permission": "No tienes permiso para cambiar el idioma para el usuario \"{name}\"", + "error.user.changeName.permission": "No tienes permiso para cambiar el nombre del usuario \"{name}\"", + "error.user.changePassword.permission": "No tienes permiso para cambiar la contraseña del usuario \"{name}\"", + "error.user.changeRole.lastAdmin": "No se puede cambiar el rol del último administrador", + "error.user.changeRole.permission": "No tienes permiso para cambiar el rol del usuario \"{name}\"", + "error.user.changeRole.toAdmin": "No tienes permiso para promover a alguien al rol de admin", "error.user.create.permission": "No tienes permiso para crear este usuario", - "error.user.delete": "El usuario \"{name}\" no puede ser eliminado", - "error.user.delete.lastAdmin": "El último administrador no puede ser eliminado", - "error.user.delete.lastUser": "El último usuario no puede ser eliminado", - "error.user.delete.permission": "No tienes permitido eliminar el usuario \"{name}\"", + "error.user.delete": "No se puede eliminar el usuario \"{name}\"", + "error.user.delete.lastAdmin": "No se puede eliminar el último admin", + "error.user.delete.lastUser": "No se puede eliminar el último usuario ", + "error.user.delete.permission": "No tienes permiso para eliminar el usuario \"{name}\"", "error.user.duplicate": "Un usuario con la dirección de correo electrónico \"{email}\" ya existe", "error.user.email.invalid": "Por favor, introduce una dirección de correo electrónico válida", - "error.user.language.invalid": "Por favor ingrese un idioma válido", - "error.user.notFound": "El usuario \"{name}\" no pudo ser encontrado", - "error.user.password.invalid": "Por favor introduce una contraseña válida. Las contraseñas deben tener al menos 8 caracteres de largo.", + "error.user.language.invalid": "Por favor, introduce un idioma válido", + "error.user.notFound": "No se puede encontrar el usuario \"{name}\"", + "error.user.password.invalid": "Por favor, introduce una contraseña válida. Las contraseñas deben tener al menos 8 caracteres de largo.", "error.user.password.notSame": "Las contraseñas no coinciden", "error.user.password.undefined": "El usuario no tiene contraseña", "error.user.password.wrong": "Contraseña incorrecta", - "error.user.role.invalid": "Por favor ingrese un rol válido", - "error.user.undefined": "El usuario no puede ser encontrado", - "error.user.update.permission": "No tienes permitido actualizar al usuario \"{name}\"", + "error.user.role.invalid": "Por favor, introduce un rol válido", + "error.user.undefined": "No se puede encontrar el usuario", + "error.user.update.permission": "No tienes permiso para actualizar el usuario \"{name}\"", "error.validation.accepted": "Por favor, confirma", - "error.validation.alpha": "Por favor solo ingresa caracteres entre a-z", - "error.validation.alphanum": "Por favor solo ingrese caracteres entre a-z o numerales 0-9", - "error.validation.between": "Por favor, introduzca un valor entre \"{min}\" y \"{max}\"", - "error.validation.boolean": "Por favor confirme o rechace", - "error.validation.contains": "Por favor ingrese un valor que contenga \"{needle}\"", - "error.validation.date": "Por favor introduzca una fecha valida", - "error.validation.date.after": "Por favor introduce una fecha posterior a {date}", - "error.validation.date.before": "Por favor introduce una fecha anterior a {date}", - "error.validation.date.between": "Por favor introduce un número entre {min} y {max}", - "error.validation.denied": "Por favor, rechace", + "error.validation.alpha": "Por favor, introduce solo caracteres entre a-z", + "error.validation.alphanum": "Por favor, introduce solo caracteres entre a-z o numerales 0-9", + "error.validation.between": "Por favor, introduce un valor entre \"{min}\" y \"{max}\"", + "error.validation.boolean": "Por favor, confirma o rechaza", + "error.validation.contains": "Por favor, introduce un valor que contenga \"{needle}\"", + "error.validation.date": "Por favor, introduce una fecha válida", + "error.validation.date.after": "Por favor, introduce una fecha posterior a {date}", + "error.validation.date.before": "Por favor, introduce una fecha anterior a {date}", + "error.validation.date.between": "Por favor, introduce un número entre {min} y {max}", + "error.validation.denied": "Por favor, rechaza", "error.validation.different": "El valor no debe ser \"{other}\"", "error.validation.email": "Por favor, introduce un correo electrónico válido", "error.validation.endswith": "El valor debe terminar con \"{end}\"", - "error.validation.filename": "Por favor ingrese un nombre de archivo válido", - "error.validation.in": "Por favor ingrese uno de los siguientes: ({in})", + "error.validation.filename": "Por favor, introduce un nombre de archivo válido", + "error.validation.in": "Por favor, introduce uno de los siguientes: ({in})", "error.validation.integer": "Por favor, introduce un numero integro válido", - "error.validation.ip": "Por favor ingrese una dirección IP válida", - "error.validation.less": "Por favor, introduzca un valor inferior a {max}", + "error.validation.ip": "Por favor, introduce una dirección IP válida", + "error.validation.less": "Por favor, introduce un valor inferior a {max}", "error.validation.match": "El valor no coincide con el patrón esperado", - "error.validation.max": "Por favor, introduzca un valor igual o inferior a {max}", - "error.validation.maxlength": "Por favor, introduzca un valor más corto. (max. {max} caracteres)", - "error.validation.maxwords": "Por favor ingrese no más de {max} palabra(s)", - "error.validation.min": "Por favor, introduzca un valor igual o mayor a {min}", - "error.validation.minlength": "Por favor, introduzca un valor más largo. (min. {min} caracteres)", - "error.validation.minwords": "Por favor ingrese al menos {min} palabra(s)", - "error.validation.more": "Por favor, introduzca un valor mayor a {min}", - "error.validation.notcontains": "Por favor ingrese un valor que no contenga \"{needle}\"", - "error.validation.notin": "Por favor, no ingrese ninguno de los siguientes: ({notIn})", - "error.validation.option": "Por favor seleccione una opción válida", - "error.validation.num": "Por favor ingrese un número valido", - "error.validation.required": "Por favor ingrese algo", - "error.validation.same": "Por favor escribe \"{other}\"", + "error.validation.max": "Por favor, introduce un valor igual o inferior a {max}", + "error.validation.maxlength": "Por favor, introduce un valor más corto. (max. {max} caracteres)", + "error.validation.maxwords": "Por favor, introduce no más de {max} palabra(s)", + "error.validation.min": "Por favor, introduce un valor igual o mayor a {min}", + "error.validation.minlength": "Por favor, introduce un valor más largo. (min. {min} caracteres)", + "error.validation.minwords": "Por favor, introduce al menos {min} palabra(s)", + "error.validation.more": "Por favor, introduce un valor mayor a {min}", + "error.validation.notcontains": "Por favor, introduce un valor que no contenga \"{needle}\"", + "error.validation.notin": "Por favor, no introduzcas ninguno de los siguientes: ({notIn})", + "error.validation.option": "Por favor, selecciona una opción válida", + "error.validation.num": "Por favor, introduce un número valido", + "error.validation.required": "Por favor, introduce algo", + "error.validation.same": "Por favor, introduce \"{other}\"", "error.validation.size": "El tamaño del valor debe ser \"{size}\"", "error.validation.startswith": "El valor debe comenzar con \"{start}\"", - "error.validation.time": "Por favor ingrese una hora válida", - "error.validation.time.after": "Por favor ingresa una fecha después de {time}", - "error.validation.time.before": "Por favor ingresa una fecha antes de {time}", - "error.validation.time.between": "Por favor ingresa un fecha entre {min} y {max}", - "error.validation.url": "Por favor introduzca un URL válido", + "error.validation.time": "Por favor, introduce una hora válida", + "error.validation.time.after": "Por favor, introduce una fecha después de {time}", + "error.validation.time.before": "Por favor, introduce una fecha antes de {time}", + "error.validation.time.between": "Por favor, introduce un fecha entre {min} y {max}", + "error.validation.url": "Por favor, introduce un URL válido", "expand": "Expandir", "expand.all": "Expandir todo", - "field.required": "Este campo es requerido", + "field.required": "Este campo es obligatorio", "field.blocks.changeType": "Cambiar tipo", "field.blocks.code.name": "Código", "field.blocks.code.language": "Idioma", "field.blocks.code.placeholder": "Tu código...", - "field.blocks.delete.confirm": "¿Seguro que quieres eliminar este bloque?", - "field.blocks.delete.confirm.all": "¿Seguro que quieres eliminar todos los bloques?", - "field.blocks.delete.confirm.selected": "¿Seguro que quieres eliminar los bloques seleccionados?", - "field.blocks.empty": "No hay bloques aún", - "field.blocks.fieldsets.label": "Por favor selecciona un tipo de bloque...", + "field.blocks.delete.confirm": "¿Realmente quieres eliminar este bloque?", + "field.blocks.delete.confirm.all": "¿Realmente quieres eliminar todos los bloques?", + "field.blocks.delete.confirm.selected": "¿Realmente quieres eliminar los bloques seleccionados?", + "field.blocks.empty": "Aún no hay bloques", + "field.blocks.fieldsets.label": "Por favor, selecciona un tipo de bloque...", "field.blocks.fieldsets.paste": "Presiona {{ shortcut }}para pegar/importar bloques en tu portapapeles ", "field.blocks.gallery.name": "Galería", - "field.blocks.gallery.images.empty": "No hay imágenes aún", + "field.blocks.gallery.images.empty": "Aún no hay imágenes", "field.blocks.gallery.images.label": "Imágenes", "field.blocks.heading.level": "Nivel", "field.blocks.heading.name": "Encabezado", @@ -267,91 +270,94 @@ "field.blocks.quote.name": "Cita", "field.blocks.quote.text.label": "Texto", "field.blocks.quote.text.placeholder": "Cita...", - "field.blocks.quote.citation.label": "Citation", + "field.blocks.quote.citation.label": "Cita", "field.blocks.quote.citation.placeholder": "Por ...", "field.blocks.text.name": "Texto", - "field.blocks.text.placeholder": "Text …", + "field.blocks.text.placeholder": "Texto ...", "field.blocks.video.caption": "Leyenda", "field.blocks.video.name": "Video", - "field.blocks.video.placeholder": "Enter a video URL", - "field.blocks.video.url.label": "Video-URL", + "field.blocks.video.placeholder": "Introduce la URL de un vídeo", + "field.blocks.video.url.label": "Vídeo-URL", "field.blocks.video.url.placeholder": "https://youtube.com/?v=", "field.files.empty": "Aún no hay archivos seleccionados", - "field.layout.delete": "Delete layout", - "field.layout.delete.confirm": "Do you really want to delete this layout?", - "field.layout.empty": "No rows yet", - "field.layout.select": "Select a layout", + "field.layout.delete": "Eliminar layout", + "field.layout.delete.confirm": "¿Realmente quieres eliminar este layout?", + "field.layout.empty": "Aún no hay filas", + "field.layout.select": "Seleccionar layout", - "field.object.empty": "No information yet", + "field.object.empty": "Aún no hay información", "field.pages.empty": "Aún no hay páginas seleccionadas", "field.structure.delete.confirm": "¿Realmente quieres eliminar esta fila?", + "field.structure.delete.confirm.all": "¿Realmente quieres eliminar todas las entradas?", "field.structure.empty": "Aún no hay entradas", "field.users.empty": "Aún no hay usuarios seleccionados", - "file.blueprint": "This file has no blueprint yet. You can define the setup in /site/blueprints/files/{blueprint}.yml", + "file.blueprint": "Este archivo aún no tiene blueprint. Puedes definir la configuración en /site/blueprints/files/{blueprint}.yml", "file.delete.confirm": "¿Realmente quieres eliminar
{filename}?", - "file.sort": "Change position", + "file.sort": "Cambiar posición", "files": "Archivos", "files.empty": "Aún no hay archivos", - "hide": "Hide", + "hide": "Ocultar", "hour": "Hora", - "import": "Import", + "import": "Importar", "info": "Info", "insert": "Insertar", - "insert.after": "Insert after", - "insert.before": "Insert before", + "insert.after": "Insertar después", + "insert.before": "Insertar antes", "install": "Instalar", "installation": "Instalación", "installation.completed": "El panel ha sido instalado", - "installation.disabled": "El instalador del panel está deshabilitado en servidores públicos por defecto. Ejecute el instalador en una máquina local o habilítelo con la opción panel.install.", + "installation.disabled": "El instalador del panel está deshabilitado en servidores públicos por defecto. Por favor, ejecuta el instalador en una máquina local o habilítalo con la opción panel.install.", "installation.issues.accounts": "La carpeta /site/accounts no existe o no se puede escribir", "installation.issues.content": "La carpeta /content no existe o no se puede escribir", "installation.issues.curl": "La extensión CURL es requerida", - "installation.issues.headline": "No se pudo instalar el panel", + "installation.issues.headline": "No se puede instalar el panel", "installation.issues.mbstring": "La extension MB String es requerida", "installation.issues.media": "La carpeta /media no existe o no se puede escribir", - "installation.issues.php": "Asegúrate de usar PHP 7+", + "installation.issues.php": "Asegurese de estar usando PHP 8+", "installation.issues.server": "Kirby requiere Apache, Nginx o Caddy", "installation.issues.sessions": "La carpeta /site/sessions no existe o no se puede escribir", "language": "Idioma", "language.code": "Código", "language.convert": "Hacer por defecto", - "language.convert.confirm": "{name} al idioma por defecto? Esto no se puede deshacer.

Si {name} tiene contenido sin traducir, ya no habrá un respaldo válido y algunas partes de su sitio podrían estar vacías.

", + "language.convert.confirm": "

¿Realmente quieres convertir {name} al idioma por defecto? Esto no se puede deshacer.

Si {name} tiene contenido sin traducir, ya no habrá un respaldo válido y algunas partes de tu sitio podrían estar vacías.

", "language.create": "Añadir un nuevo idioma", - "language.delete.confirm": "¿De verdad quieres eliminar el idioma {name} incluyendo todas las traducciones? ¡Esto no se puede deshacer!", + "language.delete.confirm": "¿Realmente quieres eliminar el idioma {name} incluyendo todas las traducciones? ¡Esto no se puede deshacer!", "language.deleted": "El idioma ha sido eliminado", "language.direction": "Leyendo dirección", "language.direction.ltr": "De izquierda a derecha", "language.direction.rtl": "De derecha a izquierda", "language.locale": "PHP locale string", - "language.locale.warning": "Estas utilizando un configuración local. Por favor modifícalo en el archivo del lenguaje en /site/languages", + "language.locale.warning": "Estás utilizando una configuración local. Por favor, modifícalo en el archivo del lenguaje en /site/languages", "language.name": "Nombre", "language.updated": "El idioma ha sido actualizado", "languages": "Idiomas", "languages.default": "Idioma predeterminado", - "languages.empty": "Todavía no hay idiomas", + "languages.empty": "Aún no hay idiomas", "languages.secondary": "Idiomas secundarios", - "languages.secondary.empty": "Todavía no hay idiomas secundarios", + "languages.secondary.empty": "Aún no hay idiomas secundarios", "license": "Licencia", "license.buy": "Comprar una licencia", "license.register": "Registro", - "license.manage": "Manage your licenses", - "license.register.help": "Recibió su código de licencia después de la compra por correo electrónico. Por favor copie y pegue para registrarse.", - "license.register.label": "Por favor ingrese su código de licencia", + "license.manage": "Gestiona licencias", + "license.register.help": "Recibiste tu código de licencia tras la compra por correo electrónico. Por favor, copia y pega para registrarte.", + "license.register.label": "Por favor, introduce tu código de licencia", + "license.register.domain": "Tu licencia será registrada para {host}.", + "license.register.local": "Estás a punto de registrar tu licencia para el dominio local {host}. Si este sitio va a ser desplegado en un dominio público, por favor regístralo allí. Si {host} es el dominio en el que quiere registrar Kirby, por favor continúa.", "license.register.success": "Gracias por apoyar a Kirby", "license.unregistered": "Esta es una demo no registrada de Kirby", - "license.unregistered.label": "Unregistered", + "license.unregistered.label": "No registrado", "link": "Enlace", "link.text": "Texto del enlace", @@ -367,20 +373,20 @@ "lock.isUnlocked": "Tus cambios sin guardar han sido sobrescritos por otro usuario. Puedes descargar los cambios y fusionarlos manualmente.", "login": "Iniciar sesión", - "login.code.label.login": "Login code", - "login.code.label.password-reset": "Password reset code", + "login.code.label.login": "Código de inicio de sesión", + "login.code.label.password-reset": "Código de restablecimiento de contraseña", "login.code.placeholder.email": "000 000", - "login.code.text.email": "If your email address is registered, the requested code was sent via email.", - "login.email.login.body": "Hi {user.nameOrEmail},\n\nYou recently requested a login code for the Panel of {site}.\nThe following login code will be valid for {timeout} minutes:\n\n{code}\n\nIf you did not request a login code, please ignore this email or contact your administrator if you have questions.\nFor security, please DO NOT forward this email.", - "login.email.login.subject": "Your login code", - "login.email.password-reset.body": "Hi {user.nameOrEmail},\n\nYou recently requested a password reset code for the Panel of {site}.\nThe following password reset code will be valid for {timeout} minutes:\n\n{code}\n\nIf you did not request a password reset code, please ignore this email or contact your administrator if you have questions.\nFor security, please DO NOT forward this email.", - "login.email.password-reset.subject": "Your password reset code", + "login.code.text.email": "Si tu dirección de correo electrónico está registrada, el código solicitado fue enviado por correo electrónico.", + "login.email.login.body": "Hola {user.nameOrEmail},\n\nHas pedido, recientemente, un código de restablecimiento de contraseña para el Panel del sitio {site}.\nEl siguiente código de restablecimiento de contraseña será válido por {timeout} minutos:\n\n{code}\n\nSi no pediste un código de restablecimiento de contraseña, por favor ignora este correo o contacta a tu administrador si tienes dudas.\nPor seguridad, por favor NO reenvíes este correo.", + "login.email.login.subject": "Tu código de inicio de sesión", + "login.email.password-reset.body": "Hola {user.nameOrEmail},\n\nHas pedido, recientemente, un código de restablecimiento de contraseña para el Panel del sitio {site}.\nEl siguiente código de restablecimiento de contraseña será válido por {timeout} minutos:\n\n{code}\n\nSi no pediste un código de restablecimiento de contraseña, por favor ignora este correo o contacta a tu administrador si tienes dudas.\nPor seguridad, por favor NO reenvíes este correo.", + "login.email.password-reset.subject": "Tu código de restablecimiento de contraseña", "login.remember": "Mantener sesión iniciada", - "login.reset": "Reset password", - "login.toggleText.code.email": "Login via email", - "login.toggleText.code.email-password": "Login with password", - "login.toggleText.password-reset.email": "Forgot your password?", - "login.toggleText.password-reset.email-password": "← Back to login", + "login.reset": "Restablecer contraseña", + "login.toggleText.code.email": "Iniciar sesión por correo electrónico", + "login.toggleText.code.email-password": "Iniciar sesión con contraseña", + "login.toggleText.password-reset.email": "¿Olvidaste tu contraseña?", + "login.toggleText.password-reset.email-password": "← Volver al inicio de sesión", "logout": "Cerrar sesión", @@ -410,34 +416,34 @@ "off": "Apagado", "on": "Encendido", "open": "Abrir", - "open.newWindow": "Open in new window", + "open.newWindow": "Abrir en una ventana nueva", "options": "Opciones", - "options.none": "No options", + "options.none": "Sin opciones", "orientation": "Orientación", "orientation.landscape": "Paisaje", "orientation.portrait": "Retrato", "orientation.square": "Cuadrado", - "page.blueprint": "This page has no blueprint yet. You can define the setup in /site/blueprints/pages/{blueprint}.yml", + "page.blueprint": "Este archivo aún no tiene blueprint. Puedes definir la configuración en /site/blueprints/pages/{blueprint}.yml", "page.changeSlug": "Cambiar URL", "page.changeSlug.fromTitle": "Crear en base al título", "page.changeStatus": "Cambiar estado", - "page.changeStatus.position": "Por favor seleccione una posición", - "page.changeStatus.select": "Seleccione un nuevo estado", + "page.changeStatus.position": "Por favor, selecciona una posición", + "page.changeStatus.select": "Selecciona un nuevo estado", "page.changeTemplate": "Cambiar plantilla", "page.delete.confirm": "¿Realmente quieres eliminar {title}?", "page.delete.confirm.subpages": "Esta página tiene subpáginas.
Todas las subpáginas también serán eliminadas.", - "page.delete.confirm.title": "Introduzca el título de la página para confirmar", + "page.delete.confirm.title": "Introduce el título de la página para confirmar", "page.draft.create": "Crear borrador", "page.duplicate.appendix": "Copiar", "page.duplicate.files": "Copiar archivos", "page.duplicate.pages": "Copiar páginas", - "page.sort": "Change position", + "page.sort": "Cambiar posición", "page.status": "Estado", "page.status.draft": "Borrador", - "page.status.draft.description": "The page is in draft mode and only visible for logged in editors or via secret link", - "page.status.listed": "Publica", + "page.status.draft.description": "La página está en modo borrador y solo es visible para editores conectados o mediante enlace secreto.", + "page.status.listed": "Pública", "page.status.listed.description": "La página es pública para cualquiera", "page.status.unlisted": "Sin publicar", "page.status.unlisted.description": "La página solo es accesible vía URL", @@ -451,24 +457,24 @@ "pagination.page": "Página", "password": "Contraseña", - "paste": "Paste", - "paste.after": "Paste after", + "paste": "Pegar", + "paste.after": "Pegar después", "pixel": "Pixel", "plugin": "Plugin", "plugins": "Plugins", "prev": "Anterior", - "preview": "Preview", + "preview": "Previsualizar", "remove": "Eliminar", "rename": "Renombrar", "replace": "Remplazar", "retry": "Inténtalo de nuevo", "revert": "Revertir", - "revert.confirm": "Do you really want to delete all unsaved changes?", + "revert.confirm": "¿Realmente quieres eliminar todos los cambios sin guardar?", "role": "Rol", "role.admin.description": "El administrador tiene todos los derechos", "role.admin.title": "Administrador", - "role.all": "Todos", + "role.all": "Todo", "role.empty": "No hay usuarios con este rol", "role.description.placeholder": "Sin descripción", "role.nobody.description": "Este es un rol alternativo sin permisos", @@ -476,49 +482,49 @@ "save": "Guardar", "search": "Buscar", - "search.min": "Enter {min} characters to search", - "search.all": "Show all", - "search.results.none": "No results", + "search.min": "Introduce {min} caracteres para buscar", + "search.all": "Mostrar todo", + "search.results.none": "Sin resultados", - "section.required": "Esta sección es requerida", + "section.required": "Esta sección es obligatoria", - "security": "Security", + "security": "Seguridad", "select": "Seleccionar", - "server": "Server", + "server": "Servidor", "settings": "Ajustes", - "show": "Show", - "site.blueprint": "The site has no blueprint yet. You can define the setup in /site/blueprints/site.yml", + "show": "Mostrar", + "site.blueprint": "Este archivo aún no tiene blueprint. Puedes definir la configuración en /site/blueprints/site.yml", "size": "Tamaño", - "slug": "Apéndice URL", + "slug": "Apéndice de URL", "sort": "Ordenar", - "stats.empty": "No reports", - "system.issues.content": "The content folder seems to be exposed", - "system.issues.eol.kirby": "Your installed Kirby version has reached end-of-life and will not receive further security updates", - "system.issues.eol.plugin": "Your installed version of the { plugin } plugin is has reached end-of-life and will not receive further security updates", - "system.issues.debug": "Debugging must be turned off in production", - "system.issues.git": "The .git folder seems to be exposed", - "system.issues.https": "We recommend HTTPS for all your sites", - "system.issues.kirby": "The kirby folder seems to be exposed", - "system.issues.site": "The site folder seems to be exposed", - "system.issues.vulnerability.kirby": "Your installation might be affected by the following vulnerability ({ severity } severity): { description }", - "system.issues.vulnerability.plugin": "Your installation might be affected by the following vulnerability in the { plugin } plugin ({ severity } severity): { description }", - "system.updateStatus": "Update status", - "system.updateStatus.error": "Could not check for updates", - "system.updateStatus.not-vulnerable": "No known vulnerabilities", - "system.updateStatus.security-update": "Free security update { version } available", - "system.updateStatus.security-upgrade": "Upgrade { version } with security fixes available", - "system.updateStatus.unreleased": "Unreleased version", - "system.updateStatus.up-to-date": "Up to date", - "system.updateStatus.update": "Free update { version } available", - "system.updateStatus.upgrade": "Upgrade { version } available", + "stats.empty": "Sin informes", + "system.issues.content": "La carpeta content parece estar expuesta", + "system.issues.eol.kirby": "La versión de Kirby que tienes instalada ha llegado al final de su vida útil y no recibirá más actualizaciones de seguridad.", + "system.issues.eol.plugin": "La versión del plugin { plugin } que tienes instalada ha llegado al final de su vida útil y no recibirá más actualizaciones de seguridad.", + "system.issues.debug": "La depuración debe estar desactivada en producción", + "system.issues.git": "La carpeta .git parece estar expuesta", + "system.issues.https": "Recomendamos HTTPS para todos tus sitios web", + "system.issues.kirby": "La carpeta kirby parece estar expuesta", + "system.issues.site": "La carpeta site parece estar expuesta", + "system.issues.vulnerability.kirby": "Tu instalación podría estar afectada por la siguiente vulnerabilidad ({ severity } gravedad): { description }", + "system.issues.vulnerability.plugin": "Tu instalación podría estar afectada por la siguiente vulnerabilidad en el plugin { plugin } ({ severity } gravedad): { description }", + "system.updateStatus": "Estado de actualización", + "system.updateStatus.error": "No se pudo comprobar si hay actualizaciones", + "system.updateStatus.not-vulnerable": "Sin vulnerabilidades conocidas", + "system.updateStatus.security-update": "Actualización gratuita de seguridad { version } disponible", + "system.updateStatus.security-upgrade": "Actualización { versión } con correcciones de seguridad disponibles", + "system.updateStatus.unreleased": "Versión no publicada", + "system.updateStatus.up-to-date": "Actualizado", + "system.updateStatus.update": "Actualización gratuita {version} disponible", + "system.updateStatus.upgrade": "Actualización {versión} disponible", - "title": "Titulo", + "title": "Título", "template": "Plantilla", "today": "Hoy", "toolbar.button.code": "Código", - "toolbar.button.bold": "Negritas", + "toolbar.button.bold": "Negrita", "toolbar.button.email": "Correo electrónico", "toolbar.button.headings": "Encabezados", "toolbar.button.heading.1": "Encabezado 1", @@ -529,13 +535,13 @@ "toolbar.button.heading.6": "Encabezado 6", "toolbar.button.italic": "Italica", "toolbar.button.file": "Archivo", - "toolbar.button.file.select": "Seleccione un archivo", - "toolbar.button.file.upload": "Sube un archivo", + "toolbar.button.file.select": "Seleccionar un archivo", + "toolbar.button.file.upload": "Subir un archivo", "toolbar.button.link": "Enlace", - "toolbar.button.paragraph": "Paragraph", - "toolbar.button.strike": "Strike-through", + "toolbar.button.paragraph": "Parágrafo", + "toolbar.button.strike": "Tachado", "toolbar.button.ol": "Lista ordenada", - "toolbar.button.underline": "Underline", + "toolbar.button.underline": "Subrayado", "toolbar.button.ul": "Lista de viñetas", "translation.author": "Turqueso", @@ -544,15 +550,15 @@ "translation.locale": "es_ES", "upload": "Subir", - "upload.error.cantMove": "El archivo subido no puede ser movido", + "upload.error.cantMove": "El archivo subido no pudo ser movido", "upload.error.cantWrite": "Error al escribir el archivo en el disco", "upload.error.default": "El archivo no pudo ser subido", "upload.error.extension": "Subida de archivo detenida por la extensión", "upload.error.formSize": "El archivo subido excede la directiva MAX_FILE_SIZE que fue especificada en el formulario", "upload.error.iniPostSize": "El archivo subido excede la directiva post_max_size directive en php.ini", "upload.error.iniSize": "El archivo subido excede la directiva upload_max_filesize en php.ini", - "upload.error.noFile": "Ningún archivo ha sido subido", - "upload.error.noFiles": "Ningún archivo ha sido subido", + "upload.error.noFile": "No se ha subido ningún archivo", + "upload.error.noFiles": "No se ha subido ningún archivo", "upload.error.partial": "El archivo ha sido subido solo parcialmente", "upload.error.tmpDir": "No se encuentra la carpeta temporal", "upload.errors": "Error", @@ -562,15 +568,15 @@ "url.placeholder": "https://ejemplo.com", "user": "Usuario", - "user.blueprint": "You can define additional sections and form fields for this user role in /site/blueprints/users/{blueprint}.yml", + "user.blueprint": "Puedes definir secciones y campos de formulario adicionales para este rol de usuario en /site/blueprints/users/{blueprint}.yml", "user.changeEmail": "Cambiar correo electrónico", "user.changeLanguage": "Cambiar idioma", "user.changeName": "Renombrar a este usuario", - "user.changePassword": "Cambia contraseña", + "user.changePassword": "Cambiar contraseña", "user.changePassword.new": "Nueva contraseña", "user.changePassword.new.confirm": "Confirmar nueva contraseña…", "user.changeRole": "Cambiar rol", - "user.changeRole.select": "Seleccione un nuevo rol", + "user.changeRole.select": "Seleccionar un nuevo rol", "user.create": "Añadir un nuevo usuario", "user.delete": "Eliminar este usuario", "user.delete.confirm": "¿Realmente quieres eliminar
{email}?", @@ -578,19 +584,19 @@ "users": "Usuarios", "version": "Versión", - "version.current": "Current version", - "version.latest": "Latest version", - "versionInformation": "Version information", + "version.current": "Versión actual", + "version.latest": "Última versión", + "versionInformation": "Información sobre la versión", - "view.account": "Su cuenta", + "view.account": "Tu cuenta", "view.installation": "Instalación", "view.languages": "Idiomas", - "view.resetPassword": "Reset password", + "view.resetPassword": "Restablecer contraseña", "view.site": "Sitio", - "view.system": "System", + "view.system": "Sistema", "view.users": "Usuarios", "welcome": "Bienvenido(a)", "year": "Año", - "yes": "yes" + "yes": "Sí" } diff --git a/kirby/i18n/translations/fa.json b/kirby/i18n/translations/fa.json index 61acc48..8e71cdf 100644 --- a/kirby/i18n/translations/fa.json +++ b/kirby/i18n/translations/fa.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "You must add at least one block", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "قالب ایمیل «{name}» پیدا نشد", "error.field.converter.invalid": "مبدل «{converter}» نامعتبر است", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "The name must not be empty", "error.file.changeName.permission": "شما اجازه تنغییر نام فایل «{filename}» را ندارید", @@ -289,6 +292,7 @@ "field.pages.empty": "صفحه‌ای انتخاب نشده است", "field.structure.delete.confirm": "\u0645\u062f\u062e\u0644 \u062c\u0627\u0631\u06cc \u062d\u0630\u0641 \u0634\u0648\u062f\u061f", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "\u0645\u0648\u0631\u062f\u06cc \u0648\u062c\u0648\u062f \u0646\u062f\u0627\u0631\u062f.", "field.users.empty": "کاربری انتخاب نشده است", @@ -318,7 +322,7 @@ "installation.issues.headline": "نصب پانل کاربری ممکن نیست", "installation.issues.mbstring": "افزونه MB String مورد نیاز است", "installation.issues.media": "پوشه /media موجود نیست یا قابل نوشتن نیست", - "installation.issues.php": "لطفا از پی‌اچ‌پی 7 یا بالاتر استفاده کنید", + "installation.issues.php": "لطفا از پی‌اچ‌پی 8 یا بالاتر استفاده کنید", "installation.issues.server": "کربی نیاز به Apache، Nginx یا Caddy دارد", "installation.issues.sessions": "پوشه /site/sessions وجود ندارد یا قابل نوشتن نیست", @@ -349,6 +353,8 @@ "license.manage": "Manage your licenses", "license.register.help": "پس از خرید از طریق ایمیل، کد مجوز خود را دریافت کردید. لطفا برای ثبت‌نام آن را کپی و اینجا پیست کنید.", "license.register.label": "لطفا کد مجوز خود را وارد کنید", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "با تشکر از شما برای حمایت از کربی", "license.unregistered": "این یک نسخه آزمایشی ثبت نشده از کربی است", "license.unregistered.label": "Unregistered", diff --git a/kirby/i18n/translations/fi.json b/kirby/i18n/translations/fi.json index ccc63eb..3d29c0e 100644 --- a/kirby/i18n/translations/fi.json +++ b/kirby/i18n/translations/fi.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Lisää vähintään yksi lohko", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "Nimellä \"{name}\" ja kyseisellä verkkotunnuksella ei löydy sähköpostiosoitetta", "error.field.converter.invalid": "Muunnin \"{converter}\" ei kelpaa", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "Nimi ei voi olla tyhjä", "error.file.changeName.permission": "Sinulla ei ole oikeutta muuttaa tiedoston \"{filename}\" nimeä", @@ -289,6 +292,7 @@ "field.pages.empty": " Sivuja ei ole vielä valittu", "field.structure.delete.confirm": "Haluatko varmasti poistaa tämän rivin?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Rivejä ei ole vielä lisätty", "field.users.empty": "Käyttäjiä ei ole vielä valittu", @@ -318,7 +322,7 @@ "installation.issues.headline": "Paneelia ei voida asentaa", "installation.issues.mbstring": "MB String-laajennos on pakollinen", "installation.issues.media": "/media -kansio ei ole olemassa tai siihen ei voi kirjoittaa", - "installation.issues.php": "Varmista että PHP 7+ on käytössä", + "installation.issues.php": "Varmista että PHP 8+ on käytössä", "installation.issues.server": "Kirby tarvitsee jonkun seuraavista: Apache, Nginx tai Caddy", "installation.issues.sessions": "/site/sessions -kansio ei ole olemassa tai siihen ei voi kirjoittaa", @@ -349,6 +353,8 @@ "license.manage": "Hallinnoi lisenssejäsi", "license.register.help": "Lisenssiavain on lähetetty oston jälkeen sähköpostiisi. Kopioi ja liitä avain tähän.", "license.register.label": "Anna lisenssiavain", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Kiitos kun tuet Kirbyä", "license.unregistered": "Tämä on rekisteröimätön demo Kirbystä", "license.unregistered.label": "Rekisteröimätön", diff --git a/kirby/i18n/translations/fr.json b/kirby/i18n/translations/fr.json index 41ee52b..41bd2a0 100644 --- a/kirby/i18n/translations/fr.json +++ b/kirby/i18n/translations/fr.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Vous devez ajouter au moins un bloc", "error.blocks.validation": "Il y a une erreur sur le champ \"{field}\" du bloc {index} utilisant le type de bloc \"{fieldset}\"", + "error.cache.type.invalid": "Type de cache incorrect \"{type}\"", + "error.email.preset.notFound": "La configuration de courriel « {name} » n’a pu être trouvé ", "error.field.converter.invalid": "Convertisseur « {converter} » incorrect", + "error.field.type.missing": "Champ \"{ name }\" : Le type de champ \"{ type }\" n’existe pas", "error.file.changeName.empty": "Le nom ne peut être vide", "error.file.changeName.permission": "Vous n’êtes pas autorisé à modifier le nom de « {filename} »", @@ -289,6 +292,7 @@ "field.pages.empty": "Pas encore de page sélectionnée", "field.structure.delete.confirm": "Voulez-vous vraiment supprimer cette ligne ?", + "field.structure.delete.confirm.all": "Voulez-vous vraiment supprimer toutes les entrées ?", "field.structure.empty": "Pas encore d’entrée", "field.users.empty": "Pas encore d’utilisateur sélectionné", @@ -318,7 +322,7 @@ "installation.issues.headline": "Le Panel ne peut être installé", "installation.issues.mbstring": "L’extension MB String est requise", "installation.issues.media": "Le dossier /media n’existe pas ou n’est pas accessible en écriture", - "installation.issues.php": "Veuillez utiliser PHP 7+", + "installation.issues.php": "Veuillez utiliser PHP 8+", "installation.issues.server": "Kirby requiert Apache, Nginx ou Caddy", "installation.issues.sessions": "Le dossier /site/sessions n’existe pas ou n’est pas accessible en écriture", @@ -349,6 +353,8 @@ "license.manage": "Gérer vos licences", "license.register.help": "Vous avez reçu votre numéro de licence par courriel après l'achat. Veuillez le copier et le coller ici pour l'enregistrer.", "license.register.label": "Veuillez saisir votre numéro de licence", + "license.register.domain": "Votre licence sera enregistrée pour {host}.", + "license.register.local": "Vous êtes sur le point d’enregistrer votre licence pour votre domaine local {host}. Si votre site sera déployé sur un domaine publique, veuillez plutôt l’y l’enregistrer. Si {host} est le domaine pour lequel vous voulez enregistrer Kirby, veuillez continuer.", "license.register.success": "Merci pour votre soutien à Kirby", "license.unregistered": "Ceci est une démo non enregistrée de Kirby", "license.unregistered.label": "Non enregistré", @@ -382,7 +388,7 @@ "login.toggleText.password-reset.email": "Mot de passe oublié ?", "login.toggleText.password-reset.email-password": "← Retour à la connexion", - "logout": "Se déconnecter", + "logout": "Déconnexion", "menu": "Menu", "meridiem": "AM/PM", diff --git a/kirby/i18n/translations/hu.json b/kirby/i18n/translations/hu.json index 626df00..9a3f108 100644 --- a/kirby/i18n/translations/hu.json +++ b/kirby/i18n/translations/hu.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Legalább egy blokkot hozzá kell adnod", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "A \"{name}\" email-beállítás nem található", "error.field.converter.invalid": "Érvénytelen konverter: \"{converter}\"", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "A név nem lehet üres", "error.file.changeName.permission": "Nincs jogosultságod megváltoztatni a \"{filename}\" fájl nevét", @@ -289,6 +292,7 @@ "field.pages.empty": "Nincs oldal kiválasztva", "field.structure.delete.confirm": "Biztos t\u00f6r\u00f6lni szeretn\u00e9d ezt a bejegyz\u00e9st?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Nincs m\u00e9g bejegyz\u00e9s", "field.users.empty": "Nincs felhasználó kiválasztva", @@ -318,7 +322,7 @@ "installation.issues.headline": "A panel telepítése sikertelen", "installation.issues.mbstring": "Az MB String bővítmény engedélyezése szükséges", "installation.issues.media": "A /media mappa nem létezik vagy nem írható", - "installation.issues.php": "Bizonyosodj meg róla, hogy az általad használt PHP-verzió PHP 7+", + "installation.issues.php": "Bizonyosodj meg róla, hogy az általad használt PHP-verzió PHP 8+", "installation.issues.server": "A Kirby az alábbi szervereken futtatható: Apache, Nginx vagy Caddy", "installation.issues.sessions": "A /site/sessions könyvtár nem létezik vagy nem írható", @@ -349,6 +353,8 @@ "license.manage": "Manage your licenses", "license.register.help": "A vásárlás után emailben küldjük el a licenc-kódot. Regisztrációhoz másold ide a kapott kódot.", "license.register.label": "Kérlek írd be a licenc-kódot", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Köszönjük, hogy támogatod a Kirby-t", "license.unregistered": "Jelenleg a Kirby nem regisztrált próbaverzióját használod", "license.unregistered.label": "Unregistered", diff --git a/kirby/i18n/translations/id.json b/kirby/i18n/translations/id.json index e04e0ea..e6b4b88 100644 --- a/kirby/i18n/translations/id.json +++ b/kirby/i18n/translations/id.json @@ -1,10 +1,10 @@ { - "account.changeName": "Change your name", - "account.delete": "Delete your account", - "account.delete.confirm": "Do you really want to delete your account? You will be logged out immediately. Your account cannot be recovered.", + "account.changeName": "Ubah nama Anda", + "account.delete": "Hapus akun Anda", + "account.delete.confirm": "Anda yakin menghapus akun? Anda akan dikeluarkan segera. Akun Anda tidak dapat dipulihkan.", "add": "Tambah", - "author": "Author", + "author": "Penulis", "avatar": "Gambar profil", "back": "Kembali", "cancel": "Batal", @@ -14,7 +14,7 @@ "collapse": "Lipat", "collapse.all": "Lipat Semua", "copy": "Salin", - "copy.all": "Copy all", + "copy.all": "Salin semua", "create": "Buat", "date": "Tanggal", @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Anda setidaknya menambahkan satu blok", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "Surel \"{name}\" tidak dapat ditemukan", "error.field.converter.invalid": "Konverter \"{converter}\" tidak valid", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "Nama harus diisi", "error.file.changeName.permission": "Anda tidak diizinkan mengubah nama berkas \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Belum ada halaman yang dipilih", "field.structure.delete.confirm": "Anda yakin menghapus baris ini?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Belum ada entri", "field.users.empty": "Belum ada pengguna yang dipilih", @@ -318,7 +322,7 @@ "installation.issues.headline": "Panel tidak dapat dipasang", "installation.issues.mbstring": "Ekstensi MB String diperlukan", "installation.issues.media": "Folder /media tidak ada atau tidak dapat ditulis", - "installation.issues.php": "Pastikan Anda menggunakan PHP 7+", + "installation.issues.php": "Pastikan Anda menggunakan PHP 8+", "installation.issues.server": "Kirby memerlukan Apache, Nginx, atau Caddy", "installation.issues.sessions": "Folder /site/sessions tidak ada atau tidak dapat ditulis", @@ -349,6 +353,8 @@ "license.manage": "Manage your licenses", "license.register.help": "Anda menerima kode lisensi via surel setelah pembelian. Salin dan tempel kode tersebut untuk mendaftarkan.", "license.register.label": "Masukkan kode lisensi Anda", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Terima kasih atas dukungan untuk Kirby", "license.unregistered": "Ini adalah demo tidak diregistrasi dari Kirby", "license.unregistered.label": "Unregistered", diff --git a/kirby/i18n/translations/is_IS.json b/kirby/i18n/translations/is_IS.json index 338aa61..9e945dc 100644 --- a/kirby/i18n/translations/is_IS.json +++ b/kirby/i18n/translations/is_IS.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Allavegana einn bálkur takk", "error.blocks.validation": "Það er villa í {field} sviðinu í bálkinum {index} sem notar {fieldset} bálkgerðina", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "Netfangstillingarnar: \"{name}\" fundust ekki", "error.field.converter.invalid": "Ógildur umbreytari \"{converter}\"", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "Nafn skal fylla út", "error.file.changeName.permission": "Þú mátt ekkert breyta nafninu á skránni \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Engar síður valdar ennþá", "field.structure.delete.confirm": "Viltu virkilega eyða þessari röð?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Engar færslur enn", "field.users.empty": "Engir notendur valdir enn", @@ -318,7 +322,7 @@ "installation.issues.headline": "Uppsetning Panelsins mistókst hrapalega", "installation.issues.mbstring": "MB String er hér bráðnauðsynleg", "installation.issues.media": "/media mappan er annaðhvort ekki til eða er ekki skrifanleg", - "installation.issues.php": "Notaðu PHP 7+", + "installation.issues.php": "Notaðu PHP 8+", "installation.issues.server": "Kirby krefst Apache, Nginx eða Caddy", "installation.issues.sessions": "/site/sessions mappan er annaðhvort ekki til eða er ekki skrifanleg", @@ -349,6 +353,8 @@ "license.manage": "Sýslaðu með leyfin þín", "license.register.help": "Þú fékkst sendan tölvupóst með leyfiskóðanum þegar þú keyptir leyfi. Vinsamlegast afritaðu hann og settu hann hingað til að skrá þig.", "license.register.label": "Vinsamlegast settu inn leyfiskóðan", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Þakka þér fyrir að velja Kirby", "license.unregistered": "Þetta er óskráð prufueintak af Kirby", "license.unregistered.label": "Óskráð", diff --git a/kirby/i18n/translations/it.json b/kirby/i18n/translations/it.json index a58b22c..234eb2f 100644 --- a/kirby/i18n/translations/it.json +++ b/kirby/i18n/translations/it.json @@ -49,13 +49,13 @@ "email": "Email", "email.placeholder": "mail@esempio.com", - "entries": "Entries", - "entry": "Entry", + "entries": "Voci", + "entry": "Voce", "environment": "Ambiente", "error.access.code": "Codice non valido", - "error.access.login": "Login Invalido", + "error.access.login": "Login invalido", "error.access.panel": "Non ti è permesso accedere al pannello", "error.access.view": "Non ti è permesso accedere a questa parte del pannello", @@ -70,11 +70,14 @@ "error.blocks.max.singular": "Non puoi aggiungere più di un blocco", "error.blocks.min.plural": "Devi aggiungere almeno {min} blocchi", "error.blocks.min.singular": "Devi aggiungere almeno un blocco", - "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.blocks.validation": "C'è un errore sul campo \"{field}\" nel blocco {index} che utilizza il tipo di blocco \"{fieldset}\"", + + "error.cache.type.invalid": "Tipo di cache \"{type}\" non valido", "error.email.preset.notFound": "Non è stato possibile trovare il preset email \"{name}\"", "error.field.converter.invalid": "Convertitore \"{converter}\" non valido", + "error.field.type.missing": "Campo \"{ name }\": il tipo di campo \"{ type }\" non esiste", "error.file.changeName.empty": "Il nome non dev'essere vuoto", "error.file.changeName.permission": "Non ti è permesso modificare il nome di \"{filename}\"", @@ -107,14 +110,14 @@ "error.language.name": "Inserisci un nome valido per la lingua", "error.language.notFound": "La lingua non è stata trovata", - "error.layout.validation.block": "There's an error on the \"{field}\" field in block {blockIndex} using the \"{fieldset}\" block type in layout {layoutIndex}", + "error.layout.validation.block": "C'è un errore sul campo \"{field}\" nel blocco {blockIndex} che utilizza il tipo di blocco \"{fieldset}\" nel layout {layoutIndex}", "error.layout.validation.settings": "C'è un errore nelle impostazioni del layout {index}", "error.license.format": "Inserisci un codice di licenza valido", "error.license.email": "Inserisci un indirizzo email valido", "error.license.verification": "Non è stato possibile verificare la licenza", - "error.object.validation": "There’s an error in the \"{label}\" field:\n{message}", + "error.object.validation": "C'è un errore nel campo \"{label}\":\n{message}", "error.offline": "Il pannello di controllo è attualmente offline", @@ -284,11 +287,12 @@ "field.layout.empty": "Nessuna riga inserita", "field.layout.select": "Scegli un layout", - "field.object.empty": "No information yet", + "field.object.empty": "Ancora nessuna informazione", "field.pages.empty": "Nessuna pagina selezionata", "field.structure.delete.confirm": "Vuoi veramente eliminare questo elemento?", + "field.structure.delete.confirm.all": "Vuoi davvero cancellare tutte le voci?", "field.structure.empty": "Non ci sono ancora elementi.", "field.users.empty": "Nessun utente selezionato", @@ -318,7 +322,7 @@ "installation.issues.headline": "Il pannello non può esser installato", "installation.issues.mbstring": "È necessaria l'estensione MB String", "installation.issues.media": "La cartella /media non esiste o non dispone dei permessi di scrittura", - "installation.issues.php": "Assicurati di utilizzare PHP 7.1+", + "installation.issues.php": "Assicurati di utilizzare PHP 8+", "installation.issues.server": "Kirby necessita di Apache, Nginx o Caddy", "installation.issues.sessions": "La cartella /site/sessionsnon esiste o non dispone dei permessi di scrittura", @@ -346,12 +350,14 @@ "license": "Licenza di Kirby", "license.buy": "Acquista una licenza", "license.register": "Registra", - "license.manage": "Manage your licenses", + "license.manage": "Gestisci le tue licenze", "license.register.help": "Hai ricevuto il codice di licenza tramite email dopo l'acquisto. Per favore inseriscilo per registrare Kirby.", "license.register.label": "Inserisci il codice di licenza", + "license.register.domain": "La tua licenza verrà registrata su {host}.", + "license.register.local": "Stai per registrare la licenza per il dominio locale {host}. Se questo sito verrà rilasciato su un dominio pubblico, ti preghiamo di registrarlo lì. Se {host} è il dominio per il quale desideri ottenere la licenza di Kirby, procedi pure.", "license.register.success": "Ti ringraziamo per aver supportato Kirby", "license.unregistered": "Questa è una versione demo di Kirby non registrata", - "license.unregistered.label": "Unregistered", + "license.unregistered.label": "Non registrato", "link": "Link", "link.text": "Testo del link", @@ -482,7 +488,7 @@ "section.required": "La sezione è obbligatoria", - "security": "Security", + "security": "Sicurezza", "select": "Seleziona", "server": "Server", "settings": "Impostazioni", @@ -492,26 +498,26 @@ "slug": "URL", "sort": "Ordina", - "stats.empty": "No reports", - "system.issues.content": "The content folder seems to be exposed", - "system.issues.eol.kirby": "Your installed Kirby version has reached end-of-life and will not receive further security updates", - "system.issues.eol.plugin": "Your installed version of the { plugin } plugin is has reached end-of-life and will not receive further security updates", - "system.issues.debug": "Debugging must be turned off in production", - "system.issues.git": "The .git folder seems to be exposed", - "system.issues.https": "We recommend HTTPS for all your sites", - "system.issues.kirby": "The kirby folder seems to be exposed", - "system.issues.site": "The site folder seems to be exposed", - "system.issues.vulnerability.kirby": "Your installation might be affected by the following vulnerability ({ severity } severity): { description }", - "system.issues.vulnerability.plugin": "Your installation might be affected by the following vulnerability in the { plugin } plugin ({ severity } severity): { description }", - "system.updateStatus": "Update status", - "system.updateStatus.error": "Could not check for updates", - "system.updateStatus.not-vulnerable": "No known vulnerabilities", - "system.updateStatus.security-update": "Free security update { version } available", - "system.updateStatus.security-upgrade": "Upgrade { version } with security fixes available", - "system.updateStatus.unreleased": "Unreleased version", - "system.updateStatus.up-to-date": "Up to date", - "system.updateStatus.update": "Free update { version } available", - "system.updateStatus.upgrade": "Upgrade { version } available", + "stats.empty": "Nessuna segnalazione", + "system.issues.content": "La cartella content sembra essere esposta", + "system.issues.eol.kirby": "La versione di Kirby installata è giunta alla fine del suo ciclo di vita e non riceverà ulteriori aggiornamenti di sicurezza ", + "system.issues.eol.plugin": "La versione installata del plugin { plugin } è giunta alla fine del suo ciclo di vita e non riceverà ulteriori aggiornamenti di sicurezza", + "system.issues.debug": "Il debug deve essere disattivato in produzione", + "system.issues.git": "La cartella .git sembra essere esposta", + "system.issues.https": "Raccomandiamo l'utilizzo di HTTPS per tutti i siti", + "system.issues.kirby": "La cartella kirby sembra essere esposta", + "system.issues.site": "La cartella site sembra essere esposta", + "system.issues.vulnerability.kirby": "La tua installazione potrebbe essere colpita dalla seguente vulnerabilità ({ severity } gravità): { description }", + "system.issues.vulnerability.plugin": "La tua installazione potrebbe essere colpita dalla seguente vulnerabilità nel plugin { plugin } ({ severity } gravità): { description }", + "system.updateStatus": "Aggiorna lo stato", + "system.updateStatus.error": "Impossibile verificare gli aggiornamenti", + "system.updateStatus.not-vulnerable": "Nessuna vulnerabilità conosciuta", + "system.updateStatus.security-update": "Aggiornamento di sicurezza gratuito { version } disponibile", + "system.updateStatus.security-upgrade": "Aggiornamento { version } con le correzioni di sicurezza disponibili", + "system.updateStatus.unreleased": "Versione non rilasciata", + "system.updateStatus.up-to-date": "Aggiornato", + "system.updateStatus.update": "Aggiornamento gratuito { version } disponibile", + "system.updateStatus.upgrade": "Aggiornamento { version } disponibile", "title": "Titolo", "template": "Template", @@ -578,9 +584,9 @@ "users": "Utenti", "version": "Versione di Kirby", - "version.current": "Current version", - "version.latest": "Latest version", - "versionInformation": "Version information", + "version.current": "Versione corrente", + "version.latest": "Ultima versione", + "versionInformation": "Informazioni sulla versione", "view.account": "Il tuo account", "view.installation": "Installazione", diff --git a/kirby/i18n/translations/ko.json b/kirby/i18n/translations/ko.json index 6bdc0dd..21b4343 100644 --- a/kirby/i18n/translations/ko.json +++ b/kirby/i18n/translations/ko.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "블록을 하나 이상 추가하세요.", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "기본 이메일 주소({name})가 없습니다.", "error.field.converter.invalid": "컨버터({converter})가 올바르지 않습니다.", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "이름을 입력하세요.", "error.file.changeName.permission": "파일명({filename})을 변경할 권한이 없습니다.", @@ -289,6 +292,7 @@ "field.pages.empty": "선택한 페이지가 없습니다.", "field.structure.delete.confirm": "이 항목을 삭제할까요?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "항목이 없습니다.", "field.users.empty": "선택한 사용자가 없습니다.", @@ -318,7 +322,7 @@ "installation.issues.headline": "패널을 설치할 수 없습니다.", "installation.issues.mbstring": "MB String 확장 모듈이 필요합니다.", "installation.issues.media": "/media 폴더의 쓰기 권한을 확인하세요.", - "installation.issues.php": "PHP 버전이 7 이상인지 확인하세요.", + "installation.issues.php": "PHP 버전이 8 이상인지 확인하세요.", "installation.issues.server": "Kirby를 실행하려면 Apache, Nginx, 또는 Caddy가 필요합니다.", "installation.issues.sessions": "/site/sessions 폴더의 쓰기 권한을 확인하세요.", @@ -349,6 +353,8 @@ "license.manage": "라이선스 관리", "license.register.help": "Kirby를 등록하려면 이메일로 전송받은 라이선스 코드와 이메일 주소를 입력하세요.", "license.register.label": "라이선스 코드를 입력하세요.", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Kirby와 함께해주셔서 감사합니다.", "license.unregistered": "Kirby가 등록되지 않았습니다.", "license.unregistered.label": "Kirby가 등록되지 않았습니다.", @@ -382,7 +388,7 @@ "login.toggleText.password-reset.email": "암호 찾기", "login.toggleText.password-reset.email-password": "로그인 화면으로", - "logout": "\ub85c\uadf8\uc544\uc6c3", + "logout": "로그아웃", "menu": "메뉴", "meridiem": "오전/오후", @@ -494,7 +500,7 @@ "stats.empty": "관련 기록이 없습니다.", "system.issues.content": "/content 폴더의 권한을 확인하세요.", - "system.issues.eol.kirby": "Your installed Kirby version has reached end-of-life and will not receive further security updates", + "system.issues.eol.kirby": "설치된 Kirby는 버전이 만료되었습니다. 더 이상 보안 업데이트를 받을 수 없습니다.", "system.issues.eol.plugin": "Your installed version of the { plugin } plugin is has reached end-of-life and will not receive further security updates", "system.issues.debug": "공개 서버상에서는 디버그 모드를 해제하세요.", "system.issues.git": "/.git 폴더의 권한을 확인하세요.", diff --git a/kirby/i18n/translations/lt.json b/kirby/i18n/translations/lt.json index fdd78f5..3ec6b12 100644 --- a/kirby/i18n/translations/lt.json +++ b/kirby/i18n/translations/lt.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Jūs turite pridėti bent vieną bloką", "error.blocks.validation": "Yra klaida laukelyje \"{field}\" bloke {index} naudojant bloko tipą \"{fieldset}\"", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "El. pašto paruoštukas \"{name}\" nerastas", "error.field.converter.invalid": "Neteisingas konverteris \"{converter}\"", + "error.field.type.missing": "Laukelis \"{ name }\": Šio tipo (\"{ type }\") laukelis neegzistuoja", "error.file.changeName.empty": "Pavadinimas negali būti tuščias", "error.file.changeName.permission": "Neturite teisės pakeisti failo pavadinimo \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Dar nėra puslapių", "field.structure.delete.confirm": "Ar tikrai norite pašalinti šią eilutę?", + "field.structure.delete.confirm.all": "Ar tikrai norite išrtinti visus įrašus?", "field.structure.empty": "Dar nėra įrašų", "field.users.empty": "Dar nėra vartotojų", @@ -318,7 +322,7 @@ "installation.issues.headline": "Nepavyko įdiegti valdymo pulto", "installation.issues.mbstring": "Plėtinys MB String yra privalomas", "installation.issues.media": "Katalogas /media neegzistuoja arba neturi įrašymo teisių", - "installation.issues.php": "Įsitikinkite, kad naudojama PHP 7+", + "installation.issues.php": "Įsitikinkite, kad naudojama PHP 8+", "installation.issues.server": "Kirby reikalauja Apache, Nginx arba Caddy", "installation.issues.sessions": "Katalogas /site/sessions neegzistuoja arba neturi įrašymo teisių", @@ -349,6 +353,8 @@ "license.manage": "Valdyti savo licencijas", "license.register.help": "Licenzijos kodą gavote el. paštu po apmokėjimo. Prašome įterpti čia, kad sistema būtų užregistruota.", "license.register.label": "Prašome įrašyti jūsų licenzijos kodą", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Ačiū, kad palaikote Kirby", "license.unregistered": "Tai neregistruota Kirby demo versija", "license.unregistered.label": "Neregistruota", @@ -498,7 +504,7 @@ "system.issues.eol.plugin": "Your installed version of the { plugin } plugin is has reached end-of-life and will not receive further security updates", "system.issues.debug": "Debugging must be turned off in production", "system.issues.git": "The .git folder seems to be exposed", - "system.issues.https": "We recommend HTTPS for all your sites", + "system.issues.https": "Rekomenduojame HTTPS visoms svetainėms", "system.issues.kirby": "The kirby folder seems to be exposed", "system.issues.site": "The site folder seems to be exposed", "system.issues.vulnerability.kirby": "Your installation might be affected by the following vulnerability ({ severity } severity): { description }", diff --git a/kirby/i18n/translations/nb.json b/kirby/i18n/translations/nb.json index 4b99b6d..def3a18 100644 --- a/kirby/i18n/translations/nb.json +++ b/kirby/i18n/translations/nb.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Du må legge til minst en blokk", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "E-postinnstillingen \"{name}\" ble ikke funnet", "error.field.converter.invalid": "Ugyldig omformer \"{converter}\"", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "Navnet kan ikke være tomt", "error.file.changeName.permission": "Du har ikke rettighet til å endre navnet til \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Ingen side har blitt valgt", "field.structure.delete.confirm": "\u00d8nsker du virkelig \u00e5 slette denne oppf\u00f8ringen?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Ingen oppf\u00f8ringer enda", "field.users.empty": "Ingen bruker har blitt valgt", @@ -318,7 +322,7 @@ "installation.issues.headline": "Panelet kan ikke installeres", "installation.issues.mbstring": "Utvidelsen MB String er nødvendig", "installation.issues.media": "Mappen /media eksisterer ikke eller er ikke skrivbar", - "installation.issues.php": "Pass på at du bruker PHP 7+", + "installation.issues.php": "Pass på at du bruker PHP 8+", "installation.issues.server": "Kirby krever Apache, Nginx eller Caddy", "installation.issues.sessions": "Mappen /site/sessions eksisterer ikke eller er ikke skrivbar", @@ -349,6 +353,8 @@ "license.manage": "Manage your licenses", "license.register.help": "Du skal ha mottatt din lisenskode for kjøpet via e-post. Vennligst kopier og lim inn denne for å registrere deg.", "license.register.label": "Vennligst skriv inn din lisenskode", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Takk for at du støtter Kirby", "license.unregistered": "Dette er en uregistrert demo av Kirby", "license.unregistered.label": "Unregistered", diff --git a/kirby/i18n/translations/nl.json b/kirby/i18n/translations/nl.json index 1e6cee3..d4de462 100644 --- a/kirby/i18n/translations/nl.json +++ b/kirby/i18n/translations/nl.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Je moet ten minste één blok toevoegen", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "De e-mailvoorinstelling \"{name}\" kan niet worden gevonden", "error.field.converter.invalid": "Ongeldige converter \"{converter}\"", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "De naam mag niet leeg zijn", "error.file.changeName.permission": "Je hebt geen rechten om de naam te wijzigen van \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Nog geen pagina's geselecteerd", "field.structure.delete.confirm": "Wil je deze entry verwijderen?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Nog geen items.", "field.users.empty": "Nog geen gebruikers geselecteerd", @@ -318,7 +322,7 @@ "installation.issues.headline": "Het Panel kan niet worden geïnstalleerd", "installation.issues.mbstring": "De MB String extensie is verplicht", "installation.issues.media": "De map /mediabestaat niet of heeft geen schrijfrechten", - "installation.issues.php": "Gebruik PHP7+", + "installation.issues.php": "Gebruik PHP8+", "installation.issues.server": "Kirby vereist Apache, Nginx of Caddy", "installation.issues.sessions": "De map /site/sessions bestaat niet of heeft geen schrijfrechten", @@ -349,6 +353,8 @@ "license.manage": "Beheer je licenties", "license.register.help": "Je hebt de licentie via e-mail gekregen nadat je de aankoop hebt gedaan. Kopieer en plak de licentie om te registreren. ", "license.register.label": "Vul je licentie in", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Bedankt dat je Kirby ondersteunt", "license.unregistered": "Dit is een niet geregistreerde demo van Kirby", "license.unregistered.label": "Unregistered", diff --git a/kirby/i18n/translations/pl.json b/kirby/i18n/translations/pl.json index de41cb3..ddee187 100644 --- a/kirby/i18n/translations/pl.json +++ b/kirby/i18n/translations/pl.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Musisz dodać co najmniej jeden blok", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "Nie udało się załadować wzorca wiadomości e-mail \"{name}\"", "error.field.converter.invalid": "Nieprawidłowy konwerter \"{converter}\"", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "Imię nie może być puste", "error.file.changeName.permission": "Nie masz uprawnień, by zmienić nazwę \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Nie wybrano jeszcze żadnych stron", "field.structure.delete.confirm": "Czy na pewno chcesz usunąć ten wiersz?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Nie ma jeszcze \u017cadnych wpis\u00f3w.", "field.users.empty": "Nie wybrano jeszcze żadnych użytkowników", @@ -318,7 +322,7 @@ "installation.issues.headline": "Nie można zainstalować panelu", "installation.issues.mbstring": "Wymagane jest rozszerzenie MB String", "installation.issues.media": "Folder /media nie istnieje lub nie ma uprawnień do zapisu", - "installation.issues.php": "Upewnij się, że używasz PHP 7+", + "installation.issues.php": "Upewnij się, że używasz PHP 8+", "installation.issues.server": "Kirby wymaga Apache, Nginx lub Caddy", "installation.issues.sessions": "Folder /site/sessions nie istnieje lub nie ma uprawnień do zapisu", @@ -349,6 +353,8 @@ "license.manage": "Zarządzaj swoimi licencjami", "license.register.help": "Po zakupieniu licencji otrzymałaś/-eś mailem klucz. Skopiuj go i wklej tutaj, aby dokonać rejestracji.", "license.register.label": "Wprowadź swój kod licencji", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Dziękujemy za wspieranie Kirby", "license.unregistered": "To jest niezarejestrowana wersja demonstracyjna Kirby", "license.unregistered.label": "Niezarejestrowane", @@ -382,7 +388,7 @@ "login.toggleText.password-reset.email": "Zapomniałeś/-aś hasła?", "login.toggleText.password-reset.email-password": "← Powrót do logowania", - "logout": "Wyloguj", + "logout": "Wyloguj się", "menu": "Menu", "meridiem": "AM/PM", diff --git a/kirby/i18n/translations/pt_BR.json b/kirby/i18n/translations/pt_BR.json index 4b42cdd..750f411 100644 --- a/kirby/i18n/translations/pt_BR.json +++ b/kirby/i18n/translations/pt_BR.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Você deve adicionar pelo menos um bloco", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "Pré-configuração de email \"{name}\" não foi encontrada", "error.field.converter.invalid": "Conversor \"{converter}\" inválido", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "O nome não deve ficar em branco", "error.file.changeName.permission": "Você não tem permissão para alterar o nome de \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Nenhuma página selecionada", "field.structure.delete.confirm": "Deseja realmente deletar esta linha?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Nenhum registro", "field.users.empty": "Nenhum usuário selecionado", @@ -318,7 +322,7 @@ "installation.issues.headline": "O painel não pôde ser instalado", "installation.issues.mbstring": "A extensão MB String é necessária", "installation.issues.media": "A pasta /media não existe ou não possui permissão de escrita", - "installation.issues.php": "Certifique-se que você está usando o PHP 7+", + "installation.issues.php": "Certifique-se que você está usando o PHP 8+", "installation.issues.server": "Kirby necessita do Apache, Nginx ou Caddy", "installation.issues.sessions": "A pasta /site/sessions não existe ou não possui permissão de escrita", @@ -349,6 +353,8 @@ "license.manage": "Manage your licenses", "license.register.help": "Você recebeu o código da sua licença por email ao efetuar sua compra. Por favor, copie e cole o código para completar seu registro.", "license.register.label": "Por favor, digite o código da sua licença", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Obrigado por apoiar o Kirby", "license.unregistered": "Esta é uma cópia de demonstração não registrada do Kirby", "license.unregistered.label": "Unregistered", diff --git a/kirby/i18n/translations/pt_PT.json b/kirby/i18n/translations/pt_PT.json index ed82386..5382db0 100644 --- a/kirby/i18n/translations/pt_PT.json +++ b/kirby/i18n/translations/pt_PT.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Você deve adicionar pelo menos um bloco", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "Preset de email \"{name}\" não encontrado", "error.field.converter.invalid": "Conversor \"{converter}\" inválido", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "O nome não pode ficar em branco", "error.file.changeName.permission": "Não tem permissões para alterar o nome de \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Nenhuma página selecionada", "field.structure.delete.confirm": "Deseja realmente excluir este registro?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Nenhum registro", "field.users.empty": "Nenhum utilizador selecionado", @@ -318,7 +322,7 @@ "installation.issues.headline": "O painel não pôde ser instalado", "installation.issues.mbstring": "A extensão MB String é necessária", "installation.issues.media": "A pasta /media não existe ou não possui permissão de escrita", - "installation.issues.php": "Certifique-se que está a usar o PHP 7+", + "installation.issues.php": "Certifique-se que você está usando o PHP 8+", "installation.issues.server": "O Kirby necessita do Apache, Nginx ou Caddy", "installation.issues.sessions": "A pasta /site/sessions não existe ou não possui permissão de escrita", @@ -349,6 +353,8 @@ "license.manage": "Manage your licenses", "license.register.help": "Recebeu o código da sua licença por email após a compra. Por favor, copie e cole-o para completar o registro.", "license.register.label": "Por favor, digite o código da sua licença", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Obrigado por apoiar o Kirby", "license.unregistered": "Esta é uma demonstração não registrada do Kirby", "license.unregistered.label": "Unregistered", diff --git a/kirby/i18n/translations/ru.json b/kirby/i18n/translations/ru.json index 11e1214..3cc15e1 100644 --- a/kirby/i18n/translations/ru.json +++ b/kirby/i18n/translations/ru.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Вы должны добавить хотя бы один блок", "error.blocks.validation": "Ошибка в поле \"{field}\" в блоке {index} типа \"{fieldset}\"", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "Шаблон эл. почты \"{name}\" не найден", "error.field.converter.invalid": "Неверный конвертер \"{converter}\"", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "Название не может быть пустым", "error.file.changeName.permission": "У вас нет права изменить название \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Страницы не выбраны", "field.structure.delete.confirm": "Вы точно хотите удалить эту запись?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Записей нет", "field.users.empty": "Пользователей нет", @@ -318,7 +322,7 @@ "installation.issues.headline": "Не удалось установить панель", "installation.issues.mbstring": "Расширение MB String необходимо", "installation.issues.media": "Каталог /media не существует или нет прав записи", - "installation.issues.php": "Убедитесь, что используется PHP 7+", + "installation.issues.php": "Убедитесь, что используется PHP 8+", "installation.issues.server": "Kirby требует Apache, Nginx или Caddy ", "installation.issues.sessions": "Каталог /site/sessions не существует или нет прав записи", @@ -349,6 +353,8 @@ "license.manage": "Управление лицензиями", "license.register.help": "После покупки вы получили по эл. почте код лицензии. Пожалуйста скопируйте и вставьте сюда чтобы зарегистрировать.", "license.register.label": "Пожалуйста вставьте код лицензии", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Спасибо за поддержку Kirby", "license.unregistered": "Это незарегистрированная версия Kirby", "license.unregistered.label": "Не зарегистрировано", diff --git a/kirby/i18n/translations/sk.json b/kirby/i18n/translations/sk.json index b1e9455..bdd129a 100644 --- a/kirby/i18n/translations/sk.json +++ b/kirby/i18n/translations/sk.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "You must add at least one block", "error.blocks.validation": "There's an error on the \"{field}\" field in block {index} using the \"{fieldset}\" block type", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "E-mailovú predvoľbu \"{name}\" nie je možné nájsť", "error.field.converter.invalid": "Neplatný converter \"{converter}\"", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "Meno nesmie byť prázdne", "error.file.changeName.permission": "Nemáte povolenie na zmenu názvu pre \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Žiadne stránky zatiaľ neboli zvolené", "field.structure.delete.confirm": "Ste si istý, že chcete zmazať tento riadok?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Zatiaľ žiadne údaje", "field.users.empty": "Žiadni užívatelia zatiaľ neboli zvolení", @@ -318,7 +322,7 @@ "installation.issues.headline": "Panel nie je možné naištalovať", "installation.issues.mbstring": "MB String rozšírenie je povinné", "installation.issues.media": "Priečinok /media neexistuje alebo nie je nastavený ako zapisovateľný", - "installation.issues.php": "Uistite sa, že používate PHP 7+", + "installation.issues.php": "Uistite sa, že používate PHP 8+", "installation.issues.server": "Kirby vyžaduje Apache, Nginx alebo Caddy", "installation.issues.sessions": "Priečinok /site/sessions neexistuje alebo nie je nastavený ako zapisovateľný", @@ -349,6 +353,8 @@ "license.manage": "Manage your licenses", "license.register.help": "Licenčný kód vám bol doručený e-mailom po úspešnom nákupe. Prosím, skopírujte a prilepte ho na uskutočnenie registrácie.", "license.register.label": "Prosím, zadajte váš licenčný kód", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Ďakujeme za vašu podporu Kirby", "license.unregistered": "Toto je neregistrované demo Kirby", "license.unregistered.label": "Unregistered", diff --git a/kirby/i18n/translations/sv_SE.json b/kirby/i18n/translations/sv_SE.json index 9a4a928..f0c48bd 100644 --- a/kirby/i18n/translations/sv_SE.json +++ b/kirby/i18n/translations/sv_SE.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "Du måste lägga till minst ett block", "error.blocks.validation": "Det finns ett fel i fältet \"{field}\" i block {index} med blocktypen \"{fieldset}\"", + "error.cache.type.invalid": "Invalid cache type \"{type}\"", + "error.email.preset.notFound": "E-postförinställningen \"{name}\" kan inte hittas", "error.field.converter.invalid": "Ogiltig omvandlare \"{converter}\"", + "error.field.type.missing": "Field \"{ name }\": The field type \"{ type }\" does not exist", "error.file.changeName.empty": "Namnet får inte vara tomt", "error.file.changeName.permission": "Du har inte behörighet att ändra namnet på \"{filename}\"", @@ -289,6 +292,7 @@ "field.pages.empty": "Inga sidor valda än", "field.structure.delete.confirm": "Vill du verkligen radera denna rad?", + "field.structure.delete.confirm.all": "Do you really want to delete all entries?", "field.structure.empty": "Inga poster än", "field.users.empty": "Inga användare valda än", @@ -318,7 +322,7 @@ "installation.issues.headline": "Panelen kan inte installeras", "installation.issues.mbstring": "Tillägget MB String krävs", "installation.issues.media": "Mappen /media finns inte eller är inte skrivbar", - "installation.issues.php": "Se till att du använder PHP 7+", + "installation.issues.php": "Se till att du använder PHP 8+", "installation.issues.server": "Kirby kräver Apache, Nginx eller Caddy", "installation.issues.sessions": "Mappen /site/sessions finns inte eller är inte skrivbar", @@ -349,6 +353,8 @@ "license.manage": "Hantera dina licenser", "license.register.help": "Du fick din licenskod via e-post efter inköpet. Kopiera och klistra in den för att registrera licensen.", "license.register.label": "Ange din licenskod", + "license.register.domain": "Your license will be registered to {host}.", + "license.register.local": "You are about to register your license for your local domain {host}. If this site will be deployed to a public domain, please register it there instead. If {host} is the domain you want to license Kirby to, please continue.", "license.register.success": "Tack för att du stödjer Kirby", "license.unregistered": "Detta är en oregistrerad demo av Kirby", "license.unregistered.label": "Oregistrerad", diff --git a/kirby/i18n/translations/tr.json b/kirby/i18n/translations/tr.json index be7ac82..ce12d20 100644 --- a/kirby/i18n/translations/tr.json +++ b/kirby/i18n/translations/tr.json @@ -72,9 +72,12 @@ "error.blocks.min.singular": "En az bir blok eklemelisiniz", "error.blocks.validation": "\"{fieldset}\" blok türünü kullanan {index}. bloktaki \"{field}\" alanında bir hata var", + "error.cache.type.invalid": "Geçersiz önbellek türü \"{type}\"", + "error.email.preset.notFound": "\"{name}\" e-posta adresi bulunamadı", "error.field.converter.invalid": "Geçersiz dönüştürücü \"{converter}\"", + "error.field.type.missing": "\"{ name }\" alanı: \"{ type }\" alan türü mevcut değil", "error.file.changeName.empty": "İsim boş olmamalıdır", "error.file.changeName.permission": "\"{filename}\" adını değiştiremezsiniz", @@ -289,6 +292,7 @@ "field.pages.empty": "Henüz sayfa seçilmedi", "field.structure.delete.confirm": "Bu girdiyi silmek istedi\u011finizden emin misiniz?", + "field.structure.delete.confirm.all": "Tüm girdileri gerçekten silmek istiyor musunuz?", "field.structure.empty": "Hen\u00fcz bir girdi yok", "field.users.empty": "Henüz kullanıcı seçilmedi", @@ -318,7 +322,7 @@ "installation.issues.headline": "Panel kurulamadı", "installation.issues.mbstring": "MB String eklentisi gerekli", "installation.issues.media": "/media klasörü yok yada yazılamaz", - "installation.issues.php": "PHP 7+ kullandığınızdan emin olun. ", + "installation.issues.php": "PHP 8+ kullandığınızdan emin olun. ", "installation.issues.server": "Kirby Apache, Nginx veya Caddy gerektirir", "installation.issues.sessions": "/site/sessions klasörü mevcut değil veya yazılabilir değil", @@ -349,6 +353,8 @@ "license.manage": "Lisanslarınızı yönetin", "license.register.help": "Satın alma işleminden sonra e-posta yoluyla lisans kodunuzu aldınız. Lütfen kayıt olmak için kodu kopyalayıp yapıştırın.", "license.register.label": "Lütfen lisans kodunu giriniz", + "license.register.domain": "Lisansınız {host} için kaydedilecek.", + "license.register.local": "Lisansınızı yerel alan adınız {host} için kaydetmek üzeresiniz. Bu site genel bir etki alanına dağıtılacaksa, lütfen bunun yerine lisansı orada kaydedin. Kirby'yi lisanslamak istediğiniz alan adı {host} ise lütfen devam edin.", "license.register.success": "Kirby'yi desteklediğiniz için teşekkürler", "license.unregistered": "Bu Kirby'nin kayıtsız bir demosu", "license.unregistered.label": "Kayıtsız", @@ -382,7 +388,7 @@ "login.toggleText.password-reset.email": "Şifrenizi mi unuttunuz?", "login.toggleText.password-reset.email-password": "← Girişe geri dön", - "logout": "Güvenli Çıkış", + "logout": "Oturumu kapat", "menu": "Menü", "meridiem": "AM/PM", diff --git a/kirby/panel/dist/css/style.css b/kirby/panel/dist/css/style.css index 512ebe1..78ec338 100644 --- a/kirby/panel/dist/css/style.css +++ b/kirby/panel/dist/css/style.css @@ -1 +1 @@ -.k-dialog{position:relative;background:var(--color-background);width:100%;box-shadow:var(--shadow-lg);border-radius:var(--rounded-md);line-height:1;max-height:calc(100vh - 3rem);margin:1.5rem;display:flex;flex-direction:column}@media screen and (min-width:20rem){.k-dialog[data-size=small]{width:20rem}}@media screen and (min-width:22rem){.k-dialog[data-size=default]{width:22rem}}@media screen and (min-width:30rem){.k-dialog[data-size=medium]{width:30rem}}@media screen and (min-width:40rem){.k-dialog[data-size=large]{width:40rem}}[dir=ltr] .k-dialog-notification,[dir=rtl] .k-dialog-notification{border-top-right-radius:var(--rounded);border-top-left-radius:var(--rounded)}.k-dialog-notification{padding:.75rem 1.5rem;background:var(--color-gray-900);width:100%;margin-top:-1px;line-height:1.25rem;color:var(--color-white);display:flex;flex-shrink:0;align-items:center}.k-dialog-notification[data-theme]{background:var(--theme-light);color:var(--color-black)}.k-dialog-notification p{flex-grow:1;word-wrap:break-word;overflow:hidden}[dir=ltr] .k-dialog-notification .k-button{margin-left:1rem}[dir=rtl] .k-dialog-notification .k-button{margin-right:1rem}.k-dialog-notification .k-button{display:flex}.k-dialog-body{padding:1.5rem}.k-dialog-body .k-fieldset{padding-bottom:.5rem}.k-dialog-footer{padding:0;border-top:1px solid var(--color-gray-300);line-height:1;flex-shrink:0}.k-dialog-footer .k-button-group{display:flex;margin:0;justify-content:space-between}.k-dialog-footer .k-button-group .k-button{padding:.75rem 1rem;line-height:1.25rem}[dir=ltr] .k-dialog-footer .k-button-group .k-button:first-child{text-align:left}[dir=rtl] .k-dialog-footer .k-button-group .k-button:first-child{text-align:right}[dir=ltr] .k-dialog-footer .k-button-group .k-button:first-child{padding-left:1.5rem}[dir=rtl] .k-dialog-footer .k-button-group .k-button:first-child{padding-right:1.5rem}[dir=ltr] .k-dialog-footer .k-button-group .k-button:last-child{text-align:right}[dir=rtl] .k-dialog-footer .k-button-group .k-button:last-child{text-align:left}[dir=ltr] .k-dialog-footer .k-button-group .k-button:last-child{padding-right:1.5rem}[dir=rtl] .k-dialog-footer .k-button-group .k-button:last-child{padding-left:1.5rem}.k-dialog .k-pagination{margin-bottom:-1.5rem;display:flex;justify-content:center;align-items:center}.k-dialog-search{margin-bottom:.75rem}.k-dialog-search.k-input{background:rgba(0,0,0,.075);padding:0 1rem;height:36px;border-radius:var(--rounded)}.k-error-details{background:var(--color-white);display:block;overflow:auto;padding:1rem;font-size:var(--text-sm);line-height:1.25em;margin-top:.75rem}.k-error-details dt{color:var(--color-negative-light);margin-bottom:.25rem}.k-error-details dd{overflow:hidden;overflow-wrap:break-word;text-overflow:ellipsis}.k-error-details dd:not(:last-of-type){margin-bottom:1.5em}.k-error-details li{white-space:pre-line}.k-error-details li:not(:last-child){border-bottom:1px solid var(--color-background);padding-bottom:.25rem;margin-bottom:.25rem}.k-files-dialog .k-list-item{cursor:pointer}[dir=ltr] .k-pages-dialog-navbar{padding-right:38px}[dir=rtl] .k-pages-dialog-navbar{padding-left:38px}.k-pages-dialog-navbar{display:flex;align-items:center;justify-content:center;margin-bottom:.5rem}.k-pages-dialog-navbar .k-button{width:38px}.k-pages-dialog-navbar .k-button[disabled]{opacity:0}.k-pages-dialog-navbar .k-headline{flex-grow:1;text-align:center}.k-pages-dialog .k-list-item{cursor:pointer}.k-pages-dialog .k-list-item .k-button[data-theme=disabled],.k-pages-dialog .k-list-item .k-button[disabled]{opacity:.25}.k-pages-dialog .k-list-item .k-button[data-theme=disabled]:hover{opacity:1}.k-users-dialog .k-list-item{cursor:pointer}.k-drawer{--drawer-header-height:2.5rem;--drawer-header-padding:1.5rem;position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--z-toolbar);display:flex;align-items:stretch;justify-content:flex-end;background:rgba(0,0,0,.2)}.k-drawer-box{position:relative;flex-basis:50rem;display:flex;flex-direction:column;background:var(--color-background);box-shadow:var(--shadow-xl)}[dir=ltr] .k-drawer-header{padding-left:var(--drawer-header-padding)}[dir=rtl] .k-drawer-header{padding-right:var(--drawer-header-padding)}.k-drawer-header{flex-shrink:0;height:var(--drawer-header-height);display:flex;align-items:center;line-height:1;justify-content:space-between;background:var(--color-white);font-size:var(--text-sm)}.k-drawer-title{padding:0 .75rem}[dir=ltr] .k-drawer-breadcrumb,[dir=ltr] .k-drawer-title{margin-left:-.75rem}[dir=rtl] .k-drawer-breadcrumb,[dir=rtl] .k-drawer-title{margin-right:-.75rem}.k-drawer-breadcrumb,.k-drawer-title{display:flex;flex-grow:1;align-items:center;min-width:0;font-size:var(--text-sm);font-weight:var(--font-normal)}[dir=ltr] .k-drawer-breadcrumb li:not(:last-child) .k-button:after{right:-.75rem}[dir=rtl] .k-drawer-breadcrumb li:not(:last-child) .k-button:after{left:-.75rem}.k-drawer-breadcrumb li:not(:last-child) .k-button:after{position:absolute;width:1.5rem;display:inline-flex;justify-content:center;align-items:center;content:"\203a";color:var(--color-gray-500);height:var(--drawer-header-height)}[dir=ltr] .k-drawer-breadcrumb .k-icon,[dir=ltr] .k-drawer-title .k-icon{margin-right:.5rem}[dir=rtl] .k-drawer-breadcrumb .k-icon,[dir=rtl] .k-drawer-title .k-icon{margin-left:.5rem}.k-drawer-breadcrumb .k-icon,.k-drawer-title .k-icon{width:1rem;color:var(--color-gray-500)}.k-drawer-breadcrumb .k-button{display:inline-flex;align-items:center;height:var(--drawer-header-height);padding-left:.75rem;padding-right:.75rem}.k-drawer-breadcrumb .k-button-text{opacity:1}[dir=ltr] .k-drawer-breadcrumb .k-button .k-button-icon~.k-button-text{padding-left:0}[dir=rtl] .k-drawer-breadcrumb .k-button .k-button-icon~.k-button-text{padding-right:0}[dir=ltr] .k-drawer-tabs{margin-right:.75rem}[dir=rtl] .k-drawer-tabs{margin-left:.75rem}.k-drawer-tabs{display:flex;align-items:center;line-height:1}.k-drawer-tab.k-button{height:var(--drawer-header-height);padding-left:.75rem;padding-right:.75rem;display:flex;align-items:center;font-size:var(--text-xs)}.k-drawer-tab.k-button[aria-current]:after{position:absolute;bottom:-1px;left:.75rem;right:.75rem;content:"";background:var(--color-black);height:2px}[dir=ltr] .k-drawer-options{padding-right:.75rem}[dir=rtl] .k-drawer-options{padding-left:.75rem}.k-drawer-option.k-button{width:var(--drawer-header-height);height:var(--drawer-header-height);color:var(--color-gray-500);line-height:1}.k-drawer-option.k-button:focus,.k-drawer-option.k-button:hover{color:var(--color-black)}.k-drawer-body{padding:1.5rem;flex-grow:1;background:var(--color-background)}.k-drawer[data-nested=true]{background:0 0}.k-drawer-body .k-table th,.k-drawer-body .k-textarea-input:focus-within .k-toolbar{top:-1.5rem}.k-calendar-input{--cell-padding:.25rem .5rem;padding:.5rem;color:var(--color-light);border-radius:var(--rounded-xs)}.k-calendar-table{table-layout:fixed;width:100%;min-width:15rem;padding-top:.5rem}.k-calendar-input>nav{display:flex;direction:ltr}.k-calendar-input>nav .k-button{padding:.5rem}.k-calendar-selects{flex-grow:1;display:flex;align-items:center;justify-content:center}[dir=ltr] .k-calendar-selects{direction:ltr}[dir=rtl] .k-calendar-selects{direction:rtl}.k-calendar-selects .k-select-input{padding:0 .5rem;font-weight:var(--font-normal);font-size:var(--text-sm)}.k-calendar-selects .k-select-input:focus-within{color:var(--color-focus-light)!important}.k-calendar-input th{padding:.5rem 0;color:var(--color-gray-500);font-size:var(--text-xs);font-weight:400;text-align:center}.k-calendar-day .k-button{width:2rem;height:2rem;margin-left:auto;margin-right:auto;color:var(--color-white);line-height:1.75rem;display:flex;justify-content:center;border-radius:50%;border:2px solid transparent}.k-calendar-day .k-button .k-button-text{opacity:1}.k-calendar-table .k-button:hover{color:var(--color-white)}.k-calendar-day:hover .k-button:not([data-disabled=true]){border-color:#ffffff40}.k-calendar-day[aria-current=date] .k-button{text-decoration:underline}.k-calendar-day[aria-selected=date] .k-button{border-color:currentColor;font-weight:600;color:var(--color-focus-light)}.k-calendar-today{text-align:center;padding-top:.5rem}.k-calendar-today .k-button{font-size:var(--text-xs);padding:1rem;text-decoration:underline}.k-calendar-today .k-button-text{opacity:1;vertical-align:baseline}.k-counter{font-size:var(--text-xs);color:var(--color-gray-900);font-weight:var(--font-bold)}.k-counter[data-invalid=true]{box-shadow:none;border:0;color:var(--color-negative)}[dir=ltr] .k-counter-rules{padding-left:.5rem}[dir=rtl] .k-counter-rules{padding-right:.5rem}.k-counter-rules{color:var(--color-gray-600);font-weight:var(--font-normal)}.k-form-submitter{display:none}.k-form-buttons[data-theme]{background:var(--theme-light)}.k-form-buttons .k-view{display:flex;justify-content:space-between;align-items:center}.k-form-button.k-button{font-weight:500;white-space:nowrap;line-height:1;height:2.5rem;display:flex;padding:0 1rem;align-items:center}[dir=ltr] .k-form-button:first-child{margin-left:-1rem}[dir=rtl] .k-form-button:first-child{margin-right:-1rem}[dir=ltr] .k-form-button:last-child{margin-right:-1rem}[dir=rtl] .k-form-button:last-child{margin-left:-1rem}[dir=ltr] .k-form-lock-info{margin-right:3rem}[dir=rtl] .k-form-lock-info{margin-left:3rem}.k-form-lock-info{display:flex;font-size:var(--text-sm);align-items:center;line-height:1.5em;padding:.625rem 0}[dir=ltr] .k-form-lock-info>.k-icon{margin-right:.5rem}[dir=rtl] .k-form-lock-info>.k-icon{margin-left:.5rem}.k-form-lock-buttons{display:flex;flex-shrink:0}.k-form-lock-loader{animation:Spin 4s linear infinite}.k-form-lock-loader .k-icon-loader{display:flex}.k-form-indicator-toggle{color:var(--color-notice-light)}.k-form-indicator-info{font-size:var(--text-sm);font-weight:var(--font-bold);padding:.75rem 1rem .25rem;line-height:1.25em;width:15rem}.k-field-label{font-weight:var(--font-bold);display:block;padding:0 0 .75rem;flex-grow:1;line-height:1.25rem}[dir=ltr] .k-field-label abbr{padding-left:.25rem}[dir=rtl] .k-field-label abbr{padding-right:.25rem}.k-field-label abbr{text-decoration:none;color:var(--color-gray-500)}.k-field-header{position:relative;display:flex;align-items:baseline}[dir=ltr] .k-field-options{right:0}[dir=rtl] .k-field-options{left:0}.k-field-options{position:absolute;top:calc(-.5rem - 1px)}.k-field-options.k-button-group .k-dropdown{height:auto}.k-field-options.k-button-group .k-field-options-button.k-button{padding:.75rem;display:flex}.k-field[data-disabled=true]{cursor:not-allowed}.k-field[data-disabled=true] *{pointer-events:none}.k-field[data-disabled=true] .k-text[data-theme=help] *{pointer-events:initial}.k-field:focus-within>.k-field-header>.k-field-counter{display:block}.k-field-help{padding-top:.5rem}.k-field-add-item-button{display:flex;align-items:center;width:100%;color:var(--color-gray-500);justify-content:center;padding:.75rem 0}.k-field-add-item-button:hover{color:var(--color-black)}.k-fieldset{border:0}.k-fieldset .k-grid{grid-row-gap:2.25rem}@media screen and (min-width:30em){.k-fieldset .k-grid{grid-column-gap:1.5rem}}.k-sections>.k-column[data-width="1/3"] .k-fieldset .k-grid,.k-sections>.k-column[data-width="1/4"] .k-fieldset .k-grid{grid-template-columns:repeat(1,1fr)}.k-sections>.k-column[data-width="1/3"] .k-fieldset .k-grid .k-column,.k-sections>.k-column[data-width="1/4"] .k-fieldset .k-grid .k-column{grid-column-start:initial}.k-input{display:flex;align-items:center;line-height:1;border:0;outline:0;background:0 0}.k-input-element{flex-grow:1}.k-input-icon{display:flex;justify-content:center;align-items:center;line-height:0}.k-input[data-disabled=true]{pointer-events:none}[data-disabled=true] .k-input-icon{color:var(--color-gray-600)}.k-input[data-theme=field]{line-height:1;border:var(--field-input-border);background:var(--field-input-background);border-radius:var(--rounded)}.k-input[data-theme=field]:focus-within{border:var(--field-input-focus-border);box-shadow:var(--color-focus-outline) 0 0 0 2px}.k-input[data-theme=field][data-disabled=true]{background:var(--color-background)}.k-input[data-theme=field] .k-input-icon{width:var(--field-input-height);align-self:stretch;display:flex;align-items:center;flex-shrink:0}.k-input[data-theme=field] .k-input-after,.k-input[data-theme=field] .k-input-before{align-self:stretch;display:flex;align-items:center;flex-shrink:0;padding:0 var(--field-input-padding)}[dir=ltr] .k-input[data-theme=field] .k-input-before{padding-right:0}[dir=ltr] .k-input[data-theme=field] .k-input-after,[dir=rtl] .k-input[data-theme=field] .k-input-before{padding-left:0}.k-input[data-theme=field] .k-input-before{color:var(--field-input-color-before)}[dir=rtl] .k-input[data-theme=field] .k-input-after{padding-right:0}.k-input[data-theme=field] .k-input-after{color:var(--field-input-color-after)}.k-input[data-theme=field] .k-input-icon>.k-dropdown{width:100%;height:100%}.k-input[data-theme=field] .k-input-icon-button{width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-shrink:0}.k-input[data-theme=field] .k-number-input,.k-input[data-theme=field] .k-select-input,.k-input[data-theme=field] .k-text-input{padding:var(--field-input-padding);line-height:var(--field-input-line-height);border-radius:var(--rounded)}.k-input[data-theme=field] .k-date-input .k-select-input,.k-input[data-theme=field] .k-time-input .k-select-input{padding-left:0;padding-right:0}[dir=ltr] .k-input[data-theme=field] .k-date-input .k-select-input:first-child,[dir=ltr] .k-input[data-theme=field] .k-time-input .k-select-input:first-child{padding-left:var(--field-input-padding)}[dir=rtl] .k-input[data-theme=field] .k-date-input .k-select-input:first-child,[dir=rtl] .k-input[data-theme=field] .k-time-input .k-select-input:first-child{padding-right:var(--field-input-padding)}.k-input[data-theme=field] .k-date-input .k-select-input:focus-within,.k-input[data-theme=field] .k-time-input .k-select-input:focus-within{color:var(--color-focus);font-weight:var(--font-bold)}[dir=ltr] .k-input[data-theme=field].k-time-input .k-time-input-meridiem{padding-left:var(--field-input-padding)}[dir=rtl] .k-input[data-theme=field].k-time-input .k-time-input-meridiem{padding-right:var(--field-input-padding)}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input li,.k-input[data-theme=field][data-type=checkboxes] .k-radio-input li,.k-input[data-theme=field][data-type=radio] .k-checkboxes-input li,.k-input[data-theme=field][data-type=radio] .k-radio-input li{min-width:0;overflow-wrap:break-word}[dir=ltr] .k-input[data-theme=field][data-type=checkboxes] .k-input-before{border-right:1px solid var(--color-background)}[dir=ltr] .k-input[data-theme=field][data-type=checkboxes] .k-input-element+.k-input-after,[dir=ltr] .k-input[data-theme=field][data-type=checkboxes] .k-input-element+.k-input-icon,[dir=rtl] .k-input[data-theme=field][data-type=checkboxes] .k-input-before{border-left:1px solid var(--color-background)}[dir=ltr] .k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input li,[dir=rtl] .k-input[data-theme=field][data-type=checkboxes] .k-input-element+.k-input-after,[dir=rtl] .k-input[data-theme=field][data-type=checkboxes] .k-input-element+.k-input-icon{border-right:1px solid var(--color-background)}.k-input[data-theme=field][data-type=checkboxes] .k-input-element{overflow:hidden}[dir=ltr] .k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input{margin-right:-1px}[dir=rtl] .k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input{margin-left:-1px}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input{display:grid;grid-template-columns:1fr;margin-bottom:-1px}@media screen and (min-width:65em){.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input{grid-template-columns:repeat(var(--columns),1fr)}}[dir=rtl] .k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input li{border-left:1px solid var(--color-background)}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input li,.k-input[data-theme=field][data-type=radio] .k-radio-input li{border-bottom:1px solid var(--color-background)}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input label{display:block;line-height:var(--field-input-line-height);padding:var(--field-input-padding) var(--field-input-padding)}[dir=ltr] .k-input[data-theme=field][data-type=checkboxes] .k-checkbox-input-icon,[dir=ltr] .k-input[data-theme=field][data-type=radio] .k-radio-input label:before{left:var(--field-input-padding)}[dir=rtl] .k-input[data-theme=field][data-type=checkboxes] .k-checkbox-input-icon,[dir=rtl] .k-input[data-theme=field][data-type=radio] .k-radio-input label:before{right:var(--field-input-padding)}.k-input[data-theme=field][data-type=checkboxes] .k-checkbox-input-icon{top:calc((var(--field-input-height) - var(--field-input-font-size))/2);margin-top:0}[dir=ltr] .k-input[data-theme=field][data-type=radio] .k-input-before{border-right:1px solid var(--color-background)}[dir=ltr] .k-input[data-theme=field][data-type=radio] .k-input-element+.k-input-after,[dir=ltr] .k-input[data-theme=field][data-type=radio] .k-input-element+.k-input-icon,[dir=rtl] .k-input[data-theme=field][data-type=radio] .k-input-before{border-left:1px solid var(--color-background)}[dir=ltr] .k-input[data-theme=field][data-type=radio] .k-radio-input li,[dir=rtl] .k-input[data-theme=field][data-type=radio] .k-input-element+.k-input-after,[dir=rtl] .k-input[data-theme=field][data-type=radio] .k-input-element+.k-input-icon{border-right:1px solid var(--color-background)}.k-input[data-theme=field][data-type=radio] .k-input-element{overflow:hidden}[dir=ltr] .k-input[data-theme=field][data-type=radio] .k-radio-input{margin-right:-1px}[dir=rtl] .k-input[data-theme=field][data-type=radio] .k-radio-input{margin-left:-1px}.k-input[data-theme=field][data-type=radio] .k-radio-input{display:grid;grid-template-columns:1fr;margin-bottom:-1px}@media screen and (min-width:65em){.k-input[data-theme=field][data-type=radio] .k-radio-input{grid-template-columns:repeat(var(--columns),1fr)}}[dir=rtl] .k-input[data-theme=field][data-type=radio] .k-radio-input li{border-left:1px solid var(--color-background)}.k-input[data-theme=field][data-type=radio] .k-radio-input label{display:block;flex-grow:1;min-height:var(--field-input-height);line-height:var(--field-input-line-height);padding:calc((var(--field-input-height) - var(--field-input-line-height))/2) var(--field-input-padding)}.k-input[data-theme=field][data-type=radio] .k-radio-input label:before{top:calc((var(--field-input-height) - 1rem)/2);margin-top:-1px}.k-input[data-theme=field][data-type=radio] .k-radio-input .k-radio-input-info{display:block;font-size:var(--text-sm);color:var(--color-gray-600);line-height:var(--field-input-line-height);padding-top:calc(var(--field-input-line-height)/10)}.k-input[data-theme=field][data-type=radio] .k-radio-input .k-icon{width:var(--field-input-height);height:var(--field-input-height);display:flex;align-items:center;justify-content:center}.k-input[data-theme=field][data-type=range] .k-range-input{padding:var(--field-input-padding)}.k-input[data-theme=field][data-type=multiselect],.k-input[data-theme=field][data-type=select]{position:relative}[dir=ltr] .k-input[data-theme=field][data-type=select] .k-input-icon{right:0}[dir=rtl] .k-input[data-theme=field][data-type=select] .k-input-icon{left:0}.k-input[data-theme=field][data-type=select] .k-input-icon{position:absolute;top:0;bottom:0}.k-input[data-theme=field][data-type=tags] .k-tags-input{padding:.25rem .25rem 0}[dir=ltr] .k-input[data-theme=field][data-type=tags] .k-tag{margin-right:.25rem}[dir=rtl] .k-input[data-theme=field][data-type=tags] .k-tag{margin-left:.25rem}.k-input[data-theme=field][data-type=tags] .k-tag{margin-bottom:.25rem;height:auto;min-height:1.75rem;font-size:var(--text-sm)}.k-input[data-theme=field][data-type=tags] .k-tags-input input{font-size:var(--text-sm);padding:0 .25rem;height:1.75rem;line-height:1;margin-bottom:.25rem}.k-input[data-theme=field][data-type=tags] .k-tags-input .k-dropdown-content{top:calc(100% + .5rem + 2px)}.k-input[data-theme=field][data-type=tags] .k-tags-input .k-dropdown-content[data-dropup]{top:calc(100% + .5rem + 2px);bottom:initial;margin-bottom:initial}.k-input[data-theme=field][data-type=multiselect] .k-multiselect-input{padding:.25rem 2rem 0 .25rem;min-height:2.25rem}[dir=ltr] .k-input[data-theme=field][data-type=multiselect] .k-tag{margin-right:.25rem}[dir=rtl] .k-input[data-theme=field][data-type=multiselect] .k-tag{margin-left:.25rem}.k-input[data-theme=field][data-type=multiselect] .k-tag{margin-bottom:.25rem;height:1.75rem;font-size:var(--text-sm)}[dir=ltr] .k-input[data-theme=field][data-type=multiselect] .k-input-icon{right:0}[dir=rtl] .k-input[data-theme=field][data-type=multiselect] .k-input-icon{left:0}.k-input[data-theme=field][data-type=multiselect] .k-input-icon{position:absolute;top:0;bottom:0;pointer-events:none}.k-input[data-theme=field][data-type=textarea] .k-textarea-input-native{padding:.25rem var(--field-input-padding);line-height:1.5rem}[dir=ltr] .k-input[data-theme=field][data-type=toggle] .k-input-before{padding-right:calc(var(--field-input-padding)/2)}[dir=rtl] .k-input[data-theme=field][data-type=toggle] .k-input-before{padding-left:calc(var(--field-input-padding)/2)}[dir=ltr] .k-input[data-theme=field][data-type=toggle] .k-toggle-input{padding-left:var(--field-input-padding)}[dir=rtl] .k-input[data-theme=field][data-type=toggle] .k-toggle-input{padding-right:var(--field-input-padding)}.k-input[data-theme=field][data-type=toggle] .k-toggle-input-label{padding:0 var(--field-input-padding)0 .75rem;line-height:var(--field-input-height)}.k-login-code-form .k-user-info{height:38px;margin-bottom:2.25rem;padding:.5rem;background:var(--color-white);border-radius:var(--rounded-xs);box-shadow:var(--shadow)}.k-times{padding:var(--spacing-4) var(--spacing-6);display:grid;line-height:1;grid-template-columns:1fr 1fr;grid-gap:var(--spacing-6)}.k-times .k-icon{width:1rem;margin-bottom:var(--spacing-2)}.k-times-slot .k-button{padding:var(--spacing-1) var(--spacing-3) var(--spacing-1)0;font-variant-numeric:tabular-nums;white-space:nowrap}.k-times .k-times-slot hr{position:relative;opacity:1;margin:var(--spacing-2)0;border:0;height:1px;top:1px;background:var(--color-dark)}[dir=ltr] .k-upload input{left:-3000px}[dir=rtl] .k-upload input{right:-3000px}.k-upload input{position:absolute;top:0}.k-upload-dialog .k-headline{margin-bottom:.75rem}.k-upload-error-list,.k-upload-list{line-height:1.5em;font-size:var(--text-sm)}.k-upload-list-filename{color:var(--color-gray-600)}.k-upload-error-list li{padding:.75rem;background:var(--color-white);border-radius:var(--rounded-xs)}.k-upload-error-list li:not(:last-child){margin-bottom:2px}.k-upload-error-filename{color:var(--color-negative);font-weight:var(--font-bold)}.k-upload-error-message{color:var(--color-gray-600)}.k-writer-toolbar{position:absolute;display:flex;background:var(--color-black);height:30px;transform:translate(-50%) translateY(-.75rem);z-index:calc(var(--z-dropdown) + 1);box-shadow:var(--shadow);color:var(--color-white);border-radius:var(--rounded)}.k-writer-toolbar-button.k-button{display:flex;align-items:center;justify-content:center;height:30px;width:30px;font-size:var(--text-sm)!important;color:currentColor;line-height:1}.k-writer-toolbar-button.k-button:hover{background:rgba(255,255,255,.15)}.k-writer-toolbar-button.k-writer-toolbar-button-active{color:var(--color-blue-300)}.k-writer-toolbar-button.k-writer-toolbar-nodes{width:auto;padding:0 .75rem}[dir=ltr] .k-writer-toolbar .k-dropdown+.k-writer-toolbar-button{border-left:1px solid var(--color-gray-700)}[dir=rtl] .k-writer-toolbar .k-dropdown+.k-writer-toolbar-button{border-right:1px solid var(--color-gray-700)}[dir=ltr] .k-writer-toolbar-button.k-writer-toolbar-nodes:after{margin-left:.5rem}[dir=rtl] .k-writer-toolbar-button.k-writer-toolbar-nodes:after{margin-right:.5rem}.k-writer-toolbar-button.k-writer-toolbar-nodes:after{content:"";border-top:4px solid var(--color-white);border-left:4px solid transparent;border-right:4px solid transparent}.k-writer-toolbar .k-dropdown-content{color:var(--color-black);background:var(--color-white);margin-top:.5rem}.k-writer-toolbar .k-dropdown-content .k-dropdown-item[aria-current]{color:var(--color-focus);font-weight:500}.k-writer{position:relative;width:100%;grid-template-areas:"content";display:grid}.k-writer .ProseMirror{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;white-space:pre-wrap;font-variant-ligatures:none;line-height:inherit;grid-area:content}.k-writer .ProseMirror:focus{outline:0}.k-writer .ProseMirror *{caret-color:currentColor}.k-writer .ProseMirror a{color:var(--color-focus);text-decoration:underline}.k-writer .ProseMirror>:last-child{margin-bottom:0}.k-writer .ProseMirror h1,.k-writer .ProseMirror h2,.k-writer .ProseMirror h3,.k-writer .ProseMirror ol,.k-writer .ProseMirror p,.k-writer .ProseMirror ul{margin-bottom:.75rem}.k-writer .ProseMirror h1{font-size:var(--text-3xl);line-height:1.25em}.k-writer .ProseMirror h2{font-size:var(--text-2xl);line-height:1.25em}.k-writer .ProseMirror h3{font-size:var(--text-xl);line-height:1.25em}.k-writer .ProseMirror h1 strong,.k-writer .ProseMirror h2 strong,.k-writer .ProseMirror h3 strong{font-weight:700}.k-writer .ProseMirror strong{font-weight:600}.k-writer .ProseMirror code{position:relative;font-size:.925em;display:inline-block;line-height:1.325;padding:.05em .325em;background:var(--color-gray-300);border-radius:var(--rounded)}[dir=ltr] .k-writer .ProseMirror ol,[dir=ltr] .k-writer .ProseMirror ul{padding-left:1.75rem}[dir=rtl] .k-writer .ProseMirror ol,[dir=rtl] .k-writer .ProseMirror ul{padding-right:1.75rem}.k-writer .ProseMirror ul>li{list-style:disc}.k-writer .ProseMirror ul ul>li{list-style:circle}.k-writer .ProseMirror ul ul ul>li{list-style:square}.k-writer .ProseMirror ol>li{list-style:decimal}.k-writer .ProseMirror li>ol,.k-writer .ProseMirror li>p,.k-writer .ProseMirror li>ul{margin:0}.k-writer-code pre{-moz-tab-size:2;-o-tab-size:2;tab-size:2;font-size:var(--text-sm);line-height:2em;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;white-space:pre}.k-writer .ProseMirror code,.k-writer-code code{font-family:var(--font-mono)}.k-writer[data-placeholder][data-empty=true]:before{grid-area:content;content:attr(data-placeholder);line-height:inherit;color:var(--color-gray-500);pointer-events:none;white-space:pre-wrap;word-wrap:break-word}.k-login-alert{padding:.5rem .75rem;display:flex;justify-content:space-between;align-items:center;min-height:38px;margin-bottom:2rem;background:var(--color-negative);color:var(--color-white);font-size:var(--text-sm);border-radius:var(--rounded-xs);box-shadow:var(--shadow-lg);cursor:pointer}.k-structure-backdrop{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;height:100vh}.k-structure-form section{position:relative;z-index:3;border-radius:var(--rounded-xs);margin-bottom:1px;box-shadow:#1111110d 0 0 0 3px;border:1px solid var(--color-border);background:var(--color-background)}.k-structure-form-fields{padding:1.5rem 1.5rem 2rem}.k-structure-form-buttons{border-top:1px solid var(--color-border);display:flex;justify-content:space-between}.k-structure-form-buttons .k-pagination{display:none}@media screen and (min-width:65em){.k-structure-form-buttons .k-pagination{display:flex}}.k-structure-form-buttons .k-pagination>.k-button,.k-structure-form-buttons .k-pagination>span{padding:.875rem 1rem!important}.k-structure-form-cancel-button,.k-structure-form-submit-button{padding:.875rem 1.5rem;line-height:1rem;display:flex}[dir=ltr] .k-toolbar,[dir=rtl] .k-toolbar{border-top-right-radius:var(--rounded);border-top-left-radius:var(--rounded)}.k-toolbar{background:var(--color-white);border-bottom:1px solid var(--color-background);height:38px}.k-toolbar-wrapper{position:absolute;top:0;left:0;right:0;max-width:100%}.k-toolbar-buttons{display:flex}.k-toolbar-divider{width:1px;background:var(--color-background)}.k-toolbar-button{width:36px;height:36px}.k-toolbar-button:hover{background:rgba(239,239,239,.5)}.k-checkbox-input{position:relative;cursor:pointer}[dir=ltr] .k-checkbox-input-label{padding-left:1.75rem}[dir=rtl] .k-checkbox-input-label{padding-right:1.75rem}.k-checkbox-input-label{display:block}[dir=ltr] .k-checkbox-input-icon{left:0}[dir=rtl] .k-checkbox-input-icon{right:0}.k-checkbox-input-icon{position:absolute;width:1rem;height:1rem;border-radius:var(--rounded);border:2px solid var(--color-gray-500)}.k-checkbox-input-icon svg{position:absolute;width:12px;height:12px;display:none}.k-checkbox-input-icon path{stroke:var(--color-white)}.k-checkbox-input-native:checked+.k-checkbox-input-icon{border-color:var(--color-gray-900);background:var(--color-gray-900)}[data-disabled=true] .k-checkbox-input-native:checked+.k-checkbox-input-icon{border-color:var(--color-gray-600);background:var(--color-gray-600)}.k-checkbox-input-native:checked+.k-checkbox-input-icon svg{display:block}.k-checkbox-input-native:focus+.k-checkbox-input-icon{border-color:var(--color-blue-600)}.k-checkbox-input-native:focus:checked+.k-checkbox-input-icon{background:var(--color-focus)}.k-text-input{width:100%;border:0;background:0 0;font:inherit;color:inherit;font-variant-numeric:tabular-nums}.k-text-input::-moz-placeholder{color:var(--color-gray-500)}.k-text-input::placeholder{color:var(--color-gray-500)}.k-text-input:focus{outline:0}.k-text-input:invalid{box-shadow:none;outline:0}.k-list-input .ProseMirror{line-height:1.5em}.k-list-input .ProseMirror ol>li::marker{font-size:var(--text-sm);color:var(--color-gray-500)}.k-multiselect-input{display:flex;flex-wrap:wrap;position:relative;font-size:var(--text-sm);min-height:2.25rem;line-height:1}.k-multiselect-input .k-sortable-ghost{background:var(--color-focus)}.k-multiselect-input .k-tag{border-radius:var(--rounded-sm)}.k-multiselect-input .k-dropdown-content,.k-multiselect-input[data-layout=list] .k-tag{width:100%}.k-multiselect-search{margin-top:0!important;color:var(--color-white);background:var(--color-gray-900);border-bottom:1px dashed rgba(255,255,255,.2)}.k-multiselect-search>.k-button-text{flex:1;opacity:1!important}.k-multiselect-search input{width:100%;color:var(--color-white);background:0 0;border:0;outline:0;padding:.25rem 0;font:inherit}.k-multiselect-options{position:relative;max-height:275px;padding:.5rem 0}.k-multiselect-option{position:relative}.k-multiselect-option.selected{color:var(--color-positive-light)}.k-multiselect-option.disabled:not(.selected) .k-icon{opacity:0}.k-multiselect-option b{color:var(--color-focus-light);font-weight:700}[dir=ltr] .k-multiselect-input[data-layout=list] .k-tag{margin-right:0!important}[dir=rtl] .k-multiselect-input[data-layout=list] .k-tag{margin-left:0!important}.k-multiselect-more{width:100%;padding:.75rem;color:#fffc;text-align:center;border-top:1px dashed rgba(255,255,255,.2)}.k-multiselect-more:hover{color:var(--color-white)}.k-number-input{width:100%;border:0;background:0 0;font:inherit;color:inherit}.k-number-input::-moz-placeholder{color:var(--color-gray-500)}.k-number-input::placeholder{color:var(--color-gray-500)}.k-number-input:focus{outline:0}.k-number-input:invalid{box-shadow:none;outline:0}[dir=ltr] .k-radio-input li{padding-left:1.75rem}[dir=rtl] .k-radio-input li{padding-right:1.75rem}.k-radio-input li{position:relative;line-height:1.5rem}.k-radio-input input{position:absolute;width:0;height:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;opacity:0}.k-radio-input label{cursor:pointer;align-items:center}[dir=ltr] .k-radio-input label:before{left:0}[dir=rtl] .k-radio-input label:before{right:0}.k-radio-input label:before{position:absolute;top:.175em;content:"";width:1rem;height:1rem;border-radius:50%;border:2px solid var(--color-gray-500);box-shadow:var(--color-white) 0 0 0 2px inset}.k-radio-input input:checked+label:before{border-color:var(--color-gray-900);background:var(--color-gray-900)}[data-disabled=true] .k-radio-input input:checked+label:before{border-color:var(--color-gray-600);background:var(--color-gray-600)}.k-radio-input input:focus+label:before{border-color:var(--color-blue-600)}.k-radio-input input:focus:checked+label:before{background:var(--color-focus)}.k-radio-input-text{display:block}.k-range-input{--range-thumb-size:16px;--range-thumb-border:4px solid var(--color-gray-900);--range-thumb-border-disabled:4px solid var(--color-gray-600);--range-thumb-background:var(--color-background);--range-thumb-focus-border:4px solid var(--color-focus);--range-thumb-focus-background:var(--color-background);--range-track-height:4px;--range-track-background:var(--color-border);--range-track-color:var(--color-gray-900);--range-track-color-disabled:var(--color-gray-600);--range-track-focus-color:var(--color-focus);display:flex;align-items:center}.k-range-input-native{--min:0;--max:100;--value:0;--range:calc(var(--max) - var(--min));--ratio:calc((var(--value) - var(--min)) / var(--range));--position:calc( .5 * var(--range-thumb-size) + var(--ratio) * calc(100% - var(--range-thumb-size)) );-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:var(--range-thumb-size);background:0 0;font-size:var(--text-sm);line-height:1}.k-range-input-native::-webkit-slider-thumb{-webkit-appearance:none;appearance:none}.k-range-input-native::-webkit-slider-runnable-track{border:0;border-radius:var(--range-track-height);width:100%;height:var(--range-track-height);background:var(--range-track-background)}.k-range-input-native::-moz-range-track{border:0;border-radius:var(--range-track-height);width:100%;height:var(--range-track-height);background:var(--range-track-background)}.k-range-input-native::-ms-track{border:0;border-radius:var(--range-track-height);width:100%;height:var(--range-track-height);background:var(--range-track-background)}.k-range-input-native::-webkit-slider-runnable-track{background:linear-gradient(var(--range-track-color),var(--range-track-color))0/var(--position) 100%no-repeat var(--range-track-background)}.k-range-input-native::-moz-range-progress{height:var(--range-track-height);background:var(--range-track-color)}.k-range-input-native::-ms-fill-lower{height:var(--range-track-height);background:var(--range-track-color)}.k-range-input-native::-webkit-slider-thumb{margin-top:calc(.5*(var(--range-track-height) - var(--range-thumb-size)));box-sizing:border-box;width:var(--range-thumb-size);height:var(--range-thumb-size);background:var(--range-thumb-background);border:var(--range-thumb-border);border-radius:50%;cursor:pointer}.k-range-input-native::-moz-range-thumb{box-sizing:border-box;width:var(--range-thumb-size);height:var(--range-thumb-size);background:var(--range-thumb-background);border:var(--range-thumb-border);border-radius:50%;cursor:pointer}.k-range-input-native::-ms-thumb{box-sizing:border-box;width:var(--range-thumb-size);height:var(--range-thumb-size);background:var(--range-thumb-background);border:var(--range-thumb-border);border-radius:50%;cursor:pointer;margin-top:0}.k-range-input-native::-ms-tooltip{display:none}.k-range-input-native:focus{outline:0}.k-range-input-native:focus::-webkit-slider-runnable-track{border:0;border-radius:var(--range-track-height);width:100%;height:var(--range-track-height);background:var(--range-track-background);background:linear-gradient(var(--range-track-focus-color),var(--range-track-focus-color))0/var(--position) 100%no-repeat var(--range-track-background)}.k-range-input-native:focus::-moz-range-progress{height:var(--range-track-height);background:var(--range-track-focus-color)}.k-range-input-native:focus::-ms-fill-lower{height:var(--range-track-height);background:var(--range-track-focus-color)}.k-range-input-native:focus::-webkit-slider-thumb{background:var(--range-thumb-focus-background);border:var(--range-thumb-focus-border)}.k-range-input-native:focus::-moz-range-thumb{background:var(--range-thumb-focus-background);border:var(--range-thumb-focus-border)}.k-range-input-native:focus::-ms-thumb{background:var(--range-thumb-focus-background);border:var(--range-thumb-focus-border)}[dir=ltr] .k-range-input-tooltip{margin-left:1rem}[dir=rtl] .k-range-input-tooltip{margin-right:1rem}.k-range-input-tooltip{position:relative;max-width:20%;display:flex;align-items:center;color:var(--color-white);font-size:var(--text-xs);line-height:1;text-align:center;border-radius:var(--rounded-xs);background:var(--color-gray-900);padding:0 .25rem;white-space:nowrap}[dir=ltr] .k-range-input-tooltip:after{left:-5px}[dir=rtl] .k-range-input-tooltip:after{right:-5px}[dir=ltr] .k-range-input-tooltip:after{border-right:5px solid var(--color-gray-900)}[dir=rtl] .k-range-input-tooltip:after{border-left:5px solid var(--color-gray-900)}.k-range-input-tooltip:after{position:absolute;top:50%;width:0;height:0;transform:translateY(-50%);border-top:5px solid transparent;border-bottom:5px solid transparent;content:""}.k-range-input-tooltip>*{padding:4px}[data-disabled=true] .k-range-input-native::-webkit-slider-runnable-track{background:linear-gradient(var(--range-track-color-disabled),var(--range-track-color-disabled))0/var(--position) 100%no-repeat var(--range-track-background)}[data-disabled=true] .k-range-input-native::-moz-range-progress{height:var(--range-track-height);background:var(--range-track-color-disabled)}[data-disabled=true] .k-range-input-native::-ms-fill-lower{height:var(--range-track-height);background:var(--range-track-color-disabled)}[data-disabled=true] .k-range-input-native::-webkit-slider-thumb{border:var(--range-thumb-border-disabled)}[data-disabled=true] .k-range-input-native::-moz-range-thumb{border:var(--range-thumb-border-disabled)}[data-disabled=true] .k-range-input-native::-ms-thumb{border:var(--range-thumb-border-disabled)}[data-disabled=true] .k-range-input-tooltip{background:var(--color-gray-600)}[dir=ltr] [data-disabled=true] .k-range-input-tooltip:after{border-right:5px solid var(--color-gray-600)}[dir=rtl] [data-disabled=true] .k-range-input-tooltip:after{border-left:5px solid var(--color-gray-600)}.k-select-input{position:relative;display:block;cursor:pointer;overflow:hidden}.k-select-input-native{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;width:100%;font:inherit;z-index:1;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-weight:var(--font-normal)}.k-select-input-native[disabled]{cursor:default}.k-tags-input{display:flex;flex-wrap:wrap}.k-tags-input .k-tag{border-radius:var(--rounded-sm)}.k-tags-input .k-sortable-ghost{background:var(--color-focus)}.k-tags-input-element{flex-grow:1;flex-basis:0;min-width:0}.k-tags-input:focus-within .k-tags-input-element{flex-basis:4rem}.k-tags-input-element input{font:inherit;border:0;width:100%;background:0 0}.k-tags-input-element input:focus{outline:0}[dir=ltr] .k-tags-input[data-layout=list] .k-tag{margin-right:0!important}[dir=rtl] .k-tags-input[data-layout=list] .k-tag{margin-left:0!important}.k-tags-input[data-layout=list] .k-tag{width:100%}.k-textarea-input[data-size=small]{--size:7.5rem}.k-textarea-input[data-size=medium]{--size:15rem}.k-textarea-input[data-size=large]{--size:30rem}.k-textarea-input[data-size=huge]{--size:45rem}.k-textarea-input-wrapper{position:relative}.k-textarea-input-native{resize:none;border:0;width:100%;background:0 0;font:inherit;line-height:1.5em;color:inherit;min-height:var(--size)}.k-textarea-input-native::-moz-placeholder{color:var(--color-gray-500)}.k-textarea-input-native::placeholder{color:var(--color-gray-500)}.k-textarea-input-native:focus{outline:0}.k-textarea-input-native:invalid{box-shadow:none;outline:0}.k-textarea-input-native[data-font=monospace]{font-family:var(--font-mono)}.k-toolbar{margin-bottom:.25rem;color:#aaa}.k-textarea-input:focus-within .k-toolbar{position:sticky;top:0;left:0;right:0;z-index:1;box-shadow:#0000000d 0 2px 5px;border-bottom:1px solid rgba(0,0,0,.1);color:#000}.k-toggle-input{--toggle-background:var(--color-white);--toggle-color:var(--color-gray-500);--toggle-active-color:var(--color-gray-900);--toggle-focus-color:var(--color-focus);--toggle-height:16px;display:flex;align-items:center}.k-toggle-input-native{position:relative;height:var(--toggle-height);width:calc(var(--toggle-height)*2);border-radius:var(--toggle-height);border:2px solid var(--toggle-color);box-shadow:inset 0 0 0 2px var(--toggle-background),inset calc(var(--toggle-height)*-1) 0 0 2px var(--toggle-background);background-color:var(--toggle-color);outline:0;transition:all ease-in-out .1s;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;flex-shrink:0}.k-toggle-input-native:checked{border-color:var(--toggle-active-color);box-shadow:inset 0 0 0 2px var(--toggle-background),inset var(--toggle-height) 0 0 2px var(--toggle-background);background-color:var(--toggle-active-color)}.k-toggle-input-native[disabled]{border-color:var(--color-border);box-shadow:inset 0 0 0 2px var(--color-background),inset calc(var(--toggle-height)*-1) 0 0 2px var(--color-background);background-color:var(--color-border)}.k-toggle-input-native[disabled]:checked{box-shadow:inset 0 0 0 2px var(--color-background),inset var(--toggle-height) 0 0 2px var(--color-background)}.k-toggle-input-native:focus:checked{border:2px solid var(--color-focus);background-color:var(--toggle-focus-color)}.k-toggle-input-native::-ms-check{opacity:0}.k-toggle-input-label{cursor:pointer;flex-grow:1}.k-input[data-type=toggles]{display:inline-flex}.k-input[data-type=toggles].grow{display:flex}.k-toggles-input{display:grid;grid-template-columns:repeat(var(--options),minmax(0,1fr));gap:1px;border-radius:var(--rounded);line-height:1;background:var(--color-border);overflow:hidden}.k-toggles-input li{height:var(--field-input-height);background:var(--color-white)}.k-toggles-input label{align-items:center;background:var(--color-white);cursor:pointer;display:flex;font-size:var(--text-sm);justify-content:center;line-height:1.25;padding:0 var(--spacing-3);height:100%}[dir=ltr] .k-toggles-input .k-icon+.k-toggles-text{margin-left:var(--spacing-2)}[dir=rtl] .k-toggles-input .k-icon+.k-toggles-text{margin-right:var(--spacing-2)}.k-toggles-input input:focus:not(:checked)+label{background:var(--color-gray-200)}.k-toggles-input input:checked+label{background:var(--color-black);color:var(--color-white)}.k-blocks-field{position:relative}.k-date-field-body{display:flex;flex-wrap:wrap;line-height:1;border:var(--field-input-border);background:var(--color-gray-300);gap:1px;border-radius:var(--rounded);--multiplier:calc(25rem - 100%)}.k-date-field-body:focus-within{border:var(--field-input-focus-border);box-shadow:var(--color-focus-outline) 0 0 0 2px}.k-date-field[data-disabled] .k-date-field-body{background:0 0}.k-date-field-body>.k-input[data-theme=field]{border:0;box-shadow:none;border-radius:var(--rounded)}.k-date-field-body>.k-input[data-invalid=true],.k-date-field-body>.k-input[data-invalid=true]:focus-within{border:0!important;box-shadow:none!important}.k-date-field-body>*{flex-grow:1;flex-basis:calc(var(--multiplier)*999);max-width:100%}.k-date-field-body .k-input[data-type=date]{min-width:60%}.k-date-field-body .k-input[data-type=time]{min-width:30%}.k-files-field[data-disabled=true] .k-item *{pointer-events:all!important}body{counter-reset:headline-counter}.k-headline-field{position:relative;padding-top:1.5rem}.k-fieldset>.k-grid .k-column:first-child .k-headline-field{padding-top:0}[dir=ltr] .k-headline-field .k-headline[data-numbered]:before{padding-right:.25rem}[dir=rtl] .k-headline-field .k-headline[data-numbered]:before{padding-left:.25rem}.k-headline-field .k-headline[data-numbered]:before{counter-increment:headline-counter;content:counter(headline-counter,decimal-leading-zero);color:var(--color-focus);font-weight:400}.k-info-field .k-headline{padding-bottom:.75rem;line-height:1.25rem}.k-layout-column{position:relative;height:100%;display:flex;flex-direction:column;background:var(--color-white);min-height:6rem}.k-layout-column:focus{outline:0}.k-layout-column .k-blocks{background:0 0;box-shadow:none;padding:0;height:100%;background:var(--color-white);min-height:4rem}.k-layout-column .k-blocks[data-empty=true]{min-height:6rem}.k-layout-column .k-blocks-list{display:flex;flex-direction:column;height:100%}.k-layout-column .k-blocks .k-block-container:last-of-type{flex-grow:1}.k-layout-column .k-blocks-empty{position:absolute;top:0;right:0;bottom:0;left:0;justify-content:center;opacity:0;transition:opacity .3s;border:0}.k-layout-column .k-blocks-empty:hover{opacity:1}[dir=ltr] .k-layout-column .k-blocks-empty.k-empty .k-icon{border-right:0}[dir=rtl] .k-layout-column .k-blocks-empty.k-empty .k-icon{border-left:0}.k-layout-column .k-blocks-empty.k-empty .k-icon{width:1rem}[dir=ltr] .k-layout{padding-right:var(--layout-toolbar-width)}[dir=rtl] .k-layout{padding-left:var(--layout-toolbar-width)}.k-layout{--layout-border-color:var(--color-gray-300);--layout-toolbar-width:2rem;position:relative;background:#fff;box-shadow:var(--shadow)}[dir=ltr] [data-disabled=true] .k-layout{padding-right:0}[dir=rtl] [data-disabled=true] .k-layout{padding-left:0}.k-layout:not(:last-of-type){margin-bottom:1px}.k-layout:focus{outline:0}[dir=ltr] .k-layout-toolbar{right:0}[dir=rtl] .k-layout-toolbar{left:0}[dir=ltr] .k-layout-toolbar{border-left:1px solid var(--color-light)}[dir=rtl] .k-layout-toolbar{border-right:1px solid var(--color-light)}.k-layout-toolbar{position:absolute;top:0;bottom:0;width:var(--layout-toolbar-width);display:flex;flex-direction:column;font-size:var(--text-sm);background:var(--color-gray-100);color:var(--color-gray-500)}.k-layout-toolbar:hover{color:var(--color-black)}.k-layout-toolbar-button{width:var(--layout-toolbar-width);height:var(--layout-toolbar-width)}.k-layout-toolbar .k-sort-handle{margin-top:auto;color:currentColor}.k-layout-columns.k-grid{grid-gap:1px;background:var(--layout-border-color);background:var(--color-gray-300)}.k-layout:not(:first-child) .k-layout-columns.k-grid{border-top:0}.k-layouts .k-sortable-ghost{position:relative;box-shadow:#11111140 0 5px 10px;outline:2px solid var(--color-focus);cursor:grabbing;cursor:-webkit-grabbing;z-index:1}.k-layout-selector.k-dialog{background:#313740;color:var(--color-white)}.k-layout-selector .k-headline{line-height:1;margin-top:-.25rem;margin-bottom:1.5rem}.k-layout-selector ul{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:1.5rem}.k-layout-selector-option .k-grid{height:5rem;grid-gap:2px;box-shadow:var(--shadow);cursor:pointer}.k-layout-selector-option:hover{outline:2px solid var(--color-green-300);outline-offset:2px}.k-layout-selector-option:last-child{margin-bottom:0}.k-layout-selector-option .k-column{display:flex;background:rgba(255,255,255,.2);justify-content:center;font-size:var(--text-xs);align-items:center}.k-line-field{position:relative;border:0;height:3rem;width:auto}.k-line-field:after{position:absolute;content:"";top:50%;margin-top:-1px;left:0;right:0;height:1px;background:var(--color-border)}.k-list-field .k-list-input{padding:.375rem .5rem .375rem .75rem}.k-table.k-object-field-table{table-layout:auto}.k-table.k-object-field-table tbody td,.k-table.k-object-field-table tbody th,.k-table.k-object-field-table tbody th button{cursor:pointer;overflow:hidden;text-overflow:ellipsis}.k-table.k-object-field-table tbody td{max-width:0}.k-pages-field[data-disabled=true] .k-item *{pointer-events:all!important}.k-structure-field:not([data-disabled=true]) td.k-table-column{cursor:pointer}.k-field-counter{display:none}.k-text-field:focus-within .k-field-counter{display:block}.k-users-field[data-disabled=true] .k-item *{pointer-events:all!important}.k-writer-field-input{line-height:1.5em;padding:.375rem .5rem}.k-aspect-ratio{position:relative;display:block;overflow:hidden;padding-bottom:100%}.k-aspect-ratio>*{position:absolute!important;top:0;right:0;bottom:0;left:0;height:100%;width:100%;-o-object-fit:contain;object-fit:contain}.k-aspect-ratio[data-cover=true]>*{-o-object-fit:cover;object-fit:cover}.k-bar{display:flex;align-items:center;justify-content:space-between;line-height:1}.k-bar-slot{flex-grow:1}.k-bar-slot[data-position=center]{text-align:center}[dir=ltr] .k-bar-slot[data-position=right]{text-align:right}[dir=rtl] .k-bar-slot[data-position=right]{text-align:left}.k-box{word-wrap:break-word;font-size:var(--text-sm)}.k-box:not([data-theme=none]){background:var(--color-white);border-radius:var(--rounded);line-height:1.25rem;padding:.5rem .75rem}.k-box[data-theme=code]{background:var(--color-gray-900);border:1px solid var(--color-black);color:var(--color-light);font-family:Input,Menlo,monospace;font-size:var(--text-sm);line-height:1.5}.k-box[data-theme=button]{padding:0}[dir=ltr] .k-box[data-theme=button] .k-button{text-align:left}[dir=rtl] .k-box[data-theme=button] .k-button{text-align:right}.k-box[data-theme=button] .k-button{padding:0 .75rem;height:2.25rem;width:100%;display:flex;align-items:center;line-height:2rem}[dir=ltr] .k-box[data-theme=info],[dir=ltr] .k-box[data-theme=negative],[dir=ltr] .k-box[data-theme=notice],[dir=ltr] .k-box[data-theme=positive]{border-left-color:var(--theme-light)}[dir=rtl] .k-box[data-theme=info],[dir=rtl] .k-box[data-theme=negative],[dir=rtl] .k-box[data-theme=notice],[dir=rtl] .k-box[data-theme=positive]{border-right-color:var(--theme-light)}.k-box[data-theme=info],.k-box[data-theme=negative],.k-box[data-theme=notice],.k-box[data-theme=positive]{border:0;background:var(--theme-bg)}[dir=ltr] .k-box[data-theme=empty]{border-left:0}[dir=rtl] .k-box[data-theme=empty]{border-right:0}.k-box[data-theme=empty]{text-align:center;padding:3rem 1.5rem;display:flex;justify-content:center;align-items:center;flex-direction:column;background:var(--color-background);border:1px dashed var(--color-border)}.k-box[data-theme=empty] .k-icon{margin-bottom:.5rem;color:var(--color-gray-500)}.k-box[data-theme=empty],.k-box[data-theme=empty] p{color:var(--color-gray-600)}.k-bubble{display:flex;padding:0 .5rem;white-space:nowrap;align-items:center;line-height:1.5;font-size:var(--text-xs);height:1.525rem;background:var(--color-light);color:var(--color-black);border-radius:var(--rounded);overflow:hidden}[dir=ltr] .k-bubble .k-item-figure{margin-left:-.5rem}[dir=rtl] .k-bubble .k-item-figure{margin-right:-.5rem}[dir=ltr] .k-bubble .k-item-figure{margin-right:var(--spacing-2)}[dir=rtl] .k-bubble .k-item-figure{margin-left:var(--spacing-2)}.k-bubble .k-item-figure{width:1.525rem;height:1.525rem}.k-bubbles{display:flex;gap:.25rem}.k-collection-help{padding:.5rem .75rem}.k-collection-footer{display:flex;justify-content:space-between;margin-left:-.75rem;margin-right:-.75rem}.k-collection-pagination{line-height:1.25rem;flex-shrink:0;min-height:2.75rem}.k-collection-pagination .k-pagination .k-button{padding:.5rem .75rem;line-height:1.125rem}.k-column{min-width:0;grid-column-start:span 12}.k-column[data-sticky=true]>div{position:sticky;top:4vh;z-index:2}@media screen and (min-width:65em){.k-column[data-width="1/1"],.k-column[data-width="12/12"],.k-column[data-width="2/2"],.k-column[data-width="3/3"],.k-column[data-width="4/4"],.k-column[data-width="6/6"]{grid-column-start:span 12}.k-column[data-width="11/12"]{grid-column-start:span 11}.k-column[data-width="10/12"],.k-column[data-width="5/6"]{grid-column-start:span 10}.k-column[data-width="3/4"],.k-column[data-width="9/12"]{grid-column-start:span 9}.k-column[data-width="2/3"],.k-column[data-width="4/6"],.k-column[data-width="8/12"]{grid-column-start:span 8}.k-column[data-width="7/12"]{grid-column-start:span 7}.k-column[data-width="1/2"],.k-column[data-width="2/4"],.k-column[data-width="3/6"],.k-column[data-width="6/12"]{grid-column-start:span 6}.k-column[data-width="5/12"]{grid-column-start:span 5}.k-column[data-width="1/3"],.k-column[data-width="2/6"],.k-column[data-width="4/12"]{grid-column-start:span 4}.k-column[data-width="1/4"],.k-column[data-width="3/12"]{grid-column-start:span 3}.k-column[data-width="1/6"],.k-column[data-width="2/12"]{grid-column-start:span 2}.k-column[data-width="1/12"]{grid-column-start:span 1}}.k-column[data-disabled=true]{cursor:not-allowed;opacity:.4}.k-column[data-disabled=true] *{pointer-events:none}.k-column[data-disabled=true] .k-text[data-theme=help] *{pointer-events:initial}.k-dropzone{position:relative}.k-dropzone:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;display:none;pointer-events:none;z-index:1}.k-dropzone[data-over=true]:after{display:block;outline:1px solid var(--color-focus);box-shadow:var(--color-focus-outline) 0 0 0 3px}.k-empty{display:flex;align-items:stretch;border-radius:var(--rounded);color:var(--color-gray-600);border:1px dashed var(--color-border)}button.k-empty{width:100%}button.k-empty:focus{outline:0}.k-empty p{font-size:var(--text-sm);color:var(--color-gray-600)}.k-empty>.k-icon{color:var(--color-gray-500)}.k-empty[data-layout=cardlets],.k-empty[data-layout=cards]{text-align:center;padding:1.5rem;justify-content:center;flex-direction:column}.k-empty[data-layout=cardlets] .k-icon,.k-empty[data-layout=cards] .k-icon{margin-bottom:1rem}.k-empty[data-layout=cardlets] .k-icon svg,.k-empty[data-layout=cards] .k-icon svg{width:2rem;height:2rem}.k-empty[data-layout=list],.k-empty[data-layout=table]{min-height:38px}[dir=ltr] .k-empty[data-layout=list]>.k-icon,[dir=ltr] .k-empty[data-layout=table]>.k-icon{border-right:1px solid rgba(0,0,0,.05)}[dir=rtl] .k-empty[data-layout=list]>.k-icon,[dir=rtl] .k-empty[data-layout=table]>.k-icon{border-left:1px solid rgba(0,0,0,.05)}.k-empty[data-layout=list]>.k-icon,.k-empty[data-layout=table]>.k-icon{width:36px;min-height:36px}.k-empty[data-layout=list]>p,.k-empty[data-layout=table]>p{line-height:1.25rem;padding:.5rem .75rem}.k-file-preview{background:var(--color-gray-800)}.k-file-preview-layout{display:grid;grid-template-columns:50%auto}.k-file-preview-layout>*{min-width:0}.k-file-preview-image{position:relative;display:flex;align-items:center;justify-content:center;background:var(--bg-pattern)}.k-file-preview-image-link{display:block;width:100%;padding:min(4vw,3rem);outline:0}.k-file-preview-image-link[data-tabbed=true]{box-shadow:none;outline:2px solid var(--color-focus);outline-offset:-2px}.k-file-preview-details{padding:1.5rem;flex-grow:1}.k-file-preview-details ul{line-height:1.5em;max-width:50rem;display:grid;grid-gap:1.5rem 3rem;grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}.k-file-preview-details h3{font-size:var(--text-sm);font-weight:500;color:var(--color-gray-500)}.k-file-preview-details a,.k-file-preview-details p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#ffffffbf;font-size:var(--text-sm)}@media screen and (min-width:30em){.k-file-preview-details ul{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}}@media screen and (max-width:65em){.k-file-preview-layout{padding:0!important}}@media screen and (min-width:65em){.k-file-preview-layout{grid-template-columns:33.333%auto;align-items:center}.k-file-preview-details{padding:3rem}}@media screen and (min-width:90em){.k-file-preview-layout{grid-template-columns:25%auto}}.k-grid{--columns:12;display:grid;grid-column-gap:0;grid-row-gap:0;grid-template-columns:1fr}@media screen and (min-width:30em){.k-grid[data-gutter=small]{grid-column-gap:1rem;grid-row-gap:1rem}.k-grid[data-gutter=huge],.k-grid[data-gutter=large],.k-grid[data-gutter=medium]{grid-column-gap:1.5rem;grid-row-gap:1.5rem}}@media screen and (min-width:65em){.k-grid{grid-template-columns:repeat(var(--columns),1fr)}.k-grid[data-gutter=large]{grid-column-gap:3rem}.k-grid[data-gutter=huge]{grid-column-gap:4.5rem}}@media screen and (min-width:90em){.k-grid[data-gutter=large]{grid-column-gap:4.5rem}.k-grid[data-gutter=huge]{grid-column-gap:6rem}}@media screen and (min-width:120em){.k-grid[data-gutter=large]{grid-column-gap:6rem}.k-grid[data-gutter=huge]{grid-column-gap:7.5rem}}.k-header{padding-top:4vh;margin-bottom:2rem;border-bottom:1px solid var(--color-border)}.k-header[data-tabs=true]{border-bottom:0}.k-header .k-headline{min-height:1.25em;margin-bottom:.5rem;word-wrap:break-word}.k-header .k-header-buttons{margin-top:-.5rem;height:3.25rem}.k-header .k-headline-editable{cursor:pointer}[dir=ltr] .k-header .k-headline-editable .k-icon{margin-left:.5rem}[dir=rtl] .k-header .k-headline-editable .k-icon{margin-right:.5rem}.k-header .k-headline-editable .k-icon{color:var(--color-gray-500);opacity:0;transition:opacity .3s;display:inline-block}.k-header .k-headline-editable:hover .k-icon{opacity:1}.k-panel-inside{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column}.k-panel-inside:focus{outline:0}.k-panel-header{z-index:var(--z-navigation);flex-shrink:0}.k-panel-view{flex-grow:1;padding-bottom:6rem}.k-item{position:relative;background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);display:grid;grid-template-columns:auto;line-height:1}.k-item a:focus,.k-item:focus{outline:0}.k-item.k-sortable-ghost,.k-item:focus-within{box-shadow:var(--shadow-outline)}.k-item-sort-handle.k-sort-handle{position:absolute;opacity:0;width:1.25rem;height:1.5rem;z-index:2;border-radius:1px}.k-item:hover .k-item-sort-handle{opacity:1}.k-item-figure{grid-area:figure}.k-item-content{grid-area:content;overflow:hidden}.k-item-info,.k-item-title{font-size:var(--text-sm);font-weight:400;text-overflow:ellipsis;white-space:nowrap;line-height:1.125rem;overflow:hidden}.k-item-info{grid-area:info;color:var(--color-gray-500)}.k-item-title-link.k-link[data-=true]{box-shadow:none}.k-item-title-link:after{position:absolute;content:"";top:0;right:0;bottom:0;left:0;z-index:1}.k-item-footer{grid-area:footer;display:flex;justify-content:space-between;align-items:center;min-width:0}[dir=ltr] .k-item-label{margin-right:.5rem}[dir=rtl] .k-item-label{margin-left:.5rem}.k-item-buttons{position:relative;display:flex;justify-content:flex-end;flex-shrink:0;flex-grow:1}.k-item-buttons>.k-button,.k-item-buttons>.k-dropdown{position:relative;width:38px;height:38px;display:flex!important;align-items:center;justify-content:center;line-height:1}.k-item-buttons>.k-button{z-index:1}.k-item-buttons>.k-options-dropdown>.k-options-dropdown-toggle{z-index:var(--z-toolbar)}.k-list-item{display:flex;align-items:center;height:38px}[dir=ltr] .k-list-item .k-item-sort-handle{left:-1.5rem}[dir=rtl] .k-list-item .k-item-sort-handle{right:-1.5rem}.k-list-item .k-item-sort-handle{width:1.5rem}[dir=ltr] .k-list-item .k-item-figure{border-top-left-radius:var(--rounded)}[dir=rtl] .k-list-item .k-item-figure{border-top-right-radius:var(--rounded)}[dir=ltr] .k-list-item .k-item-figure{border-bottom-left-radius:var(--rounded)}[dir=rtl] .k-list-item .k-item-figure{border-bottom-right-radius:var(--rounded)}.k-list-item .k-item-figure{width:38px}[dir=ltr] .k-list-item .k-item-content{margin-left:.75rem}[dir=rtl] .k-list-item .k-item-content{margin-right:.75rem}.k-list-item .k-item-content{display:flex;flex-grow:1;flex-shrink:2;justify-content:space-between;align-items:center}.k-list-item .k-item-info,.k-list-item .k-item-title{flex-grow:1;line-height:1.5rem}[dir=ltr] .k-list-item .k-item-title{margin-right:.5rem}[dir=rtl] .k-list-item .k-item-title{margin-left:.5rem}.k-list-item .k-item-title{flex-shrink:1}[dir=ltr] .k-list-item .k-item-info{text-align:right}[dir=rtl] .k-list-item .k-item-info{text-align:left}[dir=ltr] .k-list-item .k-item-info{margin-right:.5rem}[dir=rtl] .k-list-item .k-item-info{margin-left:.5rem}.k-list-item .k-item-info{flex-shrink:2;justify-self:end}.k-list-item .k-item-buttons,.k-list-item .k-item-footer{flex-shrink:0}.k-item:not(.k-list-item) .k-item-sort-handle{margin:var(--spacing-2);background:var(--color-background);box-shadow:var(--shadow-lg);border-radius:var(--rounded-sm)}[dir=ltr] .k-item:not(.k-list-item) .k-item-label{margin-left:-2px}[dir=rtl] .k-item:not(.k-list-item) .k-item-label{margin-right:-2px}.k-item:not(.k-list-item) .k-item-content{padding:.625rem .75rem}.k-cardlets-item{height:6rem;grid-template-rows:auto 38px;grid-template-areas:"content""footer"}.k-cardlets-item[data-has-figure=true]{grid-template-columns:6rem auto;grid-template-areas:"figure content""figure footer"}[dir=ltr] .k-cardlets-item .k-item-figure{border-top-left-radius:var(--rounded)}[dir=rtl] .k-cardlets-item .k-item-figure{border-top-right-radius:var(--rounded)}[dir=ltr] .k-cardlets-item .k-item-figure{border-bottom-left-radius:var(--rounded)}[dir=rtl] .k-cardlets-item .k-item-figure{border-bottom-right-radius:var(--rounded)}.k-cardlets-item .k-item-footer{padding-top:.5rem;padding-bottom:.5rem}.k-cards-item{grid-template-columns:auto;grid-template-rows:auto 1fr;grid-template-areas:"figure""content";--item-content-wrapper:0}[dir=ltr] .k-cards-item .k-item-figure,[dir=rtl] .k-cards-item .k-item-figure{border-top-right-radius:var(--rounded);border-top-left-radius:var(--rounded)}.k-cards-item .k-item-content{padding:.5rem .75rem!important;overflow:hidden}.k-cards-item .k-item-info,.k-cards-item .k-item-title{line-height:1.375rem;white-space:normal}.k-cards-item .k-item-info:after,.k-cards-item .k-item-title:after{display:inline-block;content:"\a0";width:var(--item-content-wrapper)}.k-cards-item[data-has-flag=true],.k-cards-item[data-has-options=true]{--item-content-wrapper:38px}.k-cards-item[data-has-flag=true][data-has-options=true]{--item-content-wrapper:76px}.k-cards-item[data-has-info=true] .k-item-title:after{display:none}[dir=ltr] .k-cards-item .k-item-footer{right:0}[dir=rtl] .k-cards-item .k-item-footer{left:0}.k-cards-item .k-item-footer{position:absolute;bottom:0;width:auto}.k-item-figure{overflow:hidden;flex-shrink:0}.k-cards-items{--min:13rem;--max:1fr;--gap:1.5rem;--column-gap:var(--gap);--row-gap:var(--gap);display:grid;grid-column-gap:var(--column-gap);grid-row-gap:var(--row-gap);grid-template-columns:repeat(auto-fill,minmax(var(--min),var(--max)))}@media screen and (min-width:30em){.k-cards-items[data-size=tiny]{--min:10rem}.k-cards-items[data-size=small]{--min:16rem}.k-cards-items[data-size=medium]{--min:24rem}.k-cards-items[data-size=huge],.k-cards-items[data-size=large],.k-column[data-width="1/4"] .k-cards-items,.k-column[data-width="1/5"] .k-cards-items,.k-column[data-width="1/6"] .k-cards-items{--min:1fr}}@media screen and (min-width:65em){.k-cards-items[data-size=large]{--min:32rem}}.k-cardlets-items{display:grid;grid-template-columns:repeat(auto-fill,minmax(16rem,1fr));grid-gap:.5rem}.k-list-items .k-list-item:not(:last-child){margin-bottom:2px}.k-overlay{position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:var(--z-dialog);transform:translateZ(0)}.k-overlay[data-centered=true]{display:flex;align-items:center;justify-content:center}.k-overlay[data-dimmed=true]{background:var(--color-backdrop)}.k-overlay-loader{color:var(--color-white)}.k-panel[data-loading=true]{animation:LoadingCursor .5s}.k-panel[data-dragging=true],.k-panel[data-loading=true]:after{-webkit-user-select:none;-moz-user-select:none;user-select:none}.k-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(14rem,1fr));grid-auto-rows:1fr;grid-gap:var(--spacing-2px)}.k-stat{display:flex;flex-direction:column;background:var(--color-white);box-shadow:var(--shadow);padding:var(--spacing-3) var(--spacing-6);line-height:var(--leading-normal);border-radius:var(--rounded)}.k-stat.k-link:hover{cursor:pointer;background:var(--color-gray-100)}.k-stat dd,.k-stat dt{display:block}.k-stat-value{font-size:var(--value);margin-bottom:var(--spacing-1);order:1}.k-stat-info,.k-stat-label{font-size:var(--text-xs)}.k-stat-label{order:2}.k-stat-info{order:3;color:var(--theme, var(--color-gray-500))}.k-stats[data-size=small]{--value:var(--text-base)}.k-stats[data-size=medium]{--value:var(--text-xl)}.k-stats[data-size=large]{--value:var(--text-2xl)}.k-stats[data-size=huge]{--value:var(--text-3xl)}.k-table{--table-row-height:38px;position:relative;table-layout:fixed;background:var(--color-white);font-size:var(--text-sm);border-spacing:0;box-shadow:var(--shadow);border-radius:var(--rounded);font-variant-numeric:tabular-nums}.k-table[data-invalid]{border:0;box-shadow:var(--color-negative-outline) 0 0 0 1px,var(--color-negative-outline) 0 0 3px 2px}.k-table td,.k-table th{height:var(--table-row-height);overflow:hidden;text-overflow:ellipsis;line-height:1.25em}.k-table,.k-table td{width:100%}[dir=ltr] .k-table tbody tr:first-child th,[dir=ltr] .k-table thead th:first-child{border-top-left-radius:var(--rounded)}[dir=rtl] .k-table tbody tr:first-child th,[dir=rtl] .k-table thead th:first-child{border-top-right-radius:var(--rounded)}[dir=ltr] .k-table thead th:last-child{border-top-right-radius:var(--rounded)}[dir=rtl] .k-table thead th:last-child{border-top-left-radius:var(--rounded)}[dir=ltr] .k-table td:last-child,[dir=ltr] .k-table th:last-child{border-right:0}[dir=rtl] .k-table td:last-child,[dir=rtl] .k-table th:last-child{border-left:0}.k-table td:last-child,.k-table th:last-child{height:var(--table-row-height)}.k-table th,.k-table tr:not(:last-child) td{border-bottom:1px solid var(--color-background)}.k-table td:last-child{overflow:visible}[dir=ltr] .k-table td,[dir=ltr] .k-table th{border-right:1px solid var(--color-background)}[dir=rtl] .k-table td,[dir=rtl] .k-table th{border-left:1px solid var(--color-background)}[dir=ltr] .k-table td,[dir=ltr] .k-table th,[dir=ltr] .k-table th button{text-align:left}[dir=rtl] .k-table td,[dir=rtl] .k-table th,[dir=rtl] .k-table th button{text-align:right}.k-table th{padding:0 .75rem;font-family:var(--font-mono);font-size:var(--text-xs);font-weight:400;color:var(--color-gray-600);background:var(--color-gray-100);width:100%}.k-table th button{font:inherit;display:block;padding:0 .75rem;height:100%;width:100%;border-radius:var(--rounded)}.k-table th button:focus-visible{outline:2px solid var(--color-black);outline-offset:-2px}.k-table tbody tr:hover td{background:rgba(239,239,239,.25)}.k-table thead th{position:sticky;top:0;left:0;right:0;z-index:1}.k-table tbody th{width:auto;white-space:nowrap;padding:0;overflow:visible;border-radius:0}[dir=ltr] .k-table tbody tr:last-child th{border-bottom-left-radius:var(--rounded)}[dir=rtl] .k-table tbody tr:last-child th{border-bottom-right-radius:var(--rounded)}.k-table tbody tr:last-child th{border-bottom:0}.k-table-column[data-align]{text-align:var(--align)!important}.k-table-column[data-align=right]>.k-input{flex-direction:column;align-items:flex-end}.k-table .k-sort-handle,.k-table-index{display:grid;place-items:center;width:100%;height:var(--table-row-height)}.k-table .k-sort-handle,.k-table tr:hover .k-table-index-column[data-sortable=true] .k-table-index{display:none}.k-table tr:hover .k-sort-handle{display:grid!important}.k-table-row-ghost{background:var(--color-white);box-shadow:var(--shadow-outline);outline:2px solid var(--color-black);border-radius:var(--rounded);margin-bottom:2px;cursor:grabbing;cursor:-webkit-grabbing}.k-table-row-fallback{opacity:0!important}td.k-table-index-column,td.k-table-options-column,th.k-table-index-column,th.k-table-options-column{width:var(--table-row-height);text-align:center!important}.k-table-index{font-size:var(--text-xs);color:var(--color-gray-500);line-height:1.1em}.k-table-empty{color:var(--color-gray-600);font-size:var(--text-sm)}[data-disabled=true] .k-table{background:var(--color-gray-100)}[data-disabled=true] .k-table tbody td,[data-disabled=true] .k-table th{border-color:var(--color-gray-200)}[data-disabled=true] .k-table td:last-child{overflow:hidden;text-overflow:ellipsis}@media screen and (max-width:65em){.k-table td:not([data-mobile]),.k-table th:not([data-mobile]){display:none}}.k-table-update-status-cell{padding:0 .75rem;display:flex;align-items:center;height:100%}.k-table-update-status-cell-button,.k-table-update-status-cell-version{font-variant-numeric:tabular-nums}.k-table-update-status-cell-button{display:inline-flex;padding:.25rem 1.5rem .25rem .325rem;border-radius:var(--rounded);line-height:1;align-items:center;background:var(--color-gray-200)}.k-table-update-status-cell-button .k-button-text:after{position:absolute;top:50%;right:.5rem;margin-top:-2px;content:"";border-top:4px solid #000;border-left:4px solid transparent;border-right:4px solid transparent}.k-table-update-status-cell-button .k-icon{color:var(--theme)}.k-plugin-info{padding:1rem}.k-plugin-info div+div{margin-top:.5rem}.k-plugin-info dt{color:var(--color-gray-400);margin-right:.5rem}.k-plugin-info dd[data-theme]{color:var(--theme-light)}.k-plugin-info+.k-dropdown-item{padding-top:.75rem;border-top:1px solid var(--color-gray-700)}@media screen and (min-width:30em){.k-plugin-info{width:20rem}.k-plugin-info div{display:flex}}.k-tabs{position:relative;background:#e9e9e9;border:1px solid var(--color-border);border-radius:var(--rounded)}.k-tabs nav{display:flex;justify-content:center;margin-left:-1px;margin-right:-1px}[dir=ltr] .k-tab-button.k-button{border-left:1px solid transparent}[dir=rtl] .k-tab-button.k-button{border-right:1px solid transparent}[dir=ltr] .k-tab-button.k-button{border-right:1px solid var(--color-border)}[dir=rtl] .k-tab-button.k-button{border-left:1px solid var(--color-border)}.k-tab-button.k-button{position:relative;z-index:1;display:inline-flex;justify-content:center;align-items:center;padding:.625rem .75rem;font-size:var(--text-xs);text-transform:uppercase;text-align:center;font-weight:500;flex-grow:1;flex-shrink:1;flex-direction:column;max-width:15rem}@media screen and (min-width:30em){.k-tab-button.k-button{flex-direction:row}[dir=ltr] .k-tab-button.k-button .k-icon{margin-right:.5rem}[dir=rtl] .k-tab-button.k-button .k-icon{margin-left:.5rem}}[dir=ltr] .k-tab-button.k-button>.k-button-text{padding-left:0}[dir=rtl] .k-tab-button.k-button>.k-button-text{padding-right:0}.k-tab-button.k-button>.k-button-text{padding-top:.375rem;font-size:10px;overflow:hidden;max-width:10rem;text-overflow:ellipsis;opacity:1}@media screen and (min-width:30em){.k-tab-button.k-button>.k-button-text{font-size:var(--text-xs);padding-top:0}}[dir=ltr] .k-tab-button:last-child{border-right:1px solid transparent}[dir=rtl] .k-tab-button:last-child{border-left:1px solid transparent}[dir=ltr] .k-tab-button[aria-current]{border-right:1px solid var(--color-border)}[dir=rtl] .k-tab-button[aria-current]{border-left:1px solid var(--color-border)}.k-tab-button[aria-current]{position:relative;background:var(--color-background);pointer-events:none}[dir=ltr] .k-tab-button[aria-current]:first-child{border-left:1px solid var(--color-border)}[dir=rtl] .k-tab-button[aria-current]:first-child{border-right:1px solid var(--color-border)}.k-tab-button[aria-current]:after,.k-tab-button[aria-current]:before{position:absolute;content:""}.k-tab-button[aria-current]:before{left:-1px;right:-1px;top:-1px;height:2px;background:var(--color-black)}.k-tab-button[aria-current]:after{left:0;right:0;bottom:-1px;height:1px;background:var(--color-background)}[dir=ltr] .k-tabs-dropdown{right:0}[dir=rtl] .k-tabs-dropdown{left:0}.k-tabs-dropdown{top:100%}[dir=ltr] .k-tabs-badge{right:2px}[dir=rtl] .k-tabs-badge{left:2px}.k-tabs-badge{position:absolute;top:3px;font-variant-numeric:tabular-nums;line-height:1.5;padding:0 .25rem;border-radius:2px;font-size:10px;box-shadow:var(--shadow-md)}.k-tabs[data-theme=notice] .k-tabs-badge{background:var(--theme-light);color:var(--color-black)}.k-view{padding-left:1.5rem;padding-right:1.5rem;margin:0 auto;max-width:100rem}@media screen and (min-width:30em){.k-view{padding-left:3rem;padding-right:3rem}}@media screen and (min-width:90em){.k-view{padding-left:6rem;padding-right:6rem}}.k-view[data-align=center]{height:100vh;display:flex;align-items:center;justify-content:center;padding:0 3rem;overflow:auto}.k-view[data-align=center]>*{flex-basis:22.5rem}.k-fatal{position:fixed;top:0;right:0;bottom:0;left:0;background:var(--color-backdrop);display:flex;z-index:var(--z-fatal);align-items:center;justify-content:center;padding:1.5rem}.k-fatal-box{width:100%;height:100%;display:flex;flex-direction:column;color:var(--color-black);background:var(--color-red-400);box-shadow:var(--shadow-xl);border-radius:var(--rounded)}.k-fatal-box .k-headline{line-height:1;font-size:var(--text-sm);padding:.75rem}.k-fatal-box .k-button{padding:.75rem}.k-fatal-iframe{border:0;width:100%;flex-grow:1;background:var(--color-white)}.k-headline{--size:var(--text-base);font-size:var(--size);font-weight:var(--font-bold);line-height:1.5em}.k-headline[data-size=small]{--size:var(--text-sm)}.k-headline[data-size=large]{--size:var(--text-xl);font-weight:var(--font-normal)}@media screen and (min-width:65em){.k-headline[data-size=large]{--size:var(--text-2xl)}}.k-headline[data-size=huge]{--size:var(--text-2xl);line-height:1.15em}@media screen and (min-width:65em){.k-headline[data-size=huge]{--size:var(--text-3xl)}}.k-headline[data-theme]{color:var(--theme)}[dir=ltr] .k-headline abbr{padding-left:.25rem}[dir=rtl] .k-headline abbr{padding-right:.25rem}.k-headline abbr{color:var(--color-gray-500);text-decoration:none}.k-icon{--size:1rem;position:relative;line-height:0;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:var(--size)}.k-icon[data-size=medium]{--size:2rem}.k-icon[data-size=large]{--size:3rem}.k-icon svg{width:var(--size);height:var(--size);-moz-transform:scale(1)}.k-icon svg *{fill:currentColor}.k-icon[data-back=black]{color:var(--color-white)}.k-icon[data-back=white]{color:var(--color-gray-900)}.k-icon[data-back=pattern]{color:var(--color-white)}[data-disabled=true] .k-icon[data-back=pattern] svg{opacity:1}.k-icon-emoji{display:block;line-height:1;font-style:normal;font-size:var(--size)}@media not all,not all,not all,only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){.k-icon-emoji{font-size:1.25em}}.k-icons{position:absolute;width:0;height:0}.k-image span{position:relative;display:block;line-height:0;padding-bottom:100%}.k-image img{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;-o-object-fit:contain;object-fit:contain}[dir=ltr] .k-image-error{left:50%}[dir=rtl] .k-image-error{right:50%}.k-image-error{position:absolute;top:50%;transform:translate(-50%,-50%);color:var(--color-white);font-size:.9em}.k-image-error svg *{fill:#ffffff4d}.k-image[data-cover=true] img{-o-object-fit:cover;object-fit:cover}.k-image[data-back=black] span{background:var(--color-gray-900)}.k-image[data-back=white] span{background:var(--color-white);color:var(--color-gray-900)}.k-image[data-back=white] .k-image-error{background:var(--color-gray-900);color:var(--color-white)}.k-image[data-back=pattern] span{background:var(--color-gray-800) var(--bg-pattern)}.k-loader{z-index:1}.k-loader-icon{animation:Spin .9s linear infinite}.k-offline-warning{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--z-offline);background:var(--color-backdrop);display:flex;align-items:center;justify-content:center;line-height:1}.k-offline-warning p{display:flex;align-items:center;gap:.5rem;background:var(--color-white);box-shadow:var(--shadow);padding:.75rem;border-radius:var(--rounded)}.k-offline-warning p .k-icon{color:var(--color-red-400)}.k-progress{-webkit-appearance:none;width:100%;height:.5rem;border-radius:5rem;background:var(--color-border);overflow:hidden;border:0}.k-progress::-webkit-progress-bar{border:0;background:var(--color-border);height:.5rem;border-radius:20px}.k-progress::-webkit-progress-value{border-radius:inherit;background:var(--color-focus);-webkit-transition:width .3s;transition:width .3s}.k-progress::-moz-progress-bar{border-radius:inherit;background:var(--color-focus);-moz-transition:width .3s;transition:width .3s}[dir=ltr] .k-registration,[dir=ltr] .k-registration p{margin-right:1rem}[dir=rtl] .k-registration,[dir=rtl] .k-registration p{margin-left:1rem}.k-registration{display:flex;align-items:center}.k-registration p{color:var(--color-negative-light);font-size:var(--text-sm);font-weight:600}@media screen and (max-width:90em){.k-registration p{display:none}}.k-registration .k-button{color:var(--color-white)}.k-sort-handle{cursor:move;cursor:grab;cursor:-webkit-grab;color:var(--color-gray-900);justify-content:center;align-items:center;line-height:0;width:2rem;height:2rem;display:flex;will-change:opacity,color;transition:opacity .3s;z-index:1}.k-sort-handle svg{width:1rem;height:1rem}.k-sort-handle:active{cursor:grabbing;cursor:-webkit-grabbing}.k-status-icon svg{width:14px;height:14px}.k-status-icon .k-icon{color:var(--theme-light)}.k-status-icon .k-button-text{color:var(--color-black)}.k-status-icon[data-disabled=true]{opacity:1!important}.k-status-icon[data-disabled=true] .k-icon{color:var(--color-gray-400);opacity:.5}.k-text{line-height:1.5em}[dir=ltr] .k-text ol,[dir=ltr] .k-text ul{margin-left:1rem}[dir=rtl] .k-text ol,[dir=rtl] .k-text ul{margin-right:1rem}.k-text li{list-style:inherit}.k-text p,.k-text>ol,.k-text>ul{margin-bottom:1.5em}.k-text a{text-decoration:underline}.k-text>:last-child{margin-bottom:0}.k-text[data-size=tiny]{font-size:var(--text-xs)}.k-text[data-size=small]{font-size:var(--text-sm)}.k-text[data-size=medium]{font-size:var(--text-base)}.k-text[data-size=large]{font-size:var(--text-xl)}.k-text[data-align]{text-align:var(--align)}.k-text[data-theme=help]{font-size:var(--text-sm);color:var(--color-gray-600);line-height:1.25rem}.k-dialog-body .k-text{word-wrap:break-word}.k-user-info{display:flex;align-items:center;line-height:1;font-size:var(--text-sm)}[dir=ltr] .k-user-info .k-image{margin-right:.75rem}[dir=rtl] .k-user-info .k-image{margin-left:.75rem}.k-user-info .k-image{width:1.5rem}[dir=ltr] .k-user-info .k-icon{margin-right:.75rem}[dir=rtl] .k-user-info .k-icon{margin-left:.75rem}.k-user-info .k-icon{width:1.5rem;height:1.5rem;background:var(--color-black);color:var(--color-white)}.k-breadcrumb{padding-left:.5rem;padding-right:.5rem}.k-breadcrumb-dropdown{height:2.5rem;width:2.5rem;display:flex;align-items:center;justify-content:center}.k-breadcrumb ol{display:none;align-items:center}@media screen and (min-width:30em){.k-breadcrumb ol{display:flex}.k-breadcrumb-dropdown{display:none}}.k-breadcrumb li,.k-breadcrumb-link{display:flex;align-items:center;min-width:0}.k-breadcrumb-link{font-size:var(--text-sm);align-self:stretch;padding-top:.625rem;padding-bottom:.625rem;line-height:1.25rem}.k-breadcrumb li{flex-shrink:3}.k-breadcrumb li:last-child{flex-shrink:1}.k-breadcrumb li:not(:last-child):after{content:"/";padding-left:.5rem;padding-right:.5rem;opacity:.5;flex-shrink:0}.k-breadcrumb li:not(:first-child):not(:last-child){max-width:15vw}[dir=ltr] .k-breadcrumb-icon{margin-right:.5rem}[dir=rtl] .k-breadcrumb-icon{margin-left:.5rem}.k-breadcrumb-icon.k-loader{opacity:.5}.k-breadcrumb-link-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}button{line-height:inherit;border:0;font-family:var(--font-sans);font-size:1rem;color:currentColor;background:0 0;cursor:pointer}button::-moz-focus-inner{padding:0;border:0}.k-button{display:inline-block;position:relative;font-size:var(--text-sm);transition:color .3s;outline:0}.k-button:focus,.k-button:hover{outline:0}.k-button *{vertical-align:middle}.k-button[data-responsive=true] .k-button-text{display:none}@media screen and (min-width:30em){.k-button[data-responsive=true] .k-button-text{display:inline}}.k-button[data-theme]{color:var(--theme)}.k-button-icon{display:inline-flex;align-items:center;line-height:0}[dir=ltr] .k-button-icon~.k-button-text{padding-left:.5rem}[dir=rtl] .k-button-icon~.k-button-text{padding-right:.5rem}.k-button-text{opacity:.75}.k-button:focus .k-button-text,.k-button:hover .k-button-text{opacity:1}.k-button-text b,.k-button-text span{vertical-align:baseline}.k-button[data-disabled=true]{opacity:.5;pointer-events:none;cursor:default}.k-card-options>.k-button[data-disabled=true]{display:inline-flex}.k-button-group{--padding-x:.75rem;--padding-y:1rem;--line-height:1rem;font-size:0;margin:0 calc(var(--padding-x)*-1)}.k-button-group>.k-dropdown{height:calc(var(--line-height) + (var(--padding-y)*2));display:inline-block}.k-button-group>.k-button,.k-button-group>.k-dropdown>.k-button{padding:var(--padding-y) var(--padding-x);line-height:var(--line-height)}.k-button-group .k-dropdown-content{top:calc(100% + 1px);margin:0 var(--padding-x)}.k-dropdown{position:relative}[dir=ltr] .k-dropdown-content{text-align:left}[dir=rtl] .k-dropdown-content{text-align:right}.k-dropdown-content{position:absolute;top:100%;background:var(--color-black);color:var(--color-white);z-index:var(--z-dropdown);box-shadow:var(--shadow-lg);border-radius:var(--rounded);margin-bottom:6rem}[dir=ltr] .k-dropdown-content[data-align=left]{left:0}[dir=ltr] .k-dropdown-content[data-align=right],[dir=rtl] .k-dropdown-content[data-align=left]{right:0}[dir=rtl] .k-dropdown-content[data-align=right]{left:0}.k-dropdown-content>.k-dropdown-item:first-child{margin-top:.5rem}.k-dropdown-content>.k-dropdown-item:last-child{margin-bottom:.5rem}.k-dropdown-content[data-dropup=true]{top:auto;bottom:100%;margin-bottom:.5rem}.k-dropdown-content hr{border-color:currentColor;opacity:.2;margin:.5rem 1rem}.k-dropdown-content[data-theme=light]{background:var(--color-white);color:var(--color-black)}.k-dropdown-item{white-space:nowrap;line-height:1;display:flex;width:100%;align-items:center;font-size:var(--text-sm);padding:6px 16px}.k-dropdown-item:focus{outline:0;box-shadow:var(--shadow-outline)}[dir=ltr] .k-dropdown-item .k-button-figure{padding-right:.5rem}[dir=rtl] .k-dropdown-item .k-button-figure{padding-left:.5rem}.k-dropdown-item .k-button-figure{text-align:center}.k-link{outline:0}.k-options-dropdown,.k-options-dropdown-toggle{display:flex;justify-content:center;align-items:center;height:38px}.k-options-dropdown-toggle{min-width:38px;padding:0 .75rem}.k-pagination{-webkit-user-select:none;-moz-user-select:none;user-select:none;direction:ltr}.k-pagination .k-button{padding:1rem}.k-pagination-details{white-space:nowrap}.k-pagination>span{font-size:var(--text-sm)}.k-pagination[data-align]{text-align:var(--align)}[dir=ltr] .k-dropdown-content.k-pagination-selector{left:50%}[dir=rtl] .k-dropdown-content.k-pagination-selector{right:50%}.k-dropdown-content.k-pagination-selector{position:absolute;top:100%;transform:translate(-50%);background:var(--color-black)}[dir=ltr] .k-dropdown-content.k-pagination-selector{direction:ltr}[dir=rtl] .k-dropdown-content.k-pagination-selector{direction:rtl}.k-pagination-settings{display:flex;align-items:center;justify-content:space-between}.k-pagination-settings .k-button{line-height:1}[dir=ltr] .k-pagination-settings label{border-right:1px solid rgba(255,255,255,.35)}[dir=rtl] .k-pagination-settings label{border-left:1px solid rgba(255,255,255,.35)}.k-pagination-settings label{display:flex;align-items:center;padding:.625rem 1rem;font-size:var(--text-xs)}[dir=ltr] .k-pagination-settings label span{margin-right:.5rem}[dir=rtl] .k-pagination-settings label span{margin-left:.5rem}.k-prev-next{direction:ltr}.k-search{max-width:30rem;margin:2.5rem auto;box-shadow:var(--shadow-lg);background:var(--color-light);border-radius:var(--rounded)}.k-search-input{display:flex}.k-search-types{flex-shrink:0;display:flex}[dir=ltr] .k-search-types>.k-button{padding-left:1rem}[dir=rtl] .k-search-types>.k-button{padding-right:1rem}.k-search-types>.k-button{font-size:var(--text-base);line-height:1;height:2.5rem}.k-search-types>.k-button .k-icon{height:2.5rem}.k-search-types>.k-button .k-button-text{opacity:1;font-weight:500}.k-search-input input{background:0 0;flex-grow:1;font:inherit;padding:.75rem;border:0;height:2.5rem}.k-search-close{width:3rem;line-height:1}.k-search-close .k-icon-loader{animation:Spin 2s linear infinite}.k-search input:focus{outline:0}.k-search-results{padding:.5rem 1rem 1rem}.k-search .k-item:not(:last-child){margin-bottom:.25rem}.k-search .k-item[data-selected=true]{outline:2px solid var(--color-focus)}.k-search .k-item-info,.k-search-empty{font-size:var(--text-xs)}.k-search-empty{text-align:center;color:var(--color-gray-600)}.k-tag{position:relative;font-size:var(--text-sm);line-height:1;cursor:pointer;background-color:var(--color-gray-900);color:var(--color-light);border-radius:var(--rounded);display:flex;align-items:center;justify-content:space-between;-webkit-user-select:none;-moz-user-select:none;user-select:none}.k-tag:focus{outline:0;background-color:var(--color-focus);color:#fff}.k-tag-text{padding:.3rem .75rem .375rem;line-height:var(--leading-tight)}[dir=ltr] .k-tag-toggle{padding-right:1px}[dir=rtl] .k-tag-toggle{padding-left:1px}[dir=ltr] .k-tag-toggle{border-left:1px solid rgba(255,255,255,.15)}[dir=rtl] .k-tag-toggle{border-right:1px solid rgba(255,255,255,.15)}.k-tag-toggle{color:#ffffffb3;width:1.75rem;height:100%}.k-tag-toggle:hover{background:rgba(255,255,255,.2);color:#fff}[data-disabled=true] .k-tag{background-color:var(--color-gray-600)}[data-disabled=true] .k-tag .k-tag-toggle{display:none}.k-topbar{--bg:var(--color-gray-900);position:relative;color:var(--color-white);flex-shrink:0;height:2.5rem;line-height:1;background:var(--bg)}.k-topbar-wrapper{position:relative;display:flex;align-items:center;margin-left:-.75rem;margin-right:-.75rem}[dir=ltr] .k-topbar-wrapper:after{left:100%}[dir=rtl] .k-topbar-wrapper:after{right:100%}.k-topbar-wrapper:after{position:absolute;content:"";height:2.5rem;background:var(--bg);width:3rem}.k-topbar-menu{flex-shrink:0}.k-topbar-menu ul{padding:.5rem 0}.k-topbar .k-button[data-theme]{color:var(--theme-light)}.k-topbar .k-button-text{opacity:1}.k-topbar-menu-button{display:flex;align-items:center}.k-topbar-menu .k-link[aria-current]{color:var(--color-focus);font-weight:500}.k-topbar-button{padding:.75rem;line-height:1;font-size:var(--text-sm)}.k-topbar-button .k-button-text{display:flex}[dir=ltr] .k-topbar-view-button{padding-right:0}[dir=rtl] .k-topbar-view-button{padding-left:0}.k-topbar-view-button{flex-shrink:0;display:flex;align-items:center}[dir=ltr] .k-topbar-view-button .k-icon{margin-right:.5rem}[dir=rtl] .k-topbar-view-button .k-icon{margin-left:.5rem}[dir=ltr] .k-topbar-signals{right:0}[dir=rtl] .k-topbar-signals{left:0}.k-topbar-signals{position:absolute;top:0;background:var(--bg);height:2.5rem;display:flex;align-items:center}.k-topbar-signals:before{position:absolute;content:"";top:-.5rem;bottom:0;width:.5rem;background:-webkit-linear-gradient(inline-start,rgba(17,17,17,0),#111)}.k-topbar-signals .k-button{line-height:1}.k-topbar-notification{font-weight:var(--font-bold);line-height:1;display:flex}@media screen and (max-width:30em){.k-topbar .k-button[data-theme=negative] .k-button-text{display:none}}.k-section,.k-sections{padding-bottom:3rem}.k-section-header{position:relative;display:flex;align-items:baseline;z-index:1}[dir=ltr] .k-section-header .k-headline{padding-right:var(--spacing-3)}[dir=rtl] .k-section-header .k-headline{padding-left:var(--spacing-3)}.k-section-header .k-headline{line-height:1.25rem;min-height:2rem;flex-grow:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[dir=ltr] .k-section-header .k-button-group{right:0}[dir=rtl] .k-section-header .k-button-group{left:0}.k-section-header .k-button-group{position:absolute;top:calc(-.5rem - 1px)}.k-section-header .k-button-group>.k-button{padding:.75rem;display:inline-flex}.k-fields-issue-headline{margin-bottom:.5rem}.k-fields-section input[type=submit]{display:none}[data-locked=true] .k-fields-section{opacity:.2;pointer-events:none}.k-models-section[data-processing=true]{pointer-events:none}.k-models-section-search.k-input{margin-bottom:var(--spacing-3);background:var(--color-gray-300);padding:var(--spacing-2) var(--spacing-3);height:var(--field-input-height);border-radius:var(--rounded);font-size:var(--text-sm)}.k-info-section-label{margin-bottom:.5rem}.k-user-profile{background:var(--color-white)}.k-user-profile>.k-view{padding-top:3rem;padding-bottom:3rem;display:flex;align-items:center;line-height:0}[dir=ltr] .k-user-profile .k-button-group{margin-left:.75rem}[dir=rtl] .k-user-profile .k-button-group{margin-right:.75rem}.k-user-profile .k-button-group{overflow:hidden}.k-user-profile .k-button-group .k-button{display:block;padding-top:.25rem;padding-bottom:.25rem;overflow:hidden;white-space:nowrap}.k-user-view-image .k-icon,.k-user-view-image .k-image{width:5rem;height:5rem;border-radius:var(--rounded);line-height:0;overflow:hidden}.k-user-view-image[data-disabled=true]{opacity:1}.k-user-view-image .k-image{display:block}.k-user-view-image .k-button-text{opacity:1}.k-user-name-placeholder{color:var(--color-gray-500);transition:color .3s}.k-header[data-editable=true] .k-user-name-placeholder:hover{color:var(--color-gray-900)}.k-error-view{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center}.k-error-view-content{line-height:1.5em;max-width:25rem;text-align:center}.k-error-view-icon{color:var(--color-negative);display:inline-block}.k-error-view-content p:not(:last-child){margin-bottom:.75rem}.k-installation-view .k-button{display:block;margin-top:1.5rem}.k-installation-view .k-headline{margin-bottom:.75rem}.k-installation-issues{line-height:1.5em;font-size:var(--text-sm)}[dir=ltr] .k-installation-issues li{padding-left:3.5rem}[dir=rtl] .k-installation-issues li{padding-right:3.5rem}.k-installation-issues li{position:relative;padding:1.5rem;background:var(--color-white)}[dir=ltr] .k-installation-issues .k-icon{left:1.5rem}[dir=rtl] .k-installation-issues .k-icon{right:1.5rem}.k-installation-issues .k-icon{position:absolute;top:calc(1.5rem + 2px)}.k-installation-issues .k-icon svg *{fill:var(--color-negative)}.k-installation-issues li:not(:last-child){margin-bottom:2px}.k-installation-issues li code{font:inherit;color:var(--color-negative)}[dir=ltr] .k-installation-view .k-button[type=submit]{margin-left:-1rem}[dir=rtl] .k-installation-view .k-button[type=submit]{margin-right:-1rem}.k-installation-view .k-button[type=submit]{padding:1rem}.k-languages-view .k-header{margin-bottom:1.5rem}.k-languages-view-section-header{margin-bottom:.5rem}.k-languages-view-section{margin-bottom:3rem}.k-login-fields{position:relative}[dir=ltr] .k-login-toggler{right:0}[dir=rtl] .k-login-toggler{left:0}.k-login-toggler{position:absolute;top:0;z-index:1;text-decoration:underline;font-size:.875rem}.k-login-form label abbr{visibility:hidden}.k-login-buttons{display:flex;align-items:center;justify-content:flex-end;padding:1.5rem 0}[dir=ltr] .k-login-button{margin-right:-1rem}[dir=rtl] .k-login-button{margin-left:-1rem}.k-login-button{padding:.5rem 1rem;font-weight:500;transition:opacity .3s}.k-login-button span{opacity:1}.k-login-button[disabled]{opacity:.25}.k-login-back-button,.k-login-checkbox{display:flex;align-items:center;flex-grow:1}[dir=ltr] .k-login-back-button{margin-left:-1rem}[dir=rtl] .k-login-back-button{margin-right:-1rem}.k-login-checkbox{padding:.5rem 0;font-size:var(--text-sm);cursor:pointer}.k-login-checkbox .k-checkbox-text{opacity:.75;transition:opacity .3s}.k-login-checkbox:focus span,.k-login-checkbox:hover span{opacity:1}.k-password-reset-view .k-user-info{height:38px;margin-bottom:2.25rem;padding:.5rem;background:var(--color-white);border-radius:var(--rounded-xs);box-shadow:var(--shadow)}.k-system-view .k-header{margin-bottom:1.5rem}.k-system-view-section-header{margin-bottom:.5rem;display:flex;justify-content:space-between}.k-system-view-section{margin-bottom:3rem}.k-system-info .k-stat-label{color:var(--theme, var(--color-black))}.k-block-type-code-editor{position:relative;font-size:var(--text-sm);line-height:1.5em;background:#000;border-radius:var(--rounded);padding:.5rem .75rem 3rem;color:#fff;font-family:var(--font-mono)}.k-block-type-code-editor .k-editor{white-space:pre-wrap;line-height:1.75em}[dir=ltr] .k-block-type-code-editor-language{right:0}[dir=ltr] .k-block-type-code-editor-language .k-icon,[dir=rtl] .k-block-type-code-editor-language{left:0}.k-block-type-code-editor-language{font-size:var(--text-sm);position:absolute;bottom:0}[dir=rtl] .k-block-type-code-editor-language .k-icon{right:0}.k-block-type-code-editor-language .k-icon{position:absolute;top:0;height:1.5rem;display:flex;width:2rem;z-index:0}.k-block-type-code-editor-language .k-select-input{position:relative;padding:.325rem .75rem .5rem 2rem;z-index:1;font-size:var(--text-xs)}.k-block-type-default .k-block-title{line-height:1.5em}.k-block-type-gallery ul{display:grid;grid-gap:.75rem;grid-template-columns:repeat(auto-fit,minmax(6rem,1fr));line-height:0;align-items:center;justify-content:center;cursor:pointer}.k-block-type-gallery-placeholder{background:var(--color-background)}.k-block-type-gallery figcaption{padding-top:.5rem;color:var(--color-gray-600);font-size:var(--text-sm);text-align:center}.k-block-type-heading-input{line-height:1.25em;font-weight:var(--font-bold)}.k-block-type-heading-input[data-level=h1]{font-size:var(--text-3xl);line-height:1.125em}.k-block-type-heading-input[data-level=h2]{font-size:var(--text-2xl)}.k-block-type-heading-input[data-level=h3]{font-size:var(--text-xl)}.k-block-type-heading-input[data-level=h4]{font-size:var(--text-lg)}.k-block-type-heading-input[data-level=h5]{line-height:1.5em;font-size:var(--text-base)}.k-block-type-heading-input[data-level=h6]{line-height:1.5em;font-size:var(--text-sm)}.k-block-type-heading-input .ProseMirror strong{font-weight:700}.k-block-type-image .k-block-figure-container{display:block;text-align:center;line-height:0}.k-block-type-image-auto{max-width:100%;max-height:30rem}.k-block-type-line hr{margin-top:.75rem;margin-bottom:.75rem;border:0;border-top:2px solid var(--color-gray-400)}.k-block-type-markdown-input{position:relative;font-size:var(--text-sm);line-height:1.5em;background:var(--color-background);border-radius:var(--rounded);padding:.5rem .5rem 0;font-family:var(--font-mono)}[dir=ltr] .k-block-type-quote-editor{padding-left:1rem}[dir=rtl] .k-block-type-quote-editor{padding-right:1rem}[dir=ltr] .k-block-type-quote-editor{border-left:2px solid var(--color-black)}[dir=rtl] .k-block-type-quote-editor{border-right:2px solid var(--color-black)}.k-block-type-quote-text{font-size:var(--text-xl);margin-bottom:.25rem;line-height:1.25em}.k-block-type-quote-citation{font-style:italic;font-size:var(--text-sm);color:var(--color-gray-600)}.k-block-type-table-preview{cursor:pointer;border:1px solid var(--color-gray-300);border-spacing:0;border-radius:var(--rounded-sm);overflow:hidden}[dir=ltr] .k-block-type-table-preview td,[dir=ltr] .k-block-type-table-preview th{text-align:left}[dir=rtl] .k-block-type-table-preview td,[dir=rtl] .k-block-type-table-preview th{text-align:right}.k-block-type-table-preview td,.k-block-type-table-preview th{line-height:1.5em;font-size:var(--text-sm)}.k-block-type-table-preview th{padding:.5rem .75rem}.k-block-type-table-preview td:not(.k-table-index-column){padding:0 .75rem}.k-block-type-table-preview td [class$=-field-preview],.k-block-type-table-preview td>*{padding:0}.k-block-type-text-input{font-size:var(--text-base);line-height:1.5em;height:100%}.k-block-container-type-text,.k-block-type-text,.k-block-type-text .k-writer .ProseMirror{height:100%}.k-block-container{position:relative;padding:.75rem;background:var(--color-white);border-radius:var(--rounded)}.k-block-container:not(:last-of-type){border-bottom:1px dashed rgba(0,0,0,.1)}.k-block-container:focus{outline:0}.k-block-container[data-batched=true],.k-block-container[data-selected=true]{z-index:2;border-bottom-color:transparent}.k-block-container[data-batched=true]:after{position:absolute;top:0;right:0;bottom:0;left:0;content:"";background:rgba(238,242,246,.375);mix-blend-mode:multiply;border:1px solid var(--color-focus)}.k-block-container[data-selected=true]{box-shadow:var(--color-focus) 0 0 0 1px,var(--color-focus-outline) 0 0 0 3px}[dir=ltr] .k-block-container .k-block-options{right:.75rem}[dir=rtl] .k-block-container .k-block-options{left:.75rem}.k-block-container .k-block-options{display:none;position:absolute;top:0;margin-top:calc(-1.75rem + 2px)}.k-block-container[data-last-in-batch=true]>.k-block-options,.k-block-container[data-selected=true]>.k-block-options{display:flex}.k-block-container[data-hidden=true] .k-block{opacity:.25}.k-drawer-options .k-button[data-disabled=true]{vertical-align:middle;display:inline-grid}[data-disabled=true] .k-block-container{background:var(--color-background)}.k-block-importer.k-dialog{background:#313740;color:var(--color-white)}.k-block-importer .k-dialog-body{padding:0}.k-block-importer label{display:block;padding:var(--spacing-6) var(--spacing-6)0;color:var(--color-gray-400)}.k-block-importer label kbd{background:rgba(0,0,0,.5);font-family:var(--font-mono);letter-spacing:.1em;padding:.25rem;border-radius:var(--rounded);margin:0 .25rem}.k-block-importer textarea{width:100%;height:20rem;background:0 0;font:inherit;color:var(--color-white);border:0;padding:var(--spacing-6);resize:none}.k-block-importer textarea:focus{outline:0}.k-blocks{background:var(--color-white);box-shadow:var(--shadow);border-radius:var(--rounded)}[data-disabled=true] .k-blocks{background:var(--color-background)}.k-blocks[data-multi-select-key=true] .k-block-container>*{pointer-events:none}.k-blocks[data-empty=true]{padding:0;background:0 0;box-shadow:none}.k-blocks .k-sortable-ghost{outline:2px solid var(--color-focus);box-shadow:#11111140 0 5px 10px;cursor:grabbing;cursor:-webkit-grabbing}.k-blocks-list>.k-blocks-empty{display:flex;align-items:center}.k-blocks-list>.k-blocks-empty:not(:only-child){display:none}.k-block-figure{cursor:pointer}.k-block-figure iframe{border:0;pointer-events:none;background:var(--color-black)}.k-block-figure figcaption{padding-top:.5rem;color:var(--color-gray-600);font-size:var(--text-sm);text-align:center}.k-block-figure-empty.k-button{display:flex;width:100%;height:6rem;border-radius:var(--rounded-sm);align-items:center;justify-content:center;color:var(--color-gray-600);background:var(--color-background)}.k-block-options{display:flex;align-items:center;background:var(--color-white);z-index:var(--z-dropdown);box-shadow:#0000001a -2px 0 5px,var(--shadow),var(--shadow-xl);color:var(--color-black);border-radius:var(--rounded)}[dir=ltr] .k-block-options-button{border-right:1px solid var(--color-background)}[dir=rtl] .k-block-options-button{border-left:1px solid var(--color-background)}.k-block-options-button{--block-options-button-size:30px;width:var(--block-options-button-size);height:var(--block-options-button-size);line-height:1;display:inline-flex;align-items:center;justify-content:center}[dir=ltr] .k-block-options-button:first-child{border-top-left-radius:var(--rounded)}[dir=rtl] .k-block-options-button:first-child{border-top-right-radius:var(--rounded)}[dir=ltr] .k-block-options-button:first-child{border-bottom-left-radius:var(--rounded)}[dir=rtl] .k-block-options-button:first-child{border-bottom-right-radius:var(--rounded)}[dir=ltr] .k-block-options-button:last-child{border-top-right-radius:var(--rounded)}[dir=rtl] .k-block-options-button:last-child{border-top-left-radius:var(--rounded)}[dir=ltr] .k-block-options-button:last-child{border-bottom-right-radius:var(--rounded)}[dir=rtl] .k-block-options-button:last-child{border-bottom-left-radius:var(--rounded)}[dir=ltr] .k-block-options-button:last-of-type{border-right:0}[dir=rtl] .k-block-options-button:last-of-type{border-left:0}.k-block-options-button[aria-current]{color:var(--color-focus)}.k-block-options-button:hover{background:var(--color-gray-100)}.k-block-options .k-dropdown-content{margin-top:.5rem}.k-block-selector.k-dialog{background:var(--color-dark);color:var(--color-white)}.k-block-selector .k-headline{margin-bottom:1rem}.k-block-selector details:not(:last-of-type){margin-bottom:1.5rem}.k-block-selector summary{font-size:var(--text-xs);cursor:pointer;color:var(--color-gray-400)}.k-block-selector details:only-of-type summary{pointer-events:none}.k-block-selector summary:focus{outline:0}.k-block-selector summary:focus-visible{color:var(--color-green-400)}.k-block-types{display:grid;grid-gap:2px;margin-top:.75rem;grid-template-columns:repeat(1,1fr)}[dir=ltr] .k-block-types .k-button{text-align:left}[dir=rtl] .k-block-types .k-button{text-align:right}.k-block-types .k-button{display:flex;align-items:flex-start;border-radius:var(--rounded);background:rgba(0,0,0,.5);width:100%;padding:0 .75rem 0 0;line-height:1.5em}.k-block-types .k-button:focus{outline:2px solid var(--color-green-300)}.k-block-types .k-button .k-button-text{padding:.5rem 0 .5rem .5rem}.k-block-types .k-button .k-icon{width:38px;height:38px}.k-clipboard-hint{padding-top:1.5rem;font-size:var(--text-xs);color:var(--color-gray-400)}.k-clipboard-hint kbd{background:rgba(0,0,0,.5);font-family:var(--font-mono);letter-spacing:.1em;padding:.25rem;border-radius:var(--rounded);margin:0 .25rem}[dir=ltr] .k-block-title{padding-right:.75rem}[dir=rtl] .k-block-title{padding-left:.75rem}.k-block-title{display:flex;align-items:center;min-width:0;font-size:var(--text-sm);line-height:1}[dir=ltr] .k-block-icon{margin-right:.5rem}[dir=rtl] .k-block-icon{margin-left:.5rem}.k-block-icon{width:1rem;color:var(--color-gray-500)}[dir=ltr] .k-block-name{margin-right:.5rem}[dir=rtl] .k-block-name{margin-left:.5rem}.k-block-label{color:var(--color-gray-600);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-bubbles-field-preview{padding:.325rem .75rem}.k-text-field-preview{padding:.325rem .75rem;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.k-url-field-preview{padding:.325rem .75rem;overflow-x:hidden;text-overflow:ellipsis}.k-url-field-preview[data-link]{color:var(--color-focus)}.k-url-field-preview a{text-decoration:underline;transition:color .3s;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-url-field-preview a:hover{color:var(--color-black)}.k-flag-field-preview{height:var(--table-row-height);width:var(--table-row-height);display:flex;justify-content:center;align-items:center}.k-html-field-preview{padding:.325rem .75rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.5em}.k-html-field-preview p:not(:last-child){margin-bottom:1.5em}[dir=ltr] .k-html-field-preview ol,[dir=ltr] .k-html-field-preview ul{margin-left:1rem}[dir=rtl] .k-html-field-preview ol,[dir=rtl] .k-html-field-preview ul{margin-right:1rem}.k-html-field-preview ul>li{list-style:disc}.k-html-field-preview ol ul>li,.k-html-field-preview ul ul>li{list-style:circle}.k-html-field-preview ol>li{list-style:decimal}.k-html-field-preview ol>li::marker{color:var(--color-gray-500);font-size:var(--text-xs)}.k-toggle-field-preview label{padding:0 .25rem 0 .75rem;display:flex;height:38px;cursor:pointer;overflow:hidden;white-space:nowrap}[dir=ltr] .k-toggle-field-preview .k-toggle-input-label{padding-left:.5rem}[dir=ltr] [data-align=right] .k-toggle-field-preview .k-toggle-input-label,[dir=rtl] .k-toggle-field-preview .k-toggle-input-label{padding-right:.5rem}[dir=rtl] [data-align=right] .k-toggle-field-preview .k-toggle-input-label{padding-left:.5rem}[dir=ltr] .k-toggle-field-preview .k-toggle-input{padding-left:.75rem;padding-right:.25rem}.k-toggle-field-preview .k-toggle-input{padding-top:0;padding-bottom:0}[dir=ltr] [data-align=right] .k-toggle-field-preview .k-toggle-input,[dir=rtl] .k-toggle-field-preview .k-toggle-input{padding-left:.25rem;padding-right:.75rem}[dir=rtl] [data-align=right] .k-toggle-field-preview .k-toggle-input{padding-right:.25rem;padding-left:.75rem}[data-align=right] .k-toggle-field-preview .k-toggle-input{flex-direction:row-reverse}:root{--color-backdrop:rgba(0, 0, 0, .6);--color-black:#000;--color-dark:#313740;--color-light:var(--color-gray-200);--color-white:#fff;--color-gray-100:#f7f7f7;--color-gray-200:#efefef;--color-gray-300:#ddd;--color-gray-400:#ccc;--color-gray-500:#999;--color-gray-600:#777;--color-gray-700:#555;--color-gray-800:#333;--color-gray-900:#111;--color-gray:var(--color-gray-600);--color-red-200:#edc1c1;--color-red-300:#e3a0a0;--color-red-400:#d16464;--color-red-600:#ce1f1f;--color-red:var(--color-red-600);--color-orange-200:#f2d4bf;--color-orange-300:#ebbe9e;--color-orange-400:#de935f;--color-orange-600:#f4861f;--color-orange:var(--color-orange-600);--color-yellow-200:#f9e8c7;--color-yellow-300:#f7e2b8;--color-yellow-400:#f0c674;--color-yellow-600:#cca000;--color-yellow:var(--color-yellow-600);--color-green-200:#dce5c2;--color-green-300:#c6d49d;--color-green-400:#a7bd68;--color-green-600:#678f00;--color-green:var(--color-green-600);--color-aqua-200:#d0e5e2;--color-aqua-300:#bbd9d5;--color-aqua-400:#8abeb7;--color-aqua-600:#398e93;--color-aqua:var(--color-aqua-600);--color-blue-200:#cbd7e5;--color-blue-300:#b1c2d8;--color-blue-400:#7e9abf;--color-blue-600:#4271ae;--color-blue:var(--color-blue-600);--color-purple-200:#e0d4e4;--color-purple-300:#d4c3d9;--color-purple-400:#b294bb;--color-purple-600:#9c48b9;--color-purple:var(--color-purple-600);--container:80rem;--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--font-mono:"SFMono-Regular", Consolas, Liberation Mono, Menlo, Courier, monospace;--font-normal:400;--font-bold:600;--leading-none:1;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--leading-loose:2;--rounded-xs:1px;--rounded-sm:.125rem;--rounded:.25rem;--rounded-md:.375rem;--shadow:0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06);--shadow-md:0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);--shadow-lg:0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--shadow-xl:0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04);--shadow-outline:currentColor 0 0 0 2px;--shadow-inset:inset 0 2px 4px 0 rgba(0, 0, 0, .06);--spacing-0:0;--spacing-px:1px;--spacing-2px:2px;--spacing-1:.25rem;--spacing-2:.5rem;--spacing-3:.75rem;--spacing-4:1rem;--spacing-5:1.25rem;--spacing-6:1.5rem;--spacing-8:2rem;--spacing-10:2.5rem;--spacing-12:3rem;--spacing-16:4rem;--spacing-20:5rem;--spacing-24:6rem;--spacing-36:9rem;--text-xs:.75rem;--text-sm:.875rem;--text-base:1rem;--text-lg:1.125rem;--text-xl:1.25rem;--text-2xl:1.5rem;--text-3xl:1.75rem;--text-4xl:2.5rem;--text-5xl:3rem;--text-6xl:4rem;--color-background:var(--color-light);--color-border:var(--color-gray-400);--color-focus:var(--color-blue-600);--color-focus-light:var(--color-blue-400);--color-focus-outline:rgba(113, 143, 183, .25);--color-negative:var(--color-red-600);--color-negative-light:var(--color-red-400);--color-negative-outline:rgba(212, 110, 110, .25);--color-notice:var(--color-orange-600);--color-notice-light:var(--color-orange-400);--color-positive:var(--color-green-600);--color-positive-light:var(--color-green-400);--color-positive-outline:rgba(128, 149, 65, .25);--color-text:var(--color-gray-900);--color-text-light:var(--color-gray-600);--z-offline:1200;--z-fatal:1100;--z-loader:1000;--z-notification:900;--z-dialog:800;--z-navigation:700;--z-dropdown:600;--z-drawer:500;--z-dropzone:400;--z-toolbar:300;--z-content:200;--z-background:100;--bg-pattern:repeating-conic-gradient( rgba(0, 0, 0, 0) 0% 25%, rgba(0, 0, 0, .2) 0% 50% ) 50% / 20px 20px;--shadow-sticky:rgba(0, 0, 0, .05) 0 2px 5px;--shadow-dropdown:var(--shadow-lg);--shadow-item:var(--shadow);--field-input-padding:.5rem;--field-input-height:2.25rem;--field-input-line-height:1.25rem;--field-input-font-size:var(--text-base);--field-input-color-before:var(--color-gray-700);--field-input-color-after:var(--color-gray-700);--field-input-border:1px solid var(--color-border);--field-input-focus-border:1px solid var(--color-focus);--field-input-focus-outline:2px solid var(--color-focus-outline);--field-input-invalid-border:1px solid var(--color-negative-outline);--field-input-invalid-outline:0;--field-input-invalid-focus-border:1px solid var(--color-negative);--field-input-invalid-focus-outline:2px solid var(--color-negative-outline);--field-input-background:var(--color-white);--field-input-disabled-color:var(--color-gray-500);--field-input-disabled-background:var(--color-white);--field-input-disabled-border:1px solid var(--color-gray-300);--font-family-sans:var(--font-sans);--font-family-mono:var(--font-mono);--font-size-tiny:var(--text-xs);--font-size-small:var(--text-sm);--font-size-medium:var(--text-base);--font-size-large:var(--text-xl);--font-size-huge:var(--text-2xl);--font-size-monster:var(--text-3xl);--box-shadow-dropdown:var(--shadow-dropdown);--box-shadow-item:var(--shadow);--box-shadow-focus:var(--shadow-xl)}*,:after,:before{margin:0;padding:0;box-sizing:border-box}noscript{padding:1.5rem;display:flex;align-items:center;justify-content:center;height:100vh;text-align:center}html{font-family:var(--font-sans);background:var(--color-background)}body,html{color:var(--color-gray-900);height:100%;overflow:hidden}a{color:inherit;text-decoration:none}li{list-style:none}b,strong{font-weight:var(--font-bold)}@keyframes LoadingCursor{to{cursor:progress}}@keyframes Spin{to{transform:rotate(360deg)}}[data-align=left]{--align:start}[data-align=center]{--align:center}[data-align=right]{--align:end}[data-invalid=true]{border:1px solid var(--color-negative-outline);box-shadow:var(--color-negative-outline) 0 0 3px 2px}[data-invalid=true]:focus-within{border:var(--field-input-invalid-focus-border)!important;box-shadow:var(--color-negative-outline) 0 0 0 2px!important}[data-tabbed=true]{box-shadow:var(--shadow-outline);border-radius:var(--rounded)}[data-theme=positive],[data-theme=success]{--theme:var(--color-positive);--theme-light:var(--color-positive-light);--theme-bg:var(--color-green-300)}[data-theme=error],[data-theme=negative]{--theme:var(--color-negative);--theme-light:var(--color-negative-light);--theme-bg:var(--color-red-300)}[data-theme=notice]{--theme:var(--color-notice);--theme-light:var(--color-notice-light);--theme-bg:var(--color-orange-300)}[data-theme=info]{--theme:var(--color-focus);--theme-light:var(--color-focus-light);--theme-bg:var(--color-blue-200)}.scroll-x,.scroll-x-auto,.scroll-y,.scroll-y-auto{-webkit-overflow-scrolling:touch;transform:translateZ(0)}.scroll-x,.scroll-x-auto{overflow-x:scroll;overflow-y:hidden}.scroll-x-auto{overflow-x:auto}.scroll-y,.scroll-y-auto{overflow-x:hidden;overflow-y:scroll}.scroll-y-auto{overflow-y:auto}.input-hidden{position:absolute;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:0;height:0;opacity:0}.k-offscreen,.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0} +.k-dialog{position:relative;background:var(--color-background);width:100%;box-shadow:var(--shadow-lg);border-radius:var(--rounded-md);line-height:1;max-height:calc(100vh - 3rem);margin:1.5rem;display:flex;flex-direction:column}@media screen and (min-width:20rem){.k-dialog[data-size=small]{width:20rem}}@media screen and (min-width:22rem){.k-dialog[data-size=default]{width:22rem}}@media screen and (min-width:30rem){.k-dialog[data-size=medium]{width:30rem}}@media screen and (min-width:40rem){.k-dialog[data-size=large]{width:40rem}}[dir=ltr] .k-dialog-notification,[dir=rtl] .k-dialog-notification{border-top-right-radius:var(--rounded);border-top-left-radius:var(--rounded)}.k-dialog-notification{padding:.75rem 1.5rem;background:var(--color-gray-900);width:100%;margin-top:-1px;line-height:1.25rem;color:var(--color-white);display:flex;flex-shrink:0;align-items:center}.k-dialog-notification[data-theme]{background:var(--theme-light);color:var(--color-black)}.k-dialog-notification p{flex-grow:1;word-wrap:break-word;overflow:hidden}[dir=ltr] .k-dialog-notification .k-button{margin-left:1rem}[dir=rtl] .k-dialog-notification .k-button{margin-right:1rem}.k-dialog-notification .k-button{display:flex}.k-dialog-body{padding:1.5rem}.k-dialog-body .k-fieldset{padding-bottom:.5rem}.k-dialog-footer{padding:0;border-top:1px solid var(--color-gray-300);line-height:1;flex-shrink:0}.k-dialog-footer .k-button-group{display:flex;margin:0;justify-content:space-between}.k-dialog-footer .k-button-group .k-button{padding:.75rem 1rem;line-height:1.25rem}[dir=ltr] .k-dialog-footer .k-button-group .k-button:first-child{text-align:left}[dir=rtl] .k-dialog-footer .k-button-group .k-button:first-child{text-align:right}[dir=ltr] .k-dialog-footer .k-button-group .k-button:first-child{padding-left:1.5rem}[dir=rtl] .k-dialog-footer .k-button-group .k-button:first-child{padding-right:1.5rem}[dir=ltr] .k-dialog-footer .k-button-group .k-button:last-child{text-align:right}[dir=rtl] .k-dialog-footer .k-button-group .k-button:last-child{text-align:left}[dir=ltr] .k-dialog-footer .k-button-group .k-button:last-child{padding-right:1.5rem}[dir=rtl] .k-dialog-footer .k-button-group .k-button:last-child{padding-left:1.5rem}.k-dialog .k-pagination{margin-bottom:-1.5rem;display:flex;justify-content:center;align-items:center}.k-dialog-search{margin-bottom:.75rem}.k-dialog-search.k-input{background:rgba(0,0,0,.075);padding:0 1rem;height:36px;border-radius:var(--rounded)}.k-error-details{background:var(--color-white);display:block;overflow:auto;padding:1rem;font-size:var(--text-sm);line-height:1.25em;margin-top:.75rem}.k-error-details dt{color:var(--color-negative-light);margin-bottom:.25rem}.k-error-details dd{overflow:hidden;overflow-wrap:break-word;text-overflow:ellipsis}.k-error-details dd:not(:last-of-type){margin-bottom:1.5em}.k-error-details li{white-space:pre-line}.k-error-details li:not(:last-child){border-bottom:1px solid var(--color-background);padding-bottom:.25rem;margin-bottom:.25rem}.k-files-dialog .k-list-item{cursor:pointer}[dir=ltr] .k-pages-dialog-navbar{padding-right:38px}[dir=rtl] .k-pages-dialog-navbar{padding-left:38px}.k-pages-dialog-navbar{display:flex;align-items:center;justify-content:center;margin-bottom:.5rem}.k-pages-dialog-navbar .k-button{width:38px}.k-pages-dialog-navbar .k-button[disabled]{opacity:0}.k-pages-dialog-navbar .k-headline{flex-grow:1;text-align:center}.k-pages-dialog .k-list-item{cursor:pointer}.k-pages-dialog .k-list-item .k-button[data-theme=disabled],.k-pages-dialog .k-list-item .k-button[disabled]{opacity:.25}.k-pages-dialog .k-list-item .k-button[data-theme=disabled]:hover{opacity:1}.k-users-dialog .k-list-item{cursor:pointer}.k-drawer{--drawer-header-height:2.5rem;--drawer-header-padding:1.5rem;position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--z-toolbar);display:flex;align-items:stretch;justify-content:flex-end;background:rgba(0,0,0,.2)}.k-drawer-box{position:relative;flex-basis:50rem;display:flex;flex-direction:column;background:var(--color-background);box-shadow:var(--shadow-xl)}[dir=ltr] .k-drawer-header{padding-left:var(--drawer-header-padding)}[dir=rtl] .k-drawer-header{padding-right:var(--drawer-header-padding)}.k-drawer-header{flex-shrink:0;height:var(--drawer-header-height);display:flex;align-items:center;line-height:1;justify-content:space-between;background:var(--color-white);font-size:var(--text-sm)}.k-drawer-title{padding:0 .75rem}[dir=ltr] .k-drawer-breadcrumb,[dir=ltr] .k-drawer-title{margin-left:-.75rem}[dir=rtl] .k-drawer-breadcrumb,[dir=rtl] .k-drawer-title{margin-right:-.75rem}.k-drawer-breadcrumb,.k-drawer-title{display:flex;flex-grow:1;align-items:center;min-width:0;font-size:var(--text-sm);font-weight:var(--font-normal)}[dir=ltr] .k-drawer-breadcrumb li:not(:last-child) .k-button:after{right:-.75rem}[dir=rtl] .k-drawer-breadcrumb li:not(:last-child) .k-button:after{left:-.75rem}.k-drawer-breadcrumb li:not(:last-child) .k-button:after{position:absolute;width:1.5rem;display:inline-flex;justify-content:center;align-items:center;content:"\203a";color:var(--color-gray-500);height:var(--drawer-header-height)}[dir=ltr] .k-drawer-breadcrumb .k-icon,[dir=ltr] .k-drawer-title .k-icon{margin-right:.5rem}[dir=rtl] .k-drawer-breadcrumb .k-icon,[dir=rtl] .k-drawer-title .k-icon{margin-left:.5rem}.k-drawer-breadcrumb .k-icon,.k-drawer-title .k-icon{width:1rem;color:var(--color-gray-500)}.k-drawer-breadcrumb .k-button{display:inline-flex;align-items:center;height:var(--drawer-header-height);padding-left:.75rem;padding-right:.75rem}.k-drawer-breadcrumb .k-button-text{opacity:1}[dir=ltr] .k-drawer-breadcrumb .k-button .k-button-icon~.k-button-text{padding-left:0}[dir=rtl] .k-drawer-breadcrumb .k-button .k-button-icon~.k-button-text{padding-right:0}[dir=ltr] .k-drawer-tabs{margin-right:.75rem}[dir=rtl] .k-drawer-tabs{margin-left:.75rem}.k-drawer-tabs{display:flex;align-items:center;line-height:1}.k-drawer-tab.k-button{height:var(--drawer-header-height);padding-left:.75rem;padding-right:.75rem;display:flex;align-items:center;font-size:var(--text-xs)}.k-drawer-tab.k-button[aria-current]:after{position:absolute;bottom:-1px;left:.75rem;right:.75rem;content:"";background:var(--color-black);height:2px}[dir=ltr] .k-drawer-options{padding-right:.75rem}[dir=rtl] .k-drawer-options{padding-left:.75rem}.k-drawer-option.k-button{width:var(--drawer-header-height);height:var(--drawer-header-height);color:var(--color-gray-500);line-height:1}.k-drawer-option.k-button:focus,.k-drawer-option.k-button:hover{color:var(--color-black)}.k-drawer-body{padding:1.5rem;flex-grow:1;background:var(--color-background)}.k-drawer[data-nested=true]{background:0 0}.k-drawer-body .k-table th,.k-drawer-body .k-textarea-input:focus-within .k-toolbar{top:-1.5rem}.k-calendar-input{--cell-padding:.25rem .5rem;padding:.5rem;color:var(--color-light);border-radius:var(--rounded-xs)}.k-calendar-table{table-layout:fixed;width:100%;min-width:15rem;padding-top:.5rem}.k-calendar-input>nav{display:flex;direction:ltr}.k-calendar-input>nav .k-button{padding:.5rem}.k-calendar-selects{flex-grow:1;display:flex;align-items:center;justify-content:center}[dir=ltr] .k-calendar-selects{direction:ltr}[dir=rtl] .k-calendar-selects{direction:rtl}.k-calendar-selects .k-select-input{padding:0 .5rem;font-weight:var(--font-normal);font-size:var(--text-sm)}.k-calendar-selects .k-select-input:focus-within{color:var(--color-focus-light)!important}.k-calendar-input th{padding:.5rem 0;color:var(--color-gray-500);font-size:var(--text-xs);font-weight:400;text-align:center}.k-calendar-day .k-button{width:2rem;height:2rem;margin-left:auto;margin-right:auto;color:var(--color-white);line-height:1.75rem;display:flex;justify-content:center;border-radius:50%;border:2px solid transparent}.k-calendar-day .k-button .k-button-text{opacity:1}.k-calendar-table .k-button:hover{color:var(--color-white)}.k-calendar-day:hover .k-button:not([data-disabled=true]){border-color:#ffffff40}.k-calendar-day[aria-current=date] .k-button{text-decoration:underline}.k-calendar-day[aria-selected=date] .k-button{border-color:currentColor;font-weight:600;color:var(--color-focus-light)}.k-calendar-today{text-align:center;padding-top:.5rem}.k-calendar-today .k-button{font-size:var(--text-xs);padding:1rem;text-decoration:underline}.k-calendar-today .k-button-text{opacity:1;vertical-align:baseline}.k-counter{font-size:var(--text-xs);color:var(--color-gray-900);font-weight:var(--font-bold)}.k-counter[data-invalid=true]{box-shadow:none;border:0;color:var(--color-negative)}[dir=ltr] .k-counter-rules{padding-left:.5rem}[dir=rtl] .k-counter-rules{padding-right:.5rem}.k-counter-rules{color:var(--color-gray-600);font-weight:var(--font-normal)}.k-form-submitter{display:none}.k-form-buttons[data-theme]{background:var(--theme-light)}.k-form-buttons .k-view{display:flex;justify-content:space-between;align-items:center}.k-form-button.k-button{font-weight:500;white-space:nowrap;line-height:1;height:2.5rem;display:flex;padding:0 1rem;align-items:center}[dir=ltr] .k-form-button:first-child{margin-left:-1rem}[dir=rtl] .k-form-button:first-child{margin-right:-1rem}[dir=ltr] .k-form-button:last-child{margin-right:-1rem}[dir=rtl] .k-form-button:last-child{margin-left:-1rem}[dir=ltr] .k-form-lock-info{margin-right:3rem}[dir=rtl] .k-form-lock-info{margin-left:3rem}.k-form-lock-info{display:flex;font-size:var(--text-sm);align-items:center;line-height:1.5em;padding:.625rem 0}[dir=ltr] .k-form-lock-info>.k-icon{margin-right:.5rem}[dir=rtl] .k-form-lock-info>.k-icon{margin-left:.5rem}.k-form-lock-buttons{display:flex;flex-shrink:0}.k-form-lock-loader{animation:Spin 4s linear infinite}.k-form-lock-loader .k-icon-loader{display:flex}.k-form-indicator-toggle{color:var(--color-notice-light)}.k-form-indicator-info{font-size:var(--text-sm);font-weight:var(--font-bold);padding:.75rem 1rem .25rem;line-height:1.25em;width:15rem}.k-field-label{font-weight:var(--font-bold);display:block;padding:0 0 .75rem;flex-grow:1;line-height:1.25rem}[dir=ltr] .k-field-label abbr{padding-left:.25rem}[dir=rtl] .k-field-label abbr{padding-right:.25rem}.k-field-label abbr{text-decoration:none;color:var(--color-gray-500)}.k-field-header{position:relative;display:flex;align-items:baseline}[dir=ltr] .k-field-options{right:0}[dir=rtl] .k-field-options{left:0}.k-field-options{position:absolute;top:calc(-.5rem - 1px)}.k-field-options.k-button-group .k-dropdown{height:auto}.k-field-options.k-button-group .k-field-options-button.k-button{padding:.75rem;display:flex}.k-field[data-disabled=true]{cursor:not-allowed}.k-field[data-disabled=true] *{pointer-events:none}.k-field[data-disabled=true] .k-text[data-theme=help] *{pointer-events:initial}.k-field:focus-within>.k-field-header>.k-field-counter{display:block}.k-field-help{padding-top:.5rem}.k-field-add-item-button{display:flex;align-items:center;width:100%;color:var(--color-gray-500);justify-content:center;padding:.75rem 0}.k-field-add-item-button:hover{color:var(--color-black)}.k-fieldset{border:0}.k-fieldset .k-grid{grid-row-gap:2.25rem}@media screen and (min-width:30em){.k-fieldset .k-grid{grid-column-gap:1.5rem}}.k-sections>.k-column[data-width="1/3"] .k-fieldset .k-grid,.k-sections>.k-column[data-width="1/4"] .k-fieldset .k-grid{grid-template-columns:repeat(1,1fr)}.k-sections>.k-column[data-width="1/3"] .k-fieldset .k-grid .k-column,.k-sections>.k-column[data-width="1/4"] .k-fieldset .k-grid .k-column{grid-column-start:initial}.k-input{display:flex;align-items:center;line-height:1;border:0;outline:0;background:0 0}.k-input-element{flex-grow:1}.k-input-icon{display:flex;justify-content:center;align-items:center;line-height:0}.k-input[data-disabled=true]{pointer-events:none}[data-disabled=true] .k-input-icon{color:var(--color-gray-600)}.k-input[data-theme=field]{line-height:1;border:var(--field-input-border);background:var(--field-input-background);border-radius:var(--rounded)}.k-input[data-theme=field]:focus-within{border:var(--field-input-focus-border);box-shadow:var(--color-focus-outline) 0 0 0 2px}.k-input[data-theme=field][data-disabled=true]{background:var(--color-background)}.k-input[data-theme=field] .k-input-icon{width:var(--field-input-height);align-self:stretch;display:flex;align-items:center;flex-shrink:0}.k-input[data-theme=field] .k-input-after,.k-input[data-theme=field] .k-input-before{align-self:stretch;display:flex;align-items:center;flex-shrink:0;padding:0 var(--field-input-padding)}[dir=ltr] .k-input[data-theme=field] .k-input-before{padding-right:0}[dir=ltr] .k-input[data-theme=field] .k-input-after,[dir=rtl] .k-input[data-theme=field] .k-input-before{padding-left:0}.k-input[data-theme=field] .k-input-before{color:var(--field-input-color-before)}[dir=rtl] .k-input[data-theme=field] .k-input-after{padding-right:0}.k-input[data-theme=field] .k-input-after{color:var(--field-input-color-after)}.k-input[data-theme=field] .k-input-icon>.k-dropdown{width:100%;height:100%}.k-input[data-theme=field] .k-input-icon-button{width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-shrink:0}.k-input[data-theme=field] .k-number-input,.k-input[data-theme=field] .k-select-input,.k-input[data-theme=field] .k-text-input{padding:var(--field-input-padding);line-height:var(--field-input-line-height);border-radius:var(--rounded)}.k-input[data-theme=field] .k-date-input .k-select-input,.k-input[data-theme=field] .k-time-input .k-select-input{padding-left:0;padding-right:0}[dir=ltr] .k-input[data-theme=field] .k-date-input .k-select-input:first-child,[dir=ltr] .k-input[data-theme=field] .k-time-input .k-select-input:first-child{padding-left:var(--field-input-padding)}[dir=rtl] .k-input[data-theme=field] .k-date-input .k-select-input:first-child,[dir=rtl] .k-input[data-theme=field] .k-time-input .k-select-input:first-child{padding-right:var(--field-input-padding)}.k-input[data-theme=field] .k-date-input .k-select-input:focus-within,.k-input[data-theme=field] .k-time-input .k-select-input:focus-within{color:var(--color-focus);font-weight:var(--font-bold)}[dir=ltr] .k-input[data-theme=field].k-time-input .k-time-input-meridiem{padding-left:var(--field-input-padding)}[dir=rtl] .k-input[data-theme=field].k-time-input .k-time-input-meridiem{padding-right:var(--field-input-padding)}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input li,.k-input[data-theme=field][data-type=checkboxes] .k-radio-input li,.k-input[data-theme=field][data-type=radio] .k-checkboxes-input li,.k-input[data-theme=field][data-type=radio] .k-radio-input li{min-width:0;overflow-wrap:break-word}[dir=ltr] .k-input[data-theme=field][data-type=checkboxes] .k-input-before{border-right:1px solid var(--color-background)}[dir=ltr] .k-input[data-theme=field][data-type=checkboxes] .k-input-element+.k-input-after,[dir=ltr] .k-input[data-theme=field][data-type=checkboxes] .k-input-element+.k-input-icon,[dir=rtl] .k-input[data-theme=field][data-type=checkboxes] .k-input-before{border-left:1px solid var(--color-background)}[dir=ltr] .k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input li,[dir=rtl] .k-input[data-theme=field][data-type=checkboxes] .k-input-element+.k-input-after,[dir=rtl] .k-input[data-theme=field][data-type=checkboxes] .k-input-element+.k-input-icon{border-right:1px solid var(--color-background)}.k-input[data-theme=field][data-type=checkboxes] .k-input-element{overflow:hidden}[dir=ltr] .k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input{margin-right:-1px}[dir=rtl] .k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input{margin-left:-1px}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input{display:grid;grid-template-columns:1fr;margin-bottom:-1px}@media screen and (min-width:65em){.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input{grid-template-columns:repeat(var(--columns),1fr)}}[dir=rtl] .k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input li{border-left:1px solid var(--color-background)}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input li,.k-input[data-theme=field][data-type=radio] .k-radio-input li{border-bottom:1px solid var(--color-background)}.k-input[data-theme=field][data-type=checkboxes] .k-checkboxes-input label{display:block;line-height:var(--field-input-line-height);padding:var(--field-input-padding) var(--field-input-padding)}[dir=ltr] .k-input[data-theme=field][data-type=checkboxes] .k-checkbox-input-icon,[dir=ltr] .k-input[data-theme=field][data-type=radio] .k-radio-input label:before{left:var(--field-input-padding)}[dir=rtl] .k-input[data-theme=field][data-type=checkboxes] .k-checkbox-input-icon,[dir=rtl] .k-input[data-theme=field][data-type=radio] .k-radio-input label:before{right:var(--field-input-padding)}.k-input[data-theme=field][data-type=checkboxes] .k-checkbox-input-icon{top:calc((var(--field-input-height) - var(--field-input-font-size))/2);margin-top:0}[dir=ltr] .k-input[data-theme=field][data-type=radio] .k-input-before{border-right:1px solid var(--color-background)}[dir=ltr] .k-input[data-theme=field][data-type=radio] .k-input-element+.k-input-after,[dir=ltr] .k-input[data-theme=field][data-type=radio] .k-input-element+.k-input-icon,[dir=rtl] .k-input[data-theme=field][data-type=radio] .k-input-before{border-left:1px solid var(--color-background)}[dir=ltr] .k-input[data-theme=field][data-type=radio] .k-radio-input li,[dir=rtl] .k-input[data-theme=field][data-type=radio] .k-input-element+.k-input-after,[dir=rtl] .k-input[data-theme=field][data-type=radio] .k-input-element+.k-input-icon{border-right:1px solid var(--color-background)}.k-input[data-theme=field][data-type=radio] .k-input-element{overflow:hidden}[dir=ltr] .k-input[data-theme=field][data-type=radio] .k-radio-input{margin-right:-1px}[dir=rtl] .k-input[data-theme=field][data-type=radio] .k-radio-input{margin-left:-1px}.k-input[data-theme=field][data-type=radio] .k-radio-input{display:grid;grid-template-columns:1fr;margin-bottom:-1px}@media screen and (min-width:65em){.k-input[data-theme=field][data-type=radio] .k-radio-input{grid-template-columns:repeat(var(--columns),1fr)}}[dir=rtl] .k-input[data-theme=field][data-type=radio] .k-radio-input li{border-left:1px solid var(--color-background)}.k-input[data-theme=field][data-type=radio] .k-radio-input label{display:block;flex-grow:1;min-height:var(--field-input-height);line-height:var(--field-input-line-height);padding:calc((var(--field-input-height) - var(--field-input-line-height))/2) var(--field-input-padding)}.k-input[data-theme=field][data-type=radio] .k-radio-input label:before{top:calc((var(--field-input-height) - 1rem)/2);margin-top:-1px}.k-input[data-theme=field][data-type=radio] .k-radio-input .k-radio-input-info{display:block;font-size:var(--text-sm);color:var(--color-gray-600);line-height:var(--field-input-line-height);padding-top:calc(var(--field-input-line-height)/10)}.k-input[data-theme=field][data-type=radio] .k-radio-input .k-icon{width:var(--field-input-height);height:var(--field-input-height);display:flex;align-items:center;justify-content:center}.k-input[data-theme=field][data-type=range] .k-range-input{padding:var(--field-input-padding)}.k-input[data-theme=field][data-type=multiselect],.k-input[data-theme=field][data-type=select]{position:relative}[dir=ltr] .k-input[data-theme=field][data-type=select] .k-input-icon{right:0}[dir=rtl] .k-input[data-theme=field][data-type=select] .k-input-icon{left:0}.k-input[data-theme=field][data-type=select] .k-input-icon{position:absolute;top:0;bottom:0}.k-input[data-theme=field][data-type=tags] .k-tags-input{padding:.25rem .25rem 0}[dir=ltr] .k-input[data-theme=field][data-type=tags] .k-tag{margin-right:.25rem}[dir=rtl] .k-input[data-theme=field][data-type=tags] .k-tag{margin-left:.25rem}.k-input[data-theme=field][data-type=tags] .k-tag{margin-bottom:.25rem;height:auto;min-height:1.75rem;font-size:var(--text-sm)}.k-input[data-theme=field][data-type=tags] .k-tags-input input{font-size:var(--text-sm);padding:0 .25rem;height:1.75rem;line-height:1;margin-bottom:.25rem}.k-input[data-theme=field][data-type=tags] .k-tags-input .k-dropdown-content{top:calc(100% + .5rem + 2px)}.k-input[data-theme=field][data-type=tags] .k-tags-input .k-dropdown-content[data-dropup]{top:calc(100% + .5rem + 2px);bottom:initial;margin-bottom:initial}.k-input[data-theme=field][data-type=multiselect] .k-multiselect-input{padding:.25rem 2rem 0 .25rem;min-height:2.25rem}[dir=ltr] .k-input[data-theme=field][data-type=multiselect] .k-tag{margin-right:.25rem}[dir=rtl] .k-input[data-theme=field][data-type=multiselect] .k-tag{margin-left:.25rem}.k-input[data-theme=field][data-type=multiselect] .k-tag{margin-bottom:.25rem;height:1.75rem;font-size:var(--text-sm)}[dir=ltr] .k-input[data-theme=field][data-type=multiselect] .k-input-icon{right:0}[dir=rtl] .k-input[data-theme=field][data-type=multiselect] .k-input-icon{left:0}.k-input[data-theme=field][data-type=multiselect] .k-input-icon{position:absolute;top:0;bottom:0;pointer-events:none}.k-input[data-theme=field][data-type=textarea] .k-textarea-input-native{padding:.25rem var(--field-input-padding);line-height:1.5rem}[dir=ltr] .k-input[data-theme=field][data-type=toggle] .k-input-before{padding-right:calc(var(--field-input-padding)/2)}[dir=rtl] .k-input[data-theme=field][data-type=toggle] .k-input-before{padding-left:calc(var(--field-input-padding)/2)}[dir=ltr] .k-input[data-theme=field][data-type=toggle] .k-toggle-input{padding-left:var(--field-input-padding)}[dir=rtl] .k-input[data-theme=field][data-type=toggle] .k-toggle-input{padding-right:var(--field-input-padding)}.k-input[data-theme=field][data-type=toggle] .k-toggle-input-label{padding:0 var(--field-input-padding)0 .75rem;line-height:var(--field-input-height)}.k-login-code-form .k-user-info{height:38px;margin-bottom:2.25rem;padding:.5rem;background:var(--color-white);border-radius:var(--rounded-xs);box-shadow:var(--shadow)}.k-times{padding:var(--spacing-4) var(--spacing-6);display:grid;line-height:1;grid-template-columns:1fr 1fr;grid-gap:var(--spacing-6)}.k-times .k-icon{width:1rem;margin-bottom:var(--spacing-2)}.k-times-slot .k-button{padding:var(--spacing-1) var(--spacing-3) var(--spacing-1)0;font-variant-numeric:tabular-nums;white-space:nowrap}.k-times .k-times-slot hr{position:relative;opacity:1;margin:var(--spacing-2)0;border:0;height:1px;top:1px;background:var(--color-dark)}[dir=ltr] .k-upload input{left:-3000px}[dir=rtl] .k-upload input{right:-3000px}.k-upload input{position:absolute;top:0}.k-upload-dialog .k-headline{margin-bottom:.75rem}.k-upload-error-list,.k-upload-list{line-height:1.5em;font-size:var(--text-sm)}.k-upload-list-filename{color:var(--color-gray-600)}.k-upload-error-list li{padding:.75rem;background:var(--color-white);border-radius:var(--rounded-xs)}.k-upload-error-list li:not(:last-child){margin-bottom:2px}.k-upload-error-filename{color:var(--color-negative);font-weight:var(--font-bold)}.k-upload-error-message{color:var(--color-gray-600)}.k-writer-toolbar{position:absolute;display:flex;background:var(--color-black);height:30px;transform:translate(-50%) translateY(-.75rem);z-index:calc(var(--z-dropdown) + 1);box-shadow:var(--shadow);color:var(--color-white);border-radius:var(--rounded)}.k-writer-toolbar-button.k-button{display:flex;align-items:center;justify-content:center;height:30px;width:30px;font-size:var(--text-sm)!important;color:currentColor;line-height:1}.k-writer-toolbar-button.k-button:hover{background:rgba(255,255,255,.15)}.k-writer-toolbar-button.k-writer-toolbar-button-active{color:var(--color-blue-300)}.k-writer-toolbar-button.k-writer-toolbar-nodes{width:auto;padding:0 .75rem}[dir=ltr] .k-writer-toolbar .k-dropdown+.k-writer-toolbar-button{border-left:1px solid var(--color-gray-700)}[dir=rtl] .k-writer-toolbar .k-dropdown+.k-writer-toolbar-button{border-right:1px solid var(--color-gray-700)}[dir=ltr] .k-writer-toolbar-button.k-writer-toolbar-nodes:after{margin-left:.5rem}[dir=rtl] .k-writer-toolbar-button.k-writer-toolbar-nodes:after{margin-right:.5rem}.k-writer-toolbar-button.k-writer-toolbar-nodes:after{content:"";border-top:4px solid var(--color-white);border-left:4px solid transparent;border-right:4px solid transparent}.k-writer-toolbar .k-dropdown-content{color:var(--color-black);background:var(--color-white);margin-top:.5rem}.k-writer-toolbar .k-dropdown-content .k-dropdown-item[aria-current]{color:var(--color-focus);font-weight:500}.k-writer{position:relative;width:100%;grid-template-areas:"content";display:grid}.k-writer .ProseMirror{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;white-space:pre-wrap;font-variant-ligatures:none;line-height:inherit;grid-area:content}.k-writer .ProseMirror:focus{outline:0}.k-writer .ProseMirror *{caret-color:currentColor}.k-writer .ProseMirror a{color:var(--color-focus);text-decoration:underline}.k-writer .ProseMirror>:last-child{margin-bottom:0}.k-writer .ProseMirror h1,.k-writer .ProseMirror h2,.k-writer .ProseMirror h3,.k-writer .ProseMirror ol,.k-writer .ProseMirror p,.k-writer .ProseMirror ul{margin-bottom:.75rem}.k-writer .ProseMirror h1{font-size:var(--text-3xl);line-height:1.25em}.k-writer .ProseMirror h2{font-size:var(--text-2xl);line-height:1.25em}.k-writer .ProseMirror h3{font-size:var(--text-xl);line-height:1.25em}.k-writer .ProseMirror h1 strong,.k-writer .ProseMirror h2 strong,.k-writer .ProseMirror h3 strong{font-weight:700}.k-writer .ProseMirror strong{font-weight:600}.k-writer .ProseMirror code{position:relative;font-size:.925em;display:inline-block;line-height:1.325;padding:.05em .325em;background:var(--color-gray-300);border-radius:var(--rounded)}[dir=ltr] .k-writer .ProseMirror ol,[dir=ltr] .k-writer .ProseMirror ul{padding-left:1.75rem}[dir=rtl] .k-writer .ProseMirror ol,[dir=rtl] .k-writer .ProseMirror ul{padding-right:1.75rem}.k-writer .ProseMirror ul>li{list-style:disc}.k-writer .ProseMirror ul ul>li{list-style:circle}.k-writer .ProseMirror ul ul ul>li{list-style:square}.k-writer .ProseMirror ol>li{list-style:decimal}.k-writer .ProseMirror li>ol,.k-writer .ProseMirror li>p,.k-writer .ProseMirror li>ul{margin:0}.k-writer-code pre{-moz-tab-size:2;-o-tab-size:2;tab-size:2;font-size:var(--text-sm);line-height:2em;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;white-space:pre}.k-writer .ProseMirror code,.k-writer-code code{font-family:var(--font-mono)}.k-writer[data-placeholder][data-empty=true]:before{grid-area:content;content:attr(data-placeholder);line-height:inherit;color:var(--color-gray-500);pointer-events:none;white-space:pre-wrap;word-wrap:break-word}.k-login-alert{padding:.5rem .75rem;display:flex;justify-content:space-between;align-items:center;min-height:38px;margin-bottom:2rem;background:var(--color-negative);color:var(--color-white);font-size:var(--text-sm);border-radius:var(--rounded-xs);box-shadow:var(--shadow-lg);cursor:pointer}.k-structure-backdrop{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;height:100vh}.k-structure-form section{position:relative;z-index:3;border-radius:var(--rounded-xs);margin-bottom:1px;box-shadow:#1111110d 0 0 0 3px;border:1px solid var(--color-border);background:var(--color-background)}.k-structure-form-fields{padding:1.5rem 1.5rem 2rem}.k-structure-form-buttons{border-top:1px solid var(--color-border);display:flex;justify-content:space-between}.k-structure-form-buttons .k-pagination{display:none}@media screen and (min-width:65em){.k-structure-form-buttons .k-pagination{display:flex}}.k-structure-form-buttons .k-pagination>.k-button,.k-structure-form-buttons .k-pagination>span{padding:.875rem 1rem!important}.k-structure-form-cancel-button,.k-structure-form-submit-button{padding:.875rem 1.5rem;line-height:1rem;display:flex}[dir=ltr] .k-toolbar,[dir=rtl] .k-toolbar{border-top-right-radius:var(--rounded);border-top-left-radius:var(--rounded)}.k-toolbar{background:var(--color-white);border-bottom:1px solid var(--color-background);height:38px}.k-toolbar-wrapper{position:absolute;top:0;left:0;right:0;max-width:100%}.k-toolbar-buttons{display:flex}.k-toolbar-divider{width:1px;background:var(--color-background)}.k-toolbar-button{width:36px;height:36px}.k-toolbar-button:hover{background:rgba(239,239,239,.5)}.k-checkbox-input{position:relative;cursor:pointer}[dir=ltr] .k-checkbox-input-label{padding-left:1.75rem}[dir=rtl] .k-checkbox-input-label{padding-right:1.75rem}.k-checkbox-input-label{display:block}[dir=ltr] .k-checkbox-input-icon{left:0}[dir=rtl] .k-checkbox-input-icon{right:0}.k-checkbox-input-icon{position:absolute;width:1rem;height:1rem;border-radius:var(--rounded);border:2px solid var(--color-gray-500)}.k-checkbox-input-icon svg{position:absolute;width:12px;height:12px;display:none}.k-checkbox-input-icon path{stroke:var(--color-white)}.k-checkbox-input-native:checked+.k-checkbox-input-icon{border-color:var(--color-gray-900);background:var(--color-gray-900)}[data-disabled=true] .k-checkbox-input-native:checked+.k-checkbox-input-icon{border-color:var(--color-gray-600);background:var(--color-gray-600)}.k-checkbox-input-native:checked+.k-checkbox-input-icon svg{display:block}.k-checkbox-input-native:focus+.k-checkbox-input-icon{border-color:var(--color-blue-600)}.k-checkbox-input-native:focus:checked+.k-checkbox-input-icon{background:var(--color-focus)}.k-text-input{width:100%;border:0;background:0 0;font:inherit;color:inherit;font-variant-numeric:tabular-nums}.k-text-input::-moz-placeholder{color:var(--color-gray-500)}.k-text-input::placeholder{color:var(--color-gray-500)}.k-text-input:focus{outline:0}.k-text-input:invalid{box-shadow:none;outline:0}.k-list-input .ProseMirror{line-height:1.5em}.k-list-input .ProseMirror ol>li::marker{font-size:var(--text-sm);color:var(--color-gray-500)}.k-multiselect-input{display:flex;flex-wrap:wrap;position:relative;font-size:var(--text-sm);min-height:2.25rem;line-height:1}.k-multiselect-input .k-sortable-ghost{background:var(--color-focus)}.k-multiselect-input .k-tag{border-radius:var(--rounded-sm)}.k-multiselect-input .k-dropdown-content,.k-multiselect-input[data-layout=list] .k-tag{width:100%}.k-multiselect-search{margin-top:0!important;color:var(--color-white);background:var(--color-gray-900);border-bottom:1px dashed rgba(255,255,255,.2)}.k-multiselect-search>.k-button-text{flex:1;opacity:1!important}.k-multiselect-search input{width:100%;color:var(--color-white);background:0 0;border:0;outline:0;padding:.25rem 0;font:inherit}.k-multiselect-options{position:relative;max-height:275px;padding:.5rem 0}.k-multiselect-option{position:relative}.k-multiselect-option.selected{color:var(--color-positive-light)}.k-multiselect-option.disabled:not(.selected) .k-icon{opacity:0}.k-multiselect-option b{color:var(--color-focus-light);font-weight:700}[dir=ltr] .k-multiselect-input[data-layout=list] .k-tag{margin-right:0!important}[dir=rtl] .k-multiselect-input[data-layout=list] .k-tag{margin-left:0!important}.k-multiselect-more{width:100%;padding:.75rem;color:#fffc;text-align:center;border-top:1px dashed rgba(255,255,255,.2)}.k-multiselect-more:hover{color:var(--color-white)}.k-number-input{width:100%;border:0;background:0 0;font:inherit;color:inherit}.k-number-input::-moz-placeholder{color:var(--color-gray-500)}.k-number-input::placeholder{color:var(--color-gray-500)}.k-number-input:focus{outline:0}.k-number-input:invalid{box-shadow:none;outline:0}[dir=ltr] .k-radio-input li{padding-left:1.75rem}[dir=rtl] .k-radio-input li{padding-right:1.75rem}.k-radio-input li{position:relative;line-height:1.5rem}.k-radio-input input{position:absolute;width:0;height:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;opacity:0}.k-radio-input label{cursor:pointer;align-items:center}[dir=ltr] .k-radio-input label:before{left:0}[dir=rtl] .k-radio-input label:before{right:0}.k-radio-input label:before{position:absolute;top:.175em;content:"";width:1rem;height:1rem;border-radius:50%;border:2px solid var(--color-gray-500);box-shadow:var(--color-white) 0 0 0 2px inset}.k-radio-input input:checked+label:before{border-color:var(--color-gray-900);background:var(--color-gray-900)}[data-disabled=true] .k-radio-input input:checked+label:before{border-color:var(--color-gray-600);background:var(--color-gray-600)}.k-radio-input input:focus+label:before{border-color:var(--color-blue-600)}.k-radio-input input:focus:checked+label:before{background:var(--color-focus)}.k-radio-input-text{display:block}.k-range-input{--range-thumb-size:16px;--range-thumb-border:4px solid var(--color-gray-900);--range-thumb-border-disabled:4px solid var(--color-gray-600);--range-thumb-background:var(--color-background);--range-thumb-focus-border:4px solid var(--color-focus);--range-thumb-focus-background:var(--color-background);--range-track-height:4px;--range-track-background:var(--color-border);--range-track-color:var(--color-gray-900);--range-track-color-disabled:var(--color-gray-600);--range-track-focus-color:var(--color-focus);display:flex;align-items:center}.k-range-input-native{--min:0;--max:100;--value:0;--range:calc(var(--max) - var(--min));--ratio:calc((var(--value) - var(--min)) / var(--range));--position:calc( .5 * var(--range-thumb-size) + var(--ratio) * calc(100% - var(--range-thumb-size)) );-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:var(--range-thumb-size);background:0 0;font-size:var(--text-sm);line-height:1}.k-range-input-native::-webkit-slider-thumb{-webkit-appearance:none;appearance:none}.k-range-input-native::-webkit-slider-runnable-track{border:0;border-radius:var(--range-track-height);width:100%;height:var(--range-track-height);background:var(--range-track-background)}.k-range-input-native::-moz-range-track{border:0;border-radius:var(--range-track-height);width:100%;height:var(--range-track-height);background:var(--range-track-background)}.k-range-input-native::-ms-track{border:0;border-radius:var(--range-track-height);width:100%;height:var(--range-track-height);background:var(--range-track-background)}.k-range-input-native::-webkit-slider-runnable-track{background:linear-gradient(var(--range-track-color),var(--range-track-color))0/var(--position) 100%no-repeat var(--range-track-background)}.k-range-input-native::-moz-range-progress{height:var(--range-track-height);background:var(--range-track-color)}.k-range-input-native::-ms-fill-lower{height:var(--range-track-height);background:var(--range-track-color)}.k-range-input-native::-webkit-slider-thumb{margin-top:calc(.5*(var(--range-track-height) - var(--range-thumb-size)));box-sizing:border-box;width:var(--range-thumb-size);height:var(--range-thumb-size);background:var(--range-thumb-background);border:var(--range-thumb-border);border-radius:50%;cursor:pointer}.k-range-input-native::-moz-range-thumb{box-sizing:border-box;width:var(--range-thumb-size);height:var(--range-thumb-size);background:var(--range-thumb-background);border:var(--range-thumb-border);border-radius:50%;cursor:pointer}.k-range-input-native::-ms-thumb{box-sizing:border-box;width:var(--range-thumb-size);height:var(--range-thumb-size);background:var(--range-thumb-background);border:var(--range-thumb-border);border-radius:50%;cursor:pointer;margin-top:0}.k-range-input-native::-ms-tooltip{display:none}.k-range-input-native:focus{outline:0}.k-range-input-native:focus::-webkit-slider-runnable-track{border:0;border-radius:var(--range-track-height);width:100%;height:var(--range-track-height);background:var(--range-track-background);background:linear-gradient(var(--range-track-focus-color),var(--range-track-focus-color))0/var(--position) 100%no-repeat var(--range-track-background)}.k-range-input-native:focus::-moz-range-progress{height:var(--range-track-height);background:var(--range-track-focus-color)}.k-range-input-native:focus::-ms-fill-lower{height:var(--range-track-height);background:var(--range-track-focus-color)}.k-range-input-native:focus::-webkit-slider-thumb{background:var(--range-thumb-focus-background);border:var(--range-thumb-focus-border)}.k-range-input-native:focus::-moz-range-thumb{background:var(--range-thumb-focus-background);border:var(--range-thumb-focus-border)}.k-range-input-native:focus::-ms-thumb{background:var(--range-thumb-focus-background);border:var(--range-thumb-focus-border)}[dir=ltr] .k-range-input-tooltip{margin-left:1rem}[dir=rtl] .k-range-input-tooltip{margin-right:1rem}.k-range-input-tooltip{position:relative;max-width:20%;display:flex;align-items:center;color:var(--color-white);font-size:var(--text-xs);line-height:1;text-align:center;border-radius:var(--rounded-xs);background:var(--color-gray-900);padding:0 .25rem;white-space:nowrap}[dir=ltr] .k-range-input-tooltip:after{left:-5px}[dir=rtl] .k-range-input-tooltip:after{right:-5px}[dir=ltr] .k-range-input-tooltip:after{border-right:5px solid var(--color-gray-900)}[dir=rtl] .k-range-input-tooltip:after{border-left:5px solid var(--color-gray-900)}.k-range-input-tooltip:after{position:absolute;top:50%;width:0;height:0;transform:translateY(-50%);border-top:5px solid transparent;border-bottom:5px solid transparent;content:""}.k-range-input-tooltip>*{padding:4px}[data-disabled=true] .k-range-input-native::-webkit-slider-runnable-track{background:linear-gradient(var(--range-track-color-disabled),var(--range-track-color-disabled))0/var(--position) 100%no-repeat var(--range-track-background)}[data-disabled=true] .k-range-input-native::-moz-range-progress{height:var(--range-track-height);background:var(--range-track-color-disabled)}[data-disabled=true] .k-range-input-native::-ms-fill-lower{height:var(--range-track-height);background:var(--range-track-color-disabled)}[data-disabled=true] .k-range-input-native::-webkit-slider-thumb{border:var(--range-thumb-border-disabled)}[data-disabled=true] .k-range-input-native::-moz-range-thumb{border:var(--range-thumb-border-disabled)}[data-disabled=true] .k-range-input-native::-ms-thumb{border:var(--range-thumb-border-disabled)}[data-disabled=true] .k-range-input-tooltip{background:var(--color-gray-600)}[dir=ltr] [data-disabled=true] .k-range-input-tooltip:after{border-right:5px solid var(--color-gray-600)}[dir=rtl] [data-disabled=true] .k-range-input-tooltip:after{border-left:5px solid var(--color-gray-600)}.k-select-input{position:relative;display:block;cursor:pointer;overflow:hidden}.k-select-input-native{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;width:100%;font:inherit;z-index:1;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-weight:var(--font-normal)}.k-select-input-native[disabled]{cursor:default}.k-tags-input{display:flex;flex-wrap:wrap}.k-tags-input .k-tag{border-radius:var(--rounded-sm)}.k-tags-input .k-sortable-ghost{background:var(--color-focus)}.k-tags-input-element{flex-grow:1;flex-basis:0;min-width:0}.k-tags-input:focus-within .k-tags-input-element{flex-basis:4rem}.k-tags-input-element input{font:inherit;border:0;width:100%;background:0 0}.k-tags-input-element input:focus{outline:0}[dir=ltr] .k-tags-input[data-layout=list] .k-tag{margin-right:0!important}[dir=rtl] .k-tags-input[data-layout=list] .k-tag{margin-left:0!important}.k-tags-input[data-layout=list] .k-tag{width:100%}.k-textarea-input[data-size=small]{--size:7.5rem}.k-textarea-input[data-size=medium]{--size:15rem}.k-textarea-input[data-size=large]{--size:30rem}.k-textarea-input[data-size=huge]{--size:45rem}.k-textarea-input-wrapper{position:relative}.k-textarea-input-native{resize:none;border:0;width:100%;background:0 0;font:inherit;line-height:1.5em;color:inherit;min-height:var(--size)}.k-textarea-input-native::-moz-placeholder{color:var(--color-gray-500)}.k-textarea-input-native::placeholder{color:var(--color-gray-500)}.k-textarea-input-native:focus{outline:0}.k-textarea-input-native:invalid{box-shadow:none;outline:0}.k-textarea-input-native[data-font=monospace]{font-family:var(--font-mono)}.k-toolbar{margin-bottom:.25rem;color:#aaa}.k-textarea-input:focus-within .k-toolbar{position:sticky;top:0;left:0;right:0;z-index:1;box-shadow:#0000000d 0 2px 5px;border-bottom:1px solid rgba(0,0,0,.1);color:#000}.k-toggle-input{--toggle-background:var(--color-white);--toggle-color:var(--color-gray-500);--toggle-active-color:var(--color-gray-900);--toggle-focus-color:var(--color-focus);--toggle-height:16px;display:flex;align-items:center}.k-toggle-input-native{position:relative;height:var(--toggle-height);width:calc(var(--toggle-height)*2);border-radius:var(--toggle-height);border:2px solid var(--toggle-color);box-shadow:inset 0 0 0 2px var(--toggle-background),inset calc(var(--toggle-height)*-1) 0 0 2px var(--toggle-background);background-color:var(--toggle-color);outline:0;transition:all ease-in-out .1s;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;flex-shrink:0}.k-toggle-input-native:checked{border-color:var(--toggle-active-color);box-shadow:inset 0 0 0 2px var(--toggle-background),inset var(--toggle-height) 0 0 2px var(--toggle-background);background-color:var(--toggle-active-color)}.k-toggle-input-native[disabled]{border-color:var(--color-border);box-shadow:inset 0 0 0 2px var(--color-background),inset calc(var(--toggle-height)*-1) 0 0 2px var(--color-background);background-color:var(--color-border)}.k-toggle-input-native[disabled]:checked{box-shadow:inset 0 0 0 2px var(--color-background),inset var(--toggle-height) 0 0 2px var(--color-background)}.k-toggle-input-native:focus:checked{border:2px solid var(--color-focus);background-color:var(--toggle-focus-color)}.k-toggle-input-native::-ms-check{opacity:0}.k-toggle-input-label{cursor:pointer;flex-grow:1}.k-input[data-type=toggles]{display:inline-flex}.k-input[data-type=toggles].grow{display:flex}.k-toggles-input{display:grid;grid-template-columns:repeat(var(--options),minmax(0,1fr));gap:1px;border-radius:var(--rounded);line-height:1;background:var(--color-border);overflow:hidden}.k-toggles-input li{height:var(--field-input-height);background:var(--color-white)}.k-toggles-input label{align-items:center;background:var(--color-white);cursor:pointer;display:flex;font-size:var(--text-sm);justify-content:center;line-height:1.25;padding:0 var(--spacing-3);height:100%}[dir=ltr] .k-toggles-input .k-icon+.k-toggles-text{margin-left:var(--spacing-2)}[dir=rtl] .k-toggles-input .k-icon+.k-toggles-text{margin-right:var(--spacing-2)}.k-toggles-input input:focus:not(:checked)+label{background:var(--color-gray-200)}.k-toggles-input input:checked+label{background:var(--color-black);color:var(--color-white)}.k-blocks-field{position:relative}.k-date-field-body{display:flex;flex-wrap:wrap;line-height:1;border:var(--field-input-border);background:var(--color-gray-300);gap:1px;border-radius:var(--rounded);--multiplier:calc(25rem - 100%)}.k-date-field-body:focus-within{border:var(--field-input-focus-border);box-shadow:var(--color-focus-outline) 0 0 0 2px}.k-date-field[data-disabled] .k-date-field-body{background:0 0}.k-date-field-body>.k-input[data-theme=field]{border:0;box-shadow:none;border-radius:var(--rounded)}.k-date-field-body>.k-input[data-invalid=true],.k-date-field-body>.k-input[data-invalid=true]:focus-within{border:0!important;box-shadow:none!important}.k-date-field-body>*{flex-grow:1;flex-basis:calc(var(--multiplier)*999);max-width:100%}.k-date-field-body .k-input[data-type=date]{min-width:60%}.k-date-field-body .k-input[data-type=time]{min-width:30%}.k-files-field[data-disabled=true] .k-item *{pointer-events:all!important}body{counter-reset:headline-counter}.k-headline-field{position:relative;padding-top:1.5rem}.k-fieldset>.k-grid .k-column:first-child .k-headline-field{padding-top:0}[dir=ltr] .k-headline-field .k-headline[data-numbered]:before{padding-right:.25rem}[dir=rtl] .k-headline-field .k-headline[data-numbered]:before{padding-left:.25rem}.k-headline-field .k-headline[data-numbered]:before{counter-increment:headline-counter;content:counter(headline-counter,decimal-leading-zero);color:var(--color-focus);font-weight:400}.k-info-field .k-headline{padding-bottom:.75rem;line-height:1.25rem}.k-layout-column{position:relative;height:100%;display:flex;flex-direction:column;background:var(--color-white);min-height:6rem}.k-layout-column:focus{outline:0}.k-layout-column .k-blocks{background:0 0;box-shadow:none;padding:0;height:100%;background:var(--color-white);min-height:4rem}.k-layout-column .k-blocks[data-empty=true]{min-height:6rem}.k-layout-column .k-blocks-list{display:flex;flex-direction:column;height:100%}.k-layout-column .k-blocks .k-block-container:last-of-type{flex-grow:1}.k-layout-column .k-blocks-empty{position:absolute;top:0;right:0;bottom:0;left:0;justify-content:center;opacity:0;transition:opacity .3s;border:0}.k-layout-column .k-blocks-empty:hover{opacity:1}[dir=ltr] .k-layout-column .k-blocks-empty.k-empty .k-icon{border-right:0}[dir=rtl] .k-layout-column .k-blocks-empty.k-empty .k-icon{border-left:0}.k-layout-column .k-blocks-empty.k-empty .k-icon{width:1rem}[dir=ltr] .k-layout{padding-right:var(--layout-toolbar-width)}[dir=rtl] .k-layout{padding-left:var(--layout-toolbar-width)}.k-layout{--layout-border-color:var(--color-gray-300);--layout-toolbar-width:2rem;position:relative;background:#fff;box-shadow:var(--shadow)}[dir=ltr] [data-disabled=true] .k-layout{padding-right:0}[dir=rtl] [data-disabled=true] .k-layout{padding-left:0}.k-layout:not(:last-of-type){margin-bottom:1px}.k-layout:focus{outline:0}[dir=ltr] .k-layout-toolbar{right:0}[dir=rtl] .k-layout-toolbar{left:0}[dir=ltr] .k-layout-toolbar{border-left:1px solid var(--color-light)}[dir=rtl] .k-layout-toolbar{border-right:1px solid var(--color-light)}.k-layout-toolbar{position:absolute;top:0;bottom:0;width:var(--layout-toolbar-width);display:flex;flex-direction:column;font-size:var(--text-sm);background:var(--color-gray-100);color:var(--color-gray-500)}.k-layout-toolbar:hover{color:var(--color-black)}.k-layout-toolbar-button{width:var(--layout-toolbar-width);height:var(--layout-toolbar-width)}.k-layout-toolbar .k-sort-handle{margin-top:auto;color:currentColor}.k-layout-columns.k-grid{grid-gap:1px;background:var(--layout-border-color);background:var(--color-gray-300)}.k-layout:not(:first-child) .k-layout-columns.k-grid{border-top:0}.k-layouts .k-sortable-ghost{position:relative;box-shadow:#11111140 0 5px 10px;outline:2px solid var(--color-focus);cursor:grabbing;cursor:-webkit-grabbing;z-index:1}.k-layout-selector.k-dialog{background:#313740;color:var(--color-white)}.k-layout-selector .k-headline{line-height:1;margin-top:-.25rem;margin-bottom:1.5rem}.k-layout-selector ul{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:1.5rem}.k-layout-selector-option .k-grid{height:5rem;grid-gap:2px;box-shadow:var(--shadow);cursor:pointer}.k-layout-selector-option:hover{outline:2px solid var(--color-green-300);outline-offset:2px}.k-layout-selector-option:last-child{margin-bottom:0}.k-layout-selector-option .k-column{display:flex;background:rgba(255,255,255,.2);justify-content:center;font-size:var(--text-xs);align-items:center}.k-line-field{position:relative;border:0;height:3rem;width:auto}.k-line-field:after{position:absolute;content:"";top:50%;margin-top:-1px;left:0;right:0;height:1px;background:var(--color-border)}.k-list-field .k-list-input{padding:.375rem .5rem .375rem .75rem}.k-table.k-object-field-table{table-layout:auto}.k-table.k-object-field-table tbody td,.k-table.k-object-field-table tbody th,.k-table.k-object-field-table tbody th button{cursor:pointer;overflow:hidden;text-overflow:ellipsis}.k-table.k-object-field-table tbody td{max-width:0}.k-pages-field[data-disabled=true] .k-item *{pointer-events:all!important}.k-structure-field:not([data-disabled=true]) td.k-table-column{cursor:pointer}.k-field-counter{display:none}.k-text-field:focus-within .k-field-counter{display:block}.k-users-field[data-disabled=true] .k-item *{pointer-events:all!important}.k-writer-field-input{line-height:1.5em;padding:.375rem .5rem}.k-aspect-ratio{position:relative;display:block;overflow:hidden;padding-bottom:100%}.k-aspect-ratio>*{position:absolute!important;top:0;right:0;bottom:0;left:0;height:100%;width:100%;-o-object-fit:contain;object-fit:contain}.k-aspect-ratio[data-cover=true]>*{-o-object-fit:cover;object-fit:cover}.k-bar{display:flex;align-items:center;justify-content:space-between;line-height:1}.k-bar-slot{flex-grow:1}.k-bar-slot[data-position=center]{text-align:center}[dir=ltr] .k-bar-slot[data-position=right]{text-align:right}[dir=rtl] .k-bar-slot[data-position=right]{text-align:left}.k-box{word-wrap:break-word;font-size:var(--text-sm)}.k-box:not([data-theme=none]){background:var(--color-white);border-radius:var(--rounded);line-height:1.25rem;padding:.5rem .75rem}.k-box[data-theme=code]{background:var(--color-gray-900);border:1px solid var(--color-black);color:var(--color-light);font-family:Input,Menlo,monospace;font-size:var(--text-sm);line-height:1.5}.k-box[data-theme=button]{padding:0}[dir=ltr] .k-box[data-theme=button] .k-button{text-align:left}[dir=rtl] .k-box[data-theme=button] .k-button{text-align:right}.k-box[data-theme=button] .k-button{padding:0 .75rem;height:2.25rem;width:100%;display:flex;align-items:center;line-height:2rem}[dir=ltr] .k-box[data-theme=info],[dir=ltr] .k-box[data-theme=negative],[dir=ltr] .k-box[data-theme=notice],[dir=ltr] .k-box[data-theme=positive]{border-left-color:var(--theme-light)}[dir=rtl] .k-box[data-theme=info],[dir=rtl] .k-box[data-theme=negative],[dir=rtl] .k-box[data-theme=notice],[dir=rtl] .k-box[data-theme=positive]{border-right-color:var(--theme-light)}.k-box[data-theme=info],.k-box[data-theme=negative],.k-box[data-theme=notice],.k-box[data-theme=positive]{border:0;background:var(--theme-bg)}[dir=ltr] .k-box[data-theme=empty]{border-left:0}[dir=rtl] .k-box[data-theme=empty]{border-right:0}.k-box[data-theme=empty]{text-align:center;padding:3rem 1.5rem;display:flex;justify-content:center;align-items:center;flex-direction:column;background:var(--color-background);border:1px dashed var(--color-border)}.k-box[data-theme=empty] .k-icon{margin-bottom:.5rem;color:var(--color-gray-500)}.k-box[data-theme=empty],.k-box[data-theme=empty] p{color:var(--color-gray-600)}.k-bubble{display:flex;padding:0 .5rem;white-space:nowrap;align-items:center;line-height:1.5;font-size:var(--text-xs);height:1.525rem;background:var(--color-light);color:var(--color-black);border-radius:var(--rounded);overflow:hidden}[dir=ltr] .k-bubble .k-item-figure{margin-left:-.5rem}[dir=rtl] .k-bubble .k-item-figure{margin-right:-.5rem}[dir=ltr] .k-bubble .k-item-figure{margin-right:var(--spacing-2)}[dir=rtl] .k-bubble .k-item-figure{margin-left:var(--spacing-2)}.k-bubble .k-item-figure{width:1.525rem;height:1.525rem}.k-bubbles{display:flex;gap:.25rem}.k-collection-help{padding:.5rem .75rem}.k-collection-footer{display:flex;justify-content:space-between;margin-left:-.75rem;margin-right:-.75rem}.k-collection-pagination{line-height:1.25rem;flex-shrink:0;min-height:2.75rem}.k-collection-pagination .k-pagination .k-button{padding:.5rem .75rem;line-height:1.125rem}.k-column{min-width:0;grid-column-start:span 12}.k-column[data-sticky=true]>div{position:sticky;top:4vh;z-index:2}@media screen and (min-width:65em){.k-column[data-width="1/1"],.k-column[data-width="12/12"],.k-column[data-width="2/2"],.k-column[data-width="3/3"],.k-column[data-width="4/4"],.k-column[data-width="6/6"]{grid-column-start:span 12}.k-column[data-width="11/12"]{grid-column-start:span 11}.k-column[data-width="10/12"],.k-column[data-width="5/6"]{grid-column-start:span 10}.k-column[data-width="3/4"],.k-column[data-width="9/12"]{grid-column-start:span 9}.k-column[data-width="2/3"],.k-column[data-width="4/6"],.k-column[data-width="8/12"]{grid-column-start:span 8}.k-column[data-width="7/12"]{grid-column-start:span 7}.k-column[data-width="1/2"],.k-column[data-width="2/4"],.k-column[data-width="3/6"],.k-column[data-width="6/12"]{grid-column-start:span 6}.k-column[data-width="5/12"]{grid-column-start:span 5}.k-column[data-width="1/3"],.k-column[data-width="2/6"],.k-column[data-width="4/12"]{grid-column-start:span 4}.k-column[data-width="1/4"],.k-column[data-width="3/12"]{grid-column-start:span 3}.k-column[data-width="1/6"],.k-column[data-width="2/12"]{grid-column-start:span 2}.k-column[data-width="1/12"]{grid-column-start:span 1}}.k-column[data-disabled=true]{cursor:not-allowed;opacity:.4}.k-column[data-disabled=true] *{pointer-events:none}.k-column[data-disabled=true] .k-text[data-theme=help] *{pointer-events:initial}.k-dropzone{position:relative}.k-dropzone:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;display:none;pointer-events:none;z-index:1}.k-dropzone[data-over=true]:after{display:block;outline:1px solid var(--color-focus);box-shadow:var(--color-focus-outline) 0 0 0 3px}.k-empty{display:flex;align-items:stretch;border-radius:var(--rounded);color:var(--color-gray-600);border:1px dashed var(--color-border)}button.k-empty{width:100%}button.k-empty:focus{outline:0}.k-empty p{font-size:var(--text-sm);color:var(--color-gray-600)}.k-empty>.k-icon{color:var(--color-gray-500)}.k-empty[data-layout=cardlets],.k-empty[data-layout=cards]{text-align:center;padding:1.5rem;justify-content:center;flex-direction:column}.k-empty[data-layout=cardlets] .k-icon,.k-empty[data-layout=cards] .k-icon{margin-bottom:1rem}.k-empty[data-layout=cardlets] .k-icon svg,.k-empty[data-layout=cards] .k-icon svg{width:2rem;height:2rem}.k-empty[data-layout=list],.k-empty[data-layout=table]{min-height:38px}[dir=ltr] .k-empty[data-layout=list]>.k-icon,[dir=ltr] .k-empty[data-layout=table]>.k-icon{border-right:1px solid rgba(0,0,0,.05)}[dir=rtl] .k-empty[data-layout=list]>.k-icon,[dir=rtl] .k-empty[data-layout=table]>.k-icon{border-left:1px solid rgba(0,0,0,.05)}.k-empty[data-layout=list]>.k-icon,.k-empty[data-layout=table]>.k-icon{width:36px;min-height:36px}.k-empty[data-layout=list]>p,.k-empty[data-layout=table]>p{line-height:1.25rem;padding:.5rem .75rem}.k-file-preview{background:var(--color-gray-800)}.k-file-preview-layout{display:grid;grid-template-columns:50%auto}.k-file-preview-layout>*{min-width:0}.k-file-preview-image{position:relative;display:flex;align-items:center;justify-content:center;background:var(--bg-pattern)}.k-file-preview-image-link{display:block;width:100%;padding:min(4vw,3rem);outline:0}.k-file-preview-image-link[data-tabbed=true]{box-shadow:none;outline:2px solid var(--color-focus);outline-offset:-2px}.k-file-preview-details{padding:1.5rem;flex-grow:1}.k-file-preview-details ul{line-height:1.5em;max-width:50rem;display:grid;grid-gap:1.5rem 3rem;grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}.k-file-preview-details h3{font-size:var(--text-sm);font-weight:500;color:var(--color-gray-500)}.k-file-preview-details a,.k-file-preview-details p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#ffffffbf;font-size:var(--text-sm)}@media screen and (min-width:30em){.k-file-preview-details ul{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}}@media screen and (max-width:65em){.k-file-preview-layout{padding:0!important}}@media screen and (min-width:65em){.k-file-preview-layout{grid-template-columns:33.333%auto;align-items:center}.k-file-preview-details{padding:3rem}}@media screen and (min-width:90em){.k-file-preview-layout{grid-template-columns:25%auto}}.k-grid{--columns:12;display:grid;grid-column-gap:0;grid-row-gap:0;grid-template-columns:1fr}@media screen and (min-width:30em){.k-grid[data-gutter=small]{grid-column-gap:1rem;grid-row-gap:1rem}.k-grid[data-gutter=huge],.k-grid[data-gutter=large],.k-grid[data-gutter=medium]{grid-column-gap:1.5rem;grid-row-gap:1.5rem}}@media screen and (min-width:65em){.k-grid{grid-template-columns:repeat(var(--columns),1fr)}.k-grid[data-gutter=large]{grid-column-gap:3rem}.k-grid[data-gutter=huge]{grid-column-gap:4.5rem}}@media screen and (min-width:90em){.k-grid[data-gutter=large]{grid-column-gap:4.5rem}.k-grid[data-gutter=huge]{grid-column-gap:6rem}}@media screen and (min-width:120em){.k-grid[data-gutter=large]{grid-column-gap:6rem}.k-grid[data-gutter=huge]{grid-column-gap:7.5rem}}.k-header{padding-top:4vh;margin-bottom:2rem;border-bottom:1px solid var(--color-border)}.k-header[data-tabs=true]{border-bottom:0}.k-header .k-headline{min-height:1.25em;margin-bottom:.5rem;word-wrap:break-word}.k-header .k-header-buttons{margin-top:-.5rem;height:3.25rem}.k-header .k-headline-editable{cursor:pointer}[dir=ltr] .k-header .k-headline-editable .k-icon{margin-left:.5rem}[dir=rtl] .k-header .k-headline-editable .k-icon{margin-right:.5rem}.k-header .k-headline-editable .k-icon{color:var(--color-gray-500);opacity:0;transition:opacity .3s;display:inline-block}.k-header .k-headline-editable:hover .k-icon{opacity:1}.k-panel-inside{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column}.k-panel-inside:focus{outline:0}.k-panel-header{z-index:var(--z-navigation);flex-shrink:0}.k-panel-view{flex-grow:1;padding-bottom:6rem}.k-item{position:relative;background:var(--color-white);border-radius:var(--rounded);box-shadow:var(--shadow);display:grid;grid-template-columns:auto;line-height:1}.k-item a:focus,.k-item:focus{outline:0}.k-item.k-sortable-ghost,.k-item:focus-within{box-shadow:var(--shadow-outline)}.k-item-sort-handle.k-sort-handle{position:absolute;opacity:0;width:1.25rem;height:1.5rem;z-index:2;border-radius:1px}.k-item:hover .k-item-sort-handle{opacity:1}.k-item-figure{grid-area:figure}.k-item-content{grid-area:content;overflow:hidden}.k-item-info,.k-item-title{font-size:var(--text-sm);font-weight:400;text-overflow:ellipsis;white-space:nowrap;line-height:1.125rem;overflow:hidden}.k-item-info{grid-area:info;color:var(--color-gray-500)}.k-item-title-link.k-link[data-=true]{box-shadow:none}.k-item-title-link:after{position:absolute;content:"";top:0;right:0;bottom:0;left:0;z-index:1}.k-item-footer{grid-area:footer;display:flex;justify-content:space-between;align-items:center;min-width:0}[dir=ltr] .k-item-label{margin-right:.5rem}[dir=rtl] .k-item-label{margin-left:.5rem}.k-item-buttons{position:relative;display:flex;justify-content:flex-end;flex-shrink:0;flex-grow:1}.k-item-buttons>.k-button,.k-item-buttons>.k-dropdown{position:relative;width:38px;height:38px;display:flex!important;align-items:center;justify-content:center;line-height:1}.k-item-buttons>.k-button{z-index:1}.k-item-buttons>.k-options-dropdown>.k-options-dropdown-toggle{z-index:var(--z-toolbar)}.k-list-item{display:flex;align-items:center;height:38px}[dir=ltr] .k-list-item .k-item-sort-handle{left:-1.5rem}[dir=rtl] .k-list-item .k-item-sort-handle{right:-1.5rem}.k-list-item .k-item-sort-handle{width:1.5rem}[dir=ltr] .k-list-item .k-item-figure{border-top-left-radius:var(--rounded)}[dir=rtl] .k-list-item .k-item-figure{border-top-right-radius:var(--rounded)}[dir=ltr] .k-list-item .k-item-figure{border-bottom-left-radius:var(--rounded)}[dir=rtl] .k-list-item .k-item-figure{border-bottom-right-radius:var(--rounded)}.k-list-item .k-item-figure{width:38px}[dir=ltr] .k-list-item .k-item-content{margin-left:.75rem}[dir=rtl] .k-list-item .k-item-content{margin-right:.75rem}.k-list-item .k-item-content{display:flex;flex-grow:1;flex-shrink:2;justify-content:space-between;align-items:center}.k-list-item .k-item-info,.k-list-item .k-item-title{flex-grow:1;line-height:1.5rem}[dir=ltr] .k-list-item .k-item-title{margin-right:.5rem}[dir=rtl] .k-list-item .k-item-title{margin-left:.5rem}.k-list-item .k-item-title{flex-shrink:1}[dir=ltr] .k-list-item .k-item-info{text-align:right}[dir=rtl] .k-list-item .k-item-info{text-align:left}[dir=ltr] .k-list-item .k-item-info{margin-right:.5rem}[dir=rtl] .k-list-item .k-item-info{margin-left:.5rem}.k-list-item .k-item-info{flex-shrink:2;justify-self:end}.k-list-item .k-item-buttons,.k-list-item .k-item-footer{flex-shrink:0}.k-item:not(.k-list-item) .k-item-sort-handle{margin:var(--spacing-2);background:var(--color-background);box-shadow:var(--shadow-lg);border-radius:var(--rounded-sm)}[dir=ltr] .k-item:not(.k-list-item) .k-item-label{margin-left:-2px}[dir=rtl] .k-item:not(.k-list-item) .k-item-label{margin-right:-2px}.k-item:not(.k-list-item) .k-item-content{padding:.625rem .75rem}.k-cardlets-item{height:6rem;grid-template-rows:auto 38px;grid-template-areas:"content""footer"}.k-cardlets-item[data-has-figure=true]{grid-template-columns:6rem auto;grid-template-areas:"figure content""figure footer"}[dir=ltr] .k-cardlets-item .k-item-figure{border-top-left-radius:var(--rounded)}[dir=rtl] .k-cardlets-item .k-item-figure{border-top-right-radius:var(--rounded)}[dir=ltr] .k-cardlets-item .k-item-figure{border-bottom-left-radius:var(--rounded)}[dir=rtl] .k-cardlets-item .k-item-figure{border-bottom-right-radius:var(--rounded)}.k-cardlets-item .k-item-footer{padding-top:.5rem;padding-bottom:.5rem}.k-cards-item{grid-template-columns:auto;grid-template-rows:auto 1fr;grid-template-areas:"figure""content";--item-content-wrapper:0}[dir=ltr] .k-cards-item .k-item-figure,[dir=rtl] .k-cards-item .k-item-figure{border-top-right-radius:var(--rounded);border-top-left-radius:var(--rounded)}.k-cards-item .k-item-content{padding:.5rem .75rem!important;overflow:hidden}.k-cards-item .k-item-info,.k-cards-item .k-item-title{line-height:1.375rem;white-space:normal}.k-cards-item .k-item-info:after,.k-cards-item .k-item-title:after{display:inline-block;content:"\a0";width:var(--item-content-wrapper)}.k-cards-item[data-has-flag=true],.k-cards-item[data-has-options=true]{--item-content-wrapper:38px}.k-cards-item[data-has-flag=true][data-has-options=true]{--item-content-wrapper:76px}.k-cards-item[data-has-info=true] .k-item-title:after{display:none}[dir=ltr] .k-cards-item .k-item-footer{right:0}[dir=rtl] .k-cards-item .k-item-footer{left:0}.k-cards-item .k-item-footer{position:absolute;bottom:0;width:auto}.k-item-figure{overflow:hidden;flex-shrink:0}.k-cards-items{--min:13rem;--max:1fr;--gap:1.5rem;--column-gap:var(--gap);--row-gap:var(--gap);display:grid;grid-column-gap:var(--column-gap);grid-row-gap:var(--row-gap);grid-template-columns:repeat(auto-fill,minmax(var(--min),var(--max)))}@media screen and (min-width:30em){.k-cards-items[data-size=tiny]{--min:10rem}.k-cards-items[data-size=small]{--min:16rem}.k-cards-items[data-size=medium]{--min:24rem}.k-cards-items[data-size=huge],.k-cards-items[data-size=large],.k-column[data-width="1/4"] .k-cards-items,.k-column[data-width="1/5"] .k-cards-items,.k-column[data-width="1/6"] .k-cards-items{--min:1fr}}@media screen and (min-width:65em){.k-cards-items[data-size=large]{--min:32rem}}.k-cardlets-items{display:grid;grid-template-columns:repeat(auto-fill,minmax(16rem,1fr));grid-gap:.5rem}.k-list-items .k-list-item:not(:last-child){margin-bottom:2px}.k-overlay{position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:var(--z-dialog);transform:translateZ(0)}.k-overlay[data-centered=true]{display:flex;align-items:center;justify-content:center}.k-overlay[data-dimmed=true]{background:var(--color-backdrop)}.k-overlay-loader{color:var(--color-white)}.k-panel[data-loading=true]{animation:LoadingCursor .5s}.k-panel[data-dragging=true],.k-panel[data-loading=true]:after{-webkit-user-select:none;-moz-user-select:none;user-select:none}.k-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(14rem,1fr));grid-auto-rows:1fr;grid-gap:var(--spacing-2px)}.k-stat{display:flex;flex-direction:column;background:var(--color-white);box-shadow:var(--shadow);padding:var(--spacing-3) var(--spacing-6);line-height:var(--leading-normal);border-radius:var(--rounded)}.k-stat.k-link:hover{cursor:pointer;background:var(--color-gray-100)}.k-stat dd,.k-stat dt{display:block}.k-stat-value{font-size:var(--value);margin-bottom:var(--spacing-1);order:1}.k-stat-info,.k-stat-label{font-size:var(--text-xs)}.k-stat-label{order:2}.k-stat-info{order:3;color:var(--theme, var(--color-gray-500))}.k-stats[data-size=small]{--value:var(--text-base)}.k-stats[data-size=medium]{--value:var(--text-xl)}.k-stats[data-size=large]{--value:var(--text-2xl)}.k-stats[data-size=huge]{--value:var(--text-3xl)}.k-table{--table-row-height:38px;position:relative;background:var(--color-white);font-size:var(--text-sm);box-shadow:var(--shadow);border-radius:var(--rounded)}.k-table table{width:100%;border-spacing:0;table-layout:fixed;font-variant-numeric:tabular-nums}.k-table[data-invalid]{border:0;box-shadow:var(--color-negative-outline) 0 0 0 1px,var(--color-negative-outline) 0 0 3px 2px}.k-table td,.k-table th{height:var(--table-row-height);overflow:hidden;text-overflow:ellipsis;line-height:1.25em}.k-table td{width:100%}[dir=ltr] .k-table tbody tr:first-child th,[dir=ltr] .k-table thead th:first-child{border-top-left-radius:var(--rounded)}[dir=rtl] .k-table tbody tr:first-child th,[dir=rtl] .k-table thead th:first-child{border-top-right-radius:var(--rounded)}[dir=ltr] .k-table thead th:last-child{border-top-right-radius:var(--rounded)}[dir=rtl] .k-table thead th:last-child{border-top-left-radius:var(--rounded)}[dir=ltr] .k-table td:last-child,[dir=ltr] .k-table th:last-child{border-right:0}[dir=rtl] .k-table td:last-child,[dir=rtl] .k-table th:last-child{border-left:0}.k-table td:last-child,.k-table th:last-child{height:var(--table-row-height)}.k-table th,.k-table tr:not(:last-child) td{border-bottom:1px solid var(--color-background)}.k-table td:last-child{overflow:visible}[dir=ltr] .k-table td,[dir=ltr] .k-table th{border-right:1px solid var(--color-background)}[dir=rtl] .k-table td,[dir=rtl] .k-table th{border-left:1px solid var(--color-background)}[dir=ltr] .k-table td,[dir=ltr] .k-table th,[dir=ltr] .k-table th button{text-align:left}[dir=rtl] .k-table td,[dir=rtl] .k-table th,[dir=rtl] .k-table th button{text-align:right}.k-table th{padding:0 .75rem;font-family:var(--font-mono);font-size:var(--text-xs);font-weight:400;color:var(--color-gray-600);background:var(--color-gray-100);width:100%}.k-table th button{font:inherit;display:block;padding:0 .75rem;height:100%;width:100%;border-radius:var(--rounded)}.k-table th button:focus-visible{outline:2px solid var(--color-black);outline-offset:-2px}.k-table tbody tr:hover td{background:rgba(239,239,239,.25)}.k-table thead th{position:sticky;top:0;left:0;right:0;z-index:1}.k-table tbody th{width:auto;white-space:nowrap;padding:0;overflow:visible;border-radius:0}[dir=ltr] .k-table tbody tr:last-child th{border-bottom-left-radius:var(--rounded)}[dir=rtl] .k-table tbody tr:last-child th{border-bottom-right-radius:var(--rounded)}.k-table tbody tr:last-child th{border-bottom:0}.k-table-column[data-align]{text-align:var(--align)!important}.k-table-column[data-align=right]>.k-input{flex-direction:column;align-items:flex-end}.k-table .k-sort-handle,.k-table-index{display:grid;place-items:center;width:100%;height:var(--table-row-height)}.k-table .k-sort-handle,.k-table tr:hover .k-table-index-column[data-sortable=true] .k-table-index{display:none}.k-table tr:hover .k-sort-handle{display:grid!important}.k-table-row-ghost{background:var(--color-white);box-shadow:var(--shadow-outline);outline:2px solid var(--color-black);border-radius:var(--rounded);margin-bottom:2px;cursor:grabbing;cursor:-webkit-grabbing}.k-table-row-fallback{opacity:0!important}td.k-table-index-column,td.k-table-options-column,th.k-table-index-column,th.k-table-options-column{width:var(--table-row-height);text-align:center!important}.k-table-index{font-size:var(--text-xs);color:var(--color-gray-500);line-height:1.1em}.k-table-empty{color:var(--color-gray-600);font-size:var(--text-sm)}[data-disabled=true] .k-table{background:var(--color-gray-100)}[data-disabled=true] .k-table tbody td,[data-disabled=true] .k-table th{border-color:var(--color-gray-200)}[data-disabled=true] .k-table td:last-child{overflow:hidden;text-overflow:ellipsis}@media screen and (max-width:65em){.k-table tbody td:not([data-mobile]),.k-table thead th:not([data-mobile]){display:none}}[dir=ltr] .k-table-pagination.k-pagination,[dir=rtl] .k-table-pagination.k-pagination{border-bottom-right-radius:var(--rounded);border-bottom-left-radius:var(--rounded)}.k-table-pagination.k-pagination{border-top:1px solid var(--color-gray-200);background:var(--color-gray-100);display:flex;justify-content:space-between;align-items:center;height:var(--table-row-height)}.k-table-pagination.k-pagination .k-button{padding:0 .75rem;display:flex;align-items:center;line-height:1;height:var(--table-row-height)}.k-table-update-status-cell{padding:0 .75rem;display:flex;align-items:center;height:100%}.k-table-update-status-cell-button,.k-table-update-status-cell-version{font-variant-numeric:tabular-nums}.k-table-update-status-cell-button{display:inline-flex;padding:.25rem 1.5rem .25rem .325rem;border-radius:var(--rounded);line-height:1;align-items:center;background:var(--color-gray-200)}.k-table-update-status-cell-button .k-button-text:after{position:absolute;top:50%;right:.5rem;margin-top:-2px;content:"";border-top:4px solid #000;border-left:4px solid transparent;border-right:4px solid transparent}.k-table-update-status-cell-button .k-icon{color:var(--theme)}.k-plugin-info{padding:1rem}.k-plugin-info div+div{margin-top:.5rem}.k-plugin-info dt{color:var(--color-gray-400);margin-right:.5rem}.k-plugin-info dd[data-theme]{color:var(--theme-light)}.k-plugin-info+.k-dropdown-item{padding-top:.75rem;border-top:1px solid var(--color-gray-700)}@media screen and (min-width:30em){.k-plugin-info{width:20rem}.k-plugin-info div{display:flex}}.k-tabs{position:relative;background:#e9e9e9;border:1px solid var(--color-border);border-radius:var(--rounded)}.k-tabs nav{display:flex;justify-content:center;margin-left:-1px;margin-right:-1px}[dir=ltr] .k-tab-button.k-button{border-left:1px solid transparent}[dir=rtl] .k-tab-button.k-button{border-right:1px solid transparent}[dir=ltr] .k-tab-button.k-button{border-right:1px solid var(--color-border)}[dir=rtl] .k-tab-button.k-button{border-left:1px solid var(--color-border)}.k-tab-button.k-button{position:relative;z-index:1;display:inline-flex;justify-content:center;align-items:center;padding:.625rem .75rem;font-size:var(--text-xs);text-transform:uppercase;text-align:center;font-weight:500;flex-grow:1;flex-shrink:1;flex-direction:column;max-width:15rem}@media screen and (min-width:30em){.k-tab-button.k-button{flex-direction:row}[dir=ltr] .k-tab-button.k-button .k-icon{margin-right:.5rem}[dir=rtl] .k-tab-button.k-button .k-icon{margin-left:.5rem}}[dir=ltr] .k-tab-button.k-button>.k-button-text{padding-left:0}[dir=rtl] .k-tab-button.k-button>.k-button-text{padding-right:0}.k-tab-button.k-button>.k-button-text{padding-top:.375rem;font-size:10px;overflow:hidden;max-width:10rem;text-overflow:ellipsis;opacity:1}@media screen and (min-width:30em){.k-tab-button.k-button>.k-button-text{font-size:var(--text-xs);padding-top:0}}[dir=ltr] .k-tab-button:last-child{border-right:1px solid transparent}[dir=rtl] .k-tab-button:last-child{border-left:1px solid transparent}[dir=ltr] .k-tab-button[aria-current]{border-right:1px solid var(--color-border)}[dir=rtl] .k-tab-button[aria-current]{border-left:1px solid var(--color-border)}.k-tab-button[aria-current]{position:relative;background:var(--color-background);pointer-events:none}[dir=ltr] .k-tab-button[aria-current]:first-child{border-left:1px solid var(--color-border)}[dir=rtl] .k-tab-button[aria-current]:first-child{border-right:1px solid var(--color-border)}.k-tab-button[aria-current]:after,.k-tab-button[aria-current]:before{position:absolute;content:""}.k-tab-button[aria-current]:before{left:-1px;right:-1px;top:-1px;height:2px;background:var(--color-black)}.k-tab-button[aria-current]:after{left:0;right:0;bottom:-1px;height:1px;background:var(--color-background)}[dir=ltr] .k-tabs-dropdown{right:0}[dir=rtl] .k-tabs-dropdown{left:0}.k-tabs-dropdown{top:100%}[dir=ltr] .k-tabs-badge{right:2px}[dir=rtl] .k-tabs-badge{left:2px}.k-tabs-badge{position:absolute;top:3px;font-variant-numeric:tabular-nums;line-height:1.5;padding:0 .25rem;border-radius:2px;font-size:10px;box-shadow:var(--shadow-md)}.k-tabs[data-theme=notice] .k-tabs-badge{background:var(--theme-light);color:var(--color-black)}.k-view{padding-left:1.5rem;padding-right:1.5rem;margin:0 auto;max-width:100rem}@media screen and (min-width:30em){.k-view{padding-left:3rem;padding-right:3rem}}@media screen and (min-width:90em){.k-view{padding-left:6rem;padding-right:6rem}}.k-view[data-align=center]{height:100vh;display:flex;align-items:center;justify-content:center;padding:0 3rem;overflow:auto}.k-view[data-align=center]>*{flex-basis:22.5rem}.k-fatal{position:fixed;top:0;right:0;bottom:0;left:0;background:var(--color-backdrop);display:flex;z-index:var(--z-fatal);align-items:center;justify-content:center;padding:1.5rem}.k-fatal-box{width:100%;height:100%;display:flex;flex-direction:column;color:var(--color-black);background:var(--color-red-400);box-shadow:var(--shadow-xl);border-radius:var(--rounded)}.k-fatal-box .k-headline{line-height:1;font-size:var(--text-sm);padding:.75rem}.k-fatal-box .k-button{padding:.75rem}.k-fatal-iframe{border:0;width:100%;flex-grow:1;background:var(--color-white)}.k-headline{--size:var(--text-base);font-size:var(--size);font-weight:var(--font-bold);line-height:1.5em}.k-headline[data-size=small]{--size:var(--text-sm)}.k-headline[data-size=large]{--size:var(--text-xl);font-weight:var(--font-normal)}@media screen and (min-width:65em){.k-headline[data-size=large]{--size:var(--text-2xl)}}.k-headline[data-size=huge]{--size:var(--text-2xl);line-height:1.15em}@media screen and (min-width:65em){.k-headline[data-size=huge]{--size:var(--text-3xl)}}.k-headline[data-theme]{color:var(--theme)}[dir=ltr] .k-headline abbr{padding-left:.25rem}[dir=rtl] .k-headline abbr{padding-right:.25rem}.k-headline abbr{color:var(--color-gray-500);text-decoration:none}.k-icon{--size:1rem;position:relative;line-height:0;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:var(--size)}.k-icon[data-size=medium]{--size:2rem}.k-icon[data-size=large]{--size:3rem}.k-icon svg{width:var(--size);height:var(--size);-moz-transform:scale(1)}.k-icon svg *{fill:currentColor}.k-icon[data-back=black]{color:var(--color-white)}.k-icon[data-back=white]{color:var(--color-gray-900)}.k-icon[data-back=pattern]{color:var(--color-white)}[data-disabled=true] .k-icon[data-back=pattern] svg{opacity:1}.k-icon-emoji{display:block;line-height:1;font-style:normal;font-size:var(--size)}@media not all,not all,not all,only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){.k-icon-emoji{font-size:1.25em}}.k-icons{position:absolute;width:0;height:0}.k-image span{position:relative;display:block;line-height:0;padding-bottom:100%}.k-image img{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;-o-object-fit:contain;object-fit:contain}[dir=ltr] .k-image-error{left:50%}[dir=rtl] .k-image-error{right:50%}.k-image-error{position:absolute;top:50%;transform:translate(-50%,-50%);color:var(--color-white);font-size:.9em}.k-image-error svg *{fill:#ffffff4d}.k-image[data-cover=true] img{-o-object-fit:cover;object-fit:cover}.k-image[data-back=black] span{background:var(--color-gray-900)}.k-image[data-back=white] span{background:var(--color-white);color:var(--color-gray-900)}.k-image[data-back=white] .k-image-error{background:var(--color-gray-900);color:var(--color-white)}.k-image[data-back=pattern] span{background:var(--color-gray-800) var(--bg-pattern)}.k-loader{z-index:1}.k-loader-icon{animation:Spin .9s linear infinite}.k-offline-warning{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--z-offline);background:var(--color-backdrop);display:flex;align-items:center;justify-content:center;line-height:1}.k-offline-warning p{display:flex;align-items:center;gap:.5rem;background:var(--color-white);box-shadow:var(--shadow);padding:.75rem;border-radius:var(--rounded)}.k-offline-warning p .k-icon{color:var(--color-red-400)}.k-progress{-webkit-appearance:none;width:100%;height:.5rem;border-radius:5rem;background:var(--color-border);overflow:hidden;border:0}.k-progress::-webkit-progress-bar{border:0;background:var(--color-border);height:.5rem;border-radius:20px}.k-progress::-webkit-progress-value{border-radius:inherit;background:var(--color-focus);-webkit-transition:width .3s;transition:width .3s}.k-progress::-moz-progress-bar{border-radius:inherit;background:var(--color-focus);-moz-transition:width .3s;transition:width .3s}[dir=ltr] .k-registration,[dir=ltr] .k-registration p{margin-right:1rem}[dir=rtl] .k-registration,[dir=rtl] .k-registration p{margin-left:1rem}.k-registration{display:flex;align-items:center}.k-registration p{color:var(--color-negative-light);font-size:var(--text-sm);font-weight:600}@media screen and (max-width:90em){.k-registration p{display:none}}.k-registration .k-button{color:var(--color-white)}.k-sort-handle{cursor:move;cursor:grab;cursor:-webkit-grab;color:var(--color-gray-900);justify-content:center;align-items:center;line-height:0;width:2rem;height:2rem;display:flex;will-change:opacity,color;transition:opacity .3s;z-index:1}.k-sort-handle svg{width:1rem;height:1rem}.k-sort-handle:active{cursor:grabbing;cursor:-webkit-grabbing}.k-status-icon svg{width:14px;height:14px}.k-status-icon .k-icon{color:var(--theme-light)}.k-status-icon .k-button-text{color:var(--color-black)}.k-status-icon[data-disabled=true]{opacity:1!important}.k-status-icon[data-disabled=true] .k-icon{color:var(--color-gray-400);opacity:.5}.k-text{line-height:1.5em}[dir=ltr] .k-text ol,[dir=ltr] .k-text ul{margin-left:1rem}[dir=rtl] .k-text ol,[dir=rtl] .k-text ul{margin-right:1rem}.k-text li{list-style:inherit}.k-text p,.k-text>ol,.k-text>ul{margin-bottom:1.5em}.k-text a{text-decoration:underline}.k-text>:last-child{margin-bottom:0}.k-text[data-size=tiny]{font-size:var(--text-xs)}.k-text[data-size=small]{font-size:var(--text-sm)}.k-text[data-size=medium]{font-size:var(--text-base)}.k-text[data-size=large]{font-size:var(--text-xl)}.k-text[data-align]{text-align:var(--align)}.k-text[data-theme=help]{font-size:var(--text-sm);color:var(--color-gray-600);line-height:1.25rem}.k-dialog-body .k-text{word-wrap:break-word}.k-user-info{display:flex;align-items:center;line-height:1;font-size:var(--text-sm)}[dir=ltr] .k-user-info .k-image{margin-right:.75rem}[dir=rtl] .k-user-info .k-image{margin-left:.75rem}.k-user-info .k-image{width:1.5rem}[dir=ltr] .k-user-info .k-icon{margin-right:.75rem}[dir=rtl] .k-user-info .k-icon{margin-left:.75rem}.k-user-info .k-icon{width:1.5rem;height:1.5rem;background:var(--color-black);color:var(--color-white)}.k-breadcrumb{padding-left:.5rem;padding-right:.5rem}.k-breadcrumb-dropdown{height:2.5rem;width:2.5rem;display:flex;align-items:center;justify-content:center}.k-breadcrumb ol{display:none;align-items:center}@media screen and (min-width:30em){.k-breadcrumb ol{display:flex}.k-breadcrumb-dropdown{display:none}}.k-breadcrumb li,.k-breadcrumb-link{display:flex;align-items:center;min-width:0}.k-breadcrumb-link{font-size:var(--text-sm);align-self:stretch;padding-top:.625rem;padding-bottom:.625rem;line-height:1.25rem}.k-breadcrumb li{flex-shrink:3}.k-breadcrumb li:last-child{flex-shrink:1}.k-breadcrumb li:not(:last-child):after{content:"/";padding-left:.5rem;padding-right:.5rem;opacity:.5;flex-shrink:0}.k-breadcrumb li:not(:first-child):not(:last-child){max-width:15vw}[dir=ltr] .k-breadcrumb-icon{margin-right:.5rem}[dir=rtl] .k-breadcrumb-icon{margin-left:.5rem}.k-breadcrumb-icon.k-loader{opacity:.5}.k-breadcrumb-link-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}button{line-height:inherit;border:0;font-family:var(--font-sans);font-size:1rem;color:currentColor;background:0 0;cursor:pointer}button::-moz-focus-inner{padding:0;border:0}.k-button{display:inline-block;position:relative;font-size:var(--text-sm);transition:color .3s;outline:0}.k-button:focus,.k-button:hover{outline:0}.k-button *{vertical-align:middle}.k-button[data-responsive=true] .k-button-text{display:none}@media screen and (min-width:30em){.k-button[data-responsive=true] .k-button-text{display:inline}}.k-button[data-theme]{color:var(--theme)}.k-button-icon{display:inline-flex;align-items:center;line-height:0}[dir=ltr] .k-button-icon~.k-button-text{padding-left:.5rem}[dir=rtl] .k-button-icon~.k-button-text{padding-right:.5rem}.k-button-text{opacity:.75}.k-button:focus .k-button-text,.k-button:hover .k-button-text{opacity:1}.k-button-text b,.k-button-text span{vertical-align:baseline}.k-button[data-disabled=true]{opacity:.5;pointer-events:none;cursor:default}.k-card-options>.k-button[data-disabled=true]{display:inline-flex}.k-button-group{--padding-x:.75rem;--padding-y:1rem;--line-height:1rem;font-size:0;margin:0 calc(var(--padding-x)*-1)}.k-button-group>.k-dropdown{height:calc(var(--line-height) + (var(--padding-y)*2));display:inline-block}.k-button-group>.k-button,.k-button-group>.k-dropdown>.k-button{padding:var(--padding-y) var(--padding-x);line-height:var(--line-height)}.k-button-group .k-dropdown-content{top:calc(100% + 1px);margin:0 var(--padding-x)}.k-dropdown{position:relative}[dir=ltr] .k-dropdown-content{text-align:left}[dir=rtl] .k-dropdown-content{text-align:right}.k-dropdown-content{position:absolute;top:100%;background:var(--color-black);color:var(--color-white);z-index:var(--z-dropdown);box-shadow:var(--shadow-lg);border-radius:var(--rounded);margin-bottom:6rem}[dir=ltr] .k-dropdown-content[data-align=left]{left:0}[dir=ltr] .k-dropdown-content[data-align=right],[dir=rtl] .k-dropdown-content[data-align=left]{right:0}[dir=rtl] .k-dropdown-content[data-align=right]{left:0}.k-dropdown-content>.k-dropdown-item:first-child{margin-top:.5rem}.k-dropdown-content>.k-dropdown-item:last-child{margin-bottom:.5rem}.k-dropdown-content[data-dropup=true]{top:auto;bottom:100%;margin-bottom:.5rem}.k-dropdown-content hr{border-color:currentColor;opacity:.2;margin:.5rem 1rem}.k-dropdown-content[data-theme=light]{background:var(--color-white);color:var(--color-black)}.k-dropdown-item{white-space:nowrap;line-height:1;display:flex;width:100%;align-items:center;font-size:var(--text-sm);padding:6px 16px}.k-dropdown-item:focus{outline:0;box-shadow:var(--shadow-outline)}[dir=ltr] .k-dropdown-item .k-button-figure{padding-right:.5rem}[dir=rtl] .k-dropdown-item .k-button-figure{padding-left:.5rem}.k-dropdown-item .k-button-figure{text-align:center}.k-link{outline:0}.k-options-dropdown,.k-options-dropdown-toggle{display:flex;justify-content:center;align-items:center;height:38px}.k-options-dropdown-toggle{min-width:38px;padding:0 .75rem}.k-pagination{-webkit-user-select:none;-moz-user-select:none;user-select:none;direction:ltr}.k-pagination .k-button{padding:1rem}.k-pagination-details{white-space:nowrap}.k-pagination>span{font-size:var(--text-sm)}.k-pagination[data-align]{text-align:var(--align)}[dir=ltr] .k-dropdown-content.k-pagination-selector{left:50%}[dir=rtl] .k-dropdown-content.k-pagination-selector{right:50%}.k-dropdown-content.k-pagination-selector{position:absolute;top:100%;transform:translate(-50%);background:var(--color-black)}[dir=ltr] .k-dropdown-content.k-pagination-selector{direction:ltr}[dir=rtl] .k-dropdown-content.k-pagination-selector{direction:rtl}.k-pagination-settings{display:flex;align-items:center;justify-content:space-between}.k-pagination-settings .k-button{line-height:1}[dir=ltr] .k-pagination-settings label{border-right:1px solid rgba(255,255,255,.35)}[dir=rtl] .k-pagination-settings label{border-left:1px solid rgba(255,255,255,.35)}.k-pagination-settings label{display:flex;align-items:center;padding:.625rem 1rem;font-size:var(--text-xs)}[dir=ltr] .k-pagination-settings label span{margin-right:.5rem}[dir=rtl] .k-pagination-settings label span{margin-left:.5rem}.k-prev-next{direction:ltr}.k-search{max-width:30rem;margin:2.5rem auto;box-shadow:var(--shadow-lg);background:var(--color-light);border-radius:var(--rounded)}.k-search-input{display:flex}.k-search-types{flex-shrink:0;display:flex}[dir=ltr] .k-search-types>.k-button{padding-left:1rem}[dir=rtl] .k-search-types>.k-button{padding-right:1rem}.k-search-types>.k-button{font-size:var(--text-base);line-height:1;height:2.5rem}.k-search-types>.k-button .k-icon{height:2.5rem}.k-search-types>.k-button .k-button-text{opacity:1;font-weight:500}.k-search-input input{background:0 0;flex-grow:1;font:inherit;padding:.75rem;border:0;height:2.5rem}.k-search-close{width:3rem;line-height:1}.k-search-close .k-icon-loader{animation:Spin 2s linear infinite}.k-search input:focus{outline:0}.k-search-results{padding:.5rem 1rem 1rem}.k-search .k-item:not(:last-child){margin-bottom:.25rem}.k-search .k-item[data-selected=true]{outline:2px solid var(--color-focus)}.k-search .k-item-info,.k-search-empty{font-size:var(--text-xs)}.k-search-empty{text-align:center;color:var(--color-gray-600)}.k-tag{position:relative;font-size:var(--text-sm);line-height:1;cursor:pointer;background-color:var(--color-gray-900);color:var(--color-light);border-radius:var(--rounded);display:flex;align-items:center;justify-content:space-between;-webkit-user-select:none;-moz-user-select:none;user-select:none}.k-tag:focus{outline:0;background-color:var(--color-focus);color:#fff}.k-tag-text{padding:.3rem .75rem .375rem;line-height:var(--leading-tight)}[dir=ltr] .k-tag-toggle{padding-right:1px}[dir=rtl] .k-tag-toggle{padding-left:1px}[dir=ltr] .k-tag-toggle{border-left:1px solid rgba(255,255,255,.15)}[dir=rtl] .k-tag-toggle{border-right:1px solid rgba(255,255,255,.15)}.k-tag-toggle{color:#ffffffb3;width:1.75rem;height:100%}.k-tag-toggle:hover{background:rgba(255,255,255,.2);color:#fff}[data-disabled=true] .k-tag{background-color:var(--color-gray-600)}[data-disabled=true] .k-tag .k-tag-toggle{display:none}.k-topbar{--bg:var(--color-gray-900);position:relative;color:var(--color-white);flex-shrink:0;height:2.5rem;line-height:1;background:var(--bg)}.k-topbar-wrapper{position:relative;display:flex;align-items:center;margin-left:-.75rem;margin-right:-.75rem}[dir=ltr] .k-topbar-wrapper:after{left:100%}[dir=rtl] .k-topbar-wrapper:after{right:100%}.k-topbar-wrapper:after{position:absolute;content:"";height:2.5rem;background:var(--bg);width:3rem}.k-topbar-menu{flex-shrink:0}.k-topbar-menu ul{padding:.5rem 0}.k-topbar .k-button[data-theme]{color:var(--theme-light)}.k-topbar .k-button-text{opacity:1}.k-topbar-menu-button{display:flex;align-items:center}.k-topbar-menu .k-link[aria-current]{color:var(--color-focus);font-weight:500}.k-topbar-button{padding:.75rem;line-height:1;font-size:var(--text-sm)}.k-topbar-button .k-button-text{display:flex}[dir=ltr] .k-topbar-view-button{padding-right:0}[dir=rtl] .k-topbar-view-button{padding-left:0}.k-topbar-view-button{flex-shrink:0;display:flex;align-items:center}[dir=ltr] .k-topbar-view-button .k-icon{margin-right:.5rem}[dir=rtl] .k-topbar-view-button .k-icon{margin-left:.5rem}[dir=ltr] .k-topbar-signals{right:0}[dir=rtl] .k-topbar-signals{left:0}.k-topbar-signals{position:absolute;top:0;background:var(--bg);height:2.5rem;display:flex;align-items:center}.k-topbar-signals:before{position:absolute;content:"";top:-.5rem;bottom:0;width:.5rem;background:-webkit-linear-gradient(inline-start,rgba(17,17,17,0),#111)}.k-topbar-signals .k-button{line-height:1}.k-topbar-notification{font-weight:var(--font-bold);line-height:1;display:flex}@media screen and (max-width:30em){.k-topbar .k-button[data-theme=negative] .k-button-text{display:none}}.k-section,.k-sections{padding-bottom:3rem}.k-section-header{position:relative;display:flex;align-items:baseline;z-index:1}[dir=ltr] .k-section-header .k-headline{padding-right:var(--spacing-3)}[dir=rtl] .k-section-header .k-headline{padding-left:var(--spacing-3)}.k-section-header .k-headline{line-height:1.25rem;min-height:2rem;flex-grow:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[dir=ltr] .k-section-header .k-button-group{right:0}[dir=rtl] .k-section-header .k-button-group{left:0}.k-section-header .k-button-group{position:absolute;top:calc(-.5rem - 1px)}.k-section-header .k-button-group>.k-button{padding:.75rem;display:inline-flex}.k-fields-issue-headline{margin-bottom:.5rem}.k-fields-section input[type=submit]{display:none}[data-locked=true] .k-fields-section{opacity:.2;pointer-events:none}.k-models-section[data-processing=true]{pointer-events:none}.k-models-section-search.k-input{margin-bottom:var(--spacing-3);background:var(--color-gray-300);padding:var(--spacing-2) var(--spacing-3);height:var(--field-input-height);border-radius:var(--rounded);font-size:var(--text-sm)}.k-info-section-label{margin-bottom:.5rem}.k-user-profile{background:var(--color-white)}.k-user-profile>.k-view{padding-top:3rem;padding-bottom:3rem;display:flex;align-items:center;line-height:0}[dir=ltr] .k-user-profile .k-button-group{margin-left:.75rem}[dir=rtl] .k-user-profile .k-button-group{margin-right:.75rem}.k-user-profile .k-button-group{overflow:hidden}.k-user-profile .k-button-group .k-button{display:block;padding-top:.25rem;padding-bottom:.25rem;overflow:hidden;white-space:nowrap}.k-user-view-image .k-icon,.k-user-view-image .k-image{width:5rem;height:5rem;border-radius:var(--rounded);line-height:0;overflow:hidden}.k-user-view-image[data-disabled=true]{opacity:1}.k-user-view-image .k-image{display:block}.k-user-view-image .k-button-text{opacity:1}.k-user-name-placeholder{color:var(--color-gray-500);transition:color .3s}.k-header[data-editable=true] .k-user-name-placeholder:hover{color:var(--color-gray-900)}.k-error-view{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center}.k-error-view-content{line-height:1.5em;max-width:25rem;text-align:center}.k-error-view-icon{color:var(--color-negative);display:inline-block}.k-error-view-content p:not(:last-child){margin-bottom:.75rem}.k-installation-view .k-button{display:block;margin-top:1.5rem}.k-installation-view .k-headline{margin-bottom:.75rem}.k-installation-issues{line-height:1.5em;font-size:var(--text-sm)}[dir=ltr] .k-installation-issues li{padding-left:3.5rem}[dir=rtl] .k-installation-issues li{padding-right:3.5rem}.k-installation-issues li{position:relative;padding:1.5rem;background:var(--color-white)}[dir=ltr] .k-installation-issues .k-icon{left:1.5rem}[dir=rtl] .k-installation-issues .k-icon{right:1.5rem}.k-installation-issues .k-icon{position:absolute;top:calc(1.5rem + 2px)}.k-installation-issues .k-icon svg *{fill:var(--color-negative)}.k-installation-issues li:not(:last-child){margin-bottom:2px}.k-installation-issues li code{font:inherit;color:var(--color-negative)}[dir=ltr] .k-installation-view .k-button[type=submit]{margin-left:-1rem}[dir=rtl] .k-installation-view .k-button[type=submit]{margin-right:-1rem}.k-installation-view .k-button[type=submit]{padding:1rem}.k-languages-view .k-header{margin-bottom:1.5rem}.k-languages-view-section-header{margin-bottom:.5rem}.k-languages-view-section{margin-bottom:3rem}.k-login-fields{position:relative}[dir=ltr] .k-login-toggler{right:0}[dir=rtl] .k-login-toggler{left:0}.k-login-toggler{position:absolute;top:0;z-index:1;text-decoration:underline;font-size:.875rem}.k-login-form label abbr{visibility:hidden}.k-login-buttons{display:flex;align-items:center;justify-content:flex-end;padding:1.5rem 0}[dir=ltr] .k-login-button{margin-right:-1rem}[dir=rtl] .k-login-button{margin-left:-1rem}.k-login-button{padding:.5rem 1rem;font-weight:500;transition:opacity .3s}.k-login-button span{opacity:1}.k-login-button[disabled]{opacity:.25}.k-login-back-button,.k-login-checkbox{display:flex;align-items:center;flex-grow:1}[dir=ltr] .k-login-back-button{margin-left:-1rem}[dir=rtl] .k-login-back-button{margin-right:-1rem}.k-login-checkbox{padding:.5rem 0;font-size:var(--text-sm);cursor:pointer}.k-login-checkbox .k-checkbox-text{opacity:.75;transition:opacity .3s}.k-login-checkbox:focus span,.k-login-checkbox:hover span{opacity:1}.k-password-reset-view .k-user-info{height:38px;margin-bottom:2.25rem;padding:.5rem;background:var(--color-white);border-radius:var(--rounded-xs);box-shadow:var(--shadow)}.k-system-view .k-header{margin-bottom:1.5rem}.k-system-view-section-header{margin-bottom:.5rem;display:flex;justify-content:space-between}.k-system-view-section{margin-bottom:3rem}.k-system-info .k-stat-label{color:var(--theme, var(--color-black))}.k-block-type-code-editor{position:relative;font-size:var(--text-sm);line-height:1.5em;background:#000;border-radius:var(--rounded);padding:.5rem .75rem 3rem;color:#fff;font-family:var(--font-mono)}.k-block-type-code-editor .k-editor{white-space:pre-wrap;line-height:1.75em}[dir=ltr] .k-block-type-code-editor-language{right:0}[dir=ltr] .k-block-type-code-editor-language .k-icon,[dir=rtl] .k-block-type-code-editor-language{left:0}.k-block-type-code-editor-language{font-size:var(--text-sm);position:absolute;bottom:0}[dir=rtl] .k-block-type-code-editor-language .k-icon{right:0}.k-block-type-code-editor-language .k-icon{position:absolute;top:0;height:1.5rem;display:flex;width:2rem;z-index:0}.k-block-type-code-editor-language .k-select-input{position:relative;padding:.325rem .75rem .5rem 2rem;z-index:1;font-size:var(--text-xs)}.k-block-type-default .k-block-title{line-height:1.5em}.k-block-type-gallery ul{display:grid;grid-gap:.75rem;grid-template-columns:repeat(auto-fit,minmax(6rem,1fr));line-height:0;align-items:center;justify-content:center;cursor:pointer}.k-block-type-gallery-placeholder{background:var(--color-background)}.k-block-type-gallery figcaption{padding-top:.5rem;color:var(--color-gray-600);font-size:var(--text-sm);text-align:center}.k-block-type-heading-input{line-height:1.25em;font-weight:var(--font-bold)}.k-block-type-heading-input[data-level=h1]{font-size:var(--text-3xl);line-height:1.125em}.k-block-type-heading-input[data-level=h2]{font-size:var(--text-2xl)}.k-block-type-heading-input[data-level=h3]{font-size:var(--text-xl)}.k-block-type-heading-input[data-level=h4]{font-size:var(--text-lg)}.k-block-type-heading-input[data-level=h5]{line-height:1.5em;font-size:var(--text-base)}.k-block-type-heading-input[data-level=h6]{line-height:1.5em;font-size:var(--text-sm)}.k-block-type-heading-input .ProseMirror strong{font-weight:700}.k-block-type-image .k-block-figure-container{display:block;text-align:center;line-height:0}.k-block-type-image-auto{max-width:100%;max-height:30rem}.k-block-type-line hr{margin-top:.75rem;margin-bottom:.75rem;border:0;border-top:2px solid var(--color-gray-400)}.k-block-type-markdown-input{position:relative;font-size:var(--text-sm);line-height:1.5em;background:var(--color-background);border-radius:var(--rounded);padding:.5rem .5rem 0;font-family:var(--font-mono)}[dir=ltr] .k-block-type-quote-editor{padding-left:1rem}[dir=rtl] .k-block-type-quote-editor{padding-right:1rem}[dir=ltr] .k-block-type-quote-editor{border-left:2px solid var(--color-black)}[dir=rtl] .k-block-type-quote-editor{border-right:2px solid var(--color-black)}.k-block-type-quote-text{font-size:var(--text-xl);margin-bottom:.25rem;line-height:1.25em}.k-block-type-quote-citation{font-style:italic;font-size:var(--text-sm);color:var(--color-gray-600)}.k-block-type-table-preview{cursor:pointer;border:1px solid var(--color-gray-300);border-spacing:0;border-radius:var(--rounded-sm);overflow:hidden}[dir=ltr] .k-block-type-table-preview td,[dir=ltr] .k-block-type-table-preview th{text-align:left}[dir=rtl] .k-block-type-table-preview td,[dir=rtl] .k-block-type-table-preview th{text-align:right}.k-block-type-table-preview td,.k-block-type-table-preview th{line-height:1.5em;font-size:var(--text-sm)}.k-block-type-table-preview th{padding:.5rem .75rem}.k-block-type-table-preview td:not(.k-table-index-column){padding:0 .75rem}.k-block-type-table-preview td [class$=-field-preview],.k-block-type-table-preview td>*{padding:0}.k-block-type-text-input{font-size:var(--text-base);line-height:1.5em;height:100%}.k-block-container-type-text,.k-block-type-text,.k-block-type-text .k-writer .ProseMirror{height:100%}.k-block-container{position:relative;padding:.75rem;background:var(--color-white);border-radius:var(--rounded)}.k-block-container:not(:last-of-type){border-bottom:1px dashed rgba(0,0,0,.1)}.k-block-container:focus{outline:0}.k-block-container[data-batched=true],.k-block-container[data-selected=true]{z-index:2;border-bottom-color:transparent}.k-block-container[data-batched=true]:after{position:absolute;top:0;right:0;bottom:0;left:0;content:"";background:rgba(238,242,246,.375);mix-blend-mode:multiply;border:1px solid var(--color-focus)}.k-block-container[data-selected=true]{box-shadow:var(--color-focus) 0 0 0 1px,var(--color-focus-outline) 0 0 0 3px}[dir=ltr] .k-block-container .k-block-options{right:.75rem}[dir=rtl] .k-block-container .k-block-options{left:.75rem}.k-block-container .k-block-options{display:none;position:absolute;top:0;margin-top:calc(-1.75rem + 2px)}.k-block-container[data-last-in-batch=true]>.k-block-options,.k-block-container[data-selected=true]>.k-block-options{display:flex}.k-block-container[data-hidden=true] .k-block{opacity:.25}.k-drawer-options .k-button[data-disabled=true]{vertical-align:middle;display:inline-grid}[data-disabled=true] .k-block-container{background:var(--color-background)}.k-block-importer.k-dialog{background:#313740;color:var(--color-white)}.k-block-importer .k-dialog-body{padding:0}.k-block-importer label{display:block;padding:var(--spacing-6) var(--spacing-6)0;color:var(--color-gray-400)}.k-block-importer label kbd{background:rgba(0,0,0,.5);font-family:var(--font-mono);letter-spacing:.1em;padding:.25rem;border-radius:var(--rounded);margin:0 .25rem}.k-block-importer textarea{width:100%;height:20rem;background:0 0;font:inherit;color:var(--color-white);border:0;padding:var(--spacing-6);resize:none}.k-block-importer textarea:focus{outline:0}.k-blocks{background:var(--color-white);box-shadow:var(--shadow);border-radius:var(--rounded)}[data-disabled=true] .k-blocks{background:var(--color-background)}.k-blocks[data-multi-select-key=true] .k-block-container>*{pointer-events:none}.k-blocks[data-empty=true]{padding:0;background:0 0;box-shadow:none}.k-blocks .k-sortable-ghost{outline:2px solid var(--color-focus);box-shadow:#11111140 0 5px 10px;cursor:grabbing;cursor:-webkit-grabbing}.k-blocks-list>.k-blocks-empty{display:flex;align-items:center}.k-blocks-list>.k-blocks-empty:not(:only-child){display:none}.k-block-figure{cursor:pointer}.k-block-figure iframe{border:0;pointer-events:none;background:var(--color-black)}.k-block-figure figcaption{padding-top:.5rem;color:var(--color-gray-600);font-size:var(--text-sm);text-align:center}.k-block-figure-empty.k-button{display:flex;width:100%;height:6rem;border-radius:var(--rounded-sm);align-items:center;justify-content:center;color:var(--color-gray-600);background:var(--color-background)}.k-block-options{display:flex;align-items:center;background:var(--color-white);z-index:var(--z-dropdown);box-shadow:#0000001a -2px 0 5px,var(--shadow),var(--shadow-xl);color:var(--color-black);border-radius:var(--rounded)}[dir=ltr] .k-block-options-button{border-right:1px solid var(--color-background)}[dir=rtl] .k-block-options-button{border-left:1px solid var(--color-background)}.k-block-options-button{--block-options-button-size:30px;width:var(--block-options-button-size);height:var(--block-options-button-size);line-height:1;display:inline-flex;align-items:center;justify-content:center}[dir=ltr] .k-block-options-button:first-child{border-top-left-radius:var(--rounded)}[dir=rtl] .k-block-options-button:first-child{border-top-right-radius:var(--rounded)}[dir=ltr] .k-block-options-button:first-child{border-bottom-left-radius:var(--rounded)}[dir=rtl] .k-block-options-button:first-child{border-bottom-right-radius:var(--rounded)}[dir=ltr] .k-block-options-button:last-child{border-top-right-radius:var(--rounded)}[dir=rtl] .k-block-options-button:last-child{border-top-left-radius:var(--rounded)}[dir=ltr] .k-block-options-button:last-child{border-bottom-right-radius:var(--rounded)}[dir=rtl] .k-block-options-button:last-child{border-bottom-left-radius:var(--rounded)}[dir=ltr] .k-block-options-button:last-of-type{border-right:0}[dir=rtl] .k-block-options-button:last-of-type{border-left:0}.k-block-options-button[aria-current]{color:var(--color-focus)}.k-block-options-button:hover{background:var(--color-gray-100)}.k-block-options .k-dropdown-content{margin-top:.5rem}.k-block-selector.k-dialog{background:var(--color-dark);color:var(--color-white)}.k-block-selector .k-headline{margin-bottom:1rem}.k-block-selector details:not(:last-of-type){margin-bottom:1.5rem}.k-block-selector summary{font-size:var(--text-xs);cursor:pointer;color:var(--color-gray-400)}.k-block-selector details:only-of-type summary{pointer-events:none}.k-block-selector summary:focus{outline:0}.k-block-selector summary:focus-visible{color:var(--color-green-400)}.k-block-types{display:grid;grid-gap:2px;margin-top:.75rem;grid-template-columns:repeat(1,1fr)}[dir=ltr] .k-block-types .k-button{text-align:left}[dir=rtl] .k-block-types .k-button{text-align:right}.k-block-types .k-button{display:flex;align-items:flex-start;border-radius:var(--rounded);background:rgba(0,0,0,.5);width:100%;padding:0 .75rem 0 0;line-height:1.5em}.k-block-types .k-button:focus{outline:2px solid var(--color-green-300)}.k-block-types .k-button .k-button-text{padding:.5rem 0 .5rem .5rem}.k-block-types .k-button .k-icon{width:38px;height:38px}.k-clipboard-hint{padding-top:1.5rem;font-size:var(--text-xs);color:var(--color-gray-400)}.k-clipboard-hint kbd{background:rgba(0,0,0,.5);font-family:var(--font-mono);letter-spacing:.1em;padding:.25rem;border-radius:var(--rounded);margin:0 .25rem}[dir=ltr] .k-block-title{padding-right:.75rem}[dir=rtl] .k-block-title{padding-left:.75rem}.k-block-title{display:flex;align-items:center;min-width:0;font-size:var(--text-sm);line-height:1}[dir=ltr] .k-block-icon{margin-right:.5rem}[dir=rtl] .k-block-icon{margin-left:.5rem}.k-block-icon{width:1rem;color:var(--color-gray-500)}[dir=ltr] .k-block-name{margin-right:.5rem}[dir=rtl] .k-block-name{margin-left:.5rem}.k-block-label{color:var(--color-gray-600);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-bubbles-field-preview{padding:.325rem .75rem}.k-text-field-preview{padding:.325rem .75rem;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.k-url-field-preview{padding:.325rem .75rem;overflow-x:hidden;text-overflow:ellipsis}.k-url-field-preview[data-link]{color:var(--color-focus)}.k-url-field-preview a{text-decoration:underline;transition:color .3s;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-url-field-preview a:hover{color:var(--color-black)}.k-flag-field-preview{height:var(--table-row-height);width:var(--table-row-height);display:flex;justify-content:center;align-items:center}.k-html-field-preview{padding:.325rem .75rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.5em}.k-html-field-preview p:not(:last-child){margin-bottom:1.5em}[dir=ltr] .k-html-field-preview ol,[dir=ltr] .k-html-field-preview ul{margin-left:1rem}[dir=rtl] .k-html-field-preview ol,[dir=rtl] .k-html-field-preview ul{margin-right:1rem}.k-html-field-preview ul>li{list-style:disc}.k-html-field-preview ol ul>li,.k-html-field-preview ul ul>li{list-style:circle}.k-html-field-preview ol>li{list-style:decimal}.k-html-field-preview ol>li::marker{color:var(--color-gray-500);font-size:var(--text-xs)}.k-toggle-field-preview label{padding:0 .25rem 0 .75rem;display:flex;height:38px;cursor:pointer;overflow:hidden;white-space:nowrap}[dir=ltr] .k-toggle-field-preview .k-toggle-input-label{padding-left:.5rem}[dir=ltr] [data-align=right] .k-toggle-field-preview .k-toggle-input-label,[dir=rtl] .k-toggle-field-preview .k-toggle-input-label{padding-right:.5rem}[dir=rtl] [data-align=right] .k-toggle-field-preview .k-toggle-input-label{padding-left:.5rem}[dir=ltr] .k-toggle-field-preview .k-toggle-input{padding-left:.75rem;padding-right:.25rem}.k-toggle-field-preview .k-toggle-input{padding-top:0;padding-bottom:0}[dir=ltr] [data-align=right] .k-toggle-field-preview .k-toggle-input,[dir=rtl] .k-toggle-field-preview .k-toggle-input{padding-left:.25rem;padding-right:.75rem}[dir=rtl] [data-align=right] .k-toggle-field-preview .k-toggle-input{padding-right:.25rem;padding-left:.75rem}[data-align=right] .k-toggle-field-preview .k-toggle-input{flex-direction:row-reverse}:root{--color-backdrop:rgba(0, 0, 0, .6);--color-black:#000;--color-dark:#313740;--color-light:var(--color-gray-200);--color-white:#fff;--color-gray-100:#f7f7f7;--color-gray-200:#efefef;--color-gray-300:#ddd;--color-gray-400:#ccc;--color-gray-500:#999;--color-gray-600:#777;--color-gray-700:#555;--color-gray-800:#333;--color-gray-900:#111;--color-gray:var(--color-gray-600);--color-red-200:#edc1c1;--color-red-300:#e3a0a0;--color-red-400:#d16464;--color-red-600:#ce1f1f;--color-red:var(--color-red-600);--color-orange-200:#f2d4bf;--color-orange-300:#ebbe9e;--color-orange-400:#de935f;--color-orange-600:#f4861f;--color-orange:var(--color-orange-600);--color-yellow-200:#f9e8c7;--color-yellow-300:#f7e2b8;--color-yellow-400:#f0c674;--color-yellow-600:#cca000;--color-yellow:var(--color-yellow-600);--color-green-200:#dce5c2;--color-green-300:#c6d49d;--color-green-400:#a7bd68;--color-green-600:#678f00;--color-green:var(--color-green-600);--color-aqua-200:#d0e5e2;--color-aqua-300:#bbd9d5;--color-aqua-400:#8abeb7;--color-aqua-600:#398e93;--color-aqua:var(--color-aqua-600);--color-blue-200:#cbd7e5;--color-blue-300:#b1c2d8;--color-blue-400:#7e9abf;--color-blue-600:#4271ae;--color-blue:var(--color-blue-600);--color-purple-200:#e0d4e4;--color-purple-300:#d4c3d9;--color-purple-400:#b294bb;--color-purple-600:#9c48b9;--color-purple:var(--color-purple-600);--container:80rem;--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--font-mono:"SFMono-Regular", Consolas, Liberation Mono, Menlo, Courier, monospace;--font-normal:400;--font-bold:600;--leading-none:1;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--leading-loose:2;--rounded-xs:1px;--rounded-sm:.125rem;--rounded:.25rem;--rounded-md:.375rem;--shadow:0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06);--shadow-md:0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);--shadow-lg:0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--shadow-xl:0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04);--shadow-outline:currentColor 0 0 0 2px;--shadow-inset:inset 0 2px 4px 0 rgba(0, 0, 0, .06);--spacing-0:0;--spacing-px:1px;--spacing-2px:2px;--spacing-1:.25rem;--spacing-2:.5rem;--spacing-3:.75rem;--spacing-4:1rem;--spacing-5:1.25rem;--spacing-6:1.5rem;--spacing-8:2rem;--spacing-10:2.5rem;--spacing-12:3rem;--spacing-16:4rem;--spacing-20:5rem;--spacing-24:6rem;--spacing-36:9rem;--text-xs:.75rem;--text-sm:.875rem;--text-base:1rem;--text-lg:1.125rem;--text-xl:1.25rem;--text-2xl:1.5rem;--text-3xl:1.75rem;--text-4xl:2.5rem;--text-5xl:3rem;--text-6xl:4rem;--color-background:var(--color-light);--color-border:var(--color-gray-400);--color-focus:var(--color-blue-600);--color-focus-light:var(--color-blue-400);--color-focus-outline:rgba(113, 143, 183, .25);--color-negative:var(--color-red-600);--color-negative-light:var(--color-red-400);--color-negative-outline:rgba(212, 110, 110, .25);--color-notice:var(--color-orange-600);--color-notice-light:var(--color-orange-400);--color-positive:var(--color-green-600);--color-positive-light:var(--color-green-400);--color-positive-outline:rgba(128, 149, 65, .25);--color-text:var(--color-gray-900);--color-text-light:var(--color-gray-600);--z-offline:1200;--z-fatal:1100;--z-loader:1000;--z-notification:900;--z-dialog:800;--z-navigation:700;--z-dropdown:600;--z-drawer:500;--z-dropzone:400;--z-toolbar:300;--z-content:200;--z-background:100;--bg-pattern:repeating-conic-gradient( rgba(0, 0, 0, 0) 0% 25%, rgba(0, 0, 0, .2) 0% 50% ) 50% / 20px 20px;--shadow-sticky:rgba(0, 0, 0, .05) 0 2px 5px;--shadow-dropdown:var(--shadow-lg);--shadow-item:var(--shadow);--field-input-padding:.5rem;--field-input-height:2.25rem;--field-input-line-height:1.25rem;--field-input-font-size:var(--text-base);--field-input-color-before:var(--color-gray-700);--field-input-color-after:var(--color-gray-700);--field-input-border:1px solid var(--color-border);--field-input-focus-border:1px solid var(--color-focus);--field-input-focus-outline:2px solid var(--color-focus-outline);--field-input-invalid-border:1px solid var(--color-negative-outline);--field-input-invalid-outline:0;--field-input-invalid-focus-border:1px solid var(--color-negative);--field-input-invalid-focus-outline:2px solid var(--color-negative-outline);--field-input-background:var(--color-white);--field-input-disabled-color:var(--color-gray-500);--field-input-disabled-background:var(--color-white);--field-input-disabled-border:1px solid var(--color-gray-300);--font-family-sans:var(--font-sans);--font-family-mono:var(--font-mono);--font-size-tiny:var(--text-xs);--font-size-small:var(--text-sm);--font-size-medium:var(--text-base);--font-size-large:var(--text-xl);--font-size-huge:var(--text-2xl);--font-size-monster:var(--text-3xl);--box-shadow-dropdown:var(--shadow-dropdown);--box-shadow-item:var(--shadow);--box-shadow-focus:var(--shadow-xl)}*,:after,:before{margin:0;padding:0;box-sizing:border-box}noscript{padding:1.5rem;display:flex;align-items:center;justify-content:center;height:100vh;text-align:center}html{font-family:var(--font-sans);background:var(--color-background)}body,html{color:var(--color-gray-900);height:100%;overflow:hidden}a{color:inherit;text-decoration:none}li{list-style:none}b,strong{font-weight:var(--font-bold)}@keyframes LoadingCursor{to{cursor:progress}}@keyframes Spin{to{transform:rotate(360deg)}}[data-align=left]{--align:start}[data-align=center]{--align:center}[data-align=right]{--align:end}[data-invalid=true]{border:1px solid var(--color-negative-outline);box-shadow:var(--color-negative-outline) 0 0 3px 2px}[data-invalid=true]:focus-within{border:var(--field-input-invalid-focus-border)!important;box-shadow:var(--color-negative-outline) 0 0 0 2px!important}[data-tabbed=true]{box-shadow:var(--shadow-outline);border-radius:var(--rounded)}[data-theme=positive],[data-theme=success]{--theme:var(--color-positive);--theme-light:var(--color-positive-light);--theme-bg:var(--color-green-300)}[data-theme=error],[data-theme=negative]{--theme:var(--color-negative);--theme-light:var(--color-negative-light);--theme-bg:var(--color-red-300)}[data-theme=notice]{--theme:var(--color-notice);--theme-light:var(--color-notice-light);--theme-bg:var(--color-orange-300)}[data-theme=info]{--theme:var(--color-focus);--theme-light:var(--color-focus-light);--theme-bg:var(--color-blue-200)}.scroll-x,.scroll-x-auto,.scroll-y,.scroll-y-auto{-webkit-overflow-scrolling:touch;transform:translateZ(0)}.scroll-x,.scroll-x-auto{overflow-x:scroll;overflow-y:hidden}.scroll-x-auto{overflow-x:auto}.scroll-y,.scroll-y-auto{overflow-x:hidden;overflow-y:scroll}.scroll-y-auto{overflow-y:auto}.input-hidden{position:absolute;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:0;height:0;opacity:0}.k-offscreen,.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0} diff --git a/kirby/panel/dist/js/index.js b/kirby/panel/dist/js/index.js index fb984ad..fa87b02 100644 --- a/kirby/panel/dist/js/index.js +++ b/kirby/panel/dist/js/index.js @@ -1 +1 @@ -import{V as t,s as e,I as s,P as n,S as i,F as o,N as r,a as l,l as a,w as u,c,e as d,t as p,b as h,d as m,f,g,h as k,k as b,D as v,i as y,E as $,j as _,m as x,n as w,T as S,u as C,o as O,p as A,r as T,q as I,v as j,x as E,y as M,z as L,A as B,B as D,C as P,G as N,H as F,J as q,K as R,L as z}from"./vendor.js";const Y=t=>({changeName:async(e,s,n)=>t.patch(e+"/files/"+s+"/name",{name:n}),delete:async(e,s)=>t.delete(e+"/files/"+s),async get(e,s,n){let i=await t.get(e+"/files/"+s,n);return!0===Array.isArray(i.content)&&(i.content={}),i},link(t,e,s){return"/"+this.url(t,e,s)},update:async(e,s,n)=>t.patch(e+"/files/"+s,n),url(t,e,s){let n=t+"/files/"+e;return s&&(n+="/"+s),n}}),H=t=>({async blueprint(e){return t.get("pages/"+this.id(e)+"/blueprint")},async blueprints(e,s){return t.get("pages/"+this.id(e)+"/blueprints",{section:s})},async changeSlug(e,s){return t.patch("pages/"+this.id(e)+"/slug",{slug:s})},async changeStatus(e,s,n){return t.patch("pages/"+this.id(e)+"/status",{status:s,position:n})},async changeTemplate(e,s){return t.patch("pages/"+this.id(e)+"/template",{template:s})},async changeTitle(e,s){return t.patch("pages/"+this.id(e)+"/title",{title:s})},async children(e,s){return t.post("pages/"+this.id(e)+"/children/search",s)},async create(e,s){return null===e||"/"===e?t.post("site/children",s):t.post("pages/"+this.id(e)+"/children",s)},async delete(e,s){return t.delete("pages/"+this.id(e),s)},async duplicate(e,s,n){return t.post("pages/"+this.id(e)+"/duplicate",{slug:s,children:n.children||!1,files:n.files||!1})},async get(e,s){let n=await t.get("pages/"+this.id(e),s);return!0===Array.isArray(n.content)&&(n.content={}),n},id:t=>t.replace(/\//g,"+"),async files(e,s){return t.post("pages/"+this.id(e)+"/files/search",s)},link(t){return"/"+this.url(t)},async preview(t){return(await this.get(this.id(t),{select:"previewUrl"})).previewUrl},async search(e,s){return e?t.post("pages/"+this.id(e)+"/children/search?select=id,title,hasChildren",s):t.post("site/children/search?select=id,title,hasChildren",s)},async update(e,s){return t.patch("pages/"+this.id(e),s)},url(t,e){let s=null===t?"pages":"pages/"+String(t).replace(/\//g,"+");return e&&(s+="/"+e),s}});const U=t=>({running:0,async request(e,s,n=!1){s=Object.assign(s||{},{credentials:"same-origin",cache:"no-store",headers:{"x-requested-with":"xmlhttprequest","content-type":"application/json",...s.headers}}),t.methodOverwrite&&"GET"!==s.method&&"POST"!==s.method&&(s.headers["x-http-method-override"]=s.method,s.method="POST"),s=t.onPrepare(s);const i=e+"/"+JSON.stringify(s);t.onStart(i,n),this.running++;const o=await fetch([t.endpoint,e].join(t.endpoint.endsWith("/")||e.startsWith("/")?"":"/"),s);try{const e=await async function(t){const e=await t.text();let s;try{s=JSON.parse(e)}catch(n){return window.panel.$vue.$api.onParserError({html:e}),!1}return s}(o);if(o.status<200||o.status>299)throw e;if("error"===e.status)throw e;let s=e;return e.data&&"model"===e.type&&(s=e.data),this.running--,t.onComplete(i),t.onSuccess(e),s}catch(r){if(this.running--,t.onComplete(i),!1!==t.onError(r))throw r}},async get(t,e,s,n=!1){return e&&(t+="?"+Object.keys(e).filter((t=>void 0!==e[t]&&null!==e[t])).map((t=>t+"="+e[t])).join("&")),this.request(t,Object.assign(s||{},{method:"GET"}),n)},async post(t,e,s,n="POST",i=!1){return this.request(t,Object.assign(s||{},{method:n,body:JSON.stringify(e)}),i)},async patch(t,e,s,n=!1){return this.post(t,e,s,"PATCH",n)},async delete(t,e,s,n=!1){return this.post(t,e,s,"DELETE",n)}}),K=t=>({blueprint:async e=>t.get("users/"+e+"/blueprint"),blueprints:async(e,s)=>t.get("users/"+e+"/blueprints",{section:s}),changeEmail:async(e,s)=>t.patch("users/"+e+"/email",{email:s}),changeLanguage:async(e,s)=>t.patch("users/"+e+"/language",{language:s}),changeName:async(e,s)=>t.patch("users/"+e+"/name",{name:s}),changePassword:async(e,s)=>t.patch("users/"+e+"/password",{password:s}),changeRole:async(e,s)=>t.patch("users/"+e+"/role",{role:s}),create:async e=>t.post("users",e),delete:async e=>t.delete("users/"+e),deleteAvatar:async e=>t.delete("users/"+e+"/avatar"),link(t,e){return"/"+this.url(t,e)},async list(e){return t.post(this.url(null,"search"),e)},get:async(e,s)=>t.get("users/"+e,s),async roles(e){return(await t.get(this.url(e,"roles"))).data.map((t=>({info:t.description||`(${window.panel.$t("role.description.placeholder")})`,text:t.title,value:t.name})))},search:async e=>t.post("users/search",e),update:async(e,s)=>t.patch("users/"+e,s),url(t,e){let s=t?"users/"+t:"users";return e&&(s+="/"+e),s}}),V={install(t,e){t.prototype.$api=t.$api=((t={})=>{const e={...{endpoint:"/api",methodOverwrite:!0,onPrepare:t=>t,onStart(){},onComplete(){},onSuccess(){},onParserError(){},onError(t){throw window.console.log(t.message),t}},...t.config||{}};let s={...e,...U(e),...t};return s.auth=(t=>({async login(e){const s={long:e.remember||!1,email:e.email,password:e.password};return t.post("auth/login",s)},logout:async()=>t.post("auth/logout"),ping:async()=>t.post("auth/ping"),user:async e=>t.get("auth",e),verifyCode:async e=>t.post("auth/code",{code:e})}))(s),s.files=Y(s),s.languages=(t=>({create:async e=>t.post("languages",e),delete:async e=>t.delete("languages/"+e),get:async e=>t.get("languages/"+e),list:async()=>t.get("languages"),update:async(e,s)=>t.patch("languages/"+e,s)}))(s),s.pages=H(s),s.roles=(t=>({list:async e=>t.get("roles",e),get:async e=>t.get("roles/"+e)}))(s),s.system=(t=>({get:async(e={view:"panel"})=>t.get("system",e),install:async e=>(await t.post("system/install",e)).user,register:async e=>t.post("system/register",e)}))(s),s.site=(t=>({blueprint:async()=>t.get("site/blueprint"),blueprints:async()=>t.get("site/blueprints"),changeTitle:async e=>t.patch("site/title",{title:e}),children:async e=>t.post("site/children/search",e),get:async(e={view:"panel"})=>t.get("site",e),update:async e=>t.post("site",e)}))(s),s.translations=(t=>({list:async()=>t.get("translations"),get:async e=>t.get("translations/"+e)}))(s),s.users=K(s),s})({config:{endpoint:window.panel.$urls.api,onComplete:s=>{t.$api.requests=t.$api.requests.filter((t=>t!==s)),0===t.$api.requests.length&&e.dispatch("isLoading",!1)},onError:e=>{if(window.panel.$config.debug&&window.console.error(e),403===e.code&&("Unauthenticated"===e.message||"access.panel"===e.key))return t.prototype.$go("/logout"),!1},onParserError:({html:t,silent:s})=>{e.dispatch("fatal",{html:t,silent:s})},onPrepare:t=>(window.panel.$language&&(t.headers["x-language"]=window.panel.$language.code),t.headers["x-csrf"]=window.panel.$system.csrf,t),onStart:(s,n=!1)=>{!1===n&&e.dispatch("isLoading",!0),t.$api.requests.push(s)},onSuccess:()=>{clearInterval(t.$api.ping),t.$api.ping=setInterval(t.$api.auth.ping,3e5)}},ping:null,requests:[]}),t.$api.ping=setInterval(t.$api.auth.ping,3e5)}},J={name:"Fiber",data:()=>({component:null,state:window.fiber,key:null}),created(){this.$fiber.init(this.state,{base:document.querySelector("base").href,headers:()=>({"X-CSRF":this.state.$system.csrf}),onFatal({text:t,options:e}){this.$store.dispatch("fatal",{html:t,silent:e.silent})},onFinish:()=>{0===this.$api.requests.length&&this.$store.dispatch("isLoading",!1)},onPushState:t=>{window.history.pushState(t,"",t.$url)},onReplaceState:t=>{window.history.replaceState(t,"",t.$url)},onStart:({silent:t})=>{!0!==t&&this.$store.dispatch("isLoading",!0)},onSwap:async(t,e)=>{e={navigate:!0,replace:!1,...e},this.setGlobals(t),this.setTitle(t),this.setTranslation(t),this.component=t.$view.component,this.state=t,this.key=!0===e.replace?this.key:t.$view.timestamp,!0===e.navigate&&this.navigate()},query:()=>{var t;return{language:null==(t=this.state.$language)?void 0:t.code}}}),window.addEventListener("popstate",this.$reload)},methods:{navigate(){this.$store.dispatch("navigate")},setGlobals(e){["$config","$direction","$language","$languages","$license","$menu","$multilang","$permissions","$searches","$system","$translation","$urls","$user","$view"].forEach((s=>{void 0!==e[s]?t.prototype[s]=window.panel[s]=e[s]:t.prototype[s]=e[s]=window.panel[s]}))},setTitle(t){t.$view.title?document.title=t.$view.title+" | "+t.$system.title:document.title=t.$system.title},setTranslation(t){t.$translation&&(document.documentElement.lang=t.$translation.code)}},render(t){if(this.component)return t(this.component,{key:this.key,props:this.state.$view.props})}};function G(t,e,s,n,i,o,r,l){var a,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=s,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),r?(a=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},u._ssrRegister=a):i&&(a=l?function(){i.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:i),a)if(u.functional){u._injectStyles=a;var c=u.render;u.render=function(t,e){return a.call(e),c(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,a):[a]}return{exports:t,options:u}}const W=G({props:{autofocus:{type:Boolean,default:!0},cancelButton:{type:[String,Boolean],default:!0},disabled:Boolean,icon:{type:String,default:"check"},size:{type:String,default:"default"},submitButton:{type:[String,Boolean],default:!0},theme:String,visible:Boolean},data:()=>({notification:null}),computed:{buttons(){let t=[];return this.cancelButton&&t.push({icon:"cancel",text:this.cancelButtonLabel,class:"k-dialog-button-cancel",click:this.cancel}),this.submitButtonConfig&&t.push({icon:this.icon,text:this.submitButtonLabel,theme:this.theme,class:"k-dialog-button-submit",click:this.submit,disabled:this.disabled}),t},cancelButtonLabel(){return!1!==this.cancelButton&&(!0===this.cancelButton||0===this.cancelButton.length?this.$t("cancel"):this.cancelButton)},submitButtonConfig(){return void 0!==this.$attrs.button?this.$attrs.button:void 0===this.submitButton||this.submitButton},submitButtonLabel(){return!0===this.submitButton||0===this.submitButton.length?this.$t("confirm"):this.submitButton}},created(){this.$events.$on("keydown.esc",this.close,!1)},destroyed(){this.$events.$off("keydown.esc",this.close,!1)},mounted(){this.visible&&this.$nextTick(this.open)},methods:{onOverlayClose(){this.notification=null,this.$emit("close"),this.$events.$off("keydown.esc",this.close),this.$store.dispatch("dialog",!1)},open(){this.$store.state.dialog||this.$store.dispatch("dialog",!0),this.notification=null,this.$refs.overlay.open(),this.$emit("open"),this.$events.$on("keydown.esc",this.close)},close(){this.$refs.overlay&&this.$refs.overlay.close()},cancel(){this.$emit("cancel"),this.close()},focus(){var t;if(null==(t=this.$refs.dialog)?void 0:t.querySelector){const t=this.$refs.dialog.querySelector(".k-dialog-button-cancel");"function"==typeof(null==t?void 0:t.focus)&&t.focus()}},error(t){this.notification={message:t,type:"error"}},submit(){this.$emit("submit")},success(t){this.notification={message:t,type:"success"}}}},(function(){var t=this,e=t._self._c;return e("k-overlay",{ref:"overlay",attrs:{autofocus:t.autofocus,centered:!0},on:{close:t.onOverlayClose,ready:function(e){return t.$emit("ready")}}},[e("div",{ref:"dialog",staticClass:"k-dialog",class:t.$vnode.data.staticClass,attrs:{"data-size":t.size},on:{mousedown:function(t){t.stopPropagation()}}},[t.notification?e("div",{staticClass:"k-dialog-notification",attrs:{"data-theme":t.notification.type}},[e("p",[t._v(t._s(t.notification.message))]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){t.notification=null}}})],1):t._e(),e("div",{staticClass:"k-dialog-body scroll-y-auto"},[t._t("default")],2),t.$slots.footer||t.buttons.length?e("footer",{staticClass:"k-dialog-footer"},[t._t("footer",(function(){return[e("k-button-group",{attrs:{buttons:t.buttons}})]}))],2):t._e()])])}),[],!1,null,null,null,null).exports,X={props:{autofocus:{type:Boolean,default:!0},cancelButton:{type:[String,Boolean],default:!0},icon:String,submitButton:{type:[String,Boolean],default:!0},size:String,theme:String,visible:Boolean},methods:{close(){this.$refs.dialog.close(),this.$emit("close")},error(t){this.$refs.dialog.error(t)},open(){this.$refs.dialog.open(),this.$emit("open")},success(t){this.$refs.dialog.close(),t.route&&this.$go(t.route),t.message&&this.$store.dispatch("notification/success",t.message),t.event&&("string"==typeof t.event&&(t.event=[t.event]),t.event.forEach((e=>{this.$events.$emit(e,t)}))),!1!==Object.prototype.hasOwnProperty.call(t,"emit")&&!1===t.emit||this.$emit("success")}}};const Z=G({mixins:[X],props:{details:[Object,Array],message:String,size:{type:String,default:"medium"}},computed:{detailsList(){return Array.isArray(this.details)?this.details:Object.values(this.details||{})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-error-dialog",attrs:{"cancel-button":!1,size:t.size,visible:!0},on:{cancel:function(e){return t.$emit("cancel")},close:function(e){return t.$emit("close")},submit:function(e){return t.$refs.dialog.close()}}},[e("k-text",[t._v(t._s(t.message))]),t.detailsList.length?e("dl",{staticClass:"k-error-details"},[t._l(t.detailsList,(function(s,n){return[e("dt",{key:"detail-label-"+n},[t._v(" "+t._s(s.label)+" ")]),e("dd",{key:"detail-message-"+n},["object"==typeof s.message?[e("ul",t._l(s.message,(function(s,n){return e("li",{key:n},[t._v(" "+t._s(s)+" ")])})),0)]:[t._v(" "+t._s(s.message)+" ")]],2)]}))],2):t._e()],1)}),[],!1,null,null,null,null).exports;const Q=G({props:{code:Number,component:String,path:String,props:Object,referrer:String},data:()=>({isProcessing:!1}),methods:{close(){this.$refs.dialog.close()},onCancel(){"function"==typeof this.$store.state.dialog.cancel&&this.$store.state.dialog.cancel({dialog:this})},async onSubmit(t){if(!0===this.isProcessing)return!1;let e=null;this.isProcessing=!0;try{if("function"==typeof this.$store.state.dialog.submit)e=await this.$store.state.dialog.submit({dialog:this,value:t});else{if(!this.path)throw"The dialog needs a submit action or a dialog route path to be submitted";e=await this.$request(this.path,{body:t,method:"POST",type:"$dialog",headers:{"X-Fiber-Referrer":this.referrer}})}if(!1===e)return!1;this.$refs.dialog.success(e),e.dispatch&&Object.keys(e.dispatch).forEach((t=>{const s=e.dispatch[t];this.$store.dispatch(t,!0===Array.isArray(s)?[...s]:s)})),e.redirect?this.$go(e.redirect):this.$reload(e.reload||{})}catch(s){this.$refs.dialog.error(s)}finally{this.isProcessing=!1}}}},(function(){var t=this;return(0,t._self._c)(t.component,t._b({ref:"dialog",tag:"component",attrs:{disabled:t.isProcessing,visible:!0},on:{cancel:t.onCancel,submit:t.onSubmit}},"component",t.props,!1))}),[],!1,null,null,null,null).exports,tt=(t,e)=>{let s=null;return function(){clearTimeout(s),s=setTimeout((()=>t.apply(this,arguments)),e)}},et={data:()=>({models:[],issue:null,selected:{},options:{endpoint:null,max:null,multiple:!0,parent:null,selected:[],search:!0},search:null,pagination:{limit:20,page:1,total:0}}),computed:{checkedIcon(){return!0===this.multiple?"check":"circle-filled"},collection(){return{empty:this.emptyProps,items:this.items,link:!1,layout:"list",pagination:{details:!0,dropdown:!1,align:"center",...this.pagination},sortable:!1}},items(){return this.models.map(this.item)},multiple(){return!0===this.options.multiple&&1!==this.options.max}},watch:{search(){this.updateSearch()}},created(){this.updateSearch=tt(this.updateSearch,200)},methods:{async fetch(){const t={page:this.pagination.page,search:this.search,...this.fetchData||{}};try{const e=await this.$api.get(this.options.endpoint,t);this.models=e.data,this.pagination=e.pagination,this.onFetched&&this.onFetched(e)}catch(e){this.models=[],this.issue=e.message}},async open(t,s){this.pagination.page=0,this.search=null;let n=!0;Array.isArray(t)?(this.models=t,n=!1):(this.models=[],s=t),this.options={...this.options,...s},this.selected={},this.options.selected.forEach((t=>{e(this.selected,t,{id:t})})),n&&await this.fetch(),this.$refs.dialog.open()},paginate(t){this.pagination.page=t.page,this.pagination.limit=t.limit,this.fetch()},submit(){this.$emit("submit",Object.values(this.selected)),this.$refs.dialog.close()},isSelected(t){return void 0!==this.selected[t.id]},item:t=>t,toggle(t){!1!==this.options.multiple&&1!==this.options.max||(this.selected={}),!0!==this.isSelected(t)?this.options.max&&this.options.max<=Object.keys(this.selected).length||e(this.selected,t.id,t):this.$delete(this.selected,t.id)},toggleBtn(t){const e=this.isSelected(t);return{icon:e?this.checkedIcon:"circle-outline",tooltip:e?this.$t("remove"):this.$t("select"),theme:e?"positive":null}},updateSearch(){this.pagination.page=0,this.fetch()}}};const st=G({mixins:[et],computed:{emptyProps(){return{icon:"image",text:this.$t("dialog.files.empty")}}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-files-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[e("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.options.search?e("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",value:t.search,type:"text",icon:"search"},on:{input:function(e){t.search=e}}}):t._e(),e("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:s}){return[e("k-button",t._b({on:{click:function(e){return t.toggle(s)}}},"k-button",t.toggleBtn(s),!1))]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,null,null,null,null).exports;const nt=G({mixins:[X],props:{disabled:Boolean,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!0},size:{type:String,default:"medium"},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("save")},text:{type:String},theme:{type:String,default:"positive"},value:{type:Object,default:()=>({})}},data(){return{model:this.value}},computed:{hasFields(){return Object.keys(this.fields).length>0}},watch:{value(t){this.model=t}},methods:{onInput(t){this.model=t,this.$emit("input",t)},onSubmit(t){this.$emit("submit",t)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},close:function(e){return t.$emit("close")},ready:function(e){return t.$emit("ready")},submit:function(e){return t.$refs.form.submit()}}},"k-dialog",t.$props,!1),[t.text?[e("k-text",{attrs:{html:t.text}})]:t._e(),t.hasFields?e("k-form",{ref:"form",attrs:{value:t.model,fields:t.fields,novalidate:t.novalidate},on:{input:t.onInput,submit:t.onSubmit}}):e("k-box",{attrs:{theme:"negative"}},[t._v(" This form dialog has no fields ")])],2)}),[],!1,null,null,null,null).exports;const it=G({extends:nt,watch:{"model.name"(t){this.fields.code.disabled||this.onNameChanges(t)},"model.code"(t){this.fields.code.disabled||(this.model.code=this.$helper.slug(t,[this.$system.ascii]),this.onCodeChanges(this.model.code))}},methods:{onCodeChanges(t){if(!t)return this.model.locale=null;if(t.length>=2)if(-1!==t.indexOf("-")){let e=t.split("-"),s=[e[0],e[1].toUpperCase()];this.model.locale=s.join("_")}else{let e=this.$system.locales||[];(null==e?void 0:e[t])?this.model.locale=e[t]:this.model.locale=null}},onNameChanges(t){this.model.code=this.$helper.slug(t,[this.model.rules,this.$system.ascii]).substr(0,2)}}},null,null,!1,null,null,null,null).exports;const ot=G({mixins:[et],data(){const t=et.data();return{...t,model:{title:null,parent:null},options:{...t.options,parent:null}}},computed:{emptyProps(){return{icon:"page",text:this.$t("dialog.pages.empty")}},fetchData(){return{parent:this.options.parent}}},methods:{back(){this.options.parent=this.model.parent,this.pagination.page=1,this.fetch()},go(t){this.options.parent=t.id,this.pagination.page=1,this.fetch()},onFetched(t){this.model=t.model}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-pages-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[e("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.model?e("header",{staticClass:"k-pages-dialog-navbar"},[e("k-button",{attrs:{disabled:!t.model.id,tooltip:t.$t("back"),icon:"angle-left"},on:{click:t.back}}),e("k-headline",[t._v(t._s(t.model.title))])],1):t._e(),t.options.search?e("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",value:t.search,type:"text",icon:"search"},on:{input:function(e){t.search=e}}}):t._e(),e("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:s}){return[e("k-button",t._b({on:{click:function(e){return t.toggle(s)}}},"k-button",t.toggleBtn(s),!1)),t.model?e("k-button",{attrs:{disabled:!s.hasChildren,tooltip:t.$t("open"),icon:"angle-right"},on:{click:function(e){return e.stopPropagation(),t.go(s)}}}):t._e()]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,null,null,null,null).exports;const rt=G({mixins:[X],props:{disabled:Boolean,icon:{type:String,default:"trash"},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("delete")},text:String,theme:{type:String,default:"negative"}}},(function(){var t=this;return(0,t._self._c)("k-text-dialog",t._g(t._b({ref:"dialog"},"k-text-dialog",t.$props,!1),t.$listeners),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const lt=G({mixins:[X],props:{disabled:Boolean,text:String}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._g(t._b({ref:"dialog"},"k-dialog",t.$props,!1),t.$listeners),[t._t("default",(function(){return[t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"negative"}},[t._v(" This dialog does not define any text ")])]}))],2)}),[],!1,null,null,null,null).exports;const at=G({mixins:[et],computed:{emptyProps(){return{icon:"users",text:this.$t("dialog.users.empty")}}},methods:{item:t=>({...t,key:t.email,info:t.info!==t.text?t.info:null})}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-users-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[e("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.options.search?e("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",value:t.search,type:"text",icon:"search"},on:{input:function(e){t.search=e}}}):t._e(),e("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:s}){return[e("k-button",t._b({on:{click:function(e){return t.toggle(s)}}},"k-button",t.toggleBtn(s),!1))]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,null,null,null,null).exports,ut={install(t){t.component("k-dialog",W),t.component("k-error-dialog",Z),t.component("k-fiber-dialog",Q),t.component("k-files-dialog",st),t.component("k-form-dialog",nt),t.component("k-language-dialog",it),t.component("k-pages-dialog",ot),t.component("k-remove-dialog",rt),t.component("k-text-dialog",lt),t.component("k-users-dialog",at)}};const ct=G({inheritAttrs:!1,props:{id:String,icon:String,tab:String,tabs:Object,title:String},data:()=>({click:!1}),computed:{breadcrumb(){return this.$store.state.drawers.open},hasTabs(){return this.tabs&&Object.keys(this.tabs).length>1},index(){return this.breadcrumb.findIndex((t=>t.id===this._uid))},nested(){return this.index>0}},watch:{index(){-1===this.index&&this.close()}},destroyed(){this.$store.dispatch("drawers/close",this._uid)},methods:{close(){this.$refs.overlay.close()},goTo(t){if(t===this._uid)return!0;this.$store.dispatch("drawers/goto",t)},mouseup(){!0===this.click&&this.close(),this.click=!1},mousedown(t=!1){this.click=t,!0===this.click&&this.$store.dispatch("drawers/close")},onClose(){this.$store.dispatch("drawers/close",this._uid),this.$emit("close")},onOpen(){this.$store.dispatch("drawers/open",{id:this._uid,icon:this.icon,title:this.title}),this.$emit("open")},open(){this.$refs.overlay.open()}}},(function(){var t=this,e=t._self._c;return e("k-overlay",{ref:"overlay",attrs:{dimmed:!1},on:{close:t.onClose,open:t.onOpen}},[e("div",{staticClass:"k-drawer",attrs:{"data-id":t.id,"data-nested":t.nested},on:{mousedown:function(e){return e.stopPropagation(),t.mousedown(!0)},mouseup:t.mouseup}},[e("div",{staticClass:"k-drawer-box",on:{mousedown:function(e){return e.stopPropagation(),t.mousedown(!1)}}},[e("header",{staticClass:"k-drawer-header"},[1===t.breadcrumb.length?e("h2",{staticClass:"k-drawer-title"},[e("k-icon",{attrs:{type:t.icon}}),t._v(" "+t._s(t.title)+" ")],1):e("ul",{staticClass:"k-drawer-breadcrumb"},t._l(t.breadcrumb,(function(s){return e("li",{key:s.id},[e("k-button",{attrs:{icon:s.icon,text:s.title},on:{click:function(e){return t.goTo(s.id)}}})],1)})),0),t.hasTabs?e("nav",{staticClass:"k-drawer-tabs"},t._l(t.tabs,(function(s){return e("k-button",{key:s.name,staticClass:"k-drawer-tab",attrs:{current:t.tab==s.name,text:s.label},on:{click:function(e){return e.stopPropagation(),t.$emit("tab",s.name)}}})})),1):t._e(),e("nav",{staticClass:"k-drawer-options"},[t._t("options"),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"check"},on:{click:t.close}})],2)]),e("div",{staticClass:"k-drawer-body scroll-y-auto"},[t._t("default")],2)])])])}),[],!1,null,null,null,null).exports;const dt=G({inheritAttrs:!1,props:{empty:{type:String,default:()=>"Missing field setup"},icon:String,id:String,tabs:Object,title:String,type:String,value:Object},data:()=>({tab:null}),computed:{fields(){const t=this.tab||null;return(this.tabs[t]||this.firstTab).fields||{}},firstTab(){return Object.values(this.tabs)[0]}},methods:{close(){this.$refs.drawer.close()},focus(t){var e;"function"==typeof(null==(e=this.$refs.form)?void 0:e.focus)&&this.$refs.form.focus(t)},open(t,e=!0){var s;this.$refs.drawer.open(),this.tab=t||this.firstTab.name,!0===e&&(e=null==(s=Object.values(this.fields).find((t=>!0===t.autofocus)))?void 0:s.name),setTimeout((()=>{this.focus(e)}),10)}}},(function(){var t=this,e=t._self._c;return e("k-drawer",{ref:"drawer",staticClass:"k-form-drawer",attrs:{id:t.id,icon:t.icon,tabs:t.tabs,tab:t.tab,title:t.title},on:{close:function(e){return t.$emit("close")},open:function(e){return t.$emit("open")},tab:function(e){t.tab=e}},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0},{key:"default",fn:function(){return[0===Object.keys(t.fields).length?e("k-box",{attrs:{theme:"info"}},[t._v(" "+t._s(t.empty)+" ")]):e("k-form",{ref:"form",attrs:{autofocus:!0,fields:t.fields,value:t.$helper.clone(t.value)},on:{input:function(e){return t.$emit("input",e)},invalid:function(e){return t.$emit("invalid",e)}}})]},proxy:!0}],null,!0)})}),[],!1,null,null,null,null).exports,pt={install(t){t.component("k-drawer",ct),t.component("k-form-drawer",dt)}};const ht=G({props:{html:{type:Boolean,default:!1},limit:{type:Number,default:10},skip:{type:Array,default:()=>[]},options:Array,query:String},data:()=>({matches:[],selected:{text:null}}),methods:{close(){this.$refs.dropdown.close()},onSelect(t){this.$emit("select",t),this.$refs.dropdown.close()},search(t){if(t.length<1)return;const e=new RegExp(RegExp.escape(t),"ig");this.matches=this.options.filter((t=>!!t.text&&(-1===this.skip.indexOf(t.value)&&null!==t.text.match(e)))).slice(0,this.limit),this.$emit("search",t,this.matches),this.$refs.dropdown.open()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown",{staticClass:"k-autocomplete"},[t._t("default"),e("k-dropdown-content",t._g({ref:"dropdown",attrs:{autofocus:!0}},t.$listeners),t._l(t.matches,(function(s,n){return e("k-dropdown-item",t._b({key:n,on:{mousedown:function(e){return t.onSelect(s)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:(e.preventDefault(),t.onSelect(s))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onSelect(s))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:(e.preventDefault(),t.close.apply(null,arguments))}]}},"k-dropdown-item",s,!1),[e("span",{domProps:{innerHTML:t._s(t.html?s.text:t.$esc(s.text))}})])})),1),t._v(" "+t._s(t.query)+" ")],2)}),[],!1,null,null,null,null).exports;const mt=G({props:{disabled:Boolean,max:String,min:String,value:String},data(){return this.data(this.value)},computed:{numberOfDays(){return this.toDate().daysInMonth()},firstWeekday(){const t=this.toDate().day();return t>0?t:7},weekdays(){return["mon","tue","wed","thu","fri","sat","sun"].map((t=>this.$t("days."+t)))},weeks(){const t=this.firstWeekday-1;return Math.ceil((this.numberOfDays+t)/7)},monthnames(){return["january","february","march","april","may","june","july","august","september","october","november","december"].map((t=>this.$t("months."+t)))},months(){var t=[];return this.monthnames.forEach(((e,s)=>{const n=this.toDate(1,s);t.push({value:s,text:e,disabled:n.isBefore(this.current.min,"month")||n.isAfter(this.current.max,"month")})})),t},years(){var t,e,s,n;const i=null!=(e=null==(t=this.current.min)?void 0:t.get("year"))?e:this.current.year-20,o=null!=(n=null==(s=this.current.max)?void 0:s.get("year"))?n:this.current.year+20;return this.toOptions(i,o)}},watch:{value(t){const e=this.data(t);this.dt=e.dt,this.current=e.current}},methods:{data(t){const e=this.$library.dayjs.iso(t),s=this.$library.dayjs();return{dt:e,current:{month:(null!=e?e:s).month(),year:(null!=e?e:s).year(),min:this.$library.dayjs.iso(this.min),max:this.$library.dayjs.iso(this.max)}}},days(t){let e=[];const s=7*(t-1)+1,n=s+7;for(let i=s;ithis.numberOfDays;e.push(s?"":t)}return e},isDisabled(t){const e=this.toDate(t);return this.disabled||e.isBefore(this.current.min,"day")||e.isAfter(this.current.max,"day")},isSelected(t){return this.toDate(t).isSame(this.dt,"day")},isToday(t){const e=this.$library.dayjs();return this.toDate(t).isSame(e,"day")},onInput(){var t;this.$emit("input",(null==(t=this.dt)?void 0:t.toISO("date"))||null)},onNext(){const t=this.toDate().add(1,"month");this.show(t)},onPrev(){const t=this.toDate().subtract(1,"month");this.show(t)},select(t){const e="today"===t?this.$library.dayjs().merge(this.toDate(),"time"):this.toDate(t);this.dt=e,this.show(e),this.onInput()},show(t){this.current.year=t.year(),this.current.month=t.month()},toDate(t=1,e=this.current.month){return this.$library.dayjs(`${this.current.year}-${e+1}-${t}`)},toOptions(t,e){for(var s=[],n=t;n<=e;n++)s.push({value:n,text:this.$helper.pad(n)});return s}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-calendar-input"},[e("nav",[e("k-button",{attrs:{icon:"angle-left"},on:{click:t.onPrev}}),e("span",{staticClass:"k-calendar-selects"},[e("k-select-input",{attrs:{options:t.months,disabled:t.disabled,required:!0,value:t.current.month},on:{input:function(e){t.current.month=e}}}),e("k-select-input",{attrs:{options:t.years,disabled:t.disabled,required:!0,value:t.current.year},on:{input:function(e){t.current.year=e}}})],1),e("k-button",{attrs:{icon:"angle-right"},on:{click:t.onNext}})],1),e("table",{staticClass:"k-calendar-table"},[e("thead",[e("tr",t._l(t.weekdays,(function(s){return e("th",{key:"weekday_"+s},[t._v(" "+t._s(s)+" ")])})),0)]),e("tbody",t._l(t.weeks,(function(s){return e("tr",{key:"week_"+s},t._l(t.days(s),(function(s,n){return e("td",{key:"day_"+n,staticClass:"k-calendar-day",attrs:{"aria-current":!!t.isToday(s)&&"date","aria-selected":!!t.isSelected(s)&&"date"}},[s?e("k-button",{attrs:{disabled:t.isDisabled(s),text:s},on:{click:function(e){return t.select(s)}}}):t._e()],1)})),0)})),0),e("tfoot",[e("tr",[e("td",{staticClass:"k-calendar-today",attrs:{colspan:"7"}},[e("k-button",{attrs:{text:t.$t("today")},on:{click:function(e){return t.select("today")}}})],1)])])])])}),[],!1,null,null,null,null).exports;const ft=G({props:{count:Number,min:Number,max:Number,required:{type:Boolean,default:!1}},computed:{valid(){return!1===this.required&&0===this.count||(!0!==this.required||0!==this.count)&&(!(this.min&&this.countthis.max))}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-counter",attrs:{"data-invalid":!t.valid}},[e("span",[t._v(t._s(t.count))]),t.min&&t.max?e("span",{staticClass:"k-counter-rules"},[t._v("("+t._s(t.min)+"–"+t._s(t.max)+")")]):t.min?e("span",{staticClass:"k-counter-rules"},[t._v("≥ "+t._s(t.min))]):t.max?e("span",{staticClass:"k-counter-rules"},[t._v("≤ "+t._s(t.max))]):t._e()])}),[],!1,null,null,null,null).exports;const gt=G({props:{disabled:Boolean,config:Object,fields:{type:[Array,Object],default:()=>({})},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},data(){return{errors:{},listeners:{...this.$listeners,input:this.onInput,submit:this.onSubmit}}},methods:{focus(t){var e,s;null==(s=null==(e=this.$refs.fields)?void 0:e.focus)||s.call(e,t)},onInput(t,e,s){this.$emit("input",t,e,s)},onSubmit(){this.$emit("submit",this.value)},submit(){this.$refs.submitter.click()}}},(function(){var t=this,e=t._self._c;return e("form",{ref:"form",staticClass:"k-form",attrs:{method:"POST",autocomplete:"off",novalidate:""},on:{submit:function(e){return e.preventDefault(),t.onSubmit.apply(null,arguments)}}},[t._t("header"),t._t("default",(function(){return[e("k-fieldset",t._g({ref:"fields",attrs:{disabled:t.disabled,fields:t.fields,novalidate:t.novalidate,value:t.value}},t.listeners))]})),t._t("footer"),e("input",{ref:"submitter",staticClass:"k-form-submitter",attrs:{type:"submit"}})],2)}),[],!1,null,null,null,null).exports;const kt=G({props:{lock:[Boolean,Object]},data:()=>({isRefreshing:null,isLocking:null}),computed:{api(){return[this.$view.path+"/lock",null,null,!0]},hasChanges(){return this.$store.getters["content/hasChanges"]()},isDisabled(){return!1===this.$store.state.content.status.enabled},isLocked(){return"lock"===this.lockState},isUnlocked(){return"unlock"===this.lockState},mode(){return null!==this.lockState?this.lockState:!0===this.hasChanges?"changes":null},lockState(){return this.supportsLocking&&this.lock?this.lock.state:null},supportsLocking(){return!1!==this.lock},theme(){return"lock"===this.mode?"negative":"unlock"===this.mode?"info":"notice"}},watch:{hasChanges:{handler(t,e){!0===this.supportsLocking&&!1===this.isLocked&&!1===this.isUnlocked&&(!0===t?(this.onLock(),this.isLocking=setInterval(this.onLock,3e4)):e&&(clearInterval(this.isLocking),this.onLock(!1)))},immediate:!0},isLocked(t){!1===t&&this.$events.$emit("model.reload")}},created(){this.supportsLocking&&(this.isRefreshing=setInterval(this.check,1e4)),this.$events.$on("keydown.cmd.s",this.onSave)},destroyed(){clearInterval(this.isRefreshing),clearInterval(this.isLocking),this.$events.$off("keydown.cmd.s",this.onSave)},methods:{async check(){const{lock:t}=await this.$api.get(...this.api);e(this.$view.props,"lock",t)},async onLock(t=!0){if(!0===t)try{await this.$api.patch(...this.api)}catch(e){clearInterval(this.isLocking),this.$store.dispatch("content/revert")}else clearInterval(this.isLocking),await this.$api.delete(...this.api)},onDownload(){let t="";const e=this.$store.getters["content/changes"]();Object.keys(e).forEach((s=>{t+=s+": \n\n"+e[s],t+="\n\n----\n\n"}));let s=document.createElement("a");s.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),s.setAttribute("download",this.$view.path+".txt"),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)},async onResolve(){await this.onUnlock(!1),this.$store.dispatch("content/revert")},onRevert(){this.$refs.revert.open()},async onSave(t){if(!t)return!1;t.preventDefault&&t.preventDefault();try{await this.$store.dispatch("content/save"),this.$events.$emit("model.update"),this.$store.dispatch("notification/success",":)")}catch(e){if(403===e.code)return;e.details&&Object.keys(e.details).length>0?this.$store.dispatch("notification/error",{message:this.$t("error.form.incomplete"),details:e.details}):this.$store.dispatch("notification/error",{message:this.$t("error.form.notSaved"),details:[{label:"Exception: "+e.exception,message:e.message}]})}},async onUnlock(t=!0){const e=[this.$view.path+"/unlock",null,null,!0];!0===t?await this.$api.patch(...e):await this.$api.delete(...e),this.$reload({silent:!0})},revert(){this.$store.dispatch("content/revert"),this.$refs.revert.close()}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-form-buttons",attrs:{"data-theme":t.theme}},["unlock"===t.mode?e("k-view",[e("p",{staticClass:"k-form-lock-info"},[t._v(" "+t._s(t.$t("lock.isUnlocked"))+" ")]),e("span",{staticClass:"k-form-lock-buttons"},[e("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("download"),icon:"download"},on:{click:t.onDownload}}),e("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("confirm"),icon:"check"},on:{click:t.onResolve}})],1)]):"lock"===t.mode?e("k-view",[e("p",{staticClass:"k-form-lock-info"},[e("k-icon",{attrs:{type:"lock"}}),e("span",{domProps:{innerHTML:t._s(t.$t("lock.isLocked",{email:t.$esc(t.lock.data.email)}))}})],1),t.lock.data.unlockable?e("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("lock.unlock"),icon:"unlock"},on:{click:function(e){return t.onUnlock()}}}):e("k-icon",{staticClass:"k-form-lock-loader",attrs:{type:"loader"}})],1):"changes"===t.mode?e("k-view",[e("k-button",{staticClass:"k-form-button",attrs:{disabled:t.isDisabled,text:t.$t("revert"),icon:"undo"},on:{click:t.onRevert}}),e("k-button",{staticClass:"k-form-button",attrs:{disabled:t.isDisabled,text:t.$t("save"),icon:"check"},on:{click:t.onSave}})],1):t._e(),e("k-dialog",{ref:"revert",attrs:{"submit-button":t.$t("revert"),icon:"undo",theme:"negative"},on:{submit:t.revert}},[e("k-text",{attrs:{html:t.$t("revert.confirm")}})],1)],1)}),[],!1,null,null,null,null).exports;const bt=G({data:()=>({isOpen:!1,options:[]}),computed:{hasChanges(){return this.ids.length>0},ids(){return Object.keys(this.store).filter((t=>{var e;return Object.keys((null==(e=this.store[t])?void 0:e.changes)||{}).length>0}))},store(){return this.$store.state.content.models}},methods:{async toggle(){if(!1===this.$refs.list.isOpen)try{await this.$dropdown("changes",{method:"POST",body:{ids:this.ids}})((t=>{this.options=t}))}catch(t){return this.$store.dispatch("notification/success",this.$t("lock.unsaved.empty")),this.$store.dispatch("content/clear"),!1}this.$refs.list&&this.$refs.list.toggle()}}},(function(){var t=this,e=t._self._c;return t.hasChanges?e("k-dropdown",{staticClass:"k-form-indicator"},[e("k-button",{staticClass:"k-form-indicator-toggle k-topbar-button",attrs:{icon:"edit"},on:{click:t.toggle}}),e("k-dropdown-content",{ref:"list",attrs:{align:"right",theme:"light"}},[e("p",{staticClass:"k-form-indicator-info"},[t._v(t._s(t.$t("lock.unsaved"))+":")]),e("hr"),t._l(t.options,(function(s){return e("k-dropdown-item",t._b({key:s.id},"k-dropdown-item",s,!1),[t._v(" "+t._s(s.text)+" ")])}))],2)],1):t._e()}),[],!1,null,null,null,null).exports,vt={props:{after:String}},yt={props:{autofocus:Boolean}},$t={props:{before:String}},_t={props:{disabled:Boolean}},xt={props:{help:String}},wt={props:{id:{type:[Number,String],default(){return this._uid}}}},St={props:{invalid:Boolean}},Ct={props:{label:String}},Ot={props:{name:[Number,String]}},At={props:{required:Boolean}},Tt={mixins:[_t,xt,Ct,Ot,At],props:{counter:[Boolean,Object],endpoints:Object,input:[String,Number],translate:Boolean,type:String}};const It=G({mixins:[Tt],inheritAttrs:!1,computed:{labelText(){return this.label||" "}}},(function(){var t=this,e=t._self._c;return e("div",{class:"k-field k-field-name-"+t.name,attrs:{"data-disabled":t.disabled,"data-translate":t.translate},on:{focusin:function(e){return t.$emit("focus",e)},focusout:function(e){return t.$emit("blur",e)}}},[t._t("header",(function(){return[e("header",{staticClass:"k-field-header"},[t._t("label",(function(){return[e("label",{staticClass:"k-field-label",attrs:{for:t.input}},[t._v(" "+t._s(t.labelText)+" "),t.required?e("abbr",{attrs:{title:t.$t("field.required")}},[t._v("*")]):t._e()])]})),t._t("options"),t._t("counter",(function(){return[t.counter?e("k-counter",t._b({staticClass:"k-field-counter",attrs:{required:t.required}},"k-counter",t.counter,!1)):t._e()]}))],2)]})),t._t("default"),t._t("footer",(function(){return[t.help||t.$slots.help?e("footer",{staticClass:"k-field-footer"},[t._t("help",(function(){return[t.help?e("k-text",{staticClass:"k-field-help",attrs:{theme:"help",html:t.help}}):t._e()]}))],2):t._e()]}))],2)}),[],!1,null,null,null,null).exports;const jt=G({props:{config:Object,disabled:Boolean,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},data:()=>({errors:{}}),methods:{focus(t){if(t)return void(this.hasField(t)&&"function"==typeof this.$refs[t][0].focus&&this.$refs[t][0].focus());const e=Object.keys(this.$refs)[0];this.focus(e)},hasFieldType(t){return this.$helper.isComponent(`k-${t}-field`)},hasField(t){var e;return null==(e=this.$refs[t])?void 0:e[0]},onInvalid(t,e,s,n){this.errors[n]=e,this.$emit("invalid",this.errors)},onInput(t,e,s){const n={...this.value,[s]:t};this.$emit("input",n,e,s)},hasErrors(){return Object.keys(this.errors).length}}},(function(){var t=this,e=t._self._c;return e("fieldset",{staticClass:"k-fieldset"},[e("k-grid",[t._l(t.fields,(function(s,n){return[t.$helper.field.isVisible(s,t.value)?e("k-column",{key:s.signature,attrs:{width:s.width}},[e("k-error-boundary",[t.hasFieldType(s.type)?e("k-"+s.type+"-field",t._b({ref:n,refInFor:!0,tag:"component",attrs:{disabled:t.disabled||s.disabled,"form-data":t.value,name:n,novalidate:t.novalidate,value:t.value[n]},on:{input:function(e){return t.onInput(e,s,n)},focus:function(e){return t.$emit("focus",e,s,n)},invalid:(e,i)=>t.onInvalid(e,i,s,n),submit:function(e){return t.$emit("submit",e,s,n)}}},"component",s,!1)):e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[t._v(" The field type "),e("strong",[t._v('"'+t._s(n)+'"')]),t._v(" does not exist ")])],1)],1)],1):t._e()]}))],2)],1)}),[],!1,null,null,null,null).exports,Et={mixins:[vt,$t,_t,St],props:{autofocus:Boolean,type:String,icon:[String,Boolean],theme:String,novalidate:{type:Boolean,default:!1},value:{type:[String,Boolean,Number,Object,Array],default:null}}};const Mt=G({mixins:[Et],inheritAttrs:!1,data(){return{isInvalid:this.invalid,listeners:{...this.$listeners,invalid:(t,e)=>{this.isInvalid=t,this.$emit("invalid",t,e)}}}},computed:{inputProps(){return{...this.$props,...this.$attrs}}},methods:{blur(t){(null==t?void 0:t.relatedTarget)&&!1===this.$el.contains(t.relatedTarget)&&this.trigger(null,"blur")},focus(t){this.trigger(t,"focus")},select(t){this.trigger(t,"select")},trigger(t,e){var s,n,i;if("INPUT"===(null==(s=null==t?void 0:t.target)?void 0:s.tagName)&&"function"==typeof(null==(n=null==t?void 0:t.target)?void 0:n[e]))return void t.target[e]();if("function"==typeof(null==(i=this.$refs.input)?void 0:i[e]))return void this.$refs.input[e]();const o=this.$el.querySelector("input, select, textarea");"function"==typeof(null==o?void 0:o[e])&&o[e]()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-input",attrs:{"data-disabled":t.disabled,"data-invalid":!t.novalidate&&t.isInvalid,"data-theme":t.theme,"data-type":t.type}},[t.$slots.before||t.before?e("span",{staticClass:"k-input-before",on:{click:t.focus}},[t._t("before",(function(){return[t._v(t._s(t.before))]}))],2):t._e(),e("span",{staticClass:"k-input-element",on:{click:function(e){return e.stopPropagation(),t.focus.apply(null,arguments)}}},[t._t("default",(function(){return[e("k-"+t.type+"-input",t._g(t._b({ref:"input",tag:"component",attrs:{value:t.value}},"component",t.inputProps,!1),t.listeners))]}))],2),t.$slots.after||t.after?e("span",{staticClass:"k-input-after",on:{click:t.focus}},[t._t("after",(function(){return[t._v(t._s(t.after))]}))],2):t._e(),t.$slots.icon||t.icon?e("span",{staticClass:"k-input-icon",on:{click:t.focus}},[t._t("icon",(function(){return[e("k-icon",{attrs:{type:t.icon}})]}))],2):t._e()])}),[],!1,null,null,null,null).exports;const Lt=G({props:{methods:Array},data:()=>({currentForm:null,isLoading:!1,user:{email:"",password:"",remember:!1}}),computed:{canToggle(){return null!==this.codeMode&&!0===this.methods.includes("password")&&(!0===this.methods.includes("password-reset")||!0===this.methods.includes("code"))},codeMode(){return!0===this.methods.includes("password-reset")?"password-reset":!0===this.methods.includes("code")?"code":null},fields(){let t={email:{autofocus:!0,label:this.$t("email"),type:"email",required:!0,link:!1}};return"email-password"===this.form&&(t.password={label:this.$t("password"),type:"password",minLength:8,required:!0,autocomplete:"current-password",counter:!1}),t},form(){return this.currentForm?this.currentForm:"password"===this.methods[0]?"email-password":"email"},isResetForm(){return"password-reset"===this.codeMode&&"email"===this.form},toggleText(){return this.$t("login.toggleText."+this.codeMode+"."+this.formOpposite(this.form))}},methods:{formOpposite:t=>"email-password"===t?"email":"email-password",async login(){this.$emit("error",null),this.isLoading=!0;let t=Object.assign({},this.user);"email"===this.currentForm&&(t.password=null),!0===this.isResetForm&&(t.remember=!1);try{await this.$api.auth.login(t),this.$reload({globals:["$system","$translation"]})}catch(e){this.$emit("error",e)}finally{this.isLoading=!1}},toggleForm(){this.currentForm=this.formOpposite(this.form),this.$refs.fieldset.focus("email")}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-login-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[e("div",{staticClass:"k-login-fields"},[!0===t.canToggle?e("button",{staticClass:"k-login-toggler",attrs:{type:"button"},on:{click:t.toggleForm}},[t._v(" "+t._s(t.toggleText)+" ")]):t._e(),e("k-fieldset",{ref:"fieldset",attrs:{novalidate:!0,fields:t.fields,value:t.user},on:{input:function(e){t.user=e}}})],1),e("div",{staticClass:"k-login-buttons"},[!1===t.isResetForm?e("span",{staticClass:"k-login-checkbox"},[e("k-checkbox-input",{attrs:{value:t.user.remember,label:t.$t("login.remember")},on:{input:function(e){t.user.remember=e}}})],1):t._e(),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("login"+(t.isResetForm?".reset":"")))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)],1)])}),[],!1,null,null,null,null).exports;const Bt=G({props:{methods:Array,pending:Object},data:()=>({code:"",isLoadingBack:!1,isLoadingLogin:!1}),computed:{mode(){return!0===this.methods.includes("password-reset")?"password-reset":"login"}},methods:{async back(){this.isLoadingBack=!0,this.$go("/logout")},async login(){this.$emit("error",null),this.isLoadingLogin=!0;try{await this.$api.auth.verifyCode(this.code),this.$store.dispatch("notification/success",this.$t("welcome")),"password-reset"===this.mode?this.$go("reset-password"):this.$reload()}catch(t){this.$emit("error",t)}finally{this.isLoadingLogin=!1}}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-login-form k-login-code-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[e("k-user-info",{attrs:{user:t.pending.email}}),e("k-text-field",{attrs:{autofocus:!0,counter:!1,help:t.$t("login.code.text."+t.pending.challenge),label:t.$t("login.code.label."+t.mode),novalidate:!0,placeholder:t.$t("login.code.placeholder."+t.pending.challenge),required:!0,value:t.code,autocomplete:"one-time-code",icon:"unlock",name:"code"},on:{input:function(e){t.code=e}}}),e("div",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button k-login-back-button",attrs:{icon:"angle-left"},on:{click:t.back}},[t._v(" "+t._s(t.$t("back"))+" "),t.isLoadingBack?[t._v(" … ")]:t._e()],2),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("login"+("password-reset"===t.mode?".reset":"")))+" "),t.isLoadingLogin?[t._v(" … ")]:t._e()],2)],1)],1)}),[],!1,null,null,null,null).exports;const Dt=G({props:{display:{type:String,default:"HH:mm"},value:String},computed:{day(){return this.formatTimes([6,7,8,9,10,11,"-",12,13,14,15,16,17])},night(){return this.formatTimes([18,19,20,21,22,23,"-",0,1,2,3,4,5])}},methods:{formatTimes(t){return t.map((t=>{if("-"===t)return t;const e=this.$library.dayjs(t+":00","H:mm");return{display:e.format(this.display),select:e.toISO("time")}}))},select(t){this.$emit("input",t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-times"},[e("div",{staticClass:"k-times-slot"},[e("k-icon",{attrs:{type:"sun"}}),e("ul",t._l(t.day,(function(s){return e("li",{key:s.select},["-"===s?e("hr"):e("k-button",{on:{click:function(e){return t.select(s.select)}}},[t._v(t._s(s.display))])],1)})),0)],1),e("div",{staticClass:"k-times-slot"},[e("k-icon",{attrs:{type:"moon"}}),e("ul",t._l(t.night,(function(s){return e("li",{key:s.select},["-"===s?e("hr"):e("k-button",{on:{click:function(e){return t.select(s.select)}}},[t._v(t._s(s.display))])],1)})),0)],1)])}),[],!1,null,null,null,null).exports;const Pt=G({props:{accept:{type:String,default:"*"},attributes:{type:Object},max:{type:Number},method:{type:String,default:"POST"},multiple:{type:Boolean,default:!0},url:{type:String}},data(){return{options:this.$props,completed:{},errors:[],files:[],total:0}},computed:{limit(){return!1===this.options.multiple?1:this.options.max}},methods:{open(t){this.params(t),setTimeout((()=>{this.$refs.input.click()}),1)},params(t){this.options=Object.assign({},this.$props,t)},select(t){this.upload(t.target.files)},drop(t,e){this.params(e),this.upload(t)},upload(t){this.$refs.dialog.open(),this.files=[...t],this.completed={},this.errors=[],this.hasErrors=!1,this.limit&&(this.files=this.files.slice(0,this.limit)),this.total=this.files.length,this.files.forEach((t=>{var e,s;this.$helper.upload(t,{url:this.options.url,attributes:this.options.attributes,method:this.options.method,headers:{"X-CSRF":window.panel.$system.csrf},progress:(t,e,s)=>{var n,i;null==(i=null==(n=this.$refs[e.name])?void 0:n[0])||i.set(s)},success:(t,e,s)=>{this.complete(e,s.data)},error:(t,e,s)=>{this.errors.push({file:e,message:s.message}),this.complete(e,s.data)}}),void 0!==(null==(s=null==(e=this.options)?void 0:e.attributes)?void 0:s.sort)&&this.options.attributes.sort++}))},complete(t,e){if(this.completed[t.name]=e,Object.keys(this.completed).length==this.total){if(this.$refs.input.value="",this.errors.length>0)return this.$forceUpdate(),void this.$emit("error",this.files);setTimeout((()=>{this.$refs.dialog.close(),this.$emit("success",this.files,Object.values(this.completed))}),250)}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-upload"},[e("input",{ref:"input",attrs:{accept:t.options.accept,multiple:t.options.multiple,"aria-hidden":"true",type:"file",tabindex:"-1"},on:{change:t.select,click:function(t){t.stopPropagation()}}}),e("k-dialog",{ref:"dialog",staticClass:"k-upload-dialog",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"},scopedSlots:t._u([{key:"footer",fn:function(){return[t.errors.length>0?[e("k-button-group",{attrs:{buttons:[{icon:"check",text:t.$t("confirm"),click:()=>t.$refs.dialog.close()}]}})]:t._e()]},proxy:!0}])},[t.errors.length>0?[e("k-headline",[t._v(t._s(t.$t("upload.errors")))]),e("ul",{staticClass:"k-upload-error-list"},t._l(t.errors,(function(s,n){return e("li",{key:"error-"+n},[e("p",{staticClass:"k-upload-error-filename"},[t._v(" "+t._s(s.file.name)+" ")]),e("p",{staticClass:"k-upload-error-message"},[t._v(" "+t._s(s.message)+" ")])])})),0)]:[e("k-headline",[t._v(t._s(t.$t("upload.progress")))]),e("ul",{staticClass:"k-upload-list"},t._l(t.files,(function(s,n){return e("li",{key:"file-"+n},[e("k-progress",{ref:s.name,refInFor:!0}),e("p",{staticClass:"k-upload-list-filename"},[t._v(" "+t._s(s.name)+" ")]),e("p",[t._v(t._s(t.errors[s.name]))])],1)})),0)]],2)],1)}),[],!1,null,null,null,null).exports;const Nt=t=>({$from:e})=>((t,e)=>{for(let s=t.depth;s>0;s--){const n=t.node(s);if(e(n))return{pos:s>0?t.before(s):0,start:t.start(s),depth:s,node:n}}})(e,t),Ft=t=>e=>{if((t=>t instanceof r)(e)){const{node:s,$from:n}=e;if(((t,e)=>Array.isArray(t)&&t.indexOf(e.type)>-1||e.type===t)(t,s))return{node:s,pos:n.pos,depth:n.depth}}},qt=(t,e,s={})=>{const n=Ft(e)(t.selection)||Nt((t=>t.type===e))(t.selection);return Object.keys(s).length&&n?n.node.hasMarkup(e,{...n.node.attrs,...s}):!!n};function Rt(t=null,e=null){if(!t||!e)return!1;const s=t.parent.childAfter(t.parentOffset);if(!s.node)return!1;const n=s.node.marks.find((t=>t.type===e));if(!n)return!1;let i=t.index(),o=t.start()+s.offset,r=i+1,l=o+s.node.nodeSize;for(;i>0&&n.isInSet(t.parent.child(i-1).marks);)i-=1,o-=t.parent.child(i).nodeSize;for(;r{i=[...i,...t.marks]}));const o=i.find((t=>t.type.name===e.name));return o?o.attrs:{}},getNodeAttrs:function(t,e){const{from:s,to:n}=t.selection;let i=[];t.doc.nodesBetween(s,n,(t=>{i=[...i,t]}));const o=i.reverse().find((t=>t.type.name===e.name));return o?o.attrs:{}},markInputRule:function(t,e,n){return new s(t,((t,s,i,o)=>{const r=n instanceof Function?n(s):n,{tr:l}=t,a=s.length-1;let u=o,c=i;if(s[a]){const n=i+s[0].indexOf(s[a-1]),r=n+s[a-1].length-1,d=n+s[a-1].lastIndexOf(s[a]),p=d+s[a].length,h=function(t,e,s){let n=[];return s.doc.nodesBetween(t,e,((t,e)=>{n=[...n,...t.marks.map((s=>({start:e,end:e+t.nodeSize,mark:s})))]})),n}(i,o,t).filter((t=>{const{excluded:s}=t.mark.type;return s.find((t=>t.name===e.name))})).filter((t=>t.end>n));if(h.length)return!1;pn&&l.delete(n,d),c=n,u=c+s[a].length}return l.addMark(c,u,e.create(r)),l.removeStoredMark(e),l}))},markIsActive:function(t,e){const{from:s,$from:n,to:i,empty:o}=t.selection;return o?!!e.isInSet(t.storedMarks||n.marks()):!!t.doc.rangeHasMark(s,i,e)},markPasteRule:function(t,e,s){const r=(n,i)=>{const l=[];return n.forEach((n=>{var o;if(n.isText){const{text:r,marks:a}=n;let u,c=0;const d=!!a.filter((t=>"link"===t.type.name))[0];for(;!d&&null!==(u=t.exec(r));)if((null==(o=null==i?void 0:i.type)?void 0:o.allowsMarkType(e))&&u[1]){const t=u.index,i=t+u[0].length,o=t+u[0].indexOf(u[1]),r=o+u[1].length,a=s instanceof Function?s(u):s;t>0&&l.push(n.cut(c,t)),l.push(n.cut(o,r).mark(e.create(a).addToSet(n.marks))),c=i}cnew i(r(t.content),t.openStart,t.openEnd)}})},minMax:function(t=0,e=0,s=0){return Math.min(Math.max(parseInt(t,10),e),s)},nodeIsActive:qt,nodeInputRule:function(t,e,n){return new s(t,((t,s,i,o)=>{const r=n instanceof Function?n(s):n,{tr:l}=t;return s[0]&&l.replaceWith(i-1,o,e.create(r)),l}))},pasteRule:function(t,e,s){const r=n=>{const i=[];return n.forEach((n=>{if(n.isText){const{text:o}=n;let r,l=0;do{if(r=t.exec(o),r){const t=r.index,o=t+r[0].length,a=s instanceof Function?s(r[0]):s;t>0&&i.push(n.cut(l,t)),i.push(n.cut(t,o).mark(e.create(a).addToSet(n.marks))),l=o}}while(r);lnew i(r(t.content),t.openStart,t.openEnd)}})},removeMark:function(t){return(e,s)=>{const{tr:n,selection:i}=e;let{from:o,to:r}=i;const{$from:l,empty:a}=i;if(a){const e=Rt(l,t);o=e.from,r=e.to}return n.removeMark(o,r,t),s(n)}},toggleBlockType:function(t,e,s={}){return(n,i,o)=>qt(n,t,s)?l(e)(n,i,o):l(t,s)(n,i,o)},toggleList:function(t,e){return(s,n,i)=>{const{schema:o,selection:r}=s,{$from:l,$to:c}=r,d=l.blockRange(c);if(!d)return!1;const p=Nt((t=>zt(t,o)))(r);if(d.depth>=1&&p&&d.depth-p.depth<=1){if(p.node.type===t)return a(e)(s,n,i);if(zt(p.node,o)&&t.validContent(p.node.content)){const{tr:e}=s;return e.setNodeMarkup(p.pos,t),n&&n(e),!1}}return u(t)(s,n,i)}},updateMark:function(t,e){return(s,n)=>{const{tr:i,selection:o,doc:r}=s,{ranges:l,empty:a}=o;if(a){const{from:s,to:n}=Rt(o.$from,t);r.rangeHasMark(s,n,t)&&i.removeMark(s,n,t),i.addMark(s,n,t.create(e))}else l.forEach((s=>{const{$to:n,$from:o}=s;r.rangeHasMark(o.pos,n.pos,t)&&i.removeMark(o.pos,n.pos,t),i.addMark(o.pos,n.pos,t.create(e))}));return n(i)}}};class Ht{emit(t,...e){this._callbacks=this._callbacks||{};const s=this._callbacks[t];return s&&s.forEach((t=>t.apply(this,e))),this}off(t,e){if(arguments.length){const s=this._callbacks?this._callbacks[t]:null;s&&(e?this._callbacks[t]=s.filter((t=>t!==e)):delete this._callbacks[t])}else this._callbacks={};return this}on(t,e){return this._callbacks=this._callbacks||{},this._callbacks[t]=this._callbacks[t]||[],this._callbacks[t].push(e),this}}class Ut{constructor(t=[],e){t.forEach((t=>{t.bindEditor(e),t.init()})),this.extensions=t}commands({schema:t,view:e}){return this.extensions.filter((t=>t.commands)).reduce(((s,n)=>{const{name:i,type:o}=n,r={},l=n.commands({schema:t,utils:Yt,...["node","mark"].includes(o)?{type:t[`${o}s`][i]}:{}}),a=(t,s)=>{r[t]=t=>{if("function"!=typeof s||!e.editable)return!1;e.focus();const n=s(t);return"function"==typeof n?n(e.state,e.dispatch,e):n}};return"object"==typeof l?Object.entries(l).forEach((([t,e])=>{a(t,e)})):a(i,l),{...s,...r}}),{})}buttons(t="mark"){const e={};return this.extensions.filter((e=>e.type===t)).filter((t=>t.button)).forEach((t=>{Array.isArray(t.button)?t.button.forEach((t=>{e[t.id||t.name]=t})):e[t.name]=t.button})),e}getAllowedExtensions(t){return t instanceof Array||!t?t instanceof Array?this.extensions.filter((e=>!t.includes(e.name))):this.extensions:[]}getFromExtensions(t,e,s=this.extensions){return s.filter((t=>["extension"].includes(t.type))).filter((e=>e[t])).map((s=>s[t]({...e,utils:Yt})))}getFromNodesAndMarks(t,e,s=this.extensions){return s.filter((t=>["node","mark"].includes(t.type))).filter((e=>e[t])).map((s=>s[t]({...e,type:e.schema[`${s.type}s`][s.name],utils:Yt})))}inputRules({schema:t,excludedExtensions:e}){const s=this.getAllowedExtensions(e);return[...this.getFromExtensions("inputRules",{schema:t},s),...this.getFromNodesAndMarks("inputRules",{schema:t},s)].reduce(((t,e)=>[...t,...e]),[])}keymaps({schema:t}){return[...this.getFromExtensions("keys",{schema:t}),...this.getFromNodesAndMarks("keys",{schema:t})].map((t=>b(t)))}get marks(){return this.extensions.filter((t=>"mark"===t.type)).reduce(((t,{name:e,schema:s})=>({...t,[e]:s})),{})}get nodes(){return this.extensions.filter((t=>"node"===t.type)).reduce(((t,{name:e,schema:s})=>({...t,[e]:s})),{})}get options(){const{view:t}=this;return this.extensions.reduce(((e,s)=>({...e,[s.name]:new Proxy(s.options,{set(e,s,n){const i=e[s]!==n;return Object.assign(e,{[s]:n}),i&&t.updateState(t.state),!0}})})),{})}pasteRules({schema:t,excludedExtensions:e}){const s=this.getAllowedExtensions(e);return[...this.getFromExtensions("pasteRules",{schema:t},s),...this.getFromNodesAndMarks("pasteRules",{schema:t},s)].reduce(((t,e)=>[...t,...e]),[])}plugins({schema:t}){return[...this.getFromExtensions("plugins",{schema:t}),...this.getFromNodesAndMarks("plugins",{schema:t})].reduce(((t,e)=>[...t,...e]),[]).map((t=>t instanceof n?t:new n(t)))}}class Kt{constructor(t={}){this.options={...this.defaults,...t}}init(){return null}bindEditor(t=null){this.editor=t}get name(){return null}get type(){return"extension"}get defaults(){return{}}plugins(){return[]}inputRules(){return[]}pasteRules(){return[]}keys(){return{}}}class Vt extends Kt{constructor(t={}){super(t)}get type(){return"node"}get schema(){return null}commands(){return{}}}class Jt extends Vt{get defaults(){return{inline:!1}}get name(){return"doc"}get schema(){return{content:this.options.inline?"inline*":"block+"}}}class Gt extends Vt{get button(){return{id:this.name,icon:"paragraph",label:window.panel.$t("toolbar.button.paragraph"),name:this.name}}commands({utils:t,type:e}){return{paragraph:()=>t.setBlockType(e)}}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}get name(){return"paragraph"}}class Wt extends Vt{get name(){return"text"}get schema(){return{group:"inline"}}}class Xt extends Ht{constructor(t={}){super(),this.defaults={autofocus:!1,content:"",disableInputRules:!1,disablePasteRules:!1,editable:!0,element:null,extensions:[],emptyDocument:{type:"doc",content:[]},events:{},inline:!1,parseOptions:{},topNode:"doc",useBuiltInExtensions:!0},this.init(t)}blur(){this.view.dom.blur()}get builtInExtensions(){return this.options.useBuiltInExtensions?[new Jt({inline:this.options.inline}),new Wt,new Gt]:[]}buttons(t){return this.extensions.buttons(t)}clearContent(t=!1){this.setContent(this.options.emptyDocument,t)}command(t,...e){this.commands[t]&&this.commands[t](...e)}createCommands(){return this.extensions.commands({schema:this.schema,view:this.view})}createDocument(t,e=this.options.parseOptions){if(null===t)return this.schema.nodeFromJSON(this.options.emptyDocument);if("object"==typeof t)try{return this.schema.nodeFromJSON(t)}catch(s){return window.console.warn("Invalid content.","Passed value:",t,"Error:",s),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"==typeof t){const s=`
${t}
`,n=(new window.DOMParser).parseFromString(s,"text/html").body.firstElementChild;return v.fromSchema(this.schema).parse(n,e)}return!1}createEvents(){const t=this.options.events||{};return Object.entries(t).forEach((([t,e])=>{this.on(t,e)})),t}createExtensions(){return new Ut([...this.builtInExtensions,...this.options.extensions],this)}createFocusEvents(){const t=(t,e,s=!0)=>{this.focused=s,this.emit(s?"focus":"blur",{event:e,state:t.state,view:t});const n=this.state.tr.setMeta("focused",s);this.view.dispatch(n)};return new n({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(e,s)=>{t(e,s,!0)},blur:(e,s)=>{t(e,s,!1)}}}})}createInputRules(){return this.extensions.inputRules({schema:this.schema,excludedExtensions:this.options.disableInputRules})}createKeymaps(){return this.extensions.keymaps({schema:this.schema})}createMarks(){return this.extensions.marks}createNodes(){return this.extensions.nodes}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createPlugins(){return this.extensions.plugins({schema:this.schema})}createSchema(){return new y({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return $.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,_({rules:this.inputRules}),...this.pasteRules,...this.keymaps,b({Backspace:C}),b(O),this.createFocusEvents()]})}createView(){return new x(this.element,{dispatchTransaction:this.dispatchTransaction.bind(this),editable:()=>this.options.editable,handlePaste:(t,e)=>{if("function"==typeof this.events.paste){const t=e.clipboardData.getData("text/html"),s=e.clipboardData.getData("text/plain");if(!0===this.events.paste(e,t,s))return!0}},handleDrop:(...t)=>{this.emit("drop",...t)},state:this.createState()})}destroy(){this.view&&this.view.destroy()}dispatchTransaction(t){const e=this.state,s=this.state.apply(t);this.view.updateState(s),this.selection={from:this.state.selection.from,to:this.state.selection.to},this.setActiveNodesAndMarks();const n={editor:this,getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:t};this.emit("transaction",n),!t.docChanged&&t.getMeta("preventUpdate")||this.emit("update",n);const{from:i,to:o}=this.state.selection,r=!e||!e.selection.eq(s.selection);this.emit(s.selection.empty?"deselect":"select",{...n,from:i,hasChanged:r,to:o})}focus(t=null){if(this.view.focused&&null===t||!1===t)return;const{from:e,to:s}=this.selectionAtPosition(t);this.setSelection(e,s),setTimeout((()=>this.view.focus()),10)}getHTML(){const t=document.createElement("div"),e=w.fromSchema(this.schema).serializeFragment(this.state.doc.content);return t.appendChild(e),this.options.inline&&t.querySelector("p")?t.querySelector("p").innerHTML:t.innerHTML}getJSON(){return this.state.doc.toJSON()}getMarkAttrs(t=null){return this.activeMarkAttrs[t]}getSchemaJSON(){return JSON.parse(JSON.stringify({nodes:this.nodes,marks:this.marks}))}init(t={}){this.options={...this.defaults,...t},this.element=this.options.element,this.focused=!1,this.selection={from:0,to:0},this.events=this.createEvents(),this.extensions=this.createExtensions(),this.nodes=this.createNodes(),this.marks=this.createMarks(),this.schema=this.createSchema(),this.keymaps=this.createKeymaps(),this.inputRules=this.createInputRules(),this.pasteRules=this.createPasteRules(),this.plugins=this.createPlugins(),this.view=this.createView(),this.commands=this.createCommands(),this.setActiveNodesAndMarks(),!1!==this.options.autofocus&&this.focus(this.options.autofocus),this.emit("init",{view:this.view,state:this.state}),this.extensions.view=this.view,this.setContent(this.options.content,!0)}isEditable(){return this.options.editable}isEmpty(){if(this.state)return 0===this.state.doc.textContent.length}get isActive(){return Object.entries({...this.activeMarks,...this.activeNodes}).reduce(((t,[e,s])=>({...t,[e]:(t={})=>s(t)})),{})}removeMark(t){if(this.schema.marks[t])return Yt.removeMark(this.schema.marks[t])(this.state,this.view.dispatch)}selectionAtPosition(t=null){if(this.selection&&null===t)return this.selection;if("start"===t||!0===t)return{from:0,to:0};if("end"===t){const{doc:t}=this.state;return{from:t.content.size,to:t.content.size}}return{from:t,to:t}}setActiveNodesAndMarks(){this.activeMarks=Object.values(this.schema.marks).filter((t=>Yt.markIsActive(this.state,t))).map((t=>t.name)),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce(((t,[e,s])=>({...t,[e]:Yt.getMarkAttrs(this.state,s)})),{}),this.activeNodes=Object.values(this.schema.nodes).filter((t=>Yt.nodeIsActive(this.state,t))).map((t=>t.name)),this.activeNodeAttrs=Object.entries(this.schema.nodes).reduce(((t,[e,s])=>({...t,[e]:Yt.getNodeAttrs(this.state,s)})),{})}setContent(t={},e=!1,s){const{doc:n,tr:i}=this.state,o=this.createDocument(t,s),r=i.replaceWith(0,n.content.size,o).setMeta("preventUpdate",!e);this.view.dispatch(r)}setSelection(t=0,e=0){const{doc:s,tr:n}=this.state,i=Yt.minMax(t,0,s.content.size),o=Yt.minMax(e,0,s.content.size),r=S.create(s,i,o),l=n.setSelection(r);this.view.dispatch(l)}get state(){return this.view?this.view.state:null}toggleMark(t){if(this.schema.marks[t])return Yt.toggleMark(this.schema.marks[t])(this.state,this.view.dispatch)}updateMark(t,e){if(this.schema.marks[t])return Yt.updateMark(this.schema.marks[t],e)(this.state,this.view.dispatch)}}const Zt=G({data:()=>({link:{href:null,title:null,target:!1}}),computed:{fields(){return{href:{label:this.$t("url"),type:"text",icon:"url"},title:{label:this.$t("title"),type:"text",icon:"title"},target:{label:this.$t("open.newWindow"),type:"toggle",text:[this.$t("no"),this.$t("yes")]}}}},methods:{open(t){this.link={title:null,target:!1,...t},this.link.target=Boolean(this.link.target),this.$refs.dialog.open()},submit(){this.$emit("submit",{...this.link,target:this.link.target?"_blank":null}),this.$refs.dialog.close()}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",{ref:"dialog",attrs:{fields:t.fields,"submit-button":t.$t("confirm"),value:t.link,size:"medium"},on:{close:function(e){return t.$emit("close")},input:function(e){t.link=e},submit:t.submit}})}),[],!1,null,null,null,null).exports;const Qt=G({data:()=>({email:{email:null,title:null}}),computed:{fields(){return{href:{label:this.$t("email"),type:"email",icon:"email"},title:{label:this.$t("title"),type:"text",icon:"title"}}}},methods:{open(t){this.email={title:null,...t},this.$refs.dialog.open()},submit(){this.$emit("submit",this.email),this.$refs.dialog.close()}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",{ref:"dialog",attrs:{fields:t.fields,"submit-button":t.$t("confirm"),value:t.email,size:"medium"},on:{input:function(e){t.email=e},close:function(e){return t.$emit("close")},submit:t.submit}})}),[],!1,null,null,null,null).exports;class te extends Kt{constructor(t={}){super(t)}command(){return()=>{}}remove(){this.editor.removeMark(this.name)}get schema(){return null}get type(){return"mark"}toggle(){return this.editor.toggleMark(this.name)}update(t){this.editor.updateMark(this.name,t)}}class ee extends te{get button(){return{icon:"code",label:window.panel.$t("toolbar.button.code")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:`)([^`]+)(?:`)$/,t)]}keys(){return{"Mod-`":()=>this.toggle()}}get name(){return"code"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:`)([^`]+)(?:`)/g,t)]}get schema(){return{excludes:"_",parseDOM:[{tag:"code"}],toDOM:()=>["code",0]}}}class se extends te{get button(){return{icon:"bold",label:window.panel.$t("toolbar.button.bold")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,t)]}keys(){return{"Mod-b":()=>this.toggle()}}get name(){return"bold"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g,t)]}get schema(){return{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM:()=>["strong",0]}}}class ne extends te{get button(){return{icon:"italic",label:window.panel.$t("toolbar.button.italic")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,t),e.markInputRule(/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,t)]}keys(){return{"Mod-i":()=>this.toggle()}}get name(){return"italic"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/_([^_]+)_/g,t),e.markPasteRule(/\*([^*]+)\*/g,t)]}get schema(){return{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}}}class ie extends te{get button(){return{icon:"url",label:window.panel.$t("toolbar.button.link")}}commands(){return{link:()=>{this.editor.emit("link",this.editor)},insertLink:(t={})=>{if(t.href)return this.update(t)},removeLink:()=>this.remove(),toggleLink:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertLink",t):this.editor.command("removeLink")}}}get defaults(){return{target:null}}get name(){return"link"}pasteRules({type:t,utils:e}){return[e.pasteRule(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b([-a-zA-Z0-9@:%_+.~#?&//=,]*)/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,s)=>{const n=this.editor.getMarkAttrs("link");n.href&&!0===s.altKey&&s.target instanceof HTMLAnchorElement&&(s.stopPropagation(),window.open(n.href,n.target))}}}]}get schema(){return{attrs:{href:{default:null},target:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]:not([href^='mailto:'])",getAttrs:t=>({href:t.getAttribute("href"),target:t.getAttribute("target"),title:t.getAttribute("title")})}],toDOM:t=>["a",{...t.attrs,rel:"noopener noreferrer"},0]}}}class oe extends te{get button(){return{icon:"email",label:"Email"}}commands(){return{email:()=>{this.editor.emit("email")},insertEmail:(t={})=>{if(t.href)return this.update(t)},removeEmail:()=>this.remove(),toggleEmail:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertEmail",t):this.editor.command("removeEmail")}}}get defaults(){return{target:null}}get name(){return"email"}pasteRules({type:t,utils:e}){return[e.pasteRule(/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,s)=>{const n=this.editor.getMarkAttrs("email");n.href&&!0===s.altKey&&s.target instanceof HTMLAnchorElement&&(s.stopPropagation(),window.open(n.href))}}}]}get schema(){return{attrs:{href:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href^='mailto:']",getAttrs:t=>({href:t.getAttribute("href").replace("mailto:",""),title:t.getAttribute("title")})}],toDOM:t=>["a",{...t.attrs,href:"mailto:"+t.attrs.href},0]}}}class re extends te{get button(){return{icon:"strikethrough",label:window.panel.$t("toolbar.button.strike")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/~([^~]+)~$/,t)]}keys(){return{"Mod-d":()=>this.toggle()}}get name(){return"strike"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/~([^~]+)~/g,t)]}get schema(){return{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",getAttrs:t=>"line-through"===t}],toDOM:()=>["s",0]}}}class le extends te{get button(){return{icon:"underline",label:window.panel.$t("toolbar.button.underline")}}commands(){return()=>this.toggle()}keys(){return{"Mod-u":()=>this.toggle()}}get name(){return"underline"}get schema(){return{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:t=>"underline"===t}],toDOM:()=>["u",0]}}}class ae extends Vt{get button(){return{id:this.name,icon:"list-bullet",label:window.panel.$t("toolbar.button.ul"),name:this.name,when:["listItem","bulletList","orderedList"]}}commands({type:t,schema:e,utils:s}){return()=>s.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*([-+*])\s$/,t)]}keys({type:t,schema:e,utils:s}){return{"Shift-Ctrl-8":s.toggleList(t,e.nodes.listItem)}}get name(){return"bulletList"}get schema(){return{content:"listItem+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}}class ue extends Vt{commands({utils:t,type:e}){return()=>this.createHardBreak(t,e)}createHardBreak(t,e){return t.chainCommands(t.exitCode,((t,s)=>(s(t.tr.replaceSelectionWith(e.create()).scrollIntoView()),!0)))}get defaults(){return{enter:!1,text:!1}}keys({utils:t,type:e}){const s=this.createHardBreak(t,e);let n={"Mod-Enter":s,"Shift-Enter":s};return this.options.enter&&(n.Enter=s),n}get name(){return"hardBreak"}get schema(){return{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]}}}class ce extends Vt{get button(){return this.options.levels.map((t=>({id:`h${t}`,command:`h${t}`,icon:`h${t}`,label:window.panel.$t("toolbar.button.heading."+t),attrs:{level:t},name:this.name,when:["heading","paragraph"]})))}commands({type:t,schema:e,utils:s}){let n={toggleHeading:n=>s.toggleBlockType(t,e.nodes.paragraph,n)};return this.options.levels.forEach((i=>{n[`h${i}`]=()=>s.toggleBlockType(t,e.nodes.paragraph,{level:i})})),n}get defaults(){return{levels:[1,2,3,4,5,6]}}inputRules({type:t,utils:e}){return this.options.levels.map((s=>e.textblockTypeInputRule(new RegExp(`^(#{1,${s}})\\s$`),t,(()=>({level:s})))))}keys({type:t,utils:e}){return this.options.levels.reduce(((s,n)=>({...s,[`Shift-Ctrl-${n}`]:e.setBlockType(t,{level:n})})),{})}get name(){return"heading"}get schema(){return{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,draggable:!1,parseDOM:this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}}))),toDOM:t=>[`h${t.attrs.level}`,0]}}}class de extends Vt{commands({type:t}){return()=>(e,s)=>s(e.tr.replaceSelectionWith(t.create()))}inputRules({type:t,utils:e}){return[e.nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/,t)]}get name(){return"horizontalRule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}}class pe extends Vt{keys({type:t,utils:e}){return{Enter:e.splitListItem(t),"Shift-Tab":e.liftListItem(t),Tab:e.sinkListItem(t)}}get name(){return"listItem"}get schema(){return{content:"paragraph block*",defining:!0,draggable:!1,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}}}class he extends Vt{get button(){return{id:this.name,icon:"list-numbers",label:window.panel.$t("toolbar.button.ol"),name:this.name,when:["listItem","bulletList","orderedList"]}}commands({type:t,schema:e,utils:s}){return()=>s.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^(\d+)\.\s$/,t,(t=>({order:+t[1]})),((t,e)=>e.childCount+e.attrs.order===+t[1]))]}keys({type:t,schema:e,utils:s}){return{"Shift-Ctrl-9":s.toggleList(t,e.nodes.listItem)}}get name(){return"orderedList"}get schema(){return{attrs:{order:{default:1}},content:"listItem+",group:"block",parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1===t.attrs.order?["ol",0]:["ol",{start:t.attrs.order},0]}}}class me extends Kt{commands(){return{undo:()=>A,redo:()=>T,undoDepth:()=>I,redoDepth:()=>j}}get defaults(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":A,"Mod-y":T,"Shift-Mod-z":T,"Mod-я":A,"Shift-Mod-я":T}}get name(){return"history"}plugins(){return[E({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}}class fe extends Kt{commands(){return{insertHtml:t=>(e,s)=>{let n=document.createElement("div");n.innerHTML=t.trim();const i=v.fromSchema(e.schema).parse(n);s(e.tr.replaceSelectionWith(i).scrollIntoView())}}}}class ge extends Kt{constructor(t={}){super(t)}close(){this.visible=!1,this.emit()}emit(){this.editor.emit("toolbar",{marks:this.marks,nodes:this.nodes,nodeAttrs:this.nodeAttrs,position:this.position,visible:this.visible})}init(){this.position={left:0,bottom:0},this.visible=!1,this.editor.on("blur",(()=>{this.close()})),this.editor.on("deselect",(()=>{this.close()})),this.editor.on("select",(({hasChanged:t})=>{!1!==t?this.open():this.emit()}))}get marks(){return this.editor.activeMarks}get nodes(){return this.editor.activeNodes}get nodeAttrs(){return this.editor.activeNodeAttrs}open(){this.visible=!0,this.reposition(),this.emit()}reposition(){const{from:t,to:e}=this.editor.selection,s=this.editor.view.coordsAtPos(t),n=this.editor.view.coordsAtPos(e,!0),i=this.editor.element.getBoundingClientRect();let o=(s.left+n.left)/2-i.left,r=Math.round(i.bottom-s.top);return this.position={bottom:r,left:o}}get type(){return"toolbar"}}const ke=G({props:{activeMarks:{type:Array,default:()=>[]},activeNodes:{type:Array,default:()=>[]},activeNodeAttrs:{type:[Array,Object],default:()=>[]},editor:{type:Object,required:!0},marks:{type:Array},isParagraphNodeHidden:{type:Boolean,default:!1}},computed:{activeButton(){return Object.values(this.nodeButtons).find((t=>this.isButtonActive(t)))||!1},hasVisibleButtons(){const t=Object.keys(this.nodeButtons);return t.length>1||1===t.length&&!1===t.includes("paragraph")},markButtons(){return this.buttons("mark")},nodeButtons(){let t=this.buttons("node");return!0===this.isParagraphNodeHidden&&t.paragraph&&delete t.paragraph,t}},methods:{buttons(t){const e=this.editor.buttons(t);let s=this.sorting;!1!==s&&!1!==Array.isArray(s)||(s=Object.keys(e));let n={};return s.forEach((t=>{e[t]&&(n[t]=e[t])})),n},command(t,...e){this.$emit("command",t,...e)},isButtonActive(t){if("paragraph"===t.name)return 1===this.activeNodes.length&&this.activeNodes.includes(t.name);let e=!0;if(t.attrs){const s=Object.values(this.activeNodeAttrs).find((e=>JSON.stringify(e)===JSON.stringify(t.attrs)));e=Boolean(s||!1)}return!0===e&&this.activeNodes.includes(t.name)},isButtonCurrent(t){return!!this.activeButton&&this.activeButton.id===t.id},isButtonDisabled(t){var e;if(null==(e=this.activeButton)?void 0:e.when){return!1===this.activeButton.when.includes(t.name)}return!1},needDividerAfterNode(t){let e=["paragraph"],s=Object.keys(this.nodeButtons);return(s.includes("bulletList")||s.includes("orderedList"))&&e.push("h6"),e.includes(t.id)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-writer-toolbar"},[t.hasVisibleButtons?e("k-dropdown",{nativeOn:{mousedown:function(t){t.preventDefault()}}},[e("k-button",{class:{"k-writer-toolbar-button k-writer-toolbar-nodes":!0,"k-writer-toolbar-button-active":!!t.activeButton},attrs:{icon:t.activeButton.icon||"title"},on:{click:function(e){return t.$refs.nodes.toggle()}}}),e("k-dropdown-content",{ref:"nodes"},[t._l(t.nodeButtons,(function(s,n){return[e("k-dropdown-item",{key:n,attrs:{current:t.isButtonCurrent(s),disabled:t.isButtonDisabled(s),icon:s.icon},on:{click:function(e){return t.command(s.command||n)}}},[t._v(" "+t._s(s.label)+" ")]),t.needDividerAfterNode(s)?e("hr",{key:n+"-divider"}):t._e()]}))],2)],1):t._e(),t._l(t.markButtons,(function(s,n){return e("k-button",{key:n,class:{"k-writer-toolbar-button":!0,"k-writer-toolbar-button-active":t.activeMarks.includes(n)},attrs:{icon:s.icon,tooltip:s.label},on:{mousedown:function(e){return e.preventDefault(),t.command(s.command||n)}}})}))],2)}),[],!1,null,null,null,null).exports,be={props:{autofocus:Boolean,breaks:Boolean,code:Boolean,disabled:Boolean,emptyDocument:{type:Object,default:()=>({type:"doc",content:[]})},headings:[Array,Boolean],inline:{type:Boolean,default:!1},marks:{type:[Array,Boolean],default:!0},nodes:{type:[Array,Boolean],default:()=>["heading","bulletList","orderedList"]},paste:{type:Function,default:()=>()=>!1},placeholder:String,spellcheck:Boolean,extensions:Array,value:{type:String,default:""}}};const ve=G({components:{"k-writer-email-dialog":Qt,"k-writer-link-dialog":Zt,"k-writer-toolbar":ke},mixins:[be],data(){return{editor:null,json:{},html:this.value,isEmpty:!0,toolbar:!1}},computed:{isParagraphNodeHidden(){return!0===Array.isArray(this.nodes)&&3!==this.nodes.length&&!1===this.nodes.includes("paragraph")}},watch:{value(t,e){t!==e&&t!==this.html&&(this.html=t,this.editor.setContent(this.html))}},mounted(){this.editor=new Xt({autofocus:this.autofocus,content:this.value,editable:!this.disabled,element:this.$el,emptyDocument:this.emptyDocument,events:{link:t=>{this.$refs.linkDialog.open(t.getMarkAttrs("link"))},email:()=>{this.$refs.emailDialog.open(this.editor.getMarkAttrs("email"))},paste:this.paste,toolbar:t=>{this.toolbar=t,this.toolbar.visible&&this.$nextTick((()=>{this.onToolbarOpen()}))},update:t=>{if(!this.editor)return;const e=JSON.stringify(this.editor.getJSON());e!==JSON.stringify(this.json)&&(this.json=e,this.isEmpty=t.editor.isEmpty(),this.html=t.editor.getHTML(),this.isEmpty&&(0===t.editor.activeNodes.length||t.editor.activeNodes.includes("paragraph"))&&(this.html=""),this.$emit("input",this.html))}},extensions:[...this.createMarks(),...this.createNodes(),new me,new fe,new ge,...this.extensions||[]],inline:this.inline}),this.isEmpty=this.editor.isEmpty(),this.json=this.editor.getJSON()},beforeDestroy(){this.editor.destroy()},methods:{filterExtensions(t,e,s){!1===e?e=[]:!0!==e&&!1!==Array.isArray(e)||(e=Object.keys(t));let n=[];return e.forEach((e=>{t[e]&&n.push(t[e])})),"function"==typeof s&&(n=s(e,n)),n},command(t,...e){this.editor.command(t,...e)},createMarks(){return this.filterExtensions({bold:new se,italic:new ne,strike:new re,underline:new le,code:new ee,link:new ie,email:new oe},this.marks)},createNodes(){const t=new ue({text:!0,enter:this.inline});return!0===this.inline?[t]:this.filterExtensions({bulletList:new ae,orderedList:new he,heading:new ce,horizontalRule:new de,listItem:new pe},this.nodes,((e,s)=>((e.includes("bulletList")||e.includes("orderedList"))&&s.push(new pe),s.push(t),s)))},getHTML(){return this.editor.getHTML()},focus(){this.editor.focus()},onToolbarOpen(){if(this.$refs.toolbar){const t=this.$el.clientWidth,e=this.$refs.toolbar.$el.clientWidth;let s=this.toolbar.position.left;s-e/2<0&&(s=s+(e/2-s)-20),s+e/2>t&&(s=s-(s+e/2-t)+20),s!==this.toolbar.position.left&&(this.$refs.toolbar.$el.style.left=s+"px")}}}},(function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"direction",rawName:"v-direction"}],ref:"editor",staticClass:"k-writer",attrs:{"data-empty":t.isEmpty,"data-placeholder":t.placeholder,spellcheck:t.spellcheck}},[t.editor?[t.toolbar.visible?e("k-writer-toolbar",{ref:"toolbar",style:{bottom:t.toolbar.position.bottom+"px","inset-inline-start":t.toolbar.position.left+"px"},attrs:{editor:t.editor,"active-marks":t.toolbar.marks,"active-nodes":t.toolbar.nodes,"active-node-attrs":t.toolbar.nodeAttrs,"is-paragraph-node-hidden":t.isParagraphNodeHidden},on:{command:function(e){return t.editor.command(e)}}}):t._e(),e("k-writer-link-dialog",{ref:"linkDialog",on:{close:function(e){return t.editor.focus()},submit:function(e){return t.editor.command("toggleLink",e)}}}),e("k-writer-email-dialog",{ref:"emailDialog",on:{close:function(e){return t.editor.focus()},submit:function(e){return t.editor.command("toggleEmail",e)}}})]:t._e()],2)}),[],!1,null,null,null,null).exports;const ye=G({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-login-alert",on:{click:function(e){return t.$emit("click")}}},[e("span",[t._t("default")],2),e("k-icon",{attrs:{type:"alert"}})],1)}),[],!1,null,null,null,null).exports;const $e=G({props:{fields:Object,index:[Number,String],total:Number,value:Object},mounted(){this.$store.dispatch("content/disable"),this.$events.$on("keydown.cmd.s",this.onSubmit),this.$events.$on("keydown.esc",this.onDiscard)},destroyed(){this.$events.$off("keydown.cmd.s",this.onSubmit),this.$events.$off("keydown.esc",this.onDiscard),this.$store.dispatch("content/enable")},methods:{focus(t){this.$refs.form.focus(t)},onDiscard(){this.$emit("discard")},onInput(t){this.$emit("input",t)},onSubmit(){this.$emit("submit")}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-structure-form"},[e("div",{staticClass:"k-structure-backdrop",on:{click:t.onDiscard}}),e("section",[e("k-form",{ref:"form",staticClass:"k-structure-form-fields",attrs:{value:t.value,fields:t.fields},on:{input:t.onInput,submit:t.onSubmit}}),e("footer",{staticClass:"k-structure-form-buttons"},[e("k-button",{staticClass:"k-structure-form-cancel-button",attrs:{text:t.$t("cancel"),icon:"cancel"},on:{click:function(e){return t.$emit("close")}}}),"new"!==t.index?e("k-pagination",{attrs:{dropdown:!1,total:t.total,limit:1,page:t.index+1,details:!0},on:{paginate:function(e){return t.$emit("paginate",e)}}}):t._e(),e("k-button",{staticClass:"k-structure-form-submit-button",attrs:{text:t.$t("new"!==t.index?"confirm":"add"),icon:"check"},on:{click:t.onSubmit}})],1)],1)])}),[],!1,null,null,null,null).exports,_e=function(t){this.command("insert",((e,s)=>{let n=[];return s.split("\n").forEach(((e,s)=>{let i="ol"===t?s+1+".":"-";n.push(i+" "+e)})),n.join("\n")}))};const xe=G({layout:["headlines","bold","italic","|","link","email","file","|","code","ul","ol"],props:{buttons:{type:[Boolean,Array],default:!0},uploads:[Boolean,Object,Array]},data(){let t={},e={},s=[],n=this.commands();return!1===this.buttons?t:(Array.isArray(this.buttons)&&(s=this.buttons),!0!==Array.isArray(this.buttons)&&(s=this.$options.layout),s.forEach(((s,i)=>{if("|"===s)t["divider-"+i]={divider:!0};else if(n[s]){let i=n[s];t[s]=i,i.shortcut&&(e[i.shortcut]=s)}})),{layout:t,shortcuts:e})},methods:{command(t,e){"function"==typeof t?t.apply(this):this.$emit("command",t,e)},close(){Object.keys(this.$refs).forEach((t=>{const e=this.$refs[t][0];"function"==typeof(null==e?void 0:e.close)&&e.close()}))},fileCommandSetup(){let t={label:this.$t("toolbar.button.file"),icon:"attachment"};return!1===this.uploads?t.command="selectFile":t.dropdown={select:{label:this.$t("toolbar.button.file.select"),icon:"check",command:"selectFile"},upload:{label:this.$t("toolbar.button.file.upload"),icon:"upload",command:"uploadFile"}},t},commands(){return{headlines:{label:this.$t("toolbar.button.headings"),icon:"title",dropdown:{h1:{label:this.$t("toolbar.button.heading.1"),icon:"title",command:"prepend",args:"#"},h2:{label:this.$t("toolbar.button.heading.2"),icon:"title",command:"prepend",args:"##"},h3:{label:this.$t("toolbar.button.heading.3"),icon:"title",command:"prepend",args:"###"}}},bold:{label:this.$t("toolbar.button.bold"),icon:"bold",command:"wrap",args:"**",shortcut:"b"},italic:{label:this.$t("toolbar.button.italic"),icon:"italic",command:"wrap",args:"*",shortcut:"i"},link:{label:this.$t("toolbar.button.link"),icon:"url",shortcut:"k",command:"dialog",args:"link"},email:{label:this.$t("toolbar.button.email"),icon:"email",shortcut:"e",command:"dialog",args:"email"},file:this.fileCommandSetup(),code:{label:this.$t("toolbar.button.code"),icon:"code",command:"wrap",args:"`"},ul:{label:this.$t("toolbar.button.ul"),icon:"list-bullet",command(){return _e.apply(this,["ul"])}},ol:{label:this.$t("toolbar.button.ol"),icon:"list-numbers",command(){return _e.apply(this,["ol"])}}}},shortcut(t,e){if(this.shortcuts[t]){const s=this.layout[this.shortcuts[t]];if(!s)return!1;e.preventDefault(),this.command(s.command,s.args)}}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-toolbar"},[e("div",{staticClass:"k-toolbar-wrapper"},[e("div",{staticClass:"k-toolbar-buttons"},[t._l(t.layout,(function(s,n){return[s.divider?[e("span",{key:n,staticClass:"k-toolbar-divider"})]:s.dropdown?[e("k-dropdown",{key:n},[e("k-button",{key:n,staticClass:"k-toolbar-button",attrs:{icon:s.icon,tooltip:s.label,tabindex:"-1"},on:{click:function(e){t.$refs[n+"-dropdown"][0].toggle()}}}),e("k-dropdown-content",{ref:n+"-dropdown",refInFor:!0},t._l(s.dropdown,(function(s,n){return e("k-dropdown-item",{key:n,attrs:{icon:s.icon},on:{click:function(e){return t.command(s.command,s.args)}}},[t._v(" "+t._s(s.label)+" ")])})),1)],1)]:[e("k-button",{key:n,staticClass:"k-toolbar-button",attrs:{icon:s.icon,tooltip:s.label,tabindex:"-1"},on:{click:function(e){return t.command(s.command,s.args)}}})]]}))],2)])])}),[],!1,null,null,null,null).exports;const we=G({data(){return{value:{email:null,text:null},fields:{email:{label:this.$t("email"),type:"email"},text:{label:this.$t("link.text"),type:"text"}}}},computed:{kirbytext(){return this.$config.kirbytext}},methods:{open(t,e){this.value.text=e,this.$refs.dialog.open()},cancel(){this.$emit("cancel")},createKirbytext(){var t;const e=this.value.email||"";return(null==(t=this.value.text)?void 0:t.length)>0?`(email: ${e} text: ${this.value.text})`:`(email: ${e})`},createMarkdown(){var t;const e=this.value.email||"";return(null==(t=this.value.text)?void 0:t.length)>0?`[${this.value.text}](mailto:${e})`:`<${e}>`},submit(){this.$emit("submit",this.kirbytext?this.createKirbytext():this.createMarkdown()),this.value={email:null,text:null},this.$refs.dialog.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",attrs:{"submit-button":t.$t("insert")},on:{close:t.cancel,submit:function(e){return t.$refs.form.submit()}}},[e("k-form",{ref:"form",attrs:{fields:t.fields,value:t.value},on:{input:function(e){t.value=e},submit:t.submit}})],1)}),[],!1,null,null,null,null).exports;const Se=G({data(){return{value:{url:null,text:null},fields:{url:{label:this.$t("link"),type:"text",placeholder:this.$t("url.placeholder"),icon:"url"},text:{label:this.$t("link.text"),type:"text"}}}},computed:{kirbytext(){return this.$config.kirbytext}},methods:{open(t,e){this.value.text=e,this.$refs.dialog.open()},cancel(){this.$emit("cancel")},createKirbytext(){return this.value.text.length>0?`(link: ${this.value.url} text: ${this.value.text})`:`(link: ${this.value.url})`},createMarkdown(){return this.value.text.length>0?`[${this.value.text}](${this.value.url})`:`<${this.value.url}>`},submit(){this.$emit("submit",this.kirbytext?this.createKirbytext():this.createMarkdown()),this.value={url:null,text:null},this.$refs.dialog.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",attrs:{"submit-button":t.$t("insert")},on:{close:t.cancel,submit:function(e){return t.$refs.form.submit()}}},[e("k-form",{ref:"form",attrs:{fields:t.fields,value:t.value},on:{input:function(e){t.value=e},submit:t.submit}})],1)}),[],!1,null,null,null,null).exports;const Ce=G({mixins:[yt,_t,wt,Ct,At],inheritAttrs:!1,props:{value:Boolean},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onChange(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||M.required}}}},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-checkbox-input",on:{click:function(t){t.stopPropagation()}}},[e("input",{ref:"input",staticClass:"k-checkbox-input-native input-hidden",attrs:{id:t.id,disabled:t.disabled,type:"checkbox"},domProps:{checked:t.value},on:{change:function(e){return t.onChange(e.target.checked)}}}),e("span",{staticClass:"k-checkbox-input-icon",attrs:{"aria-hidden":"true"}},[e("svg",{attrs:{width:"12",height:"10",viewBox:"0 0 12 10",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{d:"M1 5l3.3 3L11 1","stroke-width":"2",fill:"none","fill-rule":"evenodd"}})])]),e("span",{staticClass:"k-checkbox-input-label",domProps:{innerHTML:t._s(t.label)}})])}),[],!1,null,null,null,null).exports,Oe={mixins:[yt,_t,wt,At],props:{columns:Number,max:Number,min:Number,options:Array,value:{type:[Array,Object],default:()=>[]}}};const Ae=G({mixins:[Oe],inheritAttrs:!1,data(){return{selected:this.toArray(this.value)}},watch:{value(t){this.selected=this.toArray(t)},selected(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$el.querySelector("input").focus()},onInput(t,e){if(!0===e)this.selected.push(t);else{const e=this.selected.indexOf(t);-1!==e&&this.selected.splice(e,1)}this.$emit("input",this.selected)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()},toArray:t=>!0===Array.isArray(t)?t:"string"==typeof t?String(t).split(","):"object"==typeof t?Object.values(t):void 0},validations(){return{selected:{required:!this.required||M.required,min:!this.min||M.minLength(this.min),max:!this.max||M.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-checkboxes-input",style:"--columns:"+t.columns},[t.options.length?t._l(t.options,(function(s,n){return e("li",{key:n},[e("k-checkbox-input",{attrs:{id:t.id+"-"+n,label:s.text,value:-1!==t.selected.indexOf(s.value)},on:{input:function(e){return t.onInput(s.value,e)}}})],1)})):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.$t("options.none")))])],2)}),[],!1,null,null,null,null).exports,Te={mixins:[yt,_t,wt,At],props:{display:{type:String,default:"DD.MM.YYYY"},max:String,min:String,step:{type:Object,default:()=>({size:1,unit:"day"})},type:{type:String,default:"date"},value:String}};const Ie=G({mixins:[Te],inheritAttrs:!1,data:()=>({dt:null,formatted:null}),computed:{inputType:()=>"date",pattern(){return this.$library.dayjs.pattern(this.display)},rounding(){return{...this.$options.props.step.default(),...this.step}}},watch:{value:{handler(t,e){if(t!==e){const e=this.toDatetime(t);this.commit(e)}},immediate:!0}},created(){this.$events.$on("keydown.cmd.s",this.onBlur)},destroyed(){this.$events.$off("keydown.cmd.s",this.onBlur)},methods:{alter(t){let e=this.parse()||this.round(this.$library.dayjs()),s=this.rounding.unit,n=this.rounding.size;const i=this.selection();null!==i&&("meridiem"===i.unit?(t="pm"===e.format("a")?"subtract":"add",s="hour",n=12):(s=i.unit,s!==this.rounding.unit&&(n=1))),e=e[t](n,s).round(this.rounding.unit,this.rounding.size),this.commit(e),this.emit(e),this.$nextTick((()=>this.select(i)))},commit(t){this.dt=t,this.formatted=this.pattern.format(t),this.$emit("invalid",this.$v.$invalid,this.$v)},emit(t){this.$emit("input",this.toISO(t))},focus(){this.$refs.input.focus()},onArrowDown(){this.alter("subtract")},onArrowUp(){this.alter("add")},onBlur(){const t=this.parse();this.commit(t),this.emit(t)},onEnter(){this.onBlur(),this.$nextTick((()=>this.$emit("submit")))},onInput(t){const e=this.parse(),s=this.pattern.format(e);if(!t||s==t)return this.commit(e),this.emit(e)},onTab(t){""!=this.$refs.input.value&&(this.onBlur(),this.$nextTick((()=>{const e=this.selection();if(this.$refs.input&&e.start===this.$refs.input.selectionStart&&e.end===this.$refs.input.selectionEnd-1)if(t.shiftKey){if(0===e.index)return;this.selectPrev(e.index)}else{if(e.index===this.pattern.parts.length-1)return;this.selectNext(e.index)}else t.shiftKey?this.selectLast():this.selectFirst();t.preventDefault()})))},parse(){let t=this.$refs.input.value;return t=this.$library.dayjs.interpret(t,this.inputType),this.round(t)},round(t){return(null==t?void 0:t.round(this.rounding.unit,this.rounding.size))||null},select(t){var e;t||(t=this.selection()),null==(e=this.$refs.input)||e.setSelectionRange(t.start,t.end+1)},selectFirst(){this.select(this.pattern.parts[0])},selectLast(){this.select(this.pattern.parts[this.pattern.parts.length-1])},selectNext(t){this.select(this.pattern.parts[t+1])},selectPrev(t){this.select(this.pattern.parts[t-1])},selection(){return this.pattern.at(this.$refs.input.selectionStart,this.$refs.input.selectionEnd)},toDatetime(t){return this.round(this.$library.dayjs.iso(t,this.inputType))},toISO(t){return(null==t?void 0:t.toISO(this.inputType))||null}},validations(){return{value:{min:!this.dt||!this.min||(()=>this.dt.validate(this.min,"min",this.rounding.unit)),max:!this.dt||!this.max||(()=>this.dt.validate(this.max,"max",this.rounding.unit)),required:!this.required||(()=>!!this.dt)}}}},(function(){var t=this;return(0,t._self._c)("input",{directives:[{name:"direction",rawName:"v-direction"}],ref:"input",class:`k-text-input k-${t.type}-input`,attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled,placeholder:t.display,required:t.required,autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.formatted},on:{blur:t.onBlur,focus:function(e){return t.$emit("focus")},input:function(e){return t.onInput(e.target.value)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowDown.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowUp.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:t.onTab.apply(null,arguments)}]}})}),[],!1,null,null,null,null).exports,je={mixins:[yt,_t,wt,Ot,At],props:{autocomplete:{type:[Boolean,String],default:"off"},maxlength:Number,minlength:Number,pattern:String,placeholder:String,preselect:Boolean,spellcheck:{type:[Boolean,String],default:"off"},type:{type:String,default:"text"},value:String}};const Ee=G({mixins:[je],inheritAttrs:!1,data(){return{listeners:{...this.$listeners,input:t=>this.onInput(t.target.value)}}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||M.required,minLength:!this.minlength||M.minLength(this.minlength),maxLength:!this.maxlength||M.maxLength(this.maxlength),email:"email"!==this.type||M.email,url:"url"!==this.type||M.url,pattern:!this.pattern||(t=>!this.required&&!t||!this.$refs.input.validity.patternMismatch)}}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input"},"input",{autocomplete:t.autocomplete,autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,type:t.type,value:t.value},!1),t.listeners))}),[],!1,null,null,null,null).exports,Me={mixins:[je],props:{autocomplete:{type:String,default:"email"},placeholder:{type:String,default:()=>window.panel.$t("email.placeholder")},type:{type:String,default:"email"}}};const Le=G({extends:Ee,mixins:[Me]},null,null,!1,null,null,null,null).exports;class Be extends Jt{get schema(){return{content:"bulletList|orderedList"}}}const De=G({inheritAttrs:!1,props:{autofocus:Boolean,marks:{type:[Array,Boolean],default:!0},value:String},data(){return{list:this.value,html:this.value}},computed:{extensions:()=>[new Be({inline:!0})]},watch:{value(t){t!==this.html&&(this.list=t,this.html=t)}},methods:{focus(){this.$refs.input.focus()},onInput(t){let e=(new DOMParser).parseFromString(t,"text/html").querySelector("ul, ol");e&&0!==e.textContent.trim().length?(this.list=t,this.html=t.replace(/(

|<\/p>)/gi,""),this.$emit("input",this.html)):this.$emit("input",this.list="")}}},(function(){var t=this;return(0,t._self._c)("k-writer",t._b({ref:"input",staticClass:"k-list-input",attrs:{extensions:t.extensions,nodes:["bulletList","orderedList"],value:t.list},on:{input:t.onInput}},"k-writer",t.$props,!1))}),[],!1,null,null,null,null).exports,Pe={mixins:[_t,wt,At],props:{max:Number,min:Number,layout:String,options:Array,search:[Object,Boolean],separator:{type:String,default:","},sort:Boolean,value:{type:Array,required:!0,default:()=>[]}}};const Ne=G({mixins:[Pe],inheritAttrs:!1,data(){return{state:this.value,q:null,limit:!0,scrollTop:0}},computed:{draggable(){return this.state.length>1&&!this.sort},dragOptions(){return{disabled:!this.draggable,draggable:".k-tag",delay:1}},emptyLabel(){return this.q?this.$t("search.results.none"):this.$t("options.none")},filtered(){var t;return(null==(t=this.q)?void 0:t.length)>=(this.search.min||0)?this.options.filter((t=>this.isFiltered(t))).map((t=>({...t,text:this.toHighlightedString(t.text)}))):this.options},more(){return!this.max||this.state.lengththis.options.find((e=>e.value===t))));if(!1===this.sort)return t;const e=t=>this.options.findIndex((e=>e.value===t.value));return t.sort(((t,s)=>e(t)-e(s)))},visible(){return this.limit?this.filtered.slice(0,this.search.display||this.filtered.length):this.filtered}},watch:{value(t){this.state=t,this.onInvalid()}},mounted(){this.onInvalid(),this.$events.$on("click",this.close),this.$events.$on("keydown.cmd.s",this.close)},destroyed(){this.$events.$off("click",this.close),this.$events.$off("keydown.cmd.s",this.close)},methods:{add(t){!0===this.more&&(this.state.push(t.value),this.onInput())},blur(){this.close()},close(){var t;!0===(null==(t=this.$refs.dropdown)?void 0:t.isOpen)&&(this.$refs.dropdown.close(),this.limit=!0)},focus(){var t;null==(t=this.$refs.dropdown)||t.open()},index(t){return this.state.findIndex((e=>e===t.value))},isFiltered(t){return String(t.text).match(this.regex)||String(t.value).match(this.regex)},isSelected(t){return-1!==this.index(t)},navigate(t){var e,s,n;"prev"===t&&(t="previous"),null==(n=null==(s=null==(e=document.activeElement)?void 0:e[t+"Sibling"])?void 0:s.focus)||n.call(s)},onClose(){var t;!1===(null==(t=this.$refs.dropdown)?void 0:t.isOpen)&&(document.activeElement===this.$parent.$el&&(this.q=null),this.$parent.$el.focus())},onEscape(){this.q?this.q=null:this.close()},onInput(){this.$emit("input",this.state)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onOpen(){this.$nextTick((()=>{var t,e,s;null==(e=null==(t=this.$refs.search)?void 0:t.focus)||e.call(t),(null==(s=this.$refs.dropdown)?void 0:s.$el)&&(this.$refs.dropdown.$el.querySelector(".k-multiselect-options").scrollTop=this.scrollTop)}))},remove(t){const e=this.index(t);this.state.splice(e,1),this.onInput()},select(t){this.scrollTop=this.$refs.dropdown.$el.querySelector(".k-multiselect-options").scrollTop,this.isSelected(t)?this.remove(t):this.add(t)},toHighlightedString(t){return(t=this.$helper.string.stripHTML(t)).replace(this.regex,"$1")}},validations(){return{state:{required:!this.required||M.required,minLength:!this.min||M.minLength(this.min),maxLength:!this.max||M.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("k-draggable",{staticClass:"k-multiselect-input",attrs:{list:t.state,options:t.dragOptions,"data-layout":t.layout,element:"k-dropdown"},on:{end:t.onInput},nativeOn:{click:function(e){return t.$refs.dropdown.toggle.apply(null,arguments)}},scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-dropdown-content",{ref:"dropdown",on:{open:t.onOpen,close:t.onClose},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:(e.stopPropagation(),t.close.apply(null,arguments))}}},[t.search?e("k-dropdown-item",{staticClass:"k-multiselect-search",attrs:{icon:"search"}},[e("input",{ref:"search",attrs:{placeholder:t.search.min?t.$t("search.min",{min:t.search.min}):t.$t("search")+" …"},domProps:{value:t.q},on:{input:function(e){t.q=e},keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:(e.stopPropagation(),t.onEscape.apply(null,arguments))}}})]):t._e(),e("div",{staticClass:"k-multiselect-options scroll-y-auto"},[t._l(t.visible,(function(s){return e("k-dropdown-item",{key:s.value,class:{"k-multiselect-option":!0,selected:t.isSelected(s),disabled:!t.more},attrs:{icon:t.isSelected(s)?"check":"circle-outline"},on:{click:function(e){return e.preventDefault(),t.select(s)}},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),e.stopPropagation(),t.select(s))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:(e.preventDefault(),e.stopPropagation(),t.select(s))}]}},[e("span",{domProps:{innerHTML:t._s(s.text)}})])})),0===t.filtered.length?e("k-dropdown-item",{staticClass:"k-multiselect-option",attrs:{disabled:!0}},[t._v(" "+t._s(t.emptyLabel)+" ")]):t._e()],2),t.visible.lengththis.onInput(t.target.value),blur:this.onBlur}}},watch:{value(t){this.number=t},number:{immediate:!0,handler(){this.onInvalid()}}},mounted(){this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{decimals(){const t=Number(this.step||0);return Math.floor(t)===t?0:-1!==t.toString().indexOf("e")?parseInt(t.toFixed(16).split(".")[1].split("").reverse().join("")).toString().length:t.toString().split(".")[1].length||0},format(t){if(isNaN(t)||""===t)return"";const e=this.decimals();return t=e?parseFloat(t).toFixed(e):Number.isInteger(this.step)?parseInt(t):parseFloat(t)},clean(){this.number=this.format(this.number)},emit(t){t=parseFloat(t),isNaN(t)&&(t=""),t!==this.value&&this.$emit("input",t)},focus(){this.$refs.input.focus()},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.number=t,this.emit(t)},onBlur(){this.clean(),this.emit(this.number)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||M.required,min:!this.min||M.minValue(this.min),max:!this.max||M.maxValue(this.max)}}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({ref:"input",staticClass:"k-number-input",attrs:{step:t.stepNumber,type:"number"},domProps:{value:t.number},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.ctrlKey?t.clean.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?t.clean.apply(null,arguments):null}]}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,null,null,null,null).exports,Re={mixins:[je],props:{autocomplete:{type:String,default:"new-password"},type:{type:String,default:"password"}}};const ze=G({extends:Ee,mixins:[Re]},null,null,!1,null,null,null,null).exports,Ye={mixins:[yt,_t,wt,At],props:{columns:Number,options:Array,value:[String,Number,Boolean]}};const He=G({mixins:[Ye],inheritAttrs:!1,watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$el.querySelector("input").focus()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||M.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-radio-input",style:"--columns:"+t.columns},[t.options.length?t._l(t.options,(function(s,n){return e("li",{key:n},[e("input",{staticClass:"k-radio-input-native",attrs:{id:t.id+"-"+n,name:t.id,type:"radio"},domProps:{value:s.value,checked:t.value===s.value},on:{change:function(e){return t.onInput(s.value)}}}),s.info?e("label",{attrs:{for:t.id+"-"+n}},[e("span",{staticClass:"k-radio-input-text",domProps:{innerHTML:t._s(s.text)}}),e("span",{staticClass:"k-radio-input-info",domProps:{innerHTML:t._s(s.info)}})]):e("label",{attrs:{for:t.id+"-"+n},domProps:{innerHTML:t._s(s.text)}}),s.icon?e("k-icon",{attrs:{type:s.icon}}):t._e()],1)})):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.$t("options.none")))])],2)}),[],!1,null,null,null,null).exports,Ue={mixins:[yt,_t,wt,Ot,At],props:{default:[Number,String],max:{type:Number,default:100},min:{type:Number,default:0},step:{type:Number,default:1},tooltip:{type:[Boolean,Object],default:()=>({before:null,after:null})},value:[Number,String]}};const Ke=G({mixins:[Ue],inheritAttrs:!1,data(){return{listeners:{...this.$listeners,input:t=>this.onInput(t.target.value)}}},computed:{baseline(){return this.min<0?0:this.min},label(){return this.required||this.value||0===this.value?this.format(this.position):"–"},position(){return this.value||0===this.value?this.value:this.default||this.baseline}},watch:{position(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},format(t){const e=document.lang?document.lang.replace("_","-"):"en",s=this.step.toString().split("."),n=s.length>1?s[1].length:0;return new Intl.NumberFormat(e,{minimumFractionDigits:n}).format(t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.$emit("input",t)}},validations(){return{position:{required:!this.required||M.required,min:!this.min||M.minValue(this.min),max:!this.max||M.maxValue(this.max)}}}},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-range-input"},[e("input",t._g(t._b({ref:"input",staticClass:"k-range-input-native",style:`--min: ${t.min}; --max: ${t.max}; --value: ${t.position}`,attrs:{type:"range"},domProps:{value:t.position}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,required:t.required,step:t.step},!1),t.listeners)),t.tooltip?e("span",{staticClass:"k-range-input-tooltip"},[t.tooltip.before?e("span",{staticClass:"k-range-input-tooltip-before"},[t._v(t._s(t.tooltip.before))]):t._e(),e("span",{staticClass:"k-range-input-tooltip-text"},[t._v(t._s(t.label))]),t.tooltip.after?e("span",{staticClass:"k-range-input-tooltip-after"},[t._v(t._s(t.tooltip.after))]):t._e()]):t._e()])}),[],!1,null,null,null,null).exports,Ve={mixins:[yt,_t,wt,Ot,At],props:{ariaLabel:String,default:String,empty:{type:[Boolean,String],default:!0},placeholder:String,options:Array,value:{type:[String,Number,Boolean],default:""}}};const Je=G({mixins:[Ve],inheritAttrs:!1,data(){return{selected:this.value,listeners:{...this.$listeners,click:t=>this.onClick(t),change:t=>this.onInput(t.target.value),input:()=>{}}}},computed:{emptyOption(){return this.placeholder||"—"},hasEmptyOption(){return!1!==this.empty&&!(this.required&&this.default)},label(){const t=this.text(this.selected);return""===this.selected||null===this.selected||null===t?this.emptyOption:t}},watch:{value(t){this.selected=t,this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onClick(t){t.stopPropagation(),this.$emit("click",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.selected=t,this.$emit("input",this.selected)},select(){this.focus()},text(t){let e=null;return this.options.forEach((s=>{s.value==t&&(e=s.text)})),e}},validations(){return{selected:{required:!this.required||M.required}}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-select-input",attrs:{"data-disabled":t.disabled,"data-empty":""===t.selected}},[e("select",t._g({ref:"input",staticClass:"k-select-input-native",attrs:{id:t.id,autofocus:t.autofocus,"aria-label":t.ariaLabel,disabled:t.disabled,name:t.name,required:t.required},domProps:{value:t.selected}},t.listeners),[t.hasEmptyOption?e("option",{attrs:{disabled:t.required,value:""}},[t._v(" "+t._s(t.emptyOption)+" ")]):t._e(),t._l(t.options,(function(s){return e("option",{key:s.value,attrs:{disabled:s.disabled},domProps:{value:s.value}},[t._v(" "+t._s(s.text)+" ")])}))],2),t._v(" "+t._s(t.label)+" ")])}),[],!1,null,null,null,null).exports,Ge={mixins:[je],props:{allow:{type:String,default:""},formData:{type:Object,default:()=>({})},sync:{type:String}}};const We=G({extends:Ee,mixins:[Ge],data(){return{slug:this.sluggify(this.value),slugs:this.$language?this.$language.rules:this.$system.slugs,syncValue:null}},watch:{formData:{handler(t){return!this.disabled&&(!(!this.sync||void 0===t[this.sync])&&(t[this.sync]!=this.syncValue&&(this.syncValue=t[this.sync],void this.onInput(this.sluggify(this.syncValue)))))},deep:!0,immediate:!0},value(t){(t=this.sluggify(t))!==this.slug&&(this.slug=t,this.$emit("input",this.slug))}},methods:{sluggify(t){return this.$helper.slug(t,[this.slugs,this.$system.ascii],this.allow)},onInput(t){this.slug=this.sluggify(t),this.$emit("input",this.slug)}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input",attrs:{autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.slug}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,null,null,null,null).exports,Xe={mixins:[yt,_t,wt,Ot,At],props:{accept:{type:String,default:"all"},icon:{type:[String,Boolean],default:"tag"},layout:String,max:Number,min:Number,options:{type:Array,default:()=>[]},separator:{type:String,default:","},value:{type:Array,default:()=>[]}}};const Ze=G({mixins:[Xe],inheritAttrs:!1,data(){return{tags:this.toValues(this.value),selected:null,newTag:null}},computed:{dragOptions(){return{delay:1,disabled:!this.draggable,draggable:".k-tag"}},draggable(){return this.tags.length>1},skip(){return this.tags.map((t=>t.value))}},watch:{value(t){this.tags=this.toValues(t),this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{addString(t,e=!0){if(!t)return;if(0===(t=t.trim()).length)return;if(!0===t.includes(this.separator)){for(const e of t.split(this.separator))this.addString(e);return}const s=this.toValue(t);s&&this.addTag(s,e)},addTag(t,e=!0){this.addTagToIndex(t),this.$refs.autocomplete.close(),e&&this.$refs.input.focus()},addTagToIndex(t){if("options"===this.accept){if(!this.options.find((e=>e.value===t.value)))return}-1===this.index(t)&&(!this.max||this.tags.length=this.tags.length)return;break;case"first":e=0;break;case"last":e=this.tags.length-1;break;default:e=t}let n=this.tags[e];if(n){let t=this.$refs[n.value];if(null==t?void 0:t[0])return{ref:t[0],tag:n,index:e}}return!1},index(t){return this.tags.findIndex((e=>e.value===t.value))},navigate(t){var e=this.get(t);e?(e.ref.focus(),this.selectTag(e.tag)):"next"===t&&(this.$refs.input.focus(),this.selectTag(null))},onBack(t){0===t.target.selectionStart&&t.target.selectionStart===t.target.selectionEnd&&0!==this.tags.length&&(this.$refs.autocomplete.close(),this.navigate("last"),t.preventDefault())},onBlur(t){var e;let s=t.relatedTarget||t.explicitOriginalTarget;(null==(e=this.$refs.autocomplete.$el)?void 0:e.contains(s))||this.addString(this.$refs.input.value,!1)},onEnter(t){if(!this.newTag||0===this.newTag.length)return!0;t.preventDefault(),this.addString(this.newTag)},onInput(){const t=this.tags.map((t=>t.value));this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onSubmit(t){t.preventDefault(),t.stopImmediatePropagation(),this.onBlur(t),this.$emit("submit",t)},onTab(t){var e;(null==(e=this.newTag)?void 0:e.length)>0&&(t.preventDefault(),this.addString(this.newTag))},onType(t){this.newTag=t,this.$refs.autocomplete.search(t)},remove(t){const e=this.get("prev"),s=this.get("next");this.tags.splice(this.index(t),1),this.onInput(),e?(this.selectTag(e.tag),e.ref.focus()):s?this.selectTag(s.tag):(this.selectTag(null),this.$refs.input.focus())},select(){this.focus()},selectTag(t){this.selected=t},toValue(t){var e;const s=this.options.find((e=>e.value===t));return"options"===this.accept?s:s||("string"==typeof t&&(t={value:t}),{value:t.value,text:this.$helper.string.escapeHTML(null!=(e=t.text)?e:t.value)})},toValues(t){return"object"==typeof t&&(t=Object.values(t)),!1===Array.isArray(t)?[]:t.map(this.toValue).filter((t=>t))}},validations(){return{tags:{required:!this.required||M.required,minLength:!this.min||M.minLength(this.min),maxLength:!this.max||M.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("k-draggable",{directives:[{name:"direction",rawName:"v-direction"}],staticClass:"k-tags-input",attrs:{list:t.tags,options:t.dragOptions,"data-layout":t.layout},on:{end:t.onInput},scopedSlots:t._u([{key:"footer",fn:function(){var s;return[e("span",{staticClass:"k-tags-input-element"},[e("k-autocomplete",{ref:"autocomplete",attrs:{html:!0,options:t.options,skip:t.skip},on:{select:t.addTag,leave:function(e){return t.$refs.input.focus()}}},[e("input",{ref:"input",attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled||t.max&&t.tags.length>=t.max,name:t.name,autocomplete:"off",type:"text"},domProps:{value:null==(s=t.newTag)?void 0:s.trim()},on:{input:function(e){return t.onType(e.target.value)},blur:t.onBlur,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?t.onSubmit.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onBack.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onEnter.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onTab.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onBack.apply(null,arguments)}]}})])],1)]},proxy:!0}])},t._l(t.tags,(function(s){return e("k-tag",{key:s.value,ref:s.value,refInFor:!0,attrs:{removable:!t.disabled,name:"tag"},on:{remove:function(e){return t.remove(s)}},nativeOn:{click:function(t){t.stopPropagation()},blur:function(e){return t.selectTag(null)},focus:function(e){return t.selectTag(s)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:t.navigate("prev")},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:t.navigate("next")}],dblclick:function(e){return t.edit(s)}}},[e("span",{domProps:{innerHTML:t._s(s.text)}})])})),1)}),[],!1,null,null,null,null).exports,Qe={mixins:[je],props:{autocomplete:{type:String,default:"tel"},type:{type:String,default:"tel"}}};const ts=G({extends:Ee,mixins:[Qe]},null,null,!1,null,null,null,null).exports,es={mixins:[yt,_t,wt,Ot,At],props:{buttons:{type:[Boolean,Array],default:!0},endpoints:Object,font:String,maxlength:Number,minlength:Number,placeholder:String,preselect:Boolean,size:String,spellcheck:{type:[Boolean,String],default:"off"},theme:String,uploads:[Boolean,Object,Array],value:String}};const ss=G({mixins:[es],inheritAttrs:!1,data:()=>({over:!1}),watch:{value(){this.onInvalid(),this.$nextTick((()=>{this.resize()}))}},mounted(){this.$nextTick((()=>{this.$library.autosize(this.$refs.input)})),this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{cancel(){this.$refs.input.focus()},dialog(t){if(!this.$refs[t+"Dialog"])throw"Invalid toolbar dialog";this.$refs[t+"Dialog"].open(this.$refs.input,this.selection())},focus(){this.$refs.input.focus()},insert(t){const e=this.$refs.input,s=e.value;setTimeout((()=>{if(e.focus(),document.execCommand("insertText",!1,t),e.value===s){const s=e.value.slice(0,e.selectionStart)+t+e.value.slice(e.selectionEnd);e.value=s,this.$emit("input",s)}})),this.resize()},insertFile(t){(null==t?void 0:t.length)>0&&this.insert(t.map((t=>t.dragText)).join("\n\n"))},insertUpload(t,e){this.insert(e.map((t=>t.dragText)).join("\n\n")),this.$events.$emit("model.update")},onClick(){this.$refs.toolbar&&this.$refs.toolbar.close()},onCommand(t,e){"function"==typeof this[t]?"function"==typeof e?this[t](e(this.$refs.input,this.selection())):this[t](e):window.console.warn(t+" is not a valid command")},onDrop(t){if(this.uploads&&this.$helper.isUploadEvent(t))return this.$refs.fileUpload.drop(t.dataTransfer.files,{url:this.$urls.api+"/"+this.endpoints.field+"/upload",multiple:!1});const e=this.$store.state.drag;"text"===(null==e?void 0:e.type)&&(this.focus(),this.insert(e.data))},onFocus(t){this.$emit("focus",t)},onInput(t){this.$emit("input",t.target.value)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onOut(){this.$refs.input.blur(),this.over=!1},onOver(t){if(this.uploads&&this.$helper.isUploadEvent(t))return t.dataTransfer.dropEffect="copy",this.focus(),void(this.over=!0);const e=this.$store.state.drag;"text"===(null==e?void 0:e.type)&&(t.dataTransfer.dropEffect="copy",this.focus(),this.over=!0)},onShortcut(t){!1!==this.buttons&&"Meta"!==t.key&&"Control"!==t.key&&this.$refs.toolbar&&this.$refs.toolbar.shortcut(t.key,t)},onSubmit(t){return this.$emit("submit",t)},prepend(t){this.insert(t+" "+this.selection())},resize(){this.$library.autosize.update(this.$refs.input)},select(){this.$refs.select()},selectFile(){this.$refs.fileDialog.open({endpoint:this.endpoints.field+"/files",multiple:!1})},selection(){const t=this.$refs.input,e=t.selectionStart,s=t.selectionEnd;return t.value.substring(e,s)},uploadFile(){this.$refs.fileUpload.open({url:this.$urls.api+"/"+this.endpoints.field+"/upload",multiple:!1})},wrap(t){this.insert(t+this.selection()+t)}},validations(){return{value:{required:!this.required||M.required,minLength:!this.minlength||M.minLength(this.minlength),maxLength:!this.maxlength||M.maxLength(this.maxlength)}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-textarea-input",attrs:{"data-over":t.over,"data-size":t.size,"data-theme":t.theme}},[e("div",{staticClass:"k-textarea-input-wrapper"},[t.buttons&&!t.disabled?e("k-toolbar",{ref:"toolbar",attrs:{buttons:t.buttons,disabled:t.disabled,uploads:t.uploads},on:{command:t.onCommand},nativeOn:{mousedown:function(t){t.preventDefault()}}}):t._e(),e("textarea",t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-textarea-input-native",attrs:{"data-font":t.font},on:{click:t.onClick,focus:t.onFocus,input:t.onInput,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.metaKey?t.onSubmit.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.ctrlKey?t.onSubmit.apply(null,arguments):null},function(e){return e.metaKey?t.onShortcut.apply(null,arguments):null},function(e){return e.ctrlKey?t.onShortcut.apply(null,arguments):null}],dragover:t.onOver,dragleave:t.onOut,drop:t.onDrop}},"textarea",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,value:t.value},!1))],1),e("k-toolbar-email-dialog",{ref:"emailDialog",on:{cancel:t.cancel,submit:function(e){return t.insert(e)}}}),e("k-toolbar-link-dialog",{ref:"linkDialog",on:{cancel:t.cancel,submit:function(e){return t.insert(e)}}}),e("k-files-dialog",{ref:"fileDialog",on:{cancel:t.cancel,submit:function(e){return t.insertFile(e)}}}),t.uploads?e("k-upload",{ref:"fileUpload",on:{success:t.insertUpload}}):t._e()],1)}),[],!1,null,null,null,null).exports,ns={props:{display:{type:String,default:"HH:mm"},max:String,min:String,step:{type:Object,default:()=>({size:5,unit:"minute"})},type:{type:String,default:"time"},value:String}};const is=G({mixins:[Ie,ns],computed:{inputType:()=>"time"}},null,null,!1,null,null,null,null).exports,os={props:{autofocus:Boolean,disabled:Boolean,id:[Number,String],text:{type:[Array,String]},required:Boolean,value:Boolean}};const rs=G({mixins:[os],inheritAttrs:!1,computed:{label(){const t=this.text||[this.$t("off"),this.$t("on")];return Array.isArray(t)?this.value?t[1]:t[0]:t}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onEnter(t){"Enter"===t.key&&this.$refs.input.click()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.focus()}},validations(){return{value:{required:!this.required||M.required}}}},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-toggle-input",attrs:{"data-disabled":t.disabled}},[e("input",{ref:"input",staticClass:"k-toggle-input-native",attrs:{id:t.id,disabled:t.disabled,type:"checkbox"},domProps:{checked:t.value},on:{change:function(e){return t.onInput(e.target.checked)}}}),e("span",{staticClass:"k-toggle-input-label",domProps:{innerHTML:t._s(t.label)}})])}),[],!1,null,null,null,null).exports,ls={mixins:[yt,_t,wt,At],props:{columns:Number,grow:Boolean,labels:Boolean,options:Array,reset:Boolean,value:[String,Number,Boolean]}};const as=G({mixins:[ls],inheritAttrs:!1,watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){(this.$el.querySelector("input[checked]")||this.$el.querySelector("input")).focus()},onClick(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||M.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-toggles-input",style:"--options:"+(t.columns||t.options.length),attrs:{"data-invalid":t.$v.$invalid,"data-labels":t.labels}},t._l(t.options,(function(s,n){return e("li",{key:n},[e("input",{staticClass:"input-hidden",attrs:{id:t.id+"-"+n,name:t.id,type:"radio"},domProps:{value:s.value,checked:t.value===s.value},on:{click:function(e){return t.onClick(s.value)},change:function(e){return t.onInput(s.value)}}}),e("label",{attrs:{for:t.id+"-"+n,title:s.text}},[s.icon?e("k-icon",{attrs:{type:s.icon}}):t._e(),t.labels?e("span",{staticClass:"k-toggles-text",domProps:{innerHTML:t._s(s.text)}}):t._e()],1)])})),0)}),[],!1,null,null,null,null).exports,us={mixins:[je],props:{autocomplete:{type:String,default:"url"},type:{type:String,default:"url"}}};const cs=G({extends:Ee,mixins:[us]},null,null,!1,null,null,null,null).exports,ds={install(t){t.component("k-checkbox-input",Ce),t.component("k-checkboxes-input",Ae),t.component("k-date-input",Ie),t.component("k-email-input",Le),t.component("k-list-input",De),t.component("k-multiselect-input",Ne),t.component("k-number-input",qe),t.component("k-password-input",ze),t.component("k-radio-input",He),t.component("k-range-input",Ke),t.component("k-select-input",Je),t.component("k-slug-input",We),t.component("k-tags-input",Ze),t.component("k-tel-input",ts),t.component("k-text-input",Ee),t.component("k-textarea-input",ss),t.component("k-time-input",is),t.component("k-toggle-input",rs),t.component("k-toggles-input",as),t.component("k-url-input",cs)}};const ps=G({mixins:[Tt],inheritAttrs:!1,props:{autofocus:Boolean,empty:String,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},data:()=>({opened:[]}),computed:{hasFieldsets(){return Object.keys(this.fieldsets).length},isEmpty(){return 0===this.value.length},isFull(){return null!==this.max&&this.value.length>=this.max}},methods:{focus(){this.$refs.blocks.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-blocks-field",scopedSlots:t._u([{key:"options",fn:function(){return[t.hasFieldsets?e("k-dropdown",[e("k-button",{attrs:{icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"add"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}},[t._v(" "+t._s(t.$t("add"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"template"},on:{click:function(e){return t.$refs.blocks.copyAll()}}},[t._v(" "+t._s(t.$t("copy.all"))+" ")]),e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"download"},on:{click:function(e){return t.$refs.blocks.pasteboard()}}},[t._v(" "+t._s(t.$t("paste"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"trash"},on:{click:function(e){return t.$refs.blocks.confirmToRemoveAll()}}},[t._v(" "+t._s(t.$t("delete.all"))+" ")])],1)],1):t._e()]},proxy:!0}])},"k-field",t.$props,!1),[e("k-blocks",t._g({ref:"blocks",attrs:{autofocus:t.autofocus,compact:!1,empty:t.empty,endpoints:t.endpoints,fieldsets:t.fieldsets,"fieldset-groups":t.fieldsetGroups,group:t.group,max:t.max,value:t.value},on:{close:function(e){t.opened=e},open:function(e){t.opened=e}}},t.$listeners)),t.isEmpty||t.isFull?t._e():e("k-button",{staticClass:"k-field-add-item-button",attrs:{icon:"add",tooltip:t.$t("add")},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}})],1)}),[],!1,null,null,null,null).exports,hs={props:{counter:{type:Boolean,default:!0}},computed:{counterOptions(){var t,e;if(null===this.value||this.disabled||!1===this.counter)return!1;let s=0;return this.value&&(s=Array.isArray(this.value)?this.value.length:String(this.value).length),{count:s,min:null!=(t=this.min)?t:this.minlength,max:null!=(e=this.max)?e:this.maxlength}}}};const ms=G({mixins:[Tt,Et,Oe,hs],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-checkboxes-field",attrs:{counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"checkboxes"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const fs=G({mixins:[Tt,Et,Te],inheritAttrs:!1,props:{calendar:{type:Boolean,default:!0},icon:{type:String,default:"calendar"},time:{type:[Boolean,Object],default:()=>({})},times:{type:Boolean,default:!0}},data(){return{isInvalid:!1,iso:this.toIso(this.value)}},computed:{isEmpty(){return this.time?null===this.iso.date&&this.iso.time:null===this.iso.date}},watch:{value(t,e){t!==e&&(this.iso=this.toIso(t))}},methods:{focus(){this.$refs.dateInput.focus()},now(){const t=this.$library.dayjs();return{date:t.toISO("date"),time:this.time?t.toISO("time"):"00:00:00"}},onInput(){if(this.isEmpty)return this.$emit("input","");const t=this.$library.dayjs.iso(this.iso.date+" "+this.iso.time);(t||null!==this.iso.date&&null!==this.iso.time)&&this.$emit("input",(null==t?void 0:t.toISO())||"")},onCalendarInput(t){var e;null==(e=this.$refs.calendar)||e.close(),this.onDateInput(t)},onDateInput(t){t&&!this.iso.time&&(this.iso.time=this.now().time),this.iso.date=t,this.onInput()},onDateInvalid(t){this.isInvalid=t},onTimeInput(t){t&&!this.iso.date&&(this.iso.date=this.now().date),this.iso.time=t,this.onInput()},onTimesInput(t){var e;null==(e=this.$refs.times)||e.close(),this.onTimeInput(t+":00")},toIso(t){const e=this.$library.dayjs.iso(t);return{date:(null==e?void 0:e.toISO("date"))||null,time:(null==e?void 0:e.toISO("time"))||null}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-date-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("div",{ref:"body",staticClass:"k-date-field-body",attrs:{"data-invalid":!t.novalidate&&t.isInvalid,"data-theme":"field"}},[e("k-input",t._b({ref:"dateInput",attrs:{id:t._uid,autofocus:t.autofocus,disabled:t.disabled,display:t.display,max:t.max,min:t.min,required:t.required,value:t.value,theme:"field",type:"date"},on:{invalid:t.onDateInvalid,input:t.onDateInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.calendar?{key:"icon",fn:function(){return[e("k-dropdown",[e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,tooltip:t.$t("date.select")},on:{click:function(e){return t.$refs.calendar.toggle()}}}),e("k-dropdown-content",{ref:"calendar",attrs:{align:"right"}},[e("k-calendar",{attrs:{value:t.value,min:t.min,max:t.max},on:{input:t.onCalendarInput}})],1)],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1)),t.time?e("k-input",{ref:"timeInput",attrs:{disabled:t.disabled,display:t.time.display,required:t.required,step:t.time.step,value:t.iso.time,icon:t.time.icon,theme:"field",type:"time"},on:{input:t.onTimeInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-dropdown",[e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.time.icon||"clock",tooltip:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{align:"right"}},[e("k-times",{attrs:{display:t.time.display,value:t.value},on:{input:t.onTimesInput}})],1)],1)]},proxy:!0}:null],null,!0)}):t._e()],1)])}),[],!1,null,null,null,null).exports;const gs=G({mixins:[Tt,Et,Me],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"email"}},computed:{mailto(){var t;return(null==(t=this.value)?void 0:t.length)>0?"mailto:"+this.value:null}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-email-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"email"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.mailto,tooltip:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,ks={mixins:[Tt],inheritAttrs:!1,props:{empty:String,info:String,link:Boolean,layout:{type:String,default:"list"},max:Number,multiple:Boolean,parent:String,search:Boolean,size:String,text:String,value:{type:Array,default:()=>[]}},data(){return{selected:this.value}},computed:{btnIcon(){return!this.multiple&&this.selected.length>0?"refresh":"add"},btnLabel(){return!this.multiple&&this.selected.length>0?this.$t("change"):this.$t("add")},collection(){return{empty:this.emptyProps,items:this.selected,layout:this.layout,link:this.link,size:this.size,sortable:!this.disabled&&this.selected.length>1}},isInvalid(){return!(!this.required||0!==this.selected.length)||(!!(this.min&&this.selected.lengththis.max))},items(){return this.models.map(this.item)},more(){return!this.max||this.max>this.selected.length}},watch:{value(t){this.selected=t}},methods:{focus(){},item:t=>t,onInput(){this.$emit("input",this.selected)},open(){if(this.disabled)return!1;this.$refs.selector.open({endpoint:this.endpoints.field,max:this.max,multiple:this.multiple,search:this.search,selected:this.selected.map((t=>t.id))})},remove(t){this.selected.splice(t,1),this.onInput()},removeById(t){this.selected=this.selected.filter((e=>e.id!==t)),this.onInput()},select(t){0!==t.length?(this.selected=this.selected.filter((e=>t.filter((t=>t.id===e.id)).length>0)),t.forEach((t=>{0===this.selected.filter((e=>t.id===e.id)).length&&this.selected.push(t)})),this.onInput()):this.selected=[]}}};const bs=G({mixins:[ks],props:{uploads:[Boolean,Object,Array]},computed:{emptyProps(){return{icon:"image",text:this.empty||this.$t("field.files.empty")}},moreUpload(){return!this.disabled&&this.more&&this.uploads},options(){return this.uploads?{icon:this.btnIcon,text:this.btnLabel,options:[{icon:"check",text:this.$t("select"),click:"open"},{icon:"upload",text:this.$t("upload"),click:"upload"}]}:{options:[{icon:"check",text:this.$t("select"),click:()=>this.open()}]}},uploadParams(){return{accept:this.uploads.accept,max:this.max,multiple:this.multiple,url:this.$urls.api+"/"+this.endpoints.field+"/upload"}}},created(){this.$events.$on("file.delete",this.removeById)},destroyed(){this.$events.$off("file.delete",this.removeById)},methods:{drop(t){return!1!==this.uploads&&this.$refs.fileUpload.drop(t,this.uploadParams)},prompt(){if(this.disabled)return!1;this.moreUpload?this.$refs.options.toggle():this.open()},onAction(t){if(this.moreUpload)switch(t){case"open":return this.open();case"upload":return this.$refs.fileUpload.open(this.uploadParams)}},isSelected(t){return this.selected.find((e=>e.id===t.id))},upload(t,e){!1===this.multiple&&(this.selected=[]),e.forEach((t=>{this.isSelected(t)||this.selected.push(t)})),this.onInput(),this.$events.$emit("model.update")}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-files-field",scopedSlots:t._u([t.more&&!t.disabled?{key:"options",fn:function(){return[e("k-button-group",{staticClass:"k-field-options"},[e("k-options-dropdown",t._b({ref:"options",on:{action:t.onAction}},"k-options-dropdown",t.options,!1))],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-dropzone",{attrs:{disabled:!t.moreUpload},on:{drop:t.drop}},[e("k-collection",t._b({on:{empty:t.prompt,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function({index:s}){return[t.disabled?t._e():e("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(s)}}})]}}])},"k-collection",t.collection,!1))],1),e("k-files-dialog",{ref:"selector",on:{submit:t.select}}),e("k-upload",{ref:"fileUpload",on:{success:t.upload}})],1)}),[],!1,null,null,null,null).exports;const vs=G({},(function(){return(0,this._self._c)("div",{staticClass:"k-field k-gap-field"})}),[],!1,null,null,null,null).exports;const ys=G({mixins:[xt,Ct],props:{numbered:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-headline-field"},[e("k-headline",{attrs:{"data-numbered":t.numbered,size:"large"}},[t._v(" "+t._s(t.label)+" ")]),t.help?e("footer",{staticClass:"k-field-footer"},[t.help?e("k-text",{staticClass:"k-field-help",attrs:{theme:"help",html:t.help}}):t._e()],1):t._e()],1)}),[],!1,null,null,null,null).exports;const $s=G({mixins:[xt,Ct],props:{text:String,theme:{type:String,default:"info"}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-field k-info-field"},[e("k-headline",[t._v(t._s(t.label))]),e("k-box",{attrs:{theme:t.theme}},[e("k-text",{attrs:{html:t.text}})],1),t.help?e("footer",{staticClass:"k-field-footer"},[t.help?e("k-text",{staticClass:"k-field-help",attrs:{theme:"help",html:t.help}}):t._e()],1):t._e()],1)}),[],!1,null,null,null,null).exports;const _s=G({components:{"k-block-layouts":G({components:{"k-layout":G({components:{"k-layout-column":G({props:{blocks:Array,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean,width:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column k-layout-column",attrs:{id:t.id,"data-width":t.width,tabindex:"0"},on:{dblclick:function(e){return t.$refs.blocks.choose(t.blocks.length)}}},[e("k-blocks",{ref:"blocks",attrs:{endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets,value:t.blocks,group:"layout"},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{dblclick:function(t){t.stopPropagation()}}})],1)}),[],!1,null,null,null,null).exports},props:{attrs:[Array,Object],columns:Array,disabled:Boolean,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean,settings:Object},computed:{tabs(){let t=this.settings.tabs;return Object.entries(t).forEach((([e,s])=>{Object.entries(s.fields).forEach((([s])=>{t[e].fields[s].endpoints={field:this.endpoints.field+"/fields/"+s,section:this.endpoints.section,model:this.endpoints.model}}))})),t}}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-layout",attrs:{"data-selected":t.isSelected,tabindex:"0"},on:{click:function(e){return t.$emit("select")}}},[e("k-grid",{staticClass:"k-layout-columns"},t._l(t.columns,(function(s,n){return e("k-layout-column",t._b({key:s.id,attrs:{endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets},on:{input:function(e){return t.$emit("updateColumn",{column:s,columnIndex:n,blocks:e})}}},"k-layout-column",s,!1))})),1),t.disabled?t._e():e("nav",{staticClass:"k-layout-toolbar"},[t.settings?e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{tooltip:t.$t("settings"),icon:"settings"},on:{click:function(e){return t.$refs.drawer.open()}}}):t._e(),e("k-dropdown",[e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{icon:"angle-down"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{icon:"angle-up"},on:{click:function(e){return t.$emit("prepend")}}},[t._v(" "+t._s(t.$t("insert.before"))+" ")]),e("k-dropdown-item",{attrs:{icon:"angle-down"},on:{click:function(e){return t.$emit("append")}}},[t._v(" "+t._s(t.$t("insert.after"))+" ")]),e("hr"),t.settings?e("k-dropdown-item",{attrs:{icon:"settings"},on:{click:function(e){return t.$refs.drawer.open()}}},[t._v(" "+t._s(t.$t("settings"))+" ")]):t._e(),e("k-dropdown-item",{attrs:{icon:"copy"},on:{click:function(e){return t.$emit("duplicate")}}},[t._v(" "+t._s(t.$t("duplicate"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:"trash"},on:{click:function(e){return t.$refs.confirmRemoveDialog.open()}}},[t._v(" "+t._s(t.$t("field.layout.delete"))+" ")])],1)],1),e("k-sort-handle")],1),t.settings?e("k-form-drawer",{ref:"drawer",staticClass:"k-layout-drawer",attrs:{tabs:t.tabs,title:t.$t("settings"),value:t.attrs,icon:"settings"},on:{input:function(e){return t.$emit("updateAttrs",e)}}}):t._e(),e("k-remove-dialog",{ref:"confirmRemoveDialog",attrs:{text:t.$t("field.layout.delete.confirm")},on:{submit:function(e){return t.$emit("remove")}}})],1)}),[],!1,null,null,null,null).exports},props:{disabled:Boolean,empty:String,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,layouts:Array,max:Number,settings:Object,value:Array},data(){return{currentLayout:null,nextIndex:null,rows:this.value,selected:null}},computed:{draggableOptions(){return{id:this._uid,handle:!0,list:this.rows}}},watch:{value(){this.rows=this.value}},methods:{async addLayout(t){let e=await this.$api.post(this.endpoints.field+"/layout",{columns:t});this.rows.splice(this.nextIndex,0,e),this.layouts.length>1&&this.$refs.selector.close(),this.save()},duplicateLayout(t,e){let s={...this.$helper.clone(e),id:this.$helper.uuid()};s.columns=s.columns.map((t=>(t.id=this.$helper.uuid(),t.blocks=t.blocks.map((t=>(t.id=this.$helper.uuid(),t))),t))),this.rows.splice(t+1,0,s),this.save()},removeLayout(t){const e=this.rows.findIndex((e=>e.id===t.id));-1!==e&&this.$delete(this.rows,e),this.save()},save(){this.$emit("input",this.rows)},selectLayout(t){this.nextIndex=t,1!==this.layouts.length?this.$refs.selector.open():this.addLayout(this.layouts[0])},updateColumn(t){this.rows[t.layoutIndex].columns[t.columnIndex].blocks=t.blocks,this.save()},updateAttrs(t,e){this.rows[t].attrs=e,this.save()}}},(function(){var t=this,e=t._self._c;return e("div",[t.rows.length?[e("k-draggable",t._b({staticClass:"k-layouts",on:{sort:t.save}},"k-draggable",t.draggableOptions,!1),t._l(t.rows,(function(s,n){return e("k-layout",t._b({key:s.id,attrs:{disabled:t.disabled,endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets,"is-selected":t.selected===s.id,settings:t.settings},on:{append:function(e){return t.selectLayout(n+1)},duplicate:function(e){return t.duplicateLayout(n,s)},prepend:function(e){return t.selectLayout(n)},remove:function(e){return t.removeLayout(s)},select:function(e){t.selected=s.id},updateAttrs:function(e){return t.updateAttrs(n,e)},updateColumn:function(e){return t.updateColumn({layout:s,layoutIndex:n,...e})}}},"k-layout",s,!1))})),1),t.disabled?t._e():e("k-button",{staticClass:"k-field-add-item-button",attrs:{icon:"add",tooltip:t.$t("add")},on:{click:function(e){return t.selectLayout(t.rows.length)}}})]:[e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"},on:{click:function(e){return t.selectLayout(0)}}},[t._v(" "+t._s(t.empty||t.$t("field.layout.empty"))+" ")])],e("k-dialog",{ref:"selector",staticClass:"k-layout-selector",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"}},[e("k-headline",[t._v(t._s(t.$t("field.layout.select")))]),e("ul",t._l(t.layouts,(function(s,n){return e("li",{key:n,staticClass:"k-layout-selector-option"},[e("k-grid",{nativeOn:{click:function(e){return t.addLayout(s)}}},t._l(s,(function(t,s){return e("k-column",{key:s,attrs:{width:t}})})),1)],1)})),0)],1)],2)}),[],!1,null,null,null,null).exports},mixins:[Tt],inheritAttrs:!1,props:{empty:String,fieldsetGroups:Object,fieldsets:Object,layouts:{type:Array,default:()=>[["1/1"]]},settings:Object,value:{type:Array,default:()=>[]}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-layout-field"},"k-field",t.$props,!1),[e("k-block-layouts",t._b({on:{input:function(e){return t.$emit("input",e)}}},"k-block-layouts",t.$props,!1))],1)}),[],!1,null,null,null,null).exports;const xs=G({},(function(){return(0,this._self._c)("hr",{staticClass:"k-line-field"})}),[],!1,null,null,null,null).exports;const ws=G({mixins:[Tt,Et],inheritAttrs:!1,props:{marks:[Array,Boolean],value:String},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-list-field",attrs:{input:t._uid,counter:!1}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{id:t._uid,marks:t.marks,value:t.value,type:"list",theme:"field"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports;const Ss=G({mixins:[Tt,Et,Pe,hs],inheritAttrs:!1,props:{icon:{type:String,default:"angle-down"}},mounted(){this.$refs.input.$el.setAttribute("tabindex",0)},methods:{blur(t){this.$refs.input.blur(t)},focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-multiselect-field",attrs:{input:t._uid,counter:t.counterOptions},on:{blur:t.blur},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.focus.apply(null,arguments))}}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"multiselect"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Cs=G({mixins:[Tt,Et,Fe],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-number-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"number"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Os=G({mixins:[Tt,Et],props:{empty:String,fields:Object,value:[String,Object]},data(){return{object:this.valueToObject(this.value)}},computed:{drawer(){return{icon:"box",tab:"object",tabs:{object:{fields:this.$helper.field.subfields(this,this.fields)}},title:this.label,value:this.object}},isEmpty(){return!this.object||!(!this.object||0!==Object.keys(this.object).length)},isInvalid(){return!0===this.required&&this.isEmpty}},watch:{value(t){this.object=this.valueToObject(t)}},methods:{onAdd(){this.object={};for(const t in this.fields){const e=this.fields[t];e.default&&(this.object[t]=this.$helper.clone(e.default))}this.$emit("input",this.object),this.open()},onCellInput(t,s){e(this.object,t,s),this.$emit("input",this.object)},onDrawerInput(t){this.object=t,this.$emit("input",this.object)},onRemove(){this.object={},this.$emit("input",this.object)},open(t){if(this.disabled)return!1;this.$refs.drawer.open(null,t)},valueToObject:t=>"object"!=typeof t?null:t}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-object-field",scopedSlots:t._u([t.disabled?null:{key:"options",fn:function(){return[t.isEmpty?e("k-button",{attrs:{icon:"add"},on:{click:t.onAdd}}):e("k-button",{attrs:{icon:"remove"},on:{click:t.onRemove}})]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[t.isEmpty?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"box"},on:{click:t.onAdd}},[t._v(" "+t._s(t.empty||t.$t("field.object.empty"))+" ")]):e("table",{staticClass:"k-table k-object-field-table",attrs:{"data-invalid":t.isInvalid}},[e("tbody",[t._l(t.fields,(function(s){return[s.saveable&&t.$helper.field.isVisible(s,t.value)?e("tr",{key:s.name,on:{click:function(e){return t.open(s.name)}}},[e("th",{attrs:{"data-mobile":"true"}},[e("button",{attrs:{type:"button"}},[t._v(t._s(s.label))])]),e("k-table-cell",{attrs:{column:s,field:s,mobile:!0,value:t.object[s.name]},on:{input:function(e){return t.onCellInput(s.name,e)}}})],1):t._e()]}))],2)]),e("k-form-drawer",t._b({ref:"drawer",on:{input:t.onDrawerInput}},"k-form-drawer",t.drawer,!1))],1)}),[],!1,null,null,null,null).exports;const As=G({mixins:[ks],computed:{emptyProps(){return{icon:"page",text:this.empty||this.$t("field.pages.empty")}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-pages-field",scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button-group",{staticClass:"k-field-options"},[t.more&&!t.disabled?e("k-button",{staticClass:"k-field-options-button",attrs:{icon:t.btnIcon,text:t.btnLabel},on:{click:t.open}}):t._e()],1)]},proxy:!0}])},"k-field",t.$props,!1),[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function({index:s}){return[t.disabled?t._e():e("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(s)}}})]}}])},"k-collection",t.collection,!1)),e("k-pages-dialog",{ref:"selector",on:{submit:t.select}})],1)}),[],!1,null,null,null,null).exports;const Ts=G({mixins:[Tt,Et,Re,hs],inheritAttrs:!1,props:{minlength:{type:Number,default:8},icon:{type:String,default:"key"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-password-field",attrs:{input:t._uid,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"password"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Is=G({mixins:[Tt,Et,Ye],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-radio-field"},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"radio"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const js=G({mixins:[Et,Tt,Ue],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-range-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"range"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Es=G({mixins:[Tt,Et,Ve],inheritAttrs:!1,props:{icon:{type:String,default:"angle-down"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-select-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"select"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Ms=G({mixins:[Tt,Et,Ge],inheritAttrs:!1,props:{icon:{type:String,default:"url"},path:{type:String},wizard:{type:[Boolean,Object],default:!1}},data(){return{slug:this.value}},computed:{preview(){return void 0!==this.help?this.help:void 0!==this.path?this.path+this.value:null}},watch:{value(){this.slug=this.value}},methods:{focus(){this.$refs.input.focus()},onWizard(){var t;this.formData[null==(t=this.wizard)?void 0:t.field]&&(this.slug=this.formData[this.wizard.field])}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-slug-field",attrs:{input:t._uid,help:t.preview},scopedSlots:t._u([t.wizard&&t.wizard.text?{key:"options",fn:function(){return[e("k-button",{attrs:{text:t.wizard.text,icon:"wand"},on:{click:t.onWizard}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,value:t.slug,theme:"field",type:"slug"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Ls=G({mixins:[Tt],inheritAttrs:!1,props:{columns:Object,duplicate:{type:Boolean,default:!0},empty:String,fields:Object,limit:Number,max:Number,min:Number,prepend:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},sortBy:String,value:{type:Array,default:()=>[]}},data(){return{autofocus:null,items:this.toItems(this.value),currentIndex:null,currentModel:null,trash:null,page:1}},computed:{dragOptions(){return{disabled:!this.isSortable,fallbackClass:"k-sortable-row-fallback"}},form(){return this.$helper.field.subfields(this,this.fields)},index(){return this.limit?(this.page-1)*this.limit+1:1},more(){return!0!==this.disabled&&!(this.max&&this.items.length>=this.max)},isInvalid(){return!0!==this.disabled&&(!!(this.min&&this.items.lengththis.max))},isSortable(){return!this.sortBy&&(!this.limit&&(!0!==this.disabled&&(!(this.items.length<=1)&&!1!==this.sortable)))},pagination(){let t=0;return this.limit&&(t=(this.page-1)*this.limit),{page:this.page,offset:t,limit:this.limit,total:this.items.length,align:"center",details:!0}},options(){if(this.disabled)return[];let t=[],e=this.duplicate&&this.more&&null===this.currentIndex;return e&&t.push({icon:"copy",text:this.$t("duplicate"),click:"duplicate"}),t.push({icon:"remove",text:e?this.$t("remove"):null,click:"remove"}),t},paginatedItems(){return this.limit?this.items.slice(this.pagination.offset,this.pagination.offset+this.limit):this.items}},watch:{value(t){t!=this.items&&(this.items=this.toItems(t))}},methods:{add(t){!0===this.prepend?this.items.unshift(t):this.items.push(t)},focus(){var t,e;null==(e=null==(t=this.$refs.add)?void 0:t.focus)||e.call(t)},jump(t,e){this.open(t+this.pagination.offset,e)},onAdd(){if(!0===this.disabled)return!1;if(null!==this.currentIndex)return this.onFormDiscard(),!1;let t={};for(const e in this.fields)t[e]=this.$helper.clone(this.fields[e].default);this.currentIndex="new",this.currentModel=t,this.onFormOpen()},onFormClose(){this.currentIndex=null,this.currentModel=null},onFormDiscard(){if("new"===this.currentIndex){if(0===Object.values(this.currentModel).filter((t=>!1===this.$helper.object.isEmpty(t))).length)return void this.onFormClose()}this.onFormSubmit()},onFormOpen(t=this.autofocus){this.$nextTick((()=>{var e;null==(e=this.$refs.form)||e.focus(t)}))},async onFormPaginate(t){await this.save(),this.open(t)},async onFormSubmit(){try{await this.save(),this.onFormClose()}catch(t){}},onInput(t=this.items){this.$emit("input",t)},onOption(t,e,s){switch(t){case"remove":this.onFormClose(),this.trash=s+this.pagination.offset,this.$refs.remove.open();break;case"duplicate":this.add(this.items[s+this.pagination.offset]),this.onInput()}},onRemove(){if(null===this.trash)return!1;this.items.splice(this.trash,1),this.trash=null,this.$refs.remove.close(),this.onInput(),0===this.paginatedItems.length&&this.page>1&&this.page--,this.items=this.sort(this.items)},open(t,e){this.currentIndex=t,this.currentModel=this.$helper.clone(this.items[t]),this.onFormOpen(e)},paginate({page:t}){this.page=t},sort(t){return this.sortBy?t.sortBy(this.sortBy):t},async save(){if(null!==this.currentIndex&&void 0!==this.currentIndex)try{return await this.validate(this.currentModel),"new"===this.currentIndex?this.add(this.currentModel):this.items[this.currentIndex]=this.currentModel,this.items=this.sort(this.items),this.onInput(),!0}catch(t){throw this.$store.dispatch("notification/error",{message:this.$t("error.form.incomplete"),details:t}),t}},toItems(t){return!1===Array.isArray(t)?[]:this.sort(t)},async validate(t){const e=await this.$api.post(this.endpoints.field+"/validate",t);if(e.length>0)throw e;return!0},onFormInput(t){this.currentModel=t,this.$emit("formInput",t)}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-structure-field",nativeOn:{click:function(t){t.stopPropagation()}},scopedSlots:t._u([{key:"options",fn:function(){return[t.more&&null===t.currentIndex?e("k-button",{ref:"add",attrs:{id:t._uid,text:t.$t("add"),icon:"add"},on:{click:t.onAdd}}):t._e()]},proxy:!0}])},"k-field",t.$props,!1),[null!==t.currentIndex?e("k-structure-form",{ref:"form",attrs:{fields:t.form,index:t.currentIndex,total:t.items.length,value:t.currentModel},on:{close:t.onFormClose,discard:t.onFormDiscard,input:t.onFormInput,paginate:function(e){return t.onFormPaginate(e.offset)},submit:t.onFormSubmit}}):0===t.items.length?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"list-bullet"},on:{click:t.onAdd}},[t._v(" "+t._s(t.empty||t.$t("field.structure.empty"))+" ")]):[e("k-table",{attrs:{columns:t.columns,disabled:t.disabled,fields:t.fields,empty:t.$t("field.structure.empty"),index:t.index,options:t.options,rows:t.paginatedItems,sortable:t.isSortable,"data-invalid":t.isInvalid},on:{cell:function(e){return t.jump(e.rowIndex,e.columnIndex)},input:t.onInput,option:t.onOption}}),t.limit?e("k-pagination",t._b({on:{paginate:t.paginate}},"k-pagination",t.pagination,!1)):t._e(),t.disabled?t._e():e("k-dialog",{ref:"remove",attrs:{"submit-button":t.$t("delete"),theme:"negative"},on:{submit:t.onRemove}},[e("k-text",[t._v(t._s(t.$t("field.structure.delete.confirm")))])],1)]],2)}),[],!1,null,null,null,null).exports;const Bs=G({mixins:[Tt,Et,Xe,hs],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-tags-field",attrs:{input:t._uid,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"tags"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Ds=G({mixins:[Tt,Et,Qe],inheritAttrs:!1,props:{icon:{type:String,default:"phone"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-tel-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"tel"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Ps=G({mixins:[Tt,Et,je,hs],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},select(){this.$refs.input.select()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-text-field",attrs:{input:t._uid,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Ns=G({mixins:[Tt,Et,es,hs],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-textarea-field",attrs:{input:t._uid,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,type:"textarea",theme:"field"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Fs=G({mixins:[Tt,Et,ns],inheritAttrs:!1,props:{icon:{type:String,default:"clock"},times:{type:Boolean,default:!0}},methods:{focus(){this.$refs.input.focus()},select(t){var e;this.$emit("input",t),null==(e=this.$refs.times)||e.close()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-time-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"time"},on:{input:function(e){return t.$emit("input",e||"")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-dropdown",[e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon||"clock",tooltip:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{align:"right"}},[e("k-times",{attrs:{display:t.display,value:t.value},on:{input:t.select}})],1)],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports;const qs=G({mixins:[Tt,Et,os],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-toggle-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"toggle"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Rs=G({mixins:[Tt,Et,ls],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-toggles-field"},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",class:{grow:t.grow},attrs:{id:t._uid,theme:"field",type:"toggles"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const zs=G({mixins:[Tt,Et,us],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"url"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-url-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"url"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.value,tooltip:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Ys=G({mixins:[ks],computed:{emptyProps(){return{icon:"users",text:this.empty||this.$t("field.users.empty")}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-users-field",scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button-group",{staticClass:"k-field-options"},[t.more&&!t.disabled?e("k-button",{staticClass:"k-field-options-button",attrs:{icon:t.btnIcon,text:t.btnLabel},on:{click:t.open}}):t._e()],1)]},proxy:!0}])},"k-field",t.$props,!1),[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function({index:s}){return[t.disabled?t._e():e("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(s)}}})]}}])},"k-collection",t.collection,!1)),e("k-users-dialog",{ref:"selector",on:{submit:t.select}})],1)}),[],!1,null,null,null,null).exports;const Hs=G({mixins:[Tt,Et,be],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-writer-field",attrs:{input:t._uid,counter:!1}},"k-field",t.$props,!1),[e("k-input",t._b({attrs:{after:t.after,before:t.before,icon:t.icon,theme:"field"}},"k-input",t.$props,!1),[e("k-writer",t._b({ref:"input",staticClass:"k-writer-field-input",attrs:{value:t.value},on:{input:function(e){return t.$emit("input",e)}}},"k-writer",t.$props,!1))],1)],1)}),[],!1,null,null,null,null).exports,Us={install(t){t.component("k-blocks-field",ps),t.component("k-checkboxes-field",ms),t.component("k-date-field",fs),t.component("k-email-field",gs),t.component("k-files-field",bs),t.component("k-gap-field",vs),t.component("k-headline-field",ys),t.component("k-info-field",$s),t.component("k-layout-field",_s),t.component("k-line-field",xs),t.component("k-list-field",ws),t.component("k-multiselect-field",Ss),t.component("k-number-field",Cs),t.component("k-object-field",Os),t.component("k-pages-field",As),t.component("k-password-field",Ts),t.component("k-radio-field",Is),t.component("k-range-field",js),t.component("k-select-field",Es),t.component("k-slug-field",Ms),t.component("k-structure-field",Ls),t.component("k-tags-field",Bs),t.component("k-text-field",Ps),t.component("k-textarea-field",Ns),t.component("k-tel-field",Ds),t.component("k-time-field",Fs),t.component("k-toggle-field",qs),t.component("k-toggles-field",Rs),t.component("k-url-field",zs),t.component("k-users-field",Ys),t.component("k-writer-field",Hs)}},Ks={install(t){t.component("k-calendar",mt),t.component("k-counter",ft),t.component("k-autocomplete",ht),t.component("k-form",gt),t.component("k-form-buttons",kt),t.component("k-form-indicator",bt),t.component("k-field",It),t.component("k-fieldset",jt),t.component("k-input",Mt),t.component("k-login",Lt),t.component("k-login-code",Bt),t.component("k-times",Dt),t.component("k-upload",Pt),t.component("k-writer",ve),t.component("k-login-alert",ye),t.component("k-structure-form",$e),t.component("k-toolbar",xe),t.component("k-toolbar-email-dialog",we),t.component("k-toolbar-link-dialog",Se),t.use(ds),t.use(Us)}};const Vs=G({props:{cover:Boolean,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio)}}},(function(){var t=this;return(0,t._self._c)("span",{staticClass:"k-aspect-ratio",style:{"padding-bottom":t.ratioPadding},attrs:{"data-cover":t.cover}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Js=G({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bar"},[t.$slots.left?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"left"}},[t._t("left")],2):t._e(),t.$slots.center?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"center"}},[t._t("center")],2):t._e(),t.$slots.right?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"right"}},[t._t("right")],2):t._e()])}),[],!1,null,null,null,null).exports;const Gs=G({props:{theme:{type:String,default:"none"},text:String,html:{type:Boolean,default:!1}}},(function(){var t=this,e=t._self._c;return e("div",t._g({staticClass:"k-box",attrs:{"data-theme":t.theme}},t.$listeners),[t._t("default",(function(){return[t.html?e("k-text",{attrs:{html:t.text}}):e("k-text",[t._v(" "+t._s(t.text)+" ")])]}))],2)}),[],!1,null,null,null,null).exports;const Ws=G({inheritAttrs:!1,props:{back:String,color:String,element:{type:String,default:"li"},image:Object,link:String,text:String}},(function(){var t=this,e=t._self._c;return e(t.link?"k-link":"p",{tag:"component",staticClass:"k-bubble",style:{color:t.$helper.color(t.color),background:t.$helper.color(t.back)},attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[t.image?e("k-item-image",{attrs:{image:t.image,layout:"list"}}):t._e(),t._v(" "+t._s(t.text)+" ")],1)}),[],!1,null,null,null,null).exports;const Xs=G({inheritAttrs:!1,props:{bubbles:Array},computed:{items(){let t=this.bubbles;return"string"==typeof t&&(t=t.split(",")),t.map((t=>"string"==typeof t?{text:t}:t))}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-bubbles"},t._l(t.items,(function(s,n){return e("li",{key:n},[e("k-bubble",t._b({},"k-bubble",s,!1))],1)})),0)}),[],!1,null,null,null,null).exports;const Zs=G({props:{columns:{type:[Object,Array],default:()=>({})},empty:Object,help:String,items:{type:[Array,Object],default:()=>[]},layout:{type:String,default:"list"},link:{type:Boolean,default:!0},size:String,sortable:Boolean,pagination:{type:[Boolean,Object],default:()=>!1}},computed:{hasPagination(){return!1!==this.pagination&&(!0!==this.paginationOptions.hide&&!(this.pagination.total<=this.pagination.limit))},hasFooter(){return!(!this.hasPagination&&!this.help)},paginationOptions(){return{limit:10,details:!0,keys:!1,total:0,hide:!1,..."object"!=typeof this.pagination?{}:this.pagination}}},watch:{$props(){this.$forceUpdate()}},methods:{onEmpty(t){t.stopPropagation(),this.$emit("empty")},onOption(...t){this.$emit("action",...t),this.$emit("option",...t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-collection"},[t.items.length?e("k-items",{attrs:{columns:t.columns,items:t.items,layout:t.layout,link:t.link,size:t.size,sortable:t.sortable},on:{change:function(e){return t.$emit("change",e)},item:function(e){return t.$emit("item",e)},option:t.onOption,sort:function(e){return t.$emit("sort",e)}},scopedSlots:t._u([{key:"options",fn:function({item:e,itemIndex:s}){return[t._t("options",null,null,{item:e,index:s})]}}],null,!0)}):e("k-empty",t._g(t._b({attrs:{layout:t.layout}},"k-empty",t.empty,!1),t.$listeners.empty?{click:t.onEmpty}:{})),t.hasFooter?e("footer",{staticClass:"k-collection-footer"},[t.help?e("k-text",{staticClass:"k-collection-help",attrs:{theme:"help",html:t.help}}):t._e(),e("div",{staticClass:"k-collection-pagination"},[t.hasPagination?e("k-pagination",t._b({on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.paginationOptions,!1)):t._e()],1)],1):t._e()],1)}),[],!1,null,null,null,null).exports;const Qs=G({props:{width:String,sticky:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column",attrs:{"data-width":t.width,"data-sticky":t.sticky}},[e("div",[t._t("default")],2)])}),[],!1,null,null,null,null).exports;const tn=G({props:{disabled:{type:Boolean,default:!1}},data:()=>({files:[],dragging:!1,over:!1}),methods:{cancel(){this.reset()},reset(){this.dragging=!1,this.over=!1},onDrop(t){return!0===this.disabled||!1===this.$helper.isUploadEvent(t)?this.reset():(this.$events.$emit("dropzone.drop"),this.files=t.dataTransfer.files,this.$emit("drop",this.files),void this.reset())},onEnter(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(this.dragging=!0)},onLeave(){this.reset()},onOver(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(t.dataTransfer.dropEffect="copy",this.over=!0)}}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-dropzone",attrs:{"data-dragging":t.dragging,"data-over":t.over},on:{dragenter:t.onEnter,dragleave:t.onLeave,dragover:t.onOver,drop:t.onDrop}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const en=G({props:{text:String,icon:String,layout:{type:String,default:"list"}},computed:{element(){return void 0!==this.$listeners.click?"button":"div"}}},(function(){var t=this,e=t._self._c;return e(t.element,t._g({tag:"component",staticClass:"k-empty",attrs:{"data-layout":t.layout,type:"button"===t.element&&"button"}},t.$listeners),[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),e("p",[t._t("default",(function(){return[t._v(t._s(t.text))]}))],2)],1)}),[],!1,null,null,null,null).exports;const sn=G({props:{details:Array,image:Object,url:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-file-preview"},[e("k-view",{staticClass:"k-file-preview-layout"},[e("div",{staticClass:"k-file-preview-image"},[e("k-link",{staticClass:"k-file-preview-image-link",attrs:{to:t.url,title:t.$t("open"),target:"_blank"}},[e("k-item-image",{attrs:{image:t.image,layout:"cards"}})],1)],1),e("div",{staticClass:"k-file-preview-details"},[e("ul",t._l(t.details,(function(s){return e("li",{key:s.title},[e("h3",[t._v(t._s(s.title))]),e("p",[s.link?e("k-link",{attrs:{to:s.link,tabindex:"-1",target:"_blank"}},[t._v(" /"+t._s(s.text)+" ")]):[t._v(" "+t._s(s.text)+" ")]],2)])})),0)])])],1)}),[],!1,null,null,null,null).exports;const nn=G({props:{gutter:String}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-grid",attrs:{"data-gutter":t.gutter}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const on=G({props:{editable:Boolean,tab:String,tabs:{type:Array,default:()=>[]}},computed:{tabsWithBadges(){const t=Object.keys(this.$store.getters["content/changes"]());return this.tabs.map((e=>{let s=[];return Object.values(e.columns).forEach((t=>{Object.values(t.sections).forEach((t=>{"fields"===t.type&&Object.keys(t.fields).forEach((t=>{s.push(t)}))}))})),e.badge=s.filter((e=>t.includes(e.toLowerCase()))).length,e}))}}},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-header",attrs:{"data-editable":t.editable,"data-tabs":t.tabsWithBadges.length>1}},[e("k-headline",{attrs:{tag:"h1",size:"huge"}},[t.editable&&t.$listeners.edit?e("span",{staticClass:"k-headline-editable",on:{click:function(e){return t.$emit("edit")}}},[t._t("default"),e("k-icon",{attrs:{type:"edit"}})],2):t._t("default")],2),t.$slots.left||t.$slots.right?e("k-bar",{staticClass:"k-header-buttons",scopedSlots:t._u([{key:"left",fn:function(){return[t._t("left")]},proxy:!0},{key:"right",fn:function(){return[t._t("right")]},proxy:!0}],null,!0)}):t._e(),e("k-tabs",{attrs:{tab:t.tab,tabs:t.tabsWithBadges,theme:"notice"}})],1)}),[],!1,null,null,null,null).exports;const rn=G({inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-panel",{staticClass:"k-panel-inside",attrs:{tabindex:"0"}},[e("header",{staticClass:"k-panel-header"},[e("k-topbar",{attrs:{breadcrumb:t.$view.breadcrumb,license:t.$license,menu:t.$menu,view:t.$view}})],1),e("main",{staticClass:"k-panel-view scroll-y"},[t._t("default")],2),t._t("footer")],2)}),[],!1,null,null,null,null).exports;const ln=G({inheritAttrs:!1,props:{data:Object,flag:Object,image:[Object,Boolean],info:String,layout:{type:String,default:"list"},link:{type:[Boolean,String,Function]},options:{type:[Array,Function,String]},sortable:Boolean,target:String,text:String,width:String},computed:{hasFigure(){return!1!==this.image&&Object.keys(this.image).length>0},title(){return this.text||"-"}},methods:{onOption(t){this.$emit("action",t),this.$emit("option",t)}}},(function(){var t=this,e=t._self._c;return e("article",t._b({staticClass:"k-item",class:!!t.layout&&"k-"+t.layout+"-item",attrs:{"data-has-figure":t.hasFigure,"data-has-flag":Boolean(t.flag),"data-has-info":Boolean(t.info),"data-has-options":Boolean(t.options),tabindex:"-1"},on:{click:function(e){return t.$emit("click",e)},dragstart:function(e){return t.$emit("drag",e)}}},"article",t.data,!1),[t._t("image",(function(){return[t.hasFigure?e("k-item-image",{attrs:{image:t.image,layout:t.layout,width:t.width}}):t._e()]})),t.sortable?e("k-sort-handle",{staticClass:"k-item-sort-handle"}):t._e(),e("header",{staticClass:"k-item-content"},[t._t("default",(function(){return[e("h3",{staticClass:"k-item-title"},[!1!==t.link?e("k-link",{staticClass:"k-item-title-link",attrs:{target:t.target,to:t.link}},[e("span",{domProps:{innerHTML:t._s(t.title)}})]):e("span",{domProps:{innerHTML:t._s(t.title)}})],1),t.info?e("p",{staticClass:"k-item-info",domProps:{innerHTML:t._s(t.info)}}):t._e()]}))],2),t.flag||t.options||t.$slots.options?e("footer",{staticClass:"k-item-footer"},[e("nav",{staticClass:"k-item-buttons",on:{click:function(t){t.stopPropagation()}}},[t.flag?e("k-status-icon",t._b({},"k-status-icon",t.flag,!1)):t._e(),t._t("options",(function(){return[t.options?e("k-options-dropdown",{staticClass:"k-item-options-dropdown",attrs:{options:t.options},on:{option:t.onOption}}):t._e()]}))],2)]):t._e()],2)}),[],!1,null,null,null,null).exports;const an=G({inheritAttrs:!1,props:{image:[Object,Boolean],layout:{type:String,default:"list"},width:String},computed:{back(){return this.image.back||"black"},ratio(){return"cards"===this.layout&&this.image.ratio||"1/1"},size(){switch(this.layout){case"cards":return"large";case"cardlets":return"medium";default:return"regular"}},sizes(){switch(this.width){case"1/2":case"2/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 44em, 27em";case"1/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 29.333em, 27em";case"1/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 22em, 27em";case"2/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 27em, 27em";case"3/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 66em, 27em";default:return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 88em, 27em"}}}},(function(){var t=this,e=t._self._c;return t.image?e("div",{staticClass:"k-item-figure",style:{background:t.$helper.color(t.back)}},[t.image.src?e("k-image",{staticClass:"k-item-image",attrs:{cover:t.image.cover,ratio:t.ratio,sizes:t.sizes,src:t.image.src,srcset:t.image.srcset}}):e("k-aspect-ratio",{attrs:{ratio:t.ratio}},[e("k-icon",{staticClass:"k-item-icon",attrs:{color:t.$helper.color(t.image.color),type:t.image.icon}})],1)],1):t._e()}),[],!1,null,null,null,null).exports;const un=G({inheritAttrs:!1,props:{columns:{type:[Object,Array],default:()=>({})},items:{type:Array,default:()=>[]},layout:{type:String,default:"list"},link:{type:Boolean,default:!0},image:{type:[Object,Boolean],default:()=>({})},sortable:Boolean,empty:{type:[String,Object]},size:{type:String,default:"default"}},computed:{dragOptions(){return{sort:this.sortable,disabled:!1===this.sortable,draggable:".k-draggable-item"}},table(){return{columns:this.columns,rows:this.items,sortable:this.sortable}}},methods:{onDragStart(t,e){this.$store.dispatch("drag",{type:"text",data:e})},onOption(t,e,s){this.$emit("option",t,e,s)},imageOptions(t){let e=this.image,s=t.image;return!1!==e&&!1!==s&&("object"!=typeof e&&(e={}),"object"!=typeof s&&(s={}),{...s,...e})}}},(function(){var t=this,e=t._self._c;return"table"===t.layout?e("k-table",t._b({on:{change:function(e){return t.$emit("change",e)},sort:function(e){return t.$emit("sort",e)},option:t.onOption}},"k-table",t.table,!1)):e("k-draggable",{staticClass:"k-items",class:"k-"+t.layout+"-items",attrs:{handle:!0,options:t.dragOptions,"data-layout":t.layout,"data-size":t.size,list:t.items},on:{change:function(e){return t.$emit("change",e)},end:function(e){return t.$emit("sort",t.items,e)}}},[t._l(t.items,(function(s,n){return[t._t("default",(function(){return[e("k-item",t._b({key:s.id||n,class:{"k-draggable-item":t.sortable&&s.sortable},attrs:{image:t.imageOptions(s),layout:t.layout,link:!!t.link&&s.link,sortable:t.sortable&&s.sortable,width:s.column},on:{click:function(e){return t.$emit("item",s,n)},drag:function(e){return t.onDragStart(e,s.dragText)},option:function(e){return t.onOption(e,s,n)}},nativeOn:{mouseover:function(e){return t.$emit("hover",e,s,n)}},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options",null,null,{item:s,itemIndex:n})]},proxy:!0}],null,!0)},"k-item",s,!1))]}),null,{item:s,itemIndex:n})]}))],2)}),[],!1,null,null,null,null).exports;const cn=G({inheritAttrs:!0,props:{autofocus:{type:Boolean,default:!0},centered:{type:Boolean,default:!1},dimmed:{type:Boolean,default:!0},loading:{type:Boolean,default:!1}},data:()=>({isOpen:!1,scrollTop:0}),methods:{close(){!1!==this.isOpen&&(this.isOpen=!1,this.$emit("close"),this.restoreScrollPosition(),this.$events.$off("keydown.esc",this.close))},focus(){var t,e;let s=this.$refs.overlay.querySelector("\n [autofocus],\n [data-autofocus]\n ");return null===s&&(s=this.$refs.overlay.querySelector("\n input,\n textarea,\n select,\n button\n ")),"function"==typeof(null==s?void 0:s.focus)?s.focus():"function"==typeof(null==(e=null==(t=this.$slots.default[0])?void 0:t.context)?void 0:e.focus)?this.$slots.default[0].context.focus():void 0},open(){!0!==this.isOpen&&(this.storeScrollPosition(),this.isOpen=!0,this.$emit("open"),this.$events.$on("keydown.esc",this.close),setTimeout((()=>{!0===this.autofocus&&this.focus(),document.querySelector(".k-overlay > *").addEventListener("mousedown",(t=>t.stopPropagation())),this.$emit("ready")}),1))},restoreScrollPosition(){const t=document.querySelector(".k-panel-view");(null==t?void 0:t.scrollTop)&&(t.scrollTop=this.scrollTop)},storeScrollPosition(){const t=document.querySelector(".k-panel-view");(null==t?void 0:t.scrollTop)?this.scrollTop=t.scrollTop:this.scrollTop=0}}},(function(){var t=this,e=t._self._c;return t.isOpen?e("portal",[e("div",t._g({ref:"overlay",staticClass:"k-overlay",class:t.$vnode.data.staticClass,attrs:{"data-centered":t.loading||t.centered,"data-dimmed":t.dimmed,"data-loading":t.loading,dir:t.$translation.direction},on:{mousedown:t.close}},t.$listeners),[t.loading?e("k-loader",{staticClass:"k-overlay-loader"}):t._t("default",null,{close:t.close,isOpen:t.isOpen})],2)]):t._e()}),[],!1,null,null,null,null).exports;const dn=G({computed:{defaultLanguage(){return!!this.$language&&this.$language.default},dialog(){return this.$helper.clone(this.$store.state.dialog)},dir(){return this.$translation.direction},language(){return this.$language?this.$language.code:null},role(){return this.$user?this.$user.role:null},user(){return this.$user?this.$user.id:null}},watch:{dir:{handler(){document.body.dir=this.dir},immediate:!0}},created(){this.$events.$on("drop",this.drop)},destroyed(){this.$events.$off("drop",this.drop)},methods:{drop(){this.$store.dispatch("drag",null)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-panel",attrs:{"data-dragging":t.$store.state.drag,"data-loading":t.$store.state.isLoading,"data-language":t.language,"data-language-default":t.defaultLanguage,"data-role":t.role,"data-translation":t.$translation.code,"data-user":t.user,dir:t.dir}},[t._t("default"),t.$store.state.dialog&&t.$store.state.dialog.props?[e("k-fiber-dialog",t._b({},"k-fiber-dialog",t.dialog,!1))]:t._e(),!1!==t.$store.state.fatal?e("k-fatal",{attrs:{html:t.$store.state.fatal}}):t._e(),!1===t.$system.isLocal?e("k-offline-warning"):t._e(),e("k-icons")],2)}),[],!1,null,null,null,null).exports;const pn=G({props:{reports:Array,size:{type:String,default:"large"}},methods:{component(t){return null!==this.target(t)?"k-link":"div"},target(t){return t.link?t.link:t.click?t.click:t.dialog?()=>this.$dialog(t.dialog):null}}},(function(){var t=this,e=t._self._c;return e("dl",{staticClass:"k-stats",attrs:{"data-size":t.size}},t._l(t.reports,(function(s,n){return e(t.component(s),{key:n,tag:"component",staticClass:"k-stat",attrs:{"data-theme":s.theme,to:t.target(s)}},[e("dt",{staticClass:"k-stat-label"},[t._v(t._s(s.label))]),e("dd",{staticClass:"k-stat-value"},[t._v(t._s(s.value))]),e("dd",{staticClass:"k-stat-info"},[t._v(t._s(s.info))])])})),1)}),[],!1,null,null,null,null).exports;const hn=G({inheritAttrs:!1,props:{columns:Object,disabled:Boolean,fields:{type:Object,default:()=>({})},empty:String,index:{type:[Number,Boolean],default:1},rows:Array,options:[Array,Function],sortable:Boolean},data(){return{values:this.rows}},computed:{columnsCount(){return Object.keys(this.columns).length},dragOptions(){return{disabled:!this.sortable,fallbackClass:"k-table-row-fallback",ghostClass:"k-table-row-ghost"}},hasIndexColumn(){return this.sortable||!1!==this.index},hasOptions(){var t;return(null==(t=this.options)?void 0:t.length)>0||Object.values(this.values).filter((t=>t.options)).length>0}},watch:{rows(){this.values=this.rows}},methods:{isColumnEmpty(t){return 0===this.rows.filter((e=>!1===this.$helper.object.isEmpty(e[t]))).length},label(t,e){return t.label||this.$helper.string.ucfirst(e)},onChange(t){this.$emit("change",t)},onCell(t){this.$emit("cell",t)},onCellUpdate({columnIndex:t,rowIndex:e,value:s}){this.values[e][t]=s,this.$emit("input",this.values)},onHeader(t){this.$emit("header",t)},onOption(t,e,s){this.$emit("option",t,e,s)},onSort(){this.$emit("input",this.values),this.$emit("sort",this.values)},width(t){return"string"!=typeof t?"auto":!1===t.includes("/")?t:this.$helper.ratio(t,"auto",!1)}}},(function(){var t=this,e=t._self._c;return e("table",{staticClass:"k-table",attrs:{"data-disabled":t.disabled,"data-indexed":t.hasIndexColumn}},[e("thead",[e("tr",[t.hasIndexColumn?e("th",{staticClass:"k-table-index-column",attrs:{"data-mobile":""}},[t._v(" # ")]):t._e(),t._l(t.columns,(function(s,n){return e("th",{key:n+"-header",staticClass:"k-table-column",style:"width:"+t.width(s.width),attrs:{"data-align":s.align,"data-mobile":s.mobile},on:{click:function(e){return t.onHeader({column:s,columnIndex:n})}}},[t._t("header",(function(){return[t._v(" "+t._s(t.label(s,n))+" ")]}),null,{column:s,columnIndex:n,label:t.label(s,n)})],2)})),t.hasOptions?e("th",{staticClass:"k-table-options-column",attrs:{"data-mobile":""}}):t._e()],2)]),e("k-draggable",{attrs:{list:t.values,options:t.dragOptions,handle:!0,element:"tbody"},on:{change:t.onChange,end:t.onSort}},[0===t.rows.length?e("tr",[e("td",{staticClass:"k-table-empty",attrs:{colspan:t.columnsCount}},[t._v(" "+t._s(t.empty)+" ")])]):t._l(t.values,(function(s,n){return e("tr",{key:n},[t.hasIndexColumn?e("td",{staticClass:"k-table-index-column",attrs:{"data-sortable":t.sortable&&!1!==s.sortable,"data-mobile":""}},[t._t("index",(function(){return[e("div",{staticClass:"k-table-index",domProps:{textContent:t._s(t.index+n)}})]}),null,{row:s,rowIndex:n}),t.sortable&&!1!==s.sortable?e("k-sort-handle",{staticClass:"k-table-sort-handle"}):t._e()],2):t._e(),t._l(t.columns,(function(i,o){return e("k-table-cell",{key:n+"-"+o,staticClass:"k-table-column",style:"width:"+t.width(i.width),attrs:{column:i,field:t.fields[o],row:s,mobile:i.mobile,value:s[o]},on:{input:function(e){return t.onCellUpdate({columnIndex:o,rowIndex:n,value:e})}},nativeOn:{click:function(e){return t.onCell({row:s,rowIndex:n,column:i,columnIndex:o})}}})})),t.hasOptions?e("td",{staticClass:"k-table-options-column",attrs:{"data-mobile":""}},[t._t("options",(function(){return[e("k-options-dropdown",{attrs:{options:s.options||t.options,text:(s.options||t.options).length>1},on:{option:function(e){return t.onOption(e,s,n)}}})]}),null,{row:s,rowIndex:n,options:t.options})],2):t._e()],2)}))],2)],1)}),[],!1,null,null,null,null).exports;const mn=G({inheritAttrs:!1,props:{column:Object,field:Object,mobile:{type:Boolean,default:!1},row:Object,value:{default:""}},computed:{component(){return this.$helper.isComponent(`k-${this.type}-field-preview`)?`k-${this.type}-field-preview`:this.$helper.isComponent(`k-table-${this.type}-cell`)?`k-table-${this.type}-cell`:Array.isArray(this.value)?"k-array-field-preview":"object"==typeof this.value?"k-object-field-preview":"k-text-field-preview"},type(){var t;return this.column.type||(null==(t=this.field)?void 0:t.type)}}},(function(){var t=this,e=t._self._c;return e("td",{attrs:{"data-align":t.column.align,"data-mobile":t.mobile}},[!1===t.$helper.object.isEmpty(t.value)?[e(t.component,{tag:"component",attrs:{column:t.column,field:t.field,row:t.row,value:t.value},on:{input:function(e){return t.$emit("input",e)}}})]:t._e()],2)}),[],!1,null,null,null,null).exports;const fn=G({props:{value:[String,Object]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table-update-status-cell"},["string"==typeof t.value?e("span",{staticClass:"k-table-update-status-cell-version"},[t._v(" "+t._s(t.value)+" ")]):e("k-dropdown",{attrs:{"data-theme":t.value.theme}},[e("k-button",{staticClass:"k-table-update-status-cell-button",attrs:{icon:t.value.icon,href:t.value.url},on:{click:function(e){return e.stopPropagation(),t.$refs.dropdown.toggle()}}},[t._v(" "+t._s(t.value.currentVersion)+" ")]),e("k-dropdown-content",{ref:"dropdown",attrs:{align:"right"}},[e("dl",{staticClass:"k-plugin-info"},[e("div",[e("dt",[t._v(t._s(t.$t("plugin")))]),e("dd",[t._v(t._s(t.value.pluginName))])]),e("div",[e("dt",[t._v(t._s(t.$t("version.current")))]),e("dd",[t._v(t._s(t.value.currentVersion))])]),e("div",[e("dt",[t._v(t._s(t.$t("version.latest")))]),e("dd",[t._v(t._s(t.value.latestVersion))])]),e("div",[e("dt",[t._v(t._s(t.$t("system.updateStatus")))]),e("dd",{attrs:{"data-theme":t.value.theme}},[t._v(t._s(t.value.label))])])]),t.value.url?e("k-dropdown-item",{attrs:{icon:"open",link:t.value.url}},[t._v(" "+t._s(t.$t("versionInformation"))+" ")]):t._e()],1)],1)],1)}),[],!1,null,null,null,null).exports;const gn=G({props:{tab:String,tabs:Array,theme:String},data(){return{size:null,visibleTabs:this.tabs,invisibleTabs:[]}},computed:{current(){return(this.tabs.find((t=>t.name===this.tab))||this.tabs[0]||{}).name}},watch:{tabs:{handler(t){this.visibleTabs=t,this.invisibleTabs=[],this.resize(!0)},immediate:!0}},created(){window.addEventListener("resize",this.resize)},destroyed(){window.removeEventListener("resize",this.resize)},methods:{resize(t){if(this.tabs&&!(this.tabs.length<=1)){if(this.tabs.length<=3)return this.visibleTabs=this.tabs,void(this.invisibleTabs=[]);if(window.innerWidth>=700){if("large"===this.size&&!t)return;this.visibleTabs=this.tabs,this.invisibleTabs=[],this.size="large"}else{if("small"===this.size&&!t)return;this.visibleTabs=this.tabs.slice(0,2),this.invisibleTabs=this.tabs.slice(2),this.size="small"}}}}},(function(){var t=this,e=t._self._c;return t.tabs&&t.tabs.length>1?e("div",{staticClass:"k-tabs",attrs:{"data-theme":t.theme}},[e("nav",[t._l(t.visibleTabs,(function(s){return e("k-button",{key:s.name,staticClass:"k-tab-button",attrs:{link:s.link,current:t.current===s.name,icon:s.icon,tooltip:s.label}},[t._v(" "+t._s(s.label||s.text||s.name)+" "),s.badge?e("span",{staticClass:"k-tabs-badge"},[t._v(" "+t._s(s.badge)+" ")]):t._e()])})),t.invisibleTabs.length?e("k-button",{staticClass:"k-tab-button k-tabs-dropdown-button",attrs:{text:t.$t("more"),icon:"dots"},on:{click:function(e){return e.stopPropagation(),t.$refs.more.toggle()}}}):t._e()],2),t.invisibleTabs.length?e("k-dropdown-content",{ref:"more",staticClass:"k-tabs-dropdown",attrs:{align:"right"}},t._l(t.invisibleTabs,(function(s){return e("k-dropdown-item",{key:"more-"+s.name,attrs:{link:s.link,current:t.tab===s.name,icon:s.icon,tooltip:s.label}},[t._v(" "+t._s(s.label||s.text||s.name)+" ")])})),1):t._e()],1):t._e()}),[],!1,null,null,null,null).exports;const kn=G({props:{align:String}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-view",attrs:{"data-align":t.align}},[t._t("default")],2)}),[],!1,null,null,null,null).exports,bn={install(t){t.component("k-aspect-ratio",Vs),t.component("k-bar",Js),t.component("k-box",Gs),t.component("k-bubble",Ws),t.component("k-bubbles",Xs),t.component("k-collection",Zs),t.component("k-column",Qs),t.component("k-dropzone",tn),t.component("k-empty",en),t.component("k-file-preview",sn),t.component("k-grid",nn),t.component("k-header",on),t.component("k-inside",rn),t.component("k-item",ln),t.component("k-item-image",an),t.component("k-items",un),t.component("k-overlay",cn),t.component("k-panel",dn),t.component("k-stats",pn),t.component("k-table",hn),t.component("k-table-cell",mn),t.component("k-table-update-status-cell",fn),t.component("k-tabs",gn),t.component("k-view",kn)}},vn={};const yn=G({components:{draggable:()=>function(t,e,s){if(!e||0===e.length)return t();const n=document.getElementsByTagName("link");return Promise.all(e.map((t=>{if((t=function(t){return"/"+t}(t))in vn)return;vn[t]=!0;const e=t.endsWith(".css"),i=e?'[rel="stylesheet"]':"";if(s)for(let s=n.length-1;s>=0;s--){const i=n[s];if(i.href===t&&(!e||"stylesheet"===i.rel))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;const o=document.createElement("link");return o.rel=e?"stylesheet":"modulepreload",e||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),e?new Promise(((e,s)=>{o.addEventListener("load",e),o.addEventListener("error",(()=>s(new Error(`Unable to preload CSS for ${t}`))))})):void 0}))).then((()=>t()))}((()=>import("./vuedraggable.js")),[])},props:{data:Object,element:String,handle:[String,Boolean],list:[Array,Object],move:Function,options:Object},data(){return{listeners:{...this.$listeners,start:t=>{this.$store.dispatch("drag",{}),this.$listeners.start&&this.$listeners.start(t)},end:t=>{this.$store.dispatch("drag",null),this.$listeners.end&&this.$listeners.end(t)}}}},computed:{dragOptions(){let t=!1;return t=!0===this.handle?".k-sort-handle":this.handle,{fallbackClass:"k-sortable-fallback",fallbackOnBody:!0,forceFallback:!0,ghostClass:"k-sortable-ghost",handle:t,scroll:document.querySelector(".k-panel-view"),...this.options}}}},(function(){var t=this;return(0,t._self._c)("draggable",t._g(t._b({staticClass:"k-draggable",attrs:{"component-data":t.data,tag:t.element,list:t.list,move:t.move},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("footer")]},proxy:!0}],null,!0)},"draggable",t.dragOptions,!1),t.listeners),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const $n=G({data:()=>({error:null}),errorCaptured(t){return this.$config.debug&&window.console.warn(t),this.error=t,!1},render(){return this.error?this.$slots.error?this.$slots.error[0]:this.$scopedSlots.error?this.$scopedSlots.error({error:this.error}):L("k-box",{attrs:{theme:"negative"}},this.error.message||this.error):this.$slots.default[0]}},null,null,!1,null,null,null,null).exports;const _n=G({props:{html:String},mounted(){try{let t=this.$refs.iframe.contentWindow.document;t.open(),t.write(this.html),t.close()}catch(t){console.error(t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-fatal"},[e("div",{staticClass:"k-fatal-box"},[e("k-bar",{scopedSlots:t._u([{key:"left",fn:function(){return[e("k-headline",[t._v(" The JSON response could not be parsed ")])]},proxy:!0},{key:"right",fn:function(){return[e("k-button",{attrs:{icon:"cancel",text:"Close"},on:{click:function(e){return t.$store.dispatch("fatal",!1)}}})]},proxy:!0}])}),e("iframe",{ref:"iframe",staticClass:"k-fatal-iframe"})],1)])}),[],!1,null,null,null,null).exports;const xn=G({props:{link:String,size:{type:String},tag:{type:String,default:"h2"},theme:{type:String}}},(function(){var t=this,e=t._self._c;return e(t.tag,t._g({tag:"component",staticClass:"k-headline",attrs:{"data-theme":t.theme,"data-size":t.size}},t.$listeners),[t.link?e("k-link",{attrs:{to:t.link}},[t._t("default")],2):t._t("default")],2)}),[],!1,null,null,null,null).exports;const wn=G({props:{alt:String,color:String,back:String,size:String,type:String},computed:{isEmoji(){return this.$helper.string.hasEmoji(this.type)}}},(function(){var t=this,e=t._self._c;return e("span",{class:"k-icon k-icon-"+t.type,style:{background:t.$helper.color(t.back)},attrs:{"aria-label":t.alt,role:t.alt?"img":null,"aria-hidden":!t.alt,"data-back":t.back,"data-size":t.size}},[t.isEmoji?e("span",{staticClass:"k-icon-emoji"},[t._v(t._s(t.type))]):e("svg",{style:{color:t.$helper.color(t.color)},attrs:{viewBox:"0 0 16 16"}},[e("use",{attrs:{"xlink:href":"#icon-"+t.type}})])])}),[],!1,null,null,null,null).exports;const Sn=G({icons:window.panel.plugins.icons},(function(){var t=this,e=t._self._c;return e("svg",{staticClass:"k-icons",attrs:{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",overflow:"hidden"}},[e("defs",t._l(t.$options.icons,(function(s,n){return e("symbol",{key:n,attrs:{id:"icon-"+n,viewBox:"0 0 16 16"},domProps:{innerHTML:t._s(s)}})})),0)])}),[],!1,null,null,null,null).exports;const Cn=G({props:{alt:String,back:String,cover:Boolean,ratio:String,sizes:String,src:String,srcset:String},data:()=>({loaded:{type:Boolean,default:!1},error:{type:Boolean,default:!1}}),computed:{ratioPadding(){return this.$helper.ratio(this.ratio||"1/1")}},created(){let t=new Image;t.onload=()=>{this.loaded=!0,this.$emit("load")},t.onerror=()=>{this.error=!0,this.$emit("error")},t.src=this.src}},(function(){var t=this,e=t._self._c;return e("span",t._g({staticClass:"k-image",attrs:{"data-ratio":t.ratio,"data-back":t.back,"data-cover":t.cover}},t.$listeners),[e("span",{style:"padding-bottom:"+t.ratioPadding},[t.loaded?e("img",{key:t.src,attrs:{alt:t.alt||"",src:t.src,srcset:t.srcset,sizes:t.sizes},on:{dragstart:function(t){t.preventDefault()}}}):t._e(),t.loaded||t.error?t._e():e("k-loader",{attrs:{position:"center",theme:"light"}}),!t.loaded&&t.error?e("k-icon",{staticClass:"k-image-error",attrs:{type:"cancel"}}):t._e()],1)])}),[],!1,null,null,null,null).exports;const On=G({},(function(){var t=this._self._c;return t("span",{staticClass:"k-loader"},[t("k-icon",{staticClass:"k-loader-icon",attrs:{type:"loader"}})],1)}),[],!1,null,null,null,null).exports;const An=G({data:()=>({offline:!1}),created(){this.$events.$on("offline",this.isOffline),this.$events.$on("online",this.isOnline)},destroyed(){this.$events.$off("offline",this.isOffline),this.$events.$off("online",this.isOnline)},methods:{isOnline(){this.offline=!1},isOffline(){this.offline=!0}}},(function(){var t=this,e=t._self._c;return t.offline?e("div",{staticClass:"k-offline-warning"},[e("p",[e("k-icon",{attrs:{type:"bolt"}}),t._v(" "+t._s(t.$t("error.offline")))],1)]):t._e()}),[],!1,null,null,null,null).exports,Tn=(t,e=!1)=>{if(t>=0&&t<=100)return!0;if(e)throw new Error("value has to be between 0 and 100");return!1};const In=G({props:{value:{type:Number,default:0,validator:Tn}},data(){return{state:this.value}},watch:{value(t){this.state=t}},methods:{set(t){Tn(t,!0),this.state=t}}},(function(){var t=this;return(0,t._self._c)("progress",{staticClass:"k-progress",attrs:{max:"100"},domProps:{value:t.state}},[t._v(t._s(t.state)+"%")])}),[],!1,null,null,null,null).exports;const jn=G({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-registration"},[e("p",[t._v(t._s(t.$t("license.unregistered")))]),e("k-button",{staticClass:"k-topbar-button",attrs:{responsive:!0,tooltip:t.$t("license.unregistered"),icon:"key"},on:{click:function(e){return t.$dialog("registration")}}},[t._v(" "+t._s(t.$t("license.register"))+" ")]),e("k-button",{staticClass:"k-topbar-button",attrs:{responsive:!0,link:"https://getkirby.com/buy",target:"_blank",icon:"cart"}},[t._v(" "+t._s(t.$t("license.buy"))+" ")])],1)}),[],!1,null,null,null,null).exports;const En=G({props:{icon:{type:String,default:"sort"}}},(function(){return(0,this._self._c)("k-icon",{staticClass:"k-sort-handle",attrs:{type:this.icon,"aria-hidden":"true"}})}),[],!1,null,null,null,null).exports;const Mn=G({props:{click:{type:Function,default:()=>{}},disabled:Boolean,responsive:Boolean,status:String,text:String,tooltip:String},computed:{icon(){return"draft"===this.status?"circle-outline":"unlisted"===this.status?"circle-half":"circle"},theme(){return"draft"===this.status?"negative":"unlisted"===this.status?"info":"positive"},title(){let t=this.tooltip||this.text;return this.disabled&&(t+=` (${this.$t("disabled")})`),t}},methods:{onClick(){this.click(),this.$emit("click")}}},(function(){var t=this;return(0,t._self._c)("k-button",{class:"k-status-icon k-status-icon-"+t.status,attrs:{disabled:t.disabled,icon:t.icon,responsive:t.responsive,text:t.text,theme:t.theme,tooltip:t.title},on:{click:t.onClick}})}),[],!1,null,null,null,null).exports;const Ln=G({props:{align:String,html:String,size:String,theme:String},computed:{attrs(){return{class:"k-text","data-align":this.align,"data-size":this.size,"data-theme":this.theme}}}},(function(){var t=this,e=t._self._c;return t.html?e("div",t._b({domProps:{innerHTML:t._s(t.html)}},"div",t.attrs,!1)):e("div",t._b({},"div",t.attrs,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Bn=G({props:{user:[Object,String]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-user-info"},[t.user.avatar?e("k-image",{attrs:{cover:!0,src:t.user.avatar.url,ratio:"1/1"}}):e("k-icon",{attrs:{type:"user"}}),t._v(" "+t._s(t.user.name||t.user.email||t.user)+" ")],1)}),[],!1,null,null,null,null).exports,Dn={install(t){t.component("k-draggable",yn),t.component("k-error-boundary",$n),t.component("k-fatal",_n),t.component("k-headline",xn),t.component("k-icon",wn),t.component("k-icons",Sn),t.component("k-image",Cn),t.component("k-loader",On),t.component("k-offline-warning",An),t.component("k-progress",In),t.component("k-registration",jn),t.component("k-status-icon",Mn),t.component("k-sort-handle",En),t.component("k-text",Ln),t.component("k-user-info",Bn)}};const Pn=G({props:{crumbs:{type:Array,default:()=>[]},label:{type:String,default:"Breadcrumb"},view:Object},computed:{dropdown(){return this.segments.map((t=>({...t,text:t.label,icon:"angle-right"})))},segments(){return[{link:this.view.link,label:this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$store.state.isLoading},...this.crumbs]}},methods:{isLast(t){return this.crumbs.length-1===t}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-breadcrumb",attrs:{"aria-label":t.label}},[e("k-dropdown",{staticClass:"k-breadcrumb-dropdown"},[e("k-button",{attrs:{icon:"road-sign"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.dropdown,theme:"light"}})],1),e("ol",t._l(t.segments,(function(s,n){return e("li",{key:n},[e("k-link",{staticClass:"k-breadcrumb-link",attrs:{title:s.text||s.label,to:s.link,"aria-current":!!t.isLast(n)&&"page"}},[s.loading?e("k-loader",{staticClass:"k-breadcrumb-icon"}):s.icon?e("k-icon",{staticClass:"k-breadcrumb-icon",attrs:{type:s.icon}}):t._e(),e("span",{staticClass:"k-breadcrumb-link-text"},[t._v(" "+t._s(s.text||s.label)+" ")])],1)],1)})),0)],1)}),[],!1,null,null,null,null).exports;const Nn=G({inheritAttrs:!1,props:{autofocus:Boolean,click:Function,current:[String,Boolean],disabled:Boolean,icon:String,id:[String,Number],link:String,responsive:Boolean,rel:String,role:String,target:String,tabindex:String,text:[String,Number],theme:String,tooltip:String,type:{type:String,default:"button"}},computed:{component(){return!0===this.disabled?"k-button-disabled":this.link?"k-button-link":"k-button-native"}},methods:{focus(){this.$refs.button.focus&&this.$refs.button.focus()},tab(){this.$refs.button.tab&&this.$refs.button.tab()},untab(){this.$refs.button.untab&&this.$refs.button.untab()}}},(function(){var t=this;return(0,t._self._c)(t.component,t._g(t._b({ref:"button",tag:"component"},"component",t.$props,!1),t.$listeners),[t.text?[t._v(" "+t._s(t.text)+" ")]:t._t("default")],2)}),[],!1,null,null,null,null).exports;const Fn=G({inheritAttrs:!1,props:{icon:String,id:[String,Number],responsive:Boolean,theme:String,tooltip:String}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-button",attrs:{id:t.id,"data-disabled":!0,"data-responsive":t.responsive,"data-theme":t.theme,title:t.tooltip}},[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports;const qn=G({props:{buttons:Array}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-button-group"},[t.$slots.default?t._t("default"):t._l(t.buttons,(function(s,n){return e("k-button",t._b({key:n},"k-button",s,!1))}))],2)}),[],!1,null,null,null,null).exports;const Rn=G({inheritAttrs:!1,props:{autofocus:Boolean,current:[String,Boolean],icon:String,id:[String,Number],link:String,rel:String,responsive:Boolean,role:String,target:String,tabindex:String,theme:String,tooltip:String},methods:{focus(){this.$el.focus()}}},(function(){var t=this,e=t._self._c;return e("k-link",t._g({staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,rel:t.rel,role:t.role,tabindex:t.tabindex,target:t.target,title:t.tooltip,to:t.link}},t.$listeners),[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports,zn={mounted(){this.$el.addEventListener("keyup",this.onTab,!0),this.$el.addEventListener("blur",this.onUntab,!0)},destroyed(){this.$el.removeEventListener("keyup",this.onTab,!0),this.$el.removeEventListener("blur",this.onUntab,!0)},methods:{focus(){this.$el.focus&&this.$el.focus()},onTab(t){9===t.keyCode&&this.$el.setAttribute("data-tabbed",!0)},onUntab(){this.$el.removeAttribute("data-tabbed")},tab(){this.$el.focus(),this.$el.setAttribute("data-tabbed",!0)},untab(){this.$el.removeAttribute("data-tabbed")}}};const Yn=G({mixins:[zn],inheritAttrs:!1,props:{autofocus:Boolean,click:{type:Function,default:()=>{}},current:[String,Boolean],icon:String,id:[String,Number],responsive:Boolean,role:String,tabindex:String,theme:String,tooltip:String,type:{type:String,default:"button"}}},(function(){var t=this,e=t._self._c;return e("button",t._g({staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,role:t.role,tabindex:t.tabindex,title:t.tooltip,type:t.type},on:{click:t.click}},t.$listeners),[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports;const Hn=G({},(function(){return(0,this._self._c)("span",{staticClass:"k-dropdown",on:{click:function(t){t.stopPropagation()}}},[this._t("default")],2)}),[],!1,null,null,null,null).exports;let Un=null;const Kn=G({props:{align:{type:String,default:"left"},options:[Array,Function,String],theme:{type:String,default:"dark"}},data:()=>({current:-1,dropup:!1,isOpen:!1,items:[]}),methods:{async fetchOptions(t){if(!this.options)return t(this.items);"string"==typeof this.options?this.$dropdown(this.options)(t):"function"==typeof this.options?this.options(t):Array.isArray(this.options)&&t(this.options)},onOptionClick(t){"function"==typeof t.click?t.click.call(this):t.click&&this.$emit("action",t.click)},open(){this.reset(),Un&&Un!==this&&Un.close(),this.fetchOptions((t=>{this.$events.$on("keydown",this.navigate),this.$events.$on("click",this.close),this.items=t,this.isOpen=!0,Un=this,this.onOpen(),this.$emit("open")}))},reset(){this.current=-1,this.$events.$off("keydown",this.navigate),this.$events.$off("click",this.close)},close(){this.reset(),this.isOpen=Un=!1,this.$emit("close")},toggle(){this.isOpen?this.close():this.open()},focus(t=0){var e;const s=null==(e=this.$refs[t+"-item"])?void 0:e[0];(null==s?void 0:s.focus)&&(this.current=t,s.focus())},onOpen(){this.dropup=!1,this.$nextTick((()=>{if(this.$el){let t=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,e=50,s=this.$el.getBoundingClientRect().top||0,n=this.$el.clientHeight;s+n>t-e&&n+2*ethis.items.length-1){const t=this.items.filter((t=>!1===t.disabled));this.current=this.items.indexOf(t[t.length-1]);break}if(this.items[this.current]&&!1===this.items[this.current].disabled){this.focus(this.current);break}}break;case"Tab":for(;;){if(this.current++,this.current>this.items.length-1){this.close(),this.$emit("leave",t.code);break}if(this.items[this.current]&&!1===this.items[this.current].disabled)break}}}}},(function(){var t=this,e=t._self._c;return t.isOpen?e("div",{staticClass:"k-dropdown-content",attrs:{"data-align":t.align,"data-dropup":t.dropup,"data-theme":t.theme}},[t._t("default",(function(){return[t._l(t.items,(function(s,n){return["-"===s?e("hr",{key:n+"separator"}):e("k-dropdown-item",t._b({key:n+"-item",ref:n+"-item",refInFor:!0,on:{click:function(e){return t.onOptionClick(s)}}},"k-dropdown-item",s,!1),[t._v(" "+t._s(s.text)+" ")])]}))]}))],2):t._e()}),[],!1,null,null,null,null).exports;const Vn=G({inheritAttrs:!1,props:{disabled:Boolean,icon:String,image:[String,Object],link:String,target:String,theme:String,upload:String,current:[String,Boolean]},data(){return{listeners:{...this.$listeners,click:t=>{this.$parent.close(),this.$emit("click",t)}}}},methods:{focus(){this.$refs.button.focus()},tab(){this.$refs.button.tab()}}},(function(){var t=this;return(0,t._self._c)("k-button",t._g(t._b({ref:"button",staticClass:"k-dropdown-item"},"k-button",t.$props,!1),t.listeners),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Jn=G({mixins:[zn],props:{disabled:Boolean,rel:String,tabindex:[String,Number],target:String,title:String,to:[String,Function]},data(){return{relAttr:"_blank"===this.target?"noreferrer noopener":this.rel,listeners:{...this.$listeners,click:this.onClick}}},computed:{href(){return"function"==typeof this.to?"":"/"!==this.to[0]||this.target?!0===this.to.includes("@")&&!1===this.to.includes("/")?"mailto:"+this.to:this.to:this.$url(this.to)}},methods:{isRoutable(t){if(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)return!1;if(t.defaultPrevented)return!1;if(void 0!==t.button&&0!==t.button)return!1;if(this.target)return!1;if("string"==typeof this.href){if(this.href.includes("://")||this.href.startsWith("//"))return!1;if(this.href.includes("mailto:"))return!1}return!0},onClick(t){if(!0===this.disabled)return t.preventDefault(),!1;"function"==typeof this.to&&(t.preventDefault(),this.to()),this.isRoutable(t)&&(t.preventDefault(),this.$go(this.to)),this.$emit("click",t)}}},(function(){var t=this,e=t._self._c;return t.to&&!t.disabled?e("a",t._g({ref:"link",staticClass:"k-link",attrs:{href:t.href,rel:t.relAttr,tabindex:t.tabindex,target:t.target,title:t.title}},t.listeners),[t._t("default")],2):e("span",{staticClass:"k-link",attrs:{title:t.title,"data-disabled":""}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Gn=G({computed:{defaultLanguage(){return this.$languages.find((t=>!0===t.default))},language(){return this.$language},languages(){return this.$languages.filter((t=>!1===t.default))}},methods:{change(t){this.$emit("change",t),this.$go(window.location,{query:{language:t.code}})}}},(function(){var t=this,e=t._self._c;return t.languages.length?e("k-dropdown",{staticClass:"k-languages-dropdown"},[e("k-button",{attrs:{text:t.language.name,responsive:!0,icon:"globe"},on:{click:function(e){return t.$refs.languages.toggle()}}}),t.languages?e("k-dropdown-content",{ref:"languages"},[e("k-dropdown-item",{on:{click:function(e){return t.change(t.defaultLanguage)}}},[t._v(" "+t._s(t.defaultLanguage.name)+" ")]),e("hr"),t._l(t.languages,(function(s){return e("k-dropdown-item",{key:s.code,on:{click:function(e){return t.change(s)}}},[t._v(" "+t._s(s.name)+" ")])}))],2):t._e()],1):t._e()}),[],!1,null,null,null,null).exports;const Wn=G({props:{align:{type:String,default:"right"},icon:{type:String,default:"dots"},options:{type:[Array,Function,String],default:()=>[]},text:{type:[Boolean,String],default:!0},theme:{type:String,default:"dark"}},computed:{hasSingleOption(){return Array.isArray(this.options)&&1===this.options.length}},methods:{onAction(t,e,s){"function"==typeof t?t.call(this):(this.$emit("action",t,e,s),this.$emit("option",t,e,s))},toggle(){this.$refs.options.toggle()}}},(function(){var t=this,e=t._self._c;return t.hasSingleOption?e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{icon:t.options[0].icon||t.icon,tooltip:t.options[0].tooltip||t.options[0].text},on:{click:function(e){return t.onAction(t.options[0].option||t.options[0].click,t.options[0],0)}}},[!0===t.text?[t._v(" "+t._s(t.options[0].text)+" ")]:!1!==t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2):t.options.length?e("k-dropdown",{staticClass:"k-options-dropdown"},[e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{icon:t.icon,tooltip:t.$t("options")},on:{click:function(e){return t.$refs.options.toggle()}}},[t.text&&!0!==t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2),e("k-dropdown-content",{ref:"options",staticClass:"k-options-dropdown-content",attrs:{align:t.align,options:t.options},on:{action:t.onAction}})],1):t._e()}),[],!1,null,null,null,null).exports;const Xn=G({props:{align:{type:String,default:"left"},details:{type:Boolean,default:!1},dropdown:{type:Boolean,default:!0},keys:{type:Boolean,default:!1},limit:{type:Number,default:10},page:{type:Number,default:1},pageLabel:{type:String,default:()=>window.panel.$t("pagination.page")},total:{type:Number,default:0},prevLabel:{type:String,default:()=>window.panel.$t("prev")},nextLabel:{type:String,default:()=>window.panel.$t("next")},validate:{type:Function,default:()=>Promise.resolve()}},data(){return{currentPage:this.page}},computed:{show(){return this.pages>1},start(){return(this.currentPage-1)*this.limit+1},end(){let t=this.start-1+this.limit;return t>this.total?this.total:t},detailsText(){return 1===this.limit?this.start+" / ":this.start+"-"+this.end+" / "},pages(){return Math.ceil(this.total/this.limit)},hasPrev(){return this.start>1},hasNext(){return this.endthis.limit},offset(){return this.start-1}},watch:{page(t){this.currentPage=parseInt(t)}},created(){!0===this.keys&&window.addEventListener("keydown",this.navigate,!1)},destroyed(){window.removeEventListener("keydown",this.navigate,!1)},methods:{async goTo(t){try{await this.validate(t),t<1&&(t=1),t>this.pages&&(t=this.pages),this.currentPage=t,this.$refs.dropdown&&this.$refs.dropdown.close(),this.$emit("paginate",{page:this.currentPage,start:this.start,end:this.end,limit:this.limit,offset:this.offset})}catch(e){}},prev(){this.goTo(this.currentPage-1)},next(){this.goTo(this.currentPage+1)},navigate(t){switch(t.code){case"ArrowLeft":this.prev();break;case"ArrowRight":this.next()}}}},(function(){var t=this,e=t._self._c;return t.show?e("nav",{staticClass:"k-pagination",attrs:{"data-align":t.align}},[t.show?e("k-button",{attrs:{disabled:!t.hasPrev,tooltip:t.prevLabel,icon:"angle-left"},on:{click:t.prev}}):t._e(),t.details?[t.dropdown?[e("k-dropdown",[e("k-button",{staticClass:"k-pagination-details",attrs:{disabled:!t.hasPages},on:{click:function(e){return t.$refs.dropdown.toggle()}}},[t.total>1?[t._v(" "+t._s(t.detailsText)+" ")]:t._e(),t._v(" "+t._s(t.total)+" ")],2),e("k-dropdown-content",{ref:"dropdown",staticClass:"k-pagination-selector",on:{open:function(e){t.$nextTick((()=>t.$refs.page.focus()))}}},[e("div",{staticClass:"k-pagination-settings"},[e("label",{attrs:{for:"k-pagination-page"}},[e("span",[t._v(t._s(t.pageLabel)+":")]),e("select",{ref:"page",attrs:{id:"k-pagination-page"}},t._l(t.pages,(function(s){return e("option",{key:s,domProps:{selected:t.page===s,value:s}},[t._v(" "+t._s(s)+" ")])})),0)]),e("k-button",{attrs:{icon:"check"},on:{click:function(e){return t.goTo(t.$refs.page.value)}}})],1)])],1)]:[e("span",{staticClass:"k-pagination-details"},[t.total>1?[t._v(" "+t._s(t.detailsText)+" ")]:t._e(),t._v(" "+t._s(t.total)+" ")],2)]]:t._e(),t.show?e("k-button",{attrs:{disabled:!t.hasNext,tooltip:t.nextLabel,icon:"angle-right"},on:{click:t.next}}):t._e()],2):t._e()}),[],!1,null,null,null,null).exports;const Zn=G({props:{prev:{type:[Boolean,Object],default:!1},next:{type:[Boolean,Object],default:!1}},computed:{buttons(){return[{...this.button(this.prev),icon:"angle-left"},{...this.button(this.next),icon:"angle-right"}]}},methods:{button:t=>t||{disabled:!0,link:"#"}}},(function(){return(0,this._self._c)("k-button-group",{staticClass:"k-prev-next",attrs:{buttons:this.buttons}})}),[],!1,null,null,null,null).exports;const Qn=G({props:{types:{type:Object,default:()=>({})},type:String},data(){return{isLoading:!1,hasResults:!0,items:[],currentType:this.getType(this.type),q:null,selected:-1}},watch:{q(t,e){t!==e&&this.search(this.q)},currentType(t,e){t!==e&&this.search(this.q)},type(){this.currentType=this.getType(this.type)}},created(){this.search=tt(this.search,250),this.$events.$on("keydown.cmd.shift.f",this.open)},destroyed(){this.$events.$off("keydown.cmd.shift.f",this.open)},methods:{changeType(t){this.currentType=this.getType(t),this.$nextTick((()=>{this.$refs.input.focus()}))},close(){this.$refs.overlay.close(),this.hasResults=!0,this.items=[],this.q=null},getType(t){return this.types[t]||this.types[Object.keys(this.types)[0]]},navigate(t){this.$go(t.link),this.close()},onDown(){this.selected=0&&this.select(this.selected-1)},open(){this.$refs.overlay.open()},async search(t){this.isLoading=!0,this.$refs.types&&this.$refs.types.close();try{if(null===t||""===t)throw Error("Empty query");const e=await this.$search(this.currentType.id,t);if(!1===e)throw Error("JSON parsing failed");this.items=e.results}catch(e){this.items=[]}finally{this.select(-1),this.isLoading=!1,this.hasResults=this.items.length>0}},select(t){if(this.selected=t,this.$refs.items){const e=this.$refs.items.$el.querySelectorAll(".k-item");[...e].forEach((t=>delete t.dataset.selected)),t>=0&&(e[t].dataset.selected=!0)}}}},(function(){var t=this,e=t._self._c;return e("k-overlay",{ref:"overlay"},[e("div",{staticClass:"k-search",attrs:{role:"search"}},[e("div",{staticClass:"k-search-input"},[e("k-dropdown",{staticClass:"k-search-types"},[e("k-button",{attrs:{icon:t.currentType.icon,text:t.currentType.label},on:{click:function(e){return t.$refs.types.toggle()}}}),e("k-dropdown-content",{ref:"types"},t._l(t.types,(function(s,n){return e("k-dropdown-item",{key:n,attrs:{icon:s.icon},on:{click:function(e){return t.changeType(n)}}},[t._v(" "+t._s(s.label)+" ")])})),1)],1),e("input",{ref:"input",attrs:{placeholder:t.$t("search")+" …","aria-label":t.$t("search"),autofocus:!0,type:"text"},domProps:{value:t.q},on:{input:function(e){return t.onInput(e.target.value)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.onDown.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.onUp.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:(e.preventDefault(),t.onTab.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onEnter.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.close.apply(null,arguments)}]}}),e("k-button",{staticClass:"k-search-close",attrs:{icon:t.isLoading?"loader":"cancel",tooltip:t.$t("close")},on:{click:t.close}})],1),!t.q||t.hasResults&&!t.items.length?t._e():e("div",{staticClass:"k-search-results"},[t.items.length?e("k-collection",{ref:"items",attrs:{items:t.items},on:{hover:t.onHover},nativeOn:{mouseout:function(e){return t.select(-1)}}}):t.hasResults?t._e():e("p",{staticClass:"k-search-empty"},[t._v(" "+t._s(t.$t("search.results.none"))+" ")])],1)])])}),[],!1,null,null,null,null).exports;const ti=G({props:{removable:Boolean},methods:{remove(){this.removable&&this.$emit("remove")},focus(){this.$refs.button.focus()}}},(function(){var t=this,e=t._self._c;return e("span",{ref:"button",staticClass:"k-tag",attrs:{tabindex:"0"},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:(e.preventDefault(),t.remove.apply(null,arguments))}}},[e("span",{staticClass:"k-tag-text"},[t._t("default")],2),t.removable?e("k-icon",{staticClass:"k-tag-toggle",attrs:{type:"cancel-small"},nativeOn:{click:function(e){return t.remove.apply(null,arguments)}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const ei=G({props:{breadcrumb:Array,license:Boolean,menu:Array,title:String,view:Object},computed:{notification(){return this.$store.state.notification.type&&"error"!==this.$store.state.notification.type?this.$store.state.notification:null}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-topbar"},[e("k-view",[e("div",{staticClass:"k-topbar-wrapper"},[e("k-dropdown",{staticClass:"k-topbar-menu"},[e("k-button",{staticClass:"k-topbar-button k-topbar-menu-button",attrs:{tooltip:t.$t("menu"),icon:"bars"},on:{click:function(e){return t.$refs.menu.toggle()}}},[e("k-icon",{attrs:{type:"angle-down"}})],1),e("k-dropdown-content",{ref:"menu",staticClass:"k-topbar-menu",attrs:{options:t.menu,theme:"light"}})],1),e("k-breadcrumb",{staticClass:"k-topbar-breadcrumb",attrs:{crumbs:t.breadcrumb,view:t.view}}),e("div",{staticClass:"k-topbar-signals"},[t.notification?e("k-button",{staticClass:"k-topbar-notification k-topbar-button",attrs:{text:t.notification.message,theme:"positive"},on:{click:function(e){return t.$store.dispatch("notification/close")}}}):t.license?t._e():e("k-registration"),e("k-form-indicator"),e("k-button",{staticClass:"k-topbar-button",attrs:{tooltip:t.$t("search"),icon:"search"},on:{click:function(e){return t.$refs.search.open()}}})],1)],1)]),e("k-search",{ref:"search",attrs:{type:t.$view.search||"pages",types:t.$searches}})],1)}),[],!1,null,null,null,null).exports,si={install(t){t.component("k-breadcrumb",Pn),t.component("k-button",Nn),t.component("k-button-disabled",Fn),t.component("k-button-group",qn),t.component("k-button-link",Rn),t.component("k-button-native",Yn),t.component("k-dropdown",Hn),t.component("k-dropdown-content",Kn),t.component("k-dropdown-item",Vn),t.component("k-languages-dropdown",Gn),t.component("k-link",Jn),t.component("k-options-dropdown",Wn),t.component("k-pagination",Xn),t.component("k-prev-next",Zn),t.component("k-search",Qn),t.component("k-tag",ti),t.component("k-topbar",ei)}};const ni=G({props:{empty:String,blueprint:String,lock:[Boolean,Object],parent:String,tab:Object},computed:{content(){return this.$store.getters["content/values"]()}},methods:{exists(t){return this.$helper.isComponent(`k-${t}-section`)}}},(function(){var t=this,e=t._self._c;return 0===t.tab.columns.length?e("k-box",{attrs:{html:!0,text:t.empty,theme:"info"}}):e("k-grid",{staticClass:"k-sections",attrs:{gutter:"large"}},t._l(t.tab.columns,(function(s,n){return e("k-column",{key:t.parent+"-column-"+n,attrs:{width:s.width,sticky:s.sticky}},[t._l(s.sections,(function(i,o){return[t.$helper.field.isVisible(i,t.content)?[t.exists(i.type)?e("k-"+i.type+"-section",t._b({key:t.parent+"-column-"+n+"-section-"+o+"-"+t.blueprint,tag:"component",class:"k-section k-section-name-"+i.name,attrs:{column:s.width,lock:t.lock,name:i.name,parent:t.parent,timestamp:t.$view.timestamp},on:{submit:function(e){return t.$emit("submit",e)}}},"component",i,!1)):[e("k-box",{key:t.parent+"-column-"+n+"-section-"+o,attrs:{text:t.$t("error.section.type.invalid",{type:i.type}),theme:"negative"}})]]:t._e()]}))],2)})),1)}),[],!1,null,null,null,null).exports,ii={props:{blueprint:String,lock:[Boolean,Object],help:String,name:String,parent:String,timestamp:Number},methods:{load(){return this.$api.get(this.parent+"/sections/"+this.name)}}};const oi=G({mixins:[ii],inheritAttrs:!1,data:()=>({fields:{},isLoading:!0,issue:null}),computed:{values(){return this.$store.getters["content/values"]()}},watch:{timestamp(){this.fetch()}},created(){this.input=tt(this.input,50),this.fetch()},methods:{input(t,e,s){this.$store.dispatch("content/update",[s,t[s]])},async fetch(){try{const t=await this.load();this.fields=t.fields,Object.keys(this.fields).forEach((t=>{this.fields[t].section=this.name,this.fields[t].endpoints={field:this.parent+"/fields/"+t,section:this.parent+"/sections/"+this.name,model:this.parent}}))}catch(t){this.issue=t}finally{this.isLoading=!1}},onSubmit(t){this.$store.dispatch("content/update",[null,t]),this.$events.$emit("keydown.cmd.s",t)}}},(function(){var t=this,e=t._self._c;return t.isLoading?t._e():e("section",{staticClass:"k-fields-section"},[t.issue?[e("k-headline",{staticClass:"k-fields-issue-headline"},[t._v(" Error ")]),e("k-box",{attrs:{text:t.issue.message,html:!1,theme:"negative"}})]:t._e(),e("k-form",{attrs:{fields:t.fields,validate:!0,value:t.values,disabled:t.lock&&"lock"===t.lock.state},on:{input:t.input,submit:t.onSubmit}})],2)}),[],!1,null,null,null,null).exports;const ri=G({inheritAttrs:!1,props:{blueprint:String,column:String,parent:String,name:String,timestamp:Number},data:()=>({data:[],error:null,isLoading:!1,isProcessing:!1,options:{columns:{},empty:null,headline:null,help:null,layout:"list",link:null,max:null,min:null,size:null,sortable:null},pagination:{page:null},searchterm:null,searching:!1}),computed:{addIcon:()=>"add",buttons(){let t=[];return this.canSearch&&t.push({icon:"filter",text:this.$t("search"),click:this.onSearchToggle,responsive:!0}),this.canAdd&&t.push({icon:this.addIcon,text:this.$t("add"),click:this.onAdd}),t},canAdd:()=>!0,canDrop:()=>!1,canSearch(){return this.options.search},collection(){return{columns:this.options.columns,empty:this.emptyPropsWithSearch,layout:this.options.layout,help:this.options.help,items:this.items,pagination:this.pagination,sortable:!this.isProcessing&&this.options.sortable,size:this.options.size}},emptyProps(){return{icon:"page",text:this.$t("pages.empty")}},emptyPropsWithSearch(){return{...this.emptyProps,text:this.searching?this.$t("search.results.none"):this.options.empty||this.emptyProps.text}},items(){return this.data},isInvalid(){var t;return!((null==(t=this.searchterm)?void 0:t.length)>0)&&(!!(this.options.min&&this.data.lengththis.options.max))},paginationId(){return"kirby$pagination$"+this.parent+"/"+this.name},type:()=>"models"},watch:{searchterm:tt((function(){this.pagination.page=0,this.reload()}),200),timestamp(){this.reload()}},created(){this.load()},methods:{async load(t){t||(this.isLoading=!0),this.isProcessing=!0,null===this.pagination.page&&(this.pagination.page=localStorage.getItem(this.paginationId)||1);try{const t=await this.$api.get(this.parent+"/sections/"+this.name,{page:this.pagination.page,searchterm:this.searchterm});this.options=t.options,this.pagination=t.pagination,this.data=t.data}catch(e){this.error=e.message}finally{this.isProcessing=!1,this.isLoading=!1}},onAction(){},onAdd(){},onChange(){},onDrop(){},onSort(){},onPaginate(t){localStorage.setItem(this.paginationId,t.page),this.pagination=t,this.reload()},onSearchToggle(){this.searching=!this.searching,this.searchterm=null},onUpload(){},async reload(){await this.load(!0)},update(){this.reload(),this.$events.$emit("model.update")}}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("section",{class:`k-models-section k-${t.type}-section`,attrs:{"data-processing":t.isProcessing}},[e("header",{staticClass:"k-section-header"},[e("k-headline",{attrs:{link:t.options.link}},[t._v(" "+t._s(t.options.headline||" ")+" "),t.options.min?e("abbr",{attrs:{title:t.$t("section.required")}},[t._v("*")]):t._e()]),e("k-button-group",{attrs:{buttons:t.buttons}})],1),t.error?e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[e("strong",[t._v(" "+t._s(t.$t("error.section.notLoaded",{name:t.name}))+": ")]),t._v(" "+t._s(t.error)+" ")])],1):[e("k-dropzone",{attrs:{disabled:!t.canDrop},on:{drop:t.onDrop}},[t.searching&&t.options.search?e("k-input",{staticClass:"k-models-section-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",value:t.searchterm,type:"text"},on:{input:function(e){t.searchterm=e},keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.onSearchToggle.apply(null,arguments)}}}):t._e(),e("k-collection",t._g(t._b({attrs:{"data-invalid":t.isInvalid},on:{action:t.onAction,change:t.onChange,sort:t.onSort,paginate:t.onPaginate}},"k-collection",t.collection,!1),t.canAdd?{empty:t.onAdd}:{}))],1),e("k-upload",{ref:"upload",on:{success:t.onUpload,error:t.reload}})]],2):t._e()}),[],!1,null,null,null,null).exports;const li=G({extends:ri,computed:{addIcon:()=>"upload",canAdd(){return this.$permissions.files.create&&!1!==this.options.upload},canDrop(){return!1!==this.canAdd},emptyProps(){return{icon:"image",text:this.$t("files.empty")}},items(){return this.data.map((t=>(t.sortable=this.options.sortable,t.column=this.column,t.options=this.$dropdown(t.link,{query:{view:"list",update:this.options.sortable,delete:this.data.length>this.options.min}}),t.data={"data-id":t.id,"data-template":t.template},t)))},type:()=>"files",uploadProps(){return{...this.options.upload,url:this.$urls.api+"/"+this.options.upload.api}}},created(){this.$events.$on("model.update",this.reload),this.$events.$on("file.sort",this.reload)},destroyed(){this.$events.$off("model.update",this.reload),this.$events.$off("file.sort",this.reload)},methods:{onAction(t,e){"replace"===t&&this.replace(e)},onAdd(){this.canAdd&&this.$refs.upload.open(this.uploadProps)},onDrop(t){this.canAdd&&this.$refs.upload.drop(t,this.uploadProps)},async onSort(t){if(!1===this.options.sortable)return!1;this.isProcessing=!0;try{await this.$api.patch(this.options.apiUrl+"/files/sort",{files:t.map((t=>t.id)),index:this.pagination.offset}),this.$store.dispatch("notification/success",":)"),this.$events.$emit("file.sort")}catch(e){this.reload(),this.$store.dispatch("notification/error",e.message)}finally{this.isProcessing=!1}},onUpload(){this.$events.$emit("file.create"),this.$events.$emit("model.update"),this.$store.dispatch("notification/success",":)")},replace(t){this.$refs.upload.open({url:this.$urls.api+"/"+t.link,accept:"."+t.extension+","+t.mime,multiple:!1})}}},null,null,!1,null,null,null,null).exports;const ai=G({mixins:[ii],data:()=>({label:null,text:null,theme:null}),async created(){const t=await this.load();this.label=t.label,this.text=t.text,this.theme=t.theme||"info"}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-info-section"},[e("k-headline",{staticClass:"k-info-section-label"},[t._v(" "+t._s(t.label)+" ")]),e("k-box",{attrs:{theme:t.theme}},[e("k-text",{attrs:{html:t.text}})],1)],1)}),[],!1,null,null,null,null).exports;const ui=G({extends:ri,computed:{canAdd(){return this.options.add&&this.$permissions.pages.create},items(){return this.data.map((t=>{const e=!1!==t.permissions.changeStatus;return t.flag={status:t.status,tooltip:this.$t("page.status"),disabled:!e,click:()=>this.$dialog(t.link+"/changeStatus")},t.sortable=t.permissions.sort&&this.options.sortable,t.deletable=this.data.length>this.options.min,t.column=this.column,t.options=this.$dropdown(t.link,{query:{view:"list",delete:t.deletable,sort:t.sortable}}),t.data={"data-id":t.id,"data-status":t.status,"data-template":t.template},t}))}},created(){this.$events.$on("page.changeStatus",this.reload),this.$events.$on("page.sort",this.reload)},destroyed(){this.$events.$off("page.changeStatus",this.reload),this.$events.$off("page.sort",this.reload)},methods:{onAdd(){this.canAdd&&this.$dialog("pages/create",{query:{parent:this.options.link||this.parent,view:this.parent,section:this.name}})},async onChange(t){let e=null;if(t.added&&(e="added"),t.moved&&(e="moved"),e){this.isProcessing=!0;const n=t[e].element,i=t[e].newIndex+1+this.pagination.offset;try{await this.$api.pages.changeStatus(n.id,"listed",i),this.$store.dispatch("notification/success",":)"),this.$events.$emit("page.sort",n)}catch(s){this.$store.dispatch("notification/error",{message:s.message,details:s.details}),await this.reload()}finally{this.isProcessing=!1}}}}},null,null,!1,null,null,null,null).exports;const ci=G({mixins:[ii],data:()=>({isLoading:!0,headline:null,reports:null,size:null}),async created(){const t=await this.load();this.isLoading=!1,this.headline=t.headline,this.reports=t.reports,this.size=t.size},methods:{}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("section",{staticClass:"k-stats-section"},[e("header",{staticClass:"k-section-header"},[e("k-headline",[t._v(" "+t._s(t.headline)+" ")])],1),t.reports.length>0?e("k-stats",{attrs:{reports:t.reports,size:t.size}}):e("k-empty",{attrs:{icon:"chart"}},[t._v(" "+t._s(t.empty||t.$t("stats.empty")))])],1):t._e()}),[],!1,null,null,null,null).exports,di={install(t){t.component("k-sections",ni),t.component("k-fields-section",oi),t.component("k-files-section",li),t.component("k-info-section",ai),t.component("k-pages-section",ui),t.component("k-stats-section",ci)}};const pi=G({props:{blueprint:String,next:Object,prev:Object,permissions:{type:Object,default:()=>({})},lock:{type:[Boolean,Object]},model:{type:Object,default:()=>({})},tab:{type:Object,default:()=>({columns:[]})},tabs:{type:Array,default:()=>[]}},computed:{id(){return this.model.link},isLocked(){var t;return"lock"===(null==(t=this.lock)?void 0:t.state)},protectedFields:()=>[]},watch:{"model.id":{handler(){this.content()},immediate:!0}},created(){this.$events.$on("model.reload",this.reload),this.$events.$on("keydown.left",this.toPrev),this.$events.$on("keydown.right",this.toNext)},destroyed(){this.$events.$off("model.reload",this.reload),this.$events.$off("keydown.left",this.toPrev),this.$events.$off("keydown.right",this.toNext)},methods:{content(){this.$store.dispatch("content/create",{id:this.id,api:this.id,content:this.model.content,ignore:this.protectedFields})},async reload(){await this.$reload(),this.content()},toPrev(t){this.prev&&"body"===t.target.localName&&this.$go(this.prev.link)},toNext(t){this.next&&"body"===t.target.localName&&this.$go(this.next.link)}}},null,null,!1,null,null,null,null).exports;const hi=G({extends:pi,computed:{avatarOptions(){return[{icon:"upload",text:this.$t("change"),click:()=>this.$refs.upload.open()},{icon:"trash",text:this.$t("delete"),click:this.deleteAvatar}]},buttons(){return[{icon:"email",text:`${this.$t("email")}: ${this.model.email}`,disabled:!this.permissions.changeEmail||this.isLocked,click:()=>this.$dialog(this.id+"/changeEmail")},{icon:"bolt",text:`${this.$t("role")}: ${this.model.role}`,disabled:!this.permissions.changeRole||this.isLocked,click:()=>this.$dialog(this.id+"/changeRole")},{icon:"globe",text:`${this.$t("language")}: ${this.model.language}`,disabled:!this.permissions.changeLanguage||this.isLocked,click:()=>this.$dialog(this.id+"/changeLanguage")}]},uploadApi(){return this.$urls.api+"/"+this.id+"/avatar"}},methods:{async deleteAvatar(){await this.$api.users.deleteAvatar(this.model.id),this.avatar=null,this.$store.dispatch("notification/success",":)"),this.$reload()},onAvatar(){this.model.avatar?this.$refs.picture.toggle():this.$refs.upload.open()},uploadedAvatar(){this.$store.dispatch("notification/success",":)"),this.$reload()}}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("div",{staticClass:"k-user-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[e("div",{staticClass:"k-user-profile"},[e("k-view",[e("k-dropdown",[e("k-button",{staticClass:"k-user-view-image",attrs:{tooltip:t.$t("avatar"),disabled:t.isLocked},on:{click:t.onAvatar}},[t.model.avatar?e("k-image",{attrs:{cover:!0,src:t.model.avatar,ratio:"1/1"}}):e("k-icon",{attrs:{back:"gray-900",color:"gray-200",type:"user"}})],1),t.model.avatar?e("k-dropdown-content",{ref:"picture",attrs:{options:t.avatarOptions}}):t._e()],1),e("k-button-group",{attrs:{buttons:t.buttons}})],1)],1),e("k-view",[e("k-header",{attrs:{editable:t.permissions.changeName&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[e("k-dropdown",{staticClass:"k-user-view-options"},[e("k-button",{attrs:{disabled:t.isLocked,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)}})],1),e("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[t.model.account?t._e():e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[t.model.name&&0!==t.model.name.length?[t._v(" "+t._s(t.model.name)+" ")]:e("span",{staticClass:"k-user-name-placeholder"},[t._v(" "+t._s(t.$t("name"))+" … ")])],2),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("user.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}}),e("k-upload",{ref:"upload",attrs:{url:t.uploadApi,multiple:!1,accept:"image/*"},on:{success:t.uploadedAvatar}})],1)],1)])}),[],!1,null,null,null,null).exports;const mi=G({extends:hi,prevnext:!1},null,null,!1,null,null,null,null).exports;const fi=G({props:{error:String,layout:String}},(function(){var t=this,e=t._self._c;return e(`k-${t.layout}`,{tag:"component"},[e("k-view",{staticClass:"k-error-view"},[e("div",{staticClass:"k-error-view-content"},[e("k-text",[e("p",[e("k-icon",{staticClass:"k-error-view-icon",attrs:{type:"alert"}})],1),t._t("default",(function(){return[e("p",[t._v(" "+t._s(t.error)+" ")])]}))],2)],1)])],1)}),[],!1,null,null,null,null).exports;const gi=G({extends:pi,props:{preview:Object},methods:{action(t){if("replace"===t)this.$refs.upload.open({url:this.$urls.api+"/"+this.id,accept:"."+this.model.extension+","+this.model.mime,multiple:!1})},onUpload(){this.$store.dispatch("notification/success",":)"),this.$reload()}}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("div",{staticClass:"k-file-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[e("k-file-preview",t._b({},"k-file-preview",t.preview,!1)),e("k-view",{staticClass:"k-file-content"},[e("k-header",{attrs:{editable:t.permissions.changeName&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-file-view-options",attrs:{link:t.preview.url,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}),e("k-dropdown",{staticClass:"k-file-view-options"},[e("k-button",{attrs:{disabled:t.isLocked,responsive:!0,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)},on:{action:t.action}})],1),e("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[t._v(" "+t._s(t.model.filename)+" ")]),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("file.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}}),e("k-upload",{ref:"upload",on:{success:t.onUpload}})],1)],1)])}),[],!1,null,null,null,null).exports;const ki=G({props:{isInstallable:Boolean,isInstalled:Boolean,isOk:Boolean,requirements:Object,translations:Array},data(){return{user:{name:"",email:"",language:this.$translation.code,password:"",role:"admin"}}},computed:{fields(){return{email:{label:this.$t("email"),type:"email",link:!1,autofocus:!0,required:!0},password:{label:this.$t("password"),type:"password",placeholder:this.$t("password")+" …",required:!0},language:{label:this.$t("language"),type:"select",options:this.translations,icon:"globe",empty:!1,required:!0}}},isReady(){return this.isOk&&this.isInstallable},isComplete(){return this.isOk&&this.isInstalled}},methods:{async install(){try{await this.$api.system.install(this.user),await this.$reload({globals:["$system","$translation"]}),this.$store.dispatch("notification/success",this.$t("welcome")+"!")}catch(t){this.$store.dispatch("notification/error",t)}}}},(function(){var t=this,e=t._self._c;return e("k-panel",[e("k-view",{staticClass:"k-installation-view",attrs:{align:"center"}},[t.isComplete?e("k-text",[e("k-headline",[t._v(t._s(t.$t("installation.completed")))]),e("k-link",{attrs:{to:"/login"}},[t._v(" "+t._s(t.$t("login"))+" ")])],1):t.isReady?e("form",{on:{submit:function(e){return e.preventDefault(),t.install.apply(null,arguments)}}},[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("installation"))+" ")]),e("k-fieldset",{attrs:{fields:t.fields,novalidate:!0,value:t.user},on:{input:function(e){t.user=e}}}),e("k-button",{attrs:{text:t.$t("install"),type:"submit",icon:"check"}})],1):e("div",[e("k-headline",[t._v(" "+t._s(t.$t("installation.issues.headline"))+" ")]),e("ul",{staticClass:"k-installation-issues"},[!1===t.isInstallable?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.disabled"))}})],1):t._e(),!1===t.requirements.php?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.php"))}})],1):t._e(),!1===t.requirements.server?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.server"))}})],1):t._e(),!1===t.requirements.mbstring?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.mbstring"))}})],1):t._e(),!1===t.requirements.curl?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.curl"))}})],1):t._e(),!1===t.requirements.accounts?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.accounts"))}})],1):t._e(),!1===t.requirements.content?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.content"))}})],1):t._e(),!1===t.requirements.media?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.media"))}})],1):t._e(),!1===t.requirements.sessions?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.sessions"))}})],1):t._e()]),e("k-button",{attrs:{text:t.$t("retry"),icon:"refresh"},on:{click:t.$reload}})],1)],1)],1)}),[],!1,null,null,null,null).exports;const bi=G({props:{languages:{type:Array,default:()=>[]}},computed:{languagesCollection(){return this.languages.map((t=>({...t,image:{back:"black",color:"gray",icon:"globe"},link:()=>{this.$dialog(`languages/${t.id}/update`)},options:[{icon:"edit",text:this.$t("edit"),click(){this.$dialog(`languages/${t.id}/update`)}},{icon:"trash",text:this.$t("delete"),disabled:t.default&&1!==this.languages.length,click(){this.$dialog(`languages/${t.id}/delete`)}}]})))},primaryLanguage(){return this.languagesCollection.filter((t=>t.default))},secondaryLanguages(){return this.languagesCollection.filter((t=>!1===t.default))}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-languages-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.languages"))+" "),e("k-button-group",{attrs:{slot:"left"},slot:"left"},[e("k-button",{attrs:{text:t.$t("language.create"),icon:"add"},on:{click:function(e){return t.$dialog("languages/create")}}})],1)],1),e("section",{staticClass:"k-languages"},[t.languages.length>0?[e("section",{staticClass:"k-languages-view-section"},[e("header",{staticClass:"k-languages-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("languages.default")))])],1),e("k-collection",{attrs:{items:t.primaryLanguage}})],1),e("section",{staticClass:"k-languages-view-section"},[e("header",{staticClass:"k-languages-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("languages.secondary")))])],1),t.secondaryLanguages.length?e("k-collection",{attrs:{items:t.secondaryLanguages}}):e("k-empty",{attrs:{icon:"globe"},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.secondary.empty"))+" ")])],1)]:0===t.languages.length?[e("k-empty",{attrs:{icon:"globe"},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.empty"))+" ")])]:t._e()],2)],1)],1)}),[],!1,null,null,null,null).exports;const vi=G({components:{"k-login-plugin":window.panel.plugins.login||Lt},props:{methods:Array,pending:Object},data:()=>({issue:""}),computed:{form(){return this.pending.email?"code":"login"},viewClass(){return"code"===this.form?"k-login-code-view":"k-login-view"}},created(){this.$store.dispatch("content/clear")},methods:{async onError(t){null!==t?(!0===t.details.challengeDestroyed&&await this.$reload({globals:["$system"]}),this.issue=t.message):this.issue=null}}},(function(){var t=this,e=t._self._c;return e("k-panel",[e("k-view",{class:t.viewClass,attrs:{align:"center"}},[e("div",[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("login"))+" ")]),t.issue?e("k-login-alert",{on:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),"code"===t.form?e("k-login-code",t._b({on:{error:t.onError}},"k-login-code",t.$props,!1)):e("k-login-plugin",{attrs:{methods:t.methods},on:{error:t.onError}})],1)])],1)}),[],!1,null,null,null,null).exports;const yi=G({extends:pi,props:{status:Object},computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("k-view",{staticClass:"k-page-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[e("k-header",{attrs:{editable:t.permissions.changeTitle&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeTitle")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[t.permissions.preview&&t.model.previewUrl?e("k-button",{staticClass:"k-page-view-preview",attrs:{link:t.model.previewUrl,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}):t._e(),t.status?e("k-status-icon",{attrs:{status:t.model.status,disabled:!t.permissions.changeStatus||t.isLocked,responsive:!0,text:t.status.label},on:{click:function(e){return t.$dialog(t.id+"/changeStatus")}}}):t._e(),e("k-dropdown",{staticClass:"k-page-view-options"},[e("k-button",{attrs:{disabled:!0===t.isLocked,responsive:!0,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)}})],1),e("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[t.model.id?e("k-prev-next",{attrs:{prev:t.prev,next:t.next}}):t._e()]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("page.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)],1)}),[],!1,null,null,null,null).exports;const $i=G({props:{id:String},computed:{view(){return"k-"+this.id+"-plugin-view"}}},(function(){var t=this._self._c;return t("k-inside",[t(this.view,{tag:"component"})],1)}),[],!1,null,null,null,null).exports;const _i=G({data:()=>({isLoading:!1,issue:"",values:{password:null,passwordConfirmation:null}}),computed:{fields(){return{password:{autofocus:!0,label:this.$t("user.changePassword.new"),icon:"key",type:"password"},passwordConfirmation:{label:this.$t("user.changePassword.new.confirm"),icon:"key",type:"password"}}}},mounted(){this.$store.dispatch("title",this.$t("view.resetPassword"))},methods:{async submit(){if(!this.values.password||this.values.password.length<8)return this.issue=this.$t("error.user.password.invalid"),!1;if(this.values.password!==this.values.passwordConfirmation)return this.issue=this.$t("error.user.password.notSame"),!1;this.isLoading=!0;try{await this.$api.users.changePassword(this.$user.id,this.values.password),this.$store.dispatch("notification/success",":)"),this.$go("/")}catch(t){this.issue=t.message}finally{this.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-password-reset-view",attrs:{align:"center"}},[e("k-form",{attrs:{fields:t.fields,"submit-button":t.$t("change"),value:t.values},on:{input:function(e){t.values=e},submit:t.submit},scopedSlots:t._u([{key:"header",fn:function(){return[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("view.resetPassword"))+" ")]),t.issue?e("k-login-alert",{on:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),e("k-user-info",{attrs:{user:t.$user}})]},proxy:!0},{key:"footer",fn:function(){return[e("div",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("change"))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)],1)]},proxy:!0}])})],1)],1)}),[],!1,null,null,null,null).exports;const xi=G({extends:pi,computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("k-view",{staticClass:"k-site-view",attrs:{"data-locked":t.isLocked,"data-id":"/","data-template":"site"}},[e("k-header",{attrs:{editable:t.permissions.changeTitle&&!t.isLocked,tabs:t.tabs,tab:t.tab.name},on:{edit:function(e){return t.$dialog("site/changeTitle")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-site-view-preview",attrs:{link:t.model.previewUrl,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}),e("k-languages-dropdown")],1)]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("site.blueprint"),lock:t.lock,tab:t.tab,parent:"site"},on:{submit:function(e){return t.$emit("submit",e)}}})],1)],1)}),[],!1,null,null,null,null).exports;const wi=G({props:{environment:Array,exceptions:Array,plugins:Array,security:Array,urls:Object},data:()=>({accessible:[]}),computed:{securityIssues(){const t=this.accessible.map((t=>({id:t,text:this.$t("system.issues."+t),link:"https://getkirby.com/security/"+t,icon:"folder"})));return this.security.concat(t).map((t=>({image:{back:"var(--color-red-200)",icon:t.icon||"alert",color:"var(--color-red)"},...t})))}},async created(){this.exceptions.length>0&&(console.info("The following errors occurred during the update check of Kirby and/or plugins:"),this.exceptions.map((t=>console.warn(t))),console.info("End of errors from the update check.")),console.info("Running system health checks for the Panel system view; failed requests in the following console output are expected behavior.");const t=(Promise.allSettled||Promise.all).bind(Promise),e=Object.entries(this.urls).map(this.check);await t(e),console.info(`System health checks ended. ${this.accessible.length} issues with accessible files/folders found (see the security list in the system view).`)},methods:{async check([t,e]){if(!e)return!1;!0===await this.isAccessible(e)&&this.accessible.push(t)},isAccessible:async t=>(await fetch(t,{cache:"no-store"})).status<400,retry(){this.$go(window.location.href)}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-system-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.system"))+" ")]),e("section",{staticClass:"k-system-view-section"},[e("header",{staticClass:"k-system-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("environment")))])],1),e("k-stats",{staticClass:"k-system-info",attrs:{reports:t.environment,size:"medium"}})],1),t.securityIssues.length?e("section",{staticClass:"k-system-view-section"},[e("header",{staticClass:"k-system-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("security")))]),e("k-button",{attrs:{tooltip:t.$t("retry"),icon:"refresh"},on:{click:t.retry}})],1),e("k-items",{attrs:{items:t.securityIssues}})],1):t._e(),t.plugins.length?e("section",{staticClass:"k-system-view-section"},[e("header",{staticClass:"k-system-view-section-header"},[e("k-headline",{attrs:{link:"https://getkirby.com/plugins"}},[t._v(" "+t._s(t.$t("plugins"))+" ")])],1),e("k-table",{attrs:{index:!1,columns:{name:{label:t.$t("name"),type:"url",mobile:!0},author:{label:t.$t("author")},license:{label:t.$t("license")},version:{label:t.$t("version"),type:"update-status",mobile:!0,width:"10rem"}},rows:t.plugins}})],1):t._e()],1)],1)}),[],!1,null,null,null,null).exports;const Si=G({props:{role:Object,roles:Array,search:String,title:String,users:Object},computed:{items(){return this.users.data.map((t=>(t.options=this.$dropdown(t.link),t)))}},methods:{paginate(t){this.$reload({query:{page:t.page}})}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-users-view"},[e("k-header",{scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",{attrs:{buttons:[{disabled:!1===t.$permissions.users.create,text:t.$t("user.create"),icon:"add",click:()=>t.$dialog("users/create")}]}})]},proxy:!0},t.roles.length>1?{key:"right",fn:function(){return[e("k-button-group",[e("k-dropdown",[e("k-button",{attrs:{responsive:!0,text:`${t.$t("role")}: ${t.role?t.role.title:t.$t("role.all")}`,icon:"funnel"},on:{click:function(e){return t.$refs.roles.toggle()}}}),e("k-dropdown-content",{ref:"roles",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{icon:"bolt",link:"/users"}},[t._v(" "+t._s(t.$t("role.all"))+" ")]),e("hr"),t._l(t.roles,(function(s){return e("k-dropdown-item",{key:s.id,attrs:{link:"/users/?role="+s.id,icon:"bolt"}},[t._v(" "+t._s(s.title)+" ")])}))],2)],1)],1)]},proxy:!0}:null],null,!0)},[t._v(" "+t._s(t.$t("view.users"))+" ")]),t.users.data.length>0?[e("k-collection",{attrs:{items:t.items,pagination:t.users.pagination},on:{paginate:t.paginate}})]:0===t.users.pagination.total?[e("k-empty",{attrs:{icon:"users"}},[t._v(" "+t._s(t.$t("role.empty"))+" ")])]:t._e()],2)],1)}),[],!1,null,null,null,null).exports,Ci={install(t){t.component("k-account-view",mi),t.component("k-error-view",fi),t.component("k-file-view",gi),t.component("k-installation-view",ki),t.component("k-languages-view",bi),t.component("k-login-view",vi),t.component("k-page-view",yi),t.component("k-plugin-view",$i),t.component("k-reset-password-view",_i),t.component("k-site-view",xi),t.component("k-system-view",wi),t.component("k-users-view",Si),t.component("k-user-view",hi)}};const Oi=G({computed:{placeholder(){return this.field("code",{}).placeholder},languages(){return this.field("language",{options:[]}).options}},methods:{focus(){this.$refs.code.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-code-editor"},[e("k-input",{ref:"code",attrs:{buttons:!1,placeholder:t.placeholder,spellcheck:!1,value:t.content.code,type:"textarea"},on:{input:function(e){return t.update({code:e})}}}),t.languages.length?e("div",{staticClass:"k-block-type-code-editor-language"},[e("k-icon",{attrs:{type:"code"}}),e("k-input",{ref:"language",attrs:{empty:!1,options:t.languages,value:t.content.language,type:"select"},on:{input:function(e){return t.update({language:e})}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports,Ai=Object.freeze(Object.defineProperty({__proto__:null,default:Oi},Symbol.toStringTag,{value:"Module"}));const Ti=G({},(function(){var t=this;return(0,t._self._c)("k-block-title",{attrs:{content:t.content,fieldset:t.fieldset},on:{dblclick:function(e){return t.$emit("open")}}})}),[],!1,null,null,null,null).exports,Ii=Object.freeze(Object.defineProperty({__proto__:null,default:Ti},Symbol.toStringTag,{value:"Module"}));const ji=G({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop||!1},ratio(){return this.content.ratio||!1}}},(function(){var t=this,e=t._self._c;return e("figure",[e("ul",{on:{dblclick:t.open}},[0===t.content.images.length?t._l(5,(function(s){return e("li",{key:s,staticClass:"k-block-type-gallery-placeholder"},[e("k-aspect-ratio",{attrs:{ratio:t.ratio}})],1)})):t._l(t.content.images,(function(s){return e("li",{key:s.id},[e("k-aspect-ratio",{attrs:{ratio:t.ratio,cover:t.crop}},[e("img",{attrs:{src:s.url,srcset:s.image.srcset,alt:s.alt}})])],1)}))],2),t.content.caption?e("figcaption",[e("k-writer",{attrs:{inline:!0,marks:t.captionMarks,value:t.content.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}})],1):t._e()])}),[],!1,null,null,null,null).exports,Ei=Object.freeze(Object.defineProperty({__proto__:null,default:ji},Symbol.toStringTag,{value:"Module"}));const Mi=G({computed:{textField(){return this.field("text",{marks:!0})}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-heading-input",attrs:{"data-level":t.content.level}},[e("k-writer",{ref:"input",attrs:{inline:!0,marks:t.textField.marks,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}})],1)}),[],!1,null,null,null,null).exports,Li=Object.freeze(Object.defineProperty({__proto__:null,default:Mi},Symbol.toStringTag,{value:"Module"}));const Bi=G({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop||!1},src(){var t;return"web"===this.content.location?this.content.src:!!(null==(t=this.content.image[0])?void 0:t.url)&&this.content.image[0].url},ratio(){return this.content.ratio||!1}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.image.placeholder")+" …","is-empty":!t.src,"empty-icon":"image"},on:{open:t.open,update:t.update}},[t.src?[t.ratio?e("k-aspect-ratio",{attrs:{ratio:t.ratio,cover:t.crop}},[e("img",{attrs:{alt:t.content.alt,src:t.src}})]):e("img",{staticClass:"k-block-type-image-auto",attrs:{alt:t.content.alt,src:t.src}})]:t._e()],2)}),[],!1,null,null,null,null).exports,Di=Object.freeze(Object.defineProperty({__proto__:null,default:Bi},Symbol.toStringTag,{value:"Module"}));const Pi=G({},(function(){return this._self._c,this._m(0)}),[function(){var t=this._self._c;return t("div",[t("hr")])}],!1,null,null,null,null).exports,Ni=Object.freeze(Object.defineProperty({__proto__:null,default:Pi},Symbol.toStringTag,{value:"Module"}));const Fi=G({computed:{marks(){return this.field("text",{}).marks}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-list-input",attrs:{marks:t.marks,value:t.content.text,type:"list"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports,qi=Object.freeze(Object.defineProperty({__proto__:null,default:Fi},Symbol.toStringTag,{value:"Module"}));const Ri=G({computed:{placeholder(){return this.field("text",{}).placeholder}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-markdown-input",attrs:{buttons:!1,placeholder:t.placeholder,spellcheck:!1,value:t.content.text,type:"textarea"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports,zi=Object.freeze(Object.defineProperty({__proto__:null,default:Ri},Symbol.toStringTag,{value:"Module"}));const Yi=G({computed:{citationField(){return this.field("citation",{})},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.text.focus()}}},(function(){var t,e,s=this,n=s._self._c;return n("div",{staticClass:"k-block-type-quote-editor"},[n("k-writer",{ref:"text",staticClass:"k-block-type-quote-text",attrs:{inline:null!=(t=s.textField.inline)&&t,marks:s.textField.marks,placeholder:s.textField.placeholder,value:s.content.text},on:{input:function(t){return s.update({text:t})}}}),n("k-writer",{ref:"citation",staticClass:"k-block-type-quote-citation",attrs:{inline:null==(e=s.citationField.inline)||e,marks:s.citationField.marks,placeholder:s.citationField.placeholder,value:s.content.citation},on:{input:function(t){return s.update({citation:t})}}})],1)}),[],!1,null,null,null,null).exports,Hi=Object.freeze(Object.defineProperty({__proto__:null,default:Yi},Symbol.toStringTag,{value:"Module"}));const Ui=G({inheritAttrs:!1,computed:{columns(){return this.table.columns||this.fields},fields(){return this.table.fields||{}},rows(){return this.content.rows||[]},table(){let t=null;for(const e of Object.values(this.fieldset.tabs))e.fields.rows&&(t=e.fields.rows);return t||{}}}},(function(){var t=this;return(0,t._self._c)("k-table",{staticClass:"k-block-type-table-preview",attrs:{columns:t.columns,empty:t.$t("field.structure.empty"),rows:t.rows},nativeOn:{dblclick:function(e){return t.open.apply(null,arguments)}}})}),[],!1,null,null,null,null).exports,Ki=Object.freeze(Object.defineProperty({__proto__:null,default:Ui},Symbol.toStringTag,{value:"Module"}));const Vi=G({computed:{component(){const t="k-"+this.textField.type+"-input";return this.$helper.isComponent(t)?t:"k-writer"},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this;return(0,t._self._c)(t.component,t._b({ref:"input",tag:"component",staticClass:"k-block-type-text-input",attrs:{value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"component",t.textField,!1))}),[],!1,null,null,null,null).exports,Ji=Object.freeze(Object.defineProperty({__proto__:null,default:Vi},Symbol.toStringTag,{value:"Module"}));const Gi=G({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},video(){return this.$helper.embed.video(this.content.url,!0)}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.video.placeholder")+" …","is-empty":!t.video,"empty-icon":"video"},on:{open:t.open,update:t.update}},[e("k-aspect-ratio",{attrs:{ratio:"16/9"}},[t.video?e("iframe",{attrs:{src:t.video,referrerpolicy:"strict-origin-when-cross-origin"}}):t._e()])],1)}),[],!1,null,null,null,null).exports,Wi=Object.freeze(Object.defineProperty({__proto__:null,default:Gi},Symbol.toStringTag,{value:"Module"}));const Xi=G({inheritAttrs:!1,props:{attrs:[Array,Object],content:[Array,Object],endpoints:Object,fieldset:Object,id:String,isBatched:Boolean,isFull:Boolean,isHidden:Boolean,isLastInBatch:Boolean,isSelected:Boolean,name:String,next:Object,prev:Object,type:String},data:()=>({skipFocus:!1}),computed:{className(){let t=["k-block-type-"+this.type];return this.fieldset.preview!==this.type&&t.push("k-block-type-"+this.fieldset.preview),!1===this.wysiwyg&&t.push("k-block-type-default"),t},customComponent(){return this.wysiwyg?this.wysiwygComponent:"k-block-type-default"},isEditable(){return!1!==this.fieldset.editable},listeners(){return{...this.$listeners,confirmToRemove:this.confirmToRemove,open:this.open}},tabs(){let t=this.fieldset.tabs;return Object.entries(t).forEach((([e,s])=>{Object.entries(s.fields).forEach((([s])=>{t[e].fields[s].section=this.name,t[e].fields[s].endpoints={field:this.endpoints.field+"/fieldsets/"+this.type+"/fields/"+s,section:this.endpoints.section,model:this.endpoints.model}}))})),t},wysiwyg(){return!1!==this.wysiwygComponent},wysiwygComponent(){if(!1===this.fieldset.preview)return!1;let t;return this.fieldset.preview&&(t="k-block-type-"+this.fieldset.preview,this.$helper.isComponent(t))?t:(t="k-block-type-"+this.type,!!this.$helper.isComponent(t)&&t)}},methods:{close(){this.$refs.drawer.close()},confirmToRemove(){this.$refs.removeDialog.open()},focus(){!0!==this.skipFocus&&("function"==typeof this.$refs.editor.focus?this.$refs.editor.focus():this.$refs.container.focus())},onFocusIn(t){var e,s;(null==(s=null==(e=this.$refs.options)?void 0:e.$el)?void 0:s.contains(t.target))||this.$emit("focus",t)},goTo(t){t&&(this.skipFocus=!0,this.close(),this.$nextTick((()=>{t.$refs.container.focus(),t.open(),this.skipFocus=!1})))},open(){var t;null==(t=this.$refs.drawer)||t.open()},remove(){this.$refs.removeDialog.close(),this.$emit("remove",this.id)}}},(function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"k-block-container",class:"k-block-container-type-"+t.type,attrs:{"data-batched":t.isBatched,"data-disabled":t.fieldset.disabled,"data-hidden":t.isHidden,"data-id":t.id,"data-last-in-batch":t.isLastInBatch,"data-selected":t.isSelected,"data-translate":t.fieldset.translate,tabindex:"0"},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),t.$emit("sortDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),t.$emit("sortUp")):null}],focus:function(e){return t.$emit("focus")},focusin:t.onFocusIn}},[e("div",{staticClass:"k-block",class:t.className},[e(t.customComponent,t._g(t._b({ref:"editor",tag:"component"},"component",t.$props,!1),t.listeners))],1),e("k-block-options",t._g({ref:"options",attrs:{"is-batched":t.isBatched,"is-editable":t.isEditable,"is-full":t.isFull,"is-hidden":t.isHidden}},t.listeners)),t.isEditable&&!t.isBatched?e("k-form-drawer",{ref:"drawer",staticClass:"k-block-drawer",attrs:{id:t.id,icon:t.fieldset.icon||"box",tabs:t.tabs,title:t.fieldset.name,value:t.content},on:{close:function(e){return t.focus()},input:function(e){return t.$emit("update",e)}},scopedSlots:t._u([{key:"options",fn:function(){return[t.isHidden?e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"hidden"},on:{click:function(e){return t.$emit("show")}}}):t._e(),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.prev,icon:"angle-left"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.goTo(t.prev)}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.goTo(t.next)}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.confirmToRemove.apply(null,arguments)}}})]},proxy:!0}],null,!1,2211169536)}):t._e(),e("k-remove-dialog",{ref:"removeDialog",attrs:{text:t.$t("field.blocks.delete.confirm")},on:{submit:t.remove}})],1)}),[],!1,null,null,null,null).exports;const Zi=G({components:{"k-block-pasteboard":G({inheritAttrs:!1,computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{close(){this.$refs.dialog.close()},open(){this.$refs.dialog.open()},onPaste(t){this.$emit("paste",t),this.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-block-importer",attrs:{"cancel-button":!1,"submit-button":!1,size:"large"}},[e("label",{attrs:{for:"pasteboard"},domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}}),e("textarea",{attrs:{id:"pasteboard"},on:{paste:function(e){return e.preventDefault(),t.onPaste.apply(null,arguments)}}})])}),[],!1,null,null,null,null).exports},inheritAttrs:!1,props:{autofocus:Boolean,empty:String,endpoints:Object,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},data(){return{isMultiSelectKey:!1,batch:[],blocks:this.value,current:null,isFocussed:!1}},computed:{draggableOptions(){return{id:this._uid,handle:".k-sort-handle",list:this.blocks,move:this.move,delay:10,data:{fieldsets:this.fieldsets,isFull:this.isFull},options:{group:this.group}}},hasFieldsets(){return Object.keys(this.fieldsets).length},isEditing(){return this.$store.state.dialog||this.$store.state.drawers.open.length>0},isEmpty(){return 0===this.blocks.length},isFull(){return null!==this.max&&this.blocks.length>=this.max},selected(){return this.current},selectedOrBatched(){return this.batch.length>0?this.batch:this.selected?[this.selected]:[]}},watch:{value(){this.blocks=this.value}},created(){this.$events.$on("blur",this.onBlur),this.$events.$on("copy",this.copy),this.$events.$on("focus",this.onOutsideFocus),this.$events.$on("keydown",this.onKey),this.$events.$on("keyup",this.onKey),this.$events.$on("paste",this.onPaste)},destroyed(){this.$events.$off("blur",this.onBlur),this.$events.$off("copy",this.copy),this.$events.$off("focus",this.onOutsideFocus),this.$events.$off("keydown",this.onKey),this.$events.$off("keyup",this.onKey),this.$events.$off("paste",this.onPaste)},mounted(){setTimeout((()=>{!0===this.$props.autofocus&&this.focus()}),100)},methods:{append(t,e){if("string"!=typeof t){if(Array.isArray(t)){let s=this.$helper.clone(t).map((t=>(t.id=this.$helper.uuid(),t)));const n=Object.keys(this.fieldsets);if(s=s.filter((t=>n.includes(t.type))),this.max){const t=this.max-this.blocks.length;s=s.slice(0,t)}this.blocks.splice(e,0,...s),this.save()}}else this.add(t,e)},async add(t="text",e){const s=await this.$api.get(this.endpoints.field+"/fieldsets/"+t);this.blocks.splice(e,0,s),this.save(),this.$nextTick((()=>{this.focusOrOpen(s)}))},addToBatch(t){null!==this.selected&&!1===this.batch.includes(this.selected)&&(this.batch.push(this.selected),this.current=null),!1===this.batch.includes(t.id)&&this.batch.push(t.id)},choose(t){if(1===Object.keys(this.fieldsets).length){const e=Object.values(this.fieldsets)[0].type;this.add(e,t)}else this.$refs.selector.open(t)},chooseToConvert(t){this.$refs.selector.open(t,{disabled:[t.type],headline:this.$t("field.blocks.changeType"),event:"convert"})},click(t){this.$emit("click",t)},confirmToRemoveAll(){this.$refs.removeAll.open()},confirmToRemoveSelected(){this.$refs.removeSelected.open()},copy(t){if(!0===this.isEditing)return!1;if(0===this.blocks.length)return!1;if(0===this.selectedOrBatched.length)return!1;if(!0===this.isInputEvent(t))return!1;let e=[];if(this.blocks.forEach((t=>{this.selectedOrBatched.includes(t.id)&&e.push(t)})),0===e.length)return!1;this.$helper.clipboard.write(e,t),t instanceof ClipboardEvent==!1&&(this.batch=this.selectedOrBatched),this.$store.dispatch("notification/success",`${e.length} copied!`)},copyAll(){this.selectAll(),this.copy(),this.deselectAll()},async convert(t,e){var s;const n=this.findIndex(e.id);if(-1===n)return!1;const i=t=>{var e;let s={};for(const n of Object.values(null!=(e=null==t?void 0:t.tabs)?e:{}))s={...s,...n.fields};return s},o=this.blocks[n],r=await this.$api.get(this.endpoints.field+"/fieldsets/"+t),l=this.fieldsets[o.type],a=this.fieldsets[t];if(!a)return!1;let u=r.content;const c=i(a),d=i(l);for(const[p,h]of Object.entries(c)){const t=d[p];(null==t?void 0:t.type)===h.type&&(null==(s=null==o?void 0:o.content)?void 0:s[p])&&(u[p]=o.content[p])}this.blocks[n]={...r,id:o.id,content:u},this.save()},deselectAll(){this.batch=[],this.current=null},async duplicate(t,e){const s={...this.$helper.clone(t),id:this.$helper.uuid()};this.blocks.splice(e+1,0,s),this.save()},fieldset(t){return this.fieldsets[t.type]||{icon:"box",name:t.type,tabs:{content:{fields:{}}},type:t.type}},find(t){return this.blocks.find((e=>e.id===t))},findIndex(t){return this.blocks.findIndex((e=>e.id===t))},focus(t){var e,s,n,i;null==(i=null==(n=this.$refs["block-"+(null!=(s=null==t?void 0:t.id)?s:null==(e=this.blocks[0])?void 0:e.id)])?void 0:n[0])||i.focus()},focusOrOpen(t){this.fieldsets[t.type].wysiwyg?this.focus(t):this.open(t)},hide(t){e(t,"isHidden",!0),this.save()},isBatched(t){return this.batch.includes(t.id)},isInputEvent(){const t=document.querySelector(":focus");return t&&t.matches("input, textarea, [contenteditable], .k-writer")},isLastInBatch(t){const[e]=this.batch.slice(-1);return e&&t.id===e},isOnlyInstance:()=>1===document.querySelectorAll(".k-blocks").length,isSelected(t){return this.selected&&this.selected===t.id},move(t){if(t.from!==t.to){const e=t.draggedContext.element,s=t.relatedContext.component.componentData||t.relatedContext.component.$parent.componentData;if(!1===Object.keys(s.fieldsets).includes(e.type))return!1;if(!0===s.isFull)return!1}return!0},onBlur(){0===this.batch.length&&(this.isMultiSelectKey=!1)},onKey(t){this.isMultiSelectKey=t.metaKey||t.ctrlKey||t.altKey},onOutsideFocus(t){if("function"==typeof t.target.closest&&t.target.closest(".k-dialog"))return;const e=document.querySelector(".k-overlay:last-of-type");if(!1===this.$el.contains(t.target)&&(!e||!1===e.contains(t.target)))return this.select(null);if(e){const e=this.$el.closest(".k-layout-column");if(!1===(null==e?void 0:e.contains(t.target)))return this.select(null)}},onPaste(t){var e;return!0!==this.isInputEvent(t)&&(!0===this.isEditing?!0===(null==(e=this.$refs.selector)?void 0:e.isOpen())&&this.paste(t):(0!==this.selectedOrBatched.length||!0===this.isOnlyInstance())&&this.paste(t))},open(t){this.$refs["block-"+t.id]&&this.$refs["block-"+t.id][0].open()},async paste(t){const e=this.$helper.clipboard.read(t),s=await this.$api.post(this.endpoints.field+"/paste",{html:e});let n=this.selectedOrBatched[this.selectedOrBatched.length-1],i=this.findIndex(n);-1===i&&(i=this.blocks.length),this.append(s,i+1)},pasteboard(){this.$refs.pasteboard.open()},prevNext(t){if(this.blocks[t]){let e=this.blocks[t];if(this.$refs["block-"+e.id])return this.$refs["block-"+e.id][0]}},remove(t){var e;const s=this.findIndex(t.id);-1!==s&&((null==(e=this.selected)?void 0:e.id)===t.id&&this.select(null),this.$delete(this.blocks,s),this.save())},removeAll(){this.batch=[],this.blocks=[],this.save(),this.$refs.removeAll.close()},removeSelected(){this.batch.forEach((t=>{const e=this.findIndex(t);-1!==e&&this.$delete(this.blocks,e)})),this.deselectAll(),this.save(),this.$refs.removeSelected.close()},save(){this.$emit("input",this.blocks)},select(t,e=null){if(e&&this.isMultiSelectKey&&this.onKey(e),t&&this.isMultiSelectKey)return this.addToBatch(t),void(this.current=null);this.batch=[],this.current=t?t.id:null},selectAll(){this.batch=Object.values(this.blocks).map((t=>t.id))},show(t){e(t,"isHidden",!1),this.save()},sort(t,e,s){if(s<0)return;let n=this.$helper.clone(this.blocks);n.splice(e,1),n.splice(s,0,t),this.blocks=n,this.save(),this.$nextTick((()=>{this.focus(t)}))},update(t,s){const n=this.findIndex(t.id);if(-1!==n)for(const i in s)e(this.blocks[n].content,i,s[i]);this.save()}}},(function(){var t=this,e=t._self._c;return e("div",{ref:"wrapper",staticClass:"k-blocks",attrs:{"data-empty":0===t.blocks.length,"data-multi-select-key":t.isMultiSelectKey},on:{focusin:function(e){t.focussed=!0},focusout:function(e){t.focussed=!1}}},[t.hasFieldsets?[e("k-draggable",t._b({staticClass:"k-blocks-list",on:{sort:t.save},scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-empty",{staticClass:"k-blocks-empty",attrs:{icon:"box"},on:{click:function(e){return t.choose(t.blocks.length)}}},[t._v(" "+t._s(t.empty||t.$t("field.blocks.empty"))+" ")])]},proxy:!0}],null,!1,2413899928)},"k-draggable",t.draggableOptions,!1),t._l(t.blocks,(function(s,n){return e("k-block",t._b({key:s.id,ref:"block-"+s.id,refInFor:!0,attrs:{endpoints:t.endpoints,fieldset:t.fieldset(s),"is-batched":t.isBatched(s),"is-last-in-batch":t.isLastInBatch(s),"is-full":t.isFull,"is-hidden":!0===s.isHidden,"is-selected":t.isSelected(s),next:t.prevNext(n+1),prev:t.prevNext(n-1)},on:{append:function(e){return t.append(e,n+1)},blur:function(e){return t.select(null)},choose:function(e){return t.choose(e)},chooseToAppend:function(e){return t.choose(n+1)},chooseToConvert:function(e){return t.chooseToConvert(s)},chooseToPrepend:function(e){return t.choose(n)},copy:function(e){return t.copy()},confirmToRemoveSelected:t.confirmToRemoveSelected,duplicate:function(e){return t.duplicate(s,n)},focus:function(e){return t.select(s)},hide:function(e){return t.hide(s)},paste:function(e){return t.pasteboard()},prepend:function(e){return t.add(e,n)},remove:function(e){return t.remove(s)},sortDown:function(e){return t.sort(s,n,n+1)},sortUp:function(e){return t.sort(s,n,n-1)},show:function(e){return t.show(s)},update:function(e){return t.update(s,e)}},nativeOn:{click:function(e){return e.stopPropagation(),t.select(s,e)}}},"k-block",s,!1))})),1),e("k-block-selector",{ref:"selector",attrs:{fieldsets:t.fieldsets,"fieldset-groups":t.fieldsetGroups},on:{add:t.add,convert:t.convert,paste:function(e){return t.paste(e)}}}),e("k-remove-dialog",{ref:"removeAll",attrs:{text:t.$t("field.blocks.delete.confirm.all")},on:{submit:t.removeAll}}),e("k-remove-dialog",{ref:"removeSelected",attrs:{text:t.$t("field.blocks.delete.confirm.selected")},on:{submit:t.removeSelected}}),e("k-block-pasteboard",{ref:"pasteboard",on:{paste:function(e){return t.paste(e)}}})]:[e("k-box",{attrs:{theme:"info"}},[t._v(" No fieldsets yet ")])]],2)}),[],!1,null,null,null,null).exports;const Qi=G({inheritAttrs:!1,props:{caption:String,captionMarks:[Boolean,Array],cover:{type:Boolean,default:!0},isEmpty:Boolean,emptyIcon:String,emptyText:String,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio||"16/9")}}},(function(){var t=this,e=t._self._c;return e("figure",{staticClass:"k-block-figure"},[t.isEmpty?e("k-button",{staticClass:"k-block-figure-empty",attrs:{icon:t.emptyIcon,text:t.emptyText},on:{click:function(e){return t.$emit("open")}}}):e("span",{staticClass:"k-block-figure-container",on:{dblclick:function(e){return t.$emit("open")}}},[t._t("default")],2),t.caption?e("figcaption",[e("k-writer",{attrs:{inline:!0,marks:t.captionMarks,value:t.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const to=G({props:{isBatched:Boolean,isEditable:Boolean,isFull:Boolean,isHidden:Boolean},methods:{open(){this.$refs.options.open()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown",{staticClass:"k-block-options"},[t.isBatched?[e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("copy"),icon:"template"},on:{click:function(e){return e.preventDefault(),t.$emit("copy")}}}),e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("remove"),icon:"trash"},on:{click:function(e){return e.preventDefault(),t.$emit("confirmToRemoveSelected")}}})]:[t.isEditable?e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("edit"),icon:"edit"},on:{click:function(e){return t.$emit("open")}}}):t._e(),e("k-button",{staticClass:"k-block-options-button",attrs:{disabled:t.isFull,tooltip:t.$t("insert.after"),icon:"add"},on:{click:function(e){return t.$emit("chooseToAppend")}}}),e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("delete"),icon:"trash"},on:{click:function(e){return t.$emit("confirmToRemove")}}}),e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("more"),icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-button",{staticClass:"k-block-options-button k-sort-handle",attrs:{tooltip:t.$t("sort"),icon:"sort"},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.$emit("sortUp"))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.$emit("sortDown"))}]}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"angle-up"},on:{click:function(e){return t.$emit("chooseToPrepend")}}},[t._v(" "+t._s(t.$t("insert.before"))+" ")]),e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"angle-down"},on:{click:function(e){return t.$emit("chooseToAppend")}}},[t._v(" "+t._s(t.$t("insert.after"))+" ")]),e("hr"),t.isEditable?e("k-dropdown-item",{attrs:{icon:"edit"},on:{click:function(e){return t.$emit("open")}}},[t._v(" "+t._s(t.$t("edit"))+" ")]):t._e(),e("k-dropdown-item",{attrs:{icon:"refresh"},on:{click:function(e){return t.$emit("chooseToConvert")}}},[t._v(" "+t._s(t.$t("field.blocks.changeType"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:"template"},on:{click:function(e){return t.$emit("copy")}}},[t._v(" "+t._s(t.$t("copy"))+" ")]),e("k-dropdown-item",{attrs:{icon:"download"},on:{click:function(e){return t.$emit("paste")}}},[t._v(" "+t._s(t.$t("paste.after"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:t.isHidden?"preview":"hidden"},on:{click:function(e){return t.$emit(t.isHidden?"show":"hide")}}},[t._v(" "+t._s(!0===t.isHidden?t.$t("show"):t.$t("hide"))+" ")]),e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"copy"},on:{click:function(e){return t.$emit("duplicate")}}},[t._v(" "+t._s(t.$t("duplicate"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:"trash"},on:{click:function(e){return t.$emit("confirmToRemove")}}},[t._v(" "+t._s(t.$t("delete"))+" ")])],1)]],2)}),[],!1,null,null,null,null).exports;const eo=G({inheritAttrs:!1,props:{endpoint:String,fieldsets:Object,fieldsetGroups:Object},data(){return{dialogIsOpen:!1,disabled:[],headline:null,payload:null,event:"add",groups:this.createGroups()}},computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{add(t){this.$emit(this.event,t,this.payload),this.$refs.dialog.close()},close(){this.$refs.dialog.close()},createGroups(){let t={},e=0;const s=this.fieldsetGroups||{blocks:{label:this.$t("field.blocks.fieldsets.label"),sets:Object.keys(this.fieldsets)}};return Object.keys(s).forEach((n=>{let i=s[n];i.open=!1!==i.open,i.fieldsets=i.sets.filter((t=>this.fieldsets[t])).map((t=>(e++,{...this.fieldsets[t],index:e}))),0!==i.fieldsets.length&&(t[n]=i)})),t},isOpen(){return this.dialogIsOpen},navigate(t){var e,s;null==(s=null==(e=this.$refs["fieldset-"+t])?void 0:e[0])||s.focus()},onClose(){this.dialogIsOpen=!1,this.$events.$off("paste",this.close)},onOpen(){this.dialogIsOpen=!0,this.$events.$on("paste",this.close)},open(t,e={}){const s={event:"add",disabled:[],headline:null,...e};this.event=s.event,this.disabled=s.disabled,this.headline=s.headline,this.payload=t,this.$refs.dialog.open()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-block-selector",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"},on:{open:t.onOpen,close:t.onClose}},[t.headline?e("k-headline",[t._v(" "+t._s(t.headline)+" ")]):t._e(),t._l(t.groups,(function(s,n){return e("details",{key:n,attrs:{open:s.open}},[e("summary",[t._v(t._s(s.label))]),e("div",{staticClass:"k-block-types"},t._l(s.fieldsets,(function(s){return e("k-button",{key:s.name,ref:"fieldset-"+s.index,refInFor:!0,attrs:{disabled:t.disabled.includes(s.type),icon:s.icon||"box",text:s.name},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:t.navigate(s.index-1)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:t.navigate(s.index+1)}],click:function(e){return t.add(s.type)}}})})),1)])})),e("p",{staticClass:"k-clipboard-hint",domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}})],2)}),[],!1,null,null,null,null).exports;const so=G({inheritAttrs:!1,props:{fieldset:Object,content:Object},computed:{icon(){return this.fieldset.icon||"box"},label(){if(!this.fieldset.label||0===this.fieldset.label.length)return!1;if(this.fieldset.label===this.fieldset.name)return!1;const t=this.$helper.string.template(this.fieldset.label,this.content);return"…"!==t&&t},name(){return this.fieldset.name}}},(function(){var t=this,e=t._self._c;return e("div",t._g({staticClass:"k-block-title"},t.$listeners),[e("k-icon",{staticClass:"k-block-icon",attrs:{type:t.icon}}),e("span",{staticClass:"k-block-name"},[t._v(" "+t._s(t.name)+" ")]),t.label?e("span",{staticClass:"k-block-label"},[t._v(" "+t._s(t.label)+" ")]):t._e()],1)}),[],!1,null,null,null,null).exports;const no=G({inheritAttrs:!1,props:{content:[Object,Array],fieldset:Object},methods:{field(t,e=null){let s=null;return Object.values(this.fieldset.tabs).forEach((e=>{e.fields[t]&&(s=e.fields[t])})),s||e},open(){this.$emit("open")},update(t){this.$emit("update",{...this.content,...t})}}},null,null,!1,null,null,null,null).exports,io={install(t){t.component("k-block",Xi),t.component("k-blocks",Zi),t.component("k-block-figure",Qi),t.component("k-block-options",to),t.component("k-block-selector",eo),t.component("k-block-title",so),t.component("k-block-type",no);const e=Object.assign({"./Types/Code.vue":Ai,"./Types/Default.vue":Ii,"./Types/Gallery.vue":Ei,"./Types/Heading.vue":Li,"./Types/Image.vue":Di,"./Types/Line.vue":Ni,"./Types/List.vue":qi,"./Types/Markdown.vue":zi,"./Types/Quote.vue":Hi,"./Types/Table.vue":Ki,"./Types/Text.vue":Ji,"./Types/Video.vue":Wi});for(const s in e){const n=s.match(/\/([a-zA-Z]*)\.vue/)[1].toLowerCase();let i=e[s].default;i.extends=no,t.component("k-block-type-"+n,i)}}},oo={inheritAttrs:!1,props:{column:{type:Object,default:()=>({})},field:Object,value:{}}};const ro=G({mixins:[oo],inheritAttrs:!1,props:{value:[Array,String]},computed:{bubbles(){var t,e;let s=this.value;const n=(null==(t=this.column)?void 0:t.options)||(null==(e=this.field)?void 0:e.options)||[];return"string"==typeof s&&(s=s.split(",")),s.map((t=>{"string"==typeof t&&(t={value:t,text:t});for(const e of n)e.value===t.value&&(t.text=e.text);return{back:"light",color:"black",...t}}))}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bubbles-field-preview",class:t.$options.class},[e("k-bubbles",{attrs:{bubbles:t.bubbles}})],1)}),[],!1,null,null,null,null).exports;const lo=G({extends:ro,inheritAttrs:!1,class:"k-array-field-preview",computed:{bubbles(){return[{text:1===this.value.length?`1 ${this.$t("entry")}`:`${this.value.length} ${this.$t("entries")}`}]}}},null,null,!1,null,null,null,null).exports;const ao=G({mixins:[oo],inheritAttrs:!1,computed:{text(){return this.value}}},(function(){var t=this;return(0,t._self._c)("p",{staticClass:"k-text-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),t._t("default",(function(){return[t._v(t._s(t.text))]})),t._v(" "+t._s(t.column.after)+" ")],2)}),[],!1,null,null,null,null).exports;const uo=G({extends:ao,inheritAttrs:!1,props:{value:String},class:"k-date-field-preview",computed:{text(){var t,e,s,n,i,o;if("string"!=typeof this.value)return"";const r=this.$library.dayjs(this.value);if(!r)return"";let l=(null==(t=this.column)?void 0:t.display)||(null==(e=this.field)?void 0:e.display)||"YYYY-MM-DD",a=(null==(n=null==(s=this.column)?void 0:s.time)?void 0:n.display)||(null==(o=null==(i=this.field)?void 0:i.time)?void 0:o.display);return a&&(l+=" "+a),r.format(l)}}},null,null,!1,null,null,null,null).exports;const co=G({mixins:[oo],props:{value:[String,Object]},computed:{link(){return"object"==typeof this.value?this.value.href:this.value},text(){return"object"==typeof this.value?this.value.text:this.link}}},(function(){var t=this,e=t._self._c;return e("p",{staticClass:"k-url-field-preview",class:t.$options.class,attrs:{"data-link":t.link}},[t._v(" "+t._s(t.column.before)+" "),e("k-link",{attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[t._v(" "+t._s(t.text)+" ")]),t._v(" "+t._s(t.column.after)+" ")],1)}),[],!1,null,null,null,null).exports;const po=G({extends:co,class:"k-email-field-preview"},null,null,!1,null,null,null,null).exports;const ho=G({extends:ro,inheritAttrs:!1,class:"k-files-field-preview",computed:{bubbles(){return this.value.map((t=>({text:t.filename,link:t.link,image:t.image})))}}},null,null,!1,null,null,null,null).exports;const mo=G({mixins:[oo],inheritAttrs:!1,props:{value:Object}},(function(){var t=this;return(0,t._self._c)("k-status-icon",t._b({staticClass:"k-flag-field-preview"},"k-status-icon",t.value,!1))}),[],!1,null,null,null,null).exports;const fo=G({mixins:[oo],inheritAttrs:!1,props:{value:String},computed:{html(){return this.value}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-html-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),e("div",{domProps:{innerHTML:t._s(t.html)}}),t._v(" "+t._s(t.column.after)+" ")])}),[],!1,null,null,null,null).exports;const go=G({mixins:[oo],inheritAttrs:!1,props:{value:[Object]}},(function(){return(0,this._self._c)("k-item-image",{staticClass:"k-image-field-preview",attrs:{image:this.value,layout:"list"}})}),[],!1,null,null,null,null).exports;const ko=G({extends:ro,inheritAttrs:!1,class:"k-object-field-preview",props:{value:[Array,Object]},computed:{bubbles:()=>[{text:"{ ... }"}]}},null,null,!1,null,null,null,null).exports;const bo=G({extends:ro,inheritAttrs:!1,class:"k-pages-field-preview"},null,null,!1,null,null,null,null).exports;const vo=G({extends:ao,inheritAttrs:!1,props:{value:String},class:"k-time-field-preview",computed:{text(){const t=this.$library.dayjs.iso(this.value,"time");return(null==t?void 0:t.format(this.field.display))||""}}},null,null,!1,null,null,null,null).exports;const yo=G({props:{field:Object,value:Boolean,column:Object},computed:{text(){return!1!==this.column.text?this.field.text:null}}},(function(){var t=this;return(0,t._self._c)("k-input",{staticClass:"k-toggle-field-preview",attrs:{text:t.text,value:t.value,type:"toggle"},on:{input:function(e){return t.$emit("input",e)}}})}),[],!1,null,null,null,null).exports;const $o=G({extends:ro,inheritAttrs:!1,class:"k-users-field-preview",computed:{bubble(){return this.value.map((t=>({text:t.username,link:t.link,image:t.image})))}}},null,null,!1,null,null,null,null).exports,_o={install(t){t.component("k-array-field-preview",lo),t.component("k-bubbles-field-preview",ro),t.component("k-date-field-preview",uo),t.component("k-email-field-preview",po),t.component("k-files-field-preview",ho),t.component("k-flag-field-preview",mo),t.component("k-html-field-preview",fo),t.component("k-image-field-preview",go),t.component("k-object-field-preview",ko),t.component("k-pages-field-preview",bo),t.component("k-text-field-preview",ao),t.component("k-toggle-field-preview",yo),t.component("k-time-field-preview",vo),t.component("k-url-field-preview",co),t.component("k-users-field-preview",$o),t.component("k-list-field-preview",fo),t.component("k-writer-field-preview",fo),t.component("k-checkboxes-field-preview",ro),t.component("k-multiselect-field-preview",ro),t.component("k-radio-field-preview",ro),t.component("k-select-field-preview",ro),t.component("k-tags-field-preview",ro),t.component("k-toggles-field-preview",ro)}},xo={install(t){t.use(ut),t.use(pt),t.use(Ks),t.use(bn),t.use(Dn),t.use(si),t.use(di),t.use(Ci),t.use(io),t.use(_o),t.use(B)}};function wo(t){if(void 0!==t)return JSON.parse(JSON.stringify(t))}function So(t,e){for(const s of Object.keys(e))e[s]instanceof Object&&Object.assign(e[s],So(t[s]||{},e[s]));return Object.assign(t||{},e),t}const Co={clone:wo,isEmpty:function(t){return null==t||""===t||("object"==typeof t&&0===Object.keys(t).length&&t.constructor===Object||void 0!==t.length&&0===t.length)},merge:So},Oo=(t,e)=>{localStorage.setItem("kirby$content$"+t,JSON.stringify(e))},Ao={namespaced:!0,state:{current:null,models:{},status:{enabled:!0}},getters:{exists:t=>e=>Object.prototype.hasOwnProperty.call(t.models,e),hasChanges:(t,e)=>t=>{const s=e.model(t).changes;return Object.keys(s).length>0},isCurrent:t=>e=>t.current===e,id:t=>e=>(e=e||t.current,window.panel.$language?e+"?language="+window.panel.$language.code:e),model:(t,e)=>s=>(s=s||t.current,!0===e.exists(s)?t.models[s]:{api:null,originals:{},values:{},changes:{}}),originals:(t,e)=>t=>wo(e.model(t).originals),values:(t,e)=>t=>({...e.originals(t),...e.changes(t)}),changes:(t,e)=>t=>wo(e.model(t).changes)},mutations:{CLEAR(t){Object.keys(t.models).forEach((e=>{t.models[e].changes={}})),Object.keys(localStorage).forEach((t=>{t.startsWith("kirby$content$")&&localStorage.removeItem(t)}))},CREATE(t,[s,n]){if(!n)return!1;let i=t.models[s]?t.models[s].changes:n.changes;e(t.models,s,{api:n.api,originals:n.originals,changes:i||{}})},CURRENT(t,e){t.current=e},MOVE(t,[s,n]){const i=wo(t.models[s]);D(t.models,s),e(t.models,n,i);const o=localStorage.getItem("kirby$content$"+s);localStorage.removeItem("kirby$content$"+s),localStorage.setItem("kirby$content$"+n,o)},REMOVE(t,e){D(t.models,e),localStorage.removeItem("kirby$content$"+e)},REVERT(t,s){t.models[s]&&(e(t.models[s],"changes",{}),localStorage.removeItem("kirby$content$"+s))},STATUS(t,s){e(t.status,"enabled",s)},UPDATE(t,[s,n,i]){if(!t.models[s])return!1;void 0===i&&(i=null),i=wo(i);const o=JSON.stringify(i);JSON.stringify(t.models[s].originals[n])==o?D(t.models[s].changes,n):e(t.models[s].changes,n,i),Oo(s,{api:t.models[s].api,originals:t.models[s].originals,changes:t.models[s].changes})}},actions:{init(t){Object.keys(localStorage).filter((t=>t.startsWith("kirby$content$"))).map((t=>t.split("kirby$content$")[1])).forEach((e=>{const s=localStorage.getItem("kirby$content$"+e);t.commit("CREATE",[e,JSON.parse(s)])})),Object.keys(localStorage).filter((t=>t.startsWith("kirby$form$"))).map((t=>t.split("kirby$form$")[1])).forEach((e=>{const s=localStorage.getItem("kirby$form$"+e);let n=null;try{n=JSON.parse(s)}catch(o){}if(!n||!n.api)return localStorage.removeItem("kirby$form$"+e),!1;const i={api:n.api,originals:n.originals,changes:n.values};t.commit("CREATE",[e,i]),Oo(e,i),localStorage.removeItem("kirby$form$"+e)}))},clear(t){t.commit("CLEAR")},create(t,e){const s=wo(e.content);Array.isArray(e.ignore)&&e.ignore.forEach((t=>delete s[t])),e.id=t.getters.id(e.id);const n={api:e.api,originals:s,changes:{}};t.commit("CREATE",[e.id,n]),t.dispatch("current",e.id)},current(t,e){t.commit("CURRENT",e)},disable(t){t.commit("STATUS",!1)},enable(t){t.commit("STATUS",!0)},move(t,[e,s]){e=t.getters.id(e),s=t.getters.id(s),t.commit("MOVE",[e,s])},remove(t,e){t.commit("REMOVE",e),t.getters.isCurrent(e)&&t.commit("CURRENT",null)},revert(t,e){e=e||t.state.current,t.commit("REVERT",e)},async save(e,s){if(s=s||e.state.current,e.getters.isCurrent(s)&&!1===e.state.status.enabled)return!1;e.dispatch("disable");const n=e.getters.model(s),i={...n.originals,...n.changes};try{await t.$api.patch(n.api,i),e.commit("CREATE",[s,{...n,originals:i}]),e.dispatch("revert",s)}finally{e.dispatch("enable")}},update(t,[e,s,n]){if(n=n||t.state.current,null===e)for(const i in s)t.commit("UPDATE",[n,i,s[i]]);else t.commit("UPDATE",[n,e,s])}}},To={namespaced:!0,state:{open:[]},mutations:{CLOSE(t,e){t.open=e?t.open.filter((t=>t.id!==e)):[]},GOTO(t,e){t.open=t.open.slice(0,t.open.findIndex((t=>t.id===e))+1)},OPEN(t,e){t.open.push(e)}},actions:{close(t,e){t.commit("CLOSE",e)},goto(t,e){t.commit("GOTO",e)},open(t,e){t.commit("OPEN",e)}}},Io={timer:null,namespaced:!0,state:{type:null,message:null,details:null,timeout:null},mutations:{SET(t,e){t.type=e.type,t.message=e.message,t.details=e.details,t.timeout=e.timeout},UNSET(t){t.type=null,t.message=null,t.details=null,t.timeout=null}},actions:{close(t){clearTimeout(this.timer),t.commit("UNSET")},deprecated(t,e){console.warn("Deprecated: "+e)},error(t,e){let s=e;"string"==typeof e&&(s={message:e}),e instanceof Error&&(s={message:e.message},window.panel.$config.debug&&window.console.error(e)),t.dispatch("dialog",{component:"k-error-dialog",props:s},{root:!0}),t.dispatch("close")},open(t,e){t.dispatch("close"),t.commit("SET",e),e.timeout&&(this.timer=setTimeout((()=>{t.dispatch("close")}),e.timeout))},success(t,e){"string"==typeof e&&(e={message:e}),t.dispatch("open",{type:"success",timeout:4e3,...e})}}};t.use(P);const jo=new P.Store({strict:!1,state:{dialog:null,drag:null,fatal:!1,isLoading:!1},mutations:{SET_DIALOG(t,e){t.dialog=e},SET_DRAG(t,e){t.drag=e},SET_FATAL(t,e){t.fatal=e},SET_LOADING(t,e){t.isLoading=e}},actions:{dialog(t,e){t.commit("SET_DIALOG",e)},drag(t,e){t.commit("SET_DRAG",e)},fatal(t,e){!1!==e?(console.error("The JSON response could not be parsed"),window.panel.$config.debug&&console.info(e.html),e.silent||t.commit("SET_FATAL",e.html)):t.commit("SET_FATAL",!1)},isLoading(t,e){t.commit("SET_LOADING",!0===e)},navigate(t){t.dispatch("dialog",null),t.dispatch("drawers/close")}},modules:{content:Ao,drawers:To,notification:Io}}),Eo={install(t){window.panel=window.panel||{},window.onunhandledrejection=t=>{t.preventDefault(),jo.dispatch("notification/error",t.reason)},window.panel.deprecated=t=>{jo.dispatch("notification/deprecated",t)},window.panel.error=t.config.errorHandler=t=>{jo.dispatch("notification/error",t)}}},Mo={install(t){const e=N(),s={$on:e.on,$off:e.off,$emit:e.emit,blur(t){s.$emit("blur",t)},click(t){s.$emit("click",t)},copy(t){s.$emit("copy",t)},dragenter(t){s.entered=t.target,s.prevent(t),s.$emit("dragenter",t)},dragleave(t){s.prevent(t),s.entered===t.target&&s.$emit("dragleave",t)},drop(t){s.prevent(t),s.$emit("drop",t)},entered:null,focus(t){s.$emit("focus",t)},keydown(e){let n=["keydown"];(e.metaKey||e.ctrlKey)&&n.push("cmd"),!0===e.altKey&&n.push("alt"),!0===e.shiftKey&&n.push("shift");let i=t.prototype.$helper.string.lcfirst(e.key);const o={escape:"esc",arrowUp:"up",arrowDown:"down",arrowLeft:"left",arrowRight:"right"};o[i]&&(i=o[i]),!1===["alt","control","shift","meta"].includes(i)&&n.push(i),s.$emit(n.join("."),e),s.$emit("keydown",e)},keyup(t){s.$emit("keyup",t)},online(t){s.$emit("online",t)},offline(t){s.$emit("offline",t)},paste(t){s.$emit("paste",t)},prevent(t){t.stopPropagation(),t.preventDefault()}};document.addEventListener("click",s.click,!1),document.addEventListener("copy",s.copy,!0),document.addEventListener("focus",s.focus,!0),document.addEventListener("paste",s.paste,!0),window.addEventListener("blur",s.blur,!1),window.addEventListener("dragenter",s.dragenter,!1),window.addEventListener("dragexit",s.prevent,!1),window.addEventListener("dragleave",s.dragleave,!1),window.addEventListener("drop",s.drop,!1),window.addEventListener("dragover",s.prevent,!1),window.addEventListener("keydown",s.keydown,!1),window.addEventListener("keyup",s.keyup,!1),window.addEventListener("offline",s.offline),window.addEventListener("online",s.online),t.prototype.$events=s}};class Lo{constructor(t={}){this.options={base:"/",headers:()=>({}),onFatal:()=>{},onFinish:()=>{},onPushState:()=>{},onReplaceState:()=>{},onStart:()=>{},onSwap:()=>{},query:()=>({}),...t},this.state={}}init(t={},e={}){this.options={...this.options,...e},this.setState(t)}arrayToString(t){return!1===Array.isArray(t)?String(t):t.join(",")}body(t){return"object"==typeof t?JSON.stringify(t):t}async fetch(t,e){return fetch(t,e)}async go(t,e){try{const s=await this.request(t,e);return!1!==s&&this.setState(s,e)}catch(s){if(!0!==(null==e?void 0:e.silent))throw s}}query(t={},e={}){let s=new URLSearchParams(e);return"object"!=typeof t&&(t={}),Object.entries(t).forEach((([t,e])=>{null!==e&&s.set(t,e)})),Object.entries(this.options.query()).forEach((([t,e])=>{var n,i;null!==(e=null!=(i=null!=(n=s.get(t))?n:e)?i:null)&&s.set(t,e)})),s}redirect(t){window.location.href=t}reload(t={}){return this.go(window.location.href,{...t,replace:!0})}async request(t="",e={}){var s;const n=!!(e={globals:!1,method:"GET",only:[],query:{},silent:!1,type:"$view",...e}).globals&&this.arrayToString(e.globals),i=this.arrayToString(e.only);this.options.onStart(e);try{const r=this.url(t,e.query);if(new URL(r).origin!==location.origin)return this.redirect(r),!1;const l=await this.fetch(r,{method:e.method,body:this.body(e.body),credentials:"same-origin",cache:"no-store",headers:{...this.options.headers(),"X-Fiber":!0,"X-Fiber-Globals":n,"X-Fiber-Only":i,"X-Fiber-Referrer":(null==(s=this.state.$view)?void 0:s.path)||null,...e.headers}});if(!1===l.headers.has("X-Fiber"))return this.redirect(l.url),!1;const a=await l.text();let u;try{u=JSON.parse(a)}catch(o){return this.options.onFatal({url:r,path:t,options:e,response:l,text:a}),!1}if(!u[e.type])throw Error(`The ${e.type} could not be loaded`);const c=u[e.type];if(c.error)throw Error(c.error);return"$view"===e.type?i.length?So(this.state,u):u:c}finally{this.options.onFinish(e)}}async setState(t,e={}){return"object"==typeof t&&(this.state=wo(t),!0===e.replace||this.url(this.state.$url).href===window.location.href?this.options.onReplaceState(this.state,e):this.options.onPushState(this.state,e),this.options.onSwap(this.state,e),this.state)}url(t="",e={}){return(t="string"==typeof t&&null===t.match(/^https?:\/\//)?new URL(this.options.base+t.replace(/^\//,"")):new URL(t)).search=this.query(e,t.search),t}}const Bo=async function(t){return{cancel:null,submit:null,props:{},...t}},Do=async function(t,e={}){let s=null,n=null;"function"==typeof e?(s=e,e={}):(s=e.submit,n=e.cancel);let i=await this.$fiber.request("dialogs/"+t,{...e,type:"$dialog"});return"object"==typeof i&&(i.submit=s||null,i.cancel=n||null,i)};async function Po(t,e={}){let s=null;if(s="object"==typeof t?await Bo.call(this,t):await Do.call(this,t,e),!s)return!1;if(!s.component||!1===this.$helper.isComponent(s.component))throw Error("The dialog component does not exist");return s.props=s.props||{},this.$store.dispatch("dialog",s),s}function No(t,e={}){return async s=>{const n=await this.$fiber.request("dropdowns/"+t,{...e,type:"$dropdown"});if(!n)return!1;if(!1===Array.isArray(n.options)||0===n.options.length)throw Error("The dropdown is empty");n.options.map((t=>(t.dialog&&(t.click=()=>{const e="string"==typeof t.dialog?t.dialog:t.dialog.url,s="object"==typeof t.dialog?t.dialog:{};return this.$dialog(e,s)}),t))),s(n.options)}}async function Fo(t,e,s={}){return await this.$fiber.request("search/"+t,{query:{query:e},type:"$search",...s})}const qo={install(t){const e=new Lo;t.prototype.$fiber=window.panel.$fiber=e,t.prototype.$dialog=window.panel.$dialog=Po,t.prototype.$dropdown=window.panel.$dropdown=No,t.prototype.$go=window.panel.$go=e.go.bind(e),t.prototype.$reload=window.panel.$reload=e.reload.bind(e),t.prototype.$request=window.panel.$request=e.request.bind(e),t.prototype.$search=window.panel.$search=Fo,t.prototype.$url=window.panel.$url=e.url.bind(e)}};const Ro={read:function(t){if(!t)return null;if("string"==typeof t)return t;if(t instanceof ClipboardEvent){t.preventDefault();const e=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null;if(e)return e.replace(/\u00a0/g," ")}return null},write:function(t,e){if("string"!=typeof t&&(t=JSON.stringify(t,null,2)),e&&e instanceof ClipboardEvent)return e.preventDefault(),e.clipboardData.setData("text/plain",t),!0;const s=document.createElement("textarea");if(s.value=t,document.body.append(s),navigator.userAgent.match(/ipad|ipod|iphone/i)){s.contentEditable=!0,s.readOnly=!0;const t=document.createRange();t.selectNodeContents(s);const e=window.getSelection();e.removeAllRanges(),e.addRange(t),s.setSelectionRange(0,999999)}else s.select();return document.execCommand("copy"),s.remove(),!0}};function zo(t){if("string"==typeof t){if("pattern"===(t=t.toLowerCase()))return"var(--color-gray-800) var(--bg-pattern)";if(!1===t.startsWith("#")&&!1===t.startsWith("var(")){const e="--color-"+t;if(window.getComputedStyle(document.documentElement).getPropertyValue(e))return`var(${e})`}return t}}function Yo(t,e=!1){if(!t.match("youtu"))return!1;let s=null;try{s=new URL(t)}catch(d){return!1}const n=s.pathname.split("/").filter((t=>""!==t)),i=n[0],o=n[1],r="https://"+(!0===e?"www.youtube-nocookie.com":s.host)+"/embed",l=t=>!!t&&null!==t.match(/^[a-zA-Z0-9_-]+$/);let a=s.searchParams,u=null;switch(n.join("/")){case"embed/videoseries":case"playlist":l(a.get("list"))&&(u=r+"/videoseries");break;case"watch":l(a.get("v"))&&(u=r+"/"+a.get("v"),a.has("t")&&a.set("start",a.get("t")),a.delete("v"),a.delete("t"));break;default:s.host.includes("youtu.be")&&l(i)?(u="https://www.youtube.com/embed/"+i,a.has("t")&&a.set("start",a.get("t")),a.delete("t")):"embed"===i&&l(o)&&(u=r+"/"+o)}if(!u)return!1;const c=a.toString();return c.length&&(u+="?"+c),u}function Ho(t,e=!1){let s=null;try{s=new URL(t)}catch(a){return!1}const n=s.pathname.split("/").filter((t=>""!==t));let i=s.searchParams,o=null;switch(!0===e&&i.append("dnt",1),s.host){case"vimeo.com":case"www.vimeo.com":o=n[0];break;case"player.vimeo.com":o=n[1]}if(!o||!o.match(/^[0-9]*$/))return!1;let r="https://player.vimeo.com/video/"+o;const l=i.toString();return l.length&&(r+="?"+l),r}const Uo={youtube:Yo,vimeo:Ho,video:function(t,e=!1){return t.includes("youtu")?Yo(t,e):!!t.includes("vimeo")&&Ho(t,e)}};const Ko={isVisible:function(t,e){if("hidden"===t.type)return!1;if(!t.when)return!0;let s=!0;return Object.keys(t.when).forEach((n=>{e[n.toLowerCase()]!==t.when[n]&&(s=!1)})),s},subfields:function(t,e){let s={};return Object.keys(e).forEach((n=>{let i=e[n];i.section=t.name,i.endpoints={field:t.endpoints.field+"+"+n,section:t.endpoints.section,model:t.endpoints.model},s[n]=i})),s}},Vo=e=>void 0!==t.options.components[e],Jo=t=>!!t.dataTransfer&&(!!t.dataTransfer.types&&(!0===t.dataTransfer.types.includes("Files")&&!1===t.dataTransfer.types.includes("text/plain")));const Go={metaKey:function(){return window.navigator.userAgent.indexOf("Mac")>-1?"cmd":"ctrl"}},Wo=(t="3/2",e="100%",s=!0)=>{const n=String(t).split("/");if(2!==n.length)return e;const i=Number(n[0]),o=Number(n[1]);let r=100;return 0!==i&&0!==o&&(r=s?r/i*o:r/o*i,r=parseFloat(String(r)).toFixed(2)),r+"%"},Xo=t=>{var e=(t=t||{}).desc?-1:1,s=-e,n=/^0/,i=/\s+/g,o=/^\s+|\s+$/g,r=/[^\x00-\x80]/,l=/^0x[0-9a-f]+$/i,a=/(0x[\da-fA-F]+|(^[\+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|\d+)/g,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=t.insensitive?function(t){return function(t){if(t.toLocaleLowerCase)return t.toLocaleLowerCase();return t.toLowerCase()}(""+t).replace(o,"")}:function(t){return(""+t).replace(o,"")};function d(t){return t.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")}function p(t,e){return(!t.match(n)||1===e)&&parseFloat(t)||t.replace(i," ").replace(o,"")||0}return function(t,n){var i=c(t),o=c(n);if(!i&&!o)return 0;if(!i&&o)return s;if(i&&!o)return e;var a=d(i),h=d(o),m=parseInt(i.match(l),16)||1!==a.length&&Date.parse(i),f=parseInt(o.match(l),16)||m&&o.match(u)&&Date.parse(o)||null;if(f){if(mf)return e}for(var g=a.length,k=h.length,b=0,v=Math.max(g,k);b0)return e;if(_<0)return s;if(b===v-1)return 0}else{if(y<$)return s;if(y>$)return e}}return 0}};RegExp.escape=function(t){return t.replace(new RegExp("[-/\\\\^$*+?.()[\\]{}]","gu"),"\\$&")};const Zo={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function Qo(t){return String(t).replace(/[&<>"'`=/]/g,(t=>Zo[t]))}function tr(t,e={}){const s=(t,e={})=>{var n;const i=Qo(t.shift()),o=null!=(n=e[i])?n:null;return null===o?Object.prototype.hasOwnProperty.call(e,i)||"…":0===t.length?o:s(t,o)},n="[{]{1,2}[\\s]?",i="[\\s]?[}]{1,2}";return(t=t.replace(new RegExp(`${n}(.*?)${i}`,"gi"),((t,n)=>s(n.split("."),e)))).replace(new RegExp(`${n}.*${i}`,"gi"),"…")}function er(t){const e=String(t);return e.charAt(0).toUpperCase()+e.slice(1)}const sr={camelToKebab:function(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()},escapeHTML:Qo,hasEmoji:function(t){if("string"!=typeof t)return!1;const e=t.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c\ude32-\ude3a]|[\ud83c\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/i);return null!==e&&null!==e.length},lcfirst:function(t){const e=String(t);return e.charAt(0).toLowerCase()+e.slice(1)},pad:function(t,e=2){t=String(t);let s="";for(;s.length]+)>)/gi,"")},template:tr,ucfirst:er,ucwords:function(t){return String(t).split(/ /g).map((t=>er(t))).join(" ")},unescapeHTML:function(t){for(const e in Zo)t=String(t).replaceAll(Zo[e],e);return t},uuid:function(){let t,e,s="";for(t=0;t<32;t++)e=16*Math.random()|0,8!=t&&12!=t&&16!=t&&20!=t||(s+="-"),s+=(12==t?4:16==t?3&e|8:e).toString(16);return s}},nr=(t,e)=>{const s=Object.assign({url:"/",field:"file",method:"POST",attributes:{},complete:function(){},error:function(){},success:function(){},progress:function(){}},e),n=new FormData;n.append(s.field,t,t.name),s.attributes&&Object.keys(s.attributes).forEach((t=>{n.append(t,s.attributes[t])}));const i=new XMLHttpRequest,o=e=>{if(!e.lengthComputable||!s.progress)return;let n=Math.max(0,Math.min(100,e.loaded/e.total*100));s.progress(i,t,Math.ceil(n))};i.upload.addEventListener("loadstart",o),i.upload.addEventListener("progress",o),i.addEventListener("load",(e=>{let n=null;try{n=JSON.parse(e.target.response)}catch(o){n={status:"error",message:"The file could not be uploaded"}}"error"===n.status?s.error(i,t,n):(s.success(i,t,n),s.progress(i,t,100))})),i.addEventListener("error",(e=>{const n=JSON.parse(e.target.response);s.error(i,t,n),s.progress(i,t,100)})),i.open(s.method,s.url,!0),s.headers&&Object.keys(s.headers).forEach((t=>{const e=s.headers[t];i.setRequestHeader(t,e)})),i.send(n)},ir={install(t){Array.prototype.sortBy=function(e){const s=t.prototype.$helper.sort(),n=e.split(" "),i=n[0],o=n[1]||"asc";return this.sort(((t,e)=>{const n=String(t[i]).toLowerCase(),r=String(e[i]).toLowerCase();return"desc"===o?s(r,n):s(n,r)}))},t.prototype.$helper={clipboard:Ro,clone:Co.clone,color:zo,embed:Uo,isComponent:Vo,isUploadEvent:Jo,debounce:tt,field:Ko,keyboard:Go,object:Co,pad:sr.pad,ratio:Wo,slug:sr.slug,sort:Xo,string:sr,upload:nr,uuid:sr.uuid},t.prototype.$esc=sr.escapeHTML}},or={install(t){t.$t=t.prototype.$t=window.panel.$t=(t,e,s=null)=>{if("string"!=typeof t)return;const n=window.panel.$translation.data[t]||s;return"string"!=typeof n?n:tr(n,e)},t.directive("direction",{inserted(t,e,s){!0!==s.context.disabled?t.dir=s.context.$direction:t.dir=null}})}};F.extend(q),F.extend(((t,e,s)=>{s.interpret=(t,e="date")=>{const n={date:{"YYYY-MM-DD":!0,"YYYY-MM-D":!0,"YYYY-MM-":!0,"YYYY-MM":!0,"YYYY-M-DD":!0,"YYYY-M-D":!0,"YYYY-M-":!0,"YYYY-M":!0,"YYYY-":!0,YYYYMMDD:!0,"MMM DD YYYY":!1,"MMM D YYYY":!1,"MMM DD YY":!1,"MMM D YY":!1,"MMM DD":!1,"MMM D":!1,"DD MMMM YYYY":!1,"DD MMMM YY":!1,"DD MMMM":!1,"D MMMM YYYY":!1,"D MMMM YY":!1,"D MMMM":!1,"DD MMM YYYY":!1,"D MMM YYYY":!1,"DD MMM YY":!1,"D MMM YY":!1,"DD MMM":!1,"D MMM":!1,"DD MM YYYY":!1,"DD M YYYY":!1,"D MM YYYY":!1,"D M YYYY":!1,"DD MM YY":!1,"D MM YY":!1,"DD M YY":!1,"D M YY":!1,YYYY:!0,MMMM:!0,MMM:!0,"DD MM":!1,"DD M":!1,"D MM":!1,"D M":!1,DD:!1,D:!1},time:{"HH:mm:ss a":!1,"HH:mm:ss":!1,"HH:mm a":!1,"HH:mm":!1,"HH a":!1,HH:!1}};if("string"==typeof t&&""!==t)for(const i in n[e]){const o=s(t,i,n[e][i]);if(!0===o.isValid())return o}return null}})),F.extend(((t,e,s)=>{const n=t=>"date"===t?"YYYY-MM-DD":"time"===t?"HH:mm:ss":"YYYY-MM-DD HH:mm:ss";e.prototype.toISO=function(t="datetime"){return this.format(n(t))},s.iso=function(t,e="datetime"){const i=s(t,n(e));return i&&i.isValid()?i:null}})),F.extend(((t,e)=>{e.prototype.merge=function(t,e="date"){let s=this.clone();if(!t||!t.isValid())return this;if("string"==typeof e){const t={date:["year","month","date"],time:["hour","minute","second"]};if(!1===Object.prototype.hasOwnProperty.call(t,e))throw new Error("Invalid merge unit alias");e=t[e]}for(const n of e)s=s.set(n,t.get(n));return s}})),F.extend(((t,e,s)=>{s.pattern=t=>new class{constructor(t,e){this.dayjs=t,this.pattern=e;const s={year:["YY","YYYY"],month:["M","MM","MMM","MMMM"],day:["D","DD"],hour:["h","hh","H","HH"],minute:["m","mm"],second:["s","ss"],meridiem:["a"]};this.parts=this.pattern.split(/\W/).map(((t,e)=>{const n=this.pattern.indexOf(t);return{index:e,unit:Object.keys(s)[Object.values(s).findIndex((e=>e.includes(t)))],start:n,end:n+(t.length-1)}}))}at(t,e=t){const s=this.parts.filter((s=>s.start<=t&&s.end>=e-1));return s[0]?s[0]:this.parts.filter((e=>e.start<=t)).pop()}format(t){return t&&t.isValid()?t.format(this.pattern):null}}(s,t)})),F.extend(((t,e)=>{e.prototype.round=function(t="date",e=1){const s=["second","minute","hour","date","month","year"];if("day"===t&&(t="date"),!1===s.includes(t))throw new Error("Invalid rounding unit");if(["date","month","year"].includes(t)&&1!==e||"hour"===t&&24%e!=0||["second","minute"].includes(t)&&60%e!=0)throw"Invalid rounding size for "+t;let n=this.clone();const i=s.indexOf(t),o=s.slice(0,i),r=o.pop();if(o.forEach((t=>n=n.startOf(t))),r){const e={month:12,date:n.daysInMonth(),hour:24,minute:60,second:60}[r];Math.round(n.get(r)/e)*e===e&&(n=n.add(1,"date"===t?"day":t)),n=n.startOf(t)}return n=n.set(t,Math.round(n.get(t)/e)*e),n}})),F.extend(((t,e,s)=>{e.prototype.validate=function(t,e,n="day"){if(!this.isValid())return!1;if(!t)return!0;t=s.iso(t);const i={min:"isAfter",max:"isBefore"}[e];return this.isSame(t,n)||this[i](t,n)}}));const rr={install(t){t.prototype.$library={autosize:R,dayjs:F}}},lr={install(t){const e={...t.options.components},s={section:ii};for(const[n,i]of Object.entries(window.panel.plugins.components))i.template||i.render||i.extends?("string"==typeof(null==i?void 0:i.extends)&&(e[i.extends]?i.extends=e[i.extends].extend({options:i,components:{...e,...i.components||{}}}):(window.console.warn(`Problem with plugin trying to register component "${n}": cannot extend non-existent component "${i.extends}"`),i.extends=null)),i.template&&(i.render=null),i.mixins&&(i.mixins=i.mixins.map((t=>"string"==typeof t?s[t]:t))),e[n]&&window.console.warn(`Plugin is replacing "${n}"`),t.component(n,i),e[n]=t.options.components[n]):jo.dispatch("notification/error",`Neither template or render method provided nor extending a component when loading plugin component "${n}". The component has not been registered.`);for(const n of window.panel.plugins.use)t.use(n)}};t.config.productionTip=!1,t.config.devtools=!0;const ar=new t({store:jo,created(){window.panel.$vue=window.panel.app=this,window.panel.plugins.created.forEach((t=>t(this))),this.$store.dispatch("content/init")},render:()=>L(J)});t.use(Eo),t.use(ir),t.use(rr),t.use(V,jo),t.use(Mo),t.use(or),t.use(qo),t.use(z),t.use(xo),t.use(lr),ar.$mount("#app"); +import{V as t,s as e,I as s,P as n,S as i,F as o,N as r,a as l,l as a,w as u,c,e as d,t as p,b as h,d as m,f,g,h as k,k as b,D as v,i as y,E as $,j as _,m as w,n as x,T as S,u as C,o as O,p as A,r as T,q as I,v as j,x as E,y as M,z as L,A as B,B as D,C as P,G as N,H as R,J as F,K as q,L as z}from"./vendor.js";const Y=t=>({changeName:async(e,s,n)=>t.patch(e+"/files/"+s+"/name",{name:n}),delete:async(e,s)=>t.delete(e+"/files/"+s),async get(e,s,n){let i=await t.get(e+"/files/"+s,n);return!0===Array.isArray(i.content)&&(i.content={}),i},link(t,e,s){return"/"+this.url(t,e,s)},update:async(e,s,n)=>t.patch(e+"/files/"+s,n),url(t,e,s){let n=t+"/files/"+e;return s&&(n+="/"+s),n}}),H=t=>({async blueprint(e){return t.get("pages/"+this.id(e)+"/blueprint")},async blueprints(e,s){return t.get("pages/"+this.id(e)+"/blueprints",{section:s})},async changeSlug(e,s){return t.patch("pages/"+this.id(e)+"/slug",{slug:s})},async changeStatus(e,s,n){return t.patch("pages/"+this.id(e)+"/status",{status:s,position:n})},async changeTemplate(e,s){return t.patch("pages/"+this.id(e)+"/template",{template:s})},async changeTitle(e,s){return t.patch("pages/"+this.id(e)+"/title",{title:s})},async children(e,s){return t.post("pages/"+this.id(e)+"/children/search",s)},async create(e,s){return null===e||"/"===e?t.post("site/children",s):t.post("pages/"+this.id(e)+"/children",s)},async delete(e,s){return t.delete("pages/"+this.id(e),s)},async duplicate(e,s,n){return t.post("pages/"+this.id(e)+"/duplicate",{slug:s,children:n.children||!1,files:n.files||!1})},async get(e,s){let n=await t.get("pages/"+this.id(e),s);return!0===Array.isArray(n.content)&&(n.content={}),n},id:t=>t.replace(/\//g,"+"),async files(e,s){return t.post("pages/"+this.id(e)+"/files/search",s)},link(t){return"/"+this.url(t)},async preview(t){return(await this.get(this.id(t),{select:"previewUrl"})).previewUrl},async search(e,s){return e?t.post("pages/"+this.id(e)+"/children/search?select=id,title,hasChildren",s):t.post("site/children/search?select=id,title,hasChildren",s)},async update(e,s){return t.patch("pages/"+this.id(e),s)},url(t,e){let s=null===t?"pages":"pages/"+String(t).replace(/\//g,"+");return e&&(s+="/"+e),s}});function U(t){if(void 0!==t)return JSON.parse(JSON.stringify(t))}function K(t,e){for(const s of Object.keys(e))e[s]instanceof Object&&Object.assign(e[s],K(t[s]||{},e[s]));return Object.assign(t||{},e),t}function V(t){return Object.keys(t).reduce(((e,s)=>(e[s.toLowerCase()]=t[s],e)),{})}const J={clone:U,isEmpty:function(t){return null==t||""===t||("object"==typeof t&&0===Object.keys(t).length&&t.constructor===Object||void 0!==t.length&&0===t.length)},merge:K,toLowerKeys:V};const G=t=>({running:0,async request(e,s,n=!1){s=Object.assign(s||{},{credentials:"same-origin",cache:"no-store",headers:{"content-type":"application/json",...V(s.headers??{})}}),t.methodOverwrite&&"GET"!==s.method&&"POST"!==s.method&&(s.headers["x-http-method-override"]=s.method,s.method="POST"),s=t.onPrepare(s);const i=e+"/"+JSON.stringify(s);t.onStart(i,n),this.running++;try{const n=await fetch([t.endpoint,e].join(t.endpoint.endsWith("/")||e.startsWith("/")?"":"/"),s),o=await async function(t){const e=await t.text();let s;try{s=JSON.parse(e)}catch(n){return window.panel.$vue.$api.onParserError({html:e}),!1}return s}(n);if(n.status<200||n.status>299)throw o;if("error"===o.status)throw o;let r=o;return o.data&&"model"===o.type&&(r=o.data),this.running--,t.onComplete(i),t.onSuccess(o),r}catch(o){if(this.running--,t.onComplete(i),!1!==t.onError(o))throw o;return{}}},async get(t,e,s,n=!1){return e&&(t+="?"+Object.keys(e).filter((t=>void 0!==e[t]&&null!==e[t])).map((t=>t+"="+e[t])).join("&")),this.request(t,Object.assign(s||{},{method:"GET"}),n)},async post(t,e,s,n="POST",i=!1){return this.request(t,Object.assign(s||{},{method:n,body:JSON.stringify(e)}),i)},async patch(t,e,s,n=!1){return this.post(t,e,s,"PATCH",n)},async delete(t,e,s,n=!1){return this.post(t,e,s,"DELETE",n)}}),W=t=>({blueprint:async e=>t.get("users/"+e+"/blueprint"),blueprints:async(e,s)=>t.get("users/"+e+"/blueprints",{section:s}),changeEmail:async(e,s)=>t.patch("users/"+e+"/email",{email:s}),changeLanguage:async(e,s)=>t.patch("users/"+e+"/language",{language:s}),changeName:async(e,s)=>t.patch("users/"+e+"/name",{name:s}),changePassword:async(e,s)=>t.patch("users/"+e+"/password",{password:s}),changeRole:async(e,s)=>t.patch("users/"+e+"/role",{role:s}),create:async e=>t.post("users",e),delete:async e=>t.delete("users/"+e),deleteAvatar:async e=>t.delete("users/"+e+"/avatar"),link(t,e){return"/"+this.url(t,e)},async list(e){return t.post(this.url(null,"search"),e)},get:async(e,s)=>t.get("users/"+e,s),async roles(e){return(await t.get(this.url(e,"roles"))).data.map((t=>({info:t.description||`(${window.panel.$t("role.description.placeholder")})`,text:t.title,value:t.name})))},search:async e=>t.post("users/search",e),update:async(e,s)=>t.patch("users/"+e,s),url(t,e){let s=t?"users/"+t:"users";return e&&(s+="/"+e),s}}),X={install(t,e){t.prototype.$api=t.$api=((t={})=>{const e={...{endpoint:"/api",methodOverwrite:!0,onPrepare:t=>t,onStart(){},onComplete(){},onSuccess(){},onParserError(){},onError(t){throw window.console.log(t.message),t}},...t.config||{}};let s={...e,...G(e),...t};return s.auth=(t=>({async login(e){const s={long:e.remember||!1,email:e.email,password:e.password};return t.post("auth/login",s)},logout:async()=>t.post("auth/logout"),ping:async()=>t.post("auth/ping"),user:async e=>t.get("auth",e),verifyCode:async e=>t.post("auth/code",{code:e})}))(s),s.files=Y(s),s.languages=(t=>({create:async e=>t.post("languages",e),delete:async e=>t.delete("languages/"+e),get:async e=>t.get("languages/"+e),list:async()=>t.get("languages"),update:async(e,s)=>t.patch("languages/"+e,s)}))(s),s.pages=H(s),s.roles=(t=>({list:async e=>t.get("roles",e),get:async e=>t.get("roles/"+e)}))(s),s.system=(t=>({get:async(e={view:"panel"})=>t.get("system",e),install:async e=>(await t.post("system/install",e)).user,register:async e=>t.post("system/register",e)}))(s),s.site=(t=>({blueprint:async()=>t.get("site/blueprint"),blueprints:async()=>t.get("site/blueprints"),changeTitle:async e=>t.patch("site/title",{title:e}),children:async e=>t.post("site/children/search",e),get:async(e={view:"panel"})=>t.get("site",e),update:async e=>t.post("site",e)}))(s),s.translations=(t=>({list:async()=>t.get("translations"),get:async e=>t.get("translations/"+e)}))(s),s.users=W(s),s})({config:{endpoint:window.panel.$urls.api,onComplete:s=>{t.$api.requests=t.$api.requests.filter((t=>t!==s)),0===t.$api.requests.length&&e.dispatch("isLoading",!1)},onError:e=>{if(403===e.code&&("Unauthenticated"===e.message||"access.panel"===e.key))return t.prototype.$go("/logout"),!1;window.panel.$config.debug&&window.console.error(e)},onParserError:({html:t,silent:s})=>{e.dispatch("fatal",{html:t,silent:s})},onPrepare:t=>(window.panel.$language&&(t.headers["x-language"]=window.panel.$language.code),t.headers["x-csrf"]=window.panel.$system.csrf,t),onStart:(s,n=!1)=>{!1===n&&e.dispatch("isLoading",!0),t.$api.requests.push(s)},onSuccess:()=>{clearInterval(t.$api.ping),t.$api.ping=setInterval(t.$api.auth.ping,3e5)}},ping:null,requests:[]}),t.$api.ping=setInterval(t.$api.auth.ping,3e5)}},Z={name:"Fiber",data:()=>({component:null,state:window.fiber,key:null}),created(){this.$fiber.init(this.state,{base:document.querySelector("base").href,headers:()=>({"X-CSRF":this.state.$system.csrf}),onFatal({text:t,options:e}){this.$store.dispatch("fatal",{html:t,silent:e.silent})},onFinish:()=>{0===this.$api.requests.length&&this.$store.dispatch("isLoading",!1)},onPushState:t=>{window.history.pushState(t,"",t.$url)},onReplaceState:t=>{window.history.replaceState(t,"",t.$url)},onStart:({silent:t})=>{!0!==t&&this.$store.dispatch("isLoading",!0)},onSwap:async(t,e)=>{e={navigate:!0,replace:!1,...e},this.setGlobals(t),this.setTitle(t),this.setTranslation(t),this.component=t.$view.component,this.state=t,this.key=!0===e.replace?this.key:t.$view.timestamp,!0===e.navigate&&this.navigate()},query:()=>{var t;return{language:null==(t=this.state.$language)?void 0:t.code}}}),window.addEventListener("popstate",this.$reload)},methods:{navigate(){this.$store.dispatch("navigate")},setGlobals(e){["$config","$direction","$language","$languages","$license","$menu","$multilang","$permissions","$searches","$system","$translation","$urls","$user","$view"].forEach((s=>{void 0!==e[s]?t.prototype[s]=window.panel[s]=e[s]:t.prototype[s]=e[s]=window.panel[s]}))},setTitle(t){t.$view.title?document.title=t.$view.title+" | "+t.$system.title:document.title=t.$system.title},setTranslation(t){t.$translation&&(document.documentElement.lang=t.$translation.code)}},render(t){if(this.component)return t(this.component,{key:this.key,props:this.state.$view.props})}};function Q(t,e,s,n,i,o,r,l){var a,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=s,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),r?(a=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},u._ssrRegister=a):i&&(a=l?function(){i.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:i),a)if(u.functional){u._injectStyles=a;var c=u.render;u.render=function(t,e){return a.call(e),c(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,a):[a]}return{exports:t,options:u}}const tt=Q({props:{autofocus:{type:Boolean,default:!0},cancelButton:{type:[String,Boolean],default:!0},disabled:Boolean,icon:{type:String,default:"check"},size:{type:String,default:"default"},submitButton:{type:[String,Boolean],default:!0},theme:String,visible:Boolean},data:()=>({notification:null}),computed:{buttons(){let t=[];return this.cancelButton&&t.push({icon:"cancel",text:this.cancelButtonLabel,class:"k-dialog-button-cancel",click:this.cancel}),this.submitButtonConfig&&t.push({icon:this.icon,text:this.submitButtonLabel,theme:this.theme,class:"k-dialog-button-submit",click:this.submit,disabled:this.disabled}),t},cancelButtonLabel(){return!1!==this.cancelButton&&(!0===this.cancelButton||0===this.cancelButton.length?this.$t("cancel"):this.cancelButton)},submitButtonConfig(){return void 0!==this.$attrs.button?this.$attrs.button:void 0===this.submitButton||this.submitButton},submitButtonLabel(){return!0===this.submitButton||0===this.submitButton.length?this.$t("confirm"):this.submitButton}},created(){this.$events.$on("keydown.esc",this.close,!1)},destroyed(){this.$events.$off("keydown.esc",this.close,!1)},mounted(){this.visible&&this.$nextTick(this.open)},methods:{onOverlayClose(){this.notification=null,this.$emit("close"),this.$events.$off("keydown.esc",this.close),this.$store.dispatch("dialog",!1)},open(){this.$store.state.dialog||this.$store.dispatch("dialog",!0),this.notification=null,this.$refs.overlay.open(),this.$emit("open"),this.$events.$on("keydown.esc",this.close)},close(){this.$refs.overlay&&this.$refs.overlay.close()},cancel(){this.$emit("cancel"),this.close()},focus(){var t;if(null==(t=this.$refs.dialog)?void 0:t.querySelector){const t=this.$refs.dialog.querySelector(".k-dialog-button-cancel");"function"==typeof(null==t?void 0:t.focus)&&t.focus()}},error(t){this.notification={message:t,type:"error"}},submit(){this.$emit("submit")},success(t){this.notification={message:t,type:"success"}}}},(function(){var t=this,e=t._self._c;return e("k-overlay",{ref:"overlay",attrs:{autofocus:t.autofocus,centered:!0},on:{close:t.onOverlayClose,ready:function(e){return t.$emit("ready")}}},[e("div",{ref:"dialog",staticClass:"k-dialog",class:t.$vnode.data.staticClass,attrs:{"data-size":t.size},on:{mousedown:function(t){t.stopPropagation()}}},[t.notification?e("div",{staticClass:"k-dialog-notification",attrs:{"data-theme":t.notification.type}},[e("p",[t._v(t._s(t.notification.message))]),e("k-button",{attrs:{icon:"cancel"},on:{click:function(e){t.notification=null}}})],1):t._e(),e("div",{staticClass:"k-dialog-body scroll-y-auto"},[t._t("default")],2),t.$slots.footer||t.buttons.length?e("footer",{staticClass:"k-dialog-footer"},[t._t("footer",(function(){return[e("k-button-group",{attrs:{buttons:t.buttons}})]}))],2):t._e()])])}),[],!1,null,null,null,null).exports,et={props:{autofocus:{type:Boolean,default:!0},cancelButton:{type:[String,Boolean],default:!0},icon:String,submitButton:{type:[String,Boolean],default:!0},size:String,theme:String,visible:Boolean},methods:{close(){this.$refs.dialog.close(),this.$emit("close")},error(t){this.$refs.dialog.error(t)},open(){this.$refs.dialog.open(),this.$emit("open")},success(t){this.$refs.dialog.close(),t.route&&this.$go(t.route),t.message&&this.$store.dispatch("notification/success",t.message),t.event&&("string"==typeof t.event&&(t.event=[t.event]),t.event.forEach((e=>{this.$events.$emit(e,t)}))),!1!==Object.prototype.hasOwnProperty.call(t,"emit")&&!1===t.emit||this.$emit("success")}}};const st=Q({mixins:[et],props:{details:[Object,Array],message:String,size:{type:String,default:"medium"}},computed:{detailsList(){return Array.isArray(this.details)?this.details:Object.values(this.details||{})}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-error-dialog",attrs:{"cancel-button":!1,size:t.size,visible:!0},on:{cancel:function(e){return t.$emit("cancel")},close:function(e){return t.$emit("close")},submit:function(e){return t.$refs.dialog.close()}}},[e("k-text",[t._v(t._s(t.message))]),t.detailsList.length?e("dl",{staticClass:"k-error-details"},[t._l(t.detailsList,(function(s,n){return[e("dt",{key:"detail-label-"+n},[t._v(" "+t._s(s.label)+" ")]),e("dd",{key:"detail-message-"+n},["object"==typeof s.message?[e("ul",t._l(s.message,(function(s,n){return e("li",{key:n},[t._v(" "+t._s(s)+" ")])})),0)]:[t._v(" "+t._s(s.message)+" ")]],2)]}))],2):t._e()],1)}),[],!1,null,null,null,null).exports;const nt=Q({props:{code:Number,component:String,path:String,props:Object,referrer:String},data:()=>({isProcessing:!1}),methods:{close(){this.$refs.dialog.close()},onCancel(){"function"==typeof this.$store.state.dialog.cancel&&this.$store.state.dialog.cancel({dialog:this})},async onSubmit(t){if(!0===this.isProcessing)return!1;let e=null;this.isProcessing=!0;try{if("function"==typeof this.$store.state.dialog.submit)e=await this.$store.state.dialog.submit({dialog:this,value:t});else{if(!this.path)throw"The dialog needs a submit action or a dialog route path to be submitted";e=await this.$request(this.path,{body:t,method:"POST",type:"$dialog",headers:{"X-Fiber-Referrer":this.referrer}})}if(!1===e)return!1;this.$refs.dialog.success(e),e.dispatch&&Object.keys(e.dispatch).forEach((t=>{const s=e.dispatch[t];this.$store.dispatch(t,!0===Array.isArray(s)?[...s]:s)})),e.redirect?this.$go(e.redirect):this.$reload(e.reload||{})}catch(s){this.$refs.dialog.error(s)}finally{this.isProcessing=!1}}}},(function(){var t=this;return(0,t._self._c)(t.component,t._b({ref:"dialog",tag:"component",attrs:{disabled:t.isProcessing,visible:!0},on:{cancel:t.onCancel,submit:t.onSubmit}},"component",t.props,!1))}),[],!1,null,null,null,null).exports,it=(t,e)=>{let s=null;return function(){clearTimeout(s),s=setTimeout((()=>t.apply(this,arguments)),e)}},ot={data:()=>({models:[],issue:null,selected:{},options:{endpoint:null,max:null,multiple:!0,parent:null,selected:[],search:!0},search:null,pagination:{limit:20,page:1,total:0}}),computed:{checkedIcon(){return!0===this.multiple?"check":"circle-filled"},collection(){return{empty:this.emptyProps,items:this.items,link:!1,layout:"list",pagination:{details:!0,dropdown:!1,align:"center",...this.pagination},sortable:!1}},items(){return this.models.map(this.item)},multiple(){return!0===this.options.multiple&&1!==this.options.max}},watch:{search(){this.updateSearch()}},created(){this.updateSearch=it(this.updateSearch,200)},methods:{async fetch(){const t={page:this.pagination.page,search:this.search,...this.fetchData||{}};try{const e=await this.$api.get(this.options.endpoint,t);this.models=e.data,this.pagination=e.pagination,this.onFetched&&this.onFetched(e)}catch(e){this.models=[],this.issue=e.message}},async open(t,s){this.pagination.page=0,this.search=null;let n=!0;Array.isArray(t)?(this.models=t,n=!1):(this.models=[],s=t),this.options={...this.options,...s},this.selected={},this.options.selected.forEach((t=>{e(this.selected,t,{id:t})})),n&&await this.fetch(),this.$refs.dialog.open()},paginate(t){this.pagination.page=t.page,this.pagination.limit=t.limit,this.fetch()},submit(){this.$emit("submit",Object.values(this.selected)),this.$refs.dialog.close()},isSelected(t){return void 0!==this.selected[t.id]},item:t=>t,toggle(t){!1!==this.options.multiple&&1!==this.options.max||(this.selected={}),!0!==this.isSelected(t)?this.options.max&&this.options.max<=Object.keys(this.selected).length||e(this.selected,t.id,t):this.$delete(this.selected,t.id)},toggleBtn(t){const e=this.isSelected(t);return{icon:e?this.checkedIcon:"circle-outline",tooltip:e?this.$t("remove"):this.$t("select"),theme:e?"positive":null}},updateSearch(){this.pagination.page=0,this.fetch()}}};const rt=Q({mixins:[ot],computed:{emptyProps(){return{icon:"image",text:this.$t("dialog.files.empty")}}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-files-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[e("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.options.search?e("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",value:t.search,type:"text",icon:"search"},on:{input:function(e){t.search=e}}}):t._e(),e("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:s}){return[e("k-button",t._b({on:{click:function(e){return t.toggle(s)}}},"k-button",t.toggleBtn(s),!1))]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,null,null,null,null).exports;const lt=Q({mixins:[et],props:{disabled:Boolean,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!0},size:{type:String,default:"medium"},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("save")},text:{type:String},theme:{type:String,default:"positive"},value:{type:Object,default:()=>({})}},data(){return{model:this.value}},computed:{hasFields(){return Object.keys(this.fields).length>0}},watch:{value(t){this.model=t}},methods:{onInput(t){this.model=t,this.$emit("input",t)},onSubmit(t){this.$emit("submit",t)}}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._b({ref:"dialog",on:{cancel:function(e){return t.$emit("cancel")},close:function(e){return t.$emit("close")},ready:function(e){return t.$emit("ready")},submit:function(e){return t.$refs.form.submit()}}},"k-dialog",t.$props,!1),[t.text?[e("k-text",{attrs:{html:t.text}})]:t._e(),t.hasFields?e("k-form",{ref:"form",attrs:{value:t.model,fields:t.fields,novalidate:t.novalidate},on:{input:t.onInput,submit:t.onSubmit}}):e("k-box",{attrs:{theme:"negative"}},[t._v(" This form dialog has no fields ")])],2)}),[],!1,null,null,null,null).exports;const at=Q({extends:lt,watch:{"model.name"(t){this.fields.code.disabled||this.onNameChanges(t)},"model.code"(t){this.fields.code.disabled||(this.model.code=this.$helper.slug(t,[this.$system.ascii]),this.onCodeChanges(this.model.code))}},methods:{onCodeChanges(t){if(!t)return this.model.locale=null;if(t.length>=2)if(-1!==t.indexOf("-")){let e=t.split("-"),s=[e[0],e[1].toUpperCase()];this.model.locale=s.join("_")}else{let e=this.$system.locales||[];(null==e?void 0:e[t])?this.model.locale=e[t]:this.model.locale=null}},onNameChanges(t){this.model.code=this.$helper.slug(t,[this.model.rules,this.$system.ascii]).substr(0,2)}}},null,null,!1,null,null,null,null).exports;const ut=Q({mixins:[ot],data(){const t=ot.data();return{...t,model:{title:null,parent:null},options:{...t.options,parent:null}}},computed:{emptyProps(){return{icon:"page",text:this.$t("dialog.pages.empty")}},fetchData(){return{parent:this.options.parent}}},methods:{back(){this.options.parent=this.model.parent,this.pagination.page=1,this.fetch()},go(t){this.options.parent=t.id,this.pagination.page=1,this.fetch()},onFetched(t){this.model=t.model}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-pages-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[e("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.model?e("header",{staticClass:"k-pages-dialog-navbar"},[e("k-button",{attrs:{disabled:!t.model.id,tooltip:t.$t("back"),icon:"angle-left"},on:{click:t.back}}),e("k-headline",[t._v(t._s(t.model.title))])],1):t._e(),t.options.search?e("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",value:t.search,type:"text",icon:"search"},on:{input:function(e){t.search=e}}}):t._e(),e("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:s}){return[e("k-button",t._b({on:{click:function(e){return t.toggle(s)}}},"k-button",t.toggleBtn(s),!1)),t.model?e("k-button",{attrs:{disabled:!s.hasChildren,tooltip:t.$t("open"),icon:"angle-right"},on:{click:function(e){return e.stopPropagation(),t.go(s)}}}):t._e()]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,null,null,null,null).exports;const ct=Q({mixins:[et],props:{disabled:Boolean,icon:{type:String,default:"trash"},submitButton:{type:[String,Boolean],default:()=>window.panel.$t("delete")},text:String,theme:{type:String,default:"negative"}}},(function(){var t=this;return(0,t._self._c)("k-text-dialog",t._g(t._b({ref:"dialog"},"k-text-dialog",t.$props,!1),t.$listeners),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const dt=Q({mixins:[et],props:{disabled:Boolean,text:String}},(function(){var t=this,e=t._self._c;return e("k-dialog",t._g(t._b({ref:"dialog"},"k-dialog",t.$props,!1),t.$listeners),[t._t("default",(function(){return[t.text?e("k-text",{attrs:{html:t.text}}):e("k-box",{attrs:{theme:"negative"}},[t._v(" This dialog does not define any text ")])]}))],2)}),[],!1,null,null,null,null).exports;const pt=Q({mixins:[ot],computed:{emptyProps(){return{icon:"users",text:this.$t("dialog.users.empty")}}},methods:{item:t=>({...t,key:t.email,info:t.info!==t.text?t.info:null})}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-users-dialog",attrs:{size:"medium"},on:{cancel:function(e){return t.$emit("cancel")},submit:t.submit}},[t.issue?[e("k-box",{attrs:{text:t.issue,theme:"negative"}})]:[t.options.search?e("k-input",{staticClass:"k-dialog-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",value:t.search,type:"text",icon:"search"},on:{input:function(e){t.search=e}}}):t._e(),e("k-collection",t._b({on:{item:t.toggle,paginate:t.paginate},scopedSlots:t._u([{key:"options",fn:function({item:s}){return[e("k-button",t._b({on:{click:function(e){return t.toggle(s)}}},"k-button",t.toggleBtn(s),!1))]}}])},"k-collection",t.collection,!1))]],2)}),[],!1,null,null,null,null).exports,ht={install(t){t.component("k-dialog",tt),t.component("k-error-dialog",st),t.component("k-fiber-dialog",nt),t.component("k-files-dialog",rt),t.component("k-form-dialog",lt),t.component("k-language-dialog",at),t.component("k-pages-dialog",ut),t.component("k-remove-dialog",ct),t.component("k-text-dialog",dt),t.component("k-users-dialog",pt)}};const mt=Q({inheritAttrs:!1,props:{id:String,icon:String,tab:String,tabs:Object,title:String},data:()=>({click:!1}),computed:{breadcrumb(){return this.$store.state.drawers.open},hasTabs(){return this.tabs&&Object.keys(this.tabs).length>1},index(){return this.breadcrumb.findIndex((t=>t.id===this._uid))},nested(){return this.index>0}},watch:{index(){-1===this.index&&this.close()}},destroyed(){this.$store.dispatch("drawers/close",this._uid)},methods:{close(){this.$refs.overlay.close()},goTo(t){if(t===this._uid)return!0;this.$store.dispatch("drawers/goto",t)},mouseup(){!0===this.click&&this.close(),this.click=!1},mousedown(t=!1){this.click=t,!0===this.click&&this.$store.dispatch("drawers/close")},onClose(){this.$store.dispatch("drawers/close",this._uid),this.$emit("close")},onOpen(){this.$store.dispatch("drawers/open",{id:this._uid,icon:this.icon,title:this.title}),this.$emit("open")},open(){this.$refs.overlay.open()}}},(function(){var t=this,e=t._self._c;return e("k-overlay",{ref:"overlay",attrs:{dimmed:!1},on:{close:t.onClose,open:t.onOpen}},[e("div",{staticClass:"k-drawer",attrs:{"data-id":t.id,"data-nested":t.nested},on:{mousedown:function(e){return e.stopPropagation(),t.mousedown(!0)},mouseup:t.mouseup}},[e("div",{staticClass:"k-drawer-box",on:{mousedown:function(e){return e.stopPropagation(),t.mousedown(!1)}}},[e("header",{staticClass:"k-drawer-header"},[1===t.breadcrumb.length?e("h2",{staticClass:"k-drawer-title"},[e("k-icon",{attrs:{type:t.icon}}),t._v(" "+t._s(t.title)+" ")],1):e("ul",{staticClass:"k-drawer-breadcrumb"},t._l(t.breadcrumb,(function(s){return e("li",{key:s.id},[e("k-button",{attrs:{icon:s.icon,text:s.title},on:{click:function(e){return t.goTo(s.id)}}})],1)})),0),t.hasTabs?e("nav",{staticClass:"k-drawer-tabs"},t._l(t.tabs,(function(s){return e("k-button",{key:s.name,staticClass:"k-drawer-tab",attrs:{current:t.tab==s.name,text:s.label},on:{click:function(e){return e.stopPropagation(),t.$emit("tab",s.name)}}})})),1):t._e(),e("nav",{staticClass:"k-drawer-options"},[t._t("options"),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"check"},on:{click:t.close}})],2)]),e("div",{staticClass:"k-drawer-body scroll-y-auto"},[t._t("default")],2)])])])}),[],!1,null,null,null,null).exports;const ft=Q({inheritAttrs:!1,props:{empty:{type:String,default:()=>"Missing field setup"},icon:String,id:String,tabs:Object,title:String,type:String,value:Object},data:()=>({tab:null}),computed:{fields(){const t=this.tab||null;return(this.tabs[t]||this.firstTab).fields||{}},firstTab(){return Object.values(this.tabs)[0]}},methods:{close(){this.$refs.drawer.close()},focus(t){var e;"function"==typeof(null==(e=this.$refs.form)?void 0:e.focus)&&this.$refs.form.focus(t)},open(t,e=!0){var s;this.$refs.drawer.open(),this.tab=t||this.firstTab.name,!0===e&&(e=null==(s=Object.values(this.fields).find((t=>!0===t.autofocus)))?void 0:s.name),setTimeout((()=>{this.focus(e)}),10)}}},(function(){var t=this,e=t._self._c;return e("k-drawer",{ref:"drawer",staticClass:"k-form-drawer",attrs:{id:t.id,icon:t.icon,tabs:t.tabs,tab:t.tab,title:t.title},on:{close:function(e){return t.$emit("close")},open:function(e){return t.$emit("open")},tab:function(e){t.tab=e}},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0},{key:"default",fn:function(){return[0===Object.keys(t.fields).length?e("k-box",{attrs:{theme:"info"}},[t._v(" "+t._s(t.empty)+" ")]):e("k-form",{ref:"form",attrs:{autofocus:!0,fields:t.fields,value:t.$helper.clone(t.value)},on:{input:function(e){return t.$emit("input",e)},invalid:function(e){return t.$emit("invalid",e)}}})]},proxy:!0}],null,!0)})}),[],!1,null,null,null,null).exports,gt={install(t){t.component("k-drawer",mt),t.component("k-form-drawer",ft)}};const kt=Q({props:{html:{type:Boolean,default:!1},limit:{type:Number,default:10},skip:{type:Array,default:()=>[]},options:Array,query:String},data:()=>({matches:[],selected:{text:null}}),methods:{close(){this.$refs.dropdown.close()},onSelect(t){this.$emit("select",t),this.$refs.dropdown.close()},search(t){if(t.length<1)return;const e=new RegExp(RegExp.escape(t),"ig");this.matches=this.options.filter((t=>!!t.text&&(-1===this.skip.indexOf(t.value)&&null!==t.text.match(e)))).slice(0,this.limit),this.$emit("search",t,this.matches),this.$refs.dropdown.open()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown",{staticClass:"k-autocomplete"},[t._t("default"),e("k-dropdown-content",t._g({ref:"dropdown",attrs:{autofocus:!0}},t.$listeners),t._l(t.matches,(function(s,n){return e("k-dropdown-item",t._b({key:n,on:{mousedown:function(e){return t.onSelect(s)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:(e.preventDefault(),t.onSelect(s))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onSelect(s))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)?null:(e.preventDefault(),t.close.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:(e.preventDefault(),t.close.apply(null,arguments))}]}},"k-dropdown-item",s,!1),[e("span",{domProps:{innerHTML:t._s(t.html?s.text:t.$esc(s.text))}})])})),1),t._v(" "+t._s(t.query)+" ")],2)}),[],!1,null,null,null,null).exports;const bt=Q({props:{disabled:Boolean,max:String,min:String,value:String},data(){return this.data(this.value)},computed:{numberOfDays(){return this.toDate().daysInMonth()},firstWeekday(){const t=this.toDate().day();return t>0?t:7},weekdays(){return["mon","tue","wed","thu","fri","sat","sun"].map((t=>this.$t("days."+t)))},weeks(){const t=this.firstWeekday-1;return Math.ceil((this.numberOfDays+t)/7)},monthnames(){return["january","february","march","april","may","june","july","august","september","october","november","december"].map((t=>this.$t("months."+t)))},months(){var t=[];return this.monthnames.forEach(((e,s)=>{const n=this.toDate(1,s);t.push({value:s,text:e,disabled:n.isBefore(this.current.min,"month")||n.isAfter(this.current.max,"month")})})),t},years(){var t,e;const s=(null==(t=this.current.min)?void 0:t.get("year"))??this.current.year-20,n=(null==(e=this.current.max)?void 0:e.get("year"))??this.current.year+20;return this.toOptions(s,n)}},watch:{value(t){const e=this.data(t);this.dt=e.dt,this.current=e.current}},methods:{data(t){const e=this.$library.dayjs.iso(t),s=this.$library.dayjs();return{dt:e,current:{month:(e??s).month(),year:(e??s).year(),min:this.$library.dayjs.iso(this.min),max:this.$library.dayjs.iso(this.max)}}},days(t){let e=[];const s=7*(t-1)+1,n=s+7;for(let i=s;ithis.numberOfDays;e.push(s?"":t)}return e},isDisabled(t){const e=this.toDate(t);return this.disabled||e.isBefore(this.current.min,"day")||e.isAfter(this.current.max,"day")},isSelected(t){return this.toDate(t).isSame(this.dt,"day")},isToday(t){const e=this.$library.dayjs();return this.toDate(t).isSame(e,"day")},onInput(){var t;this.$emit("input",(null==(t=this.dt)?void 0:t.toISO("date"))||null)},onNext(){const t=this.toDate().add(1,"month");this.show(t)},onPrev(){const t=this.toDate().subtract(1,"month");this.show(t)},select(t){const e="today"===t?this.$library.dayjs().merge(this.toDate(),"time"):this.toDate(t);this.dt=e,this.show(e),this.onInput()},show(t){this.current.year=t.year(),this.current.month=t.month()},toDate(t=1,e=this.current.month){return this.$library.dayjs(`${this.current.year}-${e+1}-${t}`)},toOptions(t,e){for(var s=[],n=t;n<=e;n++)s.push({value:n,text:this.$helper.pad(n)});return s}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-calendar-input"},[e("nav",[e("k-button",{attrs:{icon:"angle-left"},on:{click:t.onPrev}}),e("span",{staticClass:"k-calendar-selects"},[e("k-select-input",{attrs:{options:t.months,disabled:t.disabled,required:!0,value:t.current.month},on:{input:function(e){t.current.month=Number(e)}}}),e("k-select-input",{attrs:{options:t.years,disabled:t.disabled,required:!0,value:t.current.year},on:{input:function(e){t.current.year=Number(e)}}})],1),e("k-button",{attrs:{icon:"angle-right"},on:{click:t.onNext}})],1),e("table",{staticClass:"k-calendar-table"},[e("thead",[e("tr",t._l(t.weekdays,(function(s){return e("th",{key:"weekday_"+s},[t._v(" "+t._s(s)+" ")])})),0)]),e("tbody",t._l(t.weeks,(function(s){return e("tr",{key:"week_"+s},t._l(t.days(s),(function(s,n){return e("td",{key:"day_"+n,staticClass:"k-calendar-day",attrs:{"aria-current":!!t.isToday(s)&&"date","aria-selected":!!t.isSelected(s)&&"date"}},[s?e("k-button",{attrs:{disabled:t.isDisabled(s),text:s},on:{click:function(e){return t.select(s)}}}):t._e()],1)})),0)})),0),e("tfoot",[e("tr",[e("td",{staticClass:"k-calendar-today",attrs:{colspan:"7"}},[e("k-button",{attrs:{text:t.$t("today")},on:{click:function(e){return t.select("today")}}})],1)])])])])}),[],!1,null,null,null,null).exports;const vt=Q({props:{count:Number,min:Number,max:Number,required:{type:Boolean,default:!1}},computed:{valid(){return!1===this.required&&0===this.count||(!0!==this.required||0!==this.count)&&(!(this.min&&this.countthis.max))}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-counter",attrs:{"data-invalid":!t.valid}},[e("span",[t._v(t._s(t.count))]),t.min&&t.max?e("span",{staticClass:"k-counter-rules"},[t._v("("+t._s(t.min)+"–"+t._s(t.max)+")")]):t.min?e("span",{staticClass:"k-counter-rules"},[t._v("≥ "+t._s(t.min))]):t.max?e("span",{staticClass:"k-counter-rules"},[t._v("≤ "+t._s(t.max))]):t._e()])}),[],!1,null,null,null,null).exports;const yt=Q({props:{disabled:Boolean,config:Object,fields:{type:[Array,Object],default:()=>({})},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},data(){return{errors:{},listeners:{...this.$listeners,submit:this.onSubmit}}},methods:{focus(t){var e,s;null==(s=null==(e=this.$refs.fields)?void 0:e.focus)||s.call(e,t)},onSubmit(){this.$emit("submit",this.value)},submit(){this.$refs.submitter.click()}}},(function(){var t=this,e=t._self._c;return e("form",{ref:"form",staticClass:"k-form",attrs:{method:"POST",autocomplete:"off",novalidate:""},on:{submit:function(e){return e.preventDefault(),t.onSubmit.apply(null,arguments)}}},[t._t("header"),t._t("default",(function(){return[e("k-fieldset",t._g({ref:"fields",attrs:{disabled:t.disabled,fields:t.fields,novalidate:t.novalidate},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}},t.listeners))]})),t._t("footer"),e("input",{ref:"submitter",staticClass:"k-form-submitter",attrs:{type:"submit"}})],2)}),[],!1,null,null,null,null).exports;const $t=Q({props:{lock:[Boolean,Object]},data:()=>({isRefreshing:null,isLocking:null}),computed:{api(){return[this.$view.path+"/lock",null,null,!0]},hasChanges(){return this.$store.getters["content/hasChanges"]()},isDisabled(){return!1===this.$store.state.content.status.enabled},isLocked(){return"lock"===this.lockState},isUnlocked(){return"unlock"===this.lockState},mode(){return null!==this.lockState?this.lockState:!0===this.hasChanges?"changes":null},lockState(){return this.supportsLocking&&this.lock?this.lock.state:null},supportsLocking(){return!1!==this.lock},theme(){return"lock"===this.mode?"negative":"unlock"===this.mode?"info":"notice"}},watch:{hasChanges:{handler(t,e){!0===this.supportsLocking&&!1===this.isLocked&&!1===this.isUnlocked&&(!0===t?(this.onLock(),this.isLocking=setInterval(this.onLock,3e4)):e&&(clearInterval(this.isLocking),this.onLock(!1)))},immediate:!0},isLocked(t){!1===t&&this.$events.$emit("model.reload")}},created(){this.supportsLocking&&(this.isRefreshing=setInterval(this.check,1e4)),this.$events.$on("keydown.cmd.s",this.onSave)},destroyed(){clearInterval(this.isRefreshing),clearInterval(this.isLocking),this.$events.$off("keydown.cmd.s",this.onSave)},methods:{async check(){const{lock:t}=await this.$api.get(...this.api);e(this.$view.props,"lock",t)},async onLock(t=!0){if(!0===t)try{await this.$api.patch(...this.api)}catch(e){clearInterval(this.isLocking),this.$store.dispatch("content/revert")}else clearInterval(this.isLocking),await this.$api.delete(...this.api)},onDownload(){let t="";const e=this.$store.getters["content/changes"]();Object.keys(e).forEach((s=>{t+=s+": \n\n"+e[s],t+="\n\n----\n\n"}));let s=document.createElement("a");s.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),s.setAttribute("download",this.$view.path+".txt"),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)},async onResolve(){await this.onUnlock(!1),this.$store.dispatch("content/revert")},onRevert(){this.$refs.revert.open()},async onSave(t){if(!t)return!1;t.preventDefault&&t.preventDefault();try{await this.$store.dispatch("content/save"),this.$events.$emit("model.update"),this.$store.dispatch("notification/success",":)")}catch(e){if(403===e.code)return;e.details&&Object.keys(e.details).length>0?this.$store.dispatch("notification/error",{message:this.$t("error.form.incomplete"),details:e.details}):this.$store.dispatch("notification/error",{message:this.$t("error.form.notSaved"),details:[{label:"Exception: "+e.exception,message:e.message}]})}},async onUnlock(t=!0){const e=[this.$view.path+"/unlock",null,null,!0];!0===t?await this.$api.patch(...e):await this.$api.delete(...e),this.$reload({silent:!0})},revert(){this.$store.dispatch("content/revert"),this.$refs.revert.close()}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-form-buttons",attrs:{"data-theme":t.theme}},["unlock"===t.mode?e("k-view",[e("p",{staticClass:"k-form-lock-info"},[t._v(" "+t._s(t.$t("lock.isUnlocked"))+" ")]),e("span",{staticClass:"k-form-lock-buttons"},[e("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("download"),icon:"download"},on:{click:t.onDownload}}),e("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("confirm"),icon:"check"},on:{click:t.onResolve}})],1)]):"lock"===t.mode?e("k-view",[e("p",{staticClass:"k-form-lock-info"},[e("k-icon",{attrs:{type:"lock"}}),e("span",{domProps:{innerHTML:t._s(t.$t("lock.isLocked",{email:t.$esc(t.lock.data.email)}))}})],1),t.lock.data.unlockable?e("k-button",{staticClass:"k-form-button",attrs:{text:t.$t("lock.unlock"),icon:"unlock"},on:{click:function(e){return t.onUnlock()}}}):e("k-icon",{staticClass:"k-form-lock-loader",attrs:{type:"loader"}})],1):"changes"===t.mode?e("k-view",[e("k-button",{staticClass:"k-form-button",attrs:{disabled:t.isDisabled,text:t.$t("revert"),icon:"undo"},on:{click:t.onRevert}}),e("k-button",{staticClass:"k-form-button",attrs:{disabled:t.isDisabled,text:t.$t("save"),icon:"check"},on:{click:t.onSave}})],1):t._e(),e("k-dialog",{ref:"revert",attrs:{"submit-button":t.$t("revert"),icon:"undo",theme:"negative"},on:{submit:t.revert}},[e("k-text",{attrs:{html:t.$t("revert.confirm")}})],1)],1)}),[],!1,null,null,null,null).exports;const _t=Q({data:()=>({isOpen:!1,options:[]}),computed:{hasChanges(){return this.ids.length>0},ids(){return Object.keys(this.store).filter((t=>{var e;return Object.keys((null==(e=this.store[t])?void 0:e.changes)||{}).length>0}))},store(){return this.$store.state.content.models}},methods:{async toggle(){if(!1===this.$refs.list.isOpen)try{await this.$dropdown("changes",{method:"POST",body:{ids:this.ids}})((t=>{this.options=t}))}catch(t){return this.$store.dispatch("notification/success",this.$t("lock.unsaved.empty")),this.$store.dispatch("content/clear"),!1}this.$refs.list&&this.$refs.list.toggle()}}},(function(){var t=this,e=t._self._c;return t.hasChanges?e("k-dropdown",{staticClass:"k-form-indicator"},[e("k-button",{staticClass:"k-form-indicator-toggle k-topbar-button",attrs:{icon:"edit"},on:{click:t.toggle}}),e("k-dropdown-content",{ref:"list",attrs:{align:"right",theme:"light"}},[e("p",{staticClass:"k-form-indicator-info"},[t._v(t._s(t.$t("lock.unsaved"))+":")]),e("hr"),t._l(t.options,(function(s){return e("k-dropdown-item",t._b({key:s.id},"k-dropdown-item",s,!1),[t._v(" "+t._s(s.text)+" ")])}))],2)],1):t._e()}),[],!1,null,null,null,null).exports,wt={props:{after:String}},xt={props:{autofocus:Boolean}},St={props:{before:String}},Ct={props:{disabled:Boolean}},Ot={props:{help:String}},At={props:{id:{type:[Number,String],default(){return this._uid}}}},Tt={props:{invalid:Boolean}},It={props:{label:String}},jt={props:{name:[Number,String]}},Et={props:{required:Boolean}},Mt={mixins:[Ct,Ot,It,jt,Et],props:{counter:[Boolean,Object],endpoints:Object,input:[String,Number],translate:Boolean,type:String}};const Lt=Q({mixins:[Mt],inheritAttrs:!1,computed:{labelText(){return this.label||" "}}},(function(){var t=this,e=t._self._c;return e("div",{class:"k-field k-field-name-"+t.name,attrs:{"data-disabled":t.disabled,"data-translate":t.translate},on:{focusin:function(e){return t.$emit("focus",e)},focusout:function(e){return t.$emit("blur",e)}}},[t._t("header",(function(){return[e("header",{staticClass:"k-field-header"},[t._t("label",(function(){return[e("label",{staticClass:"k-field-label",attrs:{for:t.input}},[t._v(" "+t._s(t.labelText)+" "),t.required?e("abbr",{attrs:{title:t.$t("field.required")}},[t._v("*")]):t._e()])]})),t._t("options"),t._t("counter",(function(){return[t.counter?e("k-counter",t._b({staticClass:"k-field-counter",attrs:{required:t.required}},"k-counter",t.counter,!1)):t._e()]}))],2)]})),t._t("default"),t._t("footer",(function(){return[t.help||t.$slots.help?e("footer",{staticClass:"k-field-footer"},[t._t("help",(function(){return[t.help?e("k-text",{staticClass:"k-field-help",attrs:{theme:"help",html:t.help}}):t._e()]}))],2):t._e()]}))],2)}),[],!1,null,null,null,null).exports;const Bt=Q({props:{config:Object,disabled:Boolean,fields:{type:[Array,Object],default:()=>[]},novalidate:{type:Boolean,default:!1},value:{type:Object,default:()=>({})}},data:()=>({errors:{}}),methods:{focus(t){if(t)return void(this.hasField(t)&&"function"==typeof this.$refs[t][0].focus&&this.$refs[t][0].focus());const e=Object.keys(this.$refs)[0];this.focus(e)},hasFieldType(t){return this.$helper.isComponent(`k-${t}-field`)},hasField(t){var e;return null==(e=this.$refs[t])?void 0:e[0]},onInvalid(t,e,s,n){this.errors[n]=e,this.$emit("invalid",this.errors)},onInput(t,e,s){const n={...this.value,[s]:t};this.$emit("input",n,e,s)},hasErrors(){return Object.keys(this.errors).length}}},(function(){var t=this,e=t._self._c;return e("fieldset",{staticClass:"k-fieldset"},[e("k-grid",[t._l(t.fields,(function(s,n){return[t.$helper.field.isVisible(s,t.value)?e("k-column",{key:s.signature,attrs:{width:s.width}},[e("k-error-boundary",[t.hasFieldType(s.type)?e("k-"+s.type+"-field",t._b({ref:n,refInFor:!0,tag:"component",attrs:{disabled:t.disabled||s.disabled,"form-data":t.value,name:n,novalidate:t.novalidate},on:{input:function(e){return t.$emit("input",t.value,s,n)},focus:function(e){return t.$emit("focus",e,s,n)},invalid:(e,i)=>t.onInvalid(e,i,s,n),submit:function(e){return t.$emit("submit",e,s,n)}},model:{value:t.value[n],callback:function(e){t.$set(t.value,n,e)},expression:"value[fieldName]"}},"component",s,!1)):e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[t._v(" "+t._s(t.$t("error.field.type.missing",{name:n,type:s.type}))+" ")])],1)],1)],1):t._e()]}))],2)],1)}),[],!1,null,null,null,null).exports,Dt={mixins:[wt,St,Ct,Tt],props:{autofocus:Boolean,type:String,icon:[String,Boolean],theme:String,novalidate:{type:Boolean,default:!1},value:{type:[String,Boolean,Number,Object,Array],default:null}}};const Pt=Q({mixins:[Dt],inheritAttrs:!1,data(){return{isInvalid:this.invalid,listeners:{...this.$listeners,invalid:(t,e)=>{this.isInvalid=t,this.$emit("invalid",t,e)}}}},computed:{inputProps(){return{...this.$props,...this.$attrs}}},methods:{blur(t){(null==t?void 0:t.relatedTarget)&&!1===this.$el.contains(t.relatedTarget)&&this.trigger(null,"blur")},focus(t){this.trigger(t,"focus")},select(t){this.trigger(t,"select")},trigger(t,e){var s,n,i;if("INPUT"===(null==(s=null==t?void 0:t.target)?void 0:s.tagName)&&"function"==typeof(null==(n=null==t?void 0:t.target)?void 0:n[e]))return void t.target[e]();if("function"==typeof(null==(i=this.$refs.input)?void 0:i[e]))return void this.$refs.input[e]();const o=this.$el.querySelector("input, select, textarea");"function"==typeof(null==o?void 0:o[e])&&o[e]()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-input",attrs:{"data-disabled":t.disabled,"data-invalid":!t.novalidate&&t.isInvalid,"data-theme":t.theme,"data-type":t.type}},[t.$slots.before||t.before?e("span",{staticClass:"k-input-before",on:{click:t.focus}},[t._t("before",(function(){return[t._v(t._s(t.before))]}))],2):t._e(),e("span",{staticClass:"k-input-element",on:{click:function(e){return e.stopPropagation(),t.focus.apply(null,arguments)}}},[t._t("default",(function(){return[e("k-"+t.type+"-input",t._g(t._b({ref:"input",tag:"component",attrs:{value:t.value}},"component",t.inputProps,!1),t.listeners))]}))],2),t.$slots.after||t.after?e("span",{staticClass:"k-input-after",on:{click:t.focus}},[t._t("after",(function(){return[t._v(t._s(t.after))]}))],2):t._e(),t.$slots.icon||t.icon?e("span",{staticClass:"k-input-icon",on:{click:t.focus}},[t._t("icon",(function(){return[e("k-icon",{attrs:{type:t.icon}})]}))],2):t._e()])}),[],!1,null,null,null,null).exports;const Nt=Q({props:{methods:Array},data:()=>({currentForm:null,isLoading:!1,user:{email:"",password:"",remember:!1}}),computed:{canToggle(){return null!==this.codeMode&&!0===this.methods.includes("password")&&(!0===this.methods.includes("password-reset")||!0===this.methods.includes("code"))},codeMode(){return!0===this.methods.includes("password-reset")?"password-reset":!0===this.methods.includes("code")?"code":null},fields(){let t={email:{autofocus:!0,label:this.$t("email"),type:"email",required:!0,link:!1}};return"email-password"===this.form&&(t.password={label:this.$t("password"),type:"password",minLength:8,required:!0,autocomplete:"current-password",counter:!1}),t},form(){return this.currentForm?this.currentForm:"password"===this.methods[0]?"email-password":"email"},isResetForm(){return"password-reset"===this.codeMode&&"email"===this.form},toggleText(){return this.$t("login.toggleText."+this.codeMode+"."+this.formOpposite(this.form))}},methods:{formOpposite:t=>"email-password"===t?"email":"email-password",async login(){this.$emit("error",null),this.isLoading=!0;let t=Object.assign({},this.user);"email"===this.currentForm&&(t.password=null),!0===this.isResetForm&&(t.remember=!1);try{await this.$api.auth.login(t),this.$reload({globals:["$system","$translation"]})}catch(e){this.$emit("error",e)}finally{this.isLoading=!1}},toggleForm(){this.currentForm=this.formOpposite(this.form),this.$refs.fieldset.focus("email")}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-login-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[e("div",{staticClass:"k-login-fields"},[!0===t.canToggle?e("button",{staticClass:"k-login-toggler",attrs:{type:"button"},on:{click:t.toggleForm}},[t._v(" "+t._s(t.toggleText)+" ")]):t._e(),e("k-fieldset",{ref:"fieldset",attrs:{novalidate:!0,fields:t.fields,value:t.user},on:{input:function(e){t.user=e}}})],1),e("div",{staticClass:"k-login-buttons"},[!1===t.isResetForm?e("span",{staticClass:"k-login-checkbox"},[e("k-checkbox-input",{attrs:{value:t.user.remember,label:t.$t("login.remember")},on:{input:function(e){t.user.remember=e}}})],1):t._e(),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("login"+(t.isResetForm?".reset":"")))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)],1)])}),[],!1,null,null,null,null).exports;const Rt=Q({props:{methods:Array,pending:Object},data:()=>({code:"",isLoadingBack:!1,isLoadingLogin:!1}),computed:{mode(){return!0===this.methods.includes("password-reset")?"password-reset":"login"}},methods:{async back(){this.isLoadingBack=!0,this.$go("/logout")},async login(){this.$emit("error",null),this.isLoadingLogin=!0;try{await this.$api.auth.verifyCode(this.code),this.$store.dispatch("notification/success",this.$t("welcome")),"password-reset"===this.mode?this.$go("reset-password"):this.$reload()}catch(t){this.$emit("error",t)}finally{this.isLoadingLogin=!1}}}},(function(){var t=this,e=t._self._c;return e("form",{staticClass:"k-login-form k-login-code-form",on:{submit:function(e){return e.preventDefault(),t.login.apply(null,arguments)}}},[e("k-user-info",{attrs:{user:t.pending.email}}),e("k-text-field",{attrs:{autofocus:!0,counter:!1,help:t.$t("login.code.text."+t.pending.challenge),label:t.$t("login.code.label."+t.mode),novalidate:!0,placeholder:t.$t("login.code.placeholder."+t.pending.challenge),required:!0,value:t.code,autocomplete:"one-time-code",icon:"unlock",name:"code"},on:{input:function(e){t.code=e}}}),e("div",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button k-login-back-button",attrs:{icon:"angle-left"},on:{click:t.back}},[t._v(" "+t._s(t.$t("back"))+" "),t.isLoadingBack?[t._v(" … ")]:t._e()],2),e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("login"+("password-reset"===t.mode?".reset":"")))+" "),t.isLoadingLogin?[t._v(" … ")]:t._e()],2)],1)],1)}),[],!1,null,null,null,null).exports;const Ft=Q({props:{display:{type:String,default:"HH:mm"},value:String},computed:{day(){return this.formatTimes([6,7,8,9,10,11,"-",12,13,14,15,16,17])},night(){return this.formatTimes([18,19,20,21,22,23,"-",0,1,2,3,4,5])}},methods:{formatTimes(t){return t.map((t=>{if("-"===t)return t;const e=this.$library.dayjs(t+":00","H:mm");return{display:e.format(this.display),select:e.toISO("time")}}))},select(t){this.$emit("input",t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-times"},[e("div",{staticClass:"k-times-slot"},[e("k-icon",{attrs:{type:"sun"}}),e("ul",t._l(t.day,(function(s){return e("li",{key:s.select},["-"===s?e("hr"):e("k-button",{on:{click:function(e){return t.select(s.select)}}},[t._v(t._s(s.display))])],1)})),0)],1),e("div",{staticClass:"k-times-slot"},[e("k-icon",{attrs:{type:"moon"}}),e("ul",t._l(t.night,(function(s){return e("li",{key:s.select},["-"===s?e("hr"):e("k-button",{on:{click:function(e){return t.select(s.select)}}},[t._v(t._s(s.display))])],1)})),0)],1)])}),[],!1,null,null,null,null).exports;const qt=Q({props:{accept:{type:String,default:"*"},attributes:{type:Object},max:{type:Number},method:{type:String,default:"POST"},multiple:{type:Boolean,default:!0},url:{type:String}},data(){return{options:this.$props,completed:{},errors:[],files:[],total:0}},computed:{limit(){return!1===this.options.multiple?1:this.options.max}},methods:{open(t){this.params(t),setTimeout((()=>{this.$refs.input.click()}),1)},params(t){this.options=Object.assign({},this.$props,t)},select(t){this.upload(t.target.files)},drop(t,e){this.params(e),this.upload(t)},upload(t){this.$refs.dialog.open(),this.files=[...t],this.completed={},this.errors=[],this.hasErrors=!1,this.limit&&(this.files=this.files.slice(0,this.limit)),this.total=this.files.length,this.files.forEach((t=>{var e,s;this.$helper.upload(t,{url:this.options.url,attributes:this.options.attributes,method:this.options.method,headers:{"X-CSRF":window.panel.$system.csrf},progress:(t,e,s)=>{var n,i;null==(i=null==(n=this.$refs[e.name])?void 0:n[0])||i.set(s)},success:(t,e,s)=>{this.complete(e,s.data)},error:(t,e,s)=>{this.errors.push({file:e,message:s.message}),this.complete(e,s.data)}}),void 0!==(null==(s=null==(e=this.options)?void 0:e.attributes)?void 0:s.sort)&&this.options.attributes.sort++}))},complete(t,e){if(this.completed[t.name]=e,Object.keys(this.completed).length==this.total){if(this.$refs.input.value="",this.errors.length>0)return this.$forceUpdate(),void this.$emit("error",this.files);setTimeout((()=>{this.$refs.dialog.close(),this.$emit("success",this.files,Object.values(this.completed))}),250)}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-upload"},[e("input",{ref:"input",attrs:{accept:t.options.accept,multiple:t.options.multiple,"aria-hidden":"true",type:"file",tabindex:"-1"},on:{change:t.select,click:function(t){t.stopPropagation()}}}),e("k-dialog",{ref:"dialog",staticClass:"k-upload-dialog",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"},scopedSlots:t._u([{key:"footer",fn:function(){return[t.errors.length>0?[e("k-button-group",{attrs:{buttons:[{icon:"check",text:t.$t("confirm"),click:()=>t.$refs.dialog.close()}]}})]:t._e()]},proxy:!0}])},[t.errors.length>0?[e("k-headline",[t._v(t._s(t.$t("upload.errors")))]),e("ul",{staticClass:"k-upload-error-list"},t._l(t.errors,(function(s,n){return e("li",{key:"error-"+n},[e("p",{staticClass:"k-upload-error-filename"},[t._v(" "+t._s(s.file.name)+" ")]),e("p",{staticClass:"k-upload-error-message"},[t._v(" "+t._s(s.message)+" ")])])})),0)]:[e("k-headline",[t._v(t._s(t.$t("upload.progress")))]),e("ul",{staticClass:"k-upload-list"},t._l(t.files,(function(s,n){return e("li",{key:"file-"+n},[e("k-progress",{ref:s.name,refInFor:!0}),e("p",{staticClass:"k-upload-list-filename"},[t._v(" "+t._s(s.name)+" ")]),e("p",[t._v(t._s(t.errors[s.name]))])],1)})),0)]],2)],1)}),[],!1,null,null,null,null).exports;const zt=t=>({$from:e})=>((t,e)=>{for(let s=t.depth;s>0;s--){const n=t.node(s);if(e(n))return{pos:s>0?t.before(s):0,start:t.start(s),depth:s,node:n}}})(e,t),Yt=t=>e=>{if((t=>t instanceof r)(e)){const{node:s,$from:n}=e;if(((t,e)=>Array.isArray(t)&&t.indexOf(e.type)>-1||e.type===t)(t,s))return{node:s,pos:n.pos,depth:n.depth}}},Ht=(t,e,s={})=>{const n=Yt(e)(t.selection)||zt((t=>t.type===e))(t.selection);return Object.keys(s).length&&n?n.node.hasMarkup(e,{...n.node.attrs,...s}):!!n};function Ut(t=null,e=null){if(!t||!e)return!1;const s=t.parent.childAfter(t.parentOffset);if(!s.node)return!1;const n=s.node.marks.find((t=>t.type===e));if(!n)return!1;let i=t.index(),o=t.start()+s.offset,r=i+1,l=o+s.node.nodeSize;for(;i>0&&n.isInSet(t.parent.child(i-1).marks);)i-=1,o-=t.parent.child(i).nodeSize;for(;r{i=[...i,...t.marks]}));const o=i.find((t=>t.type.name===e.name));return o?o.attrs:{}},getNodeAttrs:function(t,e){const{from:s,to:n}=t.selection;let i=[];t.doc.nodesBetween(s,n,(t=>{i=[...i,t]}));const o=i.reverse().find((t=>t.type.name===e.name));return o?o.attrs:{}},markInputRule:function(t,e,n){return new s(t,((t,s,i,o)=>{const r=n instanceof Function?n(s):n,{tr:l}=t,a=s.length-1;let u=o,c=i;if(s[a]){const n=i+s[0].indexOf(s[a-1]),r=n+s[a-1].length-1,d=n+s[a-1].lastIndexOf(s[a]),p=d+s[a].length,h=function(t,e,s){let n=[];return s.doc.nodesBetween(t,e,((t,e)=>{n=[...n,...t.marks.map((s=>({start:e,end:e+t.nodeSize,mark:s})))]})),n}(i,o,t).filter((t=>{const{excluded:s}=t.mark.type;return s.find((t=>t.name===e.name))})).filter((t=>t.end>n));if(h.length)return!1;pn&&l.delete(n,d),c=n,u=c+s[a].length}return l.addMark(c,u,e.create(r)),l.removeStoredMark(e),l}))},markIsActive:function(t,e){const{from:s,$from:n,to:i,empty:o}=t.selection;return o?!!e.isInSet(t.storedMarks||n.marks()):!!t.doc.rangeHasMark(s,i,e)},markPasteRule:function(t,e,s){const r=(n,i)=>{const l=[];return n.forEach((n=>{var o;if(n.isText){const{text:r,marks:a}=n;let u,c=0;const d=!!a.filter((t=>"link"===t.type.name))[0];for(;!d&&null!==(u=t.exec(r));)if((null==(o=null==i?void 0:i.type)?void 0:o.allowsMarkType(e))&&u[1]){const t=u.index,i=t+u[0].length,o=t+u[0].indexOf(u[1]),r=o+u[1].length,a=s instanceof Function?s(u):s;t>0&&l.push(n.cut(c,t)),l.push(n.cut(o,r).mark(e.create(a).addToSet(n.marks))),c=i}cnew i(r(t.content),t.openStart,t.openEnd)}})},minMax:function(t=0,e=0,s=0){return Math.min(Math.max(parseInt(t,10),e),s)},nodeIsActive:Ht,nodeInputRule:function(t,e,n){return new s(t,((t,s,i,o)=>{const r=n instanceof Function?n(s):n,{tr:l}=t;return s[0]&&l.replaceWith(i-1,o,e.create(r)),l}))},pasteRule:function(t,e,s){const r=n=>{const i=[];return n.forEach((n=>{if(n.isText){const{text:o}=n;let r,l=0;do{if(r=t.exec(o),r){const t=r.index,o=t+r[0].length,a=s instanceof Function?s(r[0]):s;t>0&&i.push(n.cut(l,t)),i.push(n.cut(t,o).mark(e.create(a).addToSet(n.marks))),l=o}}while(r);lnew i(r(t.content),t.openStart,t.openEnd)}})},removeMark:function(t){return(e,s)=>{const{tr:n,selection:i}=e;let{from:o,to:r}=i;const{$from:l,empty:a}=i;if(a){const e=Ut(l,t);o=e.from,r=e.to}return n.removeMark(o,r,t),s(n)}},toggleBlockType:function(t,e,s={}){return(n,i,o)=>Ht(n,t,s)?l(e)(n,i,o):l(t,s)(n,i,o)},toggleList:function(t,e){return(s,n,i)=>{const{schema:o,selection:r}=s,{$from:l,$to:c}=r,d=l.blockRange(c);if(!d)return!1;const p=zt((t=>Kt(t,o)))(r);if(d.depth>=1&&p&&d.depth-p.depth<=1){if(p.node.type===t)return a(e)(s,n,i);if(Kt(p.node,o)&&t.validContent(p.node.content)){const{tr:e}=s;return e.setNodeMarkup(p.pos,t),n&&n(e),!1}}return u(t)(s,n,i)}},updateMark:function(t,e){return(s,n)=>{const{tr:i,selection:o,doc:r}=s,{ranges:l,empty:a}=o;if(a){const{from:s,to:n}=Ut(o.$from,t);r.rangeHasMark(s,n,t)&&i.removeMark(s,n,t),i.addMark(s,n,t.create(e))}else l.forEach((s=>{const{$to:n,$from:o}=s;r.rangeHasMark(o.pos,n.pos,t)&&i.removeMark(o.pos,n.pos,t),i.addMark(o.pos,n.pos,t.create(e))}));return n(i)}}};class Jt{emit(t,...e){this._callbacks=this._callbacks||{};const s=this._callbacks[t];return s&&s.forEach((t=>t.apply(this,e))),this}off(t,e){if(arguments.length){const s=this._callbacks?this._callbacks[t]:null;s&&(e?this._callbacks[t]=s.filter((t=>t!==e)):delete this._callbacks[t])}else this._callbacks={};return this}on(t,e){return this._callbacks=this._callbacks||{},this._callbacks[t]=this._callbacks[t]||[],this._callbacks[t].push(e),this}}class Gt{constructor(t=[],e){t.forEach((t=>{t.bindEditor(e),t.init()})),this.extensions=t}commands({schema:t,view:e}){return this.extensions.filter((t=>t.commands)).reduce(((s,n)=>{const{name:i,type:o}=n,r={},l=n.commands({schema:t,utils:Vt,...["node","mark"].includes(o)?{type:t[`${o}s`][i]}:{}}),a=(t,s)=>{r[t]=t=>{if("function"!=typeof s||!e.editable)return!1;e.focus();const n=s(t);return"function"==typeof n?n(e.state,e.dispatch,e):n}};return"object"==typeof l?Object.entries(l).forEach((([t,e])=>{a(t,e)})):a(i,l),{...s,...r}}),{})}buttons(t="mark"){const e={};return this.extensions.filter((e=>e.type===t)).filter((t=>t.button)).forEach((t=>{Array.isArray(t.button)?t.button.forEach((t=>{e[t.id||t.name]=t})):e[t.name]=t.button})),e}getAllowedExtensions(t){return t instanceof Array||!t?t instanceof Array?this.extensions.filter((e=>!t.includes(e.name))):this.extensions:[]}getFromExtensions(t,e,s=this.extensions){return s.filter((t=>["extension"].includes(t.type))).filter((e=>e[t])).map((s=>s[t]({...e,utils:Vt})))}getFromNodesAndMarks(t,e,s=this.extensions){return s.filter((t=>["node","mark"].includes(t.type))).filter((e=>e[t])).map((s=>s[t]({...e,type:e.schema[`${s.type}s`][s.name],utils:Vt})))}inputRules({schema:t,excludedExtensions:e}){const s=this.getAllowedExtensions(e);return[...this.getFromExtensions("inputRules",{schema:t},s),...this.getFromNodesAndMarks("inputRules",{schema:t},s)].reduce(((t,e)=>[...t,...e]),[])}keymaps({schema:t}){return[...this.getFromExtensions("keys",{schema:t}),...this.getFromNodesAndMarks("keys",{schema:t})].map((t=>b(t)))}get marks(){return this.extensions.filter((t=>"mark"===t.type)).reduce(((t,{name:e,schema:s})=>({...t,[e]:s})),{})}get nodes(){return this.extensions.filter((t=>"node"===t.type)).reduce(((t,{name:e,schema:s})=>({...t,[e]:s})),{})}get options(){const{view:t}=this;return this.extensions.reduce(((e,s)=>({...e,[s.name]:new Proxy(s.options,{set(e,s,n){const i=e[s]!==n;return Object.assign(e,{[s]:n}),i&&t.updateState(t.state),!0}})})),{})}pasteRules({schema:t,excludedExtensions:e}){const s=this.getAllowedExtensions(e);return[...this.getFromExtensions("pasteRules",{schema:t},s),...this.getFromNodesAndMarks("pasteRules",{schema:t},s)].reduce(((t,e)=>[...t,...e]),[])}plugins({schema:t}){return[...this.getFromExtensions("plugins",{schema:t}),...this.getFromNodesAndMarks("plugins",{schema:t})].reduce(((t,e)=>[...t,...e]),[]).map((t=>t instanceof n?t:new n(t)))}}class Wt{constructor(t={}){this.options={...this.defaults,...t}}init(){return null}bindEditor(t=null){this.editor=t}get name(){return null}get type(){return"extension"}get defaults(){return{}}plugins(){return[]}inputRules(){return[]}pasteRules(){return[]}keys(){return{}}}class Xt extends Wt{constructor(t={}){super(t)}get type(){return"node"}get schema(){return null}commands(){return{}}}class Zt extends Xt{get defaults(){return{inline:!1}}get name(){return"doc"}get schema(){return{content:this.options.inline?"inline*":"block+"}}}class Qt extends Xt{get button(){return{id:this.name,icon:"paragraph",label:window.panel.$t("toolbar.button.paragraph"),name:this.name}}commands({utils:t,type:e}){return{paragraph:()=>t.setBlockType(e)}}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}get name(){return"paragraph"}}let te=class extends Xt{get name(){return"text"}get schema(){return{group:"inline"}}};class ee extends Jt{constructor(t={}){super(),this.defaults={autofocus:!1,content:"",disableInputRules:!1,disablePasteRules:!1,editable:!0,element:null,extensions:[],emptyDocument:{type:"doc",content:[]},events:{},inline:!1,parseOptions:{},topNode:"doc",useBuiltInExtensions:!0},this.init(t)}blur(){this.view.dom.blur()}get builtInExtensions(){return this.options.useBuiltInExtensions?[new Zt({inline:this.options.inline}),new te,new Qt]:[]}buttons(t){return this.extensions.buttons(t)}clearContent(t=!1){this.setContent(this.options.emptyDocument,t)}command(t,...e){this.commands[t]&&this.commands[t](...e)}createCommands(){return this.extensions.commands({schema:this.schema,view:this.view})}createDocument(t,e=this.options.parseOptions){if(null===t)return this.schema.nodeFromJSON(this.options.emptyDocument);if("object"==typeof t)try{return this.schema.nodeFromJSON(t)}catch(s){return window.console.warn("Invalid content.","Passed value:",t,"Error:",s),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"==typeof t){const s=`

${t}
`,n=(new window.DOMParser).parseFromString(s,"text/html").body.firstElementChild;return v.fromSchema(this.schema).parse(n,e)}return!1}createEvents(){const t=this.options.events||{};return Object.entries(t).forEach((([t,e])=>{this.on(t,e)})),t}createExtensions(){return new Gt([...this.builtInExtensions,...this.options.extensions],this)}createFocusEvents(){const t=(t,e,s=!0)=>{this.focused=s,this.emit(s?"focus":"blur",{event:e,state:t.state,view:t});const n=this.state.tr.setMeta("focused",s);this.view.dispatch(n)};return new n({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(e,s)=>{t(e,s,!0)},blur:(e,s)=>{t(e,s,!1)}}}})}createInputRules(){return this.extensions.inputRules({schema:this.schema,excludedExtensions:this.options.disableInputRules})}createKeymaps(){return this.extensions.keymaps({schema:this.schema})}createMarks(){return this.extensions.marks}createNodes(){return this.extensions.nodes}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createPlugins(){return this.extensions.plugins({schema:this.schema})}createSchema(){return new y({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return $.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,_({rules:this.inputRules}),...this.pasteRules,...this.keymaps,b({Backspace:C}),b(O),this.createFocusEvents()]})}createView(){return new w(this.element,{dispatchTransaction:this.dispatchTransaction.bind(this),editable:()=>this.options.editable,handlePaste:(t,e)=>{if("function"==typeof this.events.paste){const t=e.clipboardData.getData("text/html"),s=e.clipboardData.getData("text/plain");if(!0===this.events.paste(e,t,s))return!0}},handleDrop:(...t)=>{this.emit("drop",...t)},state:this.createState()})}destroy(){this.view&&this.view.destroy()}dispatchTransaction(t){const e=this.state,s=this.state.apply(t);this.view.updateState(s),this.selection={from:this.state.selection.from,to:this.state.selection.to},this.setActiveNodesAndMarks();const n={editor:this,getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:t};this.emit("transaction",n),!t.docChanged&&t.getMeta("preventUpdate")||this.emit("update",n);const{from:i,to:o}=this.state.selection,r=!e||!e.selection.eq(s.selection);this.emit(s.selection.empty?"deselect":"select",{...n,from:i,hasChanged:r,to:o})}focus(t=null){if(this.view.focused&&null===t||!1===t)return;const{from:e,to:s}=this.selectionAtPosition(t);this.setSelection(e,s),setTimeout((()=>this.view.focus()),10)}getHTML(){const t=document.createElement("div"),e=x.fromSchema(this.schema).serializeFragment(this.state.doc.content);return t.appendChild(e),this.options.inline&&t.querySelector("p")?t.querySelector("p").innerHTML:t.innerHTML}getJSON(){return this.state.doc.toJSON()}getMarkAttrs(t=null){return this.activeMarkAttrs[t]}getSchemaJSON(){return JSON.parse(JSON.stringify({nodes:this.nodes,marks:this.marks}))}init(t={}){this.options={...this.defaults,...t},this.element=this.options.element,this.focused=!1,this.selection={from:0,to:0},this.events=this.createEvents(),this.extensions=this.createExtensions(),this.nodes=this.createNodes(),this.marks=this.createMarks(),this.schema=this.createSchema(),this.keymaps=this.createKeymaps(),this.inputRules=this.createInputRules(),this.pasteRules=this.createPasteRules(),this.plugins=this.createPlugins(),this.view=this.createView(),this.commands=this.createCommands(),this.setActiveNodesAndMarks(),!1!==this.options.autofocus&&this.focus(this.options.autofocus),this.emit("init",{view:this.view,state:this.state}),this.extensions.view=this.view,this.setContent(this.options.content,!0)}isEditable(){return this.options.editable}isEmpty(){if(this.state)return 0===this.state.doc.textContent.length}get isActive(){return Object.entries({...this.activeMarks,...this.activeNodes}).reduce(((t,[e,s])=>({...t,[e]:(t={})=>s(t)})),{})}removeMark(t){if(this.schema.marks[t])return Vt.removeMark(this.schema.marks[t])(this.state,this.view.dispatch)}selectionAtPosition(t=null){if(this.selection&&null===t)return this.selection;if("start"===t||!0===t)return{from:0,to:0};if("end"===t){const{doc:t}=this.state;return{from:t.content.size,to:t.content.size}}return{from:t,to:t}}setActiveNodesAndMarks(){this.activeMarks=Object.values(this.schema.marks).filter((t=>Vt.markIsActive(this.state,t))).map((t=>t.name)),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce(((t,[e,s])=>({...t,[e]:Vt.getMarkAttrs(this.state,s)})),{}),this.activeNodes=Object.values(this.schema.nodes).filter((t=>Vt.nodeIsActive(this.state,t))).map((t=>t.name)),this.activeNodeAttrs=Object.entries(this.schema.nodes).reduce(((t,[e,s])=>({...t,[e]:Vt.getNodeAttrs(this.state,s)})),{})}setContent(t={},e=!1,s){const{doc:n,tr:i}=this.state,o=this.createDocument(t,s),r=i.replaceWith(0,n.content.size,o).setMeta("preventUpdate",!e);this.view.dispatch(r)}setSelection(t=0,e=0){const{doc:s,tr:n}=this.state,i=Vt.minMax(t,0,s.content.size),o=Vt.minMax(e,0,s.content.size),r=S.create(s,i,o),l=n.setSelection(r);this.view.dispatch(l)}get state(){return this.view?this.view.state:null}toggleMark(t){if(this.schema.marks[t])return Vt.toggleMark(this.schema.marks[t])(this.state,this.view.dispatch)}updateMark(t,e){if(this.schema.marks[t])return Vt.updateMark(this.schema.marks[t],e)(this.state,this.view.dispatch)}}const se=Q({data:()=>({link:{href:null,title:null,target:!1}}),computed:{fields(){return{href:{label:this.$t("url"),type:"text",icon:"url"},title:{label:this.$t("title"),type:"text",icon:"title"},target:{label:this.$t("open.newWindow"),type:"toggle",text:[this.$t("no"),this.$t("yes")]}}}},methods:{open(t){this.link={title:null,target:!1,...t},this.link.target=Boolean(this.link.target),this.$refs.dialog.open()},submit(){this.$emit("submit",{...this.link,target:this.link.target?"_blank":null}),this.$refs.dialog.close()}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",{ref:"dialog",attrs:{fields:t.fields,"submit-button":t.$t("confirm"),value:t.link,size:"medium"},on:{close:function(e){return t.$emit("close")},input:function(e){t.link=e},submit:t.submit}})}),[],!1,null,null,null,null).exports;const ne=Q({data:()=>({email:{email:null,title:null}}),computed:{fields(){return{href:{label:this.$t("email"),type:"email",icon:"email"},title:{label:this.$t("title"),type:"text",icon:"title"}}}},methods:{open(t){this.email={title:null,...t},this.$refs.dialog.open()},submit(){this.$emit("submit",this.email),this.$refs.dialog.close()}}},(function(){var t=this;return(0,t._self._c)("k-form-dialog",{ref:"dialog",attrs:{fields:t.fields,"submit-button":t.$t("confirm"),value:t.email,size:"medium"},on:{input:function(e){t.email=e},close:function(e){return t.$emit("close")},submit:t.submit}})}),[],!1,null,null,null,null).exports;class ie extends Wt{constructor(t={}){super(t)}command(){return()=>{}}remove(){this.editor.removeMark(this.name)}get schema(){return null}get type(){return"mark"}toggle(){return this.editor.toggleMark(this.name)}update(t){this.editor.updateMark(this.name,t)}}let oe=class extends ie{get button(){return{icon:"url",label:window.panel.$t("toolbar.button.link")}}commands(){return{link:()=>{this.editor.emit("link",this.editor)},insertLink:(t={})=>{if(t.href)return this.update(t)},removeLink:()=>this.remove(),toggleLink:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertLink",t):this.editor.command("removeLink")}}}get defaults(){return{target:null}}get name(){return"link"}pasteRules({type:t,utils:e}){return[e.pasteRule(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b([-a-zA-Z0-9@:%_+.~#?&//=,]*)/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,s)=>{const n=this.editor.getMarkAttrs("link");n.href&&!0===s.altKey&&s.target instanceof HTMLAnchorElement&&(s.stopPropagation(),window.open(n.href,n.target))}}}]}get schema(){return{attrs:{href:{default:null},target:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]:not([href^='mailto:'])",getAttrs:t=>({href:t.getAttribute("href"),target:t.getAttribute("target"),title:t.getAttribute("title")})}],toDOM:t=>["a",{...t.attrs,rel:"noopener noreferrer"},0]}}},re=class extends ie{get button(){return{icon:"code",label:window.panel.$t("toolbar.button.code")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:`)([^`]+)(?:`)$/,t)]}keys(){return{"Mod-`":()=>this.toggle()}}get name(){return"code"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:`)([^`]+)(?:`)/g,t)]}get schema(){return{excludes:"_",parseDOM:[{tag:"code"}],toDOM:()=>["code",0]}}};class le extends ie{get button(){return{icon:"bold",label:window.panel.$t("toolbar.button.bold")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,t)]}keys(){return{"Mod-b":()=>this.toggle()}}get name(){return"bold"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g,t)]}get schema(){return{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM:()=>["strong",0]}}}class ae extends ie{get button(){return{icon:"italic",label:window.panel.$t("toolbar.button.italic")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,t),e.markInputRule(/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,t)]}keys(){return{"Mod-i":()=>this.toggle()}}get name(){return"italic"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/_([^_]+)_/g,t),e.markPasteRule(/\*([^*]+)\*/g,t)]}get schema(){return{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}}}class ue extends ie{get button(){return{icon:"email",label:"Email"}}commands(){return{email:()=>{this.editor.emit("email")},insertEmail:(t={})=>{if(t.href)return this.update(t)},removeEmail:()=>this.remove(),toggleEmail:(t={})=>{var e;(null==(e=t.href)?void 0:e.length)>0?this.editor.command("insertEmail",t):this.editor.command("removeEmail")}}}get defaults(){return{target:null}}get name(){return"email"}pasteRules({type:t,utils:e}){return[e.pasteRule(/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/gi,t,(t=>({href:t})))]}plugins(){return[{props:{handleClick:(t,e,s)=>{const n=this.editor.getMarkAttrs("email");n.href&&!0===s.altKey&&s.target instanceof HTMLAnchorElement&&(s.stopPropagation(),window.open(n.href))}}}]}get schema(){return{attrs:{href:{default:null},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href^='mailto:']",getAttrs:t=>({href:t.getAttribute("href").replace("mailto:",""),title:t.getAttribute("title")})}],toDOM:t=>["a",{...t.attrs,href:"mailto:"+t.attrs.href},0]}}}class ce extends ie{get button(){return{icon:"strikethrough",label:window.panel.$t("toolbar.button.strike")}}commands(){return()=>this.toggle()}inputRules({type:t,utils:e}){return[e.markInputRule(/~([^~]+)~$/,t)]}keys(){return{"Mod-d":()=>this.toggle()}}get name(){return"strike"}pasteRules({type:t,utils:e}){return[e.markPasteRule(/~([^~]+)~/g,t)]}get schema(){return{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",getAttrs:t=>"line-through"===t}],toDOM:()=>["s",0]}}}class de extends ie{get button(){return{icon:"underline",label:window.panel.$t("toolbar.button.underline")}}commands(){return()=>this.toggle()}keys(){return{"Mod-u":()=>this.toggle()}}get name(){return"underline"}get schema(){return{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:t=>"underline"===t}],toDOM:()=>["u",0]}}}class pe extends Xt{get button(){return{id:this.name,icon:"list-bullet",label:window.panel.$t("toolbar.button.ul"),name:this.name,when:["listItem","bulletList","orderedList"]}}commands({type:t,schema:e,utils:s}){return()=>s.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^\s*([-+*])\s$/,t)]}keys({type:t,schema:e,utils:s}){return{"Shift-Ctrl-8":s.toggleList(t,e.nodes.listItem)}}get name(){return"bulletList"}get schema(){return{content:"listItem+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}}class he extends Xt{commands({utils:t,type:e}){return()=>this.createHardBreak(t,e)}createHardBreak(t,e){return t.chainCommands(t.exitCode,((t,s)=>(s(t.tr.replaceSelectionWith(e.create()).scrollIntoView()),!0)))}get defaults(){return{enter:!1,text:!1}}keys({utils:t,type:e}){const s=this.createHardBreak(t,e);let n={"Mod-Enter":s,"Shift-Enter":s};return this.options.enter&&(n.Enter=s),n}get name(){return"hardBreak"}get schema(){return{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]}}}let me=class extends Xt{get button(){return this.options.levels.map((t=>({id:`h${t}`,command:`h${t}`,icon:`h${t}`,label:window.panel.$t("toolbar.button.heading."+t),attrs:{level:t},name:this.name,when:["heading","paragraph"]})))}commands({type:t,schema:e,utils:s}){let n={toggleHeading:n=>s.toggleBlockType(t,e.nodes.paragraph,n)};return this.options.levels.forEach((i=>{n[`h${i}`]=()=>s.toggleBlockType(t,e.nodes.paragraph,{level:i})})),n}get defaults(){return{levels:[1,2,3,4,5,6]}}inputRules({type:t,utils:e}){return this.options.levels.map((s=>e.textblockTypeInputRule(new RegExp(`^(#{1,${s}})\\s$`),t,(()=>({level:s})))))}keys({type:t,utils:e}){return this.options.levels.reduce(((s,n)=>({...s,[`Shift-Ctrl-${n}`]:e.setBlockType(t,{level:n})})),{})}get name(){return"heading"}get schema(){return{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,draggable:!1,parseDOM:this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}}))),toDOM:t=>[`h${t.attrs.level}`,0]}}};class fe extends Xt{commands({type:t}){return()=>(e,s)=>s(e.tr.replaceSelectionWith(t.create()))}inputRules({type:t,utils:e}){return[e.nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/,t)]}get name(){return"horizontalRule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}}class ge extends Xt{keys({type:t,utils:e}){return{Enter:e.splitListItem(t),"Shift-Tab":e.liftListItem(t),Tab:e.sinkListItem(t)}}get name(){return"listItem"}get schema(){return{content:"paragraph block*",defining:!0,draggable:!1,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}}}class ke extends Xt{get button(){return{id:this.name,icon:"list-numbers",label:window.panel.$t("toolbar.button.ol"),name:this.name,when:["listItem","bulletList","orderedList"]}}commands({type:t,schema:e,utils:s}){return()=>s.toggleList(t,e.nodes.listItem)}inputRules({type:t,utils:e}){return[e.wrappingInputRule(/^(\d+)\.\s$/,t,(t=>({order:+t[1]})),((t,e)=>e.childCount+e.attrs.order===+t[1]))]}keys({type:t,schema:e,utils:s}){return{"Shift-Ctrl-9":s.toggleList(t,e.nodes.listItem)}}get name(){return"orderedList"}get schema(){return{attrs:{order:{default:1}},content:"listItem+",group:"block",parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1===t.attrs.order?["ol",0]:["ol",{start:t.attrs.order},0]}}}class be extends Wt{commands(){return{undo:()=>A,redo:()=>T,undoDepth:()=>I,redoDepth:()=>j}}get defaults(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":A,"Mod-y":T,"Shift-Mod-z":T,"Mod-я":A,"Shift-Mod-я":T}}get name(){return"history"}plugins(){return[E({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}}class ve extends Wt{commands(){return{insertHtml:t=>(e,s)=>{let n=document.createElement("div");n.innerHTML=t.trim();const i=v.fromSchema(e.schema).parse(n);s(e.tr.replaceSelectionWith(i).scrollIntoView())}}}}let ye=class extends Wt{constructor(t={}){super(t)}close(){this.visible=!1,this.emit()}emit(){this.editor.emit("toolbar",{marks:this.marks,nodes:this.nodes,nodeAttrs:this.nodeAttrs,position:this.position,visible:this.visible})}init(){this.position={left:0,bottom:0},this.visible=!1,this.editor.on("blur",(()=>{this.close()})),this.editor.on("deselect",(()=>{this.close()})),this.editor.on("select",(({hasChanged:t})=>{!1!==t?this.open():this.emit()}))}get marks(){return this.editor.activeMarks}get nodes(){return this.editor.activeNodes}get nodeAttrs(){return this.editor.activeNodeAttrs}open(){this.visible=!0,this.reposition(),this.emit()}reposition(){const{from:t,to:e}=this.editor.selection,s=this.editor.view.coordsAtPos(t),n=this.editor.view.coordsAtPos(e,!0),i=this.editor.element.getBoundingClientRect();let o=(s.left+n.left)/2-i.left,r=Math.round(i.bottom-s.top);return this.position={bottom:r,left:o}}get type(){return"toolbar"}};const $e=Q({props:{activeMarks:{type:Array,default:()=>[]},activeNodes:{type:Array,default:()=>[]},activeNodeAttrs:{type:[Array,Object],default:()=>[]},editor:{type:Object,required:!0},marks:{type:Array},isParagraphNodeHidden:{type:Boolean,default:!1}},computed:{activeButton(){return Object.values(this.nodeButtons).find((t=>this.isButtonActive(t)))||!1},hasVisibleButtons(){const t=Object.keys(this.nodeButtons);return t.length>1||1===t.length&&!1===t.includes("paragraph")},markButtons(){return this.buttons("mark")},nodeButtons(){let t=this.buttons("node");return!0===this.isParagraphNodeHidden&&t.paragraph&&delete t.paragraph,t}},methods:{buttons(t){const e=this.editor.buttons(t);let s=this.sorting;!1!==s&&!1!==Array.isArray(s)||(s=Object.keys(e));let n={};return s.forEach((t=>{e[t]&&(n[t]=e[t])})),n},command(t,...e){this.$emit("command",t,...e)},isButtonActive(t){if("paragraph"===t.name)return 1===this.activeNodes.length&&this.activeNodes.includes(t.name);let e=!0;if(t.attrs){const s=Object.values(this.activeNodeAttrs).find((e=>JSON.stringify(e)===JSON.stringify(t.attrs)));e=Boolean(s||!1)}return!0===e&&this.activeNodes.includes(t.name)},isButtonCurrent(t){return!!this.activeButton&&this.activeButton.id===t.id},isButtonDisabled(t){var e;if(null==(e=this.activeButton)?void 0:e.when){return!1===this.activeButton.when.includes(t.name)}return!1},needDividerAfterNode(t){let e=["paragraph"],s=Object.keys(this.nodeButtons);return(s.includes("bulletList")||s.includes("orderedList"))&&e.push("h6"),e.includes(t.id)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-writer-toolbar"},[t.hasVisibleButtons?e("k-dropdown",{nativeOn:{mousedown:function(t){t.preventDefault()}}},[e("k-button",{class:{"k-writer-toolbar-button k-writer-toolbar-nodes":!0,"k-writer-toolbar-button-active":!!t.activeButton},attrs:{icon:t.activeButton.icon||"title"},on:{click:function(e){return t.$refs.nodes.toggle()}}}),e("k-dropdown-content",{ref:"nodes"},[t._l(t.nodeButtons,(function(s,n){return[e("k-dropdown-item",{key:n,attrs:{current:t.isButtonCurrent(s),disabled:t.isButtonDisabled(s),icon:s.icon},on:{click:function(e){return t.command(s.command||n)}}},[t._v(" "+t._s(s.label)+" ")]),t.needDividerAfterNode(s)?e("hr",{key:n+"-divider"}):t._e()]}))],2)],1):t._e(),t._l(t.markButtons,(function(s,n){return e("k-button",{key:n,class:{"k-writer-toolbar-button":!0,"k-writer-toolbar-button-active":t.activeMarks.includes(n)},attrs:{icon:s.icon,tooltip:s.label},on:{mousedown:function(e){return e.preventDefault(),t.command(s.command||n)}}})}))],2)}),[],!1,null,null,null,null).exports,_e={props:{autofocus:Boolean,breaks:Boolean,code:Boolean,disabled:Boolean,emptyDocument:{type:Object,default:()=>({type:"doc",content:[]})},headings:[Array,Boolean],inline:{type:Boolean,default:!1},marks:{type:[Array,Boolean],default:!0},nodes:{type:[Array,Boolean],default:()=>["heading","bulletList","orderedList"]},paste:{type:Function,default:()=>()=>!1},placeholder:String,spellcheck:Boolean,extensions:Array,value:{type:String,default:""}}};const we=Q({components:{"k-writer-email-dialog":ne,"k-writer-link-dialog":se,"k-writer-toolbar":$e},mixins:[_e],data(){return{editor:null,json:{},html:this.value,isEmpty:!0,toolbar:!1}},computed:{isParagraphNodeHidden(){return!0===Array.isArray(this.nodes)&&3!==this.nodes.length&&!1===this.nodes.includes("paragraph")}},watch:{value(t,e){t!==e&&t!==this.html&&(this.html=t,this.editor.setContent(this.html))}},mounted(){this.editor=new ee({autofocus:this.autofocus,content:this.value,editable:!this.disabled,element:this.$el,emptyDocument:this.emptyDocument,events:{link:t=>{this.$refs.linkDialog.open(t.getMarkAttrs("link"))},email:()=>{this.$refs.emailDialog.open(this.editor.getMarkAttrs("email"))},paste:this.paste,toolbar:t=>{this.toolbar=t,this.toolbar.visible&&this.$nextTick((()=>{this.onToolbarOpen()}))},update:t=>{if(!this.editor)return;const e=JSON.stringify(this.editor.getJSON());e!==JSON.stringify(this.json)&&(this.json=e,this.isEmpty=t.editor.isEmpty(),this.html=t.editor.getHTML(),this.isEmpty&&(0===t.editor.activeNodes.length||t.editor.activeNodes.includes("paragraph"))&&(this.html=""),this.$emit("input",this.html))}},extensions:[...this.createMarks(),...this.createNodes(),new be,new ve,new ye,...this.extensions||[]],inline:this.inline}),this.isEmpty=this.editor.isEmpty(),this.json=this.editor.getJSON()},beforeDestroy(){this.editor.destroy()},methods:{filterExtensions(t,e,s){!1===e?e=[]:!0!==e&&!1!==Array.isArray(e)||(e=Object.keys(t));let n=[];return e.forEach((e=>{t[e]&&n.push(t[e])})),"function"==typeof s&&(n=s(e,n)),n},command(t,...e){this.editor.command(t,...e)},createMarks(){return this.filterExtensions({link:new oe,bold:new le,italic:new ae,strike:new ce,underline:new de,code:new re,email:new ue},this.marks)},createNodes(){const t=new he({text:!0,enter:this.inline});return!0===this.inline?[t]:this.filterExtensions({bulletList:new pe,orderedList:new ke,heading:new me,horizontalRule:new fe,listItem:new ge},this.nodes,((e,s)=>((e.includes("bulletList")||e.includes("orderedList"))&&s.push(new ge),s.push(t),s)))},getHTML(){return this.editor.getHTML()},focus(){this.editor.focus()},onToolbarOpen(){if(this.$refs.toolbar){const t=this.$el.clientWidth,e=this.$refs.toolbar.$el.clientWidth;let s=this.toolbar.position.left;s-e/2<0&&(s=s+(e/2-s)-20),s+e/2>t&&(s=s-(s+e/2-t)+20),s!==this.toolbar.position.left&&(this.$refs.toolbar.$el.style.left=s+"px")}}}},(function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"direction",rawName:"v-direction"}],ref:"editor",staticClass:"k-writer",attrs:{"data-empty":t.isEmpty,"data-placeholder":t.placeholder,spellcheck:t.spellcheck}},[t.editor?[t.toolbar.visible?e("k-writer-toolbar",{ref:"toolbar",style:{bottom:t.toolbar.position.bottom+"px","inset-inline-start":t.toolbar.position.left+"px"},attrs:{editor:t.editor,"active-marks":t.toolbar.marks,"active-nodes":t.toolbar.nodes,"active-node-attrs":t.toolbar.nodeAttrs,"is-paragraph-node-hidden":t.isParagraphNodeHidden},on:{command:function(e){return t.editor.command(e)}}}):t._e(),e("k-writer-link-dialog",{ref:"linkDialog",on:{close:function(e){return t.editor.focus()},submit:function(e){return t.editor.command("toggleLink",e)}}}),e("k-writer-email-dialog",{ref:"emailDialog",on:{close:function(e){return t.editor.focus()},submit:function(e){return t.editor.command("toggleEmail",e)}}})]:t._e()],2)}),[],!1,null,null,null,null).exports;const xe=Q({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-login-alert",on:{click:function(e){return t.$emit("click")}}},[e("span",[t._t("default")],2),e("k-icon",{attrs:{type:"alert"}})],1)}),[],!1,null,null,null,null).exports;const Se=Q({props:{fields:Object,index:[Number,String],total:Number,value:Object},mounted(){this.$store.dispatch("content/disable"),this.$events.$on("keydown.cmd.s",this.onSubmit),this.$events.$on("keydown.esc",this.onDiscard)},destroyed(){this.$events.$off("keydown.cmd.s",this.onSubmit),this.$events.$off("keydown.esc",this.onDiscard),this.$store.dispatch("content/enable")},methods:{focus(t){this.$refs.form.focus(t)},onDiscard(){this.$emit("discard")},onInput(t){this.$emit("input",t)},onSubmit(){this.$emit("submit")}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-structure-form"},[e("div",{staticClass:"k-structure-backdrop",on:{click:t.onDiscard}}),e("section",[e("k-form",{ref:"form",staticClass:"k-structure-form-fields",attrs:{value:t.value,fields:t.fields},on:{input:t.onInput,submit:t.onSubmit}}),e("footer",{staticClass:"k-structure-form-buttons"},[e("k-button",{staticClass:"k-structure-form-cancel-button",attrs:{text:t.$t("cancel"),icon:"cancel"},on:{click:function(e){return t.$emit("close")}}}),"new"!==t.index?e("k-pagination",{attrs:{dropdown:!1,total:t.total,limit:1,page:t.index+1,details:!0},on:{paginate:function(e){return t.$emit("paginate",e)}}}):t._e(),e("k-button",{staticClass:"k-structure-form-submit-button",attrs:{text:t.$t("new"!==t.index?"confirm":"add"),icon:"check"},on:{click:t.onSubmit}})],1)],1)])}),[],!1,null,null,null,null).exports,Ce=function(t){this.command("insert",((e,s)=>{let n=[];return s.split("\n").forEach(((e,s)=>{let i="ol"===t?s+1+".":"-";n.push(i+" "+e)})),n.join("\n")}))};const Oe=Q({layout:["headlines","bold","italic","|","link","email","file","|","code","ul","ol"],props:{buttons:{type:[Boolean,Array],default:!0},uploads:[Boolean,Object,Array]},data(){let t={},e={},s=[],n=this.commands();return!1===this.buttons?t:(Array.isArray(this.buttons)&&(s=this.buttons),!0!==Array.isArray(this.buttons)&&(s=this.$options.layout),s.forEach(((s,i)=>{if("|"===s)t["divider-"+i]={divider:!0};else if(n[s]){let i=n[s];t[s]=i,i.shortcut&&(e[i.shortcut]=s)}})),{layout:t,shortcuts:e})},methods:{command(t,e){"function"==typeof t?t.apply(this):this.$emit("command",t,e)},close(){Object.keys(this.$refs).forEach((t=>{const e=this.$refs[t][0];"function"==typeof(null==e?void 0:e.close)&&e.close()}))},fileCommandSetup(){let t={label:this.$t("toolbar.button.file"),icon:"attachment"};return!1===this.uploads?t.command="selectFile":t.dropdown={select:{label:this.$t("toolbar.button.file.select"),icon:"check",command:"selectFile"},upload:{label:this.$t("toolbar.button.file.upload"),icon:"upload",command:"uploadFile"}},t},commands(){return{headlines:{label:this.$t("toolbar.button.headings"),icon:"title",dropdown:{h1:{label:this.$t("toolbar.button.heading.1"),icon:"title",command:"prepend",args:"#"},h2:{label:this.$t("toolbar.button.heading.2"),icon:"title",command:"prepend",args:"##"},h3:{label:this.$t("toolbar.button.heading.3"),icon:"title",command:"prepend",args:"###"}}},bold:{label:this.$t("toolbar.button.bold"),icon:"bold",command:"wrap",args:"**",shortcut:"b"},italic:{label:this.$t("toolbar.button.italic"),icon:"italic",command:"wrap",args:"*",shortcut:"i"},link:{label:this.$t("toolbar.button.link"),icon:"url",shortcut:"k",command:"dialog",args:"link"},email:{label:this.$t("toolbar.button.email"),icon:"email",shortcut:"e",command:"dialog",args:"email"},file:this.fileCommandSetup(),code:{label:this.$t("toolbar.button.code"),icon:"code",command:"wrap",args:"`"},ul:{label:this.$t("toolbar.button.ul"),icon:"list-bullet",command(){return Ce.apply(this,["ul"])}},ol:{label:this.$t("toolbar.button.ol"),icon:"list-numbers",command(){return Ce.apply(this,["ol"])}}}},shortcut(t,e){if(this.shortcuts[t]){const s=this.layout[this.shortcuts[t]];if(!s)return!1;e.preventDefault(),this.command(s.command,s.args)}}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-toolbar"},[e("div",{staticClass:"k-toolbar-wrapper"},[e("div",{staticClass:"k-toolbar-buttons"},[t._l(t.layout,(function(s,n){return[s.divider?[e("span",{key:n,staticClass:"k-toolbar-divider"})]:s.dropdown?[e("k-dropdown",{key:n},[e("k-button",{key:n,staticClass:"k-toolbar-button",attrs:{icon:s.icon,tooltip:s.label,tabindex:"-1"},on:{click:function(e){t.$refs[n+"-dropdown"][0].toggle()}}}),e("k-dropdown-content",{ref:n+"-dropdown",refInFor:!0},t._l(s.dropdown,(function(s,n){return e("k-dropdown-item",{key:n,attrs:{icon:s.icon},on:{click:function(e){return t.command(s.command,s.args)}}},[t._v(" "+t._s(s.label)+" ")])})),1)],1)]:[e("k-button",{key:n,staticClass:"k-toolbar-button",attrs:{icon:s.icon,tooltip:s.label,tabindex:"-1"},on:{click:function(e){return t.command(s.command,s.args)}}})]]}))],2)])])}),[],!1,null,null,null,null).exports;const Ae=Q({data(){return{value:{email:null,text:null},fields:{email:{label:this.$t("email"),type:"email"},text:{label:this.$t("link.text"),type:"text"}}}},computed:{kirbytext(){return this.$config.kirbytext}},methods:{open(t,e){this.value.text=e,this.$refs.dialog.open()},cancel(){this.$emit("cancel")},createKirbytext(){var t;const e=this.value.email||"";return(null==(t=this.value.text)?void 0:t.length)>0?`(email: ${e} text: ${this.value.text})`:`(email: ${e})`},createMarkdown(){var t;const e=this.value.email||"";return(null==(t=this.value.text)?void 0:t.length)>0?`[${this.value.text}](mailto:${e})`:`<${e}>`},submit(){this.$emit("submit",this.kirbytext?this.createKirbytext():this.createMarkdown()),this.value={email:null,text:null},this.$refs.dialog.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",attrs:{"submit-button":t.$t("insert")},on:{close:t.cancel,submit:function(e){return t.$refs.form.submit()}}},[e("k-form",{ref:"form",attrs:{fields:t.fields,value:t.value},on:{input:function(e){t.value=e},submit:t.submit}})],1)}),[],!1,null,null,null,null).exports;const Te=Q({data(){return{value:{url:null,text:null},fields:{url:{label:this.$t("link"),type:"text",placeholder:this.$t("url.placeholder"),icon:"url"},text:{label:this.$t("link.text"),type:"text"}}}},computed:{kirbytext(){return this.$config.kirbytext}},methods:{open(t,e){this.value.text=e,this.$refs.dialog.open()},cancel(){this.$emit("cancel")},createKirbytext(){return this.value.text.length>0?`(link: ${this.value.url} text: ${this.value.text})`:`(link: ${this.value.url})`},createMarkdown(){return this.value.text.length>0?`[${this.value.text}](${this.value.url})`:`<${this.value.url}>`},submit(){this.$emit("submit",this.kirbytext?this.createKirbytext():this.createMarkdown()),this.value={url:null,text:null},this.$refs.dialog.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",attrs:{"submit-button":t.$t("insert")},on:{close:t.cancel,submit:function(e){return t.$refs.form.submit()}}},[e("k-form",{ref:"form",attrs:{fields:t.fields,value:t.value},on:{input:function(e){t.value=e},submit:t.submit}})],1)}),[],!1,null,null,null,null).exports;const Ie=Q({mixins:[xt,Ct,At,It,Et],inheritAttrs:!1,props:{value:Boolean},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onChange(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||M.required}}}},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-checkbox-input",on:{click:function(t){t.stopPropagation()}}},[e("input",{ref:"input",staticClass:"k-checkbox-input-native input-hidden",attrs:{id:t.id,disabled:t.disabled,type:"checkbox"},domProps:{checked:t.value},on:{change:function(e){return t.onChange(e.target.checked)}}}),e("span",{staticClass:"k-checkbox-input-icon",attrs:{"aria-hidden":"true"}},[e("svg",{attrs:{width:"12",height:"10",viewBox:"0 0 12 10",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{d:"M1 5l3.3 3L11 1","stroke-width":"2",fill:"none","fill-rule":"evenodd"}})])]),e("span",{staticClass:"k-checkbox-input-label",domProps:{innerHTML:t._s(t.label)}})])}),[],!1,null,null,null,null).exports,je={mixins:[xt,Ct,At,Et],props:{columns:Number,max:Number,min:Number,options:Array,value:{type:[Array,Object],default:()=>[]}}};const Ee=Q({mixins:[je],inheritAttrs:!1,data(){return{selected:this.toArray(this.value)}},watch:{value(t){this.selected=this.toArray(t)},selected(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},onInput(t,e){if(!0===e)this.selected.push(t);else{const e=this.selected.indexOf(t);-1!==e&&this.selected.splice(e,1)}this.$emit("input",this.selected)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()},toArray:t=>!0===Array.isArray(t)?t:"string"==typeof t?String(t).split(","):"object"==typeof t?Object.values(t):void 0},validations(){return{selected:{required:!this.required||M.required,min:!this.min||M.minLength(this.min),max:!this.max||M.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-checkboxes-input",style:"--columns:"+t.columns},[t.options.length?t._l(t.options,(function(s,n){return e("li",{key:n},[e("k-checkbox-input",{attrs:{id:t.id+"-"+n,label:s.text,value:-1!==t.selected.indexOf(s.value)},on:{input:function(e){return t.onInput(s.value,e)}}})],1)})):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.$t("options.none")))])],2)}),[],!1,null,null,null,null).exports,Me={mixins:[xt,Ct,At,Et],props:{display:{type:String,default:"DD.MM.YYYY"},max:String,min:String,step:{type:Object,default:()=>({size:1,unit:"day"})},type:{type:String,default:"date"},value:String}};const Le=Q({mixins:[Me],inheritAttrs:!1,data:()=>({dt:null,formatted:null}),computed:{inputType:()=>"date",pattern(){return this.$library.dayjs.pattern(this.display)},rounding(){return{...this.$options.props.step.default(),...this.step}}},watch:{value:{handler(t,e){if(t!==e){const e=this.toDatetime(t);this.commit(e)}},immediate:!0}},created(){this.$events.$on("keydown.cmd.s",this.onBlur)},destroyed(){this.$events.$off("keydown.cmd.s",this.onBlur)},methods:{alter(t){let e=this.parse()||this.round(this.$library.dayjs()),s=this.rounding.unit,n=this.rounding.size;const i=this.selection();null!==i&&("meridiem"===i.unit?(t="pm"===e.format("a")?"subtract":"add",s="hour",n=12):(s=i.unit,s!==this.rounding.unit&&(n=1))),e=e[t](n,s).round(this.rounding.unit,this.rounding.size),this.commit(e),this.emit(e),this.$nextTick((()=>this.select(i)))},commit(t){this.dt=t,this.formatted=this.pattern.format(t),this.$emit("invalid",this.$v.$invalid,this.$v)},emit(t){this.$emit("input",this.toISO(t))},focus(){this.$refs.input.focus()},onArrowDown(){this.alter("subtract")},onArrowUp(){this.alter("add")},onBlur(){const t=this.parse();this.commit(t),this.emit(t)},onEnter(){this.onBlur(),this.$nextTick((()=>this.$emit("submit")))},onInput(t){const e=this.parse(),s=this.pattern.format(e);if(!t||s==t)return this.commit(e),this.emit(e)},onTab(t){""!=this.$refs.input.value&&(this.onBlur(),this.$nextTick((()=>{const e=this.selection();if(this.$refs.input&&e.start===this.$refs.input.selectionStart&&e.end===this.$refs.input.selectionEnd-1)if(t.shiftKey){if(0===e.index)return;this.selectPrev(e.index)}else{if(e.index===this.pattern.parts.length-1)return;this.selectNext(e.index)}else{if(this.$refs.input&&this.$refs.input.selectionStart==e.end+1&&e.index==this.pattern.parts.length-1)return;if(this.$refs.input&&this.$refs.input.selectionEnd-1>e.end){const t=this.pattern.at(this.$refs.input.selectionEnd,this.$refs.input.selectionEnd);this.select(this.pattern.parts[t.index])}else this.select(this.pattern.parts[e.index])}t.preventDefault()})))},parse(){let t=this.$refs.input.value;return t=this.$library.dayjs.interpret(t,this.inputType),this.round(t)},round(t){return(null==t?void 0:t.round(this.rounding.unit,this.rounding.size))||null},select(t){var e;t||(t=this.selection()),null==(e=this.$refs.input)||e.setSelectionRange(t.start,t.end+1)},selectFirst(){this.select(this.pattern.parts[0])},selectLast(){this.select(this.pattern.parts[this.pattern.parts.length-1])},selectNext(t){this.select(this.pattern.parts[t+1])},selectPrev(t){this.select(this.pattern.parts[t-1])},selection(){return this.pattern.at(this.$refs.input.selectionStart,this.$refs.input.selectionEnd)},toDatetime(t){return this.round(this.$library.dayjs.iso(t,this.inputType))},toISO(t){return(null==t?void 0:t.toISO(this.inputType))||null}},validations(){return{value:{min:!this.dt||!this.min||(()=>this.dt.validate(this.min,"min",this.rounding.unit)),max:!this.dt||!this.max||(()=>this.dt.validate(this.max,"max",this.rounding.unit)),required:!this.required||(()=>!!this.dt)}}}},(function(){var t=this;return(0,t._self._c)("input",{directives:[{name:"direction",rawName:"v-direction"}],ref:"input",class:`k-text-input k-${t.type}-input`,attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled,placeholder:t.display,required:t.required,autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.formatted},on:{blur:t.onBlur,focus:function(e){return t.$emit("focus")},input:function(e){return t.onInput(e.target.value)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowDown.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.stopPropagation(),e.preventDefault(),t.onArrowUp.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.stopPropagation(),e.preventDefault(),t.onEnter.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:t.onTab.apply(null,arguments)}]}})}),[],!1,null,null,null,null).exports,Be={mixins:[xt,Ct,At,jt,Et],props:{autocomplete:{type:[Boolean,String],default:"off"},maxlength:Number,minlength:Number,pattern:String,placeholder:String,preselect:Boolean,spellcheck:{type:[Boolean,String],default:"off"},type:{type:String,default:"text"},value:String}};const De=Q({mixins:[Be],inheritAttrs:!1,data(){return{listeners:{...this.$listeners,input:t=>this.onInput(t.target.value)}}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||M.required,minLength:!this.minlength||M.minLength(this.minlength),maxLength:!this.maxlength||M.maxLength(this.maxlength),email:"email"!==this.type||M.email,url:"url"!==this.type||M.url,pattern:!this.pattern||(t=>!this.required&&!t||!this.$refs.input.validity.patternMismatch)}}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input"},"input",{autocomplete:t.autocomplete,autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,type:t.type,value:t.value},!1),t.listeners))}),[],!1,null,null,null,null).exports,Pe={mixins:[Be],props:{autocomplete:{type:String,default:"email"},placeholder:{type:String,default:()=>window.panel.$t("email.placeholder")},type:{type:String,default:"email"}}};const Ne=Q({extends:De,mixins:[Pe]},null,null,!1,null,null,null,null).exports;class Re extends Zt{get schema(){return{content:"bulletList|orderedList"}}}const Fe=Q({inheritAttrs:!1,props:{autofocus:Boolean,marks:{type:[Array,Boolean],default:!0},value:String},data(){return{list:this.value,html:this.value}},computed:{extensions:()=>[new Re({inline:!0})]},watch:{value(t){t!==this.html&&(this.list=t,this.html=t)}},methods:{focus(){this.$refs.input.focus()},onInput(t){let e=(new DOMParser).parseFromString(t,"text/html").querySelector("ul, ol");e&&0!==e.textContent.trim().length?(this.list=t,this.html=t.replace(/(

|<\/p>)/gi,""),this.$emit("input",this.html)):this.$emit("input",this.list="")}}},(function(){var t=this;return(0,t._self._c)("k-writer",t._b({ref:"input",staticClass:"k-list-input",attrs:{extensions:t.extensions,nodes:["bulletList","orderedList"],value:t.list},on:{input:t.onInput}},"k-writer",t.$props,!1))}),[],!1,null,null,null,null).exports,qe={mixins:[Ct,At,Et],props:{max:Number,min:Number,layout:String,options:Array,search:[Object,Boolean],separator:{type:String,default:","},sort:Boolean,value:{type:Array,required:!0,default:()=>[]}}};const ze=Q({mixins:[qe],inheritAttrs:!1,data(){return{state:this.value,q:null,limit:!0,scrollTop:0}},computed:{draggable(){return this.state.length>1&&!this.sort},dragOptions(){return{disabled:!this.draggable,draggable:".k-tag",delay:1}},emptyLabel(){return this.q?this.$t("search.results.none"):this.$t("options.none")},filtered(){var t;return(null==(t=this.q)?void 0:t.length)>=(this.search.min||0)?this.options.filter((t=>this.isFiltered(t))).map((t=>({...t,text:this.toHighlightedString(t.text)}))):this.options},more(){return!this.max||this.state.lengththis.options.find((e=>e.value===t))));if(!1===this.sort)return t;const e=t=>this.options.findIndex((e=>e.value===t.value));return t.sort(((t,s)=>e(t)-e(s)))},visible(){return this.limit?this.filtered.slice(0,this.search.display||this.filtered.length):this.filtered}},watch:{value(t){this.state=t,this.onInvalid()}},mounted(){this.onInvalid(),this.$events.$on("click",this.close),this.$events.$on("keydown.cmd.s",this.close)},destroyed(){this.$events.$off("click",this.close),this.$events.$off("keydown.cmd.s",this.close)},methods:{add(t){!0===this.more&&(this.state.push(t.value),this.onInput())},blur(){this.close()},close(){var t;!0===(null==(t=this.$refs.dropdown)?void 0:t.isOpen)&&(this.$refs.dropdown.close(),this.limit=!0)},focus(){var t;null==(t=this.$refs.dropdown)||t.open()},index(t){return this.state.findIndex((e=>e===t.value))},isFiltered(t){return String(t.text).match(this.regex)||String(t.value).match(this.regex)},isSelected(t){return-1!==this.index(t)},navigate(t){var e,s,n;"prev"===t&&(t="previous"),null==(n=null==(s=null==(e=document.activeElement)?void 0:e[t+"Sibling"])?void 0:s.focus)||n.call(s)},onClose(){var t;!1===(null==(t=this.$refs.dropdown)?void 0:t.isOpen)&&(document.activeElement===this.$parent.$el&&(this.q=null),this.$parent.$el.focus())},onEscape(){this.q?this.q=null:this.close()},onInput(){this.$emit("input",this.state)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onOpen(){this.$nextTick((()=>{var t,e,s;null==(e=null==(t=this.$refs.search)?void 0:t.focus)||e.call(t),(null==(s=this.$refs.dropdown)?void 0:s.$el)&&(this.$refs.dropdown.$el.querySelector(".k-multiselect-options").scrollTop=this.scrollTop)}))},remove(t){const e=this.index(t);this.state.splice(e,1),this.onInput()},select(t){this.scrollTop=this.$refs.dropdown.$el.querySelector(".k-multiselect-options").scrollTop,this.isSelected(t)?this.remove(t):this.add(t)},toHighlightedString(t){return(t=this.$helper.string.stripHTML(t)).replace(this.regex,"$1")}},validations(){return{state:{required:!this.required||M.required,minLength:!this.min||M.minLength(this.min),maxLength:!this.max||M.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("k-draggable",{staticClass:"k-multiselect-input",attrs:{list:t.state,options:t.dragOptions,"data-layout":t.layout,element:"k-dropdown"},on:{end:t.onInput},nativeOn:{click:function(e){return t.$refs.dropdown.toggle.apply(null,arguments)}},scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-dropdown-content",{ref:"dropdown",on:{open:t.onOpen,close:t.onClose},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:(e.stopPropagation(),t.close.apply(null,arguments))}}},[t.search?e("k-dropdown-item",{staticClass:"k-multiselect-search",attrs:{icon:"search"}},[e("input",{ref:"search",attrs:{placeholder:t.search.min?t.$t("search.min",{min:t.search.min}):t.$t("search")+" …"},domProps:{value:t.q},on:{input:function(e){t.q=e.target.value},keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:(e.stopPropagation(),t.onEscape.apply(null,arguments))}}})]):t._e(),e("div",{staticClass:"k-multiselect-options scroll-y-auto"},[t._l(t.visible,(function(s){return e("k-dropdown-item",{key:s.value,class:{"k-multiselect-option":!0,selected:t.isSelected(s),disabled:!t.more},attrs:{icon:t.isSelected(s)?"check":"circle-outline"},on:{click:function(e){return e.preventDefault(),t.select(s)}},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),e.stopPropagation(),t.select(s))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:(e.preventDefault(),e.stopPropagation(),t.select(s))}]}},[e("span",{domProps:{innerHTML:t._s(s.text)}})])})),0===t.filtered.length?e("k-dropdown-item",{staticClass:"k-multiselect-option",attrs:{disabled:!0}},[t._v(" "+t._s(t.emptyLabel)+" ")]):t._e()],2),t.visible.lengththis.onInput(t.target.value),blur:this.onBlur}}},watch:{value(t){this.number=t},number:{immediate:!0,handler(){this.onInvalid()}}},mounted(){this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{decimals(){const t=Number(this.step||0);return Math.floor(t)===t?0:-1!==t.toString().indexOf("e")?parseInt(t.toFixed(16).split(".")[1].split("").reverse().join("")).toString().length:t.toString().split(".")[1].length||0},format(t){if(isNaN(t)||""===t)return"";const e=this.decimals();return t=e?parseFloat(t).toFixed(e):Number.isInteger(this.step)?parseInt(t):parseFloat(t)},clean(){this.number=this.format(this.number)},emit(t){t=parseFloat(t),isNaN(t)&&(t=""),t!==this.value&&this.$emit("input",t)},focus(){this.$refs.input.focus()},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.number=t,this.emit(t)},onBlur(){this.clean(),this.emit(this.number)},select(){this.$refs.input.select()}},validations(){return{value:{required:!this.required||M.required,min:!this.min||M.minValue(this.min),max:!this.max||M.maxValue(this.max)}}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({ref:"input",staticClass:"k-number-input",attrs:{step:t.stepNumber,type:"number"},domProps:{value:t.number},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.ctrlKey?t.clean.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?t.clean.apply(null,arguments):null}]}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,null,null,null,null).exports,Ue={mixins:[Be],props:{autocomplete:{type:String,default:"new-password"},type:{type:String,default:"password"}}};const Ke=Q({extends:De,mixins:[Ue]},null,null,!1,null,null,null,null).exports,Ve={mixins:[xt,Ct,At,Et],props:{columns:Number,options:Array,value:[String,Number,Boolean]}};const Je=Q({mixins:[Ve],inheritAttrs:!1,watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){var t;null==(t=this.$el.querySelector("input"))||t.focus()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||M.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-radio-input",style:"--columns:"+t.columns},[t.options.length?t._l(t.options,(function(s,n){return e("li",{key:n},[e("input",{staticClass:"k-radio-input-native",attrs:{id:t.id+"-"+n,name:t.id,type:"radio"},domProps:{value:s.value,checked:t.value===s.value},on:{change:function(e){return t.onInput(s.value)}}}),s.info?e("label",{attrs:{for:t.id+"-"+n}},[e("span",{staticClass:"k-radio-input-text",domProps:{innerHTML:t._s(s.text)}}),e("span",{staticClass:"k-radio-input-info",domProps:{innerHTML:t._s(s.info)}})]):e("label",{attrs:{for:t.id+"-"+n},domProps:{innerHTML:t._s(s.text)}}),s.icon?e("k-icon",{attrs:{type:s.icon}}):t._e()],1)})):e("k-box",{attrs:{theme:"info"}},[t._v(t._s(t.$t("options.none")))])],2)}),[],!1,null,null,null,null).exports,Ge={mixins:[xt,Ct,At,jt,Et],props:{default:[Number,String],max:{type:Number,default:100},min:{type:Number,default:0},step:{type:Number,default:1},tooltip:{type:[Boolean,Object],default:()=>({before:null,after:null})},value:[Number,String]}};const We=Q({mixins:[Ge],inheritAttrs:!1,data(){return{listeners:{...this.$listeners,input:t=>this.onInput(t.target.value)}}},computed:{baseline(){return this.min<0?0:this.min},label(){return this.required||this.value||0===this.value?this.format(this.position):"–"},position(){return this.value||0===this.value?this.value:this.default||this.baseline}},watch:{position(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},format(t){const e=document.lang?document.lang.replace("_","-"):"en",s=this.step.toString().split("."),n=s.length>1?s[1].length:0;return new Intl.NumberFormat(e,{minimumFractionDigits:n}).format(t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.$emit("input",t)}},validations(){return{position:{required:!this.required||M.required,min:!this.min||M.minValue(this.min),max:!this.max||M.maxValue(this.max)}}}},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-range-input"},[e("input",t._g(t._b({ref:"input",staticClass:"k-range-input-native",style:`--min: ${t.min}; --max: ${t.max}; --value: ${t.position}`,attrs:{type:"range"},domProps:{value:t.position}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,max:t.max,min:t.min,name:t.name,required:t.required,step:t.step},!1),t.listeners)),t.tooltip?e("span",{staticClass:"k-range-input-tooltip"},[t.tooltip.before?e("span",{staticClass:"k-range-input-tooltip-before"},[t._v(t._s(t.tooltip.before))]):t._e(),e("span",{staticClass:"k-range-input-tooltip-text"},[t._v(t._s(t.label))]),t.tooltip.after?e("span",{staticClass:"k-range-input-tooltip-after"},[t._v(t._s(t.tooltip.after))]):t._e()]):t._e()])}),[],!1,null,null,null,null).exports,Xe={mixins:[xt,Ct,At,jt,Et],props:{ariaLabel:String,default:String,empty:{type:[Boolean,String],default:!0},placeholder:String,options:Array,value:{type:[String,Number,Boolean],default:""}}};const Ze=Q({mixins:[Xe],inheritAttrs:!1,data(){return{selected:this.value,listeners:{...this.$listeners,click:t=>this.onClick(t),change:t=>this.onInput(t.target.value),input:()=>{}}}},computed:{emptyOption(){return this.placeholder||"—"},hasEmptyOption(){return!1!==this.empty&&!(this.required&&this.default)},label(){const t=this.text(this.selected);return""===this.selected||null===this.selected||null===t?this.emptyOption:t}},watch:{value(t){this.selected=t,this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onClick(t){t.stopPropagation(),this.$emit("click",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onInput(t){this.selected=t,this.$emit("input",this.selected)},select(){this.focus()},text(t){let e=null;return this.options.forEach((s=>{s.value==t&&(e=s.text)})),e}},validations(){return{selected:{required:!this.required||M.required}}}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-select-input",attrs:{"data-disabled":t.disabled,"data-empty":""===t.selected}},[e("select",t._g({ref:"input",staticClass:"k-select-input-native",attrs:{id:t.id,autofocus:t.autofocus,"aria-label":t.ariaLabel,disabled:t.disabled,name:t.name,required:t.required},domProps:{value:t.selected}},t.listeners),[t.hasEmptyOption?e("option",{attrs:{disabled:t.required,value:""}},[t._v(" "+t._s(t.emptyOption)+" ")]):t._e(),t._l(t.options,(function(s){return e("option",{key:s.value,attrs:{disabled:s.disabled},domProps:{value:s.value}},[t._v(" "+t._s(s.text)+" ")])}))],2),t._v(" "+t._s(t.label)+" ")])}),[],!1,null,null,null,null).exports,Qe={mixins:[Be],props:{allow:{type:String,default:""},formData:{type:Object,default:()=>({})},sync:{type:String}}};const ts=Q({extends:De,mixins:[Qe],data(){return{slug:this.sluggify(this.value),slugs:this.$language?this.$language.rules:this.$system.slugs,syncValue:null}},watch:{formData:{handler(t){return!this.disabled&&(!(!this.sync||void 0===t[this.sync])&&(t[this.sync]!=this.syncValue&&(this.syncValue=t[this.sync],void this.onInput(this.sluggify(this.syncValue)))))},deep:!0,immediate:!0},value(t){(t=this.sluggify(t))!==this.slug&&(this.slug=t,this.$emit("input",this.slug))}},methods:{sluggify(t){return this.$helper.slug(t,[this.slugs,this.$system.ascii],this.allow)},onInput(t){this.slug=this.sluggify(t),this.$emit("input",this.slug)}}},(function(){var t=this;return(0,t._self._c)("input",t._g(t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-text-input",attrs:{autocomplete:"off",spellcheck:"false",type:"text"},domProps:{value:t.slug}},"input",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,pattern:t.pattern,placeholder:t.placeholder,required:t.required},!1),t.listeners))}),[],!1,null,null,null,null).exports,es={mixins:[xt,Ct,At,jt,Et],props:{accept:{type:String,default:"all"},icon:{type:[String,Boolean],default:"tag"},layout:String,max:Number,min:Number,options:{type:Array,default:()=>[]},separator:{type:String,default:","},value:{type:Array,default:()=>[]}}};const ss=Q({mixins:[es],inheritAttrs:!1,data(){return{tags:this.toValues(this.value),selected:null,newTag:null}},computed:{dragOptions(){return{delay:1,disabled:!this.draggable,draggable:".k-tag"}},draggable(){return this.tags.length>1},skip(){return this.tags.map((t=>t.value))}},watch:{value(t){this.tags=this.toValues(t),this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{addString(t,e=!0){if(!t)return;if(0===(t=t.trim()).length)return;if(!0===t.includes(this.separator)){for(const e of t.split(this.separator))this.addString(e);return}const s=this.toValue(t);s&&this.addTag(s,e)},addTag(t,e=!0){this.addTagToIndex(t),this.$refs.autocomplete.close(),e&&this.$refs.input.focus()},addTagToIndex(t){if("options"===this.accept){if(!this.options.find((e=>e.value===t.value)))return}-1===this.index(t)&&(!this.max||this.tags.length=this.tags.length)return;break;case"first":e=0;break;case"last":e=this.tags.length-1;break;default:e=t}let n=this.tags[e];if(n){let t=this.$refs[n.value];if(null==t?void 0:t[0])return{ref:t[0],tag:n,index:e}}return!1},index(t){return this.tags.findIndex((e=>e.value===t.value))},navigate(t){var e=this.get(t);e?(e.ref.focus(),this.selectTag(e.tag)):"next"===t&&(this.$refs.input.focus(),this.selectTag(null))},onBack(t){0===t.target.selectionStart&&t.target.selectionStart===t.target.selectionEnd&&0!==this.tags.length&&(this.$refs.autocomplete.close(),this.navigate("last"),t.preventDefault())},onBlur(t){var e;let s=t.relatedTarget||t.explicitOriginalTarget;(null==(e=this.$refs.autocomplete.$el)?void 0:e.contains(s))||this.addString(this.$refs.input.value,!1)},onEnter(t){if(!this.newTag||0===this.newTag.length)return!0;t.preventDefault(),this.addString(this.newTag)},onInput(){const t=this.tags.map((t=>t.value));this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onSubmit(t){t.preventDefault(),t.stopImmediatePropagation(),this.onBlur(t),this.$emit("submit",t)},onTab(t){var e;(null==(e=this.newTag)?void 0:e.length)>0&&(t.preventDefault(),this.addString(this.newTag))},onType(t){this.newTag=t,this.$refs.autocomplete.search(t)},remove(t){const e=this.get("prev"),s=this.get("next");this.tags.splice(this.index(t),1),this.onInput(),e?(this.selectTag(e.tag),e.ref.focus()):s?this.selectTag(s.tag):(this.selectTag(null),this.$refs.input.focus())},select(){this.focus()},selectTag(t){this.selected=t},toValue(t){const e=this.options.find((e=>e.value===t));return"options"===this.accept?e:e||("string"==typeof t&&(t={value:t}),{value:t.value,text:this.$helper.string.escapeHTML(t.text??t.value)})},toValues(t){return"object"==typeof t&&(t=Object.values(t)),!1===Array.isArray(t)?[]:t.map(this.toValue).filter((t=>t))}},validations(){return{tags:{required:!this.required||M.required,minLength:!this.min||M.minLength(this.min),maxLength:!this.max||M.maxLength(this.max)}}}},(function(){var t=this,e=t._self._c;return e("k-draggable",{directives:[{name:"direction",rawName:"v-direction"}],staticClass:"k-tags-input",attrs:{list:t.tags,options:t.dragOptions,"data-layout":t.layout},on:{end:t.onInput},scopedSlots:t._u([{key:"footer",fn:function(){return[e("span",{staticClass:"k-tags-input-element"},[e("k-autocomplete",{ref:"autocomplete",attrs:{html:!0,options:t.options,skip:t.skip},on:{select:t.addTag,leave:function(e){return t.$refs.input.focus()}}},[e("input",{ref:"input",attrs:{id:t.id,autofocus:t.autofocus,disabled:t.disabled||t.max&&t.tags.length>=t.max,name:t.name,autocomplete:"off",type:"text"},domProps:{value:t.newTag},on:{input:function(e){return t.onType(e.target.value)},blur:t.onBlur,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"s",void 0,e.key,void 0)?null:e.metaKey?t.onSubmit.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onBack.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onEnter.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onTab.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"backspace",void 0,e.key,void 0)||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onBack.apply(null,arguments)}]}})])],1)]},proxy:!0}])},t._l(t.tags,(function(s){return e("k-tag",{key:s.value,ref:s.value,refInFor:!0,attrs:{removable:!t.disabled,name:"tag"},on:{remove:function(e){return t.remove(s)}},nativeOn:{click:function(t){t.stopPropagation()},blur:function(e){return t.selectTag(null)},focus:function(e){return t.selectTag(s)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:t.navigate("prev")},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:t.navigate("next")}],dblclick:function(e){return t.edit(s)}}},[e("span",{domProps:{innerHTML:t._s(s.text)}})])})),1)}),[],!1,null,null,null,null).exports,ns={mixins:[Be],props:{autocomplete:{type:String,default:"tel"},type:{type:String,default:"tel"}}};const is=Q({extends:De,mixins:[ns]},null,null,!1,null,null,null,null).exports,os={mixins:[xt,Ct,At,jt,Et],props:{buttons:{type:[Boolean,Array],default:!0},endpoints:Object,font:String,maxlength:Number,minlength:Number,placeholder:String,preselect:Boolean,size:String,spellcheck:{type:[Boolean,String],default:"off"},theme:String,uploads:[Boolean,Object,Array],value:String}};const rs=Q({mixins:[os],inheritAttrs:!1,data:()=>({over:!1}),watch:{value(){this.onInvalid(),this.$nextTick((()=>{this.resize()}))}},mounted(){this.$nextTick((()=>{this.$library.autosize(this.$refs.input)})),this.onInvalid(),this.$props.autofocus&&this.focus(),this.$props.preselect&&this.select()},methods:{cancel(){this.$refs.input.focus()},dialog(t){if(!this.$refs[t+"Dialog"])throw"Invalid toolbar dialog";this.$refs[t+"Dialog"].open(this.$refs.input,this.selection())},focus(){this.$refs.input.focus()},insert(t){const e=this.$refs.input,s=e.value;setTimeout((()=>{if(e.focus(),document.execCommand("insertText",!1,t),e.value===s){const s=e.value.slice(0,e.selectionStart)+t+e.value.slice(e.selectionEnd);e.value=s,this.$emit("input",s)}})),this.resize()},insertFile(t){(null==t?void 0:t.length)>0&&this.insert(t.map((t=>t.dragText)).join("\n\n"))},insertUpload(t,e){this.insert(e.map((t=>t.dragText)).join("\n\n")),this.$events.$emit("model.update")},onClick(){this.$refs.toolbar&&this.$refs.toolbar.close()},onCommand(t,e){"function"==typeof this[t]?"function"==typeof e?this[t](e(this.$refs.input,this.selection())):this[t](e):window.console.warn(t+" is not a valid command")},onDrop(t){if(this.uploads&&this.$helper.isUploadEvent(t))return this.$refs.fileUpload.drop(t.dataTransfer.files,{url:this.$urls.api+"/"+this.endpoints.field+"/upload",multiple:!1});const e=this.$store.state.drag;"text"===(null==e?void 0:e.type)&&(this.focus(),this.insert(e.data))},onFocus(t){this.$emit("focus",t)},onInput(t){this.$emit("input",t.target.value)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},onOut(){this.$refs.input.blur(),this.over=!1},onOver(t){if(this.uploads&&this.$helper.isUploadEvent(t))return t.dataTransfer.dropEffect="copy",this.focus(),void(this.over=!0);const e=this.$store.state.drag;"text"===(null==e?void 0:e.type)&&(t.dataTransfer.dropEffect="copy",this.focus(),this.over=!0)},onShortcut(t){!1!==this.buttons&&"Meta"!==t.key&&"Control"!==t.key&&this.$refs.toolbar&&this.$refs.toolbar.shortcut(t.key,t)},onSubmit(t){return this.$emit("submit",t)},prepend(t){this.insert(t+" "+this.selection())},resize(){this.$library.autosize.update(this.$refs.input)},select(){this.$refs.select()},selectFile(){this.$refs.fileDialog.open({endpoint:this.endpoints.field+"/files",multiple:!1})},selection(){const t=this.$refs.input,e=t.selectionStart,s=t.selectionEnd;return t.value.substring(e,s)},uploadFile(){this.$refs.fileUpload.open({url:this.$urls.api+"/"+this.endpoints.field+"/upload",multiple:!1})},wrap(t){this.insert(t+this.selection()+t)}},validations(){return{value:{required:!this.required||M.required,minLength:!this.minlength||M.minLength(this.minlength),maxLength:!this.maxlength||M.maxLength(this.maxlength)}}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-textarea-input",attrs:{"data-over":t.over,"data-size":t.size,"data-theme":t.theme}},[e("div",{staticClass:"k-textarea-input-wrapper"},[t.buttons&&!t.disabled?e("k-toolbar",{ref:"toolbar",attrs:{buttons:t.buttons,disabled:t.disabled,uploads:t.uploads},on:{command:t.onCommand},nativeOn:{mousedown:function(t){t.preventDefault()}}}):t._e(),e("textarea",t._b({directives:[{name:"direction",rawName:"v-direction"}],ref:"input",staticClass:"k-textarea-input-native",attrs:{"data-font":t.font},on:{click:t.onClick,focus:t.onFocus,input:t.onInput,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.metaKey?t.onSubmit.apply(null,arguments):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.ctrlKey?t.onSubmit.apply(null,arguments):null},function(e){return e.metaKey?t.onShortcut.apply(null,arguments):null},function(e){return e.ctrlKey?t.onShortcut.apply(null,arguments):null}],dragover:t.onOver,dragleave:t.onOut,drop:t.onDrop}},"textarea",{autofocus:t.autofocus,disabled:t.disabled,id:t.id,minlength:t.minlength,name:t.name,placeholder:t.placeholder,required:t.required,spellcheck:t.spellcheck,value:t.value},!1))],1),e("k-toolbar-email-dialog",{ref:"emailDialog",on:{cancel:t.cancel,submit:function(e){return t.insert(e)}}}),e("k-toolbar-link-dialog",{ref:"linkDialog",on:{cancel:t.cancel,submit:function(e){return t.insert(e)}}}),e("k-files-dialog",{ref:"fileDialog",on:{cancel:t.cancel,submit:function(e){return t.insertFile(e)}}}),t.uploads?e("k-upload",{ref:"fileUpload",on:{success:t.insertUpload}}):t._e()],1)}),[],!1,null,null,null,null).exports,ls={props:{display:{type:String,default:"HH:mm"},max:String,min:String,step:{type:Object,default:()=>({size:5,unit:"minute"})},type:{type:String,default:"time"},value:String}};const as=Q({mixins:[Le,ls],computed:{inputType:()=>"time"}},null,null,!1,null,null,null,null).exports,us={props:{autofocus:Boolean,disabled:Boolean,id:[Number,String],text:{type:[Array,String]},required:Boolean,value:Boolean}};const cs=Q({mixins:[us],inheritAttrs:!1,computed:{label(){const t=this.text||[this.$t("off"),this.$t("on")];return Array.isArray(t)?this.value?t[1]:t[0]:t}},watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){this.$refs.input.focus()},onEnter(t){"Enter"===t.key&&this.$refs.input.click()},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.$refs.input.focus()}},validations(){return{value:{required:!this.required||M.required}}}},(function(){var t=this,e=t._self._c;return e("label",{staticClass:"k-toggle-input",attrs:{"data-disabled":t.disabled}},[e("input",{ref:"input",staticClass:"k-toggle-input-native",attrs:{id:t.id,disabled:t.disabled,type:"checkbox"},domProps:{checked:t.value},on:{change:function(e){return t.onInput(e.target.checked)}}}),e("span",{staticClass:"k-toggle-input-label",domProps:{innerHTML:t._s(t.label)}})])}),[],!1,null,null,null,null).exports,ds={mixins:[xt,Ct,At,Et],props:{columns:Number,grow:Boolean,labels:Boolean,options:Array,reset:Boolean,value:[String,Number,Boolean]}};const ps=Q({mixins:[ds],inheritAttrs:!1,watch:{value(){this.onInvalid()}},mounted(){this.onInvalid(),this.$props.autofocus&&this.focus()},methods:{focus(){(this.$el.querySelector("input[checked]")||this.$el.querySelector("input")).focus()},onClick(t){t===this.value&&this.reset&&!this.required&&this.$emit("input","")},onInput(t){this.$emit("input",t)},onInvalid(){this.$emit("invalid",this.$v.$invalid,this.$v)},select(){this.focus()}},validations(){return{value:{required:!this.required||M.required}}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-toggles-input",style:"--options:"+(t.columns||t.options.length),attrs:{"data-invalid":t.$v.$invalid,"data-labels":t.labels}},t._l(t.options,(function(s,n){return e("li",{key:n},[e("input",{staticClass:"input-hidden",attrs:{id:t.id+"-"+n,name:t.id,type:"radio"},domProps:{value:s.value,checked:t.value===s.value},on:{click:function(e){return t.onClick(s.value)},change:function(e){return t.onInput(s.value)}}}),e("label",{attrs:{for:t.id+"-"+n,title:s.text}},[s.icon?e("k-icon",{attrs:{type:s.icon}}):t._e(),t.labels?e("span",{staticClass:"k-toggles-text",domProps:{innerHTML:t._s(s.text)}}):t._e()],1)])})),0)}),[],!1,null,null,null,null).exports,hs={mixins:[Be],props:{autocomplete:{type:String,default:"url"},type:{type:String,default:"url"}}};const ms=Q({extends:De,mixins:[hs]},null,null,!1,null,null,null,null).exports,fs={install(t){t.component("k-checkbox-input",Ie),t.component("k-checkboxes-input",Ee),t.component("k-date-input",Le),t.component("k-email-input",Ne),t.component("k-list-input",Fe),t.component("k-multiselect-input",ze),t.component("k-number-input",He),t.component("k-password-input",Ke),t.component("k-radio-input",Je),t.component("k-range-input",We),t.component("k-select-input",Ze),t.component("k-slug-input",ts),t.component("k-tags-input",ss),t.component("k-tel-input",is),t.component("k-text-input",De),t.component("k-textarea-input",rs),t.component("k-time-input",as),t.component("k-toggle-input",cs),t.component("k-toggles-input",ps),t.component("k-url-input",ms)}};const gs=Q({mixins:[Mt],inheritAttrs:!1,props:{autofocus:Boolean,empty:String,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},data:()=>({opened:[]}),computed:{hasFieldsets(){return Object.keys(this.fieldsets).length},isEmpty(){return 0===this.value.length},isFull(){return null!==this.max&&this.value.length>=this.max}},methods:{focus(){this.$refs.blocks.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-blocks-field",scopedSlots:t._u([{key:"options",fn:function(){return[t.hasFieldsets?e("k-dropdown",[e("k-button",{attrs:{icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"add"},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}},[t._v(" "+t._s(t.$t("add"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"template"},on:{click:function(e){return t.$refs.blocks.copyAll()}}},[t._v(" "+t._s(t.$t("copy.all"))+" ")]),e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"download"},on:{click:function(e){return t.$refs.blocks.pasteboard()}}},[t._v(" "+t._s(t.$t("paste"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{disabled:t.isEmpty,icon:"trash"},on:{click:function(e){return t.$refs.blocks.confirmToRemoveAll()}}},[t._v(" "+t._s(t.$t("delete.all"))+" ")])],1)],1):t._e()]},proxy:!0}])},"k-field",t.$props,!1),[e("k-blocks",t._g({ref:"blocks",attrs:{autofocus:t.autofocus,compact:!1,empty:t.empty,endpoints:t.endpoints,fieldsets:t.fieldsets,"fieldset-groups":t.fieldsetGroups,group:t.group,max:t.max,value:t.value},on:{close:function(e){t.opened=e},open:function(e){t.opened=e}}},t.$listeners)),t.isEmpty||t.isFull?t._e():e("k-button",{staticClass:"k-field-add-item-button",attrs:{icon:"add",tooltip:t.$t("add")},on:{click:function(e){return t.$refs.blocks.choose(t.value.length)}}})],1)}),[],!1,null,null,null,null).exports,ks={props:{counter:{type:Boolean,default:!0}},computed:{counterOptions(){if(null===this.value||this.disabled||!1===this.counter)return!1;let t=0;return this.value&&(t=Array.isArray(this.value)?this.value.length:String(this.value).length),{count:t,min:this.min??this.minlength,max:this.max??this.maxlength}}}};const bs=Q({mixins:[Mt,Dt,je,ks],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-checkboxes-field",attrs:{counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"checkboxes"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const vs=Q({mixins:[Mt,Dt,Me],inheritAttrs:!1,props:{calendar:{type:Boolean,default:!0},icon:{type:String,default:"calendar"},time:{type:[Boolean,Object],default:()=>({})},times:{type:Boolean,default:!0}},data(){return{isInvalid:!1,iso:this.toIso(this.value)}},computed:{isEmpty(){return this.time?null===this.iso.date&&this.iso.time:null===this.iso.date}},watch:{value(t,e){t!==e&&(this.iso=this.toIso(t))}},methods:{focus(){this.$refs.dateInput.focus()},now(){const t=this.$library.dayjs();return{date:t.toISO("date"),time:this.time?t.toISO("time"):"00:00:00"}},onInput(){if(this.isEmpty)return this.$emit("input","");const t=this.$library.dayjs.iso(this.iso.date+" "+this.iso.time);(t||null!==this.iso.date&&null!==this.iso.time)&&this.$emit("input",(null==t?void 0:t.toISO())||"")},onCalendarInput(t){var e;null==(e=this.$refs.calendar)||e.close(),this.onDateInput(t)},onDateInput(t){t&&!this.iso.time&&(this.iso.time=this.now().time),this.iso.date=t,this.onInput()},onDateInvalid(t){this.isInvalid=t},onTimeInput(t){t&&!this.iso.date&&(this.iso.date=this.now().date),this.iso.time=t,this.onInput()},onTimesInput(t){var e;null==(e=this.$refs.times)||e.close(),this.onTimeInput(t+":00")},toIso(t){const e=this.$library.dayjs.iso(t);return{date:(null==e?void 0:e.toISO("date"))||null,time:(null==e?void 0:e.toISO("time"))||null}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-date-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("div",{ref:"body",staticClass:"k-date-field-body",attrs:{"data-invalid":!t.novalidate&&t.isInvalid,"data-theme":"field"}},[e("k-input",t._b({ref:"dateInput",attrs:{id:t._uid,autofocus:t.autofocus,disabled:t.disabled,display:t.display,max:t.max,min:t.min,required:t.required,value:t.value,theme:"field",type:"date"},on:{invalid:t.onDateInvalid,input:t.onDateInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.calendar?{key:"icon",fn:function(){return[e("k-dropdown",[e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,tooltip:t.$t("date.select")},on:{click:function(e){return t.$refs.calendar.toggle()}}}),e("k-dropdown-content",{ref:"calendar",attrs:{align:"right"}},[e("k-calendar",{attrs:{value:t.value,min:t.min,max:t.max},on:{input:t.onCalendarInput}})],1)],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1)),t.time?e("k-input",{ref:"timeInput",attrs:{disabled:t.disabled,display:t.time.display,required:t.required,step:t.time.step,value:t.iso.time,icon:t.time.icon,theme:"field",type:"time"},on:{input:t.onTimeInput,submit:function(e){return t.$emit("submit")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-dropdown",[e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.time.icon||"clock",tooltip:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{align:"right"}},[e("k-times",{attrs:{display:t.time.display,value:t.value},on:{input:t.onTimesInput}})],1)],1)]},proxy:!0}:null],null,!0)}):t._e()],1)])}),[],!1,null,null,null,null).exports;const ys=Q({mixins:[Mt,Dt,Pe],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"email"}},computed:{mailto(){var t;return(null==(t=this.value)?void 0:t.length)>0?"mailto:"+this.value:null}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-email-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"email"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.mailto,tooltip:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports,$s={mixins:[Mt],inheritAttrs:!1,props:{empty:String,info:String,link:Boolean,layout:{type:String,default:"list"},max:Number,multiple:Boolean,parent:String,search:Boolean,size:String,text:String,value:{type:Array,default:()=>[]}},data(){return{selected:this.value}},computed:{btnIcon(){return!this.multiple&&this.selected.length>0?"refresh":"add"},btnLabel(){return!this.multiple&&this.selected.length>0?this.$t("change"):this.$t("add")},collection(){return{empty:this.emptyProps,items:this.selected,layout:this.layout,link:this.link,size:this.size,sortable:!this.disabled&&this.selected.length>1}},isInvalid(){return!(!this.required||0!==this.selected.length)||(!!(this.min&&this.selected.lengththis.max))},items(){return this.models.map(this.item)},more(){return!this.max||this.max>this.selected.length}},watch:{value(t){this.selected=t}},methods:{focus(){},item:t=>t,onInput(){this.$emit("input",this.selected)},open(){if(this.disabled)return!1;this.$refs.selector.open({endpoint:this.endpoints.field,max:this.max,multiple:this.multiple,search:this.search,selected:this.selected.map((t=>t.id))})},remove(t){this.selected.splice(t,1),this.onInput()},removeById(t){this.selected=this.selected.filter((e=>e.id!==t)),this.onInput()},select(t){0!==t.length?(this.selected=this.selected.filter((e=>t.filter((t=>t.id===e.id)).length>0)),t.forEach((t=>{0===this.selected.filter((e=>t.id===e.id)).length&&this.selected.push(t)})),this.onInput()):this.selected=[]}}};const _s=Q({mixins:[$s],props:{uploads:[Boolean,Object,Array]},computed:{emptyProps(){return{icon:"image",text:this.empty||this.$t("field.files.empty")}},moreUpload(){return!this.disabled&&this.more&&this.uploads},options(){return this.uploads?{icon:this.btnIcon,text:this.btnLabel,options:[{icon:"check",text:this.$t("select"),click:"open"},{icon:"upload",text:this.$t("upload"),click:"upload"}]}:{options:[{icon:"check",text:this.$t("select"),click:()=>this.open()}]}},uploadParams(){return{accept:this.uploads.accept,max:this.max,multiple:this.multiple,url:this.$urls.api+"/"+this.endpoints.field+"/upload"}}},created(){this.$events.$on("file.delete",this.removeById)},destroyed(){this.$events.$off("file.delete",this.removeById)},methods:{drop(t){return!1!==this.uploads&&this.$refs.fileUpload.drop(t,this.uploadParams)},prompt(){if(this.disabled)return!1;this.moreUpload?this.$refs.options.toggle():this.open()},onAction(t){if(this.moreUpload)switch(t){case"open":return this.open();case"upload":return this.$refs.fileUpload.open(this.uploadParams)}},isSelected(t){return this.selected.find((e=>e.id===t.id))},upload(t,e){!1===this.multiple&&(this.selected=[]),e.forEach((t=>{this.isSelected(t)||this.selected.push(t)})),this.onInput(),this.$events.$emit("model.update")}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-files-field",scopedSlots:t._u([t.more&&!t.disabled?{key:"options",fn:function(){return[e("k-button-group",{staticClass:"k-field-options"},[e("k-options-dropdown",t._b({ref:"options",on:{action:t.onAction}},"k-options-dropdown",t.options,!1))],1)]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-dropzone",{attrs:{disabled:!t.moreUpload},on:{drop:t.drop}},[e("k-collection",t._b({on:{empty:t.prompt,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function({index:s}){return[t.disabled?t._e():e("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(s)}}})]}}])},"k-collection",t.collection,!1))],1),e("k-files-dialog",{ref:"selector",on:{submit:t.select}}),e("k-upload",{ref:"fileUpload",on:{success:t.upload}})],1)}),[],!1,null,null,null,null).exports;const ws=Q({},(function(){return(0,this._self._c)("div",{staticClass:"k-field k-gap-field"})}),[],!1,null,null,null,null).exports;const xs=Q({mixins:[Ot,It],props:{numbered:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-headline-field"},[e("k-headline",{attrs:{"data-numbered":t.numbered,size:"large"}},[t._v(" "+t._s(t.label)+" ")]),t.help?e("footer",{staticClass:"k-field-footer"},[t.help?e("k-text",{staticClass:"k-field-help",attrs:{theme:"help",html:t.help}}):t._e()],1):t._e()],1)}),[],!1,null,null,null,null).exports;const Ss=Q({mixins:[Ot,It],props:{text:String,theme:{type:String,default:"info"}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-field k-info-field"},[e("k-headline",[t._v(t._s(t.label))]),e("k-box",{attrs:{theme:t.theme}},[e("k-text",{attrs:{html:t.text}})],1),t.help?e("footer",{staticClass:"k-field-footer"},[t.help?e("k-text",{staticClass:"k-field-help",attrs:{theme:"help",html:t.help}}):t._e()],1):t._e()],1)}),[],!1,null,null,null,null).exports;const Cs=Q({components:{"k-block-layouts":Q({components:{"k-layout":Q({components:{"k-layout-column":Q({props:{blocks:Array,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean,width:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column k-layout-column",attrs:{id:t.id,"data-width":t.width,tabindex:"0"},on:{dblclick:function(e){return t.$refs.blocks.choose(t.blocks.length)}}},[e("k-blocks",{ref:"blocks",attrs:{endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets,value:t.blocks,group:"layout"},on:{input:function(e){return t.$emit("input",e)}},nativeOn:{dblclick:function(t){t.stopPropagation()}}})],1)}),[],!1,null,null,null,null).exports},props:{attrs:[Array,Object],columns:Array,disabled:Boolean,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,id:String,isSelected:Boolean,settings:Object},computed:{tabs(){let t=this.settings.tabs;return Object.entries(t).forEach((([e,s])=>{Object.entries(s.fields).forEach((([s])=>{t[e].fields[s].endpoints={field:this.endpoints.field+"/fields/"+s,section:this.endpoints.section,model:this.endpoints.model}}))})),t}}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-layout",attrs:{"data-selected":t.isSelected,tabindex:"0"},on:{click:function(e){return t.$emit("select")}}},[e("k-grid",{staticClass:"k-layout-columns"},t._l(t.columns,(function(s,n){return e("k-layout-column",t._b({key:s.id,attrs:{endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets},on:{input:function(e){return t.$emit("updateColumn",{column:s,columnIndex:n,blocks:e})}}},"k-layout-column",s,!1))})),1),t.disabled?t._e():e("nav",{staticClass:"k-layout-toolbar"},[t.settings?e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{tooltip:t.$t("settings"),icon:"settings"},on:{click:function(e){return t.$refs.drawer.open()}}}):t._e(),e("k-dropdown",[e("k-button",{staticClass:"k-layout-toolbar-button",attrs:{icon:"angle-down"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{icon:"angle-up"},on:{click:function(e){return t.$emit("prepend")}}},[t._v(" "+t._s(t.$t("insert.before"))+" ")]),e("k-dropdown-item",{attrs:{icon:"angle-down"},on:{click:function(e){return t.$emit("append")}}},[t._v(" "+t._s(t.$t("insert.after"))+" ")]),e("hr"),t.settings?e("k-dropdown-item",{attrs:{icon:"settings"},on:{click:function(e){return t.$refs.drawer.open()}}},[t._v(" "+t._s(t.$t("settings"))+" ")]):t._e(),e("k-dropdown-item",{attrs:{icon:"copy"},on:{click:function(e){return t.$emit("duplicate")}}},[t._v(" "+t._s(t.$t("duplicate"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:"trash"},on:{click:function(e){return t.$refs.confirmRemoveDialog.open()}}},[t._v(" "+t._s(t.$t("field.layout.delete"))+" ")])],1)],1),e("k-sort-handle")],1),t.settings?e("k-form-drawer",{ref:"drawer",staticClass:"k-layout-drawer",attrs:{tabs:t.tabs,title:t.$t("settings"),value:t.attrs,icon:"settings"},on:{input:function(e){return t.$emit("updateAttrs",e)}}}):t._e(),e("k-remove-dialog",{ref:"confirmRemoveDialog",attrs:{text:t.$t("field.layout.delete.confirm")},on:{submit:function(e){return t.$emit("remove")}}})],1)}),[],!1,null,null,null,null).exports},props:{disabled:Boolean,empty:String,endpoints:Object,fieldsetGroups:Object,fieldsets:Object,layouts:Array,max:Number,settings:Object,value:Array},data(){return{currentLayout:null,nextIndex:null,rows:this.value,selected:null}},computed:{draggableOptions(){return{id:this._uid,handle:!0,list:this.rows}}},watch:{value(){this.rows=this.value}},methods:{async addLayout(t){let e=await this.$api.post(this.endpoints.field+"/layout",{columns:t});this.rows.splice(this.nextIndex,0,e),this.layouts.length>1&&this.$refs.selector.close(),this.save()},duplicateLayout(t,e){let s={...this.$helper.clone(e),id:this.$helper.uuid()};s.columns=s.columns.map((t=>(t.id=this.$helper.uuid(),t.blocks=t.blocks.map((t=>(t.id=this.$helper.uuid(),t))),t))),this.rows.splice(t+1,0,s),this.save()},removeLayout(t){const e=this.rows.findIndex((e=>e.id===t.id));-1!==e&&this.$delete(this.rows,e),this.save()},save(){this.$emit("input",this.rows)},selectLayout(t){this.nextIndex=t,1!==this.layouts.length?this.$refs.selector.open():this.addLayout(this.layouts[0])},updateColumn(t){this.rows[t.layoutIndex].columns[t.columnIndex].blocks=t.blocks,this.save()},updateAttrs(t,e){this.rows[t].attrs=e,this.save()}}},(function(){var t=this,e=t._self._c;return e("div",[t.rows.length?[e("k-draggable",t._b({staticClass:"k-layouts",on:{sort:t.save}},"k-draggable",t.draggableOptions,!1),t._l(t.rows,(function(s,n){return e("k-layout",t._b({key:s.id,attrs:{disabled:t.disabled,endpoints:t.endpoints,"fieldset-groups":t.fieldsetGroups,fieldsets:t.fieldsets,"is-selected":t.selected===s.id,settings:t.settings},on:{append:function(e){return t.selectLayout(n+1)},duplicate:function(e){return t.duplicateLayout(n,s)},prepend:function(e){return t.selectLayout(n)},remove:function(e){return t.removeLayout(s)},select:function(e){t.selected=s.id},updateAttrs:function(e){return t.updateAttrs(n,e)},updateColumn:function(e){return t.updateColumn({layout:s,layoutIndex:n,...e})}}},"k-layout",s,!1))})),1),t.disabled?t._e():e("k-button",{staticClass:"k-field-add-item-button",attrs:{icon:"add",tooltip:t.$t("add")},on:{click:function(e){return t.selectLayout(t.rows.length)}}})]:[e("k-empty",{staticClass:"k-layout-empty",attrs:{icon:"dashboard"},on:{click:function(e){return t.selectLayout(0)}}},[t._v(" "+t._s(t.empty||t.$t("field.layout.empty"))+" ")])],e("k-dialog",{ref:"selector",staticClass:"k-layout-selector",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"}},[e("k-headline",[t._v(t._s(t.$t("field.layout.select")))]),e("ul",t._l(t.layouts,(function(s,n){return e("li",{key:n,staticClass:"k-layout-selector-option"},[e("k-grid",{nativeOn:{click:function(e){return t.addLayout(s)}}},t._l(s,(function(t,s){return e("k-column",{key:s,attrs:{width:t}})})),1)],1)})),0)],1)],2)}),[],!1,null,null,null,null).exports},mixins:[Mt],inheritAttrs:!1,props:{empty:String,fieldsetGroups:Object,fieldsets:Object,layouts:{type:Array,default:()=>[["1/1"]]},settings:Object,value:{type:Array,default:()=>[]}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-layout-field"},"k-field",t.$props,!1),[e("k-block-layouts",t._b({on:{input:function(e){return t.$emit("input",e)}}},"k-block-layouts",t.$props,!1))],1)}),[],!1,null,null,null,null).exports;const Os=Q({},(function(){return(0,this._self._c)("hr",{staticClass:"k-line-field"})}),[],!1,null,null,null,null).exports;const As=Q({mixins:[Mt,Dt],inheritAttrs:!1,props:{marks:[Array,Boolean],value:String},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-list-field",attrs:{input:t._uid,counter:!1}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{id:t._uid,marks:t.marks,value:t.value,type:"list",theme:"field"},on:{input:function(e){return t.$emit("input",e)}}},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports;const Ts=Q({mixins:[Mt,Dt,qe,ks],inheritAttrs:!1,props:{icon:{type:String,default:"angle-down"}},mounted(){this.$refs.input.$el.setAttribute("tabindex",0)},methods:{blur(t){this.$refs.input.blur(t)},focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-multiselect-field",attrs:{input:t._uid,counter:t.counterOptions},on:{blur:t.blur},nativeOn:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.focus.apply(null,arguments))}}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"multiselect"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Is=Q({mixins:[Mt,Dt,Ye],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-number-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"number"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const js=Q({mixins:[Mt,Dt],props:{empty:String,fields:Object,value:[String,Object]},data(){return{object:this.valueToObject(this.value)}},computed:{drawer(){return{icon:"box",tab:"object",tabs:{object:{fields:this.$helper.field.subfields(this,this.fields)}},title:this.label,value:this.object}},isEmpty(){return!this.object||!(!this.object||0!==Object.keys(this.object).length)},isInvalid(){return!0===this.required&&this.isEmpty}},watch:{value(t){this.object=this.valueToObject(t)}},methods:{onAdd(){this.object=this.$helper.field.form(this.fields),this.$emit("input",this.object),this.open()},onCellInput(t,s){e(this.object,t,s),this.$emit("input",this.object)},onDrawerInput(t){this.object=t,this.$emit("input",this.object)},onRemove(){this.object={},this.$emit("input",this.object)},open(t){if(this.disabled)return!1;this.$refs.drawer.open(null,t)},valueToObject:t=>"object"!=typeof t?null:t}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-object-field",scopedSlots:t._u([t.disabled?null:{key:"options",fn:function(){return[t.isEmpty?e("k-button",{attrs:{icon:"add"},on:{click:t.onAdd}}):e("k-button",{attrs:{icon:"remove"},on:{click:t.onRemove}})]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[t.isEmpty?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"box"},on:{click:t.onAdd}},[t._v(" "+t._s(t.empty||t.$t("field.object.empty"))+" ")]):e("table",{staticClass:"k-table k-object-field-table",attrs:{"data-invalid":t.isInvalid}},[e("tbody",[t._l(t.fields,(function(s){return[s.saveable&&t.$helper.field.isVisible(s,t.value)?e("tr",{key:s.name,on:{click:function(e){return t.open(s.name)}}},[e("th",{attrs:{"data-mobile":"true"}},[e("button",{attrs:{type:"button"}},[t._v(t._s(s.label))])]),e("k-table-cell",{attrs:{column:s,field:s,mobile:!0,value:t.object[s.name]},on:{input:function(e){return t.onCellInput(s.name,e)}}})],1):t._e()]}))],2)]),e("k-form-drawer",t._b({ref:"drawer",on:{input:t.onDrawerInput}},"k-form-drawer",t.drawer,!1))],1)}),[],!1,null,null,null,null).exports;const Es=Q({mixins:[$s],computed:{emptyProps(){return{icon:"page",text:this.empty||this.$t("field.pages.empty")}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-pages-field",scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button-group",{staticClass:"k-field-options"},[t.more&&!t.disabled?e("k-button",{staticClass:"k-field-options-button",attrs:{icon:t.btnIcon,text:t.btnLabel},on:{click:t.open}}):t._e()],1)]},proxy:!0}])},"k-field",t.$props,!1),[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function({index:s}){return[t.disabled?t._e():e("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(s)}}})]}}])},"k-collection",t.collection,!1)),e("k-pages-dialog",{ref:"selector",on:{submit:t.select}})],1)}),[],!1,null,null,null,null).exports;const Ms=Q({mixins:[Mt,Dt,Ue,ks],inheritAttrs:!1,props:{minlength:{type:Number,default:8},icon:{type:String,default:"key"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-password-field",attrs:{input:t._uid,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"password"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Ls=Q({mixins:[Mt,Dt,Ve],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-radio-field"},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"radio"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Bs=Q({mixins:[Dt,Mt,Ge],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-range-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"range"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Ds=Q({mixins:[Mt,Dt,Xe],inheritAttrs:!1,props:{icon:{type:String,default:"angle-down"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-select-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"select"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Ps=Q({mixins:[Mt,Dt,Qe],inheritAttrs:!1,props:{icon:{type:String,default:"url"},path:{type:String},wizard:{type:[Boolean,Object],default:!1}},data(){return{slug:this.value}},computed:{preview(){return void 0!==this.help?this.help:void 0!==this.path?this.path+this.value:null}},watch:{value(){this.slug=this.value}},methods:{focus(){this.$refs.input.focus()},onWizard(){var t;this.formData[null==(t=this.wizard)?void 0:t.field]&&(this.slug=this.formData[this.wizard.field])}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-slug-field",attrs:{input:t._uid,help:t.preview},scopedSlots:t._u([t.wizard&&t.wizard.text?{key:"options",fn:function(){return[e("k-button",{attrs:{text:t.wizard.text,icon:"wand"},on:{click:t.onWizard}})]},proxy:!0}:null],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,value:t.slug,theme:"field",type:"slug"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Ns=Q({mixins:[Mt],inheritAttrs:!1,props:{columns:Object,duplicate:{type:Boolean,default:!0},empty:String,fields:Object,limit:Number,max:Number,min:Number,prepend:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},sortBy:String,value:{type:Array,default:()=>[]}},data(){return{autofocus:null,items:this.toItems(this.value),currentIndex:null,currentModel:null,trash:null,page:1}},computed:{dragOptions(){return{disabled:!this.isSortable,fallbackClass:"k-sortable-row-fallback"}},form(){return this.$helper.field.subfields(this,this.fields)},index(){return this.limit?(this.page-1)*this.limit+1:1},more(){return!0!==this.disabled&&!(this.max&&this.items.length>=this.max)},isInvalid(){return!0!==this.disabled&&(!!(this.min&&this.items.lengththis.max))},isSortable(){return!this.sortBy&&(!this.limit&&(!0!==this.disabled&&(!(this.items.length<=1)&&!1!==this.sortable)))},pagination(){let t=0;return this.limit&&(t=(this.page-1)*this.limit),{page:this.page,offset:t,limit:this.limit,total:this.items.length,align:"center",details:!0}},options(){if(this.disabled)return[];let t=[],e=this.duplicate&&this.more&&null===this.currentIndex;return e&&t.push({icon:"copy",text:this.$t("duplicate"),click:"duplicate"}),t.push({icon:"remove",text:e?this.$t("remove"):null,click:"remove"}),t},paginatedItems(){return this.limit?this.items.slice(this.pagination.offset,this.pagination.offset+this.limit):this.items}},watch:{value(t){t!=this.items&&(this.items=this.toItems(t))}},methods:{add(t){!0===this.prepend?this.items.unshift(t):this.items.push(t)},confirmToRemoveAll(){this.$refs.dialogRemoveAll.open()},focus(){var t,e;null==(e=null==(t=this.$refs.add)?void 0:t.focus)||e.call(t)},jump(t,e){this.open(t+this.pagination.offset,e)},onAdd(){return!0!==this.disabled&&(null!==this.currentIndex?(this.onFormDiscard(),!1):(this.currentIndex="new",this.currentModel=this.$helper.field.form(this.fields),void this.onFormOpen()))},onFormClose(){this.currentIndex=null,this.currentModel=null},onFormDiscard(){if("new"===this.currentIndex){if(0===Object.values(this.currentModel).filter((t=>!1===this.$helper.object.isEmpty(t))).length)return void this.onFormClose()}this.onFormSubmit()},onFormOpen(t=this.autofocus){this.$nextTick((()=>{var e;null==(e=this.$refs.form)||e.focus(t)}))},async onFormPaginate(t){try{await this.save(),this.open(t)}catch(e){}},async onFormSubmit(){try{await this.save(),this.onFormClose()}catch(t){}},onInput(t=this.items){this.$emit("input",t)},onOption(t,e,s){switch(t){case"remove":this.onFormClose(),this.trash=s+this.pagination.offset,this.$refs.remove.open();break;case"duplicate":this.add(this.items[s+this.pagination.offset]),this.onInput()}},onRemove(){if(null===this.trash)return!1;this.items.splice(this.trash,1),this.trash=null,this.$refs.remove.close(),this.onInput(),0===this.paginatedItems.length&&this.page>1&&this.page--,this.items=this.sort(this.items)},onRemoveAll(){this.items=[],this.onInput(),this.$refs.dialogRemoveAll.close()},open(t,e){this.currentIndex=t,this.currentModel=this.$helper.clone(this.items[t]),this.onFormOpen(e)},paginate({page:t}){this.page=t},sort(t){return this.sortBy?t.sortBy(this.sortBy):t},async save(){if(null!==this.currentIndex&&void 0!==this.currentIndex)try{return await this.validate(this.currentModel),"new"===this.currentIndex?this.add(this.currentModel):this.items[this.currentIndex]=this.currentModel,this.items=this.sort(this.items),this.onInput(),!0}catch(t){throw this.$store.dispatch("notification/error",{message:this.$t("error.form.incomplete"),details:t}),t}},toItems(t){return!1===Array.isArray(t)?[]:this.sort(t)},async validate(t){const e=await this.$api.post(this.endpoints.field+"/validate",t);if(e.length>0)throw e;return!0},onFormInput(t){this.currentModel=t,this.$emit("formInput",t)}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-structure-field",nativeOn:{click:function(t){t.stopPropagation()}},scopedSlots:t._u([{key:"options",fn:function(){return[t.currentIndex?t._e():e("k-dropdown",[e("k-button",{attrs:{icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{disabled:!t.more,icon:"add"},on:{click:t.onAdd}},[t._v(" "+t._s(t.$t("add"))+" ")]),e("k-dropdown-item",{attrs:{disabled:0===t.items.length||t.disabled,icon:"trash"},on:{click:t.confirmToRemoveAll}},[t._v(" "+t._s(t.$t("delete.all"))+" ")])],1)],1)]},proxy:!0}])},"k-field",t.$props,!1),[null!==t.currentIndex?e("k-structure-form",{ref:"form",attrs:{fields:t.form,index:t.currentIndex,total:t.items.length,value:t.currentModel},on:{close:t.onFormClose,discard:t.onFormDiscard,input:t.onFormInput,paginate:function(e){return t.onFormPaginate(e.offset)},submit:t.onFormSubmit}}):0===t.items.length?e("k-empty",{attrs:{"data-invalid":t.isInvalid,icon:"list-bullet"},on:{click:t.onAdd}},[t._v(" "+t._s(t.empty||t.$t("field.structure.empty"))+" ")]):[e("k-table",{attrs:{columns:t.columns,disabled:t.disabled,fields:t.fields,empty:t.$t("field.structure.empty"),index:t.index,options:t.options,pagination:!!t.limit&&t.pagination,rows:t.paginatedItems,sortable:t.isSortable,"data-invalid":t.isInvalid},on:{cell:function(e){return t.jump(e.rowIndex,e.columnIndex)},input:t.onInput,option:t.onOption,paginate:t.paginate}}),t.more?e("k-button",{staticClass:"k-field-add-item-button",attrs:{icon:"add",tooltip:t.$t("add")},on:{click:t.onAdd}}):t._e(),t.disabled?t._e():e("k-remove-dialog",{ref:"remove",attrs:{theme:"negative","submit-button":t.$t("delete"),text:t.$t("field.structure.delete.confirm")},on:{submit:t.onRemove}}),e("k-remove-dialog",{ref:"dialogRemoveAll",attrs:{text:t.$t("field.structure.delete.confirm.all")},on:{submit:t.onRemoveAll}})]],2)}),[],!1,null,null,null,null).exports;const Rs=Q({mixins:[Mt,Dt,es,ks],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-tags-field",attrs:{input:t._uid,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"tags"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Fs=Q({mixins:[Mt,Dt,ns],inheritAttrs:!1,props:{icon:{type:String,default:"phone"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-tel-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"tel"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const qs=Q({mixins:[Mt,Dt,Be,ks],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},select(){this.$refs.input.select()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-text-field",attrs:{input:t._uid,counter:t.counterOptions},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options")]},proxy:!0}],null,!0)},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const zs=Q({mixins:[Mt,Dt,os,ks],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-textarea-field",attrs:{input:t._uid,counter:t.counterOptions}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,type:"textarea",theme:"field"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Ys=Q({mixins:[Mt,Dt,ls],inheritAttrs:!1,props:{icon:{type:String,default:"clock"},times:{type:Boolean,default:!0}},methods:{focus(){this.$refs.input.focus()},select(t){var e;this.$emit("input",t),null==(e=this.$refs.times)||e.close()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-time-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"time"},on:{input:function(e){return t.$emit("input",e||"")}},scopedSlots:t._u([t.times?{key:"icon",fn:function(){return[e("k-dropdown",[e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon||"clock",tooltip:t.$t("time.select")},on:{click:function(e){return t.$refs.times.toggle()}}}),e("k-dropdown-content",{ref:"times",attrs:{align:"right"}},[e("k-times",{attrs:{display:t.display,value:t.value},on:{input:t.select}})],1)],1)]},proxy:!0}:null],null,!0)},"k-input",t.$props,!1))],1)}),[],!1,null,null,null,null).exports;const Hs=Q({mixins:[Mt,Dt,us],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-toggle-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"toggle"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Us=Q({mixins:[Mt,Dt,ds],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()},onInput(t){this.$emit("input",t)}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-toggles-field"},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",class:{grow:t.grow},attrs:{id:t._uid,theme:"field",type:"toggles"}},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Ks=Q({mixins:[Mt,Dt,hs],inheritAttrs:!1,props:{link:{type:Boolean,default:!0},icon:{type:String,default:"url"}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-url-field",attrs:{input:t._uid}},"k-field",t.$props,!1),[e("k-input",t._g(t._b({ref:"input",attrs:{id:t._uid,theme:"field",type:"url"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.link?e("k-button",{staticClass:"k-input-icon-button",attrs:{icon:t.icon,link:t.value,tooltip:t.$t("open"),tabindex:"-1",target:"_blank"}}):t._e()]},proxy:!0}])},"k-input",t.$props,!1),t.$listeners))],1)}),[],!1,null,null,null,null).exports;const Vs=Q({mixins:[$s],computed:{emptyProps(){return{icon:"users",text:this.empty||this.$t("field.users.empty")}}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-users-field",scopedSlots:t._u([{key:"options",fn:function(){return[e("k-button-group",{staticClass:"k-field-options"},[t.more&&!t.disabled?e("k-button",{staticClass:"k-field-options-button",attrs:{icon:t.btnIcon,text:t.btnLabel},on:{click:t.open}}):t._e()],1)]},proxy:!0}])},"k-field",t.$props,!1),[e("k-collection",t._b({on:{empty:t.open,sort:t.onInput,sortChange:function(e){return t.$emit("change",e)}},scopedSlots:t._u([{key:"options",fn:function({index:s}){return[t.disabled?t._e():e("k-button",{attrs:{tooltip:t.$t("remove"),icon:"remove"},on:{click:function(e){return t.remove(s)}}})]}}])},"k-collection",t.collection,!1)),e("k-users-dialog",{ref:"selector",on:{submit:t.select}})],1)}),[],!1,null,null,null,null).exports;const Js=Q({mixins:[Mt,Dt,_e],inheritAttrs:!1,methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("k-field",t._b({staticClass:"k-writer-field",attrs:{input:t._uid,counter:!1}},"k-field",t.$props,!1),[e("k-input",t._b({attrs:{after:t.after,before:t.before,icon:t.icon,theme:"field"}},"k-input",t.$props,!1),[e("k-writer",t._b({ref:"input",staticClass:"k-writer-field-input",attrs:{value:t.value},on:{input:function(e){return t.$emit("input",e)}}},"k-writer",t.$props,!1))],1)],1)}),[],!1,null,null,null,null).exports,Gs={install(t){t.component("k-blocks-field",gs),t.component("k-checkboxes-field",bs),t.component("k-date-field",vs),t.component("k-email-field",ys),t.component("k-files-field",_s),t.component("k-gap-field",ws),t.component("k-headline-field",xs),t.component("k-info-field",Ss),t.component("k-layout-field",Cs),t.component("k-line-field",Os),t.component("k-list-field",As),t.component("k-multiselect-field",Ts),t.component("k-number-field",Is),t.component("k-object-field",js),t.component("k-pages-field",Es),t.component("k-password-field",Ms),t.component("k-radio-field",Ls),t.component("k-range-field",Bs),t.component("k-select-field",Ds),t.component("k-slug-field",Ps),t.component("k-structure-field",Ns),t.component("k-tags-field",Rs),t.component("k-text-field",qs),t.component("k-textarea-field",zs),t.component("k-tel-field",Fs),t.component("k-time-field",Ys),t.component("k-toggle-field",Hs),t.component("k-toggles-field",Us),t.component("k-url-field",Ks),t.component("k-users-field",Vs),t.component("k-writer-field",Js)}},Ws={install(t){t.component("k-calendar",bt),t.component("k-counter",vt),t.component("k-autocomplete",kt),t.component("k-form",yt),t.component("k-form-buttons",$t),t.component("k-form-indicator",_t),t.component("k-field",Lt),t.component("k-fieldset",Bt),t.component("k-input",Pt),t.component("k-login",Nt),t.component("k-login-code",Rt),t.component("k-times",Ft),t.component("k-upload",qt),t.component("k-writer",we),t.component("k-login-alert",xe),t.component("k-structure-form",Se),t.component("k-toolbar",Oe),t.component("k-toolbar-email-dialog",Ae),t.component("k-toolbar-link-dialog",Te),t.use(fs),t.use(Gs)}};const Xs=Q({props:{cover:Boolean,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio)}}},(function(){var t=this;return(0,t._self._c)("span",{staticClass:"k-aspect-ratio",style:{"padding-bottom":t.ratioPadding},attrs:{"data-cover":t.cover}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Zs=Q({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bar"},[t.$slots.left?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"left"}},[t._t("left")],2):t._e(),t.$slots.center?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"center"}},[t._t("center")],2):t._e(),t.$slots.right?e("div",{staticClass:"k-bar-slot",attrs:{"data-position":"right"}},[t._t("right")],2):t._e()])}),[],!1,null,null,null,null).exports;const Qs=Q({props:{theme:{type:String,default:"none"},text:String,html:{type:Boolean,default:!1}}},(function(){var t=this,e=t._self._c;return e("div",t._g({staticClass:"k-box",attrs:{"data-theme":t.theme}},t.$listeners),[t._t("default",(function(){return[t.html?e("k-text",{attrs:{html:t.text}}):e("k-text",[t._v(" "+t._s(t.text)+" ")])]}))],2)}),[],!1,null,null,null,null).exports;const tn=Q({inheritAttrs:!1,props:{back:String,color:String,element:{type:String,default:"li"},image:Object,link:String,text:String}},(function(){var t=this,e=t._self._c;return e(t.link?"k-link":"p",{tag:"component",staticClass:"k-bubble",style:{color:t.$helper.color(t.color),background:t.$helper.color(t.back)},attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[t.image?e("k-item-image",{attrs:{image:t.image,layout:"list"}}):t._e(),t._v(" "+t._s(t.text)+" ")],1)}),[],!1,null,null,null,null).exports;const en=Q({inheritAttrs:!1,props:{bubbles:Array},computed:{items(){let t=this.bubbles;return"string"==typeof t&&(t=t.split(",")),t.map((t=>"string"==typeof t?{text:t}:t))}}},(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"k-bubbles"},t._l(t.items,(function(s,n){return e("li",{key:n},[e("k-bubble",t._b({},"k-bubble",s,!1))],1)})),0)}),[],!1,null,null,null,null).exports;const sn=Q({props:{columns:{type:[Object,Array],default:()=>({})},empty:Object,help:String,items:{type:[Array,Object],default:()=>[]},layout:{type:String,default:"list"},link:{type:Boolean,default:!0},size:String,sortable:Boolean,pagination:{type:[Boolean,Object],default:()=>!1}},computed:{hasPagination(){return!1!==this.pagination&&(!0!==this.paginationOptions.hide&&!(this.pagination.total<=this.pagination.limit))},hasFooter(){return!(!this.hasPagination&&!this.help)},paginationOptions(){return{limit:10,details:!0,keys:!1,total:0,hide:!1,..."object"!=typeof this.pagination?{}:this.pagination}}},watch:{$props(){this.$forceUpdate()}},methods:{onEmpty(t){t.stopPropagation(),this.$emit("empty")},onOption(...t){this.$emit("action",...t),this.$emit("option",...t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-collection"},[t.items.length?e("k-items",{attrs:{columns:t.columns,items:t.items,layout:t.layout,link:t.link,size:t.size,sortable:t.sortable},on:{change:function(e){return t.$emit("change",e)},item:function(e){return t.$emit("item",e)},option:t.onOption,sort:function(e){return t.$emit("sort",e)}},scopedSlots:t._u([{key:"options",fn:function({item:e,itemIndex:s}){return[t._t("options",null,null,{item:e,index:s})]}}],null,!0)}):e("k-empty",t._g(t._b({attrs:{layout:t.layout}},"k-empty",t.empty,!1),t.$listeners.empty?{click:t.onEmpty}:{})),t.hasFooter?e("footer",{staticClass:"k-collection-footer"},[t.help?e("k-text",{staticClass:"k-collection-help",attrs:{theme:"help",html:t.help}}):t._e(),e("div",{staticClass:"k-collection-pagination"},[t.hasPagination?e("k-pagination",t._b({on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.paginationOptions,!1)):t._e()],1)],1):t._e()],1)}),[],!1,null,null,null,null).exports;const nn=Q({props:{width:String,sticky:Boolean}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-column",attrs:{"data-width":t.width,"data-sticky":t.sticky}},[e("div",[t._t("default")],2)])}),[],!1,null,null,null,null).exports;const on=Q({props:{disabled:{type:Boolean,default:!1}},data:()=>({files:[],dragging:!1,over:!1}),methods:{cancel(){this.reset()},reset(){this.dragging=!1,this.over=!1},onDrop(t){return!0===this.disabled||!1===this.$helper.isUploadEvent(t)?this.reset():(this.$events.$emit("dropzone.drop"),this.files=t.dataTransfer.files,this.$emit("drop",this.files),void this.reset())},onEnter(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(this.dragging=!0)},onLeave(){this.reset()},onOver(t){!1===this.disabled&&this.$helper.isUploadEvent(t)&&(t.dataTransfer.dropEffect="copy",this.over=!0)}}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-dropzone",attrs:{"data-dragging":t.dragging,"data-over":t.over},on:{dragenter:t.onEnter,dragleave:t.onLeave,dragover:t.onOver,drop:t.onDrop}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const rn=Q({props:{text:String,icon:String,layout:{type:String,default:"list"}},computed:{element(){return void 0!==this.$listeners.click?"button":"div"}}},(function(){var t=this,e=t._self._c;return e(t.element,t._g({tag:"component",staticClass:"k-empty",attrs:{"data-layout":t.layout,type:"button"===t.element&&"button"}},t.$listeners),[t.icon?e("k-icon",{attrs:{type:t.icon}}):t._e(),e("p",[t._t("default",(function(){return[t._v(t._s(t.text))]}))],2)],1)}),[],!1,null,null,null,null).exports;const ln=Q({props:{details:Array,image:Object,url:String}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-file-preview"},[e("k-view",{staticClass:"k-file-preview-layout"},[e("div",{staticClass:"k-file-preview-image"},[e("k-link",{staticClass:"k-file-preview-image-link",attrs:{to:t.url,title:t.$t("open"),target:"_blank"}},[e("k-item-image",{attrs:{image:t.image,layout:"cards"}})],1)],1),e("div",{staticClass:"k-file-preview-details"},[e("ul",t._l(t.details,(function(s){return e("li",{key:s.title},[e("h3",[t._v(t._s(s.title))]),e("p",[s.link?e("k-link",{attrs:{to:s.link,tabindex:"-1",target:"_blank"}},[t._v(" /"+t._s(s.text)+" ")]):[t._v(" "+t._s(s.text)+" ")]],2)])})),0)])])],1)}),[],!1,null,null,null,null).exports;const an=Q({props:{gutter:String}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-grid",attrs:{"data-gutter":t.gutter}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const un=Q({props:{editable:Boolean,tab:String,tabs:{type:Array,default:()=>[]}},computed:{tabsWithBadges(){const t=Object.keys(this.$store.getters["content/changes"]());return this.tabs.map((e=>{let s=[];return Object.values(e.columns).forEach((t=>{Object.values(t.sections).forEach((t=>{"fields"===t.type&&Object.keys(t.fields).forEach((t=>{s.push(t)}))}))})),e.badge=s.filter((e=>t.includes(e.toLowerCase()))).length,e}))}}},(function(){var t=this,e=t._self._c;return e("header",{staticClass:"k-header",attrs:{"data-editable":t.editable,"data-tabs":t.tabsWithBadges.length>1}},[e("k-headline",{attrs:{tag:"h1",size:"huge"}},[t.editable&&t.$listeners.edit?e("span",{staticClass:"k-headline-editable",on:{click:function(e){return t.$emit("edit")}}},[t._t("default"),e("k-icon",{attrs:{type:"edit"}})],2):t._t("default")],2),t.$slots.left||t.$slots.right?e("k-bar",{staticClass:"k-header-buttons",scopedSlots:t._u([{key:"left",fn:function(){return[t._t("left")]},proxy:!0},{key:"right",fn:function(){return[t._t("right")]},proxy:!0}],null,!0)}):t._e(),e("k-tabs",{attrs:{tab:t.tab,tabs:t.tabsWithBadges,theme:"notice"}})],1)}),[],!1,null,null,null,null).exports;const cn=Q({inheritAttrs:!1},(function(){var t=this,e=t._self._c;return e("k-panel",{staticClass:"k-panel-inside",attrs:{tabindex:"0"}},[e("header",{staticClass:"k-panel-header"},[e("k-topbar",{attrs:{breadcrumb:t.$view.breadcrumb,license:t.$license,menu:t.$menu,view:t.$view}})],1),e("main",{staticClass:"k-panel-view scroll-y"},[t._t("default")],2),t._t("footer")],2)}),[],!1,null,null,null,null).exports;const dn=Q({inheritAttrs:!1,props:{data:Object,flag:Object,image:[Object,Boolean],info:String,layout:{type:String,default:"list"},link:{type:[Boolean,String,Function]},options:{type:[Array,Function,String]},sortable:Boolean,target:String,text:String,width:String},computed:{hasFigure(){return!1!==this.image&&Object.keys(this.image).length>0},title(){return this.text||"-"}},methods:{onOption(t){this.$emit("action",t),this.$emit("option",t)}}},(function(){var t=this,e=t._self._c;return e("article",t._b({staticClass:"k-item",class:!!t.layout&&"k-"+t.layout+"-item",attrs:{"data-has-figure":t.hasFigure,"data-has-flag":Boolean(t.flag),"data-has-info":Boolean(t.info),"data-has-options":Boolean(t.options),tabindex:"-1"},on:{click:function(e){return t.$emit("click",e)},dragstart:function(e){return t.$emit("drag",e)}}},"article",t.data,!1),[t._t("image",(function(){return[t.hasFigure?e("k-item-image",{attrs:{image:t.image,layout:t.layout,width:t.width}}):t._e()]})),t.sortable?e("k-sort-handle",{staticClass:"k-item-sort-handle"}):t._e(),e("header",{staticClass:"k-item-content"},[t._t("default",(function(){return[e("h3",{staticClass:"k-item-title"},[!1!==t.link?e("k-link",{staticClass:"k-item-title-link",attrs:{target:t.target,to:t.link}},[e("span",{domProps:{innerHTML:t._s(t.title)}})]):e("span",{domProps:{innerHTML:t._s(t.title)}})],1),t.info?e("p",{staticClass:"k-item-info",domProps:{innerHTML:t._s(t.info)}}):t._e()]}))],2),t.flag||t.options||t.$slots.options?e("footer",{staticClass:"k-item-footer"},[e("nav",{staticClass:"k-item-buttons",on:{click:function(t){t.stopPropagation()}}},[t.flag?e("k-status-icon",t._b({},"k-status-icon",t.flag,!1)):t._e(),t._t("options",(function(){return[t.options?e("k-options-dropdown",{staticClass:"k-item-options-dropdown",attrs:{options:t.options},on:{option:t.onOption}}):t._e()]}))],2)]):t._e()],2)}),[],!1,null,null,null,null).exports;const pn=Q({inheritAttrs:!1,props:{image:[Object,Boolean],layout:{type:String,default:"list"},width:String},computed:{back(){return this.image.back||"black"},ratio(){return"cards"===this.layout&&this.image.ratio||"1/1"},size(){switch(this.layout){case"cards":return"large";case"cardlets":return"medium";default:return"regular"}},sizes(){switch(this.width){case"1/2":case"2/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 44em, 27em";case"1/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 29.333em, 27em";case"1/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 22em, 27em";case"2/3":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 27em, 27em";case"3/4":return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 66em, 27em";default:return"(min-width: 30em) and (max-width: 65em) 59em, (min-width: 65em) 88em, 27em"}}}},(function(){var t=this,e=t._self._c;return t.image?e("div",{staticClass:"k-item-figure",style:{background:t.$helper.color(t.back)}},[t.image.src?e("k-image",{staticClass:"k-item-image",attrs:{cover:t.image.cover,ratio:t.ratio,sizes:t.sizes,src:t.image.src,srcset:t.image.srcset}}):e("k-aspect-ratio",{attrs:{ratio:t.ratio}},[e("k-icon",{staticClass:"k-item-icon",attrs:{color:t.$helper.color(t.image.color),type:t.image.icon}})],1)],1):t._e()}),[],!1,null,null,null,null).exports;const hn=Q({inheritAttrs:!1,props:{columns:{type:[Object,Array],default:()=>({})},items:{type:Array,default:()=>[]},layout:{type:String,default:"list"},link:{type:Boolean,default:!0},image:{type:[Object,Boolean],default:()=>({})},sortable:Boolean,empty:{type:[String,Object]},size:{type:String,default:"default"}},computed:{dragOptions(){return{sort:this.sortable,disabled:!1===this.sortable,draggable:".k-draggable-item"}},table(){return{columns:this.columns,rows:this.items,sortable:this.sortable}}},methods:{onDragStart(t,e){this.$store.dispatch("drag",{type:"text",data:e})},onOption(t,e,s){this.$emit("option",t,e,s)},imageOptions(t){let e=this.image,s=t.image;return!1!==e&&!1!==s&&("object"!=typeof e&&(e={}),"object"!=typeof s&&(s={}),{...s,...e})}}},(function(){var t=this,e=t._self._c;return"table"===t.layout?e("k-table",t._b({on:{change:function(e){return t.$emit("change",e)},sort:function(e){return t.$emit("sort",e)},option:t.onOption}},"k-table",t.table,!1)):e("k-draggable",{staticClass:"k-items",class:"k-"+t.layout+"-items",attrs:{handle:!0,options:t.dragOptions,"data-layout":t.layout,"data-size":t.size,list:t.items},on:{change:function(e){return t.$emit("change",e)},end:function(e){return t.$emit("sort",t.items,e)}}},[t._l(t.items,(function(s,n){return[t._t("default",(function(){return[e("k-item",t._b({key:s.id||n,class:{"k-draggable-item":t.sortable&&s.sortable},attrs:{image:t.imageOptions(s),layout:t.layout,link:!!t.link&&s.link,sortable:t.sortable&&s.sortable,width:s.column},on:{click:function(e){return t.$emit("item",s,n)},drag:function(e){return t.onDragStart(e,s.dragText)},option:function(e){return t.onOption(e,s,n)}},nativeOn:{mouseover:function(e){return t.$emit("hover",e,s,n)}},scopedSlots:t._u([{key:"options",fn:function(){return[t._t("options",null,null,{item:s,itemIndex:n})]},proxy:!0}],null,!0)},"k-item",s,!1))]}),null,{item:s,itemIndex:n})]}))],2)}),[],!1,null,null,null,null).exports;const mn=Q({inheritAttrs:!0,props:{autofocus:{type:Boolean,default:!0},centered:{type:Boolean,default:!1},dimmed:{type:Boolean,default:!0},loading:{type:Boolean,default:!1}},data:()=>({isOpen:!1,scrollTop:0}),methods:{close(){!1!==this.isOpen&&(this.isOpen=!1,this.$emit("close"),this.restoreScrollPosition(),this.$events.$off("keydown.esc",this.close))},focus(){var t,e;let s=this.$refs.overlay.querySelector("\n [autofocus],\n [data-autofocus]\n ");return null===s&&(s=this.$refs.overlay.querySelector("\n input,\n textarea,\n select,\n button\n ")),"function"==typeof(null==s?void 0:s.focus)?s.focus():"function"==typeof(null==(e=null==(t=this.$slots.default[0])?void 0:t.context)?void 0:e.focus)?this.$slots.default[0].context.focus():void 0},open(){!0!==this.isOpen&&(this.storeScrollPosition(),this.isOpen=!0,this.$emit("open"),this.$events.$on("keydown.esc",this.close),setTimeout((()=>{!0===this.autofocus&&this.focus(),document.querySelector(".k-overlay > *").addEventListener("mousedown",(t=>t.stopPropagation())),this.$emit("ready")}),1))},restoreScrollPosition(){const t=document.querySelector(".k-panel-view");(null==t?void 0:t.scrollTop)&&(t.scrollTop=this.scrollTop)},storeScrollPosition(){const t=document.querySelector(".k-panel-view");(null==t?void 0:t.scrollTop)?this.scrollTop=t.scrollTop:this.scrollTop=0}}},(function(){var t=this,e=t._self._c;return t.isOpen?e("portal",[e("div",t._g({ref:"overlay",staticClass:"k-overlay",class:t.$vnode.data.staticClass,attrs:{"data-centered":t.loading||t.centered,"data-dimmed":t.dimmed,"data-loading":t.loading,dir:t.$translation.direction},on:{mousedown:t.close}},t.$listeners),[t.loading?e("k-loader",{staticClass:"k-overlay-loader"}):t._t("default",null,{close:t.close,isOpen:t.isOpen})],2)]):t._e()}),[],!1,null,null,null,null).exports;const fn=Q({computed:{defaultLanguage(){return!!this.$language&&this.$language.default},dialog(){return this.$helper.clone(this.$store.state.dialog)},dir(){return this.$translation.direction},language(){return this.$language?this.$language.code:null},role(){return this.$user?this.$user.role:null},user(){return this.$user?this.$user.id:null}},watch:{dir:{handler(){document.body.dir=this.dir},immediate:!0}},created(){this.$events.$on("drop",this.drop)},destroyed(){this.$events.$off("drop",this.drop)},methods:{drop(){this.$store.dispatch("drag",null)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-panel",attrs:{"data-dragging":t.$store.state.drag,"data-loading":t.$store.state.isLoading,"data-language":t.language,"data-language-default":t.defaultLanguage,"data-role":t.role,"data-translation":t.$translation.code,"data-user":t.user,dir:t.dir}},[t._t("default"),t.$store.state.dialog&&t.$store.state.dialog.props?[e("k-fiber-dialog",t._b({},"k-fiber-dialog",t.dialog,!1))]:t._e(),!1!==t.$store.state.fatal?e("k-fatal",{attrs:{html:t.$store.state.fatal}}):t._e(),!1===t.$system.isLocal?e("k-offline-warning"):t._e(),e("k-icons")],2)}),[],!1,null,null,null,null).exports;const gn=Q({props:{reports:Array,size:{type:String,default:"large"}},methods:{component(t){return null!==this.target(t)?"k-link":"div"},target(t){return t.link?t.link:t.click?t.click:t.dialog?()=>this.$dialog(t.dialog):null}}},(function(){var t=this,e=t._self._c;return e("dl",{staticClass:"k-stats",attrs:{"data-size":t.size}},t._l(t.reports,(function(s,n){return e(t.component(s),{key:n,tag:"component",staticClass:"k-stat",attrs:{"data-theme":s.theme,to:t.target(s)}},[e("dt",{staticClass:"k-stat-label"},[t._v(t._s(s.label))]),e("dd",{staticClass:"k-stat-value"},[t._v(t._s(s.value))]),e("dd",{staticClass:"k-stat-info"},[t._v(t._s(s.info))])])})),1)}),[],!1,null,null,null,null).exports;const kn=Q({inheritAttrs:!1,props:{columns:Object,disabled:Boolean,fields:{type:Object,default:()=>({})},empty:String,index:{type:[Number,Boolean],default:1},rows:Array,options:[Array,Function],pagination:[Object,Boolean],sortable:Boolean},data(){return{values:this.rows}},computed:{colspan(){let t=this.columnsCount;return this.hasIndexColumn&&t++,this.hasOptions&&t++,t},columnsCount(){return Object.keys(this.columns).length},dragOptions(){return{disabled:!this.sortable,fallbackClass:"k-table-row-fallback",ghostClass:"k-table-row-ghost"}},hasIndexColumn(){return this.sortable||!1!==this.index},hasOptions(){var t;return(null==(t=this.options)?void 0:t.length)>0||Object.values(this.values).filter((t=>t.options)).length>0}},watch:{rows(){this.values=this.rows}},methods:{isColumnEmpty(t){return 0===this.rows.filter((e=>!1===this.$helper.object.isEmpty(e[t]))).length},label(t,e){return t.label||this.$helper.string.ucfirst(e)},onChange(t){this.$emit("change",t)},onCell(t){this.$emit("cell",t)},onCellUpdate({columnIndex:t,rowIndex:e,value:s}){this.values[e][t]=s,this.$emit("input",this.values)},onHeader(t){this.$emit("header",t)},onOption(t,e,s){this.$emit("option",t,e,s)},onSort(){this.$emit("input",this.values),this.$emit("sort",this.values)},width(t){return"string"!=typeof t?"auto":!1===t.includes("/")?t:this.$helper.ratio(t,"auto",!1)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table"},[e("table",{attrs:{"data-disabled":t.disabled,"data-indexed":t.hasIndexColumn}},[e("thead",[e("tr",[t.hasIndexColumn?e("th",{staticClass:"k-table-index-column",attrs:{"data-mobile":""}},[t._v(" # ")]):t._e(),t._l(t.columns,(function(s,n){return e("th",{key:n+"-header",staticClass:"k-table-column",style:"width:"+t.width(s.width),attrs:{"data-align":s.align,"data-mobile":s.mobile},on:{click:function(e){return t.onHeader({column:s,columnIndex:n})}}},[t._t("header",(function(){return[t._v(" "+t._s(t.label(s,n))+" ")]}),null,{column:s,columnIndex:n,label:t.label(s,n)})],2)})),t.hasOptions?e("th",{staticClass:"k-table-options-column",attrs:{"data-mobile":""}}):t._e()],2)]),e("k-draggable",{attrs:{list:t.values,options:t.dragOptions,handle:!0,element:"tbody"},on:{change:t.onChange,end:t.onSort}},[0===t.rows.length?e("tr",[e("td",{staticClass:"k-table-empty",attrs:{colspan:t.columnsCount}},[t._v(" "+t._s(t.empty)+" ")])]):t._l(t.values,(function(s,n){return e("tr",{key:n},[t.hasIndexColumn?e("td",{staticClass:"k-table-index-column",attrs:{"data-sortable":t.sortable&&!1!==s.sortable,"data-mobile":""}},[t._t("index",(function(){return[e("div",{staticClass:"k-table-index",domProps:{textContent:t._s(t.index+n)}})]}),null,{row:s,rowIndex:n}),t.sortable&&!1!==s.sortable?e("k-sort-handle",{staticClass:"k-table-sort-handle"}):t._e()],2):t._e(),t._l(t.columns,(function(i,o){return e("k-table-cell",{key:n+"-"+o,staticClass:"k-table-column",style:"width:"+t.width(i.width),attrs:{column:i,field:t.fields[o],row:s,mobile:i.mobile,value:s[o]},on:{input:function(e){return t.onCellUpdate({columnIndex:o,rowIndex:n,value:e})}},nativeOn:{click:function(e){return t.onCell({row:s,rowIndex:n,column:i,columnIndex:o})}}})})),t.hasOptions?e("td",{staticClass:"k-table-options-column",attrs:{"data-mobile":""}},[t._t("options",(function(){return[e("k-options-dropdown",{attrs:{options:s.options||t.options,text:(s.options||t.options).length>1},on:{option:function(e){return t.onOption(e,s,n)}}})]}),null,{row:s,rowIndex:n,options:t.options})],2):t._e()],2)}))],2)],1),t.pagination?e("k-pagination",t._b({staticClass:"k-table-pagination",on:{paginate:function(e){return t.$emit("paginate",e)}}},"k-pagination",t.pagination,!1)):t._e()],1)}),[],!1,null,null,null,null).exports;const bn=Q({inheritAttrs:!1,props:{column:Object,field:Object,mobile:{type:Boolean,default:!1},row:Object,value:{default:""}},computed:{component(){return this.$helper.isComponent(`k-${this.type}-field-preview`)?`k-${this.type}-field-preview`:this.$helper.isComponent(`k-table-${this.type}-cell`)?`k-table-${this.type}-cell`:Array.isArray(this.value)?"k-array-field-preview":"object"==typeof this.value?"k-object-field-preview":"k-text-field-preview"},type(){var t;return this.column.type||(null==(t=this.field)?void 0:t.type)}}},(function(){var t=this,e=t._self._c;return e("td",{attrs:{"data-align":t.column.align,"data-mobile":t.mobile}},[!1===t.$helper.object.isEmpty(t.value)?[e(t.component,{tag:"component",attrs:{column:t.column,field:t.field,row:t.row,value:t.value},on:{input:function(e){return t.$emit("input",e)}}})]:t._e()],2)}),[],!1,null,null,null,null).exports;const vn=Q({props:{value:[String,Object]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-table-update-status-cell"},["string"==typeof t.value?e("span",{staticClass:"k-table-update-status-cell-version"},[t._v(" "+t._s(t.value)+" ")]):e("k-dropdown",{attrs:{"data-theme":t.value.theme}},[e("k-button",{staticClass:"k-table-update-status-cell-button",attrs:{icon:t.value.icon,href:t.value.url},on:{click:function(e){return e.stopPropagation(),t.$refs.dropdown.toggle()}}},[t._v(" "+t._s(t.value.currentVersion)+" ")]),e("k-dropdown-content",{ref:"dropdown",attrs:{align:"right"}},[e("dl",{staticClass:"k-plugin-info"},[e("div",[e("dt",[t._v(t._s(t.$t("plugin")))]),e("dd",[t._v(t._s(t.value.pluginName))])]),e("div",[e("dt",[t._v(t._s(t.$t("version.current")))]),e("dd",[t._v(t._s(t.value.currentVersion))])]),e("div",[e("dt",[t._v(t._s(t.$t("version.latest")))]),e("dd",[t._v(t._s(t.value.latestVersion))])]),e("div",[e("dt",[t._v(t._s(t.$t("system.updateStatus")))]),e("dd",{attrs:{"data-theme":t.value.theme}},[t._v(t._s(t.value.label))])])]),t.value.url?e("k-dropdown-item",{attrs:{icon:"open",link:t.value.url}},[t._v(" "+t._s(t.$t("versionInformation"))+" ")]):t._e()],1)],1)],1)}),[],!1,null,null,null,null).exports;const yn=Q({props:{tab:String,tabs:Array,theme:String},data(){return{size:null,visibleTabs:this.tabs,invisibleTabs:[]}},computed:{current(){return(this.tabs.find((t=>t.name===this.tab))||this.tabs[0]||{}).name}},watch:{tabs:{handler(t){this.visibleTabs=t,this.invisibleTabs=[],this.resize(!0)},immediate:!0}},created(){window.addEventListener("resize",this.resize)},destroyed(){window.removeEventListener("resize",this.resize)},methods:{resize(t){if(this.tabs&&!(this.tabs.length<=1)){if(this.tabs.length<=3)return this.visibleTabs=this.tabs,void(this.invisibleTabs=[]);if(window.innerWidth>=700){if("large"===this.size&&!t)return;this.visibleTabs=this.tabs,this.invisibleTabs=[],this.size="large"}else{if("small"===this.size&&!t)return;this.visibleTabs=this.tabs.slice(0,2),this.invisibleTabs=this.tabs.slice(2),this.size="small"}}}}},(function(){var t=this,e=t._self._c;return t.tabs&&t.tabs.length>1?e("div",{staticClass:"k-tabs",attrs:{"data-theme":t.theme}},[e("nav",[t._l(t.visibleTabs,(function(s){return e("k-button",{key:s.name,staticClass:"k-tab-button",attrs:{link:s.link,current:t.current===s.name,icon:s.icon,tooltip:s.label}},[t._v(" "+t._s(s.label||s.text||s.name)+" "),s.badge?e("span",{staticClass:"k-tabs-badge"},[t._v(" "+t._s(s.badge)+" ")]):t._e()])})),t.invisibleTabs.length?e("k-button",{staticClass:"k-tab-button k-tabs-dropdown-button",attrs:{text:t.$t("more"),icon:"dots"},on:{click:function(e){return e.stopPropagation(),t.$refs.more.toggle()}}}):t._e()],2),t.invisibleTabs.length?e("k-dropdown-content",{ref:"more",staticClass:"k-tabs-dropdown",attrs:{align:"right"}},t._l(t.invisibleTabs,(function(s){return e("k-dropdown-item",{key:"more-"+s.name,attrs:{link:s.link,current:t.tab===s.name,icon:s.icon,tooltip:s.label}},[t._v(" "+t._s(s.label||s.text||s.name)+" ")])})),1):t._e()],1):t._e()}),[],!1,null,null,null,null).exports;const $n=Q({props:{align:String}},(function(){var t=this;return(0,t._self._c)("div",{staticClass:"k-view",attrs:{"data-align":t.align}},[t._t("default")],2)}),[],!1,null,null,null,null).exports,_n={install(t){t.component("k-aspect-ratio",Xs),t.component("k-bar",Zs),t.component("k-box",Qs),t.component("k-bubble",tn),t.component("k-bubbles",en),t.component("k-collection",sn),t.component("k-column",nn),t.component("k-dropzone",on),t.component("k-empty",rn),t.component("k-file-preview",ln),t.component("k-grid",an),t.component("k-header",un),t.component("k-inside",cn),t.component("k-item",dn),t.component("k-item-image",pn),t.component("k-items",hn),t.component("k-overlay",mn),t.component("k-panel",fn),t.component("k-stats",gn),t.component("k-table",kn),t.component("k-table-cell",bn),t.component("k-table-update-status-cell",vn),t.component("k-tabs",yn),t.component("k-view",$n)}},wn={};const xn=Q({components:{draggable:()=>function(t,e,s){if(!e||0===e.length)return t();const n=document.getElementsByTagName("link");return Promise.all(e.map((t=>{if((t=function(t){return"/"+t}(t))in wn)return;wn[t]=!0;const e=t.endsWith(".css"),i=e?'[rel="stylesheet"]':"";if(s)for(let s=n.length-1;s>=0;s--){const i=n[s];if(i.href===t&&(!e||"stylesheet"===i.rel))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;const o=document.createElement("link");return o.rel=e?"stylesheet":"modulepreload",e||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),e?new Promise(((e,s)=>{o.addEventListener("load",e),o.addEventListener("error",(()=>s(new Error(`Unable to preload CSS for ${t}`))))})):void 0}))).then((()=>t()))}((()=>import("./vuedraggable.js")),[])},props:{data:Object,element:String,handle:[String,Boolean],list:[Array,Object],move:Function,options:Object},data(){return{listeners:{...this.$listeners,start:t=>{this.$store.dispatch("drag",{}),this.$listeners.start&&this.$listeners.start(t)},end:t=>{this.$store.dispatch("drag",null),this.$listeners.end&&this.$listeners.end(t)}}}},computed:{dragOptions(){let t=!1;return t=!0===this.handle?".k-sort-handle":this.handle,{fallbackClass:"k-sortable-fallback",fallbackOnBody:!0,forceFallback:!0,ghostClass:"k-sortable-ghost",handle:t,scroll:document.querySelector(".k-panel-view"),...this.options}}}},(function(){var t=this;return(0,t._self._c)("draggable",t._g(t._b({staticClass:"k-draggable",attrs:{"component-data":t.data,tag:t.element,list:t.list,move:t.move},scopedSlots:t._u([{key:"footer",fn:function(){return[t._t("footer")]},proxy:!0}],null,!0)},"draggable",t.dragOptions,!1),t.listeners),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Sn=Q({data:()=>({error:null}),errorCaptured(t){return this.$config.debug&&window.console.warn(t),this.error=t,!1},render(){return this.error?this.$slots.error?this.$slots.error[0]:this.$scopedSlots.error?this.$scopedSlots.error({error:this.error}):L("k-box",{attrs:{theme:"negative"}},this.error.message||this.error):this.$slots.default[0]}},null,null,!1,null,null,null,null).exports;const Cn=Q({props:{html:String},mounted(){try{let t=this.$refs.iframe.contentWindow.document;t.open(),t.write(this.html),t.close()}catch(t){console.error(t)}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-fatal"},[e("div",{staticClass:"k-fatal-box"},[e("k-bar",{scopedSlots:t._u([{key:"left",fn:function(){return[e("k-headline",[t._v(" The JSON response could not be parsed ")])]},proxy:!0},{key:"right",fn:function(){return[e("k-button",{attrs:{icon:"cancel",text:"Close"},on:{click:function(e){return t.$store.dispatch("fatal",!1)}}})]},proxy:!0}])}),e("iframe",{ref:"iframe",staticClass:"k-fatal-iframe"})],1)])}),[],!1,null,null,null,null).exports;const On=Q({props:{link:String,size:{type:String},tag:{type:String,default:"h2"},theme:{type:String}}},(function(){var t=this,e=t._self._c;return e(t.tag,t._g({tag:"component",staticClass:"k-headline",attrs:{"data-theme":t.theme,"data-size":t.size}},t.$listeners),[t.link?e("k-link",{attrs:{to:t.link}},[t._t("default")],2):t._t("default")],2)}),[],!1,null,null,null,null).exports;const An=Q({props:{alt:String,color:String,back:String,size:String,type:String},computed:{isEmoji(){return this.$helper.string.hasEmoji(this.type)}}},(function(){var t=this,e=t._self._c;return e("span",{class:"k-icon k-icon-"+t.type,style:{background:t.$helper.color(t.back)},attrs:{"aria-label":t.alt,role:t.alt?"img":null,"aria-hidden":!t.alt,"data-back":t.back,"data-size":t.size}},[t.isEmoji?e("span",{staticClass:"k-icon-emoji"},[t._v(t._s(t.type))]):e("svg",{style:{color:t.$helper.color(t.color)},attrs:{viewBox:"0 0 16 16"}},[e("use",{attrs:{"xlink:href":"#icon-"+t.type}})])])}),[],!1,null,null,null,null).exports;const Tn=Q({icons:window.panel.plugins.icons},(function(){var t=this,e=t._self._c;return e("svg",{staticClass:"k-icons",attrs:{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",overflow:"hidden"}},[e("defs",t._l(t.$options.icons,(function(s,n){return e("symbol",{key:n,attrs:{id:"icon-"+n,viewBox:"0 0 16 16"},domProps:{innerHTML:t._s(s)}})})),0)])}),[],!1,null,null,null,null).exports;const In=Q({props:{alt:String,back:String,cover:Boolean,ratio:String,sizes:String,src:String,srcset:String},data:()=>({loaded:{type:Boolean,default:!1},error:{type:Boolean,default:!1}}),computed:{ratioPadding(){return this.$helper.ratio(this.ratio||"1/1")}},created(){let t=new Image;t.onload=()=>{this.loaded=!0,this.$emit("load")},t.onerror=()=>{this.error=!0,this.$emit("error")},t.src=this.src}},(function(){var t=this,e=t._self._c;return e("span",t._g({staticClass:"k-image",attrs:{"data-ratio":t.ratio,"data-back":t.back,"data-cover":t.cover}},t.$listeners),[e("span",{style:"padding-bottom:"+t.ratioPadding},[t.loaded?e("img",{key:t.src,attrs:{alt:t.alt||"",src:t.src,srcset:t.srcset,sizes:t.sizes},on:{dragstart:function(t){t.preventDefault()}}}):t._e(),t.loaded||t.error?t._e():e("k-loader",{attrs:{position:"center",theme:"light"}}),!t.loaded&&t.error?e("k-icon",{staticClass:"k-image-error",attrs:{type:"cancel"}}):t._e()],1)])}),[],!1,null,null,null,null).exports;const jn=Q({},(function(){var t=this._self._c;return t("span",{staticClass:"k-loader"},[t("k-icon",{staticClass:"k-loader-icon",attrs:{type:"loader"}})],1)}),[],!1,null,null,null,null).exports;const En=Q({data:()=>({offline:!1}),created(){this.$events.$on("offline",this.isOffline),this.$events.$on("online",this.isOnline)},destroyed(){this.$events.$off("offline",this.isOffline),this.$events.$off("online",this.isOnline)},methods:{isOnline(){this.offline=!1},isOffline(){this.offline=!0}}},(function(){var t=this,e=t._self._c;return t.offline?e("div",{staticClass:"k-offline-warning"},[e("p",[e("k-icon",{attrs:{type:"bolt"}}),t._v(" "+t._s(t.$t("error.offline")))],1)]):t._e()}),[],!1,null,null,null,null).exports,Mn=(t,e=!1)=>{if(t>=0&&t<=100)return!0;if(e)throw new Error("value has to be between 0 and 100");return!1};const Ln=Q({props:{value:{type:Number,default:0,validator:Mn}},data(){return{state:this.value}},watch:{value(t){this.state=t}},methods:{set(t){Mn(t,!0),this.state=t}}},(function(){var t=this;return(0,t._self._c)("progress",{staticClass:"k-progress",attrs:{max:"100"},domProps:{value:t.state}},[t._v(t._s(t.state)+"%")])}),[],!1,null,null,null,null).exports;const Bn=Q({},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-registration"},[e("p",[t._v(t._s(t.$t("license.unregistered")))]),e("k-button",{staticClass:"k-topbar-button",attrs:{responsive:!0,tooltip:t.$t("license.unregistered"),icon:"key"},on:{click:function(e){return t.$dialog("registration")}}},[t._v(" "+t._s(t.$t("license.register"))+" ")]),e("k-button",{staticClass:"k-topbar-button",attrs:{responsive:!0,link:"https://getkirby.com/buy",target:"_blank",icon:"cart"}},[t._v(" "+t._s(t.$t("license.buy"))+" ")])],1)}),[],!1,null,null,null,null).exports;const Dn=Q({props:{icon:{type:String,default:"sort"}}},(function(){return(0,this._self._c)("k-icon",{staticClass:"k-sort-handle",attrs:{type:this.icon,"aria-hidden":"true"}})}),[],!1,null,null,null,null).exports;const Pn=Q({props:{click:{type:Function,default:()=>{}},disabled:Boolean,responsive:Boolean,status:String,text:String,tooltip:String},computed:{icon(){return"draft"===this.status?"circle-outline":"unlisted"===this.status?"circle-half":"circle"},theme(){return"draft"===this.status?"negative":"unlisted"===this.status?"info":"positive"},title(){let t=this.tooltip||this.text;return this.disabled&&(t+=` (${this.$t("disabled")})`),t}},methods:{onClick(){this.click(),this.$emit("click")}}},(function(){var t=this;return(0,t._self._c)("k-button",{class:"k-status-icon k-status-icon-"+t.status,attrs:{disabled:t.disabled,icon:t.icon,responsive:t.responsive,text:t.text,theme:t.theme,tooltip:t.title},on:{click:t.onClick}})}),[],!1,null,null,null,null).exports;const Nn=Q({props:{align:String,html:String,size:String,theme:String},computed:{attrs(){return{class:"k-text","data-align":this.align,"data-size":this.size,"data-theme":this.theme}}}},(function(){var t=this,e=t._self._c;return t.html?e("div",t._b({domProps:{innerHTML:t._s(t.html)}},"div",t.attrs,!1)):e("div",t._b({},"div",t.attrs,!1),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Rn=Q({props:{user:[Object,String]}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-user-info"},[t.user.avatar?e("k-image",{attrs:{cover:!0,src:t.user.avatar.url,ratio:"1/1"}}):e("k-icon",{attrs:{type:"user"}}),t._v(" "+t._s(t.user.name||t.user.email||t.user)+" ")],1)}),[],!1,null,null,null,null).exports,Fn={install(t){t.component("k-draggable",xn),t.component("k-error-boundary",Sn),t.component("k-fatal",Cn),t.component("k-headline",On),t.component("k-icon",An),t.component("k-icons",Tn),t.component("k-image",In),t.component("k-loader",jn),t.component("k-offline-warning",En),t.component("k-progress",Ln),t.component("k-registration",Bn),t.component("k-status-icon",Pn),t.component("k-sort-handle",Dn),t.component("k-text",Nn),t.component("k-user-info",Rn)}};const qn=Q({props:{crumbs:{type:Array,default:()=>[]},label:{type:String,default:"Breadcrumb"},view:Object},computed:{dropdown(){return this.segments.map((t=>({...t,text:t.label,icon:"angle-right"})))},segments(){return[{link:this.view.link,label:this.view.breadcrumbLabel,icon:this.view.icon,loading:this.$store.state.isLoading},...this.crumbs]}},methods:{isLast(t){return this.crumbs.length-1===t}}},(function(){var t=this,e=t._self._c;return e("nav",{staticClass:"k-breadcrumb",attrs:{"aria-label":t.label}},[e("k-dropdown",{staticClass:"k-breadcrumb-dropdown"},[e("k-button",{attrs:{icon:"road-sign"},on:{click:function(e){return t.$refs.dropdown.toggle()}}}),e("k-dropdown-content",{ref:"dropdown",attrs:{options:t.dropdown,theme:"light"}})],1),e("ol",t._l(t.segments,(function(s,n){return e("li",{key:n},[e("k-link",{staticClass:"k-breadcrumb-link",attrs:{title:s.text||s.label,to:s.link,"aria-current":!!t.isLast(n)&&"page"}},[s.loading?e("k-loader",{staticClass:"k-breadcrumb-icon"}):s.icon?e("k-icon",{staticClass:"k-breadcrumb-icon",attrs:{type:s.icon}}):t._e(),e("span",{staticClass:"k-breadcrumb-link-text"},[t._v(" "+t._s(s.text||s.label)+" ")])],1)],1)})),0)],1)}),[],!1,null,null,null,null).exports;const zn=Q({inheritAttrs:!1,props:{autofocus:Boolean,click:Function,current:[String,Boolean],disabled:Boolean,icon:String,id:[String,Number],link:String,responsive:Boolean,rel:String,role:String,target:String,tabindex:String,text:[String,Number],theme:String,tooltip:String,type:{type:String,default:"button"}},computed:{component(){return!0===this.disabled?"k-button-disabled":this.link?"k-button-link":"k-button-native"}},methods:{focus(){this.$refs.button.focus&&this.$refs.button.focus()},tab(){this.$refs.button.tab&&this.$refs.button.tab()},untab(){this.$refs.button.untab&&this.$refs.button.untab()}}},(function(){var t=this;return(0,t._self._c)(t.component,t._g(t._b({ref:"button",tag:"component"},"component",t.$props,!1),t.$listeners),[t.text?[t._v(" "+t._s(t.text)+" ")]:t._t("default")],2)}),[],!1,null,null,null,null).exports;const Yn=Q({inheritAttrs:!1,props:{icon:String,id:[String,Number],responsive:Boolean,theme:String,tooltip:String}},(function(){var t=this,e=t._self._c;return e("span",{staticClass:"k-button",attrs:{id:t.id,"data-disabled":!0,"data-responsive":t.responsive,"data-theme":t.theme,title:t.tooltip}},[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports;const Hn=Q({props:{buttons:Array}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-button-group"},[t.$slots.default?t._t("default"):t._l(t.buttons,(function(s,n){return e("k-button",t._b({key:n},"k-button",s,!1))}))],2)}),[],!1,null,null,null,null).exports;const Un=Q({inheritAttrs:!1,props:{autofocus:Boolean,current:[String,Boolean],icon:String,id:[String,Number],link:String,rel:String,responsive:Boolean,role:String,target:String,tabindex:String,theme:String,tooltip:String},methods:{focus(){this.$el.focus()}}},(function(){var t=this,e=t._self._c;return e("k-link",t._g({staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,rel:t.rel,role:t.role,tabindex:t.tabindex,target:t.target,title:t.tooltip,to:t.link}},t.$listeners),[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports,Kn={mounted(){this.$el.addEventListener("keyup",this.onTab,!0),this.$el.addEventListener("blur",this.onUntab,!0)},destroyed(){this.$el.removeEventListener("keyup",this.onTab,!0),this.$el.removeEventListener("blur",this.onUntab,!0)},methods:{focus(){this.$el.focus&&this.$el.focus()},onTab(t){9===t.keyCode&&this.$el.setAttribute("data-tabbed",!0)},onUntab(){this.$el.removeAttribute("data-tabbed")},tab(){this.$el.focus(),this.$el.setAttribute("data-tabbed",!0)},untab(){this.$el.removeAttribute("data-tabbed")}}};const Vn=Q({mixins:[Kn],inheritAttrs:!1,props:{autofocus:Boolean,click:{type:Function,default:()=>{}},current:[String,Boolean],icon:String,id:[String,Number],responsive:Boolean,role:String,tabindex:String,theme:String,tooltip:String,type:{type:String,default:"button"}}},(function(){var t=this,e=t._self._c;return e("button",t._g({staticClass:"k-button",attrs:{id:t.id,"aria-current":t.current,autofocus:t.autofocus,"data-theme":t.theme,"data-responsive":t.responsive,role:t.role,tabindex:t.tabindex,title:t.tooltip,type:t.type},on:{click:t.click}},t.$listeners),[t.icon?e("k-icon",{staticClass:"k-button-icon",attrs:{type:t.icon,alt:t.tooltip}}):t._e(),t.$slots.default?e("span",{staticClass:"k-button-text"},[t._t("default")],2):t._e()],1)}),[],!1,null,null,null,null).exports;const Jn=Q({},(function(){return(0,this._self._c)("span",{staticClass:"k-dropdown",on:{click:function(t){t.stopPropagation()}}},[this._t("default")],2)}),[],!1,null,null,null,null).exports;let Gn=null;const Wn=Q({props:{align:{type:String,default:"left"},options:[Array,Function,String],theme:{type:String,default:"dark"}},data:()=>({current:-1,dropup:!1,isOpen:!1,items:[]}),methods:{async fetchOptions(t){if(!this.options)return t(this.items);"string"==typeof this.options?this.$dropdown(this.options)(t):"function"==typeof this.options?this.options(t):Array.isArray(this.options)&&t(this.options)},onOptionClick(t){"function"==typeof t.click?t.click.call(this):t.click&&this.$emit("action",t.click)},open(){this.reset(),Gn&&Gn!==this&&Gn.close(),this.fetchOptions((t=>{this.$events.$on("keydown",this.navigate),this.$events.$on("click",this.close),this.items=t,this.isOpen=!0,Gn=this,this.onOpen(),this.$emit("open")}))},reset(){this.current=-1,this.$events.$off("keydown",this.navigate),this.$events.$off("click",this.close)},close(){this.reset(),this.isOpen=Gn=!1,this.$emit("close")},toggle(){this.isOpen?this.close():this.open()},focus(t=0){var e;(null==(e=this.$children[t])?void 0:e.focus)&&(this.current=t,this.$children[t].focus())},onOpen(){this.dropup=!1,this.$nextTick((()=>{if(this.$el){let t=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,e=50,s=this.$el.getBoundingClientRect().top||0,n=this.$el.clientHeight;s+n>t-e&&n+2*ethis.$children.length-1){const t=this.$children.filter((t=>!1===t.disabled));this.current=this.$children.indexOf(t[t.length-1]);break}if(this.$children[this.current]&&!1===this.$children[this.current].disabled){this.focus(this.current);break}}break;case"Tab":for(;;){if(this.current++,this.current>this.$children.length-1){this.close(),this.$emit("leave",t.code);break}if(this.$children[this.current]&&!1===this.$children[this.current].disabled)break}}}}},(function(){var t=this,e=t._self._c;return t.isOpen?e("div",{staticClass:"k-dropdown-content",attrs:{"data-align":t.align,"data-dropup":t.dropup,"data-theme":t.theme}},[t._t("default",(function(){return[t._l(t.items,(function(s,n){return["-"===s?e("hr",{key:t._uid+"-item-"+n}):e("k-dropdown-item",t._b({key:t._uid+"-item-"+n,ref:t._uid+"-item-"+n,refInFor:!0,on:{click:function(e){return t.onOptionClick(s)}}},"k-dropdown-item",s,!1),[t._v(" "+t._s(s.text)+" ")])]}))]}))],2):t._e()}),[],!1,null,null,null,null).exports;const Xn=Q({inheritAttrs:!1,props:{disabled:Boolean,icon:String,image:[String,Object],link:String,target:String,theme:String,upload:String,current:[String,Boolean]},data(){return{listeners:{...this.$listeners,click:t=>{this.$parent.close(),this.$emit("click",t)}}}},methods:{focus(){this.$refs.button.focus()},tab(){this.$refs.button.tab()}}},(function(){var t=this;return(0,t._self._c)("k-button",t._g(t._b({ref:"button",staticClass:"k-dropdown-item"},"k-button",t.$props,!1),t.listeners),[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Zn=Q({mixins:[Kn],props:{disabled:Boolean,rel:String,tabindex:[String,Number],target:String,title:String,to:[String,Function]},data(){return{relAttr:"_blank"===this.target?"noreferrer noopener":this.rel,listeners:{...this.$listeners,click:this.onClick}}},computed:{href(){return"function"==typeof this.to?"":"/"!==this.to[0]||this.target?!0===this.to.includes("@")&&!1===this.to.includes("/")&&!1===this.to.startsWith("mailto:")?"mailto:"+this.to:this.to:this.$url(this.to)}},methods:{isRoutable(t){if(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)return!1;if(t.defaultPrevented)return!1;if(void 0!==t.button&&0!==t.button)return!1;if(this.target)return!1;if("string"==typeof this.href){if(this.href.includes("://")||this.href.startsWith("//"))return!1;if(this.href.includes("mailto:"))return!1}return!0},onClick(t){if(!0===this.disabled)return t.preventDefault(),!1;"function"==typeof this.to&&(t.preventDefault(),this.to()),this.isRoutable(t)&&(t.preventDefault(),this.$go(this.to)),this.$emit("click",t)}}},(function(){var t=this,e=t._self._c;return t.to&&!t.disabled?e("a",t._g({ref:"link",staticClass:"k-link",attrs:{href:t.href,rel:t.relAttr,tabindex:t.tabindex,target:t.target,title:t.title}},t.listeners),[t._t("default")],2):e("span",{staticClass:"k-link",attrs:{title:t.title,"data-disabled":""}},[t._t("default")],2)}),[],!1,null,null,null,null).exports;const Qn=Q({computed:{defaultLanguage(){return this.$languages.find((t=>!0===t.default))},language(){return this.$language},languages(){return this.$languages.filter((t=>!1===t.default))}},methods:{change(t){this.$emit("change",t),this.$go(window.location,{query:{language:t.code}})}}},(function(){var t=this,e=t._self._c;return t.languages.length?e("k-dropdown",{staticClass:"k-languages-dropdown"},[e("k-button",{attrs:{text:t.language.name,responsive:!0,icon:"globe"},on:{click:function(e){return t.$refs.languages.toggle()}}}),t.languages?e("k-dropdown-content",{ref:"languages"},[e("k-dropdown-item",{on:{click:function(e){return t.change(t.defaultLanguage)}}},[t._v(" "+t._s(t.defaultLanguage.name)+" ")]),e("hr"),t._l(t.languages,(function(s){return e("k-dropdown-item",{key:s.code,on:{click:function(e){return t.change(s)}}},[t._v(" "+t._s(s.name)+" ")])}))],2):t._e()],1):t._e()}),[],!1,null,null,null,null).exports;const ti=Q({props:{align:{type:String,default:"right"},icon:{type:String,default:"dots"},options:{type:[Array,Function,String],default:()=>[]},text:{type:[Boolean,String],default:!0},theme:{type:String,default:"dark"}},computed:{hasSingleOption(){return Array.isArray(this.options)&&1===this.options.length}},methods:{onAction(t,e,s){"function"==typeof t?t.call(this):(this.$emit("action",t,e,s),this.$emit("option",t,e,s))},toggle(){this.$refs.options.toggle()}}},(function(){var t=this,e=t._self._c;return t.hasSingleOption?e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{icon:t.options[0].icon||t.icon,tooltip:t.options[0].tooltip||t.options[0].text},on:{click:function(e){return t.onAction(t.options[0].option||t.options[0].click,t.options[0],0)}}},[!0===t.text?[t._v(" "+t._s(t.options[0].text)+" ")]:!1!==t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2):t.options.length?e("k-dropdown",{staticClass:"k-options-dropdown"},[e("k-button",{staticClass:"k-options-dropdown-toggle",attrs:{icon:t.icon,tooltip:t.$t("options")},on:{click:function(e){return t.$refs.options.toggle()}}},[t.text&&!0!==t.text?[t._v(" "+t._s(t.text)+" ")]:t._e()],2),e("k-dropdown-content",{ref:"options",staticClass:"k-options-dropdown-content",attrs:{align:t.align,options:t.options},on:{action:t.onAction}})],1):t._e()}),[],!1,null,null,null,null).exports;const ei=Q({props:{align:{type:String,default:"left"},details:{type:Boolean,default:!1},dropdown:{type:Boolean,default:!0},keys:{type:Boolean,default:!1},limit:{type:Number,default:10},page:{type:Number,default:1},pageLabel:{type:String,default:()=>window.panel.$t("pagination.page")},total:{type:Number,default:0},prevLabel:{type:String,default:()=>window.panel.$t("prev")},nextLabel:{type:String,default:()=>window.panel.$t("next")},validate:{type:Function,default:()=>Promise.resolve()}},data(){return{currentPage:this.page}},computed:{show(){return this.pages>1},start(){return(this.currentPage-1)*this.limit+1},end(){let t=this.start-1+this.limit;return t>this.total?this.total:t},detailsText(){return 1===this.limit?this.start+" / ":this.start+"-"+this.end+" / "},pages(){return Math.ceil(this.total/this.limit)},hasPrev(){return this.start>1},hasNext(){return this.endthis.limit},offset(){return this.start-1}},watch:{page(t){this.currentPage=parseInt(t)}},created(){!0===this.keys&&window.addEventListener("keydown",this.navigate,!1)},destroyed(){window.removeEventListener("keydown",this.navigate,!1)},methods:{async goTo(t){try{await this.validate(t),t<1&&(t=1),t>this.pages&&(t=this.pages),this.currentPage=t,this.$refs.dropdown&&this.$refs.dropdown.close(),this.$emit("paginate",{page:this.currentPage,start:this.start,end:this.end,limit:this.limit,offset:this.offset})}catch(e){}},prev(){this.goTo(this.currentPage-1)},next(){this.goTo(this.currentPage+1)},navigate(t){switch(t.code){case"ArrowLeft":this.prev();break;case"ArrowRight":this.next()}}}},(function(){var t=this,e=t._self._c;return t.show?e("nav",{staticClass:"k-pagination",attrs:{"data-align":t.align}},[t.show?e("k-button",{attrs:{disabled:!t.hasPrev,tooltip:t.prevLabel,icon:"angle-left"},on:{click:t.prev}}):t._e(),t.details?[t.dropdown?[e("k-dropdown",[e("k-button",{staticClass:"k-pagination-details",attrs:{disabled:!t.hasPages},on:{click:function(e){return t.$refs.dropdown.toggle()}}},[t.total>1?[t._v(" "+t._s(t.detailsText)+" ")]:t._e(),t._v(" "+t._s(t.total)+" ")],2),e("k-dropdown-content",{ref:"dropdown",staticClass:"k-pagination-selector",on:{open:function(e){t.$nextTick((()=>t.$refs.page.focus()))}}},[e("div",{staticClass:"k-pagination-settings"},[e("label",{attrs:{for:"k-pagination-page"}},[e("span",[t._v(t._s(t.pageLabel)+":")]),e("select",{ref:"page",attrs:{id:"k-pagination-page"}},t._l(t.pages,(function(s){return e("option",{key:s,domProps:{selected:t.page===s,value:s}},[t._v(" "+t._s(s)+" ")])})),0)]),e("k-button",{attrs:{icon:"check"},on:{click:function(e){return t.goTo(t.$refs.page.value)}}})],1)])],1)]:[e("span",{staticClass:"k-pagination-details"},[t.total>1?[t._v(" "+t._s(t.detailsText)+" ")]:t._e(),t._v(" "+t._s(t.total)+" ")],2)]]:t._e(),t.show?e("k-button",{attrs:{disabled:!t.hasNext,tooltip:t.nextLabel,icon:"angle-right"},on:{click:t.next}}):t._e()],2):t._e()}),[],!1,null,null,null,null).exports;const si=Q({props:{prev:{type:[Boolean,Object],default:!1},next:{type:[Boolean,Object],default:!1}},computed:{buttons(){return[{...this.button(this.prev),icon:"angle-left"},{...this.button(this.next),icon:"angle-right"}]}},methods:{button:t=>t||{disabled:!0,link:"#"}}},(function(){return(0,this._self._c)("k-button-group",{staticClass:"k-prev-next",attrs:{buttons:this.buttons}})}),[],!1,null,null,null,null).exports;const ni=Q({props:{types:{type:Object,default:()=>({})},type:String},data(){return{isLoading:!1,hasResults:!0,items:[],currentType:this.getType(this.type),q:null,selected:-1}},watch:{q(t,e){t!==e&&this.search(this.q)},currentType(t,e){t!==e&&this.search(this.q)},type(){this.currentType=this.getType(this.type)}},created(){this.search=it(this.search,250),this.$events.$on("keydown.cmd.shift.f",this.open),this.$events.$on("keydown.cmd.k",this.open),this.$events.$on("keydown.cmd./",this.open)},destroyed(){this.$events.$off("keydown.cmd.shift.f",this.open),this.$events.$off("keydown.cmd.k",this.open),this.$events.$off("keydown.cmd./",this.open)},methods:{changeType(t){this.currentType=this.getType(t),this.$nextTick((()=>{this.$refs.input.focus()}))},close(){this.$refs.overlay.close(),this.hasResults=!0,this.items=[],this.q=null},getType(t){return this.types[t]||this.types[Object.keys(this.types)[0]]},navigate(t){this.$go(t.link),this.close()},onDown(){this.selected=0&&this.select(this.selected-1)},open(t){null==t||t.preventDefault(),this.$refs.overlay.open()},async search(t){this.isLoading=!0,this.$refs.types&&this.$refs.types.close();try{if(null===t||""===t)throw Error("Empty query");const e=await this.$search(this.currentType.id,t);if(!1===e)throw Error("JSON parsing failed");this.items=e.results}catch(e){this.items=[]}finally{this.select(-1),this.isLoading=!1,this.hasResults=this.items.length>0}},select(t){if(this.selected=t,this.$refs.items){const e=this.$refs.items.$el.querySelectorAll(".k-item");[...e].forEach((t=>delete t.dataset.selected)),t>=0&&(e[t].dataset.selected=!0)}}}},(function(){var t=this,e=t._self._c;return e("k-overlay",{ref:"overlay"},[e("div",{staticClass:"k-search",attrs:{role:"search"}},[e("div",{staticClass:"k-search-input"},[e("k-dropdown",{staticClass:"k-search-types"},[e("k-button",{attrs:{icon:t.currentType.icon,text:t.currentType.label},on:{click:function(e){return t.$refs.types.toggle()}}}),e("k-dropdown-content",{ref:"types"},t._l(t.types,(function(s,n){return e("k-dropdown-item",{key:n,attrs:{icon:s.icon},on:{click:function(e){return t.changeType(n)}}},[t._v(" "+t._s(s.label)+" ")])})),1)],1),e("input",{ref:"input",attrs:{placeholder:t.$t("search")+" …","aria-label":t.$t("search"),autofocus:!0,type:"text"},domProps:{value:t.q},on:{input:function(e){return t.onInput(e.target.value)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.onDown.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.onUp.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:(e.preventDefault(),t.onTab.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onEnter.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.close.apply(null,arguments)}]}}),e("k-button",{staticClass:"k-search-close",attrs:{icon:t.isLoading?"loader":"cancel",tooltip:t.$t("close")},on:{click:t.close}})],1),!t.q||t.hasResults&&!t.items.length?t._e():e("div",{staticClass:"k-search-results"},[t.items.length?e("k-collection",{ref:"items",attrs:{items:t.items},on:{hover:t.onHover},nativeOn:{mouseout:function(e){return t.select(-1)}}}):t.hasResults?t._e():e("p",{staticClass:"k-search-empty"},[t._v(" "+t._s(t.$t("search.results.none"))+" ")])],1)])])}),[],!1,null,null,null,null).exports;const ii=Q({props:{removable:Boolean},methods:{remove(){this.removable&&this.$emit("remove")},focus(){this.$refs.button.focus()}}},(function(){var t=this,e=t._self._c;return e("span",{ref:"button",staticClass:"k-tag",attrs:{tabindex:"0"},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?null:(e.preventDefault(),t.remove.apply(null,arguments))}}},[e("span",{staticClass:"k-tag-text"},[t._t("default")],2),t.removable?e("k-icon",{staticClass:"k-tag-toggle",attrs:{type:"cancel-small"},nativeOn:{click:function(e){return t.remove.apply(null,arguments)}}}):t._e()],1)}),[],!1,null,null,null,null).exports;const oi=Q({props:{breadcrumb:Array,license:Boolean,menu:Array,title:String,view:Object},computed:{notification(){return this.$store.state.notification.type&&"error"!==this.$store.state.notification.type?this.$store.state.notification:null}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-topbar"},[e("k-view",[e("div",{staticClass:"k-topbar-wrapper"},[e("k-dropdown",{staticClass:"k-topbar-menu"},[e("k-button",{staticClass:"k-topbar-button k-topbar-menu-button",attrs:{tooltip:t.$t("menu"),icon:"bars"},on:{click:function(e){return t.$refs.menu.toggle()}}},[e("k-icon",{attrs:{type:"angle-down"}})],1),e("k-dropdown-content",{ref:"menu",staticClass:"k-topbar-menu",attrs:{options:t.menu,theme:"light"}})],1),e("k-breadcrumb",{staticClass:"k-topbar-breadcrumb",attrs:{crumbs:t.breadcrumb,view:t.view}}),e("div",{staticClass:"k-topbar-signals"},[t.notification?e("k-button",{staticClass:"k-topbar-notification k-topbar-button",attrs:{text:t.notification.message,theme:"positive"},on:{click:function(e){return t.$store.dispatch("notification/close")}}}):t.license?t._e():e("k-registration"),e("k-form-indicator"),e("k-button",{staticClass:"k-topbar-button",attrs:{tooltip:t.$t("search"),icon:"search"},on:{click:function(e){return t.$refs.search.open()}}})],1)],1)]),e("k-search",{ref:"search",attrs:{type:t.$view.search||"pages",types:t.$searches}})],1)}),[],!1,null,null,null,null).exports,ri={install(t){t.component("k-breadcrumb",qn),t.component("k-button",zn),t.component("k-button-disabled",Yn),t.component("k-button-group",Hn),t.component("k-button-link",Un),t.component("k-button-native",Vn),t.component("k-dropdown",Jn),t.component("k-dropdown-content",Wn),t.component("k-dropdown-item",Xn),t.component("k-languages-dropdown",Qn),t.component("k-link",Zn),t.component("k-options-dropdown",ti),t.component("k-pagination",ei),t.component("k-prev-next",si),t.component("k-search",ni),t.component("k-tag",ii),t.component("k-topbar",oi)}};const li=Q({props:{empty:String,blueprint:String,lock:[Boolean,Object],parent:String,tab:Object},computed:{content(){return this.$store.getters["content/values"]()}},methods:{exists(t){return this.$helper.isComponent(`k-${t}-section`)}}},(function(){var t=this,e=t._self._c;return 0===t.tab.columns.length?e("k-box",{attrs:{html:!0,text:t.empty,theme:"info"}}):e("k-grid",{staticClass:"k-sections",attrs:{gutter:"large"}},t._l(t.tab.columns,(function(s,n){return e("k-column",{key:t.parent+"-column-"+n,attrs:{width:s.width,sticky:s.sticky}},[t._l(s.sections,(function(i,o){return[t.$helper.field.isVisible(i,t.content)?[t.exists(i.type)?e("k-"+i.type+"-section",t._b({key:t.parent+"-column-"+n+"-section-"+o+"-"+t.blueprint,tag:"component",class:"k-section k-section-name-"+i.name,attrs:{column:s.width,lock:t.lock,name:i.name,parent:t.parent,timestamp:t.$view.timestamp},on:{submit:function(e){return t.$emit("submit",e)}}},"component",i,!1)):[e("k-box",{key:t.parent+"-column-"+n+"-section-"+o,attrs:{text:t.$t("error.section.type.invalid",{type:i.type}),theme:"negative"}})]]:t._e()]}))],2)})),1)}),[],!1,null,null,null,null).exports,ai={props:{blueprint:String,lock:[Boolean,Object],help:String,name:String,parent:String,timestamp:Number},methods:{load(){return this.$api.get(this.parent+"/sections/"+this.name)}}};const ui=Q({mixins:[ai],inheritAttrs:!1,data:()=>({fields:{},isLoading:!0,issue:null}),computed:{values(){return this.$store.getters["content/values"]()}},watch:{timestamp(){this.fetch()}},created(){this.input=it(this.input,50),this.fetch()},methods:{input(t,e,s){this.$store.dispatch("content/update",[s,t[s]])},async fetch(){try{const t=await this.load();this.fields=t.fields,Object.keys(this.fields).forEach((t=>{this.fields[t].section=this.name,this.fields[t].endpoints={field:this.parent+"/fields/"+t,section:this.parent+"/sections/"+this.name,model:this.parent}}))}catch(t){this.issue=t}finally{this.isLoading=!1}},onSubmit(t){this.$store.dispatch("content/update",[null,t]),this.$events.$emit("keydown.cmd.s",t)}}},(function(){var t=this,e=t._self._c;return t.isLoading?t._e():e("section",{staticClass:"k-fields-section"},[t.issue?[e("k-headline",{staticClass:"k-fields-issue-headline"},[t._v(" Error ")]),e("k-box",{attrs:{text:t.issue.message,html:!1,theme:"negative"}})]:t._e(),e("k-form",{attrs:{fields:t.fields,validate:!0,value:t.values,disabled:t.lock&&"lock"===t.lock.state},on:{input:t.input,submit:t.onSubmit}})],2)}),[],!1,null,null,null,null).exports;const ci=Q({inheritAttrs:!1,props:{blueprint:String,column:String,parent:String,name:String,timestamp:Number},data:()=>({data:[],error:null,isLoading:!1,isProcessing:!1,options:{columns:{},empty:null,headline:null,help:null,layout:"list",link:null,max:null,min:null,size:null,sortable:null},pagination:{page:null},searchterm:null,searching:!1}),computed:{addIcon:()=>"add",buttons(){let t=[];return this.canSearch&&t.push({icon:"filter",text:this.$t("search"),click:this.onSearchToggle,responsive:!0}),this.canAdd&&t.push({icon:this.addIcon,text:this.$t("add"),click:this.onAdd}),t},canAdd:()=>!0,canDrop:()=>!1,canSearch(){return this.options.search},collection(){return{columns:this.options.columns,empty:this.emptyPropsWithSearch,layout:this.options.layout,help:this.options.help,items:this.items,pagination:this.pagination,sortable:!this.isProcessing&&this.options.sortable,size:this.options.size}},emptyProps(){return{icon:"page",text:this.$t("pages.empty")}},emptyPropsWithSearch(){return{...this.emptyProps,text:this.searching?this.$t("search.results.none"):this.options.empty||this.emptyProps.text}},items(){return this.data},isInvalid(){var t;return!((null==(t=this.searchterm)?void 0:t.length)>0)&&(!!(this.options.min&&this.data.lengththis.options.max))},paginationId(){return"kirby$pagination$"+this.parent+"/"+this.name},type:()=>"models"},watch:{searchterm:it((function(){this.pagination.page=0,this.reload()}),200),timestamp(){this.reload()}},created(){this.load()},methods:{async load(t){t||(this.isLoading=!0),this.isProcessing=!0,null===this.pagination.page&&(this.pagination.page=localStorage.getItem(this.paginationId)||1);try{const t=await this.$api.get(this.parent+"/sections/"+this.name,{page:this.pagination.page,searchterm:this.searchterm});this.options=t.options,this.pagination=t.pagination,this.data=t.data}catch(e){this.error=e.message}finally{this.isProcessing=!1,this.isLoading=!1}},onAction(){},onAdd(){},onChange(){},onDrop(){},onSort(){},onPaginate(t){localStorage.setItem(this.paginationId,t.page),this.pagination=t,this.reload()},onSearchToggle(){this.searching=!this.searching,this.searchterm=null},onUpload(){},async reload(){await this.load(!0)},update(){this.reload(),this.$events.$emit("model.update")}}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("section",{class:`k-models-section k-${t.type}-section`,attrs:{"data-processing":t.isProcessing}},[e("header",{staticClass:"k-section-header"},[e("k-headline",{attrs:{link:t.options.link}},[t._v(" "+t._s(t.options.headline||" ")+" "),t.options.min?e("abbr",{attrs:{title:t.$t("section.required")}},[t._v("*")]):t._e()]),e("k-button-group",{attrs:{buttons:t.buttons}})],1),t.error?e("k-box",{attrs:{theme:"negative"}},[e("k-text",{attrs:{size:"small"}},[e("strong",[t._v(" "+t._s(t.$t("error.section.notLoaded",{name:t.name}))+": ")]),t._v(" "+t._s(t.error)+" ")])],1):[e("k-dropzone",{attrs:{disabled:!t.canDrop},on:{drop:t.onDrop}},[t.searching&&t.options.search?e("k-input",{staticClass:"k-models-section-search",attrs:{autofocus:!0,placeholder:t.$t("search")+" …",value:t.searchterm,type:"text"},on:{input:function(e){t.searchterm=e},keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.onSearchToggle.apply(null,arguments)}}}):t._e(),e("k-collection",t._g(t._b({attrs:{"data-invalid":t.isInvalid},on:{action:t.onAction,change:t.onChange,sort:t.onSort,paginate:t.onPaginate}},"k-collection",t.collection,!1),t.canAdd?{empty:t.onAdd}:{}))],1),e("k-upload",{ref:"upload",on:{success:t.onUpload,error:t.reload}})]],2):t._e()}),[],!1,null,null,null,null).exports;const di=Q({extends:ci,computed:{addIcon:()=>"upload",canAdd(){return this.$permissions.files.create&&!1!==this.options.upload},canDrop(){return!1!==this.canAdd},emptyProps(){return{icon:"image",text:this.$t("files.empty")}},items(){return this.data.map((t=>(t.sortable=this.options.sortable,t.column=this.column,t.options=this.$dropdown(t.link,{query:{view:"list",update:this.options.sortable,delete:this.data.length>this.options.min}}),t.data={"data-id":t.id,"data-template":t.template},t)))},type:()=>"files",uploadProps(){return{...this.options.upload,url:this.$urls.api+"/"+this.options.upload.api}}},created(){this.$events.$on("model.update",this.reload),this.$events.$on("file.sort",this.reload)},destroyed(){this.$events.$off("model.update",this.reload),this.$events.$off("file.sort",this.reload)},methods:{onAction(t,e){"replace"===t&&this.replace(e)},onAdd(){this.canAdd&&this.$refs.upload.open(this.uploadProps)},onDrop(t){this.canAdd&&this.$refs.upload.drop(t,this.uploadProps)},async onSort(t){if(!1===this.options.sortable)return!1;this.isProcessing=!0;try{await this.$api.patch(this.options.apiUrl+"/files/sort",{files:t.map((t=>t.id)),index:this.pagination.offset}),this.$store.dispatch("notification/success",":)"),this.$events.$emit("file.sort")}catch(e){this.reload(),this.$store.dispatch("notification/error",e.message)}finally{this.isProcessing=!1}},onUpload(){this.$events.$emit("file.create"),this.$events.$emit("model.update"),this.$store.dispatch("notification/success",":)")},replace(t){this.$refs.upload.open({url:this.$urls.api+"/"+t.link,accept:"."+t.extension+","+t.mime,multiple:!1})}}},null,null,!1,null,null,null,null).exports;const pi=Q({mixins:[ai],data:()=>({label:null,text:null,theme:null}),async created(){const t=await this.load();this.label=t.label,this.text=t.text,this.theme=t.theme||"info"}},(function(){var t=this,e=t._self._c;return e("section",{staticClass:"k-info-section"},[e("k-headline",{staticClass:"k-info-section-label"},[t._v(" "+t._s(t.label)+" ")]),e("k-box",{attrs:{theme:t.theme}},[e("k-text",{attrs:{html:t.text}})],1)],1)}),[],!1,null,null,null,null).exports;const hi=Q({extends:ci,computed:{canAdd(){return this.options.add&&this.$permissions.pages.create},items(){return this.data.map((t=>{const e=!1!==t.permissions.changeStatus;return t.flag={status:t.status,tooltip:this.$t("page.status")+": "+this.$t("page.status."+t.status),disabled:!e,click:()=>this.$dialog(t.link+"/changeStatus")},t.sortable=t.permissions.sort&&this.options.sortable,t.deletable=this.data.length>this.options.min,t.column=this.column,t.options=this.$dropdown(t.link,{query:{view:"list",delete:t.deletable,sort:t.sortable}}),t.data={"data-id":t.id,"data-status":t.status,"data-template":t.template},t}))}},created(){this.$events.$on("page.changeStatus",this.reload),this.$events.$on("page.sort",this.reload)},destroyed(){this.$events.$off("page.changeStatus",this.reload),this.$events.$off("page.sort",this.reload)},methods:{onAdd(){this.canAdd&&this.$dialog("pages/create",{query:{parent:this.options.link||this.parent,view:this.parent,section:this.name}})},async onChange(t){let e=null;if(t.added&&(e="added"),t.moved&&(e="moved"),e){this.isProcessing=!0;const n=t[e].element,i=t[e].newIndex+1+this.pagination.offset;try{await this.$api.pages.changeStatus(n.id,"listed",i),this.$store.dispatch("notification/success",":)"),this.$events.$emit("page.sort",n)}catch(s){this.$store.dispatch("notification/error",{message:s.message,details:s.details}),await this.reload()}finally{this.isProcessing=!1}}}}},null,null,!1,null,null,null,null).exports;const mi=Q({mixins:[ai],data:()=>({isLoading:!0,headline:null,reports:null,size:null}),async created(){const t=await this.load();this.isLoading=!1,this.headline=t.headline,this.reports=t.reports,this.size=t.size},methods:{}},(function(){var t=this,e=t._self._c;return!1===t.isLoading?e("section",{staticClass:"k-stats-section"},[e("header",{staticClass:"k-section-header"},[e("k-headline",[t._v(" "+t._s(t.headline)+" ")])],1),t.reports.length>0?e("k-stats",{attrs:{reports:t.reports,size:t.size}}):e("k-empty",{attrs:{icon:"chart"}},[t._v(" "+t._s(t.empty||t.$t("stats.empty")))])],1):t._e()}),[],!1,null,null,null,null).exports,fi={install(t){t.component("k-sections",li),t.component("k-fields-section",ui),t.component("k-files-section",di),t.component("k-info-section",pi),t.component("k-pages-section",hi),t.component("k-stats-section",mi)}};const gi=Q({props:{blueprint:String,next:Object,prev:Object,permissions:{type:Object,default:()=>({})},lock:{type:[Boolean,Object]},model:{type:Object,default:()=>({})},tab:{type:Object,default:()=>({columns:[]})},tabs:{type:Array,default:()=>[]}},computed:{id(){return this.model.link},isLocked(){var t;return"lock"===(null==(t=this.lock)?void 0:t.state)},protectedFields:()=>[]},watch:{"model.id":{handler(){this.content()},immediate:!0}},created(){this.$events.$on("model.reload",this.reload),this.$events.$on("keydown.left",this.toPrev),this.$events.$on("keydown.right",this.toNext)},destroyed(){this.$events.$off("model.reload",this.reload),this.$events.$off("keydown.left",this.toPrev),this.$events.$off("keydown.right",this.toNext)},methods:{content(){this.$store.dispatch("content/create",{id:this.id,api:this.id,content:this.model.content,ignore:this.protectedFields})},async reload(){await this.$reload(),this.content()},toPrev(t){this.prev&&"body"===t.target.localName&&this.$go(this.prev.link)},toNext(t){this.next&&"body"===t.target.localName&&this.$go(this.next.link)}}},null,null,!1,null,null,null,null).exports;const ki=Q({extends:gi,computed:{avatarOptions(){return[{icon:"upload",text:this.$t("change"),click:()=>this.$refs.upload.open()},{icon:"trash",text:this.$t("delete"),click:this.deleteAvatar}]},buttons(){return[{icon:"email",text:`${this.$t("email")}: ${this.model.email}`,disabled:!this.permissions.changeEmail||this.isLocked,click:()=>this.$dialog(this.id+"/changeEmail")},{icon:"bolt",text:`${this.$t("role")}: ${this.model.role}`,disabled:!this.permissions.changeRole||this.isLocked,click:()=>this.$dialog(this.id+"/changeRole")},{icon:"globe",text:`${this.$t("language")}: ${this.model.language}`,disabled:!this.permissions.changeLanguage||this.isLocked,click:()=>this.$dialog(this.id+"/changeLanguage")}]},uploadApi(){return this.$urls.api+"/"+this.id+"/avatar"}},methods:{async deleteAvatar(){await this.$api.users.deleteAvatar(this.model.id),this.avatar=null,this.$store.dispatch("notification/success",":)"),this.$reload()},onAvatar(){this.model.avatar?this.$refs.picture.toggle():this.$refs.upload.open()},uploadedAvatar(){this.$store.dispatch("notification/success",":)"),this.$reload()}}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("div",{staticClass:"k-user-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[e("div",{staticClass:"k-user-profile"},[e("k-view",[e("k-dropdown",[e("k-button",{staticClass:"k-user-view-image",attrs:{tooltip:t.$t("avatar"),disabled:t.isLocked},on:{click:t.onAvatar}},[t.model.avatar?e("k-image",{attrs:{cover:!0,src:t.model.avatar,ratio:"1/1"}}):e("k-icon",{attrs:{back:"gray-900",color:"gray-200",type:"user"}})],1),t.model.avatar?e("k-dropdown-content",{ref:"picture",attrs:{options:t.avatarOptions}}):t._e()],1),e("k-button-group",{attrs:{buttons:t.buttons}})],1)],1),e("k-view",[e("k-header",{attrs:{editable:t.permissions.changeName&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[e("k-dropdown",{staticClass:"k-user-view-options"},[e("k-button",{attrs:{disabled:t.isLocked,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)}})],1),e("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[t.model.account?t._e():e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[t.model.name&&0!==t.model.name.length?[t._v(" "+t._s(t.model.name)+" ")]:e("span",{staticClass:"k-user-name-placeholder"},[t._v(" "+t._s(t.$t("name"))+" … ")])],2),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("user.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}}),e("k-upload",{ref:"upload",attrs:{url:t.uploadApi,multiple:!1,accept:"image/*"},on:{success:t.uploadedAvatar}})],1)],1)])}),[],!1,null,null,null,null).exports;const bi=Q({extends:ki,prevnext:!1},null,null,!1,null,null,null,null).exports;const vi=Q({props:{error:String,layout:String}},(function(){var t=this,e=t._self._c;return e(`k-${t.layout}`,{tag:"component"},[e("k-view",{staticClass:"k-error-view"},[e("div",{staticClass:"k-error-view-content"},[e("k-text",[e("p",[e("k-icon",{staticClass:"k-error-view-icon",attrs:{type:"alert"}})],1),t._t("default",(function(){return[e("p",[t._v(" "+t._s(t.error)+" ")])]}))],2)],1)])],1)}),[],!1,null,null,null,null).exports;const yi=Q({extends:gi,props:{preview:Object},methods:{action(t){if("replace"===t)this.$refs.upload.open({url:this.$urls.api+"/"+this.id,accept:"."+this.model.extension+","+this.model.mime,multiple:!1})},onUpload(){this.$store.dispatch("notification/success",":)"),this.$reload()}}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("div",{staticClass:"k-file-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[e("k-file-preview",t._b({},"k-file-preview",t.preview,!1)),e("k-view",{staticClass:"k-file-content"},[e("k-header",{attrs:{editable:t.permissions.changeName&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeName")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-file-view-options",attrs:{link:t.preview.url,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}),e("k-dropdown",{staticClass:"k-file-view-options"},[e("k-button",{attrs:{disabled:t.isLocked,responsive:!0,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)},on:{action:t.action}})],1),e("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[e("k-prev-next",{attrs:{prev:t.prev,next:t.next}})]},proxy:!0}])},[t._v(" "+t._s(t.model.filename)+" ")]),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("file.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}}),e("k-upload",{ref:"upload",on:{success:t.onUpload}})],1)],1)])}),[],!1,null,null,null,null).exports;const $i=Q({props:{isInstallable:Boolean,isInstalled:Boolean,isOk:Boolean,requirements:Object,translations:Array},data(){return{user:{name:"",email:"",language:this.$translation.code,password:"",role:"admin"}}},computed:{fields(){return{email:{label:this.$t("email"),type:"email",link:!1,autofocus:!0,required:!0},password:{label:this.$t("password"),type:"password",placeholder:this.$t("password")+" …",required:!0},language:{label:this.$t("language"),type:"select",options:this.translations,icon:"globe",empty:!1,required:!0}}},isReady(){return this.isOk&&this.isInstallable},isComplete(){return this.isOk&&this.isInstalled}},methods:{async install(){try{await this.$api.system.install(this.user),await this.$reload({globals:["$system","$translation"]}),this.$store.dispatch("notification/success",this.$t("welcome")+"!")}catch(t){this.$store.dispatch("notification/error",t)}}}},(function(){var t=this,e=t._self._c;return e("k-panel",[e("k-view",{staticClass:"k-installation-view",attrs:{align:"center"}},[t.isComplete?e("k-text",[e("k-headline",[t._v(t._s(t.$t("installation.completed")))]),e("k-link",{attrs:{to:"/login"}},[t._v(" "+t._s(t.$t("login"))+" ")])],1):t.isReady?e("form",{on:{submit:function(e){return e.preventDefault(),t.install.apply(null,arguments)}}},[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("installation"))+" ")]),e("k-fieldset",{attrs:{fields:t.fields,novalidate:!0,value:t.user},on:{input:function(e){t.user=e}}}),e("k-button",{attrs:{text:t.$t("install"),type:"submit",icon:"check"}})],1):e("div",[e("k-headline",[t._v(" "+t._s(t.$t("installation.issues.headline"))+" ")]),e("ul",{staticClass:"k-installation-issues"},[!1===t.isInstallable?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.disabled"))}})],1):t._e(),!1===t.requirements.php?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.php"))}})],1):t._e(),!1===t.requirements.server?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.server"))}})],1):t._e(),!1===t.requirements.mbstring?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.mbstring"))}})],1):t._e(),!1===t.requirements.curl?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.curl"))}})],1):t._e(),!1===t.requirements.accounts?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.accounts"))}})],1):t._e(),!1===t.requirements.content?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.content"))}})],1):t._e(),!1===t.requirements.media?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.media"))}})],1):t._e(),!1===t.requirements.sessions?e("li",[e("k-icon",{attrs:{type:"alert"}}),e("span",{domProps:{innerHTML:t._s(t.$t("installation.issues.sessions"))}})],1):t._e()]),e("k-button",{attrs:{text:t.$t("retry"),icon:"refresh"},on:{click:t.$reload}})],1)],1)],1)}),[],!1,null,null,null,null).exports;const _i=Q({props:{languages:{type:Array,default:()=>[]}},computed:{languagesCollection(){return this.languages.map((t=>({...t,image:{back:"black",color:"gray",icon:"globe"},link:()=>{this.$dialog(`languages/${t.id}/update`)},options:[{icon:"edit",text:this.$t("edit"),click(){this.$dialog(`languages/${t.id}/update`)}},{icon:"trash",text:this.$t("delete"),disabled:t.default&&1!==this.languages.length,click(){this.$dialog(`languages/${t.id}/delete`)}}]})))},primaryLanguage(){return this.languagesCollection.filter((t=>t.default))},secondaryLanguages(){return this.languagesCollection.filter((t=>!1===t.default))}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-languages-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.languages"))+" "),e("k-button-group",{attrs:{slot:"left"},slot:"left"},[e("k-button",{attrs:{text:t.$t("language.create"),icon:"add"},on:{click:function(e){return t.$dialog("languages/create")}}})],1)],1),e("section",{staticClass:"k-languages"},[t.languages.length>0?[e("section",{staticClass:"k-languages-view-section"},[e("header",{staticClass:"k-languages-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("languages.default")))])],1),e("k-collection",{attrs:{items:t.primaryLanguage}})],1),e("section",{staticClass:"k-languages-view-section"},[e("header",{staticClass:"k-languages-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("languages.secondary")))])],1),t.secondaryLanguages.length?e("k-collection",{attrs:{items:t.secondaryLanguages}}):e("k-empty",{attrs:{icon:"globe"},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.secondary.empty"))+" ")])],1)]:0===t.languages.length?[e("k-empty",{attrs:{icon:"globe"},on:{click:function(e){return t.$dialog("languages/create")}}},[t._v(" "+t._s(t.$t("languages.empty"))+" ")])]:t._e()],2)],1)],1)}),[],!1,null,null,null,null).exports;const wi=Q({components:{"k-login-plugin":window.panel.plugins.login||Nt},props:{methods:Array,pending:Object},data:()=>({issue:""}),computed:{form(){return this.pending.email?"code":"login"},viewClass(){return"code"===this.form?"k-login-code-view":"k-login-view"}},created(){this.$store.dispatch("content/clear")},methods:{async onError(t){null!==t?(!0===t.details.challengeDestroyed&&await this.$reload({globals:["$system"]}),this.issue=t.message):this.issue=null}}},(function(){var t=this,e=t._self._c;return e("k-panel",[e("k-view",{class:t.viewClass,attrs:{align:"center"}},[e("div",[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("login"))+" ")]),t.issue?e("k-login-alert",{on:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),"code"===t.form?e("k-login-code",t._b({on:{error:t.onError}},"k-login-code",t.$props,!1)):e("k-login-plugin",{attrs:{methods:t.methods},on:{error:t.onError}})],1)])],1)}),[],!1,null,null,null,null).exports;const xi=Q({extends:gi,props:{status:Object},computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("k-view",{staticClass:"k-page-view",attrs:{"data-locked":t.isLocked,"data-id":t.model.id,"data-template":t.blueprint}},[e("k-header",{attrs:{editable:t.permissions.changeTitle&&!t.isLocked,tab:t.tab.name,tabs:t.tabs},on:{edit:function(e){return t.$dialog(t.id+"/changeTitle")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[t.permissions.preview&&t.model.previewUrl?e("k-button",{staticClass:"k-page-view-preview",attrs:{link:t.model.previewUrl,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}):t._e(),t.status?e("k-status-icon",{attrs:{status:t.model.status,disabled:!t.permissions.changeStatus||t.isLocked,responsive:!0,text:t.status.label},on:{click:function(e){return t.$dialog(t.id+"/changeStatus")}}}):t._e(),e("k-dropdown",{staticClass:"k-page-view-options"},[e("k-button",{attrs:{disabled:!0===t.isLocked,responsive:!0,text:t.$t("settings"),icon:"cog"},on:{click:function(e){return t.$refs.settings.toggle()}}}),e("k-dropdown-content",{ref:"settings",attrs:{options:t.$dropdown(t.id)}})],1),e("k-languages-dropdown")],1)]},proxy:!0},{key:"right",fn:function(){return[t.model.id?e("k-prev-next",{attrs:{prev:t.prev,next:t.next}}):t._e()]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("page.blueprint",{blueprint:t.$esc(t.blueprint)}),lock:t.lock,parent:t.id,tab:t.tab}})],1)],1)}),[],!1,null,null,null,null).exports;const Si=Q({props:{id:String},computed:{view(){return"k-"+this.id+"-plugin-view"}}},(function(){var t=this._self._c;return t("k-inside",[t(this.view,{tag:"component"})],1)}),[],!1,null,null,null,null).exports;const Ci=Q({data:()=>({isLoading:!1,issue:"",values:{password:null,passwordConfirmation:null}}),computed:{fields(){return{password:{autofocus:!0,label:this.$t("user.changePassword.new"),icon:"key",type:"password"},passwordConfirmation:{label:this.$t("user.changePassword.new.confirm"),icon:"key",type:"password"}}}},mounted(){this.$store.dispatch("title",this.$t("view.resetPassword"))},methods:{async submit(){if(!this.values.password||this.values.password.length<8)return this.issue=this.$t("error.user.password.invalid"),!1;if(this.values.password!==this.values.passwordConfirmation)return this.issue=this.$t("error.user.password.notSame"),!1;this.isLoading=!0;try{await this.$api.users.changePassword(this.$user.id,this.values.password),this.$store.dispatch("notification/success",":)"),this.$go("/")}catch(t){this.issue=t.message}finally{this.isLoading=!1}}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-password-reset-view",attrs:{align:"center"}},[e("k-form",{attrs:{fields:t.fields,"submit-button":t.$t("change"),value:t.values},on:{input:function(e){t.values=e},submit:t.submit},scopedSlots:t._u([{key:"header",fn:function(){return[e("h1",{staticClass:"sr-only"},[t._v(" "+t._s(t.$t("view.resetPassword"))+" ")]),t.issue?e("k-login-alert",{on:{click:function(e){t.issue=null}}},[t._v(" "+t._s(t.issue)+" ")]):t._e(),e("k-user-info",{attrs:{user:t.$user}})]},proxy:!0},{key:"footer",fn:function(){return[e("div",{staticClass:"k-login-buttons"},[e("k-button",{staticClass:"k-login-button",attrs:{icon:"check",type:"submit"}},[t._v(" "+t._s(t.$t("change"))+" "),t.isLoading?[t._v(" … ")]:t._e()],2)],1)]},proxy:!0}])})],1)],1)}),[],!1,null,null,null,null).exports;const Oi=Q({extends:gi,computed:{protectedFields:()=>["title"]}},(function(){var t=this,e=t._self._c;return e("k-inside",{scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-form-buttons",{attrs:{lock:t.lock}})]},proxy:!0}])},[e("k-view",{staticClass:"k-site-view",attrs:{"data-locked":t.isLocked,"data-id":"/","data-template":"site"}},[e("k-header",{attrs:{editable:t.permissions.changeTitle&&!t.isLocked,tabs:t.tabs,tab:t.tab.name},on:{edit:function(e){return t.$dialog("site/changeTitle")}},scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",[e("k-button",{staticClass:"k-site-view-preview",attrs:{link:t.model.previewUrl,responsive:!0,text:t.$t("open"),icon:"open",target:"_blank"}}),e("k-languages-dropdown")],1)]},proxy:!0}])},[t._v(" "+t._s(t.model.title)+" ")]),e("k-sections",{attrs:{blueprint:t.blueprint,empty:t.$t("site.blueprint"),lock:t.lock,tab:t.tab,parent:"site"},on:{submit:function(e){return t.$emit("submit",e)}}})],1)],1)}),[],!1,null,null,null,null).exports;const Ai=Q({props:{environment:Array,exceptions:Array,plugins:Array,security:Array,urls:Object},data:()=>({accessible:[]}),computed:{securityIssues(){const t=this.accessible.map((t=>({id:t,text:this.$t("system.issues."+t),link:"https://getkirby.com/security/"+t,icon:"folder"})));return this.security.concat(t).map((t=>({image:{back:"var(--color-red-200)",icon:t.icon||"alert",color:"var(--color-red)"},...t})))}},async created(){this.exceptions.length>0&&(console.info("The following errors occurred during the update check of Kirby and/or plugins:"),this.exceptions.map((t=>console.warn(t))),console.info("End of errors from the update check.")),console.info("Running system health checks for the Panel system view; failed requests in the following console output are expected behavior.");const t=(Promise.allSettled||Promise.all).bind(Promise),e=Object.entries(this.urls).map(this.check);await t(e),console.info(`System health checks ended. ${this.accessible.length} issues with accessible files/folders found (see the security list in the system view).`)},methods:{async check([t,e]){if(!e)return!1;!0===await this.isAccessible(e)&&this.accessible.push(t)},isAccessible:async t=>(await fetch(t,{cache:"no-store"})).status<400,retry(){this.$go(window.location.href)}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-system-view"},[e("k-header",[t._v(" "+t._s(t.$t("view.system"))+" ")]),e("section",{staticClass:"k-system-view-section"},[e("header",{staticClass:"k-system-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("environment")))])],1),e("k-stats",{staticClass:"k-system-info",attrs:{reports:t.environment,size:"medium"}})],1),t.securityIssues.length?e("section",{staticClass:"k-system-view-section"},[e("header",{staticClass:"k-system-view-section-header"},[e("k-headline",[t._v(t._s(t.$t("security")))]),e("k-button",{attrs:{tooltip:t.$t("retry"),icon:"refresh"},on:{click:t.retry}})],1),e("k-items",{attrs:{items:t.securityIssues}})],1):t._e(),t.plugins.length?e("section",{staticClass:"k-system-view-section"},[e("header",{staticClass:"k-system-view-section-header"},[e("k-headline",{attrs:{link:"https://getkirby.com/plugins"}},[t._v(" "+t._s(t.$t("plugins"))+" ")])],1),e("k-table",{attrs:{index:!1,columns:{name:{label:t.$t("name"),type:"url",mobile:!0},author:{label:t.$t("author")},license:{label:t.$t("license")},version:{label:t.$t("version"),type:"update-status",mobile:!0,width:"10rem"}},rows:t.plugins}})],1):t._e()],1)],1)}),[],!1,null,null,null,null).exports;const Ti=Q({props:{role:Object,roles:Array,search:String,title:String,users:Object},computed:{items(){return this.users.data.map((t=>(t.options=this.$dropdown(t.link),t)))}},methods:{paginate(t){this.$reload({query:{page:t.page}})}}},(function(){var t=this,e=t._self._c;return e("k-inside",[e("k-view",{staticClass:"k-users-view"},[e("k-header",{scopedSlots:t._u([{key:"left",fn:function(){return[e("k-button-group",{attrs:{buttons:[{disabled:!1===t.$permissions.users.create,text:t.$t("user.create"),icon:"add",click:()=>t.$dialog("users/create")}]}})]},proxy:!0},t.roles.length>1?{key:"right",fn:function(){return[e("k-button-group",[e("k-dropdown",[e("k-button",{attrs:{responsive:!0,text:`${t.$t("role")}: ${t.role?t.role.title:t.$t("role.all")}`,icon:"funnel"},on:{click:function(e){return t.$refs.roles.toggle()}}}),e("k-dropdown-content",{ref:"roles",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{icon:"bolt",link:"/users"}},[t._v(" "+t._s(t.$t("role.all"))+" ")]),e("hr"),t._l(t.roles,(function(s){return e("k-dropdown-item",{key:s.id,attrs:{link:"/users/?role="+s.id,icon:"bolt"}},[t._v(" "+t._s(s.title)+" ")])}))],2)],1)],1)]},proxy:!0}:null],null,!0)},[t._v(" "+t._s(t.$t("view.users"))+" ")]),t.users.data.length>0?[e("k-collection",{attrs:{items:t.items,pagination:t.users.pagination},on:{paginate:t.paginate}})]:0===t.users.pagination.total?[e("k-empty",{attrs:{icon:"users"}},[t._v(" "+t._s(t.$t("role.empty"))+" ")])]:t._e()],2)],1)}),[],!1,null,null,null,null).exports,Ii={install(t){t.component("k-account-view",bi),t.component("k-error-view",vi),t.component("k-file-view",yi),t.component("k-installation-view",$i),t.component("k-languages-view",_i),t.component("k-login-view",wi),t.component("k-page-view",xi),t.component("k-plugin-view",Si),t.component("k-reset-password-view",Ci),t.component("k-site-view",Oi),t.component("k-system-view",Ai),t.component("k-users-view",Ti),t.component("k-user-view",ki)}};const ji=Q({computed:{placeholder(){return this.field("code",{}).placeholder},languages(){return this.field("language",{options:[]}).options}},methods:{focus(){this.$refs.code.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-code-editor"},[e("k-input",{ref:"code",attrs:{buttons:!1,placeholder:t.placeholder,spellcheck:!1,value:t.content.code,type:"textarea"},on:{input:function(e){return t.update({code:e})}}}),t.languages.length?e("div",{staticClass:"k-block-type-code-editor-language"},[e("k-icon",{attrs:{type:"code"}}),e("k-input",{ref:"language",attrs:{empty:!1,options:t.languages,value:t.content.language,type:"select"},on:{input:function(e){return t.update({language:e})}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports,Ei=Object.freeze(Object.defineProperty({__proto__:null,default:ji},Symbol.toStringTag,{value:"Module"}));const Mi=Q({},(function(){var t=this;return(0,t._self._c)("k-block-title",{attrs:{content:t.content,fieldset:t.fieldset},on:{dblclick:function(e){return t.$emit("open")}}})}),[],!1,null,null,null,null).exports,Li=Object.freeze(Object.defineProperty({__proto__:null,default:Mi},Symbol.toStringTag,{value:"Module"}));const Bi=Q({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop||!1},ratio(){return this.content.ratio||!1}}},(function(){var t=this,e=t._self._c;return e("figure",[e("ul",{on:{dblclick:t.open}},[0===t.content.images.length?t._l(5,(function(s){return e("li",{key:s,staticClass:"k-block-type-gallery-placeholder"},[e("k-aspect-ratio",{attrs:{ratio:t.ratio}})],1)})):t._l(t.content.images,(function(s){return e("li",{key:s.id},[e("k-aspect-ratio",{attrs:{ratio:t.ratio,cover:t.crop}},[e("img",{attrs:{src:s.url,srcset:s.image.srcset,alt:s.alt}})])],1)}))],2),t.content.caption?e("figcaption",[e("k-writer",{attrs:{inline:!0,marks:t.captionMarks,value:t.content.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}})],1):t._e()])}),[],!1,null,null,null,null).exports,Di=Object.freeze(Object.defineProperty({__proto__:null,default:Bi},Symbol.toStringTag,{value:"Module"}));const Pi=Q({computed:{textField(){return this.field("text",{marks:!0})}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-heading-input",attrs:{"data-level":t.content.level}},[e("k-writer",{ref:"input",attrs:{inline:!0,marks:t.textField.marks,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}})],1)}),[],!1,null,null,null,null).exports,Ni=Object.freeze(Object.defineProperty({__proto__:null,default:Pi},Symbol.toStringTag,{value:"Module"}));const Ri=Q({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},crop(){return this.content.crop||!1},src(){var t;return"web"===this.content.location?this.content.src:!!(null==(t=this.content.image[0])?void 0:t.url)&&this.content.image[0].url},ratio(){return this.content.ratio||!1}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.image.placeholder")+" …","is-empty":!t.src,"empty-icon":"image"},on:{open:t.open,update:t.update}},[t.src?[t.ratio?e("k-aspect-ratio",{attrs:{ratio:t.ratio,cover:t.crop}},[e("img",{attrs:{alt:t.content.alt,src:t.src}})]):e("img",{staticClass:"k-block-type-image-auto",attrs:{alt:t.content.alt,src:t.src}})]:t._e()],2)}),[],!1,null,null,null,null).exports,Fi=Object.freeze(Object.defineProperty({__proto__:null,default:Ri},Symbol.toStringTag,{value:"Module"}));const qi=Q({},(function(){return this._self._c,this._m(0)}),[function(){var t=this._self._c;return t("div",[t("hr")])}],!1,null,null,null,null).exports,zi=Object.freeze(Object.defineProperty({__proto__:null,default:qi},Symbol.toStringTag,{value:"Module"}));const Yi=Q({computed:{marks(){return this.field("text",{}).marks}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-list-input",attrs:{marks:t.marks,value:t.content.text,type:"list"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports,Hi=Object.freeze(Object.defineProperty({__proto__:null,default:Yi},Symbol.toStringTag,{value:"Module"}));const Ui=Q({computed:{placeholder(){return this.field("text",{}).placeholder}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this;return(0,t._self._c)("k-input",{ref:"input",staticClass:"k-block-type-markdown-input",attrs:{buttons:!1,placeholder:t.placeholder,spellcheck:!1,value:t.content.text,type:"textarea"},on:{input:function(e){return t.update({text:e})}}})}),[],!1,null,null,null,null).exports,Ki=Object.freeze(Object.defineProperty({__proto__:null,default:Ui},Symbol.toStringTag,{value:"Module"}));const Vi=Q({computed:{citationField(){return this.field("citation",{})},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.text.focus()}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-block-type-quote-editor"},[e("k-writer",{ref:"text",staticClass:"k-block-type-quote-text",attrs:{inline:t.textField.inline??!1,marks:t.textField.marks,placeholder:t.textField.placeholder,value:t.content.text},on:{input:function(e){return t.update({text:e})}}}),e("k-writer",{ref:"citation",staticClass:"k-block-type-quote-citation",attrs:{inline:t.citationField.inline??!0,marks:t.citationField.marks,placeholder:t.citationField.placeholder,value:t.content.citation},on:{input:function(e){return t.update({citation:e})}}})],1)}),[],!1,null,null,null,null).exports,Ji=Object.freeze(Object.defineProperty({__proto__:null,default:Vi},Symbol.toStringTag,{value:"Module"}));const Gi=Q({inheritAttrs:!1,computed:{columns(){return this.table.columns||this.fields},fields(){return this.table.fields||{}},rows(){return this.content.rows||[]},table(){let t=null;for(const e of Object.values(this.fieldset.tabs))e.fields.rows&&(t=e.fields.rows);return t||{}}}},(function(){var t=this;return(0,t._self._c)("k-table",{staticClass:"k-block-type-table-preview",attrs:{columns:t.columns,empty:t.$t("field.structure.empty"),rows:t.rows},nativeOn:{dblclick:function(e){return t.open.apply(null,arguments)}}})}),[],!1,null,null,null,null).exports,Wi=Object.freeze(Object.defineProperty({__proto__:null,default:Gi},Symbol.toStringTag,{value:"Module"}));const Xi=Q({computed:{component(){const t="k-"+this.textField.type+"-input";return this.$helper.isComponent(t)?t:"k-writer"},textField(){return this.field("text",{})}},methods:{focus(){this.$refs.input.focus()}}},(function(){var t=this;return(0,t._self._c)(t.component,t._b({ref:"input",tag:"component",staticClass:"k-block-type-text-input",attrs:{value:t.content.text},on:{input:function(e){return t.update({text:e})}}},"component",t.textField,!1))}),[],!1,null,null,null,null).exports,Zi=Object.freeze(Object.defineProperty({__proto__:null,default:Xi},Symbol.toStringTag,{value:"Module"}));const Qi=Q({computed:{captionMarks(){return this.field("caption",{marks:!0}).marks},video(){return this.$helper.embed.video(this.content.url,!0)}}},(function(){var t=this,e=t._self._c;return e("k-block-figure",{attrs:{caption:t.content.caption,"caption-marks":t.captionMarks,"empty-text":t.$t("field.blocks.video.placeholder")+" …","is-empty":!t.video,"empty-icon":"video"},on:{open:t.open,update:t.update}},[e("k-aspect-ratio",{attrs:{ratio:"16/9"}},[t.video?e("iframe",{attrs:{src:t.video,referrerpolicy:"strict-origin-when-cross-origin"}}):t._e()])],1)}),[],!1,null,null,null,null).exports,to=Object.freeze(Object.defineProperty({__proto__:null,default:Qi},Symbol.toStringTag,{value:"Module"}));const eo=Q({inheritAttrs:!1,props:{attrs:[Array,Object],content:[Array,Object],endpoints:Object,fieldset:Object,id:String,isBatched:Boolean,isFull:Boolean,isHidden:Boolean,isLastInBatch:Boolean,isSelected:Boolean,name:String,next:Object,prev:Object,type:String},data:()=>({skipFocus:!1}),computed:{className(){let t=["k-block-type-"+this.type];return this.fieldset.preview!==this.type&&t.push("k-block-type-"+this.fieldset.preview),!1===this.wysiwyg&&t.push("k-block-type-default"),t},customComponent(){return this.wysiwyg?this.wysiwygComponent:"k-block-type-default"},isEditable(){return!1!==this.fieldset.editable},listeners(){return{...this.$listeners,confirmToRemove:this.confirmToRemove,open:this.open}},tabs(){let t=this.fieldset.tabs;return Object.entries(t).forEach((([e,s])=>{Object.entries(s.fields).forEach((([s])=>{t[e].fields[s].section=this.name,t[e].fields[s].endpoints={field:this.endpoints.field+"/fieldsets/"+this.type+"/fields/"+s,section:this.endpoints.section,model:this.endpoints.model}}))})),t},wysiwyg(){return!1!==this.wysiwygComponent},wysiwygComponent(){if(!1===this.fieldset.preview)return!1;let t;return this.fieldset.preview&&(t="k-block-type-"+this.fieldset.preview,this.$helper.isComponent(t))?t:(t="k-block-type-"+this.type,!!this.$helper.isComponent(t)&&t)}},methods:{close(){this.$refs.drawer.close()},confirmToRemove(){this.$refs.removeDialog.open()},focus(){!0!==this.skipFocus&&("function"==typeof this.$refs.editor.focus?this.$refs.editor.focus():this.$refs.container.focus())},onFocusIn(t){var e,s;(null==(s=null==(e=this.$refs.options)?void 0:e.$el)?void 0:s.contains(t.target))||this.$emit("focus",t)},goTo(t){t&&(this.skipFocus=!0,this.close(),this.$nextTick((()=>{t.$refs.container.focus(),t.open(),this.skipFocus=!1})))},open(){var t;null==(t=this.$refs.drawer)||t.open()},remove(){this.$refs.removeDialog.close(),this.$emit("remove",this.id)}}},(function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"k-block-container",class:"k-block-container-type-"+t.type,attrs:{"data-batched":t.isBatched,"data-disabled":t.fieldset.disabled,"data-hidden":t.isHidden,"data-id":t.id,"data-last-in-batch":t.isLastInBatch,"data-selected":t.isSelected,"data-translate":t.fieldset.translate,tabindex:"0"},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),t.$emit("sortDown")):null},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:e.ctrlKey&&e.shiftKey?(e.preventDefault(),t.$emit("sortUp")):null}],focus:function(e){return t.$emit("focus")},focusin:t.onFocusIn}},[e("div",{staticClass:"k-block",class:t.className},[e(t.customComponent,t._g(t._b({ref:"editor",tag:"component"},"component",t.$props,!1),t.listeners))],1),e("k-block-options",t._g({ref:"options",attrs:{"is-batched":t.isBatched,"is-editable":t.isEditable,"is-full":t.isFull,"is-hidden":t.isHidden}},t.listeners)),t.isEditable&&!t.isBatched?e("k-form-drawer",{ref:"drawer",staticClass:"k-block-drawer",attrs:{id:t.id,icon:t.fieldset.icon||"box",tabs:t.tabs,title:t.fieldset.name,value:t.content},on:{close:function(e){t.focus(),t.$emit("close")},input:function(e){return t.$emit("update",e)},open:function(e){return t.$emit("open")}},scopedSlots:t._u([{key:"options",fn:function(){return[t.isHidden?e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"hidden"},on:{click:function(e){return t.$emit("show")}}}):t._e(),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.prev,icon:"angle-left"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.goTo(t.prev)}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{disabled:!t.next,icon:"angle-right"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.goTo(t.next)}}}),e("k-button",{staticClass:"k-drawer-option",attrs:{icon:"trash"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.confirmToRemove.apply(null,arguments)}}})]},proxy:!0}],null,!1,2211169536)}):t._e(),e("k-remove-dialog",{ref:"removeDialog",attrs:{text:t.$t("field.blocks.delete.confirm")},on:{submit:t.remove}})],1)}),[],!1,null,null,null,null).exports;const so=Q({components:{"k-block-pasteboard":Q({inheritAttrs:!1,computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{close(){this.$refs.dialog.close()},open(){this.$refs.dialog.open()},onPaste(t){this.$emit("paste",t),this.close()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-block-importer",attrs:{"cancel-button":!1,"submit-button":!1,size:"large"}},[e("label",{attrs:{for:"pasteboard"},domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}}),e("textarea",{attrs:{id:"pasteboard"},on:{paste:function(e){return e.preventDefault(),t.onPaste.apply(null,arguments)}}})])}),[],!1,null,null,null,null).exports},inheritAttrs:!1,props:{autofocus:Boolean,empty:String,endpoints:Object,fieldsets:Object,fieldsetGroups:Object,group:String,max:{type:Number,default:null},value:{type:Array,default:()=>[]}},data(){return{isEditing:!1,isMultiSelectKey:!1,batch:[],blocks:this.value,current:null,isFocussed:!1}},computed:{draggableOptions(){return{id:this._uid,handle:".k-sort-handle",list:this.blocks,move:this.move,delay:10,data:{fieldsets:this.fieldsets,isFull:this.isFull},options:{group:this.group}}},hasFieldsets(){return Object.keys(this.fieldsets).length},isEmpty(){return 0===this.blocks.length},isFull(){return null!==this.max&&this.blocks.length>=this.max},selected(){return this.current},selectedOrBatched(){return this.batch.length>0?this.batch:this.selected?[this.selected]:[]}},watch:{value(){this.blocks=this.value}},created(){this.$events.$on("blur",this.onBlur),this.$events.$on("copy",this.onCopy),this.$events.$on("focus",this.onOutsideFocus),this.$events.$on("keydown",this.onKey),this.$events.$on("keyup",this.onKey),this.$events.$on("paste",this.onPaste)},destroyed(){this.$events.$off("blur",this.onBlur),this.$events.$off("copy",this.onCopy),this.$events.$off("focus",this.onOutsideFocus),this.$events.$off("keydown",this.onKey),this.$events.$off("keyup",this.onKey),this.$events.$off("paste",this.onPaste)},mounted(){setTimeout((()=>{!0===this.$props.autofocus&&this.focus()}),100)},methods:{append(t,e){if("string"!=typeof t){if(Array.isArray(t)){let s=this.$helper.clone(t).map((t=>(t.id=this.$helper.uuid(),t)));const n=Object.keys(this.fieldsets);if(s=s.filter((t=>n.includes(t.type))),this.max){const t=this.max-this.blocks.length;s=s.slice(0,t)}this.blocks.splice(e,0,...s),this.save()}}else this.add(t,e)},async add(t="text",e){const s=await this.$api.get(this.endpoints.field+"/fieldsets/"+t);this.blocks.splice(e,0,s),this.save(),this.$nextTick((()=>{this.focusOrOpen(s)}))},addToBatch(t){null!==this.selected&&!1===this.batch.includes(this.selected)&&(this.batch.push(this.selected),this.current=null),!1===this.batch.includes(t.id)&&this.batch.push(t.id)},choose(t){if(1===Object.keys(this.fieldsets).length){const e=Object.values(this.fieldsets)[0].type;this.add(e,t)}else this.$refs.selector.open(t)},chooseToConvert(t){this.$refs.selector.open(t,{disabled:[t.type],headline:this.$t("field.blocks.changeType"),event:"convert"})},click(t){this.$emit("click",t)},confirmToRemoveAll(){this.$refs.removeAll.open()},confirmToRemoveSelected(){this.$refs.removeSelected.open()},copy(t){if(0===this.blocks.length)return!1;if(0===this.selectedOrBatched.length)return!1;let e=[];for(const s of this.blocks)this.selectedOrBatched.includes(s.id)&&e.push(s);if(0===e.length)return!1;this.$helper.clipboard.write(e,t),t instanceof ClipboardEvent==!1&&(this.batch=this.selectedOrBatched),this.$store.dispatch("notification/success",`${e.length} copied!`)},copyAll(){this.selectAll(),this.copy(),this.deselectAll()},async convert(t,e){var s;const n=this.findIndex(e.id);if(-1===n)return!1;const i=t=>{let e={};for(const s of Object.values((null==t?void 0:t.tabs)??{}))e={...e,...s.fields};return e},o=this.blocks[n],r=await this.$api.get(this.endpoints.field+"/fieldsets/"+t),l=this.fieldsets[o.type],a=this.fieldsets[t];if(!a)return!1;let u=r.content;const c=i(a),d=i(l);for(const[p,h]of Object.entries(c)){const t=d[p];(null==t?void 0:t.type)===h.type&&(null==(s=null==o?void 0:o.content)?void 0:s[p])&&(u[p]=o.content[p])}this.blocks[n]={...r,id:o.id,content:u},this.save()},deselectAll(){this.batch=[],this.current=null},async duplicate(t,e){const s={...this.$helper.clone(t),id:this.$helper.uuid()};this.blocks.splice(e+1,0,s),this.save()},fieldset(t){return this.fieldsets[t.type]||{icon:"box",name:t.type,tabs:{content:{fields:{}}},type:t.type}},find(t){return this.blocks.find((e=>e.id===t))},findIndex(t){return this.blocks.findIndex((e=>e.id===t))},focus(t){var e,s,n;null==(n=null==(s=this.$refs["block-"+((null==t?void 0:t.id)??(null==(e=this.blocks[0])?void 0:e.id))])?void 0:s[0])||n.focus()},focusOrOpen(t){this.fieldsets[t.type].wysiwyg?this.focus(t):this.open(t)},hide(t){e(t,"isHidden",!0),this.save()},isBatched(t){return this.batch.includes(t.id)},isInputEvent(){const t=document.querySelector(":focus");return t&&(null==t?void 0:t.matches("input, textarea, [contenteditable], .k-writer"))},isLastInBatch(t){const[e]=this.batch.slice(-1);return e&&t.id===e},isOnlyInstance:()=>1===document.querySelectorAll(".k-blocks").length,isSelected(t){return this.selected&&this.selected===t.id},move(t){if(t.from!==t.to){const e=t.draggedContext.element,s=t.relatedContext.component.componentData||t.relatedContext.component.$parent.componentData;if(!1===Object.keys(s.fieldsets).includes(e.type))return!1;if(!0===s.isFull)return!1}return!0},onBlur(){0===this.batch.length&&(this.isMultiSelectKey=!1)},onCopy(t){return!1!==this.$el.contains(t.target)&&!0!==this.isEditing&&!this.$store.state.dialog&&!0!==this.isInputEvent(t)&&this.copy(t)},onKey(t){this.isMultiSelectKey=t.metaKey||t.ctrlKey||t.altKey},onOutsideFocus(t){if("function"==typeof t.target.closest&&t.target.closest(".k-dialog"))return;const e=document.querySelector(".k-overlay:last-of-type");if(!1===this.$el.contains(t.target)&&(!e||!1===e.contains(t.target)))return this.select(null);if(e){const e=this.$el.closest(".k-layout-column");if(!1===(null==e?void 0:e.contains(t.target)))return this.select(null)}},onPaste(t){var e;return!0===(null==(e=this.$refs.selector)?void 0:e.isOpen())?this.paste(t):!0!==this.isInputEvent(t)&&(!0!==this.isEditing&&!this.$store.state.dialog&&((0!==this.selectedOrBatched.length||!1!==this.$el.contains(t.target))&&this.paste(t)))},open(t){var e;null==(e=this.$refs["block-"+t.id])||e[0].open()},async paste(t){const e=this.$helper.clipboard.read(t),s=await this.$api.post(this.endpoints.field+"/paste",{html:e});let n=this.selectedOrBatched[this.selectedOrBatched.length-1],i=this.findIndex(n);-1===i&&(i=this.blocks.length),this.append(s,i+1)},pasteboard(){this.$refs.pasteboard.open()},prevNext(t){var e;if(this.blocks[t])return null==(e=this.$refs["block-"+this.blocks[t].id])?void 0:e[0]},remove(t){var e;const s=this.findIndex(t.id);-1!==s&&((null==(e=this.selected)?void 0:e.id)===t.id&&this.select(null),this.$delete(this.blocks,s),this.save())},removeAll(){this.batch=[],this.blocks=[],this.save(),this.$refs.removeAll.close()},removeSelected(){for(const t of this.batch){const e=this.findIndex(t);-1!==e&&this.$delete(this.blocks,e)}this.deselectAll(),this.save(),this.$refs.removeSelected.close()},save(){this.$emit("input",this.blocks)},select(t,e=null){if(e&&this.isMultiSelectKey&&this.onKey(e),t&&this.isMultiSelectKey)return this.addToBatch(t),void(this.current=null);this.batch=[],this.current=t?t.id:null},selectAll(){this.batch=Object.values(this.blocks).map((t=>t.id))},show(t){e(t,"isHidden",!1),this.save()},sort(t,e,s){if(s<0)return;let n=this.$helper.clone(this.blocks);n.splice(e,1),n.splice(s,0,t),this.blocks=n,this.save(),this.$nextTick((()=>{this.focus(t)}))},update(t,s){const n=this.findIndex(t.id);if(-1!==n)for(const i in s)e(this.blocks[n].content,i,s[i]);this.save()}}},(function(){var t=this,e=t._self._c;return e("div",{ref:"wrapper",staticClass:"k-blocks",attrs:{"data-empty":0===t.blocks.length,"data-multi-select-key":t.isMultiSelectKey},on:{focusin:function(e){t.focussed=!0},focusout:function(e){t.focussed=!1}}},[t.hasFieldsets?[e("k-draggable",t._b({staticClass:"k-blocks-list",on:{sort:t.save},scopedSlots:t._u([{key:"footer",fn:function(){return[e("k-empty",{staticClass:"k-blocks-empty",attrs:{icon:"box"},on:{click:function(e){return t.choose(t.blocks.length)}}},[t._v(" "+t._s(t.empty||t.$t("field.blocks.empty"))+" ")])]},proxy:!0}],null,!1,2413899928)},"k-draggable",t.draggableOptions,!1),t._l(t.blocks,(function(s,n){return e("k-block",t._b({key:s.id,ref:"block-"+s.id,refInFor:!0,attrs:{endpoints:t.endpoints,fieldset:t.fieldset(s),"is-batched":t.isBatched(s),"is-last-in-batch":t.isLastInBatch(s),"is-full":t.isFull,"is-hidden":!0===s.isHidden,"is-selected":t.isSelected(s),next:t.prevNext(n+1),prev:t.prevNext(n-1)},on:{append:function(e){return t.append(e,n+1)},blur:function(e){return t.select(null)},choose:function(e){return t.choose(e)},chooseToAppend:function(e){return t.choose(n+1)},chooseToConvert:function(e){return t.chooseToConvert(s)},chooseToPrepend:function(e){return t.choose(n)},close:function(e){t.isEditing=!1},copy:function(e){return t.copy()},confirmToRemoveSelected:t.confirmToRemoveSelected,duplicate:function(e){return t.duplicate(s,n)},focus:function(e){return t.select(s)},hide:function(e){return t.hide(s)},open:function(e){t.isEditing=!0},paste:function(e){return t.pasteboard()},prepend:function(e){return t.add(e,n)},remove:function(e){return t.remove(s)},sortDown:function(e){return t.sort(s,n,n+1)},sortUp:function(e){return t.sort(s,n,n-1)},show:function(e){return t.show(s)},update:function(e){return t.update(s,e)}},nativeOn:{click:function(e){return e.stopPropagation(),t.select(s,e)}}},"k-block",s,!1))})),1),e("k-block-selector",{ref:"selector",attrs:{fieldsets:t.fieldsets,"fieldset-groups":t.fieldsetGroups},on:{add:t.add,convert:t.convert,paste:function(e){return t.paste(e)}}}),e("k-remove-dialog",{ref:"removeAll",attrs:{text:t.$t("field.blocks.delete.confirm.all")},on:{submit:t.removeAll}}),e("k-remove-dialog",{ref:"removeSelected",attrs:{text:t.$t("field.blocks.delete.confirm.selected")},on:{submit:t.removeSelected}}),e("k-block-pasteboard",{ref:"pasteboard",on:{paste:function(e){return t.paste(e)}}})]:[e("k-box",{attrs:{theme:"info"}},[t._v(" No fieldsets yet ")])]],2)}),[],!1,null,null,null,null).exports;const no=Q({inheritAttrs:!1,props:{caption:String,captionMarks:[Boolean,Array],cover:{type:Boolean,default:!0},isEmpty:Boolean,emptyIcon:String,emptyText:String,ratio:String},computed:{ratioPadding(){return this.$helper.ratio(this.ratio||"16/9")}}},(function(){var t=this,e=t._self._c;return e("figure",{staticClass:"k-block-figure"},[t.isEmpty?e("k-button",{staticClass:"k-block-figure-empty",attrs:{icon:t.emptyIcon,text:t.emptyText},on:{click:function(e){return t.$emit("open")}}}):e("span",{staticClass:"k-block-figure-container",on:{dblclick:function(e){return t.$emit("open")}}},[t._t("default")],2),t.caption?e("figcaption",[e("k-writer",{attrs:{inline:!0,marks:t.captionMarks,value:t.caption},on:{input:function(e){return t.$emit("update",{caption:e})}}})],1):t._e()],1)}),[],!1,null,null,null,null).exports;const io=Q({props:{isBatched:Boolean,isEditable:Boolean,isFull:Boolean,isHidden:Boolean},methods:{open(){this.$refs.options.open()}}},(function(){var t=this,e=t._self._c;return e("k-dropdown",{staticClass:"k-block-options"},[t.isBatched?[e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("copy"),icon:"template"},on:{click:function(e){return e.preventDefault(),t.$emit("copy")}}}),e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("remove"),icon:"trash"},on:{click:function(e){return e.preventDefault(),t.$emit("confirmToRemoveSelected")}}})]:[t.isEditable?e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("edit"),icon:"edit"},on:{click:function(e){return t.$emit("open")}}}):t._e(),e("k-button",{staticClass:"k-block-options-button",attrs:{disabled:t.isFull,tooltip:t.$t("insert.after"),icon:"add"},on:{click:function(e){return t.$emit("chooseToAppend")}}}),e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("delete"),icon:"trash"},on:{click:function(e){return t.$emit("confirmToRemove")}}}),e("k-button",{staticClass:"k-block-options-button",attrs:{tooltip:t.$t("more"),icon:"dots"},on:{click:function(e){return t.$refs.options.toggle()}}}),e("k-button",{staticClass:"k-block-options-button k-sort-handle",attrs:{tooltip:t.$t("sort"),icon:"sort"},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.$emit("sortUp"))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.$emit("sortDown"))}]}}),e("k-dropdown-content",{ref:"options",attrs:{align:"right"}},[e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"angle-up"},on:{click:function(e){return t.$emit("chooseToPrepend")}}},[t._v(" "+t._s(t.$t("insert.before"))+" ")]),e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"angle-down"},on:{click:function(e){return t.$emit("chooseToAppend")}}},[t._v(" "+t._s(t.$t("insert.after"))+" ")]),e("hr"),t.isEditable?e("k-dropdown-item",{attrs:{icon:"edit"},on:{click:function(e){return t.$emit("open")}}},[t._v(" "+t._s(t.$t("edit"))+" ")]):t._e(),e("k-dropdown-item",{attrs:{icon:"refresh"},on:{click:function(e){return t.$emit("chooseToConvert")}}},[t._v(" "+t._s(t.$t("field.blocks.changeType"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:"template"},on:{click:function(e){return t.$emit("copy")}}},[t._v(" "+t._s(t.$t("copy"))+" ")]),e("k-dropdown-item",{attrs:{icon:"download"},on:{click:function(e){return t.$emit("paste")}}},[t._v(" "+t._s(t.$t("paste.after"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:t.isHidden?"preview":"hidden"},on:{click:function(e){return t.$emit(t.isHidden?"show":"hide")}}},[t._v(" "+t._s(!0===t.isHidden?t.$t("show"):t.$t("hide"))+" ")]),e("k-dropdown-item",{attrs:{disabled:t.isFull,icon:"copy"},on:{click:function(e){return t.$emit("duplicate")}}},[t._v(" "+t._s(t.$t("duplicate"))+" ")]),e("hr"),e("k-dropdown-item",{attrs:{icon:"trash"},on:{click:function(e){return t.$emit("confirmToRemove")}}},[t._v(" "+t._s(t.$t("delete"))+" ")])],1)]],2)}),[],!1,null,null,null,null).exports;const oo=Q({inheritAttrs:!1,props:{endpoint:String,fieldsets:Object,fieldsetGroups:Object},data(){return{dialogIsOpen:!1,disabled:[],headline:null,payload:null,event:"add",groups:this.createGroups()}},computed:{shortcut(){return this.$helper.keyboard.metaKey()+"+v"}},methods:{add(t){this.$emit(this.event,t,this.payload),this.$refs.dialog.close()},close(){this.$refs.dialog.close()},createGroups(){let t={},e=0;const s=this.fieldsetGroups||{blocks:{label:this.$t("field.blocks.fieldsets.label"),sets:Object.keys(this.fieldsets)}};return Object.keys(s).forEach((n=>{let i=s[n];i.open=!1!==i.open,i.fieldsets=i.sets.filter((t=>this.fieldsets[t])).map((t=>(e++,{...this.fieldsets[t],index:e}))),0!==i.fieldsets.length&&(t[n]=i)})),t},isOpen(){return this.dialogIsOpen},navigate(t){var e,s;null==(s=null==(e=this.$refs["fieldset-"+t])?void 0:e[0])||s.focus()},onClose(){this.dialogIsOpen=!1,this.$events.$off("paste",this.close)},onOpen(){this.dialogIsOpen=!0,this.$events.$on("paste",this.close)},open(t,e={}){const s={event:"add",disabled:[],headline:null,...e};this.event=s.event,this.disabled=s.disabled,this.headline=s.headline,this.payload=t,this.$refs.dialog.open()}}},(function(){var t=this,e=t._self._c;return e("k-dialog",{ref:"dialog",staticClass:"k-block-selector",attrs:{"cancel-button":!1,"submit-button":!1,size:"medium"},on:{open:t.onOpen,close:t.onClose}},[t.headline?e("k-headline",[t._v(" "+t._s(t.headline)+" ")]):t._e(),t._l(t.groups,(function(s,n){return e("details",{key:n,attrs:{open:s.open}},[e("summary",[t._v(t._s(s.label))]),e("div",{staticClass:"k-block-types"},t._l(s.fieldsets,(function(s){return e("k-button",{key:s.name,ref:"fieldset-"+s.index,refInFor:!0,attrs:{disabled:t.disabled.includes(s.type),icon:s.icon||"box",text:s.name},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:t.navigate(s.index-1)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:t.navigate(s.index+1)}],click:function(e){return t.add(s.type)}}})})),1)])})),e("p",{staticClass:"k-clipboard-hint",domProps:{innerHTML:t._s(t.$t("field.blocks.fieldsets.paste",{shortcut:t.shortcut}))}})],2)}),[],!1,null,null,null,null).exports;const ro=Q({inheritAttrs:!1,props:{fieldset:Object,content:Object},computed:{icon(){return this.fieldset.icon||"box"},label(){if(!this.fieldset.label||0===this.fieldset.label.length)return!1;if(this.fieldset.label===this.fieldset.name)return!1;const t=this.$helper.string.template(this.fieldset.label,this.content);return"…"!==t&&t},name(){return this.fieldset.name}}},(function(){var t=this,e=t._self._c;return e("div",t._g({staticClass:"k-block-title"},t.$listeners),[e("k-icon",{staticClass:"k-block-icon",attrs:{type:t.icon}}),e("span",{staticClass:"k-block-name"},[t._v(" "+t._s(t.name)+" ")]),t.label?e("span",{staticClass:"k-block-label"},[t._v(" "+t._s(t.label)+" ")]):t._e()],1)}),[],!1,null,null,null,null).exports;const lo=Q({inheritAttrs:!1,props:{content:[Object,Array],fieldset:Object},methods:{field(t,e=null){let s=null;return Object.values(this.fieldset.tabs).forEach((e=>{e.fields[t]&&(s=e.fields[t])})),s||e},open(){this.$emit("open")},update(t){this.$emit("update",{...this.content,...t})}}},null,null,!1,null,null,null,null).exports,ao={install(t){t.component("k-block",eo),t.component("k-blocks",so),t.component("k-block-figure",no),t.component("k-block-options",io),t.component("k-block-selector",oo),t.component("k-block-title",ro),t.component("k-block-type",lo);const e=Object.assign({"./Types/Code.vue":Ei,"./Types/Default.vue":Li,"./Types/Gallery.vue":Di,"./Types/Heading.vue":Ni,"./Types/Image.vue":Fi,"./Types/Line.vue":zi,"./Types/List.vue":Hi,"./Types/Markdown.vue":Ki,"./Types/Quote.vue":Ji,"./Types/Table.vue":Wi,"./Types/Text.vue":Zi,"./Types/Video.vue":to});for(const s in e){const n=s.match(/\/([a-zA-Z]*)\.vue/)[1].toLowerCase();let i=e[s].default;i.extends=lo,t.component("k-block-type-"+n,i)}}},uo={inheritAttrs:!1,props:{column:{type:Object,default:()=>({})},field:Object,value:{}}};const co=Q({mixins:[uo],inheritAttrs:!1,props:{value:[Array,String]},computed:{bubbles(){var t,e;let s=this.value;const n=(null==(t=this.column)?void 0:t.options)||(null==(e=this.field)?void 0:e.options)||[];return"string"==typeof s&&(s=s.split(",")),s.map((t=>{"string"==typeof t&&(t={value:t,text:t});for(const e of n)e.value===t.value&&(t.text=e.text);return{back:"light",color:"black",...t}}))}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-bubbles-field-preview",class:t.$options.class},[e("k-bubbles",{attrs:{bubbles:t.bubbles}})],1)}),[],!1,null,null,null,null).exports;const po=Q({extends:co,inheritAttrs:!1,class:"k-array-field-preview",computed:{bubbles(){return[{text:1===this.value.length?`1 ${this.$t("entry")}`:`${this.value.length} ${this.$t("entries")}`}]}}},null,null,!1,null,null,null,null).exports;const ho=Q({mixins:[uo],inheritAttrs:!1,computed:{text(){return this.value}}},(function(){var t=this;return(0,t._self._c)("p",{staticClass:"k-text-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),t._t("default",(function(){return[t._v(t._s(t.text))]})),t._v(" "+t._s(t.column.after)+" ")],2)}),[],!1,null,null,null,null).exports;const mo=Q({extends:ho,inheritAttrs:!1,props:{value:String},class:"k-date-field-preview",computed:{text(){var t,e,s,n,i,o;if("string"!=typeof this.value)return"";const r=this.$library.dayjs(this.value);if(!r)return"";let l=(null==(t=this.column)?void 0:t.display)||(null==(e=this.field)?void 0:e.display)||"YYYY-MM-DD",a=(null==(n=null==(s=this.column)?void 0:s.time)?void 0:n.display)||(null==(o=null==(i=this.field)?void 0:i.time)?void 0:o.display);return a&&(l+=" "+a),r.format(l)}}},null,null,!1,null,null,null,null).exports;const fo=Q({mixins:[uo],props:{value:[String,Object]},computed:{link(){return"object"==typeof this.value?this.value.href:this.value},text(){return"object"==typeof this.value?this.value.text:this.link}}},(function(){var t=this,e=t._self._c;return e("p",{staticClass:"k-url-field-preview",class:t.$options.class,attrs:{"data-link":t.link}},[t._v(" "+t._s(t.column.before)+" "),e("k-link",{attrs:{to:t.link},nativeOn:{click:function(t){t.stopPropagation()}}},[t._v(" "+t._s(t.text)+" ")]),t._v(" "+t._s(t.column.after)+" ")],1)}),[],!1,null,null,null,null).exports;const go=Q({extends:fo,class:"k-email-field-preview"},null,null,!1,null,null,null,null).exports;const ko=Q({extends:co,inheritAttrs:!1,class:"k-files-field-preview",computed:{bubbles(){return this.value.map((t=>({text:t.filename,link:t.link,image:t.image})))}}},null,null,!1,null,null,null,null).exports;const bo=Q({mixins:[uo],inheritAttrs:!1,props:{value:Object}},(function(){var t=this;return(0,t._self._c)("k-status-icon",t._b({staticClass:"k-flag-field-preview"},"k-status-icon",t.value,!1))}),[],!1,null,null,null,null).exports;const vo=Q({mixins:[uo],inheritAttrs:!1,props:{value:String},computed:{html(){return this.value}}},(function(){var t=this,e=t._self._c;return e("div",{staticClass:"k-html-field-preview",class:t.$options.class},[t._v(" "+t._s(t.column.before)+" "),e("div",{domProps:{innerHTML:t._s(t.html)}}),t._v(" "+t._s(t.column.after)+" ")])}),[],!1,null,null,null,null).exports;const yo=Q({mixins:[uo],inheritAttrs:!1,props:{value:[Object]}},(function(){return(0,this._self._c)("k-item-image",{staticClass:"k-image-field-preview",attrs:{image:this.value,layout:"list"}})}),[],!1,null,null,null,null).exports;const $o=Q({extends:co,inheritAttrs:!1,class:"k-object-field-preview",props:{value:[Array,Object]},computed:{bubbles:()=>[{text:"{ ... }"}]}},null,null,!1,null,null,null,null).exports;const _o=Q({extends:co,inheritAttrs:!1,class:"k-pages-field-preview"},null,null,!1,null,null,null,null).exports;const wo=Q({extends:ho,inheritAttrs:!1,props:{value:String},class:"k-time-field-preview",computed:{text(){const t=this.$library.dayjs.iso(this.value,"time");return(null==t?void 0:t.format(this.field.display))||""}}},null,null,!1,null,null,null,null).exports;const xo=Q({props:{field:Object,value:Boolean,column:Object},computed:{text(){return!1!==this.column.text?this.field.text:null}}},(function(){var t=this;return(0,t._self._c)("k-input",{staticClass:"k-toggle-field-preview",attrs:{text:t.text,value:t.value,type:"toggle"},on:{input:function(e){return t.$emit("input",e)}}})}),[],!1,null,null,null,null).exports;const So=Q({extends:co,inheritAttrs:!1,class:"k-users-field-preview",computed:{bubble(){return this.value.map((t=>({text:t.username,link:t.link,image:t.image})))}}},null,null,!1,null,null,null,null).exports,Co={install(t){t.component("k-array-field-preview",po),t.component("k-bubbles-field-preview",co),t.component("k-date-field-preview",mo),t.component("k-email-field-preview",go),t.component("k-files-field-preview",ko),t.component("k-flag-field-preview",bo),t.component("k-html-field-preview",vo),t.component("k-image-field-preview",yo),t.component("k-object-field-preview",$o),t.component("k-pages-field-preview",_o),t.component("k-text-field-preview",ho),t.component("k-toggle-field-preview",xo),t.component("k-time-field-preview",wo),t.component("k-url-field-preview",fo),t.component("k-users-field-preview",So),t.component("k-list-field-preview",vo),t.component("k-writer-field-preview",vo),t.component("k-checkboxes-field-preview",co),t.component("k-multiselect-field-preview",co),t.component("k-radio-field-preview",co),t.component("k-select-field-preview",co),t.component("k-tags-field-preview",co),t.component("k-toggles-field-preview",co)}},Oo={install(t){t.use(ht),t.use(gt),t.use(Ws),t.use(_n),t.use(Fn),t.use(ri),t.use(fi),t.use(Ii),t.use(ao),t.use(Co),t.use(B)}},Ao=(t,e)=>{localStorage.setItem("kirby$content$"+t,JSON.stringify(e))},To={namespaced:!0,state:{current:null,models:{},status:{enabled:!0}},getters:{exists:t=>e=>Object.prototype.hasOwnProperty.call(t.models,e),hasChanges:(t,e)=>t=>{const s=e.model(t).changes;return Object.keys(s).length>0},isCurrent:t=>e=>t.current===e,id:t=>e=>(e=e||t.current,window.panel.$language?e+"?language="+window.panel.$language.code:e),model:(t,e)=>s=>(s=s||t.current,!0===e.exists(s)?t.models[s]:{api:null,originals:{},values:{},changes:{}}),originals:(t,e)=>t=>U(e.model(t).originals),values:(t,e)=>t=>({...e.originals(t),...e.changes(t)}),changes:(t,e)=>t=>U(e.model(t).changes)},mutations:{CLEAR(t){Object.keys(t.models).forEach((e=>{t.models[e].changes={}})),Object.keys(localStorage).forEach((t=>{t.startsWith("kirby$content$")&&localStorage.removeItem(t)}))},CREATE(t,[s,n]){if(!n)return!1;let i=t.models[s]?t.models[s].changes:n.changes;e(t.models,s,{api:n.api,originals:n.originals,changes:i||{}})},CURRENT(t,e){t.current=e},MOVE(t,[s,n]){const i=U(t.models[s]);D(t.models,s),e(t.models,n,i);const o=localStorage.getItem("kirby$content$"+s);localStorage.removeItem("kirby$content$"+s),localStorage.setItem("kirby$content$"+n,o)},REMOVE(t,e){D(t.models,e),localStorage.removeItem("kirby$content$"+e)},REVERT(t,s){t.models[s]&&(e(t.models[s],"changes",{}),localStorage.removeItem("kirby$content$"+s))},STATUS(t,s){e(t.status,"enabled",s)},UPDATE(t,[s,n,i]){if(!t.models[s])return!1;void 0===i&&(i=null),i=U(i);const o=JSON.stringify(i);JSON.stringify(t.models[s].originals[n])==o?D(t.models[s].changes,n):e(t.models[s].changes,n,i),Ao(s,{api:t.models[s].api,originals:t.models[s].originals,changes:t.models[s].changes})}},actions:{init(t){Object.keys(localStorage).filter((t=>t.startsWith("kirby$content$"))).map((t=>t.split("kirby$content$")[1])).forEach((e=>{const s=localStorage.getItem("kirby$content$"+e);t.commit("CREATE",[e,JSON.parse(s)])})),Object.keys(localStorage).filter((t=>t.startsWith("kirby$form$"))).map((t=>t.split("kirby$form$")[1])).forEach((e=>{const s=localStorage.getItem("kirby$form$"+e);let n=null;try{n=JSON.parse(s)}catch(o){}if(!n||!n.api)return localStorage.removeItem("kirby$form$"+e),!1;const i={api:n.api,originals:n.originals,changes:n.values};t.commit("CREATE",[e,i]),Ao(e,i),localStorage.removeItem("kirby$form$"+e)}))},clear(t){t.commit("CLEAR")},create(t,e){const s=U(e.content);Array.isArray(e.ignore)&&e.ignore.forEach((t=>delete s[t])),e.id=t.getters.id(e.id);const n={api:e.api,originals:s,changes:{}};t.commit("CREATE",[e.id,n]),t.dispatch("current",e.id)},current(t,e){t.commit("CURRENT",e)},disable(t){t.commit("STATUS",!1)},enable(t){t.commit("STATUS",!0)},move(t,[e,s]){e=t.getters.id(e),s=t.getters.id(s),t.commit("MOVE",[e,s])},remove(t,e){t.commit("REMOVE",e),t.getters.isCurrent(e)&&t.commit("CURRENT",null)},revert(t,e){e=e||t.state.current,t.commit("REVERT",e)},async save(e,s){if(s=s||e.state.current,e.getters.isCurrent(s)&&!1===e.state.status.enabled)return!1;e.dispatch("disable");const n=e.getters.model(s),i={...n.originals,...n.changes};try{await t.$api.patch(n.api,i),e.commit("CREATE",[s,{...n,originals:i}]),e.dispatch("revert",s)}finally{e.dispatch("enable")}},update(t,[e,s,n]){if(n=n||t.state.current,null===e)for(const i in s)t.commit("UPDATE",[n,i,s[i]]);else t.commit("UPDATE",[n,e,s])}}},Io={namespaced:!0,state:{open:[]},mutations:{CLOSE(t,e){t.open=e?t.open.filter((t=>t.id!==e)):[]},GOTO(t,e){t.open=t.open.slice(0,t.open.findIndex((t=>t.id===e))+1)},OPEN(t,e){t.open.push(e)}},actions:{close(t,e){t.commit("CLOSE",e)},goto(t,e){t.commit("GOTO",e)},open(t,e){t.commit("OPEN",e)}}},jo={timer:null,namespaced:!0,state:{type:null,message:null,details:null,timeout:null},mutations:{SET(t,e){t.type=e.type,t.message=e.message,t.details=e.details,t.timeout=e.timeout},UNSET(t){t.type=null,t.message=null,t.details=null,t.timeout=null}},actions:{close(t){clearTimeout(this.timer),t.commit("UNSET")},deprecated(t,e){console.warn("Deprecated: "+e)},error(t,e){let s=e;"string"==typeof e&&(s={message:e}),e instanceof Error&&(s={message:e.message},window.panel.$config.debug&&window.console.error(e)),t.dispatch("dialog",{component:"k-error-dialog",props:s},{root:!0}),t.dispatch("close")},open(t,e){t.dispatch("close"),t.commit("SET",e),e.timeout&&(this.timer=setTimeout((()=>{t.dispatch("close")}),e.timeout))},success(t,e){"string"==typeof e&&(e={message:e}),t.dispatch("open",{type:"success",timeout:4e3,...e})}}};t.use(P);const Eo=new P.Store({strict:!1,state:{dialog:null,drag:null,fatal:!1,isLoading:!1},mutations:{SET_DIALOG(t,e){t.dialog=e},SET_DRAG(t,e){t.drag=e},SET_FATAL(t,e){t.fatal=e},SET_LOADING(t,e){t.isLoading=e}},actions:{dialog(t,e){t.commit("SET_DIALOG",e)},drag(t,e){t.commit("SET_DRAG",e)},fatal(t,e){!1!==e?(console.error("The JSON response could not be parsed"),window.panel.$config.debug&&console.info(e.html),e.silent||t.commit("SET_FATAL",e.html)):t.commit("SET_FATAL",!1)},isLoading(t,e){t.commit("SET_LOADING",!0===e)},navigate(t){t.dispatch("dialog",null),t.dispatch("drawers/close")}},modules:{content:To,drawers:Io,notification:jo}}),Mo={install(t){window.panel=window.panel||{},window.onunhandledrejection=t=>{t.preventDefault(),Eo.dispatch("notification/error",t.reason)},window.panel.deprecated=t=>{Eo.dispatch("notification/deprecated",t)},window.panel.error=t.config.errorHandler=t=>{Eo.dispatch("notification/error",t)}}},Lo={install(t){const e=N(),s={$on:e.on,$off:e.off,$emit:e.emit,blur(t){s.$emit("blur",t)},click(t){s.$emit("click",t)},copy(t){s.$emit("copy",t)},dragenter(t){s.entered=t.target,s.prevent(t),s.$emit("dragenter",t)},dragleave(t){s.prevent(t),s.entered===t.target&&s.$emit("dragleave",t)},drop(t){s.prevent(t),s.$emit("drop",t)},entered:null,focus(t){s.$emit("focus",t)},keydown(e){let n=["keydown"];(e.metaKey||e.ctrlKey)&&n.push("cmd"),!0===e.altKey&&n.push("alt"),!0===e.shiftKey&&n.push("shift");let i=t.prototype.$helper.string.lcfirst(e.key);const o={escape:"esc",arrowUp:"up",arrowDown:"down",arrowLeft:"left",arrowRight:"right"};o[i]&&(i=o[i]),!1===["alt","control","shift","meta"].includes(i)&&n.push(i),s.$emit(n.join("."),e),s.$emit("keydown",e)},keyup(t){s.$emit("keyup",t)},online(t){s.$emit("online",t)},offline(t){s.$emit("offline",t)},paste(t){s.$emit("paste",t)},prevent(t){t.stopPropagation(),t.preventDefault()}};document.addEventListener("click",s.click,!1),document.addEventListener("copy",s.copy,!0),document.addEventListener("focus",s.focus,!0),document.addEventListener("paste",s.paste,!0),window.addEventListener("blur",s.blur,!1),window.addEventListener("dragenter",s.dragenter,!1),window.addEventListener("dragexit",s.prevent,!1),window.addEventListener("dragleave",s.dragleave,!1),window.addEventListener("drop",s.drop,!1),window.addEventListener("dragover",s.prevent,!1),window.addEventListener("keydown",s.keydown,!1),window.addEventListener("keyup",s.keyup,!1),window.addEventListener("offline",s.offline),window.addEventListener("online",s.online),t.prototype.$events=s}};const Bo=async function(t){return{cancel:null,submit:null,props:{},...t}},Do=async function(t,e={}){let s=null,n=null;"function"==typeof e?(s=e,e={}):(s=e.submit,n=e.cancel);let i=await this.$fiber.request("dialogs/"+t,{...e,type:"$dialog"});return"object"==typeof i&&(i.submit=s||null,i.cancel=n||null,i)};async function Po(t,e={}){let s=null;if(s="object"==typeof t?await Bo.call(this,t):await Do.call(this,t,e),!s)return!1;if(!s.component||!1===this.$helper.isComponent(s.component))throw Error("The dialog component does not exist");return s.props=s.props||{},this.$store.dispatch("dialog",s),s}function No(t,e={}){return async s=>{const n=await this.$fiber.request("dropdowns/"+t,{...e,type:"$dropdown"});if(!n)return!1;if(!1===Array.isArray(n.options)||0===n.options.length)throw Error("The dropdown is empty");n.options.map((t=>(t.dialog&&(t.click=()=>{const e="string"==typeof t.dialog?t.dialog:t.dialog.url,s="object"==typeof t.dialog?t.dialog:{};return this.$dialog(e,s)}),t))),s(n.options)}}async function Ro(t,e,s={}){return await this.$fiber.request("search/"+t,{query:{query:e},type:"$search",...s})}const Fo={install(t){const e=new class{constructor(t={}){this.options={base:"/",headers:()=>({}),onFatal:()=>{},onFinish:()=>{},onPushState:()=>{},onReplaceState:()=>{},onStart:()=>{},onSwap:()=>{},query:()=>({}),...t},this.state={}}init(t={},e={}){this.options={...this.options,...e},this.setState(t)}arrayToString(t){return!1===Array.isArray(t)?String(t):t.join(",")}body(t){return"object"==typeof t?JSON.stringify(t):t}async fetch(t,e){return fetch(t,e)}async go(t,e){try{const s=await this.request(t,e);return!1!==s&&this.setState(s,e)}catch(s){if(!0!==(null==e?void 0:e.silent))throw s}}query(t={},e={}){let s=new URLSearchParams(e);return"object"!=typeof t&&(t={}),Object.entries(t).forEach((([t,e])=>{null!==e&&s.set(t,e)})),Object.entries(this.options.query()).forEach((([t,e])=>{null!==(e=s.get(t)??e??null)&&s.set(t,e)})),s}redirect(t){window.location.href=t}reload(t={}){return this.go(window.location.href,{...t,replace:!0})}async request(t="",e={}){var s;const n=!!(e={globals:!1,method:"GET",only:[],query:{},silent:!1,type:"$view",...e}).globals&&this.arrayToString(e.globals),i=this.arrayToString(e.only);this.options.onStart(e);try{const r=this.url(t,e.query);if(new URL(r).origin!==location.origin)return this.redirect(r),!1;const l=await this.fetch(r,{method:e.method,body:this.body(e.body),credentials:"same-origin",cache:"no-store",headers:{...V(this.options.headers()),"content-type":"application/json","x-fiber":!0,"x-fiber-globals":n,"x-fiber-only":i,"x-fiber-referrer":(null==(s=this.state.$view)?void 0:s.path)||null,...V(e.headers??{})}});if(!1===l.headers.has("X-Fiber"))return this.redirect(l.url),!1;const a=await l.text();let u;try{u=JSON.parse(a)}catch(o){return this.options.onFatal({url:r,path:t,options:e,response:l,text:a}),!1}if(!u[e.type])throw Error(`The ${e.type} could not be loaded`);const c=u[e.type];if(c.error)throw Error(c.error);return"$view"===e.type?i.length?K(this.state,u):u:c}finally{this.options.onFinish(e)}}async setState(t,e={}){return"object"==typeof t&&(this.state=U(t),!0===e.replace||this.url(this.state.$url).href===window.location.href?this.options.onReplaceState(this.state,e):this.options.onPushState(this.state,e),this.options.onSwap(this.state,e),this.state)}url(t="",e={}){return(t="string"==typeof t&&null===t.match(/^https?:\/\//)?new URL(this.options.base+t.replace(/^\//,"")):new URL(t)).search=this.query(e,t.search),t}};t.prototype.$fiber=window.panel.$fiber=e,t.prototype.$dialog=window.panel.$dialog=Po,t.prototype.$dropdown=window.panel.$dropdown=No,t.prototype.$go=window.panel.$go=e.go.bind(e),t.prototype.$reload=window.panel.$reload=e.reload.bind(e),t.prototype.$request=window.panel.$request=e.request.bind(e),t.prototype.$search=window.panel.$search=Ro,t.prototype.$url=window.panel.$url=e.url.bind(e)}};const qo={read:function(t){if(!t)return null;if("string"==typeof t)return t;if(t instanceof ClipboardEvent){t.preventDefault();const e=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null;if(e)return e.replace(/\u00a0/g," ")}return null},write:function(t,e){if("string"!=typeof t&&(t=JSON.stringify(t,null,2)),e&&e instanceof ClipboardEvent)return e.preventDefault(),e.clipboardData.setData("text/plain",t),!0;const s=document.createElement("textarea");if(s.value=t,document.body.append(s),navigator.userAgent.match(/ipad|ipod|iphone/i)){s.contentEditable=!0,s.readOnly=!0;const t=document.createRange();t.selectNodeContents(s);const e=window.getSelection();e.removeAllRanges(),e.addRange(t),s.setSelectionRange(0,999999)}else s.select();return document.execCommand("copy"),s.remove(),!0}};function zo(t){if("string"==typeof t){if("pattern"===(t=t.toLowerCase()))return"var(--color-gray-800) var(--bg-pattern)";if(!1===t.startsWith("#")&&!1===t.startsWith("var(")){const e="--color-"+t;if(window.getComputedStyle(document.documentElement).getPropertyValue(e))return`var(${e})`}return t}}function Yo(t,e=!1){if(!t.match("youtu"))return!1;let s=null;try{s=new URL(t)}catch(d){return!1}const n=s.pathname.split("/").filter((t=>""!==t)),i=n[0],o=n[1],r="https://"+(!0===e?"www.youtube-nocookie.com":s.host)+"/embed",l=t=>!!t&&null!==t.match(/^[a-zA-Z0-9_-]+$/);let a=s.searchParams,u=null;switch(n.join("/")){case"embed/videoseries":case"playlist":l(a.get("list"))&&(u=r+"/videoseries");break;case"watch":l(a.get("v"))&&(u=r+"/"+a.get("v"),a.has("t")&&a.set("start",a.get("t")),a.delete("v"),a.delete("t"));break;default:s.host.includes("youtu.be")&&l(i)?(u=!0===e?"https://www.youtube-nocookie.com/embed/"+i:"https://www.youtube.com/embed/"+i,a.has("t")&&a.set("start",a.get("t")),a.delete("t")):["embed","shorts"].includes(i)&&l(o)&&(u=r+"/"+o)}if(!u)return!1;const c=a.toString();return c.length&&(u+="?"+c),u}function Ho(t,e=!1){let s=null;try{s=new URL(t)}catch(a){return!1}const n=s.pathname.split("/").filter((t=>""!==t));let i=s.searchParams,o=null;switch(!0===e&&i.append("dnt",1),s.host){case"vimeo.com":case"www.vimeo.com":o=n[0];break;case"player.vimeo.com":o=n[1]}if(!o||!o.match(/^[0-9]*$/))return!1;let r="https://player.vimeo.com/video/"+o;const l=i.toString();return l.length&&(r+="?"+l),r}const Uo={youtube:Yo,vimeo:Ho,video:function(t,e=!1){return t.includes("youtu")?Yo(t,e):!!t.includes("vimeo")&&Ho(t,e)}};const Ko={form:function(t){const e={};for(const s in t)e[s]=U(t[s].default);return e},isVisible:function(t,e){if("hidden"===t.type)return!1;if(!t.when)return!0;for(const s in t.when){const n=e[s.toLowerCase()],i=t.when[s];if((void 0!==n||""!==i&&i!==[])&&n!==i)return!1}return!0},subfields:function(t,e){let s={};return Object.keys(e).forEach((n=>{let i=e[n];i.section=t.name,i.endpoints={field:t.endpoints.field+"+"+n,section:t.endpoints.section,model:t.endpoints.model},s[n]=i})),s}},Vo=e=>void 0!==t.options.components[e],Jo=t=>!!t.dataTransfer&&(!!t.dataTransfer.types&&(!0===t.dataTransfer.types.includes("Files")&&!1===t.dataTransfer.types.includes("text/plain")));const Go={metaKey:function(){return window.navigator.userAgent.indexOf("Mac")>-1?"cmd":"ctrl"}},Wo=(t="3/2",e="100%",s=!0)=>{const n=String(t).split("/");if(2!==n.length)return e;const i=Number(n[0]),o=Number(n[1]);let r=100;return 0!==i&&0!==o&&(r=s?r/i*o:r/o*i,r=parseFloat(String(r)).toFixed(2)),r+"%"},Xo=t=>{var e=(t=t||{}).desc?-1:1,s=-e,n=/^0/,i=/\s+/g,o=/^\s+|\s+$/g,r=/[^\x00-\x80]/,l=/^0x[0-9a-f]+$/i,a=/(0x[\da-fA-F]+|(^[\+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|\d+)/g,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=t.insensitive?function(t){return function(t){if(t.toLocaleLowerCase)return t.toLocaleLowerCase();return t.toLowerCase()}(""+t).replace(o,"")}:function(t){return(""+t).replace(o,"")};function d(t){return t.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")}function p(t,e){return(!t.match(n)||1===e)&&parseFloat(t)||t.replace(i," ").replace(o,"")||0}return function(t,n){var i=c(t),o=c(n);if(!i&&!o)return 0;if(!i&&o)return s;if(i&&!o)return e;var a=d(i),h=d(o),m=parseInt(i.match(l),16)||1!==a.length&&Date.parse(i),f=parseInt(o.match(l),16)||m&&o.match(u)&&Date.parse(o)||null;if(f){if(mf)return e}for(var g=a.length,k=h.length,b=0,v=Math.max(g,k);b0)return e;if(_<0)return s;if(b===v-1)return 0}else{if(y<$)return s;if(y>$)return e}}return 0}};RegExp.escape=function(t){return t.replace(new RegExp("[-/\\\\^$*+?.()[\\]{}]","gu"),"\\$&")};const Zo={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function Qo(t){return String(t).replace(/[&<>"'`=/]/g,(t=>Zo[t]))}function tr(t,e={}){const s=(t,e={})=>{const n=Qo(t.shift()),i=e[n]??null;return null===i?Object.prototype.hasOwnProperty.call(e,n)||"…":0===t.length?i:s(t,i)},n="[{]{1,2}[\\s]?",i="[\\s]?[}]{1,2}";return(t=t.replace(new RegExp(`${n}(.*?)${i}`,"gi"),((t,n)=>s(n.split("."),e)))).replace(new RegExp(`${n}.*${i}`,"gi"),"…")}function er(t){const e=String(t);return e.charAt(0).toUpperCase()+e.slice(1)}const sr={camelToKebab:function(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()},escapeHTML:Qo,hasEmoji:function(t){if("string"!=typeof t)return!1;const e=t.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c\ude32-\ude3a]|[\ud83c\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/i);return null!==e&&null!==e.length},lcfirst:function(t){const e=String(t);return e.charAt(0).toLowerCase()+e.slice(1)},pad:function(t,e=2){t=String(t);let s="";for(;s.length]+)>)/gi,"")},template:tr,ucfirst:er,ucwords:function(t){return String(t).split(/ /g).map((t=>er(t))).join(" ")},unescapeHTML:function(t){for(const e in Zo)t=String(t).replaceAll(Zo[e],e);return t},uuid:function(){let t,e,s="";for(t=0;t<32;t++)e=16*Math.random()|0,8!=t&&12!=t&&16!=t&&20!=t||(s+="-"),s+=(12==t?4:16==t?3&e|8:e).toString(16);return s}},nr=(t,e)=>{const s=Object.assign({url:"/",field:"file",method:"POST",attributes:{},complete:function(){},error:function(){},success:function(){},progress:function(){}},e),n=new FormData;n.append(s.field,t,t.name),s.attributes&&Object.keys(s.attributes).forEach((t=>{n.append(t,s.attributes[t])}));const i=new XMLHttpRequest,o=e=>{if(!e.lengthComputable||!s.progress)return;let n=Math.max(0,Math.min(100,e.loaded/e.total*100));s.progress(i,t,Math.ceil(n))};i.upload.addEventListener("loadstart",o),i.upload.addEventListener("progress",o),i.addEventListener("load",(e=>{let n=null;try{n=JSON.parse(e.target.response)}catch(o){n={status:"error",message:"The file could not be uploaded"}}"error"===n.status?s.error(i,t,n):(s.success(i,t,n),s.progress(i,t,100))})),i.addEventListener("error",(e=>{const n=JSON.parse(e.target.response);s.error(i,t,n),s.progress(i,t,100)})),i.open(s.method,s.url,!0),s.headers&&Object.keys(s.headers).forEach((t=>{const e=s.headers[t];i.setRequestHeader(t,e)})),i.send(n)},ir={install(t){Array.prototype.sortBy=function(e){const s=t.prototype.$helper.sort(),n=e.split(" "),i=n[0],o=n[1]||"asc";return this.sort(((t,e)=>{const n=String(t[i]).toLowerCase(),r=String(e[i]).toLowerCase();return"desc"===o?s(r,n):s(n,r)}))},t.prototype.$helper={clipboard:qo,clone:J.clone,color:zo,embed:Uo,isComponent:Vo,isUploadEvent:Jo,debounce:it,field:Ko,keyboard:Go,object:J,pad:sr.pad,ratio:Wo,slug:sr.slug,sort:Xo,string:sr,upload:nr,uuid:sr.uuid},t.prototype.$esc=sr.escapeHTML}},or={install(t){t.$t=t.prototype.$t=window.panel.$t=(t,e,s=null)=>{if("string"!=typeof t)return;const n=window.panel.$translation.data[t]||s;return"string"!=typeof n?n:tr(n,e)},t.directive("direction",{inserted(t,e,s){!0!==s.context.disabled?t.dir=s.context.$direction:t.dir=null}})}};R.extend(F),R.extend(((t,e,s)=>{s.interpret=(t,e="date")=>{const n={date:{"YYYY-MM-DD":!0,"YYYY-MM-D":!0,"YYYY-MM-":!0,"YYYY-MM":!0,"YYYY-M-DD":!0,"YYYY-M-D":!0,"YYYY-M-":!0,"YYYY-M":!0,"YYYY-":!0,YYYYMMDD:!0,"MMM DD YYYY":!1,"MMM D YYYY":!1,"MMM DD YY":!1,"MMM D YY":!1,"MMM DD":!1,"MMM D":!1,"DD MMMM YYYY":!1,"DD MMMM YY":!1,"DD MMMM":!1,"D MMMM YYYY":!1,"D MMMM YY":!1,"D MMMM":!1,"DD MMM YYYY":!1,"D MMM YYYY":!1,"DD MMM YY":!1,"D MMM YY":!1,"DD MMM":!1,"D MMM":!1,"DD MM YYYY":!1,"DD M YYYY":!1,"D MM YYYY":!1,"D M YYYY":!1,"DD MM YY":!1,"D MM YY":!1,"DD M YY":!1,"D M YY":!1,YYYY:!0,MMMM:!0,MMM:!0,"DD MM":!1,"DD M":!1,"D MM":!1,"D M":!1,DD:!1,D:!1},time:{"HH:mm:ss a":!1,"HH:mm:ss":!1,"HH:mm a":!1,"HH:mm":!1,"HH a":!1,HH:!1}};if("string"==typeof t&&""!==t)for(const i in n[e]){const o=s(t,i,n[e][i]);if(!0===o.isValid())return o}return null}})),R.extend(((t,e,s)=>{const n=t=>"date"===t?"YYYY-MM-DD":"time"===t?"HH:mm:ss":"YYYY-MM-DD HH:mm:ss";e.prototype.toISO=function(t="datetime"){return this.format(n(t))},s.iso=function(t,e="datetime"){const i=s(t,n(e));return i&&i.isValid()?i:null}})),R.extend(((t,e)=>{e.prototype.merge=function(t,e="date"){let s=this.clone();if(!t||!t.isValid())return this;if("string"==typeof e){const t={date:["year","month","date"],time:["hour","minute","second"]};if(!1===Object.prototype.hasOwnProperty.call(t,e))throw new Error("Invalid merge unit alias");e=t[e]}for(const n of e)s=s.set(n,t.get(n));return s}})),R.extend(((t,e,s)=>{s.pattern=t=>new class{constructor(t,e){this.dayjs=t,this.pattern=e;const s={year:["YY","YYYY"],month:["M","MM","MMM","MMMM"],day:["D","DD"],hour:["h","hh","H","HH"],minute:["m","mm"],second:["s","ss"],meridiem:["a"]};this.parts=this.pattern.split(/\W/).map(((t,e)=>{const n=this.pattern.indexOf(t);return{index:e,unit:Object.keys(s)[Object.values(s).findIndex((e=>e.includes(t)))],start:n,end:n+(t.length-1)}}))}at(t,e=t){const s=this.parts.filter((s=>s.start<=t&&s.end>=e-1));return s[0]?s[0]:this.parts.filter((e=>e.start<=t)).pop()}format(t){return t&&t.isValid()?t.format(this.pattern):null}}(s,t)})),R.extend(((t,e)=>{e.prototype.round=function(t="date",e=1){const s=["second","minute","hour","date","month","year"];if("day"===t&&(t="date"),!1===s.includes(t))throw new Error("Invalid rounding unit");if(["date","month","year"].includes(t)&&1!==e||"hour"===t&&24%e!=0||["second","minute"].includes(t)&&60%e!=0)throw"Invalid rounding size for "+t;let n=this.clone();const i=s.indexOf(t),o=s.slice(0,i),r=o.pop();if(o.forEach((t=>n=n.startOf(t))),r){const e={month:12,date:n.daysInMonth(),hour:24,minute:60,second:60}[r];Math.round(n.get(r)/e)*e===e&&(n=n.add(1,"date"===t?"day":t)),n=n.startOf(t)}return n=n.set(t,Math.round(n.get(t)/e)*e),n}})),R.extend(((t,e,s)=>{e.prototype.validate=function(t,e,n="day"){if(!this.isValid())return!1;if(!t)return!0;t=s.iso(t);const i={min:"isAfter",max:"isBefore"}[e];return this.isSame(t,n)||this[i](t,n)}}));const rr={install(t){t.prototype.$library={autosize:q,dayjs:R}}},lr={install(t){const e={...t.options.components},s={section:ai};for(const[n,i]of Object.entries(window.panel.plugins.components))i.template||i.render||i.extends?("string"==typeof(null==i?void 0:i.extends)&&(e[i.extends]?i.extends=e[i.extends].extend({options:i,components:{...e,...i.components||{}}}):(window.console.warn(`Problem with plugin trying to register component "${n}": cannot extend non-existent component "${i.extends}"`),i.extends=null)),i.template&&(i.render=null),i.mixins&&(i.mixins=i.mixins.map((t=>"string"==typeof t?s[t]:t))),e[n]&&window.console.warn(`Plugin is replacing "${n}"`),t.component(n,i),e[n]=t.options.components[n]):Eo.dispatch("notification/error",`Neither template or render method provided nor extending a component when loading plugin component "${n}". The component has not been registered.`);for(const n of window.panel.plugins.use)t.use(n)}};t.config.productionTip=!1,t.config.devtools=!0;const ar=new t({store:Eo,created(){window.panel.$vue=window.panel.app=this,window.panel.plugins.created.forEach((t=>t(this))),this.$store.dispatch("content/init")},render:()=>L(Z)});t.use(Mo),t.use(ir),t.use(rr),t.use(X,Eo),t.use(Lo),t.use(or),t.use(Fo),t.use(z),t.use(Oo),t.use(lr),ar.$mount("#app"); diff --git a/kirby/panel/dist/js/vendor.js b/kirby/panel/dist/js/vendor.js index d965b54..5286594 100644 --- a/kirby/panel/dist/js/vendor.js +++ b/kirby/panel/dist/js/vendor.js @@ -1,11 +1 @@ -/*! - * Vue.js v2.7.14 - * (c) 2014-2022 Evan You - * Released under the MIT License. - */ -var t=Object.freeze({}),e=Array.isArray;function n(t){return null==t}function r(t){return null!=t}function i(t){return!0===t}function o(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function s(t){return"function"==typeof t}function a(t){return null!==t&&"object"==typeof t}var l=Object.prototype.toString;function c(t){return"[object Object]"===l.call(t)}function u(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return r(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function f(t){return null==t?"":Array.isArray(t)||c(t)&&t.toString===l?JSON.stringify(t,null,2):String(t)}function h(t){var e=parseFloat(t);return isNaN(e)?t:e}function p(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i-1)return t.splice(r,1)}}var y=Object.prototype.hasOwnProperty;function b(t,e){return y.call(t,e)}function w(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var x=/-(\w)/g,k=w((function(t){return t.replace(x,(function(t,e){return e?e.toUpperCase():""}))})),S=w((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),O=/\B([A-Z])/g,_=w((function(t){return t.replace(O,"-$1").toLowerCase()}));var M=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function C(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function $(t,e){for(var n in e)t[n]=e[n];return t}function N(t){for(var e={},n=0;n0,Y=H&&H.indexOf("edge/")>0;H&&H.indexOf("android");var G=H&&/iphone|ipad|ipod|ios/.test(H);H&&/chrome\/\d+/.test(H),H&&/phantomjs/.test(H);var Z,X=H&&H.match(/firefox\/(\d+)/),Q={}.watch,tt=!1;if(W)try{var et={};Object.defineProperty(et,"passive",{get:function(){tt=!0}}),window.addEventListener("test-passive",null,et)}catch(Tg){}var nt=function(){return void 0===Z&&(Z=!W&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),Z},rt=W&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function it(t){return"function"==typeof t&&/native code/.test(t.toString())}var ot,st="undefined"!=typeof Symbol&&it(Symbol)&&"undefined"!=typeof Reflect&&it(Reflect.ownKeys);ot="undefined"!=typeof Set&&it(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var at=null;function lt(t){void 0===t&&(t=null),t||at&&at._scope.off(),at=t,t&&t._scope.on()}var ct=function(){function t(t,e,n,r,i,o,s,a){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=s,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=a,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),ut=function(t){void 0===t&&(t="");var e=new ct;return e.text=t,e.isComment=!0,e};function dt(t){return new ct(void 0,void 0,void 0,String(t))}function ft(t){var e=new ct(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var ht=0,pt=[],mt=function(){function t(){this._pending=!1,this.id=ht++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){this.subs[this.subs.indexOf(t)]=null,this._pending||(this._pending=!0,pt.push(this))},t.prototype.depend=function(e){t.target&&t.target.addDep(this)},t.prototype.notify=function(t){for(var e=this.subs.filter((function(t){return t})),n=0,r=e.length;n0&&(Vt((l=qt(l,"".concat(s||"","_").concat(a)))[0])&&Vt(u)&&(d[c]=dt(u.text+l[0].text),l.shift()),d.push.apply(d,l)):o(l)?Vt(u)?d[c]=dt(u.text+l):""!==l&&d.push(dt(l)):Vt(l)&&Vt(u)?d[c]=dt(u.text+l.text):(i(t._isVList)&&r(l.tag)&&n(l.key)&&r(s)&&(l.key="__vlist".concat(s,"_").concat(a,"__")),d.push(l)));return d}function Jt(t,n,l,c,u,d){return(e(l)||o(l))&&(u=c,c=l,l=void 0),i(d)&&(u=2),function(t,n,i,o,l){if(r(i)&&r(i.__ob__))return ut();r(i)&&r(i.is)&&(n=i.is);if(!n)return ut();e(o)&&s(o[0])&&((i=i||{}).scopedSlots={default:o[0]},o.length=0);2===l?o=Bt(o):1===l&&(o=function(t){for(var n=0;n0,a=n?!!n.$stable:!s,l=n&&n.$key;if(n){if(n._normalized)return n._normalized;if(a&&i&&i!==t&&l===i.$key&&!s&&!i.$hasNormal)return i;for(var c in o={},n)n[c]&&"$"!==c[0]&&(o[c]=de(e,r,c,n[c]))}else o={};for(var u in r)u in o||(o[u]=fe(r,u));return n&&Object.isExtensible(n)&&(n._normalized=o),V(o,"$stable",a),V(o,"$key",l),V(o,"$hasNormal",s),o}function de(t,n,r,i){var o=function(){var n=at;lt(t);var r=arguments.length?i.apply(null,arguments):i({}),o=(r=r&&"object"==typeof r&&!e(r)?[r]:Bt(r))&&r[0];return lt(n),r&&(!o||1===r.length&&o.isComment&&!ce(o))?void 0:r};return i.proxy&&Object.defineProperty(n,r,{get:o,enumerable:!0,configurable:!0}),o}function fe(t,e){return function(){return t[e]}}function he(e){var n=e.$options,r=n.setup;if(r){var i=e._setupContext=function(e){return{get attrs(){if(!e._attrsProxy){var n=e._attrsProxy={};V(n,"_v_attr_proxy",!0),pe(n,e.$attrs,t,e,"$attrs")}return e._attrsProxy},get listeners(){e._listenersProxy||pe(e._listenersProxy={},e.$listeners,t,e,"$listeners");return e._listenersProxy},get slots(){return function(t){t._slotsProxy||ge(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(e)},emit:M(e.$emit,e),expose:function(t){t&&Object.keys(t).forEach((function(n){return It(e,t,n)}))}}}(e);lt(e),vt();var o=He(r,null,[e._props||At({}),i],e,"setup");if(yt(),lt(),s(o))n.render=o;else if(a(o))if(e._setupState=o,o.__sfc){var l=e._setupProxy={};for(var c in o)"__sfc"!==c&&It(l,o,c)}else for(var c in o)B(c)||It(e,o,c)}}function pe(t,e,n,r,i){var o=!1;for(var s in e)s in t?e[s]!==n[s]&&(o=!0):(o=!0,me(t,s,r,i));for(var s in t)s in e||(o=!0,delete t[s]);return o}function me(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[r][e]}})}function ge(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var ve,ye=null;function be(t,e){return(t.__esModule||st&&"Module"===t[Symbol.toStringTag])&&(t=t.default),a(t)?e.extend(t):t}function we(t){if(e(t))for(var n=0;ndocument.createEvent("Event").timeStamp&&(je=function(){return Fe.now()})}var Le,Be=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function Ve(){var t,e;for(ze=je(),Ie=!0,De.sort(Be),Re=0;ReRe&&De[n].id>t.id;)n--;De.splice(n+1,0,t)}else De.push(t);Pe||(Pe=!0,on(Ve))}}(this)},t.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||a(t)||this.deep){var e=this.value;if(this.value=t,this.user){var n='callback for watcher "'.concat(this.expression,'"');He(this.cb,this.vm,[t,e],this.vm,n)}else this.cb.call(this.vm,t,e)}}},t.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},t.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},t.prototype.teardown=function(){if(this.vm&&!this.vm._isBeingDestroyed&&v(this.vm._scope.effects,this),this.active){for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1,this.onStop&&this.onStop()}},t}(),dn={enumerable:!0,configurable:!0,get:T,set:T};function fn(t,e,n){dn.get=function(){return this[e][n]},dn.set=function(t){this[e][n]=t},Object.defineProperty(t,n,dn)}function hn(t){var n=t.$options;if(n.props&&function(t,e){var n=t.$options.propsData||{},r=t._props=At({}),i=t.$options._propKeys=[];t.$parent&&Ot(!1);var o=function(o){i.push(o);var s=Ln(o,e,n,t);$t(r,o,s),o in t||fn(t,"_props",o)};for(var s in e)o(s);Ot(!0)}(t,n.props),he(t),n.methods&&function(t,e){for(var n in t.$options.props,e)t[n]="function"!=typeof e[n]?T:M(e[n],t)}(t,n.methods),n.data)!function(t){var e=t.$options.data;c(e=t._data=s(e)?function(t,e){vt();try{return t.call(e,e)}catch(Tg){return We(Tg,e,"data()"),{}}finally{yt()}}(e,t):e||{})||(e={});var n=Object.keys(e),r=t.$options.props;t.$options.methods;var i=n.length;for(;i--;){var o=n[i];r&&b(r,o)||B(o)||fn(t,"_data",o)}var a=Ct(e);a&&a.vmCount++}(t);else{var r=Ct(t._data={});r&&r.vmCount++}n.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=nt();for(var i in e){var o=e[i],a=s(o)?o:o.get;r||(n[i]=new un(t,a||T,T,pn)),i in t||mn(t,i,o)}}(t,n.computed),n.watch&&n.watch!==Q&&function(t,n){for(var r in n){var i=n[r];if(e(i))for(var o=0;o-1)if(o&&!b(i,"default"))a=!1;else if(""===a||a===_(t)){var c=Jn(String,i.type);(c<0||l-1:"string"==typeof t?t.split(",").indexOf(n)>-1:(r=t,"[object RegExp]"===l.call(r)&&t.test(n));var r}function Yn(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var s=n[o];if(s){var a=s.name;a&&!e(a)&&Gn(n,o,r,i)}}}function Gn(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,v(n,e)}Wn.prototype._init=function(e){var n=this;n._uid=xn++,n._isVue=!0,n.__v_skip=!0,n._scope=new qe(!0),n._scope._vm=!0,e&&e._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(n,e):n.$options=jn(kn(n.constructor),e||{},n),n._renderProxy=n,n._self=n,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(n),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Oe(t,e)}(n),function(e){e._vnode=null,e._staticTrees=null;var n=e.$options,r=e.$vnode=n._parentVnode,i=r&&r.context;e.$slots=ae(n._renderChildren,i),e.$scopedSlots=r?ue(e.$parent,r.data.scopedSlots,e.$slots):t,e._c=function(t,n,r,i){return Jt(e,t,n,r,i,!1)},e.$createElement=function(t,n,r,i){return Jt(e,t,n,r,i,!0)};var o=r&&r.data;$t(e,"$attrs",o&&o.attrs||t,null,!0),$t(e,"$listeners",n._parentListeners||t,null,!0)}(n),Te(n,"beforeCreate",void 0,!1),function(t){var e=wn(t.$options.inject,t);e&&(Ot(!1),Object.keys(e).forEach((function(n){$t(t,n,e[n])})),Ot(!0))}(n),hn(n),bn(n),Te(n,"created"),n.$options.el&&n.$mount(n.$options.el)},function(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=Nt,t.prototype.$delete=Tt,t.prototype.$watch=function(t,e,n){var r=this;if(c(e))return yn(r,t,e,n);(n=n||{}).user=!0;var i=new un(r,t,e,n);if(n.immediate){var o='callback for immediate watcher "'.concat(i.expression,'"');vt(),He(e,r,[i.value],r,o),yt()}return function(){i.teardown()}}}(Wn),function(t){var n=/^hook:/;t.prototype.$on=function(t,r){var i=this;if(e(t))for(var o=0,s=t.length;o1?C(n):n;for(var r=C(arguments,1),i='event handler for "'.concat(t,'"'),o=0,s=n.length;oparseInt(this.max)&&Gn(e,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Gn(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Yn(t,(function(t){return Un(e,t)}))})),this.$watch("exclude",(function(e){Yn(t,(function(t){return!Un(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=we(t),n=e&&e.componentOptions;if(n){var r=Kn(n),i=this.include,o=this.exclude;if(i&&(!r||!Un(i,r))||o&&r&&Un(o,r))return e;var s=this.cache,a=this.keys,l=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;s[l]?(e.componentInstance=s[l].componentInstance,v(a,l),a.push(l)):(this.vnodeToCache=e,this.keyToCache=l),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return F}};Object.defineProperty(t,"config",e),t.util={warn:Dn,extend:$,mergeOptions:jn,defineReactive:$t},t.set=Nt,t.delete=Tt,t.nextTick=on,t.observable=function(t){return Ct(t),t},t.options=Object.create(null),z.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,$(t.options.components,Xn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=C(arguments,1);return n.unshift(this),s(t.install)?t.install.apply(t,n):s(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=jn(this.options,t),this}}(t),Hn(t),function(t){z.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&c(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&s(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(Wn),Object.defineProperty(Wn.prototype,"$isServer",{get:nt}),Object.defineProperty(Wn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Wn,"FunctionalRenderContext",{value:Sn}),Wn.version="2.7.14";var Qn=p("style,class"),tr=p("input,textarea,option,select,progress"),er=function(t,e,n){return"value"===n&&tr(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},nr=p("contenteditable,draggable,spellcheck"),rr=p("events,caret,typing,plaintext-only"),ir=p("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),or="http://www.w3.org/1999/xlink",sr=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},ar=function(t){return sr(t)?t.slice(6,t.length):""},lr=function(t){return null==t||!1===t};function cr(t){for(var e=t.data,n=t,i=t;r(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(e=ur(i.data,e));for(;r(n=n.parent);)n&&n.data&&(e=ur(e,n.data));return function(t,e){if(r(t)||r(e))return dr(t,fr(e));return""}(e.staticClass,e.class)}function ur(t,e){return{staticClass:dr(t.staticClass,e.staticClass),class:r(t.class)?[t.class,e.class]:e.class}}function dr(t,e){return t?e?t+" "+e:t:e||""}function fr(t){return Array.isArray(t)?function(t){for(var e,n="",i=0,o=t.length;i-1?jr(t,e,n):ir(e)?lr(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):nr(e)?t.setAttribute(e,function(t,e){return lr(e)||"false"===e?"false":"contenteditable"===t&&rr(e)?e:"true"}(e,n)):sr(e)?lr(n)?t.removeAttributeNS(or,ar(e)):t.setAttributeNS(or,e,n):jr(t,e,n)}function jr(t,e,n){if(lr(n))t.removeAttribute(e);else{if(K&&!U&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var Fr={create:Rr,update:Rr};function Lr(t,e){var i=e.elm,o=e.data,s=t.data;if(!(n(o.staticClass)&&n(o.class)&&(n(s)||n(s.staticClass)&&n(s.class)))){var a=cr(e),l=i._transitionClasses;r(l)&&(a=dr(a,fr(l))),a!==i._prevClass&&(i.setAttribute("class",a),i._prevClass=a)}}var Br,Vr,qr,Jr,Wr,Hr,Kr={create:Lr,update:Lr},Ur=/[\w).+\-_$\]]/;function Yr(t){var e,n,r,i,o,s=!1,a=!1,l=!1,c=!1,u=0,d=0,f=0,h=0;for(r=0;r=0&&" "===(m=t.charAt(p));p--);m&&Ur.test(m)||(c=!0)}}else void 0===i?(h=r+1,i=t.slice(0,r).trim()):g();function g(){(o||(o=[])).push(t.slice(h,r).trim()),h=r+1}if(void 0===i?i=t.slice(0,r).trim():0!==h&&g(),o)for(r=0;r-1?{exp:t.slice(0,Jr),key:'"'+t.slice(Jr+1)+'"'}:{exp:t,key:null};Vr=t,Jr=Wr=Hr=0;for(;!fi();)hi(qr=di())?mi(qr):91===qr&&pi(qr);return{exp:t.slice(0,Wr),key:t.slice(Wr+1,Hr)}}(t);return null===n.key?"".concat(t,"=").concat(e):"$set(".concat(n.exp,", ").concat(n.key,", ").concat(e,")")}function di(){return Vr.charCodeAt(++Jr)}function fi(){return Jr>=Br}function hi(t){return 34===t||39===t}function pi(t){var e=1;for(Wr=Jr;!fi();)if(hi(t=di()))mi(t);else if(91===t&&e++,93===t&&e--,0===e){Hr=Jr;break}}function mi(t){for(var e=t;!fi()&&(t=di())!==e;);}var gi;function vi(t,e,n){var r=gi;return function i(){var o=e.apply(null,arguments);null!==o&&wi(t,i,n,r)}}var yi=Ge&&!(X&&Number(X[1])<=53);function bi(t,e,n,r){if(yi){var i=ze,o=e;e=o._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=i||t.timeStamp<=0||t.target.ownerDocument!==document)return o.apply(this,arguments)}}gi.addEventListener(t,e,tt?{capture:n,passive:r}:n)}function wi(t,e,n,r){(r||gi).removeEventListener(t,e._wrapper||e,n)}function xi(t,e){if(!n(t.data.on)||!n(e.data.on)){var i=e.data.on||{},o=t.data.on||{};gi=e.elm||t.elm,function(t){if(r(t.__r)){var e=K?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}r(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(i),jt(i,o,bi,wi,vi,e.context),gi=void 0}}var ki,Si={create:xi,update:xi,destroy:function(t){return xi(t,_r)}};function Oi(t,e){if(!n(t.data.domProps)||!n(e.data.domProps)){var o,s,a=e.elm,l=t.data.domProps||{},c=e.data.domProps||{};for(o in(r(c.__ob__)||i(c._v_attr_proxy))&&(c=e.data.domProps=$({},c)),l)o in c||(a[o]="");for(o in c){if(s=c[o],"textContent"===o||"innerHTML"===o){if(e.children&&(e.children.length=0),s===l[o])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===o&&"PROGRESS"!==a.tagName){a._value=s;var u=n(s)?"":String(s);_i(a,u)&&(a.value=u)}else if("innerHTML"===o&&mr(a.tagName)&&n(a.innerHTML)){(ki=ki||document.createElement("div")).innerHTML="".concat(s,"");for(var d=ki.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;d.firstChild;)a.appendChild(d.firstChild)}else if(s!==l[o])try{a[o]=s}catch(Tg){}}}}function _i(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(Tg){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,i=t._vModifiers;if(r(i)){if(i.number)return h(n)!==h(e);if(i.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Mi={create:Oi,update:Oi},Ci=w((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function $i(t){var e=Ni(t.style);return t.staticStyle?$(t.staticStyle,e):e}function Ni(t){return Array.isArray(t)?N(t):"string"==typeof t?Ci(t):t}var Ti,Di=/^--/,Ai=/\s*!important$/,Ei=function(t,e,n){if(Di.test(e))t.style.setProperty(e,n);else if(Ai.test(n))t.style.setProperty(_(e),n.replace(Ai,""),"important");else{var r=Ii(e);if(Array.isArray(n))for(var i=0,o=n.length;i-1?e.split(ji).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Li(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(ji).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function Bi(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&$(e,Vi(t.name||"v")),$(e,t),e}return"string"==typeof t?Vi(t):void 0}}var Vi=w((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),qi=W&&!U,Ji="transition",Wi="transitionend",Hi="animation",Ki="animationend";qi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ji="WebkitTransition",Wi="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Hi="WebkitAnimation",Ki="webkitAnimationEnd"));var Ui=W?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Yi(t){Ui((function(){Ui(t)}))}function Gi(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Fi(t,e))}function Zi(t,e){t._transitionClasses&&v(t._transitionClasses,e),Li(t,e)}function Xi(t,e,n){var r=to(t,e),i=r.type,o=r.timeout,s=r.propCount;if(!i)return n();var a="transition"===i?Wi:Ki,l=0,c=function(){t.removeEventListener(a,u),n()},u=function(e){e.target===t&&++l>=s&&c()};setTimeout((function(){l0&&(n="transition",u=s,d=o.length):"animation"===e?c>0&&(n="animation",u=c,d=l.length):d=(n=(u=Math.max(s,c))>0?s>c?"transition":"animation":null)?"transition"===n?o.length:l.length:0,{type:n,timeout:u,propCount:d,hasTransform:"transition"===n&&Qi.test(r[Ji+"Property"])}}function eo(t,e){for(;t.length1}function ao(t,e){!0!==e.data.show&&ro(e)}var lo=function(t){var s,a,l={},c=t.modules,u=t.nodeOps;for(s=0;sp?w(t,n(i[v+1])?null:i[v+1].elm,i,h,v,o):h>v&&k(e,d,p)}(d,m,g,o,c):r(g)?(r(t.text)&&u.setTextContent(d,""),w(d,null,g,0,g.length-1,o)):r(m)?k(m,0,m.length-1):r(t.text)&&u.setTextContent(d,""):t.text!==e.text&&u.setTextContent(d,e.text),r(p)&&r(h=p.hook)&&r(h=h.postpatch)&&h(t,e)}}}function M(t,e,n){if(i(n)&&r(t.parent))t.parent.data.pendingInsert=e;else for(var o=0;o-1,s.selected!==o&&(s.selected=o);else if(E(po(s),r))return void(t.selectedIndex!==a&&(t.selectedIndex=a));i||(t.selectedIndex=-1)}}function ho(t,e){return e.every((function(e){return!E(e,t)}))}function po(t){return"_value"in t?t._value:t.value}function mo(t){t.target.composing=!0}function go(t){t.target.composing&&(t.target.composing=!1,vo(t.target,"input"))}function vo(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function yo(t){return!t.componentInstance||t.data&&t.data.transition?t:yo(t.componentInstance._vnode)}var bo={model:co,show:{bind:function(t,e,n){var r=e.value,i=(n=yo(n)).data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&i?(n.data.show=!0,ro(n,(function(){t.style.display=o}))):t.style.display=r?o:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=yo(n)).data&&n.data.transition?(n.data.show=!0,r?ro(n,(function(){t.style.display=t.__vOriginalDisplay})):io(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,i){i||(t.style.display=t.__vOriginalDisplay)}}},wo={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function xo(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?xo(we(e.children)):t}function ko(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var r in i)e[k(r)]=i[r];return e}function So(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Oo=function(t){return t.tag||ce(t)},_o=function(t){return"show"===t.name},Mo={name:"transition",props:wo,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Oo)).length){var r=this.mode,i=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return i;var s=xo(i);if(!s)return i;if(this._leaving)return So(t,i);var a="__transition-".concat(this._uid,"-");s.key=null==s.key?s.isComment?a+"comment":a+s.tag:o(s.key)?0===String(s.key).indexOf(a)?s.key:a+s.key:s.key;var l=(s.data||(s.data={})).transition=ko(this),c=this._vnode,u=xo(c);if(s.data.directives&&s.data.directives.some(_o)&&(s.data.show=!0),u&&u.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(s,u)&&!ce(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var d=u.data.transition=$({},l);if("out-in"===r)return this._leaving=!0,Ft(d,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),So(t,i);if("in-out"===r){if(ce(s))return c;var f,h=function(){f()};Ft(l,"afterEnter",h),Ft(l,"enterCancelled",h),Ft(d,"delayLeave",(function(t){f=t}))}}return i}}},Co=$({tag:String,moveClass:String},wo);function $o(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function No(t){t.data.newPos=t.elm.getBoundingClientRect()}function To(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate(".concat(r,"px,").concat(i,"px)"),o.transitionDuration="0s"}}delete Co.mode;var Do={Transition:Mo,TransitionGroup:{props:Co,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var i=Me(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],s=ko(this),a=0;a-1?yr[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:yr[t]=/HTMLUnknownElement/.test(e.toString())},$(Wn.options.directives,bo),$(Wn.options.components,Do),Wn.prototype.__patch__=W?lo:T,Wn.prototype.$mount=function(t,e){return function(t,e,n){var r;t.$el=e,t.$options.render||(t.$options.render=ut),Te(t,"beforeMount"),r=function(){t._update(t._render(),n)},new un(t,r,T,{before:function(){t._isMounted&&!t._isDestroyed&&Te(t,"beforeUpdate")}},!0),n=!1;var i=t._preWatchers;if(i)for(var o=0;o\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,qo=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Jo="[a-zA-Z_][\\-\\.0-9_a-zA-Z".concat(L.source,"]*"),Wo="((?:".concat(Jo,"\\:)?").concat(Jo,")"),Ho=new RegExp("^<".concat(Wo)),Ko=/^\s*(\/?)>/,Uo=new RegExp("^<\\/".concat(Wo,"[^>]*>")),Yo=/^]+>/i,Go=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},es=/&(?:lt|gt|quot|amp|#39);/g,ns=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,rs=p("pre,textarea",!0),is=function(t,e){return t&&rs(t)&&"\n"===e[0]};function ss(t,e){var n=e?ns:es;return t.replace(n,(function(t){return ts[t]}))}function as(t,e){for(var n,r,i=[],o=e.expectHTML,s=e.isUnaryTag||D,a=e.canBeLeftOpenTag||D,l=0,c=function(){if(n=t,r&&Xo(r)){var c=0,f=r.toLowerCase(),h=Qo[f]||(Qo[f]=new RegExp("([\\s\\S]*?)(]*>)","i"));k=t.replace(h,(function(t,n,r){return c=r.length,Xo(f)||"noscript"===f||(n=n.replace(//g,"$1").replace(//g,"$1")),is(f,n)&&(n=n.slice(1)),e.chars&&e.chars(n),""}));l+=t.length-k.length,t=k,d(f,l-c,l)}else{var p=t.indexOf("<");if(0===p){if(Go.test(t)){var m=t.indexOf("--\x3e");if(m>=0)return e.shouldKeepComment&&e.comment&&e.comment(t.substring(4,m),l,l+m+3),u(m+3),"continue"}if(Zo.test(t)){var g=t.indexOf("]>");if(g>=0)return u(g+2),"continue"}var v=t.match(Yo);if(v)return u(v[0].length),"continue";var y=t.match(Uo);if(y){var b=l;return u(y[0].length),d(y[1],b,l),"continue"}var w=function(){var e=t.match(Ho);if(e){var n={tagName:e[1],attrs:[],start:l};u(e[0].length);for(var r=void 0,i=void 0;!(r=t.match(Ko))&&(i=t.match(qo)||t.match(Vo));)i.start=l,u(i[0].length),i.end=l,n.attrs.push(i);if(r)return n.unarySlash=r[1],u(r[0].length),n.end=l,n}}();if(w)return function(t){var n=t.tagName,l=t.unarySlash;o&&("p"===r&&Bo(n)&&d(r),a(n)&&r===n&&d(n));for(var c=s(n)||!!l,u=t.attrs.length,f=new Array(u),h=0;h=0){for(k=t.slice(p);!(Uo.test(k)||Ho.test(k)||Go.test(k)||Zo.test(k)||(S=k.indexOf("<",1))<0);)p+=S,k=t.slice(p);x=t.substring(0,p)}p<0&&(x=t),x&&u(x.length),e.chars&&x&&e.chars(x,l-x.length,l)}if(t===n)return e.chars&&e.chars(t),"break"};t;){if("break"===c())break}function u(e){l+=e,t=t.substring(e)}function d(t,n,o){var s,a;if(null==n&&(n=l),null==o&&(o=l),t)for(a=t.toLowerCase(),s=i.length-1;s>=0&&i[s].lowerCasedTag!==a;s--);else s=0;if(s>=0){for(var c=i.length-1;c>=s;c--)e.end&&e.end(i[c].tag,n,o);i.length=s,r=s&&i[s-1].tag}else"br"===a?e.start&&e.start(t,[],!0,n,o):"p"===a&&(e.start&&e.start(t,[],!1,n,o),e.end&&e.end(t,n,o))}d()}var ls,cs,us,ds,fs,hs,ps,ms,gs=/^@|^v-on:/,vs=/^v-|^@|^:|^#/,ys=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,bs=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,ws=/^\(|\)$/g,xs=/^\[.*\]$/,ks=/:(.*)$/,Ss=/^:|^\.|^v-bind:/,Os=/\.[^.\]]+(?=[^\]]*$)/g,_s=/^v-slot(:|$)|^#/,Ms=/[\r\n]/,Cs=/[ \f\t\r\n]+/g,$s=w(jo);function Ns(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:Rs(e),rawAttrsMap:{},parent:n,children:[]}}function Ts(t,e){ls=e.warn||Zr,hs=e.isPreTag||D,ps=e.mustUseProp||D,ms=e.getTagNamespace||D,e.isReservedTag,us=Xr(e.modules,"transformNode"),ds=Xr(e.modules,"preTransformNode"),fs=Xr(e.modules,"postTransformNode"),cs=e.delimiters;var n,r,i=[],o=!1!==e.preserveWhitespace,s=e.whitespace,a=!1,l=!1;function c(t){if(u(t),a||t.processed||(t=Ds(t,e)),i.length||t===n||n.if&&(t.elseif||t.else)&&Es(n,{exp:t.elseif,block:t}),r&&!t.forbidden)if(t.elseif||t.else)s=t,c=function(t){for(var e=t.length;e--;){if(1===t[e].type)return t[e];t.pop()}}(r.children),c&&c.if&&Es(c,{exp:s.elseif,block:s});else{if(t.slotScope){var o=t.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[o]=t}r.children.push(t),t.parent=r}var s,c;t.children=t.children.filter((function(t){return!t.slotScope})),u(t),t.pre&&(a=!1),hs(t.tag)&&(l=!1);for(var d=0;dl&&(a.push(o=t.slice(l,i)),s.push(JSON.stringify(o)));var c=Yr(r[1].trim());s.push("_s(".concat(c,")")),a.push({"@binding":c}),l=i+r[0].length}return l-1")+("true"===o?":(".concat(e,")"):":_q(".concat(e,",").concat(o,")"))),ii(t,"change","var $$a=".concat(e,",")+"$$el=$event.target,"+"$$c=$$el.checked?(".concat(o,"):(").concat(s,");")+"if(Array.isArray($$a)){"+"var $$v=".concat(r?"_n("+i+")":i,",")+"$$i=_i($$a,$$v);"+"if($$el.checked){$$i<0&&(".concat(ui(e,"$$a.concat([$$v])"),")}")+"else{$$i>-1&&(".concat(ui(e,"$$a.slice(0,$$i).concat($$a.slice($$i+1))"),")}")+"}else{".concat(ui(e,"$$c"),"}"),null,!0)}(t,r,i);else if("input"===o&&"radio"===s)!function(t,e,n){var r=n&&n.number,i=oi(t,"value")||"null";i=r?"_n(".concat(i,")"):i,Qr(t,"checked","_q(".concat(e,",").concat(i,")")),ii(t,"change",ui(e,i),null,!0)}(t,r,i);else if("input"===o||"textarea"===o)!function(t,e,n){var r=t.attrsMap.type,i=n||{},o=i.lazy,s=i.number,a=i.trim,l=!o&&"range"!==r,c=o?"change":"range"===r?"__r":"input",u="$event.target.value";a&&(u="$event.target.value.trim()");s&&(u="_n(".concat(u,")"));var d=ui(e,u);l&&(d="if($event.target.composing)return;".concat(d));Qr(t,"value","(".concat(e,")")),ii(t,c,d,null,!0),(a||s)&&ii(t,"blur","$forceUpdate()")}(t,r,i);else if(!F.isReservedTag(o))return ci(t,r,i),!1;return!0},text:function(t,e){e.value&&Qr(t,"textContent","_s(".concat(e.value,")"),e)},html:function(t,e){e.value&&Qr(t,"innerHTML","_s(".concat(e.value,")"),e)}},Ws={expectHTML:!0,modules:Ls,directives:Js,isPreTag:function(t){return"pre"===t},isUnaryTag:Fo,mustUseProp:er,canBeLeftOpenTag:Lo,isReservedTag:gr,getTagNamespace:vr,staticKeys:(Bs=Ls,Bs.reduce((function(t,e){return t.concat(e.staticKeys||[])}),[]).join(","))},Hs=w((function(t){return p("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(t?","+t:""))}));function Ks(t,e){t&&(Vs=Hs(e.staticKeys||""),qs=e.isReservedTag||D,Us(t),Ys(t,!1))}function Us(t){if(t.static=function(t){if(2===t.type)return!1;if(3===t.type)return!0;return!(!t.pre&&(t.hasBindings||t.if||t.for||m(t.tag)||!qs(t.tag)||function(t){for(;t.parent;){if("template"!==(t=t.parent).tag)return!1;if(t.for)return!0}return!1}(t)||!Object.keys(t).every(Vs)))}(t),1===t.type){if(!qs(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var e=0,n=t.children.length;e|^function(?:\s+[\w$]+)?\s*\(/,Zs=/\([^)]*?\);*$/,Xs=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Qs={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ta={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},ea=function(t){return"if(".concat(t,")return null;")},na={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:ea("$event.target !== $event.currentTarget"),ctrl:ea("!$event.ctrlKey"),shift:ea("!$event.shiftKey"),alt:ea("!$event.altKey"),meta:ea("!$event.metaKey"),left:ea("'button' in $event && $event.button !== 0"),middle:ea("'button' in $event && $event.button !== 1"),right:ea("'button' in $event && $event.button !== 2")};function ra(t,e){var n=e?"nativeOn:":"on:",r="",i="";for(var o in t){var s=ia(t[o]);t[o]&&t[o].dynamic?i+="".concat(o,",").concat(s,","):r+='"'.concat(o,'":').concat(s,",")}return r="{".concat(r.slice(0,-1),"}"),i?n+"_d(".concat(r,",[").concat(i.slice(0,-1),"])"):n+r}function ia(t){if(!t)return"function(){}";if(Array.isArray(t))return"[".concat(t.map((function(t){return ia(t)})).join(","),"]");var e=Xs.test(t.value),n=Gs.test(t.value),r=Xs.test(t.value.replace(Zs,""));if(t.modifiers){var i="",o="",s=[],a=function(e){if(na[e])o+=na[e],Qs[e]&&s.push(e);else if("exact"===e){var n=t.modifiers;o+=ea(["ctrl","shift","alt","meta"].filter((function(t){return!n[t]})).map((function(t){return"$event.".concat(t,"Key")})).join("||"))}else s.push(e)};for(var l in t.modifiers)a(l);s.length&&(i+=function(t){return"if(!$event.type.indexOf('key')&&"+"".concat(t.map(oa).join("&&"),")return null;")}(s)),o&&(i+=o);var c=e?"return ".concat(t.value,".apply(null, arguments)"):n?"return (".concat(t.value,").apply(null, arguments)"):r?"return ".concat(t.value):t.value;return"function($event){".concat(i).concat(c,"}")}return e||n?t.value:"function($event){".concat(r?"return ".concat(t.value):t.value,"}")}function oa(t){var e=parseInt(t,10);if(e)return"$event.keyCode!==".concat(e);var n=Qs[t],r=ta[t];return"_k($event.keyCode,"+"".concat(JSON.stringify(t),",")+"".concat(JSON.stringify(n),",")+"$event.key,"+"".concat(JSON.stringify(r))+")"}var sa={on:function(t,e){t.wrapListeners=function(t){return"_g(".concat(t,",").concat(e.value,")")}},bind:function(t,e){t.wrapData=function(n){return"_b(".concat(n,",'").concat(t.tag,"',").concat(e.value,",").concat(e.modifiers&&e.modifiers.prop?"true":"false").concat(e.modifiers&&e.modifiers.sync?",true":"",")")}},cloak:T},aa=function(t){this.options=t,this.warn=t.warn||Zr,this.transforms=Xr(t.modules,"transformCode"),this.dataGenFns=Xr(t.modules,"genData"),this.directives=$($({},sa),t.directives);var e=t.isReservedTag||D;this.maybeComponent=function(t){return!!t.component||!e(t.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function la(t,e){var n=new aa(e),r=t?"script"===t.tag?"null":ca(t,n):'_c("div")';return{render:"with(this){return ".concat(r,"}"),staticRenderFns:n.staticRenderFns}}function ca(t,e){if(t.parent&&(t.pre=t.pre||t.parent.pre),t.staticRoot&&!t.staticProcessed)return ua(t,e);if(t.once&&!t.onceProcessed)return da(t,e);if(t.for&&!t.forProcessed)return pa(t,e);if(t.if&&!t.ifProcessed)return fa(t,e);if("template"!==t.tag||t.slotTarget||e.pre){if("slot"===t.tag)return function(t,e){var n=t.slotName||'"default"',r=ya(t,e),i="_t(".concat(n).concat(r?",function(){return ".concat(r,"}"):""),o=t.attrs||t.dynamicAttrs?xa((t.attrs||[]).concat(t.dynamicAttrs||[]).map((function(t){return{name:k(t.name),value:t.value,dynamic:t.dynamic}}))):null,s=t.attrsMap["v-bind"];!o&&!s||r||(i+=",null");o&&(i+=",".concat(o));s&&(i+="".concat(o?"":",null",",").concat(s));return i+")"}(t,e);var n=void 0;if(t.component)n=function(t,e,n){var r=e.inlineTemplate?null:ya(e,n,!0);return"_c(".concat(t,",").concat(ma(e,n)).concat(r?",".concat(r):"",")")}(t.component,t,e);else{var r=void 0,i=e.maybeComponent(t);(!t.plain||t.pre&&i)&&(r=ma(t,e));var o=void 0,s=e.options.bindings;i&&s&&!1!==s.__isScriptSetup&&(o=function(t,e){var n=k(e),r=S(n),i=function(i){return t[e]===i?e:t[n]===i?n:t[r]===i?r:void 0},o=i("setup-const")||i("setup-reactive-const");if(o)return o;var s=i("setup-let")||i("setup-ref")||i("setup-maybe-ref");if(s)return s}(s,t.tag)),o||(o="'".concat(t.tag,"'"));var a=t.inlineTemplate?null:ya(t,e,!0);n="_c(".concat(o).concat(r?",".concat(r):"").concat(a?",".concat(a):"",")")}for(var l=0;l>>0}(s)):"",")")}(t,t.scopedSlots,e),",")),t.model&&(n+="model:{value:".concat(t.model.value,",callback:").concat(t.model.callback,",expression:").concat(t.model.expression,"},")),t.inlineTemplate){var o=function(t,e){var n=t.children[0];if(n&&1===n.type){var r=la(n,e.options);return"inlineTemplate:{render:function(){".concat(r.render,"},staticRenderFns:[").concat(r.staticRenderFns.map((function(t){return"function(){".concat(t,"}")})).join(","),"]}")}}(t,e);o&&(n+="".concat(o,","))}return n=n.replace(/,$/,"")+"}",t.dynamicAttrs&&(n="_b(".concat(n,',"').concat(t.tag,'",').concat(xa(t.dynamicAttrs),")")),t.wrapData&&(n=t.wrapData(n)),t.wrapListeners&&(n=t.wrapListeners(n)),n}function ga(t){return 1===t.type&&("slot"===t.tag||t.children.some(ga))}function va(t,e){var n=t.attrsMap["slot-scope"];if(t.if&&!t.ifProcessed&&!n)return fa(t,e,va,"null");if(t.for&&!t.forProcessed)return pa(t,e,va);var r="_empty_"===t.slotScope?"":String(t.slotScope),i="function(".concat(r,"){")+"return ".concat("template"===t.tag?t.if&&n?"(".concat(t.if,")?").concat(ya(t,e)||"undefined",":undefined"):ya(t,e)||"undefined":ca(t,e),"}"),o=r?"":",proxy:true";return"{key:".concat(t.slotTarget||'"default"',",fn:").concat(i).concat(o,"}")}function ya(t,e,n,r,i){var o=t.children;if(o.length){var s=o[0];if(1===o.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var a=n?e.maybeComponent(s)?",1":",0":"";return"".concat((r||ca)(s,e)).concat(a)}var l=n?function(t,e){for(var n=0,r=0;r':'

',Ma.innerHTML.indexOf(" ")>0}var Ta=!!W&&Na(!1),Da=!!W&&Na(!0),Aa=w((function(t){var e=wr(t);return e&&e.innerHTML})),Ea=Wn.prototype.$mount;function Pa(t){this.content=t}function Ia(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let t=0;i.text[t]==o.text[t];t++)n++;return n}if(i.content.size||o.content.size){let t=Ia(i.content,o.content,n+1);if(null!=t)return t}n+=i.nodeSize}else n+=i.nodeSize}}function Ra(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let t=0,e=Math.min(s.text.length,a.text.length);for(;t>1}},Pa.from=function(t){if(t instanceof Pa)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Pa(e)};class za{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let n=0;nt&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,t-i),Math.min(a.content.size,e-i),n,r+i)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let i="",o=!0;return this.nodesBetween(t,e,((s,a)=>{s.isText?(i+=s.text.slice(Math.max(t,a)-a,e-a),o=!n):s.isLeaf?(r?i+="function"==typeof r?r(s):r:s.type.spec.leafText&&(i+=s.type.spec.leafText(s)),o=!n):!o&&s.isBlock&&(i+=n,o=!0)}),0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),i=1);it)for(let i=0,o=0;ot&&((oe)&&(s=s.isText?s.cut(Math.max(0,t-o),Math.min(s.text.length,e-o)):s.cut(Math.max(0,t-o-1),Math.min(s.content.size,e-o-1))),n.push(s),r+=s.nodeSize),o=a}return new za(n,r)}cutByIndex(t,e){return t==e?za.empty:0==t&&e==this.content.length?this:new za(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),i=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new za(r,i)}addToStart(t){return new za([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new za(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;ethis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=t)return i==t||e>0?Fa(n+1,i):Fa(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((t=>t.toJSON())):null}static fromJSON(t,e){if(!e)return za.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new za(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return za.empty;let e,n=0;for(let r=0;rthis.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;et.type.rank-e.type.rank)),e}}Ba.none=[];class Va extends Error{}class qa{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=Wa(this.content,t+this.openStart,e);return n&&new qa(n,this.openStart,this.openEnd)}removeBetween(t,e){return new qa(Ja(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return qa.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new qa(za.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let i=t.firstChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new qa(t,n,r)}}function Ja(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Ja(o.content,e-i-1,n-i-1)))}function Wa(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=Wa(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function Ha(t,e,n){if(n.openStart>t.depth)throw new Va("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Va("Inconsistent open depths");return Ka(t,e,n,0)}function Ka(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0;i--)r=e.node(i).copy(za.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return Xa(o,Qa(t,i,s,e,r))}{let r=t.parent,i=r.content;return Xa(r,i.cut(0,t.parentOffset).append(n.content).append(i.cut(e.parentOffset)))}}return Xa(o,tl(t,e,r))}function Ua(t,e){if(!e.type.compatibleContent(t.type))throw new Va("Cannot join "+e.type.name+" onto "+t.type.name)}function Ya(t,e,n){let r=t.node(n);return Ua(r,e.node(n)),r}function Ga(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Za(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Ga(t.nodeAfter,r),o++));for(let a=o;ai&&Ya(t,e,i+1),s=r.depth>i&&Ya(n,r,i+1),a=[];return Za(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(Ua(o,s),Ga(Xa(o,Qa(t,e,n,r,i+1)),a)):(o&&Ga(Xa(o,tl(t,e,i+1)),a),Za(e,n,i,a),s&&Ga(Xa(s,tl(n,r,i+1)),a)),Za(r,null,i,a),new za(a)}function tl(t,e,n){let r=[];if(Za(null,t,n,r),t.depth>n){Ga(Xa(Ya(t,e,n+1),tl(t,e,n+1)),r)}return Za(e,null,n,r),new za(r)}qa.empty=new qa(za.empty,0,0);class el{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let i=0;i0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new ol(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let o=t;;){let{index:t,offset:e}=o.content.findIndex(i),s=i-e;if(n.push(o,t,r+e),!s)break;if(o=o.child(t),o.isText)break;i=s-1,r+=e+1}return new el(e,n,i)}static resolveCached(t,e){for(let r=0;rt&&this.nodesBetween(t,e,(t=>(n.isInSet(t.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),cl(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=za.empty,r=0,i=n.childCount){let o=this.contentMatchAt(t).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let a=r;at.type.name))}`);this.content.forEach((t=>t.check()))}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((t=>t.toJSON()))),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=za.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}al.prototype.text=void 0;class ll extends al{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):cl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new ll(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new ll(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function cl(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class ul{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new dl(t,e);if(null==n.next)return ul.empty;let r=fl(n);n.next&&n.err("Unexpected trailing text");let i=function(t){let e=Object.create(null);return n(yl(t,0));function n(r){let i=[];r.forEach((e=>{t[e].forEach((({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)}))}))}));let o=e[r.join(",")]=new ul(r.indexOf(t.length-1)>-1);for(let t=0;tt.to=e))}function o(t,e){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(o(n,e))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(e,s),i(o(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return i(o(t.expr,e),s),i(o(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(o(t.expr,e));if("range"==t.type){let s=e;for(let e=0;et.createAndFill())));for(let t=0;t=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let r=0;r{let r=n+(e.validEnd?"*":" ")+" ";for(let i=0;i"+t.indexOf(e.next[i].next);return r})).join("\n")}}ul.empty=new ul(!0);class dl{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function fl(t){let e=[];do{e.push(hl(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function hl(t){let e=[];do{e.push(pl(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function pl(t){let e=function(t){if(t.eat("(")){let e=fl(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let t=n[o];t.groups.indexOf(e)>-1&&i.push(t)}0==i.length&&t.err("No node type or group '"+e+"' found");return i}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=gl(t,e)}return e}function ml(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function gl(t,e){let n=ml(t),r=n;return t.eat(",")&&(r="}"!=t.next?ml(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function vl(t,e){return e-t}function yl(t,e){let n=[];return function e(r){let i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(let t=0;t-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;en[t]=new kl(t,e,r)));let r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class Sl{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Ol{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=xl(r.attrs),this.excluded=null;let i=bl(this.attrs);this.instance=i?new Ba(this,i):null}create(t=null){return!t&&this.instance?this.instance:new Ba(this,wl(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,i)=>n[t]=new Ol(t,r++,e,i))),n}removeFromSet(t){for(var e=0;e-1}}class _l{constructor(t){this.cached=Object.create(null);let e=this.spec={};for(let r in t)e[r]=t[r];e.nodes=Pa.from(t.nodes),e.marks=Pa.from(t.marks||{}),this.nodes=kl.compile(this.spec.nodes,this),this.marks=Ol.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let t=this.nodes[r],e=t.spec.content||"",i=t.spec.marks;t.contentMatch=n[e]||(n[e]=ul.parse(e,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.markSet="_"==i?null:i?Ml(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let r in this.marks){let t=this.marks[r],e=t.spec.excludes;t.excluded=null==e?[t]:""==e?[]:Ml(this,e.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof kl))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new ll(n,n.defaultAttrs,t,Ba.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return al.fromJSON(this,t)}markFromJSON(t){return Ba.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function Ml(t,e){let n=[];for(let r=0;r-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class Cl{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)})),this.normalizeLists=!this.tags.some((e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}parse(t,e={}){let n=new El(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new El(this,e,!0);return n.addAll(t,e.from,e.to),qa.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;rt.length&&(61!=o.charCodeAt(t.length)||o.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r{n(t=Il(t)),t.mark=r}))}for(let r in t.nodes){let e=t.nodes[r].spec.parseDOM;e&&e.forEach((t=>{n(t=Il(t)),t.node=r}))}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Cl(t,Cl.schemaRules(t)))}}const $l={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Nl={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Tl={ol:!0,ul:!0};function Dl(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class Al{constructor(t,e,n,r,i,o,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Ba.none,this.stashMarks=[],this.match=o||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(za.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=za.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(za.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;ethis.insertNode(t)));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(t,e,n){let r=e||0;for(let i=e?t.childNodes[e]:t.firstChild,o=null==n?null:t.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(i);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(t);if(o&&(!e||e.length>o.length)&&(e=o,n=i,!o.length))break;if(i.solid)break}if(!e)return!1;this.sync(n);for(let r=0;rthis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(t,s)=>{for(;t>=0;t--){let a=e[t];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=i;s--)if(o(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return o(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(t){let e=function(t,e){for(let n=0;n=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function Pl(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Il(t){let e={};for(let n in t)e[n]=t[n];return e}function Rl(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=t=>{o.push(t);for(let n=0;n{if(i.length||t.marks.length){let n=0,o=0;for(;n=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&zl.renderSpec(Fl(n),r(t,e))}static renderSpec(t,e,n=null){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let r,i=e[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?t.createElementNS(n,i):t.createElement(i),a=e[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let t in a)if(null!=a[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):s.setAttribute(t,a[t])}}for(let c=l;cl)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:o}=zl.renderSpec(t,i,n);if(s.appendChild(e),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new zl(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=jl(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return jl(t.marks)}}function jl(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Fl(t){return t.document||window.document}const Ll=Math.pow(2,16);function Bl(t){return 65535&t}class Vl{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class ql{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&ql.empty)return ql.empty}recover(t){let e=0,n=Bl(t);if(!this.inverted)for(let r=0;rt)break;let l=this.ranges[s+i],c=this.ranges[s+o],u=a+l;if(t<=u){let i=a+r+((l?t==a?-1:t==u?1:e:e)<0?0:c);if(n)return i;let o=t==(e<0?a:u)?null:s/3+(t-a)*Ll,d=t==a?2:t==u?1:4;return(e<0?t!=a:t!=u)&&(d|=8),new Vl(i,d,o)}r+=c-l}return n?t+r:new Vl(t+r,0,null)}touches(t,e){let n=0,r=Bl(e),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;st)break;let a=this.ranges[s+i];if(t<=e+a&&s==3*r)return!0;n+=this.ranges[s+o]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new Jl;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;ni&&et.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),r),e.openStart,e.openEnd);return Kl.fromReplace(t,this.from,this.to,i)}invert(){return new Gl(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new Yl(e.pos,n.pos,this.mark)}merge(t){return t instanceof Yl&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Yl(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Yl(e.from,e.to,t.markFromJSON(e.mark))}}Hl.jsonID("addMark",Yl);class Gl extends Hl{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new qa(Ul(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return Kl.fromReplace(t,this.from,this.to,n)}invert(){return new Yl(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new Gl(e.pos,n.pos,this.mark)}merge(t){return t instanceof Gl&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Gl(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Gl(e.from,e.to,t.markFromJSON(e.mark))}}Hl.jsonID("removeMark",Gl);class Zl extends Hl{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return Kl.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return Kl.fromReplace(t,this.pos,this.pos+1,new qa(za.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;nn.pos?null:new tc(e.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new tc(e.from,e.to,e.gapFrom,e.gapTo,qa.fromJSON(t,e.slice),e.insert,!!e.structure)}}function ec(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let t=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,i--}}return!1}function nc(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function rc(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(no;c--,u--){let t=i.node(c),e=i.index(c);if(t.type.spec.isolating)return!1;let n=t.content.cutByIndex(e,t.childCount),o=r&&r[u]||t;if(o!=t&&(n=n.replaceChild(0,o.type.create(o.attrs))),!t.canReplace(e+1,t.childCount)||!o.type.validContent(n))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function ac(t,e){let n=t.resolve(e),r=n.index();return i=n.nodeBefore,o=n.nodeAfter,!(!i||!o||i.isLeaf||!i.canAppend(o))&&n.parent.canReplace(r,r+1);var i,o}function lc(t,e,n=e,r=qa.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return cc(i,o,r)?new Ql(e,n,r):new uc(i,o,r).fit()}function cc(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}Hl.jsonID("replaceAround",tc);class uc{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=za.empty;for(let r=0;r<=t.depth;r++){let e=t.node(r);this.frontier.push({type:e.type,match:e.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=za.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new qa(i,o,s);return t>-1?new tc(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new Ql(n.pos,r.pos,a):null}findFittable(){for(let t=1;t<=2;t++)for(let e=this.unplaced.openStart;e>=0;e--){let n,r=null;e?(r=hc(this.unplaced.content,e-1).firstChild,n=r.content):n=this.unplaced.content;let i=n.firstChild;for(let o=this.depth;o>=0;o--){let n,{type:s,match:a}=this.frontier[o],l=null;if(1==t&&(i?a.matchType(i.type)||(l=a.fillBefore(za.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:e,frontierDepth:o,parent:r,inject:l};if(2==t&&i&&(n=a.findWrapping(i.type)))return{sliceDepth:e,frontierDepth:o,parent:r,wrap:n};if(r&&a.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=hc(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new qa(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=hc(t,e);if(r.childCount<=1&&e>0){let i=t.size-e<=e+r.size;this.unplaced=new qa(dc(t,e-1,1),e-1,i?e-1:n)}else this.unplaced=new qa(dc(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:i}){for(;this.depth>e;)this.closeFrontierNode();if(i)for(let p=0;p1||0==a||t.content.size)&&(u=e,c.push(pc(t.mark(d.allowedMarks(t.marks)),1==l?a:0,l==s.childCount?f:-1)))}let h=l==s.childCount;h||(f=-1),this.placed=fc(this.placed,e,za.from(c)),this.frontier[e].match=u,h&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let p=0,m=s;p1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],i=e=0;n--){let{match:e,type:r}=this.frontier[n],i=mc(t,n,r,e,!0);if(!i||i.childCount)continue t}return{depth:e,fit:o,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=fc(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=fc(this.placed,this.depth,za.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(za.empty,!0);t.childCount&&(this.placed=fc(this.placed,this.frontier.length,t))}}function dc(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(dc(t.firstChild.content,e-1,n)))}function fc(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(fc(t.lastChild.content,e-1,n)))}function hc(t,e){for(let n=0;n1&&(r=r.replaceChild(0,pc(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(za.empty,!0)))),t.copy(r)}function mc(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(t,e,n){for(let r=n;rr){let e=i.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(za.empty,!0))}return t}function yc(t,e){let n=[];for(let r=Math.min(t.depth,e.depth);r>=0;r--){let i=t.start(r);if(ie.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(i==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==i-1)&&n.push(r)}return n}class bc extends Hl{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return Kl.fail("No node at attribute step's position");let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,null,e.marks);return Kl.fromReplace(t,this.pos,this.pos+1,new qa(za.from(r),0,e.isLeaf?0:1))}getMap(){return ql.empty}invert(t){return new bc(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new bc(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new bc(e.pos,e.attr,e.value)}}Hl.jsonID("attr",bc);let wc=class extends Error{};wc=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(wc.prototype=Object.create(Error.prototype)).constructor=wc,wc.prototype.name="TransformError";class xc{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Jl}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new wc(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=qa.empty){let r=lc(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new qa(za.from(n),0,0))}delete(t,e){return this.replace(t,e,qa.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(cc(i,o,r))return t.step(new Ql(e,n,r));let s=yc(i,t.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let f=i.depth,h=i.pos-1;f>0;f--,h--){let t=i.node(f).type.spec;if(t.defining||t.definingAsContext||t.isolating)break;s.indexOf(f)>-1?a=f:i.before(f)==h&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let t=f.firstChild;if(c.push(t),h==r.openStart)break;f=t.content}for(let f=u-1;f>=0;f--){let t=c[f].type,e=gc(t);if(e&&i.node(l).type!=t)u=f;else if(e||!t.isTextblock)break}for(let f=r.openStart;f>=0;f--){let e=(f+u+1)%(r.openStart+1),a=c[e];if(a)for(let c=0;c=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let t=s[f];t<0||(e=i.before(t),n=o.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let t=r.index(i);if(r.node(i).canReplaceWith(t,t,n))return r.before(i+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let t=r.indexAfter(i);if(r.node(i).canReplaceWith(t,t,n))return r.after(i+1);if(t0&&(n||r.node(e-1).canReplace(r.index(e-1),i.indexAfter(e-1))))return t.delete(r.before(e),i.after(e))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=za.empty,d=0;for(let p=o,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,u=za.from(r.node(p).copy(u)),d++):l--;let f=za.empty,h=0;for(let p=o,m=!1;p>n;p--)m||i.after(p+1)=0;s--){if(r.size){let t=n[s].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=za.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new tc(i,o,i,o,new qa(r,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,r=null){return function(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,((e,n)=>{if(e.isTextblock&&!e.hasMarkup(r,i)&&function(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(t.doc,t.mapping.slice(o).map(n),r)){t.clearIncompatible(t.mapping.slice(o).map(n,1),r);let s=t.mapping.slice(o),a=s.map(n,1),l=s.map(n+e.nodeSize,1);return t.step(new tc(a,l,a+1,l-1,new qa(za.from(r.create(i,null,e.marks)),0,0),1,!0)),!1}}))}(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r=[]){return function(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new tc(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new qa(za.from(s),0,0),1,!0))}(this,t,e,n,r),this}setNodeAttribute(t,e,n){return this.step(new bc(t,e,n)),this}addNodeMark(t,e){return this.step(new Zl(t,e)),this}removeNodeMark(t,e){if(!(e instanceof Ba)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new Xl(t,e)),this}split(t,e=1,n){return function(t,e,n=1,r){let i=t.doc.resolve(e),o=za.empty,s=za.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=za.from(i.node(a).copy(o));let t=r&&r[c];s=za.from(t?t.type.create(t.attrs,s):i.node(a).copy(s))}t.step(new Ql(e,e,new qa(o.append(s),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,r){let i,o,s=[],a=[];t.doc.nodesBetween(e,n,((t,l,c)=>{if(!t.isInline)return;let u=t.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,e),d=Math.min(l+t.nodeSize,n),f=r.addToSet(u);for(let t=0;tt.step(e))),a.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,((t,s)=>{if(!t.isInline)return;o++;let a=null;if(r instanceof Ol){let e,n=t.marks;for(;e=r.isInSet(n);)(a||(a=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(a=[r]):a=t.marks;if(a&&a.length){let r=Math.min(s+t.nodeSize,n);for(let t=0;tt.step(new Gl(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return function(t,e,n,r=n.contentMatch){let i=t.doc.nodeAt(e),o=[],s=e+1;for(let a=0;a=0;a--)t.step(o[a])}(this,t,e,n),this}}const kc=Object.create(null);class Sc{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new Oc(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e=0;i--){let r=e<0?Ec(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):Ec(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(r)return r}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new Dc(t.node(0))}static atStart(t){return Ec(t,t,0,0,1)||new Dc(t)}static atEnd(t){return Ec(t,t,t.content.size,t.childCount,-1)||new Dc(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=kc[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in kc)throw new RangeError("Duplicate use of selection JSON ID "+t);return kc[t]=e,e.prototype.jsonID=t,e}getBookmark(){return Cc.between(this.$anchor,this.$head).getBookmark()}}Sc.prototype.visible=!0;class Oc{constructor(t,e){this.$from=t,this.$to=e}}let _c=!1;function Mc(t){_c||t.parent.inlineContent||(_c=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Cc extends Sc{constructor(t,e=t){Mc(t),Mc(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return Sc.near(n);let r=t.resolve(e.map(this.anchor));return new Cc(r.parent.inlineContent?r:n,n)}replace(t,e=qa.empty){if(super.replace(t,e),e==qa.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof Cc&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new $c(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Cc(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=Sc.findFrom(e,n,!0)||Sc.findFrom(e,-n,!0);if(!t)return Sc.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(Sc.findFrom(t,-n,!0)||Sc.findFrom(t,n,!0)).$anchor).posnew Dc(t)};function Ec(t,e,n,r,i,o=!1){if(e.inlineContent)return Cc.create(t,n);for(let s=r-(i>0?0:1);i>0?s=0;s+=i){let r=e.child(s);if(r.isAtom){if(!o&&Nc.isSelectable(r))return Nc.create(t,n-(i<0?r.nodeSize:0))}else{let e=Ec(t,r,n+i,i<0?r.childCount:0,i,o);if(e)return e}n+=r.nodeSize*i}return null}function Pc(t,e,n){let r=t.steps.length-1;if(r{null==i&&(i=r)})),t.setSelection(Sc.near(t.doc.resolve(i),n)))}class Ic extends xc{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return Ba.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Ba.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let t=this.doc.resolve(e);i=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.setSelection(Sc.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Rc(t,e){return e&&t?t.bind(e):t}class zc{constructor(t,e,n){this.name=t,this.init=Rc(e.init,n),this.apply=Rc(e.apply,n)}}const jc=[new zc("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new zc("selection",{init:(t,e)=>t.selection||Sc.atStart(e.doc),apply:t=>t.selection}),new zc("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new zc("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class Fc{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=jc.slice(),e&&e.forEach((t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new zc(t.key,t.spec.state,t))}))}}class Lc{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;nt.toJSON()))),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],i=r.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new Fc(t.schema,t.plugins),i=new Lc(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=al.fromJSON(t.schema,e.doc);else if("selection"==r.name)i.selection=Sc.fromJSON(i.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(i.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,o))return void(i[r.name]=a.fromJSON.call(s,t,e[o],i))}i[r.name]=r.init(t,i)}})),i}}function Bc(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):"handleDOMEvents"==r&&(i=Bc(i,e,{})),n[r]=i}return n}class Vc{constructor(t){this.spec=t,this.props={},t.props&&Bc(t.props,this,this.props),this.key=t.key?t.key.key:Jc("plugin")}getState(t){return t[this.key]}}const qc=Object.create(null);function Jc(t){return t in qc?t+"$"+ ++qc[t]:(qc[t]=0,t+"$")}class Wc{constructor(t="key"){this.key=Jc(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Hc=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},Kc=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let Uc=null;const Yc=function(t,e,n){let r=Uc||(Uc=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},Gc=function(t,e,n,r){return n&&(Xc(t,e,n,r,-1)||Xc(t,e,n,r,1))},Zc=/^(img|br|input|textarea|hr)$/i;function Xc(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Qc(t))){let n=t.parentNode;if(!n||1!=n.nodeType||tu(t)||Zc.test(t.nodeName)||"false"==t.contentEditable)return!1;e=Hc(t)+(i<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(i<0?-1:0)]).contentEditable)return!1;e=i<0?Qc(t):0}}}function Qc(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function tu(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const eu=function(t){return t.focusNode&&Gc(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function nu(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const ru="undefined"!=typeof navigator?navigator:null,iu="undefined"!=typeof document?document:null,ou=ru&&ru.userAgent||"",su=/Edge\/(\d+)/.exec(ou),au=/MSIE \d/.exec(ou),lu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ou),cu=!!(au||lu||su),uu=au?document.documentMode:lu?+lu[1]:su?+su[1]:0,du=!cu&&/gecko\/(\d+)/i.test(ou);du&&(/Firefox\/(\d+)/.exec(ou)||[0,0])[1];const fu=!cu&&/Chrome\/(\d+)/.exec(ou),hu=!!fu,pu=fu?+fu[1]:0,mu=!cu&&!!ru&&/Apple Computer/.test(ru.vendor),gu=mu&&(/Mobile\/\w+/.test(ou)||!!ru&&ru.maxTouchPoints>2),vu=gu||!!ru&&/Mac/.test(ru.platform),yu=/Android \d/.test(ou),bu=!!iu&&"webkitFontSmoothing"in iu.documentElement.style,wu=bu?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function xu(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function ku(t,e){return"number"==typeof t?t:t[e]}function Su(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Ou(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Kc(s)){if(1!=s.nodeType)continue;let t=s,n=t==o.body,a=n?xu(o):Su(t),l=0,c=0;if(e.topa.bottom-ku(r,"bottom")&&(c=e.bottom-a.bottom+ku(i,"bottom")),e.lefta.right-ku(r,"right")&&(l=e.right-a.right+ku(i,"right")),l||c)if(n)o.defaultView.scrollBy(l,c);else{let n=t.scrollLeft,r=t.scrollTop;c&&(t.scrollTop+=c),l&&(t.scrollLeft+=l);let i=t.scrollLeft-n,o=t.scrollTop-r;e={left:e.left-i,top:e.top-o,right:e.right-i,bottom:e.bottom-o}}if(n)break}}function _u(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Kc(r));return e}function Mu(t,e){for(let n=0;n=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);let t=d.left>e.left?d.left-e.left:d.right=(d.left+d.right)/2?1:0));continue}}!n&&(e.left>=d.right&&e.top>=d.top||e.left>=d.left&&e.top>=d.bottom)&&(o=c+1)}}return n&&3==n.nodeType?function(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(n.left+n.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:t,offset:o}:$u(n,r)}function Nu(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Tu(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}n==t.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?o=t.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(o=function(t,e,n,r){let i=-1;for(let o=e;o!=t.dom;){let e=t.docView.nearestDesc(o,!0);if(!e)return null;if(e.node.isBlock&&e.parent){let t=e.dom.getBoundingClientRect();if(t.left>r.left||t.top>r.top)i=e.posBefore;else{if(!(t.right-1?i:t.docView.posFromDOM(e,n,1)}(t,n,i,e))}null==o&&(o=function(t,e,n){let{node:r,offset:i}=$u(e,n),o=-1;if(1==r.nodeType&&!r.firstChild){let t=r.getBoundingClientRect();o=t.left!=t.right&&n.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}(t,s,e));let a=t.docView.nearestDesc(s,!0);return{pos:o,inside:a?a.posAtStart-a.border:-1}}function Au(t,e){let n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}const Eu=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Pu(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=bu||du;if(3==r.nodeType){if(!s||!Eu.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let t=i,e=i,o=n<0?1:-1;return n<0&&!i?(e++,o=-1):n>=0&&i==r.nodeValue.length?(t--,o=1):n<0?t--:e++,Iu(Au(Yc(r,t,e),1),o<0)}{let t=Au(Yc(r,i,i),n);if(du&&i&&/\s/.test(r.nodeValue[i-1])&&i=0)}if(null==o&&i&&(n<0||i==Qc(r))){let t=r.childNodes[i-1],e=3==t.nodeType?Yc(t,Qc(t)-(s?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return Iu(Au(e,1),!1)}if(null==o&&i=0)}function Iu(t,e){if(0==t.width)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ru(t,e){if(0==t.height)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function zu(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}const ju=/[\u0590-\u08ac]/;let Fu=null,Lu=null,Bu=!1;function Vu(t,e,n){return Fu==e&&Lu==n?Bu:(Fu=e,Lu=n,Bu="up"==n||"down"==n?function(t,e,n){let r=e.selection,i="up"==n?r.$from:r.$to;return zu(t,e,(()=>{let{node:e}=t.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=t.docView.nearestDesc(e,!0);if(!n)break;if(n.node.isBlock){e=n.dom;break}e=n.dom.parentNode}let r=Pu(t,i.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=Yc(t,0,t.nodeValue.length).getClientRects()}for(let t=0;ti.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(t,e,n):function(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return ju.test(r.parent.textContent)&&a.modify?zu(t,e,(()=>{let{focusNode:e,focusOffset:i,anchorNode:o,anchorOffset:s}=t.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:u,focusOffset:d}=t.domSelectionRange(),f=u&&!c.contains(1==u.nodeType?u:u.parentNode)||e==u&&i==d;try{a.collapse(o,s),e&&(e!=o||i!=s)&&a.extend&&a.extend(e,i)}catch(h){}return null!=l&&(a.caretBidiLevel=l),f})):"left"==n||"backward"==n?o:s}(t,e,n))}class qu{constructor(t,e,n,r){this.parent=t,this.children=e,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;eHc(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!1;break}if(e.previousSibling)break}if(null==r&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!0;break}if(e.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let n=!0,r=t;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!e||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==t.nodeType?t:t.parentNode):i==t))return o;n=!1}}}getDesc(t){let e=t.pmViewDesc;for(let n=e;n;n=n.parent)if(n==this)return e}posFromDOM(t,e,n){for(let r=t;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;et||e instanceof Gu){i=t-o;break}o=n}if(i)return this.children[r].domFromPos(i-this.children[r].border,e);for(;r&&!(n=this.children[r-1]).size&&n instanceof Ju&&n.side>=0;r--);if(e<=0){let t,n=!0;for(;t=r?this.children[r-1]:null,t&&t.dom.parentNode!=this.contentDOM;r--,n=!1);return t&&e&&n&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?Hc(t.dom)+1:0}}{let t,n=!0;for(;t=r=i&&e<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(t,e,i);t=o;for(let e=s;e>0;e--){let n=this.children[e-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Hc(n.dom)+1;break}t-=n.size}-1==r&&(r=0)}if(r>-1&&(a>e||s==this.children.length-1)){e=a;for(let t=s+1;th&&oe){let t=s;s=a,a=t}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,r=0;r=n:tn){let r=n+i.border,s=o-i.border;if(t>=r&&e<=s)return this.dirty=t==n||e==o?2:1,void(t!=r||e!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(t-r,e-r):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let n=1==t?2:1;e.dirtyi?i.parent?i.parent.posBeforeChild(i):void 0:r))),!e.type.spec.raw){if(1!=o.nodeType){let t=document.createElement("span");t.appendChild(o),o=t}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(t,[],o,null),this.widget=e,this.widget=e,i=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Wu extends qu{constructor(t,e,n,r){super(t,[],e,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class Hu extends qu{constructor(t,e,n,r){super(t,[],n,r),this.mark=e}static create(t,e,n,r){let i=r.nodeViews[e.type.name],o=i&&i(e,r,n);return o&&o.dom||(o=zl.renderSpec(document,e.type.spec.toDOM(e,n))),new Hu(t,e,o.dom,o.contentDOM||o.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),0!=this.dirty){let t=this.parent;for(;!t.node;)t=t.parent;t.dirty0&&(i=cd(i,0,t,n));for(let s=0;ss?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),c=l&&l.dom,u=l&&l.contentDOM;if(e.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(e.text);else c||({dom:c,contentDOM:u}=zl.renderSpec(document,e.type.spec.toDOM(e)));u||e.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),e.type.spec.draggable&&(c.draggable=!0));let d=c;return c=id(c,n,e),l?s=new Zu(t,e,n,r,c,u||null,d,l,i,o+1):e.isText?new Yu(t,e,n,r,c,d,i):new Ku(t,e,n,r,c,u||null,d,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>za.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,n){return 0==this.dirty&&t.eq(this.node)&&od(e,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let n=this.node.inlineContent,r=e,i=t.composing?this.localCompositionInfo(t,e):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new ad(this,o&&o.node,t);!function(t,e,n,r){let i=e.locals(t),o=0;if(0==i.length){for(let n=0;no;)a.push(i[s++]);let f=o+u.nodeSize;if(u.isText){let t=f;s!t.inline)):a.slice(),e.forChild(o,u),d),o=f}}(this.node,this.innerDeco,((e,i,o)=>{e.spec.marks?a.syncToMarks(e.spec.marks,n,t):e.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?Ba.none:this.node.child(i).marks,n,t),a.placeWidget(e,t,r)}),((e,o,l,c)=>{let u;a.syncToMarks(e.marks,n,t),a.findNodeMatch(e,o,l,c)||s&&t.state.selection.from>r&&t.state.selection.to-1&&a.updateNodeAt(e,o,l,u,t)||a.updateNextNode(e,o,l,t,c)||a.addNode(e,o,l,t,r),r+=e.nodeSize})),a.syncToMarks([],n,t),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(t,o),Xu(this.contentDOM,this.children,t),gu&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}localCompositionInfo(t,e){let{from:n,to:r}=t.state.selection;if(!(t.state.selection instanceof Cc)||ne+this.node.content.size)return null;let i=t.domSelectionRange(),o=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];e=Qc(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e=n){let t=a=0&&t+e.length+a>=n)return a+t;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}(this.node.content,t,n-e,r-e);return i<0?null:{node:o,pos:i,text:t}}return{node:o,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:n,text:r}){if(this.getDesc(e))return;let i=e;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new Wu(this,i,e,r);t.input.compositionNodes.push(o),this.children=cd(this.children,n,n+r.length,t,o)}update(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)}updateInner(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(od(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=nd(this.dom,this.nodeDOM,ed(this.outerDeco,this.node,e),ed(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Uu(t,e,n,r,i){return id(r,e,t),new Ku(void 0,t,e,n,r,r,r,i,0)}class Yu extends Ku{constructor(t,e,n,r,i,o,s){super(t,e,n,r,i,null,o,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,n){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,n)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,n){let r=this.node.cut(t,e),i=document.createTextNode(r.text);return new Yu(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class Gu extends qu{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Zu extends Ku{constructor(t,e,n,r,i,o,s,a,l,c){super(t,e,n,r,i,o,s,l,c),this.spec=a}update(t,e,n,r){if(3==this.dirty)return!1;if(this.spec.update){let i=this.spec.update(t,e,n);return i&&this.updateInner(t,e,n,r),i}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,r){this.spec.setSelection?this.spec.setSelection(t,e,n):super.setSelection(t,e,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function Xu(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o0;){let a;for(;;)if(r){let t=n.children[r-1];if(!(t instanceof Hu)){a=t,r--;break}n=t,r=t.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n>1,o=Math.min(i,t.length);for(;r-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=Hu.create(this.top,t[i],e,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(t,e,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(t,e,n))o=this.top.children.indexOf(i,this.index);else for(let s=this.index,a=Math.min(this.top.children.length,s+5);s=n||u<=e?o.push(l):(cn&&o.push(l.slice(n-c,l.size,r)))}return o}function ud(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(eu(n)){for(a=c;i&&!i.node;)i=i.parent;let t=i.node;if(i&&t.isAtom&&Nc.isSelectable(t)&&i.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,i=e==Qc(t);r||i;){if(t==n)return!0;let e=Hc(t);if(!(t=t.parentNode))return!1;r=r&&0==e,i=i&&e==Qc(t)}}(n.focusNode,n.focusOffset,i.dom))){let t=i.posBefore;l=new Nc(s==t?c:r.resolve(t))}}else{let e=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(e<0)return null;a=r.resolve(e)}if(!l){l=bd(t,a,c,"pointer"==e||t.state.selection.head{n.anchorNode==r&&n.anchorOffset==i||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{dd(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const hd=mu||hu&&pu<63;function pd(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=rr(t,e,n)))||Cc.between(e,n,r)}function wd(t){return!(t.editable&&!t.hasFocus())&&xd(t)}function xd(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(n){return!1}}function kd(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&Sc.findFrom(o,e)}function Sd(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Od(t,e,n){let r=t.state.selection;if(!(r instanceof Cc)){if(r instanceof Nc&&r.node.isInline)return Sd(t,new Cc(e>0?r.$to:r.$from));{let n=kd(t.state,e);return!!n&&Sd(t,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){let n=kd(t.state,e);return!!(n&&n instanceof Nc)&&Sd(t,n)}if(!(vu&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=e<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=t.docView.descAt(s))&&!n.contentDOM)&&(Nc.isSelectable(o)?Sd(t,new Nc(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):!!bu&&Sd(t,new Cc(t.state.doc.resolve(e<0?s:s+o.nodeSize))))}}function _d(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Md(t){let e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Cd(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(du&&1==n.nodeType&&r<_d(n)&&Md(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(Md(t))i=n,o=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(Nd(n))break;{let e=n.previousSibling;for(;e&&Md(e);)i=n.parentNode,o=Hc(e),e=e.previousSibling;if(e)n=e,r=_d(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Td(t,n,r):i&&Td(t,i,o)}function $d(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=_d(n);for(;;)if(r{t.state==i&&fd(t)}),50)}function Dd(t,e,n){let r=t.state.selection;if(r instanceof Cc&&!r.empty||n.indexOf("s")>-1)return!1;if(vu&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=kd(t.state,e);if(n&&n instanceof Nc)return Sd(t,n)}if(!i.parent.inlineContent){let n=e<0?i:o,s=r instanceof Dc?Sc.near(n,e):Sc.findFrom(n,e);return!!s&&Sd(t,s)}return!1}function Ad(t,e){if(!(t.state.selection instanceof Cc))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=t.state.tr;return e<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),t.dispatch(r),!0}return!1}function Ed(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Pd(t,e){let n=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||vu&&72==n&&"c"==r?Ad(t,-1)||Cd(t):46==n||vu&&68==n&&"c"==r?Ad(t,1)||$d(t):13==n||27==n||(37==n||vu&&66==n&&"c"==r?Od(t,-1,r)||Cd(t):39==n||vu&&70==n&&"c"==r?Od(t,1,r)||$d(t):38==n||vu&&80==n&&"c"==r?Dd(t,-1,r)||Cd(t):40==n||vu&&78==n&&"c"==r?function(t){if(!mu||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;Ed(t,n,"true"),setTimeout((()=>Ed(t,n,"false")),20)}return!1}(t)||Dd(t,1,r)||$d(t):r==(vu?"m":"c")&&(66==n||73==n||89==n||90==n))}function Id(t,e){t.someProp("transformCopied",(n=>{e=n(e,t)}));let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let s=t.someProp("clipboardSerializer")||zl.fromSchema(t.state.schema),a=Wd(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,d=0;for(;u&&1==u.nodeType&&(c=qd[u.nodeName.toLowerCase()]);){for(let t=c.length-1;t>=0;t--){let e=a.createElement(c[t]);for(;l.firstChild;)e.appendChild(l.firstChild);l.appendChild(e),d++}u=l.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:l,text:t.someProp("clipboardTextSerializer",(n=>n(e,t)))||e.content.textBetween(0,e.content.size,"\n\n")}}function Rd(t,e,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!e)return null;let l=e&&(r||a||!n);if(l){if(t.someProp("transformPastedText",(n=>{e=n(e,a||r,t)})),a)return e?new qa(za.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):qa.empty;let n=t.someProp("clipboardTextParser",(n=>n(e,i,r,t)));if(n)s=n;else{let n=i.marks(),{schema:r}=t.state,s=zl.fromSchema(r);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=o.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(r.text(t,n)))}))}}else t.someProp("transformPastedHTML",(e=>{n=e(n,t)})),o=function(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=Wd().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t);(n=i&&qd[i[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"")).reverse().join(""));if(r.innerHTML=t,n)for(let o=0;o0;d--){let t=o.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;o=t}if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||Cl.fromSchema(t.state.schema);s=e.parseSlice(o,{preserveWhitespace:!(!l&&!u),context:i,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||zd.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(u)s=function(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(Tg){return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=n.length-2;a>=0;a-=2){let t=r.nodes[n[a]];if(!t||t.hasRequiredAttrs())break;i=za.from(t.create(n[a+1],i)),o++,s++}return new qa(i,o,s)}(Vd(s,+u[1],+u[2]),u[4]);else if(s=qa.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,i=e.node(n).contentMatchAt(e.index(n)),o=[];if(t.forEach((t=>{if(!o)return;let e,n=i.findWrapping(t.type);if(!n)return o=null;if(e=o.length&&r.length&&Fd(n,r,t,o[o.length-1],0))o[o.length-1]=e;else{o.length&&(o[o.length-1]=Ld(o[o.length-1],r.length));let e=jd(t,n);o.push(e),i=i.matchType(e.type),r=n}})),o)return za.from(o)}return t}(s.content,i),!0),s.openStart||s.openEnd){let t=0,e=0;for(let n=s.content.firstChild;t{s=e(s,t)})),s}const zd=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function jd(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,za.from(t));return t}function Fd(t,e,n,r,i){if(i=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,t.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(za.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Vd(t,e,n){return e{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=e=>Xd(t,e))}))}function Xd(t,e){return t.someProp("handleDOMEvents",(n=>{let r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function Qd(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function tf(t){return{left:t.clientX,top:t.clientY}}function ef(t,e,n,r,i){if(-1==r)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,(e=>s>o.depth?e(t,n,o.nodeAfter,o.before(s),i,!0):e(t,n,o.node(s),o.before(s),i,!1))))return!0;return!1}function nf(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function rf(t,e,n,r,i){return ef(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(n=>n(t,e,r)))||(i?function(t,e){if(-1==e)return!1;let n,r,i=t.state.selection;i instanceof Nc&&(n=i.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let t=s>o.depth?o.nodeAfter:o.node(s);if(Nc.isSelectable(t)){r=n&&i.$from.depth>0&&s>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(s);break}}return null!=r&&(nf(t,Nc.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&Nc.isSelectable(r))&&(nf(t,new Nc(n),"pointer"),!0)}(t,n))}function of(t,e,n,r){return ef(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function sf(t,e,n,r){return ef(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(n=>n(t,e,r)))||function(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(nf(t,Cc.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let e=o>i.depth?i.nodeAfter:i.node(o),n=i.before(o);if(e.inlineContent)nf(t,Cc.create(r,n+1,n+1+e.content.size),"pointer");else{if(!Nc.isSelectable(e))continue;nf(t,Nc.create(r,n),"pointer")}return!0}}(t,n,r)}function af(t){return pf(t)}Kd.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!uf(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!yu||!hu||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!gu||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||Pd(t,n)?n.preventDefault():Gd(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,nu(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},Kd.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},Kd.keypress=(t,e)=>{let n=e;if(uf(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||vu&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof Cc&&r.$from.sameParent(r.$to))){let e=String.fromCharCode(n.charCode);t.someProp("handleTextInput",(n=>n(t,r.$from.pos,r.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const lf=vu?"metaKey":"ctrlKey";Hd.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=af(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[lf]&&("singleClick"==t.input.lastClick.type?o="doubleClick":"doubleClick"==t.input.lastClick.type&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(tf(n));s&&("singleClick"==o?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new cf(t,s,n,!!r)):("doubleClick"==o?of:sf)(t,s.pos,s.inside,n)?n.preventDefault():Gd(t,"pointer"))};class cf{constructor(t,e,n,r){let i,o;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[lf],this.allowDefault=n.shiftKey,e.inside>-1)i=t.state.doc.nodeAt(e.inside),o=e.inside;else{let n=t.state.doc.resolve(e.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?t.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=t.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof Nc&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!du||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Gd(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>fd(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(tf(t))),this.updateAllowDefault(t),this.allowDefault||!e?Gd(this.view,"pointer"):rf(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||mu&&this.mightDrag&&!this.mightDrag.node.isAtom||hu&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(nf(this.view,Sc.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):Gd(this.view,"pointer")}move(t){this.updateAllowDefault(t),Gd(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function uf(t,e){return!!t.composing||!!(mu&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}Hd.touchstart=t=>{t.input.lastTouch=Date.now(),af(t),Gd(t,"pointer")},Hd.touchmove=t=>{t.input.lastTouch=Date.now(),Gd(t,"pointer")},Hd.contextmenu=t=>af(t);const df=yu?5e3:-1;function ff(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>pf(t)),e))}function hf(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function pf(t,e=!1){if(!(yu&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),hf(t),e||t.docView&&t.docView.dirty){let e=ud(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}Kd.compositionstart=Kd.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||n.marks(),pf(t,!0),t.markCursor=null;else if(pf(t),du&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,r=e.focusOffset;n&&1==n.nodeType&&0!=r;){let e=r<0?n.lastChild:n.childNodes[r-1];if(!e)break;if(3==e.nodeType){t.domSelection().collapse(e,e.nodeValue.length);break}n=e,r=-1}}t.input.composing=!0}ff(t,df)},Kd.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,ff(t,20))};const mf=cu&&uu<15||gu&&wu<604;function gf(t,e,n,r){let i=Rd(t,e,n,t.input.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,r,i||qa.empty))))return!0;if(!i)return!1;let o=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(i),s=o?t.state.tr.replaceSelectionWith(o,t.input.shiftKey):t.state.tr.replaceSelection(i);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Hd.copy=Kd.cut=(t,e)=>{let n=e,r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=mf?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Id(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Kd.paste=(t,e)=>{let n=e;if(t.composing&&!yu)return;let r=mf?null:n.clipboardData;r&&gf(t,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?gf(t,r.value,null,e):gf(t,r.textContent,r.innerHTML,e)}),50)}(t,n)};class vf{constructor(t,e){this.slice=t,this.move=e}}const yf=vu?"altKey":"ctrlKey";Hd.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(tf(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof Nc?i.to-1:i.to));else if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Nc.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&t.dispatch(t.state.tr.setSelection(Nc.create(t.state.doc,e.posBefore)))}let s=t.state.selection.content(),{dom:a,text:l}=Id(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(mf?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",mf||n.dataTransfer.setData("text/plain",l),t.dragging=new vf(s,!n[yf])},Hd.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},Kd.dragover=Kd.dragenter=(t,e)=>e.preventDefault(),Kd.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(tf(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",(e=>{s=e(s,t)})):s=Rd(t,n.dataTransfer.getData(mf?"Text":"text/plain"),mf?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[yf]);if(t.someProp("handleDrop",(e=>e(t,n,s||qa.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?function(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o=0;t--){let e=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,n=r.index(t)+(e>0?1:0),s=r.node(t),a=!1;if(1==o)a=s.canReplace(n,n,i);else{let t=s.contentMatchAt(n).findWrapping(i.firstChild.type);a=t&&s.canReplaceWith(n,n,t[0])}if(a)return 0==e?r.pos:e<0?r.before(t+1):r.after(t+1)}return null}(t.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let c=t.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let h=c.doc.resolve(u);if(d&&Nc.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Nc(h));else{let e=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((t,n,r,i)=>e=i)),c.setSelection(bd(t,h,c.doc.resolve(e)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Hd.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&fd(t)}),20))},Hd.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Hd.beforeinput=(t,e)=>{if(hu&&yu&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,nu(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let os in Kd)Hd[os]=Kd[os];function bf(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class wf{constructor(t,e){this.toDOM=t,this.spec=e||_f,this.side=this.spec.side||0}map(t,e,n,r){let{pos:i,deleted:o}=t.mapResult(e.from+r,this.side<0?-1:1);return o?null:new Sf(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof wf&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&bf(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class xf{constructor(t,e){this.attrs=t,this.spec=e||_f}map(t,e,n,r){let i=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,o=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new Sf(i,o,this)}valid(t,e){return e.from=t&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;ot){let s=this.children[o]+1;this.children[o+2].findInner(t-s,e-s,n,r+s,i)}}map(t,e,n){return this==Cf||0==t.maps.length?this:this.mapInner(t,e,0,0,n||_f)}mapInner(t,e,n,r,i){let o;for(let s=0;s{let s=o-r-(n-e);for(let l=0;lo+u-t)continue;let c=a[l]+u-t;n>=c?a[l+1]=e<=c?-2:-1:r>=i&&s&&(a[l]+=s,a[l+1]+=s)}t+=s})),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c=r.content.size){l=!0;continue}let d=n.map(t[c+1]+o,-1)-i,{index:f,offset:h}=r.content.findIndex(u),p=r.maybeChild(f);if(p&&h==u&&h+p.nodeSize==d){let r=a[c+2].mapInner(n,p,e+1,t[c]+o+1,s);r!=Cf?(a[c]=u,a[c+1]=d,a[c+2]=r):(a[c+1]=-2,l=!0)}else l=!0}if(l){let l=function(t,e,n,r,i,o,s){function a(t,e){for(let o=0;o{let s,a=o+n;if(s=Tf(e,t,a)){for(r||(r=this.children.slice());io&&e.to=t){this.children[s]==t&&(n=this.children[s+2]);break}let i=t+1,o=i+e.content.size;for(let s=0;si&&t.type instanceof xf){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;en.map(t,e,_f)));return $f.from(n)}forChild(t,e){if(e.isLeaf)return Mf.empty;let n=[];for(let r=0;rt instanceof Mf))?t:t.reduce(((t,e)=>t.concat(e instanceof Mf?e:e.members)),[]))}}}function Nf(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;rn&&o.to{let a=Tf(t,e,s+n);if(a){o=!0;let t=Af(a,e,n+s+1,r);t!=Cf&&i.push(s,s+e.nodeSize,t)}}));let s=Nf(o?Df(t):t,-n).sort(Ef);for(let a=0;a0;)e++;t.splice(e,0,n)}function Rf(t){let e=[];return t.someProp("decorations",(n=>{let r=n(t.state);r&&r!=Cf&&e.push(r)})),t.cursorWrapper&&e.push(Mf.create(t.state.doc,[t.cursorWrapper.deco])),$f.from(e)}const zf={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},jf=cu&&uu<=11;class Ff{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class Lf{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ff,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((t=>{for(let e=0;e"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),jf&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,zf)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;ethis.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(wd(this.view)){if(this.suppressingSelectionUpdates)return fd(this.view);if(cu&&uu<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Gc(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e,n=new Set;for(let i=t.focusNode;i;i=Kc(i))n.add(i);for(let i=t.anchorNode;i;i=Kc(i))if(n.has(i)){e=i;break}let r=e&&this.view.docView.nearestDesc(e);return r&&r.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);let n=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&wd(t)&&!this.ignoreSelectionChange(n),i=-1,o=-1,s=!1,a=[];if(t.editable)for(let c=0;c1){let t=a.filter((t=>"BR"==t.nodeName));if(2==t.length){let e=t[0],n=t[1];e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}}let l=null;i<0&&r&&t.input.lastFocus>Date.now()-200&&t.input.lastTouch-1||r)&&(i>-1&&(t.docView.markDirty(i,o),function(t){if(Bf.has(t))return;if(Bf.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)){if(t.requiresGeckoHackNode=du,Vf)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Vf=!0}}(t)),this.handleDOMChange(i,o,s,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||fd(t),this.currentSelection.set(n))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(let n=0;nDate.now()-50?t.input.lastSelectionOrigin:null,n=ud(t,e);if(n&&!t.state.selection.eq(n)){let r=t.state.tr.setSelection(n);"pointer"==e?r.setMeta("pointer",!0):"key"==e&&r.scrollIntoView(),t.dispatch(r)}return}let o=t.state.doc.resolve(e),s=o.sharedDepth(n);e=o.before(s+1),n=t.state.doc.resolve(n).after(s+1);let a,l,c=t.state.selection,u=function(t,e,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=t.docView.parseRange(e,n),c=t.domSelectionRange(),u=c.anchorNode;if(u&&t.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],eu(c)||r.push({node:c.focusNode,offset:c.focusOffset})),hu&&8===t.input.lastKeyCode)for(let g=s;g>o;g--){let t=i.childNodes[g-1],e=t.pmViewDesc;if("BR"==t.nodeName&&!e){s=g;break}if(!e||e.size)break}let d=t.state.doc,f=t.someProp("domParser")||Cl.fromSchema(t.state.schema),h=d.resolve(a),p=null,m=f.parse(i,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:qf,context:h});if(r&&null!=r[0].pos){let t=r[0].pos,e=r[1]&&r[1].pos;null==e&&(e=t),p={anchor:t+a,head:e+a}}return{doc:m,sel:p,from:a,to:l}}(t,e,n),d=t.state.doc,f=d.slice(u.from,u.to);8===t.input.lastKeyCode&&Date.now()-100=s?o-r:0,a=o+(a-s),s=o}else if(a=a?o-r:0,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(f.content,u.doc.content,u.from,a,l);if((gu&&t.input.lastIOSEnter>Date.now()-225||yu)&&i.some((t=>"DIV"==t.nodeName||"P"==t.nodeName||"LI"==t.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",(e=>e(t,nu(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(!h){if(!(r&&c instanceof Cc&&!c.empty&&c.$head.sameParent(c.$anchor))||t.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let e=Wf(t,t.state.doc,u.sel);e&&!e.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(e))}return}h={start:c.from,endA:c.to,endB:c.to}}if(hu&&t.cursorWrapper&&u.sel&&u.sel.anchor==t.cursorWrapper.deco.from&&u.sel.head==u.sel.anchor){let t=h.endB-h.start;u.sel={anchor:u.sel.anchor+t,head:u.sel.anchor+t}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?h.start=t.state.selection.from:h.endA=t.state.selection.to-2&&t.state.selection.to<=u.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),cu&&uu<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>u.from&&"  "==u.doc.textBetween(h.start-u.from-1,h.start-u.from+1)&&(h.start--,h.endA--,h.endB--);let p,m=u.doc.resolveNoCache(h.start-u.from),g=u.doc.resolveNoCache(h.endB-u.from),v=d.resolve(h.start),y=m.sameParent(g)&&m.parent.inlineContent&&v.end()>=h.endA;if((gu&&t.input.lastIOSEnter>Date.now()-225&&(!y||i.some((t=>"DIV"==t.nodeName||"P"==t.nodeName)))||!y&&m.pose(t,nu(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>h.start&&function(t,e,n,r,i){if(!r.parent.isTextblock||n-e<=i.pos-r.pos||Hf(r,!0,!1)n||Hf(s,!0,!1)e(t,nu(8,"Backspace")))))return void(yu&&hu&&t.domObserver.suppressSelectionUpdates());hu&&yu&&h.endB==h.start&&(t.input.lastAndroidDelete=Date.now()),yu&&!y&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==h.endA&&(h.endB-=2,g=u.doc.resolveNoCache(h.endB-u.from),setTimeout((()=>{t.someProp("handleKeyDown",(function(e){return e(t,nu(13,"Enter"))}))}),20));let b,w,x,k=h.start,S=h.endA;if(y)if(m.pos==g.pos)cu&&uu<=11&&0==m.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((()=>fd(t)),20)),b=t.state.tr.delete(k,S),w=d.resolve(h.start).marksAcross(d.resolve(h.endA));else if(h.endA==h.endB&&(x=function(t,e){let n,r,i,o=t.firstChild.marks,s=e.firstChild.marks,a=o,l=s;for(let u=0;ut.mark(r.addToSet(t.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",i=t=>t.mark(r.removeFromSet(t.marks))}let c=[];for(let u=0;un(t,k,S,e))))return;b=t.state.tr.insertText(e,k,S)}if(b||(b=t.state.tr.replace(k,S,u.doc.slice(h.start-u.from,h.endB-u.from))),u.sel){let e=Wf(t,b.doc,u.sel);e&&!(hu&&yu&&t.composing&&e.empty&&(h.start!=h.endB||t.input.lastAndroidDeletee.content.size?null:bd(t,e.resolve(n.anchor),e.resolve(n.head))}function Hf(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let e=t.node(r).maybeChild(t.indexAfter(r));for(;e&&!e.isLeaf;)e=e.firstChild,i++}return i}class Kf{constructor(t,e){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Yd,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(Xf),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Gf(this),Yf(this),this.nodeViews=Zf(this),this.docView=Uu(this.state.doc,Uf(this),Rf(this),this.dom,this),this.domObserver=new Lf(this,((t,e,n,r)=>Jf(this,t,e,n,r))),this.domObserver.start(),function(t){for(let e in Hd){let n=Hd[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=e=>{!Qd(t,e)||Xd(t,e)||!t.editable&&e.type in Kd||n(t,e)},Ud[e]?{passive:!0}:void 0)}mu&&t.dom.addEventListener("input",(()=>null)),Zd(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Zd(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Xf),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let n in this._props)e[n]=this._props[n];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){let n=this.state,r=!1,i=!1;t.storedMarks&&this.composing&&(hf(this),i=!0),this.state=t;let o=n.plugins!=t.plugins||this._props.plugins!=e.plugins;if(o||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let t=Zf(this);(function(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r})(t,this.nodeViews)&&(this.nodeViews=t,r=!0)}(o||e.handleDOMEvents!=this._props.handleDOMEvents)&&Zd(this),this.editable=Gf(this),Yf(this);let s=Rf(this),a=Uf(this),l=n.plugins==t.plugins||n.doc.eq(t.doc)?t.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",c=r||!this.docView.matchesNode(t.doc,a,s);!c&&t.selection.eq(n.selection)||(i=!0);let u="preserve"==l&&i&&null==this.dom.style.overflowAnchor&&function(t){let e,n,r=t.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s=i-20){e=r,n=a.top;break}}return{refDOM:e,refTop:n,stack:_u(t.dom)}}(this);if(i){this.domObserver.stop();let e=c&&(cu||hu)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&function(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}(n.selection,t.selection);if(c){let n=hu?this.trackWrites=this.domSelectionRange().focusNode:null;!r&&this.docView.update(t.doc,a,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Uu(t.doc,a,s,this.dom,this)),n&&!this.trackWrites&&(e=!0)}e||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Gc(e.node,e.offset,n.anchorNode,n.anchorOffset)}(this))?fd(this,e):(vd(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():u&&function({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Mu(n,0==r?0:r-e)}(u)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(t=>t(this))));else if(this.state.selection instanceof Nc){let e=this.docView.domAfterPos(this.state.selection.from);1==e.nodeType&&Ou(this,e.getBoundingClientRect(),t)}else Ou(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;ee.ownerDocument.getSelection()),this._root=e;return t||document}posAtCoords(t){return Du(this,t)}coordsAtPos(t,e=1){return Pu(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return Vu(this,e||this.state,t)}destroy(){this.docView&&(!function(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Rf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){return function(t,e){Xd(t,e)||!Hd[e.type]||!t.editable&&e.type in Kd||Hd[e.type](t,e)}(this,t)}dispatch(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return mu&&11===this.root.nodeType&&function(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom?function(t){let e;function n(t){t.preventDefault(),t.stopImmediatePropagation(),e=t.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0);let r=e.startContainer,i=e.startOffset,o=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return Gc(a.node,a.offset,o,s)&&([r,i,o,s]=[o,s,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Uf(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),e.translate="no",t.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(t.state)),n)for(let t in n)"class"==t&&(e.class+=" "+n[t]),"style"==t?e.style=(e.style?e.style+";":"")+n[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(n[t]))})),[Sf.node(0,t.state.doc.content.size,e)]}function Yf(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Sf.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Gf(t){return!t.someProp("editable",(e=>!1===e(t.state)))}function Zf(t){let e=Object.create(null);function n(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Xf(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Qf={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},th={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},eh="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent);"undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent);for(var nh="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),rh="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ih=nh||eh&&+eh[1]<57,oh=0;oh<10;oh++)Qf[48+oh]=Qf[96+oh]=String(oh);for(oh=1;oh<=24;oh++)Qf[oh+111]="F"+oh;for(oh=65;oh<=90;oh++)Qf[oh]=String.fromCharCode(oh+32),th[oh]=String.fromCharCode(oh);for(var sh in Qf)th.hasOwnProperty(sh)||(th[sh]=Qf[sh]);const ah="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function lh(t){let e,n,r,i,o=t.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let a=0;a127)&&(r=Qf[n.keyCode])&&r!=i){let i=e[ch(r,n,!0)];if(i&&i(t.state,t.dispatch,t))return!0}else if(o&&n.shiftKey){let r=e[ch(i,n,!0)];if(r&&r(t.state,t.dispatch,t))return!0}return!1}}const fh=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function hh(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function ph(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function mh(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=gh(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let r=n.after(),i=t.tr.replaceWith(r,r,s.createAndFill());i.setSelection(Sc.near(i.doc.resolve(r),1)),e(i.scrollIntoView())}return!0};function yh(t,e,n){let r,i,o=e.nodeBefore,s=e.nodeAfter;if(o.type.spec.isolating||s.type.spec.isolating)return!1;if(function(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(o,o+1)||!i.isTextblock&&!ac(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&i.matchType(r[0]||s.type).validEnd){if(n){let i=e.pos+s.nodeSize,a=za.empty;for(let t=r.length-1;t>=0;t--)a=za.from(r[t].create(null,a));a=za.from(o.copy(a));let l=t.tr.step(new tc(e.pos-1,i,e.pos,i,new qa(a,1,0),r.length,!0)),c=i+2*r.length;ac(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=Sc.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),u=c&&rc(c);if(null!=u&&u>=e.depth)return n&&n(t.tr.lift(c,u).scrollIntoView()),!0;if(a&&hh(s,"start",!0)&&hh(o,"end")){let r=o,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=za.empty;for(let t=i.length-1;t>=0;t--)r=za.from(i[t].copy(r));n(t.tr.step(new tc(e.pos-i.length,e.pos+s.nodeSize,e.pos+l,e.pos+s.nodeSize-l,new qa(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function bh(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(e.tr.setSelection(Cc.create(e.doc,t<0?i.start(o):i.end(o)))),!0)}}const wh=bh(-1),xh=bh(1);function kh(t,e=null){return function(n,r){let{from:i,to:o}=n.selection,s=!1;return n.doc.nodesBetween(i,o,((r,i)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)s=!0;else{let e=n.doc.resolve(i),r=e.index();s=e.parent.canReplaceWith(r,r+1,t)}})),!!s&&(r&&r(n.tr.setBlockType(i,o,t,e).scrollIntoView()),!0)}}function Sh(t,e=null){return function(n,r){let{empty:i,$cursor:o,ranges:s}=n.selection;if(i&&!o||!function(t,e,n){for(let r=0;r{if(s)return!1;s=t.inlineContent&&t.type.allowsMarkType(n)})),s)return!0}return!1}(n.doc,s,t))return!1;if(r)if(o)t.isInSet(n.storedMarks||o.marks())?r(n.tr.removeStoredMark(t)):r(n.tr.addStoredMark(t.create(e)));else{let i=!1,o=n.tr;for(let e=0;!i&&e{let{$cursor:r}=t.selection;if(!r||(n?!n.endOfTextblock("backward",t):r.parentOffset>0))return!1;let i=ph(r);if(!i){let n=r.blockRange(),i=n&&rc(n);return null!=i&&(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&yh(t,i,e))return!0;if(0==r.parent.content.size&&(hh(o,"end")||Nc.isSelectable(o))){let n=lc(t.doc,r.before(),r.after(),qa.empty);if(n&&n.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=ph(r)}let s=o&&o.nodeBefore;return!(!s||!Nc.isSelectable(s))&&(e&&e(t.tr.setSelection(Nc.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)})),Mh=Oh(fh,((t,e,n)=>{let{$cursor:r}=t.selection;if(!r||(n?!n.endOfTextblock("forward",t):r.parentOffset{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}),((t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Dc||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=gh(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let n=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(sc(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&rc(r);return null!=i&&(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)}),((t,e)=>{let{$from:n,$to:r}=t.selection;if(t.selection instanceof Nc&&t.selection.node.isBlock)return!(!n.parentOffset||!sc(t.doc,n.pos))&&(e&&e(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(e){let i=r.parentOffset==r.parent.content.size,o=t.tr;(t.selection instanceof Cc||t.selection instanceof Dc)&&o.deleteSelection();let s=0==n.depth?null:gh(n.node(-1).contentMatchAt(n.indexAfter(-1))),a=i&&s?[{type:s}]:void 0,l=sc(o.doc,o.mapping.map(n.pos),1,a);if(a||l||!sc(o.doc,o.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(a=[{type:s}]),l=!0),l&&(o.split(o.mapping.map(n.pos),1,a),!i&&!n.parentOffset&&n.parent.type!=s)){let t=o.mapping.map(n.before()),e=o.doc.resolve(t);s&&n.node(-1).canReplaceWith(e.index(),e.index()+1,s)&&o.setNodeMarkup(o.mapping.map(n.before()),s)}e(o.scrollIntoView())}return!0})),"Mod-Enter":vh,Backspace:_h,"Mod-Backspace":_h,"Shift-Backspace":_h,Delete:Mh,"Mod-Delete":Mh,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new Dc(t.doc))),!0)},$h={"Ctrl-h":Ch.Backspace,"Alt-Backspace":Ch["Mod-Backspace"],"Ctrl-d":Ch.Delete,"Ctrl-Alt-Backspace":Ch["Mod-Delete"],"Alt-Delete":Ch["Mod-Delete"],"Alt-d":Ch["Mod-Delete"],"Ctrl-a":wh,"Ctrl-e":xh};for(let os in Ch)$h[os]=Ch[os];const Nh=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?$h:Ch;class Th{constructor(t,e){var n;this.match=t,this.match=t,this.handler="string"==typeof e?(n=e,function(t,e,r,i){let o=n;if(e[1]){let t=e[0].lastIndexOf(e[1]);o+=e[0].slice(t+e[1].length);let n=(r+=t)-i;n>0&&(o=e[0].slice(t-n,t)+o,r=i)}return t.tr.insertText(o,r,i)}):e}}function Dh({rules:t}){let e=new Vc({state:{init:()=>null,apply(t,e){let n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:(n,r,i,o)=>Ah(n,r,i,o,t,e),handleDOMEvents:{compositionend:n=>{setTimeout((()=>{let{$cursor:r}=n.state.selection;r&&Ah(n,r.pos,r.pos,"",t,e)}))}}},isInputRules:!0});return e}function Ah(t,e,n,r,i,o){if(t.composing)return!1;let s=t.state,a=s.doc.resolve(e);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r;for(let c=0;c{let n=t.plugins;for(let r=0;r=0;t--)n.step(r.steps[t].invert(r.docs[t]));if(i.text){let e=n.doc.resolve(i.from).marks();n.replaceWith(i.from,i.to,t.schema.text(i.text,e))}else n.delete(i.from,i.to);e(n)}return!0}}return!1};function Ph(t,e,n=null,r){return new Th(t,((t,i,o,s)=>{let a=n instanceof Function?n(i):n,l=t.tr.delete(o,s),c=l.doc.resolve(o).blockRange(),u=c&&ic(c,e,a);if(!u)return null;l.wrap(c,u);let d=l.doc.resolve(o-1).nodeBefore;return d&&d.type==e&&ac(l.doc,o-1)&&(!r||r(i,d))&&l.join(o-1),l}))}function Ih(t,e,n=null){return new Th(t,((t,r,i,o)=>{let s=t.doc.resolve(i),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e)?t.tr.delete(i,o).setBlockType(i,i,e,a):null}))}new Th(/--$/,"—"),new Th(/\.\.\.$/,"…"),new Th(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new Th(/"$/,"”"),new Th(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new Th(/'$/,"’");const Rh=["ol",0],zh=["ul",0],jh=["li",0],Fh={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1==t.attrs.order?Rh:["ol",{start:t.attrs.order},0]},Lh={parseDOM:[{tag:"ul"}],toDOM:()=>zh},Bh={parseDOM:[{tag:"li"}],toDOM:()=>jh,defining:!0};function Vh(t,e){let n={};for(let r in t)n[r]=t[r];for(let r in e)n[r]=e[r];return n}function qh(t,e,n){return t.append({ordered_list:Vh(Fh,{content:"list_item+",group:n}),bullet_list:Vh(Lh,{content:"list_item+",group:n}),list_item:Vh(Bh,{content:e})})}function Jh(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;let t=n.doc.resolve(s.start-2);l=new ol(t,t,s.depth),s.endIndex=0;u--)o=za.from(n[u].type.create(n[u].attrs,o));t.step(new tc(e.start-(r?2:0),e.end,e.start,e.end,new qa(o,0,0),n.length,!0));let s=0;for(let u=0;u=r.depth-3;t--)i=za.from(r.node(t).copy(i));let s=r.indexAfter(-1){if(c>-1)return!1;t.isTextblock&&0==t.content.size&&(c=e+1)})),c>-1&&l.setSelection(Sc.near(l.doc.resolve(c))),n(l.scrollIntoView())}return!0}let a=i.pos==r.end()?s.contentMatchAt(0).defaultType:null,l=e.tr.delete(r.pos,i.pos),c=a?[null,{type:a}]:void 0;return!!sc(l.doc,r.pos,2,c)&&(n&&n(l.split(r.pos,2,c).scrollIntoView()),!0)}}function Hh(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,(e=>e.childCount>0&&e.firstChild.type==t));return!!o&&(!n||(r.node(o.depth-1).type==t?function(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);om;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?za.empty:za.from(i))))return!1;let d=o.pos,f=d+s.nodeSize;return r.step(new tc(d-(a?1:0),f+(l?1:0),d+1,f-1,new qa((a?za.empty:za.from(i.copy(za.empty))).append(l?za.empty:za.from(i.copy(za.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}(e,n,o)))}}function Kh(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,(e=>e.childCount>0&&e.firstChild.type==t));if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let r=l.lastChild&&l.lastChild.type==a.type,i=za.from(r?t.create():null),s=new qa(za.from(t.create(null,za.from(a.type.create(null,i)))),r?3:1,0),c=o.start,u=o.end;n(e.tr.step(new tc(c-(r?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0}}var Uh=function(){};Uh.prototype.append=function(t){return t.length?(t=Uh.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},Uh.prototype.prepend=function(t){return t.length?Uh.from(t).append(this):this},Uh.prototype.appendInner=function(t){return new Gh(this,t)},Uh.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Uh.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Uh.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Uh.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Uh.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Uh.from=function(t){return t instanceof Uh?t:t&&t.length?new Yh(t):Uh.empty};var Yh=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var i=e;i=n;i--)if(!1===t(this.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Uh);Uh.empty=new Yh([]);var Gh=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return ti&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;return!(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i))&&(!(n=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Uh),Zh=Uh;class Xh{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}e&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,a=t.tr,l=[],c=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(i,e+1),r=n.maps.length),r--,void c.push(t);if(n){c.push(new Qh(t.map));let e,i=t.step.map(n.slice(r));i&&a.maybeStep(i).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],l.push(new Qh(e,void 0,void 0,l.length+c.length))),r--,e&&n.appendMap(e,r)}else a.maybeStep(t.step);return t.selection?(o=n?t.selection.map(n.slice(r)):t.selection,s=new Xh(this.items.slice(0,i).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(t,e,n,r){let i=[],o=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let c=0;cep&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,l),o-=l),new Xh(s.append(i),o)}remapping(t,e){let n=new Jl;return this.items.forEach(((e,r)=>{let i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new Xh(this.items.append(t.map((t=>new Qh(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),i=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let a=e;this.items.forEach((e=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(e.step){let o=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(i.slice(a+1,r));c&&s++,n.push(new Qh(l,o,c))}else n.push(new Qh(l))}),r);let l=[];for(let d=e;d500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=t)r.push(o),o.selection&&i++;else if(o.step){let t=o.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=o.selection&&o.selection.map(e.slice(n));a&&i++;let l,c=new Qh(s.invert(),t,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else o.map&&n--}),this.items.length,0),new Xh(Zh.from(r.reverse()),i)}}Xh.empty=new Xh(Zh.empty,0);class Qh{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new Qh(e.getMap().invert(),e,this.selection)}}}class tp{constructor(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r}}const ep=20;function np(t){let e=[];return t.forEach(((t,n,r,i)=>e.push(r,i))),e}function rp(t,e){if(!t)return null;let n=[];for(let r=0;rnew tp(Xh.empty,Xh.empty,null,0),apply:(e,n,r)=>function(t,e,n,r){let i,o=n.getMeta(lp);if(o)return o.historyState;n.getMeta(cp)&&(t=new tp(t.done,t.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(lp))return s.getMeta(lp).redo?new tp(t.done.addTransform(n,void 0,r,ap(e)),t.undone,np(n.mapping.maps[n.steps.length-1]),t.prevTime):new tp(t.done,t.undone.addTransform(n,void 0,r,ap(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new tp(t.done.rebased(n,i),t.undone.rebased(n,i),rp(t.prevRanges,n.mapping),t.prevTime):new tp(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),rp(t.prevRanges,n.mapping),t.prevTime);{let i=0==t.prevTime||!s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach(((t,r)=>{for(let i=0;i=e[i]&&(n=!0)})),n}(n,t.prevRanges)),o=s?rp(t.prevRanges,n.mapping):np(n.mapping.maps[n.steps.length-1]);return new tp(t.done.addTransform(n,i?e.selection.getBookmark():void 0,r,ap(e)),Xh.empty,o,n.time)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?dp:"historyRedo"==n?fp:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}const dp=(t,e)=>{let n=lp.getState(t);return!(!n||0==n.done.eventCount)&&(e&&ip(n,t,e,!1),!0)},fp=(t,e)=>{let n=lp.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&ip(n,t,e,!0),!0)};function hp(t){let e=lp.getState(t);return e?e.done.eventCount:0}function pp(t){let e=lp.getState(t);return e?e.undone.eventCount:0}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function mp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gp={},vp={},yp={},bp={},wp={};function xp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function kp(t){for(var e=1;e=+n}))};var Fp={};Object.defineProperty(Fp,"__esModule",{value:!0}),Fp.default=void 0;var Lp=(0,yp.regex)("email",/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i);Fp.default=Lp;var Bp={};Object.defineProperty(Bp,"__esModule",{value:!0}),Bp.default=void 0;var Vp=yp,qp=(0,Vp.withParams)({type:"ipAddress"},(function(t){if(!(0,Vp.req)(t))return!0;if("string"!=typeof t)return!1;var e=t.split(".");return 4===e.length&&e.every(Jp)}));Bp.default=qp;var Jp=function(t){if(t.length>3||0===t.length)return!1;if("0"===t[0]&&"0"!==t)return!1;if(!t.match(/^\d+$/))return!1;var e=0|+t;return e>=0&&e<=255},Wp={};Object.defineProperty(Wp,"__esModule",{value:!0}),Wp.default=void 0;var Hp=yp;Wp.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":";return(0,Hp.withParams)({type:"macAddress"},(function(e){if(!(0,Hp.req)(e))return!0;if("string"!=typeof e)return!1;var n="string"==typeof t&&""!==t?e.split(t):12===e.length||16===e.length?e.match(/.{2}/g):null;return null!==n&&(6===n.length||8===n.length)&&n.every(Kp)}))};var Kp=function(t){return t.toLowerCase().match(/^[0-9a-f]{2}$/)},Up={};Object.defineProperty(Up,"__esModule",{value:!0}),Up.default=void 0;var Yp=yp;Up.default=function(t){return(0,Yp.withParams)({type:"maxLength",max:t},(function(e){return!(0,Yp.req)(e)||(0,Yp.len)(e)<=t}))};var Gp={};Object.defineProperty(Gp,"__esModule",{value:!0}),Gp.default=void 0;var Zp=yp;Gp.default=function(t){return(0,Zp.withParams)({type:"minLength",min:t},(function(e){return!(0,Zp.req)(e)||(0,Zp.len)(e)>=t}))};var Xp={};Object.defineProperty(Xp,"__esModule",{value:!0}),Xp.default=void 0;var Qp=yp,tm=(0,Qp.withParams)({type:"required"},(function(t){return(0,Qp.req)("string"==typeof t?t.trim():t)}));Xp.default=tm;var em={};Object.defineProperty(em,"__esModule",{value:!0}),em.default=void 0;var nm=yp;em.default=function(t){return(0,nm.withParams)({type:"requiredIf",prop:t},(function(e,n){return!(0,nm.ref)(t,this,n)||(0,nm.req)(e)}))};var rm={};Object.defineProperty(rm,"__esModule",{value:!0}),rm.default=void 0;var im=yp;rm.default=function(t){return(0,im.withParams)({type:"requiredUnless",prop:t},(function(e,n){return!!(0,im.ref)(t,this,n)||(0,im.req)(e)}))};var om={};Object.defineProperty(om,"__esModule",{value:!0}),om.default=void 0;var sm=yp;om.default=function(t){return(0,sm.withParams)({type:"sameAs",eq:t},(function(e,n){return e===(0,sm.ref)(t,this,n)}))};var am={};Object.defineProperty(am,"__esModule",{value:!0}),am.default=void 0;var lm=(0,yp.regex)("url",/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i);am.default=lm;var cm={};Object.defineProperty(cm,"__esModule",{value:!0}),cm.default=void 0;var um=yp;cm.default=function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&e.reduce((function(e,n){return e||n.apply(t,r)}),!1)}))};var dm={};Object.defineProperty(dm,"__esModule",{value:!0}),dm.default=void 0;var fm=yp;dm.default=function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&e.reduce((function(e,n){return e&&n.apply(t,r)}),!0)}))};var hm={};Object.defineProperty(hm,"__esModule",{value:!0}),hm.default=void 0;var pm=yp;hm.default=function(t){return(0,pm.withParams)({type:"not"},(function(e,n){return!(0,pm.req)(e)||!t.call(this,e,n)}))};var mm={};Object.defineProperty(mm,"__esModule",{value:!0}),mm.default=void 0;var gm=yp;mm.default=function(t){return(0,gm.withParams)({type:"minValue",min:t},(function(e){return!(0,gm.req)(e)||(!/\s/.test(e)||e instanceof Date)&&+e>=+t}))};var vm={};Object.defineProperty(vm,"__esModule",{value:!0}),vm.default=void 0;var ym=yp;vm.default=function(t){return(0,ym.withParams)({type:"maxValue",max:t},(function(e){return!(0,ym.req)(e)||(!/\s/.test(e)||e instanceof Date)&&+e<=+t}))};var bm={};Object.defineProperty(bm,"__esModule",{value:!0}),bm.default=void 0;var wm=(0,yp.regex)("integer",/(^[0-9]*$)|(^-[0-9]+$)/);bm.default=wm;var xm={};Object.defineProperty(xm,"__esModule",{value:!0}),xm.default=void 0;var km=(0,yp.regex)("decimal",/^[-]?\d*(\.\d+)?$/);xm.default=km,function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"alpha",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"alphaNum",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"and",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"between",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"decimal",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"email",{enumerable:!0,get:function(){return s.default}}),t.helpers=void 0,Object.defineProperty(t,"integer",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"ipAddress",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"macAddress",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"maxLength",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"maxValue",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"minLength",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"minValue",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"not",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"numeric",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"or",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"required",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"requiredIf",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"requiredUnless",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"sameAs",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"url",{enumerable:!0,get:function(){return m.default}});var n=_(vp),r=_(Ep),i=_(Ip),o=_(zp),s=_(Fp),a=_(Bp),l=_(Wp),c=_(Up),u=_(Gp),d=_(Xp),f=_(em),h=_(rm),p=_(om),m=_(am),g=_(cm),v=_(dm),y=_(hm),b=_(mm),w=_(vm),x=_(bm),k=_(xm),S=function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!=typeof t)return{default:t};var r=O(n);if(r&&r.has(t))return r.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var a=o?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=t[s]}i.default=t,r&&r.set(t,i);return i}(yp);function O(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(O=function(t){return t?n:e})(t)}function _(t){return t&&t.__esModule?t:{default:t}}t.helpers=S}(gp);function Sm(t){return(Sm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Om={selector:"vue-portal-target-".concat(((t=21)=>{let e="",n=t;for(;n--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e})())},_m=function(t){return Om.selector=t},Mm="undefined"!=typeof window&&void 0!==("undefined"==typeof document?"undefined":Sm(document)),Cm=Wn.extend({abstract:!0,name:"PortalOutlet",props:["nodes","tag"],data:function(t){return{updatedNodes:t.nodes}},render:function(t){var e=this.updatedNodes&&this.updatedNodes();return e?1!==e.length||e[0].text?t(this.tag||"DIV",e):e:t()},destroyed:function(){var t=this.$el;t&&t.parentNode.removeChild(t)}}),$m=Wn.extend({name:"VueSimplePortal",props:{disabled:{type:Boolean},prepend:{type:Boolean},selector:{type:String,default:function(){return"#".concat(Om.selector)}},tag:{type:String,default:"DIV"}},render:function(t){if(this.disabled){var e=this.$scopedSlots&&this.$scopedSlots.default();return e?e.length<2&&!e[0].text?e:t(this.tag,e):t()}return t()},created:function(){this.getTargetEl()||this.insertTargetEl()},updated:function(){var t=this;this.$nextTick((function(){t.disabled||t.slotFn===t.$scopedSlots.default||(t.container.updatedNodes=t.$scopedSlots.default),t.slotFn=t.$scopedSlots.default}))},beforeDestroy:function(){this.unmount()},watch:{disabled:{immediate:!0,handler:function(t){t?this.unmount():this.$nextTick(this.mount)}}},methods:{getTargetEl:function(){if(Mm)return document.querySelector(this.selector)},insertTargetEl:function(){if(Mm){var t=document.querySelector("body"),e=document.createElement(this.tag);e.id=this.selector.substring(1),t.appendChild(e)}},mount:function(){if(Mm){var t=this.getTargetEl(),e=document.createElement("DIV");this.prepend&&t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e),this.container=new Cm({el:e,parent:this,propsData:{tag:this.tag,nodes:this.$scopedSlots.default}})}},unmount:function(){this.container&&(this.container.$destroy(),delete this.container)}}});function Nm(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.component(e.name||"portal",$m),e.defaultSelector&&_m(e.defaultSelector)}"undefined"!=typeof window&&window.Vue&&window.Vue===Wn&&Wn.use(Nm) -/*! - * vuex v3.6.2 - * (c) 2021 Evan You - * @license MIT - */;var Tm=("undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function Dm(t,e){if(void 0===e&&(e=[]),null===t||"object"!=typeof t)return t;var n,r=(n=function(e){return e.original===t},e.filter(n)[0]);if(r)return r.copy;var i=Array.isArray(t)?[]:{};return e.push({original:t,copy:i}),Object.keys(t).forEach((function(n){i[n]=Dm(t[n],e)})),i}function Am(t,e){Object.keys(t).forEach((function(n){return e(t[n],n)}))}function Em(t){return null!==t&&"object"==typeof t}var Pm=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var n=t.state;this.state=("function"==typeof n?n():n)||{}},Im={namespaced:{configurable:!0}};Im.namespaced.get=function(){return!!this._rawModule.namespaced},Pm.prototype.addChild=function(t,e){this._children[t]=e},Pm.prototype.removeChild=function(t){delete this._children[t]},Pm.prototype.getChild=function(t){return this._children[t]},Pm.prototype.hasChild=function(t){return t in this._children},Pm.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},Pm.prototype.forEachChild=function(t){Am(this._children,t)},Pm.prototype.forEachGetter=function(t){this._rawModule.getters&&Am(this._rawModule.getters,t)},Pm.prototype.forEachAction=function(t){this._rawModule.actions&&Am(this._rawModule.actions,t)},Pm.prototype.forEachMutation=function(t){this._rawModule.mutations&&Am(this._rawModule.mutations,t)},Object.defineProperties(Pm.prototype,Im);var Rm,zm=function(t){this.register([],t,!1)};function jm(t,e,n){if(e.update(n),n.modules)for(var r in n.modules){if(!e.getChild(r))return;jm(t.concat(r),e.getChild(r),n.modules[r])}}zm.prototype.get=function(t){return t.reduce((function(t,e){return t.getChild(e)}),this.root)},zm.prototype.getNamespace=function(t){var e=this.root;return t.reduce((function(t,n){return t+((e=e.getChild(n)).namespaced?n+"/":"")}),"")},zm.prototype.update=function(t){jm([],this.root,t)},zm.prototype.register=function(t,e,n){var r=this;void 0===n&&(n=!0);var i=new Pm(e,n);0===t.length?this.root=i:this.get(t.slice(0,-1)).addChild(t[t.length-1],i);e.modules&&Am(e.modules,(function(e,i){r.register(t.concat(i),e,n)}))},zm.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1],r=e.getChild(n);r&&r.runtime&&e.removeChild(n)},zm.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];return!!e&&e.hasChild(n)};var Fm=function(t){var e=this;void 0===t&&(t={}),!Rm&&"undefined"!=typeof window&&window.Vue&&Km(window.Vue);var n=t.plugins;void 0===n&&(n=[]);var r=t.strict;void 0===r&&(r=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new zm(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new Rm,this._makeLocalGettersCache=Object.create(null);var i=this,o=this.dispatch,s=this.commit;this.dispatch=function(t,e){return o.call(i,t,e)},this.commit=function(t,e,n){return s.call(i,t,e,n)},this.strict=r;var a=this._modules.root.state;Jm(this,a,[],this._modules.root),qm(this,a),n.forEach((function(t){return t(e)})),(void 0!==t.devtools?t.devtools:Rm.config.devtools)&&function(t){Tm&&(t._devtoolHook=Tm,Tm.emit("vuex:init",t),Tm.on("vuex:travel-to-state",(function(e){t.replaceState(e)})),t.subscribe((function(t,e){Tm.emit("vuex:mutation",t,e)}),{prepend:!0}),t.subscribeAction((function(t,e){Tm.emit("vuex:action",t,e)}),{prepend:!0}))}(this)},Lm={state:{configurable:!0}};function Bm(t,e,n){return e.indexOf(t)<0&&(n&&n.prepend?e.unshift(t):e.push(t)),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function Vm(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;Jm(t,n,[],t._modules.root,!0),qm(t,n,e)}function qm(t,e,n){var r=t._vm;t.getters={},t._makeLocalGettersCache=Object.create(null);var i=t._wrappedGetters,o={};Am(i,(function(e,n){o[n]=function(t,e){return function(){return t(e)}}(e,t),Object.defineProperty(t.getters,n,{get:function(){return t._vm[n]},enumerable:!0})}));var s=Rm.config.silent;Rm.config.silent=!0,t._vm=new Rm({data:{$$state:e},computed:o}),Rm.config.silent=s,t.strict&&function(t){t._vm.$watch((function(){return this._data.$$state}),(function(){}),{deep:!0,sync:!0})}(t),r&&(n&&t._withCommit((function(){r._data.$$state=null})),Rm.nextTick((function(){return r.$destroy()})))}function Jm(t,e,n,r,i){var o=!n.length,s=t._modules.getNamespace(n);if(r.namespaced&&(t._modulesNamespaceMap[s],t._modulesNamespaceMap[s]=r),!o&&!i){var a=Wm(e,n.slice(0,-1)),l=n[n.length-1];t._withCommit((function(){Rm.set(a,l,r.state)}))}var c=r.context=function(t,e,n){var r=""===e,i={dispatch:r?t.dispatch:function(n,r,i){var o=Hm(n,r,i),s=o.payload,a=o.options,l=o.type;return a&&a.root||(l=e+l),t.dispatch(l,s)},commit:r?t.commit:function(n,r,i){var o=Hm(n,r,i),s=o.payload,a=o.options,l=o.type;a&&a.root||(l=e+l),t.commit(l,s,a)}};return Object.defineProperties(i,{getters:{get:r?function(){return t.getters}:function(){return function(t,e){if(!t._makeLocalGettersCache[e]){var n={},r=e.length;Object.keys(t.getters).forEach((function(i){if(i.slice(0,r)===e){var o=i.slice(r);Object.defineProperty(n,o,{get:function(){return t.getters[i]},enumerable:!0})}})),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}(t,e)}},state:{get:function(){return Wm(t.state,n)}}}),i}(t,s,n);r.forEachMutation((function(e,n){!function(t,e,n,r){(t._mutations[e]||(t._mutations[e]=[])).push((function(e){n.call(t,r.state,e)}))}(t,s+n,e,c)})),r.forEachAction((function(e,n){var r=e.root?n:s+n,i=e.handler||e;!function(t,e,n,r){(t._actions[e]||(t._actions[e]=[])).push((function(e){var i,o=n.call(t,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:t.getters,rootState:t.state},e);return(i=o)&&"function"==typeof i.then||(o=Promise.resolve(o)),t._devtoolHook?o.catch((function(e){throw t._devtoolHook.emit("vuex:error",e),e})):o}))}(t,r,i,c)})),r.forEachGetter((function(e,n){!function(t,e,n,r){if(t._wrappedGetters[e])return;t._wrappedGetters[e]=function(t){return n(r.state,r.getters,t.state,t.getters)}}(t,s+n,e,c)})),r.forEachChild((function(r,o){Jm(t,e,n.concat(o),r,i)}))}function Wm(t,e){return e.reduce((function(t,e){return t[e]}),t)}function Hm(t,e,n){return Em(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}function Km(t){Rm&&t===Rm||function(t){if(Number(t.version.split(".")[0])>=2)t.mixin({beforeCreate:n});else{var e=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[n].concat(t.init):n,e.call(this,t)}}function n(){var t=this.$options;t.store?this.$store="function"==typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}(Rm=t)}Lm.state.get=function(){return this._vm._data.$$state},Lm.state.set=function(t){},Fm.prototype.commit=function(t,e,n){var r=this,i=Hm(t,e,n),o=i.type,s=i.payload,a={type:o,payload:s},l=this._mutations[o];l&&(this._withCommit((function(){l.forEach((function(t){t(s)}))})),this._subscribers.slice().forEach((function(t){return t(a,r.state)})))},Fm.prototype.dispatch=function(t,e){var n=this,r=Hm(t,e),i=r.type,o=r.payload,s={type:i,payload:o},a=this._actions[i];if(a){try{this._actionSubscribers.slice().filter((function(t){return t.before})).forEach((function(t){return t.before(s,n.state)}))}catch(Tg){}var l=a.length>1?Promise.all(a.map((function(t){return t(o)}))):a[0](o);return new Promise((function(t,e){l.then((function(e){try{n._actionSubscribers.filter((function(t){return t.after})).forEach((function(t){return t.after(s,n.state)}))}catch(Tg){}t(e)}),(function(t){try{n._actionSubscribers.filter((function(t){return t.error})).forEach((function(e){return e.error(s,n.state,t)}))}catch(Tg){}e(t)}))}))}},Fm.prototype.subscribe=function(t,e){return Bm(t,this._subscribers,e)},Fm.prototype.subscribeAction=function(t,e){return Bm("function"==typeof t?{before:t}:t,this._actionSubscribers,e)},Fm.prototype.watch=function(t,e,n){var r=this;return this._watcherVM.$watch((function(){return t(r.state,r.getters)}),e,n)},Fm.prototype.replaceState=function(t){var e=this;this._withCommit((function(){e._vm._data.$$state=t}))},Fm.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"==typeof t&&(t=[t]),this._modules.register(t,e),Jm(this,this.state,t,this._modules.get(t),n.preserveState),qm(this,this.state)},Fm.prototype.unregisterModule=function(t){var e=this;"string"==typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit((function(){var n=Wm(e.state,t.slice(0,-1));Rm.delete(n,t[t.length-1])})),Vm(this)},Fm.prototype.hasModule=function(t){return"string"==typeof t&&(t=[t]),this._modules.isRegistered(t)},Fm.prototype.hotUpdate=function(t){this._modules.update(t),Vm(this,!0)},Fm.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(Fm.prototype,Lm);var Um=Qm((function(t,e){var n={};return Xm(e).forEach((function(e){var r=e.key,i=e.val;n[r]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var r=tg(this.$store,"mapState",t);if(!r)return;e=r.context.state,n=r.context.getters}return"function"==typeof i?i.call(this,e,n):e[i]},n[r].vuex=!0})),n})),Ym=Qm((function(t,e){var n={};return Xm(e).forEach((function(e){var r=e.key,i=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.commit;if(t){var o=tg(this.$store,"mapMutations",t);if(!o)return;r=o.context.commit}return"function"==typeof i?i.apply(this,[r].concat(e)):r.apply(this.$store,[i].concat(e))}})),n})),Gm=Qm((function(t,e){var n={};return Xm(e).forEach((function(e){var r=e.key,i=e.val;i=t+i,n[r]=function(){if(!t||tg(this.$store,"mapGetters",t))return this.$store.getters[i]},n[r].vuex=!0})),n})),Zm=Qm((function(t,e){var n={};return Xm(e).forEach((function(e){var r=e.key,i=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.dispatch;if(t){var o=tg(this.$store,"mapActions",t);if(!o)return;r=o.context.dispatch}return"function"==typeof i?i.apply(this,[r].concat(e)):r.apply(this.$store,[i].concat(e))}})),n}));function Xm(t){return function(t){return Array.isArray(t)||Em(t)}(t)?Array.isArray(t)?t.map((function(t){return{key:t,val:t}})):Object.keys(t).map((function(e){return{key:e,val:t[e]}})):[]}function Qm(t){return function(e,n){return"string"!=typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function tg(t,e,n){return t._modulesNamespaceMap[n]}function eg(t,e,n){var r=n?t.groupCollapsed:t.group;try{r.call(t,e)}catch(Tg){t.log(e)}}function ng(t){try{t.groupEnd()}catch(Tg){t.log("—— log end ——")}}function rg(){var t=new Date;return" @ "+ig(t.getHours(),2)+":"+ig(t.getMinutes(),2)+":"+ig(t.getSeconds(),2)+"."+ig(t.getMilliseconds(),3)}function ig(t,e){return n="0",r=e-t.toString().length,new Array(r+1).join(n)+t;var n,r}const og={Store:Fm,install:Km,version:"3.6.2",mapState:Um,mapMutations:Ym,mapGetters:Gm,mapActions:Zm,createNamespacedHelpers:function(t){return{mapState:Um.bind(null,t),mapGetters:Gm.bind(null,t),mapMutations:Ym.bind(null,t),mapActions:Zm.bind(null,t)}},createLogger:function(t){void 0===t&&(t={});var e=t.collapsed;void 0===e&&(e=!0);var n=t.filter;void 0===n&&(n=function(t,e,n){return!0});var r=t.transformer;void 0===r&&(r=function(t){return t});var i=t.mutationTransformer;void 0===i&&(i=function(t){return t});var o=t.actionFilter;void 0===o&&(o=function(t,e){return!0});var s=t.actionTransformer;void 0===s&&(s=function(t){return t});var a=t.logMutations;void 0===a&&(a=!0);var l=t.logActions;void 0===l&&(l=!0);var c=t.logger;return void 0===c&&(c=console),function(t){var u=Dm(t.state);void 0!==c&&(a&&t.subscribe((function(t,o){var s=Dm(o);if(n(t,u,s)){var a=rg(),l=i(t),d="mutation "+t.type+a;eg(c,d,e),c.log("%c prev state","color: #9E9E9E; font-weight: bold",r(u)),c.log("%c mutation","color: #03A9F4; font-weight: bold",l),c.log("%c next state","color: #4CAF50; font-weight: bold",r(s)),ng(c)}u=s})),l&&t.subscribeAction((function(t,n){if(o(t,n)){var r=rg(),i=s(t),a="action "+t.type+r;eg(c,a,e),c.log("%c action","color: #03A9F4; font-weight: bold",i),ng(c)}})))}}};function sg(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map((function(t){t(n)})),(r=t.get("*"))&&r.slice().map((function(t){t(e,n)}))}}}var ag,lg,cg="function"==typeof Map?new Map:(ag=[],lg=[],{has:function(t){return ag.indexOf(t)>-1},get:function(t){return lg[ag.indexOf(t)]},set:function(t,e){-1===ag.indexOf(t)&&(ag.push(t),lg.push(e))},delete:function(t){var e=ag.indexOf(t);e>-1&&(ag.splice(e,1),lg.splice(e,1))}}),ug=function(t){return new Event(t,{bubbles:!0})};try{new Event("test")}catch(Tg){ug=function(t){var e=document.createEvent("Event");return e.initEvent(t,!0,!1),e}}function dg(t){var e=cg.get(t);e&&e.destroy()}function fg(t){var e=cg.get(t);e&&e.update()}var hg=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((hg=function(t){return t}).destroy=function(t){return t},hg.update=function(t){return t}):((hg=function(t,e){return t&&Array.prototype.forEach.call(t.length?t:[t],(function(t){return function(t){if(t&&t.nodeName&&"TEXTAREA"===t.nodeName&&!cg.has(t)){var e,n=null,r=null,i=null,o=function(){t.clientWidth!==r&&c()},s=function(e){window.removeEventListener("resize",o,!1),t.removeEventListener("input",c,!1),t.removeEventListener("keyup",c,!1),t.removeEventListener("autosize:destroy",s,!1),t.removeEventListener("autosize:update",c,!1),Object.keys(e).forEach((function(n){t.style[n]=e[n]})),cg.delete(t)}.bind(t,{height:t.style.height,resize:t.style.resize,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener("autosize:destroy",s,!1),"onpropertychange"in t&&"oninput"in t&&t.addEventListener("keyup",c,!1),window.addEventListener("resize",o,!1),t.addEventListener("input",c,!1),t.addEventListener("autosize:update",c,!1),t.style.overflowX="hidden",t.style.wordWrap="break-word",cg.set(t,{destroy:s,update:c}),"vertical"===(e=window.getComputedStyle(t,null)).resize?t.style.resize="none":"both"===e.resize&&(t.style.resize="horizontal"),n="content-box"===e.boxSizing?-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)):parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth),isNaN(n)&&(n=0),c()}function a(e){var n=t.style.width;t.style.width="0px",t.style.width=n,t.style.overflowY=e}function l(){if(0!==t.scrollHeight){var e=function(t){for(var e=[];t&&t.parentNode&&t.parentNode instanceof Element;)t.parentNode.scrollTop&&(t.parentNode.style.scrollBehavior="auto",e.push([t.parentNode,t.parentNode.scrollTop])),t=t.parentNode;return function(){return e.forEach((function(t){var e=t[0];e.scrollTop=t[1],e.style.scrollBehavior=null}))}}(t);t.style.height="",t.style.height=t.scrollHeight+n+"px",r=t.clientWidth,e()}}function c(){l();var e=Math.round(parseFloat(t.style.height)),n=window.getComputedStyle(t,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):t.offsetHeight;if(r=e?t:""+Array(e+1-r.length).join(n)+t},y={s:v,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+v(r,2,"0")+":"+v(i,2,"0")},m:function t(e,n){if(e.date()1)return t(s[0])}else{var a=e.name;w[a]=e,i=a}return!r&&i&&(b=i),i||!r&&b},S=function(t,e){if(x(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=y;O.l=k,O.i=x,O.w=function(t,e){return S(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function g(t){this.$L=k(t.locale,null,!0),this.parse(t)}var v=g.prototype;return v.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},v.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},v.$utils=function(){return O},v.isValid=function(){return!(this.$d.toString()===h)},v.isSame=function(t,e){var n=S(t);return this.startOf(e)<=n&&n<=this.endOf(e)},v.isAfter=function(t,e){return S(t)68?1900:2e3)},a=function(t){return function(e){this[t]=+e}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),n=60*e[1]+(+e[2]||0);return 0===n?0:"+"===e[0]?-n:n}(t)}],c=function(t){var e=o[t];return e&&(e.indexOf?e:e.s.concat(e.f))},u=function(t,e){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(t.indexOf(r(i,0,e))>-1){n=i>12;break}}else n=t===(e?"pm":"PM");return n},d={A:[i,function(t){this.afternoon=u(t,!1)}],a:[i,function(t){this.afternoon=u(t,!0)}],S:[/\d/,function(t){this.milliseconds=100*+t}],SS:[n,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(t){var e=o.ordinal,n=t.match(/\d+/);if(this.day=n[0],e)for(var r=1;r<=31;r+=1)e(r).replace(/\[|\]/g,"")===t&&(this.day=r)}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(t){var e=c("months"),n=(c("monthsShort")||e.map((function(t){return t.slice(0,3)}))).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(t){var e=c("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(t){this.year=s(t)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function f(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,n,r){var o=r&&r.toUpperCase();return n||i[r]||t[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),a=s.length,l=0;l-1)return new Date(("X"===e?1e3:1)*t);var r=f(e)(t),i=r.year,o=r.month,s=r.day,a=r.hours,l=r.minutes,c=r.seconds,u=r.milliseconds,d=r.zone,h=new Date,p=s||(i||o?1:h.getDate()),m=i||h.getFullYear(),g=0;i&&!o||(g=o>0?o-1:h.getMonth());var v=a||0,y=l||0,b=c||0,w=u||0;return d?new Date(Date.UTC(m,g,p,v,y,b,w+60*d.offset*1e3)):n?new Date(Date.UTC(m,g,p,v,y,b,w)):new Date(m,g,p,v,y,b,w)}catch(x){return new Date("")}}(e,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&e!=this.format(a)&&(this.$d=new Date("")),o={}}else if(a instanceof Array)for(var h=a.length,p=1;p<=h;p+=1){s[1]=a[p-1];var m=n.apply(this,s);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}p===h&&(this.$d=new Date(""))}else i.call(this,t)}}}();var bg={},wg={};function xg(t){return null==t}function kg(t){return null!=t}function Sg(t,e){return e.tag===t.tag&&e.key===t.key}function Og(t){var e=t.tag;t.vm=new e({data:t.args})}function _g(t,e,n){var r,i,o={};for(r=e;r<=n;++r)kg(i=t[r].key)&&(o[i]=r);return o}function Mg(t,e,n){for(;e<=n;++e)Og(t[e])}function Cg(t,e,n){for(;e<=n;++e){var r=t[e];kg(r)&&(r.vm.$destroy(),r.vm=null)}}function $g(t,e){t!==e&&(e.vm=t.vm,function(t){for(var e=Object.keys(t.args),n=0;na?Mg(e,s,u):s>u&&Cg(t,o,a)}(t,e):kg(e)?Mg(e,0,e.length-1):kg(t)&&Cg(t,0,t.length-1)},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Vuelidate=O,t.validationMixin=t.default=void 0,Object.defineProperty(t,"withParams",{enumerable:!0,get:function(){return n.withParams}});var e=wg,n=wp;function r(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?a:a.$sub[0]:null}}},computed:{run:function(){var t=this,e=this.lazyParentModel();if(Array.isArray(e)&&e.__ob__){var n=e.__ob__.dep;n.depend();var r=n.constructor.target;if(!this._indirectWatcher){var i=r.constructor;this._indirectWatcher=new i(this,(function(){return t.runRule(e)}),null,{lazy:!0})}var o=this.getModel();if(!this._indirectWatcher.dirty&&this._lastModel===o)return this._indirectWatcher.depend(),r.value;this._lastModel=o,this._indirectWatcher.evaluate(),this._indirectWatcher.depend()}else this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null);return this._indirectWatcher?this._indirectWatcher.value:this.runRule(e)},$params:function(){return this.run.params},proxy:function(){var t=this.run.output;return t.__isVuelidateAsyncVm?!!t.v:!!t},$pending:function(){var t=this.run.output;return!!t.__isVuelidateAsyncVm&&t.p}},destroyed:function(){this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null)}}),a=i.extend({data:function(){return{dirty:!1,validations:null,lazyModel:null,model:null,prop:null,lazyParentModel:null,rootModel:null}},methods:s(s({},g),{},{refProxy:function(t){return this.getRef(t).proxy},getRef:function(t){return this.refs[t]},isNested:function(t){return"function"!=typeof this.validations[t]}}),computed:s(s({},p),{},{nestedKeys:function(){return this.keys.filter(this.isNested)},ruleKeys:function(){var t=this;return this.keys.filter((function(e){return!t.isNested(e)}))},keys:function(){return Object.keys(this.validations).filter((function(t){return"$params"!==t}))},proxy:function(){var t=this,e=u(this.keys,(function(e){return{enumerable:!0,configurable:!0,get:function(){return t.refProxy(e)}}})),n=u(v,(function(e){return{enumerable:!0,configurable:!0,get:function(){return t[e]}}})),r=u(y,(function(e){return{enumerable:!1,configurable:!0,get:function(){return t[e]}}})),i=this.hasIter()?{$iter:{enumerable:!0,value:Object.defineProperties({},s({},e))}}:{};return Object.defineProperties({},s(s(s(s({},e),i),{},{$model:{enumerable:!0,get:function(){var e=t.lazyParentModel();return null!=e?e[t.prop]:null},set:function(e){var n=t.lazyParentModel();null!=n&&(n[t.prop]=e,t.$touch())}}},n),r))},children:function(){var t=this;return[].concat(r(this.nestedKeys.map((function(e){return w(t,e)}))),r(this.ruleKeys.map((function(e){return x(t,e)})))).filter(Boolean)}})}),l=a.extend({methods:{isNested:function(t){return void 0!==this.validations[t]()},getRef:function(t){var e=this;return{get proxy(){return e.validations[t]()||!1}}}}}),m=a.extend({computed:{keys:function(){var t=this.getModel();return f(t)?Object.keys(t):[]},tracker:function(){var t=this,e=this.validations.$trackBy;return e?function(n){return"".concat(h(t.rootModel,t.getModelKey(n),e))}:function(t){return"".concat(t)}},getModelLazy:function(){var t=this;return function(){return t.getModel()}},children:function(){var t=this,n=this.validations,r=this.getModel(),i=s({},n);delete i.$trackBy;var o={};return this.keys.map((function(n){var s=t.tracker(n);return o.hasOwnProperty(s)?null:(o[s]=!0,(0,e.h)(a,s,{validations:i,prop:n,lazyParentModel:t.getModelLazy,model:r[n],rootModel:t.rootModel}))})).filter(Boolean)}},methods:{isNested:function(){return!0},getRef:function(t){return this.refs[this.tracker(t)]},hasIter:function(){return!0}}}),w=function(t,n){if("$each"===n)return(0,e.h)(m,n,{validations:t.validations[n],lazyParentModel:t.lazyParentModel,prop:n,lazyModel:t.getModel,rootModel:t.rootModel});var r=t.validations[n];if(Array.isArray(r)){var i=t.rootModel,o=u(r,(function(t){return function(){return h(i,i.$v,t)}}),(function(t){return Array.isArray(t)?t.join("."):t}));return(0,e.h)(l,n,{validations:o,lazyParentModel:c,prop:n,lazyModel:c,rootModel:i})}return(0,e.h)(a,n,{validations:r,lazyParentModel:t.getModel,prop:n,lazyModel:t.getModelKey,rootModel:t.rootModel})},x=function(t,n){return(0,e.h)(o,n,{rule:t.validations[n],lazyParentModel:t.lazyParentModel,lazyModel:t.getModel,rootModel:t.rootModel})};return b={VBase:i,Validation:a}},x=null;var k=function(t,n){var r=function(t){if(x)return x;for(var e=t.constructor;e.super;)e=e.super;return x=e,e}(t),i=w(r),o=i.Validation;return new(0,i.VBase)({computed:{children:function(){var r="function"==typeof n?n.call(t):n;return[(0,e.h)(o,"$v",{validations:r,lazyParentModel:c,prop:"$v",model:t,rootModel:t})]}}})},S={data:function(){var t=this.$options.validations;return t&&(this._vuelidate=k(this,t)),{}},beforeCreate:function(){var t=this.$options;t.validations&&(t.computed||(t.computed={}),t.computed.$v||(t.computed.$v=function(){return this._vuelidate?this._vuelidate.refs.$v.proxy:null}))},beforeDestroy:function(){this._vuelidate&&(this._vuelidate.$destroy(),this._vuelidate=null)}};function O(t){t.mixin(S)}t.validationMixin=S;var _=O;t.default=_}(bg);const Ng=mp(bg);export{Nm as A,Tt as B,og as C,Cl as D,Lc as E,za as F,sg as G,gg as H,Th as I,yg as J,pg as K,Ng as L,Nc as N,Vc as P,qa as S,Cc as T,Wn as V,kh as a,Ph as b,Oh as c,Ih as d,vh as e,qh as f,Wh as g,Kh as h,_l as i,Dh as j,uh as k,Hh as l,Kf as m,zl as n,Nh as o,dp as p,hp as q,fp as r,Nt as s,Sh as t,Eh as u,pp as v,Jh as w,up as x,gp as y,Je as z}; +var t=Object.freeze({}),e=Array.isArray;function n(t){return null==t}function r(t){return null!=t}function o(t){return!0===t}function i(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function s(t){return"function"==typeof t}function a(t){return null!==t&&"object"==typeof t}var l=Object.prototype.toString;function c(t){return"[object Object]"===l.call(t)}function u(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return r(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function f(t){return null==t?"":Array.isArray(t)||c(t)&&t.toString===l?JSON.stringify(t,null,2):String(t)}function h(t){var e=parseFloat(t);return isNaN(e)?t:e}function p(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o-1)return t.splice(r,1)}}var y=Object.prototype.hasOwnProperty;function b(t,e){return y.call(t,e)}function w(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var x=/-(\w)/g,k=w((function(t){return t.replace(x,(function(t,e){return e?e.toUpperCase():""}))})),S=w((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),O=/\B([A-Z])/g,M=w((function(t){return t.replace(O,"-$1").toLowerCase()}));var _=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function C(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function $(t,e){for(var n in e)t[n]=e[n];return t}function N(t){for(var e={},n=0;n0,G=K&&K.indexOf("edge/")>0;K&&K.indexOf("android");var Z,X=K&&/iphone|ipad|ipod|ios/.test(K),Q=K&&K.match(/firefox\/(\d+)/),tt={}.watch,et=!1;if(H)try{var nt={};Object.defineProperty(nt,"passive",{get:function(){et=!0}}),window.addEventListener("test-passive",null,nt)}catch(Fg){}var rt=function(){return void 0===Z&&(Z=!H&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),Z},ot=H&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function it(t){return"function"==typeof t&&/native code/.test(t.toString())}var st,at="undefined"!=typeof Symbol&&it(Symbol)&&"undefined"!=typeof Reflect&&it(Reflect.ownKeys);st="undefined"!=typeof Set&&it(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var lt=null;function ct(t){void 0===t&&(t=null),t||lt&<._scope.off(),lt=t,t&&t._scope.on()}var ut=function(){function t(t,e,n,r,o,i,s,a){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=o,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=s,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=a,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),dt=function(t){void 0===t&&(t="");var e=new ut;return e.text=t,e.isComment=!0,e};function ft(t){return new ut(void 0,void 0,void 0,String(t))}function ht(t){var e=new ut(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var pt=0,mt=[],gt=function(){function t(){this._pending=!1,this.id=pt++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){this.subs[this.subs.indexOf(t)]=null,this._pending||(this._pending=!0,mt.push(this))},t.prototype.depend=function(e){t.target&&t.target.addDep(this)},t.prototype.notify=function(t){for(var e=this.subs.filter((function(t){return t})),n=0,r=e.length;n0&&(qt((l=Jt(l,"".concat(s||"","_").concat(a)))[0])&&qt(u)&&(d[c]=ft(u.text+l[0].text),l.shift()),d.push.apply(d,l)):i(l)?qt(u)?d[c]=ft(u.text+l):""!==l&&d.push(ft(l)):qt(l)&&qt(u)?d[c]=ft(u.text+l.text):(o(t._isVList)&&r(l.tag)&&n(l.key)&&r(s)&&(l.key="__vlist".concat(s,"_").concat(a,"__")),d.push(l)));return d}function Wt(t,n,l,c,u,d){return(e(l)||i(l))&&(u=c,c=l,l=void 0),o(d)&&(u=2),function(t,n,o,i,l){if(r(o)&&r(o.__ob__))return dt();r(o)&&r(o.is)&&(n=o.is);if(!n)return dt();e(i)&&s(i[0])&&((o=o||{}).scopedSlots={default:i[0]},i.length=0);2===l?i=Vt(i):1===l&&(i=function(t){for(var n=0;n0,a=n?!!n.$stable:!s,l=n&&n.$key;if(n){if(n._normalized)return n._normalized;if(a&&o&&o!==t&&l===o.$key&&!s&&!o.$hasNormal)return o;for(var c in i={},n)n[c]&&"$"!==c[0]&&(i[c]=fe(e,r,c,n[c]))}else i={};for(var u in r)u in i||(i[u]=he(r,u));return n&&Object.isExtensible(n)&&(n._normalized=i),q(i,"$stable",a),q(i,"$key",l),q(i,"$hasNormal",s),i}function fe(t,n,r,o){var i=function(){var n=lt;ct(t);var r=arguments.length?o.apply(null,arguments):o({}),i=(r=r&&"object"==typeof r&&!e(r)?[r]:Vt(r))&&r[0];return ct(n),r&&(!i||1===r.length&&i.isComment&&!ue(i))?void 0:r};return o.proxy&&Object.defineProperty(n,r,{get:i,enumerable:!0,configurable:!0}),i}function he(t,e){return function(){return t[e]}}function pe(e){var n=e.$options,r=n.setup;if(r){var o=e._setupContext=function(e){return{get attrs(){if(!e._attrsProxy){var n=e._attrsProxy={};q(n,"_v_attr_proxy",!0),me(n,e.$attrs,t,e,"$attrs")}return e._attrsProxy},get listeners(){e._listenersProxy||me(e._listenersProxy={},e.$listeners,t,e,"$listeners");return e._listenersProxy},get slots(){return function(t){t._slotsProxy||ve(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(e)},emit:_(e.$emit,e),expose:function(t){t&&Object.keys(t).forEach((function(n){return Rt(e,t,n)}))}}}(e);ct(e),yt();var i=Ke(r,null,[e._props||Et({}),o],e,"setup");if(bt(),ct(),s(i))n.render=i;else if(a(i))if(e._setupState=i,i.__sfc){var l=e._setupProxy={};for(var c in i)"__sfc"!==c&&Rt(l,i,c)}else for(var c in i)V(c)||Rt(e,i,c)}}function me(t,e,n,r,o){var i=!1;for(var s in e)s in t?e[s]!==n[s]&&(i=!0):(i=!0,ge(t,s,r,o));for(var s in t)s in e||(i=!0,delete t[s]);return i}function ge(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[r][e]}})}function ve(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var ye,be=null;function we(t,e){return(t.__esModule||at&&"Module"===t[Symbol.toStringTag])&&(t=t.default),a(t)?e.extend(t):t}function xe(t){if(e(t))for(var n=0;ndocument.createEvent("Event").timeStamp&&(Fe=function(){return Le.now()})}var Be,Ve=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function qe(){var t,e;for(je=Fe(),Re=!0,Ae.sort(Ve),ze=0;zeze&&Ae[n].id>t.id;)n--;Ae.splice(n+1,0,t)}else Ae.push(t);Ie||(Ie=!0,sn(qe))}}(this)},t.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||a(t)||this.deep){var e=this.value;if(this.value=t,this.user){var n='callback for watcher "'.concat(this.expression,'"');Ke(this.cb,this.vm,[t,e],this.vm,n)}else this.cb.call(this.vm,t,e)}}},t.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},t.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},t.prototype.teardown=function(){if(this.vm&&!this.vm._isBeingDestroyed&&v(this.vm._scope.effects,this),this.active){for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1,this.onStop&&this.onStop()}},t}(),fn={enumerable:!0,configurable:!0,get:T,set:T};function hn(t,e,n){fn.get=function(){return this[e][n]},fn.set=function(t){this[e][n]=t},Object.defineProperty(t,n,fn)}function pn(t){var n=t.$options;if(n.props&&function(t,e){var n=t.$options.propsData||{},r=t._props=Et({}),o=t.$options._propKeys=[],i=!t.$parent;i||Mt(!1);var s=function(i){o.push(i);var s=Bn(i,e,n,t);Nt(r,i,s),i in t||hn(t,"_props",i)};for(var a in e)s(a);Mt(!0)}(t,n.props),pe(t),n.methods&&function(t,e){for(var n in t.$options.props,e)t[n]="function"!=typeof e[n]?T:_(e[n],t)}(t,n.methods),n.data)!function(t){var e=t.$options.data;e=t._data=s(e)?function(t,e){yt();try{return t.call(e,e)}catch(Fg){return He(Fg,e,"data()"),{}}finally{bt()}}(e,t):e||{},c(e)||(e={});var n=Object.keys(e),r=t.$options.props;t.$options.methods;var o=n.length;for(;o--;){var i=n[o];r&&b(r,i)||V(i)||hn(t,"_data",i)}var a=$t(e);a&&a.vmCount++}(t);else{var r=$t(t._data={});r&&r.vmCount++}n.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=rt();for(var o in e){var i=e[o],a=s(i)?i:i.get;r||(n[o]=new dn(t,a||T,T,mn)),o in t||gn(t,o,i)}}(t,n.computed),n.watch&&n.watch!==tt&&function(t,n){for(var r in n){var o=n[r];if(e(o))for(var i=0;i-1)if(i&&!b(o,"default"))a=!1;else if(""===a||a===M(t)){var c=Wn(String,o.type);(c<0||l-1:"string"==typeof t?t.split(",").indexOf(n)>-1:(r=t,"[object RegExp]"===l.call(r)&&t.test(n));var r}function Gn(t,e){var n=t.cache,r=t.keys,o=t._vnode;for(var i in n){var s=n[i];if(s){var a=s.name;a&&!e(a)&&Zn(n,i,r,o)}}}function Zn(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,v(n,e)}Hn.prototype._init=function(e){var n=this;n._uid=kn++,n._isVue=!0,n.__v_skip=!0,n._scope=new Je(!0),n._scope._vm=!0,e&&e._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(n,e):n.$options=Fn(Sn(n.constructor),e||{},n),n._renderProxy=n,n._self=n,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(n),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Me(t,e)}(n),function(e){e._vnode=null,e._staticTrees=null;var n=e.$options,r=e.$vnode=n._parentVnode,o=r&&r.context;e.$slots=le(n._renderChildren,o),e.$scopedSlots=r?de(e.$parent,r.data.scopedSlots,e.$slots):t,e._c=function(t,n,r,o){return Wt(e,t,n,r,o,!1)},e.$createElement=function(t,n,r,o){return Wt(e,t,n,r,o,!0)};var i=r&&r.data;Nt(e,"$attrs",i&&i.attrs||t,null,!0),Nt(e,"$listeners",n._parentListeners||t,null,!0)}(n),De(n,"beforeCreate",void 0,!1),function(t){var e=xn(t.$options.inject,t);e&&(Mt(!1),Object.keys(e).forEach((function(n){Nt(t,n,e[n])})),Mt(!0))}(n),pn(n),wn(n),De(n,"created"),n.$options.el&&n.$mount(n.$options.el)},function(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=Tt,t.prototype.$delete=Dt,t.prototype.$watch=function(t,e,n){var r=this;if(c(e))return bn(r,t,e,n);(n=n||{}).user=!0;var o=new dn(r,t,e,n);if(n.immediate){var i='callback for immediate watcher "'.concat(o.expression,'"');yt(),Ke(e,r,[o.value],r,i),bt()}return function(){o.teardown()}}}(Hn),function(t){var n=/^hook:/;t.prototype.$on=function(t,r){var o=this;if(e(t))for(var i=0,s=t.length;i1?C(n):n;for(var r=C(arguments,1),o='event handler for "'.concat(t,'"'),i=0,s=n.length;iparseInt(this.max)&&Zn(e,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Zn(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Gn(t,(function(t){return Yn(e,t)}))})),this.$watch("exclude",(function(e){Gn(t,(function(t){return!Yn(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=xe(t),n=e&&e.componentOptions;if(n){var r=Un(n),o=this.include,i=this.exclude;if(o&&(!r||!Yn(o,r))||i&&r&&Yn(i,r))return e;var s=this.cache,a=this.keys,l=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;s[l]?(e.componentInstance=s[l].componentInstance,v(a,l),a.push(l)):(this.vnodeToCache=e,this.keyToCache=l),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return L}};Object.defineProperty(t,"config",e),t.util={warn:An,extend:$,mergeOptions:Fn,defineReactive:Nt},t.set=Tt,t.delete=Dt,t.nextTick=sn,t.observable=function(t){return $t(t),t},t.options=Object.create(null),j.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,$(t.options.components,Qn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=C(arguments,1);return n.unshift(this),s(t.install)?t.install.apply(t,n):s(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Fn(this.options,t),this}}(t),Kn(t),function(t){j.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&c(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&s(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(Hn),Object.defineProperty(Hn.prototype,"$isServer",{get:rt}),Object.defineProperty(Hn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Hn,"FunctionalRenderContext",{value:On}),Hn.version="2.7.14";var tr=p("style,class"),er=p("input,textarea,option,select,progress"),nr=function(t,e,n){return"value"===n&&er(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},rr=p("contenteditable,draggable,spellcheck"),or=p("events,caret,typing,plaintext-only"),ir=p("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),sr="http://www.w3.org/1999/xlink",ar=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},lr=function(t){return ar(t)?t.slice(6,t.length):""},cr=function(t){return null==t||!1===t};function ur(t){for(var e=t.data,n=t,o=t;r(o.componentInstance);)(o=o.componentInstance._vnode)&&o.data&&(e=dr(o.data,e));for(;r(n=n.parent);)n&&n.data&&(e=dr(e,n.data));return function(t,e){if(r(t)||r(e))return fr(t,hr(e));return""}(e.staticClass,e.class)}function dr(t,e){return{staticClass:fr(t.staticClass,e.staticClass),class:r(t.class)?[t.class,e.class]:e.class}}function fr(t,e){return t?e?t+" "+e:t:e||""}function hr(t){return Array.isArray(t)?function(t){for(var e,n="",o=0,i=t.length;o-1?Fr(t,e,n):ir(e)?cr(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):rr(e)?t.setAttribute(e,function(t,e){return cr(e)||"false"===e?"false":"contenteditable"===t&&or(e)?e:"true"}(e,n)):ar(e)?cr(n)?t.removeAttributeNS(sr,lr(e)):t.setAttributeNS(sr,e,n):Fr(t,e,n)}function Fr(t,e,n){if(cr(n))t.removeAttribute(e);else{if(U&&!Y&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var Lr={create:zr,update:zr};function Br(t,e){var o=e.elm,i=e.data,s=t.data;if(!(n(i.staticClass)&&n(i.class)&&(n(s)||n(s.staticClass)&&n(s.class)))){var a=ur(e),l=o._transitionClasses;r(l)&&(a=fr(a,hr(l))),a!==o._prevClass&&(o.setAttribute("class",a),o._prevClass=a)}}var Vr,qr,Jr,Wr,Hr,Kr,Ur={create:Br,update:Br},Yr=/[\w).+\-_$\]]/;function Gr(t){var e,n,r,o,i,s=!1,a=!1,l=!1,c=!1,u=0,d=0,f=0,h=0;for(r=0;r=0&&" "===(m=t.charAt(p));p--);m&&Yr.test(m)||(c=!0)}}else void 0===o?(h=r+1,o=t.slice(0,r).trim()):g();function g(){(i||(i=[])).push(t.slice(h,r).trim()),h=r+1}if(void 0===o?o=t.slice(0,r).trim():0!==h&&g(),i)for(r=0;r-1?{exp:t.slice(0,Wr),key:'"'+t.slice(Wr+1)+'"'}:{exp:t,key:null};qr=t,Wr=Hr=Kr=0;for(;!po();)mo(Jr=ho())?vo(Jr):91===Jr&&go(Jr);return{exp:t.slice(0,Hr),key:t.slice(Hr+1,Kr)}}(t);return null===n.key?"".concat(t,"=").concat(e):"$set(".concat(n.exp,", ").concat(n.key,", ").concat(e,")")}function ho(){return qr.charCodeAt(++Wr)}function po(){return Wr>=Vr}function mo(t){return 34===t||39===t}function go(t){var e=1;for(Hr=Wr;!po();)if(mo(t=ho()))vo(t);else if(91===t&&e++,93===t&&e--,0===e){Kr=Wr;break}}function vo(t){for(var e=t;!po()&&(t=ho())!==e;);}var yo,bo="__r",wo="__c";function xo(t,e,n){var r=yo;return function o(){var i=e.apply(null,arguments);null!==i&&Oo(t,o,n,r)}}var ko=Ze&&!(Q&&Number(Q[1])<=53);function So(t,e,n,r){if(ko){var o=je,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}yo.addEventListener(t,e,et?{capture:n,passive:r}:n)}function Oo(t,e,n,r){(r||yo).removeEventListener(t,e._wrapper||e,n)}function Mo(t,e){if(!n(t.data.on)||!n(e.data.on)){var o=e.data.on||{},i=t.data.on||{};yo=e.elm||t.elm,function(t){if(r(t[bo])){var e=U?"change":"input";t[e]=[].concat(t[bo],t[e]||[]),delete t[bo]}r(t[wo])&&(t.change=[].concat(t[wo],t.change||[]),delete t[wo])}(o),Ft(o,i,So,Oo,xo,e.context),yo=void 0}}var _o,Co={create:Mo,update:Mo,destroy:function(t){return Mo(t,_r)}};function $o(t,e){if(!n(t.data.domProps)||!n(e.data.domProps)){var i,s,a=e.elm,l=t.data.domProps||{},c=e.data.domProps||{};for(i in(r(c.__ob__)||o(c._v_attr_proxy))&&(c=e.data.domProps=$({},c)),l)i in c||(a[i]="");for(i in c){if(s=c[i],"textContent"===i||"innerHTML"===i){if(e.children&&(e.children.length=0),s===l[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i&&"PROGRESS"!==a.tagName){a._value=s;var u=n(s)?"":String(s);No(a,u)&&(a.value=u)}else if("innerHTML"===i&&gr(a.tagName)&&n(a.innerHTML)){(_o=_o||document.createElement("div")).innerHTML="".concat(s,"");for(var d=_o.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;d.firstChild;)a.appendChild(d.firstChild)}else if(s!==l[i])try{a[i]=s}catch(Fg){}}}}function No(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(Fg){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,o=t._vModifiers;if(r(o)){if(o.number)return h(n)!==h(e);if(o.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var To={create:$o,update:$o},Do=w((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function Ao(t){var e=Eo(t.style);return t.staticStyle?$(t.staticStyle,e):e}function Eo(t){return Array.isArray(t)?N(t):"string"==typeof t?Do(t):t}var Po,Io=/^--/,Ro=/\s*!important$/,zo=function(t,e,n){if(Io.test(e))t.style.setProperty(e,n);else if(Ro.test(n))t.style.setProperty(M(e),n.replace(Ro,""),"important");else{var r=Fo(e);if(Array.isArray(n))for(var o=0,i=n.length;o-1?e.split(Vo).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Jo(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Vo).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function Wo(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&$(e,Ho(t.name||"v")),$(e,t),e}return"string"==typeof t?Ho(t):void 0}}var Ho=w((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),Ko=H&&!Y,Uo="transition",Yo="animation",Go="transition",Zo="transitionend",Xo="animation",Qo="animationend";Ko&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Go="WebkitTransition",Zo="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Xo="WebkitAnimation",Qo="webkitAnimationEnd"));var ti=H?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function ei(t){ti((function(){ti(t)}))}function ni(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),qo(t,e))}function ri(t,e){t._transitionClasses&&v(t._transitionClasses,e),Jo(t,e)}function oi(t,e,n){var r=si(t,e),o=r.type,i=r.timeout,s=r.propCount;if(!o)return n();var a=o===Uo?Zo:Qo,l=0,c=function(){t.removeEventListener(a,u),n()},u=function(e){e.target===t&&++l>=s&&c()};setTimeout((function(){l0&&(n=Uo,u=s,d=i.length):e===Yo?c>0&&(n=Yo,u=c,d=l.length):d=(n=(u=Math.max(s,c))>0?s>c?Uo:Yo:null)?n===Uo?i.length:l.length:0,{type:n,timeout:u,propCount:d,hasTransform:n===Uo&&ii.test(r[Go+"Property"])}}function ai(t,e){for(;t.length1}function hi(t,e){!0!==e.data.show&&ci(e)}var pi=function(t){var s,a,l={},c=t.modules,u=t.nodeOps;for(s=0;sp?w(t,n(o[v+1])?null:o[v+1].elm,o,h,v,i):h>v&&k(e,d,p)}(d,m,g,i,c):r(g)?(r(t.text)&&u.setTextContent(d,""),w(d,null,g,0,g.length-1,i)):r(m)?k(m,0,m.length-1):r(t.text)&&u.setTextContent(d,""):t.text!==e.text&&u.setTextContent(d,e.text),r(p)&&r(h=p.hook)&&r(h=h.postpatch)&&h(t,e)}}}function _(t,e,n){if(o(n)&&r(t.parent))t.parent.data.pendingInsert=e;else for(var i=0;i-1,s.selected!==i&&(s.selected=i);else if(E(bi(s),r))return void(t.selectedIndex!==a&&(t.selectedIndex=a));o||(t.selectedIndex=-1)}}function yi(t,e){return e.every((function(e){return!E(e,t)}))}function bi(t){return"_value"in t?t._value:t.value}function wi(t){t.target.composing=!0}function xi(t){t.target.composing&&(t.target.composing=!1,ki(t.target,"input"))}function ki(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Si(t){return!t.componentInstance||t.data&&t.data.transition?t:Si(t.componentInstance._vnode)}var Oi={model:mi,show:{bind:function(t,e,n){var r=e.value,o=(n=Si(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,ci(n,(function(){t.style.display=i}))):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=Si(n)).data&&n.data.transition?(n.data.show=!0,r?ci(n,(function(){t.style.display=t.__vOriginalDisplay})):ui(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}}},Mi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function _i(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?_i(xe(e.children)):t}function Ci(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var r in o)e[k(r)]=o[r];return e}function $i(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Ni=function(t){return t.tag||ue(t)},Ti=function(t){return"show"===t.name},Di={name:"transition",props:Mi,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Ni)).length){var r=this.mode,o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var s=_i(o);if(!s)return o;if(this._leaving)return $i(t,o);var a="__transition-".concat(this._uid,"-");s.key=null==s.key?s.isComment?a+"comment":a+s.tag:i(s.key)?0===String(s.key).indexOf(a)?s.key:a+s.key:s.key;var l=(s.data||(s.data={})).transition=Ci(this),c=this._vnode,u=_i(c);if(s.data.directives&&s.data.directives.some(Ti)&&(s.data.show=!0),u&&u.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(s,u)&&!ue(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var d=u.data.transition=$({},l);if("out-in"===r)return this._leaving=!0,Lt(d,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),$i(t,o);if("in-out"===r){if(ue(s))return c;var f,h=function(){f()};Lt(l,"afterEnter",h),Lt(l,"enterCancelled",h),Lt(d,"delayLeave",(function(t){f=t}))}}return o}}},Ai=$({tag:String,moveClass:String},Mi);function Ei(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Pi(t){t.data.newPos=t.elm.getBoundingClientRect()}function Ii(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,o=e.top-n.top;if(r||o){t.data.moved=!0;var i=t.elm.style;i.transform=i.WebkitTransform="translate(".concat(r,"px,").concat(o,"px)"),i.transitionDuration="0s"}}delete Ai.mode;var Ri={Transition:Di,TransitionGroup:{props:Ai,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=Ce(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],s=Ci(this),a=0;a-1?br[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:br[t]=/HTMLUnknownElement/.test(e.toString())},$(Hn.options.directives,Oi),$(Hn.options.components,Ri),Hn.prototype.__patch__=H?pi:T,Hn.prototype.$mount=function(t,e){return function(t,e,n){var r;t.$el=e,t.$options.render||(t.$options.render=dt),De(t,"beforeMount"),r=function(){t._update(t._render(),n)},new dn(t,r,T,{before:function(){t._isMounted&&!t._isDestroyed&&De(t,"beforeUpdate")}},!0),n=!1;var o=t._preWatchers;if(o)for(var i=0;i\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Ui=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Yi="[a-zA-Z_][\\-\\.0-9_a-zA-Z".concat(B.source,"]*"),Gi="((?:".concat(Yi,"\\:)?").concat(Yi,")"),Zi=new RegExp("^<".concat(Gi)),Xi=/^\s*(\/?)>/,Qi=new RegExp("^<\\/".concat(Gi,"[^>]*>")),ts=/^]+>/i,es=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},as=/&(?:lt|gt|quot|amp|#39);/g,ls=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,cs=p("pre,textarea",!0),us=function(t,e){return t&&cs(t)&&"\n"===e[0]};function ds(t,e){var n=e?ls:as;return t.replace(n,(function(t){return ss[t]}))}function fs(t,e){for(var n,r,o=[],i=e.expectHTML,s=e.isUnaryTag||D,a=e.canBeLeftOpenTag||D,l=0,c=function(){if(n=t,r&&rs(r)){var c=0,f=r.toLowerCase(),h=is[f]||(is[f]=new RegExp("([\\s\\S]*?)(]*>)","i"));k=t.replace(h,(function(t,n,r){return c=r.length,rs(f)||"noscript"===f||(n=n.replace(//g,"$1").replace(//g,"$1")),us(f,n)&&(n=n.slice(1)),e.chars&&e.chars(n),""}));l+=t.length-k.length,t=k,d(f,l-c,l)}else{var p=t.indexOf("<");if(0===p){if(es.test(t)){var m=t.indexOf("--\x3e");if(m>=0)return e.shouldKeepComment&&e.comment&&e.comment(t.substring(4,m),l,l+m+3),u(m+3),"continue"}if(ns.test(t)){var g=t.indexOf("]>");if(g>=0)return u(g+2),"continue"}var v=t.match(ts);if(v)return u(v[0].length),"continue";var y=t.match(Qi);if(y){var b=l;return u(y[0].length),d(y[1],b,l),"continue"}var w=function(){var e=t.match(Zi);if(e){var n={tagName:e[1],attrs:[],start:l};u(e[0].length);for(var r=void 0,o=void 0;!(r=t.match(Xi))&&(o=t.match(Ui)||t.match(Ki));)o.start=l,u(o[0].length),o.end=l,n.attrs.push(o);if(r)return n.unarySlash=r[1],u(r[0].length),n.end=l,n}}();if(w)return function(t){var n=t.tagName,l=t.unarySlash;i&&("p"===r&&Hi(n)&&d(r),a(n)&&r===n&&d(n));for(var c=s(n)||!!l,u=t.attrs.length,f=new Array(u),h=0;h=0){for(k=t.slice(p);!(Qi.test(k)||Zi.test(k)||es.test(k)||ns.test(k)||(S=k.indexOf("<",1))<0);)p+=S,k=t.slice(p);x=t.substring(0,p)}p<0&&(x=t),x&&u(x.length),e.chars&&x&&e.chars(x,l-x.length,l)}if(t===n)return e.chars&&e.chars(t),"break"};t;){if("break"===c())break}function u(e){l+=e,t=t.substring(e)}function d(t,n,i){var s,a;if(null==n&&(n=l),null==i&&(i=l),t)for(a=t.toLowerCase(),s=o.length-1;s>=0&&o[s].lowerCasedTag!==a;s--);else s=0;if(s>=0){for(var c=o.length-1;c>=s;c--)e.end&&e.end(o[c].tag,n,i);o.length=s,r=s&&o[s-1].tag}else"br"===a?e.start&&e.start(t,[],!0,n,i):"p"===a&&(e.start&&e.start(t,[],!1,n,i),e.end&&e.end(t,n,i))}d()}var hs,ps,ms,gs,vs,ys,bs,ws,xs=/^@|^v-on:/,ks=/^v-|^@|^:|^#/,Ss=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Os=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Ms=/^\(|\)$/g,_s=/^\[.*\]$/,Cs=/:(.*)$/,$s=/^:|^\.|^v-bind:/,Ns=/\.[^.\]]+(?=[^\]]*$)/g,Ts=/^v-slot(:|$)|^#/,Ds=/[\r\n]/,As=/[ \f\t\r\n]+/g,Es=w(qi),Ps="_empty_";function Is(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:Vs(e),rawAttrsMap:{},parent:n,children:[]}}function Rs(t,e){hs=e.warn||Xr,ys=e.isPreTag||D,bs=e.mustUseProp||D,ws=e.getTagNamespace||D,e.isReservedTag,ms=Qr(e.modules,"transformNode"),gs=Qr(e.modules,"preTransformNode"),vs=Qr(e.modules,"postTransformNode"),ps=e.delimiters;var n,r,o=[],i=!1!==e.preserveWhitespace,s=e.whitespace,a=!1,l=!1;function c(t){if(u(t),a||t.processed||(t=zs(t,e)),o.length||t===n||n.if&&(t.elseif||t.else)&&Fs(n,{exp:t.elseif,block:t}),r&&!t.forbidden)if(t.elseif||t.else)s=t,c=function(t){for(var e=t.length;e--;){if(1===t[e].type)return t[e];t.pop()}}(r.children),c&&c.if&&Fs(c,{exp:s.elseif,block:s});else{if(t.slotScope){var i=t.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[i]=t}r.children.push(t),t.parent=r}var s,c;t.children=t.children.filter((function(t){return!t.slotScope})),u(t),t.pre&&(a=!1),ys(t.tag)&&(l=!1);for(var d=0;dl&&(a.push(i=t.slice(l,o)),s.push(JSON.stringify(i)));var c=Gr(r[1].trim());s.push("_s(".concat(c,")")),a.push({"@binding":c}),l=o+r[0].length}return l-1")+("true"===i?":(".concat(e,")"):":_q(".concat(e,",").concat(i,")"))),io(t,"change","var $$a=".concat(e,",")+"$$el=$event.target,"+"$$c=$$el.checked?(".concat(i,"):(").concat(s,");")+"if(Array.isArray($$a)){"+"var $$v=".concat(r?"_n("+o+")":o,",")+"$$i=_i($$a,$$v);"+"if($$el.checked){$$i<0&&(".concat(fo(e,"$$a.concat([$$v])"),")}")+"else{$$i>-1&&(".concat(fo(e,"$$a.slice(0,$$i).concat($$a.slice($$i+1))"),")}")+"}else{".concat(fo(e,"$$c"),"}"),null,!0)}(t,r,o);else if("input"===i&&"radio"===s)!function(t,e,n){var r=n&&n.number,o=so(t,"value")||"null";o=r?"_n(".concat(o,")"):o,to(t,"checked","_q(".concat(e,",").concat(o,")")),io(t,"change",fo(e,o),null,!0)}(t,r,o);else if("input"===i||"textarea"===i)!function(t,e,n){var r=t.attrsMap.type,o=n||{},i=o.lazy,s=o.number,a=o.trim,l=!i&&"range"!==r,c=i?"change":"range"===r?bo:"input",u="$event.target.value";a&&(u="$event.target.value.trim()");s&&(u="_n(".concat(u,")"));var d=fo(e,u);l&&(d="if($event.target.composing)return;".concat(d));to(t,"value","(".concat(e,")")),io(t,c,d,null,!0),(a||s)&&io(t,"blur","$forceUpdate()")}(t,r,o);else if(!L.isReservedTag(i))return uo(t,r,o),!1;return!0},text:function(t,e){e.value&&to(t,"textContent","_s(".concat(e.value,")"),e)},html:function(t,e){e.value&&to(t,"innerHTML","_s(".concat(e.value,")"),e)}},Zs={expectHTML:!0,modules:Hs,directives:Gs,isPreTag:function(t){return"pre"===t},isUnaryTag:Ji,mustUseProp:nr,canBeLeftOpenTag:Wi,isReservedTag:vr,getTagNamespace:yr,staticKeys:(Ks=Hs,Ks.reduce((function(t,e){return t.concat(e.staticKeys||[])}),[]).join(","))},Xs=w((function(t){return p("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(t?","+t:""))}));function Qs(t,e){t&&(Us=Xs(e.staticKeys||""),Ys=e.isReservedTag||D,ta(t),ea(t,!1))}function ta(t){if(t.static=function(t){if(2===t.type)return!1;if(3===t.type)return!0;return!(!t.pre&&(t.hasBindings||t.if||t.for||m(t.tag)||!Ys(t.tag)||function(t){for(;t.parent;){if("template"!==(t=t.parent).tag)return!1;if(t.for)return!0}return!1}(t)||!Object.keys(t).every(Us)))}(t),1===t.type){if(!Ys(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var e=0,n=t.children.length;e|^function(?:\s+[\w$]+)?\s*\(/,ra=/\([^)]*?\);*$/,oa=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,ia={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},sa={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},aa=function(t){return"if(".concat(t,")return null;")},la={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:aa("$event.target !== $event.currentTarget"),ctrl:aa("!$event.ctrlKey"),shift:aa("!$event.shiftKey"),alt:aa("!$event.altKey"),meta:aa("!$event.metaKey"),left:aa("'button' in $event && $event.button !== 0"),middle:aa("'button' in $event && $event.button !== 1"),right:aa("'button' in $event && $event.button !== 2")};function ca(t,e){var n=e?"nativeOn:":"on:",r="",o="";for(var i in t){var s=ua(t[i]);t[i]&&t[i].dynamic?o+="".concat(i,",").concat(s,","):r+='"'.concat(i,'":').concat(s,",")}return r="{".concat(r.slice(0,-1),"}"),o?n+"_d(".concat(r,",[").concat(o.slice(0,-1),"])"):n+r}function ua(t){if(!t)return"function(){}";if(Array.isArray(t))return"[".concat(t.map((function(t){return ua(t)})).join(","),"]");var e=oa.test(t.value),n=na.test(t.value),r=oa.test(t.value.replace(ra,""));if(t.modifiers){var o="",i="",s=[],a=function(e){if(la[e])i+=la[e],ia[e]&&s.push(e);else if("exact"===e){var n=t.modifiers;i+=aa(["ctrl","shift","alt","meta"].filter((function(t){return!n[t]})).map((function(t){return"$event.".concat(t,"Key")})).join("||"))}else s.push(e)};for(var l in t.modifiers)a(l);s.length&&(o+=function(t){return"if(!$event.type.indexOf('key')&&"+"".concat(t.map(da).join("&&"),")return null;")}(s)),i&&(o+=i);var c=e?"return ".concat(t.value,".apply(null, arguments)"):n?"return (".concat(t.value,").apply(null, arguments)"):r?"return ".concat(t.value):t.value;return"function($event){".concat(o).concat(c,"}")}return e||n?t.value:"function($event){".concat(r?"return ".concat(t.value):t.value,"}")}function da(t){var e=parseInt(t,10);if(e)return"$event.keyCode!==".concat(e);var n=ia[t],r=sa[t];return"_k($event.keyCode,"+"".concat(JSON.stringify(t),",")+"".concat(JSON.stringify(n),",")+"$event.key,"+"".concat(JSON.stringify(r))+")"}var fa={on:function(t,e){t.wrapListeners=function(t){return"_g(".concat(t,",").concat(e.value,")")}},bind:function(t,e){t.wrapData=function(n){return"_b(".concat(n,",'").concat(t.tag,"',").concat(e.value,",").concat(e.modifiers&&e.modifiers.prop?"true":"false").concat(e.modifiers&&e.modifiers.sync?",true":"",")")}},cloak:T},ha=function(t){this.options=t,this.warn=t.warn||Xr,this.transforms=Qr(t.modules,"transformCode"),this.dataGenFns=Qr(t.modules,"genData"),this.directives=$($({},fa),t.directives);var e=t.isReservedTag||D;this.maybeComponent=function(t){return!!t.component||!e(t.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function pa(t,e){var n=new ha(e),r=t?"script"===t.tag?"null":ma(t,n):'_c("div")';return{render:"with(this){return ".concat(r,"}"),staticRenderFns:n.staticRenderFns}}function ma(t,e){if(t.parent&&(t.pre=t.pre||t.parent.pre),t.staticRoot&&!t.staticProcessed)return ga(t,e);if(t.once&&!t.onceProcessed)return va(t,e);if(t.for&&!t.forProcessed)return wa(t,e);if(t.if&&!t.ifProcessed)return ya(t,e);if("template"!==t.tag||t.slotTarget||e.pre){if("slot"===t.tag)return function(t,e){var n=t.slotName||'"default"',r=Oa(t,e),o="_t(".concat(n).concat(r?",function(){return ".concat(r,"}"):""),i=t.attrs||t.dynamicAttrs?Ca((t.attrs||[]).concat(t.dynamicAttrs||[]).map((function(t){return{name:k(t.name),value:t.value,dynamic:t.dynamic}}))):null,s=t.attrsMap["v-bind"];!i&&!s||r||(o+=",null");i&&(o+=",".concat(i));s&&(o+="".concat(i?"":",null",",").concat(s));return o+")"}(t,e);var n=void 0;if(t.component)n=function(t,e,n){var r=e.inlineTemplate?null:Oa(e,n,!0);return"_c(".concat(t,",").concat(xa(e,n)).concat(r?",".concat(r):"",")")}(t.component,t,e);else{var r=void 0,o=e.maybeComponent(t);(!t.plain||t.pre&&o)&&(r=xa(t,e));var i=void 0,s=e.options.bindings;o&&s&&!1!==s.__isScriptSetup&&(i=function(t,e){var n=k(e),r=S(n),o=function(o){return t[e]===o?e:t[n]===o?n:t[r]===o?r:void 0},i=o("setup-const")||o("setup-reactive-const");if(i)return i;var s=o("setup-let")||o("setup-ref")||o("setup-maybe-ref");if(s)return s}(s,t.tag)),i||(i="'".concat(t.tag,"'"));var a=t.inlineTemplate?null:Oa(t,e,!0);n="_c(".concat(i).concat(r?",".concat(r):"").concat(a?",".concat(a):"",")")}for(var l=0;l>>0}(s)):"",")")}(t,t.scopedSlots,e),",")),t.model&&(n+="model:{value:".concat(t.model.value,",callback:").concat(t.model.callback,",expression:").concat(t.model.expression,"},")),t.inlineTemplate){var i=function(t,e){var n=t.children[0];if(n&&1===n.type){var r=pa(n,e.options);return"inlineTemplate:{render:function(){".concat(r.render,"},staticRenderFns:[").concat(r.staticRenderFns.map((function(t){return"function(){".concat(t,"}")})).join(","),"]}")}}(t,e);i&&(n+="".concat(i,","))}return n=n.replace(/,$/,"")+"}",t.dynamicAttrs&&(n="_b(".concat(n,',"').concat(t.tag,'",').concat(Ca(t.dynamicAttrs),")")),t.wrapData&&(n=t.wrapData(n)),t.wrapListeners&&(n=t.wrapListeners(n)),n}function ka(t){return 1===t.type&&("slot"===t.tag||t.children.some(ka))}function Sa(t,e){var n=t.attrsMap["slot-scope"];if(t.if&&!t.ifProcessed&&!n)return ya(t,e,Sa,"null");if(t.for&&!t.forProcessed)return wa(t,e,Sa);var r=t.slotScope===Ps?"":String(t.slotScope),o="function(".concat(r,"){")+"return ".concat("template"===t.tag?t.if&&n?"(".concat(t.if,")?").concat(Oa(t,e)||"undefined",":undefined"):Oa(t,e)||"undefined":ma(t,e),"}"),i=r?"":",proxy:true";return"{key:".concat(t.slotTarget||'"default"',",fn:").concat(o).concat(i,"}")}function Oa(t,e,n,r,o){var i=t.children;if(i.length){var s=i[0];if(1===i.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var a=n?e.maybeComponent(s)?",1":",0":"";return"".concat((r||ma)(s,e)).concat(a)}var l=n?function(t,e){for(var n=0,r=0;r':'
',Aa.innerHTML.indexOf(" ")>0}var Ra=!!H&&Ia(!1),za=!!H&&Ia(!0),ja=w((function(t){var e=xr(t);return e&&e.innerHTML})),Fa=Hn.prototype.$mount;function La(t){this.content=t}function Ba(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let t=0;o.text[t]==i.text[t];t++)n++;return n}if(o.content.size||i.content.size){let t=Ba(o.content,i.content,n+1);if(null!=t)return t}n+=o.nodeSize}else n+=o.nodeSize}}function Va(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let t=0,e=Math.min(s.text.length,a.text.length);for(;t>1}},La.from=function(t){if(t instanceof La)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new La(e)};class qa{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let n=0;nt&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,t-o),Math.min(a.content.size,e-o),n,r+o)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let o="",i=!0;return this.nodesBetween(t,e,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf?(r?o+="function"==typeof r?r(s):r:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);ot)for(let o=0,i=0;it&&((ie)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),n.push(s),r+=s.nodeSize),i=a}return new qa(n,r)}cutByIndex(t,e){return t==e?qa.empty:0==t&&e==this.content.length?this:new qa(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new qa(r,o)}addToStart(t){return new qa([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new qa(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;ethis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?Wa(n+1,o):Wa(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((t=>t.toJSON())):null}static fromJSON(t,e){if(!e)return qa.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new qa(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return qa.empty;let e,n=0;for(let r=0;rthis.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;et.type.rank-e.type.rank)),e}}Ka.none=[];class Ua extends Error{}class Ya{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=Za(this.content,t+this.openStart,e);return n&&new Ya(n,this.openStart,this.openEnd)}removeBetween(t,e){return new Ya(Ga(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return Ya.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new Ya(qa.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)n++;for(let o=t.lastChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.lastChild)r++;return new Ya(t,n,r)}}function Ga(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Ga(i.content,e-o-1,n-o-1)))}function Za(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=Za(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function Xa(t,e,n){if(n.openStart>t.depth)throw new Ua("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Ua("Inconsistent open depths");return Qa(t,e,n,0)}function Qa(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r=0;o--)r=e.node(o).copy(qa.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return ol(i,il(t,o,s,e,r))}{let r=t.parent,o=r.content;return ol(r,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}}return ol(i,sl(t,e,r))}function tl(t,e){if(!e.type.compatibleContent(t.type))throw new Ua("Cannot join "+e.type.name+" onto "+t.type.name)}function el(t,e,n){let r=t.node(n);return tl(r,e.node(n)),r}function nl(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function rl(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(nl(t.nodeAfter,r),i++));for(let a=i;ao&&el(t,e,o+1),s=r.depth>o&&el(n,r,o+1),a=[];return rl(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(tl(i,s),nl(ol(i,il(t,e,n,r,o+1)),a)):(i&&nl(ol(i,sl(t,e,o+1)),a),rl(e,n,o,a),s&&nl(ol(s,sl(n,r,o+1)),a)),rl(r,null,o,a),new qa(a)}function sl(t,e,n){let r=[];if(rl(null,t,n,r),t.depth>n){nl(ol(el(t,e,n+1),sl(t,e,n+1)),r)}return rl(e,null,n,r),new qa(r)}Ya.empty=new Ya(qa.empty,0,0);class al{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let o=0;o0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new dl(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,o=e;for(let i=t;;){let{index:t,offset:e}=i.content.findIndex(o),s=o-e;if(n.push(i,t,r+e),!s)break;if(i=i.child(t),i.isText)break;o=s-1,r+=e+1}return new al(e,n,o)}static resolveCached(t,e){for(let r=0;rt&&this.nodesBetween(t,e,(t=>(n.isInSet(t.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),ml(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=qa.empty,r=0,o=n.childCount){let i=this.contentMatchAt(t).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let a=r;at.type.name))}`);this.content.forEach((t=>t.check()))}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((t=>t.toJSON()))),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=qa.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}hl.prototype.text=void 0;class pl extends hl{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ml(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new pl(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new pl(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function ml(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class gl{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new vl(t,e);if(null==n.next)return gl.empty;let r=yl(n);n.next&&n.err("Unexpected trailing text");let o=function(t){let e=Object.create(null);return n(Ol(t,0));function n(r){let o=[];r.forEach((e=>{t[e].forEach((({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)}))}))}));let i=e[r.join(",")]=new gl(r.indexOf(t.length-1)>-1);for(let t=0;tt.to=e))}function i(t,e){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(i(n,e))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(e,s),o(i(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return o(i(t.expr,e),s),o(i(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(i(t.expr,e));if("range"==t.type){let s=e;for(let e=0;et.createAndFill())));for(let t=0;t=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let r=0;r{let r=n+(e.validEnd?"*":" ")+" ";for(let o=0;o"+t.indexOf(e.next[o].next);return r})).join("\n")}}gl.empty=new gl(!0);class vl{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function yl(t){let e=[];do{e.push(bl(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function bl(t){let e=[];do{e.push(wl(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function wl(t){let e=function(t){if(t.eat("(")){let e=yl(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let t=n[i];t.groups.indexOf(e)>-1&&o.push(t)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=kl(t,e)}return e}function xl(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function kl(t,e){let n=xl(t),r=n;return t.eat(",")&&(r="}"!=t.next?xl(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Sl(t,e){return e-t}function Ol(t,e){let n=[];return function e(r){let o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(let t=0;t-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;en[t]=new $l(t,e,r)));let r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};class Nl{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Tl{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=Cl(r.attrs),this.excluded=null;let o=Ml(this.attrs);this.instance=o?new Ka(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Ka(this,_l(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,o)=>n[t]=new Tl(t,r++,e,o))),n}removeFromSet(t){for(var e=0;e-1}}class Dl{constructor(t){this.cached=Object.create(null);let e=this.spec={};for(let r in t)e[r]=t[r];e.nodes=La.from(t.nodes),e.marks=La.from(t.marks||{}),this.nodes=$l.compile(this.spec.nodes,this),this.marks=Tl.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let t=this.nodes[r],e=t.spec.content||"",o=t.spec.marks;t.contentMatch=n[e]||(n[e]=gl.parse(e,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.markSet="_"==o?null:o?Al(this,o.split(" ")):""!=o&&t.inlineContent?null:[]}for(let r in this.marks){let t=this.marks[r],e=t.spec.excludes;t.excluded=null==e?[t]:""==e?[]:Al(this,e.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof $l))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new pl(n,n.defaultAttrs,t,Ka.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return hl.fromJSON(this,t)}markFromJSON(t){return Ka.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function Al(t,e){let n=[];for(let r=0;r-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class El{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)})),this.normalizeLists=!this.tags.some((e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}parse(t,e={}){let n=new Fl(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new Fl(this,e,!0);return n.addAll(t,e.from,e.to),Ya.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;rt.length&&(61!=i.charCodeAt(t.length)||i.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r{n(t=Bl(t)),t.mark=r}))}for(let r in t.nodes){let e=t.nodes[r].spec.parseDOM;e&&e.forEach((t=>{n(t=Bl(t)),t.node=r}))}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new El(t,El.schemaRules(t)))}}const Pl={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Il={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Rl={ol:!0,ul:!0};function zl(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class jl{constructor(t,e,n,r,o,i,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=Ka.none,this.stashMarks=[],this.match=i||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(qa.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=qa.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(qa.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;ethis.insertNode(t)));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,i&&this.removePendingMark(i,s)}addAll(t,e,n){let r=e||0;for(let o=e?t.childNodes[e]:t.firstChild,i=null==n?null:t.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(o);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(let r=0;rthis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(t,s)=>{for(;t>=0;t--){let a=e[t];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=o;s--)if(i(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return i(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(t){let e=function(t,e){for(let n=0;n=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function Ll(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Bl(t){let e={};for(let n in t)e[n]=t[n];return e}function Vl(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=t=>{i.push(t);for(let n=0;n{if(o.length||t.marks.length){let n=0,i=0;for(;n=0;r--){let o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&ql.renderSpec(Wl(n),r(t,e))}static renderSpec(t,e,n=null){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let r,o=e[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s=n?t.createElementNS(n,o):t.createElement(o),a=e[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let t in a)if(null!=a[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):s.setAttribute(t,a[t])}}for(let c=l;cl)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:i}=ql.renderSpec(t,o,n);if(s.appendChild(e),i){if(r)throw new RangeError("Multiple content holes");r=i}}}return{dom:s,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new ql(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=Jl(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return Jl(t.marks)}}function Jl(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Wl(t){return t.document||window.document}const Hl=Math.pow(2,16);function Kl(t){return 65535&t}class Ul{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Yl{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&Yl.empty)return Yl.empty}recover(t){let e=0,n=Kl(t);if(!this.inverted)for(let r=0;rt)break;let l=this.ranges[s+o],c=this.ranges[s+i],u=a+l;if(t<=u){let o=a+r+((l?t==a?-1:t==u?1:e:e)<0?0:c);if(n)return o;let i=t==(e<0?a:u)?null:s/3+(t-a)*Hl,d=t==a?2:t==u?1:4;return(e<0?t!=a:t!=u)&&(d|=8),new Ul(o,d,i)}r+=c-l}return n?t+r:new Ul(t+r,0,null)}touches(t,e){let n=0,r=Kl(e),o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;st)break;let a=this.ranges[s+o];if(t<=e+a&&s==3*r)return!0;n+=this.ranges[s+i]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new Gl;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;no&&et.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),r),e.openStart,e.openEnd);return Ql.fromReplace(t,this.from,this.to,o)}invert(){return new nc(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new ec(e.pos,n.pos,this.mark)}merge(t){return t instanceof ec&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ec(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ec(e.from,e.to,t.markFromJSON(e.mark))}}Xl.jsonID("addMark",ec);class nc extends Xl{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new Ya(tc(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return Ql.fromReplace(t,this.from,this.to,n)}invert(){return new ec(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new nc(e.pos,n.pos,this.mark)}merge(t){return t instanceof nc&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new nc(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new nc(e.from,e.to,t.markFromJSON(e.mark))}}Xl.jsonID("removeMark",nc);class rc extends Xl{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return Ql.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return Ql.fromReplace(t,this.pos,this.pos+1,new Ya(qa.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;nn.pos?null:new sc(e.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new sc(e.from,e.to,e.gapFrom,e.gapTo,Ya.fromJSON(t,e.slice),e.insert,!!e.structure)}}function ac(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let t=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,o--}}return!1}function lc(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function cc(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(ni;c--,u--){let t=o.node(c),e=o.index(c);if(t.type.spec.isolating)return!1;let n=t.content.cutByIndex(e,t.childCount),i=r&&r[u]||t;if(i!=t&&(n=n.replaceChild(0,i.type.create(i.attrs))),!t.canReplace(e+1,t.childCount)||!i.type.validContent(n))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function hc(t,e){let n=t.resolve(e),r=n.index();return o=n.nodeBefore,i=n.nodeAfter,!(!o||!i||o.isLeaf||!o.canAppend(i))&&n.parent.canReplace(r,r+1);var o,i}function pc(t,e,n=e,r=Ya.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return mc(o,i,r)?new ic(e,n,r):new gc(o,i,r).fit()}function mc(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}Xl.jsonID("replaceAround",sc);class gc{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=qa.empty;for(let r=0;r<=t.depth;r++){let e=t.node(r);this.frontier.push({type:e.type,match:e.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=qa.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new Ya(o,i,s);return t>-1?new sc(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new ic(n.pos,r.pos,a):null}findFittable(){for(let t=1;t<=2;t++)for(let e=this.unplaced.openStart;e>=0;e--){let n,r=null;e?(r=bc(this.unplaced.content,e-1).firstChild,n=r.content):n=this.unplaced.content;let o=n.firstChild;for(let i=this.depth;i>=0;i--){let n,{type:s,match:a}=this.frontier[i],l=null;if(1==t&&(o?a.matchType(o.type)||(l=a.fillBefore(qa.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:e,frontierDepth:i,parent:r,inject:l};if(2==t&&o&&(n=a.findWrapping(o.type)))return{sliceDepth:e,frontierDepth:i,parent:r,wrap:n};if(r&&a.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=bc(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new Ya(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=bc(t,e);if(r.childCount<=1&&e>0){let o=t.size-e<=e+r.size;this.unplaced=new Ya(vc(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new Ya(vc(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let p=0;p1||0==a||t.content.size)&&(u=e,c.push(wc(t.mark(d.allowedMarks(t.marks)),1==l?a:0,l==s.childCount?f:-1)))}let h=l==s.childCount;h||(f=-1),this.placed=yc(this.placed,e,qa.from(c)),this.frontier[e].match=u,h&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let p=0,m=s;p1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],o=e=0;n--){let{match:e,type:r}=this.frontier[n],o=xc(t,n,r,e,!0);if(!o||o.childCount)continue t}return{depth:e,fit:i,move:o?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=yc(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=yc(this.placed,this.depth,qa.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(qa.empty,!0);t.childCount&&(this.placed=yc(this.placed,this.frontier.length,t))}}function vc(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(vc(t.firstChild.content,e-1,n)))}function yc(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(yc(t.lastChild.content,e-1,n)))}function bc(t,e){for(let n=0;n1&&(r=r.replaceChild(0,wc(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(qa.empty,!0)))),t.copy(r)}function xc(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(let r=n;rr){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(qa.empty,!0))}return t}function Oc(t,e){let n=[];for(let r=Math.min(t.depth,e.depth);r>=0;r--){let o=t.start(r);if(oe.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}class Mc extends Xl{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return Ql.fail("No node at attribute step's position");let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,null,e.marks);return Ql.fromReplace(t,this.pos,this.pos+1,new Ya(qa.from(r),0,e.isLeaf?0:1))}getMap(){return Yl.empty}invert(t){return new Mc(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Mc(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Mc(e.pos,e.attr,e.value)}}Xl.jsonID("attr",Mc);let _c=class extends Error{};_c=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(_c.prototype=Object.create(Error.prototype)).constructor=_c,_c.prototype.name="TransformError";class Cc{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Gl}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new _c(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=Ya.empty){let r=pc(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new Ya(qa.from(n),0,0))}delete(t,e){return this.replace(t,e,Ya.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(mc(o,i,r))return t.step(new ic(e,n,r));let s=Oc(o,t.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let f=o.depth,h=o.pos-1;f>0;f--,h--){let t=o.node(f).type.spec;if(t.defining||t.definingAsContext||t.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==h&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let t=f.firstChild;if(c.push(t),h==r.openStart)break;f=t.content}for(let f=u-1;f>=0;f--){let t=c[f].type,e=kc(t);if(e&&o.node(l).type!=t)u=f;else if(e||!t.isTextblock)break}for(let f=r.openStart;f>=0;f--){let e=(f+u+1)%(r.openStart+1),a=c[e];if(a)for(let c=0;c=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let t=s[f];t<0||(e=o.before(t),n=i.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let o=r.depth-1;o>=0;o--){let t=r.index(o);if(r.node(o).canReplaceWith(t,t,n))return r.before(o+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let t=r.indexAfter(o);if(r.node(o).canReplaceWith(t,t,n))return r.after(o+1);if(t0&&(n||r.node(e-1).canReplace(r.index(e-1),o.indexAfter(e-1))))return t.delete(r.before(e),o.after(e))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=qa.empty,d=0;for(let p=i,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,u=qa.from(r.node(p).copy(u)),d++):l--;let f=qa.empty,h=0;for(let p=i,m=!1;p>n;p--)m||o.after(p+1)=0;s--){if(r.size){let t=n[s].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=qa.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new sc(o,i,o,i,new Ya(r,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,r=null){return function(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,((e,n)=>{if(e.isTextblock&&!e.hasMarkup(r,o)&&function(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(t.doc,t.mapping.slice(i).map(n),r)){t.clearIncompatible(t.mapping.slice(i).map(n,1),r);let s=t.mapping.slice(i),a=s.map(n,1),l=s.map(n+e.nodeSize,1);return t.step(new sc(a,l,a+1,l-1,new Ya(qa.from(r.create(o,null,e.marks)),0,0),1,!0)),!1}}))}(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r=[]){return function(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new sc(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new Ya(qa.from(s),0,0),1,!0))}(this,t,e,n,r),this}setNodeAttribute(t,e,n){return this.step(new Mc(t,e,n)),this}addNodeMark(t,e){return this.step(new rc(t,e)),this}removeNodeMark(t,e){if(!(e instanceof Ka)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new oc(t,e)),this}split(t,e=1,n){return function(t,e,n=1,r){let o=t.doc.resolve(e),i=qa.empty,s=qa.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=qa.from(o.node(a).copy(i));let t=r&&r[c];s=qa.from(t?t.type.create(t.attrs,s):o.node(a).copy(s))}t.step(new ic(e,e,new Ya(i.append(s),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,r){let o,i,s=[],a=[];t.doc.nodesBetween(e,n,((t,l,c)=>{if(!t.isInline)return;let u=t.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,e),d=Math.min(l+t.nodeSize,n),f=r.addToSet(u);for(let t=0;tt.step(e))),a.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,((t,s)=>{if(!t.isInline)return;i++;let a=null;if(r instanceof Tl){let e,n=t.marks;for(;e=r.isInSet(n);)(a||(a=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(a=[r]):a=t.marks;if(a&&a.length){let r=Math.min(s+t.nodeSize,n);for(let t=0;tt.step(new nc(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return function(t,e,n,r=n.contentMatch){let o=t.doc.nodeAt(e),i=[],s=e+1;for(let a=0;a=0;a--)t.step(i[a])}(this,t,e,n),this}}const $c=Object.create(null);class Nc{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new Tc(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e=0;o--){let r=e<0?Fc(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):Fc(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(r)return r}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new zc(t.node(0))}static atStart(t){return Fc(t,t,0,0,1)||new zc(t)}static atEnd(t){return Fc(t,t,t.content.size,t.childCount,-1)||new zc(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=$c[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in $c)throw new RangeError("Duplicate use of selection JSON ID "+t);return $c[t]=e,e.prototype.jsonID=t,e}getBookmark(){return Ec.between(this.$anchor,this.$head).getBookmark()}}Nc.prototype.visible=!0;class Tc{constructor(t,e){this.$from=t,this.$to=e}}let Dc=!1;function Ac(t){Dc||t.parent.inlineContent||(Dc=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ec extends Nc{constructor(t,e=t){Ac(t),Ac(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return Nc.near(n);let r=t.resolve(e.map(this.anchor));return new Ec(r.parent.inlineContent?r:n,n)}replace(t,e=Ya.empty){if(super.replace(t,e),e==Ya.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof Ec&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Pc(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ec(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=Nc.findFrom(e,n,!0)||Nc.findFrom(e,-n,!0);if(!t)return Nc.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(Nc.findFrom(t,-n,!0)||Nc.findFrom(t,n,!0)).$anchor).posnew zc(t)};function Fc(t,e,n,r,o,i=!1){if(e.inlineContent)return Ec.create(t,n);for(let s=r-(o>0?0:1);o>0?s=0;s+=o){let r=e.child(s);if(r.isAtom){if(!i&&Ic.isSelectable(r))return Ic.create(t,n-(o<0?r.nodeSize:0))}else{let e=Fc(t,r,n+o,o<0?r.childCount:0,o,i);if(e)return e}n+=r.nodeSize*o}return null}function Lc(t,e,n){let r=t.steps.length-1;if(r{null==o&&(o=r)})),t.setSelection(Nc.near(t.doc.resolve(o),n)))}class Bc extends Cc{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return Ka.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Ka.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let o=this.storedMarks;if(!o){let t=this.doc.resolve(e);o=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.setSelection(Nc.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Vc(t,e){return e&&t?t.bind(e):t}class qc{constructor(t,e,n){this.name=t,this.init=Vc(e.init,n),this.apply=Vc(e.apply,n)}}const Jc=[new qc("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new qc("selection",{init:(t,e)=>t.selection||Nc.atStart(e.doc),apply:t=>t.selection}),new qc("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new qc("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class Wc{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Jc.slice(),e&&e.forEach((t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new qc(t.key,t.spec.state,t))}))}}class Hc{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;nt.toJSON()))),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],o=r.spec.state;o&&o.toJSON&&(e[n]=o.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new Wc(t.schema,t.plugins),o=new Hc(r);return r.fields.forEach((r=>{if("doc"==r.name)o.doc=hl.fromJSON(t.schema,e.doc);else if("selection"==r.name)o.selection=Nc.fromJSON(o.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(o.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,i))return void(o[r.name]=a.fromJSON.call(s,t,e[i],o))}o[r.name]=r.init(t,o)}})),o}}function Kc(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=Kc(o,e,{})),n[r]=o}return n}class Uc{constructor(t){this.spec=t,this.props={},t.props&&Kc(t.props,this,this.props),this.key=t.key?t.key.key:Gc("plugin")}getState(t){return t[this.key]}}const Yc=Object.create(null);function Gc(t){return t in Yc?t+"$"+ ++Yc[t]:(Yc[t]=0,t+"$")}class Zc{constructor(t="key"){this.key=Gc(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Xc=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},Qc=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let tu=null;const eu=function(t,e,n){let r=tu||(tu=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},nu=function(t,e,n,r){return n&&(ou(t,e,n,r,-1)||ou(t,e,n,r,1))},ru=/^(img|br|input|textarea|hr)$/i;function ou(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:iu(t))){let n=t.parentNode;if(!n||1!=n.nodeType||su(t)||ru.test(t.nodeName)||"false"==t.contentEditable)return!1;e=Xc(t)+(o<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?iu(t):0}}}function iu(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function su(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const au=function(t){return t.focusNode&&nu(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function lu(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const cu="undefined"!=typeof navigator?navigator:null,uu="undefined"!=typeof document?document:null,du=cu&&cu.userAgent||"",fu=/Edge\/(\d+)/.exec(du),hu=/MSIE \d/.exec(du),pu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(du),mu=!!(hu||pu||fu),gu=hu?document.documentMode:pu?+pu[1]:fu?+fu[1]:0,vu=!mu&&/gecko\/(\d+)/i.test(du);vu&&(/Firefox\/(\d+)/.exec(du)||[0,0])[1];const yu=!mu&&/Chrome\/(\d+)/.exec(du),bu=!!yu,wu=yu?+yu[1]:0,xu=!mu&&!!cu&&/Apple Computer/.test(cu.vendor),ku=xu&&(/Mobile\/\w+/.test(du)||!!cu&&cu.maxTouchPoints>2),Su=ku||!!cu&&/Mac/.test(cu.platform),Ou=/Android \d/.test(du),Mu=!!uu&&"webkitFontSmoothing"in uu.documentElement.style,_u=Mu?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Cu(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function $u(t,e){return"number"==typeof t?t:t[e]}function Nu(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Tu(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Qc(s)){if(1!=s.nodeType)continue;let t=s,n=t==i.body,a=n?Cu(i):Nu(t),l=0,c=0;if(e.topa.bottom-$u(r,"bottom")&&(c=e.bottom-a.bottom+$u(o,"bottom")),e.lefta.right-$u(r,"right")&&(l=e.right-a.right+$u(o,"right")),l||c)if(n)i.defaultView.scrollBy(l,c);else{let n=t.scrollLeft,r=t.scrollTop;c&&(t.scrollTop+=c),l&&(t.scrollLeft+=l);let o=t.scrollLeft-n,i=t.scrollTop-r;e={left:e.left-o,top:e.top-i,right:e.right-o,bottom:e.bottom-i}}if(n)break}}function Du(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Qc(r));return e}function Au(t,e){for(let n=0;n=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);let t=d.left>e.left?d.left-e.left:d.right=(d.left+d.right)/2?1:0));continue}}!n&&(e.left>=d.right&&e.top>=d.top||e.left>=d.left&&e.top>=d.bottom)&&(i=c+1)}}return n&&3==n.nodeType?function(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o=(n.left+n.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:t,offset:i}:Pu(n,r)}function Iu(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Ru(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&o++}n==t.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?i=t.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(i=function(t,e,n,r){let o=-1;for(let i=e;i!=t.dom;){let e=t.docView.nearestDesc(i,!0);if(!e)return null;if(e.node.isBlock&&e.parent){let t=e.dom.getBoundingClientRect();if(t.left>r.left||t.top>r.top)o=e.posBefore;else{if(!(t.right-1?o:t.docView.posFromDOM(e,n,1)}(t,n,o,e))}null==i&&(i=function(t,e,n){let{node:r,offset:o}=Pu(e,n),i=-1;if(1==r.nodeType&&!r.firstChild){let t=r.getBoundingClientRect();i=t.left!=t.right&&n.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}(t,s,e));let a=t.docView.nearestDesc(s,!0);return{pos:i,inside:a?a.posAtStart-a.border:-1}}function ju(t,e){let n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}const Fu=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Lu(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=Mu||vu;if(3==r.nodeType){if(!s||!Fu.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let t=o,e=o,i=n<0?1:-1;return n<0&&!o?(e++,i=-1):n>=0&&o==r.nodeValue.length?(t--,i=1):n<0?t--:e++,Bu(ju(eu(r,t,e),1),i<0)}{let t=ju(eu(r,o,o),n);if(vu&&o&&/\s/.test(r.nodeValue[o-1])&&o=0)}if(null==i&&o&&(n<0||o==iu(r))){let t=r.childNodes[o-1],e=3==t.nodeType?eu(t,iu(t)-(s?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return Bu(ju(e,1),!1)}if(null==i&&o=0)}function Bu(t,e){if(0==t.width)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Vu(t,e){if(0==t.height)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function qu(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}const Ju=/[\u0590-\u08ac]/;let Wu=null,Hu=null,Ku=!1;function Uu(t,e,n){return Wu==e&&Hu==n?Ku:(Wu=e,Hu=n,Ku="up"==n||"down"==n?function(t,e,n){let r=e.selection,o="up"==n?r.$from:r.$to;return qu(t,e,(()=>{let{node:e}=t.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=t.docView.nearestDesc(e,!0);if(!n)break;if(n.node.isBlock){e=n.dom;break}e=n.dom.parentNode}let r=Lu(t,o.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=eu(t,0,t.nodeValue.length).getClientRects()}for(let t=0;to.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0}))}(t,e,n):function(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return Ju.test(r.parent.textContent)&&a.modify?qu(t,e,(()=>{let{focusNode:e,focusOffset:o,anchorNode:i,anchorOffset:s}=t.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:u,focusOffset:d}=t.domSelectionRange(),f=u&&!c.contains(1==u.nodeType?u:u.parentNode)||e==u&&o==d;try{a.collapse(i,s),e&&(e!=i||o!=s)&&a.extend&&a.extend(e,o)}catch(h){}return null!=l&&(a.caretBidiLevel=l),f})):"left"==n||"backward"==n?i:s}(t,e,n))}class Yu{constructor(t,e,n,r){this.parent=t,this.children=e,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;eXc(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!1;break}if(e.previousSibling)break}if(null==r&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!0;break}if(e.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let n=!0,r=t;r;r=r.parentNode){let o,i=this.getDesc(r);if(i&&(!e||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==t.nodeType?t:t.parentNode):o==t))return i;n=!1}}}getDesc(t){let e=t.pmViewDesc;for(let n=e;n;n=n.parent)if(n==this)return e}posFromDOM(t,e,n){for(let r=t;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;et||e instanceof nd){o=t-i;break}i=n}if(o)return this.children[r].domFromPos(o-this.children[r].border,e);for(;r&&!(n=this.children[r-1]).size&&n instanceof Gu&&n.side>=0;r--);if(e<=0){let t,n=!0;for(;t=r?this.children[r-1]:null,t&&t.dom.parentNode!=this.contentDOM;r--,n=!1);return t&&e&&n&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?Xc(t.dom)+1:0}}{let t,n=!0;for(;t=r=o&&e<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(t,e,o);t=i;for(let e=s;e>0;e--){let n=this.children[e-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Xc(n.dom)+1;break}t-=n.size}-1==r&&(r=0)}if(r>-1&&(a>e||s==this.children.length-1)){e=a;for(let t=s+1;th&&ie){let t=s;s=a,a=t}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,r=0;r=n:tn){let r=n+o.border,s=i-o.border;if(t>=r&&e<=s)return this.dirty=t==n||e==i?2:1,void(t!=r||e!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-r,e-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let n=1==t?2:1;e.dirtyo?o.parent?o.parent.posBeforeChild(o):void 0:r))),!e.type.spec.raw){if(1!=i.nodeType){let t=document.createElement("span");t.appendChild(i),i=t}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(t,[],i,null),this.widget=e,this.widget=e,o=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Zu extends Yu{constructor(t,e,n,r){super(t,[],e,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class Xu extends Yu{constructor(t,e,n,r){super(t,[],n,r),this.mark=e}static create(t,e,n,r){let o=r.nodeViews[e.type.name],i=o&&o(e,r,n);return i&&i.dom||(i=ql.renderSpec(document,e.type.spec.toDOM(e,n))),new Xu(t,e,i.dom,i.contentDOM||i.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),0!=this.dirty){let t=this.parent;for(;!t.node;)t=t.parent;t.dirty0&&(o=md(o,0,t,n));for(let s=0;ss?s.parent?s.parent.posBeforeChild(s):void 0:i),n,r),c=l&&l.dom,u=l&&l.contentDOM;if(e.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(e.text);else c||({dom:c,contentDOM:u}=ql.renderSpec(document,e.type.spec.toDOM(e)));u||e.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),e.type.spec.draggable&&(c.draggable=!0));let d=c;return c=ud(c,n,e),l?s=new rd(t,e,n,r,c,u||null,d,l,o,i+1):e.isText?new ed(t,e,n,r,c,d,o):new Qu(t,e,n,r,c,u||null,d,o,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>qa.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,n){return 0==this.dirty&&t.eq(this.node)&&dd(e,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let n=this.node.inlineContent,r=e,o=t.composing?this.localCompositionInfo(t,e):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,a=new hd(this,i&&i.node,t);!function(t,e,n,r){let o=e.locals(t),i=0;if(0==o.length){for(let n=0;ni;)a.push(o[s++]);let f=i+u.nodeSize;if(u.isText){let t=f;s!t.inline)):a.slice(),e.forChild(i,u),d),i=f}}(this.node,this.innerDeco,((e,o,i)=>{e.spec.marks?a.syncToMarks(e.spec.marks,n,t):e.type.side>=0&&!i&&a.syncToMarks(o==this.node.childCount?Ka.none:this.node.child(o).marks,n,t),a.placeWidget(e,t,r)}),((e,i,l,c)=>{let u;a.syncToMarks(e.marks,n,t),a.findNodeMatch(e,i,l,c)||s&&t.state.selection.from>r&&t.state.selection.to-1&&a.updateNodeAt(e,i,l,u,t)||a.updateNextNode(e,i,l,t,c)||a.addNode(e,i,l,t,r),r+=e.nodeSize})),a.syncToMarks([],n,t),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(i&&this.protectLocalComposition(t,i),od(this.contentDOM,this.children,t),ku&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}localCompositionInfo(t,e){let{from:n,to:r}=t.state.selection;if(!(t.state.selection instanceof Ec)||ne+this.node.content.size)return null;let o=t.domSelectionRange(),i=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];e=iu(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e=n){let t=a=0&&t+e.length+a>=n)return a+t;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}(this.node.content,t,n-e,r-e);return o<0?null:{node:i,pos:o,text:t}}return{node:i,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:n,text:r}){if(this.getDesc(e))return;let o=e;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new Zu(this,o,e,r);t.input.compositionNodes.push(i),this.children=md(this.children,n,n+r.length,t,i)}update(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)}updateInner(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(dd(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=ld(this.dom,this.nodeDOM,ad(this.outerDeco,this.node,e),ad(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function td(t,e,n,r,o){return ud(r,e,t),new Qu(void 0,t,e,n,r,r,r,o,0)}class ed extends Qu{constructor(t,e,n,r,o,i,s){super(t,e,n,r,o,null,i,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,n){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,n)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,n){let r=this.node.cut(t,e),o=document.createTextNode(r.text);return new ed(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class nd extends Yu{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class rd extends Qu{constructor(t,e,n,r,o,i,s,a,l,c){super(t,e,n,r,o,i,s,l,c),this.spec=a}update(t,e,n,r){if(3==this.dirty)return!1;if(this.spec.update){let o=this.spec.update(t,e,n);return o&&this.updateInner(t,e,n,r),o}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,r){this.spec.setSelection?this.spec.setSelection(t,e,n):super.setSelection(t,e,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function od(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i0;){let a;for(;;)if(r){let t=n.children[r-1];if(!(t instanceof Xu)){a=t,r--;break}n=t,r=t.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n>1,i=Math.min(o,t.length);for(;r-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=Xu.create(this.top,t[o],e,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(t,e,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(t,e,n))i=this.top.children.indexOf(o,this.index);else for(let s=this.index,a=Math.min(this.top.children.length,s+5);s=n||u<=e?i.push(l):(cn&&i.push(l.slice(n-c,l.size,r)))}return i}function gd(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(au(n)){for(a=c;o&&!o.node;)o=o.parent;let t=o.node;if(o&&t.isAtom&&Ic.isSelectable(t)&&o.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,o=e==iu(t);r||o;){if(t==n)return!0;let e=Xc(t);if(!(t=t.parentNode))return!1;r=r&&0==e,o=o&&e==iu(t)}}(n.focusNode,n.focusOffset,o.dom))){let t=o.posBefore;l=new Ic(s==t?c:r.resolve(t))}}else{let e=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(e<0)return null;a=r.resolve(e)}if(!l){l=Md(t,a,c,"pointer"==e||t.state.selection.head{n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{vd(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const bd=xu||bu&&wu<63;function wd(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=rr(t,e,n)))||Ec.between(e,n,r)}function _d(t){return!(t.editable&&!t.hasFocus())&&Cd(t)}function Cd(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(n){return!1}}function $d(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Nc.findFrom(i,e)}function Nd(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Td(t,e,n){let r=t.state.selection;if(!(r instanceof Ec)){if(r instanceof Ic&&r.node.isInline)return Nd(t,new Ec(e>0?r.$to:r.$from));{let n=$d(t.state,e);return!!n&&Nd(t,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){let n=$d(t.state,e);return!!(n&&n instanceof Ic)&&Nd(t,n)}if(!(Su&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=e<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=t.docView.descAt(s))&&!n.contentDOM)&&(Ic.isSelectable(i)?Nd(t,new Ic(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):!!Mu&&Nd(t,new Ec(t.state.doc.resolve(e<0?s:s+i.nodeSize))))}}function Dd(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ad(t){let e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Ed(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(vu&&1==n.nodeType&&r0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(Ad(t))o=n,i=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(Id(n))break;{let e=n.previousSibling;for(;e&&Ad(e);)o=n.parentNode,i=Xc(e),e=e.previousSibling;if(e)n=e,r=Dd(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Rd(t,n,r):o&&Rd(t,o,i)}function Pd(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=Dd(n);for(;;)if(r{t.state==o&&yd(t)}),50)}function zd(t,e,n){let r=t.state.selection;if(r instanceof Ec&&!r.empty||n.indexOf("s")>-1)return!1;if(Su&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=$d(t.state,e);if(n&&n instanceof Ic)return Nd(t,n)}if(!o.parent.inlineContent){let n=e<0?o:i,s=r instanceof zc?Nc.near(n,e):Nc.findFrom(n,e);return!!s&&Nd(t,s)}return!1}function jd(t,e){if(!(t.state.selection instanceof Ec))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=t.state.tr;return e<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),t.dispatch(r),!0}return!1}function Fd(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Ld(t,e){let n=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||Su&&72==n&&"c"==r?jd(t,-1)||Ed(t):46==n||Su&&68==n&&"c"==r?jd(t,1)||Pd(t):13==n||27==n||(37==n||Su&&66==n&&"c"==r?Td(t,-1,r)||Ed(t):39==n||Su&&70==n&&"c"==r?Td(t,1,r)||Pd(t):38==n||Su&&80==n&&"c"==r?zd(t,-1,r)||Ed(t):40==n||Su&&78==n&&"c"==r?function(t){if(!xu||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;Fd(t,n,"true"),setTimeout((()=>Fd(t,n,"false")),20)}return!1}(t)||zd(t,1,r)||Pd(t):r==(Su?"m":"c")&&(66==n||73==n||89==n||90==n))}function Bd(t,e){t.someProp("transformCopied",(n=>{e=n(e,t)}));let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let s=t.someProp("clipboardSerializer")||ql.fromSchema(t.state.schema),a=Zd(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,d=0;for(;u&&1==u.nodeType&&(c=Yd[u.nodeName.toLowerCase()]);){for(let t=c.length-1;t>=0;t--){let e=a.createElement(c[t]);for(;l.firstChild;)e.appendChild(l.firstChild);l.appendChild(e),d++}u=l.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:l,text:t.someProp("clipboardTextSerializer",(n=>n(e,t)))||e.content.textBetween(0,e.content.size,"\n\n")}}function Vd(t,e,n,r,o){let i,s,a=o.parent.type.spec.code;if(!n&&!e)return null;let l=e&&(r||a||!n);if(l){if(t.someProp("transformPastedText",(n=>{e=n(e,a||r,t)})),a)return e?new Ya(qa.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):Ya.empty;let n=t.someProp("clipboardTextParser",(n=>n(e,o,r,t)));if(n)s=n;else{let n=o.marks(),{schema:r}=t.state,s=ql.fromSchema(r);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=i.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(r.text(t,n)))}))}}else t.someProp("transformPastedHTML",(e=>{n=e(n,t)})),i=function(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=Zd().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);(n=o&&Yd[o[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"")).reverse().join(""));if(r.innerHTML=t,n)for(let i=0;i0;d--){let t=i.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;i=t}if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||El.fromSchema(t.state.schema);s=e.parseSlice(i,{preserveWhitespace:!(!l&&!u),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||qd.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(u)s=function(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(Fg){return t}let{content:o,openStart:i,openEnd:s}=t;for(let a=n.length-2;a>=0;a-=2){let t=r.nodes[n[a]];if(!t||t.hasRequiredAttrs())break;o=qa.from(t.create(n[a+1],o)),i++,s++}return new Ya(o,i,s)}(Ud(s,+u[1],+u[2]),u[4]);else if(s=Ya.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,o=e.node(n).contentMatchAt(e.index(n)),i=[];if(t.forEach((t=>{if(!i)return;let e,n=o.findWrapping(t.type);if(!n)return i=null;if(e=i.length&&r.length&&Wd(n,r,t,i[i.length-1],0))i[i.length-1]=e;else{i.length&&(i[i.length-1]=Hd(i[i.length-1],r.length));let e=Jd(t,n);i.push(e),o=o.matchType(e.type),r=n}})),i)return qa.from(i)}return t}(s.content,o),!0),s.openStart||s.openEnd){let t=0,e=0;for(let n=s.content.firstChild;t{s=e(s,t)})),s}const qd=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Jd(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,qa.from(t));return t}function Wd(t,e,n,r,o){if(o=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,t.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(qa.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Ud(t,e,n){return e{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=e=>of(t,e))}))}function of(t,e){return t.someProp("handleDOMEvents",(n=>{let r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function sf(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function af(t){return{left:t.clientX,top:t.clientY}}function lf(t,e,n,r,o){if(-1==r)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,(e=>s>i.depth?e(t,n,i.nodeAfter,i.before(s),o,!0):e(t,n,i.node(s),i.before(s),o,!1))))return!0;return!1}function cf(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function uf(t,e,n,r,o){return lf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(n=>n(t,e,r)))||(o?function(t,e){if(-1==e)return!1;let n,r,o=t.state.selection;o instanceof Ic&&(n=o.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let t=s>i.depth?i.nodeAfter:i.node(s);if(Ic.isSelectable(t)){r=n&&o.$from.depth>0&&s>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(s);break}}return null!=r&&(cf(t,Ic.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&Ic.isSelectable(r))&&(cf(t,new Ic(n),"pointer"),!0)}(t,n))}function df(t,e,n,r){return lf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function ff(t,e,n,r){return lf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(n=>n(t,e,r)))||function(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(cf(t,Ec.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let e=i>o.depth?o.nodeAfter:o.node(i),n=o.before(i);if(e.inlineContent)cf(t,Ec.create(r,n+1,n+1+e.content.size),"pointer");else{if(!Ic.isSelectable(e))continue;cf(t,Ic.create(r,n),"pointer")}return!0}}(t,n,r)}function hf(t){return wf(t)}Qd.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!gf(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!Ou||!bu||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!ku||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||Ld(t,n)?n.preventDefault():nf(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,lu(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},Qd.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},Qd.keypress=(t,e)=>{let n=e;if(gf(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Su&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof Ec&&r.$from.sameParent(r.$to))){let e=String.fromCharCode(n.charCode);t.someProp("handleTextInput",(n=>n(t,r.$from.pos,r.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const pf=Su?"metaKey":"ctrlKey";Xd.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=hf(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[pf]&&("singleClick"==t.input.lastClick.type?i="doubleClick":"doubleClick"==t.input.lastClick.type&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(af(n));s&&("singleClick"==i?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new mf(t,s,n,!!r)):("doubleClick"==i?df:ff)(t,s.pos,s.inside,n)?n.preventDefault():nf(t,"pointer"))};class mf{constructor(t,e,n,r){let o,i;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[pf],this.allowDefault=n.shiftKey,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{let n=t.state.doc.resolve(e.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,a=s?t.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=t.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof Ic&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!vu||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),nf(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>yd(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(af(t))),this.updateAllowDefault(t),this.allowDefault||!e?nf(this.view,"pointer"):uf(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||xu&&this.mightDrag&&!this.mightDrag.node.isAtom||bu&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(cf(this.view,Nc.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):nf(this.view,"pointer")}move(t){this.updateAllowDefault(t),nf(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function gf(t,e){return!!t.composing||!!(xu&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}Xd.touchstart=t=>{t.input.lastTouch=Date.now(),hf(t),nf(t,"pointer")},Xd.touchmove=t=>{t.input.lastTouch=Date.now(),nf(t,"pointer")},Xd.contextmenu=t=>hf(t);const vf=Ou?5e3:-1;function yf(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>wf(t)),e))}function bf(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function wf(t,e=!1){if(!(Ou&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),bf(t),e||t.docView&&t.docView.dirty){let e=gd(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}Qd.compositionstart=Qd.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||n.marks(),wf(t,!0),t.markCursor=null;else if(wf(t),vu&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,r=e.focusOffset;n&&1==n.nodeType&&0!=r;){let e=r<0?n.lastChild:n.childNodes[r-1];if(!e)break;if(3==e.nodeType){t.domSelection().collapse(e,e.nodeValue.length);break}n=e,r=-1}}t.input.composing=!0}yf(t,vf)},Qd.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,yf(t,20))};const xf=mu&&gu<15||ku&&_u<604;function kf(t,e,n,r){let o=Vd(t,e,n,t.input.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,r,o||Ya.empty))))return!0;if(!o)return!1;let i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),s=i?t.state.tr.replaceSelectionWith(i,t.input.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Xd.copy=Qd.cut=(t,e)=>{let n=e,r=t.state.selection,o="cut"==n.type;if(r.empty)return;let i=xf?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Bd(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):function(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Qd.paste=(t,e)=>{let n=e;if(t.composing&&!Ou)return;let r=xf?null:n.clipboardData;r&&kf(t,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?kf(t,r.value,null,e):kf(t,r.textContent,r.innerHTML,e)}),50)}(t,n)};class Sf{constructor(t,e){this.slice=t,this.move=e}}const Of=Su?"altKey":"ctrlKey";Xd.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(af(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof Ic?o.to-1:o.to));else if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Ic.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&t.dispatch(t.state.tr.setSelection(Ic.create(t.state.doc,e.posBefore)))}let s=t.state.selection.content(),{dom:a,text:l}=Bd(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(xf?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",xf||n.dataTransfer.setData("text/plain",l),t.dragging=new Sf(s,!n[Of])},Xd.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},Qd.dragover=Qd.dragenter=(t,e)=>e.preventDefault(),Qd.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(af(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",(e=>{s=e(s,t)})):s=Vd(t,n.dataTransfer.getData(xf?"Text":"text/plain"),xf?null:n.dataTransfer.getData("text/html"),!1,i);let a=!(!r||n[Of]);if(t.someProp("handleDrop",(e=>e(t,n,s||Ya.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?function(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i=0;t--){let e=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,n=r.index(t)+(e>0?1:0),s=r.node(t),a=!1;if(1==i)a=s.canReplace(n,n,o);else{let t=s.contentMatchAt(n).findWrapping(o.firstChild.type);a=t&&s.canReplaceWith(n,n,t[0])}if(a)return 0==e?r.pos:e<0?r.before(t+1):r.after(t+1)}return null}(t.state.doc,i.pos,s):i.pos;null==l&&(l=i.pos);let c=t.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let h=c.doc.resolve(u);if(d&&Ic.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Ic(h));else{let e=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((t,n,r,o)=>e=o)),c.setSelection(Md(t,h,c.doc.resolve(e)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Xd.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&yd(t)}),20))},Xd.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Xd.beforeinput=(t,e)=>{if(bu&&Ou&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,lu(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let os in Qd)Xd[os]=Qd[os];function Mf(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class _f{constructor(t,e){this.toDOM=t,this.spec=e||Df,this.side=this.spec.side||0}map(t,e,n,r){let{pos:o,deleted:i}=t.mapResult(e.from+r,this.side<0?-1:1);return i?null:new Nf(o-n,o-n,this)}valid(){return!0}eq(t){return this==t||t instanceof _f&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Mf(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Cf{constructor(t,e){this.attrs=t,this.spec=e||Df}map(t,e,n,r){let o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Nf(o,i,this)}valid(t,e){return e.from=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;it){let s=this.children[i]+1;this.children[i+2].findInner(t-s,e-s,n,r+s,o)}}map(t,e,n){return this==Ef||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Df)}mapInner(t,e,n,r,o){let i;for(let s=0;s{let s=i-r-(n-e);for(let l=0;li+u-t)continue;let c=a[l]+u-t;n>=c?a[l+1]=e<=c?-2:-1:r>=o&&s&&(a[l]+=s,a[l+1]+=s)}t+=s})),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c=r.content.size){l=!0;continue}let d=n.map(t[c+1]+i,-1)-o,{index:f,offset:h}=r.content.findIndex(u),p=r.maybeChild(f);if(p&&h==u&&h+p.nodeSize==d){let r=a[c+2].mapInner(n,p,e+1,t[c]+i+1,s);r!=Ef?(a[c]=u,a[c+1]=d,a[c+2]=r):(a[c+1]=-2,l=!0)}else l=!0}if(l){let l=function(t,e,n,r,o,i,s){function a(t,e){for(let i=0;i{let s,a=i+n;if(s=Rf(e,t,a)){for(r||(r=this.children.slice());oi&&e.to=t){this.children[s]==t&&(n=this.children[s+2]);break}let o=t+1,i=o+e.content.size;for(let s=0;so&&t.type instanceof Cf){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;en.map(t,e,Df)));return Pf.from(n)}forChild(t,e){if(e.isLeaf)return Af.empty;let n=[];for(let r=0;rt instanceof Af))?t:t.reduce(((t,e)=>t.concat(e instanceof Af?e:e.members)),[]))}}}function If(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;rn&&i.to{let a=Rf(t,e,s+n);if(a){i=!0;let t=jf(a,e,n+s+1,r);t!=Ef&&o.push(s,s+e.nodeSize,t)}}));let s=If(i?zf(t):t,-n).sort(Ff);for(let a=0;a0;)e++;t.splice(e,0,n)}function Vf(t){let e=[];return t.someProp("decorations",(n=>{let r=n(t.state);r&&r!=Ef&&e.push(r)})),t.cursorWrapper&&e.push(Af.create(t.state.doc,[t.cursorWrapper.deco])),Pf.from(e)}const qf={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Jf=mu&&gu<=11;class Wf{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class Hf{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Wf,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((t=>{for(let e=0;e"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),Jf&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,qf)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;ethis.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(_d(this.view)){if(this.suppressingSelectionUpdates)return yd(this.view);if(mu&&gu<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&nu(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e,n=new Set;for(let o=t.focusNode;o;o=Qc(o))n.add(o);for(let o=t.anchorNode;o;o=Qc(o))if(n.has(o)){e=o;break}let r=e&&this.view.docView.nearestDesc(e);return r&&r.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);let n=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&_d(t)&&!this.ignoreSelectionChange(n),o=-1,i=-1,s=!1,a=[];if(t.editable)for(let c=0;c1){let t=a.filter((t=>"BR"==t.nodeName));if(2==t.length){let e=t[0],n=t[1];e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}}let l=null;o<0&&r&&t.input.lastFocus>Date.now()-200&&t.input.lastTouch-1||r)&&(o>-1&&(t.docView.markDirty(o,i),function(t){if(Kf.has(t))return;if(Kf.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)){if(t.requiresGeckoHackNode=vu,Uf)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Uf=!0}}(t)),this.handleDOMChange(o,i,s,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||yd(t),this.currentSelection.set(n))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(let n=0;nDate.now()-50?t.input.lastSelectionOrigin:null,n=gd(t,e);if(n&&!t.state.selection.eq(n)){let r=t.state.tr.setSelection(n);"pointer"==e?r.setMeta("pointer",!0):"key"==e&&r.scrollIntoView(),t.dispatch(r)}return}let i=t.state.doc.resolve(e),s=i.sharedDepth(n);e=i.before(s+1),n=t.state.doc.resolve(n).after(s+1);let a,l,c=t.state.selection,u=function(t,e,n){let r,{node:o,fromOffset:i,toOffset:s,from:a,to:l}=t.docView.parseRange(e,n),c=t.domSelectionRange(),u=c.anchorNode;if(u&&t.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],au(c)||r.push({node:c.focusNode,offset:c.focusOffset})),bu&&8===t.input.lastKeyCode)for(let g=s;g>i;g--){let t=o.childNodes[g-1],e=t.pmViewDesc;if("BR"==t.nodeName&&!e){s=g;break}if(!e||e.size)break}let d=t.state.doc,f=t.someProp("domParser")||El.fromSchema(t.state.schema),h=d.resolve(a),p=null,m=f.parse(o,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Yf,context:h});if(r&&null!=r[0].pos){let t=r[0].pos,e=r[1]&&r[1].pos;null==e&&(e=t),p={anchor:t+a,head:e+a}}return{doc:m,sel:p,from:a,to:l}}(t,e,n),d=t.state.doc,f=d.slice(u.from,u.to);8===t.input.lastKeyCode&&Date.now()-100=s?i-r:0,a=i+(a-s),s=i}else if(a=a?i-r:0,s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}(f.content,u.doc.content,u.from,a,l);if((ku&&t.input.lastIOSEnter>Date.now()-225||Ou)&&o.some((t=>"DIV"==t.nodeName||"P"==t.nodeName||"LI"==t.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",(e=>e(t,lu(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(!h){if(!(r&&c instanceof Ec&&!c.empty&&c.$head.sameParent(c.$anchor))||t.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let e=Zf(t,t.state.doc,u.sel);e&&!e.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(e))}return}h={start:c.from,endA:c.to,endB:c.to}}if(bu&&t.cursorWrapper&&u.sel&&u.sel.anchor==t.cursorWrapper.deco.from&&u.sel.head==u.sel.anchor){let t=h.endB-h.start;u.sel={anchor:u.sel.anchor+t,head:u.sel.anchor+t}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?h.start=t.state.selection.from:h.endA=t.state.selection.to-2&&t.state.selection.to<=u.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),mu&&gu<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>u.from&&"  "==u.doc.textBetween(h.start-u.from-1,h.start-u.from+1)&&(h.start--,h.endA--,h.endB--);let p,m=u.doc.resolveNoCache(h.start-u.from),g=u.doc.resolveNoCache(h.endB-u.from),v=d.resolve(h.start),y=m.sameParent(g)&&m.parent.inlineContent&&v.end()>=h.endA;if((ku&&t.input.lastIOSEnter>Date.now()-225&&(!y||o.some((t=>"DIV"==t.nodeName||"P"==t.nodeName)))||!y&&m.pose(t,lu(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>h.start&&function(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||Xf(r,!0,!1)n||Xf(s,!0,!1)e(t,lu(8,"Backspace")))))return void(Ou&&bu&&t.domObserver.suppressSelectionUpdates());bu&&Ou&&h.endB==h.start&&(t.input.lastAndroidDelete=Date.now()),Ou&&!y&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==h.endA&&(h.endB-=2,g=u.doc.resolveNoCache(h.endB-u.from),setTimeout((()=>{t.someProp("handleKeyDown",(function(e){return e(t,lu(13,"Enter"))}))}),20));let b,w,x,k=h.start,S=h.endA;if(y)if(m.pos==g.pos)mu&&gu<=11&&0==m.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((()=>yd(t)),20)),b=t.state.tr.delete(k,S),w=d.resolve(h.start).marksAcross(d.resolve(h.endA));else if(h.endA==h.endB&&(x=function(t,e){let n,r,o,i=t.firstChild.marks,s=e.firstChild.marks,a=i,l=s;for(let u=0;ut.mark(r.addToSet(t.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",o=t=>t.mark(r.removeFromSet(t.marks))}let c=[];for(let u=0;un(t,k,S,e))))return;b=t.state.tr.insertText(e,k,S)}if(b||(b=t.state.tr.replace(k,S,u.doc.slice(h.start-u.from,h.endB-u.from))),u.sel){let e=Zf(t,b.doc,u.sel);e&&!(bu&&Ou&&t.composing&&e.empty&&(h.start!=h.endB||t.input.lastAndroidDeletee.content.size?null:Md(t,e.resolve(n.anchor),e.resolve(n.head))}function Xf(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let e=t.node(r).maybeChild(t.indexAfter(r));for(;e&&!e.isLeaf;)e=e.firstChild,o++}return o}class Qf{constructor(t,e){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ef,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(oh),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=nh(this),eh(this),this.nodeViews=rh(this),this.docView=td(this.state.doc,th(this),Vf(this),this.dom,this),this.domObserver=new Hf(this,((t,e,n,r)=>Gf(this,t,e,n,r))),this.domObserver.start(),function(t){for(let e in Xd){let n=Xd[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=e=>{!sf(t,e)||of(t,e)||!t.editable&&e.type in Qd||n(t,e)},tf[e]?{passive:!0}:void 0)}xu&&t.dom.addEventListener("input",(()=>null)),rf(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&rf(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(oh),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let n in this._props)e[n]=this._props[n];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){let n=this.state,r=!1,o=!1;t.storedMarks&&this.composing&&(bf(this),o=!0),this.state=t;let i=n.plugins!=t.plugins||this._props.plugins!=e.plugins;if(i||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let t=rh(this);(function(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r})(t,this.nodeViews)&&(this.nodeViews=t,r=!0)}(i||e.handleDOMEvents!=this._props.handleDOMEvents)&&rf(this),this.editable=nh(this),eh(this);let s=Vf(this),a=th(this),l=n.plugins==t.plugins||n.doc.eq(t.doc)?t.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",c=r||!this.docView.matchesNode(t.doc,a,s);!c&&t.selection.eq(n.selection)||(o=!0);let u="preserve"==l&&o&&null==this.dom.style.overflowAnchor&&function(t){let e,n,r=t.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s=o-20){e=r,n=a.top;break}}return{refDOM:e,refTop:n,stack:Du(t.dom)}}(this);if(o){this.domObserver.stop();let e=c&&(mu||bu)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&function(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}(n.selection,t.selection);if(c){let n=bu?this.trackWrites=this.domSelectionRange().focusNode:null;!r&&this.docView.update(t.doc,a,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=td(t.doc,a,s,this.dom,this)),n&&!this.trackWrites&&(e=!0)}e||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return nu(e.node,e.offset,n.anchorNode,n.anchorOffset)}(this))?yd(this,e):(Sd(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():u&&function({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Au(n,0==r?0:r-e)}(u)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(t=>t(this))));else if(this.state.selection instanceof Ic){let e=this.docView.domAfterPos(this.state.selection.from);1==e.nodeType&&Tu(this,e.getBoundingClientRect(),t)}else Tu(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;ee.ownerDocument.getSelection()),this._root=e;return t||document}posAtCoords(t){return zu(this,t)}coordsAtPos(t,e=1){return Lu(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return Uu(this,e||this.state,t)}destroy(){this.docView&&(!function(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Vf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){return function(t,e){of(t,e)||!Xd[e.type]||!t.editable&&e.type in Qd||Xd[e.type](t,e)}(this,t)}dispatch(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return xu&&11===this.root.nodeType&&function(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom?function(t){let e;function n(t){t.preventDefault(),t.stopImmediatePropagation(),e=t.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0);let r=e.startContainer,o=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return nu(a.node,a.offset,i,s)&&([r,o,i,s]=[i,s,r,o]),{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function th(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),e.translate="no",t.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(t.state)),n)for(let t in n)"class"==t&&(e.class+=" "+n[t]),"style"==t?e.style=(e.style?e.style+";":"")+n[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(n[t]))})),[Nf.node(0,t.state.doc.content.size,e)]}function eh(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Nf.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function nh(t){return!t.someProp("editable",(e=>!1===e(t.state)))}function rh(t){let e=Object.create(null);function n(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function oh(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var ih={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},sh={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ah="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),lh="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),ch="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),uh=lh||ah&&+ah[1]<57,dh=0;dh<10;dh++)ih[48+dh]=ih[96+dh]=String(dh);for(dh=1;dh<=24;dh++)ih[dh+111]="F"+dh;for(dh=65;dh<=90;dh++)ih[dh]=String.fromCharCode(dh+32),sh[dh]=String.fromCharCode(dh);for(var fh in ih)sh.hasOwnProperty(fh)||(sh[fh]=ih[fh]);const hh="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function ph(t){let e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let a=0;a127)&&(r=ih[n.keyCode])&&r!=o){let o=e[mh(r,n,!0)];if(o&&o(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){let r=e[mh(o,n,!0)];if(r&&r(t.state,t.dispatch,t))return!0}return!1}}const yh=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function bh(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function wh(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function xh(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=kh(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let r=n.after(),o=t.tr.replaceWith(r,r,s.createAndFill());o.setSelection(Nc.near(o.doc.resolve(r),1)),e(o.scrollIntoView())}return!0};const Oh=(t,e)=>{let{$from:n,$to:r}=t.selection;if(t.selection instanceof Ic&&t.selection.node.isBlock)return!(!n.parentOffset||!fc(t.doc,n.pos)||(e&&e(t.tr.split(n.pos).scrollIntoView()),0));if(!n.parent.isBlock)return!1;if(e){let o=r.parentOffset==r.parent.content.size,i=t.tr;(t.selection instanceof Ec||t.selection instanceof zc)&&i.deleteSelection();let s=0==n.depth?null:kh(n.node(-1).contentMatchAt(n.indexAfter(-1))),a=Mh&&Mh(r.parent,o),l=a?[a]:o&&s?[{type:s}]:void 0,c=fc(i.doc,i.mapping.map(n.pos),1,l);if(l||c||!fc(i.doc,i.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(l=[{type:s}]),c=!0),c&&(i.split(i.mapping.map(n.pos),1,l),!o&&!n.parentOffset&&n.parent.type!=s)){let t=i.mapping.map(n.before()),e=i.doc.resolve(t);s&&n.node(-1).canReplaceWith(e.index(),e.index()+1,s)&&i.setNodeMarkup(i.mapping.map(n.before()),s)}e(i.scrollIntoView())}return!0};var Mh;function _h(t,e,n){let r,o,i=e.nodeBefore,s=e.nodeAfter;if(i.type.spec.isolating||s.type.spec.isolating)return!1;if(function(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(i,i+1)||!o.isTextblock&&!hc(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(r[0]||s.type).validEnd){if(n){let o=e.pos+s.nodeSize,a=qa.empty;for(let t=r.length-1;t>=0;t--)a=qa.from(r[t].create(null,a));a=qa.from(i.copy(a));let l=t.tr.step(new sc(e.pos-1,o,e.pos,o,new Ya(a,1,0),r.length,!0)),c=o+2*r.length;hc(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=Nc.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),u=c&&cc(c);if(null!=u&&u>=e.depth)return n&&n(t.tr.lift(c,u).scrollIntoView()),!0;if(a&&bh(s,"start",!0)&&bh(i,"end")){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=qa.empty;for(let t=o.length-1;t>=0;t--)r=qa.from(o[t].copy(r));n(t.tr.step(new sc(e.pos-o.length,e.pos+s.nodeSize,e.pos+l,e.pos+s.nodeSize-l,new Ya(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Ch(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(e.tr.setSelection(Ec.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}const $h=Ch(-1),Nh=Ch(1);function Th(t,e=null){return function(n,r){let o=!1;for(let i=0;i{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)o=!0;else{let e=n.doc.resolve(i),r=e.index();o=e.parent.canReplaceWith(r,r+1,t)}}))}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r{if(s)return!1;s=t.inlineContent&&t.type.allowsMarkType(n)})),s)return!0}return!1}(n.doc,s,t))return!1;if(r)if(i)t.isInSet(n.storedMarks||i.marks())?r(n.tr.removeStoredMark(t)):r(n.tr.addStoredMark(t.create(e)));else{let o=!1,i=n.tr;for(let e=0;!o&&e{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}(t,n);if(!r)return!1;let o=wh(r);if(!o){let n=r.blockRange(),o=n&&cc(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&_h(t,o,e))return!0;if(0==r.parent.content.size&&(bh(i,"end")||Ic.isSelectable(i))){let n=pc(t.doc,r.before(),r.after(),Ya.empty);if(n&&n.slice.size{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=wh(r)}let s=i&&i.nodeBefore;return!(!s||!Ic.isSelectable(s))&&(e&&e(t.tr.setSelection(Ic.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)})),Ph=Ah(yh,((t,e,n)=>{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}),((t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof zc||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=kh(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let n=(!r.parentOffset&&o.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(fc(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&cc(r);return null!=o&&(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)}),Oh),"Mod-Enter":Sh,Backspace:Eh,"Mod-Backspace":Eh,"Shift-Backspace":Eh,Delete:Ph,"Mod-Delete":Ph,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new zc(t.doc))),!0)},Rh={"Ctrl-h":Ih.Backspace,"Alt-Backspace":Ih["Mod-Backspace"],"Ctrl-d":Ih.Delete,"Ctrl-Alt-Backspace":Ih["Mod-Delete"],"Alt-Delete":Ih["Mod-Delete"],"Alt-d":Ih["Mod-Delete"],"Ctrl-a":$h,"Ctrl-e":Nh};for(let os in Ih)Rh[os]=Ih[os];const zh=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?Rh:Ih;class jh{constructor(t,e){var n;this.match=t,this.match=t,this.handler="string"==typeof e?(n=e,function(t,e,r,o){let i=n;if(e[1]){let t=e[0].lastIndexOf(e[1]);i+=e[0].slice(t+e[1].length);let n=(r+=t)-o;n>0&&(i=e[0].slice(t-n,t)+i,r=o)}return t.tr.insertText(i,r,o)}):e}}function Fh({rules:t}){let e=new Uc({state:{init:()=>null,apply(t,e){let n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:(n,r,o,i)=>Lh(n,r,o,i,t,e),handleDOMEvents:{compositionend:n=>{setTimeout((()=>{let{$cursor:r}=n.state.selection;r&&Lh(n,r.pos,r.pos,"",t,e)}))}}},isInputRules:!0});return e}function Lh(t,e,n,r,o,i){if(t.composing)return!1;let s=t.state,a=s.doc.resolve(e);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r;for(let c=0;c{let n=t.plugins;for(let r=0;r=0;t--)n.step(r.steps[t].invert(r.docs[t]));if(o.text){let e=n.doc.resolve(o.from).marks();n.replaceWith(o.from,o.to,t.schema.text(o.text,e))}else n.delete(o.from,o.to);e(n)}return!0}}return!1};function Vh(t,e,n=null,r){return new jh(t,((t,o,i,s)=>{let a=n instanceof Function?n(o):n,l=t.tr.delete(i,s),c=l.doc.resolve(i).blockRange(),u=c&&uc(c,e,a);if(!u)return null;l.wrap(c,u);let d=l.doc.resolve(i-1).nodeBefore;return d&&d.type==e&&hc(l.doc,i-1)&&(!r||r(o,d))&&l.join(i-1),l}))}function qh(t,e,n=null){return new jh(t,((t,r,o,i)=>{let s=t.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e)?t.tr.delete(o,i).setBlockType(o,o,e,a):null}))}new jh(/--$/,"—"),new jh(/\.\.\.$/,"…"),new jh(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new jh(/"$/,"”"),new jh(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new jh(/'$/,"’");const Jh=["ol",0],Wh=["ul",0],Hh=["li",0],Kh={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1==t.attrs.order?Jh:["ol",{start:t.attrs.order},0]},Uh={parseDOM:[{tag:"ul"}],toDOM:()=>Wh},Yh={parseDOM:[{tag:"li"}],toDOM:()=>Hh,defining:!0};function Gh(t,e){let n={};for(let r in t)n[r]=t[r];for(let r in e)n[r]=e[r];return n}function Zh(t,e,n){return t.append({ordered_list:Gh(Kh,{content:"list_item+",group:n}),bullet_list:Gh(Uh,{content:"list_item+",group:n}),list_item:Gh(Yh,{content:e})})}function Xh(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;let t=n.doc.resolve(s.start-2);l=new dl(t,t,s.depth),s.endIndex=0;u--)i=qa.from(n[u].type.create(n[u].attrs,i));t.step(new sc(e.start-(r?2:0),e.end,e.start,e.end,new Ya(i,0,0),n.length,!0));let s=0;for(let u=0;u=r.depth-3;t--)o=qa.from(r.node(t).copy(o));let s=r.indexAfter(-1){if(c>-1)return!1;t.isTextblock&&0==t.content.size&&(c=e+1)})),c>-1&&l.setSelection(Nc.near(l.doc.resolve(c))),n(l.scrollIntoView())}return!0}let a=o.pos==r.end()?s.contentMatchAt(0).defaultType:null,l=e.tr.delete(r.pos,o.pos),c=a?[null,{type:a}]:void 0;return!!fc(l.doc,r.pos,2,c)&&(n&&n(l.split(r.pos,2,c).scrollIntoView()),!0)}}function tp(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,(e=>e.childCount>0&&e.firstChild.type==t));return!!i&&(!n||(r.node(i.depth-1).type==t?function(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);im;p--)h-=o.child(p).nodeSize,r.delete(h-1,h+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?qa.empty:qa.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return r.step(new sc(d-(a?1:0),f+(l?1:0),d+1,f-1,new Ya((a?qa.empty:qa.from(o.copy(qa.empty))).append(l?qa.empty:qa.from(o.copy(qa.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}(e,n,i)))}}function ep(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,(e=>e.childCount>0&&e.firstChild.type==t));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let r=l.lastChild&&l.lastChild.type==a.type,o=qa.from(r?t.create():null),s=new Ya(qa.from(t.create(null,qa.from(a.type.create(null,o)))),r?3:1,0),c=i.start,u=i.end;n(e.tr.step(new sc(c-(r?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0}}var np=200,rp=function(){};rp.prototype.append=function(t){return t.length?(t=rp.from(t),!this.length&&t||t.length=e?rp.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},rp.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},rp.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},rp.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},rp.from=function(t){return t instanceof rp?t:t&&t.length?new op(t):rp.empty};var op=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=np)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=np)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(rp);rp.empty=new op([]);var ip=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return to&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(rp),sp=rp;class ap{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}e&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=t.tr,l=[],c=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(o,e+1),r=n.maps.length),r--,void c.push(t);if(n){c.push(new lp(t.map));let e,o=t.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],l.push(new lp(e,void 0,void 0,l.length+c.length))),r--,e&&n.appendMap(e,r)}else a.maybeStep(t.step);return t.selection?(i=n?t.selection.map(n.slice(r)):t.selection,s=new ap(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(t,e,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let c=0;cup&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,l),i-=l),new ap(s.append(o),i)}remapping(t,e){let n=new Gl;return this.items.forEach(((e,r)=>{let o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,o)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new ap(this.items.append(t.map((t=>new lp(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let a=e;this.items.forEach((e=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(e.step){let i=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(o.slice(a+1,r));c&&s++,n.push(new lp(l,i,c))}else n.push(new lp(l))}),r);let l=[];for(let d=e;d500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=t)r.push(i),i.selection&&o++;else if(i.step){let t=i.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=i.selection&&i.selection.map(e.slice(n));a&&o++;let l,c=new lp(s.invert(),t,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new ap(sp.from(r.reverse()),o)}}ap.empty=new ap(sp.empty,0);class lp{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new lp(e.getMap().invert(),e,this.selection)}}}class cp{constructor(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r}}const up=20;function dp(t){let e=[];return t.forEach(((t,n,r,o)=>e.push(r,o))),e}function fp(t,e){if(!t)return null;let n=[];for(let r=0;rnew cp(ap.empty,ap.empty,null,0),apply:(e,n,r)=>function(t,e,n,r){let o,i=n.getMeta(vp);if(i)return i.historyState;n.getMeta(yp)&&(t=new cp(t.done,t.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(vp))return s.getMeta(vp).redo?new cp(t.done.addTransform(n,void 0,r,gp(e)),t.undone,dp(n.mapping.maps[n.steps.length-1]),t.prevTime):new cp(t.done,t.undone.addTransform(n,void 0,r,gp(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new cp(t.done.rebased(n,o),t.undone.rebased(n,o),fp(t.prevRanges,n.mapping),t.prevTime):new cp(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),fp(t.prevRanges,n.mapping),t.prevTime);{let o=0==t.prevTime||!s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach(((t,r)=>{for(let o=0;o=e[o]&&(n=!0)})),n}(n,t.prevRanges)),i=s?fp(t.prevRanges,n.mapping):dp(n.mapping.maps[n.steps.length-1]);return new cp(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,gp(e)),ap.empty,i,n.time)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?wp:"historyRedo"==n?xp:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}const wp=(t,e)=>{let n=vp.getState(t);return!(!n||0==n.done.eventCount)&&(e&&hp(n,t,e,!1),!0)},xp=(t,e)=>{let n=vp.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&hp(n,t,e,!0),!0)};function kp(t){let e=vp.getState(t);return e?e.done.eventCount:0}function Sp(t){let e=vp.getState(t);return e?e.undone.eventCount:0}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Op(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Mp={},_p={},Cp={},$p={},Np={};function Tp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Dp(t){for(var e=1;e=+n}))};var Up={};Object.defineProperty(Up,"__esModule",{value:!0}),Up.default=void 0;var Yp=(0,Cp.regex)("email",/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i);Up.default=Yp;var Gp={};Object.defineProperty(Gp,"__esModule",{value:!0}),Gp.default=void 0;var Zp=Cp,Xp=(0,Zp.withParams)({type:"ipAddress"},(function(t){if(!(0,Zp.req)(t))return!0;if("string"!=typeof t)return!1;var e=t.split(".");return 4===e.length&&e.every(Qp)}));Gp.default=Xp;var Qp=function(t){if(t.length>3||0===t.length)return!1;if("0"===t[0]&&"0"!==t)return!1;if(!t.match(/^\d+$/))return!1;var e=0|+t;return e>=0&&e<=255},tm={};Object.defineProperty(tm,"__esModule",{value:!0}),tm.default=void 0;var em=Cp;tm.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":";return(0,em.withParams)({type:"macAddress"},(function(e){if(!(0,em.req)(e))return!0;if("string"!=typeof e)return!1;var n="string"==typeof t&&""!==t?e.split(t):12===e.length||16===e.length?e.match(/.{2}/g):null;return null!==n&&(6===n.length||8===n.length)&&n.every(nm)}))};var nm=function(t){return t.toLowerCase().match(/^[0-9a-f]{2}$/)},rm={};Object.defineProperty(rm,"__esModule",{value:!0}),rm.default=void 0;var om=Cp;rm.default=function(t){return(0,om.withParams)({type:"maxLength",max:t},(function(e){return!(0,om.req)(e)||(0,om.len)(e)<=t}))};var im={};Object.defineProperty(im,"__esModule",{value:!0}),im.default=void 0;var sm=Cp;im.default=function(t){return(0,sm.withParams)({type:"minLength",min:t},(function(e){return!(0,sm.req)(e)||(0,sm.len)(e)>=t}))};var am={};Object.defineProperty(am,"__esModule",{value:!0}),am.default=void 0;var lm=Cp,cm=(0,lm.withParams)({type:"required"},(function(t){return(0,lm.req)("string"==typeof t?t.trim():t)}));am.default=cm;var um={};Object.defineProperty(um,"__esModule",{value:!0}),um.default=void 0;var dm=Cp;um.default=function(t){return(0,dm.withParams)({type:"requiredIf",prop:t},(function(e,n){return!(0,dm.ref)(t,this,n)||(0,dm.req)(e)}))};var fm={};Object.defineProperty(fm,"__esModule",{value:!0}),fm.default=void 0;var hm=Cp;fm.default=function(t){return(0,hm.withParams)({type:"requiredUnless",prop:t},(function(e,n){return!!(0,hm.ref)(t,this,n)||(0,hm.req)(e)}))};var pm={};Object.defineProperty(pm,"__esModule",{value:!0}),pm.default=void 0;var mm=Cp;pm.default=function(t){return(0,mm.withParams)({type:"sameAs",eq:t},(function(e,n){return e===(0,mm.ref)(t,this,n)}))};var gm={};Object.defineProperty(gm,"__esModule",{value:!0}),gm.default=void 0;var vm=(0,Cp.regex)("url",/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i);gm.default=vm;var ym={};Object.defineProperty(ym,"__esModule",{value:!0}),ym.default=void 0;var bm=Cp;ym.default=function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&e.reduce((function(e,n){return e||n.apply(t,r)}),!1)}))};var wm={};Object.defineProperty(wm,"__esModule",{value:!0}),wm.default=void 0;var xm=Cp;wm.default=function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&e.reduce((function(e,n){return e&&n.apply(t,r)}),!0)}))};var km={};Object.defineProperty(km,"__esModule",{value:!0}),km.default=void 0;var Sm=Cp;km.default=function(t){return(0,Sm.withParams)({type:"not"},(function(e,n){return!(0,Sm.req)(e)||!t.call(this,e,n)}))};var Om={};Object.defineProperty(Om,"__esModule",{value:!0}),Om.default=void 0;var Mm=Cp;Om.default=function(t){return(0,Mm.withParams)({type:"minValue",min:t},(function(e){return!(0,Mm.req)(e)||(!/\s/.test(e)||e instanceof Date)&&+e>=+t}))};var _m={};Object.defineProperty(_m,"__esModule",{value:!0}),_m.default=void 0;var Cm=Cp;_m.default=function(t){return(0,Cm.withParams)({type:"maxValue",max:t},(function(e){return!(0,Cm.req)(e)||(!/\s/.test(e)||e instanceof Date)&&+e<=+t}))};var $m={};Object.defineProperty($m,"__esModule",{value:!0}),$m.default=void 0;var Nm=(0,Cp.regex)("integer",/(^[0-9]*$)|(^-[0-9]+$)/);$m.default=Nm;var Tm={};Object.defineProperty(Tm,"__esModule",{value:!0}),Tm.default=void 0;var Dm=(0,Cp.regex)("decimal",/^[-]?\d*(\.\d+)?$/);Tm.default=Dm,function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"alpha",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"alphaNum",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"and",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"between",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"decimal",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"email",{enumerable:!0,get:function(){return s.default}}),t.helpers=void 0,Object.defineProperty(t,"integer",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"ipAddress",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"macAddress",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"maxLength",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"maxValue",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"minLength",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"minValue",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"not",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"numeric",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"or",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"required",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"requiredIf",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"requiredUnless",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"sameAs",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"url",{enumerable:!0,get:function(){return m.default}});var n=M(_p),r=M(Vp),o=M(Jp),i=M(Hp),s=M(Up),a=M(Gp),l=M(tm),c=M(rm),u=M(im),d=M(am),f=M(um),h=M(fm),p=M(pm),m=M(gm),g=M(ym),v=M(wm),y=M(km),b=M(Om),w=M(_m),x=M($m),k=M(Tm),S=function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!=typeof t)return{default:t};var r=O(n);if(r&&r.has(t))return r.get(t);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var a=i?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(o,s,a):o[s]=t[s]}o.default=t,r&&r.set(t,o);return o}(Cp);function O(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(O=function(t){return t?n:e})(t)}function M(t){return t&&t.__esModule?t:{default:t}}t.helpers=S}(Mp);function Am(t){return(Am="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Em={selector:"vue-portal-target-".concat(((t=21)=>{let e="",n=t;for(;n--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e})())},Pm=function(t){return Em.selector=t},Im="undefined"!=typeof window&&void 0!==("undefined"==typeof document?"undefined":Am(document)),Rm=Hn.extend({abstract:!0,name:"PortalOutlet",props:["nodes","tag"],data:function(t){return{updatedNodes:t.nodes}},render:function(t){var e=this.updatedNodes&&this.updatedNodes();return e?1!==e.length||e[0].text?t(this.tag||"DIV",e):e:t()},destroyed:function(){var t=this.$el;t&&t.parentNode.removeChild(t)}}),zm=Hn.extend({name:"VueSimplePortal",props:{disabled:{type:Boolean},prepend:{type:Boolean},selector:{type:String,default:function(){return"#".concat(Em.selector)}},tag:{type:String,default:"DIV"}},render:function(t){if(this.disabled){var e=this.$scopedSlots&&this.$scopedSlots.default();return e?e.length<2&&!e[0].text?e:t(this.tag,e):t()}return t()},created:function(){this.getTargetEl()||this.insertTargetEl()},updated:function(){var t=this;this.$nextTick((function(){t.disabled||t.slotFn===t.$scopedSlots.default||(t.container.updatedNodes=t.$scopedSlots.default),t.slotFn=t.$scopedSlots.default}))},beforeDestroy:function(){this.unmount()},watch:{disabled:{immediate:!0,handler:function(t){t?this.unmount():this.$nextTick(this.mount)}}},methods:{getTargetEl:function(){if(Im)return document.querySelector(this.selector)},insertTargetEl:function(){if(Im){var t=document.querySelector("body"),e=document.createElement(this.tag);e.id=this.selector.substring(1),t.appendChild(e)}},mount:function(){if(Im){var t=this.getTargetEl(),e=document.createElement("DIV");this.prepend&&t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e),this.container=new Rm({el:e,parent:this,propsData:{tag:this.tag,nodes:this.$scopedSlots.default}})}},unmount:function(){this.container&&(this.container.$destroy(),delete this.container)}}});function jm(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.component(e.name||"portal",zm),e.defaultSelector&&Pm(e.defaultSelector)}"undefined"!=typeof window&&window.Vue&&window.Vue===Hn&&Hn.use(jm);var Fm=("undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function Lm(t,e){if(void 0===e&&(e=[]),null===t||"object"!=typeof t)return t;var n,r=(n=function(e){return e.original===t},e.filter(n)[0]);if(r)return r.copy;var o=Array.isArray(t)?[]:{};return e.push({original:t,copy:o}),Object.keys(t).forEach((function(n){o[n]=Lm(t[n],e)})),o}function Bm(t,e){Object.keys(t).forEach((function(n){return e(t[n],n)}))}function Vm(t){return null!==t&&"object"==typeof t}var qm=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var n=t.state;this.state=("function"==typeof n?n():n)||{}},Jm={namespaced:{configurable:!0}};Jm.namespaced.get=function(){return!!this._rawModule.namespaced},qm.prototype.addChild=function(t,e){this._children[t]=e},qm.prototype.removeChild=function(t){delete this._children[t]},qm.prototype.getChild=function(t){return this._children[t]},qm.prototype.hasChild=function(t){return t in this._children},qm.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},qm.prototype.forEachChild=function(t){Bm(this._children,t)},qm.prototype.forEachGetter=function(t){this._rawModule.getters&&Bm(this._rawModule.getters,t)},qm.prototype.forEachAction=function(t){this._rawModule.actions&&Bm(this._rawModule.actions,t)},qm.prototype.forEachMutation=function(t){this._rawModule.mutations&&Bm(this._rawModule.mutations,t)},Object.defineProperties(qm.prototype,Jm);var Wm,Hm=function(t){this.register([],t,!1)};function Km(t,e,n){if(e.update(n),n.modules)for(var r in n.modules){if(!e.getChild(r))return;Km(t.concat(r),e.getChild(r),n.modules[r])}}Hm.prototype.get=function(t){return t.reduce((function(t,e){return t.getChild(e)}),this.root)},Hm.prototype.getNamespace=function(t){var e=this.root;return t.reduce((function(t,n){return t+((e=e.getChild(n)).namespaced?n+"/":"")}),"")},Hm.prototype.update=function(t){Km([],this.root,t)},Hm.prototype.register=function(t,e,n){var r=this;void 0===n&&(n=!0);var o=new qm(e,n);0===t.length?this.root=o:this.get(t.slice(0,-1)).addChild(t[t.length-1],o);e.modules&&Bm(e.modules,(function(e,o){r.register(t.concat(o),e,n)}))},Hm.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1],r=e.getChild(n);r&&r.runtime&&e.removeChild(n)},Hm.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];return!!e&&e.hasChild(n)};var Um=function(t){var e=this;void 0===t&&(t={}),!Wm&&"undefined"!=typeof window&&window.Vue&&ng(window.Vue);var n=t.plugins;void 0===n&&(n=[]);var r=t.strict;void 0===r&&(r=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new Hm(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new Wm,this._makeLocalGettersCache=Object.create(null);var o=this,i=this.dispatch,s=this.commit;this.dispatch=function(t,e){return i.call(o,t,e)},this.commit=function(t,e,n){return s.call(o,t,e,n)},this.strict=r;var a=this._modules.root.state;Qm(this,a,[],this._modules.root),Xm(this,a),n.forEach((function(t){return t(e)})),(void 0!==t.devtools?t.devtools:Wm.config.devtools)&&function(t){Fm&&(t._devtoolHook=Fm,Fm.emit("vuex:init",t),Fm.on("vuex:travel-to-state",(function(e){t.replaceState(e)})),t.subscribe((function(t,e){Fm.emit("vuex:mutation",t,e)}),{prepend:!0}),t.subscribeAction((function(t,e){Fm.emit("vuex:action",t,e)}),{prepend:!0}))}(this)},Ym={state:{configurable:!0}};function Gm(t,e,n){return e.indexOf(t)<0&&(n&&n.prepend?e.unshift(t):e.push(t)),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function Zm(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;Qm(t,n,[],t._modules.root,!0),Xm(t,n,e)}function Xm(t,e,n){var r=t._vm;t.getters={},t._makeLocalGettersCache=Object.create(null);var o=t._wrappedGetters,i={};Bm(o,(function(e,n){i[n]=function(t,e){return function(){return t(e)}}(e,t),Object.defineProperty(t.getters,n,{get:function(){return t._vm[n]},enumerable:!0})}));var s=Wm.config.silent;Wm.config.silent=!0,t._vm=new Wm({data:{$$state:e},computed:i}),Wm.config.silent=s,t.strict&&function(t){t._vm.$watch((function(){return this._data.$$state}),(function(){}),{deep:!0,sync:!0})}(t),r&&(n&&t._withCommit((function(){r._data.$$state=null})),Wm.nextTick((function(){return r.$destroy()})))}function Qm(t,e,n,r,o){var i=!n.length,s=t._modules.getNamespace(n);if(r.namespaced&&(t._modulesNamespaceMap[s],t._modulesNamespaceMap[s]=r),!i&&!o){var a=tg(e,n.slice(0,-1)),l=n[n.length-1];t._withCommit((function(){Wm.set(a,l,r.state)}))}var c=r.context=function(t,e,n){var r=""===e,o={dispatch:r?t.dispatch:function(n,r,o){var i=eg(n,r,o),s=i.payload,a=i.options,l=i.type;return a&&a.root||(l=e+l),t.dispatch(l,s)},commit:r?t.commit:function(n,r,o){var i=eg(n,r,o),s=i.payload,a=i.options,l=i.type;a&&a.root||(l=e+l),t.commit(l,s,a)}};return Object.defineProperties(o,{getters:{get:r?function(){return t.getters}:function(){return function(t,e){if(!t._makeLocalGettersCache[e]){var n={},r=e.length;Object.keys(t.getters).forEach((function(o){if(o.slice(0,r)===e){var i=o.slice(r);Object.defineProperty(n,i,{get:function(){return t.getters[o]},enumerable:!0})}})),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}(t,e)}},state:{get:function(){return tg(t.state,n)}}}),o}(t,s,n);r.forEachMutation((function(e,n){!function(t,e,n,r){var o=t._mutations[e]||(t._mutations[e]=[]);o.push((function(e){n.call(t,r.state,e)}))}(t,s+n,e,c)})),r.forEachAction((function(e,n){var r=e.root?n:s+n,o=e.handler||e;!function(t,e,n,r){var o=t._actions[e]||(t._actions[e]=[]);o.push((function(e){var o,i=n.call(t,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:t.getters,rootState:t.state},e);return(o=i)&&"function"==typeof o.then||(i=Promise.resolve(i)),t._devtoolHook?i.catch((function(e){throw t._devtoolHook.emit("vuex:error",e),e})):i}))}(t,r,o,c)})),r.forEachGetter((function(e,n){!function(t,e,n,r){if(t._wrappedGetters[e])return;t._wrappedGetters[e]=function(t){return n(r.state,r.getters,t.state,t.getters)}}(t,s+n,e,c)})),r.forEachChild((function(r,i){Qm(t,e,n.concat(i),r,o)}))}function tg(t,e){return e.reduce((function(t,e){return t[e]}),t)}function eg(t,e,n){return Vm(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}function ng(t){Wm&&t===Wm||function(t){if(Number(t.version.split(".")[0])>=2)t.mixin({beforeCreate:n});else{var e=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[n].concat(t.init):n,e.call(this,t)}}function n(){var t=this.$options;t.store?this.$store="function"==typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}(Wm=t)}Ym.state.get=function(){return this._vm._data.$$state},Ym.state.set=function(t){},Um.prototype.commit=function(t,e,n){var r=this,o=eg(t,e,n),i=o.type,s=o.payload,a={type:i,payload:s},l=this._mutations[i];l&&(this._withCommit((function(){l.forEach((function(t){t(s)}))})),this._subscribers.slice().forEach((function(t){return t(a,r.state)})))},Um.prototype.dispatch=function(t,e){var n=this,r=eg(t,e),o=r.type,i=r.payload,s={type:o,payload:i},a=this._actions[o];if(a){try{this._actionSubscribers.slice().filter((function(t){return t.before})).forEach((function(t){return t.before(s,n.state)}))}catch(Fg){}var l=a.length>1?Promise.all(a.map((function(t){return t(i)}))):a[0](i);return new Promise((function(t,e){l.then((function(e){try{n._actionSubscribers.filter((function(t){return t.after})).forEach((function(t){return t.after(s,n.state)}))}catch(Fg){}t(e)}),(function(t){try{n._actionSubscribers.filter((function(t){return t.error})).forEach((function(e){return e.error(s,n.state,t)}))}catch(Fg){}e(t)}))}))}},Um.prototype.subscribe=function(t,e){return Gm(t,this._subscribers,e)},Um.prototype.subscribeAction=function(t,e){return Gm("function"==typeof t?{before:t}:t,this._actionSubscribers,e)},Um.prototype.watch=function(t,e,n){var r=this;return this._watcherVM.$watch((function(){return t(r.state,r.getters)}),e,n)},Um.prototype.replaceState=function(t){var e=this;this._withCommit((function(){e._vm._data.$$state=t}))},Um.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"==typeof t&&(t=[t]),this._modules.register(t,e),Qm(this,this.state,t,this._modules.get(t),n.preserveState),Xm(this,this.state)},Um.prototype.unregisterModule=function(t){var e=this;"string"==typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit((function(){var n=tg(e.state,t.slice(0,-1));Wm.delete(n,t[t.length-1])})),Zm(this)},Um.prototype.hasModule=function(t){return"string"==typeof t&&(t=[t]),this._modules.isRegistered(t)},Um.prototype.hotUpdate=function(t){this._modules.update(t),Zm(this,!0)},Um.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(Um.prototype,Ym);var rg=lg((function(t,e){var n={};return ag(e).forEach((function(e){var r=e.key,o=e.val;n[r]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var r=cg(this.$store,"mapState",t);if(!r)return;e=r.context.state,n=r.context.getters}return"function"==typeof o?o.call(this,e,n):e[o]},n[r].vuex=!0})),n})),og=lg((function(t,e){var n={};return ag(e).forEach((function(e){var r=e.key,o=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.commit;if(t){var i=cg(this.$store,"mapMutations",t);if(!i)return;r=i.context.commit}return"function"==typeof o?o.apply(this,[r].concat(e)):r.apply(this.$store,[o].concat(e))}})),n})),ig=lg((function(t,e){var n={};return ag(e).forEach((function(e){var r=e.key,o=e.val;o=t+o,n[r]=function(){if(!t||cg(this.$store,"mapGetters",t))return this.$store.getters[o]},n[r].vuex=!0})),n})),sg=lg((function(t,e){var n={};return ag(e).forEach((function(e){var r=e.key,o=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.dispatch;if(t){var i=cg(this.$store,"mapActions",t);if(!i)return;r=i.context.dispatch}return"function"==typeof o?o.apply(this,[r].concat(e)):r.apply(this.$store,[o].concat(e))}})),n}));function ag(t){return function(t){return Array.isArray(t)||Vm(t)}(t)?Array.isArray(t)?t.map((function(t){return{key:t,val:t}})):Object.keys(t).map((function(e){return{key:e,val:t[e]}})):[]}function lg(t){return function(e,n){return"string"!=typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function cg(t,e,n){return t._modulesNamespaceMap[n]}function ug(t,e,n){var r=n?t.groupCollapsed:t.group;try{r.call(t,e)}catch(Fg){t.log(e)}}function dg(t){try{t.groupEnd()}catch(Fg){t.log("—— log end ——")}}function fg(){var t=new Date;return" @ "+hg(t.getHours(),2)+":"+hg(t.getMinutes(),2)+":"+hg(t.getSeconds(),2)+"."+hg(t.getMilliseconds(),3)}function hg(t,e){return n="0",r=e-t.toString().length,new Array(r+1).join(n)+t;var n,r}const pg={Store:Um,install:ng,version:"3.6.2",mapState:rg,mapMutations:og,mapGetters:ig,mapActions:sg,createNamespacedHelpers:function(t){return{mapState:rg.bind(null,t),mapGetters:ig.bind(null,t),mapMutations:og.bind(null,t),mapActions:sg.bind(null,t)}},createLogger:function(t){void 0===t&&(t={});var e=t.collapsed;void 0===e&&(e=!0);var n=t.filter;void 0===n&&(n=function(t,e,n){return!0});var r=t.transformer;void 0===r&&(r=function(t){return t});var o=t.mutationTransformer;void 0===o&&(o=function(t){return t});var i=t.actionFilter;void 0===i&&(i=function(t,e){return!0});var s=t.actionTransformer;void 0===s&&(s=function(t){return t});var a=t.logMutations;void 0===a&&(a=!0);var l=t.logActions;void 0===l&&(l=!0);var c=t.logger;return void 0===c&&(c=console),function(t){var u=Lm(t.state);void 0!==c&&(a&&t.subscribe((function(t,i){var s=Lm(i);if(n(t,u,s)){var a=fg(),l=o(t),d="mutation "+t.type+a;ug(c,d,e),c.log("%c prev state","color: #9E9E9E; font-weight: bold",r(u)),c.log("%c mutation","color: #03A9F4; font-weight: bold",l),c.log("%c next state","color: #4CAF50; font-weight: bold",r(s)),dg(c)}u=s})),l&&t.subscribeAction((function(t,n){if(i(t,n)){var r=fg(),o=s(t),a="action "+t.type+r;ug(c,a,e),c.log("%c action","color: #03A9F4; font-weight: bold",o),dg(c)}})))}}};function mg(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map((function(t){t(n)})),(r=t.get("*"))&&r.slice().map((function(t){t(e,n)}))}}}var gg,vg,yg="function"==typeof Map?new Map:(gg=[],vg=[],{has:function(t){return gg.indexOf(t)>-1},get:function(t){return vg[gg.indexOf(t)]},set:function(t,e){-1===gg.indexOf(t)&&(gg.push(t),vg.push(e))},delete:function(t){var e=gg.indexOf(t);e>-1&&(gg.splice(e,1),vg.splice(e,1))}}),bg=function(t){return new Event(t,{bubbles:!0})};try{new Event("test")}catch(Fg){bg=function(t){var e=document.createEvent("Event");return e.initEvent(t,!0,!1),e}}function wg(t){var e=yg.get(t);e&&e.destroy()}function xg(t){var e=yg.get(t);e&&e.update()}var kg=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((kg=function(t){return t}).destroy=function(t){return t},kg.update=function(t){return t}):((kg=function(t,e){return t&&Array.prototype.forEach.call(t.length?t:[t],(function(t){return function(t){if(t&&t.nodeName&&"TEXTAREA"===t.nodeName&&!yg.has(t)){var e,n=null,r=null,o=null,i=function(){t.clientWidth!==r&&c()},s=function(e){window.removeEventListener("resize",i,!1),t.removeEventListener("input",c,!1),t.removeEventListener("keyup",c,!1),t.removeEventListener("autosize:destroy",s,!1),t.removeEventListener("autosize:update",c,!1),Object.keys(e).forEach((function(n){t.style[n]=e[n]})),yg.delete(t)}.bind(t,{height:t.style.height,resize:t.style.resize,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener("autosize:destroy",s,!1),"onpropertychange"in t&&"oninput"in t&&t.addEventListener("keyup",c,!1),window.addEventListener("resize",i,!1),t.addEventListener("input",c,!1),t.addEventListener("autosize:update",c,!1),t.style.overflowX="hidden",t.style.wordWrap="break-word",yg.set(t,{destroy:s,update:c}),"vertical"===(e=window.getComputedStyle(t,null)).resize?t.style.resize="none":"both"===e.resize&&(t.style.resize="horizontal"),n="content-box"===e.boxSizing?-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)):parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth),isNaN(n)&&(n=0),c()}function a(e){var n=t.style.width;t.style.width="0px",t.style.width=n,t.style.overflowY=e}function l(){if(0!==t.scrollHeight){var e=function(t){for(var e=[];t&&t.parentNode&&t.parentNode instanceof Element;)t.parentNode.scrollTop&&(t.parentNode.style.scrollBehavior="auto",e.push([t.parentNode,t.parentNode.scrollTop])),t=t.parentNode;return function(){return e.forEach((function(t){var e=t[0];e.scrollTop=t[1],e.style.scrollBehavior=null}))}}(t);t.style.height="",t.style.height=t.scrollHeight+n+"px",r=t.clientWidth,e()}}function c(){l();var e=Math.round(parseFloat(t.style.height)),n=window.getComputedStyle(t,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):t.offsetHeight;if(r=e?t:""+Array(e+1-r.length).join(n)+t},y={s:v,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),o=n%60;return(e<=0?"+":"-")+v(r,2,"0")+":"+v(o,2,"0")},m:function t(e,n){if(e.date()1)return t(s[0])}else{var a=e.name;w[a]=e,o=a}return!r&&o&&(b=o),o||!r&&b},S=function(t,e){if(x(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new M(n)},O=y;O.l=k,O.i=x,O.w=function(t,e){return S(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var M=function(){function g(t){this.$L=k(t.locale,null,!0),this.parse(t)}var v=g.prototype;return v.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(p);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},v.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},v.$utils=function(){return O},v.isValid=function(){return!(this.$d.toString()===h)},v.isSame=function(t,e){var n=S(t);return this.startOf(e)<=n&&n<=this.endOf(e)},v.isAfter=function(t,e){return S(t)68?1900:2e3)},a=function(t){return function(e){this[t]=+e}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),n=60*e[1]+(+e[2]||0);return 0===n?0:"+"===e[0]?-n:n}(t)}],c=function(t){var e=i[t];return e&&(e.indexOf?e:e.s.concat(e.f))},u=function(t,e){var n,r=i.meridiem;if(r){for(var o=1;o<=24;o+=1)if(t.indexOf(r(o,0,e))>-1){n=o>12;break}}else n=t===(e?"pm":"PM");return n},d={A:[o,function(t){this.afternoon=u(t,!1)}],a:[o,function(t){this.afternoon=u(t,!0)}],S:[/\d/,function(t){this.milliseconds=100*+t}],SS:[n,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[o,function(t){var e=i.ordinal,n=t.match(/\d+/);if(this.day=n[0],e)for(var r=1;r<=31;r+=1)e(r).replace(/\[|\]/g,"")===t&&(this.day=r)}],M:[r,a("month")],MM:[n,a("month")],MMM:[o,function(t){var e=c("months"),n=(c("monthsShort")||e.map((function(t){return t.slice(0,3)}))).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[o,function(t){var e=c("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(t){this.year=s(t)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function f(n){var r,o;r=n,o=i&&i.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,n,r){var i=r&&r.toUpperCase();return n||o[r]||t[r]||o[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),a=s.length,l=0;l-1)return new Date(("X"===e?1e3:1)*t);var r=f(e)(t),o=r.year,i=r.month,s=r.day,a=r.hours,l=r.minutes,c=r.seconds,u=r.milliseconds,d=r.zone,h=new Date,p=s||(o||i?1:h.getDate()),m=o||h.getFullYear(),g=0;o&&!i||(g=i>0?i-1:h.getMonth());var v=a||0,y=l||0,b=c||0,w=u||0;return d?new Date(Date.UTC(m,g,p,v,y,b,w+60*d.offset*1e3)):n?new Date(Date.UTC(m,g,p,v,y,b,w)):new Date(m,g,p,v,y,b,w)}catch(x){return new Date("")}}(e,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&e!=this.format(a)&&(this.$d=new Date("")),i={}}else if(a instanceof Array)for(var h=a.length,p=1;p<=h;p+=1){s[1]=a[p-1];var m=n.apply(this,s);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}p===h&&(this.$d=new Date(""))}else o.call(this,t)}}}();var $g={},Ng={};function Tg(t){return null==t}function Dg(t){return null!=t}function Ag(t,e){return e.tag===t.tag&&e.key===t.key}function Eg(t){var e=t.tag;t.vm=new e({data:t.args})}function Pg(t,e,n){var r,o,i={};for(r=e;r<=n;++r)Dg(o=t[r].key)&&(i[o]=r);return i}function Ig(t,e,n){for(;e<=n;++e)Eg(t[e])}function Rg(t,e,n){for(;e<=n;++e){var r=t[e];Dg(r)&&(r.vm.$destroy(),r.vm=null)}}function zg(t,e){t!==e&&(e.vm=t.vm,function(t){for(var e=Object.keys(t.args),n=0;na?Ig(e,s,u):s>u&&Rg(t,i,a)}(t,e):Dg(e)?Ig(e,0,e.length-1):Dg(t)&&Rg(t,0,t.length-1)},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Vuelidate=M,t.validationMixin=t.default=void 0,Object.defineProperty(t,"withParams",{enumerable:!0,get:function(){return n.withParams}});var e=Ng,n=Np;function r(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?a:a.$sub[0]:null}}},computed:{run:function(){var t=this,e=this.lazyParentModel();if(Array.isArray(e)&&e.__ob__){var n=e.__ob__.dep;n.depend();var r=n.constructor.target;if(!this._indirectWatcher){var o=r.constructor;this._indirectWatcher=new o(this,(function(){return t.runRule(e)}),null,{lazy:!0})}var i=this.getModel();if(!this._indirectWatcher.dirty&&this._lastModel===i)return this._indirectWatcher.depend(),r.value;this._lastModel=i,this._indirectWatcher.evaluate(),this._indirectWatcher.depend()}else this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null);return this._indirectWatcher?this._indirectWatcher.value:this.runRule(e)},$params:function(){return this.run.params},proxy:function(){var t=this.run.output;return t[p]?!!t.v:!!t},$pending:function(){var t=this.run.output;return!!t[p]&&t.p}},destroyed:function(){this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null)}}),a=o.extend({data:function(){return{dirty:!1,validations:null,lazyModel:null,model:null,prop:null,lazyParentModel:null,rootModel:null}},methods:s(s({},v),{},{refProxy:function(t){return this.getRef(t).proxy},getRef:function(t){return this.refs[t]},isNested:function(t){return"function"!=typeof this.validations[t]}}),computed:s(s({},m),{},{nestedKeys:function(){return this.keys.filter(this.isNested)},ruleKeys:function(){var t=this;return this.keys.filter((function(e){return!t.isNested(e)}))},keys:function(){return Object.keys(this.validations).filter((function(t){return"$params"!==t}))},proxy:function(){var t=this,e=u(this.keys,(function(e){return{enumerable:!0,configurable:!0,get:function(){return t.refProxy(e)}}})),n=u(y,(function(e){return{enumerable:!0,configurable:!0,get:function(){return t[e]}}})),r=u(b,(function(e){return{enumerable:!1,configurable:!0,get:function(){return t[e]}}})),o=this.hasIter()?{$iter:{enumerable:!0,value:Object.defineProperties({},s({},e))}}:{};return Object.defineProperties({},s(s(s(s({},e),o),{},{$model:{enumerable:!0,get:function(){var e=t.lazyParentModel();return null!=e?e[t.prop]:null},set:function(e){var n=t.lazyParentModel();null!=n&&(n[t.prop]=e,t.$touch())}}},n),r))},children:function(){var t=this;return[].concat(r(this.nestedKeys.map((function(e){return x(t,e)}))),r(this.ruleKeys.map((function(e){return k(t,e)})))).filter(Boolean)}})}),l=a.extend({methods:{isNested:function(t){return void 0!==this.validations[t]()},getRef:function(t){var e=this;return{get proxy(){return e.validations[t]()||!1}}}}}),g=a.extend({computed:{keys:function(){var t=this.getModel();return f(t)?Object.keys(t):[]},tracker:function(){var t=this,e=this.validations.$trackBy;return e?function(n){return"".concat(h(t.rootModel,t.getModelKey(n),e))}:function(t){return"".concat(t)}},getModelLazy:function(){var t=this;return function(){return t.getModel()}},children:function(){var t=this,n=this.validations,r=this.getModel(),o=s({},n);delete o.$trackBy;var i={};return this.keys.map((function(n){var s=t.tracker(n);return i.hasOwnProperty(s)?null:(i[s]=!0,(0,e.h)(a,s,{validations:o,prop:n,lazyParentModel:t.getModelLazy,model:r[n],rootModel:t.rootModel}))})).filter(Boolean)}},methods:{isNested:function(){return!0},getRef:function(t){return this.refs[this.tracker(t)]},hasIter:function(){return!0}}}),x=function(t,n){if("$each"===n)return(0,e.h)(g,n,{validations:t.validations[n],lazyParentModel:t.lazyParentModel,prop:n,lazyModel:t.getModel,rootModel:t.rootModel});var r=t.validations[n];if(Array.isArray(r)){var o=t.rootModel,i=u(r,(function(t){return function(){return h(o,o.$v,t)}}),(function(t){return Array.isArray(t)?t.join("."):t}));return(0,e.h)(l,n,{validations:i,lazyParentModel:c,prop:n,lazyModel:c,rootModel:o})}return(0,e.h)(a,n,{validations:r,lazyParentModel:t.getModel,prop:n,lazyModel:t.getModelKey,rootModel:t.rootModel})},k=function(t,n){return(0,e.h)(i,n,{rule:t.validations[n],lazyParentModel:t.lazyParentModel,lazyModel:t.getModel,rootModel:t.rootModel})};return w={VBase:o,Validation:a}},k=null;var S=function(t,n){var r=function(t){if(k)return k;for(var e=t.constructor;e.super;)e=e.super;return k=e,e}(t),o=x(r),i=o.Validation;return new(0,o.VBase)({computed:{children:function(){var r="function"==typeof n?n.call(t):n;return[(0,e.h)(i,"$v",{validations:r,lazyParentModel:c,prop:"$v",model:t,rootModel:t})]}}})},O={data:function(){var t=this.$options.validations;return t&&(this._vuelidate=S(this,t)),{}},beforeCreate:function(){var t=this.$options;t.validations&&(t.computed||(t.computed={}),t.computed.$v||(t.computed.$v=function(){return this._vuelidate?this._vuelidate.refs.$v.proxy:null}))},beforeDestroy:function(){this._vuelidate&&(this._vuelidate.$destroy(),this._vuelidate=null)}};function M(t){t.mixin(O)}t.validationMixin=O;var _=M;t.default=_}($g);const jg=Op($g);export{jm as A,Dt as B,pg as C,El as D,Hc as E,qa as F,mg as G,Mg as H,jh as I,Cg as J,Sg as K,jg as L,Ic as N,Uc as P,Ya as S,Ec as T,Hn as V,Th as a,Vh as b,Ah as c,qh as d,Sh as e,Zh as f,Qh as g,ep as h,Dl as i,Fh as j,gh as k,tp as l,Qf as m,ql as n,zh as o,wp as p,kp as q,xp as r,Tt as s,Dh as t,Bh as u,Sp as v,Xh as w,bp as x,Mp as y,We as z}; diff --git a/kirby/panel/dist/js/vuedraggable.js b/kirby/panel/dist/js/vuedraggable.js index 2b85509..696f5f4 100644 --- a/kirby/panel/dist/js/vuedraggable.js +++ b/kirby/panel/dist/js/vuedraggable.js @@ -1,7 +1 @@ -/**! - * Sortable 1.10.2 - * @author RubaXa - * @author owenm - * @license MIT - */ function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n(){return n=Object.assign||function(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function r(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var a=r(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),l=r(/Edge/i),s=r(/firefox/i),c=r(/safari/i)&&!r(/chrome/i)&&!r(/android/i),d=r(/iP(ad|od|hone)/i),u=r(/chrome/i)&&r(/android/i),h={capture:!1,passive:!1};function f(t,e,n){t.addEventListener(e,n,!a&&h)}function p(t,e,n){t.removeEventListener(e,n,!a&&h)}function g(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(n){return!1}return!1}}function m(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function v(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&g(t,e):g(t,e))||o&&t===n)return t;if(t===n)break}while(t=m(t))}return null}var b,y=/\s+/g;function w(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(y," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(y," ")}}function E(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function D(t,e){var n="";if("string"==typeof t)n=t;else do{var o=E(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function _(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i=r:i<=r))return o;if(o===S())break;o=N(o,!1)}return!1}function T(t,e,n){for(var o=0,i=0,r=t.children;i2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,a=i(n,["evt"]);$.pluginEvent.bind(At)(t,e,o({dragEl:H,parentEl:W,ghostEl:V,rootEl:U,nextEl:z,lastDownEl:G,cloneEl:q,cloneHidden:J,dragStarted:ct,putSortable:nt,activeSortable:At.active,originalEvent:r,oldIndex:Z,oldDraggableIndex:Q,newIndex:K,newDraggableIndex:tt,hideGhostForTarget:It,unhideGhostForTarget:Mt,cloneNowHidden:function(){J=!0},cloneNowShown:function(){J=!1},dispatchSortableEvent:function(t){j({sortable:e,name:t,originalEvent:r})}},a))};function j(t){!function(t){var e=t.sortable,n=t.rootEl,i=t.name,r=t.targetEl,s=t.cloneEl,c=t.toEl,d=t.fromEl,u=t.oldIndex,h=t.newIndex,f=t.oldDraggableIndex,p=t.newDraggableIndex,g=t.originalEvent,m=t.putSortable,v=t.extraEventProperties;if(e=e||n&&n[R]){var b,y=e.options,w="on"+i.charAt(0).toUpperCase()+i.substr(1);!window.CustomEvent||a||l?(b=document.createEvent("Event")).initEvent(i,!0,!0):b=new CustomEvent(i,{bubbles:!0,cancelable:!0}),b.to=c||n,b.from=d||n,b.item=r||n,b.clone=s,b.oldIndex=u,b.newIndex=h,b.oldDraggableIndex=f,b.newDraggableIndex=p,b.originalEvent=g,b.pullMode=m?m.lastPutMode:void 0;var E=o({},v,$.getEventProperties(i,e));for(var D in E)b[D]=E[D];n&&n.dispatchEvent(b),y[w]&&y[w].call(e,b)}}(o({putSortable:nt,cloneEl:q,targetEl:H,rootEl:U,oldIndex:Z,oldDraggableIndex:Q,newIndex:K,newDraggableIndex:tt},t))}var H,W,V,U,z,G,q,J,Z,K,Q,tt,et,nt,ot,it,rt,at,lt,st,ct,dt,ut,ht,ft,pt=!1,gt=!1,mt=[],vt=!1,bt=!1,yt=[],wt=!1,Et=[],Dt="undefined"!=typeof document,_t=d,St=l||a?"cssFloat":"float",Ct=Dt&&!u&&!d&&"draggable"in document.createElement("div"),xt=function(){if(Dt){if(a)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Tt=function(t,e){var n=E(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=T(t,0,e),r=T(t,1,e),a=i&&E(i),l=r&&E(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+C(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+C(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var d="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==d?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=o&&"none"===n[St]||r&&"none"===n[St]&&s+c>o)?"vertical":"horizontal"},Ot=function(e){function n(t,e){return function(o,i,r,a){var l=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(e||l))return!0;if(null==t||!1===t)return!1;if(e&&"clone"===t)return t;if("function"==typeof t)return n(t(o,i,r,a),e)(o,i,r,a);var s=(e?o:i).options.group.name;return!0===t||"string"==typeof t&&t===s||t.join&&t.indexOf(s)>-1}}var o={},i=e.group;i&&"object"==t(i)||(i={name:i}),o.name=i.name,o.checkPull=n(i.pull,!0),o.checkPut=n(i.put),o.revertClone=i.revertClone,e.group=o},It=function(){!xt&&V&&E(V,"display","none")},Mt=function(){!xt&&V&&E(V,"display","")};Dt&&document.addEventListener("click",(function(t){if(gt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),gt=!1,!1}),!0);var Nt=function(t){if(H){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,mt.some((function(t){if(!O(t)){var e=C(t),n=t[R].options.emptyInsertThreshold,o=i>=e.left-n&&i<=e.right+n,l=r>=e.top-n&&r<=e.bottom+n;return n&&o&&l?a=t:void 0}})),a);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[R]._onDragOver(n)}}var i,r,a},Pt=function(t){H&&H.parentNode[R]._isOutsideThisEl(t.target)};function At(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=n({},e),t[R]=this;var o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Tt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.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:!1!==At.supportPointer&&"PointerEvent"in window,emptyInsertThreshold:5};for(var i in $.initializePlugins(this,t,o),o)!(i in e)&&(e[i]=o[i]);for(var r in Ot(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Ct,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?f(t,"pointerdown",this._onTapStart):(f(t,"mousedown",this._onTapStart),f(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(f(t,"dragover",this),f(t,"dragenter",this)),mt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),n(this,X())}function kt(t,e,n,o,i,r,s,c){var d,u,h=t[R],f=h.options.onMove;return!window.CustomEvent||a||l?(d=document.createEvent("Event")).initEvent("move",!0,!0):d=new CustomEvent("move",{bubbles:!0,cancelable:!0}),d.to=e,d.from=t,d.dragged=n,d.draggedRect=o,d.related=i||e,d.relatedRect=r||C(e),d.willInsertAfter=c,d.originalEvent=s,t.dispatchEvent(d),f&&(u=f.call(h,d,s)),u}function Ft(t){t.draggable=!1}function Rt(){wt=!1}function Xt(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Lt(t){return setTimeout(t,0)}function Yt(t){return clearTimeout(t)}At.prototype={constructor:At,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(dt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,H):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,l=(a||t).target,s=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(function(t){Et.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Et.push(o)}}(n),!H&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled||s.isContentEditable||(l=v(l,o.draggable,n,!1))&&l.animated||G===l)){if(Z=I(l),Q=I(l,o.draggable),"function"==typeof c){if(c.call(this,t,l,this))return j({sortable:e,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),B("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=v(s,o.trim(),n,!1))return j({sortable:e,rootEl:o,name:"filter",targetEl:l,fromEl:n,toEl:n}),B("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!v(s,o.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,c=i.options,d=r.ownerDocument;if(n&&!H&&n.parentNode===r){var u=C(n);if(U=r,W=(H=n).parentNode,z=H.nextSibling,G=n,et=c.group,At.dragged=H,ot={target:H,clientX:(e||t).clientX,clientY:(e||t).clientY},lt=ot.clientX-u.left,st=ot.clientY-u.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,H.style["will-change"]="all",o=function(){B("delayEnded",i,{evt:t}),At.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!s&&i.nativeDraggable&&(H.draggable=!0),i._triggerDragStart(t,e),j({sortable:i,name:"choose",originalEvent:t}),w(H,c.chosenClass,!0))},c.ignore.split(",").forEach((function(t){_(H,t.trim(),Ft)})),f(d,"dragover",Nt),f(d,"mousemove",Nt),f(d,"touchmove",Nt),f(d,"mouseup",i._onDrop),f(d,"touchend",i._onDrop),f(d,"touchcancel",i._onDrop),s&&this.nativeDraggable&&(this.options.touchStartThreshold=4,H.draggable=!0),B("delayStart",this,{evt:t}),!c.delay||c.delayOnTouchOnly&&!e||this.nativeDraggable&&(l||a))o();else{if(At.eventCanceled)return void this._onDrop();f(d,"mouseup",i._disableDelayedDrag),f(d,"touchend",i._disableDelayedDrag),f(d,"touchcancel",i._disableDelayedDrag),f(d,"mousemove",i._delayedDragTouchMoveHandler),f(d,"touchmove",i._delayedDragTouchMoveHandler),c.supportPointer&&f(d,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,c.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){H&&Ft(H),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;p(t,"mouseup",this._disableDelayedDrag),p(t,"touchend",this._disableDelayedDrag),p(t,"touchcancel",this._disableDelayedDrag),p(t,"mousemove",this._delayedDragTouchMoveHandler),p(t,"touchmove",this._delayedDragTouchMoveHandler),p(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?f(document,"pointermove",this._onTouchMove):f(document,e?"touchmove":"mousemove",this._onTouchMove):(f(H,"dragend",this),f(U,"dragstart",this._onDragStart));try{document.selection?Lt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(pt=!1,U&&H){B("dragStarted",this,{evt:e}),this.nativeDraggable&&f(document,"dragover",Pt);var n=this.options;!t&&w(H,n.dragClass,!1),w(H,n.ghostClass,!0),At.active=this,t&&this._appendGhost(),j({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(it){this._lastX=it.clientX,this._lastY=it.clientY,It();for(var t=document.elementFromPoint(it.clientX,it.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(it.clientX,it.clientY))!==e;)e=t;if(H.parentNode[R]._isOutsideThisEl(t),e)do{if(e[R]){if(e[R]._onDragOver({clientX:it.clientX,clientY:it.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Mt()}},_onTouchMove:function(t){if(ot){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=V&&D(V,!0),a=V&&r&&r.a,l=V&&r&&r.d,s=_t&&ft&&M(ft),c=(i.clientX-ot.clientX+o.x)/(a||1)+(s?s[0]-yt[0]:0)/(a||1),d=(i.clientY-ot.clientY+o.y)/(l||1)+(s?s[1]-yt[1]:0)/(l||1);if(!At.active&&!pt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))o.right+i||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+i}(t,r,this)&&!m.animated){if(m===H)return $(!1);if(m&&a===t.target&&(l=m),l&&(n=C(l)),!1!==kt(U,a,H,e,l,n,t,!!l))return Y(),a.appendChild(H),W=a,G(),$(!0)}else if(l.parentNode===a){n=C(l);var b,y,D,_=H.parentNode!==a,S=!function(t,e,n){var o=n?t.left:t.top,i=n?t.right:t.bottom,r=n?t.width:t.height,a=n?e.left:e.top,l=n?e.right:e.bottom,s=n?e.width:e.height;return o===a||i===l||o+r/2===a+s/2}(H.animated&&H.toRect||e,l.animated&&l.toRect||n,r),T=r?"top":"left",M=x(l,"top","top")||x(H,"top","top"),N=M?M.scrollTop:void 0;if(dt!==l&&(y=n[T],vt=!1,bt=!S&&s.invertSwap||_),b=function(t,e,n,o,i,r,a,l){var s=o?t.clientY:t.clientX,c=o?n.height:n.width,d=o?n.top:n.left,u=o?n.bottom:n.right,h=!1;if(!a)if(l&&htd+c*r/2:su-ht)return-ut}else if(s>d+c*(1-i)/2&&su-c*r/2))return s>d+c/2?1:-1;return 0}(t,l,n,r,S?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,bt,dt===l),0!==b){var P=I(H);do{P-=b,D=W.children[P]}while(D&&("none"===E(D,"display")||D===V))}if(0===b||D===l)return $(!1);dt=l,ut=b;var A=l.nextElementSibling,F=!1,X=kt(U,a,H,e,l,n,t,F=1===b);if(!1!==X)return 1!==X&&-1!==X||(F=1===X),wt=!0,setTimeout(Rt,30),Y(),F&&!A?a.appendChild(H):l.parentNode.insertBefore(H,F?A:l),M&&k(M,0,N-M.scrollTop),W=H.parentNode,void 0===y||bt||(ht=Math.abs(y-C(l)[T])),G(),$(!0)}if(a.contains(H))return $(!1)}return!1}function L(s,c){B(s,p,o({evt:t,isOwner:u,axis:r?"vertical":"horizontal",revert:i,dragRect:e,targetRect:n,canSort:h,fromSortable:f,target:l,completed:$,onMove:function(n,o){return kt(U,a,H,e,n,C(n),t,o)},changed:G},c))}function Y(){L("dragOverAnimationCapture"),p.captureAnimationState(),p!==f&&f.captureAnimationState()}function $(e){return L("dragOverCompleted",{insertion:e}),e&&(u?d._hideClone():d._showClone(p),p!==f&&(w(H,nt?nt.options.ghostClass:d.options.ghostClass,!1),w(H,s.ghostClass,!0)),nt!==p&&p!==At.active?nt=p:p===At.active&&nt&&(nt=null),f===p&&(p._ignoreWhileAnimating=l),p.animateAll((function(){L("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(l===H&&!H.animated||l===a&&!l.animated)&&(dt=null),s.dragoverBubble||t.rootEl||l===document||(H.parentNode[R]._isOutsideThisEl(t.target),!e&&Nt(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function G(){K=I(H),tt=I(H,s.draggable),j({sortable:p,name:"change",toEl:a,newIndex:K,newDraggableIndex:tt,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){p(document,"mousemove",this._onTouchMove),p(document,"touchmove",this._onTouchMove),p(document,"pointermove",this._onTouchMove),p(document,"dragover",Nt),p(document,"mousemove",Nt),p(document,"touchmove",Nt)},_offUpEvents:function(){var t=this.el.ownerDocument;p(t,"mouseup",this._onDrop),p(t,"touchend",this._onDrop),p(t,"pointerup",this._onDrop),p(t,"touchcancel",this._onDrop),p(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;K=I(H),tt=I(H,n.draggable),B("drop",this,{evt:t}),W=H&&H.parentNode,K=I(H),tt=I(H,n.draggable),At.eventCanceled||(pt=!1,bt=!1,vt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Yt(this.cloneId),Yt(this._dragStartId),this.nativeDraggable&&(p(document,"drop",this),p(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),c&&E(document.body,"user-select",""),E(H,"transform",""),t&&(ct&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),V&&V.parentNode&&V.parentNode.removeChild(V),(U===W||nt&&"clone"!==nt.lastPutMode)&&q&&q.parentNode&&q.parentNode.removeChild(q),H&&(this.nativeDraggable&&p(H,"dragend",this),Ft(H),H.style["will-change"]="",ct&&!pt&&w(H,nt?nt.options.ghostClass:this.options.ghostClass,!1),w(H,this.options.chosenClass,!1),j({sortable:this,name:"unchoose",toEl:W,newIndex:null,newDraggableIndex:null,originalEvent:t}),U!==W?(K>=0&&(j({rootEl:W,name:"add",toEl:W,fromEl:U,originalEvent:t}),j({sortable:this,name:"remove",toEl:W,originalEvent:t}),j({rootEl:W,name:"sort",toEl:W,fromEl:U,originalEvent:t}),j({sortable:this,name:"sort",toEl:W,originalEvent:t})),nt&&nt.save()):K!==Z&&K>=0&&(j({sortable:this,name:"update",toEl:W,originalEvent:t}),j({sortable:this,name:"sort",toEl:W,originalEvent:t})),At.active&&(null!=K&&-1!==K||(K=Z,tt=Q),j({sortable:this,name:"end",toEl:W,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){B("nulling",this),U=H=W=V=z=q=G=J=ot=it=ct=K=tt=Z=Q=dt=ut=nt=et=At.dragged=At.ghost=At.clone=At.active=null,Et.forEach((function(t){t.checked=!0})),Et.length=rt=at=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":H&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;ot.replace(ee,((t,e)=>e?e.toUpperCase():""))));function oe(t){null!==t.parentElement&&t.parentElement.removeChild(t)}function ie(t,e,n){const o=0===n?t.children[0]:t.children[n-1].nextSibling;t.insertBefore(e,o)}function re(t,e){this.$nextTick((()=>this.$emit(t.toLowerCase(),e)))}function ae(t){return e=>{null!==this.realList&&this["onDrag"+t](e),re.call(this,t,e)}}function le(t){return["transition-group","TransitionGroup"].includes(t)}function se(t,e,n){return t[n]||(e[n]?e[n]():void 0)}const ce=["Start","Add","Remove","Update","End"],de=["Choose","Unchoose","Sort","Filter","Clone"],ue=["Move",...ce,...de].map((t=>"on"+t));var he=null;const fe={name:"draggable",inheritAttrs:!1,props:{options:Object,list:{type:Array,required:!1,default:null},value:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:t=>t},element:{type:String,default:"div"},tag:{type:String,default:null},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},data:()=>({transitionMode:!1,noneFunctionalComponentMode:!1}),render(t){const e=this.$slots.default;this.transitionMode=function(t){if(!t||1!==t.length)return!1;const[{componentOptions:e}]=t;return!!e&&le(e.tag)}(e);const{children:n,headerOffset:o,footerOffset:i}=function(t,e,n){let o=0,i=0;const r=se(e,n,"header");r&&(o=r.length,t=t?[...r,...t]:[...r]);const a=se(e,n,"footer");return a&&(i=a.length,t=t?[...t,...a]:[...a]),{children:t,headerOffset:o,footerOffset:i}}(e,this.$slots,this.$scopedSlots);this.headerOffset=o,this.footerOffset=i;const r=function(t,e){let n=null;const o=(t,e)=>{n=function(t,e,n){return void 0===n||((t=t||{})[e]=n),t}(n,t,e)};if(o("attrs",Object.keys(t).filter((t=>"id"===t||t.startsWith("data-"))).reduce(((e,n)=>(e[n]=t[n],e)),{})),!e)return n;const{on:i,props:r,attrs:a}=e;return o("on",i),o("props",r),Object.assign(n.attrs,a),n}(this.$attrs,this.componentData);return t(this.getTag(),r,n)},created(){null!==this.list&&null!==this.value&&te.error("Value and list props are mutually exclusive! Please set one or another."),"div"!==this.element&&te.warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props"),void 0!==this.options&&te.warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props")},mounted(){if(this.noneFunctionalComponentMode=this.getTag().toLowerCase()!==this.$el.nodeName.toLowerCase()&&!this.getIsFunctional(),this.noneFunctionalComponentMode&&this.transitionMode)throw new Error(`Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ${this.getTag()}`);const t={};ce.forEach((e=>{t["on"+e]=ae.call(this,e)})),de.forEach((e=>{t["on"+e]=re.bind(this,e)}));const e=Object.keys(this.$attrs).reduce(((t,e)=>(t[ne(e)]=this.$attrs[e],t)),{}),n=Object.assign({},this.options,e,t,{onMove:(t,e)=>this.onDragMove(t,e)});!("draggable"in n)&&(n.draggable=">*"),this._sortable=new At(this.rootContainer,n),this.computeIndexes()},beforeDestroy(){void 0!==this._sortable&&this._sortable.destroy()},computed:{rootContainer(){return this.transitionMode?this.$el.children[0]:this.$el},realList(){return this.list?this.list:this.value}},watch:{options:{handler(t){this.updateOptions(t)},deep:!0},$attrs:{handler(t){this.updateOptions(t)},deep:!0},realList(){this.computeIndexes()}},methods:{getIsFunctional(){const{fnOptions:t}=this._vnode;return t&&t.functional},getTag(){return this.tag||this.element},updateOptions(t){for(var e in t){const n=ne(e);-1===ue.indexOf(n)&&this._sortable.option(n,t[e])}},getChildrenNodes(){if(this.noneFunctionalComponentMode)return this.$children[0].$slots.default;const t=this.$slots.default;return this.transitionMode?t[0].child.$slots.default:t},computeIndexes(){this.$nextTick((()=>{this.visibleIndexes=function(t,e,n,o){if(!t)return[];const i=t.map((t=>t.elm)),r=e.length-o,a=[...e].map(((t,e)=>e>=r?i.length:i.indexOf(t)));return n?a.filter((t=>-1!==t)):a}(this.getChildrenNodes(),this.rootContainer.children,this.transitionMode,this.footerOffset)}))},getUnderlyingVm(t){const e=function(t,e){return t.map((t=>t.elm)).indexOf(e)}(this.getChildrenNodes()||[],t);if(-1===e)return null;return{index:e,element:this.realList[e]}},getUnderlyingPotencialDraggableComponent:({__vue__:t})=>t&&t.$options&&le(t.$options._componentTag)?t.$parent:!("realList"in t)&&1===t.$children.length&&"realList"in t.$children[0]?t.$children[0]:t,emitChanges(t){this.$nextTick((()=>{this.$emit("change",t)}))},alterList(t){if(this.list)return void t(this.list);const e=[...this.value];t(e),this.$emit("input",e)},spliceList(){this.alterList((t=>t.splice(...arguments)))},updatePosition(t,e){this.alterList((n=>n.splice(e,0,n.splice(t,1)[0])))},getRelatedContextFromMoveEvent({to:t,related:e}){const n=this.getUnderlyingPotencialDraggableComponent(t);if(!n)return{component:n};const o=n.realList,i={list:o,component:n};if(t!==e&&o&&n.getUnderlyingVm){const t=n.getUnderlyingVm(e);if(t)return Object.assign(t,i)}return i},getVmIndex(t){const e=this.visibleIndexes,n=e.length;return t>n-1?n:e[t]},getComponent(){return this.$slots.default[0].componentInstance},resetTransitionData(t){if(!this.noTransitionOnDrag||!this.transitionMode)return;this.getChildrenNodes()[t].data=null;const e=this.getComponent();e.children=[],e.kept=void 0},onDragStart(t){this.context=this.getUnderlyingVm(t.item),t.item._underlying_vm_=this.clone(this.context.element),he=t.item},onDragAdd(t){const e=t.item._underlying_vm_;if(void 0===e)return;oe(t.item);const n=this.getVmIndex(t.newIndex);this.spliceList(n,0,e),this.computeIndexes();const o={element:e,newIndex:n};this.emitChanges({added:o})},onDragRemove(t){if(ie(this.rootContainer,t.item,t.oldIndex),"clone"===t.pullMode)return void oe(t.clone);const e=this.context.index;this.spliceList(e,1);const n={element:this.context.element,oldIndex:e};this.resetTransitionData(e),this.emitChanges({removed:n})},onDragUpdate(t){oe(t.item),ie(t.from,t.item,t.oldIndex);const e=this.context.index,n=this.getVmIndex(t.newIndex);this.updatePosition(e,n);const o={element:this.context.element,oldIndex:e,newIndex:n};this.emitChanges({moved:o})},updateProperty(t,e){t.hasOwnProperty(e)&&(t[e]+=this.headerOffset)},computeFutureIndex(t,e){if(!t.element)return 0;const n=[...e.to.children].filter((t=>"none"!==t.style.display)),o=n.indexOf(e.related),i=t.component.getVmIndex(o);return-1!==n.indexOf(he)||!e.willInsertAfter?i:i+1},onDragMove(t,e){const n=this.move;if(!n||!this.realList)return!0;const o=this.getRelatedContextFromMoveEvent(t),i=this.context,r=this.computeFutureIndex(o,t);Object.assign(i,{futureIndex:r});return n(Object.assign({},t,{relatedContext:o,draggedContext:i}),e)},onDragEnd(){this.computeIndexes(),he=null}}};"undefined"!=typeof window&&"Vue"in window&&window.Vue.component("draggable",fe);export{fe as default}; diff --git a/kirby/src/Api/Collection.php b/kirby/src/Api/Collection.php index e3f39c9..cc71b24 100644 --- a/kirby/src/Api/Collection.php +++ b/kirby/src/Api/Collection.php @@ -23,7 +23,7 @@ class Collection protected Api $api; protected $data; protected $model; - protected $select; + protected $select = null; protected $view; /** @@ -36,7 +36,6 @@ class Collection $this->api = $api; $this->data = $data; $this->model = $schema['model'] ?? null; - $this->select = null; $this->view = $schema['view'] ?? null; if ($data === null) { diff --git a/kirby/src/Api/Model.php b/kirby/src/Api/Model.php index e0fa9ba..ba14cb2 100644 --- a/kirby/src/Api/Model.php +++ b/kirby/src/Api/Model.php @@ -91,12 +91,8 @@ class Model */ public function selection(): array { - $select = $this->select; - - if ($select === null) { - $select = array_keys($this->fields); - } - + $select = $this->select; + $select ??= array_keys($this->fields); $selection = []; foreach ($select as $key => $value) { diff --git a/kirby/src/Blueprint/Collection.php b/kirby/src/Blueprint/Collection.php index 3abadb0..a943b74 100644 --- a/kirby/src/Blueprint/Collection.php +++ b/kirby/src/Blueprint/Collection.php @@ -16,7 +16,7 @@ use TypeError; * @copyright Bastian Allgeier * @license https://opensource.org/licenses/MIT * - * // TODO: include in test coverage in 3.9 + * // TODO: include in test coverage 3.10 * @codeCoverageIgnore */ class Collection extends BaseCollection @@ -45,21 +45,22 @@ class Collection extends BaseCollection /** * Validate the type of every item that is being - * added to the collection. They cneed to have + * added to the collection. They need to have * the class defined by static::TYPE. */ public function __set(string $key, $value): void { - if ( - is_a($value, static::TYPE) === false - ) { + if (is_a($value, static::TYPE) === false) { throw new TypeError('Each value in the collection must be an instance of ' . static::TYPE); } parent::__set($key, $value); } - public static function factory(array $items) + /** + * Creates a collection from a nested array structure + */ + public static function factory(array $items): static { $collection = new static(); $className = static::TYPE; @@ -77,7 +78,11 @@ class Collection extends BaseCollection return $collection; } - public function render(ModelWithContent $model) + /** + * Renders each item with a model and returns + * an array of all rendered results + */ + public function render(ModelWithContent $model): array { $props = []; diff --git a/kirby/src/Blueprint/Config.php b/kirby/src/Blueprint/Config.php index abfb1a7..1cd9143 100644 --- a/kirby/src/Blueprint/Config.php +++ b/kirby/src/Blueprint/Config.php @@ -17,7 +17,7 @@ use Kirby\Filesystem\F; * @copyright Bastian Allgeier * @license https://opensource.org/licenses/MIT * - * // TODO: include in test coverage in 3.9 + * // TODO: include in test coverage in 3.10 * @codeCoverageIgnore */ class Config diff --git a/kirby/src/Blueprint/Extension.php b/kirby/src/Blueprint/Extension.php index cb15905..f422b1d 100644 --- a/kirby/src/Blueprint/Extension.php +++ b/kirby/src/Blueprint/Extension.php @@ -11,7 +11,7 @@ namespace Kirby\Blueprint; * @copyright Bastian Allgeier * @license https://opensource.org/licenses/MIT * - * // TODO: include in test coverage in 3.9 + * // TODO: include in test coverage in 3.10 * @codeCoverageIgnore */ class Extension diff --git a/kirby/src/Blueprint/Factory.php b/kirby/src/Blueprint/Factory.php index 3ba9600..148f1eb 100644 --- a/kirby/src/Blueprint/Factory.php +++ b/kirby/src/Blueprint/Factory.php @@ -16,7 +16,7 @@ use ReflectionUnionType; * @copyright Bastian Allgeier * @license https://opensource.org/licenses/MIT * - * // TODO: include in test coverage in 3.9 + * // TODO: include in test coverage in 3.10 * @codeCoverageIgnore */ class Factory @@ -95,7 +95,7 @@ class Factory } // union types - if (is_a($propType, ReflectionUnionType::class) === true) { + if ($propType instanceof ReflectionUnionType) { return static::forUnionType($propType, $value); } diff --git a/kirby/src/Blueprint/Node.php b/kirby/src/Blueprint/Node.php index 88e7d97..80f9ae6 100644 --- a/kirby/src/Blueprint/Node.php +++ b/kirby/src/Blueprint/Node.php @@ -13,7 +13,7 @@ use Kirby\Cms\ModelWithContent; * @copyright Bastian Allgeier * @license https://opensource.org/licenses/MIT * - * // TODO: include in test coverage in 3.9 + * // TODO: include in test coverage in 3.10 * @codeCoverageIgnore */ class Node @@ -53,7 +53,6 @@ class Node return Factory::make(static::class, $props); } - public static function load(string|array $props): static { // load by path diff --git a/kirby/src/Blueprint/NodeI18n.php b/kirby/src/Blueprint/NodeI18n.php index 1eaeb10..5278774 100644 --- a/kirby/src/Blueprint/NodeI18n.php +++ b/kirby/src/Blueprint/NodeI18n.php @@ -14,7 +14,7 @@ use Kirby\Toolkit\I18n; * @copyright Bastian Allgeier * @license https://opensource.org/licenses/MIT * - * // TODO: include in test coverage in 3.9 + * // TODO: include in test coverage in 3.10 * @codeCoverageIgnore */ class NodeI18n extends NodeProperty diff --git a/kirby/src/Blueprint/NodeIcon.php b/kirby/src/Blueprint/NodeIcon.php index 36abdb5..c23d589 100644 --- a/kirby/src/Blueprint/NodeIcon.php +++ b/kirby/src/Blueprint/NodeIcon.php @@ -11,7 +11,7 @@ namespace Kirby\Blueprint; * @copyright Bastian Allgeier * @license https://opensource.org/licenses/MIT * - * // TODO: include in test coverage in 3.9 + * // TODO: include in test coverage in 3.10 * @codeCoverageIgnore */ class NodeIcon extends NodeString diff --git a/kirby/src/Blueprint/NodeProperty.php b/kirby/src/Blueprint/NodeProperty.php index e3646ab..9490435 100644 --- a/kirby/src/Blueprint/NodeProperty.php +++ b/kirby/src/Blueprint/NodeProperty.php @@ -13,7 +13,7 @@ use Kirby\Cms\ModelWithContent; * @copyright Bastian Allgeier * @license https://opensource.org/licenses/MIT * - * // TODO: include in test coverage in 3.9 + * // TODO: include in test coverage in 3.10 * @codeCoverageIgnore */ abstract class NodeProperty diff --git a/kirby/src/Blueprint/NodeString.php b/kirby/src/Blueprint/NodeString.php index 1fc1d70..9f9cf1b 100644 --- a/kirby/src/Blueprint/NodeString.php +++ b/kirby/src/Blueprint/NodeString.php @@ -13,7 +13,7 @@ use Kirby\Cms\ModelWithContent; * @copyright Bastian Allgeier * @license https://opensource.org/licenses/MIT * - * // TODO: include in test coverage in 3.9 + * // TODO: include in test coverage in 3.10 * @codeCoverageIgnore */ class NodeString extends NodeProperty diff --git a/kirby/src/Blueprint/NodeText.php b/kirby/src/Blueprint/NodeText.php index a72e711..feeccf6 100644 --- a/kirby/src/Blueprint/NodeText.php +++ b/kirby/src/Blueprint/NodeText.php @@ -14,7 +14,7 @@ use Kirby\Cms\ModelWithContent; * @copyright Bastian Allgeier * @license https://opensource.org/licenses/MIT * - * // TODO: include in test coverage in 3.9 + * // TODO: include in test coverage in 3.10 * @codeCoverageIgnore */ class NodeText extends NodeI18n diff --git a/kirby/src/Cache/Value.php b/kirby/src/Cache/Value.php index 45cfdc7..693d95d 100644 --- a/kirby/src/Cache/Value.php +++ b/kirby/src/Cache/Value.php @@ -39,7 +39,8 @@ class Value * * @param int $minutes the number of minutes until the value expires * or an absolute UNIX timestamp - * @param int $created the UNIX timestamp when the value has been created + * @param int|null $created the UNIX timestamp when the value has been created + * (defaults to the current time) */ public function __construct($value, int $minutes = 0, int|null $created = null) { diff --git a/kirby/src/Cms/App.php b/kirby/src/Cms/App.php index 4cd8895..d15e52e 100644 --- a/kirby/src/Cms/App.php +++ b/kirby/src/Cms/App.php @@ -18,6 +18,7 @@ use Kirby\Http\Router; use Kirby\Http\Uri; use Kirby\Http\Visitor; use Kirby\Session\AutoSession; +use Kirby\Template\Snippet; use Kirby\Text\KirbyTag; use Kirby\Text\KirbyTags; use Kirby\Toolkit\A; @@ -481,28 +482,23 @@ class App /** * Try to find a controller by name - * - * @param string $name - * @param string $contentType - * @return \Kirby\Toolkit\Controller|null */ - protected function controllerLookup(string $name, string $contentType = 'html') + protected function controllerLookup(string $name, string $contentType = 'html'): Controller|null { if ($contentType !== null && $contentType !== 'html') { $name .= '.' . $contentType; } - // controller on disk - if ($controller = Controller::load($this->root('controllers') . '/' . $name . '.php')) { + // controller from site root + $controller = Controller::load($this->root('controllers') . '/' . $name . '.php'); + // controller from extension + $controller ??= $this->extension('controllers', $name); + + if ($controller instanceof Controller) { return $controller; } - // registry controller - if ($controller = $this->extension('controllers', $name)) { - if ($controller instanceof Controller) { - return $controller; - } - + if ($controller !== null) { return new Controller($controller); } @@ -1278,6 +1274,11 @@ class App // set the current locale $this->setCurrentLanguage($language); + // directly prevent path with incomplete content representation + if (Str::endsWith($path, '.') === true) { + return null; + } + // the site is needed a couple times here $site = $this->site(); @@ -1557,24 +1558,6 @@ class App return $this; } - /** - * Returns the Environment object - * @deprecated 3.7.0 Use `$kirby->environment()` instead - * - * @return \Kirby\Http\Environment - * @deprecated Will be removed in Kirby 3.9.0 - * @todo Remove in 3.9.0 - * @codeCoverageIgnore - */ - public function server() - { - // @codeCoverageIgnoreStart - Helpers::deprecated('$kirby->server() has been deprecated and will be removed in Kirby 3.9.0. Use $kirby->environment() instead.'); - // @codeCoverageIgnoreEnd - - return $this->environment(); - } - /** * Initializes and returns the Site object * @@ -1624,21 +1607,24 @@ class App * Uses the snippet component to create * and return a template snippet * - * @param mixed $name * @param array|object $data Variables or an object that becomes `$item` * @param bool $return On `false`, directly echo the snippet - * @return string|null * @psalm-return ($return is true ? string : null) */ - public function snippet($name, $data = [], bool $return = true): string|null + public function snippet(string|array|null $name, $data = [], bool $return = true, bool $slots = false): Snippet|string|null { if (is_object($data) === true) { $data = ['item' => $data]; } - $snippet = ($this->component('snippet'))($this, $name, array_merge($this->data, $data)); + $snippet = ($this->component('snippet'))( + $this, + $name, + array_merge($this->data, $data), + $slots + ); - if ($return === true) { + if ($return === true || $slots === true) { return $snippet; } @@ -1661,7 +1647,7 @@ class App * and return the Template object * * @internal - * @return \Kirby\Cms\Template + * @return \Kirby\Template\Template * @param string $name * @param string $type * @param string $defaultType diff --git a/kirby/src/Cms/AppCaches.php b/kirby/src/Cms/AppCaches.php index 79ec6b9..0ae164f 100644 --- a/kirby/src/Cms/AppCaches.php +++ b/kirby/src/Cms/AppCaches.php @@ -44,7 +44,7 @@ trait AppCaches if (array_key_exists($type, $types) === false) { throw new InvalidArgumentException([ - 'key' => 'app.invalid.cacheType', + 'key' => 'cache.type.invalid', 'data' => ['type' => $type] ]); } @@ -57,7 +57,7 @@ trait AppCaches // check if it is a usable cache object if ($cache instanceof Cache === false) { throw new InvalidArgumentException([ - 'key' => 'app.invalid.cacheType', + 'key' => 'cache.type.invalid', 'data' => ['type' => $type] ]); } @@ -82,9 +82,10 @@ trait AppCaches ]; } - $prefix = str_replace(['/', ':'], '_', $this->system()->indexUrl()) . - '/' . - str_replace('.', '/', $key); + $prefix = + str_replace(['/', ':'], '_', $this->system()->indexUrl()) . + '/' . + str_replace('.', '/', $key); $defaults = [ 'active' => true, diff --git a/kirby/src/Cms/AppPlugins.php b/kirby/src/Cms/AppPlugins.php index 39b03b6..e0210d1 100644 --- a/kirby/src/Cms/AppPlugins.php +++ b/kirby/src/Cms/AppPlugins.php @@ -4,6 +4,7 @@ namespace Kirby\Cms; use Closure; use Kirby\Exception\DuplicateException; +use Kirby\Filesystem\Asset; use Kirby\Filesystem\Dir; use Kirby\Filesystem\F; use Kirby\Filesystem\Mime; @@ -45,6 +46,7 @@ trait AppPlugins // other plugin types 'api' => [], 'areas' => [], + 'assetMethods' => [], 'authChallenges' => [], 'blockMethods' => [], 'blockModels' => [], @@ -147,6 +149,17 @@ trait AppPlugins return $this->extensions['areas']; } + /** + * Registers additional asset methods + * + * @param array $methods + * @return array + */ + protected function extendAssetMethods(array $methods): array + { + return $this->extensions['assetMethods'] = Asset::$methods = array_merge(Asset::$methods, $methods); + } + /** * Registers additional authentication challenges * diff --git a/kirby/src/Cms/AppUsers.php b/kirby/src/Cms/AppUsers.php index 5a93a16..30381ad 100644 --- a/kirby/src/Cms/AppUsers.php +++ b/kirby/src/Cms/AppUsers.php @@ -60,10 +60,7 @@ trait AppUsers } try { - // TODO: switch over in 3.9.0 to - // return $callback($userAfter); - $proxy = new AppUsersImpersonateProxy($this); - return $callback->call($proxy, $userAfter); + return $callback($userAfter); } catch (Throwable $e) { throw $e; } finally { diff --git a/kirby/src/Cms/AppUsersImpersonateProxy.php b/kirby/src/Cms/AppUsersImpersonateProxy.php deleted file mode 100644 index 2ca8849..0000000 --- a/kirby/src/Cms/AppUsersImpersonateProxy.php +++ /dev/null @@ -1,32 +0,0 @@ -impersonate()` - * - * @package Kirby Cms - * @author Nico Hoffmann , - * Lukas Bestle - * @link https://getkirby.com - * @copyright Bastian Allgeier - * @license https://getkirby.com/license - * - * @internal - * @deprecated Will be removed in Kirby 3.9.0 - * @todo remove in 3.9.0 - */ -class AppUsersImpersonateProxy -{ - public function __construct(protected App $app) - { - } - - public function __call($name, $arguments) - { - Helpers::deprecated('Calling $kirby->' . $name . '() as $this->' . $name . '() has been deprecated inside the $kirby->impersonate() callback function. Use a dedicated $kirby object for your call instead of $this. In Kirby 3.9.0 $this will no longer refer to the $kirby object, but the current context of the callback function.'); - - return $this->app->$name(...$arguments); - } -} diff --git a/kirby/src/Cms/Auth.php b/kirby/src/Cms/Auth.php index 6b2d984..34fc073 100644 --- a/kirby/src/Cms/Auth.php +++ b/kirby/src/Cms/Auth.php @@ -15,6 +15,7 @@ use Kirby\Http\Idn; use Kirby\Http\Request\Auth\BasicAuth; use Kirby\Session\Session; use Kirby\Toolkit\A; +use SensitiveParameter; use Throwable; /** @@ -381,17 +382,16 @@ class Auth /** * Login a user by email and password * - * @param string $email - * @param string $password - * @param bool $long - * @return \Kirby\Cms\User - * * @throws \Kirby\Exception\PermissionException If the rate limit was exceeded or if any other error occurred with debug mode off * @throws \Kirby\Exception\NotFoundException If the email was invalid * @throws \Kirby\Exception\InvalidArgumentException If the password is not valid (via `$user->login()`) */ - public function login(string $email, string $password, bool $long = false) - { + public function login( + string $email, + #[SensitiveParameter] + string $password, + bool $long = false + ): User { // session options $options = [ 'createMode' => 'cookie', @@ -412,17 +412,16 @@ class Auth * Login a user by email, password and auth challenge * @since 3.5.0 * - * @param string $email - * @param string $password - * @param bool $long - * @return \Kirby\Cms\Auth\Status - * * @throws \Kirby\Exception\PermissionException If the rate limit was exceeded or if any other error occurred with debug mode off * @throws \Kirby\Exception\NotFoundException If the email was invalid * @throws \Kirby\Exception\InvalidArgumentException If the password is not valid (via `$user->login()`) */ - public function login2fa(string $email, string $password, bool $long = false) - { + public function login2fa( + string $email, + #[SensitiveParameter] + string $password, + bool $long = false + ): Status { $this->validatePassword($email, $password); return $this->createChallenge($email, $long, '2fa'); } @@ -516,16 +515,15 @@ class Auth * Validates the user credentials and returns the user object on success; * otherwise logs the failed attempt * - * @param string $email - * @param string $password - * @return \Kirby\Cms\User - * * @throws \Kirby\Exception\PermissionException If the rate limit was exceeded or if any other error occurred with debug mode off * @throws \Kirby\Exception\NotFoundException If the email was invalid * @throws \Kirby\Exception\InvalidArgumentException If the password is not valid (via `$user->login()`) */ - public function validatePassword(string $email, string $password) - { + public function validatePassword( + string $email, + #[SensitiveParameter] + string $password + ): User { $email = Idn::decodeEmail($email); try { @@ -798,8 +796,10 @@ class Auth * @throws \Kirby\Exception\InvalidArgumentException If no authentication challenge is active * @throws \Kirby\Exception\LogicException If the authentication challenge is invalid */ - public function verifyChallenge(string $code) - { + public function verifyChallenge( + #[SensitiveParameter] + string $code + ) { try { $session = $this->kirby->session(); diff --git a/kirby/src/Cms/Auth/Challenge.php b/kirby/src/Cms/Auth/Challenge.php index cf69259..1897dfa 100644 --- a/kirby/src/Cms/Auth/Challenge.php +++ b/kirby/src/Cms/Auth/Challenge.php @@ -3,6 +3,7 @@ namespace Kirby\Cms\Auth; use Kirby\Cms\User; +use SensitiveParameter; /** * Template class for authentication challenges @@ -48,8 +49,11 @@ abstract class Challenge * @param string $code Code to verify * @return bool */ - public static function verify(User $user, string $code): bool - { + public static function verify( + User $user, + #[SensitiveParameter] + string $code + ): bool { $hash = $user->kirby()->session()->get('kirby.challenge.code'); if (is_string($hash) !== true) { return false; diff --git a/kirby/src/Cms/Block.php b/kirby/src/Cms/Block.php index 2955787..81dbe75 100644 --- a/kirby/src/Cms/Block.php +++ b/kirby/src/Cms/Block.php @@ -73,6 +73,13 @@ class Block extends Item { parent::__construct($params); + // @deprecated import old builder format + // @todo block.converter remove eventually + // @codeCoverageIgnoreStart + $params = BlockConverter::builderBlock($params); + $params = BlockConverter::editorBlock($params); + // @codeCoverageIgnoreEnd + if (isset($params['type']) === false) { throw new InvalidArgumentException('The block type is missing'); } diff --git a/kirby/src/Cms/BlockConverter.php b/kirby/src/Cms/BlockConverter.php new file mode 100644 index 0000000..a71f69e --- /dev/null +++ b/kirby/src/Cms/BlockConverter.php @@ -0,0 +1,285 @@ + + * @link https://getkirby.com + * @copyright Bastian Allgeier GmbH + * @license https://getkirby.com/license + */ +class BlockConverter +{ + public static function builderBlock(array $params): array + { + if (isset($params['_key']) === false) { + return $params; + } + + $params['type'] = $params['_key']; + $params['content'] = $params; + unset($params['_uid']); + + return $params; + } + + public static function editorBlock(array $params): array + { + if (static::isEditorBlock($params) === false) { + return $params; + } + + $method = 'editor' . $params['type']; + + if (method_exists(static::class, $method) === true) { + $params = static::$method($params); + } else { + $params = static::editorCustom($params); + } + + return $params; + } + + public static function editorBlocks(array $blocks = []): array + { + if (empty($blocks) === true) { + return $blocks; + } + + if (static::isEditorBlock($blocks[0]) === false) { + return $blocks; + } + + $list = []; + $listStart = null; + + foreach ($blocks as $index => $block) { + if (in_array($block['type'], ['ul', 'ol']) === true) { + $prev = $blocks[$index-1] ?? null; + $next = $blocks[$index+1] ?? null; + + // new list starts here + if (!$prev || $prev['type'] !== $block['type']) { + $listStart = $index; + } + + // add the block to the list + $list[] = $block; + + // list ends here + if (!$next || $next['type'] !== $block['type']) { + $blocks[$listStart] = [ + 'content' => [ + 'text' => + '<' . $block['type'] . '>' . + implode(array_map( + fn ($item) => '
  • ' . $item['content'] . '
  • ', + $list + )) . + '', + ], + 'type' => 'list' + ]; + + $start = $listStart + 1; + $end = $listStart + count($list); + + for ($x = $start; $x <= $end; $x++) { + $blocks[$x] = false; + } + + $listStart = null; + $list = []; + } + } else { + $blocks[$index] = static::editorBlock($block); + } + } + + return array_filter($blocks); + } + + public static function editorBlockquote(array $params): array + { + return [ + 'content' => [ + 'text' => $params['content'] + ], + 'type' => 'quote' + ]; + } + + public static function editorCode(array $params): array + { + return [ + 'content' => [ + 'language' => $params['attrs']['language'] ?? null, + 'code' => $params['content'] + ], + 'type' => 'code' + ]; + } + + public static function editorCustom(array $params): array + { + return [ + 'content' => array_merge( + $params['attrs'] ?? [], + [ + 'body' => $params['content'] ?? null + ] + ), + 'type' => $params['type'] ?? 'unknown' + ]; + } + + public static function editorH1(array $params): array + { + return static::editorHeading($params, 'h1'); + } + + public static function editorH2(array $params): array + { + return static::editorHeading($params, 'h2'); + } + + public static function editorH3(array $params): array + { + return static::editorHeading($params, 'h3'); + } + + public static function editorH4(array $params): array + { + return static::editorHeading($params, 'h4'); + } + + public static function editorH5(array $params): array + { + return static::editorHeading($params, 'h5'); + } + + public static function editorH6(array $params): array + { + return static::editorHeading($params, 'h6'); + } + + public static function editorHr(array $params): array + { + return [ + 'content' => [], + 'type' => 'line' + ]; + } + + public static function editorHeading(array $params, string $level = 'h1'): array + { + return [ + 'content' => [ + 'level' => $level, + 'text' => $params['content'] + ], + 'type' => 'heading' + ]; + } + + public static function editorImage(array $params): array + { + // internal image + if (isset($params['attrs']['id']) === true) { + return [ + 'content' => [ + 'alt' => $params['attrs']['alt'] ?? null, + 'caption' => $params['attrs']['caption'] ?? null, + 'image' => $params['attrs']['id'] ?? $params['attrs']['src'] ?? null, + 'location' => 'kirby', + 'ratio' => $params['attrs']['ratio'] ?? null, + ], + 'type' => 'image' + ]; + } + + return [ + 'content' => [ + 'alt' => $params['attrs']['alt'] ?? null, + 'caption' => $params['attrs']['caption'] ?? null, + 'src' => $params['attrs']['src'] ?? null, + 'location' => 'web', + 'ratio' => $params['attrs']['ratio'] ?? null, + ], + 'type' => 'image' + ]; + } + + public static function editorKirbytext(array $params): array + { + return [ + 'content' => [ + 'text' => $params['content'] + ], + 'type' => 'markdown' + ]; + } + + public static function editorOl(array $params): array + { + return [ + 'content' => [ + 'text' => $params['content'] + ], + 'type' => 'list' + ]; + } + + public static function editorParagraph(array $params): array + { + return [ + 'content' => [ + 'text' => '

    ' . $params['content'] . '

    ' + ], + 'type' => 'text' + ]; + } + + public static function editorUl(array $params): array + { + return [ + 'content' => [ + 'text' => $params['content'] + ], + 'type' => 'list' + ]; + } + + public static function editorVideo(array $params): array + { + return [ + 'content' => [ + 'caption' => $params['attrs']['caption'] ?? null, + 'url' => $params['attrs']['src'] ?? null + ], + 'type' => 'video' + ]; + } + + public static function isEditorBlock(array $params): bool + { + if (isset($params['attrs']) === true) { + return true; + } + + if (is_string($params['content'] ?? null) === true) { + return true; + } + + return false; + } +} diff --git a/kirby/src/Cms/Blocks.php b/kirby/src/Cms/Blocks.php index 0277f27..31791d5 100644 --- a/kirby/src/Cms/Blocks.php +++ b/kirby/src/Cms/Blocks.php @@ -2,9 +2,12 @@ namespace Kirby\Cms; +use Exception; use Kirby\Data\Json; +use Kirby\Data\Yaml; use Kirby\Parsley\Parsley; use Kirby\Parsley\Schema\Blocks as BlockSchema; +use Kirby\Toolkit\A; use Kirby\Toolkit\Str; use Throwable; @@ -58,6 +61,12 @@ class Blocks extends Items { $items = static::extractFromLayouts($items); + // @deprecated old editor format + // @todo block.converter remove eventually + // @codeCoverageIgnoreStart + $items = BlockConverter::editorBlocks($items); + // @codeCoverageIgnoreEnd + return parent::factory($items, $params); } @@ -73,8 +82,13 @@ class Blocks extends Items return []; } - // no columns = no layout - if (array_key_exists('columns', $input[0]) === false) { + if ( + // no columns = no layout + array_key_exists('columns', $input[0]) === false || + // @deprecated checks if this is a block for the builder plugin + // @todo block.converter remove eventually + array_key_exists('_key', $input[0]) === true + ) { return $input; } @@ -115,8 +129,33 @@ class Blocks extends Items try { $input = Json::decode((string)$input); } catch (Throwable) { - $parser = new Parsley((string)$input, new BlockSchema()); - $input = $parser->blocks(); + // @deprecated try to import the old YAML format + // @todo block.converter remove eventually + // @codeCoverageIgnoreStart + try { + $yaml = Yaml::decode((string)$input); + $first = A::first($yaml); + + // check for valid yaml + if ( + empty($yaml) === true || + ( + isset($first['_key']) === false && + isset($first['type']) === false + ) + ) { + throw new Exception('Invalid YAML'); + } else { + $input = $yaml; + } + } catch (Throwable $e) { + // the next 2 lines remain after removing block.converter + // @codeCoverageIgnoreEnd + $parser = new Parsley((string)$input, new BlockSchema()); + $input = $parser->blocks(); + // @codeCoverageIgnoreStart + } + // @codeCoverageIgnoreEnd } } diff --git a/kirby/src/Cms/ContentTranslation.php b/kirby/src/Cms/ContentTranslation.php index 4ad78c6..8f1e5be 100644 --- a/kirby/src/Cms/ContentTranslation.php +++ b/kirby/src/Cms/ContentTranslation.php @@ -115,8 +115,9 @@ class ContentTranslation */ public function exists(): bool { - return empty($this->content) === false || - file_exists($this->contentFile()) === true; + return + empty($this->content) === false || + file_exists($this->contentFile()) === true; } /** diff --git a/kirby/src/Cms/Email.php b/kirby/src/Cms/Email.php index 7b1be8a..6362584 100644 --- a/kirby/src/Cms/Email.php +++ b/kirby/src/Cms/Email.php @@ -132,7 +132,7 @@ class Email * * @param string $name Template name * @param string|null $type `html` or `text` - * @return \Kirby\Cms\Template + * @return \Kirby\Template\Template */ protected function getTemplate(string $name, string $type = null) { diff --git a/kirby/src/Cms/File.php b/kirby/src/Cms/File.php index b6b1fac..1a06ac6 100644 --- a/kirby/src/Cms/File.php +++ b/kirby/src/Cms/File.php @@ -179,7 +179,7 @@ class File extends ModelWithContent public function contentFileData(array $data, string $languageCode = null): array { return A::append($data, [ - 'template' => $this->template(), + 'template' => $data['template'] ?? $this->template(), ]); } diff --git a/kirby/src/Cms/FileActions.php b/kirby/src/Cms/FileActions.php index b6ce3c0..5d2ce6f 100644 --- a/kirby/src/Cms/FileActions.php +++ b/kirby/src/Cms/FileActions.php @@ -169,11 +169,12 @@ trait FileActions * way of generating files. * * @param array $props + * @param bool $move If set to `true`, the source will be deleted * @return static * @throws \Kirby\Exception\InvalidArgumentException * @throws \Kirby\Exception\LogicException */ - public static function create(array $props) + public static function create(array $props, bool $move = false) { if (isset($props['source'], $props['parent']) === false) { throw new InvalidArgumentException('Please provide the "source" and "parent" props for the File'); @@ -204,12 +205,16 @@ trait FileActions $file = $file->clone(['content' => $form->strings(true)]); // run the hook - return $file->commit('create', compact('file', 'upload'), function ($file, $upload) { + $arguments = compact('file', 'upload'); + return $file->commit('create', $arguments, function ($file, $upload) use ($move) { // remove all public versions, lock and clear UUID cache $file->unpublish(); + // only move the original source if intended + $method = $move === true ? 'move' : 'copy'; + // overwrite the original - if (F::copy($upload->root(), $file->root(), true) !== true) { + if (F::$method($upload->root(), $file->root(), true) !== true) { throw new LogicException('The file could not be created'); } @@ -280,10 +285,11 @@ trait FileActions * source. * * @param string $source + * @param bool $move If set to `true`, the source will be deleted * @return static * @throws \Kirby\Exception\LogicException */ - public function replace(string $source) + public function replace(string $source, bool $move = false) { $file = $this->clone(); @@ -292,12 +298,15 @@ trait FileActions 'upload' => $file->asset($source) ]; - return $this->commit('replace', $arguments, function ($file, $upload) { + return $this->commit('replace', $arguments, function ($file, $upload) use ($move) { // delete all public versions $file->unpublish(true); + // only move the original source if intended + $method = $move === true ? 'move' : 'copy'; + // overwrite the original - if (F::copy($upload->root(), $file->root(), true) !== true) { + if (F::$method($upload->root(), $file->root(), true) !== true) { throw new LogicException('The file could not be created'); } diff --git a/kirby/src/Cms/HasFiles.php b/kirby/src/Cms/HasFiles.php index 9e35fe2..6ae09ee 100644 --- a/kirby/src/Cms/HasFiles.php +++ b/kirby/src/Cms/HasFiles.php @@ -57,16 +57,17 @@ trait HasFiles * Creates a new file * * @param array $props + * @param bool $move If set to `true`, the source will be deleted * @return \Kirby\Cms\File */ - public function createFile(array $props) + public function createFile(array $props, bool $move = false) { $props = array_merge($props, [ 'parent' => $this, 'url' => null ]); - return File::create($props); + return File::create($props, $move); } /** diff --git a/kirby/src/Cms/Helpers.php b/kirby/src/Cms/Helpers.php index 9ea9b35..ae6c51f 100644 --- a/kirby/src/Cms/Helpers.php +++ b/kirby/src/Cms/Helpers.php @@ -19,18 +19,57 @@ use Kirby\Toolkit\Str; class Helpers { /** - * Triggers a deprecation warning if debug mode is active + * Allows to disable specific deprecation warnings + * by setting them to `false`. + * You can do this by putting the following code in + * `site/config/config.php`: * - * @param string $message + * ```php + * Helpers::$deprecations[''] = false; + * ``` + */ + public static $deprecations = [ + // Passing the $slot or $slots variables to snippets is + // deprecated and will break in a future version. + 'snippet-pass-slots' => true, + + // The `Toolkit\Query` class has been deprecated and will + // be removed in a future version. Use `Query\Query` instead: + // Kirby\Query\Query::factory($query)->resolve($data). + 'toolkit-query-class' => true, + + // Passing an empty string as value to `Xml::attr()` has been + // deprecated. In a future version, passing an empty string won't + // omit the attribute anymore but render it with an empty value. + // To omit the attribute, please pass `null`. + 'xml-attr-empty-string' => false, + ]; + + /** + * Triggers a deprecation warning if debug mode is active + * and warning has not been surpressed via `Helpers::$deprecations` + * + * @param string|null $key If given, the key will be checked against the static array * @return bool Whether the warning was triggered */ - public static function deprecated(string $message): bool + public static function deprecated(string $message, string|null $key = null): bool { - if (App::instance()->option('debug') === true) { - return trigger_error($message, E_USER_DEPRECATED) === true; + // only trigger warning in debug mode or when running PHPUnit tests + // @codeCoverageIgnoreStart + if ( + App::instance()->option('debug') !== true && + (defined('KIRBY_TESTING') !== true || KIRBY_TESTING !== true) + ) { + return false; + } + // @codeCoverageIgnoreEnd + + // don't trigger the warning if disabled by default or by the dev + if ($key !== null && (static::$deprecations[$key] ?? true) === false) { + return false; } - return false; + return trigger_error($message, E_USER_DEPRECATED) === true; } /** diff --git a/kirby/src/Cms/Html.php b/kirby/src/Cms/Html.php index b7c6774..f8f3388 100644 --- a/kirby/src/Cms/Html.php +++ b/kirby/src/Cms/Html.php @@ -45,7 +45,8 @@ class Html extends \Kirby\Toolkit\Html } } - // only valid value for 'rel' is 'alternate stylesheet', if 'title' is given as well + // only valid value for 'rel' is 'alternate stylesheet', + // if 'title' is given as well if ( ($options['rel'] ?? '') !== 'alternate stylesheet' || ($options['title'] ?? '') === '' diff --git a/kirby/src/Cms/Item.php b/kirby/src/Cms/Item.php index b6886dc..b7e3d3f 100644 --- a/kirby/src/Cms/Item.php +++ b/kirby/src/Cms/Item.php @@ -26,6 +26,8 @@ class Item public const ITEMS_CLASS = Items::class; + protected Field|null $field; + /** * @var string */ @@ -57,6 +59,7 @@ class Item $this->id = $params['id'] ?? Str::uuid(); $this->params = $params; + $this->field = $params['field'] ?? null; $this->parent = $params['parent'] ?? App::instance()->site(); $this->siblings = $params['siblings'] ?? new $siblingsClass(); } @@ -72,6 +75,14 @@ class Item return new static($params); } + /** + * Returns the parent field if known + */ + public function field(): Field|null + { + return $this->field; + } + /** * Returns the unique item id (UUID v4) * diff --git a/kirby/src/Cms/Items.php b/kirby/src/Cms/Items.php index da65ab1..fb37a10 100644 --- a/kirby/src/Cms/Items.php +++ b/kirby/src/Cms/Items.php @@ -19,6 +19,8 @@ class Items extends Collection { public const ITEM_CLASS = Item::class; + protected Field|null $field; + /** * @var array */ @@ -39,6 +41,7 @@ class Items extends Collection { $this->options = $options; $this->parent = $options['parent'] ?? App::instance()->site(); + $this->field = $options['field'] ?? null; parent::__construct($objects, $this->parent); } @@ -54,6 +57,7 @@ class Items extends Collection public static function factory(array $items = null, array $params = []) { $options = array_merge([ + 'field' => null, 'options' => [], 'parent' => App::instance()->site(), ], $params); @@ -74,6 +78,7 @@ class Items extends Collection continue; } + $params['field'] = $options['field']; $params['options'] = $options['options']; $params['parent'] = $options['parent']; $params['siblings'] = $collection; @@ -85,6 +90,14 @@ class Items extends Collection return $collection; } + /** + * Returns the parent field if known + */ + public function field(): Field|null + { + return $this->field; + } + /** * Convert the items to an array * diff --git a/kirby/src/Cms/Language.php b/kirby/src/Cms/Language.php index 42e95c4..df1733e 100644 --- a/kirby/src/Cms/Language.php +++ b/kirby/src/Cms/Language.php @@ -658,12 +658,8 @@ class Language extends Model */ public function url(): string { - $url = $this->url; - - if ($url === null) { - $url = '/' . $this->code; - } - + $url = $this->url; + $url ??= '/' . $this->code; return Url::makeAbsolute($url, $this->kirby()->url()); } diff --git a/kirby/src/Cms/Layout.php b/kirby/src/Cms/Layout.php index 57fd613..2aaa960 100644 --- a/kirby/src/Cms/Layout.php +++ b/kirby/src/Cms/Layout.php @@ -56,6 +56,7 @@ class Layout extends Item parent::__construct($params); $this->columns = LayoutColumns::factory($params['columns'] ?? [], [ + 'field' => $this->field, 'parent' => $this->parent ]); diff --git a/kirby/src/Cms/LayoutColumn.php b/kirby/src/Cms/LayoutColumn.php index 5d1d9d8..b4706cc 100644 --- a/kirby/src/Cms/LayoutColumn.php +++ b/kirby/src/Cms/LayoutColumn.php @@ -41,6 +41,7 @@ class LayoutColumn extends Item parent::__construct($params); $this->blocks = Blocks::factory($params['blocks'] ?? [], [ + 'field' => $this->field, 'parent' => $this->parent ]); diff --git a/kirby/src/Cms/Layouts.php b/kirby/src/Cms/Layouts.php index 34b02bd..62f42ac 100644 --- a/kirby/src/Cms/Layouts.php +++ b/kirby/src/Cms/Layouts.php @@ -98,6 +98,9 @@ class Layouts extends Items } } - return Blocks::factory($blocks); + return Blocks::factory($blocks, [ + 'field' => $this->field, + 'parent' => $this->parent + ]); } } diff --git a/kirby/src/Cms/ModelWithContent.php b/kirby/src/Cms/ModelWithContent.php index 71c7501..42ad403 100644 --- a/kirby/src/Cms/ModelWithContent.php +++ b/kirby/src/Cms/ModelWithContent.php @@ -629,13 +629,11 @@ abstract class ModelWithContent extends Model implements Identifiable ]); // validate the input - if ($validate === true) { - if ($form->isInvalid() === true) { - throw new InvalidArgumentException([ - 'fallback' => 'Invalid form with errors', - 'details' => $form->errors() - ]); - } + if ($validate === true && $form->isInvalid() === true) { + throw new InvalidArgumentException([ + 'fallback' => 'Invalid form with errors', + 'details' => $form->errors() + ]); } $arguments = [static::CLASS_ALIAS => $this, 'values' => $form->data(), 'strings' => $form->strings(), 'languageCode' => $languageCode]; diff --git a/kirby/src/Cms/Page.php b/kirby/src/Cms/Page.php index 53eeac9..3ea0d55 100644 --- a/kirby/src/Cms/Page.php +++ b/kirby/src/Cms/Page.php @@ -96,7 +96,7 @@ class Page extends ModelWithContent * The template, that should be loaded * if it exists * - * @var \Kirby\Cms\Template + * @var \Kirby\Template\Template */ protected $intendedTemplate; @@ -143,7 +143,7 @@ class Page extends ModelWithContent /** * The intended page template * - * @var \Kirby\Cms\Template + * @var \Kirby\Template\Template */ protected $template; @@ -504,7 +504,7 @@ class Page extends ModelWithContent * Returns the template that should be * loaded if it exists. * - * @return \Kirby\Cms\Template + * @return \Kirby\Template\Template */ public function intendedTemplate() { @@ -1096,7 +1096,7 @@ class Page extends ModelWithContent /** * @internal * @param mixed $type - * @return \Kirby\Cms\Template + * @return \Kirby\Template\Template * @throws \Kirby\Exception\NotFoundException If the content representation cannot be found */ public function representation($type) @@ -1277,13 +1277,13 @@ class Page extends ModelWithContent public function slug(string $languageCode = null): string { if ($this->kirby()->multilang() === true) { - if ($languageCode === null) { - $languageCode = $this->kirby()->languageCode(); - } - + $languageCode ??= $this->kirby()->languageCode(); $defaultLanguageCode = $this->kirby()->defaultLanguage()->code(); - if ($languageCode !== $defaultLanguageCode && $translation = $this->translations()->find($languageCode)) { + if ( + $languageCode !== $defaultLanguageCode && + $translation = $this->translations()->find($languageCode) + ) { return $translation->slug() ?? $this->slug; } } @@ -1313,7 +1313,7 @@ class Page extends ModelWithContent /** * Returns the final template * - * @return \Kirby\Cms\Template + * @return \Kirby\Template\Template */ public function template() { diff --git a/kirby/src/Cms/PageActions.php b/kirby/src/Cms/PageActions.php index 5cda48b..84a9d29 100644 --- a/kirby/src/Cms/PageActions.php +++ b/kirby/src/Cms/PageActions.php @@ -223,7 +223,7 @@ trait PageActions throw new InvalidArgumentException('Use the changeSlug method to change the slug for the default language'); } - $arguments = ['page' => $this, 'slug' => $slug, 'languageCode' => $languageCode]; + $arguments = ['page' => $this, 'slug' => $slug, 'languageCode' => $language->code()]; return $this->commit('changeSlug', $arguments, function ($page, $slug, $languageCode) { // remove the slug if it's the same as the folder name if ($slug === $page->uid()) { @@ -521,9 +521,9 @@ trait PageActions public static function create(array $props) { // clean up the slug - $props['slug'] = Str::slug($props['slug'] ?? $props['content']['title'] ?? null); - $props['template'] = $props['model'] = strtolower($props['template'] ?? 'default'); - $props['isDraft'] = ($props['draft'] ?? true); + $props['slug'] = Str::slug($props['slug'] ?? $props['content']['title'] ?? null); + $props['template'] = $props['model'] = strtolower($props['template'] ?? 'default'); + $props['isDraft'] ??= $props['draft'] ?? true; // make sure that a UUID gets generated and // added to content right away @@ -620,9 +620,7 @@ trait PageActions ->count(); // default positioning at the end - if ($num === null) { - $num = $max; - } + $num ??= $max; // avoid zeros or negative numbers if ($num < 1) { diff --git a/kirby/src/Cms/PageRules.php b/kirby/src/Cms/PageRules.php index 9e0b36d..30ef6e8 100644 --- a/kirby/src/Cms/PageRules.php +++ b/kirby/src/Cms/PageRules.php @@ -204,7 +204,12 @@ class PageRules ]); } - if (count($page->blueprints()) <= 1) { + $blueprints = $page->blueprints(); + + if ( + count($blueprints) <= 1 || + in_array($template, array_column($blueprints, 'name')) === false + ) { throw new LogicException([ 'key' => 'page.changeTemplate.invalid', 'data' => ['slug' => $page->slug()] diff --git a/kirby/src/Cms/Pages.php b/kirby/src/Cms/Pages.php index b3f6620..bca708c 100644 --- a/kirby/src/Cms/Pages.php +++ b/kirby/src/Cms/Pages.php @@ -154,10 +154,10 @@ class Pages extends Collection * * @param array $pages * @param \Kirby\Cms\Model|null $model - * @param bool $draft + * @param bool|null $draft * @return static */ - public static function factory(array $pages, Model $model = null, bool $draft = false) + public static function factory(array $pages, Model $model = null, bool $draft = null) { $model ??= App::instance()->site(); $children = new static([], $model); @@ -175,7 +175,7 @@ class Pages extends Collection $props['kirby'] = $kirby; $props['parent'] = $parent; $props['site'] = $site; - $props['isDraft'] = $draft; + $props['isDraft'] = $draft ?? $props['isDraft'] ?? $props['draft'] ?? false; $page = Page::factory($props); diff --git a/kirby/src/Cms/Plugin.php b/kirby/src/Cms/Plugin.php index 33dadeb..84d1f1d 100644 --- a/kirby/src/Cms/Plugin.php +++ b/kirby/src/Cms/Plugin.php @@ -255,9 +255,7 @@ class Plugin extends Model } } - if ($option === null) { - $option = $kirby->option('updates') ?? true; - } + $option ??= $kirby->option('updates') ?? true; if ($option !== true) { return null; diff --git a/kirby/src/Cms/System.php b/kirby/src/Cms/System.php index 3266cd0..481efa1 100644 --- a/kirby/src/Cms/System.php +++ b/kirby/src/Cms/System.php @@ -31,63 +31,37 @@ use Throwable; */ class System { - /** - * @var \Kirby\Cms\App - */ - protected $app; - // cache protected UpdateStatus|null $updateStatus = null; - /** - * @param \Kirby\Cms\App $app - */ - public function __construct(App $app) + public function __construct(protected App $app) { - $this->app = $app; - // try to create all folders that could be missing $this->init(); } - /** - * Improved `var_dump` output - * - * @return array - */ - public function __debugInfo(): array - { - return $this->toArray(); - } - /** * Check for a writable accounts folder - * - * @return bool */ public function accounts(): bool { - return is_writable($this->app->root('accounts')); + return is_writable($this->app->root('accounts')) === true; } /** * Check for a writable content folder - * - * @return bool */ public function content(): bool { - return is_writable($this->app->root('content')); + return is_writable($this->app->root('content')) === true; } /** * Check for an existing curl extension - * - * @return bool */ public function curl(): bool { - return extension_loaded('curl'); + return extension_loaded('curl') === true; } /** @@ -96,7 +70,6 @@ class System * root. Otherwise it will return null. * * @param string $folder 'git', 'content', 'site', 'kirby' - * @return string|null */ public function exposedFileUrl(string $folder): string|null { @@ -142,19 +115,20 @@ class System * root. Otherwise it will return null. * * @param string $folder 'git', 'content', 'site', 'kirby' - * @return string|null */ public function folderUrl(string $folder): string|null { $index = $this->app->root('index'); + $root = match ($folder) { + 'git' => $index . '/.git', + default => $this->app->root($folder) + }; - if ($folder === 'git') { - $root = $index . '/.git'; - } else { - $root = $this->app->root($folder); - } - - if ($root === null || is_dir($root) === false || is_dir($index) === false) { + if ( + $root === null || + is_dir($root) === false || + is_dir($index) === false + ) { return null; } @@ -180,22 +154,22 @@ class System /** * Returns the app's human-readable * index URL without scheme - * - * @return string */ public function indexUrl(): string { - return $this->app->url('index', true)->setScheme(null)->setSlash(false)->toString(); + return $this->app->url('index', true) + ->setScheme(null) + ->setSlash(false) + ->toString(); } /** * Create the most important folders * if they don't exist yet * - * @return void * @throws \Kirby\Exception\PermissionException */ - public function init() + public function init(): void { // init /site/accounts try { @@ -231,18 +205,16 @@ class System * On a public server the panel.install * option must be explicitly set to true * to get the installer up and running. - * - * @return bool */ public function isInstallable(): bool { - return $this->isLocal() === true || $this->app->option('panel.install', false) === true; + return + $this->isLocal() === true || + $this->app->option('panel.install', false) === true; } /** * Check if Kirby is already installed - * - * @return bool */ public function isInstalled(): bool { @@ -251,8 +223,6 @@ class System /** * Check if this is a local installation - * - * @return bool */ public function isLocal(): bool { @@ -261,8 +231,6 @@ class System /** * Check if all tests pass - * - * @return bool */ public function isOk(): bool { @@ -311,7 +279,9 @@ class System $pubKey = F::read($this->app->root('kirby') . '/kirby.pub'); // verify the license signature - if (openssl_verify(json_encode($data), hex2bin($license['signature']), $pubKey, 'RSA-SHA256') !== 1) { + $data = json_encode($data); + $signature = hex2bin($license['signature']); + if (openssl_verify($data, $signature, $pubKey, 'RSA-SHA256') !== 1) { return false; } @@ -338,9 +308,7 @@ class System */ protected function licenseUrl(string $url = null): string { - if ($url === null) { - $url = $this->indexUrl(); - } + $url ??= $this->indexUrl(); // remove common "testing" subdomains as well as www. // to ensure that installations of the same site have @@ -371,8 +339,6 @@ class System * Returns the configured UI modes for the login form * with their respective options * - * @return array - * * @throws \Kirby\Exception\InvalidArgumentException If the configuration is invalid * (only in debug mode) */ @@ -431,45 +397,38 @@ class System /** * Check for an existing mbstring extension - * - * @return bool */ public function mbString(): bool { - return extension_loaded('mbstring'); + return extension_loaded('mbstring') === true; } /** * Check for a writable media folder - * - * @return bool */ public function media(): bool { - return is_writable($this->app->root('media')); + return is_writable($this->app->root('media')) === true; } /** * Check for a valid PHP version - * - * @return bool */ public function php(): bool { return version_compare(PHP_VERSION, '8.0.0', '>=') === true && - version_compare(PHP_VERSION, '8.2.0', '<') === true; + version_compare(PHP_VERSION, '8.3.0', '<') === true; } /** * Returns a sorted collection of all * installed plugins - * - * @return \Kirby\Cms\Collection */ - public function plugins() + public function plugins(): Collection { - return (new Collection(App::instance()->plugins()))->sortBy('name', 'asc'); + $plugins = new Collection($this->app->plugins()); + return $plugins->sortBy('name', 'asc'); } /** @@ -477,24 +436,17 @@ class System * and adds it to the .license file in the config * folder if possible. * - * @param string|null $license - * @param string|null $email - * @return bool * @throws \Kirby\Exception\Exception * @throws \Kirby\Exception\InvalidArgumentException */ public function register(string $license = null, string $email = null): bool { if (Str::startsWith($license, 'K3-PRO-') === false) { - throw new InvalidArgumentException([ - 'key' => 'license.format' - ]); + throw new InvalidArgumentException(['key' => 'license.format']); } if (V::email($email) === false) { - throw new InvalidArgumentException([ - 'key' => 'license.email' - ]); + throw new InvalidArgumentException(['key' => 'license.email']); } // @codeCoverageIgnoreStart @@ -534,8 +486,6 @@ class System /** * Check for a valid server environment - * - * @return bool */ public function server(): bool { @@ -544,8 +494,6 @@ class System /** * Returns the detected server software - * - * @return string|null */ public function serverSoftware(): string|null { @@ -566,18 +514,14 @@ class System /** * Check for a writable sessions folder - * - * @return bool */ public function sessions(): bool { - return is_writable($this->app->root('sessions')); + return is_writable($this->app->root('sessions')) === true; } /** * Get an status array of all checks - * - * @return array */ public function status(): array { @@ -597,23 +541,18 @@ class System * Returns the site's title as defined in the * content file or `site.yml` blueprint * @since 3.6.0 - * - * @return string */ public function title(): string { $site = $this->app->site(); - if ($site->title()->isNotEmpty()) { + if ($site->title()->isNotEmpty() === true) { return $site->title()->value(); } return $site->blueprint()->title(); } - /** - * @return array - */ public function toArray(): array { return $this->status(); @@ -633,7 +572,9 @@ class System } $kirby = $this->app; - $option = $kirby->option('updates.kirby') ?? $kirby->option('updates') ?? true; + $option = + $kirby->option('updates.kirby') ?? + $kirby->option('updates', true); if ($option === false) { return null; @@ -648,11 +589,8 @@ class System /** * Upgrade to the new folder separator - * - * @param string $root - * @return void */ - public static function upgradeContent(string $root) + public static function upgradeContent(string $root): void { $index = Dir::read($root); @@ -666,4 +604,12 @@ class System } } } + + /** + * Improved `var_dump` output + */ + public function __debugInfo(): array + { + return $this->toArray(); + } } diff --git a/kirby/src/Cms/System/UpdateStatus.php b/kirby/src/Cms/System/UpdateStatus.php index 7bdf3af..549b6e3 100644 --- a/kirby/src/Cms/System/UpdateStatus.php +++ b/kirby/src/Cms/System/UpdateStatus.php @@ -435,9 +435,7 @@ class UpdateStatus // verify that we found at least one possible version; // otherwise try the `$maxVersion` as a last chance before // concluding at the top that we cannot solve the task - if ($incidentVersion === null) { - $incidentVersion = $maxVersion; - } + $incidentVersion ??= $maxVersion; // we need a version that fixes all vulnerabilities, so use the // "largest of the smallest" fixed versions diff --git a/kirby/src/Cms/User.php b/kirby/src/Cms/User.php index b94e643..2154d9c 100644 --- a/kirby/src/Cms/User.php +++ b/kirby/src/Cms/User.php @@ -10,6 +10,7 @@ use Kirby\Filesystem\F; use Kirby\Panel\User as Panel; use Kirby\Session\Session; use Kirby\Toolkit\Str; +use SensitiveParameter; /** * The `$user` object represents a @@ -274,11 +275,11 @@ class User extends ModelWithContent * which will leave it as `null` * * @internal - * @param string|null $password - * @return string|null */ - public static function hashPassword($password): string|null - { + public static function hashPassword( + #[SensitiveParameter] + string $password = null + ): string|null { if ($password !== null) { $password = password_hash($password, PASSWORD_DEFAULT); } @@ -372,8 +373,9 @@ class User extends ModelWithContent */ public function isLastAdmin(): bool { - return $this->role()->isAdmin() === true && - $this->kirby()->users()->filter('role', 'admin')->count() <= 1; + return + $this->role()->isAdmin() === true && + $this->kirby()->users()->filter('role', 'admin')->count() <= 1; } /** @@ -410,12 +412,13 @@ class User extends ModelWithContent /** * Logs the user in * - * @param string $password * @param \Kirby\Session\Session|array|null $session Session options or session object to set the user in - * @return bool */ - public function login(string $password, $session = null): bool - { + public function login( + #[SensitiveParameter] + string $password, + $session = null + ): bool { $this->validatePassword($password); $this->loginPasswordless($session); @@ -750,11 +753,12 @@ class User extends ModelWithContent /** * Sets the user's password hash * - * @param string $password|null * @return $this */ - protected function setPassword(string $password = null) - { + protected function setPassword( + #[SensitiveParameter] + string $password = null + ): static { $this->password = $password; return $this; } @@ -848,15 +852,14 @@ class User extends ModelWithContent /** * Compares the given password with the stored one * - * @param string $password|null - * @return bool - * * @throws \Kirby\Exception\NotFoundException If the user has no password * @throws \Kirby\Exception\InvalidArgumentException If the entered password is not valid * or does not match the user password */ - public function validatePassword(string $password = null): bool - { + public function validatePassword( + #[SensitiveParameter] + string $password = null + ): bool { if (empty($this->password()) === true) { throw new NotFoundException(['key' => 'user.password.undefined']); } diff --git a/kirby/src/Cms/UserActions.php b/kirby/src/Cms/UserActions.php index 15b0769..25e30fb 100644 --- a/kirby/src/Cms/UserActions.php +++ b/kirby/src/Cms/UserActions.php @@ -11,6 +11,7 @@ use Kirby\Filesystem\F; use Kirby\Form\Form; use Kirby\Http\Idn; use Kirby\Toolkit\Str; +use SensitiveParameter; use Throwable; /** @@ -102,12 +103,11 @@ trait UserActions /** * Changes the user password - * - * @param string $password - * @return static */ - public function changePassword(string $password) - { + public function changePassword( + #[SensitiveParameter] + string $password + ): static { return $this->commit('changePassword', ['user' => $this, 'password' => $password], function ($user, $password) { $user = $user->clone([ 'password' => $password = User::hashPassword($password) @@ -379,12 +379,11 @@ trait UserActions /** * Writes the password to disk - * - * @param string|null $password - * @return bool */ - protected function writePassword(string $password = null): bool - { + protected function writePassword( + #[SensitiveParameter] + string $password = null + ): bool { return F::write($this->root() . '/.htpasswd', $password); } } diff --git a/kirby/src/Cms/UserRules.php b/kirby/src/Cms/UserRules.php index bf469d4..3725f8c 100644 --- a/kirby/src/Cms/UserRules.php +++ b/kirby/src/Cms/UserRules.php @@ -8,6 +8,7 @@ use Kirby\Exception\LogicException; use Kirby\Exception\PermissionException; use Kirby\Toolkit\Str; use Kirby\Toolkit\V; +use SensitiveParameter; /** * Validators for all user actions @@ -83,13 +84,13 @@ class UserRules /** * Validates if the password can be changed * - * @param \Kirby\Cms\User $user - * @param string $password - * @return bool * @throws \Kirby\Exception\PermissionException If the user is not allowed to change the password */ - public static function changePassword(User $user, string $password): bool - { + public static function changePassword( + User $user, + #[SensitiveParameter] + string $password + ): bool { if ($user->permissions()->changePassword() !== true) { throw new PermissionException([ 'key' => 'user.changePassword.permission', @@ -193,12 +194,13 @@ class UserRules } // check user permissions (if not on install) - if ($user->kirby()->users()->count() > 0) { - if ($user->permissions()->create() !== true) { - throw new PermissionException([ - 'key' => 'user.create.permission' - ]); - } + if ( + $user->kirby()->users()->count() > 0 && + $user->permissions()->create() !== true + ) { + throw new PermissionException([ + 'key' => 'user.create.permission' + ]); } return true; @@ -332,13 +334,13 @@ class UserRules /** * Validates a password * - * @param \Kirby\Cms\User $user - * @param string $password - * @return bool * @throws \Kirby\Exception\InvalidArgumentException If the password is too short */ - public static function validPassword(User $user, string $password): bool - { + public static function validPassword( + User $user, + #[SensitiveParameter] + string $password + ): bool { if (Str::length($password ?? null) < 8) { throw new InvalidArgumentException([ 'key' => 'user.password.invalid', diff --git a/kirby/src/Data/Data.php b/kirby/src/Data/Data.php index 00e1194..c4b89f9 100644 --- a/kirby/src/Data/Data.php +++ b/kirby/src/Data/Data.php @@ -55,8 +55,9 @@ class Data // find a handler or alias $alias = static::$aliases[$type] ?? null; - $handler = static::$handlers[$type] ?? - ($alias ? static::$handlers[$alias] ?? null : null); + $handler = + static::$handlers[$type] ?? + ($alias ? static::$handlers[$alias] ?? null : null); if ($handler === null || class_exists($handler) === false) { throw new Exception('Missing handler for type: "' . $type . '"'); diff --git a/kirby/src/Field/FieldOptions.php b/kirby/src/Field/FieldOptions.php index feef4c4..fb98070 100644 --- a/kirby/src/Field/FieldOptions.php +++ b/kirby/src/Field/FieldOptions.php @@ -6,6 +6,7 @@ use Kirby\Blueprint\Node; use Kirby\Cms\ModelWithContent; use Kirby\Option\Options; use Kirby\Option\OptionsApi; +use Kirby\Option\OptionsProvider; use Kirby\Option\OptionsQuery; /** @@ -20,7 +21,18 @@ use Kirby\Option\OptionsQuery; class FieldOptions extends Node { public function __construct( - public Options|OptionsApi|OptionsQuery|null $options = null + /** + * The option source, either a fixed collection or + * a dynamic provider + */ + public Options|OptionsProvider|null $options = null, + + /** + * Whether to escape special HTML characters in + * the option text for safe output in the Panel; + * only set to `false` if the text is later escaped! + */ + public bool $safeMode = true ) { } @@ -31,7 +43,7 @@ class FieldOptions extends Node return parent::defaults(); } - public static function factory(array $props): static + public static function factory(array $props, bool $safeMode = true): static { $options = match ($props['type']) { 'api' => OptionsApi::factory($props), @@ -39,20 +51,23 @@ class FieldOptions extends Node default => Options::factory($props['options'] ?? []) }; - return new static($options); + return new static($options, $safeMode); } public static function polyfill(array $props = []): array { if (is_string($props['options'] ?? null) === true) { $props['options'] = match ($props['options']) { - 'api' => ['type' => 'api'] + - OptionsApi::polyfill($props['api'] ?? null), + 'api' => + ['type' => 'api'] + + OptionsApi::polyfill($props['api'] ?? null), - 'query' => ['type' => 'query'] + - OptionsQuery::polyfill($props['query'] ?? null), + 'query' => + ['type' => 'query'] + + OptionsQuery::polyfill($props['query'] ?? null), - default => [ 'type' => 'query', 'query' => $props['options']] + default => + [ 'type' => 'query', 'query' => $props['options']] }; } @@ -82,8 +97,8 @@ class FieldOptions extends Node return $this->options; } - // resolve OptionsApi or OptionsQuery to Options - return $this->options = $this->options->resolve($model); + // resolve OptionsProvider (OptionsApi or OptionsQuery) to Options + return $this->options = $this->options->resolve($model, $this->safeMode); } public function render(ModelWithContent $model): array diff --git a/kirby/src/Filesystem/Asset.php b/kirby/src/Filesystem/Asset.php index cd1e699..1ced36b 100644 --- a/kirby/src/Filesystem/Asset.php +++ b/kirby/src/Filesystem/Asset.php @@ -3,6 +3,8 @@ namespace Kirby\Filesystem; use Kirby\Cms\FileModifications; +use Kirby\Cms\HasMethods; +use Kirby\Exception\BadMethodCallException; /** * Anything in your public path can be converted @@ -20,6 +22,7 @@ class Asset { use IsFile; use FileModifications; + use HasMethods; /** * Relative file path @@ -38,6 +41,31 @@ class Asset ]); } + /** + * Magic caller for asset methods + * + * @throws \Kirby\Exception\BadMethodCallException + */ + public function __call(string $method, array $arguments = []) + { + // public property access + if (isset($this->$method) === true) { + return $this->$method; + } + + // asset method proxy + if (method_exists($this->asset(), $method)) { + return $this->asset()->$method(...$arguments); + } + + // asset methods + if ($this->hasMethod($method)) { + return $this->callMethod($method, $arguments); + } + + throw new BadMethodCallException('The method: "' . $method . '" does not exist'); + } + /** * Returns a unique id for the asset */ diff --git a/kirby/src/Filesystem/Dir.php b/kirby/src/Filesystem/Dir.php index 5938153..b51b80b 100644 --- a/kirby/src/Filesystem/Dir.php +++ b/kirby/src/Filesystem/Dir.php @@ -48,12 +48,16 @@ class Dir /** * Copy the directory to a new destination + * + * @param array|false $ignore List of full paths to skip during copying + * or `false` to copy all files, including + * those listed in `Dir::$ignore` */ public static function copy( string $dir, string $target, bool $recursive = true, - array $ignore = [] + array|false $ignore = [] ): bool { if (is_dir($dir) === false) { throw new Exception('The directory "' . $dir . '" does not exist'); @@ -67,10 +71,13 @@ class Dir throw new Exception('The target directory "' . $target . '" could not be created'); } - foreach (static::read($dir) as $name) { + foreach (static::read($dir, $ignore === false ? [] : null) as $name) { $root = $dir . '/' . $name; - if (in_array($root, $ignore) === true) { + if ( + is_array($ignore) === true && + in_array($root, $ignore) === true + ) { continue; } @@ -132,19 +139,32 @@ class Dir /** * Read the directory and all subdirectories + * + * @todo Remove support for `$ignore = null` in a major release + * @param array|false|null $ignore Array of absolut file paths; + * `false` to disable `Dir::$ignore` list + * (passing null is deprecated) */ public static function index( string $dir, bool $recursive = false, - array|null $ignore = null, + array|false|null $ignore = [], string $path = null ): array { $result = []; $dir = realpath($dir); - $items = static::read($dir); + $items = static::read($dir, $ignore === false ? [] : null); foreach ($items as $item) { - $root = $dir . '/' . $item; + $root = $dir . '/' . $item; + + if ( + is_array($ignore) === true && + in_array($root, $ignore) === true + ) { + continue; + } + $entry = $path !== null ? $path . '/' . $item : $item; $result[] = $entry; diff --git a/kirby/src/Filesystem/F.php b/kirby/src/Filesystem/F.php index 5cc5bb3..3917838 100644 --- a/kirby/src/Filesystem/F.php +++ b/kirby/src/Filesystem/F.php @@ -514,7 +514,14 @@ class F static::remove($newRoot); } - // actually move the file if it exists + $directory = dirname($newRoot); + + // create the parent directory if it does not exist + if (is_dir($directory) === false) { + Dir::make($directory, true); + } + + // actually move the file if (rename($oldRoot, $newRoot) !== true) { return false; } diff --git a/kirby/src/Form/Field.php b/kirby/src/Form/Field.php index 2d1055f..c13910a 100644 --- a/kirby/src/Form/Field.php +++ b/kirby/src/Form/Field.php @@ -62,7 +62,10 @@ class Field extends Component public function __construct(string $type, array $attrs = [], ?Fields $formFields = null) { if (isset(static::$types[$type]) === false) { - throw new InvalidArgumentException('The field type "' . $type . '" does not exist'); + throw new InvalidArgumentException([ + 'key' => 'field.type.missing', + 'data' => ['name' => $attrs['name'] ?? '-', 'type' => $type] + ]); } if (isset($attrs['model']) === false) { diff --git a/kirby/src/Form/Field/BlocksField.php b/kirby/src/Form/Field/BlocksField.php index d058171..29b4993 100644 --- a/kirby/src/Form/Field/BlocksField.php +++ b/kirby/src/Form/Field/BlocksField.php @@ -202,6 +202,18 @@ class BlocksField extends FieldClass return $this->valueToJson($blocks, $this->pretty()); } + protected function setDefault($default = null) + { + // set id for blocks if not exists + if (is_array($default) === true) { + array_walk($default, function (&$block) { + $block['id'] ??= Str::uuid(); + }); + } + + parent::setDefault($default); + } + protected function setFieldsets($fieldsets, $model) { if (is_string($fieldsets) === true) { diff --git a/kirby/src/Form/Field/LayoutField.php b/kirby/src/Form/Field/LayoutField.php index 461f32a..528c192 100644 --- a/kirby/src/Form/Field/LayoutField.php +++ b/kirby/src/Form/Field/LayoutField.php @@ -115,6 +115,32 @@ class LayoutField extends BlocksField return $routes; } + protected function setDefault($default = null) + { + // set id for layouts, columns and blocks within layout if not exists + if (is_array($default) === true) { + array_walk($default, function (&$layout) { + $layout['id'] ??= Str::uuid(); + + // set columns id within layout + if (isset($layout['columns']) === true) { + array_walk($layout['columns'], function (&$column) { + $column['id'] ??= Str::uuid(); + + // set blocks id within column + if (isset($column['blocks']) === true) { + array_walk($column['blocks'], function (&$block) { + $block['id'] ??= Str::uuid(); + }); + } + }); + } + }); + } + + parent::setDefault($default); + } + protected function setLayouts(array $layouts = []) { $this->layouts = array_map( diff --git a/kirby/src/Form/FieldClass.php b/kirby/src/Form/FieldClass.php index ebd76c6..d93bdff 100644 --- a/kirby/src/Form/FieldClass.php +++ b/kirby/src/Form/FieldClass.php @@ -838,11 +838,13 @@ abstract class FieldClass */ protected function valueToJson(array $value = null, bool $pretty = false): string { + $constants = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; + if ($pretty === true) { - return json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); + $constants |= JSON_PRETTY_PRINT; } - return json_encode($value); + return json_encode($value, $constants); } /** diff --git a/kirby/src/Form/Form.php b/kirby/src/Form/Form.php index 68f698d..9ee3059 100644 --- a/kirby/src/Form/Form.php +++ b/kirby/src/Form/Form.php @@ -324,9 +324,7 @@ class Form return $fields; } - if ($language === null) { - $language = $kirby->language()->code(); - } + $language ??= $kirby->language()->code(); if ($language !== $kirby->defaultLanguage()->code()) { foreach ($fields as $fieldName => $fieldProps) { diff --git a/kirby/src/Http/Cookie.php b/kirby/src/Http/Cookie.php index e461a5a..1d5c3e6 100644 --- a/kirby/src/Http/Cookie.php +++ b/kirby/src/Http/Cookie.php @@ -217,9 +217,6 @@ class Cookie { // lazily request the instance for non-CMS use cases $kirby = App::instance(null, true); - - if ($kirby) { - $kirby->response()->usesCookie($key); - } + $kirby?->response()->usesCookie($key); } } diff --git a/kirby/src/Http/Environment.php b/kirby/src/Http/Environment.php index 9a3e3c5..8a9a52e 100644 --- a/kirby/src/Http/Environment.php +++ b/kirby/src/Http/Environment.php @@ -152,7 +152,7 @@ class Environment */ public function detect(array $options = null, array $info = null): array { - $info ??= $_SERVER; + $info ??= $_SERVER; $options = array_merge([ 'cli' => null, 'allowed' => null @@ -195,7 +195,7 @@ class Environment * Sets the host name, port, path and protocol from the * fixed list of allowed URLs */ - protected function detectAllowed(array|string|object $allowed): void + protected function detectAllowed(array|string $allowed): void { $allowed = A::wrap($allowed); @@ -922,7 +922,7 @@ class Environment protected function sanitizeScriptPath(string|null $scriptPath = null): string { $scriptPath ??= ''; - $scriptPath = trim($scriptPath); + $scriptPath = trim($scriptPath); // skip all the sanitizing steps if the path is empty if ($scriptPath === '') { diff --git a/kirby/src/Http/Header.php b/kirby/src/Http/Header.php index 2d9692e..0c36b58 100644 --- a/kirby/src/Http/Header.php +++ b/kirby/src/Http/Header.php @@ -101,8 +101,11 @@ class Header * * @return string|void */ - public static function type(string $mime, string $charset = 'UTF-8', bool $send = true) - { + public static function type( + string $mime, + string $charset = 'UTF-8', + bool $send = true + ) { return static::contentType($mime, $charset, $send); } @@ -118,17 +121,25 @@ class Header * @return string|void * @psalm-return ($send is false ? string : void) */ - public static function status(int|string|null $code = null, bool $send = true) - { + public static function status( + int|string|null $code = null, + bool $send = true + ) { $codes = static::$codes; $protocol = Environment::getGlobally('SERVER_PROTOCOL', 'HTTP/1.1'); // allow full control over code and message - if (is_string($code) === true && preg_match('/^\d{3} \w.+$/', $code) === 1) { + if ( + is_string($code) === true && + preg_match('/^\d{3} \w.+$/', $code) === 1 + ) { $message = substr(rtrim($code), 4); $code = substr($code, 0, 3); } else { - $code = array_key_exists('_' . $code, $codes) === false ? 500 : $code; + if (array_key_exists('_' . $code, $codes) === false) { + $code = 500; + } + $message = $codes['_' . $code] ?? 'Something went wrong'; } diff --git a/kirby/src/Http/Params.php b/kirby/src/Http/Params.php index 2403cc9..6ad821f 100644 --- a/kirby/src/Http/Params.php +++ b/kirby/src/Http/Params.php @@ -66,7 +66,7 @@ class Params extends Obj $paramValue = $paramParts[1] ?? null; if ($paramKey !== null) { - $params[rawurldecode($paramKey)] = $paramValue ? rawurldecode($paramValue) : null; + $params[rawurldecode($paramKey)] = $paramValue !== null ? rawurldecode($paramValue) : null; } unset($path[$index]); @@ -120,8 +120,10 @@ class Params extends Obj * Converts the params object to a params string * which can then be used in the URL builder again */ - public function toString(bool $leadingSlash = false, bool $trailingSlash = false): string - { + public function toString( + bool $leadingSlash = false, + bool $trailingSlash = false + ): string { if ($this->isEmpty() === true) { return ''; } diff --git a/kirby/src/Http/Path.php b/kirby/src/Http/Path.php index 10c5020..02d2b05 100644 --- a/kirby/src/Http/Path.php +++ b/kirby/src/Http/Path.php @@ -31,8 +31,10 @@ class Path extends Collection return $this->toString(); } - public function toString(bool $leadingSlash = false, bool $trailingSlash = false): string - { + public function toString( + bool $leadingSlash = false, + bool $trailingSlash = false + ): string { if (empty($this->data) === true) { return ''; } diff --git a/kirby/src/Http/Remote.php b/kirby/src/Http/Remote.php index 01f4c89..3ef7138 100644 --- a/kirby/src/Http/Remote.php +++ b/kirby/src/Http/Remote.php @@ -91,7 +91,13 @@ class Remote public static function __callStatic(string $method, array $arguments = []): static { - return new static($arguments[0], array_merge(['method' => strtoupper($method)], $arguments[1] ?? [])); + return new static( + url: $arguments[0], + options: array_merge( + ['method' => strtoupper($method)], + $arguments[1] ?? [] + ) + ); } /** @@ -176,10 +182,10 @@ class Remote $headers = []; foreach ($this->options['headers'] as $key => $value) { if (is_string($key) === true) { - $headers[] = $key . ': ' . $value; - } else { - $headers[] = $value; + $value = $key . ': ' . $value; } + + $headers[] = $value; } $this->curlopt[CURLOPT_HTTPHEADER] = $headers; @@ -264,7 +270,10 @@ class Remote $query = http_build_query($options['data']); if (empty($query) === false) { - $url = Url::hasQuery($url) === true ? $url . '&' . $query : $url . '?' . $query; + $url = match (Url::hasQuery($url)) { + true => $url . '&' . $query, + default => $url . '?' . $query + }; } // remove the data array from the options diff --git a/kirby/src/Http/Request.php b/kirby/src/Http/Request.php index 17dc3e6..cec5dd1 100644 --- a/kirby/src/Http/Request.php +++ b/kirby/src/Http/Request.php @@ -147,9 +147,7 @@ class Request // this ensures that the response is only cached for // unauthenticated visitors; // https://github.com/getkirby/kirby/issues/4423#issuecomment-1166300526 - if ($kirby) { - $kirby->response()->usesAuth(true); - } + $kirby?->response()->usesAuth(true); if ($auth = $this->authString()) { $type = Str::lower(Str::before($auth, ' ')); @@ -292,7 +290,10 @@ class Request $headers = []; foreach (Environment::getGlobally() as $key => $value) { - if (substr($key, 0, 5) !== 'HTTP_' && substr($key, 0, 14) !== 'REDIRECT_HTTP_') { + if ( + substr($key, 0, 5) !== 'HTTP_' && + substr($key, 0, 14) !== 'REDIRECT_HTTP_' + ) { continue; } diff --git a/kirby/src/Http/Request/Auth.php b/kirby/src/Http/Request/Auth.php index 3eb1f23..f197379 100644 --- a/kirby/src/Http/Request/Auth.php +++ b/kirby/src/Http/Request/Auth.php @@ -2,6 +2,8 @@ namespace Kirby\Http\Request; +use SensitiveParameter; + /** * Base class for auth types * @@ -22,8 +24,10 @@ abstract class Auth /** * Constructor */ - public function __construct(string $data) - { + public function __construct( + #[SensitiveParameter] + string $data + ) { $this->data = $data; } diff --git a/kirby/src/Http/Request/Auth/BasicAuth.php b/kirby/src/Http/Request/Auth/BasicAuth.php index 7549a4f..f0e80ce 100644 --- a/kirby/src/Http/Request/Auth/BasicAuth.php +++ b/kirby/src/Http/Request/Auth/BasicAuth.php @@ -4,6 +4,7 @@ namespace Kirby\Http\Request\Auth; use Kirby\Http\Request\Auth; use Kirby\Toolkit\Str; +use SensitiveParameter; /** * HTTP basic authentication data @@ -20,8 +21,10 @@ class BasicAuth extends Auth protected string|null $password; protected string|null $username; - public function __construct(string $data) - { + public function __construct( + #[SensitiveParameter] + string $data + ) { parent::__construct($data); $this->credentials = base64_decode($data); diff --git a/kirby/src/Http/Request/Files.php b/kirby/src/Http/Request/Files.php index 8e7d3a0..244028a 100644 --- a/kirby/src/Http/Request/Files.php +++ b/kirby/src/Http/Request/Files.php @@ -22,7 +22,7 @@ class Files /** * Sanitized array of all received files */ - protected array $files; + protected array $files = []; /** * Creates a new Files object @@ -31,11 +31,7 @@ class Files */ public function __construct(array|null $files = null) { - if ($files === null) { - $files = $_FILES; - } - - $this->files = []; + $files ??= $_FILES; foreach ($files as $key => $file) { if (is_array($file['name'])) { diff --git a/kirby/src/Http/Response.php b/kirby/src/Http/Response.php index 15bca1f..984aed4 100644 --- a/kirby/src/Http/Response.php +++ b/kirby/src/Http/Response.php @@ -50,8 +50,13 @@ class Response /** * Creates a new response object */ - public function __construct(string|array $body = '', string|null $type = null, int|null $code = null, array|null $headers = null, string|null $charset = null) - { + public function __construct( + string|array $body = '', + string|null $type = null, + int|null $code = null, + array|null $headers = null, + string|null $charset = null + ) { // array construction if (is_array($body) === true) { $params = $body; @@ -127,8 +132,11 @@ class Response * * @param array $props Custom overrides for response props (e.g. headers) */ - public static function download(string $file, string|null $filename = null, array $props = []): static - { + public static function download( + string $file, + string|null $filename = null, + array $props = [] + ): static { if (file_exists($file) === false) { throw new Exception('The file could not be found'); } @@ -178,6 +186,7 @@ class Response * @since 3.7.0 * * @codeCoverageIgnore + * @todo Change return type to `never` once support for PHP 8.0 is dropped */ public static function go(string $url = '/', int $code = 302): void { @@ -223,8 +232,12 @@ class Response * Creates a json response with appropriate * header and automatic conversion of arrays. */ - public static function json(string|array $body = '', int|null $code = null, bool|null $pretty = null, array $headers = []): static - { + public static function json( + string|array $body = '', + int|null $code = null, + bool|null $pretty = null, + array $headers = [] + ): static { if (is_array($body) === true) { $body = json_encode($body, $pretty === true ? JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES : 0); } diff --git a/kirby/src/Http/Route.php b/kirby/src/Http/Route.php index 3aa1d8c..18796c4 100644 --- a/kirby/src/Http/Route.php +++ b/kirby/src/Http/Route.php @@ -72,8 +72,12 @@ class Route * Creates a new Route object for the given * pattern(s), method(s) and the callback action */ - public function __construct(string $pattern, string $method, Closure $action, array $attributes = []) - { + public function __construct( + string $pattern, + string $method, + Closure $action, + array $attributes = [] + ) { $this->action = $action; $this->attributes = $attributes; $this->method = $method; diff --git a/kirby/src/Http/Router.php b/kirby/src/Http/Router.php index 6481a63..f561bd3 100644 --- a/kirby/src/Http/Router.php +++ b/kirby/src/Http/Router.php @@ -117,7 +117,10 @@ class Router if ($callback) { $result = $callback($route); } else { - $result = $route?->action()->call($route, ...$route->arguments()); + $result = $route->action()->call( + $route, + ...$route->arguments() + ); } $loop = false; @@ -139,8 +142,12 @@ class Router * the routing action immediately * @since 3.7.0 */ - public static function execute(string|null $path = null, string $method = 'GET', array $routes = [], Closure|null $callback = null) - { + public static function execute( + string|null $path = null, + string $method = 'GET', + array $routes = [], + Closure|null $callback = null + ) { return (new static($routes))->call($path, $method, $callback); } @@ -150,8 +157,11 @@ class Router * find matches and return all the found * arguments in the path. */ - public function find(string $path, string $method, array|null $ignore = null): Route|null - { + public function find( + string $path, + string $method, + array|null $ignore = null + ): Route { if (isset($this->routes[$method]) === false) { throw new InvalidArgumentException('Invalid routing method: ' . $method, 400); } @@ -163,7 +173,10 @@ class Router $arguments = $route->parse($route->pattern(), $path); if ($arguments !== false) { - if (empty($ignore) === true || in_array($route, $ignore) === false) { + if ( + empty($ignore) === true || + in_array($route, $ignore) === false + ) { return $this->route = $route; } } diff --git a/kirby/src/Http/Uri.php b/kirby/src/Http/Uri.php index 087cc8a..a44526f 100644 --- a/kirby/src/Http/Uri.php +++ b/kirby/src/Http/Uri.php @@ -5,6 +5,7 @@ namespace Kirby\Http; use Kirby\Cms\App; use Kirby\Exception\InvalidArgumentException; use Kirby\Toolkit\Properties; +use SensitiveParameter; use Throwable; /** @@ -226,7 +227,10 @@ class Uri $domain .= $this->host; - if ($this->port !== null && in_array($this->port, [80, 443]) === false) { + if ( + $this->port !== null && + in_array($this->port, [80, 443]) === false + ) { $domain .= ':' . $this->port; } @@ -326,8 +330,10 @@ class Uri /** * @return $this */ - public function setPassword(string|null $password = null): static - { + public function setPassword( + #[SensitiveParameter] + string|null $password = null + ): static { $this->password = $password; return $this; } diff --git a/kirby/src/Http/Url.php b/kirby/src/Http/Url.php index 23e5456..7a52907 100644 --- a/kirby/src/Http/Url.php +++ b/kirby/src/Http/Url.php @@ -30,7 +30,8 @@ class Url */ public static function __callStatic(string $method, array $arguments) { - return (new Uri($arguments[0] ?? static::current()))->$method(...array_slice($arguments, 1)); + $uri = new Uri($arguments[0] ?? static::current()); + return $uri->$method(...array_slice($arguments, 1)); } /** @@ -65,7 +66,11 @@ class Url public static function fix(string|null $url = null): string|null { // make sure to not touch absolute urls - return (!preg_match('!^(https|http|ftp)\:\/\/!i', $url ?? '')) ? 'http://' . $url : $url; + if (!preg_match('!^(https|http|ftp)\:\/\/!i', $url ?? '')) { + return 'http://' . $url; + } + + return $url; } /** @@ -93,7 +98,9 @@ class Url // //example.com/uri // http://example.com/uri, https://example.com/uri, ftp://example.com/uri // mailto:example@example.com, geo:49.0158,8.3239?z=11 - return $url !== null && preg_match('!^(//|[a-z0-9+-.]+://|mailto:|tel:|geo:)!i', $url) === 1; + return + $url !== null && + preg_match('!^(//|[a-z0-9+-.]+://|mailto:|tel:|geo:)!i', $url) === 1; } /** @@ -127,8 +134,11 @@ class Url /** * Returns the path for the given url */ - public static function path(string|array|null $url = null, bool $leadingSlash = false, bool $trailingSlash = false): string - { + public static function path( + string|array|null $url = null, + bool $leadingSlash = false, + bool $trailingSlash = false + ): string { return Url::toObject($url)->path()->toString($leadingSlash, $trailingSlash); } @@ -151,8 +161,12 @@ class Url /** * Shortens the Url by removing all unnecessary parts */ - public static function short(string|null $url = null, int $length = 0, bool $base = false, string $rep = '…'): string - { + public static function short( + string|null $url = null, + int $length = 0, + bool $base = false, + string $rep = '…' + ): string { $uri = static::toObject($url); $uri->fragment = null; diff --git a/kirby/src/Image/Darkroom/GdLib.php b/kirby/src/Image/Darkroom/GdLib.php index 38efc87..62f31cf 100644 --- a/kirby/src/Image/Darkroom/GdLib.php +++ b/kirby/src/Image/Darkroom/GdLib.php @@ -33,7 +33,7 @@ class GdLib extends Darkroom $image = $this->blur($image, $options); $image = $this->grayscale($image, $options); - $image->toFile($file, $mime, $options['quality']); + $image->toFile($file, $mime, $options); return $options; } @@ -60,7 +60,11 @@ class GdLib extends Darkroom return $image->resize($options['width'], $options['height']); } - return $image->thumbnail($options['width'], $options['height'] ?? $options['width'], $options['crop']); + return $image->thumbnail( + $options['width'], + $options['height'] ?? $options['width'], + $options['crop'] + ); } /** diff --git a/kirby/src/Image/Dimensions.php b/kirby/src/Image/Dimensions.php index f1da3a3..54bb636 100644 --- a/kirby/src/Image/Dimensions.php +++ b/kirby/src/Image/Dimensions.php @@ -2,6 +2,8 @@ namespace Kirby\Image; +use Kirby\Toolkit\Str; + /** * The Dimension class is used to provide additional * methods for images and possibly other objects with @@ -253,12 +255,28 @@ class Dimensions if ($xml !== false) { $attr = $xml->attributes(); - $width = (int)($attr->width); - $height = (int)($attr->height); - if (($width === 0 || $height === 0) && empty($attr->viewBox) === false) { - $box = explode(' ', $attr->viewBox); - $width = (int)($box[2] ?? 0); - $height = (int)($box[3] ?? 0); + + $rawWidth = $attr->width; + $width = (int)$rawWidth; + $rawHeight = $attr->height; + $height = (int)$rawHeight; + + // use viewbox values if direct attributes are 0 + // or based on percentages + if (empty($attr->viewBox) === false) { + $box = explode(' ', $attr->viewBox); + + // when using viewbox values, make sure to subtract + // first two box values from last two box values + // to retrieve the absolute dimensions + + if (Str::endsWith($rawWidth, '%') === true || $width === 0) { + $width = (int)($box[2] ?? 0) - (int)($box[0] ?? 0); + } + + if (Str::endsWith($rawHeight, '%') === true || $height === 0) { + $height = (int)($box[3] ?? 0) - (int)($box[1] ?? 0); + } } } diff --git a/kirby/src/Image/Exif.php b/kirby/src/Image/Exif.php index b03573a..1bbb8a5 100644 --- a/kirby/src/Image/Exif.php +++ b/kirby/src/Image/Exif.php @@ -215,9 +215,10 @@ class Exif */ protected function parseFocalLength(): string|null { - return $this->data['FocalLength'] ?? - $this->data['FocalLengthIn35mmFilm'] ?? - null; + return + $this->data['FocalLength'] ?? + $this->data['FocalLengthIn35mmFilm'] ?? + null; } /** diff --git a/kirby/src/Image/Image.php b/kirby/src/Image/Image.php index 5779eb1..83c0a7b 100644 --- a/kirby/src/Image/Image.php +++ b/kirby/src/Image/Image.php @@ -2,6 +2,7 @@ namespace Kirby\Image; +use Kirby\Cms\Content; use Kirby\Exception\LogicException; use Kirby\Filesystem\File; use Kirby\Toolkit\Html; @@ -112,6 +113,17 @@ class Image extends File */ public function html(array $attr = []): string { + // if no alt text explicitly provided, + // try to infer from model content file + if ( + $this->model !== null && + method_exists($this->model, 'content') === true && + $this->model->content() instanceof Content && + $this->model->content()->get('alt')->isNotEmpty() === true + ) { + $attr['alt'] ??= $this->model->content()->get('alt')->value(); + } + if ($url = $this->url()) { return Html::img($url, $attr); } diff --git a/kirby/src/Option/Option.php b/kirby/src/Option/Option.php index 314e7cf..3e58741 100644 --- a/kirby/src/Option/Option.php +++ b/kirby/src/Option/Option.php @@ -8,7 +8,7 @@ use Kirby\Blueprint\NodeText; use Kirby\Cms\ModelWithContent; /** - * Option for select fields, radio fields, etc + * Option for select fields, radio fields, etc. * * @package Kirby Option * @author Bastian Allgeier @@ -19,7 +19,7 @@ use Kirby\Cms\ModelWithContent; class Option { public function __construct( - public float|int|string|null $value, + public string|int|float|null $value, public bool $disabled = false, public NodeIcon|null $icon = null, public NodeText|null $info = null, @@ -28,7 +28,7 @@ class Option $this->text ??= new NodeText(['en' => $this->value]); } - public static function factory(float|int|string|null|array $props): static + public static function factory(string|int|float|null|array $props): static { if (is_array($props) === false) { $props = ['value' => $props]; diff --git a/kirby/src/Option/Options.php b/kirby/src/Option/Options.php index b1b31c6..de16a14 100644 --- a/kirby/src/Option/Options.php +++ b/kirby/src/Option/Options.php @@ -6,7 +6,8 @@ use Kirby\Blueprint\Collection; use Kirby\Cms\ModelWithContent; /** - * Options + * Collection of possible options for + * select fields, radio fields, etc. * * @package Kirby Option * @author Bastian Allgeier @@ -30,6 +31,7 @@ class Options extends Collection $collection = new static(); foreach ($items as $key => $option) { + // convert an associative value => text array into props; // skip if option is already an array of option props if ( is_array($option) === false || diff --git a/kirby/src/Option/OptionsApi.php b/kirby/src/Option/OptionsApi.php index 59fc145..011d19e 100644 --- a/kirby/src/Option/OptionsApi.php +++ b/kirby/src/Option/OptionsApi.php @@ -2,6 +2,7 @@ namespace Kirby\Option; +use Kirby\Cms\Field; use Kirby\Cms\ModelWithContent; use Kirby\Cms\Nest; use Kirby\Data\Json; @@ -88,8 +89,12 @@ class OptionsApi extends OptionsProvider * Creates the actual options by loading * data from the API and resolving it to * the correct text-value entries + * + * @param bool $safeMode Whether to escape special HTML characters in + * the option text for safe output in the Panel; + * only set to `false` if the text is later escaped! */ - public function resolve(ModelWithContent $model): Options + public function resolve(ModelWithContent $model, bool $safeMode = true): Options { // use cached options if present // @codeCoverageIgnoreStart @@ -101,25 +106,41 @@ class OptionsApi extends OptionsProvider // apply property defaults $this->defaults(); - // load data from URL and narrow down to queried part + // load data from URL and convert from JSON to array $data = $this->load($model); + // @codeCoverageIgnoreStart if ($data === null) { throw new NotFoundException('Options could not be loaded from API: ' . $model->toSafeString($this->url)); } + // @codeCoverageIgnoreEnd // turn data into Nest so that it can be queried + // or field methods applied to the data $data = Nest::create($data); - $data = Query::factory($this->query)->resolve($data); + + // optionally query a substructure inside the data array + $data = Query::factory($this->query)->resolve($data); + $options = []; // create options by resolving text and value query strings // for each item from the data - $options = $data->toArray(fn ($item) => [ - // value is always a raw string - 'value' => $model->toString($this->value, ['item' => $item]), - // text is only a raw string when using {< >} - 'text' => $model->toSafeString($this->text, ['item' => $item]), - ]); + foreach ($data as $key => $item) { + // convert simple `key: value` API data + if (is_string($item) === true) { + $item = new Field(null, $key, $item); + } + + $safeMethod = $safeMode === true ? 'toSafeString' : 'toString'; + + $options[] = [ + // value is always a raw string + 'value' => $model->toString($this->value, ['item' => $item]), + // text is only a raw string when using {< >} + // or when the safe mode is explicitly disabled (select field) + 'text' => $model->$safeMethod($this->text, ['item' => $item]) + ]; + } // create Options object and render this subsequently return $this->options = Options::factory($options); diff --git a/kirby/src/Option/OptionsProvider.php b/kirby/src/Option/OptionsProvider.php index e36ab09..433b2ab 100644 --- a/kirby/src/Option/OptionsProvider.php +++ b/kirby/src/Option/OptionsProvider.php @@ -26,5 +26,13 @@ abstract class OptionsProvider return $this->resolve($model)->render($model); } - abstract public function resolve(ModelWithContent $model): Options; + /** + * Dynamically determines the actual options and resolves + * them to the correct text-value entries + * + * @param bool $safeMode Whether to escape special HTML characters in + * the option text for safe output in the Panel; + * only set to `false` if the text is later escaped! + */ + abstract public function resolve(ModelWithContent $model, bool $safeMode = true): Options; } diff --git a/kirby/src/Option/OptionsQuery.php b/kirby/src/Option/OptionsQuery.php index 0179b1f..62800ca 100644 --- a/kirby/src/Option/OptionsQuery.php +++ b/kirby/src/Option/OptionsQuery.php @@ -131,8 +131,12 @@ class OptionsQuery extends OptionsProvider * Creates the actual options by running * the query on the model and resolving it to * the correct text-value entries + * + * @param bool $safeMode Whether to escape special HTML characters in + * the option text for safe output in the Panel; + * only set to `false` if the text is later escaped! */ - public function resolve(ModelWithContent $model): Options + public function resolve(ModelWithContent $model, bool $safeMode = true): Options { // use cached options if present // @codeCoverageIgnoreStart @@ -159,7 +163,7 @@ class OptionsQuery extends OptionsProvider } // create options array - $options = $result->toArray(function ($item) use ($model) { + $options = $result->toArray(function ($item) use ($model, $safeMode) { // get defaults based on item type [$alias, $text, $value] = $this->itemToDefaults($item); $data = ['item' => $item, $alias => $item]; @@ -167,9 +171,10 @@ class OptionsQuery extends OptionsProvider // value is always a raw string $value = $model->toString($this->value ?? $value, $data); - // text is only a raw string when HTML prop - // is explicitly set to true - $text = $model->toSafeString($this->text ?? $text, $data); + // text is only a raw string when using {< >} + // or when the safe mode is explicitly disabled (select field) + $safeMethod = $safeMode === true ? 'toSafeString' : 'toString'; + $text = $model->$safeMethod($this->text ?? $text, $data); return compact('text', 'value'); }); diff --git a/kirby/src/Panel/Document.php b/kirby/src/Panel/Document.php index 034b1d3..f23eb9e 100644 --- a/kirby/src/Panel/Document.php +++ b/kirby/src/Panel/Document.php @@ -198,7 +198,9 @@ class Document */ public static function icons(): string { - return F::read(App::instance()->root('kirby') . '/panel/dist/img/icons.svg'); + $dev = App::instance()->option('panel.dev', false); + $dir = $dev ? 'public' : 'dist'; + return F::read(App::instance()->root('kirby') . '/panel/' . $dir . '/img/icons.svg'); } /** diff --git a/kirby/src/Panel/File.php b/kirby/src/Panel/File.php index 4beb689..531c679 100644 --- a/kirby/src/Panel/File.php +++ b/kirby/src/Panel/File.php @@ -196,9 +196,10 @@ class File extends Model 'rtf' => 'blue-400' ]; - return $extensions[$this->model->extension()] ?? - $types[$this->model->type()] ?? - parent::imageDefaults()['color']; + return + $extensions[$this->model->extension()] ?? + $types[$this->model->type()] ?? + parent::imageDefaults()['color']; } /** @@ -237,9 +238,10 @@ class File extends Model 'md' => 'markdown' ]; - return $extensions[$this->model->extension()] ?? - $types[$this->model->type()] ?? - 'file'; + return + $extensions[$this->model->extension()] ?? + $types[$this->model->type()] ?? + 'file'; } /** @@ -292,17 +294,22 @@ class File extends Model public function pickerData(array $params = []): array { $name = $this->model->filename(); + $id = $this->model->id(); if (empty($params['model']) === false) { $parent = $this->model->parent(); + // if the file belongs to the current parent model, + // store only name as ID to keep its path relative to the model + $id = $parent === $params['model'] ? $name : $id; $absolute = $parent !== $params['model']; } $params['text'] ??= '{{ file.filename }}'; return array_merge(parent::pickerData($params), [ - 'filename' => $name, 'dragText' => $this->dragText('auto', $absolute ?? false), + 'filename' => $name, + 'id' => $id, 'type' => $this->model->type(), 'url' => $this->model->url() ]); diff --git a/kirby/src/Panel/Page.php b/kirby/src/Panel/Page.php index 75fd78d..088822c 100644 --- a/kirby/src/Panel/Page.php +++ b/kirby/src/Panel/Page.php @@ -196,10 +196,7 @@ class Page extends Model protected function imageSource( string|null $query = null ): CmsFile|Asset|null { - if ($query === null) { - $query = 'page.image'; - } - + $query ??= 'page.image'; return parent::imageSource($query); } @@ -234,8 +231,9 @@ class Page extends Model */ public function position(): int { - return $this->model->num() ?? - $this->model->parentModel()->children()->listed()->not($this->model)->count() + 1; + return + $this->model->num() ?? + $this->model->parentModel()->children()->listed()->not($this->model)->count() + 1; } /** diff --git a/kirby/src/Panel/Site.php b/kirby/src/Panel/Site.php index caddd46..fc32b9d 100644 --- a/kirby/src/Panel/Site.php +++ b/kirby/src/Panel/Site.php @@ -38,10 +38,7 @@ class Site extends Model protected function imageSource( string|null $query = null ): CmsFile|Asset|null { - if ($query === null) { - $query = 'site.image'; - } - + $query ??= 'site.image'; return parent::imageSource($query); } diff --git a/kirby/src/Parsley/Element.php b/kirby/src/Parsley/Element.php index b0bd9de..2deae25 100644 --- a/kirby/src/Parsley/Element.php +++ b/kirby/src/Parsley/Element.php @@ -96,7 +96,7 @@ class Element * Tries to find a single nested element by * query and otherwise returns null */ - public function find(string $query): Element|null + public function find(string $query): static|null { if ($result = $this->query($query)[0]) { return new static($result); @@ -107,6 +107,8 @@ class Element /** * Returns the inner HTML of the element + * + * @param array|null $marks List of allowed marks */ public function innerHtml(array|null $marks = null): string { diff --git a/kirby/src/Query/Argument.php b/kirby/src/Query/Argument.php index 579883d..29a1b8f 100644 --- a/kirby/src/Query/Argument.php +++ b/kirby/src/Query/Argument.php @@ -38,18 +38,23 @@ class Argument $argument = trim(substr($argument, 1, -1)); } - // string with single or double quotes + // string with single quotes if ( - ( - Str::startsWith($argument, '"') && - Str::endsWith($argument, '"') - ) || ( - Str::startsWith($argument, "'") && - Str::endsWith($argument, "'") - ) + Str::startsWith($argument, "'") && + Str::endsWith($argument, "'") ) { $string = substr($argument, 1, -1); - $string = str_replace(['\"', "\'"], ['"', "'"], $string); + $string = str_replace("\'", "'", $string); + return new static($string); + } + + // string with double quotes + if ( + Str::startsWith($argument, '"') && + Str::endsWith($argument, '"') + ) { + $string = substr($argument, 1, -1); + $string = str_replace('\"', '"', $string); return new static($string); } diff --git a/kirby/src/Query/Arguments.php b/kirby/src/Query/Arguments.php index a187e1a..c78dd22 100644 --- a/kirby/src/Query/Arguments.php +++ b/kirby/src/Query/Arguments.php @@ -6,8 +6,8 @@ use Kirby\Toolkit\A; use Kirby\Toolkit\Collection; /** - * The Argument class represents a single - * parameter passed to a method in a chained query + * The Arguments class helps splitting a + * parameter string into processable arguments * * @package Kirby Query * @author Nico Hoffmann @@ -26,8 +26,9 @@ class Arguments extends Collection // skip all matches inside of single quotes public const NO_SLQU = '\'(?:[^\'\\\\]|\\\\.)*\'(*SKIP)(*FAIL)'; // skip all matches inside of any of the above skip groups - public const OUTSIDE = self::NO_PNTH . '|' . self::NO_SQBR . '|' . - self::NO_DLQU . '|' . self::NO_SLQU; + public const OUTSIDE = + self::NO_PNTH . '|' . self::NO_SQBR . '|' . + self::NO_DLQU . '|' . self::NO_SLQU; /** * Splits list of arguments into individual diff --git a/kirby/src/Query/Expression.php b/kirby/src/Query/Expression.php index cfea6fb..e9ff509 100644 --- a/kirby/src/Query/Expression.php +++ b/kirby/src/Query/Expression.php @@ -22,6 +22,9 @@ class Expression ) { } + /** + * Parses an expression string into its parts + */ public static function factory(string $expression, Query $parent = null): static|Segments { // split into different expression parts and operators diff --git a/kirby/src/Query/Query.php b/kirby/src/Query/Query.php index 40450bc..4dd590a 100644 --- a/kirby/src/Query/Query.php +++ b/kirby/src/Query/Query.php @@ -51,7 +51,7 @@ class Query /** * Creates a new Query object */ - public static function factory(string $query): static + public static function factory(string|null $query): static { return new static(query: $query); } @@ -124,7 +124,6 @@ Query::$entries['site'] = function (): Site { return App::instance()->site(); }; - Query::$entries['t'] = function ( string $key, string|array $fallback = null, diff --git a/kirby/src/Query/Segment.php b/kirby/src/Query/Segment.php index 25ed4fc..f417f1a 100644 --- a/kirby/src/Query/Segment.php +++ b/kirby/src/Query/Segment.php @@ -51,6 +51,11 @@ class Segment throw new BadMethodCallException($error); } + /** + * Parses a segment into the property/method name and its arguments + * + * @param int $position String position of the segment inside the full query + */ public static function factory( string $segment, int $position = 0 @@ -69,6 +74,10 @@ class Segment ); } + /** + * Automatically resolves the segment depending on the + * segment position and the type of the base + */ public function resolve(mixed $base = null, array|object $data = []): mixed { // resolve arguments to array diff --git a/kirby/src/Query/Segments.php b/kirby/src/Query/Segments.php index e49194d..5d2d009 100644 --- a/kirby/src/Query/Segments.php +++ b/kirby/src/Query/Segments.php @@ -81,8 +81,9 @@ class Segments extends Collection return null; } - // for regular connectors, just skip - if ($segment === '.') { + // for regular connectors and optional chaining on non-null, + // just skip this connecting segment + if ($segment === '.' || $segment === '?.') { continue; } diff --git a/kirby/src/Sane/Sane.php b/kirby/src/Sane/Sane.php index 15522a0..d52ea65 100644 --- a/kirby/src/Sane/Sane.php +++ b/kirby/src/Sane/Sane.php @@ -56,8 +56,9 @@ class Sane // find a handler or alias $alias = static::$aliases[$type] ?? null; - $handler = static::$handlers[$type] ?? - ($alias ? static::$handlers[$alias] ?? null : null); + $handler = + static::$handlers[$type] ?? + ($alias ? static::$handlers[$alias] ?? null : null); if (empty($handler) === false && class_exists($handler) === true) { return new $handler(); diff --git a/kirby/src/Session/Session.php b/kirby/src/Session/Session.php index 66f5416..66b942a 100644 --- a/kirby/src/Session/Session.php +++ b/kirby/src/Session/Session.php @@ -339,7 +339,11 @@ class Session * @todo The $this->destroyed check gets flagged by Psalm for unknown reasons * @psalm-suppress ParadoxicalCondition */ - if ($this->writeMode !== true || $this->tokenExpiry === null || $this->destroyed === true) { + if ( + $this->writeMode !== true || + $this->tokenExpiry === null || + $this->destroyed === true + ) { return; } @@ -523,7 +527,11 @@ class Session * @todo The $this->destroyed check gets flagged by Psalm for unknown reasons * @psalm-suppress ParadoxicalCondition */ - if ($this->tokenExpiry === null || $this->destroyed === true || $this->writeMode === true) { + if ( + $this->tokenExpiry === null || + $this->destroyed === true || + $this->writeMode === true + ) { return; } diff --git a/kirby/src/Template/Slot.php b/kirby/src/Template/Slot.php new file mode 100644 index 0000000..69d63d4 --- /dev/null +++ b/kirby/src/Template/Slot.php @@ -0,0 +1,123 @@ + + * @link https://getkirby.com + * @copyright Bastian Allgeier + * @license https://getkirby.com/license + */ +class Slot +{ + /** + * The captured slot content + * @internal + */ + public string|null $content; + + /** + * The name that was declared during + * the definition of the slot + */ + protected string $name; + + /** + * Keeps track of the slot state + */ + protected bool $open = false; + + /** + * Creates a new slot + */ + public function __construct(string $name, string|null $content = null) + { + $this->name = $name; + $this->content = $content; + } + + /** + * Renders the slot content or an empty string + * if the slot is empty. + */ + public function __toString(): string + { + return $this->render() ?? ''; + } + + /** + * Used in the slot helper + */ + public static function begin(string $name = 'default'): static|null + { + return Snippet::$current?->slot($name); + } + + /** + * Closes a slot and catches all the content + * that has been printed since the slot has + * been opened + */ + public function close(): void + { + if ($this->open === false) { + throw new LogicException('The slot has not been opened'); + } + + $this->content = ob_get_clean(); + $this->open = false; + } + + /** + * Used in the endslot() helper + */ + public static function end(): void + { + Snippet::$current?->endslot(); + } + + /** + * Returns whether the slot is currently + * open and being buffered + */ + public function isOpen(): bool + { + return $this->open; + } + + /** + * Returns the slot name + */ + public function name(): string + { + return $this->name; + } + + /** + * Opens the slot and starts + * output buffering + */ + public function open(): void + { + $this->open = true; + + // capture the output + ob_start(); + } + + /** + * Returns the slot content + */ + public function render(): string|null + { + return $this->content; + } +} diff --git a/kirby/src/Template/Slots.php b/kirby/src/Template/Slots.php new file mode 100644 index 0000000..77bc148 --- /dev/null +++ b/kirby/src/Template/Slots.php @@ -0,0 +1,53 @@ +heading()` and accessing a non-existing + * slot will simply return null. + * + * @package Kirby Template + * @author Bastian Allgeier + * @link https://getkirby.com + * @copyright Bastian Allgeier + * @license https://getkirby.com/license + */ +class Slots implements Countable +{ + /** + * Creates a new slots collection + */ + public function __construct(protected array $slots) + { + } + + /** + * Magic getter for slots; + * e.g. `$slots->heading` + */ + public function __get(string $name): Slot|null + { + return $this->slots[$name] ?? null; + } + + /** + * Magic getter method for slots; + * e.g. `$slots->heading()` + */ + public function __call(string $name, array $args): Slot|null + { + return $this->__get($name); + } + + /** + * Counts the number of defined slots + */ + public function count(): int + { + return count($this->slots); + } +} diff --git a/kirby/src/Template/Snippet.php b/kirby/src/Template/Snippet.php new file mode 100644 index 0000000..a238934 --- /dev/null +++ b/kirby/src/Template/Snippet.php @@ -0,0 +1,324 @@ +, + * Nico Hoffmann + * @link https://getkirby.com + * @copyright Bastian Allgeier + * @license https://getkirby.com/license + */ +class Snippet extends Tpl +{ + /** + * Cache for the currently active + * snippet. This is used to start + * and end slots within this snippet + * in the helper functions + * @internal + */ + public static self|null $current = null; + + /** + * Contains all slots that are opened + * but not yet closed + */ + protected array $capture = []; + + /** + * Associative array with variables that + * will be set inside the snippet + */ + protected array $data; + + /** + * An empty dummy slots object used for snippets + * that were loaded without passing slots + */ + protected static Slots|null $dummySlots = null; + + /** + * Full path to the PHP file of the snippet; + * can be `null` for "dummy" snippets that don't exist + */ + protected string|null $file; + + /** + * Keeps track of the state of the snippet + */ + protected bool $open = false; + + /** + * The parent snippet + */ + protected self|null $parent = null; + + /** + * The collection of closed slots that will be used + * to pass down to the template for the snippet. + */ + protected array $slots = []; + + /** + * Creates a new snippet + */ + public function __construct(string|null $file, array $data = []) + { + $this->file = $file; + $this->data = $data; + } + + /** + * Creates and opens a new snippet. This can be used + * directly in a template or via the slots() helper + */ + public static function begin(string|null $file, array $data = []): static + { + $snippet = new static($file, $data); + return $snippet->open(); + } + + /** + * Closes the snippet and catches + * the default slot if no slots have been + * defined in between opening and closing. + */ + public function close(): static + { + // make sure that ending a snippet + // is only supported if the snippet has + // been started before + if ($this->open === false) { + throw new LogicException('The snippet has not been opened'); + } + + // create a default slot for the content + // that has been captured between start and end + if (empty($this->slots) === true) { + $this->slots['default'] = new Slot('default'); + $this->slots['default']->content = ob_get_clean(); + } else { + // swallow any "unslotted" content + // between start and end + ob_end_clean(); + } + + $this->open = false; + + // switch back to the parent in nested + // snippet stacks + static::$current = $this->parent; + + return $this; + } + + /** + * Used in the endsnippet() helper + */ + public static function end(): void + { + echo static::$current?->render(); + } + + /** + * Closes the last openend slot + */ + public function endslot(): void + { + // take the last slot from the capture stack + $slot = array_pop($this->capture); + + // capture the content and close the slot + $slot->close(); + + // add the slot to the scope + $this->slots[$slot->name()] = $slot; + } + + /** + * Returns either an open snippet capturing slots + * or the template string for self-enclosed snippets + */ + public static function factory( + string|array|null $name, + array $data = [], + bool $slots = false + ): static|string { + // instead of returning empty string when `$name` is null + // allow rest of code to run, otherwise the wrong snippet would be closed + // and potential issues for nested snippets may occur + $file = $name !== null ? static::file($name) : null; + + // for snippets with slots, make sure to open a new + // snippet and start capturing slots + if ($slots === true) { + return static::begin($file, $data); + } + + // for snippets without slots, directly load and return + // the snippet's template file + return static::load($file, static::scope($data)); + } + + /** + * Absolute path to the file for + * the snippet/s taking snippets defined in plugins + * into account + */ + public static function file(string|array $name): string|null + { + $kirby = App::instance(); + $root = static::root(); + $names = A::wrap($name); + + foreach ($names as $name) { + $name = (string)$name; + $file = $root . '/' . $name . '.php'; + + if (file_exists($file) === false) { + $file = $kirby->extensions('snippets')[$name] ?? null; + } + + if ($file) { + break; + } + } + + return $file; + } + + /** + * Opens the snippet and starts output + * buffering to catch all slots in between + */ + public function open(): static + { + if (static::$current !== null) { + $this->parent = static::$current; + } + + $this->open = true; + static::$current = $this; + + ob_start(); + + return $this; + } + + /** + * Returns the parent snippet if it exists + */ + public function parent(): static|null + { + return $this->parent; + } + + /** + * Renders the snippet and passes the scope + * with all slots and data + */ + public function render(array $data = [], array $slots = []): string + { + // always make sure that the snippet + // is closed before it can be rendered + if ($this->open === true) { + $this->close(); + } + + // manually add slots + foreach ($slots as $slotName => $slotContent) { + $this->slots[$slotName] = new Slot($slotName, $slotContent); + } + + // custom data overrides for the data that was passed to the snippet instance + $data = array_replace_recursive($this->data, $data); + + return static::load($this->file, static::scope($data, $this->slots())); + } + + /** + * Returns the root directory for all + * snippet templates + */ + public static function root(): string + { + return App::instance()->root('snippets'); + } + + /** + * Starts a new slot with the given name + */ + public function slot(string $name = 'default'): Slot + { + $slot = new Slot($name); + $slot->open(); + + // start a new slot + $this->capture[] = $slot; + + return $slot; + } + + /** + * Returns the slots collection + */ + public function slots(): Slots + { + return new Slots($this->slots); + } + + /** + * Returns the data variables that get passed to a snippet + * + * @param \Kirby\Template\Slots|null $slots If null, an empty dummy object is used + */ + protected static function scope(array $data = [], Slots|null $slots = null): array + { + // initialize a dummy slots object and cache it for better performance + if ($slots === null) { + $slots = static::$dummySlots ??= new Slots([]); + } + + $data = array_merge(App::instance()->data, $data); + + // TODO 3.10: Replace the following code: + // if ( + // array_key_exists('slot', $data) === true || + // array_key_exists('slots', $data) === true + // ) { + // throw new InvalidArgumentException('Passing the $slot or $slots variables to snippets is not supported.'); + // } + // + // return array_merge($data, [ + // 'slot' => $slots->default, + // 'slots' => $slots, + // ]); + + // @codeCoverageIgnoreStart + if ( + array_key_exists('slot', $data) === true || + array_key_exists('slots', $data) === true + ) { + Helpers::deprecated('Passing the $slot or $slots variables to snippets is deprecated and will break in a future version.', 'snippet-pass-slots'); + } + // @codeCoverageIgnoreEnd + + return array_merge([ + 'slot' => $slots->default, + 'slots' => $slots, + ], $data); + } +} diff --git a/kirby/src/Cms/Template.php b/kirby/src/Template/Template.php similarity index 59% rename from kirby/src/Cms/Template.php rename to kirby/src/Template/Template.php index ee61cf4..a366ad8 100644 --- a/kirby/src/Cms/Template.php +++ b/kirby/src/Template/Template.php @@ -1,8 +1,9 @@ * @link https://getkirby.com * @copyright Bastian Allgeier @@ -20,38 +21,26 @@ class Template { /** * Global template data - * - * @var array */ - public static $data = []; - - /** - * The name of the template - * - * @var string - */ - protected $name; - - /** - * Template type (html, json, etc.) - * - * @var string - */ - protected $type; + public static array $data = []; /** * Default template type if no specific type is set - * - * @var string */ - protected $defaultType; + protected string $defaultType; + + /** + * The name of the template + */ + protected string $name; + + /** + * Template type (html, json, etc.) + */ + protected string $type; /** * Creates a new template object - * - * @param string $name - * @param string $type - * @param string $defaultType */ public function __construct(string $name, string $type = 'html', string $defaultType = 'html') { @@ -63,18 +52,22 @@ class Template /** * Converts the object to a simple string * This is used in template filters for example - * - * @return string */ public function __toString(): string { return $this->name; } + /** + * Returns the default template type + */ + public function defaultType(): string + { + return $this->defaultType; + } + /** * Checks if the template exists - * - * @return bool */ public function exists(): bool { @@ -87,75 +80,61 @@ class Template /** * Returns the expected template file extension - * - * @return string */ public function extension(): string { return 'php'; } - /** - * Returns the default template type - * - * @return string - */ - public function defaultType(): string - { - return $this->defaultType; - } - - /** - * Returns the place where templates are located - * in the site folder and and can be found in extensions - * - * @return string - */ - public function store(): string - { - return 'templates'; - } - /** * Detects the location of the template file * if it exists. - * - * @return string|null */ public function file(): string|null { + $name = $this->name(); + $extension = $this->extension(); + $store = $this->store(); + $root = $this->root(); + if ($this->hasDefaultType() === true) { try { // Try the default template in the default template directory. - return F::realpath($this->root() . '/' . $this->name() . '.' . $this->extension(), $this->root()); + return F::realpath($root . '/' . $name . '.' . $extension, $root); } catch (Exception) { // ignore errors, continue searching } // Look for the default template provided by an extension. - $path = App::instance()->extension($this->store(), $this->name()); + $path = App::instance()->extension($store, $name); if ($path !== null) { return $path; } } - $name = $this->name() . '.' . $this->type(); + $name .= '.' . $this->type(); try { // Try the template with type extension in the default template directory. - return F::realpath($this->root() . '/' . $name . '.' . $this->extension(), $this->root()); + return F::realpath($root . '/' . $name . '.' . $extension, $root); } catch (Exception) { // Look for the template with type extension provided by an extension. // This might be null if the template does not exist. - return App::instance()->extension($this->store(), $name); + return App::instance()->extension($store, $name); } } + /** + * Checks if the template uses the default type + */ + public function hasDefaultType(): bool + { + return $this->type() === $this->defaultType(); + } + /** * Returns the template name - * - * @return string */ public function name(): string { @@ -163,43 +142,67 @@ class Template } /** - * @param array $data - * @return string + * Renders the template with the given template data */ public function render(array $data = []): string { - return Tpl::load($this->file(), $data); + // if the template is rendered inside a snippet, + // we need to keep the "outside" snippet object + // to compare it later + $snippet = Snippet::$current; + + // load the template + $template = Tpl::load($this->file(), $data); + + // if last `endsnippet()` inside the current template + // has been omitted (= snippet was used as layout snippet), + // `Snippet::$current` will point to a snippet that was + // opened inside the template; if that snippet is the direct + // child of the snippet that was open before the template was + // rendered (which could be `null` if no snippet was open), + // take the buffer output from the template as default slot + // and render the snippet as final template output + if ( + Snippet::$current === null || + Snippet::$current->parent() !== $snippet + ) { + return $template; + } + + // no slots have been defined, but the template code + // should be used as default slot + if (Snippet::$current->slots()->count() === 0) { + return Snippet::$current->render($data, [ + 'default' => $template + ]); + } + + // let the snippet close and render natively + return Snippet::$current->render($data); } /** * Returns the root to the templates directory - * - * @return string */ public function root(): string { return App::instance()->root($this->store()); } + /** + * Returns the place where templates are located + * in the site folder and and can be found in extensions + */ + public function store(): string + { + return 'templates'; + } + /** * Returns the template type - * - * @return string */ public function type(): string { return $this->type; } - - /** - * Checks if the template uses the default type - * - * @return bool - */ - public function hasDefaultType(): bool - { - $type = $this->type(); - - return $type === null || $type === $this->defaultType(); - } } diff --git a/kirby/src/Text/KirbyTag.php b/kirby/src/Text/KirbyTag.php index be11a26..47b1214 100644 --- a/kirby/src/Text/KirbyTag.php +++ b/kirby/src/Text/KirbyTag.php @@ -148,6 +148,7 @@ class KirbyTag return $this->kirby()->file($path, null, true); } + /** * Returns the current Kirby instance */ diff --git a/kirby/src/Text/KirbyTags.php b/kirby/src/Text/KirbyTags.php index 6121552..9f0fe71 100644 --- a/kirby/src/Text/KirbyTags.php +++ b/kirby/src/Text/KirbyTags.php @@ -25,6 +25,9 @@ class KirbyTags array $data = [], array $options = [] ): string { + // make sure $text is a string + $text ??= ''; + $regex = '! (?=[^\]]) # positive lookahead that matches a group after the main expression without including ] in the result (?=\([a-z0-9_-]+:) # positive lookahead that requires starts with ( and lowercase ASCII letters, digits, underscores or hyphens followed with : immediately to the right of the current location @@ -40,7 +43,10 @@ class KirbyTags return KirbyTag::parse($match[0], $data, $options)->render(); } catch (InvalidArgumentException $e) { // stay silent in production and ignore non-existing tags - if ($debug !== true || Str::startsWith($e->getMessage(), 'Undefined tag type:') === true) { + if ( + $debug !== true || + Str::startsWith($e->getMessage(), 'Undefined tag type:') === true + ) { return $match[0]; } @@ -52,6 +58,6 @@ class KirbyTags return $match[0]; } - }, $text ?? ''); + }, $text); } } diff --git a/kirby/src/Text/Markdown.php b/kirby/src/Text/Markdown.php index ae49451..4d47eba 100644 --- a/kirby/src/Text/Markdown.php +++ b/kirby/src/Text/Markdown.php @@ -53,11 +53,10 @@ class Markdown */ public function parse(string|null $text = null, bool $inline = false): string { - if ($this->options['extra'] === true) { - $parser = new ParsedownExtra(); - } else { - $parser = new Parsedown(); - } + $parser = match ($this->options['extra']) { + true => new ParsedownExtra(), + default => new Parsedown() + }; $parser->setBreaksEnabled($this->options['breaks']); $parser->setSafeMode($this->options['safe']); diff --git a/kirby/src/Text/SmartyPants.php b/kirby/src/Text/SmartyPants.php index c87761b..661a057 100644 --- a/kirby/src/Text/SmartyPants.php +++ b/kirby/src/Text/SmartyPants.php @@ -110,7 +110,8 @@ class SmartyPants public function parse(string|null $text = null): string { // prepare the text - $text = str_replace('"', '"', $text ?? ''); + $text ??= ''; + $text = str_replace('"', '"', $text); // parse the text return $this->parser->transform($text); diff --git a/kirby/src/Toolkit/A.php b/kirby/src/Toolkit/A.php index 4097804..c3d1627 100644 --- a/kirby/src/Toolkit/A.php +++ b/kirby/src/Toolkit/A.php @@ -4,6 +4,7 @@ namespace Kirby\Toolkit; use Closure; use Exception; +use InvalidArgumentException; /** * The `A` class provides a set of handy methods @@ -47,6 +48,17 @@ class A return $array; } + /** + * Counts the number of elements in an array + * + * @param array $array + * @return int + */ + public static function count(array $array): int + { + return count($array); + } + /** * Gets an element of an array by key * @@ -114,9 +126,16 @@ class A // the element needs to exist and also needs to be an array; otherwise // we cannot find the remaining keys within it (invalid array structure) - if (isset($array[$currentKey]) === true && is_array($array[$currentKey]) === true) { + if ( + isset($array[$currentKey]) === true && + is_array($array[$currentKey]) === true + ) { // $keys only holds the remaining keys that have not been shifted off yet - return static::get($array[$currentKey], implode('.', $keys), $default); + return static::get( + $array[$currentKey], + implode('.', $keys), + $default + ); } } @@ -127,7 +146,11 @@ class A // if the input array uses a completely nested structure, // recursively progress layer by layer if (is_array($array[$firstKey]) === true) { - return static::get($array[$firstKey], implode('.', $keys), $default); + return static::get( + $array[$firstKey], + implode('.', $keys), + $default + ); } // the $firstKey element was found, but isn't an array, so we cannot @@ -138,6 +161,19 @@ class A return $default; } + /** + * Checks if array has a value + * + * @param array $array + * @param mixed $value + * @param bool $strict + * @return bool + */ + public static function has(array $array, $value, bool $strict = false): bool + { + return in_array($value, $array, $strict); + } + /** * Joins the elements of an array to a string */ @@ -146,9 +182,37 @@ class A if (is_string($value) === true) { return $value; } + return implode($separator, $value); } + /** + * Takes an array and makes it associative by an argument. + * If the argument is a callable, it will be used to map the array. + * If it is a string, it will be used as a key to pluck from the array. + * + * + * $array = [['id'=>1], ['id'=>2], ['id'=>3]]; + * $keyed = A::keyBy($array, 'id'); + * + * // Now you can access the array by the id + * + * + * @param array $array + * @param string|callable $keyBy + * @return array + */ + public static function keyBy(array $array, string|callable $keyBy): array + { + $keys = is_callable($keyBy) ? static::map($array, $keyBy) : static::pluck($array, $keyBy); + + if (count($keys) !== count($array)) { + throw new InvalidArgumentException('The "key by" argument must be a valid key or a callable'); + } + + return array_combine($keys, $array); + } + public const MERGE_OVERWRITE = 0; public const MERGE_APPEND = 1; public const MERGE_REPLACE = 2; @@ -251,6 +315,7 @@ class A public static function pluck(array $array, string $key): array { $output = []; + foreach ($array as $a) { if (isset($a[$key]) === true) { $output[] = $a[$key]; @@ -268,6 +333,19 @@ class A return $prepend + $array; } + /** + * Reduce an array to a single value + * + * @param array $array + * @param callable $callback + * @param mixed $initial + * @return mixed + */ + public static function reduce(array $array, callable $callback, $initial = null): mixed + { + return array_reduce($array, $callback, $initial); + } + /** * Shuffles an array and keeps the keys * @@ -304,6 +382,36 @@ class A return $new; } + + /** + * Returns a slice of an array + * + * @param array $array + * @param int $offset + * @param int|null $length + * @param bool $preserveKeys + * @return array + */ + public static function slice( + array $array, + int $offset, + int $length = null, + bool $preserveKeys = false + ): array { + return array_slice($array, $offset, $length, $preserveKeys); + } + + /** + * Sums an array + * + * @param array $array + * @return int|float + */ + public static function sum(array $array): int|float + { + return array_sum($array); + } + /** * Returns the first element of an array * @@ -391,17 +499,16 @@ class A * @param int $limit The number of elements the array should * contain after filling it up. * @param mixed $fill The element, which should be used to - * fill the array + * fill the array. If it's a callable, it + * will be called with the current index * @return array The filled-up result array */ public static function fill(array $array, int $limit, $fill = 'placeholder'): array { - if (count($array) < $limit) { - $diff = $limit - count($array); - for ($x = 0; $x < $diff; $x++) { - $array[] = $fill; - } + for ($x = count($array); $x < $limit; $x++) { + $array[] = is_callable($fill) ? $fill($x) : $fill; } + return $array; } @@ -467,13 +574,7 @@ class A */ public static function missing(array $array, array $required = []): array { - $missing = []; - foreach ($required as $r) { - if (isset($array[$r]) === false) { - $missing[] = $r; - } - } - return $missing; + return array_values(array_diff($required, array_keys($array))); } /** diff --git a/kirby/src/Toolkit/Collection.php b/kirby/src/Toolkit/Collection.php index 6710a4b..de5f6ea 100644 --- a/kirby/src/Toolkit/Collection.php +++ b/kirby/src/Toolkit/Collection.php @@ -1464,7 +1464,8 @@ Collection::$filters['date <='] = [ */ Collection::$filters['date between'] = Collection::$filters['date ..'] = [ 'validator' => function ($value, $test) { - return V::date($value, '>=', $test[0]) && - V::date($value, '<=', $test[1]); + return + V::date($value, '>=', $test[0]) && + V::date($value, '<=', $test[1]); } ]; diff --git a/kirby/src/Toolkit/Controller.php b/kirby/src/Toolkit/Controller.php index c20787e..62bdf0f 100644 --- a/kirby/src/Toolkit/Controller.php +++ b/kirby/src/Toolkit/Controller.php @@ -19,24 +19,18 @@ use ReflectionFunction; */ class Controller { - protected $function; - - public function __construct(Closure $function) + public function __construct(protected Closure $function) { - $this->function = $function; } public function arguments(array $data = []): array { $info = new ReflectionFunction($this->function); - $args = []; - foreach ($info->getParameters() as $parameter) { - $name = $parameter->getName(); - $args[] = $data[$name] ?? null; - } - - return $args; + return A::map( + $info->getParameters(), + fn ($parameter) => $data[$parameter->getName()] ?? null + ); } public function call($bind = null, $data = []) @@ -44,7 +38,7 @@ class Controller $args = $this->arguments($data); if ($bind === null) { - return call_user_func($this->function, ...$args); + return ($this->function)(...$args); } return $this->function->call($bind, ...$args); diff --git a/kirby/src/Toolkit/Dom.php b/kirby/src/Toolkit/Dom.php index fec17f2..cff7774 100644 --- a/kirby/src/Toolkit/Dom.php +++ b/kirby/src/Toolkit/Dom.php @@ -8,11 +8,11 @@ use DOMDocument; use DOMDocumentType; use DOMElement; use DOMNode; +use DOMNodeList; use DOMProcessingInstruction; use DOMText; use DOMXPath; use Kirby\Cms\App; -use Kirby\Exception\Exception; use Kirby\Exception\InvalidArgumentException; /** @@ -122,20 +122,16 @@ class Dom /** * Returns the HTML body if one exists - * - * @return \DOMElement|null */ - public function body() + public function body(): DOMElement|null { return $this->body ??= $this->query('/html/body')[0] ?? null; } /** * Returns the document object - * - * @return \DOMDocument */ - public function document() + public function document(): DOMDocument { return $this->doc; } @@ -143,9 +139,6 @@ class Dom /** * Extracts all URLs wrapped in a url() wrapper. E.g. for style attributes. * @internal - * - * @param string $value - * @return array */ public static function extractUrls(string $value): array { @@ -170,12 +163,12 @@ class Dom * Checks for allowed attributes according to the allowlist * @internal * - * @param \DOMAttr $attr - * @param array $options * @return true|string If not allowed, an error message is returned */ - public static function isAllowedAttr(DOMAttr $attr, array $options) - { + public static function isAllowedAttr( + DOMAttr $attr, + array $options + ): bool|string { $allowedTags = $options['allowedTags']; // check if the attribute is in the list of global allowed attributes @@ -218,12 +211,12 @@ class Dom * Checks for allowed attributes according to the global allowlist * @internal * - * @param \DOMAttr $attr - * @param array $options * @return true|string If not allowed, an error message is returned */ - public static function isAllowedGlobalAttr(DOMAttr $attr, array $options) - { + public static function isAllowedGlobalAttr( + DOMAttr $attr, + array $options + ): bool|string { $allowedAttrs = $options['allowedAttrs']; if ($allowedAttrs === true) { @@ -256,12 +249,12 @@ class Dom * Checks if the URL is acceptable for URL attributes * @internal * - * @param string $url - * @param array $options * @return true|string If not allowed, an error message is returned */ - public static function isAllowedUrl(string $url, array $options) - { + public static function isAllowedUrl( + string $url, + array $options + ): bool|string { $url = Str::lower($url); // allow empty URL values @@ -393,8 +386,6 @@ class Dom * Otherwise DOMDocument won't be available and the Dom cannot * work at all. * - * @return bool - * * @codeCoverageIgnore */ public static function isSupported(): bool @@ -404,9 +395,6 @@ class Dom /** * Returns the XML or HTML markup contained in the node - * - * @param \DOMNode $node - * @return string */ public function innerMarkup(DOMNode $node): string { @@ -425,20 +413,19 @@ class Dom * the allowed namespaces * @internal * - * @param array $list - * @param \DOMNode $node * @param array $options See `Dom::sanitize()` * @param \Closure|null Comparison callback that returns whether the expected and real name match * @return string|false Matched name in the list or `false` */ - public static function listContainsName(array $list, DOMNode $node, array $options, Closure|null $compare = null) - { + public static function listContainsName( + array $list, + DOMNode $node, + array $options, + Closure|null $compare = null + ): string|false { $allowedNamespaces = $options['allowedNamespaces']; $localName = $node->localName; - - if ($compare === null) { - $compare = fn ($expected, $real): bool => $expected === $real; - } + $compare ??= fn ($expected, $real): bool => $expected === $real; // if the configuration does not define namespace URIs or if the // currently checked node is from the special `xml:` namespace @@ -477,13 +464,19 @@ class Dom } // try if we can find an exact namespaced match - if ($namespaceUri === $node->namespaceURI && $compare($itemLocal, $localName) === true) { + if ( + $namespaceUri === $node->namespaceURI && + $compare($itemLocal, $localName) === true + ) { return $item; } // also try to match the fully-qualified name // if the document doesn't define the namespace - if ($node->namespaceURI === null && $compare($item, $node->nodeName) === true) { + if ( + $node->namespaceURI === null && + $compare($item, $node->nodeName) === true + ) { return $item; } } @@ -493,9 +486,6 @@ class Dom /** * Removes a node from the document - * - * @param \DOMNode $node - * @return void */ public static function remove(DOMNode $node): void { @@ -505,12 +495,12 @@ class Dom /** * Executes an XPath query in the document * - * @param string $query * @param \DOMNode|null $node Optional context node for relative queries - * @return \DOMNodeList|false */ - public function query(string $query, ?DOMNode $node = null) - { + public function query( + string $query, + DOMNode|null $node = null + ): DOMNodeList|false { return (new DOMXPath($this->doc))->query($query, $node); } @@ -605,7 +595,6 @@ class Dom * is exported with an XML declaration/ * full HTML markup even if the input * didn't have them - * @return string */ public function toString(bool $normalize = false): string { @@ -626,9 +615,6 @@ class Dom /** * Removes a node from the document but keeps its children * by moving them one level up - * - * @param \DOMNode $node - * @return void */ public static function unwrap(DOMNode $node): void { @@ -651,7 +637,6 @@ class Dom * @param bool $normalize If set to `true`, the document * is exported with full HTML markup * even if the input didn't have it - * @return string */ protected function exportHtml(bool $normalize = false): string { @@ -660,7 +645,7 @@ class Dom $metaTag = $this->doc->createElement('meta'); $metaTag->setAttribute('http-equiv', 'Content-Type'); $metaTag->setAttribute('content', 'text/html; charset=utf-8'); - $metaTag->setAttribute('id', $metaId = Str::random(10)); + $metaTag->setAttribute('id', Str::random(10)); $this->doc->insertBefore($metaTag, $this->doc->documentElement); if ( @@ -691,11 +676,13 @@ class Dom * @param bool $normalize If set to `true`, the document * is exported with an XML declaration * even if the input didn't have it - * @return string */ protected function exportXml(bool $normalize = false): string { - if (Str::contains($this->code, 'code, 'doc->encoding === null) { - $this->doc->encoding = 'UTF-8'; - } + $this->doc->encoding ??= 'UTF-8'; return trim($this->doc->saveXML()); } @@ -719,13 +704,14 @@ class Dom /** * Sanitizes an attribute * - * @param \DOMAttr $attr * @param array $options See `Dom::sanitize()` * @param array $errors Array to store additional errors in by reference - * @return void */ - protected function sanitizeAttr(DOMAttr $attr, array $options, array &$errors): void - { + protected function sanitizeAttr( + DOMAttr $attr, + array $options, + array &$errors + ): void { $element = $attr->ownerElement; $name = $attr->nodeName; $value = $attr->value; @@ -767,13 +753,14 @@ class Dom /** * Sanitizes the doctype * - * @param \DOMDocumentType $doctype * @param array $options See `Dom::sanitize()` * @param array $errors Array to store additional errors in by reference - * @return void */ - protected function sanitizeDoctype(DOMDocumentType $doctype, array $options, array &$errors): void - { + protected function sanitizeDoctype( + DOMDocumentType $doctype, + array $options, + array &$errors + ): void { try { $this->validateDoctype($doctype, $options); } catch (InvalidArgumentException $e) { @@ -785,13 +772,14 @@ class Dom /** * Sanitizes a single DOM element and its attribute * - * @param \DOMElement $element * @param array $options See `Dom::sanitize()` * @param array $errors Array to store additional errors in by reference - * @return void */ - protected function sanitizeElement(DOMElement $element, array $options, array &$errors): void - { + protected function sanitizeElement( + DOMElement $element, + array $options, + array &$errors + ): void { $name = $element->nodeName; // check defined namespaces (`xmlns` attributes); @@ -867,13 +855,14 @@ class Dom /** * Sanitizes a single XML processing instruction * - * @param \DOMProcessingInstruction $pi * @param array $options See `Dom::sanitize()` * @param array $errors Array to store additional errors in by reference - * @return void */ - protected function sanitizePI(DOMProcessingInstruction $pi, array $options, array &$errors): void - { + protected function sanitizePI( + DOMProcessingInstruction $pi, + array $options, + array &$errors + ): void { $name = $pi->nodeName; // check for allow-listed processing instructions @@ -889,15 +878,18 @@ class Dom /** * Validates the document type * - * @param \DOMDocumentType $doctype * @param array $options See `Dom::sanitize()` - * @return void * * @throws \Kirby\Exception\InvalidArgumentException If the doctype is not valid */ - protected function validateDoctype(DOMDocumentType $doctype, array $options): void - { - if (empty($doctype->publicId) === false || empty($doctype->systemId) === false) { + protected function validateDoctype( + DOMDocumentType $doctype, + array $options + ): void { + if ( + empty($doctype->publicId) === false || + empty($doctype->systemId) === false + ) { throw new InvalidArgumentException('The doctype must not reference external files'); } diff --git a/kirby/src/Toolkit/Escape.php b/kirby/src/Toolkit/Escape.php index 9333a65..8b62259 100644 --- a/kirby/src/Toolkit/Escape.php +++ b/kirby/src/Toolkit/Escape.php @@ -25,10 +25,8 @@ class Escape { /** * The internal singleton escaper instance - * - * @var \Laminas\Escaper\Escaper */ - protected static $escaper; + protected static Escaper|null $escaper; /** * Escape common HTML attributes data @@ -44,11 +42,8 @@ class Escape *
    content
    *
    content
    *
    content
    - * - * @param string $string - * @return string */ - public static function attr($string) + public static function attr(string $string): string { return static::escaper()->escapeHtmlAttr($string); } @@ -65,21 +60,16 @@ class Escape * * * text - * - * @param string $string - * @return string */ - public static function css($string) + public static function css(string $string): string { return static::escaper()->escapeCss($string); } /** * Get the escaper instance (and create if needed) - * - * @return \Laminas\Escaper\Escaper */ - protected static function escaper() + protected static function escaper(): Escaper { return static::$escaper ??= new Escaper('utf-8'); } @@ -95,11 +85,8 @@ class Escape * * ...ESCAPE UNTRUSTED DATA BEFORE PUTTING HERE... *
    ...ESCAPE UNTRUSTED DATA BEFORE PUTTING HERE...
    - * - * @param string $string - * @return string */ - public static function html($string) + public static function html(string $string): string { return static::escaper()->escapeHtml($string); } @@ -113,11 +100,8 @@ class Escape * * *
    - * - * @param string $string - * @return string */ - public static function js($string) + public static function js(string $string): string { return static::escaper()->escapeJs($string); } @@ -129,11 +113,8 @@ class Escape * This should not be used to escape an entire URI. * * link - * - * @param string $string - * @return string */ - public static function url($string) + public static function url(string $string): string { return rawurlencode($string); } @@ -151,11 +132,8 @@ class Escape * & is replaced with & * < is replaced with < * > is replaced with > - * - * @param string $string - * @return string */ - public static function xml($string) + public static function xml(string $string): string { return htmlspecialchars($string, ENT_QUOTES | ENT_XML1, 'UTF-8'); } diff --git a/kirby/src/Toolkit/Html.php b/kirby/src/Toolkit/Html.php index 5050958..1b1e320 100644 --- a/kirby/src/Toolkit/Html.php +++ b/kirby/src/Toolkit/Html.php @@ -19,17 +19,13 @@ class Html extends Xml { /** * An internal store for an HTML entities translation table - * - * @var array */ - public static $entities; + public static array|null $entities; /** * List of HTML tags that can be used inline - * - * @var array */ - public static $inlineList = [ + public static array $inlineList = [ 'b', 'i', 'small', @@ -144,6 +140,11 @@ class Html extends Xml return $value === true ? strtolower($name) : null; } + // HTML attribute names are case-insensitive + if (is_string($name) === true) { + $name = strtolower($name); + } + // all other cases can share the XML variant $attr = parent::attr($name, $value); @@ -375,7 +376,7 @@ class Html extends Xml return trim($rel . ' noopener noreferrer', ' '); } - return $rel; + return $rel ?: null; } /** @@ -389,13 +390,11 @@ class Html extends Xml * @param int $level Indentation level * @return string The generated HTML */ - public static function tag(string $name, $content = '', array $attr = null, string $indent = null, int $level = 0): string + public static function tag(string $name, $content = '', array $attr = [], string $indent = null, int $level = 0): string { // treat an explicit `null` value as an empty tag // as void tags are already covered below - if ($content === null) { - $content = ''; - } + $content ??= ''; // force void elements to be self-closing if (static::isVoid($name) === true) { @@ -629,7 +628,7 @@ class Html extends Xml } // build the full video src URL - $src = $src . $query->toString(true); + $src .= $query->toString(true); // render the iframe return static::iframe($src, static::videoAttr($attr)); diff --git a/kirby/src/Toolkit/I18n.php b/kirby/src/Toolkit/I18n.php index cfd37db..f5a6ef0 100644 --- a/kirby/src/Toolkit/I18n.php +++ b/kirby/src/Toolkit/I18n.php @@ -41,7 +41,7 @@ class I18n * The fallback locale or a * list of fallback locales * - * @var string|array|\Closure + * @var string|array|\Closure|null */ public static $fallback = ['en']; @@ -54,8 +54,6 @@ class I18n /** * Returns the list of fallback locales - * - * @return array */ public static function fallbacks(): array { @@ -77,9 +75,7 @@ class I18n * Returns singular or plural * depending on the given number * - * @param int $count * @param bool $none If true, 'none' will be returned if the count is 0 - * @return string */ public static function form(int $count, bool $none = false): string { @@ -92,23 +88,17 @@ class I18n /** * Formats a number - * - * @param int|float $number - * @param string $locale - * @return string */ - public static function formatNumber($number, string $locale = null): string + public static function formatNumber(int|float $number, string $locale = null): string { - $locale ??= static::locale(); - $formatter = static::decimalNumberFormatter($locale); - $number = $formatter?->format($number) ?? $number; + $locale ??= static::locale(); + $formatter = static::decimalNumberFormatter($locale); + $number = $formatter?->format($number) ?? $number; return (string)$number; } /** * Returns the locale code - * - * @return string */ public static function locale(): string { @@ -126,25 +116,22 @@ class I18n /** * Translates a given message * according to the currently set locale - * - * @param string|array $key - * @param string|array|null $fallback - * @param string|null $locale - * @return string|array|null */ - public static function translate($key, $fallback = null, string $locale = null) - { + public static function translate( + string|array|null $key, + string|array $fallback = null, + string $locale = null + ): string|array|Closure|null { $locale ??= static::locale(); if (is_array($key) === true) { // try to use actual locale - if (isset($key[$locale]) === true) { - return $key[$locale]; + if ($result = $key[$locale] ?? null) { + return $result; } // try to use language code, e.g. `es` when locale is `es_ES` - $lang = Str::before($locale, '_'); - if (isset($key[$lang]) === true) { - return $key[$lang]; + if ($result = $key[Str::before($locale, '_')] ?? null) { + return $result; } // use global wildcard as i18n key if (isset($key['*']) === true) { @@ -152,16 +139,18 @@ class I18n } // use fallback if (is_array($fallback) === true) { - return $fallback[$locale] ?? - $fallback['en'] ?? - reset($fallback); + return + $fallback[$locale] ?? + $fallback['en'] ?? + reset($fallback); } return $fallback; } - if ($translation = static::translation($locale)[$key] ?? null) { - return $translation; + // $key is a string + if ($result = static::translation($locale)[$key] ?? null) { + return $result; } if ($fallback !== null) { @@ -174,8 +163,8 @@ class I18n continue; } - if ($translation = static::translation($fallback)[$key] ?? null) { - return $translation; + if ($result = static::translation($fallback)[$key] ?? null) { + return $result; } } @@ -192,8 +181,12 @@ class I18n * @param string|null $locale * @return string */ - public static function template(string $key, $fallback = null, array|null $replace = null, string|null $locale = null): string - { + public static function template( + string $key, + string|array $fallback = null, + array|null $replace = null, + string|null $locale = null + ): string { if (is_array($fallback) === true) { $replace = $fallback; $fallback = null; @@ -271,11 +264,7 @@ class I18n * defined, the template that is defined last in the translation array is used * - Translation is a callback with a `$count` argument: Returns the callback return value * - * @param string $key - * @param int $count - * @param string|null $locale * @param bool $formatNumber If set to `false`, the count is not formatted - * @return mixed */ public static function translateCount(string $key, int $count, string $locale = null, bool $formatNumber = true) { diff --git a/kirby/src/Toolkit/Iterator.php b/kirby/src/Toolkit/Iterator.php index 0ddceb0..f19ccf3 100644 --- a/kirby/src/Toolkit/Iterator.php +++ b/kirby/src/Toolkit/Iterator.php @@ -16,23 +16,20 @@ use IteratorAggregate; * @copyright Bastian Allgeier * @license https://opensource.org/licenses/MIT * - * @psalm-suppress MissingTemplateParam Implementing template params in this class would - * require implementing them throughout the code base - * https://github.com/getkirby/kirby/pull/4886#pullrequestreview-1203577545 + * @psalm-suppress MissingTemplateParam Implementing template params + * in this class would require + * implementing them throughout + * the code base: https://github.com/getkirby/kirby/pull/4886#pullrequestreview-1203577545 */ class Iterator implements IteratorAggregate { /** * The data array - * - * @var array */ - public $data = []; + public array $data = []; /** * Constructor - * - * @param array $data */ public function __construct(array $data = []) { @@ -41,8 +38,6 @@ class Iterator implements IteratorAggregate /** * Get an iterator for the items. - * - * @return \ArrayIterator */ public function getIterator(): ArrayIterator { @@ -51,18 +46,14 @@ class Iterator implements IteratorAggregate /** * Returns the current key - * - * @return string */ - public function key() + public function key(): int|string|null { return key($this->data); } /** * Returns an array of all keys - * - * @return array */ public function keys(): array { @@ -71,8 +62,6 @@ class Iterator implements IteratorAggregate /** * Returns the current element - * - * @return mixed */ public function current() { @@ -82,8 +71,6 @@ class Iterator implements IteratorAggregate /** * Moves the cursor to the previous element * and returns it - * - * @return mixed */ public function prev() { @@ -93,8 +80,6 @@ class Iterator implements IteratorAggregate /** * Moves the cursor to the next element * and returns it - * - * @return mixed */ public function next() { @@ -104,15 +89,13 @@ class Iterator implements IteratorAggregate /** * Moves the cursor to the first element */ - public function rewind() + public function rewind(): void { reset($this->data); } /** * Checks if the current element is valid - * - * @return bool */ public function valid(): bool { @@ -121,8 +104,6 @@ class Iterator implements IteratorAggregate /** * Counts all elements - * - * @return int */ public function count(): int { @@ -135,7 +116,7 @@ class Iterator implements IteratorAggregate * @param mixed $needle the element to search for * @return int|false the index (int) of the element or false */ - public function indexOf($needle) + public function indexOf($needle): int|false { return array_search($needle, array_values($this->data)); } @@ -144,9 +125,9 @@ class Iterator implements IteratorAggregate * Tries to find the key for the given element * * @param mixed $needle the element to search for - * @return string|false the name of the key or false + * @return int|string|false the name of the key or false */ - public function keyOf($needle) + public function keyOf($needle): int|string|false { return array_search($needle, $this->data); } @@ -155,18 +136,16 @@ class Iterator implements IteratorAggregate * Checks by key if an element is included * * @param mixed $key - * @return bool */ public function has($key): bool { - return isset($this->data[$key]); + return isset($this->data[$key]) === true; } /** * Checks if the current key is set * * @param mixed $key the key to check - * @return bool */ public function __isset($key): bool { @@ -175,8 +154,6 @@ class Iterator implements IteratorAggregate /** * Simplified var_dump output - * - * @return array */ public function __debugInfo(): array { diff --git a/kirby/src/Toolkit/Locale.php b/kirby/src/Toolkit/Locale.php index f8e6143..9380d07 100644 --- a/kirby/src/Toolkit/Locale.php +++ b/kirby/src/Toolkit/Locale.php @@ -28,25 +28,17 @@ class Locale /** * Converts a normalized locale array to an array with the * locale constants replaced with their string representations - * - * @param array $locale - * @return array */ public static function export(array $locale): array { + $return = []; $constants = static::supportedConstants(true); // replace the keys in the locale data array with the locale names - $return = []; foreach ($locale as $key => $value) { - if (isset($constants[$key]) === true) { - // the key is a valid constant, - // replace it with its string representation - $return[$constants[$key]] = $value; - } else { - // not found, keep it as-is - $return[$key] = $value; - } + // use string representation for key + // if it is a valid constant + $return[$constants[$key] ?? $key] = $value; } return $return; @@ -63,7 +55,7 @@ class Locale * @throws \Kirby\Exception\Exception If the locale cannot be determined * @throws \Kirby\Exception\InvalidArgumentException If the provided locale category is invalid */ - public static function get($category = LC_ALL) + public static function get(int|string $category = LC_ALL): array|string { $normalizedCategory = static::normalizeConstant($category); @@ -105,11 +97,10 @@ class Locale * string keys to a normalized constant => value array * * @param array|string $locale - * @return array */ public static function normalize($locale): array { - if (is_array($locale)) { + if (is_array($locale) === true) { // replace string constant keys with the constant values $convertedLocale = []; foreach ($locale as $key => $value) { @@ -129,11 +120,8 @@ class Locale /** * Sets the PHP locale with a locale string or * an array with constant or string keys - * - * @param array|string $locale - * @return void */ - public static function set($locale): void + public static function set(array|string $locale): void { $locale = static::normalize($locale); @@ -154,13 +142,13 @@ class Locale /** * Tries to convert an `LC_*` constant name * to its constant value - * - * @param int|string $constant - * @return int|string */ - protected static function normalizeConstant($constant) + protected static function normalizeConstant(int|string $constant): int|string { - if (is_string($constant) === true && Str::startsWith($constant, 'LC_') === true) { + if ( + is_string($constant) === true && + Str::startsWith($constant, 'LC_') === true + ) { return constant($constant); } @@ -173,7 +161,6 @@ class Locale * that are actually supported on this system * * @param bool $withAll If set to `true`, `LC_ALL` is returned as well - * @return array */ protected static function supportedConstants(bool $withAll = false): array { diff --git a/kirby/src/Toolkit/Obj.php b/kirby/src/Toolkit/Obj.php index 65dcc84..635224d 100644 --- a/kirby/src/Toolkit/Obj.php +++ b/kirby/src/Toolkit/Obj.php @@ -19,8 +19,6 @@ class Obj extends stdClass { /** * Constructor - * - * @param array $data */ public function __construct(array $data = []) { @@ -31,10 +29,6 @@ class Obj extends stdClass /** * Magic getter - * - * @param string $property - * @param array $arguments - * @return mixed */ public function __call(string $property, array $arguments) { @@ -43,8 +37,6 @@ class Obj extends stdClass /** * Improved `var_dump` output - * - * @return array */ public function __debugInfo(): array { @@ -53,9 +45,6 @@ class Obj extends stdClass /** * Magic property getter - * - * @param string $property - * @return mixed */ public function __get(string $property) { @@ -65,19 +54,15 @@ class Obj extends stdClass /** * Gets one or multiple properties of the object * - * @param string|array $property * @param mixed $fallback If multiple properties are requested: * Associative array of fallback values per key - * @return mixed */ - public function get($property, $fallback = null) + public function get(string|array $property, $fallback = null) { if (is_array($property)) { - if ($fallback === null) { - $fallback = []; - } + $fallback ??= []; - if (!is_array($fallback)) { + if (is_array($fallback) === false) { throw new InvalidArgumentException('The fallback value must be an array when getting multiple properties'); } @@ -93,8 +78,6 @@ class Obj extends stdClass /** * Converts the object to an array - * - * @return array */ public function toArray(): array { @@ -116,9 +99,6 @@ class Obj extends stdClass /** * Converts the object to a json string - * - * @param mixed ...$arguments - * @return string */ public function toJson(...$arguments): string { diff --git a/kirby/src/Toolkit/Pagination.php b/kirby/src/Toolkit/Pagination.php index b40e44e..ea29503 100644 --- a/kirby/src/Toolkit/Pagination.php +++ b/kirby/src/Toolkit/Pagination.php @@ -389,9 +389,7 @@ class Pagination // ensure that page is set to something, otherwise // generate "default page" based on other params - if ($this->page === null) { - $this->page = $this->firstPage(); - } + $this->page ??= $this->firstPage(); // allow a page value of 1 even if there are no pages; // otherwise the exception will get thrown for this pretty common case diff --git a/kirby/src/Toolkit/Query.php b/kirby/src/Toolkit/Query.php index 8a65c46..58e48d5 100644 --- a/kirby/src/Toolkit/Query.php +++ b/kirby/src/Toolkit/Query.php @@ -3,6 +3,7 @@ namespace Kirby\Toolkit; use Closure; +use Kirby\Cms\Helpers; use Kirby\Exception\BadMethodCallException; use Kirby\Exception\InvalidArgumentException; @@ -18,7 +19,6 @@ use Kirby\Exception\InvalidArgumentException; * @license https://opensource.org/licenses/MIT * * @deprecated 3.8.2 Use `Kirby\Query\Query` instead - * // TODO: throw warnings in 3.9.0 * // TODO: Remove in 3.10.0 */ class Query @@ -57,6 +57,8 @@ class Query { $this->query = $query; $this->data = $data; + + Helpers::deprecated('The `Toolkit\Query` class has been deprecated and will be removed in a future version. Use `Query\Query` instead: Kirby\Query\Query::factory($query)->resolve($data).', 'toolkit-query-class'); } /** diff --git a/kirby/src/Toolkit/Silo.php b/kirby/src/Toolkit/Silo.php index f8374d4..ff1e9f2 100644 --- a/kirby/src/Toolkit/Silo.php +++ b/kirby/src/Toolkit/Silo.php @@ -15,19 +15,12 @@ namespace Kirby\Toolkit; */ class Silo { - /** - * @var array - */ public static $data = []; /** - * Setter for new data. - * - * @param string|array $key - * @param mixed $value - * @return array + * Setter for new data */ - public static function set($key, $value = null): array + public static function set(string|array $key, $value = null): array { if (is_array($key) === true) { return static::$data = array_merge(static::$data, $key); @@ -37,12 +30,7 @@ class Silo return static::$data; } - /** - * @param string|array $key - * @param mixed $default - * @return mixed - */ - public static function get($key = null, $default = null) + public static function get(string|array $key = null, $default = null) { if ($key === null) { return static::$data; @@ -53,9 +41,6 @@ class Silo /** * Removes an item from the data array - * - * @param string|null $key - * @return array */ public static function remove(string $key = null): array { diff --git a/kirby/src/Toolkit/Str.php b/kirby/src/Toolkit/Str.php index f356f1e..e2d2559 100644 --- a/kirby/src/Toolkit/Str.php +++ b/kirby/src/Toolkit/Str.php @@ -25,17 +25,13 @@ class Str { /** * Language translation table - * - * @var array */ - public static $language = []; + public static array $language = []; /** * Ascii translation table - * - * @var array */ - public static $ascii = [ + public static array $ascii = [ '/°|₀/' => '0', '/¹|₁/' => '1', '/²|₂/' => '2', @@ -117,10 +113,8 @@ class Str /** * Default settings for class methods - * - * @var array */ - public static $defaults = [ + public static array $defaults = [ 'slug' => [ 'separator' => '-', 'allowed' => 'a-z0-9' @@ -130,9 +124,6 @@ class Str /** * Parse accepted values and their quality from an * accept string like an Accept or Accept-Language header - * - * @param string $input - * @return array */ public static function accepted(string $input): array { @@ -174,11 +165,6 @@ class Str /** * Returns the rest of the string after the given substring or character - * - * @param string $string - * @param string $needle - * @param bool $caseInsensitive - * @return string */ public static function after(string $string, string $needle, bool $caseInsensitive = false): string { @@ -192,13 +178,9 @@ class Str } /** - * Removes the given substring or character only from the start of the string + * Removes the given substring or character + * only from the start of the string * @since 3.7.0 - * - * @param string $string - * @param string $needle - * @param bool $caseInsensitive - * @return string */ public static function afterStart(string $string, string $needle, bool $caseInsensitive = false): string { @@ -215,9 +197,6 @@ class Str /** * Convert a string to 7-bit ASCII. - * - * @param string $string - * @return string */ public static function ascii(string $string): string { @@ -238,11 +217,6 @@ class Str /** * Returns the beginning of a string before the given substring or character - * - * @param string $string - * @param string $needle - * @param bool $caseInsensitive - * @return string */ public static function before(string $string, string $needle, bool $caseInsensitive = false): string { @@ -258,11 +232,6 @@ class Str /** * Removes the given substring or character only from the end of the string * @since 3.7.0 - * - * @param string $string - * @param string $needle - * @param bool $caseInsensitive - * @return string */ public static function beforeEnd(string $string, string $needle, bool $caseInsensitive = false): string { @@ -279,11 +248,6 @@ class Str /** * Returns everything between two strings from the first occurrence of a given string - * - * @param string $string - * @param string $start - * @param string $end - * @return string */ public static function between(string $string = null, string $start, string $end): string { @@ -294,7 +258,6 @@ class Str * Converts a string to camel case * * @param string $value The string to convert - * @return string */ public static function camel(string $value = null): string { @@ -303,11 +266,6 @@ class Str /** * Checks if a str contains another string - * - * @param string $string - * @param string $needle - * @param bool $caseInsensitive - * @return bool */ public static function contains(string $string = null, string $needle, bool $caseInsensitive = false): bool { @@ -323,12 +281,9 @@ class Str * Convert timestamp to date string * according to locale settings * - * @param int|null $time - * @param string|\IntlDateFormatter|null $format * @param string $handler date, intl or strftime - * @return string|int */ - public static function date(int|null $time = null, $format = null, string $handler = 'date') + public static function date(int|null $time = null, string|IntlDateFormatter $format = null, string $handler = 'date'): string|int|false { if (is_null($format) === true) { return $time; @@ -365,18 +320,11 @@ class Str /** * Converts a string to a different encoding - * - * @param string $string - * @param string $targetEncoding - * @param string $sourceEncoding (optional) - * @return string */ - public static function convert($string, $targetEncoding, $sourceEncoding = null) + public static function convert(string $string, string $targetEncoding, string $sourceEncoding = null): string { // detect the source encoding if not passed as third argument - if ($sourceEncoding === null) { - $sourceEncoding = static::encoding($string); - } + $sourceEncoding ??= static::encoding($string); // no need to convert if the target encoding is the same if (strtolower($sourceEncoding) === strtolower($targetEncoding)) { @@ -388,9 +336,6 @@ class Str /** * Encode a string (used for email addresses) - * - * @param string $string - * @return string */ public static function encode(string $string): string { @@ -407,22 +352,18 @@ class Str /** * Tries to detect the string encoding - * - * @param string $string - * @return string */ public static function encoding(string $string): string { - return mb_detect_encoding($string, 'UTF-8, ISO-8859-1, windows-1251', true); + return mb_detect_encoding( + $string, + 'UTF-8, ISO-8859-1, windows-1251', + true + ); } /** * Checks if a string ends with the passed needle - * - * @param string $string - * @param string $needle - * @param bool $caseInsensitive - * @return bool */ public static function endsWith(string $string = null, string $needle, bool $caseInsensitive = false): bool { @@ -499,11 +440,8 @@ class Str /** * Convert the value to a float with a decimal * point, no matter what the locale setting is - * - * @param string|int|float $value - * @return string */ - public static function float($value): string + public static function float(string|int|float|null $value): string { // make sure $value is not null $value ??= ''; @@ -520,11 +458,6 @@ class Str /** * Returns the rest of the string starting from the given character - * - * @param string $string - * @param string $needle - * @param bool $caseInsensitive - * @return string */ public static function from(string $string, string $needle, bool $caseInsensitive = false): string { @@ -542,9 +475,7 @@ class Str * @since 3.7.0 * * @param string $string The string to increment - * @param string $separator * @param int $first Starting number - * @return string */ public static function increment(string $string, string $separator = '-', int $first = 1): string { @@ -561,9 +492,6 @@ class Str /** * Convert a string to kebab case. - * - * @param string $value - * @return string */ public static function kebab(string $value = null): string { @@ -572,9 +500,6 @@ class Str /** * A UTF-8 safe version of strlen() - * - * @param string $string - * @return int */ public static function length(string $string = null): int { @@ -583,9 +508,6 @@ class Str /** * A UTF-8 safe version of strtolower() - * - * @param string $string - * @return string */ public static function lower(string $string = null): string { @@ -594,25 +516,60 @@ class Str /** * Safe ltrim alternative - * - * @param string $string - * @param string $trim - * @return string */ public static function ltrim(string $string, string $trim = ' '): string { return preg_replace('!^(' . preg_quote($trim) . ')+!', '', $string); } + /** + * Match string against a regular expression and return matches + * + * @param string $string The string to match + * @param string $pattern The regular expression + * @param int $flags Optional flags for PHP `preg_match()` + * @param int $offset Positional offset in the string to start the search + * @return array|null The matches or null if no match was found + */ + public static function match(string $string, string $pattern, int $flags = 0, int $offset = 0): ?array + { + $result = preg_match($pattern, $string, $matches, $flags, $offset); + return ($result === 1) ? $matches : null; + } + + /** + * Check whether a string matches a regular expression + * + * @param string $string The string to match + * @param string $pattern The regular expression + * @param int $flags Optional flags for PHP `preg_match()` + * @param int $offset Positional offset in the string to start the search + * @return bool True if the string matches the pattern + */ + public static function matches(string $string, string $pattern, int $flags = 0, int $offset = 0): bool + { + return static::match($string, $pattern, $flags, $offset) !== null; + } + + /** + * Match string against a regular expression and return all matches + * + * @param string $string The string to match + * @param string $pattern The regular expression + * @param int $flags Optional flags for PHP `preg_match_all()` + * @param int $offset Positional offset in the string to start the search + * @return array|null The matches or null if no match was found + */ + public static function matchAll(string $string, string $pattern, int $flags = 0, int $offset = 0): ?array + { + $result = preg_match_all($pattern, $string, $matches, $flags, $offset); + return ($result > 0) ? $matches : null; + } /** * Get a character pool with various possible combinations - * - * @param string|array $type - * @param bool $array - * @return string|array */ - public static function pool($type, bool $array = true) + public static function pool(string|array $type, bool $array = true): string|array { $pool = []; @@ -638,12 +595,9 @@ class Str * Returns the position of a needle in a string * if it can be found * - * @param string $string - * @param string $needle - * @param bool $caseInsensitive - * @return int|bool + * @throws \Kirby\Exception\InvalidArgumentException for empty $needle */ - public static function position(string $string = null, string $needle, bool $caseInsensitive = false) + public static function position(string $string = null, string $needle, bool $caseInsensitive = false): int|bool { if ($needle === '') { throw new InvalidArgumentException('The needle must not be empty'); @@ -660,10 +614,6 @@ class Str /** * Runs a string query. * Check out the Query class for more information. - * - * @param string $query - * @param array $data - * @return string|null */ public static function query(string $query, array $data = []) { @@ -675,15 +625,11 @@ class Str * * @param int $length The length of the random string * @param string $type Pool type (type of allowed characters) - * @return string */ - public static function random(int $length = null, string $type = 'alphaNum') + public static function random(int $length = null, string $type = 'alphaNum'): string|false { - if ($length === null) { - $length = random_int(5, 10); - } - - $pool = static::pool($type, false); + $length ??= random_int(5, 10); + $pool = static::pool($type, false); // catch invalid pools if (!$pool) { @@ -883,10 +829,17 @@ class Str * * @return string The filled-in and partially escaped string */ - public static function safeTemplate(string $string = null, array $data = [], array $options = []): string - { - $callback = ($options['callback'] ?? null) instanceof Closure ? $options['callback'] : null; + public static function safeTemplate( + string $string = null, + array $data = [], + array $options = [] + ): string { $fallback = $options['fallback'] ?? null; + $callback = $options['callback'] ?? null; + + if ($callback instanceof Closure === false) { + $callback = null; + } // replace and escape $string = static::template($string, $data, [ @@ -957,8 +910,7 @@ class Str * @author Based on the work of Antal Áron * @copyright Original Copyright (c) 2017, Antal Áron * @license https://github.com/antalaron/mb-similar-text/blob/master/LICENSE MIT License - * @param string $first - * @param string $second + * * @param bool $caseInsensitive If `true`, strings are compared case-insensitively * @return array matches: Number of matching chars in both strings * percent: Similarity in percent @@ -1033,8 +985,12 @@ class Str * @param int $maxlength The maximum length of the slug * @return string The safe string */ - public static function slug(string $string = null, string $separator = null, string $allowed = null, int $maxlength = 128): string - { + public static function slug( + string $string = null, + string $separator = null, + string $allowed = null, + int $maxlength = 128 + ): string { $separator ??= static::$defaults['slug']['separator']; $allowed ??= static::$defaults['slug']['allowed']; @@ -1063,10 +1019,6 @@ class Str /** * Convert a string to snake case. - * - * @param string $value - * @param string $delimiter - * @return string */ public static function snake(string $value = null, string $delimiter = '_'): string { @@ -1088,7 +1040,7 @@ class Str * @param int $length The min length of values. * @return array An array of found values */ - public static function split($string, string $separator = ',', int $length = 1): array + public static function split(string|array|null $string, string $separator = ',', int $length = 1): array { if (is_array($string) === true) { return $string; @@ -1112,11 +1064,6 @@ class Str /** * Checks if a string starts with the passed needle - * - * @param string $string - * @param string $needle - * @param bool $caseInsensitive - * @return bool */ public static function startsWith(string $string = null, string $needle, bool $caseInsensitive = false): bool { @@ -1132,7 +1079,6 @@ class Str * @since 3.7.0 * * @param string $value The string to convert - * @return string */ public static function studly(string $value = null): string { @@ -1141,11 +1087,6 @@ class Str /** * A UTF-8 safe version of substr() - * - * @param string $string - * @param int $start - * @param int $length - * @return string */ public static function substr(string $string = null, int $start = 0, int $length = null): string { @@ -1173,12 +1114,19 @@ class Str * - end: end placeholder * @return string The filled-in string */ - public static function template(string $string = null, array $data = [], array $options = []): string - { - $fallback = $options['fallback'] ?? null; - $callback = ($options['callback'] ?? null) instanceof Closure ? $options['callback'] : null; + public static function template( + string $string = null, + array $data = [], + array $options = [] + ): string { $start = (string)($options['start'] ?? '{{'); $end = (string)($options['end'] ?? '}}'); + $fallback = $options['fallback'] ?? null; + $callback = $options['callback'] ?? null; + + if ($callback instanceof Closure === false) { + $callback = null; + } // make sure $string is string $string ??= ''; @@ -1219,9 +1167,6 @@ class Str /** * Converts a filesize string with shortcuts * like M, G or K to an integer value - * - * @param string $size - * @return int */ public static function toBytes(string $size): int { @@ -1229,26 +1174,18 @@ class Str $last = strtolower($size[strlen($size)-1] ?? ''); $size = (int)$size; - switch ($last) { - case 'g': - $size *= 1024; - // no break - case 'm': - $size *= 1024; - // no break - case 'k': - $size *= 1024; - } + $size *= match ($last) { + 'g' => 1024 * 1024 * 1024, + 'm' => 1024 * 1024, + 'k' => 1024, + default => 1 + }; return $size; } /** * Convert the string to the given type - * - * @param string $string - * @param mixed $type - * @return mixed */ public static function toType($string, $type) { @@ -1267,10 +1204,6 @@ class Str /** * Safe trim alternative - * - * @param string $string - * @param string $trim - * @return string */ public static function trim(string $string, string $trim = ' '): string { @@ -1279,20 +1212,16 @@ class Str /** * A UTF-8 safe version of ucfirst() - * - * @param string $string - * @return string */ public static function ucfirst(string $string = null): string { - return static::upper(static::substr($string, 0, 1)) . static::lower(static::substr($string, 1)); + $first = static::substr($string, 0, 1); + $rest = static::substr($string, 1); + return static::upper($first) . static::lower($rest); } /** * A UTF-8 safe version of ucwords() - * - * @param string $string - * @return string */ public static function ucwords(string $string = null): string { @@ -1308,9 +1237,6 @@ class Str * // output: some uber crazy stuff * * - * - * @param string $string - * @return string The html string */ public static function unhtml(string $string = null): string { @@ -1319,11 +1245,6 @@ class Str /** * Returns the beginning of a string until the given character - * - * @param string $string - * @param string $needle - * @param bool $caseInsensitive - * @return string */ public static function until(string $string, string $needle, bool $caseInsensitive = false): string { @@ -1338,9 +1259,6 @@ class Str /** * A UTF-8 safe version of strotoupper() - * - * @param string $string - * @return string */ public static function upper(string $string = null): string { @@ -1351,8 +1269,6 @@ class Str * Creates a compliant v4 UUID * Taken from: https://github.com/symfony/polyfill * @since 3.7.0 - * - * @return string */ public static function uuid(): string { @@ -1381,9 +1297,6 @@ class Str * The widont function makes sure that there are no * typographical widows at the end of a paragraph – * that's a single word in the last line - * - * @param string $string - * @return string */ public static function widont(string $string = null): string { @@ -1411,7 +1324,6 @@ class Str * @param string $string String to wrap * @param string $before String to prepend * @param string|null $after String to append (if different from `$before`) - * @return string */ public static function wrap(string $string, string $before, string $after = null): string { diff --git a/kirby/src/Toolkit/Tpl.php b/kirby/src/Toolkit/Tpl.php index 2a65298..a0d4288 100644 --- a/kirby/src/Toolkit/Tpl.php +++ b/kirby/src/Toolkit/Tpl.php @@ -19,9 +19,6 @@ class Tpl /** * Renders the template * - * @param string|null $file - * @param array $data - * @return string * @throws Throwable */ public static function load(string|null $file = null, array $data = []): string diff --git a/kirby/src/Toolkit/V.php b/kirby/src/Toolkit/V.php index 88e7525..82a47ef 100644 --- a/kirby/src/Toolkit/V.php +++ b/kirby/src/Toolkit/V.php @@ -24,22 +24,15 @@ class V { /** * An array with all installed validators - * - * @var array */ - public static $validators = []; + public static array $validators = []; /** * Validates the given input with all passed rules * and returns an array with all error messages. * The array will be empty if the input is valid - * - * @param mixed $input - * @param array $rules - * @param array $messages - * @return array */ - public static function errors($input, array $rules, $messages = []): array + public static function errors($input, array $rules, array $messages = []): array { $errors = static::value($input, $rules, $messages, false); @@ -50,11 +43,6 @@ class V * Runs a number of validators on a set of data and * checks if the data is invalid * @since 3.7.0 - * - * @param array $data - * @param array $rules - * @param array $messages - * @return array */ public static function invalid(array $data = [], array $rules = [], array $messages = []): array { @@ -119,10 +107,6 @@ class V * Creates a useful error message for the given validator * and the arguments. This is used mainly internally * to create error messages - * - * @param string $validatorName - * @param mixed ...$params - * @return string|null */ public static function message(string $validatorName, ...$params): string|null { @@ -162,8 +146,6 @@ class V /** * Return the list of all validators - * - * @return array */ public static function validators(): array { @@ -174,14 +156,8 @@ class V * Validate a single value against * a set of rules, using all registered * validators - * - * @param mixed $value - * @param array $rules - * @param array $messages - * @param bool $fail - * @return bool|array */ - public static function value($value, array $rules, array $messages = [], bool $fail = true) + public static function value($value, array $rules, array $messages = [], bool $fail = true): bool|array { $errors = []; @@ -214,10 +190,6 @@ class V * Validate an input array against * a set of rules, using all registered * validators - * - * @param array $input - * @param array $rules - * @return bool */ public static function input(array $input, array $rules): bool { @@ -252,10 +224,6 @@ class V /** * Calls an installed validator and passes all arguments - * - * @param string $method - * @param array $arguments - * @return bool */ public static function __callStatic(string $method, array $arguments): bool { @@ -301,8 +269,9 @@ V::$validators = [ * Checks for numbers within the given range */ 'between' => function ($value, $min, $max): bool { - return V::min($value, $min) === true && - V::max($value, $max) === true; + return + V::min($value, $min) === true && + V::max($value, $max) === true; }, /** @@ -415,8 +384,9 @@ V::$validators = [ * Checks for a valid filename */ 'filename' => function ($value): bool { - return V::match($value, '/^[a-z0-9@._-]+$/i') === true && - V::min($value, 2) === true; + return + V::match($value, '/^[a-z0-9@._-]+$/i') === true && + V::min($value, 2) === true; }, /** diff --git a/kirby/src/Toolkit/View.php b/kirby/src/Toolkit/View.php index 5d2102d..56c45c2 100644 --- a/kirby/src/Toolkit/View.php +++ b/kirby/src/Toolkit/View.php @@ -19,23 +19,16 @@ class View { /** * The absolute path to the view file - * - * @var string */ - protected $file; + protected string $file; /** * The view data - * - * @var array */ - protected $data = []; + protected array $data = []; /** * Creates a new view object - * - * @param string $file - * @param array $data */ public function __construct(string $file, array $data = []) { @@ -46,8 +39,6 @@ class View /** * Returns the view's data array * without globals. - * - * @return array */ public function data(): array { @@ -56,8 +47,6 @@ class View /** * Checks if the template file exists - * - * @return bool */ public function exists(): bool { @@ -66,18 +55,14 @@ class View /** * Returns the view file - * - * @return string|false */ - public function file() + public function file(): string { return $this->file; } /** * Creates an error message for the missing view exception - * - * @return string */ protected function missingViewMessage(): string { @@ -86,8 +71,6 @@ class View /** * Renders the view - * - * @return string */ public function render(): string { @@ -115,9 +98,7 @@ class View } /** - * Alias for View::render() - * - * @return string + * @see ::render() */ public function toString(): string { @@ -127,8 +108,6 @@ class View /** * Magic string converter to enable * converting view objects to string - * - * @return string */ public function __toString(): string { diff --git a/kirby/src/Toolkit/Xml.php b/kirby/src/Toolkit/Xml.php index 62fc980..96a5464 100644 --- a/kirby/src/Toolkit/Xml.php +++ b/kirby/src/Toolkit/Xml.php @@ -2,6 +2,7 @@ namespace Kirby\Toolkit; +use Kirby\Cms\Helpers; use SimpleXMLElement; /** @@ -17,10 +18,8 @@ class Xml { /** * HTML to XML conversion table for entities - * - * @var array */ - public static $entities = [ + public static array|null $entities = [ ' ' => ' ', '¡' => '¡', '¢' => '¢', '£' => '£', '¤' => '¤', '¥' => '¥', '¦' => '¦', '§' => '§', '¨' => '¨', '©' => '©', 'ª' => 'ª', '«' => '«', '¬' => '¬', '­' => '­', '®' => '®', '¯' => '¯', '°' => '°', '±' => '±', '²' => '²', '³' => '³', '´' => '´', 'µ' => 'µ', '¶' => '¶', '·' => '·', @@ -71,7 +70,7 @@ class Xml * If used with a `$name` array, this can be set to `false` to disable attribute sorting. * @return string|null The generated XML attributes string */ - public static function attr($name, $value = null): string|null + public static function attr(string|array $name, $value = null): string|null { if (is_array($name) === true) { if ($value !== false) { @@ -80,26 +79,43 @@ class Xml $attributes = []; foreach ($name as $key => $val) { - $a = static::attr($key, $val); + if (is_int($key) === true) { + $key = $val; + $val = true; + } - if ($a) { - $attributes[] = $a; + if ($attribute = static::attr($key, $val)) { + $attributes[] = $attribute; } } return implode(' ', $attributes); } + // TODO: In 3.10, treat $value === '' to render as name="" if ($value === null || $value === '' || $value === []) { + // TODO: Remove in 3.10 + // @codeCoverageIgnoreStart + if ($value === '') { + Helpers::deprecated('Passing an empty string as value to `Xml::attr()` has been deprecated. In a future version, passing an empty string won\'t omit the attribute anymore but render it with an empty value. To omit the attribute, please pass `null`.', 'xml-attr-empty-string'); + } + // @codeCoverageIgnoreEnd + return null; } + // TODO: In 3.10, add deprecation message for space = empty attribute + // TODO: In 3.11, render space as space if ($value === ' ') { - return strtolower($name) . '=""'; + return $name . '=""'; } - if (is_bool($value) === true) { - return $value === true ? strtolower($name) . '="' . strtolower($name) . '"' : null; + if ($value === true) { + return $name . '="' . $name . '"'; + } + + if ($value === false) { + return null; } if (is_array($value) === true) { @@ -115,7 +131,7 @@ class Xml $value = static::encode($value); } - return strtolower($name) . '="' . $value . '"'; + return $name . '="' . $value . '"'; } /** @@ -133,8 +149,13 @@ class Xml * @param int $level The indentation level (used internally) * @return string The XML string */ - public static function create($props, string $name = 'root', bool $head = true, string $indent = ' ', int $level = 0): string - { + public static function create( + array|string $props, + string $name = 'root', + bool $head = true, + string $indent = ' ', + int $level = 0 + ): string { if (is_array($props) === true) { if (A::isAssociative($props) === true) { // a tag with attributes or named children @@ -177,7 +198,7 @@ class Xml } else { // scalar value - $result = static::tag($name, $props, null, $indent, $level); + $result = static::tag($name, $props, [], $indent, $level); } if ($head === true) { @@ -194,17 +215,10 @@ class Xml * echo Xml::decode('some über crazy stuff'); * // output: some über crazy stuff * ``` - * - * @param string|null $string - * @return string */ public static function decode(string|null $string): string { - if ($string === null) { - $string = ''; - } - - $string = strip_tags($string); + $string = strip_tags($string ?? ''); return html_entity_decode($string, ENT_COMPAT, 'utf-8'); } @@ -219,9 +233,7 @@ class Xml * // output: some über crazy stuff * ``` * - * @param string|null $string * @param bool $html True = Convert to HTML-safe first - * @return string */ public static function encode(string|null $string, bool $html = true): string { @@ -242,8 +254,6 @@ class Xml /** * Returns the HTML-to-XML entity translation table - * - * @return array */ public static function entities(): array { @@ -253,7 +263,6 @@ class Xml /** * Parses an XML string and returns an array * - * @param string $xml * @return array|null Parsed array or `null` on error */ public static function parse(string $xml): array|null @@ -271,11 +280,9 @@ class Xml * Breaks a SimpleXMLElement down into a simpler tree * structure of arrays and strings * - * @param \SimpleXMLElement $element * @param bool $collectName Whether the element name should be collected (for the root element) - * @return array|string */ - public static function simplify(SimpleXMLElement $element, bool $collectName = true) + public static function simplify(SimpleXMLElement $element, bool $collectName = true): array|string { // get all XML namespaces of the whole document to iterate over later; // we don't need the global namespace (empty string) in the list @@ -365,7 +372,7 @@ class Xml * @param int $level Indentation level * @return string The generated XML */ - public static function tag(string $name, $content = '', array $attr = null, string|null $indent = null, int $level = 0): string + public static function tag(string $name, $content = '', array $attr = [], string $indent = null, int $level = 0): string { $attr = static::attr($attr); $start = '<' . $name . ($attr ? ' ' . $attr : '') . '>'; @@ -394,9 +401,6 @@ class Xml /** * Properly encodes tag contents - * - * @param mixed $value - * @return string|null */ public static function value($value): string|null { diff --git a/kirby/vendor/autoload.php b/kirby/vendor/autoload.php index 3180c98..49e86b9 100644 --- a/kirby/vendor/autoload.php +++ b/kirby/vendor/autoload.php @@ -3,8 +3,21 @@ // autoload.php @generated by Composer if (PHP_VERSION_ID < 50600) { - echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; - exit(1); + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, $err); + } elseif (!headers_sent()) { + echo $err; + } + } + trigger_error( + $err, + E_USER_ERROR + ); } require_once __DIR__ . '/composer/autoload_real.php'; diff --git a/kirby/vendor/claviska/simpleimage/composer.json b/kirby/vendor/claviska/simpleimage/composer.json index ab23830..1a2a180 100644 --- a/kirby/vendor/claviska/simpleimage/composer.json +++ b/kirby/vendor/claviska/simpleimage/composer.json @@ -3,9 +3,9 @@ "description": "A PHP class that makes working with images as simple as possible.", "license": "MIT", "require": { - "php": ">=5.6.0", + "php": ">=8.0", "ext-gd": "*", - "league/color-extractor": "0.3.*" + "league/color-extractor": "0.4.*" }, "authors": [ { @@ -18,5 +18,9 @@ "psr-0": { "claviska": "src/" } + }, + "require-dev": { + "laravel/pint": "^1.5", + "phpstan/phpstan": "^1.10" } } diff --git a/kirby/vendor/claviska/simpleimage/composer.lock b/kirby/vendor/claviska/simpleimage/composer.lock new file mode 100644 index 0000000..d95667b --- /dev/null +++ b/kirby/vendor/claviska/simpleimage/composer.lock @@ -0,0 +1,209 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "eb94dc95686ec297093755af85d5e7dd", + "packages": [ + { + "name": "league/color-extractor", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/color-extractor.git", + "reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/color-extractor/zipball/21fcac6249c5ef7d00eb83e128743ee6678fe505", + "reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505", + "shasum": "" + }, + "require": { + "ext-gd": "*", + "php": "^7.3 || ^8.0" + }, + "replace": { + "matthecat/colorextractor": "*" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2", + "phpunit/phpunit": "^9.5" + }, + "suggest": { + "ext-curl": "To download images from remote URLs if allow_url_fopen is disabled for security reasons" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\ColorExtractor\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mathieu Lechat", + "email": "math.lechat@gmail.com", + "homepage": "http://matthecat.com", + "role": "Developer" + } + ], + "description": "Extract colors from an image as a human would do.", + "homepage": "https://github.com/thephpleague/color-extractor", + "keywords": [ + "color", + "extract", + "human", + "image", + "palette" + ], + "support": { + "issues": "https://github.com/thephpleague/color-extractor/issues", + "source": "https://github.com/thephpleague/color-extractor/tree/0.4.0" + }, + "time": "2022-09-24T15:57:16+00:00" + } + ], + "packages-dev": [ + { + "name": "laravel/pint", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "e0a8cef58b74662f27355be9cdea0e726bbac362" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/e0a8cef58b74662f27355be9cdea0e726bbac362", + "reference": "e0a8cef58b74662f27355be9cdea0e726bbac362", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "php": "^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.14.4", + "illuminate/view": "^9.51.0", + "laravel-zero/framework": "^9.2.0", + "mockery/mockery": "^1.5.1", + "nunomaduro/larastan": "^2.4.0", + "nunomaduro/termwind": "^1.15.1", + "pestphp/pest": "^1.22.4" + }, + "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": "2023-02-14T16:31:02+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "a2ffec7db373d8da4973d1d62add872db5cd22dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a2ffec7db373d8da4973d1d62add872db5cd22dd", + "reference": "a2ffec7db373d8da4973d1d62add872db5cd22dd", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpstan/phpstan/issues", + "source": "https://github.com/phpstan/phpstan/tree/1.10.2" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2023-02-23T14:36:46+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=8.0", + "ext-gd": "*" + }, + "platform-dev": [], + "plugin-api-version": "2.3.0" +} diff --git a/kirby/vendor/claviska/simpleimage/src/claviska/SimpleImage.php b/kirby/vendor/claviska/simpleimage/src/claviska/SimpleImage.php index 51e5673..5ef9efe 100644 --- a/kirby/vendor/claviska/simpleimage/src/claviska/SimpleImage.php +++ b/kirby/vendor/claviska/simpleimage/src/claviska/SimpleImage.php @@ -1,4 +1,5 @@ flags = [ + 'sslVerify' => true, // Skip SSL peer validation + ]; + + // Override default flag values. + foreach ($flags as $flag => $value) { + $this->setFlag($flag, $value); + } + + // Load an image through the constructor + if (preg_match('/^data:(.*?);/', $image)) { + $this->fromDataUri($image); + } elseif ($image) { + $this->fromFile($image); + } } - // Associative array of flags. - $this->flags = [ - "sslVerify" => true // Skip SSL peer validation - ]; - - // Override default flag values. - foreach($flags as $flag => $value) { - $this->setFlag($flag, $value); + /** + * Destroys the image resource. + */ + public function __destruct() + { + //Check for a valid GDimage instance + $type_check = (gettype($this->image) == 'object' && $this->image::class == 'GdImage'); + + if (is_resource($this->image) && $type_check) { + imagedestroy($this->image); + } } - // Load an image through the constructor - if(preg_match('/^data:(.*?);/', $image)) { - $this->fromDataUri($image); - } elseif($image) { - $this->fromFile($image); - } - } + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Helper functions + ////////////////////////////////////////////////////////////////////////////////////////////////// - /** - * Destroys the image resource. - */ - public function __destruct() { - //Check for a valid GDimage instance - $type_check = (gettype($this->image) == "object" && get_class($this->image) == "GdImage"); + /** + * Set flag value. + * + * @param string $flag Name of the flag to set. + * @param bool $value State of the flag. + * + * @throws Exception Thrown if flag does not exist (no default value). + */ + public function setFlag(string $flag, bool $value): void + { + // Throw if flag does not exist + if (! in_array($flag, array_keys($this->flags))) { + throw new Exception('Invalid flag.', self::ERR_INVALID_FLAG); + } - if($this->image !== null && is_resource($this->image) && $type_check) { - imagedestroy($this->image); - } - } - - ////////////////////////////////////////////////////////////////////////////////////////////////// - // Helper functions - ////////////////////////////////////////////////////////////////////////////////////////////////// - - /** - * Set flag value. - * - * @param string $flag Name of the flag to set. - * @param boolean $value State of the flag. - * @throws \Exception Thrown if flag does not exist (no default value). - */ - public function setFlag($flag, $value) { - // Throw if flag does not exist - if(!in_array($flag, array_keys($this->flags))) { - throw new \Exception('Invalid flag.', self::ERR_INVALID_FLAG); + // Set flag value by name + $this->flags[$flag] = $value; } - // Set flag value by name - $this->flags[$flag] = $value; - } - - /** - * Get flag value. - * - * @param string $flag Name of the flag to get. - * @return boolean|null - */ - public function getFlag($flag) { - return in_array($flag, array_keys($this->flags)) ? $this->flags[$flag] : null; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////// - // Loaders - ////////////////////////////////////////////////////////////////////////////////////////////////// - - /** - * Loads an image from a data URI. - * - * @param string $uri A data URI. - * @throws \Exception Thrown if URI or image data is invalid. - * @return \claviska\SimpleImage - */ - public function fromDataUri($uri) { - // Basic formatting check - preg_match('/^data:(.*?);/', $uri, $matches); - if(!count($matches)) { - throw new \Exception('Invalid data URI.', self::ERR_INVALID_DATA_URI); + /** + * Get flag value. + * + * @param string $flag Name of the flag to get. + */ + public function getFlag(string $flag): ?bool + { + return in_array($flag, array_keys($this->flags)) ? $this->flags[$flag] : null; } - // Determine mime type - $this->mimeType = $matches[1]; - if(!preg_match('/^image\/(gif|jpeg|png)$/', $this->mimeType)) { - throw new \Exception( - 'Unsupported format: ' . $this->mimeType, - self::ERR_UNSUPPORTED_FORMAT - ); + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Loaders + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Loads an image from a data URI. + * + * @param string $uri A data URI. + * @return SimpleImage + * + * @throws Exception Thrown if URI or image data is invalid. + */ + public function fromDataUri(string $uri): static + { + // Basic formatting check + preg_match('/^data:(.*?);/', $uri, $matches); + if (! count($matches)) { + throw new Exception('Invalid data URI.', self::ERR_INVALID_DATA_URI); + } + + // Determine mime type + $this->mimeType = $matches[1]; + if (! preg_match('/^image\/(gif|jpeg|png)$/', $this->mimeType)) { + throw new Exception( + 'Unsupported format: '.$this->mimeType, + self::ERR_UNSUPPORTED_FORMAT + ); + } + + // Get image data + $uri = base64_decode(strval(preg_replace('/^data:(.*?);base64,/', '', $uri))); + $this->image = imagecreatefromstring($uri); + if (! $this->image) { + throw new Exception('Invalid image data.', self::ERR_INVALID_IMAGE); + } + + return $this; } - // Get image data - $uri = base64_decode(preg_replace('/^data:(.*?);base64,/', '', $uri)); - $this->image = imagecreatefromstring($uri); - if(!$this->image) { - throw new \Exception("Invalid image data.", self::ERR_INVALID_IMAGE); - } - - return $this; - } - - /** - * Loads an image from a file. - * - * @param string $file The image file to load. - * @param boolean $sslVerify Set to false to skip SSL validation. - * @throws \Exception Thrown if file or image data is invalid. - * @return \claviska\SimpleImage - */ - public function fromFile($file) { + /** + * Loads an image from a file. + * + * @param string $file The image file to load. + * @return SimpleImage + * + * @throws Exception Thrown if file or image data is invalid. + */ + public function fromFile(string $file): static + { // Set fopen options. - $sslVerify = $this->getFlag("sslVerify"); // Don't perform peer validation when true - $opts = [ - "ssl" => [ - "verify_peer" => $sslVerify, - "verify_peer_name" => $sslVerify - ] - ]; + $sslVerify = $this->getFlag('sslVerify'); // Don't perform peer validation when true + $opts = [ + 'ssl' => [ + 'verify_peer' => $sslVerify, + 'verify_peer_name' => $sslVerify, + ], + ]; - // Check if the file exists and is readable. - $file = @file_get_contents($file, false, stream_context_create($opts)); - if($file === false) { - throw new \Exception("File not found: $file", self::ERR_FILE_NOT_FOUND); - } - - // Create image object from string - $this->image = imagecreatefromstring($file); - - // Get image info - $info = @getimagesizefromstring($file); - if($info === false) { - throw new \Exception("Invalid image file: $file", self::ERR_INVALID_IMAGE); - } - $this->mimeType = $info['mime']; - - if(!$this->image) { - throw new \Exception("Unsupported format: " . $this->mimeType, self::ERR_UNSUPPORTED_FORMAT); - } - - switch($this->mimeType) { - case 'image/gif': - // Copy the gif over to a true color image to preserve its transparency. This is a - // workaround to prevent imagepalettetotruecolor() from borking transparency. - $width = imagesx($this->image); - $height = imagesx($this->image); - - $gif = imagecreatetruecolor((int) $width, (int) $height); - $alpha = imagecolorallocatealpha($gif, 0, 0, 0, 127); - imagecolortransparent($gif, $alpha); - imagefill($gif, 0, 0, $alpha); - - imagecopy($this->image, $gif, 0, 0, 0, 0, $width, $height); - imagedestroy($gif); - break; - case 'image/jpeg': - // Load exif data from JPEG images - if(function_exists('exif_read_data')) { - $this->exif = @exif_read_data("data://image/jpeg;base64," . base64_encode($file)); + // Check if the file exists and is readable. + $file = @file_get_contents($file, false, stream_context_create($opts)); + if ($file === false) { + throw new Exception("File not found: $file", self::ERR_FILE_NOT_FOUND); } - break; - } - // Convert pallete images to true color images - imagepalettetotruecolor($this->image); + // Create image object from string + $this->image = imagecreatefromstring($file); - return $this; - } - - /** - * Creates a new image. - * - * @param integer $width The width of the image. - * @param integer $height The height of the image. - * @param string|array $color Optional fill color for the new image (default 'transparent'). - * @return \claviska\SimpleImage - */ - public function fromNew($width, $height, $color = 'transparent') { - $this->image = imagecreatetruecolor((int) $width, (int) $height); - - // Use PNG for dynamically created images because it's lossless and supports transparency - $this->mimeType = 'image/png'; - - // Fill the image with color - $this->fill($color); - - return $this; - } - - /** - * Creates a new image from a string. - * - * @param string $string The raw image data as a string. - * @example - * $string = file_get_contents('image.jpg'); - * @return \claviska\SimpleImage - */ - public function fromString($string) { - return $this->fromFile('data://;base64,' . base64_encode($string)); - } - - ////////////////////////////////////////////////////////////////////////////////////////////////// - // Savers - ////////////////////////////////////////////////////////////////////////////////////////////////// - - /** - * Generates an image. - * - * @param string $mimeType The image format to output as a mime type (defaults to the original mime type). - * @param integer $quality Image quality as a percentage (default 100). - * @throws \Exception Thrown when WEBP support is not enabled or unsupported format. - * @return array Returns an array containing the image data and mime type ['data' => '', 'mimeType' => '']. - */ - protected function generate($mimeType = null, $quality = 100) { - // Format defaults to the original mime type - $mimeType = $mimeType ?: $this->mimeType; - - // Ensure quality is a valid integer - if($quality === null) $quality = 100; - $quality = self::keepWithin((int) $quality, 0, 100); - - // Capture output - ob_start(); - - // Generate the image - switch($mimeType) { - - case 'image/gif': - imagesavealpha($this->image, true); - imagegif($this->image, null); - break; - case 'image/jpeg': - imageinterlace($this->image, true); - imagejpeg($this->image, null, $quality); - break; - case 'image/png': - imagesavealpha($this->image, true); - imagepng($this->image); - break; - case 'image/webp': - // Not all versions of PHP will have webp support enabled - if(!function_exists('imagewebp')) { - throw new \Exception( - 'WEBP support is not enabled in your version of PHP.', - self::ERR_WEBP_NOT_ENABLED - ); + // Get image info + $info = @getimagesizefromstring($file); + if ($info === false) { + throw new Exception("Invalid image file: $file", self::ERR_INVALID_IMAGE); } - imagesavealpha($this->image, true); - imagewebp($this->image, null, $quality); - break; - case 'image/bmp': - case 'image/x-ms-bmp': - case 'image/x-windows-bmp': - // Not all versions of PHP support bmp - if(!function_exists('imagebmp')) { - throw new \Exception( - 'BMP support is not available in your version of PHP.', - self::ERR_UNSUPPORTED_FORMAT - ); + $this->mimeType = $info['mime']; + + if (! $this->image) { + throw new Exception('Unsupported format: '.$this->mimeType, self::ERR_UNSUPPORTED_FORMAT); } - imageinterlace($this->image, true); - imagebmp($this->image, null, $quality); - break; - default: - throw new \Exception('Unsupported format: ' . $mimeType, self::ERR_UNSUPPORTED_FORMAT); + + switch($this->mimeType) { + case 'image/gif': + // Copy the gif over to a true color image to preserve its transparency. This is a + // workaround to prevent imagepalettetotruecolor() from borking transparency. + $width = imagesx($this->image); + $height = imagesx($this->image); + + $gif = imagecreatetruecolor((int) $width, (int) $height); + $alpha = imagecolorallocatealpha($gif, 0, 0, 0, 127); + imagecolortransparent($gif, $alpha ?: null); + imagefill($gif, 0, 0, $alpha); + + imagecopy($this->image, $gif, 0, 0, 0, 0, $width, $height); + imagedestroy($gif); + break; + case 'image/jpeg': + // Load exif data from JPEG images + if (function_exists('exif_read_data')) { + $this->exif = @exif_read_data('data://image/jpeg;base64,'.base64_encode($file)); + } + break; + } + + // Convert pallete images to true color images + imagepalettetotruecolor($this->image); + + return $this; } - // Stop capturing - $data = ob_get_contents(); - ob_end_clean(); + /** + * Creates a new image. + * + * @param int $width The width of the image. + * @param int $height The height of the image. + * @param string|array $color Optional fill color for the new image (default 'transparent'). + * @return SimpleImage + * + * @throws Exception + */ + public function fromNew(int $width, int $height, string|array $color = 'transparent'): static + { + $this->image = imagecreatetruecolor($width, $height); - return [ - 'data' => $data, - 'mimeType' => $mimeType - ]; - } + // Use PNG for dynamically created images because it's lossless and supports transparency + $this->mimeType = 'image/png'; - /** - * Generates a data URI. - * - * @param string $mimeType The image format to output as a mime type (defaults to the original mime type). - * @param integer $quality Image quality as a percentage (default 100). - * @return string Returns a string containing a data URI. - */ - public function toDataUri($mimeType = null, $quality = 100) { - $image = $this->generate($mimeType, $quality); + // Fill the image with color + $this->fill($color); - return 'data:' . $image['mimeType'] . ';base64,' . base64_encode($image['data']); - } - - /** - * Forces the image to be downloaded to the clients machine. Must be called before any output is sent to the screen. - * - * @param string $filename The filename (without path) to send to the client (e.g. 'image.jpeg'). - * @param string $mimeType The image format to output as a mime type (defaults to the original mime type). - * @param integer $quality Image quality as a percentage (default 100). - * @return \claviska\SimpleImage - */ - public function toDownload($filename, $mimeType = null, $quality = 100) { - $image = $this->generate($mimeType, $quality); - - // Set download headers - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Content-Description: File Transfer'); - header('Content-Length: ' . strlen($image['data'])); - header('Content-Transfer-Encoding: Binary'); - header('Content-Type: application/octet-stream'); - header("Content-Disposition: attachment; filename=\"$filename\""); - - echo $image['data']; - - return $this; - } - - /** - * Writes the image to a file. - * - * @param string $file The image format to output as a mime type (defaults to the original mime type). - * @param string $mimeType Image quality as a percentage (default 100). - * @param integer $quality Image quality as a percentage (default 100). - * @throws \Exception Thrown if failed write to file. - * @return \claviska\SimpleImage - */ - public function toFile($file, $mimeType = null, $quality = 100) { - $image = $this->generate($mimeType, $quality); - - // Save the image to file - if(!file_put_contents($file, $image['data'])) { - throw new \Exception("Failed to write image to file: $file", self::ERR_WRITE); + return $this; } - return $this; - } - - /** - * Outputs the image to the screen. Must be called before any output is sent to the screen. - * - * @param string $mimeType The image format to output as a mime type (defaults to the original mime type). - * @param integer $quality Image quality as a percentage (default 100). - * @return \claviska\SimpleImage - */ - public function toScreen($mimeType = null, $quality = 100) { - $image = $this->generate($mimeType, $quality); - - // Output the image to stdout - header('Content-Type: ' . $image['mimeType']); - echo $image['data']; - - return $this; - } - - /** - * Generates an image string. - * - * @param string $mimeType The image format to output as a mime type (defaults to the original mime type). - * @param integer $quality Image quality as a percentage (default 100). - * @return string - */ - public function toString($mimeType = null, $quality = 100) { - return $this->generate($mimeType, $quality)['data']; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////// - // Utilities - ////////////////////////////////////////////////////////////////////////////////////////////////// - - /** - * Ensures a numeric value is always within the min and max range. - * - * @param integer|float $value A numeric value to test. - * @param integer|float $min The minimum allowed value. - * @param integer|float $max The maximum allowed value. - * @return integer|float - */ - protected static function keepWithin($value, $min, $max) { - if($value < $min) return $min; - if($value > $max) return $max; - return $value; - } - - /** - * Gets the image's current aspect ratio. - * - * @return float Returns the aspect ratio as a float. - */ - public function getAspectRatio() { - return $this->getWidth() / $this->getHeight(); - } - - /** - * Gets the image's exif data. - * - * @return array|NULL Returns an array of exif data or null if no data is available. - */ - public function getExif() { - return isset($this->exif) ? $this->exif : null; - } - - /** - * Gets the image's current height. - * - * @return integer - */ - public function getHeight() { - return (int) imagesy($this->image); - } - - /** - * Gets the mime type of the loaded image. - * - * @return string - */ - public function getMimeType() { - return $this->mimeType; - } - - /** - * Gets the image's current orientation. - * - * @return string One of the values: 'landscape', 'portrait', or 'square' - */ - public function getOrientation() { - $width = $this->getWidth(); - $height = $this->getHeight(); - - if($width > $height) return 'landscape'; - if($width < $height) return 'portrait'; - return 'square'; - } - - /** - * Gets the resolution of the image - * - * @return mixed The resolution as an array of integers: [96, 96] - */ - public function getResolution() { - return imageresolution($this->image); - } - - /** - * Gets the image's current width. - * - * @return integer - */ - public function getWidth() { - return (int) imagesx($this->image); - } - - ////////////////////////////////////////////////////////////////////////////////////////////////// - // Manipulation - ////////////////////////////////////////////////////////////////////////////////////////////////// - - /** - * Same as PHP's imagecopymerge, but works with transparent images. Used internally for overlay. - * - * @param resource $dstIm Destination image link resource. - * @param resource $srcIm Source image link resource. - * @param integer $dstX x-coordinate of destination point. - * @param integer $dstY y-coordinate of destination point. - * @param integer $srcX x-coordinate of source point. - * @param integer $srcY y-coordinate of source point. - * @param integer $srcW Source width. - * @param integer $srcH Source height. - * @param integer $pct - * @return boolean true if success. - */ - protected static function imageCopyMergeAlpha($dstIm, $srcIm, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH, $pct) { - // Are we merging with transparency? - if($pct < 100) { - // Disable alpha blending and "colorize" the image using a transparent color - imagealphablending($srcIm, false); - imagefilter($srcIm, IMG_FILTER_COLORIZE, 0, 0, 0, 127 * ((100 - $pct) / 100)); + /** + * Creates a new image from a string. + * + * @param string $string The raw image data as a string. + * @return SimpleImage + * + * @throws Exception + * + * @example + * $string = file_get_contents('image.jpg'); + */ + public function fromString(string $string): SimpleImage|static + { + return $this->fromFile('data://;base64,'.base64_encode($string)); } - imagecopy($dstIm, $srcIm, (int) $dstX, (int) $dstY, (int) $srcX, (int) $srcY, (int) $srcW, (int) $srcH); + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Savers + ////////////////////////////////////////////////////////////////////////////////////////////////// - return true; - } + /** + * Generates an image. + * + * @param string|null $mimeType The image format to output as a mime type (defaults to the original mime type). + * @param array|int $options Array or Image quality as a percentage (default 100). + * @return array Returns an array containing the image data and mime type ['data' => '', 'mimeType' => '']. + * + * @throws Exception Thrown when WEBP support is not enabled or unsupported format. + */ + protected function generate(string $mimeType = null, array|int $options = []): array + { + // Format defaults to the original mime type + $mimeType = $mimeType ?: $this->mimeType; - /** - * Rotates an image so the orientation will be correct based on its exif data. It is safe to call - * this method on images that don't have exif data (no changes will be made). - * - * @return \claviska\SimpleImage - */ - public function autoOrient() { - $exif = $this->getExif(); + $quality = null; + // allow $options to be an int for backwards compatibility to v3 + if (is_int($options)) { + $quality = $options; + $options = []; + } - if(!$exif || !isset($exif['Orientation'])){ - return $this; + // get quality if passed as an option + if (is_array($options) && array_key_exists('quality', $options)) { + $quality = intval($options['quality']); + } + + // Ensure quality is a valid integer + if ($quality === null) { + $quality = 100; + } + $quality = (int) round(self::keepWithin((int) $quality, 0, 100)); + + $alpha = true; + // get alpha if passed as an option + if (is_array($options) && array_key_exists('alpha', $options)) { + $alpha = boolval($options['alpha']); + } + + $interlace = null; // keep the same + // get interlace if passed as an option + if (is_array($options) && array_key_exists('interlace', $options)) { + $interlace = boolval($options['interlace']); + } + + // get raw stream from image* functions in providing no path + $file = null; + + // Capture output + ob_start(); + + // Generate the image + switch($mimeType) { + case 'image/gif': + imagesavealpha($this->image, $alpha); + imagegif($this->image, $file); + break; + case 'image/jpeg': + imageinterlace($this->image, $interlace); + imagejpeg($this->image, $file, $quality); + break; + case 'image/png': + $filters = -1; // imagepng default + // get filters if passed as an option + if (is_array($options) && array_key_exists('filters', $options)) { + $filters = intval($options['filters']); + } + // compression param is called quality in imagepng but that would be + // misleading in context of SimpleImage + $compression = -1; // defaults to zlib default which is 6 + // get compression if passed as an option + if (is_array($options) && array_key_exists('compression', $options)) { + $compression = intval($options['compression']); + } + if ($compression !== -1) { + $compression = (int) round(self::keepWithin($compression, 0, 10)); + } + imagesavealpha($this->image, $alpha); + imagepng($this->image, $file, $compression, $filters); + break; + case 'image/webp': + // Not all versions of PHP will have webp support enabled + if (! function_exists('imagewebp')) { + throw new Exception( + 'WEBP support is not enabled in your version of PHP.', + self::ERR_WEBP_NOT_ENABLED + ); + } + // useless but recommended, see https://www.php.net/manual/en/function.imagesavealpha.php + imagesavealpha($this->image, $alpha); + imagewebp($this->image, $file, $quality); + break; + case 'image/bmp': + case 'image/x-ms-bmp': + case 'image/x-windows-bmp': + // Not all versions of PHP support bmp + if (! function_exists('imagebmp')) { + throw new Exception( + 'BMP support is not available in your version of PHP.', + self::ERR_UNSUPPORTED_FORMAT + ); + } + $compression = true; // imagebmp default + // get compression if passed as an option + if (is_array($options) && array_key_exists('compression', $options)) { + $compression = is_int($options['compression']) ? + $options['compression'] > 0 : boolval($options['compression']); + } + imageinterlace($this->image, $interlace); + imagebmp($this->image, $file, $compression); + break; + case 'image/avif': + // Not all versions of PHP support avif + if (! function_exists('imageavif')) { + throw new Exception( + 'AVIF support is not available in your version of PHP.', + self::ERR_UNSUPPORTED_FORMAT + ); + } + $speed = -1; // imageavif default + // get speed if passed as an option + if (is_array($options) && array_key_exists('speed', $options)) { + $speed = intval($options['speed']); + $speed = self::keepWithin($speed, 0, 10); + } + // useless but recommended, see https://www.php.net/manual/en/function.imagesavealpha.php + imagesavealpha($this->image, $alpha); + imageavif($this->image, $file, $quality, $speed); + break; + default: + throw new Exception('Unsupported format: '.$mimeType, self::ERR_UNSUPPORTED_FORMAT); + } + + // Stop capturing + $data = ob_get_contents(); + ob_end_clean(); + + return [ + 'data' => $data, + 'mimeType' => $mimeType, + ]; } - switch($exif['Orientation']) { - case 1: // Do nothing! - break; - case 2: // Flip horizontally - $this->flip('x'); - break; - case 3: // Rotate 180 degrees - $this->rotate(180); - break; - case 4: // Flip vertically - $this->flip('y'); - break; - case 5: // Rotate 90 degrees clockwise and flip vertically - $this->flip('y')->rotate(90); - break; - case 6: // Rotate 90 clockwise - $this->rotate(90); - break; - case 7: // Rotate 90 clockwise and flip horizontally - $this->flip('x')->rotate(90); - break; - case 8: // Rotate 90 counterclockwise - $this->rotate(-90); - break; + /** + * Generates a data URI. + * + * @param string|null $mimeType The image format to output as a mime type (defaults to the original mime type). + * @param array|int $options Array or Image quality as a percentage (default 100). + * @return string Returns a string containing a data URI. + * + * @throws Exception + */ + public function toDataUri(string $mimeType = null, array|int $options = 100): string + { + $image = $this->generate($mimeType, $options); + + return 'data:'.$image['mimeType'].';base64,'.base64_encode($image['data']); } - return $this; - } + /** + * Forces the image to be downloaded to the clients machine. Must be called before any output is sent to the screen. + * + * @param string $filename The filename (without path) to send to the client (e.g. 'image.jpeg'). + * @param string|null $mimeType The image format to output as a mime type (defaults to the original mime type). + * @param array|int $options Array or Image quality as a percentage (default 100). + * @return SimpleImage + * + * @throws Exception + */ + public function toDownload(string $filename, string $mimeType = null, array|int $options = 100): static + { + $image = $this->generate($mimeType, $options); - /** - * Proportionally resize the image to fit inside a specific width and height. - * - * @param integer $maxWidth The maximum width the image can be. - * @param integer $maxHeight The maximum height the image can be. - * @return \claviska\SimpleImage - */ - public function bestFit($maxWidth, $maxHeight) { - // If the image already fits, there's nothing to do - if($this->getWidth() <= $maxWidth && $this->getHeight() <= $maxHeight) { - return $this; + // Set download headers + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Content-Description: File Transfer'); + header('Content-Length: '.strlen($image['data'])); + header('Content-Transfer-Encoding: Binary'); + header('Content-Type: application/octet-stream'); + header("Content-Disposition: attachment; filename=\"$filename\""); + + echo $image['data']; + + return $this; } - // Calculate max width or height based on orientation - if($this->getOrientation() === 'portrait') { - $height = $maxHeight; - $width = $maxHeight * $this->getAspectRatio(); - } else { - $width = $maxWidth; - $height = $maxWidth / $this->getAspectRatio(); + /** + * Writes the image to a file. + * + * @param string $file The image format to output as a mime type (defaults to the original mime type). + * @param string|null $mimeType Image quality as a percentage (default 100). + * @param array|int $options Array or Image quality as a percentage (default 100). + * @return SimpleImage + * + * @throws Exception Thrown if failed write to file. + */ + public function toFile(string $file, string $mimeType = null, array|int $options = 100): static + { + $image = $this->generate($mimeType, $options); + + // Save the image to file + if (! file_put_contents($file, $image['data'])) { + throw new Exception("Failed to write image to file: $file", self::ERR_WRITE); + } + + return $this; } - // Reduce to max width - if($width > $maxWidth) { - $width = $maxWidth; - $height = $width / $this->getAspectRatio(); + /** + * Outputs the image to the screen. Must be called before any output is sent to the screen. + * + * @param string|null $mimeType The image format to output as a mime type (defaults to the original mime type). + * @param array|int $options Array or Image quality as a percentage (default 100). + * @return SimpleImage + * + * @throws Exception + */ + public function toScreen(string $mimeType = null, array|int $options = 100): static + { + $image = $this->generate($mimeType, $options); + + // Output the image to stdout + header('Content-Type: '.$image['mimeType']); + echo $image['data']; + + return $this; } - // Reduce to max height - if($height > $maxHeight) { - $height = $maxHeight; - $width = $height * $this->getAspectRatio(); + /** + * Generates an image string. + * + * @param string|null $mimeType The image format to output as a mime type (defaults to the original mime type). + * @param array|int $options Array or Image quality as a percentage (default 100). + * + * @throws Exception + */ + public function toString(string $mimeType = null, array|int $options = 100): string + { + return $this->generate($mimeType, $options)['data']; } - return $this->resize($width, $height); - } + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Utilities + ////////////////////////////////////////////////////////////////////////////////////////////////// + /** + * Ensures a numeric value is always within the min and max range. + * + * @param int|float $value A numeric value to test. + * @param int|float $min The minimum allowed value. + * @param int|float $max The maximum allowed value. + */ + protected static function keepWithin(int|float $value, int|float $min, int|float $max): int|float + { + if ($value < $min) { + return $min; + } + if ($value > $max) { + return $max; + } - /** - * Crop the image. - * - * @param integer|float $x1 Top left x coordinate. - * @param integer|float $y1 Top left y coordinate. - * @param integer|float $x2 Bottom right x coordinate. - * @param integer|float $y2 Bottom right x coordinate. - * @return \claviska\SimpleImage - */ - public function crop($x1, $y1, $x2, $y2) { - // Keep crop within image dimensions - $x1 = self::keepWithin($x1, 0, $this->getWidth()); - $x2 = self::keepWithin($x2, 0, $this->getWidth()); - $y1 = self::keepWithin($y1, 0, $this->getHeight()); - $y2 = self::keepWithin($y2, 0, $this->getHeight()); - - // Avoid using native imagecrop() because of a bug with PNG transparency - $dstW = abs($x2 - $x1); - $dstH = abs($y2 - $y1); - $newImage = imagecreatetruecolor((int) $dstW, (int) $dstH); - $transparentColor = imagecolorallocatealpha($newImage, 0, 0, 0, 127); - imagecolortransparent($newImage, $transparentColor); - imagefill($newImage, 0, 0, $transparentColor); - - // Crop it - imagecopyresampled( - $newImage, - $this->image, - 0, 0, min($x1, $x2), min($y1, $y2), - (int) $dstW, - (int) $dstH, - (int) $dstW, - (int) $dstH - ); - - // Swap out the new image - $this->image = $newImage; - - return $this; - } - - /** - * Applies a duotone filter to the image. - * - * @param string|array $lightColor The lightest color in the duotone. - * @param string|array $darkColor The darkest color in the duotone. - * @return \claviska\SimpleImage - */ - function duotone($lightColor, $darkColor) { - $lightColor = self::normalizeColor($lightColor); - $darkColor = self::normalizeColor($darkColor); - - // Calculate averages between light and dark colors - $redAvg = $lightColor['red'] - $darkColor['red']; - $greenAvg = $lightColor['green'] - $darkColor['green']; - $blueAvg = $lightColor['blue'] - $darkColor['blue']; - - // Create a matrix of all possible duotone colors based on gray values - $pixels = []; - for($i = 0; $i <= 255; $i++) { - $grayAvg = $i / 255; - $pixels['red'][$i] = $darkColor['red'] + $grayAvg * $redAvg; - $pixels['green'][$i] = $darkColor['green'] + $grayAvg * $greenAvg; - $pixels['blue'][$i] = $darkColor['blue'] + $grayAvg * $blueAvg; + return $value; } - // Apply the filter pixel by pixel - for($x = 0; $x < $this->getWidth(); $x++) { - for($y = 0; $y < $this->getHeight(); $y++) { - $rgb = $this->getColorAt($x, $y); - $gray = min(255, round(0.299 * $rgb['red'] + 0.114 * $rgb['blue'] + 0.587 * $rgb['green'])); - $this->dot($x, $y, [ - 'red' => $pixels['red'][$gray], - 'green' => $pixels['green'][$gray], - 'blue' => $pixels['blue'][$gray] - ]); - } + /** + * Gets the image's current aspect ratio. + * + * @return float|int Returns the aspect ratio as a float. + */ + public function getAspectRatio(): float|int + { + return $this->getWidth() / $this->getHeight(); } - return $this; - } - - /** - * Proportionally resize the image to a specific height. - * - * @deprecated - * This method was deprecated in version 3.2.2 and will be removed in version 4.0. - * Please use `resize(null, $height)` instead. - * @param integer $height - * @return \claviska\SimpleImage - */ - public function fitToHeight($height) { - return $this->resize(null, $height); - } - - /** - * Proportionally resize the image to a specific width. - * - * @deprecated - * This method was deprecated in version 3.2.2 and will be removed in version 4.0. - * Please use `resize(null, $height)` instead. - * @param integer $width The width to resize the image to. - * @return \claviska\SimpleImage - */ - public function fitToWidth($width) { - return $this->resize($width, null); - } - - /** - * Flip the image horizontally or vertically. - * - * @param string $direction The direction to flip: x|y|both. - * @return \claviska\SimpleImage - */ - public function flip($direction) { - switch($direction) { - case 'x': - imageflip($this->image, IMG_FLIP_HORIZONTAL); - break; - case 'y': - imageflip($this->image, IMG_FLIP_VERTICAL); - break; - case 'both': - imageflip($this->image, IMG_FLIP_BOTH); - break; + /** + * Gets the image's exif data. + * + * @return array|null Returns an array of exif data or null if no data is available. + */ + public function getExif(): ?array + { + return $this->exif ?? null; } - return $this; - } - - /** - * Reduces the image to a maximum number of colors. - * - * @param integer $max The maximum number of colors to use. - * @param boolean $dither Whether or not to use a dithering effect (default true). - * @return \claviska\SimpleImage - */ - public function maxColors($max, $dither = true) { - imagetruecolortopalette($this->image, $dither, max(1, $max)); - - return $this; - } - - /** - * Place an image on top of the current image. - * - * @param string|SimpleImage $overlay The image to overlay. This can be a filename, a data URI, or a SimpleImage object. - * @param string $anchor The anchor point: 'center', 'top', 'bottom', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right' (default 'center'). - * @param float $opacity The opacity level of the overlay 0-1 (default 1). - * @param integer $xOffset Horizontal offset in pixels (default 0). - * @param integer $yOffset Vertical offset in pixels (default 0). - * @param bool $calculateOffsetFromEdge Calculate Offset referring to the edges of the image (default false). - * @return \claviska\SimpleImage - */ - public function overlay($overlay, $anchor = 'center', $opacity = 1, $xOffset = 0, $yOffset = 0, $calculateOffsetFromEdge = false) { - // Load overlay image - if(!($overlay instanceof SimpleImage)) $overlay = new SimpleImage($overlay); - - // Convert opacity - $opacity = self::keepWithin($opacity, 0, 1) * 100; - - // Get available space - $spaceX = $this->getWidth() - $overlay->getWidth(); - $spaceY = $this->getHeight() - $overlay->getHeight(); - - // Set default center - $x = ($spaceX / 2) + ($calculateOffsetFromEdge ? 0 : $xOffset); - $y = ($spaceY / 2) + ($calculateOffsetFromEdge ? 0 : $yOffset); - - // Determine if top|bottom - if (strpos($anchor, 'top') !== false) { - $y = $yOffset; - } elseif (strpos($anchor, 'bottom') !== false) { - $y = $spaceY + ($calculateOffsetFromEdge ? -$yOffset : $yOffset); + /** + * Gets the image's current height. + */ + public function getHeight(): int + { + return (int) imagesy($this->image); } - // Determine if left|right - if (strpos($anchor, 'left') !== false) { - $x = $xOffset; - } elseif (strpos($anchor, 'right') !== false) { - $x = $spaceX + ($calculateOffsetFromEdge ? -$xOffset : $xOffset); + /** + * Gets the mime type of the loaded image. + */ + public function getMimeType(): string + { + return $this->mimeType; } - // Perform the overlay - self::imageCopyMergeAlpha( - $this->image, - $overlay->image, - $x, $y, - 0, 0, - $overlay->getWidth(), - $overlay->getHeight(), - $opacity - ); + /** + * Gets the image's current orientation. + * + * @return string One of the values: 'landscape', 'portrait', or 'square' + */ + public function getOrientation(): string + { + $width = $this->getWidth(); + $height = $this->getHeight(); - return $this; - } + if ($width > $height) { + return 'landscape'; + } + if ($width < $height) { + return 'portrait'; + } - /** - * Resize an image to the specified dimensions. If only one dimension is specified, the image will be resized proportionally. - * - * @param integer $width The new image width. - * @param integer $height The new image height. - * @return \claviska\SimpleImage - */ - public function resize($width = null, $height = null) { - // No dimentions specified - if(!$width && !$height) { - return $this; + return 'square'; } - // Resize to width - if($width && !$height) { - $height = $width / $this->getAspectRatio(); + /** + * Gets the resolution of the image + * + * @return array|bool The resolution as an array of integers: [96, 96] + */ + public function getResolution(): bool|array + { + return imageresolution($this->image); } - // Resize to height - if(!$width && $height) { - $width = $height * $this->getAspectRatio(); + /** + * Gets the image's current width. + */ + public function getWidth(): int + { + return (int) imagesx($this->image); } - // If the dimensions are the same, there's no need to resize - if($this->getWidth() === $width && $this->getHeight() === $height) { - return $this; + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Manipulation + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Same as PHP's imagecopymerge, but works with transparent images. Used internally for overlay. + * + * @param resource $dstIm Destination image link resource. + * @param resource $srcIm Source image link resource. + * @param int $dstX x-coordinate of destination point. + * @param int $dstY y-coordinate of destination point. + * @param int $srcX x-coordinate of source point. + * @param int $srcY y-coordinate of source point. + * @param int $srcW Source width. + * @param int $srcH Source height. + * @return bool true if success. + */ + protected static function imageCopyMergeAlpha($dstIm, $srcIm, int $dstX, int $dstY, int $srcX, int $srcY, int $srcW, int $srcH, int $pct): bool + { + // Are we merging with transparency? + if ($pct < 100) { + // Disable alpha blending and "colorize" the image using a transparent color + imagealphablending($srcIm, false); + imagefilter($srcIm, IMG_FILTER_COLORIZE, 0, 0, 0, round(127 * ((100 - $pct) / 100))); + } + + imagecopy($dstIm, $srcIm, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH); + + return true; } - // We can't use imagescale because it doesn't seem to preserve transparency properly. The - // workaround is to create a new truecolor image, allocate a transparent color, and copy the - // image over to it using imagecopyresampled. - $newImage = imagecreatetruecolor((int) $width, (int) $height); - $transparentColor = imagecolorallocatealpha($newImage, 0, 0, 0, 127); - imagecolortransparent($newImage, $transparentColor); - imagefill($newImage, 0, 0, $transparentColor); - imagecopyresampled( - $newImage, - $this->image, - 0, 0, 0, 0, - (int) $width, - (int) $height, - $this->getWidth(), - $this->getHeight() - ); + /** + * Rotates an image so the orientation will be correct based on its exif data. It is safe to call + * this method on images that don't have exif data (no changes will be made). + * + * @return SimpleImage + * + * @throws Exception + */ + public function autoOrient(): static + { + $exif = $this->getExif(); - // Swap out the new image - $this->image = $newImage; + if (! $exif || ! isset($exif['Orientation'])) { + return $this; + } - return $this; - } + switch($exif['Orientation']) { + case 1: // Do nothing! + break; + case 2: // Flip horizontally + $this->flip('x'); + break; + case 3: // Rotate 180 degrees + $this->rotate(180); + break; + case 4: // Flip vertically + $this->flip('y'); + break; + case 5: // Rotate 90 degrees clockwise and flip vertically + $this->flip('y')->rotate(90); + break; + case 6: // Rotate 90 clockwise + $this->rotate(90); + break; + case 7: // Rotate 90 clockwise and flip horizontally + $this->flip('x')->rotate(90); + break; + case 8: // Rotate 90 counterclockwise + $this->rotate(-90); + break; + } - /** - * Sets an image's resolution, as per https://www.php.net/manual/en/function.imageresolution.php - * - * @param integer $res_x The horizontal resolution in DPI. - * @param integer $res_y The vertical resolution in DPI - * @return \claviska\SimpleImage - */ - public function resolution($res_x, $res_y = null) { - if(is_null($res_y)) { - imageresolution($this->image, $res_x); - } else { - imageresolution($this->image, $res_x, $res_y); + return $this; } - return $this; - } + /** + * Proportionally resize the image to fit inside a specific width and height. + * + * @param int $maxWidth The maximum width the image can be. + * @param int $maxHeight The maximum height the image can be. + * @return SimpleImage + */ + public function bestFit(int $maxWidth, int $maxHeight): static + { + // If the image already fits, there's nothing to do + if ($this->getWidth() <= $maxWidth && $this->getHeight() <= $maxHeight) { + return $this; + } - /** - * Rotates the image. - * - * @param integer $angle The angle of rotation (-360 - 360). - * @param string|array $backgroundColor The background color to use for the uncovered zone area after rotation (default 'transparent'). - * @return \claviska\SimpleImage - */ - public function rotate($angle, $backgroundColor = 'transparent') { - // Rotate the image on a canvas with the desired background color - $backgroundColor = $this->allocateColor($backgroundColor); + // Calculate max width or height based on orientation + if ($this->getOrientation() === 'portrait') { + $height = $maxHeight; + $width = (int) round($maxHeight * $this->getAspectRatio()); + } else { + $width = $maxWidth; + $height = (int) round($maxWidth / $this->getAspectRatio()); + } - $this->image = imagerotate( - $this->image, - -(self::keepWithin($angle, -360, 360)), - $backgroundColor - ); - imagecolortransparent($this->image, imagecolorallocatealpha($this->image, 0, 0, 0, 127)); + // Reduce to max width + if ($width > $maxWidth) { + $width = $maxWidth; + $height = (int) round($width / $this->getAspectRatio()); + } - return $this; - } + // Reduce to max height + if ($height > $maxHeight) { + $height = $maxHeight; + $width = (int) round($height * $this->getAspectRatio()); + } - /** - * Adds text to the image. - * - * @param string $text The desired text. - * @param array $options - * An array of options. - * - fontFile* (string) - The TrueType (or compatible) font file to use. - * - size (integer) - The size of the font in pixels (default 12). - * - color (string|array) - The text color (default black). - * - anchor (string) - The anchor point: 'center', 'top', 'bottom', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right' (default 'center'). - * - xOffset (integer) - The horizontal offset in pixels (default 0). - * - yOffset (integer) - The vertical offset in pixels (default 0). - * - shadow (array) - Text shadow params. - * - x* (integer) - Horizontal offset in pixels. - * - y* (integer) - Vertical offset in pixels. - * - color* (string|array) - The text shadow color. - * - $calculateOffsetFromEdge (bool) - Calculate offsets from the edge of the image (default false). - * - $baselineAlign (bool) - Align the text font with the baseline. (default true). - * @param array $boundary - * If passed, this variable will contain an array with coordinates that surround the text: [x1, y1, x2, y2, width, height]. - * This can be used for calculating the text's position after it gets added to the image. - * @throws \Exception - * @return \claviska\SimpleImage - */ - public function text($text, $options, &$boundary = null) { - // Check for freetype support - if(!function_exists('imagettftext')) { - throw new \Exception( - 'Freetype support is not enabled in your version of PHP.', - self::ERR_FREETYPE_NOT_ENABLED - ); + return $this->resize($width, $height); } - // Default options - $options = array_merge([ - 'fontFile' => null, - 'size' => 12, - 'color' => 'black', - 'anchor' => 'center', - 'xOffset' => 0, - 'yOffset' => 0, - 'shadow' => null, - 'calculateOffsetFromEdge' => false, - 'baselineAlign' => true - ], $options); + /** + * Crop the image. + * + * @param int|float $x1 Top left x coordinate. + * @param int|float $y1 Top left y coordinate. + * @param int|float $x2 Bottom right x coordinate. + * @param int|float $y2 Bottom right x coordinate. + * @return SimpleImage + */ + public function crop(int|float $x1, int|float $y1, int|float $x2, int|float $y2): static + { + // Keep crop within image dimensions + $x1 = self::keepWithin($x1, 0, $this->getWidth()); + $x2 = self::keepWithin($x2, 0, $this->getWidth()); + $y1 = self::keepWithin($y1, 0, $this->getHeight()); + $y2 = self::keepWithin($y2, 0, $this->getHeight()); - // Extract and normalize options - $fontFile = $options['fontFile']; - $size = ($options['size'] / 96) * 72; // Convert px to pt (72pt per inch, 96px per inch) - $color = $this->allocateColor($options['color']); - $anchor = $options['anchor']; - $xOffset = $options['xOffset']; - $yOffset = $options['yOffset']; - $calculateOffsetFromEdge = $options['calculateOffsetFromEdge']; - $baselineAlign = $options['baselineAlign']; - $angle = 0; + // Avoid using native imagecrop() because of a bug with PNG transparency + $dstW = abs($x2 - $x1); + $dstH = abs($y2 - $y1); + $newImage = imagecreatetruecolor((int) $dstW, (int) $dstH); + $transparentColor = imagecolorallocatealpha($newImage, 0, 0, 0, 127); + imagecolortransparent($newImage, $transparentColor ?: null); + imagefill($newImage, 0, 0, $transparentColor); - // Calculate the bounding box dimensions + // Crop it + imagecopyresampled( + $newImage, + $this->image, + 0, + 0, + (int) round(min($x1, $x2)), + (int) round(min($y1, $y2)), + (int) $dstW, + (int) $dstH, + (int) $dstW, + (int) $dstH + ); + + // Swap out the new image + $this->image = $newImage; + + return $this; + } + + /** + * Applies a duotone filter to the image. + * + * @param string|array $lightColor The lightest color in the duotone. + * @param string|array $darkColor The darkest color in the duotone. + * @return SimpleImage + * + * @throws Exception + */ + public function duotone(string|array $lightColor, string|array $darkColor): static + { + $lightColor = self::normalizeColor($lightColor); + $darkColor = self::normalizeColor($darkColor); + + // Calculate averages between light and dark colors + $redAvg = $lightColor['red'] - $darkColor['red']; + $greenAvg = $lightColor['green'] - $darkColor['green']; + $blueAvg = $lightColor['blue'] - $darkColor['blue']; + + // Create a matrix of all possible duotone colors based on gray values + $pixels = []; + for ($i = 0; $i <= 255; $i++) { + $grayAvg = $i / 255; + $pixels['red'][$i] = $darkColor['red'] + $grayAvg * $redAvg; + $pixels['green'][$i] = $darkColor['green'] + $grayAvg * $greenAvg; + $pixels['blue'][$i] = $darkColor['blue'] + $grayAvg * $blueAvg; + } + + // Apply the filter pixel by pixel + for ($x = 0; $x < $this->getWidth(); $x++) { + for ($y = 0; $y < $this->getHeight(); $y++) { + $rgb = $this->getColorAt($x, $y); + $gray = min(255, round(0.299 * $rgb['red'] + 0.114 * $rgb['blue'] + 0.587 * $rgb['green'])); + $this->dot($x, $y, [ + 'red' => $pixels['red'][$gray], + 'green' => $pixels['green'][$gray], + 'blue' => $pixels['blue'][$gray], + ]); + } + } + + return $this; + } + + /** + * Proportionally resize the image to a specific width. + * + * @param int $width The width to resize the image to. + * @return SimpleImage + * + *@deprecated + * This method was deprecated in version 3.2.2 and will be removed in version 4.0. + * Please use `resize(null, $height)` instead. + */ + public function fitToWidth(int $width): static + { + return $this->resize($width); + } + + /** + * Flip the image horizontally or vertically. + * + * @param string $direction The direction to flip: x|y|both. + * @return SimpleImage + */ + public function flip(string $direction): static + { + match ($direction) { + 'x' => imageflip($this->image, IMG_FLIP_HORIZONTAL), + 'y' => imageflip($this->image, IMG_FLIP_VERTICAL), + 'both' => imageflip($this->image, IMG_FLIP_BOTH), + default => $this, + }; + + return $this; + } + + /** + * Reduces the image to a maximum number of colors. + * + * @param int $max The maximum number of colors to use. + * @param bool $dither Whether or not to use a dithering effect (default true). + * @return SimpleImage + */ + public function maxColors(int $max, bool $dither = true): static + { + imagetruecolortopalette($this->image, $dither, max(1, $max)); + + return $this; + } + + /** + * Place an image on top of the current image. + * + * @param string|SimpleImage $overlay The image to overlay. This can be a filename, a data URI, or a SimpleImage object. + * @param string $anchor The anchor point: 'center', 'top', 'bottom', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right' (default 'center'). + * @param float|int $opacity The opacity level of the overlay 0-1 (default 1). + * @param int $xOffset Horizontal offset in pixels (default 0). + * @param int $yOffset Vertical offset in pixels (default 0). + * @param bool $calculateOffsetFromEdge Calculate Offset referring to the edges of the image (default false). + * @return SimpleImage + * + * @throws Exception + */ + public function overlay(string|SimpleImage $overlay, string $anchor = 'center', float|int $opacity = 1, int $xOffset = 0, int $yOffset = 0, bool $calculateOffsetFromEdge = false): static + { + // Load overlay image + if (! ($overlay instanceof SimpleImage)) { + $overlay = new SimpleImage($overlay); + } + + // Convert opacity + $opacity = (int) round(self::keepWithin($opacity, 0, 1) * 100); + + // Get available space + $spaceX = $this->getWidth() - $overlay->getWidth(); + $spaceY = $this->getHeight() - $overlay->getHeight(); + + // Set default center + $x = (int) round(($spaceX / 2) + ($calculateOffsetFromEdge ? 0 : $xOffset)); + $y = (int) round(($spaceY / 2) + ($calculateOffsetFromEdge ? 0 : $yOffset)); + + // Determine if top|bottom + if (str_contains($anchor, 'top')) { + $y = $yOffset; + } elseif (str_contains($anchor, 'bottom')) { + $y = $spaceY + ($calculateOffsetFromEdge ? -$yOffset : $yOffset); + } + + // Determine if left|right + if (str_contains($anchor, 'left')) { + $x = $xOffset; + } elseif (str_contains($anchor, 'right')) { + $x = $spaceX + ($calculateOffsetFromEdge ? -$xOffset : $xOffset); + } + + // Perform the overlay + self::imageCopyMergeAlpha( + $this->image, + $overlay->image, + $x, $y, + 0, 0, + $overlay->getWidth(), + $overlay->getHeight(), + $opacity + ); + + return $this; + } + + /** + * Resize an image to the specified dimensions. If only one dimension is specified, the image will be resized proportionally. + * + * @param int|null $width The new image width. + * @param int|null $height The new image height. + * @return SimpleImage + */ + public function resize(int $width = null, int $height = null): static + { + // No dimensions specified + if (! $width && ! $height) { + return $this; + } + + // Resize to width + if ($width && ! $height) { + $height = (int) round($width / $this->getAspectRatio()); + } + + // Resize to height + if (! $width && $height) { + $width = (int) round($height * $this->getAspectRatio()); + } + + // If the dimensions are the same, there's no need to resize + if ($this->getWidth() === $width && $this->getHeight() === $height) { + return $this; + } + + // We can't use imagescale because it doesn't seem to preserve transparency properly. The + // workaround is to create a new truecolor image, allocate a transparent color, and copy the + // image over to it using imagecopyresampled. + $newImage = imagecreatetruecolor($width, $height); + $transparentColor = imagecolorallocatealpha($newImage, 0, 0, 0, 127); + imagecolortransparent($newImage, $transparentColor); + imagefill($newImage, 0, 0, $transparentColor); + imagecopyresampled( + $newImage, + $this->image, + 0, 0, 0, 0, + $width, + $height, + $this->getWidth(), + $this->getHeight() + ); + + // Swap out the new image + $this->image = $newImage; + + return $this; + } + + /** + * Sets an image's resolution, as per https://www.php.net/manual/en/function.imageresolution.php + * + * @param int $res_x The horizontal resolution in DPI. + * @param int|null $res_y The vertical resolution in DPI + * @return SimpleImage + */ + public function resolution(int $res_x, int $res_y = null): static + { + if (is_null($res_y)) { + imageresolution($this->image, $res_x); + } else { + imageresolution($this->image, $res_x, $res_y); + } + + return $this; + } + + /** + * Rotates the image. + * + * @param int $angle The angle of rotation (-360 - 360). + * @param string|array $backgroundColor The background color to use for the uncovered zone area after rotation (default 'transparent'). + * @return SimpleImage + * + * @throws Exception + */ + public function rotate(int $angle, string|array $backgroundColor = 'transparent'): static + { + // Rotate the image on a canvas with the desired background color + $backgroundColor = $this->allocateColor($backgroundColor); + + $this->image = imagerotate( + $this->image, + -(self::keepWithin($angle, -360, 360)), + $backgroundColor + ); + imagecolortransparent($this->image, imagecolorallocatealpha($this->image, 0, 0, 0, 127)); + + return $this; + } + + /** + * Adds text to the image. + * + * @param string $text The desired text. + * @param array $options + * An array of options. + * - fontFile* (string) - The TrueType (or compatible) font file to use. + * - size (integer) - The size of the font in pixels (default 12). + * - color (string|array) - The text color (default black). + * - anchor (string) - The anchor point: 'center', 'top', 'bottom', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right' (default 'center'). + * - xOffset (integer) - The horizontal offset in pixels (default 0). + * - yOffset (integer) - The vertical offset in pixels (default 0). + * - shadow (array) - Text shadow params. + * - x* (integer) - Horizontal offset in pixels. + * - y* (integer) - Vertical offset in pixels. + * - color* (string|array) - The text shadow color. + * - $calculateOffsetFromEdge (bool) - Calculate offsets from the edge of the image (default false). + * - $baselineAlign (bool) - Align the text font with the baseline. (default true). + * @param array|null $boundary + * If passed, this variable will contain an array with coordinates that surround the text: [x1, y1, x2, y2, width, height]. + * This can be used for calculating the text's position after it gets added to the image. + * @return SimpleImage + * + * @throws Exception + */ + public function text(string $text, array $options, array &$boundary = null): static + { + // Check for freetype support + if (! function_exists('imagettftext')) { + throw new Exception( + 'Freetype support is not enabled in your version of PHP.', + self::ERR_FREETYPE_NOT_ENABLED + ); + } + + // Default options + $options = array_merge([ + 'fontFile' => null, + 'size' => 12, + 'color' => 'black', + 'anchor' => 'center', + 'xOffset' => 0, + 'yOffset' => 0, + 'shadow' => null, + 'calculateOffsetFromEdge' => false, + 'baselineAlign' => true, + ], $options); + + // Extract and normalize options + $fontFile = $options['fontFile']; + $size = ($options['size'] / 96) * 72; // Convert px to pt (72pt per inch, 96px per inch) + $color = $this->allocateColor($options['color']); + $anchor = $options['anchor']; + $xOffset = $options['xOffset']; + $yOffset = $options['yOffset']; + $calculateOffsetFromEdge = $options['calculateOffsetFromEdge']; + $baselineAlign = $options['baselineAlign']; + $angle = 0; + + // Calculate the bounding box dimensions // - // Since imagettfbox() returns a bounding box from the text's baseline, we can end up with - // different heights for different strings of the same font size. For example, 'type' will often - // be taller than 'text' because the former has a descending letter. + // Since imagettfbox() returns a bounding box from the text's baseline, we can end up with + // different heights for different strings of the same font size. For example, 'type' will often + // be taller than 'text' because the former has a descending letter. // - // To compensate for this, we created a temporary bounding box to measure the maximum height - // that the font used can occupy. Based on this, we can adjust the text vertically so that it - // appears inside the box with a good consistency. + // To compensate for this, we created a temporary bounding box to measure the maximum height + // that the font used can occupy. Based on this, we can adjust the text vertically so that it + // appears inside the box with a good consistency. // - // See: https://github.com/claviska/SimpleImage/issues/165 + // See: https://github.com/claviska/SimpleImage/issues/165 // - $boxText = imagettfbbox($size, $angle, $fontFile, $text); - if(!$boxText) throw new \Exception("Unable to load font file: $fontFile", self::ERR_FONT_FILE); - - $boxWidth = abs($boxText[4] - $boxText[0]); - $boxHeight = abs($boxText[5] - $boxText[1]); - - // Calculate Offset referring to the edges of the image. - // Just invert the value for bottom|right; - if ($calculateOffsetFromEdge == true) { - if (strpos($anchor, 'bottom') !== false) $yOffset *= -1; - if (strpos($anchor, 'right') !== false) $xOffset *= -1; - } - - // Align the text font with the baseline. - // I use $yOffset to inject the vertical alignment correction value. - if ($baselineAlign == true) { - // Create a temporary box to obtain the maximum height that this font can use. - $boxFull = imagettfbbox($size, $angle, $fontFile, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'); - // Based on the maximum height, the text is aligned. - if (strpos($anchor, 'bottom') !== false) { - $yOffset -= $boxFull[1]; - } elseif (strpos($anchor, 'top') !== false) { - $yOffset += abs($boxFull[5]) - $boxHeight; - } else { // center - $boxFullHeight = abs($boxFull[1]) + abs($boxFull[5]); - $yOffset += ($boxFullHeight/2) - ($boxHeight/2) - abs($boxFull[1]); - } - - } else { - // Prevents fonts rendered outside the box boundary from being cut. - // Example: 'Scriptina' font, some letters invade the space of the previous or subsequent letter. - $yOffset -= $boxText[1]; - } - - // Prevents fonts rendered outside the box boundary from being cut. - // Example: 'Scriptina' font, some letters invade the space of the previous or subsequent letter. - $xOffset -= $boxText[0]; - - // Determine position - switch($anchor) { - case 'top left': - $x = $xOffset; - $y = $yOffset + $boxHeight; - break; - case 'top right': - $x = $this->getWidth() - $boxWidth + $xOffset; - $y = $yOffset + $boxHeight; - break; - case 'top': - $x = ($this->getWidth() / 2) - ($boxWidth / 2) + $xOffset; - $y = $yOffset + $boxHeight; - break; - case 'bottom left': - $x = $xOffset; - $y = $this->getHeight() + $yOffset ; - break; - case 'bottom right': - $x = $this->getWidth() - $boxWidth + $xOffset; - $y = $this->getHeight() + $yOffset; - break; - case 'bottom': - $x = ($this->getWidth() / 2) - ($boxWidth / 2) + $xOffset; - $y = $this->getHeight() + $yOffset; - break; - case 'left': - $x = $xOffset; - $y = ($this->getHeight() / 2) - (($boxHeight / 2) - $boxHeight) + $yOffset; - break; - case 'right'; - $x = $this->getWidth() - $boxWidth + $xOffset; - $y = ($this->getHeight() / 2) - (($boxHeight / 2) - $boxHeight) + $yOffset; - break; - default: // center - $x = ($this->getWidth() / 2) - ($boxWidth / 2) + $xOffset; - $y = ($this->getHeight() / 2) - (($boxHeight / 2) - $boxHeight) + $yOffset; - break; - } - $x = (int) round($x); - $y = (int) round($y); - - // Pass the boundary back by reference - $boundary = [ - 'x1' => $x + $boxText[0], - 'y1' => $y + $boxText[1] - $boxHeight, // $y is the baseline, not the top! - 'x2' => $x + $boxWidth + $boxText[0], - 'y2' => $y + $boxText[1], - 'width' => $boxWidth, - 'height' => $boxHeight - ]; - - // Text shadow - if(is_array($options['shadow'])) { - imagettftext( - $this->image, - $size, - $angle, - $x + $options['shadow']['x'], - $y + $options['shadow']['y'], - $this->allocateColor($options['shadow']['color']), - $fontFile, - $text - ); - } - - // Draw the text - imagettftext($this->image, $size, $angle, $x, $y, $color, $fontFile, $text); - - return $this; - } - - /** - * Adds text with a line break to the image. - * - * @param string $text The desired text. - * @param array $options - * An array of options. - * - fontFile* (string) - The TrueType (or compatible) font file to use. - * - size (integer) - The size of the font in pixels (default 12). - * - color (string|array) - The text color (default black). - * - anchor (string) - The anchor point: 'center', 'top', 'bottom', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right' (default 'center'). - * - xOffset (integer) - The horizontal offset in pixels (default 0). Has no effect when anchor is 'center'. - * - yOffset (integer) - The vertical offset in pixels (default 0). Has no effect when anchor is 'center'. - * - shadow (array) - Text shadow params. - * - x* (integer) - Horizontal offset in pixels. - * - y* (integer) - Vertical offset in pixels. - * - color* (string|array) - The text shadow color. - * - $calculateOffsetFromEdge (bool) - Calculate offsets from the edge of the image (default false). - * - width (int) - Width of text box (default image width). - * - align (string) - How to align text: 'left', 'right', 'center', 'justify' (default 'left'). - * - leading (float) - Increase/decrease spacing between lines of text (default 0). - * - opacity (float) - The opacity level of the text 0-1 (default 1). - * @throws \Exception - * @return \claviska\SimpleImage - */ - public function textBox($text, $options) { - // default width of image - $maxWidth = $this->getWidth(); - // Default options - $options = array_merge([ - 'fontFile' => null, - 'size' => 12, - 'color' => 'black', - 'anchor' => 'center', - 'xOffset' => 0, - 'yOffset' => 0, - 'shadow' => null, - 'calculateOffsetFromEdge' => false, - 'width' => $maxWidth, - 'align' => 'left', - 'leading' => 0, - 'opacity' => 1 - ], $options); - - // Extract and normalize options - $fontFile = $options['fontFile']; - $fontSize = $fontSizePx = $options['size']; - $fontSize = ($fontSize / 96) * 72; // Convert px to pt (72pt per inch, 96px per inch) - $color = $options['color']; - $anchor = $options['anchor']; - $xOffset = $options['xOffset']; - $yOffset = $options['yOffset']; - $shadow = $options['shadow']; - $calculateOffsetFromEdge = $options['calculateOffsetFromEdge']; - $angle = 0; - $maxWidth = $options['width']; - $leading = $options['leading']; - $leading = self::keepWithin($leading, ($fontSizePx * -1), $leading); - $opacity = $options['opacity']; - - $align = $options['align']; - if ($align == 'right') { - $align = 'top right'; - } elseif ($align == 'center') { - $align = 'top'; - } elseif ($align == 'justify') { - $align = 'justify'; - } else { - $align = 'top left'; - } - - list($lines, $isLastLine, $lastLineHeight) = self::textSeparateLines($text, $fontFile, $fontSize, $maxWidth); - - $maxHeight = (count($lines) - 1) * ($fontSizePx * 1.2 + $leading) + $lastLineHeight; - - $imageText = new SimpleImage(); - $imageText->fromNew($maxWidth, $maxHeight); - - // Align left/center/right - if ($align <> 'justify') { - foreach ($lines as $key => $line) { - if( $align == 'top' ) $line = trim($line); // If is justify = 'center' - $imageText->text($line, array( - 'fontFile' => $fontFile, - 'size' => $fontSizePx, - 'color' => $color, - 'anchor' => $align, - 'xOffset' => 0, - 'yOffset' => $key * ($fontSizePx * 1.2 + $leading), - 'shadow' => $shadow, - 'calculateOffsetFromEdge' => true - )); - } - - // Justify - } else { - foreach ($lines as $keyLine => $line) { - // Check if there are spaces at the beginning of the sentence - $spaces = 0; - if (preg_match("/^\s+/", $line, $match)) { - // Count spaces - $spaces = strlen($match[0]); - $line = ltrim($line); + $boxText = imagettfbbox($size, $angle, $fontFile, $text); + if (! $boxText) { + throw new Exception("Unable to load font file: $fontFile", self::ERR_FONT_FILE); } - // Separate words - $words = preg_split("/\s+/", $line); - // Include spaces with the first word - $words[0] = str_repeat(' ', $spaces) . $words[0]; + $boxWidth = abs($boxText[4] - $boxText[0]); + $boxHeight = abs($boxText[5] - $boxText[1]); - // Calculates the space occupied by all words - $wordsSize = array(); - foreach ($words as $key => $word) { - $wordBox = imagettfbbox($fontSize, 0, $fontFile, $word); - $wordWidth = abs($wordBox[4] - $wordBox[0]); - $wordsSize[$key] = $wordWidth; - } - $wordsSizeTotal = array_sum($wordsSize); - - // Calculates the required space between words - $countWords = count($words); - $wordSpacing = 0; - if ($countWords > 1) { - $wordSpacing = ($maxWidth - $wordsSizeTotal) / ($countWords - 1); - $wordSpacing = round($wordSpacing, 3); + // Calculate Offset referring to the edges of the image. + // Just invert the value for bottom|right; + if ($calculateOffsetFromEdge) { + if (str_contains($anchor, 'bottom')) { + $yOffset *= -1; + } + if (str_contains($anchor, 'right')) { + $xOffset *= -1; + } } - $xOffsetJustify = 0; - foreach ($words as $key => $word) { - if ($isLastLine[$keyLine] == true) { - if ($key < (count($words) - 1)) continue; - $word = $line; - } - $imageText->text($word, array( - 'fontFile' => $fontFile, - 'size' => $fontSizePx, - 'color' => $color, - 'anchor' => 'top left', - 'xOffset' => $xOffsetJustify, - 'yOffset' => $keyLine * ($fontSizePx * 1.2 + $leading), - 'shadow' => $shadow, - 'calculateOffsetFromEdge' => true, - ) - ); - // Calculate offset for next word - $xOffsetJustify += $wordsSize[$key] + $wordSpacing; + // Align the text font with the baseline. + // I use $yOffset to inject the vertical alignment correction value. + if ($baselineAlign) { + // Create a temporary box to obtain the maximum height that this font can use. + $boxFull = imagettfbbox($size, $angle, $fontFile, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'); + // Based on the maximum height, the text is aligned. + if (str_contains($anchor, 'bottom')) { + $yOffset -= $boxFull[1]; + } elseif (str_contains($anchor, 'top')) { + $yOffset += abs($boxFull[5]) - $boxHeight; + } else { // center + $boxFullHeight = abs($boxFull[1]) + abs($boxFull[5]); + $yOffset += ($boxFullHeight / 2) - ($boxHeight / 2) - abs($boxFull[1]); + } + } else { + // Prevents fonts rendered outside the box boundary from being cut. + // Example: 'Scriptina' font, some letters invade the space of the previous or subsequent letter. + $yOffset -= $boxText[1]; } - } + + // Prevents fonts rendered outside the box boundary from being cut. + // Example: 'Scriptina' font, some letters invade the space of the previous or subsequent letter. + $xOffset -= $boxText[0]; + + // Determine position + switch($anchor) { + case 'top left': + $x = $xOffset; + $y = $yOffset + $boxHeight; + break; + case 'top right': + $x = $this->getWidth() - $boxWidth + $xOffset; + $y = $yOffset + $boxHeight; + break; + case 'top': + $x = ($this->getWidth() / 2) - ($boxWidth / 2) + $xOffset; + $y = $yOffset + $boxHeight; + break; + case 'bottom left': + $x = $xOffset; + $y = $this->getHeight() + $yOffset; + break; + case 'bottom right': + $x = $this->getWidth() - $boxWidth + $xOffset; + $y = $this->getHeight() + $yOffset; + break; + case 'bottom': + $x = ($this->getWidth() / 2) - ($boxWidth / 2) + $xOffset; + $y = $this->getHeight() + $yOffset; + break; + case 'left': + $x = $xOffset; + $y = ($this->getHeight() / 2) - (($boxHeight / 2) - $boxHeight) + $yOffset; + break; + case 'right': + $x = $this->getWidth() - $boxWidth + $xOffset; + $y = ($this->getHeight() / 2) - (($boxHeight / 2) - $boxHeight) + $yOffset; + break; + default: // center + $x = ($this->getWidth() / 2) - ($boxWidth / 2) + $xOffset; + $y = ($this->getHeight() / 2) - (($boxHeight / 2) - $boxHeight) + $yOffset; + break; + } + $x = (int) round($x); + $y = (int) round($y); + + // Pass the boundary back by reference + $boundary = [ + 'x1' => $x + $boxText[0], + 'y1' => $y + $boxText[1] - $boxHeight, // $y is the baseline, not the top! + 'x2' => $x + $boxWidth + $boxText[0], + 'y2' => $y + $boxText[1], + 'width' => $boxWidth, + 'height' => $boxHeight, + ]; + + // Text shadow + if (is_array($options['shadow'])) { + imagettftext( + $this->image, + $size, + $angle, + $x + $options['shadow']['x'], + $y + $options['shadow']['y'], + $this->allocateColor($options['shadow']['color']), + $fontFile, + $text + ); + } + + // Draw the text + imagettftext($this->image, $size, $angle, $x, $y, $color, $fontFile, $text); + + return $this; } - $this->overlay($imageText, $anchor, $opacity, $xOffset, $yOffset, $calculateOffsetFromEdge); + /** + * Adds text with a line break to the image. + * + * @param string $text The desired text. + * @param array $options + * An array of options. + * - fontFile* (string) - The TrueType (or compatible) font file to use. + * - size (integer) - The size of the font in pixels (default 12). + * - color (string|array) - The text color (default black). + * - anchor (string) - The anchor point: 'center', 'top', 'bottom', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right' (default 'center'). + * - xOffset (integer) - The horizontal offset in pixels (default 0). Has no effect when anchor is 'center'. + * - yOffset (integer) - The vertical offset in pixels (default 0). Has no effect when anchor is 'center'. + * - shadow (array) - Text shadow params. + * - x* (integer) - Horizontal offset in pixels. + * - y* (integer) - Vertical offset in pixels. + * - color* (string|array) - The text shadow color. + * - $calculateOffsetFromEdge (bool) - Calculate offsets from the edge of the image (default false). + * - width (int) - Width of text box (default image width). + * - align (string) - How to align text: 'left', 'right', 'center', 'justify' (default 'left'). + * - leading (float) - Increase/decrease spacing between lines of text (default 0). + * - opacity (float) - The opacity level of the text 0-1 (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function textBox(string $text, array $options): static + { + // default width of image + $maxWidth = $this->getWidth(); + // Default options + $options = array_merge([ + 'fontFile' => null, + 'size' => 12, + 'color' => 'black', + 'anchor' => 'center', + 'xOffset' => 0, + 'yOffset' => 0, + 'shadow' => null, + 'calculateOffsetFromEdge' => false, + 'width' => $maxWidth, + 'align' => 'left', + 'leading' => 0, + 'opacity' => 1, + ], $options); - return $this; - } + // Extract and normalize options + $fontFile = $options['fontFile']; + $fontSize = $fontSizePx = $options['size']; + $fontSize = ($fontSize / 96) * 72; // Convert px to pt (72pt per inch, 96px per inch) + $color = $options['color']; + $anchor = $options['anchor']; + $xOffset = $options['xOffset']; + $yOffset = $options['yOffset']; + $shadow = $options['shadow']; + $calculateOffsetFromEdge = $options['calculateOffsetFromEdge']; + $maxWidth = intval($options['width']); + $leading = $options['leading']; + $leading = self::keepWithin($leading, ($fontSizePx * -1), $leading); + $opacity = $options['opacity']; - /** - * Receives a text and breaks into LINES. - * - * @param integer $text - * @param string $fontFile - * @param int $fontSize - * @param int $maxWidth - * @return array - */ - private function textSeparateLines($text, $fontFile, $fontSize, $maxWidth) { - $words = self::textSeparateWords($text); - $countWords = count($words) - 1; - $lines[0] = ''; - $lineKey = 0; - $isLastLine = []; - for ($i = 0; $i < $countWords; $i++) { - $word = $words[$i]; - $isLastLine[$lineKey] = false; - if ($word === PHP_EOL) { + $align = $options['align']; + if ($align == 'right') { + $align = 'top right'; + } elseif ($align == 'center') { + $align = 'top'; + } elseif ($align == 'justify') { + $align = 'justify'; + } else { + $align = 'top left'; + } + + [$lines, $isLastLine, $lastLineHeight] = self::textSeparateLines($text, $fontFile, $fontSize, $maxWidth); + + $maxHeight = (int) round(((is_countable($lines) ? count($lines) : 0) - 1) * ($fontSizePx * 1.2 + $leading) + $lastLineHeight); + + $imageText = new SimpleImage(); + $imageText->fromNew($maxWidth, $maxHeight); + + // Align left/center/right + if ($align != 'justify') { + foreach ($lines as $key => $line) { + if ($align == 'top') { + $line = trim($line); + } // If is justify = 'center' + $imageText->text($line, ['fontFile' => $fontFile, 'size' => $fontSizePx, 'color' => $color, 'anchor' => $align, 'xOffset' => 0, 'yOffset' => $key * ($fontSizePx * 1.2 + $leading), 'shadow' => $shadow, 'calculateOffsetFromEdge' => true]); + } + + // Justify + } else { + foreach ($lines as $keyLine => $line) { + // Check if there are spaces at the beginning of the sentence + $spaces = 0; + if (preg_match("/^\s+/", $line, $match)) { + // Count spaces + $spaces = strlen($match[0]); + $line = ltrim($line); + } + + // Separate words + $words = preg_split("/\s+/", $line); + // Include spaces with the first word + $words[0] = str_repeat(' ', $spaces).$words[0]; + + // Calculates the space occupied by all words + $wordsSize = []; + foreach ($words as $key => $word) { + $wordBox = imagettfbbox($fontSize, 0, $fontFile, $word); + $wordWidth = abs($wordBox[4] - $wordBox[0]); + $wordsSize[$key] = $wordWidth; + } + $wordsSizeTotal = array_sum($wordsSize); + + // Calculates the required space between words + $countWords = count($words); + $wordSpacing = 0; + if ($countWords > 1) { + $wordSpacing = ($maxWidth - $wordsSizeTotal) / ($countWords - 1); + $wordSpacing = round($wordSpacing, 3); + } + + $xOffsetJustify = 0; + foreach ($words as $key => $word) { + if ($isLastLine[$keyLine]) { + if ($key < (count($words) - 1)) { + continue; + } + $word = $line; + } + $imageText->text($word, ['fontFile' => $fontFile, 'size' => $fontSizePx, 'color' => $color, 'anchor' => 'top left', 'xOffset' => $xOffsetJustify, 'yOffset' => $keyLine * ($fontSizePx * 1.2 + $leading), 'shadow' => $shadow, 'calculateOffsetFromEdge' => true] + ); + // Calculate offset for next word + $xOffsetJustify += $wordsSize[$key] + $wordSpacing; + } + } + } + + $this->overlay($imageText, $anchor, $opacity, $xOffset, $yOffset, $calculateOffsetFromEdge); + + return $this; + } + + /** + * Receives a text and breaks into LINES. + */ + private function textSeparateLines(string $text, string $fontFile, int $fontSize, int $maxWidth): array + { + $lines = []; + $words = self::textSeparateWords($text); + $countWords = count($words) - 1; + $lines[0] = ''; + $lineKey = 0; + $isLastLine = []; + for ($i = 0; $i < $countWords; $i++) { + $word = $words[$i]; + $isLastLine[$lineKey] = false; + if ($word === PHP_EOL) { + $isLastLine[$lineKey] = true; + $lineKey++; + $lines[$lineKey] = ''; + + continue; + } + $lineBox = imagettfbbox($fontSize, 0, $fontFile, $lines[$lineKey].$word); + if (abs($lineBox[4] - $lineBox[0]) < $maxWidth) { + $lines[$lineKey] .= $word.' '; + } else { + $lineKey++; + $lines[$lineKey] = $word.' '; + } + } $isLastLine[$lineKey] = true; - $lineKey++; - $lines[$lineKey] = ''; - continue; - } - $lineBox = imagettfbbox($fontSize, 0, $fontFile, $lines[$lineKey] . $word); - if (abs($lineBox[4] - $lineBox[0]) < $maxWidth) { - $lines[$lineKey] .= $word . ' '; - } else { - $lineKey++; - $lines[$lineKey] = $word . ' '; - } - } - $isLastLine[$lineKey] = true; - // Exclude space of right - $lines = array_map('rtrim', $lines); - // Calculate height of last line - $boxFull = imagettfbbox($fontSize, 0, $fontFile, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'); - $lineBox = imagettfbbox($fontSize, 0, $fontFile, $lines[$lineKey]); - // Height of last line = ascender of $boxFull + descender of $lineBox - $lastLineHeight = abs($lineBox[1]) + abs($boxFull[5]); + // Exclude space of right + $lines = array_map('rtrim', $lines); + // Calculate height of last line + $boxFull = imagettfbbox($fontSize, 0, $fontFile, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'); + $lineBox = imagettfbbox($fontSize, 0, $fontFile, $lines[$lineKey]); + // Height of last line = ascender of $boxFull + descender of $lineBox + $lastLineHeight = abs($lineBox[1]) + abs($boxFull[5]); - return array($lines, $isLastLine, $lastLineHeight); - } - - /** - * Receives a text and breaks into WORD / SPACE / NEW LINE. - * - * @param integer $text - * @return array - */ - private function textSeparateWords($text) { - // Normalizes line break - $text = preg_replace('/(\r\n|\n|\r)/', PHP_EOL, $text); - $text = explode(PHP_EOL, $text); - $newText = array(); - foreach ($text as $key => $line) { - $newText = array_merge($newText, explode(' ', $line), [PHP_EOL]); + return [$lines, $isLastLine, $lastLineHeight]; } - return $newText; - } + /** + * Receives a text and breaks into WORD / SPACE / NEW LINE. + */ + private function textSeparateWords(string $text): array + { + // Normalizes line break + $text = strval(preg_replace('/(\r\n|\n|\r)/', PHP_EOL, $text)); + $text = explode(PHP_EOL, $text); + $newText = []; + foreach ($text as $line) { + $newText = array_merge($newText, explode(' ', $line), [PHP_EOL]); + } - /** - * Creates a thumbnail image. This function attempts to get the image as close to the provided - * dimensions as possible, then crops the remaining overflow to force the desired size. Useful - * for generating thumbnail images. - * - * @param integer $width The thumbnail width. - * @param integer $height The thumbnail height. - * @param string $anchor The anchor point: 'center', 'top', 'bottom', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right' (default 'center'). - * @return \claviska\SimpleImage - */ - public function thumbnail($width, $height, $anchor = 'center') { - // Determine aspect ratios - $currentRatio = $this->getHeight() / $this->getWidth(); - $targetRatio = $height / $width; - - // Fit to height/width - if($targetRatio > $currentRatio) { - $this->resize(null, $height); - } else { - $this->resize($width, null); + return $newText; } - switch($anchor) { - case 'top': - $x1 = floor(($this->getWidth() / 2) - ($width / 2)); - $x2 = $width + $x1; - $y1 = 0; - $y2 = $height; - break; - case 'bottom': - $x1 = floor(($this->getWidth() / 2) - ($width / 2)); - $x2 = $width + $x1; - $y1 = $this->getHeight() - $height; - $y2 = $this->getHeight(); - break; - case 'left': - $x1 = 0; - $x2 = $width; - $y1 = floor(($this->getHeight() / 2) - ($height / 2)); - $y2 = $height + $y1; - break; - case 'right': - $x1 = $this->getWidth() - $width; - $x2 = $this->getWidth(); - $y1 = floor(($this->getHeight() / 2) - ($height / 2)); - $y2 = $height + $y1; - break; - case 'top left': - $x1 = 0; - $x2 = $width; - $y1 = 0; - $y2 = $height; - break; - case 'top right': - $x1 = $this->getWidth() - $width; - $x2 = $this->getWidth(); - $y1 = 0; - $y2 = $height; - break; - case 'bottom left': - $x1 = 0; - $x2 = $width; - $y1 = $this->getHeight() - $height; - $y2 = $this->getHeight(); - break; - case 'bottom right': - $x1 = $this->getWidth() - $width; - $x2 = $this->getWidth(); - $y1 = $this->getHeight() - $height; - $y2 = $this->getHeight(); - break; - default: - $x1 = floor(($this->getWidth() / 2) - ($width / 2)); - $x2 = $width + $x1; - $y1 = floor(($this->getHeight() / 2) - ($height / 2)); - $y2 = $height + $y1; - break; + /** + * Creates a thumbnail image. This function attempts to get the image as close to the provided + * dimensions as possible, then crops the remaining overflow to force the desired size. Useful + * for generating thumbnail images. + * + * @param int $width The thumbnail width. + * @param int $height The thumbnail height. + * @param string $anchor The anchor point: 'center', 'top', 'bottom', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right' (default 'center'). + * @return SimpleImage + */ + public function thumbnail(int $width, int $height, string $anchor = 'center'): SimpleImage|static + { + // Determine aspect ratios + $currentRatio = $this->getHeight() / $this->getWidth(); + $targetRatio = $height / $width; + + // Fit to height/width + if ($targetRatio > $currentRatio) { + $this->resize(null, $height); + } else { + $this->resize($width); + } + + switch($anchor) { + case 'top': + $x1 = floor(($this->getWidth() / 2) - ($width / 2)); + $x2 = $width + $x1; + $y1 = 0; + $y2 = $height; + break; + case 'bottom': + $x1 = floor(($this->getWidth() / 2) - ($width / 2)); + $x2 = $width + $x1; + $y1 = $this->getHeight() - $height; + $y2 = $this->getHeight(); + break; + case 'left': + $x1 = 0; + $x2 = $width; + $y1 = floor(($this->getHeight() / 2) - ($height / 2)); + $y2 = $height + $y1; + break; + case 'right': + $x1 = $this->getWidth() - $width; + $x2 = $this->getWidth(); + $y1 = floor(($this->getHeight() / 2) - ($height / 2)); + $y2 = $height + $y1; + break; + case 'top left': + $x1 = 0; + $x2 = $width; + $y1 = 0; + $y2 = $height; + break; + case 'top right': + $x1 = $this->getWidth() - $width; + $x2 = $this->getWidth(); + $y1 = 0; + $y2 = $height; + break; + case 'bottom left': + $x1 = 0; + $x2 = $width; + $y1 = $this->getHeight() - $height; + $y2 = $this->getHeight(); + break; + case 'bottom right': + $x1 = $this->getWidth() - $width; + $x2 = $this->getWidth(); + $y1 = $this->getHeight() - $height; + $y2 = $this->getHeight(); + break; + default: + $x1 = floor(($this->getWidth() / 2) - ($width / 2)); + $x2 = $width + $x1; + $y1 = floor(($this->getHeight() / 2) - ($height / 2)); + $y2 = $height + $y1; + break; + } + + // Return the cropped thumbnail image + return $this->crop($x1, $y1, $x2, $y2); } - // Return the cropped thumbnail image - return $this->crop($x1, $y1, $x2, $y2); - } + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Drawing + ////////////////////////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////////////////////////// - // Drawing - ////////////////////////////////////////////////////////////////////////////////////////////////// + /** + * Draws an arc. + * + * @param int $x The x coordinate of the arc's center. + * @param int $y The y coordinate of the arc's center. + * @param int $width The width of the arc. + * @param int $height The height of the arc. + * @param int $start The start of the arc in degrees. + * @param int $end The end of the arc in degrees. + * @param string|array $color The arc color. + * @param int|string $thickness Line thickness in pixels or 'filled' (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function arc(int $x, int $y, int $width, int $height, int $start, int $end, string|array $color, int|string $thickness = 1): static + { + // Allocate the color + $tempColor = $this->allocateColor($color); + imagesetthickness($this->image, 1); - /** - * Draws an arc. - * - * @param integer $x The x coordinate of the arc's center. - * @param integer $y The y coordinate of the arc's center. - * @param integer $width The width of the arc. - * @param integer $height The height of the arc. - * @param integer $start The start of the arc in degrees. - * @param integer $end The end of the arc in degrees. - * @param string|array $color The arc color. - * @param integer|string $thickness Line thickness in pixels or 'filled' (default 1). - * @return \claviska\SimpleImage - */ - public function arc($x, $y, $width, $height, $start, $end, $color, $thickness = 1) { - // Allocate the color - $tempColor = $this->allocateColor($color); - imagesetthickness($this->image, 1); + // Draw an arc + if ($thickness === 'filled') { + imagefilledarc($this->image, $x, $y, $width, $height, $start, $end, $tempColor, IMG_ARC_PIE); + } elseif ($thickness === 1) { + imagearc($this->image, $x, $y, $width, $height, $start, $end, $tempColor); + } else { + // New temp image + $tempImage = new SimpleImage(); + $tempImage->fromNew($this->getWidth(), $this->getHeight()); - // Draw an arc - if($thickness === 'filled') { - imagefilledarc($this->image, $x, $y, $width, $height, $start, $end, $tempColor, IMG_ARC_PIE); + // Draw a large ellipse filled with $color (+$thickness pixels) + $tempColor = $tempImage->allocateColor($color); + imagefilledarc($tempImage->image, $x, $y, $width + $thickness, $height + $thickness, $start, $end, $tempColor, IMG_ARC_PIE); - } else if ($thickness === 1) { - imagearc($this->image, $x, $y, $width, $height, $start, $end, $tempColor); + // Draw a smaller ellipse filled with red|blue (-$thickness pixels) + $tempColor = (self::normalizeColor($color)['red'] == 255) ? 'blue' : 'red'; + $tempColor = $tempImage->allocateColor($tempColor); + imagefilledarc($tempImage->image, $x, $y, $width - $thickness, $height - $thickness, $start, $end, $tempColor, IMG_ARC_PIE); - } else { - // New temp image - $tempImage = new SimpleImage(); - $tempImage->fromNew($this->getWidth(), $this->getHeight(), 'transparent'); + // Replace the color of the smaller ellipse with 'transparent' + $tempImage->excludeInsideColor($x, $y, $color); - // Draw a large ellipse filled with $color (+$thickness pixels) - $tempColor = $tempImage->allocateColor($color); - imagefilledarc($tempImage->image, $x, $y, $width+$thickness, $height+$thickness, $start, $end, $tempColor, IMG_ARC_PIE); + // Apply the temp image + $this->overlay($tempImage); + } - // Draw a smaller ellipse filled with red|blue (-$thickness pixels) - $tempColor = (self::normalizeColor($color)['red'] == 255) ? 'blue' : 'red'; - $tempColor = $tempImage->allocateColor($tempColor); - imagefilledarc($tempImage->image, $x, $y, $width-$thickness, $height-$thickness, $start, $end, $tempColor, IMG_ARC_PIE); - - // Replace the color of the smaller ellipse with 'transparent' - $tempImage->excludeInsideColor($x, $y, $color); - - // Apply the temp image - $this->overlay($tempImage); + return $this; } - return $this; - } + /** + * Draws a border around the image. + * + * @param string|array $color The border color. + * @param int $thickness The thickness of the border (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function border(string|array $color, int $thickness = 1): static + { + $x1 = -1; + $y1 = 0; + $x2 = $this->getWidth(); + $y2 = $this->getHeight() - 1; - /** - * Draws a border around the image. - * - * @param string|array $color The border color. - * @param integer $thickness The thickness of the border (default 1). - * @return \claviska\SimpleImage - */ - public function border($color, $thickness = 1) { - $x1 = -1; - $y1 = 0; - $x2 = $this->getWidth(); - $y2 = $this->getHeight()-1; + $color = $this->allocateColor($color); + imagesetthickness($this->image, $thickness * 2); + imagerectangle($this->image, $x1, $y1, $x2, $y2, $color); - $color = $this->allocateColor($color); - imagesetthickness($this->image, $thickness*2); - imagerectangle($this->image, $x1, $y1, $x2, $y2, $color); - - return $this; - } - - /** - * Draws a single pixel dot. - * - * @param integer $x The x coordinate of the dot. - * @param integer $y The y coordinate of the dot. - * @param string|array $color The dot color. - * @return \claviska\SimpleImage - */ - public function dot($x, $y, $color) { - $color = $this->allocateColor($color); - imagesetpixel($this->image, $x, $y, $color); - - return $this; - } - - /** - * Draws an ellipse. - * - * @param integer $x The x coordinate of the center. - * @param integer $y The y coordinate of the center. - * @param integer $width The ellipse width. - * @param integer $height The ellipse height. - * @param string|array $color The ellipse color. - * @param integer|array $thickness Line thickness in pixels or 'filled' (default 1). - * @return \claviska\SimpleImage - */ - public function ellipse($x, $y, $width, $height, $color, $thickness = 1) { - // Allocate the color - $tempColor = $this->allocateColor($color); - imagesetthickness($this->image, 1); - - // Draw an ellipse - if($thickness === 'filled') { - imagefilledellipse($this->image, $x, $y, $width, $height, $tempColor); - - } else if ($thickness === 1) { - imageellipse($this->image, $x, $y, $width, $height, $tempColor); - - } else { - // New temp image - $tempImage = new SimpleImage(); - $tempImage->fromNew($this->getWidth(), $this->getHeight(), 'transparent'); - - // Draw a large ellipse filled with $color (+$thickness pixels) - $tempColor = $tempImage->allocateColor($color); - imagefilledellipse($tempImage->image, $x, $y, $width+$thickness, $height+$thickness, $tempColor); - - // Draw a smaller ellipse filled with red|blue (-$thickness pixels) - $tempColor = (self::normalizeColor($color)['red'] == 255) ? 'blue' : 'red'; - $tempColor = $tempImage->allocateColor($tempColor); - imagefilledellipse($tempImage->image, $x, $y, $width-$thickness, $height-$thickness, $tempColor); - - // Replace the color of the smaller ellipse with 'transparent' - $tempImage->excludeInsideColor($x, $y, $color); - - // Apply the temp image - $this->overlay($tempImage); + return $this; } - return $this; - } + /** + * Draws a single pixel dot. + * + * @param int $x The x coordinate of the dot. + * @param int $y The y coordinate of the dot. + * @param string|array $color The dot color. + * @return SimpleImage + * + * @throws Exception + */ + public function dot(int $x, int $y, string|array $color): static + { + $color = $this->allocateColor($color); + imagesetpixel($this->image, $x, $y, $color); - /** - * Fills the image with a solid color. - * - * @param string|array $color The fill color. - * @return \claviska\SimpleImage - */ - public function fill($color) { - // Draw a filled rectangle over the entire image - $this->rectangle(0, 0, $this->getWidth(), $this->getHeight(), 'white', 'filled'); - - // Now flood it with the appropriate color - $color = $this->allocateColor($color); - imagefill($this->image, 0, 0, $color); - - return $this; - } - - /** - * Draws a line. - * - * @param integer $x1 The x coordinate for the first point. - * @param integer $y1 The y coordinate for the first point. - * @param integer $x2 The x coordinate for the second point. - * @param integer $y2 The y coordinate for the second point. - * @param string|array $color The line color. - * @param integer $thickness The line thickness (default 1). - * @return \claviska\SimpleImage - */ - public function line($x1, $y1, $x2, $y2, $color, $thickness = 1) { - // Allocate the color - $color = $this->allocateColor($color); - - // Draw a line - imagesetthickness($this->image, $thickness); - imageline($this->image, $x1, $y1, $x2, $y2, $color); - - return $this; - } - - /** - * Draws a polygon. - * - * @param array $vertices - * The polygon's vertices in an array of x/y arrays. - * Example: - * [ - * ['x' => x1, 'y' => y1], - * ['x' => x2, 'y' => y2], - * ['x' => xN, 'y' => yN] - * ] - * @param string|array $color The polygon color. - * @param integer|array $thickness Line thickness in pixels or 'filled' (default 1). - * @return \claviska\SimpleImage - */ - public function polygon($vertices, $color, $thickness = 1) { - // Allocate the color - $color = $this->allocateColor($color); - - // Convert [['x' => x1, 'y' => x1], ['x' => x1, 'y' => y2], ...] to [x1, y1, x2, y2, ...] - $points = []; - foreach($vertices as $vals) { - $points[] = $vals['x']; - $points[] = $vals['y']; + return $this; } - // Draw a polygon - if($thickness === 'filled') { - imagesetthickness($this->image, 1); - imagefilledpolygon($this->image, $points, count($vertices), $color); - } else { - imagesetthickness($this->image, $thickness); - imagepolygon($this->image, $points, count($vertices), $color); + /** + * Draws an ellipse. + * + * @param int $x The x coordinate of the center. + * @param int $y The y coordinate of the center. + * @param int $width The ellipse width. + * @param int $height The ellipse height. + * @param string|array $color The ellipse color. + * @param int|array $thickness Line thickness in pixels or 'filled' (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function ellipse(int $x, int $y, int $width, int $height, string|array $color, int|array $thickness = 1): static + { + // Allocate the color + $tempColor = $this->allocateColor($color); + imagesetthickness($this->image, 1); + + // Draw an ellipse + if ($thickness == 'filled') { + imagefilledellipse($this->image, $x, $y, $width, $height, $tempColor); + } elseif ($thickness === 1) { + imageellipse($this->image, $x, $y, $width, $height, $tempColor); + } else { + // New temp image + $tempImage = new SimpleImage(); + $tempImage->fromNew($this->getWidth(), $this->getHeight()); + + // Draw a large ellipse filled with $color (+$thickness pixels) + $tempColor = $tempImage->allocateColor($color); + imagefilledellipse($tempImage->image, $x, $y, $width + $thickness, $height + $thickness, $tempColor); + + // Draw a smaller ellipse filled with red|blue (-$thickness pixels) + $tempColor = (self::normalizeColor($color)['red'] == 255) ? 'blue' : 'red'; + $tempColor = $tempImage->allocateColor($tempColor); + imagefilledellipse($tempImage->image, $x, $y, $width - $thickness, $height - $thickness, $tempColor); + + // Replace the color of the smaller ellipse with 'transparent' + $tempImage->excludeInsideColor($x, $y, $color); + + // Apply the temp image + $this->overlay($tempImage); + } + + return $this; } - return $this; - } + /** + * Fills the image with a solid color. + * + * @param string|array $color The fill color. + * @return SimpleImage + * + * @throws Exception + */ + public function fill(string|array $color): static + { + // Draw a filled rectangle over the entire image + $this->rectangle(0, 0, $this->getWidth(), $this->getHeight(), 'white', 'filled'); - /** - * Draws a rectangle. - * - * @param integer $x1 The upper left x coordinate. - * @param integer $y1 The upper left y coordinate. - * @param integer $x2 The bottom right x coordinate. - * @param integer $y2 The bottom right y coordinate. - * @param string|array $color The rectangle color. - * @param integer|array $thickness Line thickness in pixels or 'filled' (default 1). - * @return \claviska\SimpleImage - */ - public function rectangle($x1, $y1, $x2, $y2, $color, $thickness = 1) { - // Allocate the color - $color = $this->allocateColor($color); + // Now flood it with the appropriate color + $color = $this->allocateColor($color); + imagefill($this->image, 0, 0, $color); - // Draw a rectangle - if($thickness === 'filled') { - imagesetthickness($this->image, 1); - imagefilledrectangle($this->image, $x1, $y1, $x2, $y2, $color); - } else { - imagesetthickness($this->image, $thickness); - imagerectangle($this->image, $x1, $y1, $x2, $y2, $color); + return $this; } - return $this; - } + /** + * Draws a line. + * + * @param int $x1 The x coordinate for the first point. + * @param int $y1 The y coordinate for the first point. + * @param int $x2 The x coordinate for the second point. + * @param int $y2 The y coordinate for the second point. + * @param string|array $color The line color. + * @param int $thickness The line thickness (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function line(int $x1, int $y1, int $x2, int $y2, string|array $color, int $thickness = 1): static + { + // Allocate the color + $color = $this->allocateColor($color); - /** - * Draws a rounded rectangle. - * - * @param integer $x1 The upper left x coordinate. - * @param integer $y1 The upper left y coordinate. - * @param integer $x2 The bottom right x coordinate. - * @param integer $y2 The bottom right y coordinate. - * @param integer $radius The border radius in pixels. - * @param string|array $color The rectangle color. - * @param integer|array $thickness Line thickness in pixels or 'filled' (default 1). - * @return \claviska\SimpleImage - */ - public function roundedRectangle($x1, $y1, $x2, $y2, $radius, $color, $thickness = 1) { - if($thickness === 'filled') { - // Draw the filled rectangle without edges - $this->rectangle($x1 + $radius + 1, $y1, $x2 - $radius - 1, $y2, $color, 'filled'); - $this->rectangle($x1, $y1 + $radius + 1, $x1 + $radius, $y2 - $radius - 1, $color, 'filled'); - $this->rectangle($x2 - $radius, $y1 + $radius + 1, $x2, $y2 - $radius - 1, $color, 'filled'); + // Draw a line + imagesetthickness($this->image, $thickness); + imageline($this->image, $x1, $y1, $x2, $y2, $color); - // Fill in the edges with arcs - $this->arc($x1 + $radius, $y1 + $radius, $radius * 2, $radius * 2, 180, 270, $color, 'filled'); - $this->arc($x2 - $radius, $y1 + $radius, $radius * 2, $radius * 2, 270, 360, $color, 'filled'); - $this->arc($x1 + $radius, $y2 - $radius, $radius * 2, $radius * 2, 90, 180, $color, 'filled'); - $this->arc($x2 - $radius, $y2 - $radius, $radius * 2, $radius * 2, 360, 90, $color, 'filled'); - } else { - $offset = $thickness / 2; - $x1 -= $offset; - $x2 += $offset; - $y1 -= $offset; - $y2 += $offset; - $radius = self::keepWithin($radius, 0, min(($x2 - $x1) / 2, ($y2 - $y1) / 2 ) - 1); - $radius = floor($radius); - $thickness = self::keepWithin($thickness, 1, min(($x2 - $x1) / 2, ($y2 - $y1) / 2)); - - // New temp image - $tempImage = new SimpleImage(); - $tempImage->fromNew($this->getWidth(), $this->getHeight(), 'transparent'); - - // Draw a large rectangle filled with $color - $tempImage->roundedRectangle($x1, $y1, $x2, $y2, $radius, $color,'filled'); - - // Draw a smaller rectangle filled with red|blue (-$thickness pixels on each side) - $tempColor = (self::normalizeColor($color)['red'] == 255) ? 'blue' : 'red'; - $radius = $radius - $thickness; - $radius = self::keepWithin($radius, 0, $radius); - $tempImage->roundedRectangle( - $x1 + $thickness, - $y1 + $thickness, - $x2 - $thickness, - $y2 - $thickness, - $radius, - $tempColor, - 'filled' - ); - - // Replace the color of the smaller rectangle with 'transparent' - $tempImage->excludeInsideColor(($x2 + $x1) / 2, ($y2 + $y1) / 2, $color); - - // Apply the temp image - $this->overlay($tempImage); + return $this; } - return $this; - } + /** + * Draws a polygon. + * + * @param array $vertices + * The polygon's vertices in an array of x/y arrays. + * Example: + * [ + * ['x' => x1, 'y' => y1], + * ['x' => x2, 'y' => y2], + * ['x' => xN, 'y' => yN] + * ] + * @param string|array $color The polygon color. + * @param string|int|array $thickness Line thickness in pixels or 'filled' (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function polygon(array $vertices, string|array $color, string|int|array $thickness = 1): static + { + // Allocate the color + $color = $this->allocateColor($color); - /** - * Exclude inside color. - * Used for roundedRectangle(), ellipse() and arc() - * - * @param number $x certer x of rectangle. - * @param number $y certer y of rectangle. - * @param string|array $borderColor The color of border. - */ - private function excludeInsideColor($x, $y, $borderColor) { - $borderColor = $this->allocateColor($borderColor); - $transparent = $this->allocateColor('transparent'); - imagefilltoborder($this->image, $x, $y, $borderColor, $transparent); - return $this; - } + // Convert [['x' => x1, 'y' => x1], ['x' => x1, 'y' => y2], ...] to [x1, y1, x2, y2, ...] + $points = []; + foreach ($vertices as $vals) { + $points[] = $vals['x']; + $points[] = $vals['y']; + } - ////////////////////////////////////////////////////////////////////////////////////////////////// - // Filters - ////////////////////////////////////////////////////////////////////////////////////////////////// + // Draw a polygon + if ($thickness == 'filled') { + imagesetthickness($this->image, 1); + imagefilledpolygon($this->image, $points, count($vertices), $color); + } else { + imagesetthickness($this->image, $thickness); + imagepolygon($this->image, $points, count($vertices), $color); + } - /** - * Applies the blur filter. - * - * @param string $type The blur algorithm to use: 'selective', 'gaussian' (default 'gaussian'). - * @param number $passes The number of time to apply the filter, enhancing the effect (default 1). - * @return \claviska\SimpleImage - */ - public function blur($type = 'selective', $passes = 1) { - $filter = $type === 'gaussian' ? IMG_FILTER_GAUSSIAN_BLUR : IMG_FILTER_SELECTIVE_BLUR; - - for($i = 0; $i < $passes; $i++) { - imagefilter($this->image, $filter); + return $this; } - return $this; - } + /** + * Draws a rectangle. + * + * @param int $x1 The upper left x coordinate. + * @param int $y1 The upper left y coordinate. + * @param int $x2 The bottom right x coordinate. + * @param int $y2 The bottom right y coordinate. + * @param string|array $color The rectangle color. + * @param string|int|array $thickness Line thickness in pixels or 'filled' (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function rectangle(int $x1, int $y1, int $x2, int $y2, string|array $color, string|int|array $thickness = 1): static + { + // Allocate the color + $color = $this->allocateColor($color); - /** - * Applies the brightness filter to brighten the image. - * - * @param integer $percentage Percentage to brighten the image (0 - 100). - * @return \claviska\SimpleImage - */ - public function brighten($percentage) { - $percentage = self::keepWithin(255 * $percentage / 100, 0, 255); + // Draw a rectangle + if ($thickness == 'filled') { + imagesetthickness($this->image, 1); + imagefilledrectangle($this->image, $x1, $y1, $x2, $y2, $color); + } else { + imagesetthickness($this->image, $thickness); + imagerectangle($this->image, $x1, $y1, $x2, $y2, $color); + } - imagefilter($this->image, IMG_FILTER_BRIGHTNESS, $percentage); - - return $this; - } - - /** - * Applies the colorize filter. - * - * @param string|array $color The filter color. - * @return \claviska\SimpleImage - */ - public function colorize($color) { - $color = self::normalizeColor($color); - - imagefilter( - $this->image, - IMG_FILTER_COLORIZE, - $color['red'], - $color['green'], - $color['blue'], - 127 - ($color['alpha'] * 127) - ); - - return $this; - } - - /** - * Applies the contrast filter. - * - * @param integer $percentage Percentage to adjust (-100 - 100). - * @return \claviska\SimpleImage - */ - public function contrast($percentage) { - imagefilter($this->image, IMG_FILTER_CONTRAST, self::keepWithin($percentage, -100, 100)); - - return $this; - } - - /** - * Applies the brightness filter to darken the image. - * - * @param integer $percentage Percentage to darken the image (0 - 100). - * @return \claviska\SimpleImage - */ - public function darken($percentage) { - $percentage = self::keepWithin(255 * $percentage / 100, 0, 255); - - imagefilter($this->image, IMG_FILTER_BRIGHTNESS, -$percentage); - - return $this; - } - - /** - * Applies the desaturate (grayscale) filter. - * - * @return \claviska\SimpleImage - */ - public function desaturate() { - imagefilter($this->image, IMG_FILTER_GRAYSCALE); - - return $this; - } - - /** - * Applies the edge detect filter. - * - * @return \claviska\SimpleImage - */ - public function edgeDetect() { - imagefilter($this->image, IMG_FILTER_EDGEDETECT); - - return $this; - } - - /** - * Applies the emboss filter. - * - * @return \claviska\SimpleImage - */ - public function emboss() { - imagefilter($this->image, IMG_FILTER_EMBOSS); - - return $this; - } - - /** - * Inverts the image's colors. - * - * @return \claviska\SimpleImage - */ - public function invert() { - imagefilter($this->image, IMG_FILTER_NEGATE); - - return $this; - } - - /** - * Changes the image's opacity level. - * - * @param float $opacity The desired opacity level (0 - 1). - * @return \claviska\SimpleImage - */ - public function opacity($opacity) { - // Create a transparent image - $newImage = new SimpleImage(); - $newImage->fromNew($this->getWidth(), $this->getHeight()); - - // Copy the current image (with opacity) onto the transparent image - self::imageCopyMergeAlpha( - $newImage->image, - $this->image, - 0, 0, - 0, 0, - $this->getWidth(), - $this->getHeight(), - self::keepWithin($opacity, 0, 1) * 100 - ); - - return $this; - } - - /** - * Applies the pixelate filter. - * - * @param integer $size The size of the blocks in pixels (default 10). - * @return \claviska\SimpleImage - */ - public function pixelate($size = 10) { - imagefilter($this->image, IMG_FILTER_PIXELATE, $size, true); - - return $this; - } - - /** - * Simulates a sepia effect by desaturating the image and applying a sepia tone. - * - * @return \claviska\SimpleImage - */ - public function sepia() { - imagefilter($this->image, IMG_FILTER_GRAYSCALE); - imagefilter($this->image, IMG_FILTER_COLORIZE, 70, 35, 0); - - return $this; - } - - /** - * Sharpens the image. - * - * @param integer $amount Sharpening amount (default 50). - * @return \claviska\SimpleImage - */ - public function sharpen($amount = 50) { - // Normalize amount - $amount = max(1, min(100, $amount)) / 100; - - $sharpen = [ - [-1, -1, -1], - [-1, 8 / $amount, -1], - [-1, -1, -1], - ]; - $divisor = array_sum(array_map('array_sum', $sharpen)); - - imageconvolution($this->image, $sharpen, $divisor, 0); - - return $this; - } - - /** - * Applies the mean remove filter to produce a sketch effect. - * - * @return \claviska\SimpleImage - */ - public function sketch() { - imagefilter($this->image, IMG_FILTER_MEAN_REMOVAL); - - return $this; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////// - // Color utilities - ////////////////////////////////////////////////////////////////////////////////////////////////// - - /** - * Converts a "friendly color" into a color identifier for use with GD's image functions. - * - * @param string|array $color The color to allocate. - * @return integer - */ - protected function allocateColor($color) { - $color = self::normalizeColor($color); - - // Was this color already allocated? - $index = imagecolorexactalpha( - $this->image, - $color['red'], - $color['green'], - $color['blue'], - (int) (127 - ($color['alpha'] * 127)) - ); - if($index > -1) { - // Yes, return this color index - return $index; + return $this; } - // Allocate a new color index - return imagecolorallocatealpha( - $this->image, - $color['red'], - $color['green'], - $color['blue'], - 127 - ($color['alpha'] * 127) - ); - } + /** + * Draws a rounded rectangle. + * + * @param int $x1 The upper left x coordinate. + * @param int $y1 The upper left y coordinate. + * @param int $x2 The bottom right x coordinate. + * @param int $y2 The bottom right y coordinate. + * @param int $radius The border radius in pixels. + * @param string|array $color The rectangle color. + * @param string|int|array $thickness Line thickness in pixels or 'filled' (default 1). + * @return SimpleImage + * + * @throws Exception + */ + public function roundedRectangle(int $x1, int $y1, int $x2, int $y2, int $radius, string|array $color, string|int|array $thickness = 1): static + { + if ($thickness == 'filled') { + // Draw the filled rectangle without edges + $this->rectangle($x1 + $radius + 1, $y1, $x2 - $radius - 1, $y2, $color, 'filled'); + $this->rectangle($x1, $y1 + $radius + 1, $x1 + $radius, $y2 - $radius - 1, $color, 'filled'); + $this->rectangle($x2 - $radius, $y1 + $radius + 1, $x2, $y2 - $radius - 1, $color, 'filled'); - /** - * Adjusts a color by increasing/decreasing red/green/blue/alpha values independently. - * - * @param string|array $color The color to adjust. - * @param integer $red Red adjustment (-255 - 255). - * @param integer $green Green adjustment (-255 - 255). - * @param integer $blue Blue adjustment (-255 - 255). - * @param integer $alpha Alpha adjustment (-1 - 1). - * @return integer[] An RGBA color array. - */ - public static function adjustColor($color, $red, $green, $blue, $alpha) { - // Normalize to RGBA - $color = self::normalizeColor($color); + // Fill in the edges with arcs + $this->arc($x1 + $radius, $y1 + $radius, $radius * 2, $radius * 2, 180, 270, $color, 'filled'); + $this->arc($x2 - $radius, $y1 + $radius, $radius * 2, $radius * 2, 270, 360, $color, 'filled'); + $this->arc($x1 + $radius, $y2 - $radius, $radius * 2, $radius * 2, 90, 180, $color, 'filled'); + $this->arc($x2 - $radius, $y2 - $radius, $radius * 2, $radius * 2, 360, 90, $color, 'filled'); + } else { + $offset = $thickness / 2; + $x1 -= $offset; + $x2 += $offset; + $y1 -= $offset; + $y2 += $offset; + $radius = self::keepWithin($radius, 0, min(($x2 - $x1) / 2, ($y2 - $y1) / 2) - 1); + $radius = (int) floor($radius); + $thickness = self::keepWithin($thickness, 1, min(($x2 - $x1) / 2, ($y2 - $y1) / 2)); - // Adjust each channel - return self::normalizeColor([ - 'red' => $color['red'] + $red, - 'green' => $color['green'] + $green, - 'blue' => $color['blue'] + $blue, - 'alpha' => $color['alpha'] + $alpha - ]); - } + // New temp image + $tempImage = new SimpleImage(); + $tempImage->fromNew($this->getWidth(), $this->getHeight()); - /** - * Darkens a color. - * - * @param string|array $color The color to darken. - * @param integer $amount Amount to darken (0 - 255). - * @return integer[] An RGBA color array. - */ - public static function darkenColor($color, $amount) { - return self::adjustColor($color, -$amount, -$amount, -$amount, 0); - } + // Draw a large rectangle filled with $color + $tempImage->roundedRectangle($x1, $y1, $x2, $y2, $radius, $color, 'filled'); - /** - * Extracts colors from an image like a human would do.™ This method requires the third-party - * library \League\ColorExtractor. If you're using Composer, it will be installed for you - * automatically. - * - * @param integer $count The max number of colors to extract (default 5). - * @param string|array $backgroundColor - * By default any pixel with alpha value greater than zero will - * be discarded. This is because transparent colors are not perceived as is. For example, fully - * transparent black would be seen white on a white background. So if you want to take - * transparency into account, you have to specify a default background color. - * @throws \Exception Thrown if library \League\ColorExtractor is missing. - * @return integer[] An array of RGBA colors arrays. - */ - public function extractColors($count = 5, $backgroundColor = null) { - // Check for required library - if(!class_exists('\League\ColorExtractor\ColorExtractor')) { - throw new \Exception( - 'Required library \League\ColorExtractor is missing.', - self::ERR_LIB_NOT_LOADED - ); + // Draw a smaller rectangle filled with red|blue (-$thickness pixels on each side) + $tempColor = (self::normalizeColor($color)['red'] == 255) ? 'blue' : 'red'; + $radius = $radius - $thickness; + $radius = self::keepWithin($radius, 0, $radius); + $tempImage->roundedRectangle( + $x1 + $thickness, + $y1 + $thickness, + $x2 - $thickness, + $y2 - $thickness, + $radius, + $tempColor, + 'filled' + ); + + // Replace the color of the smaller rectangle with 'transparent' + $tempImage->excludeInsideColor(($x2 + $x1) / 2, ($y2 + $y1) / 2, $color); + + // Apply the temp image + $this->overlay($tempImage); + } + + return $this; } - // Convert background color to an integer value - if($backgroundColor) { - $backgroundColor = self::normalizeColor($backgroundColor); - $backgroundColor = \League\ColorExtractor\Color::fromRgbToInt([ - 'r' => $backgroundColor['red'], - 'g' => $backgroundColor['green'], - 'b' => $backgroundColor['blue'] - ]); + /** + * Exclude inside color. + * Used for roundedRectangle(), ellipse() and arc() + * + * @param int $x certer x of rectangle. + * @param int $y certer y of rectangle. + * @param string|array $borderColor The color of border. + * + * @throws Exception + */ + private function excludeInsideColor(int $x, int $y, string|array $borderColor): static + { + $borderColor = $this->allocateColor($borderColor); + $transparent = $this->allocateColor('transparent'); + imagefilltoborder($this->image, $x, $y, $borderColor, $transparent); + + return $this; } - // Extract colors from the image - $palette = \League\ColorExtractor\Palette::fromGD($this->image, $backgroundColor); - $extractor = new \League\ColorExtractor\ColorExtractor($palette); - $colors = $extractor->extract($count); + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Filters + ////////////////////////////////////////////////////////////////////////////////////////////////// - // Convert colors to an RGBA color array - foreach($colors as $key => $value) { - $colors[$key] = self::normalizeColor(\League\ColorExtractor\Color::fromIntToHex($value)); + /** + * Applies the blur filter. + * + * @param string $type The blur algorithm to use: 'selective', 'gaussian' (default 'gaussian'). + * @param int $passes The number of time to apply the filter, enhancing the effect (default 1). + * @return SimpleImage + */ + public function blur(string $type = 'selective', int $passes = 1): static + { + $filter = $type === 'gaussian' ? IMG_FILTER_GAUSSIAN_BLUR : IMG_FILTER_SELECTIVE_BLUR; + + for ($i = 0; $i < $passes; $i++) { + imagefilter($this->image, $filter); + } + + return $this; } - return $colors; - } + /** + * Applies the brightness filter to brighten the image. + * + * @param int $percentage Percentage to brighten the image (0 - 100). + * @return SimpleImage + */ + public function brighten(int $percentage): static + { + $percentage = self::keepWithin(255 * $percentage / 100, 0, 255); - /** - * Gets the RGBA value of a single pixel. - * - * @param integer $x The horizontal position of the pixel. - * @param integer $y The vertical position of the pixel. - * @return integer[] An RGBA color array or false if the x/y position is off the canvas. - */ - public function getColorAt($x, $y) { - // Coordinates must be on the canvas - if($x < 0 || $x > $this->getWidth() || $y < 0 || $y > $this->getHeight()) { - return false; + imagefilter($this->image, IMG_FILTER_BRIGHTNESS, $percentage); + + return $this; } - // Get the color of this pixel and convert it to RGBA - $color = imagecolorat($this->image, $x, $y); - $rgba = imagecolorsforindex($this->image, $color); - $rgba['alpha'] = 127 - ($color >> 24) & 0xFF; + /** + * Applies the colorize filter. + * + * @param string|array $color The filter color. + * @return SimpleImage + * + * @throws Exception + */ + public function colorize(string|array $color): static + { + $color = self::normalizeColor($color); - return $rgba; - } + imagefilter( + $this->image, + IMG_FILTER_COLORIZE, + $color['red'], + $color['green'], + $color['blue'], + 127 - ($color['alpha'] * 127) + ); - /** - * Lightens a color. - * - * @param string|array $color The color to lighten. - * @param integer $amount Amount to lighten (0 - 255). - * @return integer[] An RGBA color array. - */ - public static function lightenColor($color, $amount) { - return self::adjustColor($color, $amount, $amount, $amount, 0); - } - - /** - * Normalizes a hex or array color value to a well-formatted RGBA array. - * - * @param string|array $color - * A CSS color name, hex string, or an array [red, green, blue, alpha]. - * You can pipe alpha transparency through hex strings and color names. For example: - * #fff|0.50 <-- 50% white - * red|0.25 <-- 25% red - * @throws \Exception Thrown if color value is invalid. - * @return array [red, green, blue, alpha]. - */ - public static function normalizeColor($color) { - // 140 CSS color names and hex values - $cssColors = [ - 'aliceblue' => '#f0f8ff', 'antiquewhite' => '#faebd7', 'aqua' => '#00ffff', - 'aquamarine' => '#7fffd4', 'azure' => '#f0ffff', 'beige' => '#f5f5dc', 'bisque' => '#ffe4c4', - 'black' => '#000000', 'blanchedalmond' => '#ffebcd', 'blue' => '#0000ff', - 'blueviolet' => '#8a2be2', 'brown' => '#a52a2a', 'burlywood' => '#deb887', - 'cadetblue' => '#5f9ea0', 'chartreuse' => '#7fff00', 'chocolate' => '#d2691e', - 'coral' => '#ff7f50', 'cornflowerblue' => '#6495ed', 'cornsilk' => '#fff8dc', - 'crimson' => '#dc143c', 'cyan' => '#00ffff', 'darkblue' => '#00008b', 'darkcyan' => '#008b8b', - 'darkgoldenrod' => '#b8860b', 'darkgray' => '#a9a9a9', 'darkgrey' => '#a9a9a9', - 'darkgreen' => '#006400', 'darkkhaki' => '#bdb76b', 'darkmagenta' => '#8b008b', - 'darkolivegreen' => '#556b2f', 'darkorange' => '#ff8c00', 'darkorchid' => '#9932cc', - 'darkred' => '#8b0000', 'darksalmon' => '#e9967a', 'darkseagreen' => '#8fbc8f', - 'darkslateblue' => '#483d8b', 'darkslategray' => '#2f4f4f', 'darkslategrey' => '#2f4f4f', - 'darkturquoise' => '#00ced1', 'darkviolet' => '#9400d3', 'deeppink' => '#ff1493', - 'deepskyblue' => '#00bfff', 'dimgray' => '#696969', 'dimgrey' => '#696969', - 'dodgerblue' => '#1e90ff', 'firebrick' => '#b22222', 'floralwhite' => '#fffaf0', - 'forestgreen' => '#228b22', 'fuchsia' => '#ff00ff', 'gainsboro' => '#dcdcdc', - 'ghostwhite' => '#f8f8ff', 'gold' => '#ffd700', 'goldenrod' => '#daa520', 'gray' => '#808080', - 'grey' => '#808080', 'green' => '#008000', 'greenyellow' => '#adff2f', - 'honeydew' => '#f0fff0', 'hotpink' => '#ff69b4', 'indianred ' => '#cd5c5c', - 'indigo ' => '#4b0082', 'ivory' => '#fffff0', 'khaki' => '#f0e68c', 'lavender' => '#e6e6fa', - 'lavenderblush' => '#fff0f5', 'lawngreen' => '#7cfc00', 'lemonchiffon' => '#fffacd', - 'lightblue' => '#add8e6', 'lightcoral' => '#f08080', 'lightcyan' => '#e0ffff', - 'lightgoldenrodyellow' => '#fafad2', 'lightgray' => '#d3d3d3', 'lightgrey' => '#d3d3d3', - 'lightgreen' => '#90ee90', 'lightpink' => '#ffb6c1', 'lightsalmon' => '#ffa07a', - 'lightseagreen' => '#20b2aa', 'lightskyblue' => '#87cefa', 'lightslategray' => '#778899', - 'lightslategrey' => '#778899', 'lightsteelblue' => '#b0c4de', 'lightyellow' => '#ffffe0', - 'lime' => '#00ff00', 'limegreen' => '#32cd32', 'linen' => '#faf0e6', 'magenta' => '#ff00ff', - 'maroon' => '#800000', 'mediumaquamarine' => '#66cdaa', 'mediumblue' => '#0000cd', - 'mediumorchid' => '#ba55d3', 'mediumpurple' => '#9370db', 'mediumseagreen' => '#3cb371', - 'mediumslateblue' => '#7b68ee', 'mediumspringgreen' => '#00fa9a', - 'mediumturquoise' => '#48d1cc', 'mediumvioletred' => '#c71585', 'midnightblue' => '#191970', - 'mintcream' => '#f5fffa', 'mistyrose' => '#ffe4e1', 'moccasin' => '#ffe4b5', - 'navajowhite' => '#ffdead', 'navy' => '#000080', 'oldlace' => '#fdf5e6', 'olive' => '#808000', - 'olivedrab' => '#6b8e23', 'orange' => '#ffa500', 'orangered' => '#ff4500', - 'orchid' => '#da70d6', 'palegoldenrod' => '#eee8aa', 'palegreen' => '#98fb98', - 'paleturquoise' => '#afeeee', 'palevioletred' => '#db7093', 'papayawhip' => '#ffefd5', - 'peachpuff' => '#ffdab9', 'peru' => '#cd853f', 'pink' => '#ffc0cb', 'plum' => '#dda0dd', - 'powderblue' => '#b0e0e6', 'purple' => '#800080', 'rebeccapurple' => '#663399', - 'red' => '#ff0000', 'rosybrown' => '#bc8f8f', 'royalblue' => '#4169e1', - 'saddlebrown' => '#8b4513', 'salmon' => '#fa8072', 'sandybrown' => '#f4a460', - 'seagreen' => '#2e8b57', 'seashell' => '#fff5ee', 'sienna' => '#a0522d', - 'silver' => '#c0c0c0', 'skyblue' => '#87ceeb', 'slateblue' => '#6a5acd', - 'slategray' => '#708090', 'slategrey' => '#708090', 'snow' => '#fffafa', - 'springgreen' => '#00ff7f', 'steelblue' => '#4682b4', 'tan' => '#d2b48c', 'teal' => '#008080', - 'thistle' => '#d8bfd8', 'tomato' => '#ff6347', 'turquoise' => '#40e0d0', - 'violet' => '#ee82ee', 'wheat' => '#f5deb3', 'white' => '#ffffff', 'whitesmoke' => '#f5f5f5', - 'yellow' => '#ffff00', 'yellowgreen' => '#9acd32' - ]; - - // Parse alpha from '#fff|.5' and 'white|.5' - if(is_string($color) && strstr($color, '|')) { - $color = explode('|', $color); - $alpha = (float) $color[1]; - $color = trim($color[0]); - } else { - $alpha = 1; + return $this; } - // Translate CSS color names to hex values - if(is_string($color) && array_key_exists(strtolower($color), $cssColors)) { - $color = $cssColors[strtolower($color)]; + /** + * Applies the contrast filter. + * + * @param int $percentage Percentage to adjust (-100 - 100). + * @return SimpleImage + */ + public function contrast(int $percentage): static + { + imagefilter($this->image, IMG_FILTER_CONTRAST, self::keepWithin($percentage, -100, 100)); + + return $this; } - // Translate transparent keyword to a transparent color - if($color === 'transparent') { - $color = ['red' => 0, 'green' => 0, 'blue' => 0, 'alpha' => 0]; + /** + * Applies the brightness filter to darken the image. + * + * @param int $percentage Percentage to darken the image (0 - 100). + * @return SimpleImage + */ + public function darken(int $percentage): static + { + $percentage = self::keepWithin(255 * $percentage / 100, 0, 255); + + imagefilter($this->image, IMG_FILTER_BRIGHTNESS, -$percentage); + + return $this; } - // Convert hex values to RGBA - if(is_string($color)) { - // Remove # - $hex = preg_replace('/^#/', '', $color); + /** + * Applies the desaturate (grayscale) filter. + * + * @return SimpleImage + */ + public function desaturate(): static + { + imagefilter($this->image, IMG_FILTER_GRAYSCALE); - // Support short and standard hex codes - if(strlen($hex) === 3) { - list($red, $green, $blue) = [ - $hex[0] . $hex[0], - $hex[1] . $hex[1], - $hex[2] . $hex[2] + return $this; + } + + /** + * Applies the edge detect filter. + * + * @return SimpleImage + */ + public function edgeDetect(): static + { + imagefilter($this->image, IMG_FILTER_EDGEDETECT); + + return $this; + } + + /** + * Applies the emboss filter. + * + * @return SimpleImage + */ + public function emboss(): static + { + imagefilter($this->image, IMG_FILTER_EMBOSS); + + return $this; + } + + /** + * Inverts the image's colors. + * + * @return SimpleImage + */ + public function invert(): static + { + imagefilter($this->image, IMG_FILTER_NEGATE); + + return $this; + } + + /** + * Changes the image's opacity level. + * + * @param float $opacity The desired opacity level (0 - 1). + * @return SimpleImage + * + * @throws Exception + */ + public function opacity(float $opacity): static + { + // Create a transparent image + $newImage = new SimpleImage(); + $newImage->fromNew($this->getWidth(), $this->getHeight()); + + // Copy the current image (with opacity) onto the transparent image + self::imageCopyMergeAlpha( + $newImage->image, + $this->image, + 0, 0, + 0, 0, + $this->getWidth(), + $this->getHeight(), + (int) round(self::keepWithin($opacity, 0, 1) * 100) + ); + + return $this; + } + + /** + * Applies the pixelate filter. + * + * @param int $size The size of the blocks in pixels (default 10). + * @return SimpleImage + */ + public function pixelate(int $size = 10): static + { + imagefilter($this->image, IMG_FILTER_PIXELATE, $size, true); + + return $this; + } + + /** + * Simulates a sepia effect by desaturating the image and applying a sepia tone. + * + * @return SimpleImage + */ + public function sepia(): static + { + imagefilter($this->image, IMG_FILTER_GRAYSCALE); + imagefilter($this->image, IMG_FILTER_COLORIZE, 70, 35, 0); + + return $this; + } + + /** + * Sharpens the image. + * + * @param int $amount Sharpening amount (default 50). + * @return SimpleImage + */ + public function sharpen(int $amount = 50): static + { + // Normalize amount + $amount = max(1, min(100, $amount)) / 100; + + $sharpen = [ + [-1, -1, -1], + [-1, 8 / $amount, -1], + [-1, -1, -1], ]; - } elseif(strlen($hex) === 6) { - list($red, $green, $blue) = [ - $hex[0] . $hex[1], - $hex[2] . $hex[3], - $hex[4] . $hex[5] + $divisor = array_sum(array_map('array_sum', $sharpen)); + + imageconvolution($this->image, $sharpen, $divisor, 0); + + return $this; + } + + /** + * Applies the mean remove filter to produce a sketch effect. + * + * @return SimpleImage + */ + public function sketch(): static + { + imagefilter($this->image, IMG_FILTER_MEAN_REMOVAL); + + return $this; + } + + ////////////////////////////////////////////////////////////////////////////////////////////////// + // Color utilities + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Converts a "friendly color" into a color identifier for use with GD's image functions. + * + * @param string|array $color The color to allocate. + * + * @throws Exception + */ + protected function allocateColor(string|array $color): int + { + $color = self::normalizeColor($color); + + // Was this color already allocated? + $index = imagecolorexactalpha( + $this->image, + $color['red'], + $color['green'], + $color['blue'], + (int) (127 - ($color['alpha'] * 127)) + ); + if ($index > -1) { + // Yes, return this color index + return $index; + } + + // Allocate a new color index + return imagecolorallocatealpha( + $this->image, + $color['red'], + $color['green'], + $color['blue'], + 127 - ($color['alpha'] * 127) + ); + } + + /** + * Adjusts a color by increasing/decreasing red/green/blue/alpha values independently. + * + * @param string|array $color The color to adjust. + * @param int $red Red adjustment (-255 - 255). + * @param int $green Green adjustment (-255 - 255). + * @param int $blue Blue adjustment (-255 - 255). + * @param int $alpha Alpha adjustment (-1 - 1). + * @return int[] An RGBA color array. + * + * @throws Exception + */ + public static function adjustColor(string|array $color, int $red, int $green, int $blue, int $alpha): array + { + // Normalize to RGBA + $color = self::normalizeColor($color); + + // Adjust each channel + return self::normalizeColor([ + 'red' => $color['red'] + $red, + 'green' => $color['green'] + $green, + 'blue' => $color['blue'] + $blue, + 'alpha' => $color['alpha'] + $alpha, + ]); + } + + /** + * Darkens a color. + * + * @param string|array $color The color to darken. + * @param int $amount Amount to darken (0 - 255). + * @return int[] An RGBA color array. + * + * @throws Exception + */ + public static function darkenColor(string|array $color, int $amount): array + { + return self::adjustColor($color, -$amount, -$amount, -$amount, 0); + } + + /** + * Extracts colors from an image like a human would do.™ This method requires the third-party + * library \League\ColorExtractor. If you're using Composer, it will be installed for you + * automatically. + * + * @param int $count The max number of colors to extract (default 5). + * @param string|array|null $backgroundColor + * By default any pixel with alpha value greater than zero will + * be discarded. This is because transparent colors are not perceived as is. For example, fully + * transparent black would be seen white on a white background. So if you want to take + * transparency into account, you have to specify a default background color. + * @return int[] An array of RGBA colors arrays. + * + * @throws Exception Thrown if library \League\ColorExtractor is missing. + */ + public function extractColors(int $count = 5, string|array $backgroundColor = null): array + { + // Check for required library + if (! class_exists('\\'.ColorExtractor::class)) { + throw new Exception( + 'Required library \League\ColorExtractor is missing.', + self::ERR_LIB_NOT_LOADED + ); + } + + // Convert background color to an integer value + if ($backgroundColor) { + $backgroundColor = self::normalizeColor($backgroundColor); + $backgroundColor = Color::fromRgbToInt([ + 'r' => $backgroundColor['red'], + 'g' => $backgroundColor['green'], + 'b' => $backgroundColor['blue'], + ]); + } + + // Extract colors from the image + $palette = Palette::fromGD($this->image, $backgroundColor); + $extractor = new ColorExtractor($palette); + $colors = $extractor->extract($count); + + // Convert colors to an RGBA color array + foreach ($colors as $key => $value) { + $colors[$key] = self::normalizeColor(Color::fromIntToHex($value)); + } + + return $colors; + } + + /** + * Gets the RGBA value of a single pixel. + * + * @param int $x The horizontal position of the pixel. + * @param int $y The vertical position of the pixel. + * @return bool|int[] An RGBA color array or false if the x/y position is off the canvas. + */ + public function getColorAt(int $x, int $y): array|bool + { + // Coordinates must be on the canvas + if ($x < 0 || $x > $this->getWidth() || $y < 0 || $y > $this->getHeight()) { + return false; + } + + // Get the color of this pixel and convert it to RGBA + $color = imagecolorat($this->image, $x, $y); + $rgba = imagecolorsforindex($this->image, $color); + $rgba['alpha'] = 127 - ($color >> 24) & 0xFF; + + return $rgba; + } + + /** + * Lightens a color. + * + * @param string|array $color The color to lighten. + * @param int $amount Amount to lighten (0 - 255). + * @return int[] An RGBA color array. + * + * @throws Exception + */ + public static function lightenColor(string|array $color, int $amount): array + { + return self::adjustColor($color, $amount, $amount, $amount, 0); + } + + /** + * Normalizes a hex or array color value to a well-formatted RGBA array. + * + * @param string|array $color + * A CSS color name, hex string, or an array [red, green, blue, alpha]. + * You can pipe alpha transparency through hex strings and color names. For example: + * #fff|0.50 <-- 50% white + * red|0.25 <-- 25% red + * @return array [red, green, blue, alpha]. + * + * @throws Exception Thrown if color value is invalid. + */ + public static function normalizeColor(string|array $color): array + { + // 140 CSS color names and hex values + $cssColors = [ + 'aliceblue' => '#f0f8ff', 'antiquewhite' => '#faebd7', 'aqua' => '#00ffff', + 'aquamarine' => '#7fffd4', 'azure' => '#f0ffff', 'beige' => '#f5f5dc', 'bisque' => '#ffe4c4', + 'black' => '#000000', 'blanchedalmond' => '#ffebcd', 'blue' => '#0000ff', + 'blueviolet' => '#8a2be2', 'brown' => '#a52a2a', 'burlywood' => '#deb887', + 'cadetblue' => '#5f9ea0', 'chartreuse' => '#7fff00', 'chocolate' => '#d2691e', + 'coral' => '#ff7f50', 'cornflowerblue' => '#6495ed', 'cornsilk' => '#fff8dc', + 'crimson' => '#dc143c', 'cyan' => '#00ffff', 'darkblue' => '#00008b', 'darkcyan' => '#008b8b', + 'darkgoldenrod' => '#b8860b', 'darkgray' => '#a9a9a9', 'darkgrey' => '#a9a9a9', + 'darkgreen' => '#006400', 'darkkhaki' => '#bdb76b', 'darkmagenta' => '#8b008b', + 'darkolivegreen' => '#556b2f', 'darkorange' => '#ff8c00', 'darkorchid' => '#9932cc', + 'darkred' => '#8b0000', 'darksalmon' => '#e9967a', 'darkseagreen' => '#8fbc8f', + 'darkslateblue' => '#483d8b', 'darkslategray' => '#2f4f4f', 'darkslategrey' => '#2f4f4f', + 'darkturquoise' => '#00ced1', 'darkviolet' => '#9400d3', 'deeppink' => '#ff1493', + 'deepskyblue' => '#00bfff', 'dimgray' => '#696969', 'dimgrey' => '#696969', + 'dodgerblue' => '#1e90ff', 'firebrick' => '#b22222', 'floralwhite' => '#fffaf0', + 'forestgreen' => '#228b22', 'fuchsia' => '#ff00ff', 'gainsboro' => '#dcdcdc', + 'ghostwhite' => '#f8f8ff', 'gold' => '#ffd700', 'goldenrod' => '#daa520', 'gray' => '#808080', + 'grey' => '#808080', 'green' => '#008000', 'greenyellow' => '#adff2f', + 'honeydew' => '#f0fff0', 'hotpink' => '#ff69b4', 'indianred ' => '#cd5c5c', + 'indigo ' => '#4b0082', 'ivory' => '#fffff0', 'khaki' => '#f0e68c', 'lavender' => '#e6e6fa', + 'lavenderblush' => '#fff0f5', 'lawngreen' => '#7cfc00', 'lemonchiffon' => '#fffacd', + 'lightblue' => '#add8e6', 'lightcoral' => '#f08080', 'lightcyan' => '#e0ffff', + 'lightgoldenrodyellow' => '#fafad2', 'lightgray' => '#d3d3d3', 'lightgrey' => '#d3d3d3', + 'lightgreen' => '#90ee90', 'lightpink' => '#ffb6c1', 'lightsalmon' => '#ffa07a', + 'lightseagreen' => '#20b2aa', 'lightskyblue' => '#87cefa', 'lightslategray' => '#778899', + 'lightslategrey' => '#778899', 'lightsteelblue' => '#b0c4de', 'lightyellow' => '#ffffe0', + 'lime' => '#00ff00', 'limegreen' => '#32cd32', 'linen' => '#faf0e6', 'magenta' => '#ff00ff', + 'maroon' => '#800000', 'mediumaquamarine' => '#66cdaa', 'mediumblue' => '#0000cd', + 'mediumorchid' => '#ba55d3', 'mediumpurple' => '#9370db', 'mediumseagreen' => '#3cb371', + 'mediumslateblue' => '#7b68ee', 'mediumspringgreen' => '#00fa9a', + 'mediumturquoise' => '#48d1cc', 'mediumvioletred' => '#c71585', 'midnightblue' => '#191970', + 'mintcream' => '#f5fffa', 'mistyrose' => '#ffe4e1', 'moccasin' => '#ffe4b5', + 'navajowhite' => '#ffdead', 'navy' => '#000080', 'oldlace' => '#fdf5e6', 'olive' => '#808000', + 'olivedrab' => '#6b8e23', 'orange' => '#ffa500', 'orangered' => '#ff4500', + 'orchid' => '#da70d6', 'palegoldenrod' => '#eee8aa', 'palegreen' => '#98fb98', + 'paleturquoise' => '#afeeee', 'palevioletred' => '#db7093', 'papayawhip' => '#ffefd5', + 'peachpuff' => '#ffdab9', 'peru' => '#cd853f', 'pink' => '#ffc0cb', 'plum' => '#dda0dd', + 'powderblue' => '#b0e0e6', 'purple' => '#800080', 'rebeccapurple' => '#663399', + 'red' => '#ff0000', 'rosybrown' => '#bc8f8f', 'royalblue' => '#4169e1', + 'saddlebrown' => '#8b4513', 'salmon' => '#fa8072', 'sandybrown' => '#f4a460', + 'seagreen' => '#2e8b57', 'seashell' => '#fff5ee', 'sienna' => '#a0522d', + 'silver' => '#c0c0c0', 'skyblue' => '#87ceeb', 'slateblue' => '#6a5acd', + 'slategray' => '#708090', 'slategrey' => '#708090', 'snow' => '#fffafa', + 'springgreen' => '#00ff7f', 'steelblue' => '#4682b4', 'tan' => '#d2b48c', 'teal' => '#008080', + 'thistle' => '#d8bfd8', 'tomato' => '#ff6347', 'turquoise' => '#40e0d0', + 'violet' => '#ee82ee', 'wheat' => '#f5deb3', 'white' => '#ffffff', 'whitesmoke' => '#f5f5f5', + 'yellow' => '#ffff00', 'yellowgreen' => '#9acd32', ]; - } else { - throw new \Exception("Invalid color value: $color", self::ERR_INVALID_COLOR); - } - // Turn color into an array - $color = [ - 'red' => hexdec($red), - 'green' => hexdec($green), - 'blue' => hexdec($blue), - 'alpha' => $alpha - ]; + // Parse alpha from '#fff|.5' and 'white|.5' + if (is_string($color) && strstr($color, '|')) { + $color = explode('|', $color); + $alpha = (float) $color[1]; + $color = trim($color[0]); + } else { + $alpha = 1; + } + + // Translate CSS color names to hex values + if (is_string($color) && array_key_exists(strtolower($color), $cssColors)) { + $color = $cssColors[strtolower($color)]; + } + + // Translate transparent keyword to a transparent color + if ($color === 'transparent') { + $color = ['red' => 0, 'green' => 0, 'blue' => 0, 'alpha' => 0]; + } + + // Convert hex values to RGBA + if (is_string($color)) { + // Remove # + $hex = strval(preg_replace('/^#/', '', $color)); + + // Support short and standard hex codes + if (strlen($hex) === 3) { + [$red, $green, $blue] = [ + $hex[0].$hex[0], + $hex[1].$hex[1], + $hex[2].$hex[2], + ]; + } elseif (strlen($hex) === 6) { + [$red, $green, $blue] = [ + $hex[0].$hex[1], + $hex[2].$hex[3], + $hex[4].$hex[5], + ]; + } else { + throw new Exception("Invalid color value: $color", self::ERR_INVALID_COLOR); + } + + // Turn color into an array + $color = [ + 'red' => hexdec($red), + 'green' => hexdec($green), + 'blue' => hexdec($blue), + 'alpha' => $alpha, + ]; + } + + // Enforce color value ranges + if (is_array($color)) { + // RGB default to 0 + $color['red'] ??= 0; + $color['green'] ??= 0; + $color['blue'] ??= 0; + + // Alpha defaults to 1 + $color['alpha'] ??= 1; + + return [ + 'red' => (int) self::keepWithin((int) $color['red'], 0, 255), + 'green' => (int) self::keepWithin((int) $color['green'], 0, 255), + 'blue' => (int) self::keepWithin((int) $color['blue'], 0, 255), + 'alpha' => self::keepWithin($color['alpha'], 0, 1), + ]; + } + + throw new Exception("Invalid color value: $color", self::ERR_INVALID_COLOR); } - - // Enforce color value ranges - if(is_array($color)) { - // RGB default to 0 - $color['red'] = isset($color['red']) ? $color['red'] : 0; - $color['green'] = isset($color['green']) ? $color['green'] : 0; - $color['blue'] = isset($color['blue']) ? $color['blue'] : 0; - - // Alpha defaults to 1 - $color['alpha'] = isset($color['alpha']) ? $color['alpha'] : 1; - - return [ - 'red' => (int) self::keepWithin((int) $color['red'], 0, 255), - 'green' => (int) self::keepWithin((int) $color['green'], 0, 255), - 'blue' => (int) self::keepWithin((int) $color['blue'], 0, 255), - 'alpha' => self::keepWithin($color['alpha'], 0, 1) - ]; - } - - throw new \Exception("Invalid color value: $color", self::ERR_INVALID_COLOR); - } - } diff --git a/kirby/vendor/composer/ClassLoader.php b/kirby/vendor/composer/ClassLoader.php index afef3fa..a72151c 100644 --- a/kirby/vendor/composer/ClassLoader.php +++ b/kirby/vendor/composer/ClassLoader.php @@ -42,6 +42,9 @@ namespace Composer\Autoload; */ class ClassLoader { + /** @var \Closure(string):void */ + private static $includeFile; + /** @var ?string */ private $vendorDir; @@ -106,6 +109,7 @@ class ClassLoader public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); } /** @@ -425,7 +429,8 @@ class ClassLoader public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } @@ -555,18 +560,26 @@ class ClassLoader return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private - */ -function includeFile($file) -{ - include $file; + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } } diff --git a/kirby/vendor/composer/autoload_classmap.php b/kirby/vendor/composer/autoload_classmap.php index 4f29f1e..61e1f45 100644 --- a/kirby/vendor/composer/autoload_classmap.php +++ b/kirby/vendor/composer/autoload_classmap.php @@ -46,12 +46,12 @@ return array( 'Kirby\\Cms\\AppPlugins' => $baseDir . '/src/Cms/AppPlugins.php', 'Kirby\\Cms\\AppTranslations' => $baseDir . '/src/Cms/AppTranslations.php', 'Kirby\\Cms\\AppUsers' => $baseDir . '/src/Cms/AppUsers.php', - 'Kirby\\Cms\\AppUsersImpersonateProxy' => $baseDir . '/src/Cms/AppUsersImpersonateProxy.php', 'Kirby\\Cms\\Auth' => $baseDir . '/src/Cms/Auth.php', 'Kirby\\Cms\\Auth\\Challenge' => $baseDir . '/src/Cms/Auth/Challenge.php', 'Kirby\\Cms\\Auth\\EmailChallenge' => $baseDir . '/src/Cms/Auth/EmailChallenge.php', 'Kirby\\Cms\\Auth\\Status' => $baseDir . '/src/Cms/Auth/Status.php', 'Kirby\\Cms\\Block' => $baseDir . '/src/Cms/Block.php', + 'Kirby\\Cms\\BlockConverter' => $baseDir . '/src/Cms/BlockConverter.php', 'Kirby\\Cms\\Blocks' => $baseDir . '/src/Cms/Blocks.php', 'Kirby\\Cms\\Blueprint' => $baseDir . '/src/Cms/Blueprint.php', 'Kirby\\Cms\\Collection' => $baseDir . '/src/Cms/Collection.php', @@ -132,7 +132,6 @@ return array( 'Kirby\\Cms\\StructureObject' => $baseDir . '/src/Cms/StructureObject.php', 'Kirby\\Cms\\System' => $baseDir . '/src/Cms/System.php', 'Kirby\\Cms\\System\\UpdateStatus' => $baseDir . '/src/Cms/System/UpdateStatus.php', - 'Kirby\\Cms\\Template' => $baseDir . '/src/Cms/Template.php', 'Kirby\\Cms\\Translation' => $baseDir . '/src/Cms/Translation.php', 'Kirby\\Cms\\Translations' => $baseDir . '/src/Cms/Translations.php', 'Kirby\\Cms\\Url' => $baseDir . '/src/Cms/Url.php', @@ -271,6 +270,10 @@ return array( 'Kirby\\Session\\SessionData' => $baseDir . '/src/Session/SessionData.php', 'Kirby\\Session\\SessionStore' => $baseDir . '/src/Session/SessionStore.php', 'Kirby\\Session\\Sessions' => $baseDir . '/src/Session/Sessions.php', + 'Kirby\\Template\\Slot' => $baseDir . '/src/Template/Slot.php', + 'Kirby\\Template\\Slots' => $baseDir . '/src/Template/Slots.php', + 'Kirby\\Template\\Snippet' => $baseDir . '/src/Template/Snippet.php', + 'Kirby\\Template\\Template' => $baseDir . '/src/Template/Template.php', 'Kirby\\Text\\KirbyTag' => $baseDir . '/src/Text/KirbyTag.php', 'Kirby\\Text\\KirbyTags' => $baseDir . '/src/Text/KirbyTags.php', 'Kirby\\Text\\Markdown' => $baseDir . '/src/Text/Markdown.php', @@ -315,12 +318,13 @@ return array( 'Laminas\\Escaper\\Exception\\ExceptionInterface' => $vendorDir . '/laminas/laminas-escaper/src/Exception/ExceptionInterface.php', 'Laminas\\Escaper\\Exception\\InvalidArgumentException' => $vendorDir . '/laminas/laminas-escaper/src/Exception/InvalidArgumentException.php', 'Laminas\\Escaper\\Exception\\RuntimeException' => $vendorDir . '/laminas/laminas-escaper/src/Exception/RuntimeException.php', - 'League\\ColorExtractor\\Color' => $vendorDir . '/league/color-extractor/src/League/ColorExtractor/Color.php', - 'League\\ColorExtractor\\ColorExtractor' => $vendorDir . '/league/color-extractor/src/League/ColorExtractor/ColorExtractor.php', - 'League\\ColorExtractor\\Palette' => $vendorDir . '/league/color-extractor/src/League/ColorExtractor/Palette.php', + 'League\\ColorExtractor\\Color' => $vendorDir . '/league/color-extractor/src/Color.php', + 'League\\ColorExtractor\\ColorExtractor' => $vendorDir . '/league/color-extractor/src/ColorExtractor.php', + 'League\\ColorExtractor\\Palette' => $vendorDir . '/league/color-extractor/src/Palette.php', 'Michelf\\SmartyPants' => $vendorDir . '/michelf/php-smartypants/Michelf/SmartyPants.php', 'Michelf\\SmartyPantsTypographer' => $vendorDir . '/michelf/php-smartypants/Michelf/SmartyPantsTypographer.php', 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', + 'PHPMailer\\PHPMailer\\DSNConfigurator' => $vendorDir . '/phpmailer/phpmailer/src/DSNConfigurator.php', 'PHPMailer\\PHPMailer\\Exception' => $vendorDir . '/phpmailer/phpmailer/src/Exception.php', 'PHPMailer\\PHPMailer\\OAuth' => $vendorDir . '/phpmailer/phpmailer/src/OAuth.php', 'PHPMailer\\PHPMailer\\OAuthTokenProvider' => $vendorDir . '/phpmailer/phpmailer/src/OAuthTokenProvider.php', @@ -356,6 +360,9 @@ return array( 'Whoops\\Handler\\PlainTextHandler' => $vendorDir . '/filp/whoops/src/Whoops/Handler/PlainTextHandler.php', 'Whoops\\Handler\\PrettyPageHandler' => $vendorDir . '/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php', 'Whoops\\Handler\\XmlResponseHandler' => $vendorDir . '/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php', + 'Whoops\\Inspector\\InspectorFactory' => $vendorDir . '/filp/whoops/src/Whoops/Inspector/InspectorFactory.php', + 'Whoops\\Inspector\\InspectorFactoryInterface' => $vendorDir . '/filp/whoops/src/Whoops/Inspector/InspectorFactoryInterface.php', + 'Whoops\\Inspector\\InspectorInterface' => $vendorDir . '/filp/whoops/src/Whoops/Inspector/InspectorInterface.php', 'Whoops\\Run' => $vendorDir . '/filp/whoops/src/Whoops/Run.php', 'Whoops\\RunInterface' => $vendorDir . '/filp/whoops/src/Whoops/RunInterface.php', 'Whoops\\Util\\HtmlDumperOutput' => $vendorDir . '/filp/whoops/src/Whoops/Util/HtmlDumperOutput.php', diff --git a/kirby/vendor/composer/autoload_psr4.php b/kirby/vendor/composer/autoload_psr4.php index 2f9a882..46ac143 100644 --- a/kirby/vendor/composer/autoload_psr4.php +++ b/kirby/vendor/composer/autoload_psr4.php @@ -12,8 +12,8 @@ return array( 'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'), 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'), + 'League\\ColorExtractor\\' => array($vendorDir . '/league/color-extractor/src'), 'Laminas\\Escaper\\' => array($vendorDir . '/laminas/laminas-escaper/src'), 'Kirby\\' => array($baseDir . '/src', $vendorDir . '/getkirby/composer-installer/src'), 'Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'), - '' => array($vendorDir . '/league/color-extractor/src'), ); diff --git a/kirby/vendor/composer/autoload_real.php b/kirby/vendor/composer/autoload_real.php index fe2eb1e..094ef14 100644 --- a/kirby/vendor/composer/autoload_real.php +++ b/kirby/vendor/composer/autoload_real.php @@ -31,25 +31,18 @@ class ComposerAutoloaderInita8011b477bb239488e5d139cdeb7b31e $loader->register(true); - $includeFiles = \Composer\Autoload\ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$files; - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequirea8011b477bb239488e5d139cdeb7b31e($fileIdentifier, $file); + $filesToLoad = \Composer\Autoload\ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); } return $loader; } } - -/** - * @param string $fileIdentifier - * @param string $file - * @return void - */ -function composerRequirea8011b477bb239488e5d139cdeb7b31e($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } -} diff --git a/kirby/vendor/composer/autoload_static.php b/kirby/vendor/composer/autoload_static.php index 73e9e99..f9dfbf0 100644 --- a/kirby/vendor/composer/autoload_static.php +++ b/kirby/vendor/composer/autoload_static.php @@ -32,6 +32,7 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e ), 'L' => array ( + 'League\\ColorExtractor\\' => 22, 'Laminas\\Escaper\\' => 16, ), 'K' => @@ -69,6 +70,10 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e array ( 0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src', ), + 'League\\ColorExtractor\\' => + array ( + 0 => __DIR__ . '/..' . '/league/color-extractor/src', + ), 'Laminas\\Escaper\\' => array ( 0 => __DIR__ . '/..' . '/laminas/laminas-escaper/src', @@ -84,10 +89,6 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e ), ); - public static $fallbackDirsPsr4 = array ( - 0 => __DIR__ . '/..' . '/league/color-extractor/src', - ); - public static $prefixesPsr0 = array ( 'c' => array ( @@ -146,12 +147,12 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e 'Kirby\\Cms\\AppPlugins' => __DIR__ . '/../..' . '/src/Cms/AppPlugins.php', 'Kirby\\Cms\\AppTranslations' => __DIR__ . '/../..' . '/src/Cms/AppTranslations.php', 'Kirby\\Cms\\AppUsers' => __DIR__ . '/../..' . '/src/Cms/AppUsers.php', - 'Kirby\\Cms\\AppUsersImpersonateProxy' => __DIR__ . '/../..' . '/src/Cms/AppUsersImpersonateProxy.php', 'Kirby\\Cms\\Auth' => __DIR__ . '/../..' . '/src/Cms/Auth.php', 'Kirby\\Cms\\Auth\\Challenge' => __DIR__ . '/../..' . '/src/Cms/Auth/Challenge.php', 'Kirby\\Cms\\Auth\\EmailChallenge' => __DIR__ . '/../..' . '/src/Cms/Auth/EmailChallenge.php', 'Kirby\\Cms\\Auth\\Status' => __DIR__ . '/../..' . '/src/Cms/Auth/Status.php', 'Kirby\\Cms\\Block' => __DIR__ . '/../..' . '/src/Cms/Block.php', + 'Kirby\\Cms\\BlockConverter' => __DIR__ . '/../..' . '/src/Cms/BlockConverter.php', 'Kirby\\Cms\\Blocks' => __DIR__ . '/../..' . '/src/Cms/Blocks.php', 'Kirby\\Cms\\Blueprint' => __DIR__ . '/../..' . '/src/Cms/Blueprint.php', 'Kirby\\Cms\\Collection' => __DIR__ . '/../..' . '/src/Cms/Collection.php', @@ -232,7 +233,6 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e 'Kirby\\Cms\\StructureObject' => __DIR__ . '/../..' . '/src/Cms/StructureObject.php', 'Kirby\\Cms\\System' => __DIR__ . '/../..' . '/src/Cms/System.php', 'Kirby\\Cms\\System\\UpdateStatus' => __DIR__ . '/../..' . '/src/Cms/System/UpdateStatus.php', - 'Kirby\\Cms\\Template' => __DIR__ . '/../..' . '/src/Cms/Template.php', 'Kirby\\Cms\\Translation' => __DIR__ . '/../..' . '/src/Cms/Translation.php', 'Kirby\\Cms\\Translations' => __DIR__ . '/../..' . '/src/Cms/Translations.php', 'Kirby\\Cms\\Url' => __DIR__ . '/../..' . '/src/Cms/Url.php', @@ -371,6 +371,10 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e 'Kirby\\Session\\SessionData' => __DIR__ . '/../..' . '/src/Session/SessionData.php', 'Kirby\\Session\\SessionStore' => __DIR__ . '/../..' . '/src/Session/SessionStore.php', 'Kirby\\Session\\Sessions' => __DIR__ . '/../..' . '/src/Session/Sessions.php', + 'Kirby\\Template\\Slot' => __DIR__ . '/../..' . '/src/Template/Slot.php', + 'Kirby\\Template\\Slots' => __DIR__ . '/../..' . '/src/Template/Slots.php', + 'Kirby\\Template\\Snippet' => __DIR__ . '/../..' . '/src/Template/Snippet.php', + 'Kirby\\Template\\Template' => __DIR__ . '/../..' . '/src/Template/Template.php', 'Kirby\\Text\\KirbyTag' => __DIR__ . '/../..' . '/src/Text/KirbyTag.php', 'Kirby\\Text\\KirbyTags' => __DIR__ . '/../..' . '/src/Text/KirbyTags.php', 'Kirby\\Text\\Markdown' => __DIR__ . '/../..' . '/src/Text/Markdown.php', @@ -415,12 +419,13 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e 'Laminas\\Escaper\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/laminas/laminas-escaper/src/Exception/ExceptionInterface.php', 'Laminas\\Escaper\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/laminas/laminas-escaper/src/Exception/InvalidArgumentException.php', 'Laminas\\Escaper\\Exception\\RuntimeException' => __DIR__ . '/..' . '/laminas/laminas-escaper/src/Exception/RuntimeException.php', - 'League\\ColorExtractor\\Color' => __DIR__ . '/..' . '/league/color-extractor/src/League/ColorExtractor/Color.php', - 'League\\ColorExtractor\\ColorExtractor' => __DIR__ . '/..' . '/league/color-extractor/src/League/ColorExtractor/ColorExtractor.php', - 'League\\ColorExtractor\\Palette' => __DIR__ . '/..' . '/league/color-extractor/src/League/ColorExtractor/Palette.php', + 'League\\ColorExtractor\\Color' => __DIR__ . '/..' . '/league/color-extractor/src/Color.php', + 'League\\ColorExtractor\\ColorExtractor' => __DIR__ . '/..' . '/league/color-extractor/src/ColorExtractor.php', + 'League\\ColorExtractor\\Palette' => __DIR__ . '/..' . '/league/color-extractor/src/Palette.php', 'Michelf\\SmartyPants' => __DIR__ . '/..' . '/michelf/php-smartypants/Michelf/SmartyPants.php', 'Michelf\\SmartyPantsTypographer' => __DIR__ . '/..' . '/michelf/php-smartypants/Michelf/SmartyPantsTypographer.php', 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', + 'PHPMailer\\PHPMailer\\DSNConfigurator' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/DSNConfigurator.php', 'PHPMailer\\PHPMailer\\Exception' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/Exception.php', 'PHPMailer\\PHPMailer\\OAuth' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/OAuth.php', 'PHPMailer\\PHPMailer\\OAuthTokenProvider' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/OAuthTokenProvider.php', @@ -456,6 +461,9 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e 'Whoops\\Handler\\PlainTextHandler' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Handler/PlainTextHandler.php', 'Whoops\\Handler\\PrettyPageHandler' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php', 'Whoops\\Handler\\XmlResponseHandler' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php', + 'Whoops\\Inspector\\InspectorFactory' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Inspector/InspectorFactory.php', + 'Whoops\\Inspector\\InspectorFactoryInterface' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Inspector/InspectorFactoryInterface.php', + 'Whoops\\Inspector\\InspectorInterface' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Inspector/InspectorInterface.php', 'Whoops\\Run' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Run.php', 'Whoops\\RunInterface' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/RunInterface.php', 'Whoops\\Util\\HtmlDumperOutput' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Util/HtmlDumperOutput.php', @@ -470,7 +478,6 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$prefixDirsPsr4; - $loader->fallbackDirsPsr4 = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$fallbackDirsPsr4; $loader->prefixesPsr0 = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$prefixesPsr0; $loader->classMap = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$classMap; diff --git a/kirby/vendor/composer/installed.json b/kirby/vendor/composer/installed.json index 5fb44d7..964dee6 100644 --- a/kirby/vendor/composer/installed.json +++ b/kirby/vendor/composer/installed.json @@ -2,25 +2,29 @@ "packages": [ { "name": "claviska/simpleimage", - "version": "3.7.0", - "version_normalized": "3.7.0.0", + "version": "4.0.2", + "version_normalized": "4.0.2.0", "source": { "type": "git", "url": "https://github.com/claviska/SimpleImage.git", - "reference": "abd15ced313c7b8041d7d73d8d2398b4f2510cf1" + "reference": "226d507cca0c8400d69bee7eb324158e3cbe246e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/claviska/SimpleImage/zipball/abd15ced313c7b8041d7d73d8d2398b4f2510cf1", - "reference": "abd15ced313c7b8041d7d73d8d2398b4f2510cf1", + "url": "https://api.github.com/repos/claviska/SimpleImage/zipball/226d507cca0c8400d69bee7eb324158e3cbe246e", + "reference": "226d507cca0c8400d69bee7eb324158e3cbe246e", "shasum": "" }, "require": { "ext-gd": "*", - "league/color-extractor": "0.3.*", - "php": ">=5.6.0" + "league/color-extractor": "0.4.*", + "php": ">=8.0" }, - "time": "2022-07-05T13:18:44+00:00", + "require-dev": { + "laravel/pint": "^1.5", + "phpstan/phpstan": "^1.10" + }, + "time": "2023-03-20T15:27:20+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -42,7 +46,7 @@ "description": "A PHP class that makes working with images as simple as possible.", "support": { "issues": "https://github.com/claviska/SimpleImage/issues", - "source": "https://github.com/claviska/SimpleImage/tree/3.7.0" + "source": "https://github.com/claviska/SimpleImage/tree/4.0.2" }, "funding": [ { @@ -138,17 +142,17 @@ }, { "name": "filp/whoops", - "version": "2.14.6", - "version_normalized": "2.14.6.0", + "version": "2.15.1", + "version_normalized": "2.15.1.0", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "f7948baaa0330277c729714910336383286305da" + "reference": "e864ac957acd66e1565f25efda61e37791a5db0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/f7948baaa0330277c729714910336383286305da", - "reference": "f7948baaa0330277c729714910336383286305da", + "url": "https://api.github.com/repos/filp/whoops/zipball/e864ac957acd66e1565f25efda61e37791a5db0b", + "reference": "e864ac957acd66e1565f25efda61e37791a5db0b", "shasum": "" }, "require": { @@ -164,7 +168,7 @@ "symfony/var-dumper": "Pretty print complex values better with var-dumper available", "whoops/soap": "Formats errors as SOAP responses" }, - "time": "2022-11-02T16:23:29+00:00", + "time": "2023-03-06T18:09:13+00:00", "type": "library", "extra": { "branch-alias": { @@ -200,7 +204,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.14.6" + "source": "https://github.com/filp/whoops/tree/2.15.1" }, "funding": [ { @@ -327,36 +331,39 @@ }, { "name": "league/color-extractor", - "version": "0.3.2", - "version_normalized": "0.3.2.0", + "version": "0.4.0", + "version_normalized": "0.4.0.0", "source": { "type": "git", "url": "https://github.com/thephpleague/color-extractor.git", - "reference": "837086ec60f50c84c611c613963e4ad2e2aec806" + "reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/color-extractor/zipball/837086ec60f50c84c611c613963e4ad2e2aec806", - "reference": "837086ec60f50c84c611c613963e4ad2e2aec806", + "url": "https://api.github.com/repos/thephpleague/color-extractor/zipball/21fcac6249c5ef7d00eb83e128743ee6678fe505", + "reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505", "shasum": "" }, "require": { "ext-gd": "*", - "php": ">=5.4.0" + "php": "^7.3 || ^8.0" }, "replace": { "matthecat/colorextractor": "*" }, "require-dev": { "friendsofphp/php-cs-fixer": "~2", - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^9.5" }, - "time": "2016-12-15T09:30:02+00:00", + "suggest": { + "ext-curl": "To download images from remote URLs if allow_url_fopen is disabled for security reasons" + }, + "time": "2022-09-24T15:57:16+00:00", "type": "library", "installation-source": "dist", "autoload": { "psr-4": { - "": "src" + "League\\ColorExtractor\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -382,7 +389,7 @@ ], "support": { "issues": "https://github.com/thephpleague/color-extractor/issues", - "source": "https://github.com/thephpleague/color-extractor/tree/master" + "source": "https://github.com/thephpleague/color-extractor/tree/0.4.0" }, "install-path": "../league/color-extractor" }, @@ -445,17 +452,17 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.6.5", - "version_normalized": "6.6.5.0", + "version": "v6.8.0", + "version_normalized": "6.8.0.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627" + "reference": "df16b615e371d81fb79e506277faea67a1be18f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/8b6386d7417526d1ea4da9edb70b8352f7543627", - "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/df16b615e371d81fb79e506277faea67a1be18f1", + "reference": "df16b615e371d81fb79e506277faea67a1be18f1", "shasum": "" }, "require": { @@ -465,24 +472,26 @@ "php": ">=5.5.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.2", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "doctrine/annotations": "^1.2.6 || ^1.13.3", "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.6.2", - "yoast/phpunit-polyfills": "^1.0.0" + "squizlabs/php_codesniffer": "^3.7.1", + "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, - "time": "2022-10-07T12:23:10+00:00", + "time": "2023-03-06T14:43:22+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -514,7 +523,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.5" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.0" }, "funding": [ { @@ -579,17 +588,17 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.26.0", - "version_normalized": "1.26.0.0", + "version": "v1.27.0", + "version_normalized": "1.27.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8" + "reference": "639084e360537a19f9ee352433b84ce831f3d2da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/59a8d271f00dd0e4c2e518104cc7963f655a1aa8", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", + "reference": "639084e360537a19f9ee352433b84ce831f3d2da", "shasum": "" }, "require": { @@ -600,11 +609,11 @@ "suggest": { "ext-intl": "For best performance" }, - "time": "2022-05-24T11:49:31+00:00", + "time": "2022-11-03T14:55:06+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -649,7 +658,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.27.0" }, "funding": [ { @@ -756,17 +765,17 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", - "version_normalized": "1.26.0.0", + "version": "v1.27.0", + "version_normalized": "1.27.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "shasum": "" }, "require": { @@ -778,11 +787,11 @@ "suggest": { "ext-mbstring": "For best performance" }, - "time": "2022-05-24T11:49:31+00:00", + "time": "2022-11-03T14:55:06+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -822,7 +831,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" }, "funding": [ { diff --git a/kirby/vendor/composer/installed.php b/kirby/vendor/composer/installed.php index 1db40b7..43abf81 100644 --- a/kirby/vendor/composer/installed.php +++ b/kirby/vendor/composer/installed.php @@ -1,8 +1,8 @@ array( 'name' => 'getkirby/cms', - 'pretty_version' => '3.8.3', - 'version' => '3.8.3.0', + 'pretty_version' => '3.9.3', + 'version' => '3.9.3.0', 'reference' => NULL, 'type' => 'kirby-cms', 'install_path' => __DIR__ . '/../../', @@ -11,9 +11,9 @@ ), 'versions' => array( 'claviska/simpleimage' => array( - 'pretty_version' => '3.7.0', - 'version' => '3.7.0.0', - 'reference' => 'abd15ced313c7b8041d7d73d8d2398b4f2510cf1', + 'pretty_version' => '4.0.2', + 'version' => '4.0.2.0', + 'reference' => '226d507cca0c8400d69bee7eb324158e3cbe246e', 'type' => 'library', 'install_path' => __DIR__ . '/../claviska/simpleimage', 'aliases' => array(), @@ -29,17 +29,17 @@ 'dev_requirement' => false, ), 'filp/whoops' => array( - 'pretty_version' => '2.14.6', - 'version' => '2.14.6.0', - 'reference' => 'f7948baaa0330277c729714910336383286305da', + 'pretty_version' => '2.15.1', + 'version' => '2.15.1.0', + 'reference' => 'e864ac957acd66e1565f25efda61e37791a5db0b', 'type' => 'library', 'install_path' => __DIR__ . '/../filp/whoops', 'aliases' => array(), 'dev_requirement' => false, ), 'getkirby/cms' => array( - 'pretty_version' => '3.8.3', - 'version' => '3.8.3.0', + 'pretty_version' => '3.9.3', + 'version' => '3.9.3.0', 'reference' => NULL, 'type' => 'kirby-cms', 'install_path' => __DIR__ . '/../../', @@ -65,9 +65,9 @@ 'dev_requirement' => false, ), 'league/color-extractor' => array( - 'pretty_version' => '0.3.2', - 'version' => '0.3.2.0', - 'reference' => '837086ec60f50c84c611c613963e4ad2e2aec806', + 'pretty_version' => '0.4.0', + 'version' => '0.4.0.0', + 'reference' => '21fcac6249c5ef7d00eb83e128743ee6678fe505', 'type' => 'library', 'install_path' => __DIR__ . '/../league/color-extractor', 'aliases' => array(), @@ -89,9 +89,9 @@ 'dev_requirement' => false, ), 'phpmailer/phpmailer' => array( - 'pretty_version' => 'v6.6.5', - 'version' => '6.6.5.0', - 'reference' => '8b6386d7417526d1ea4da9edb70b8352f7543627', + 'pretty_version' => 'v6.8.0', + 'version' => '6.8.0.0', + 'reference' => 'df16b615e371d81fb79e506277faea67a1be18f1', 'type' => 'library', 'install_path' => __DIR__ . '/../phpmailer/phpmailer', 'aliases' => array(), @@ -107,9 +107,9 @@ 'dev_requirement' => false, ), 'symfony/polyfill-intl-idn' => array( - 'pretty_version' => 'v1.26.0', - 'version' => '1.26.0.0', - 'reference' => '59a8d271f00dd0e4c2e518104cc7963f655a1aa8', + 'pretty_version' => 'v1.27.0', + 'version' => '1.27.0.0', + 'reference' => '639084e360537a19f9ee352433b84ce831f3d2da', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn', 'aliases' => array(), @@ -125,9 +125,9 @@ 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.26.0', - 'version' => '1.26.0.0', - 'reference' => '9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e', + 'pretty_version' => 'v1.27.0', + 'version' => '1.27.0.0', + 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), diff --git a/kirby/vendor/filp/whoops/src/Whoops/Exception/Formatter.php b/kirby/vendor/filp/whoops/src/Whoops/Exception/Formatter.php index 573dda0..a041530 100644 --- a/kirby/vendor/filp/whoops/src/Whoops/Exception/Formatter.php +++ b/kirby/vendor/filp/whoops/src/Whoops/Exception/Formatter.php @@ -6,16 +6,19 @@ namespace Whoops\Exception; +use Whoops\Inspector\InspectorInterface; + class Formatter { /** * Returns all basic information about the exception in a simple array * for further convertion to other languages - * @param Inspector $inspector - * @param bool $shouldAddTrace + * @param InspectorInterface $inspector + * @param bool $shouldAddTrace + * @param array $frameFilters * @return array */ - public static function formatExceptionAsDataArray(Inspector $inspector, $shouldAddTrace) + public static function formatExceptionAsDataArray(InspectorInterface $inspector, $shouldAddTrace, array $frameFilters = []) { $exception = $inspector->getException(); $response = [ @@ -27,7 +30,7 @@ class Formatter ]; if ($shouldAddTrace) { - $frames = $inspector->getFrames(); + $frames = $inspector->getFrames($frameFilters); $frameData = []; foreach ($frames as $frame) { @@ -47,7 +50,7 @@ class Formatter return $response; } - public static function formatExceptionPlain(Inspector $inspector) + public static function formatExceptionPlain(InspectorInterface $inspector) { $message = $inspector->getException()->getMessage(); $frames = $inspector->getFrames(); diff --git a/kirby/vendor/filp/whoops/src/Whoops/Exception/Frame.php b/kirby/vendor/filp/whoops/src/Whoops/Exception/Frame.php index 2d7297b..469070e 100644 --- a/kirby/vendor/filp/whoops/src/Whoops/Exception/Frame.php +++ b/kirby/vendor/filp/whoops/src/Whoops/Exception/Frame.php @@ -31,9 +31,6 @@ class Frame implements Serializable */ protected $application; - /** - * @param array[] - */ public function __construct(array $frame) { $this->frame = $frame; diff --git a/kirby/vendor/filp/whoops/src/Whoops/Exception/FrameCollection.php b/kirby/vendor/filp/whoops/src/Whoops/Exception/FrameCollection.php index 723b475..922c035 100644 --- a/kirby/vendor/filp/whoops/src/Whoops/Exception/FrameCollection.php +++ b/kirby/vendor/filp/whoops/src/Whoops/Exception/FrameCollection.php @@ -25,9 +25,6 @@ class FrameCollection implements ArrayAccess, IteratorAggregate, Serializable, C */ private $frames; - /** - * @param array $frames - */ public function __construct(array $frames) { $this->frames = array_map(function ($frame) { diff --git a/kirby/vendor/filp/whoops/src/Whoops/Exception/Inspector.php b/kirby/vendor/filp/whoops/src/Whoops/Exception/Inspector.php index 8570959..a183563 100644 --- a/kirby/vendor/filp/whoops/src/Whoops/Exception/Inspector.php +++ b/kirby/vendor/filp/whoops/src/Whoops/Exception/Inspector.php @@ -6,9 +6,11 @@ namespace Whoops\Exception; +use Whoops\Inspector\InspectorFactory; +use Whoops\Inspector\InspectorInterface; use Whoops\Util\Misc; -class Inspector +class Inspector implements InspectorInterface { /** * @var \Throwable @@ -31,11 +33,18 @@ class Inspector private $previousExceptions; /** - * @param \Throwable $exception The exception to inspect + * @var \Whoops\Inspector\InspectorFactoryInterface|null */ - public function __construct($exception) + protected $inspectorFactory; + + /** + * @param \Throwable $exception The exception to inspect + * @param \Whoops\Inspector\InspectorFactoryInterface $factory + */ + public function __construct($exception, $factory = null) { $this->exception = $exception; + $this->inspectorFactory = $factory ?: new InspectorFactory(); } /** @@ -137,7 +146,7 @@ class Inspector $previousException = $this->exception->getPrevious(); if ($previousException) { - $this->previousExceptionInspector = new Inspector($previousException); + $this->previousExceptionInspector = $this->inspectorFactory->create($previousException); } } @@ -167,9 +176,12 @@ class Inspector /** * Returns an iterator for the inspected exception's * frames. + * + * @param array $frameFilters + * * @return \Whoops\Exception\FrameCollection */ - public function getFrames() + public function getFrames(array $frameFilters = []) { if ($this->frames === null) { $frames = $this->getTrace($this->exception); @@ -225,6 +237,13 @@ class Inspector $newFrames->prependFrames($outerFrames->topDiff($newFrames)); $this->frames = $newFrames; } + + // Apply frame filters callbacks on the frames stack + if (!empty($frameFilters)) { + foreach ($frameFilters as $filterCallback) { + $this->frames->filter($filterCallback); + } + } } return $this->frames; @@ -301,7 +320,6 @@ class Inspector * Determine if the frame can be used to fill in previous frame's missing info * happens for call_user_func and call_user_func_array usages (PHP Bug #44428) * - * @param array $frame * @return bool */ protected function isValidNextFrame(array $frame) diff --git a/kirby/vendor/filp/whoops/src/Whoops/Handler/Handler.php b/kirby/vendor/filp/whoops/src/Whoops/Handler/Handler.php index cf1f708..21435fc 100644 --- a/kirby/vendor/filp/whoops/src/Whoops/Handler/Handler.php +++ b/kirby/vendor/filp/whoops/src/Whoops/Handler/Handler.php @@ -6,7 +6,7 @@ namespace Whoops\Handler; -use Whoops\Exception\Inspector; +use Whoops\Inspector\InspectorInterface; use Whoops\RunInterface; /** @@ -36,7 +36,7 @@ abstract class Handler implements HandlerInterface private $run; /** - * @var Inspector $inspector + * @var InspectorInterface $inspector */ private $inspector; @@ -62,15 +62,15 @@ abstract class Handler implements HandlerInterface } /** - * @param Inspector $inspector + * @param InspectorInterface $inspector */ - public function setInspector(Inspector $inspector) + public function setInspector(InspectorInterface $inspector) { $this->inspector = $inspector; } /** - * @return Inspector + * @return InspectorInterface */ protected function getInspector() { diff --git a/kirby/vendor/filp/whoops/src/Whoops/Handler/HandlerInterface.php b/kirby/vendor/filp/whoops/src/Whoops/Handler/HandlerInterface.php index 0265a85..2deae98 100644 --- a/kirby/vendor/filp/whoops/src/Whoops/Handler/HandlerInterface.php +++ b/kirby/vendor/filp/whoops/src/Whoops/Handler/HandlerInterface.php @@ -6,7 +6,7 @@ namespace Whoops\Handler; -use Whoops\Exception\Inspector; +use Whoops\Inspector\InspectorInterface; use Whoops\RunInterface; interface HandlerInterface @@ -29,8 +29,8 @@ interface HandlerInterface public function setException($exception); /** - * @param Inspector $inspector + * @param InspectorInterface $inspector * @return void */ - public function setInspector(Inspector $inspector); + public function setInspector(InspectorInterface $inspector); } diff --git a/kirby/vendor/filp/whoops/src/Whoops/Handler/JsonResponseHandler.php b/kirby/vendor/filp/whoops/src/Whoops/Handler/JsonResponseHandler.php index 2966d38..9051b36 100644 --- a/kirby/vendor/filp/whoops/src/Whoops/Handler/JsonResponseHandler.php +++ b/kirby/vendor/filp/whoops/src/Whoops/Handler/JsonResponseHandler.php @@ -60,7 +60,8 @@ class JsonResponseHandler extends Handler 'errors' => [ Formatter::formatExceptionAsDataArray( $this->getInspector(), - $this->addTraceToOutput() + $this->addTraceToOutput(), + $this->getRun()->getFrameFilters() ), ] ]; @@ -68,7 +69,8 @@ class JsonResponseHandler extends Handler $response = [ 'error' => Formatter::formatExceptionAsDataArray( $this->getInspector(), - $this->addTraceToOutput() + $this->addTraceToOutput(), + $this->getRun()->getFrameFilters() ), ]; } diff --git a/kirby/vendor/filp/whoops/src/Whoops/Handler/PlainTextHandler.php b/kirby/vendor/filp/whoops/src/Whoops/Handler/PlainTextHandler.php index 6c148aa..ea38b76 100644 --- a/kirby/vendor/filp/whoops/src/Whoops/Handler/PlainTextHandler.php +++ b/kirby/vendor/filp/whoops/src/Whoops/Handler/PlainTextHandler.php @@ -282,7 +282,7 @@ class PlainTextHandler extends Handler return ''; } $inspector = $this->getInspector(); - $frames = $inspector->getFrames(); + $frames = $inspector->getFrames($this->getRun()->getFrameFilters()); $response = "\nStack trace:"; diff --git a/kirby/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php b/kirby/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php index e5a2560..167407e 100644 --- a/kirby/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php +++ b/kirby/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php @@ -287,6 +287,7 @@ class PrettyPageHandler extends Handler $vars["tables"] = array_merge($extraTables, $vars["tables"]); $plainTextHandler = new PlainTextHandler(); + $plainTextHandler->setRun($this->getRun()); $plainTextHandler->setException($this->getException()); $plainTextHandler->setInspector($this->getInspector()); $vars["preface"] = ""; @@ -304,7 +305,7 @@ class PrettyPageHandler extends Handler */ protected function getExceptionFrames() { - $frames = $this->getInspector()->getFrames(); + $frames = $this->getInspector()->getFrames($this->getRun()->getFrameFilters()); if ($this->getApplicationPaths()) { foreach ($frames as $frame) { @@ -353,7 +354,6 @@ class PrettyPageHandler extends Handler * will be flattened with `print_r`. * * @param string $label - * @param array $data * * @return static */ @@ -383,7 +383,7 @@ class PrettyPageHandler extends Handler throw new InvalidArgumentException('Expecting callback argument to be callable'); } - $this->extraTables[$label] = function (\Whoops\Exception\Inspector $inspector = null) use ($callback) { + $this->extraTables[$label] = function (\Whoops\Inspector\InspectorInterface $inspector = null) use ($callback) { try { $result = call_user_func($callback, $inspector); @@ -755,11 +755,9 @@ class PrettyPageHandler extends Handler /** * Set the application paths. * - * @param array $applicationPaths - * * @return void */ - public function setApplicationPaths($applicationPaths) + public function setApplicationPaths(array $applicationPaths) { $this->applicationPaths = $applicationPaths; } diff --git a/kirby/vendor/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php b/kirby/vendor/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php index d695750..dcfd551 100644 --- a/kirby/vendor/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php +++ b/kirby/vendor/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php @@ -43,7 +43,8 @@ class XmlResponseHandler extends Handler $response = [ 'error' => Formatter::formatExceptionAsDataArray( $this->getInspector(), - $this->addTraceToOutput() + $this->addTraceToOutput(), + $this->getRun()->getFrameFilters() ), ]; diff --git a/kirby/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactory.php b/kirby/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactory.php new file mode 100644 index 0000000..ee19898 --- /dev/null +++ b/kirby/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactory.php @@ -0,0 +1,21 @@ + + */ + +namespace Whoops\Inspector; + +use Whoops\Exception\Inspector; + +class InspectorFactory implements InspectorFactoryInterface +{ + /** + * @param \Throwable $exception + * @return InspectorInterface + */ + public function create($exception) + { + return new Inspector($exception, $this); + } +} diff --git a/kirby/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactoryInterface.php b/kirby/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactoryInterface.php new file mode 100644 index 0000000..e3907cf --- /dev/null +++ b/kirby/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactoryInterface.php @@ -0,0 +1,16 @@ + + */ + +namespace Whoops\Inspector; + +interface InspectorFactoryInterface +{ + /** + * @param \Throwable $exception + * @return InspectorInterface + */ + public function create($exception); +} diff --git a/kirby/vendor/filp/whoops/src/Whoops/Inspector/InspectorInterface.php b/kirby/vendor/filp/whoops/src/Whoops/Inspector/InspectorInterface.php new file mode 100644 index 0000000..6893517 --- /dev/null +++ b/kirby/vendor/filp/whoops/src/Whoops/Inspector/InspectorInterface.php @@ -0,0 +1,71 @@ + + */ + +namespace Whoops\Inspector; + +interface InspectorInterface +{ + /** + * @return \Throwable + */ + public function getException(); + + /** + * @return string + */ + public function getExceptionName(); + + /** + * @return string + */ + public function getExceptionMessage(); + + /** + * @return string[] + */ + public function getPreviousExceptionMessages(); + + /** + * @return int[] + */ + public function getPreviousExceptionCodes(); + + /** + * Returns a url to the php-manual related to the underlying error - when available. + * + * @return string|null + */ + public function getExceptionDocrefUrl(); + + /** + * Does the wrapped Exception has a previous Exception? + * @return bool + */ + public function hasPreviousException(); + + /** + * Returns an Inspector for a previous Exception, if any. + * @todo Clean this up a bit, cache stuff a bit better. + * @return InspectorInterface + */ + public function getPreviousExceptionInspector(); + + /** + * Returns an array of all previous exceptions for this inspector's exception + * @return \Throwable[] + */ + public function getPreviousExceptions(); + + /** + * Returns an iterator for the inspected exception's + * frames. + * + * @param array $frameFilters + * + * @return \Whoops\Exception\FrameCollection + */ + public function getFrames(array $frameFilters = []); +} diff --git a/kirby/vendor/filp/whoops/src/Whoops/Run.php b/kirby/vendor/filp/whoops/src/Whoops/Run.php index 52486d0..0862768 100644 --- a/kirby/vendor/filp/whoops/src/Whoops/Run.php +++ b/kirby/vendor/filp/whoops/src/Whoops/Run.php @@ -9,10 +9,13 @@ namespace Whoops; use InvalidArgumentException; use Throwable; use Whoops\Exception\ErrorException; -use Whoops\Exception\Inspector; use Whoops\Handler\CallbackHandler; use Whoops\Handler\Handler; use Whoops\Handler\HandlerInterface; +use Whoops\Inspector\CallableInspectorFactory; +use Whoops\Inspector\InspectorFactory; +use Whoops\Inspector\InspectorFactoryInterface; +use Whoops\Inspector\InspectorInterface; use Whoops\Util\Misc; use Whoops\Util\SystemFacade; @@ -66,9 +69,22 @@ final class Run implements RunInterface */ private $canThrowExceptions = true; + /** + * The inspector factory to create inspectors. + * + * @var InspectorFactoryInterface + */ + private $inspectorFactory; + + /** + * @var array + */ + private $frameFilters = []; + public function __construct(SystemFacade $system = null) { $this->system = $system ?: new SystemFacade; + $this->inspectorFactory = new InspectorFactory(); } /** @@ -165,6 +181,17 @@ final class Run implements RunInterface return $this; } + public function getFrameFilters() + { + return $this->frameFilters; + } + + public function clearFrameFilters() + { + $this->frameFilters = []; + return $this; + } + /** * Registers this instance as an error handler. * @@ -179,6 +206,7 @@ final class Run implements RunInterface class_exists("\\Whoops\\Exception\\FrameCollection"); class_exists("\\Whoops\\Exception\\Frame"); class_exists("\\Whoops\\Exception\\Inspector"); + class_exists("\\Whoops\\Inspector\\InspectorFactory"); $this->system->setErrorHandler([$this, self::ERROR_HANDLER]); $this->system->setExceptionHandler([$this, self::EXCEPTION_HANDLER]); @@ -488,14 +516,38 @@ final class Run implements RunInterface } } + + /** + * @param InspectorFactoryInterface $factory + * + * @return void + */ + public function setInspectorFactory(InspectorFactoryInterface $factory) + { + $this->inspectorFactory = $factory; + } + + public function addFrameFilter($filterCallback) + { + if (!is_callable($filterCallback)) { + throw new \InvalidArgumentException(sprintf( + "A frame filter must be of type callable, %s type given.", + gettype($filterCallback) + )); + } + + $this->frameFilters[] = $filterCallback; + return $this; + } + /** * @param Throwable $exception * - * @return Inspector + * @return InspectorInterface */ private function getInspector($exception) { - return new Inspector($exception); + return $this->inspectorFactory->create($exception); } /** diff --git a/kirby/vendor/filp/whoops/src/Whoops/RunInterface.php b/kirby/vendor/filp/whoops/src/Whoops/RunInterface.php index 8162fe4..0ef3e3f 100644 --- a/kirby/vendor/filp/whoops/src/Whoops/RunInterface.php +++ b/kirby/vendor/filp/whoops/src/Whoops/RunInterface.php @@ -49,6 +49,16 @@ interface RunInterface */ public function clearHandlers(); + /** + * @return array + */ + public function getFrameFilters(); + + /** + * @return Run + */ + public function clearFrameFilters(); + /** * Registers this instance as an error handler. * @@ -137,4 +147,12 @@ interface RunInterface * Special case to deal with Fatal errors and the like. */ public function handleShutdown(); + + /** + * Registers a filter callback in the frame filters stack. + * + * @param callable $filterCallback + * @return \Whoops\Run + */ + public function addFrameFilter($filterCallback); } diff --git a/kirby/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php b/kirby/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php index 9c7cec2..8e4df32 100644 --- a/kirby/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php +++ b/kirby/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php @@ -232,7 +232,6 @@ class TemplateHelper * passed to the template. * * @param string $template - * @param array $additionalVariables */ public function render($template, array $additionalVariables = null) { @@ -254,8 +253,6 @@ class TemplateHelper /** * Sets the variables to be passed to all templates rendered * by this template helper. - * - * @param array $variables */ public function setVariables(array $variables) { diff --git a/kirby/vendor/league/color-extractor/composer.json b/kirby/vendor/league/color-extractor/composer.json index a5fb009..d1132cf 100644 --- a/kirby/vendor/league/color-extractor/composer.json +++ b/kirby/vendor/league/color-extractor/composer.json @@ -17,16 +17,24 @@ } ], "require": { - "php": ">=5.4.0", + "php": "^7.3 || ^8.0", "ext-gd": "*" }, "require-dev": { "friendsofphp/php-cs-fixer": "~2", - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^9.5" + }, + "suggest": { + "ext-curl": "To download images from remote URLs if allow_url_fopen is disabled for security reasons" }, "autoload": { "psr-4": { - "": "src" + "League\\ColorExtractor\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "League\\ColorExtractor\\Tests\\": "tests" } } } diff --git a/kirby/vendor/league/color-extractor/src/League/ColorExtractor/Color.php b/kirby/vendor/league/color-extractor/src/Color.php similarity index 100% rename from kirby/vendor/league/color-extractor/src/League/ColorExtractor/Color.php rename to kirby/vendor/league/color-extractor/src/Color.php diff --git a/kirby/vendor/league/color-extractor/src/League/ColorExtractor/ColorExtractor.php b/kirby/vendor/league/color-extractor/src/ColorExtractor.php similarity index 98% rename from kirby/vendor/league/color-extractor/src/League/ColorExtractor/ColorExtractor.php rename to kirby/vendor/league/color-extractor/src/ColorExtractor.php index 09e43c1..364a3bd 100644 --- a/kirby/vendor/league/color-extractor/src/League/ColorExtractor/ColorExtractor.php +++ b/kirby/vendor/league/color-extractor/src/ColorExtractor.php @@ -25,6 +25,10 @@ class ColorExtractor */ public function extract($colorCount = 1) { + if ($colorCount === 0) { + return []; + } + if (!$this->isInitialized()) { $this->initialize(); } @@ -75,6 +79,9 @@ class ColorExtractor protected static function mergeColors(\SplFixedArray $colors, $limit, $maxDelta) { $limit = min(count($colors), $limit); + if ($limit === 0) { + return []; + } if ($limit === 1) { return [$colors[0]]; } diff --git a/kirby/vendor/league/color-extractor/src/League/ColorExtractor/Palette.php b/kirby/vendor/league/color-extractor/src/Palette.php similarity index 62% rename from kirby/vendor/league/color-extractor/src/League/ColorExtractor/Palette.php rename to kirby/vendor/league/color-extractor/src/Palette.php index d8fb4f9..5c5266f 100644 --- a/kirby/vendor/league/color-extractor/src/League/ColorExtractor/Palette.php +++ b/kirby/vendor/league/color-extractor/src/Palette.php @@ -2,34 +2,41 @@ namespace League\ColorExtractor; + + class Palette implements \Countable, \IteratorAggregate { - /** @var array */ - protected $colors; - - /** + /** + * @var array + */ + protected $colors = []; + + /** * @return int */ - public function count() + #[\ReturnTypeWillChange] + public function count(): int { return count($this->colors); } - /** - * @return \ArrayIterator + /** + * @return \Traversable */ - public function getIterator() + public function getIterator(): \Traversable { return new \ArrayIterator($this->colors); } - - /** - * @param int $color - * + + /** * @return int */ public function getColorCount($color) { + if (!array_key_exists($color, $this->colors)) { + return 0; + } + return $this->colors[$color]; } @@ -48,10 +55,57 @@ class Palette implements \Countable, \IteratorAggregate * @param int|null $backgroundColor * * @return Palette + * + * @throws \InvalidArgumentException */ public static function fromFilename($filename, $backgroundColor = null) { - $image = imagecreatefromstring(file_get_contents($filename)); + if (!is_readable($filename)) { + throw new \InvalidArgumentException('Filename must be a valid path and should be readable'); + } + + return self::fromContents(file_get_contents($filename), $backgroundColor); + } + + /** + * @param string $url + * @param int|null $backgroundColor + * + * @return Palette + * + * @throws \RuntimeException + */ + public static function fromUrl($url, $backgroundColor = null) + { + if (!function_exists('curl_init')){ + return self::fromContents(file_get_contents($url)); + } + + $ch = curl_init(); + try { + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $contents = curl_exec($ch); + if ($contents === false) { + throw new \RuntimeException('Failed to fetch image from URL'); + } + } finally { + curl_close($ch); + } + + return self::fromContents($contents, $backgroundColor); + } + + /** + * Create instance with file contents + * + * @param string $contents + * @param int|null $backgroundColor + * + * @return Palette + */ + public static function fromContents($contents, $backgroundColor = null) { + $image = imagecreatefromstring($contents); $palette = self::fromGD($image, $backgroundColor); imagedestroy($image); @@ -59,16 +113,16 @@ class Palette implements \Countable, \IteratorAggregate } /** - * @param resource $image + * @param \GDImage|resource $image * @param int|null $backgroundColor * * @return Palette * * @throws \InvalidArgumentException */ - public static function fromGD($image, $backgroundColor = null) + public static function fromGD($image, ?int $backgroundColor = null) { - if (!is_resource($image) || get_resource_type($image) != 'gd') { + if (!$image instanceof \GDImage && (!is_resource($image) || get_resource_type($image) !== 'gd')) { throw new \InvalidArgumentException('Image must be a gd resource'); } if ($backgroundColor !== null && (!is_numeric($backgroundColor) || $backgroundColor < 0 || $backgroundColor > 16777215)) { diff --git a/kirby/vendor/phpmailer/phpmailer/composer.json b/kirby/vendor/phpmailer/phpmailer/composer.json index 9275fab..37e3d6e 100644 --- a/kirby/vendor/phpmailer/phpmailer/composer.json +++ b/kirby/vendor/phpmailer/phpmailer/composer.json @@ -37,17 +37,19 @@ "ext-hash": "*" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.2", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "doctrine/annotations": "^1.2.6 || ^1.13.3", "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.6.2", - "yoast/phpunit-polyfills": "^1.0.0" + "squizlabs/php_codesniffer": "^3.7.1", + "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", diff --git a/kirby/vendor/phpmailer/phpmailer/get_oauth_token.php b/kirby/vendor/phpmailer/phpmailer/get_oauth_token.php index ba66f6c..cda0445 100644 --- a/kirby/vendor/phpmailer/phpmailer/get_oauth_token.php +++ b/kirby/vendor/phpmailer/phpmailer/get_oauth_token.php @@ -44,6 +44,8 @@ use League\OAuth2\Client\Provider\Google; use Hayageek\OAuth2\Client\Provider\Yahoo; //@see https://github.com/stevenmaguire/oauth2-microsoft use Stevenmaguire\OAuth2\Client\Provider\Microsoft; +//@see https://github.com/greew/oauth2-azure-provider +use Greew\OAuth2\Client\Provider\Azure; if (!isset($_GET['code']) && !isset($_POST['provider'])) { ?> @@ -57,11 +59,14 @@ if (!isset($_GET['code']) && !isset($_POST['provider'])) {

    + +

    Enter id and secret

    These details are obtained by setting up an app in your provider's developer console.

    ClientId:

    ClientSecret:

    +

    TenantID (only relevant for Azure):

    @@ -77,18 +82,22 @@ session_start(); $providerName = ''; $clientId = ''; $clientSecret = ''; +$tenantId = ''; if (array_key_exists('provider', $_POST)) { $providerName = $_POST['provider']; $clientId = $_POST['clientId']; $clientSecret = $_POST['clientSecret']; + $tenantId = $_POST['tenantId']; $_SESSION['provider'] = $providerName; $_SESSION['clientId'] = $clientId; $_SESSION['clientSecret'] = $clientSecret; + $_SESSION['tenantId'] = $tenantId; } elseif (array_key_exists('provider', $_SESSION)) { $providerName = $_SESSION['provider']; $clientId = $_SESSION['clientId']; $clientSecret = $_SESSION['clientSecret']; + $tenantId = $_SESSION['tenantId']; } //If you don't want to use the built-in form, set your client id and secret here @@ -130,6 +139,17 @@ switch ($providerName) { ] ]; break; + case 'Azure': + $params['tenantId'] = $tenantId; + + $provider = new Azure($params); + $options = [ + 'scope' => [ + 'https://outlook.office.com/SMTP.Send', + 'offline_access' + ] + ]; + break; } if (null === $provider) { diff --git a/kirby/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php b/kirby/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php index 6ba7462..6992041 100644 --- a/kirby/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php +++ b/kirby/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php @@ -4,6 +4,7 @@ * Spanish PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * @author Matt Sturdy + * @author Crystopher Glodzienski Cardoso */ $PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.'; @@ -25,3 +26,6 @@ $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.'; $PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; $PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: '; $PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; +$PHPMAILER_LANG['smtp_code'] = 'Código del servidor SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Información adicional del servidor SMTP: '; +$PHPMAILER_LANG['invalid_header'] = 'Nombre o valor de encabezado no válido'; diff --git a/kirby/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php b/kirby/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php index d973a35..d2856e0 100644 --- a/kirby/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php +++ b/kirby/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php @@ -4,24 +4,32 @@ * Hindi PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * @author Yash Karanke + * Rewrite and extension of the work by Jayanti Suthar */ $PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। '; +$PHPMAILER_LANG['buggy_php'] = 'PHP का आपका संस्करण एक बग से प्रभावित है जिसके परिणामस्वरूप संदेश दूषित हो सकते हैं. इसे ठीक करने हेतु, भेजने के लिए SMTP का उपयोग करे, अपने php.ini में mail.add_x_header विकल्प को अक्षम करें, MacOS या Linux पर जाए, या अपने PHP संस्करण को 7.0.17+ या 7.1.3+ बदले.'; $PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। '; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। '; $PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। '; $PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। '; $PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। '; +$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: '; $PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। '; $PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। '; $PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। '; $PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।'; $PHPMAILER_LANG['invalid_address'] = 'पता गलत है। '; +$PHPMAILER_LANG['invalid_header'] = 'अमान्य हेडर नाम या मान'; +$PHPMAILER_LANG['invalid_hostentry'] = 'अमान्य hostentry: '; +$PHPMAILER_LANG['invalid_host'] = 'अमान्य होस्ट: '; $PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। '; $PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। '; -$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि:। '; +$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP कोड: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'अतिरिक्त SMTP जानकारी: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। '; +$PHPMAILER_LANG['smtp_detail'] = 'विवरण: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। '; $PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। '; -$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: '; diff --git a/kirby/vendor/phpmailer/phpmailer/src/DSNConfigurator.php b/kirby/vendor/phpmailer/phpmailer/src/DSNConfigurator.php new file mode 100644 index 0000000..ab707d2 --- /dev/null +++ b/kirby/vendor/phpmailer/phpmailer/src/DSNConfigurator.php @@ -0,0 +1,247 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2023 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * Configure PHPMailer with DSN string. + * + * @see https://en.wikipedia.org/wiki/Data_source_name + * + * @author Oleg Voronkovich + */ +class DSNConfigurator +{ + /** + * Create new PHPMailer instance configured by DSN. + * + * @param string $dsn DSN + * @param bool $exceptions Should we throw external exceptions? + * + * @return PHPMailer + */ + public static function mailer($dsn, $exceptions = null) + { + static $configurator = null; + + if (null === $configurator) { + $configurator = new DSNConfigurator(); + } + + return $configurator->configure(new PHPMailer($exceptions), $dsn); + } + + /** + * Configure PHPMailer instance with DSN string. + * + * @param PHPMailer $mailer PHPMailer instance + * @param string $dsn DSN + * + * @return PHPMailer + */ + public function configure(PHPMailer $mailer, $dsn) + { + $config = $this->parseDSN($dsn); + + $this->applyConfig($mailer, $config); + + return $mailer; + } + + /** + * Parse DSN string. + * + * @param string $dsn DSN + * + * @throws Exception If DSN is malformed + * + * @return array Configuration + */ + private function parseDSN($dsn) + { + $config = $this->parseUrl($dsn); + + if (false === $config || !isset($config['scheme']) || !isset($config['host'])) { + throw new Exception( + sprintf('Malformed DSN: "%s".', $dsn) + ); + } + + if (isset($config['query'])) { + parse_str($config['query'], $config['query']); + } + + return $config; + } + + /** + * Apply configuration to mailer. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $config Configuration + * + * @throws Exception If scheme is invalid + */ + private function applyConfig(PHPMailer $mailer, $config) + { + switch ($config['scheme']) { + case 'mail': + $mailer->isMail(); + break; + case 'sendmail': + $mailer->isSendmail(); + break; + case 'qmail': + $mailer->isQmail(); + break; + case 'smtp': + case 'smtps': + $mailer->isSMTP(); + $this->configureSMTP($mailer, $config); + break; + default: + throw new Exception( + sprintf( + 'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".', + $config['scheme'] + ) + ); + } + + if (isset($config['query'])) { + $this->configureOptions($mailer, $config['query']); + } + } + + /** + * Configure SMTP. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $config Configuration + */ + private function configureSMTP($mailer, $config) + { + $isSMTPS = 'smtps' === $config['scheme']; + + if ($isSMTPS) { + $mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; + } + + $mailer->Host = $config['host']; + + if (isset($config['port'])) { + $mailer->Port = $config['port']; + } elseif ($isSMTPS) { + $mailer->Port = SMTP::DEFAULT_SECURE_PORT; + } + + $mailer->SMTPAuth = isset($config['user']) || isset($config['pass']); + + if (isset($config['user'])) { + $mailer->Username = $config['user']; + } + + if (isset($config['pass'])) { + $mailer->Password = $config['pass']; + } + } + + /** + * Configure options. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $options Options + * + * @throws Exception If option is unknown + */ + private function configureOptions(PHPMailer $mailer, $options) + { + $allowedOptions = get_object_vars($mailer); + + unset($allowedOptions['Mailer']); + unset($allowedOptions['SMTPAuth']); + unset($allowedOptions['Username']); + unset($allowedOptions['Password']); + unset($allowedOptions['Hostname']); + unset($allowedOptions['Port']); + unset($allowedOptions['ErrorInfo']); + + $allowedOptions = \array_keys($allowedOptions); + + foreach ($options as $key => $value) { + if (!in_array($key, $allowedOptions)) { + throw new Exception( + sprintf( + 'Unknown option: "%s". Allowed values: "%s"', + $key, + implode('", "', $allowedOptions) + ) + ); + } + + switch ($key) { + case 'AllowEmpty': + case 'SMTPAutoTLS': + case 'SMTPKeepAlive': + case 'SingleTo': + case 'UseSendmailOptions': + case 'do_verp': + case 'DKIM_copyHeaderFields': + $mailer->$key = (bool) $value; + break; + case 'Priority': + case 'SMTPDebug': + case 'WordWrap': + $mailer->$key = (int) $value; + break; + default: + $mailer->$key = $value; + break; + } + } + } + + /** + * Parse a URL. + * Wrapper for the built-in parse_url function to work around a bug in PHP 5.5. + * + * @param string $url URL + * + * @return array|false + */ + protected function parseUrl($url) + { + if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) { + return parse_url($url); + } + + $chunks = explode('?', $url); + if (is_array($chunks)) { + $result = parse_url($chunks[0]); + if (is_array($result)) { + $result['query'] = $chunks[1]; + } + return $result; + } + + return false; + } +} diff --git a/kirby/vendor/phpmailer/phpmailer/src/PHPMailer.php b/kirby/vendor/phpmailer/phpmailer/src/PHPMailer.php index 7e6c88f..a644d2c 100644 --- a/kirby/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ b/kirby/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -750,7 +750,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.6.5'; + const VERSION = '6.8.0'; /** * Error severity: message only, continue processing. @@ -858,7 +858,7 @@ class PHPMailer private function mailPassthru($to, $subject, $body, $header, $params) { //Check overloading of mail function to avoid double-encoding - if (ini_get('mbstring.func_overload') & 1) { + if ((int)ini_get('mbstring.func_overload') & 1) { $subject = $this->secureHeader($subject); } else { $subject = $this->encodeHeader($this->secureHeader($subject)); @@ -1124,6 +1124,22 @@ class PHPMailer return call_user_func_array([$this, 'addAnAddress'], $params); } + /** + * Set the boundaries to use for delimiting MIME parts. + * If you override this, ensure you set all 3 boundaries to unique values. + * The default boundaries include a "=_" sequence which cannot occur in quoted-printable bodies, + * as suggested by https://www.rfc-editor.org/rfc/rfc2045#section-6.7 + * + * @return void + */ + public function setBoundaries() + { + $this->uniqueid = $this->generateId(); + $this->boundary[1] = 'b1=_' . $this->uniqueid; + $this->boundary[2] = 'b2=_' . $this->uniqueid; + $this->boundary[3] = 'b3=_' . $this->uniqueid; + } + /** * Add an address to one of the recipient arrays or to the ReplyTo array. * Addresses that have been added already return false, but do not throw exceptions. @@ -1671,11 +1687,11 @@ class PHPMailer return $this->mailSend($this->MIMEHeader, $this->MIMEBody); } } catch (Exception $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true && $this->smtp->connected()) { $this->smtp->reset(); } - $this->setError($exc->getMessage()); - $this->edebug($exc->getMessage()); if ($this->exceptions) { throw $exc; } @@ -2407,7 +2423,7 @@ class PHPMailer */ public function addrFormat($addr) { - if (empty($addr[1])) { //No name provided + if (!isset($addr[1]) || ($addr[1] === '')) { //No name provided return $this->secureHeader($addr[0]); } @@ -2794,10 +2810,7 @@ class PHPMailer { $body = ''; //Create unique IDs and preset boundaries - $this->uniqueid = $this->generateId(); - $this->boundary[1] = 'b1_' . $this->uniqueid; - $this->boundary[2] = 'b2_' . $this->uniqueid; - $this->boundary[3] = 'b3_' . $this->uniqueid; + $this->setBoundaries(); if ($this->sign_key_file) { $body .= $this->getMailMIME() . static::$LE; @@ -2833,7 +2846,7 @@ class PHPMailer $altBodyEncoding = static::ENCODING_QUOTED_PRINTABLE; } //Use this as a preamble in all multipart message types - $mimepre = 'This is a multi-part message in MIME format.' . static::$LE . static::$LE; + $mimepre = ''; switch ($this->message_type) { case 'inline': $body .= $mimepre; @@ -3069,6 +3082,18 @@ class PHPMailer return $body; } + /** + * Get the boundaries that this message will use + * @return array + */ + public function getBoundaries() + { + if (empty($this->boundary)) { + $this->setBoundaries(); + } + return $this->boundary; + } + /** * Return the start of a message boundary. * @@ -4186,6 +4211,7 @@ class PHPMailer * @param string $name Custom header name * @param string|null $value Header value * + * @return bool True if a header was set successfully * @throws Exception */ public function addCustomHeader($name, $value = null) @@ -4635,15 +4661,27 @@ class PHPMailer } /** - * Remove trailing breaks from a string. + * Remove trailing whitespace from a string. + * + * @param string $text + * + * @return string The text to remove whitespace from + */ + public static function stripTrailingWSP($text) + { + return rtrim($text, " \r\n\t"); + } + + /** + * Strip trailing line breaks from a string. * * @param string $text * * @return string The text to remove breaks from */ - public static function stripTrailingWSP($text) + public static function stripTrailingBreaks($text) { - return rtrim($text, " \r\n\t"); + return rtrim($text, "\r\n"); } /** @@ -4809,7 +4847,7 @@ class PHPMailer $body = static::normalizeBreaks($body, self::CRLF); //Reduce multiple trailing line breaks to a single one - return static::stripTrailingWSP($body) . self::CRLF; + return static::stripTrailingBreaks($body) . self::CRLF; } /** diff --git a/kirby/vendor/phpmailer/phpmailer/src/POP3.php b/kirby/vendor/phpmailer/phpmailer/src/POP3.php index a3c9f45..d025689 100644 --- a/kirby/vendor/phpmailer/phpmailer/src/POP3.php +++ b/kirby/vendor/phpmailer/phpmailer/src/POP3.php @@ -46,7 +46,7 @@ class POP3 * * @var string */ - const VERSION = '6.6.5'; + const VERSION = '6.8.0'; /** * Default POP3 port number. @@ -337,7 +337,12 @@ class POP3 */ public function disconnect() { - $this->sendString('QUIT'); + // If could not connect at all, no need to disconnect + if ($this->pop_conn === false) { + return; + } + + $this->sendString('QUIT' . static::LE); // RFC 1939 shows POP3 server sending a +OK response to the QUIT command. // Try to get it. Ignore any failures here. diff --git a/kirby/vendor/phpmailer/phpmailer/src/SMTP.php b/kirby/vendor/phpmailer/phpmailer/src/SMTP.php index 312f753..fc4b781 100644 --- a/kirby/vendor/phpmailer/phpmailer/src/SMTP.php +++ b/kirby/vendor/phpmailer/phpmailer/src/SMTP.php @@ -35,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.6.5'; + const VERSION = '6.8.0'; /** * SMTP line break constant. @@ -51,6 +51,13 @@ class SMTP */ const DEFAULT_PORT = 25; + /** + * The SMTPs port to use if one is not specified. + * + * @var int + */ + const DEFAULT_SECURE_PORT = 465; + /** * The maximum line length allowed by RFC 5321 section 4.5.3.1.6, * *excluding* a trailing CRLF break. @@ -187,6 +194,7 @@ class SMTP 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', 'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/', 'Haraka' => '/[\d]{3} Message Queued \((.*)\)/', + 'ZoneMTA' => '/[\d]{3} Message queued as (.*)/', 'Mailjet' => '/[\d]{3} OK queued as (.*)/', ]; diff --git a/kirby/vendor/symfony/polyfill-intl-idn/Idn.php b/kirby/vendor/symfony/polyfill-intl-idn/Idn.php index fee3026..86710b9 100644 --- a/kirby/vendor/symfony/polyfill-intl-idn/Idn.php +++ b/kirby/vendor/symfony/polyfill-intl-idn/Idn.php @@ -723,7 +723,7 @@ final class Idn $qMinusT = $q - $t; $baseMinusT = self::BASE - $t; - $output .= self::encodeDigit($t + ($qMinusT) % ($baseMinusT), false); + $output .= self::encodeDigit($t + $qMinusT % $baseMinusT, false); ++$out; $q = intdiv($qMinusT, $baseMinusT); } diff --git a/kirby/vendor/symfony/polyfill-intl-idn/composer.json b/kirby/vendor/symfony/polyfill-intl-idn/composer.json index 71030a2..105e3d0 100644 --- a/kirby/vendor/symfony/polyfill-intl-idn/composer.json +++ b/kirby/vendor/symfony/polyfill-intl-idn/composer.json @@ -34,7 +34,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/kirby/vendor/symfony/polyfill-mbstring/Mbstring.php b/kirby/vendor/symfony/polyfill-mbstring/Mbstring.php index 693749f..bce5c4a 100644 --- a/kirby/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/kirby/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -80,7 +80,7 @@ final class Mbstring public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { - if (\is_array($fromEncoding) || ($fromEncoding !== null && false !== strpos($fromEncoding, ','))) { + if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); } else { $fromEncoding = self::getEncoding($fromEncoding); @@ -102,7 +102,7 @@ final class Mbstring $fromEncoding = 'Windows-1252'; } if ('UTF-8' !== $fromEncoding) { - $s = \iconv($fromEncoding, 'UTF-8//IGNORE', $s); + $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); } return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); @@ -113,7 +113,7 @@ final class Mbstring $fromEncoding = 'UTF-8'; } - return \iconv($fromEncoding, $toEncoding.'//IGNORE', $s); + return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); } public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) @@ -130,7 +130,7 @@ final class Mbstring public static function mb_decode_mimeheader($s) { - return \iconv_mime_decode($s, 2, self::$internalEncoding); + return iconv_mime_decode($s, 2, self::$internalEncoding); } public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) @@ -140,7 +140,7 @@ final class Mbstring public static function mb_decode_numericentity($s, $convmap, $encoding = null) { - if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); return null; @@ -150,7 +150,7 @@ final class Mbstring return false; } - if (null !== $encoding && !is_scalar($encoding)) { + if (null !== $encoding && !\is_scalar($encoding)) { trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); return ''; // Instead of null (cf. mb_encode_numericentity). @@ -166,10 +166,10 @@ final class Mbstring if ('UTF-8' === $encoding) { $encoding = null; if (!preg_match('//u', $s)) { - $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); } } else { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); + $s = iconv($encoding, 'UTF-8//IGNORE', $s); } $cnt = floor(\count($convmap) / 4) * 4; @@ -195,12 +195,12 @@ final class Mbstring return $s; } - return \iconv('UTF-8', $encoding.'//IGNORE', $s); + return iconv('UTF-8', $encoding.'//IGNORE', $s); } public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) { - if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); return null; @@ -210,13 +210,13 @@ final class Mbstring return false; } - if (null !== $encoding && !is_scalar($encoding)) { + if (null !== $encoding && !\is_scalar($encoding)) { trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); return null; // Instead of '' (cf. mb_decode_numericentity). } - if (null !== $is_hex && !is_scalar($is_hex)) { + if (null !== $is_hex && !\is_scalar($is_hex)) { trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); return null; @@ -232,10 +232,10 @@ final class Mbstring if ('UTF-8' === $encoding) { $encoding = null; if (!preg_match('//u', $s)) { - $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); } } else { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); + $s = iconv($encoding, 'UTF-8//IGNORE', $s); } static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; @@ -265,7 +265,7 @@ final class Mbstring return $result; } - return \iconv('UTF-8', $encoding.'//IGNORE', $result); + return iconv('UTF-8', $encoding.'//IGNORE', $result); } public static function mb_convert_case($s, $mode, $encoding = null) @@ -280,10 +280,10 @@ final class Mbstring if ('UTF-8' === $encoding) { $encoding = null; if (!preg_match('//u', $s)) { - $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); } } else { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); + $s = iconv($encoding, 'UTF-8//IGNORE', $s); } if (\MB_CASE_TITLE == $mode) { @@ -343,7 +343,7 @@ final class Mbstring return $s; } - return \iconv('UTF-8', $encoding.'//IGNORE', $s); + return iconv('UTF-8', $encoding.'//IGNORE', $s); } public static function mb_internal_encoding($encoding = null) @@ -354,7 +354,7 @@ final class Mbstring $normalizedEncoding = self::getEncoding($encoding); - if ('UTF-8' === $normalizedEncoding || false !== @\iconv($normalizedEncoding, $normalizedEncoding, ' ')) { + if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, ' ')) { self::$internalEncoding = $normalizedEncoding; return true; @@ -413,7 +413,7 @@ final class Mbstring $encoding = self::$internalEncoding; } - return self::mb_detect_encoding($var, [$encoding]) || false !== @\iconv($encoding, $encoding, $var); + return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); } public static function mb_detect_encoding($str, $encodingList = null, $strict = false) @@ -488,7 +488,7 @@ final class Mbstring return \strlen($s); } - return @\iconv_strlen($s, $encoding); + return @iconv_strlen($s, $encoding); } public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) @@ -509,7 +509,7 @@ final class Mbstring return 0; } - return \iconv_strpos($haystack, $needle, $offset, $encoding); + return iconv_strpos($haystack, $needle, $offset, $encoding); } public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) @@ -533,7 +533,7 @@ final class Mbstring } $pos = '' !== $needle || 80000 > \PHP_VERSION_ID - ? \iconv_strrpos($haystack, $needle, $encoding) + ? iconv_strrpos($haystack, $needle, $encoding) : self::mb_strlen($haystack, $encoding); return false !== $pos ? $offset + $pos : false; @@ -541,7 +541,7 @@ final class Mbstring public static function mb_str_split($string, $split_length = 1, $encoding = null) { - if (null !== $string && !is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { + if (null !== $string && !\is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); return null; @@ -550,6 +550,7 @@ final class Mbstring if (1 > $split_length = (int) $split_length) { if (80000 > \PHP_VERSION_ID) { trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); + return false; } @@ -617,7 +618,7 @@ final class Mbstring } if ($start < 0) { - $start = \iconv_strlen($s, $encoding) + $start; + $start = iconv_strlen($s, $encoding) + $start; if ($start < 0) { $start = 0; } @@ -626,13 +627,13 @@ final class Mbstring if (null === $length) { $length = 2147483647; } elseif ($length < 0) { - $length = \iconv_strlen($s, $encoding) + $length - $start; + $length = iconv_strlen($s, $encoding) + $length - $start; if ($length < 0) { return ''; } } - return (string) \iconv_substr($s, $start, $length, $encoding); + return (string) iconv_substr($s, $start, $length, $encoding); } public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) @@ -657,7 +658,7 @@ final class Mbstring $pos = strrpos($haystack, $needle); } else { $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = \iconv_strrpos($haystack, $needle, $encoding); + $pos = iconv_strrpos($haystack, $needle, $encoding); } return self::getSubpart($pos, $part, $haystack, $encoding); @@ -736,12 +737,12 @@ final class Mbstring $encoding = self::getEncoding($encoding); if ('UTF-8' !== $encoding) { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); + $s = iconv($encoding, 'UTF-8//IGNORE', $s); } $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); - return ($wide << 1) + \iconv_strlen($s, 'UTF-8'); + return ($wide << 1) + iconv_strlen($s, 'UTF-8'); } public static function mb_substr_count($haystack, $needle, $encoding = null) diff --git a/kirby/vendor/symfony/polyfill-mbstring/composer.json b/kirby/vendor/symfony/polyfill-mbstring/composer.json index 9cd2e92..4489553 100644 --- a/kirby/vendor/symfony/polyfill-mbstring/composer.json +++ b/kirby/vendor/symfony/polyfill-mbstring/composer.json @@ -31,7 +31,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill",