diff --git a/.env b/.env index 7bdb8892..1d41c646 100644 --- a/.env +++ b/.env @@ -7,7 +7,7 @@ TYPO3_CACHE_DIR=var SQLDUMPSDIR=.project/data/ SQLDUMPFILE=db.sql.gz -SQLPORT=53844 +SQLPORT=53845 # Service names from docker-compose.yml to include in URL generation make target. Delimited by \| SERVICELIST=mail diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index 24d2d3e1..19adbbc6 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: php-lint: name: "PHP linter" - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: "Checkout" uses: actions/checkout@v2 @@ -20,12 +20,12 @@ jobs: fail-fast: false matrix: php-version: - - 7.4 - - 8.0 - 8.1 + - 8.2 + - 8.3 typoscript-lint: name: "TypoScript linter" - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: "Checkout" uses: actions/checkout@v2 @@ -36,7 +36,7 @@ jobs: config_file: ".project/tests/typoscript-lint.yml" php-cs-fixer: name: "PHP CS Fixer" - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: php-lint steps: - name: "Checkout" @@ -51,7 +51,7 @@ jobs: run: "composer test:php:cs" unit-tests: name: "PHP Unit Tests" - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: php-lint steps: - name: Checkout @@ -70,5 +70,5 @@ jobs: fail-fast: false matrix: php-version: - - 8.1 - 8.2 + - 8.3 diff --git a/.project/TYPO3/additional.php b/.project/TYPO3/additional.php index d19cfec6..cf955426 100644 --- a/.project/TYPO3/additional.php +++ b/.project/TYPO3/additional.php @@ -19,6 +19,38 @@ ], ], ], + 'EXTENSIONS' => [ + 'lux' => [ + 'anonymizeIp' => '1', + 'categoryScoringAddDownload' => '20', + 'categoryScoringAddNewsVisit' => '10', + 'categoryScoringAddPageVisit' => '10', + 'categoryScoringLinkListenerClick' => '20', + 'disableAnalysisModule' => '0', + 'disableCkEditorConfiguration' => '0', + 'disableIpLogging' => '0', + 'disableLeadModule' => '0', + 'disablePageOverview' => '0', + 'disableWorkflowModule' => '0', + 'enableExceptionLogging' => '1', + 'leadImageFromExternalSources' => 'all', + 'pageOverviewView' => 'analysis', + 'scoringCalculation' => '(10 * numberOfSiteVisits) + (1 * numberOfPageVisits) + (20 * downloads) - (1 * lastVisitDaysAgo)', + 'showRenderTimes' => '1', + 'useCacheLayer' => '0', + ], + 'luxletter' => [ + 'addTypeNumToNumberLocation' => '1562349004', + 'addUnsubscribeUrlToMailHeader' => '1', + 'asynchronousQueueStorage' => '0', + 'embedImagesInNewsletter' => '1', + 'limitToContext' => '', + 'multiLanguageMode' => '1', + 'multiLanguageNewsletterPageDoktype' => '11', + 'receiverAction' => '1', + 'rewriteLinksInNewsletter' => '1', + ], + ], 'FE' => [ 'cacheHash' => [ 'enforceValidation' => true, @@ -38,6 +70,7 @@ 'msclkid', ], ], + 'passwordPolicy' => 'simpleLuxletter', ], 'GFX' => [ 'colorspace' => 'sRGB', @@ -70,3 +103,19 @@ ] ]; $GLOBALS['TYPO3_CONF_VARS'] = array_replace_recursive($GLOBALS['TYPO3_CONF_VARS'], $additional); + +$GLOBALS['TYPO3_CONF_VARS']['SYS']['passwordPolicies'] = [ + 'simpleLuxletter' => [ + 'validators' => [ + \TYPO3\CMS\Core\PasswordPolicy\Validator\CorePasswordValidator::class => [ + 'options' => [ + 'minimumLength' => 3, + 'upperCaseCharacterRequired' => false, + 'lowerCaseCharacterRequired' => false, + 'digitCharacterRequired' => false, + 'specialCharacterRequired' => false, + ], + ], + ], + ], +]; diff --git a/.project/data/db.sql.gz b/.project/data/db.sql.gz index d6fbe0c7..1a1b4f27 100644 Binary files a/.project/data/db.sql.gz and b/.project/data/db.sql.gz differ diff --git a/.project/docker/docker-compose.darwin.yml b/.project/docker/docker-compose.darwin.yml index 62d1630a..b8f232d4 100644 --- a/.project/docker/docker-compose.darwin.yml +++ b/.project/docker/docker-compose.darwin.yml @@ -32,7 +32,7 @@ services: - host.docker.internal:host-gateway mysql: - image: in2code/mysql:5.7 + image: in2code/mysql:8.0 env_file: - .env volumes: diff --git a/.project/docker/docker-compose.unix.yml b/.project/docker/docker-compose.unix.yml index 18bc923d..8711af87 100644 --- a/.project/docker/docker-compose.unix.yml +++ b/.project/docker/docker-compose.unix.yml @@ -28,7 +28,7 @@ services: - .env mysql: - image: in2code/mysql:5.7 + image: in2code/mysql:8.0 env_file: - .env volumes: diff --git a/.project/docker/php/Dockerfile b/.project/docker/php/Dockerfile index df36a0ac..f94b05da 100644 --- a/.project/docker/php/Dockerfile +++ b/.project/docker/php/Dockerfile @@ -1,3 +1,3 @@ -FROM in2code/php-dev:8.1-fpm +FROM in2code/php-dev:8.2-fpm COPY zz_xdebug.ini /usr/local/etc/php/conf.d/zz_xdebug.ini diff --git a/Classes/Backend/Buttons/NavigationGroupButton.php b/Classes/Backend/Buttons/NavigationGroupButton.php index d615dd51..d2d6239a 100644 --- a/Classes/Backend/Buttons/NavigationGroupButton.php +++ b/Classes/Backend/Buttons/NavigationGroupButton.php @@ -53,8 +53,15 @@ public function render() protected function prepend(): string { - $icon = $this->iconFactory->getIcon('extension-lux'); - return $icon->render(); + return ' + + '; } protected function append(string $content): string @@ -65,13 +72,13 @@ protected function append(string $content): string $icon = $this->iconFactory->getIcon('extension-luxletter-star', Icon::SIZE_SMALL); $content .= '
'; - $content .= ''; + $content .= ''; $content .= $icon->render(); - $content .= 'Go enterprise
'; + $content .= ' Go enterprise'; return $content; } - public function __toString() + public function __toString(): string { return $this->render(); } diff --git a/Classes/Command/BuildQueueCommand.php b/Classes/Command/BuildQueueCommand.php index 331289cf..149c10b5 100644 --- a/Classes/Command/BuildQueueCommand.php +++ b/Classes/Command/BuildQueueCommand.php @@ -12,6 +12,8 @@ class BuildQueueCommand extends Command { + use FakeRequestTrait; + public function configure() { $this->setDescription('Build a queue to a newsletter. Normally used together with "asynchronousQueueStorage"'); @@ -19,6 +21,7 @@ public function configure() protected function execute(InputInterface $input, OutputInterface $output): int { + $this->fakeRequest(); $newsletterRepository = GeneralUtility::makeInstance(NewsletterRepository::class); $newsletter = $newsletterRepository->findOneNotQueued(); diff --git a/Classes/Command/CreateNewsletterFromOriginCommand.php b/Classes/Command/CreateNewsletterFromOriginCommand.php index 3d5532dc..9321fa7a 100644 --- a/Classes/Command/CreateNewsletterFromOriginCommand.php +++ b/Classes/Command/CreateNewsletterFromOriginCommand.php @@ -53,6 +53,7 @@ public function configure() protected function execute(InputInterface $input, OutputInterface $output): int { $this->fakeRequest(); + /** @var NewsletterFactory $newsletterFactory */ $newsletterFactory = GeneralUtility::makeInstance(NewsletterFactory::class); $newsletter = $newsletterFactory->get( $input->getArgument('title'), @@ -69,6 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->writeln('Newsletter with uid ' . $newsletter->getUid() . ' created'); if (ConfigurationUtility::isAsynchronousQueueStorageActivated() === false) { + /** @var QueueService $queueService */ $queueService = GeneralUtility::makeInstance(QueueService::class); $queuedAmount = $queueService->addMailReceiversToQueue($newsletter, (int)$input->getArgument('language')); $output->writeln('Added ' . $queuedAmount . ' queue records'); diff --git a/Classes/Command/FakeRequestTrait.php b/Classes/Command/FakeRequestTrait.php index 6e3daa52..86f8eb10 100644 --- a/Classes/Command/FakeRequestTrait.php +++ b/Classes/Command/FakeRequestTrait.php @@ -7,8 +7,8 @@ use TYPO3\CMS\Core\Http\ServerRequest; /** - * For whatever reason it seems not possible to create an instance of an extbase repository in a symfony command - * in TYPO3 12. So now we have to fake a request. + * It is not possible to create an instance of an extbase repository in a symfony command anymore in TYPO3 12 or newer + * So we have to fake a request, to get this running again. */ trait FakeRequestTrait { diff --git a/Classes/Controller/AbstractNewsletterController.php b/Classes/Controller/AbstractNewsletterController.php index 519a683b..0346d4ef 100644 --- a/Classes/Controller/AbstractNewsletterController.php +++ b/Classes/Controller/AbstractNewsletterController.php @@ -30,46 +30,25 @@ abstract class AbstractNewsletterController extends ActionController protected string $wizardUserPreviewFile = 'EXT:luxletter/Resources/Private/Templates/Newsletter/WizardUserPreview.html'; protected string $receiverDetailFile = 'EXT:luxletter/Resources/Private/Templates/Newsletter/ReceiverDetail.html'; - - protected ModuleTemplateFactory $moduleTemplateFactory; - protected IconFactory $iconFactory; protected ModuleTemplate $moduleTemplate; - protected NewsletterRepository $newsletterRepository; - protected UserRepository $userRepository; - protected UsergroupRepository $usergroupRepository; - protected LogRepository $logRepository; - protected ConfigurationRepository $configurationRepository; - protected PageRepository $pageRepository; - protected LayoutService $layoutService; - protected CategoryRepository $categoryRepository; public function __construct( - ModuleTemplateFactory $moduleTemplateFactory, - IconFactory $iconFactory, - NewsletterRepository $newsletterRepository, - UserRepository $userRepository, - UsergroupRepository $usergroupRepository, - LogRepository $logRepository, - ConfigurationRepository $configurationRepository, - PageRepository $pageRepository, - LayoutService $layoutService, - CategoryRepository $categoryRepository + readonly protected ModuleTemplateFactory $moduleTemplateFactory, + readonly protected IconFactory $iconFactory, + readonly protected NewsletterRepository $newsletterRepository, + readonly protected UserRepository $userRepository, + readonly protected UsergroupRepository $usergroupRepository, + readonly protected LogRepository $logRepository, + readonly protected ConfigurationRepository $configurationRepository, + readonly protected PageRepository $pageRepository, + readonly protected LayoutService $layoutService, + readonly protected CategoryRepository $categoryRepository ) { - $this->moduleTemplateFactory = $moduleTemplateFactory; - $this->iconFactory = $iconFactory; - $this->newsletterRepository = $newsletterRepository; - $this->userRepository = $userRepository; - $this->usergroupRepository = $usergroupRepository; - $this->logRepository = $logRepository; - $this->configurationRepository = $configurationRepository; - $this->pageRepository = $pageRepository; - $this->layoutService = $layoutService; - $this->categoryRepository = $categoryRepository; } - public function initializeView($view) + public function initializeView() { - $this->view->assignMultiple([ + $this->moduleTemplate->assignMultiple([ 'view' => [ 'controller' => $this->getControllerName(), 'action' => $this->getActionName(), @@ -77,7 +56,7 @@ public function initializeView($view) ]); } - public function initializeAction() + public function initializeAction(): void { $this->moduleTemplate = $this->moduleTemplateFactory->create($this->request); } @@ -163,8 +142,7 @@ protected function getActionName(): string protected function defaultRendering(): ResponseInterface { - $this->moduleTemplate->setContent($this->view->render()); - return $this->htmlResponse($this->moduleTemplate->renderContent()); + return $this->moduleTemplate->renderResponse($this->getControllerName() . '/' . ucfirst($this->getActionName())); } protected function addDocumentHeader(array $configuration): void diff --git a/Classes/Controller/FrontendController.php b/Classes/Controller/FrontendController.php index 56884fb9..93b5b0ec 100644 --- a/Classes/Controller/FrontendController.php +++ b/Classes/Controller/FrontendController.php @@ -3,8 +3,7 @@ declare(strict_types=1); namespace In2code\Luxletter\Controller; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Driver\Exception as ExceptionDbalDriver; +use Doctrine\DBAL\Exception as ExceptionDbal; use Exception; use In2code\Luxletter\Domain\Factory\UsergroupFactory; use In2code\Luxletter\Domain\Model\Newsletter; @@ -31,41 +30,27 @@ use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; -use TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException; class FrontendController extends ActionController { - protected ?UserRepository $userRepository; - protected UsergroupRepository $usergroupRepository; - protected ContentRepository $contentRepository; - protected LogService $logService; - protected UsergroupFactory $usergroupFactory; - public function __construct( - UserRepository $userRepository, - UsergroupRepository $usergroupRepository, - ContentRepository $contentRepository, - LogService $logService, - UsergroupFactory $usergroupFactory + readonly protected UserRepository $userRepository, + readonly protected UsergroupRepository $usergroupRepository, + readonly protected ContentRepository $contentRepository, + readonly protected LogService $logService, + readonly protected UsergroupFactory $usergroupFactory ) { - $this->userRepository = $userRepository; - $this->usergroupRepository = $usergroupRepository; - $this->contentRepository = $contentRepository; - $this->logService = $logService; - $this->usergroupFactory = $usergroupFactory; } /** - * @param \TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view (Todo: Param is only needed in TYPO3 11) * @return void * @throws ExtensionConfigurationExtensionNotConfiguredException * @throws ExtensionConfigurationPathDoesNotExistException */ - public function initializeView($view) + public function initializeView() { - $contentObject = $this->configurationManager->getContentObject(); $this->view->assignMultiple([ - 'data' => $contentObject->data, + 'data' => $this->request->getAttribute('currentContentObject')->data, 'extensionConfiguration' => GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('luxletter'), ]); } @@ -98,14 +83,12 @@ public function previewAction(string $origin, string $layout, int $language = 0) * @param Newsletter|null $newsletter * @param User|null $user * @return ResponseInterface - * @throws IllegalObjectTypeException - * @throws ExceptionDbalDriver - * @throws DBALException + * @throws ExceptionDbal */ public function trackingPixelAction(Newsletter $newsletter = null, User $user = null): ResponseInterface { if ($newsletter !== null && $user !== null) { - $this->logService->logNewsletterOpening($newsletter, $user); + $this->logService->logNewsletterOpening($newsletter->getUid(), $user->getUid()); } $content = base64_decode('R0lGODlhAQABAJAAAP8AAAAAACH5BAUQAAAALAAAAAABAAEAAAICBAEAOw=='); return $this->htmlResponse($content); @@ -151,14 +134,10 @@ public function unsubscribeAction( * Use same arguments as from default unsubscribe plugin * * @return void - * @throws ArgumentMissingException - * @throws AuthenticationFailedException - * @throws MisconfigurationException - * @throws UserValuesAreMissingException */ public function initializeUnsubscribe2Action(): void { - $arguments = GeneralUtility::_GP('tx_luxletter_fe'); + $arguments = $_REQUEST['tx_luxletter_fe'] ?? null; if (is_array($arguments)) { $this->request = $this->request->withArguments($arguments); } diff --git a/Classes/Controller/NewsletterController.php b/Classes/Controller/NewsletterController.php index cf4b6803..c86e69fa 100644 --- a/Classes/Controller/NewsletterController.php +++ b/Classes/Controller/NewsletterController.php @@ -32,7 +32,7 @@ public function initializeDashboardAction(): void public function dashboardAction(Filter $filter): ResponseInterface { - $this->view->assignMultiple([ + $this->moduleTemplate->assignMultiple([ 'filter' => $filter, 'newsletters' => $this->newsletterRepository->findAllByFilter($filter->setLimit(10)), 'groupedLinksByHref' => $this->logRepository->getGroupedLinksByHref($filter->setLimit(8)), @@ -62,7 +62,7 @@ public function initializeListAction(): void public function listAction(Filter $filter): ResponseInterface { - $this->view->assignMultiple([ + $this->moduleTemplate->assignMultiple([ 'filter' => $filter, 'newsletters' => $this->newsletterRepository->findAllAuthorized($filter), 'newslettersGrouped' => $this->newsletterRepository->findAllGroupedByCategories($filter), @@ -86,7 +86,7 @@ public function editAction(Newsletter $newsletter): ResponseInterface throw new AuthenticationFailedException('You are not allowed to see this record', 1709329205); } - $this->view->assignMultiple([ + $this->moduleTemplate->assignMultiple([ 'newsletter' => $newsletter, 'configurations' => $this->configurationRepository->findAllAuthorized(), 'layouts' => $this->layoutService->getLayouts(), @@ -127,7 +127,7 @@ public function updateAction(Newsletter $newsletter): ResponseInterface public function newAction(): ResponseInterface { - $this->view->assignMultiple([ + $this->moduleTemplate->assignMultiple([ 'configurations' => $this->configurationRepository->findAllAuthorized(), 'layouts' => $this->layoutService->getLayouts(), 'newsletterpages' => $this->pageRepository->findAllNewsletterPages(), @@ -220,7 +220,7 @@ public function receiverAction(Filter $filter): ResponseInterface { $receiverAnalysisService = GeneralUtility::makeInstance(ReceiverAnalysisService::class); $users = $this->userRepository->getUsersByFilter($filter->setLimit(1000)); - $this->view->assignMultiple( + $this->moduleTemplate->assignMultiple( [ 'filter' => $filter, 'users' => $users, diff --git a/Classes/DataProcessing/TeaserProcessor.php b/Classes/DataProcessing/TeaserProcessor.php index 64da88f3..ee5ba402 100644 --- a/Classes/DataProcessing/TeaserProcessor.php +++ b/Classes/DataProcessing/TeaserProcessor.php @@ -83,11 +83,11 @@ protected function getHtmlOfTeaserElement(int $identifier): string protected function getDataFromTeaserElement(int $identifier): array { $queryBuilder = DatabaseUtility::getQueryBuilderForTable('tt_content'); - $rows = (array)$queryBuilder + $rows = $queryBuilder ->select('*') ->from('tt_content') - ->where('uid=' . (int)$identifier) - ->execute() + ->where('uid=' . $identifier) + ->executeQuery() ->fetchAllAssociative(); if (!empty($rows[0])) { return $rows[0]; diff --git a/Classes/Domain/Model/Dto/Filter.php b/Classes/Domain/Model/Dto/Filter.php index 95a17af5..858f17f9 100644 --- a/Classes/Domain/Model/Dto/Filter.php +++ b/Classes/Domain/Model/Dto/Filter.php @@ -236,11 +236,12 @@ public function hasAnyAllowedSites(): bool /** * Always return given site or all available sites, so this can be always used in sql queries even for admins * + * @param bool $allAvailableSites If true, don't look into filter settings * @return array */ - public function getSitesForFilter(): array + public function getSitesForFilter(bool $allAvailableSites = false): array { - if ($this->isSiteSet()) { + if ($allAvailableSites === false && $this->isSiteSet()) { return [$this->getSite()]; } return array_merge(array_keys($this->getAllowedSites()), ['']); diff --git a/Classes/Domain/Repository/LanguageRepository.php b/Classes/Domain/Repository/LanguageRepository.php index 7065504f..060caf1f 100644 --- a/Classes/Domain/Repository/LanguageRepository.php +++ b/Classes/Domain/Repository/LanguageRepository.php @@ -23,7 +23,7 @@ public function getIsocodeFromIdentifier(int $languageIdentifier, string $origin { $siteLanguage = $this->getSiteLanguage($languageIdentifier, $origin); if ($siteLanguage !== null) { - return $siteLanguage->getTwoLetterIsoCode(); + return $siteLanguage->getLocale()->getLanguageCode(); } return ''; } diff --git a/Classes/Domain/Repository/LinkRepository.php b/Classes/Domain/Repository/LinkRepository.php index d8f5a82d..20b25cff 100644 --- a/Classes/Domain/Repository/LinkRepository.php +++ b/Classes/Domain/Repository/LinkRepository.php @@ -3,15 +3,32 @@ declare(strict_types=1); namespace In2code\Luxletter\Domain\Repository; +use In2code\Luxletter\Domain\Model\Link; use In2code\Luxletter\Exception\ArgumentMissingException; +use In2code\Luxletter\Utility\DatabaseUtility; +use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Extbase\Object\Exception; use TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException; -/** - * Class LinkRepository - */ class LinkRepository extends AbstractRepository { + public function findOneByHashRaw(string $hash): array + { + $queryBuilder = DatabaseUtility::getQueryBuilderForTable(Link::TABLE_NAME); + $row = $queryBuilder + ->select('*') + ->from(Link::TABLE_NAME) + ->where( + $queryBuilder->expr()->eq('hash', $queryBuilder->createNamedParameter($hash, Connection::PARAM_STR)) + ) + ->orderBy('uid', 'desc') + ->executeQuery() + ->fetchAssociative(); + if ($row === false) { + $row = []; + } + return $row; + } /** * @param string $hash * @return bool diff --git a/Classes/Domain/Repository/LogRepository.php b/Classes/Domain/Repository/LogRepository.php index 77c69e9c..09957446 100644 --- a/Classes/Domain/Repository/LogRepository.php +++ b/Classes/Domain/Repository/LogRepository.php @@ -263,19 +263,19 @@ public function getOverallSubscribes(Filter $filter): int } /** - * @param Newsletter $newsletter - * @param User $user + * @param int $newsletterIdentifier + * @param int $userIdentifier * @param int $status * @return bool * @throws ExceptionDbal */ - public function isLogRecordExisting(Newsletter $newsletter, User $user, int $status): bool + public function isLogRecordExisting(int $newsletterIdentifier, int $userIdentifier, int $status): bool { $queryBuilder = DatabaseUtility::getQueryBuilderForTable(Log::TABLE_NAME); $uid = (int)$queryBuilder ->select('uid') ->from(Log::TABLE_NAME) - ->where('newsletter=' . $newsletter->getUid() . ' and user=' . $user->getUid() . ' and status=' . $status) + ->where('newsletter=' . $newsletterIdentifier . ' and user=' . $userIdentifier . ' and status=' . $status) ->setMaxResults(1) ->executeQuery() ->fetchOne(); diff --git a/Classes/Domain/Repository/NewsletterRepository.php b/Classes/Domain/Repository/NewsletterRepository.php index d7eb638e..a08d5d33 100644 --- a/Classes/Domain/Repository/NewsletterRepository.php +++ b/Classes/Domain/Repository/NewsletterRepository.php @@ -26,7 +26,7 @@ class NewsletterRepository extends AbstractRepository public function findAllAuthorized(Filter $filter): QueryResultInterface { $query = $this->createQuery(); - $query->matching($query->in('configuration.site', $filter->getSitesForFilter())); + $query->matching($query->in('configuration.site', $filter->getSitesForFilter(true))); if ($filter->isLimitSet()) { $query->setLimit($filter->getLimit()); } diff --git a/Classes/Domain/Repository/PageRepository.php b/Classes/Domain/Repository/PageRepository.php index 04178f3d..988b9cd5 100644 --- a/Classes/Domain/Repository/PageRepository.php +++ b/Classes/Domain/Repository/PageRepository.php @@ -8,10 +8,10 @@ use In2code\Luxletter\Utility\BackendUserUtility; use In2code\Luxletter\Utility\ConfigurationUtility; use In2code\Luxletter\Utility\DatabaseUtility; -use PDO; use Throwable; use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException; use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException; +use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Utility\MathUtility; class PageRepository @@ -74,11 +74,11 @@ public function getSubjectFromPageIdentifier(int $pageIdentifier, int $language) ->where( $queryBuilder->expr()->eq( $fieldname, - $queryBuilder->createNamedParameter($pageIdentifier, PDO::PARAM_INT) + $queryBuilder->createNamedParameter($pageIdentifier, Connection::PARAM_INT) ), $queryBuilder->expr()->eq( 'sys_language_uid', - $queryBuilder->createNamedParameter($language, PDO::PARAM_INT) + $queryBuilder->createNamedParameter($language, Connection::PARAM_INT) ) ) ->executeQuery() diff --git a/Classes/Domain/Service/LayoutService.php b/Classes/Domain/Service/LayoutService.php index 5e0479df..e661249e 100644 --- a/Classes/Domain/Service/LayoutService.php +++ b/Classes/Domain/Service/LayoutService.php @@ -11,7 +11,6 @@ use In2code\Luxletter\Utility\ConfigurationUtility; use In2code\Luxletter\Utility\ObjectUtility; use In2code\Luxletter\Utility\StringUtility; -use Throwable; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException; @@ -93,7 +92,6 @@ protected function getPathAndFilenameFromLayoutForDefaultLanguage(string $layout * @return string * @throws InvalidConfigurationTypeException * @throws MisconfigurationException - * @throws RecordInDatabaseNotFoundException */ protected function getPathAndFilenameFromLayoutForSpecificLanguage( string $layout, @@ -101,14 +99,7 @@ protected function getPathAndFilenameFromLayoutForSpecificLanguage( string $origin ): string { $languageRepository = GeneralUtility::makeInstance(LanguageRepository::class); - try { - $isocode = $languageRepository->getIsocodeFromIdentifier($language, $origin); - } catch (Throwable $exception) { - throw new RecordInDatabaseNotFoundException( - 'No isocode found found in table sys_language for language with uid ' . $language, - 1646250413 - ); - } + $isocode = $languageRepository->getIsocodeFromIdentifier($language, $origin); $filename = $this->getLayoutPath() . $layout . '_' . $isocode . '.html'; if (is_file(GeneralUtility::getFileAbsFileName($filename))) { return $filename; diff --git a/Classes/Domain/Service/LogService.php b/Classes/Domain/Service/LogService.php index 6d84d5cb..e01af66a 100644 --- a/Classes/Domain/Service/LogService.php +++ b/Classes/Domain/Service/LogService.php @@ -3,104 +3,71 @@ declare(strict_types=1); namespace In2code\Luxletter\Domain\Service; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Driver\Exception as ExceptionDbalDriver; -use In2code\Luxletter\Domain\Model\Link; +use Doctrine\DBAL\Exception as ExceptionDbal; use In2code\Luxletter\Domain\Model\Log; use In2code\Luxletter\Domain\Model\Newsletter; use In2code\Luxletter\Domain\Model\User; use In2code\Luxletter\Domain\Repository\LogRepository; +use In2code\Luxletter\Utility\DatabaseUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException; -/** - * Class LogService - */ class LogService { - /** - * @param Newsletter $newsletter - * @param User $user - * @return void - * @throws IllegalObjectTypeException - */ public function logNewsletterDispatch(Newsletter $newsletter, User $user): void { - $this->log($newsletter, $user, Log::STATUS_DISPATCH); + $this->log($newsletter->getUid(), $user->getUid(), Log::STATUS_DISPATCH); } - /** - * @param Newsletter $newsletter - * @param User $user - * @return void - * @throws IllegalObjectTypeException - */ public function logNewsletterDispatchFailure(Newsletter $newsletter, User $user, string $message): void { - $this->log($newsletter, $user, Log::STATUS_DISPATCH_FAILURE, ['exception' => $message]); + $this->log($newsletter->getUid(), $user->getUid(), Log::STATUS_DISPATCH_FAILURE, ['exception' => $message]); } /** * Log the opening of a newsletter (via tracking pixel or when clicking a link) only once per newsletter and user * - * @param Newsletter $newsletter - * @param User $user + * @param int $newsletterIdentifier + * @param int $userIdentifier * @return void - * @throws IllegalObjectTypeException - * @throws ExceptionDbalDriver - * @throws DBALException + * @throws ExceptionDbal */ - public function logNewsletterOpening(Newsletter $newsletter, User $user): void + public function logNewsletterOpening(int $newsletterIdentifier, int $userIdentifier): void { $logRepository = GeneralUtility::makeInstance(LogRepository::class); - if ($logRepository->isLogRecordExisting($newsletter, $user, Log::STATUS_NEWSLETTEROPENING) === false) { - $this->log($newsletter, $user, Log::STATUS_NEWSLETTEROPENING); + if ($logRepository->isLogRecordExisting($newsletterIdentifier, $userIdentifier, Log::STATUS_NEWSLETTEROPENING) === false) { + $this->log($newsletterIdentifier, $userIdentifier, Log::STATUS_NEWSLETTEROPENING); } } /** - * @param Link $link + * @param array $link * @return void - * @throws ExceptionDbalDriver - * @throws IllegalObjectTypeException - * @throws DBALException + * @throws ExceptionDbal */ - public function logLinkOpening(Link $link): void + public function logLinkOpening(array $link): void { - if ($link->getUser() !== null) { - $this->logNewsletterOpening($link->getNewsletter(), $link->getUser()); - $this->log($link->getNewsletter(), $link->getUser(), Log::STATUS_LINKOPENING, ['target' => $link->getTarget()]); + if (($link['user'] ?? 0) > 0 && ($link['newsletter'] ?? 0) > 0) { + $this->logNewsletterOpening($link['newsletter'], $link['user']); + $this->log($link['newsletter'], $link['user'], Log::STATUS_LINKOPENING, ['target' => $link['target']]); } } - /** - * @param Newsletter $newsletter - * @param User $user - * @return void - * @throws IllegalObjectTypeException - */ public function logUnsubscribe(Newsletter $newsletter, User $user): void { - $this->log($newsletter, $user, Log::STATUS_UNSUBSCRIBE); + $this->log($newsletter->getUid(), $user->getUid(), Log::STATUS_UNSUBSCRIBE); } - /** - * @param Newsletter $newsletter - * @param User $user - * @param int $status - * @param array $properties - * @return void - * @throws IllegalObjectTypeException - */ - protected function log(Newsletter $newsletter, User $user, int $status, array $properties = []): void + protected function log(int $newsletterIdentifier, int $userIdentifier, int $status, array $properties = []): void { - $logRepository = GeneralUtility::makeInstance(LogRepository::class); - $log = GeneralUtility::makeInstance(Log::class) - ->setStatus($status) - ->setProperties($properties) - ->setNewsletter($newsletter) - ->setUser($user); - $logRepository->add($log); - $logRepository->persistAll(); + $queryBuilder = DatabaseUtility::getQueryBuilderForTable(Log::TABLE_NAME); + $queryBuilder + ->insert(Log::TABLE_NAME) + ->values([ + 'status' => $status, + 'properties' => json_encode($properties), + 'user' => $userIdentifier, + 'newsletter' => $newsletterIdentifier, + ]) + ->executeStatement(); } } diff --git a/Classes/Domain/Service/PermissionTrait.php b/Classes/Domain/Service/PermissionTrait.php index d6355d4b..fdf328c0 100644 --- a/Classes/Domain/Service/PermissionTrait.php +++ b/Classes/Domain/Service/PermissionTrait.php @@ -6,6 +6,7 @@ use Doctrine\DBAL\Exception as ExceptionDbal; use In2code\Luxletter\Exception\MisconfigurationException; use In2code\Luxletter\Utility\BackendUserUtility; +use In2code\Luxletter\Utility\ConfigurationUtility; use In2code\Luxletter\Utility\DatabaseUtility; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Type\Bitmask\Permission; @@ -65,7 +66,7 @@ protected function getIdentifierFromArrayOrObject($object, $key): int */ private function isAuthenticatedForRecord(int $identifier, string $table): bool { - if (BackendUserUtility::isAdministrator()) { + if (ConfigurationUtility::isCli() || BackendUserUtility::isAdministrator()) { return true; } diff --git a/Classes/Domain/Service/PreviewUrlService.php b/Classes/Domain/Service/PreviewUrlService.php index 94b47345..a11540c0 100644 --- a/Classes/Domain/Service/PreviewUrlService.php +++ b/Classes/Domain/Service/PreviewUrlService.php @@ -3,7 +3,6 @@ declare(strict_types=1); namespace In2code\Luxletter\Domain\Service; -use Doctrine\DBAL\Driver\Exception as ExceptionDbalDriver; use In2code\Luxletter\Domain\Factory\UserFactory; use In2code\Luxletter\Domain\Repository\PageRepository; use In2code\Luxletter\Domain\Service\Parsing\Newsletter as NewsletterParsing; @@ -12,7 +11,6 @@ use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException; use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException; class PreviewUrlService @@ -36,7 +34,6 @@ public function __construct() * @param string $origin * @param string $layout * @return array|string[] - * @throws ExceptionDbalDriver * @throws ExtensionConfigurationExtensionNotConfiguredException * @throws ExtensionConfigurationPathDoesNotExistException * @throws MisconfigurationException @@ -87,9 +84,9 @@ protected function getUrlInDefaultInstallation(string $origin, string $layout): protected function getUrl(string $origin, string $layout, int $language = 0): string { - if (MathUtility::canBeInterpretedAsInteger($origin)) { - return $this->getUrlFromPageIdentifier((int)$origin, $layout, $language); - } + // if (MathUtility::canBeInterpretedAsInteger($origin)) { + // return $this->getUrlFromPageIdentifier((int)$origin, $layout, $language); + // } $url = '//' . GeneralUtility::getIndpEnv('HTTP_HOST') . '?type=1560777975'; $url .= '&tx_luxletter_preview[origin]=' . htmlspecialchars($origin); diff --git a/Classes/Events/LuxletterLinkGetHashEvent.php b/Classes/Events/LuxletterLinkGetHashEvent.php index 3c0f69fe..cb942459 100644 --- a/Classes/Events/LuxletterLinkGetHashEvent.php +++ b/Classes/Events/LuxletterLinkGetHashEvent.php @@ -5,31 +5,23 @@ final class LuxletterLinkGetHashEvent { - /** - * @var string|null - */ - protected $hash; + protected ?string $hash = null; - /** - * @param string|null $hash - */ public function __construct(string $hash = null) { $this->hash = $hash; } - /** - * @return string|null - */ - public function getHash() + public function getHash(): ?string { return $this->hash; } - /** - * @param string|null $hash - * @return LuxletterLinkGetHashEvent - */ + public function isHashGiven(): bool + { + return $this->getHash() !== null; + } + public function setHash(string $hash = null): LuxletterLinkGetHashEvent { $this->hash = $hash; diff --git a/Classes/Events/LuxletterLinkLuxIdentificationEvent.php b/Classes/Events/LuxletterLinkLuxIdentificationEvent.php index d151ef51..fd2d5ae5 100644 --- a/Classes/Events/LuxletterLinkLuxIdentificationEvent.php +++ b/Classes/Events/LuxletterLinkLuxIdentificationEvent.php @@ -3,58 +3,30 @@ declare(strict_types=1); namespace In2code\Luxletter\Events; -use In2code\Luxletter\Domain\Model\Link; - final class LuxletterLinkLuxIdentificationEvent { - /** - * @var Link - */ - protected Link $link; - - /** - * @var bool - */ protected bool $identification = true; - /** - * @param Link $link - */ - public function __construct(Link $link) + public function __construct(protected array $link) { - $this->link = $link; } - /** - * @return Link - */ - public function getLink(): Link + public function getLink(): array { return $this->link; } - /** - * @param Link $link - * @return LuxletterLinkLuxIdentificationEvent - */ - public function setLink(Link $link): LuxletterLinkLuxIdentificationEvent + public function setLink(array $link): LuxletterLinkLuxIdentificationEvent { $this->link = $link; return $this; } - /** - * @return bool - */ public function isIdentification(): bool { return $this->identification; } - /** - * @param bool $identification - * @return LuxletterLinkLuxIdentificationEvent - */ public function setIdentification(bool $identification): LuxletterLinkLuxIdentificationEvent { $this->identification = $identification; diff --git a/Classes/Events/LuxletterLinkProcessEvent.php b/Classes/Events/LuxletterLinkProcessEvent.php index c54552ad..55986f8d 100644 --- a/Classes/Events/LuxletterLinkProcessEvent.php +++ b/Classes/Events/LuxletterLinkProcessEvent.php @@ -3,68 +3,39 @@ declare(strict_types=1); namespace In2code\Luxletter\Events; -use In2code\Luxletter\Domain\Model\Link; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; final class LuxletterLinkProcessEvent { /** - * @var Link - */ - protected $link; - - /** - * @var ServerRequestInterface - */ - protected $request; - - /** - * @var RequestHandlerInterface - */ - protected $handler; - - /** - * @param Link $link + * @param array $link * @param ServerRequestInterface $request * @param RequestHandlerInterface $handler */ - public function __construct(Link $link, ServerRequestInterface $request, RequestHandlerInterface $handler) - { - $this->link = $link; - $this->request = $request; - $this->handler = $handler; + public function __construct( + protected array $link, + protected ServerRequestInterface $request, + protected RequestHandlerInterface $handler + ) { } - /** - * @return Link - */ - public function getLink(): Link + public function getLink(): array { return $this->link; } - /** - * @param Link $link - * @return LuxletterLinkProcessEvent - */ - public function setLink(Link $link): LuxletterLinkProcessEvent + public function setLink(array $link): LuxletterLinkProcessEvent { $this->link = $link; return $this; } - /** - * @return ServerRequestInterface - */ public function getRequest(): ServerRequestInterface { return $this->request; } - /** - * @return RequestHandlerInterface - */ public function getHandler(): RequestHandlerInterface { return $this->handler; diff --git a/Classes/Middleware/LuxletterLink.php b/Classes/Middleware/LuxletterLink.php index 82fc0da3..ee9bbb27 100644 --- a/Classes/Middleware/LuxletterLink.php +++ b/Classes/Middleware/LuxletterLink.php @@ -3,10 +3,8 @@ declare(strict_types=1); namespace In2code\Luxletter\Middleware; -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Driver\Exception as ExceptionDbalDriver; +use Doctrine\DBAL\Exception as ExceptionDbal; use In2code\Lux\Utility\CookieUtility; -use In2code\Luxletter\Domain\Model\Link; use In2code\Luxletter\Domain\Repository\LinkRepository; use In2code\Luxletter\Domain\Service\LogService; use In2code\Luxletter\Events\LuxletterLinkGetHashEvent; @@ -19,9 +17,7 @@ use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; use TYPO3\CMS\Core\Http\RedirectResponse; -use TYPO3\CMS\Core\Package\Exception; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException; +use TYPO3\CMS\Core\Package\Exception as ExceptionPackage; /** * Class LuxletterLink @@ -29,41 +25,31 @@ */ class LuxletterLink implements MiddlewareInterface { - private EventDispatcherInterface $eventDispatcher; - - public function __construct(EventDispatcherInterface $eventDispatcher) - { - $this->eventDispatcher = $eventDispatcher; + public function __construct( + readonly private EventDispatcherInterface $eventDispatcher, + readonly private LinkRepository $linkRepository, + readonly private LogService $logService + ) { } /** * @param ServerRequestInterface $request * @param RequestHandlerInterface $handler * @return ResponseInterface - * @throws Exception - * @throws IllegalObjectTypeException - * @throws DBALException - * @throws ExceptionDbalDriver + * @throws ExceptionPackage + * @throws ExceptionDbal */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { if ($this->isLuxletterLink()) { - $linkRepository = GeneralUtility::makeInstance(LinkRepository::class); - /** @var Link $link */ - $link = $linkRepository->findOneByHash($this->getHash()); - if ($link !== null) { + $link = $this->linkRepository->findOneByHashRaw($this->getHash()); + if ($link !== []) { /** @var LuxletterLinkProcessEvent $event */ - $event = $this->eventDispatcher->dispatch(GeneralUtility::makeInstance( - LuxletterLinkProcessEvent::class, - $link, - $request, - $handler - )); + $event = $this->eventDispatcher->dispatch(new LuxletterLinkProcessEvent($link, $request, $handler)); $link = $event->getLink(); $this->luxIdentification($link); - $logService = GeneralUtility::makeInstance(LogService::class); - $logService->logLinkOpening($link); - return new RedirectResponse($link->getTarget(), 302); + $this->logService->logLinkOpening($link); + return new RedirectResponse($link['target'], 302); } } return $handler->handle($request); @@ -71,34 +57,32 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface protected function isLuxletterLink(): bool { - return $this->getHash() !== null; + /** @var LuxletterLinkGetHashEvent $event */ + $event = $this->eventDispatcher->dispatch(new LuxletterLinkGetHashEvent($_REQUEST['luxletterlink'] ?? null)); + return $event->isHashGiven(); } protected function getHash(): ?string { - $hash = GeneralUtility::_GP('luxletterlink'); /** @var LuxletterLinkGetHashEvent $event */ - $event = $this->eventDispatcher->dispatch( - GeneralUtility::makeInstance(LuxletterLinkGetHashEvent::class, $hash) - ); + $event = $this->eventDispatcher->dispatch(new LuxletterLinkGetHashEvent($_REQUEST['luxletterlink'] ?? null)); return $event->getHash(); } /** * Identification of user in EXT:lux: Set a session cookie that can be removed once it was read by lux * - * @param Link $link + * @param array $link * @return void - * @throws Exception + * @throws ExceptionPackage */ - protected function luxIdentification(Link $link): void + protected function luxIdentification(array $link): void { /** @var LuxletterLinkLuxIdentificationEvent $event */ - $event = $this->eventDispatcher->dispatch( - GeneralUtility::makeInstance(LuxletterLinkLuxIdentificationEvent::class, $link) - ); + $event = $this->eventDispatcher->dispatch(new LuxletterLinkLuxIdentificationEvent($link)); if (ExtensionUtility::isLuxAvailable() && $event->isIdentification()) { - CookieUtility::setCookie('luxletterlinkhash', $link->getHash()); + $link = $event->getLink(); + CookieUtility::setCookie('luxletterlinkhash', $link['hash']); } } } diff --git a/Classes/Utility/ConfigurationUtility.php b/Classes/Utility/ConfigurationUtility.php index bd098f5b..164ed4db 100644 --- a/Classes/Utility/ConfigurationUtility.php +++ b/Classes/Utility/ConfigurationUtility.php @@ -9,8 +9,8 @@ use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException; use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; use TYPO3\CMS\Core\Core\Environment; +use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Core\Utility\VersionNumberUtility; use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; use TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException; @@ -196,32 +196,13 @@ public static function getEncryptionKey(): string return $encryptionKey; } - /** - * Todo: Can be removed if TYPO3 11 support is dropped - * - * @return bool - */ public static function isTypo3Version12(): bool { - return self::isVersionToCompareSameOrLowerThenCurrentTypo3Version('11.5.99'); - } - - /** - * @param string $versionToCompare like "1.2.3" - * @return bool - */ - public static function isVersionToCompareSameOrLowerThenCurrentTypo3Version(string $versionToCompare): bool - { - return VersionNumberUtility::convertVersionNumberToInteger($versionToCompare) <= self::getCurrentTypo3Version(); + return (new Typo3Version())->getMajorVersion() === 12; } - /** - * Return current TYPO3 version as integer - e.g. 10003000 (10.3.0) or 9005014 (9.5.14) - * - * @return int - */ - protected static function getCurrentTypo3Version(): int + public static function isCli(): bool { - return VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getNumericTypo3Version()); + return Environment::isCli(); } } diff --git a/Classes/Utility/FrontendUtility.php b/Classes/Utility/FrontendUtility.php index 5f9ffb21..bcc23bbb 100644 --- a/Classes/Utility/FrontendUtility.php +++ b/Classes/Utility/FrontendUtility.php @@ -3,7 +3,6 @@ declare(strict_types=1); namespace In2code\Luxletter\Utility; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; class FrontendUtility @@ -21,7 +20,7 @@ public static function getActionName(): string { $action = ''; $plugin = self::getPluginName(); - $arguments = GeneralUtility::_GPmerged($plugin); + $arguments = $_REQUEST[$plugin] ?? []; if (!empty($arguments['action'])) { $action = $arguments['action']; } @@ -31,7 +30,7 @@ public static function getActionName(): string public static function getModuleName(): string { $module = ''; - $route = GeneralUtility::_GP('route'); + $route = $_REQUEST['route'] ?? ''; if (!empty($route)) { $module = rtrim(ltrim($route, '/lux/Luxletter'), '/'); } diff --git a/Classes/ViewHelpers/Condition/IsLuxenterpriseExtensionActivatedViewHelper.php b/Classes/ViewHelpers/Condition/IsLuxenterpriseExtensionActivatedViewHelper.php index 1589957c..82a52d4e 100644 --- a/Classes/ViewHelpers/Condition/IsLuxenterpriseExtensionActivatedViewHelper.php +++ b/Classes/ViewHelpers/Condition/IsLuxenterpriseExtensionActivatedViewHelper.php @@ -4,19 +4,12 @@ namespace In2code\Luxletter\ViewHelpers\Condition; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; +use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractConditionViewHelper; -/** - * IsLuxenterpriseExtensionActivatedViewHelper - * @noinspection PhpUnused - */ class IsLuxenterpriseExtensionActivatedViewHelper extends AbstractConditionViewHelper { - /** - * @param null $arguments - * @return bool - */ - protected static function evaluateCondition($arguments = null): bool + public static function verdict(array $arguments, RenderingContextInterface $renderingContext) { return ExtensionManagementUtility::isLoaded('luxenterprise'); } diff --git a/Classes/ViewHelpers/Condition/IsMultiLanguageModeActivatedViewHelper.php b/Classes/ViewHelpers/Condition/IsMultiLanguageModeActivatedViewHelper.php index e4d0c1dc..40a0dc99 100644 --- a/Classes/ViewHelpers/Condition/IsMultiLanguageModeActivatedViewHelper.php +++ b/Classes/ViewHelpers/Condition/IsMultiLanguageModeActivatedViewHelper.php @@ -4,23 +4,12 @@ namespace In2code\Luxletter\ViewHelpers\Condition; use In2code\Luxletter\Utility\ConfigurationUtility; -use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException; -use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException; +use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractConditionViewHelper; -/** - * IsMultiLanguageModeActivatedViewHelper - * @noinspection PhpUnused - */ class IsMultiLanguageModeActivatedViewHelper extends AbstractConditionViewHelper { - /** - * @param null $arguments - * @return bool - * @throws ExtensionConfigurationExtensionNotConfiguredException - * @throws ExtensionConfigurationPathDoesNotExistException - */ - protected static function evaluateCondition($arguments = null): bool + public static function verdict(array $arguments, RenderingContextInterface $renderingContext) { return ConfigurationUtility::isMultiLanguageModeActivated(); } diff --git a/Classes/ViewHelpers/Condition/IsNewsletterTypenumViewHelper.php b/Classes/ViewHelpers/Condition/IsNewsletterTypenumViewHelper.php index 72a419f8..90e688fc 100644 --- a/Classes/ViewHelpers/Condition/IsNewsletterTypenumViewHelper.php +++ b/Classes/ViewHelpers/Condition/IsNewsletterTypenumViewHelper.php @@ -3,24 +3,14 @@ declare(strict_types=1); namespace In2code\Luxletter\ViewHelpers\Condition; -use Exception; use In2code\Luxletter\Utility\ConfigurationUtility; -use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractConditionViewHelper; -/** - * Class IsNewsletterTypenumViewHelper - * @noinspection PhpUnused - */ class IsNewsletterTypenumViewHelper extends AbstractConditionViewHelper { - /** - * @param null $arguments - * @return bool - * @throws Exception - */ - protected static function evaluateCondition($arguments = null): bool + public static function verdict(array $arguments, RenderingContextInterface $renderingContext) { - return ConfigurationUtility::getTypeNumToNumberLocation() === (int)GeneralUtility::_GP('type'); + return ConfigurationUtility::getTypeNumToNumberLocation() === (int)($_REQUEST['type'] ?? 0); } } diff --git a/Classes/ViewHelpers/Condition/IsReceiverActionEnabledViewHelper.php b/Classes/ViewHelpers/Condition/IsReceiverActionEnabledViewHelper.php index cb67bee0..1bde85b0 100644 --- a/Classes/ViewHelpers/Condition/IsReceiverActionEnabledViewHelper.php +++ b/Classes/ViewHelpers/Condition/IsReceiverActionEnabledViewHelper.php @@ -4,23 +4,12 @@ namespace In2code\Luxletter\ViewHelpers\Condition; use In2code\Luxletter\Utility\ConfigurationUtility; -use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException; -use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException; +use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractConditionViewHelper; -/** - * Class IsReceiverActionEnabledViewHelper - * @noinspection PhpUnused - */ class IsReceiverActionEnabledViewHelper extends AbstractConditionViewHelper { - /** - * @param null $arguments - * @return bool - * @throws ExtensionConfigurationExtensionNotConfiguredException - * @throws ExtensionConfigurationPathDoesNotExistException - */ - protected static function evaluateCondition($arguments = null): bool + public static function verdict(array $arguments, RenderingContextInterface $renderingContext) { return ConfigurationUtility::isReceiverActionActivated(); } diff --git a/Classes/ViewHelpers/Condition/IsTypo3ElevenViewHelper.php b/Classes/ViewHelpers/Condition/IsTypo3ElevenViewHelper.php deleted file mode 100644 index 5ea48128..00000000 --- a/Classes/ViewHelpers/Condition/IsTypo3ElevenViewHelper.php +++ /dev/null @@ -1,21 +0,0 @@ -registerArgument('usergroup', Usergroup::class, 'Usergroup to check for', true); } - protected static function evaluateCondition($arguments = null): bool + public static function verdict(array $arguments, RenderingContextInterface $renderingContext) { /** @var User $user */ $user = $arguments['user']; diff --git a/Classes/ViewHelpers/Pagination/PaginateViewHelper.php b/Classes/ViewHelpers/Pagination/PaginateViewHelper.php index e0279cbe..763163f4 100644 --- a/Classes/ViewHelpers/Pagination/PaginateViewHelper.php +++ b/Classes/ViewHelpers/Pagination/PaginateViewHelper.php @@ -114,7 +114,7 @@ protected static function getPageNumber(array $arguments, RenderingContextInterf $pluginName = $renderingContext->getRequest()->getPluginName(); $extensionService = GeneralUtility::makeInstance(ExtensionService::class); $pluginNamespace = $extensionService->getPluginNamespace($extensionName, $pluginName); - $variables = GeneralUtility::_GP($pluginNamespace); + $variables = $_REQUEST[$pluginNamespace] ?? []; if ($variables !== null) { if (!empty($variables[self::getName($arguments)]['currentPage'])) { return (int)$variables[self::getName($arguments)]['currentPage']; diff --git a/Configuration/ContentSecurityPolicies.php b/Configuration/ContentSecurityPolicies.php new file mode 100644 index 00000000..8c29db91 --- /dev/null +++ b/Configuration/ContentSecurityPolicies.php @@ -0,0 +1,23 @@ +
- - LLL:EXT:luxletter/Resources/Private/Language/locallang_db.xlf:ctype.teaser.flexform - + LLL:EXT:luxletter/Resources/Private/Language/locallang_db.xlf:ctype.teaser.flexform - - - - input - 40 - 9 - 240 - int,required - - + + + input + 40 + 9 + 240 + int,required + - - - - input - 40 - 200 - ... - - + + + input + 40 + 200 + ... + - - - - input - 40 - 200 - read more - required - - + + + input + 40 + 200 + read more + required + - - - - group - db - tt_content - 10 - 10 - 1 - - - suggest - - - - + + + group + db + tt_content + 10 + 10 + 1 + + + suggest + + + - - 1 - - - check - - + 1 + + + check + diff --git a/Configuration/FlexForm/FlexFormFe.xml b/Configuration/FlexForm/FlexFormFe.xml index b4870eed..1942ee21 100644 --- a/Configuration/FlexForm/FlexFormFe.xml +++ b/Configuration/FlexForm/FlexFormFe.xml @@ -1,31 +1,27 @@ - - 1 - - -
- - - Luxletter - - array - - - - 1 - - - text - Thank you for unsubscribing.

-

You will not receive newsletters any more from our service.

]]>
- 1 - default -
- richtext[]:rte_transform[mode=ts_css] -
-
-
-
-
-
+ + 1 + + +
+ + Luxletter + array + + + 1 + + + text + Thank you for unsubscribing.

+

You will not receive newsletters any more from our service.

]]>
+ 1 + default +
+ richtext[]:rte_transform[mode=ts_css] +
+
+
+
+
diff --git a/Configuration/FlexForm/FlexFormUnsubscribe2.xml b/Configuration/FlexForm/FlexFormUnsubscribe2.xml index 80792902..6aa3fc92 100644 --- a/Configuration/FlexForm/FlexFormUnsubscribe2.xml +++ b/Configuration/FlexForm/FlexFormUnsubscribe2.xml @@ -5,23 +5,19 @@
- - Luxletter - + Luxletter array - - 1 - - - select - fe_groups - 1 - selectMultipleSideBySide - 6 - - + 1 + + + select + fe_groups + 1 + selectMultipleSideBySide + 6 + diff --git a/Configuration/JavaScriptModules.php b/Configuration/JavaScriptModules.php new file mode 100644 index 00000000..6790e44d --- /dev/null +++ b/Configuration/JavaScriptModules.php @@ -0,0 +1,14 @@ + [ + 'core', + ], + 'imports' => [ + '@in2code/luxletter/' => [ + 'path' => 'EXT:luxletter/Resources/Public/JavaScript/Luxletter/', + ], + '@in2code/luxletter/vendor/chartjs.js' => 'EXT:luxletter/Resources/Public/JavaScript/Vendor/Chart.min.js', + '@in2code/luxletter/vendor/choices.js' => 'EXT:luxletter/Resources/Public/JavaScript/Vendor/Choices.min.js', + ], +]; diff --git a/Configuration/Services.php b/Configuration/Services.php index 4a7ed655..92abd313 100644 --- a/Configuration/Services.php +++ b/Configuration/Services.php @@ -22,7 +22,7 @@ $services = $configurator->services(); if ($containerBuilder->hasDefinition(Dashboard::class)) { - $configuration = $services->set('dashboard.widgets.OpenRateWidget') + $services->set('dashboard.widgets.OpenRateWidget') ->class(DoughnutChartWidget::class) ->tag('dashboard.widget', [ 'identifier' => 'luxletterOpenRate', @@ -33,16 +33,10 @@ 'height' => 'medium', 'width' => 'small', ]) - ->arg('$dataProvider', new Reference(OpenRateDataProvider::class)); - if ($containerBuilder->hasDefinition(BackendViewFactory::class)) { - // TYPO3 12 - $configuration->arg('$backendViewFactory', new Reference(BackendViewFactory::class)); - } else { - // Todo: Can be removed when TYPO3 11 support will be dropped - $configuration->arg('$view', new Reference('dashboard.views.widget')); - } + ->arg('$dataProvider', new Reference(OpenRateDataProvider::class)) + ->arg('$backendViewFactory', new Reference(BackendViewFactory::class)); - $configuration = $services->set('dashboard.widgets.ClickRateWidget') + $services->set('dashboard.widgets.ClickRateWidget') ->class(DoughnutChartWidget::class) ->tag('dashboard.widget', [ 'identifier' => 'luxletterClickRate', @@ -53,16 +47,10 @@ 'height' => 'medium', 'width' => 'small', ]) - ->arg('$dataProvider', new Reference(ClickRateDataProvider::class)); - if ($containerBuilder->hasDefinition(BackendViewFactory::class)) { - // TYPO3 12 - $configuration->arg('$backendViewFactory', new Reference(BackendViewFactory::class)); - } else { - // Todo: Can be removed when TYPO3 11 support will be dropped - $configuration->arg('$view', new Reference('dashboard.views.widget')); - } + ->arg('$dataProvider', new Reference(ClickRateDataProvider::class)) + ->arg('$backendViewFactory', new Reference(BackendViewFactory::class)); - $configuration = $services->set('dashboard.widgets.UnsubscribeRateWidget') + $services->set('dashboard.widgets.UnsubscribeRateWidget') ->class(DoughnutChartWidget::class) ->tag('dashboard.widget', [ 'identifier' => 'luxletterUnsubscribeRate', @@ -73,14 +61,8 @@ 'height' => 'medium', 'width' => 'small', ]) - ->arg('$dataProvider', new Reference(UnsubscribeRateDataProvider::class)); - if ($containerBuilder->hasDefinition(BackendViewFactory::class)) { - // TYPO3 12 - $configuration->arg('$backendViewFactory', new Reference(BackendViewFactory::class)); - } else { - // Todo: Can be removed when TYPO3 11 support will be dropped - $configuration->arg('$view', new Reference('dashboard.views.widget')); - } + ->arg('$dataProvider', new Reference(UnsubscribeRateDataProvider::class)) + ->arg('$backendViewFactory', new Reference(BackendViewFactory::class)); $configuration = $services->set('dashboard.widgets.ReceiverWidget') ->class(NumberWithIconWidget::class) @@ -97,13 +79,13 @@ 'icon' => 'luxletter-widget-receiver', ]) ->arg('$dataProvider', new Reference(ReceiverDataProvider::class)) - ->arg('$view', new Reference('dashboard.views.widget')); - if ($containerBuilder->hasDefinition(BackendViewFactory::class)) { - // TYPO3 12 - $configuration->arg('$backendViewFactory', new Reference(BackendViewFactory::class)); + ->arg('$backendViewFactory', new Reference(BackendViewFactory::class)); + // Todo: Can be removed when TYPO3 12 support is dropped + if ((new \TYPO3\CMS\Core\Information\Typo3Version())->getMajorVersion() === 12) { + $configuration->arg('$view', new Reference('dashboard.views.widget')); } - $configuration = $services->set('dashboard.widgets.NewsletterWidget') + $services->set('dashboard.widgets.NewsletterWidget') ->class(NumberWithIconWidget::class) ->tag('dashboard.widget', [ 'identifier' => 'luxletterNewsletter', @@ -118,13 +100,9 @@ 'icon' => 'luxletter-widget-receiver', ]) ->arg('$dataProvider', new Reference(NewsletterDataProvider::class)) - ->arg('$view', new Reference('dashboard.views.widget')); - if ($containerBuilder->hasDefinition(BackendViewFactory::class)) { - // TYPO3 12 - $configuration->arg('$backendViewFactory', new Reference(BackendViewFactory::class)); - } + ->arg('$backendViewFactory', new Reference(BackendViewFactory::class)); - $configuration = $services->set('dashboard.widgets.LastNewslettersOpenRateWidget') + $services->set('dashboard.widgets.LastNewslettersOpenRateWidget') ->class(BarChartWidget::class) ->tag('dashboard.widget', [ 'identifier' => 'luxletterLastNewslettersOpenRate', @@ -135,16 +113,10 @@ 'height' => 'medium', 'width' => 'medium', ]) - ->arg('$dataProvider', new Reference(LastNewslettersOpenRateDataProvider::class)); - if ($containerBuilder->hasDefinition(BackendViewFactory::class)) { - // TYPO3 12 - $configuration->arg('$backendViewFactory', new Reference(BackendViewFactory::class)); - } else { - // Todo: Can be removed when TYPO3 11 support will be dropped - $configuration->arg('$view', new Reference('dashboard.views.widget')); - } + ->arg('$dataProvider', new Reference(LastNewslettersOpenRateDataProvider::class)) + ->arg('$backendViewFactory', new Reference(BackendViewFactory::class)); - $configuration = $services->set('dashboard.widgets.LastNewslettersClickRateWidget') + $services->set('dashboard.widgets.LastNewslettersClickRateWidget') ->class(BarChartWidget::class) ->tag('dashboard.widget', [ 'identifier' => 'luxletterLastNewslettersClickRate', @@ -155,13 +127,7 @@ 'height' => 'medium', 'width' => 'medium', ]) - ->arg('$dataProvider', new Reference(LastNewslettersClickRateDataProvider::class)); - if ($containerBuilder->hasDefinition(BackendViewFactory::class)) { - // TYPO3 12 - $configuration->arg('$backendViewFactory', new Reference(BackendViewFactory::class)); - } else { - // Todo: Can be removed when TYPO3 11 support will be dropped - $configuration->arg('$view', new Reference('dashboard.views.widget')); - } + ->arg('$dataProvider', new Reference(LastNewslettersClickRateDataProvider::class)) + ->arg('$backendViewFactory', new Reference(BackendViewFactory::class)); } }; diff --git a/Configuration/SiteConfiguration/Overrides/sites.php b/Configuration/SiteConfiguration/Overrides/sites.php index f42612ed..314383c3 100644 --- a/Configuration/SiteConfiguration/Overrides/sites.php +++ b/Configuration/SiteConfiguration/Overrides/sites.php @@ -9,12 +9,6 @@ ], ]; -// Todo: Can be removed if TYPO3 11 support is dropped -if (\In2code\Luxletter\Utility\ConfigurationUtility::isTypo3Version12() === false) { - $configuration['config']['type'] = 'input'; - $configuration['config']['eval'] = 'required,int'; -} - $GLOBALS['SiteConfiguration']['site']['columns']['luxletterUnsubscribePid'] = $configuration; $GLOBALS['SiteConfiguration']['site']['types']['0']['showitem'] .= ', --div--;Luxletter, luxletterUnsubscribePid'; diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index 75115840..e0cdcf33 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -11,8 +11,22 @@ function () { /** * Register plugins */ - ExtensionUtility::registerPlugin('luxletter', 'Fe', $languageFilePrefix . 'flexform.fe'); - ExtensionUtility::registerPlugin('luxletter', 'Unsubscribe2', $languageFilePrefix . 'flexform.unsubscribe2'); + ExtensionUtility::registerPlugin( + 'luxletter', + 'Fe', + $languageFilePrefix . 'flexform.fe', + 'extension-lux', + 'plugins', + $languageFilePrefix . 'flexform.fe.description' + ); + ExtensionUtility::registerPlugin( + 'luxletter', + 'Unsubscribe2', + $languageFilePrefix . 'flexform.unsubscribe2', + 'extension-lux', + 'plugins', + $languageFilePrefix . 'flexform.unsubscribe2.description' + ); /** * Disable not needed fields in tt_content diff --git a/Configuration/TypoScript/FluidStyledMailContent/setup.typoscript b/Configuration/TypoScript/FluidStyledMailContent/setup.typoscript index 5e71c818..1cd9bbe6 100644 --- a/Configuration/TypoScript/FluidStyledMailContent/setup.typoscript +++ b/Configuration/TypoScript/FluidStyledMailContent/setup.typoscript @@ -1,6 +1,6 @@ # Fluid Styled Mail Content (needs fluid_styled_content loaded before) for rendering content elements for newsletters -[getTSFE() && getTSFE().type == 1562349004] +[request && traverse(request.getQueryParams(), 'type') == 1562349004] lib { contentElement { templateRootPaths { @@ -15,22 +15,6 @@ lib { 100 = EXT:luxletter/Resources/Private/FluidStyledMailContent/Layouts/ } } - - // Use absolute URL for all kind of links within fluidStyledMailContent - // (absRefPrefix is also used for absolute images paths - see ext_localconf.php) - // Todo: Remove this part when TYPO3 11 support is dropped (fluidStyledMailContent.config.forceAbsoluteUrls=1 is used in TYPO3 12) - parseFunc { - tags { - a.typolink.forceAbsoluteUrl = 1 - link.typolink.forceAbsoluteUrl = 1 - } - } - parseFunc_RTE { - tags { - a.typolink.forceAbsoluteUrl = 1 - link.typolink.forceAbsoluteUrl = 1 - } - } } // Settings for EXT:news diff --git a/Documentation/Changelog/Index.md b/Documentation/Changelog/Index.md index 9fc0870a..53bb808e 100644 --- a/Documentation/Changelog/Index.md +++ b/Documentation/Changelog/Index.md @@ -9,6 +9,7 @@ | Version | Date | State | Description | |------------|------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 27.0.0 | 2024-12-08 | Task | Support TYPO3 13 (and 12 and drop support for 11), some small bugfixes | | 26.3.1 | 2024-10-16 | Bugfix | Show correct number of links in dashboard, fix newsletter filter by usergroup | | 26.3.0 | 2024-10-11 | Feature | Increase number of frontend groups options when searching for a string when adding a new newsletter in backend module | | 26.2.0 | 2024-08-01 | Task | Use a better error message on requestExceptions for preview now, use site.identifier instead of websiteTitle (to prevent empty filter options), small documentation fix | diff --git a/Documentation/Images/documentation_installation_statictyposcript.png b/Documentation/Images/documentation_installation_statictyposcript.png index 76428445..82438c7c 100644 Binary files a/Documentation/Images/documentation_installation_statictyposcript.png and b/Documentation/Images/documentation_installation_statictyposcript.png differ diff --git a/Documentation/Installation/Index.md b/Documentation/Installation/Index.md index 5acb8574..d30eb136 100644 --- a/Documentation/Installation/Index.md +++ b/Documentation/Installation/Index.md @@ -14,7 +14,7 @@ composer require "in2code/luxletter" **Note:** TYPO3 in composer mode is needed -TYPO3 11.5 or 12.4 is required. The free extension lux can be also installed for more analysis but is not necessary. +TYPO3 12.4 or 13.4 is required. The free extension lux can be also installed for more analysis but is not necessary. ### Basic settings in extension configuration @@ -68,15 +68,13 @@ A sender configuration can be added via list module in every folder page in back ### TypoScript -Basicly there are two different TypoScripts that should be included in static templates in your root template +Basically there are two different TypoScripts from LUXletter. One should be included manually in static templates in +your root template: -* Static template `Basic TypoScript` must be included for basic settings -* In addition `FluidStyledMailContent` static template can also be added for rendering content in an email way (with html from the hell for outlook & co.) +* `FluidStyledMailContent` static template helps to render content in a way email needs (with html from the hell for outlook & co.) add static typoscript -**Important** Please do not include those templates in an extension template deep in your website but on the root template. Otherwise the backend module can't read the TypoScript. - #### Basic The basic Typoscript is splitted into some files (see Folders and files in EXT:luxletter/Configuration/TypoScript/Basic/*) diff --git a/Makefile b/Makefile index 8bb5657d..34972f52 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ destroy: stop echo "$(EMOJI_litter) Removing the project" docker-compose down -v --remove-orphans git clean -dfx - make link-compose-file + make .link-compose-file ## Starts docker-compose up -d start: @@ -67,19 +67,14 @@ composer-install: docker-compose exec php composer install ## Create necessary directories -create-dirs: +.create-dirs: echo "$(EMOJI_dividers) Creating required directories" mkdir -p $(TYPO3_CACHE_DIR) mkdir -p $(SQLDUMPSDIR) mkdir -p $(WEBROOT)/$(TYPO3_CACHE_DIR) -## Starts composer-install -composer-install-production: - echo "$(EMOJI_package) Installing composer dependencies (without dev)" - docker-compose exec php composer install --no-dev -ao - ## Install mkcert on this computer, skips installation if already present -install-mkcert: +.install-mkcert: if [[ "$$OSTYPE" == "linux-gnu" ]]; then \ if [[ "$$(command -v certutil > /dev/null; echo $$?)" -ne 0 ]]; then sudo apt install libnss3-tools; fi; \ if [[ "$$(command -v mkcert > /dev/null; echo $$?)" -ne 0 ]]; then sudo curl -L https://github.com/FiloSottile/mkcert/releases/download/v1.4.1/mkcert-v1.4.1-linux-amd64 -o /usr/local/bin/mkcert; sudo chmod +x /usr/local/bin/mkcert; fi; \ @@ -91,7 +86,7 @@ install-mkcert: mkcert -install > /dev/null ## Create SSL certificates for dinghy and starting project -create-certificate: install-mkcert +.create-certificate: .install-mkcert echo "$(EMOJI_secure) Creating SSL certificates for dinghy http proxy" mkdir -p $(HOME)/.dinghy/certs/ PROJECT=$$(echo "$${PWD##*/}" | tr -d '.'); \ @@ -100,7 +95,7 @@ create-certificate: install-mkcert if [[ ! -f $(HOME)/.dinghy/certs/${MAIL}.key ]]; then mkcert -cert-file $(HOME)/.dinghy/certs/${MAIL}.crt -key-file $(HOME)/.dinghy/certs/${MAIL}.key ${MAIL}; fi; ## Choose the right docker-compose file for your environment -link-compose-file: +.link-compose-file: echo "$(EMOJI_triangular_ruler) Linking the OS specific compose file" ifeq ($(shell uname -s), Darwin) ln -snf .project/docker/docker-compose.darwin.yml docker-compose.yml @@ -122,14 +117,14 @@ npm-stop: docker-compose stop node ## Initialize the docker setup -init-docker: create-dirs create-certificate +.init-docker: .create-dirs .create-certificate echo "$(EMOJI_rocket) Initializing docker environment" docker-compose pull docker-compose up -d --build docker-compose exec -u root php chown -R app:app /app/$(WEBROOT)/$(TYPO3_CACHE_DIR)/; ## Copies the TYPO3 site configuration -typo3-add-site: +.typo3-add-site: echo "$(EMOJI_triangular_flag) Copying the TYPO3 site configuration" mkdir -p config/sites/main/ cp -f .project/TYPO3/host1.yaml config/sites/main/config.yaml @@ -137,7 +132,7 @@ typo3-add-site: cp -f .project/TYPO3/host2.yaml config/sites/second/config.yaml ## Copies the Additional/DockerConfiguration.php to the correct directory -typo3-add-dockerconfig: +.typo3-add-dockerconfig: echo "$(EMOJI_plug) Copying the docker specific configuration for TYPO3" mkdir -p ./config/system cp -f .project/TYPO3/additional.php ./config/system/additional.php @@ -148,7 +143,7 @@ typo3-comparedb: docker-compose exec php ./.Build/bin/typo3 database:updateschema ## Starts the TYPO3 setup process -typo3-setupinstall: +.typo3-setupinstall: echo "$(EMOJI_upright) Running install:setup" docker-compose exec php ./.Build/bin/typo3 install:setup @@ -164,13 +159,13 @@ lfs-fetch: git lfs checkout ## Provision fileadmin with necessary files -provision-fileadmin: +.provision-fileadmin: echo "$(EMOJI_package) Provision fileadmin with necessary files from git lfs" cd .Build/public; \ tar xvfz ../../.project/data/fileadmin.tar.gz ## To start an existing project incl. rsync from fileadmin, uploads and database dump -install-project: lfs-fetch link-compose-file destroy add-hosts-entry init-docker .fix-mount-perms composer-install typo3-add-site typo3-add-dockerconfig typo3-setupinstall provision-fileadmin mysql-restore typo3-clearcache typo3-comparedb +install-project: lfs-fetch .link-compose-file destroy .add-hosts-entry .init-docker .fix-mount-perms composer-install .typo3-add-site .typo3-add-dockerconfig .provision-fileadmin mysql-restore typo3-comparedb typo3-clearcache .typo3-setupinstall echo "---------------------" echo "" echo "The project is online $(EMOJI_thumbsup)" @@ -191,12 +186,9 @@ urls: printf " %-$${LONGEST}s %s\n" "Frontend2:" "https://$(HOST2)/"; \ printf " %-$${LONGEST}s %s\n" "Backend:" "https://$(HOST)/typo3/"; \ printf " %-$${LONGEST}s %s\n" "Mail:" "https://$(MAIL)/"; \ - for service in $$SERVICES; do \ - printf " %-$${LONGEST}s %s\n" "$$service:" "https://$$service.$$PROJECT.docker/"; \ - done; ## Create the hosts entry for the custom project URL (non-dinghy convention) -add-hosts-entry: +.add-hosts-entry: echo "$(EMOJI_monkey) Creating Hosts Entry (if not set yet)" SERVICES=$$(command -v getent > /dev/null && echo "getent ahostsv4" || echo "dscacheutil -q host -a name"); \ if [ ! "$$($$SERVICES $(HOST) | grep 127.0.0.1 > /dev/null; echo $$?)" -eq 0 ]; then sudo bash -c 'echo "127.0.0.1 $(HOST)" >> /etc/hosts; echo "Entry was added"'; else echo 'Entry already exists'; fi;\ diff --git a/Resources/Private/Build/JavaScript/Choices.js b/Resources/Private/Build/JavaScript/Choices.js index 5813d469..79c9dbe7 100644 --- a/Resources/Private/Build/JavaScript/Choices.js +++ b/Resources/Private/Build/JavaScript/Choices.js @@ -1,31 +1,30 @@ -define(['TYPO3/CMS/Luxletter/Vendor/Choices.min'], function() { - 'use strict'; +import "@in2code/luxletter/vendor/choices.js"; - /** - * @constructor - */ - function LuxletterChoices() { - 'use strict'; +function LuxletterChoices() { + this.initialize = function() { + const luxletterReceiversIdentifier = '#luxletter-receivers-dropdown'; + const luxletterReceiversElement = document.querySelector(luxletterReceiversIdentifier); + if (luxletterReceiversElement === null) return; + window.luxLetterReceiverChoice = new Choices(luxletterReceiversIdentifier, { + allowHTML: true, + searchResultLimit: 100 + }); + }; +} - /** - * Initialize - * - * @returns {void} - */ - this.initialize = function() { - const luxletterReceiversIdentifier = '#luxletter-receivers-dropdown'; - const luxletterReceiversElement = document.querySelector(luxletterReceiversIdentifier); - if (luxletterReceiversElement === null) return; - window.luxLetterReceiverChoice = new Choices(luxletterReceiversIdentifier, { - allowHTML: true, - searchResultLimit: 100 - }); - }; - } +var LuxletterChoicesObject = new LuxletterChoices(); +LuxletterChoicesObject.initialize(); - /** - * Init - */ - var LuxletterChoicesObject = new LuxletterChoices(); - LuxletterChoicesObject.initialize(); -}); +window.setTimeout(() => { + const choisesEls = document.querySelectorAll('.choices__inner'); + const choisesListEls = document.querySelectorAll('.choices__list--dropdown'); + + choisesEls.forEach((choisesEl) => { + choisesEl.classList.add('form-control'); + choisesEl.classList.add('form-select'); + }); + + choisesListEls.forEach((choisesEl) => { + choisesEl.classList.add('form-control'); + }); +}, 1000); diff --git a/Resources/Private/Build/JavaScript/Diagram.js b/Resources/Private/Build/JavaScript/Diagram.js index c6c9e0b1..de2399db 100644 --- a/Resources/Private/Build/JavaScript/Diagram.js +++ b/Resources/Private/Build/JavaScript/Diagram.js @@ -1,112 +1,128 @@ -define(['jquery', 'TYPO3/CMS/Luxletter/Vendor/Chart.min'], function($) { - 'use strict'; +import { Chart, registerables } from "@in2code/luxletter/vendor/chartjs.js"; - /** - * @constructor - */ - function LuxletterDiagram($) { - 'use strict'; +const setDefaultChartColor = () => { + const colorScheme = document.documentElement.getAttribute('data-color-scheme') || 'auto'; + const prefersDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches; - /** - * Initialize - * - * @returns {void} - */ - this.initialize = function() { - diagramListener(); - }; + if (colorScheme === 'light') { + Chart.defaults.color = '#1A1A1A'; + } else if (colorScheme === 'dark' || (colorScheme === 'auto' && prefersDarkMode)) { + Chart.defaults.color = '#D9D9D9'; + } else { + Chart.defaults.color = '#1A1A1A'; + } +}; - /** - * @returns {void} - */ - var diagramListener = function() { - var diagrams = document.querySelectorAll('[data-chart]'); - for (var i = 0; i < diagrams.length; i++) { - var type = diagrams[i].getAttribute('data-chart'); - if (type === 'doughnut') { - diagramDoughnut(diagrams[i]); - } else if (type === 'bar') { - diagramBar(diagrams[i]); - } - } - }; +const IS_TYPO3_12 = document.querySelector('.luxletter--typo3-12') !== null; - /** - * @returns {void} - */ - var diagramDoughnut = function(element) { - new Chart(element.getContext('2d'), { - type: 'doughnut', - data: { - datasets: [{ - data: element.getAttribute('data-chart-data').split(','), - backgroundColor: [ - 'rgba(221, 221, 221, 1)', - 'rgba(2, 122, 202, 1)' - ] - }], - labels: element.getAttribute('data-chart-labels').split(',') - }, - options: { - legend: { - display: false, - position: 'right', - labels: { - fontSize: 14 - } - } - } - }); - }; +if (!IS_TYPO3_12) { + setDefaultChartColor(); +} - /** - * @returns {void} - */ - var diagramBar = function(element) { - new Chart(element.getContext('2d'), { - type: 'bar', - data: { - datasets: [{ - label: element.getAttribute('data-chart-label'), - data: element.getAttribute('data-chart-data').split(','), - backgroundColor: [ - 'rgba(2, 122, 202, 1)', - 'rgba(221, 221, 221, 1)' - ] - }], - labels: element.getAttribute('data-chart-labels').split(',') - }, - options: { - legend: { - display: false, - position: 'right', - labels: { - fontSize: 18 - } - }, - scales: { - xAxes: [{ - ticks: { - autoSkip: false - } - }], - yAxes: [{ - ticks: { - beginAtZero: true - } - }] - } - } - }); - }; - } +Chart.register(...registerables); +const LuxletterDiagram = function() { + 'use strict'; - /** - * Init - */ - $(document).ready(function () { - var LuxletterDiagramObject = new LuxletterDiagram($); - LuxletterDiagramObject.initialize(); - }) -}); + /** + * @returns {void} + */ + this.initialize = function() { + diagramListener(); + }; + + /** + * @returns {void} + */ + var diagramListener = function() { + var diagrams = document.querySelectorAll('[data-chart]'); + diagrams.forEach(function(diagram) { + const existingChart = Chart.getChart(diagram); + if (existingChart !== undefined) { + existingChart.destroy(); + } + + const type = diagram.getAttribute('data-chart'); + if (type === 'doughnut') { + diagramDoughnut(diagram); + } else if (type === 'bar') { + diagramBar(diagram); + } + }); + }; + + /** + * @returns {void} + */ + var diagramDoughnut = function(element) { + new Chart(element.getContext('2d'), { + type: 'doughnut', + data: { + datasets: [{ + data: element.getAttribute('data-chart-data').split(','), + backgroundColor: [ + 'rgba(221, 221, 221, 1)', + 'rgba(2, 122, 202, 1)' + ] + }], + labels: element.getAttribute('data-chart-labels').split(',') + }, + options: { + maintainAspectRatio: false, + plugins: { + legend: { + display: false, + position: 'right', + labels: { + fontSize: 14 + } + } + } + } + }); + }; + + /** + * @returns {void} + */ + var diagramBar = function(element) { + new Chart(element.getContext('2d'), { + type: 'bar', + data: { + datasets: [{ + label: element.getAttribute('data-chart-label'), + data: element.getAttribute('data-chart-data').split(','), + backgroundColor: [ + 'rgba(2, 122, 202, 1)', + 'rgba(221, 221, 221, 1)' + ] + }], + labels: element.getAttribute('data-chart-labels').split(',') + }, + options: { + legend: { + display: false, + position: 'right', + labels: { + fontSize: 18 + } + }, + scales: { + x: { + ticks: { + autoSkip: false + } + }, + y: { + ticks: { + beginAtZero: true + } + } + } + } + }); + }; +} + +const LuxletterDiagramObject = new LuxletterDiagram(); +LuxletterDiagramObject.initialize(); diff --git a/Resources/Private/Build/JavaScript/Module.js b/Resources/Private/Build/JavaScript/Module.js index 4b95be97..fe4ba7d6 100644 --- a/Resources/Private/Build/JavaScript/Module.js +++ b/Resources/Private/Build/JavaScript/Module.js @@ -1,409 +1,406 @@ -define(['jquery'], function($) { - 'use strict'; +const LuxletterBackend = function() { + /** + * @type {LuxletterBackend} + */ + var that = this; + + /** + * @type {boolean} + */ + var newsletterPreview = false; + + /** + * @type {boolean} + */ + var userPreview = false; /** - * LuxBackend functions + * Initialize * - * @class LuxletterBackend + * @returns {void} */ - function LuxletterBackend($) { - 'use strict'; - - /** - * @type {LuxletterBackend} - */ - var that = this; - - /** - * @type {boolean} - */ - var newsletterPreview = false; - - /** - * @type {boolean} - */ - var userPreview = false; - - /** - * Initialize - * - * @returns {void} - */ - this.initialize = function() { - addWizardForm(); - addWizardUserPreview(); - addWizardNewsletterPreview(); - testMailListener(); - userDetailMockListener(); - userDetailListener(); - addConfirmListeners(); - }; - - /** - * @returns {void} - */ - var addWizardForm = function() { - var fieldsets = document.querySelectorAll('.wizardform > fieldset'); - var buttons = document.querySelectorAll('[data-wizardform-gotostep]'); - var wizardLinks = document.querySelectorAll('.wizard > a'); - - for (var i = 1; i < fieldsets.length; i++) { - hideElement(fieldsets[i]); - } - for (var j = 0; j < buttons.length; j++) { - buttons[j].addEventListener('click', function(event) { - event.preventDefault(); - var step = this.getAttribute('data-wizardform-gotostep'); + this.initialize = function() { + addWizardForm(); + addWizardUserPreview(); + addWizardNewsletterPreview(); + testMailListener(); + userDetailMockListener(); + userDetailListener(); + addConfirmListeners(); + addSelectSubmitListener(); + }; - removeClassFromElements(wizardLinks, 'current'); - wizardLinks[step-1].classList.add('current'); + /** + * @returns {void} + */ + var addWizardForm = function() { + var fieldsets = document.querySelectorAll('.wizardform > fieldset'); + var buttons = document.querySelectorAll('[data-wizardform-gotostep]'); + var wizardLinks = document.querySelectorAll('.wizard > a'); - for (var k = 0; k < fieldsets.length; k++) { - hideElement(fieldsets[k]); - } - showElement(fieldsets[step-1]); + for (var i = 1; i < fieldsets.length; i++) { + hideElement(fieldsets[i]); + } + for (var j = 0; j < buttons.length; j++) { + buttons[j].addEventListener('click', function(event) { + event.preventDefault(); + var step = this.getAttribute('data-wizardform-gotostep'); - showIfNewsletterIsReady(); - }); - } - }; - - /** - * @param {string} elements - * @param {string} className - * @returns {void} - */ - var removeClassFromElements = function(elements, className) { - for (var i = 0; i < elements.length; i++) { - elements[i].classList.remove(className); - } - }; - - /** - * @returns {void} - */ - var addWizardUserPreview = function() { - wizardUserPreviewAction(); - - var receiverDropdown = document.querySelector('select[data-luxletter-wizardpreviewevent="users"]'); - if (receiverDropdown !== null) { - receiverDropdown.addEventListener('change', function (event) { - wizardUserPreviewAction(); - }); - } - }; - - /** - * @returns {void} - */ - var wizardUserPreviewAction = function() { - var values = []; - if (window.luxLetterReceiverChoice !== undefined) { - values = window.luxLetterReceiverChoice.getValue(true); - } + removeClassFromElements(wizardLinks, 'current'); + wizardLinks[step-1].classList.add('current'); - var hiddenFields = document.querySelectorAll('input[data-luxletter-wizardpreviewevent="users"][type="hidden"]'); - if (hiddenFields.length > 0) { - for (var i = 0; i < hiddenFields.length; i++) { - values.push(hiddenFields[i].getAttribute('value')); + for (var k = 0; k < fieldsets.length; k++) { + hideElement(fieldsets[k]); } - } + showElement(fieldsets[step-1]); - // Even send if values is empty, when checkboxes are dechecked again - ajaxConnection(TYPO3.settings.ajaxUrls['/luxletter/wizardUserPreview'], { - usergroups: values.join(','), - }, 'addWizardUserPreviewCallback'); + showIfNewsletterIsReady(); + }); } + }; - /** - * @returns {void} - */ - var addWizardNewsletterPreview = function() { - initializeNewsletterPreviewIframe(); - - var input = document.querySelector('[data-luxletter-wizardpreviewevent="newsletter"]'); - if (input !== null) { - input.addEventListener('change', function() { - initializeNewsletterPreviewIframe(); - }); - } + /** + * @param {string} elements + * @param {string} className + * @returns {void} + */ + var removeClassFromElements = function(elements, className) { + for (var i = 0; i < elements.length; i++) { + elements[i].classList.remove(className); + } + }; + + /** + * @returns {void} + */ + var addWizardUserPreview = function() { + wizardUserPreviewAction(); + + var receiverDropdown = document.querySelector('select[data-luxletter-wizardpreviewevent="users"]'); + if (receiverDropdown !== null) { + receiverDropdown.addEventListener('change', function (event) { + wizardUserPreviewAction(); + }); + } + }; + + /** + * @returns {void} + */ + var wizardUserPreviewAction = function() { + var values = []; + if (window.luxLetterReceiverChoice !== undefined) { + values = window.luxLetterReceiverChoice.getValue(true); + } - var layoutField = document.querySelector('[data-luxletter-wizardpreviewevent="layout"]'); - if (layoutField !== null) { - layoutField.addEventListener('change', function() { - initializeNewsletterPreviewIframe(); - }); + var hiddenFields = document.querySelectorAll('input[data-luxletter-wizardpreviewevent="users"][type="hidden"]'); + if (hiddenFields.length > 0) { + for (var i = 0; i < hiddenFields.length; i++) { + values.push(hiddenFields[i].getAttribute('value')); } - }; - - /** - * @returns {void} - */ - var initializeNewsletterPreviewIframe = function() { - var container = document.querySelector('[data-luxletter-wizardpreview="newsletter"]'); - var input = document.querySelector('[data-luxletter-wizardpreviewevent="newsletter"]'); - var layoutField = document.querySelector('[data-luxletter-wizardpreviewevent="layout"]'); - if (container !== null && input.value !== '') { - ajaxConnection(TYPO3.settings.ajaxUrls['/luxletter/previewSources'], { - origin: input.value, - layout: layoutField.value, - }, 'newsletterPreviewCallback'); + } + + // Even send if values is empty, when checkboxes are dechecked again + ajaxConnection(TYPO3.settings.ajaxUrls['/luxletter/wizardUserPreview'], { + usergroups: values.join(','), + }, 'addWizardUserPreviewCallback'); + } + + /** + * @returns {void} + */ + var addWizardNewsletterPreview = function() { + initializeNewsletterPreviewIframe(); + + var input = document.querySelector('[data-luxletter-wizardpreviewevent="newsletter"]'); + if (input !== null) { + input.addEventListener('change', function() { + initializeNewsletterPreviewIframe(); + }); + } + + var layoutField = document.querySelector('[data-luxletter-wizardpreviewevent="layout"]'); + if (layoutField !== null) { + layoutField.addEventListener('change', function() { + initializeNewsletterPreviewIframe(); + }); + } + }; + + /** + * @returns {void} + */ + var initializeNewsletterPreviewIframe = function() { + var container = document.querySelector('[data-luxletter-wizardpreview="newsletter"]'); + var input = document.querySelector('[data-luxletter-wizardpreviewevent="newsletter"]'); + var layoutField = document.querySelector('[data-luxletter-wizardpreviewevent="layout"]'); + if (container !== null && input.value !== '') { + ajaxConnection(TYPO3.settings.ajaxUrls['/luxletter/previewSources'], { + origin: input.value, + layout: layoutField.value, + }, 'newsletterPreviewCallback'); + } + }; + + /** + * @param response + * @returns {void} + */ + this.newsletterPreviewCallback = function(response) { + var container = document.querySelector('[data-luxletter-wizardpreview="newsletter"]'); + container.innerHTML = ''; + for (var i = 0; i < response.length; i++) { + var div = document.createElement('div'); + div.setAttribute('class', 'luxletter-iframepreview-children'); + var iframe = document.createElement('iframe'); + iframe.setAttribute('src', response[i]['url']); + if (response[i]['subject']) { + var title = document.createElement('h2'); + title.innerHTML = response[i]['subject']; + div.appendChild(title); } - }; - - /** - * @param response - * @returns {void} - */ - this.newsletterPreviewCallback = function(response) { - var container = document.querySelector('[data-luxletter-wizardpreview="newsletter"]'); - container.innerHTML = ''; - for (var i = 0; i < response.length; i++) { - var div = document.createElement('div'); - div.setAttribute('class', 'luxletter-iframepreview-children'); - var iframe = document.createElement('iframe'); - iframe.setAttribute('src', response[i]['url']); - if (response[i]['subject']) { - var title = document.createElement('h2'); - title.innerHTML = response[i]['subject']; - div.appendChild(title); + div.appendChild(iframe); + container.appendChild(div); + newsletterPreview = true; + } + }; + + /** + * @returns {void} + */ + var testMailListener = function() { + var input = document.querySelector('[data-luxletter-testmail="submit"]'); + if (input !== null) { + input.addEventListener('click', function(event) { + event.preventDefault(); + var origin = document.querySelector('[data-luxletter-wizardpreviewevent="newsletter"]').value; + var email = document.querySelector('[data-luxletter-testmail="email"]').value; + var subjectField = document.querySelector('[data-luxletter-testmail="subject"]'); + var configuration = document.querySelector('[data-luxletter-testmail="configuration"]').value; + var layout = document.querySelector('[data-luxletter-wizardpreviewevent="layout"]').value; + if (origin && email && layout) { + ajaxConnection(TYPO3.settings.ajaxUrls['/luxletter/testMail'], { + origin: origin, + email: email, + subject: subjectField !== null ? subjectField.value : '', + configuration: configuration, + layout: layout + }, 'testMailListenerCallback'); } - div.appendChild(iframe); - container.appendChild(div); - newsletterPreview = true; - } - }; - - /** - * @returns {void} - */ - var testMailListener = function() { - var input = document.querySelector('[data-luxletter-testmail="submit"]'); - if (input !== null) { - input.addEventListener('click', function(event) { - event.preventDefault(); - var origin = document.querySelector('[data-luxletter-wizardpreviewevent="newsletter"]').value; - var email = document.querySelector('[data-luxletter-testmail="email"]').value; - var subjectField = document.querySelector('[data-luxletter-testmail="subject"]'); - var configuration = document.querySelector('[data-luxletter-testmail="configuration"]').value; - var layout = document.querySelector('[data-luxletter-wizardpreviewevent="layout"]').value; - if (origin && email && layout) { - ajaxConnection(TYPO3.settings.ajaxUrls['/luxletter/testMail'], { - origin: origin, - email: email, - subject: subjectField !== null ? subjectField.value : '', - configuration: configuration, - layout: layout - }, 'testMailListenerCallback'); - } - }); - } - }; - - /** - * Clicking on a table line simulates a click on the (hidden) detail button - * - * @returns {void} - */ - var userDetailMockListener = function() { - var elements = document.querySelectorAll('[data-luxletter-linkmockaction]'); - for (var i = 0; i < elements.length; i++) { - elements[i].addEventListener('click', function() { - var identifier = this.getAttribute('data-luxletter-linkmockaction'); - document.querySelector('[data-luxletter-linkmock-link="' + identifier + '"]').click(); - }); - } - }; - - /** - * @returns {void} - */ - var userDetailListener = function() { - var elements = document.querySelectorAll('[data-luxletter-action-ajax]'); - for (var i = 0; i < elements.length; i++) { - elements[i].addEventListener('click', function(event) { + }); + } + }; + + /** + * Clicking on a table line simulates a click on the (hidden) detail button + * + * @returns {void} + */ + var userDetailMockListener = function() { + var elements = document.querySelectorAll('[data-luxletter-linkmockaction]'); + for (var i = 0; i < elements.length; i++) { + elements[i].addEventListener('click', function() { + var identifier = this.getAttribute('data-luxletter-linkmockaction'); + document.querySelector('[data-luxletter-linkmock-link="' + identifier + '"]').click(); + }); + } + }; + + /** + * @returns {void} + */ + var userDetailListener = function() { + var elements = document.querySelectorAll('[data-luxletter-action-ajax]'); + for (var i = 0; i < elements.length; i++) { + elements[i].addEventListener('click', function(event) { + event.preventDefault(); + var userIdentifier = this.getAttribute('data-luxletter-action-ajax'); + ajaxConnection(TYPO3.settings.ajaxUrls['/luxletter/receiverdetail'], { + user: userIdentifier, + }, 'userDetailListenerCallback'); + }); + } + }; + + /** + * @returns {void} + */ + var addConfirmListeners = function() { + var elements = document.querySelectorAll('[data-luxletter-confirm]'); + for (var i = 0; i < elements.length; i++) { + elements[i].addEventListener('click', function(event) { + var message = event.currentTarget.getAttribute('data-luxletter-confirm'); + if (confirm(message) === false) { event.preventDefault(); - var userIdentifier = this.getAttribute('data-luxletter-action-ajax'); - ajaxConnection(TYPO3.settings.ajaxUrls['/luxletter/receiverdetail'], { - user: userIdentifier, - }, 'userDetailListenerCallback'); - }); - } - }; - - /** - * @returns {void} - */ - var addConfirmListeners = function() { - var elements = document.querySelectorAll('[data-luxletter-confirm]'); - for (var i = 0; i < elements.length; i++) { - elements[i].addEventListener('click', function(event) { - var message = event.currentTarget.getAttribute('data-luxletter-confirm'); - if (confirm(message) === false) { - event.preventDefault(); - } - }); - } - }; - - /** - * @param response - * @returns {void} - */ - this.addWizardUserPreviewCallback = function(response) { - var container = document.querySelector('[data-luxletter-wizardpreview="users"]'); - if (container !== null) { - container.innerHTML = response.html; - userPreview = true; - showIfNewsletterIsReady(); - } - }; - - /** - * @param response - * @returns {void} - */ - this.testMailListenerCallback = function(response) { - const messageElement = document.querySelector('[data-luxletter-testmail="message"]'); - if (messageElement !== null && response.statusSeverity === undefined && response.status === true) { - showElement(messageElement); - - const counterElement = messageElement.querySelector('p>span'); - let counter = parseInt(counterElement.innerHTML); - counter++; - counterElement.innerHTML = counter.toString(); - } else if (messageElement !== null && response.statusSeverity !== '' && response.status === true) { - messageElement.classList.remove(...messageElement.classList); - messageElement.classList.add('alert'); - messageElement.classList.add(response.statusSeverity); - messageElement.querySelector('.alert-heading').innerHTML = response.statusTitle; - messageElement.querySelector('p').innerHTML = response.statusMessage; - showElement(messageElement); - } - }; - - /** - * @param response - * @returns {void} - */ - this.userDetailListenerCallback = function(response) { - var container = document.getElementById('luxletter-newsletter-receiver-container'); - if (container !== null) { - container.innerHTML = response.html; - } - }; - - /** - * @params {string} uri - * @params {object} parameters - * @params {string} target callback function name - * @returns {void} - */ - var ajaxConnection = function(uri, parameters, target) { - if (uri !== undefined && uri !== '') { - var xhttp = new XMLHttpRequest(); - xhttp.onreadystatechange = function() { - if (this.readyState === 4 && this.status === 200) { - if (target !== null) { - that[target](JSON.parse(this.responseText)); - } - } - }; - xhttp.open('POST', mergeUriWithParameters(uri, parameters), true); - xhttp.send(); - } else { - console.log('No ajax URI given!'); - } - }; - - /** - * @returns {void} - */ - var showIfNewsletterIsReady = function() { - if (isNewsletterReady() && areAllMandatoryFieldsFilled()) { - var statusElements = document.querySelectorAll('[data-luxletter-wizardstatus]'); - for (var i = 0; i < statusElements.length; i++) { - if (statusElements[i].getAttribute('data-luxletter-wizardstatus') === 'ready') { - showElement(statusElements[i]); - } else if (statusElements[i].getAttribute('data-luxletter-wizardstatus') === 'pending') { - hideElement(statusElements[i]); + } + }); + } + }; + + const addSelectSubmitListener = function() { + const elements = document.querySelectorAll('[data-luxletter-changesubmit]'); + elements.forEach(function(element) { + element.addEventListener('change', (event) => { + event.target.form.submit(); + }); + }); + } + + /** + * @param response + * @returns {void} + */ + this.addWizardUserPreviewCallback = function(response) { + var container = document.querySelector('[data-luxletter-wizardpreview="users"]'); + if (container !== null) { + container.innerHTML = response.html; + userPreview = true; + showIfNewsletterIsReady(); + } + }; + + /** + * @param response + * @returns {void} + */ + this.testMailListenerCallback = function(response) { + const messageElement = document.querySelector('[data-luxletter-testmail="message"]'); + if (messageElement !== null && response.statusSeverity === undefined && response.status === true) { + showElement(messageElement); + + const counterElement = messageElement.querySelector('p>span'); + let counter = parseInt(counterElement.innerHTML); + counter++; + counterElement.innerHTML = counter.toString(); + } else if (messageElement !== null && response.statusSeverity !== '' && response.status === true) { + messageElement.classList.remove(...messageElement.classList); + messageElement.classList.add('alert'); + messageElement.classList.add(response.statusSeverity); + messageElement.querySelector('.alert-heading').innerHTML = response.statusTitle; + messageElement.querySelector('p').innerHTML = response.statusMessage; + showElement(messageElement); + } + }; + + /** + * @param response + * @returns {void} + */ + this.userDetailListenerCallback = function(response) { + var container = document.getElementById('luxletter-newsletter-receiver-container'); + if (container !== null) { + container.innerHTML = response.html; + } + }; + + /** + * @params {string} uri + * @params {object} parameters + * @params {string} target callback function name + * @returns {void} + */ + var ajaxConnection = function(uri, parameters, target) { + if (uri !== undefined && uri !== '') { + var xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function() { + if (this.readyState === 4 && this.status === 200) { + if (target !== null) { + that[target](JSON.parse(this.responseText)); } } - } - }; - - /** - * @returns {boolean} - */ - var isNewsletterReady = function() { - return newsletterPreview && userPreview; - }; - - /** - * @returns {boolean} - */ - var areAllMandatoryFieldsFilled = function() { - var fields = document.querySelectorAll('[data-luxletter-mandatory]'); - for (var i = 0; i < fields.length; i++) { - if (fields[i].value === 0 || fields[i].value === '') { - return false; + }; + xhttp.open('POST', mergeUriWithParameters(uri, parameters), true); + xhttp.send(); + } else { + console.log('No ajax URI given!'); + } + }; + + /** + * @returns {void} + */ + var showIfNewsletterIsReady = function() { + if (isNewsletterReady() && areAllMandatoryFieldsFilled()) { + var statusElements = document.querySelectorAll('[data-luxletter-wizardstatus]'); + for (var i = 0; i < statusElements.length; i++) { + if (statusElements[i].getAttribute('data-luxletter-wizardstatus') === 'ready') { + showElement(statusElements[i]); + } else if (statusElements[i].getAttribute('data-luxletter-wizardstatus') === 'pending') { + hideElement(statusElements[i]); } } - return true; - }; - - /** - * Build an uri string for an ajax call together with params from an object - * { - * 'x': 123, - * 'y': 'abc' - * } - * - * => - * - * "?x=123&y=abc" - * - * @params {string} uri - * @params {object} parameters - * @returns {string} e.g. "index.php?id=123&type=123&x=123&y=abc" - */ - var mergeUriWithParameters = function(uri, parameters) { - for (var key in parameters) { - if (parameters.hasOwnProperty(key)) { - if (uri.indexOf('?') !== -1) { - uri += '&'; - } else { - uri += '?'; - } - uri += key + '=' + encodeURIComponent(parameters[key]); + } + }; + + /** + * @returns {boolean} + */ + var isNewsletterReady = function() { + return newsletterPreview && userPreview; + }; + + /** + * @returns {boolean} + */ + var areAllMandatoryFieldsFilled = function() { + var fields = document.querySelectorAll('[data-luxletter-mandatory]'); + for (var i = 0; i < fields.length; i++) { + if (fields[i].value === 0 || fields[i].value === '') { + return false; + } + } + return true; + }; + + /** + * Build an uri string for an ajax call together with params from an object + * { + * 'x': 123, + * 'y': 'abc' + * } + * + * => + * + * "?x=123&y=abc" + * + * @params {string} uri + * @params {object} parameters + * @returns {string} e.g. "index.php?id=123&type=123&x=123&y=abc" + */ + var mergeUriWithParameters = function(uri, parameters) { + for (var key in parameters) { + if (parameters.hasOwnProperty(key)) { + if (uri.indexOf('?') !== -1) { + uri += '&'; + } else { + uri += '?'; } + uri += key + '=' + encodeURIComponent(parameters[key]); } - return uri; - }; - - /** - * @param element - * @returns {void} - */ - var hideElement = function(element) { - element.style.display = 'none'; - }; - - /** - * @param element - * @returns {void} - */ - var showElement = function(element) { - element.style.display = 'block'; - }; - } + } + return uri; + }; + /** + * @param element + * @returns {void} + */ + var hideElement = function(element) { + element.style.display = 'none'; + }; /** - * Init + * @param element + * @returns {void} */ - $(document).ready(function () { - var LuxletterBackendObject = new LuxletterBackend($); - LuxletterBackendObject.initialize(); - }) -}); + var showElement = function(element) { + element.style.display = 'block'; + }; +} + + +/** + * Init + */ +const LuxletterBackendObject = new LuxletterBackend(); +LuxletterBackendObject.initialize(); diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf index 1e0868f1..f6ce527e 100644 --- a/Resources/Private/Language/de.locallang.xlf +++ b/Resources/Private/Language/de.locallang.xlf @@ -362,6 +362,10 @@ Please select a newsletter page that should be parsed and then sent Bitte wähle eine Newsletterseite aus, die geparst und anschließend versendet werden soll + + Please first create a page of the type "Newsletter" in the page tree. + Bitte zuerst eine Seite vom Typ "Newsletter" im Seitenbaum anlegen. + Send a test mail to yourself Newsletter testweise versenden @@ -532,6 +536,10 @@ Are you sure to delete this record? Wollen Sie diesen Datensatz wirklich löschen? + + Deleted newsletter + Gelöschter Newsletter + Default Standard diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf index 925aff0d..3ba42c5a 100644 --- a/Resources/Private/Language/de.locallang_db.xlf +++ b/Resources/Private/Language/de.locallang_db.xlf @@ -220,6 +220,10 @@ LUXletter: Quick unsubscribe LUXletter: Schnelle Newsletterabmeldung + + A simple plugin that removes the LUXletter category from Frontend User when it's used via Newsletter unsubscribe link + Ein einfaches Plugin, das die LUXletter Kategorie vom Frontend Benutzer entfernt, wenn der Unsubscribe-Link im Newsletter gewählt wurde + Select usergroup which should be removed on unsubscribe Benutzergruppe auswählen, die bei einem Austragen aus dem Newsletter entfernt werden soll @@ -233,6 +237,10 @@ LUXletter: Unsubscribe with category selection LUXletter: Newsletterabmeldung mit Kategorieauswahl + + Show some categories for the unsubscribers that can be selected or removed when clicking the unsubscribe link in the Newsletter + Biete Kategorien zum Auswählen oder Entfernen an, wenn der Unsubscribe-Link im Newsletter gewählt wurde + Usergroups that can be added or removed by the user Benutzergruppen die vom Benutzer hinzugefügt oder entfernt werden können diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index 13f0c44a..bfcc4f29 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -252,6 +252,9 @@ Note: Recipient lists that have already been created cannot be changed later. + + Please first create a page of the type "Newsletter" in the page tree. + Sender @@ -403,6 +406,9 @@ Are you sure to delete this record? + + Deleted newsletter + Default diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index bbb32ff3..6bade43f 100644 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -168,6 +168,9 @@ LUXletter: Quick unsubscribe + + A simple plugin that removes the LUXletter category from Frontend User when it's used via Newsletter unsubscribe link + Select usergroup which should be removed on unsubscribe @@ -178,6 +181,9 @@ LUXletter: Unsubscribe with category selection + + Show some categories for the unsubscribers that can be selected or removed when clicking the unsubscribe link in the Newsletter + Usergroups that can be added or removed by the user diff --git a/Resources/Private/Layouts/Backend.html b/Resources/Private/Layouts/Backend.html deleted file mode 100644 index 73be4c4d..00000000 --- a/Resources/Private/Layouts/Backend.html +++ /dev/null @@ -1,19 +0,0 @@ - - - -
- - - - - - - - -
diff --git a/Resources/Private/Layouts/BackendLuxLetter.html b/Resources/Private/Layouts/BackendLuxLetter.html new file mode 100644 index 00000000..d109ddfc --- /dev/null +++ b/Resources/Private/Layouts/BackendLuxLetter.html @@ -0,0 +1,22 @@ + + +
+ + +
+ + + + + + + + +
+
diff --git a/Resources/Private/Partials/Filter/NewsletterDashboard.html b/Resources/Private/Partials/Filter/NewsletterDashboard.html index be680d4d..cb57b136 100644 --- a/Resources/Private/Partials/Filter/NewsletterDashboard.html +++ b/Resources/Private/Partials/Filter/NewsletterDashboard.html @@ -15,7 +15,7 @@ optionValueField="identifier" optionLabelField="identifier" value="{filter.site}" - additionalAttributes="{onchange:'this.form.submit();'}" /> + additionalAttributes="{data-luxletter-changesubmit:1}" /> @@ -28,7 +28,7 @@ options="{filter.timeOptions}" class="form-control form-select" id="time" - additionalAttributes="{onchange:'this.form.submit();'}" /> + additionalAttributes="{data-luxletter-changesubmit:1}" /> diff --git a/Resources/Private/Partials/Miscellaneous/FlashMessages.html b/Resources/Private/Partials/Miscellaneous/FlashMessagesLuxLetter.html similarity index 100% rename from Resources/Private/Partials/Miscellaneous/FlashMessages.html rename to Resources/Private/Partials/Miscellaneous/FlashMessagesLuxLetter.html diff --git a/Resources/Private/Partials/Newsletter/Dashboard/Links.html b/Resources/Private/Partials/Newsletter/Dashboard/Links.html index 6890c334..30613669 100644 --- a/Resources/Private/Partials/Newsletter/Dashboard/Links.html +++ b/Resources/Private/Partials/Newsletter/Dashboard/Links.html @@ -1,18 +1,26 @@
-
-

- Links -

-
-
-
    - -
  • - {groupedLink.count} - {groupedLink.target} -
    ({groupedLink.newsletter.title}) -
  • -
    -
-
+
+

+ Links +

+
+
+
    + +
  • + {groupedLink.count} + {groupedLink.target} +
    + + + {groupedLink.newsletter.title} + + + (Deleted Newsletter) + + +
  • +
    +
+
diff --git a/Resources/Private/Partials/Newsletter/FormFields.html b/Resources/Private/Partials/Newsletter/FormFields.html index 6b5ee779..25931f3f 100644 --- a/Resources/Private/Partials/Newsletter/FormFields.html +++ b/Resources/Private/Partials/Newsletter/FormFields.html @@ -121,7 +121,12 @@
- + {title} @@ -169,17 +174,27 @@ - - - Choose an origin - + + + + + Choose an origin + + + +

+ No newsletter pages +

+
+
+
tbody > tr:hover, @@ -295,7 +321,7 @@ label { &--addition { font-size: 1vw; - color: $colorGreyDark; + color: light-dark($colorGreyDark, #AAAAAA); display: block; } diff --git a/Resources/Private/Sass/_Choices.scss b/Resources/Private/Sass/_Choices.scss index 6a283ef7..2228b990 100644 --- a/Resources/Private/Sass/_Choices.scss +++ b/Resources/Private/Sass/_Choices.scss @@ -16,7 +16,6 @@ .choices.is-open { overflow: visible; } -.choices.is-disabled .choices__inner, .choices.is-disabled .choices__input { background-color: #eaeaea; cursor: not-allowed; @@ -41,7 +40,6 @@ width: 100%; padding: 10px; border-bottom: 1px solid #ddd; - background-color: #fff; margin: 0; } .choices[data-type*=select-one] .choices__button { @@ -123,20 +121,8 @@ } .choices__inner { - display: inline-block; - vertical-align: top; - width: 100%; - background-color: white; - padding: 5px 7.5px 0; - border: 1px solid rgb(187,187,187); - border-radius: 2.5px; - font-size: 14px; - min-height: 40px; overflow: hidden; } -.is-focused .choices__inner, .is-open .choices__inner { - border-color: #b7b7b7; -} .is-open .choices__inner { border-radius: 2.5px 2.5px 0 0; } @@ -197,26 +183,23 @@ } .choices__list--dropdown, .choices__list[aria-expanded] { - visibility: hidden; - z-index: 1; - position: absolute; - width: 100%; - background-color: #fff; - border: 1px solid #ddd; - top: 100%; + border-top-left-radius: 0; + border-top-right-radius: 0; + border-top: 0; margin-top: -1px; - border-bottom-left-radius: 2.5px; - border-bottom-right-radius: 2.5px; overflow: hidden; - word-break: break-all; + padding-right: 0; + position: absolute; + top: 100%; + visibility: hidden; + width: 100%; will-change: visibility; + word-break: break-all; + z-index: 12; } .is-active.choices__list--dropdown, .is-active.choices__list[aria-expanded] { visibility: visible; } -.is-open .choices__list--dropdown, .is-open .choices__list[aria-expanded] { - border-color: #b7b7b7; -} .is-flipped .choices__list--dropdown, .is-flipped .choices__list[aria-expanded] { top: auto; bottom: 100%; @@ -263,7 +246,8 @@ } } .choices__list--dropdown .choices__item--selectable.is-highlighted, .choices__list[aria-expanded] .choices__item--selectable.is-highlighted { - background-color: #f2f2f2; + background-color: $colorMain; + color: #fff; } .choices__list--dropdown .choices__item--selectable.is-highlighted::after, .choices__list[aria-expanded] .choices__item--selectable.is-highlighted::after { opacity: 0.5; @@ -309,13 +293,12 @@ .choices__input { display: inline-block; vertical-align: baseline; - background-color: white; - font-size: 14px; - margin-bottom: 5px; + background-color: transparent; + color: inherit; border: 0; border-radius: 0; max-width: 100%; - padding: 4px 0 4px 2px; + padding: 0 0 0 2px; } .choices__input:focus { outline: 0; diff --git a/Resources/Private/Sass/_Timeline.scss b/Resources/Private/Sass/_Timeline.scss index a3871928..2b1e8fc2 100644 --- a/Resources/Private/Sass/_Timeline.scss +++ b/Resources/Private/Sass/_Timeline.scss @@ -4,7 +4,6 @@ $linewidth: 3px; .timeline { position: relative; - background: $white; &:before { content: ''; @@ -116,11 +115,15 @@ $linewidth: 3px; } &__item { - margin: 0 0 1rem 0; + margin: 0; max-width: 300px; padding: 0.5rem; position: relative; + &:not(:last-child) { + margin: 0 0 1rem 0; + } + &:before { content: ''; display: block; @@ -134,23 +137,18 @@ $linewidth: 3px; left: calc(-#{$bulletsize} - #{$bulletlinespacing}); } - &:first-child { - - &:after { - content: ''; - display: block; - background-color: $white; - position: absolute; - } - } - + &:first-child, &:last-child { - &:after { + &::after { + background-color: var(--typo3-component-bg); content: ''; display: block; - background-color: $white; position: absolute; + + .luxletter--typo3-12 & { + background-color: var(--panel-bg); + } } } } diff --git a/Resources/Private/Sass/_Wizard.scss b/Resources/Private/Sass/_Wizard.scss index 40ac5083..c7a4ee76 100644 --- a/Resources/Private/Sass/_Wizard.scss +++ b/Resources/Private/Sass/_Wizard.scss @@ -7,7 +7,6 @@ } .wizard { - background-color: $white; padding: 0.2em 0em 0.2em 0.2em; } @@ -22,7 +21,7 @@ font-size: 18px; color: $white; font-weight: bold; - background: $colorGrey; + background: light-dark($colorGreyBright, $colorGreyDark); text-transform: uppercase; cursor: pointer; margin-bottom: 20px; @@ -41,11 +40,15 @@ height: 0; border-top: 34px inset transparent; border-bottom: 34px inset transparent; - border-left: 34px solid $white; + border-left: 34px solid var(--typo3-component-bg); position: absolute; content: ""; top: 0; left: 0; + + .luxletter--typo3-12 & { + border-left-color: var(--panel-bg); + } } .wizard:not(.left-arrow) a:after { @@ -53,7 +56,7 @@ height: 0; border-top: 34px inset transparent; border-bottom: 34px inset transparent; - border-left: 34px solid $colorGrey; + border-left: 34px solid light-dark($colorGreyBright, $colorGreyDark); position: absolute; content: ""; top: 0; @@ -66,7 +69,7 @@ height: 0; border-top: 34px inset transparent; border-bottom: 34px inset transparent; - border-right: 34px solid $colorGrey; + border-right: 34px solid light-dark($colorGreyBright, $colorGreyDark); position: absolute; content: ""; top: 0; @@ -116,7 +119,8 @@ border-radius: 20px; font-size: 18px; background: $white; - color: $colorGrey; + border-color: transparent; + color: light-dark($colorGreyBright, $colorGreyDark); .number { display: inline-block; diff --git a/Resources/Private/Templates/Frontend/Unsubscribe.html b/Resources/Private/Templates/Frontend/Unsubscribe.html index f9291ba6..64c21beb 100644 --- a/Resources/Private/Templates/Frontend/Unsubscribe.html +++ b/Resources/Private/Templates/Frontend/Unsubscribe.html @@ -8,7 +8,7 @@ {settings} (array) TypoScript and FlexForm settings - + diff --git a/Resources/Private/Templates/Frontend/Unsubscribe2.html b/Resources/Private/Templates/Frontend/Unsubscribe2.html index 71cf9361..bc7bf340 100644 --- a/Resources/Private/Templates/Frontend/Unsubscribe2.html +++ b/Resources/Private/Templates/Frontend/Unsubscribe2.html @@ -10,7 +10,7 @@ {settings} (array) TypoScript and FlexForm settings - + diff --git a/Resources/Private/Templates/Newsletter/Dashboard.html b/Resources/Private/Templates/Newsletter/Dashboard.html index 7f3d94de..4cd4a3f6 100644 --- a/Resources/Private/Templates/Newsletter/Dashboard.html +++ b/Resources/Private/Templates/Newsletter/Dashboard.html @@ -1,4 +1,4 @@ - + diff --git a/Resources/Private/Templates/Newsletter/Edit.html b/Resources/Private/Templates/Newsletter/Edit.html index 61188166..94093514 100644 --- a/Resources/Private/Templates/Newsletter/Edit.html +++ b/Resources/Private/Templates/Newsletter/Edit.html @@ -1,4 +1,4 @@ - +
@@ -7,7 +7,7 @@

edit newsletter

- + diff --git a/Resources/Private/Templates/Newsletter/List.html b/Resources/Private/Templates/Newsletter/List.html index e0ba709d..d4bcac2c 100644 --- a/Resources/Private/Templates/Newsletter/List.html +++ b/Resources/Private/Templates/Newsletter/List.html @@ -1,4 +1,4 @@ - + @@ -24,7 +24,7 @@
- + @@ -33,7 +33,7 @@
-
+
{categoryLabel} ({newslettersGroupedPage -> f:count()})
@@ -58,7 +58,7 @@

No newsletters found

- + reset

diff --git a/Resources/Private/Templates/Newsletter/New.html b/Resources/Private/Templates/Newsletter/New.html index 9b08f7e6..eb48b023 100644 --- a/Resources/Private/Templates/Newsletter/New.html +++ b/Resources/Private/Templates/Newsletter/New.html @@ -1,4 +1,4 @@ - +
@@ -7,7 +7,7 @@

Add newsletter

- + diff --git a/Resources/Private/Templates/Newsletter/Receiver.html b/Resources/Private/Templates/Newsletter/Receiver.html index 89e56446..793bc2f4 100644 --- a/Resources/Private/Templates/Newsletter/Receiver.html +++ b/Resources/Private/Templates/Newsletter/Receiver.html @@ -1,4 +1,4 @@ - + diff --git a/Resources/Private/Templates/Newsletter/ReceiverDetail.html b/Resources/Private/Templates/Newsletter/ReceiverDetail.html index 49dc28fc..8443ab2b 100644 --- a/Resources/Private/Templates/Newsletter/ReceiverDetail.html +++ b/Resources/Private/Templates/Newsletter/ReceiverDetail.html @@ -43,25 +43,12 @@

- - - - - show - - - - - show - - - + + show +
diff --git a/Resources/Public/Css/Modules.min.css b/Resources/Public/Css/Modules.min.css index 9b9d4042..97c5d9af 100644 --- a/Resources/Public/Css/Modules.min.css +++ b/Resources/Public/Css/Modules.min.css @@ -1 +1 @@ -.timeline{position:relative;background:#fff}.timeline:before{content:"";display:block;background-color:#ddd;position:absolute}.timeline--vertical{margin:0 0 0 calc(1.5rem + 2rem + 1rem)}.timeline--vertical:before{width:3px;height:100%;top:0;left:calc(-1.5rem / 2 - 3px / 2 - 2rem)}.timeline--vertical .timeline__item:before{background-color:#ddd}.timeline--vertical .timeline__item:first-child:before{background-color:#027aca}.timeline--vertical .timeline__item:first-child:after{width:3px;height:50%;top:0;left:calc(-1.5rem / 2 - 3px / 2 - 2rem)}.timeline--vertical .timeline__item:last-child:after{width:3px;height:50%;bottom:0;left:calc(-1.5rem / 2 - 3px / 2 - 2rem)}.timeline--horizontal{display:flex;justify-content:space-between}.timeline--horizontal:before{width:100%;height:3px;top:34px}.timeline--horizontal .timeline__item{width:100px;text-align:center}.timeline--horizontal .timeline__item:before{left:calc(50% - 1.5rem / 2);top:28px}.timeline--horizontal .timeline__item:first-child:before{background-color:#ddd}.timeline--horizontal .timeline__item:first-child:after{width:50%;height:3px;left:0;top:34px}.timeline--horizontal .timeline__item:last-child:before{background-color:#ddd}.timeline--horizontal .timeline__item:last-child:after{width:50%;height:3px;top:34px;right:0}.timeline__thin{width:85%;margin:10px auto 5px auto}.timeline__item{margin:0 0 1rem 0;max-width:300px;padding:.5rem;position:relative}.timeline__item:before{content:"";display:block;width:1.5rem;height:1.5rem;background-color:#027aca;border-radius:1.5rem;position:absolute;z-index:1;top:calc(50% - 1.5rem / 2);left:calc(-1.5rem - 2rem)}.timeline__item:first-child:after{content:"";display:block;background-color:#fff;position:absolute}.timeline__item:last-child:after{content:"";display:block;background-color:#fff;position:absolute}.nomargin{padding:0 !important;margin:0 !important}.wizard{background-color:#fff;padding:.2em 0em .2em .2em}.wizard a{padding:19px 12px 19px;position:relative;display:inline-block;text-decoration:none;min-width:33%;margin-left:3px;text-align:center;font-size:18px;color:#fff;font-weight:bold;background:#ddd;text-transform:uppercase;cursor:pointer;margin-bottom:20px}.wizard a:hover{text-decoration:none}.wizard a:first-child{margin-left:0}.wizard:not(.left-arrow) a:before{width:0;height:0;border-top:34px inset rgba(0,0,0,0);border-bottom:34px inset rgba(0,0,0,0);border-left:34px solid #fff;position:absolute;content:"";top:0;left:0}.wizard:not(.left-arrow) a:after{width:0;height:0;border-top:34px inset rgba(0,0,0,0);border-bottom:34px inset rgba(0,0,0,0);border-left:34px solid #ddd;position:absolute;content:"";top:0;right:-34px;z-index:2}.wizard.left-arrow a:before{width:0;height:0;border-top:34px inset rgba(0,0,0,0);border-bottom:34px inset rgba(0,0,0,0);border-right:34px solid #ddd;position:absolute;content:"";top:0;left:-34px;z-index:2}.wizard.left-arrow a:after{width:0;height:0;border-top:34px inset rgba(0,0,0,0);border-bottom:34px inset rgba(0,0,0,0);border-right:34px solid #fff;position:absolute;content:"";top:0;right:0;z-index:2}.wizard a:first-child:before,.wizard a:last-child:after{border:none}.wizard a:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.wizard a:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.wizard.left-arrow a:last-child:before,.wizard.small.left-arrow a:last-child:before{border-right-color:#027aca}.luxletter .wizard .badge{margin:0 5px 0 18px;position:relative;top:-1px;border-radius:20px;font-size:18px;background:#fff;color:#ddd}.luxletter .wizard .badge .number{display:inline-block}.wizard a:first-child .badge{margin-left:0}.wizard .current,.wizard a.progress-current{background:#027aca;color:#fff}.wizard .current .badge,.wizard a.progress-current .badge{color:#027aca}.wizard a.current:after,.wizard a.progress-current:after{border-left-color:#027aca !important}.wizard.left-arrow a.current:before,.wizard.left-arrow a.progress-current:before,.wizard.small.left-arrow a.current:before,.wizard.small.left-arrow a.progress-current:before{border-right-color:#027aca}.wizard.small{margin-bottom:15px}.wizard.small a{padding:5px 12px 5px}.wizard.small:not(.left-arrow) a:before{border-top:15px inset rgba(0,0,0,0);border-bottom:15px inset rgba(0,0,0,0);border-left:15px solid #fff}.wizard.small:not(.left-arrow) a:after{border-top:15px inset rgba(0,0,0,0);border-bottom:15px inset rgba(0,0,0,0);border-left:15px solid #7cc6fe;right:-15px}.wizard.small.left-arrow a:before{border-top:15px inset rgba(0,0,0,0);border-bottom:15px inset rgba(0,0,0,0);border-right:15px solid #7cc6fe;left:-15px;z-index:2}.wizard.small.left-arrow a:after{width:0;height:0;border-top:15px inset rgba(0,0,0,0);border-bottom:15px inset rgba(0,0,0,0);border-right:15px solid #fff}.wizard.small a:first-child:before,.wizard.small a:last-child:after{border:none}_:-ms-fullscreen,:root .wizard.small.left-arrow a:before{left:-14px}_:-ms-fullscreen,:root .wizard.small:not(.left-arrow) a:after{right:-14px}_:-ms-fullscreen,:root .wizard.left-arrow a:before{left:-29px}_:-ms-fullscreen,:root .wizard:not(.left-arrow) a:after{right:-29px}.choices{position:relative;overflow:hidden;margin-bottom:24px;font-size:16px}.choices:focus{outline:none}.choices:last-child{margin-bottom:0}.choices.is-open{overflow:visible}.choices.is-disabled .choices__inner,.choices.is-disabled .choices__input{background-color:#eaeaea;cursor:not-allowed;-webkit-user-select:none;user-select:none}.choices.is-disabled .choices__item{cursor:not-allowed}.choices [hidden]{display:none !important}.choices[data-type*=select-one]{cursor:pointer}.choices[data-type*=select-one] .choices__inner{padding-bottom:7.5px}.choices[data-type*=select-one] .choices__input{display:block;width:100%;padding:10px;border-bottom:1px solid #ddd;background-color:#fff;margin:0}.choices[data-type*=select-one] .choices__button{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==");padding:0;background-size:8px;position:absolute;top:50%;right:0;margin-top:-10px;margin-right:25px;height:20px;width:20px;border-radius:10em;opacity:.25}.choices[data-type*=select-one] .choices__button:hover,.choices[data-type*=select-one] .choices__button:focus{opacity:1}.choices[data-type*=select-one] .choices__button:focus{box-shadow:0 0 0 2px #027aca}.choices[data-type*=select-one] .choices__item[data-value=""] .choices__button{display:none}.choices[data-type*=select-one]::after{content:"";height:0;width:0;border-style:solid;border-color:#333 rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0);border-width:5px;position:absolute;right:11.5px;top:50%;margin-top:-2.5px;pointer-events:none}.choices[data-type*=select-one].is-open::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #333 rgba(0,0,0,0);margin-top:-7.5px}.choices[data-type*=select-one][dir=rtl]::after{left:11.5px;right:auto}.choices[data-type*=select-one][dir=rtl] .choices__button{right:auto;left:0;margin-left:25px;margin-right:0}.choices[data-type*=select-multiple] .choices__inner,.choices[data-type*=text] .choices__inner{cursor:text}.choices[data-type*=select-multiple] .choices__button,.choices[data-type*=text] .choices__button{position:relative;display:inline-block;margin-top:0;margin-right:-4px;margin-bottom:0;margin-left:8px;padding-left:16px;border-left:1px solid #7cc6fe;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==");background-size:8px;width:8px;line-height:1;opacity:.75;border-radius:0}.choices[data-type*=select-multiple] .choices__button:hover,.choices[data-type*=select-multiple] .choices__button:focus,.choices[data-type*=text] .choices__button:hover,.choices[data-type*=text] .choices__button:focus{opacity:1}.choices__inner{display:inline-block;vertical-align:top;width:100%;background-color:#fff;padding:5px 7.5px 0;border:1px solid #bbb;border-radius:2.5px;font-size:14px;min-height:40px;overflow:hidden}.is-focused .choices__inner,.is-open .choices__inner{border-color:#b7b7b7}.is-open .choices__inner{border-radius:2.5px 2.5px 0 0}.is-flipped.is-open .choices__inner{border-radius:0 0 2.5px 2.5px}.choices__list{margin:0;padding-left:0;list-style:none}.choices__list--single{display:inline-block;padding:4px 16px 4px 4px;width:100%}[dir=rtl] .choices__list--single{padding-right:4px;padding-left:16px}.choices__list--single .choices__item{width:100%}.choices__list--multiple{display:inline}.choices__list--multiple .choices__item{display:inline-block;vertical-align:middle;border-radius:20px;padding:4px 10px;font-size:12px;font-weight:500;margin-right:3.75px;margin-bottom:3.75px;background-color:#027aca;border:1px solid #027aca;color:#fff;word-break:break-all;box-sizing:border-box}.choices__list--multiple .choices__item[data-deletable]{padding-right:5px}[dir=rtl] .choices__list--multiple .choices__item{margin-right:0;margin-left:3.75px}.choices__list--multiple .choices__item.is-highlighted{background-color:#027aca;border:1px solid #027aca}.is-disabled .choices__list--multiple .choices__item{background-color:#aaa;border:1px solid #919191}.choices__list--dropdown,.choices__list[aria-expanded]{visibility:hidden;z-index:1;position:absolute;width:100%;background-color:#fff;border:1px solid #ddd;top:100%;margin-top:-1px;border-bottom-left-radius:2.5px;border-bottom-right-radius:2.5px;overflow:hidden;word-break:break-all;will-change:visibility}.is-active.choices__list--dropdown,.is-active.choices__list[aria-expanded]{visibility:visible}.is-open .choices__list--dropdown,.is-open .choices__list[aria-expanded]{border-color:#b7b7b7}.is-flipped .choices__list--dropdown,.is-flipped .choices__list[aria-expanded]{top:auto;bottom:100%;margin-top:0;margin-bottom:-1px;border-radius:.25rem .25rem 0 0}.choices__list--dropdown .choices__list,.choices__list[aria-expanded] .choices__list{position:relative;max-height:300px;overflow:auto;-webkit-overflow-scrolling:touch;will-change:scroll-position}.choices__list--dropdown .choices__item,.choices__list[aria-expanded] .choices__item{position:relative;padding:10px;font-size:14px}[dir=rtl] .choices__list--dropdown .choices__item,[dir=rtl] .choices__list[aria-expanded] .choices__item{text-align:right}@media(min-width: 640px){.choices__list--dropdown .choices__item--selectable,.choices__list[aria-expanded] .choices__item--selectable{padding-right:100px}.choices__list--dropdown .choices__item--selectable::after,.choices__list[aria-expanded] .choices__item--selectable::after{content:attr(data-select-text);font-size:12px;opacity:0;position:absolute;right:10px;top:50%;transform:translateY(-50%)}[dir=rtl] .choices__list--dropdown .choices__item--selectable,[dir=rtl] .choices__list[aria-expanded] .choices__item--selectable{text-align:right;padding-left:100px;padding-right:10px}[dir=rtl] .choices__list--dropdown .choices__item--selectable::after,[dir=rtl] .choices__list[aria-expanded] .choices__item--selectable::after{right:auto;left:10px}}.choices__list--dropdown .choices__item--selectable.is-highlighted,.choices__list[aria-expanded] .choices__item--selectable.is-highlighted{background-color:#f2f2f2}.choices__list--dropdown .choices__item--selectable.is-highlighted::after,.choices__list[aria-expanded] .choices__item--selectable.is-highlighted::after{opacity:.5}.choices__item{cursor:default}.choices__item--selectable{cursor:pointer}.choices__item--disabled{cursor:not-allowed;-webkit-user-select:none;user-select:none;opacity:.5}.choices__heading{font-weight:600;font-size:12px;padding:10px;border-bottom:1px solid #f7f7f7;color:gray}.choices__button{text-indent:-9999px;-webkit-appearance:none;appearance:none;border:0;background-color:rgba(0,0,0,0);background-repeat:no-repeat;background-position:center;cursor:pointer}.choices__button:focus{outline:none}.choices__input{display:inline-block;vertical-align:baseline;background-color:#fff;font-size:14px;margin-bottom:5px;border:0;border-radius:0;max-width:100%;padding:4px 0 4px 2px}.choices__input:focus{outline:0}.choices__input::-webkit-search-decoration,.choices__input::-webkit-search-cancel-button,.choices__input::-webkit-search-results-button,.choices__input::-webkit-search-results-decoration{display:none}.choices__input::-ms-clear,.choices__input::-ms-reveal{display:none;width:0;height:0}[dir=rtl] .choices__input{padding-right:2px;padding-left:0}.choices__placeholder{opacity:.5}a{color:#027aca;cursor:pointer}hr{border-style:dashed;border-color:#ddd;border-bottom:0;border-left:0;border-right:0;margin:40px 0}label{font-weight:normal}.color-lux{color:#027aca}.color-grey{color:#ddd}.lux-backend{--bs-primary-rgb: 165, 231, 255}.lux-backend .table>:not(caption)>*>*{background:rgba(0,0,0,0)}.img-circle{object-fit:cover;border-radius:50%;width:100%;height:auto;aspect-ratio:1/1}@media screen and (min-width: 992px){.row{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;flex-wrap:wrap}}@media screen and (min-width: 992px){.row>[class*=col-]{display:flex;flex-direction:column}}.row+.row:not(.lux-trigger){margin-top:.5rem}.luxletter-dashboard .panel,.luxletter-dashboard .panel-body{height:100%}.panel-body{overflow:hidden}.bg-primary{background-color:#7cc6fe}.bg-primary li{color:#fff}.badge-primary{background-color:#027aca}.badge{background-color:#5a5a5a;color:#fff}.alert-lux{background-color:#027aca}.form-select.form-control-lg{font-size:.9375rem;padding:.5rem 1rem}.form-control{border:1px solid #ddd}.progress{margin-bottom:0}.progress-bar{background-color:#027aca}.progress-bar-striped{background-color:#ccc}.pull-right{float:right !important}.btn-lg-extra{padding:30px 60px;font-size:25px;line-height:2;border-radius:5px}.btn-primary{background-color:#027aca;border-color:#027aca;color:#fff}.btn-primary:hover{background-color:#027aca;border-color:#027aca}.btn-primary-extra{appearance:none;-moz-appearance:none;-webkit-appearance:none;left:50%;top:50%;margin-top:-100px;margin-left:-200px;position:fixed;line-height:1.6}.btn-primary-extra>span{display:block;font-size:16px}.btn-add-lg{display:block;width:100%;padding:5px;font-weight:bold;font-size:19px}.lb-lg{font-size:20px;margin-bottom:5px}.help-block{margin-top:15px;margin-left:15px;display:inline-block;color:#5a5a5a}.help-block__code{list-style-type:none;padding:0;margin:0}.help-block__code>li{margin:5px 0}.help-block__code>li>span{font-style:italic;background:#ddd;display:inline-block;padding:2px 10px;margin-right:10px;font-weight:bold}.table{border:1px solid #ccc}.table-hover>tbody>tr:hover,.table-hover>tbody>tr.lux-action-detail{background-color:#027aca}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr.lux-action-detail>td{color:#fff;background-color:rgba(0,0,0,0)}.table-pointer>tbody>tr{cursor:pointer}.lux-textarea{width:100%;padding:10px}.lux-textarea__default{color:#ddd}.luxletter-mailprefiew--image{width:32px;height:32px;border-radius:16px;display:inline-block;overflow:hidden;margin-right:20px}.luxletter-iframepreview-container{display:flex;width:100%}.luxletter-iframepreview-children{flex-direction:row;width:100%;padding:10px}.luxletter-iframepreview-children h2{margin:0 0 12px 0}.luxletter-iframepreview-children iframe{width:100%;height:800px;border:1px dashed #000}.luxletter-messages{padding:15px 0;list-style-type:none}.luxletter-messages>li{margin:5px 30px;font-size:16px}.luxletter-panel-body-text{font-size:2.5vw;display:inline-block;width:100%;text-align:center;color:#027aca;line-height:85%}.luxletter-panel-body-text--addition{font-size:1vw;color:#292929;display:block}.luxletter-panel-body-text__larger{font-size:4vw}.luxletter-panel-body-text__larger .luxletter-panel-body-text--addition{font-size:1.5vw}.vcenter{display:flex;align-items:center;justify-content:center} \ No newline at end of file +.timeline{position:relative}.timeline:before{content:"";display:block;background-color:#ddd;position:absolute}.timeline--vertical{margin:0 0 0 calc(1.5rem + 2rem + 1rem)}.timeline--vertical:before{width:3px;height:100%;top:0;left:calc(-1.5rem/2 - 3px/2 - 2rem)}.timeline--vertical .timeline__item:before{background-color:#ddd}.timeline--vertical .timeline__item:first-child:before{background-color:#027aca}.timeline--vertical .timeline__item:first-child:after{width:3px;height:50%;top:0;left:calc(-1.5rem/2 - 3px/2 - 2rem)}.timeline--vertical .timeline__item:last-child:after{width:3px;height:50%;bottom:0;left:calc(-1.5rem/2 - 3px/2 - 2rem)}.timeline--horizontal{display:flex;justify-content:space-between}.timeline--horizontal:before{width:100%;height:3px;top:34px}.timeline--horizontal .timeline__item{width:100px;text-align:center}.timeline--horizontal .timeline__item:before{left:calc(50% - 1.5rem/2);top:28px}.timeline--horizontal .timeline__item:first-child:before{background-color:#ddd}.timeline--horizontal .timeline__item:first-child:after{width:50%;height:3px;left:0;top:34px}.timeline--horizontal .timeline__item:last-child:before{background-color:#ddd}.timeline--horizontal .timeline__item:last-child:after{width:50%;height:3px;top:34px;right:0}.timeline__thin{width:85%;margin:10px auto 5px auto}.timeline__item{margin:0;max-width:300px;padding:.5rem;position:relative}.timeline__item:not(:last-child){margin:0 0 1rem 0}.timeline__item:before{content:"";display:block;width:1.5rem;height:1.5rem;background-color:#027aca;border-radius:1.5rem;position:absolute;z-index:1;top:calc(50% - 1.5rem/2);left:calc(-1.5rem - 2rem)}.timeline__item:first-child::after,.timeline__item:last-child::after{background-color:var(--typo3-component-bg);content:"";display:block;position:absolute}.luxletter--typo3-12 .timeline__item:first-child::after,.luxletter--typo3-12 .timeline__item:last-child::after{background-color:var(--panel-bg)}.nomargin{padding:0 !important;margin:0 !important}.wizard{padding:.2em 0em .2em .2em}.wizard a{padding:19px 12px 19px;position:relative;display:inline-block;text-decoration:none;min-width:33%;margin-left:3px;text-align:center;font-size:18px;color:#fff;font-weight:bold;background:light-dark(#CCCCCC, #292929);text-transform:uppercase;cursor:pointer;margin-bottom:20px}.wizard a:hover{text-decoration:none}.wizard a:first-child{margin-left:0}.wizard:not(.left-arrow) a:before{width:0;height:0;border-top:34px inset rgba(0,0,0,0);border-bottom:34px inset rgba(0,0,0,0);border-left:34px solid var(--typo3-component-bg);position:absolute;content:"";top:0;left:0}.luxletter--typo3-12 .wizard:not(.left-arrow) a:before{border-left-color:var(--panel-bg)}.wizard:not(.left-arrow) a:after{width:0;height:0;border-top:34px inset rgba(0,0,0,0);border-bottom:34px inset rgba(0,0,0,0);border-left:34px solid light-dark(#CCCCCC, #292929);position:absolute;content:"";top:0;right:-34px;z-index:2}.wizard.left-arrow a:before{width:0;height:0;border-top:34px inset rgba(0,0,0,0);border-bottom:34px inset rgba(0,0,0,0);border-right:34px solid light-dark(#CCCCCC, #292929);position:absolute;content:"";top:0;left:-34px;z-index:2}.wizard.left-arrow a:after{width:0;height:0;border-top:34px inset rgba(0,0,0,0);border-bottom:34px inset rgba(0,0,0,0);border-right:34px solid #fff;position:absolute;content:"";top:0;right:0;z-index:2}.wizard a:first-child:before,.wizard a:last-child:after{border:none}.wizard a:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.wizard a:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.wizard.left-arrow a:last-child:before,.wizard.small.left-arrow a:last-child:before{border-right-color:#027aca}.luxletter .wizard .badge{margin:0 5px 0 18px;position:relative;top:-1px;border-radius:20px;font-size:18px;background:#fff;border-color:rgba(0,0,0,0);color:light-dark(#CCCCCC, #292929)}.luxletter .wizard .badge .number{display:inline-block}.wizard a:first-child .badge{margin-left:0}.wizard .current,.wizard a.progress-current{background:#027aca;color:#fff}.wizard .current .badge,.wizard a.progress-current .badge{color:#027aca}.wizard a.current:after,.wizard a.progress-current:after{border-left-color:#027aca !important}.wizard.left-arrow a.current:before,.wizard.left-arrow a.progress-current:before,.wizard.small.left-arrow a.current:before,.wizard.small.left-arrow a.progress-current:before{border-right-color:#027aca}.wizard.small{margin-bottom:15px}.wizard.small a{padding:5px 12px 5px}.wizard.small:not(.left-arrow) a:before{border-top:15px inset rgba(0,0,0,0);border-bottom:15px inset rgba(0,0,0,0);border-left:15px solid #fff}.wizard.small:not(.left-arrow) a:after{border-top:15px inset rgba(0,0,0,0);border-bottom:15px inset rgba(0,0,0,0);border-left:15px solid #7cc6fe;right:-15px}.wizard.small.left-arrow a:before{border-top:15px inset rgba(0,0,0,0);border-bottom:15px inset rgba(0,0,0,0);border-right:15px solid #7cc6fe;left:-15px;z-index:2}.wizard.small.left-arrow a:after{width:0;height:0;border-top:15px inset rgba(0,0,0,0);border-bottom:15px inset rgba(0,0,0,0);border-right:15px solid #fff}.wizard.small a:first-child:before,.wizard.small a:last-child:after{border:none}_:-ms-fullscreen,:root .wizard.small.left-arrow a:before{left:-14px}_:-ms-fullscreen,:root .wizard.small:not(.left-arrow) a:after{right:-14px}_:-ms-fullscreen,:root .wizard.left-arrow a:before{left:-29px}_:-ms-fullscreen,:root .wizard:not(.left-arrow) a:after{right:-29px}.choices{position:relative;overflow:hidden;margin-bottom:24px;font-size:16px}.choices:focus{outline:none}.choices:last-child{margin-bottom:0}.choices.is-open{overflow:visible}.choices.is-disabled .choices__input{background-color:#eaeaea;cursor:not-allowed;-webkit-user-select:none;user-select:none}.choices.is-disabled .choices__item{cursor:not-allowed}.choices [hidden]{display:none !important}.choices[data-type*=select-one]{cursor:pointer}.choices[data-type*=select-one] .choices__inner{padding-bottom:7.5px}.choices[data-type*=select-one] .choices__input{display:block;width:100%;padding:10px;border-bottom:1px solid #ddd;margin:0}.choices[data-type*=select-one] .choices__button{background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==");padding:0;background-size:8px;position:absolute;top:50%;right:0;margin-top:-10px;margin-right:25px;height:20px;width:20px;border-radius:10em;opacity:.25}.choices[data-type*=select-one] .choices__button:hover,.choices[data-type*=select-one] .choices__button:focus{opacity:1}.choices[data-type*=select-one] .choices__button:focus{box-shadow:0 0 0 2px #027aca}.choices[data-type*=select-one] .choices__item[data-value=""] .choices__button{display:none}.choices[data-type*=select-one]::after{content:"";height:0;width:0;border-style:solid;border-color:#333 rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0);border-width:5px;position:absolute;right:11.5px;top:50%;margin-top:-2.5px;pointer-events:none}.choices[data-type*=select-one].is-open::after{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #333 rgba(0,0,0,0);margin-top:-7.5px}.choices[data-type*=select-one][dir=rtl]::after{left:11.5px;right:auto}.choices[data-type*=select-one][dir=rtl] .choices__button{right:auto;left:0;margin-left:25px;margin-right:0}.choices[data-type*=select-multiple] .choices__inner,.choices[data-type*=text] .choices__inner{cursor:text}.choices[data-type*=select-multiple] .choices__button,.choices[data-type*=text] .choices__button{position:relative;display:inline-block;margin-top:0;margin-right:-4px;margin-bottom:0;margin-left:8px;padding-left:16px;border-left:1px solid #7cc6fe;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==");background-size:8px;width:8px;line-height:1;opacity:.75;border-radius:0}.choices[data-type*=select-multiple] .choices__button:hover,.choices[data-type*=select-multiple] .choices__button:focus,.choices[data-type*=text] .choices__button:hover,.choices[data-type*=text] .choices__button:focus{opacity:1}.choices__inner{overflow:hidden}.is-open .choices__inner{border-radius:2.5px 2.5px 0 0}.is-flipped.is-open .choices__inner{border-radius:0 0 2.5px 2.5px}.choices__list{margin:0;padding-left:0;list-style:none}.choices__list--single{display:inline-block;padding:4px 16px 4px 4px;width:100%}[dir=rtl] .choices__list--single{padding-right:4px;padding-left:16px}.choices__list--single .choices__item{width:100%}.choices__list--multiple{display:inline}.choices__list--multiple .choices__item{display:inline-block;vertical-align:middle;border-radius:20px;padding:4px 10px;font-size:12px;font-weight:500;margin-right:3.75px;margin-bottom:3.75px;background-color:#027aca;border:1px solid #027aca;color:#fff;word-break:break-all;box-sizing:border-box}.choices__list--multiple .choices__item[data-deletable]{padding-right:5px}[dir=rtl] .choices__list--multiple .choices__item{margin-right:0;margin-left:3.75px}.choices__list--multiple .choices__item.is-highlighted{background-color:#027aca;border:1px solid #027aca}.is-disabled .choices__list--multiple .choices__item{background-color:#aaa;border:1px solid #919191}.choices__list--dropdown,.choices__list[aria-expanded]{border-top-left-radius:0;border-top-right-radius:0;border-top:0;margin-top:-1px;overflow:hidden;padding-right:0;position:absolute;top:100%;visibility:hidden;width:100%;will-change:visibility;word-break:break-all;z-index:12}.is-active.choices__list--dropdown,.is-active.choices__list[aria-expanded]{visibility:visible}.is-flipped .choices__list--dropdown,.is-flipped .choices__list[aria-expanded]{top:auto;bottom:100%;margin-top:0;margin-bottom:-1px;border-radius:.25rem .25rem 0 0}.choices__list--dropdown .choices__list,.choices__list[aria-expanded] .choices__list{position:relative;max-height:300px;overflow:auto;-webkit-overflow-scrolling:touch;will-change:scroll-position}.choices__list--dropdown .choices__item,.choices__list[aria-expanded] .choices__item{position:relative;padding:10px;font-size:14px}[dir=rtl] .choices__list--dropdown .choices__item,[dir=rtl] .choices__list[aria-expanded] .choices__item{text-align:right}@media(min-width: 640px){.choices__list--dropdown .choices__item--selectable,.choices__list[aria-expanded] .choices__item--selectable{padding-right:100px}.choices__list--dropdown .choices__item--selectable::after,.choices__list[aria-expanded] .choices__item--selectable::after{content:attr(data-select-text);font-size:12px;opacity:0;position:absolute;right:10px;top:50%;transform:translateY(-50%)}[dir=rtl] .choices__list--dropdown .choices__item--selectable,[dir=rtl] .choices__list[aria-expanded] .choices__item--selectable{text-align:right;padding-left:100px;padding-right:10px}[dir=rtl] .choices__list--dropdown .choices__item--selectable::after,[dir=rtl] .choices__list[aria-expanded] .choices__item--selectable::after{right:auto;left:10px}}.choices__list--dropdown .choices__item--selectable.is-highlighted,.choices__list[aria-expanded] .choices__item--selectable.is-highlighted{background-color:#027aca;color:#fff}.choices__list--dropdown .choices__item--selectable.is-highlighted::after,.choices__list[aria-expanded] .choices__item--selectable.is-highlighted::after{opacity:.5}.choices__item{cursor:default}.choices__item--selectable{cursor:pointer}.choices__item--disabled{cursor:not-allowed;-webkit-user-select:none;user-select:none;opacity:.5}.choices__heading{font-weight:600;font-size:12px;padding:10px;border-bottom:1px solid #f7f7f7;color:gray}.choices__button{text-indent:-9999px;-webkit-appearance:none;appearance:none;border:0;background-color:rgba(0,0,0,0);background-repeat:no-repeat;background-position:center;cursor:pointer}.choices__button:focus{outline:none}.choices__input{display:inline-block;vertical-align:baseline;background-color:rgba(0,0,0,0);color:inherit;border:0;border-radius:0;max-width:100%;padding:0 0 0 2px}.choices__input:focus{outline:0}.choices__input::-webkit-search-decoration,.choices__input::-webkit-search-cancel-button,.choices__input::-webkit-search-results-button,.choices__input::-webkit-search-results-decoration{display:none}.choices__input::-ms-clear,.choices__input::-ms-reveal{display:none;width:0;height:0}[dir=rtl] .choices__input{padding-right:2px;padding-left:0}.choices__placeholder{opacity:.5}a{color:#027aca;cursor:pointer}hr{border-style:dashed;border-color:#ddd;border-bottom:0;border-left:0;border-right:0;margin:40px 0}label{font-weight:normal}.color-lux{color:#027aca}.color-grey{color:#ddd}.lux-backend{--bs-primary-rgb: 165, 231, 255}.lux-backend .table>:not(caption)>*>*{background:rgba(0,0,0,0)}.img-circle{object-fit:cover;border-radius:50%;width:100%;height:auto;aspect-ratio:1/1}@media screen and (min-width: 992px){.row{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;flex-wrap:wrap}}@media screen and (min-width: 992px){.row>[class*=col-]{display:flex;flex-direction:column}}.row+.row:not(.lux-trigger){margin-top:.5rem}.luxletter-dashboard .panel,.luxletter-dashboard .panel-body{height:100%}.panel-body{overflow:hidden}.bg-primary{background-color:#7cc6fe}.bg-primary li{color:#fff}.badge-primary{background-color:#027aca}.luxletter .badge{background-color:#5a5a5a;color:#fff;border-radius:10px;font-size:11px;padding:3px 7px}.luxletter .badge.badge-primary{background-color:#027aca}.alert-lux{background-color:#027aca}.form-select.form-control-lg{font-size:.9375rem;padding:.5rem 1rem}.progress{margin-bottom:0}.progress-bar{background-color:#027aca}.progress-bar-striped{background-color:#ccc}.pull-right{float:right !important}.btn-lg-extra{padding:30px 60px;font-size:25px;line-height:2;border-radius:5px}.btn-primary{background-color:#027aca;border-color:#027aca;color:#fff}.btn-primary:hover{background-color:#027aca;border-color:#027aca}.btn-primary-extra{appearance:none;-moz-appearance:none;-webkit-appearance:none;left:50%;top:50%;margin-top:-100px;margin-left:-200px;position:fixed;line-height:1.6}.btn-primary-extra>span{display:block;font-size:16px}.btn-add-lg{display:block;width:100%;padding:5px;font-weight:bold;font-size:19px}.lb-lg{font-size:20px;margin-bottom:5px}.help-block{margin-top:15px;margin-left:15px;display:inline-block;color:light-dark(#292929, #AAAAAA)}.help-block__code{list-style-type:none;padding:0;margin:0}.help-block__code>li{margin:5px 0}.help-block__code>li>span{font-style:italic;background:#ddd;display:inline-block;padding:2px 10px;margin-right:10px;font-weight:bold}.table-title{background-color:var(--typo3-component-border-color);border-top:1px solid var(--typo3-component-border-color);border-left:1px solid var(--typo3-component-border-color);border-right:1px solid var(--typo3-component-border-color);color:var(--typo3-table-color);font-weight:bold;padding:10px}.table{border:1px solid var(--typo3-component-border-color)}.luxletter--typo3-12 .table-title,.luxletter--typo3-12 .table{--typo3-component-border-color: #dddddd}.table-hover>tbody>tr:hover,.table-hover>tbody>tr.lux-action-detail{background-color:#027aca}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr.lux-action-detail>td{color:#fff;background-color:rgba(0,0,0,0)}.table-pointer>tbody>tr{cursor:pointer}.lux-textarea{width:100%;padding:10px}.lux-textarea__default{color:#ddd}.luxletter-mailprefiew--image{width:32px;height:32px;border-radius:16px;display:inline-block;overflow:hidden;margin-right:20px}.luxletter-iframepreview-container{display:flex;width:100%}.luxletter-iframepreview-children{flex-direction:row;width:100%;padding:10px}.luxletter-iframepreview-children h2{margin:0 0 12px 0}.luxletter-iframepreview-children iframe{width:100%;height:800px;border:1px dashed #000}.luxletter-messages{padding:15px 0;list-style-type:none}.luxletter-messages>li{margin:5px 30px;font-size:16px}.luxletter-panel-body-text{font-size:2.5vw;display:inline-block;width:100%;text-align:center;color:#027aca;line-height:85%}.luxletter-panel-body-text--addition{font-size:1vw;color:light-dark(#292929, #AAAAAA);display:block}.luxletter-panel-body-text__larger{font-size:4vw}.luxletter-panel-body-text__larger .luxletter-panel-body-text--addition{font-size:1.5vw}.vcenter{display:flex;align-items:center;justify-content:center} \ No newline at end of file diff --git a/Resources/Public/JavaScript/Luxletter/Choices.min.js b/Resources/Public/JavaScript/Luxletter/Choices.min.js index 5e898f04..5bfc9610 100644 --- a/Resources/Public/JavaScript/Luxletter/Choices.min.js +++ b/Resources/Public/JavaScript/Luxletter/Choices.min.js @@ -1 +1 @@ -define(["TYPO3/CMS/Luxletter/Vendor/Choices.min"],function(){"use strict";(new function(){this.initialize=function(){var e="#luxletter-receivers-dropdown";null!==document.querySelector(e)&&(window.luxLetterReceiverChoice=new Choices(e,{allowHTML:!0,searchResultLimit:100}))}}).initialize()}); \ No newline at end of file +import"@in2code/luxletter/vendor/choices.js";function LuxletterChoices(){this.initialize=function(){var e="#luxletter-receivers-dropdown";null!==document.querySelector(e)&&(window.luxLetterReceiverChoice=new Choices(e,{allowHTML:!0,searchResultLimit:100}))}}var LuxletterChoicesObject=new LuxletterChoices;LuxletterChoicesObject.initialize(),window.setTimeout(()=>{var e=document.querySelectorAll(".choices__inner"),t=document.querySelectorAll(".choices__list--dropdown");e.forEach(e=>{e.classList.add("form-control"),e.classList.add("form-select")}),t.forEach(e=>{e.classList.add("form-control")})},1e3); \ No newline at end of file diff --git a/Resources/Public/JavaScript/Luxletter/Diagram.min.js b/Resources/Public/JavaScript/Luxletter/Diagram.min.js index eca484f3..156e1486 100644 --- a/Resources/Public/JavaScript/Luxletter/Diagram.min.js +++ b/Resources/Public/JavaScript/Luxletter/Diagram.min.js @@ -1 +1 @@ -define(["jquery","TYPO3/CMS/Luxletter/Vendor/Chart.min"],function(t){"use strict";function a(t){this.initialize=function(){a()};var a=function(){for(var t=document.querySelectorAll("[data-chart]"),a=0;a{var t=document.documentElement.getAttribute("data-color-scheme")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;Chart.defaults.color="light"!==t&&("dark"===t||"auto"===t&&a)?"#D9D9D9":"#1A1A1A"},IS_TYPO3_12=null!==document.querySelector(".luxletter--typo3-12"),LuxletterDiagram=(IS_TYPO3_12||setDefaultChartColor(),Chart.register(...registerables),function(){this.initialize=function(){t()};var t=function(){document.querySelectorAll("[data-chart]").forEach(function(t){var a=Chart.getChart(t),a=(void 0!==a&&a.destroy(),t.getAttribute("data-chart"));"doughnut"===a?e(t):"bar"===a&&r(t)})},e=function(t){new Chart(t.getContext("2d"),{type:"doughnut",data:{datasets:[{data:t.getAttribute("data-chart-data").split(","),backgroundColor:["rgba(221, 221, 221, 1)","rgba(2, 122, 202, 1)"]}],labels:t.getAttribute("data-chart-labels").split(",")},options:{maintainAspectRatio:!1,plugins:{legend:{display:!1,position:"right",labels:{fontSize:14}}}}})},r=function(t){new Chart(t.getContext("2d"),{type:"bar",data:{datasets:[{label:t.getAttribute("data-chart-label"),data:t.getAttribute("data-chart-data").split(","),backgroundColor:["rgba(2, 122, 202, 1)","rgba(221, 221, 221, 1)"]}],labels:t.getAttribute("data-chart-labels").split(",")},options:{legend:{display:!1,position:"right",labels:{fontSize:18}},scales:{x:{ticks:{autoSkip:!1}},y:{ticks:{beginAtZero:!0}}}}})}}),LuxletterDiagramObject=new LuxletterDiagram;LuxletterDiagramObject.initialize(); \ No newline at end of file diff --git a/Resources/Public/JavaScript/Luxletter/Module.min.js b/Resources/Public/JavaScript/Luxletter/Module.min.js index 25a019e5..bc199c0a 100644 --- a/Resources/Public/JavaScript/Luxletter/Module.min.js +++ b/Resources/Public/JavaScript/Luxletter/Module.min.js @@ -1 +1 @@ -define(["jquery"],function(e){"use strict";function t(e){var n=this,i=!1,r=!1,t=(this.initialize=function(){t(),l(),c(),s(),d(),v(),f()},function(){for(var r=document.querySelectorAll(".wizardform > fieldset"),e=document.querySelectorAll("[data-wizardform-gotostep]"),l=document.querySelectorAll(".wizard > a"),t=1;tspan"),r=parseInt(t.innerHTML),t.innerHTML=(++r).toString()):null!==l&&""!==e.statusSeverity&&!0===e.status&&(l.classList.remove(...l.classList),l.classList.add("alert"),l.classList.add(e.statusSeverity),l.querySelector(".alert-heading").innerHTML=e.statusTitle,l.querySelector("p").innerHTML=e.statusMessage,h(l))},this.userDetailListenerCallback=function(e){var t=document.getElementById("luxletter-newsletter-receiver-container");null!==t&&(t.innerHTML=e.html)},function(e,t,r){var l;void 0!==e&&""!==e?((l=new XMLHttpRequest).onreadystatechange=function(){4===this.readyState&&200===this.status&&null!==r&&n[r](JSON.parse(this.responseText))},l.open("POST",x(e,t),!0),l.send()):console.log("No ajax URI given!")}),w=function(){if(y()&&g())for(var e=document.querySelectorAll("[data-luxletter-wizardstatus]"),t=0;t fieldset"),e=document.querySelectorAll("[data-wizardform-gotostep]"),l=document.querySelectorAll(".wizard > a"),t=1;t{e.target.form.submit()})})};this.addWizardUserPreviewCallback=function(e){var t=document.querySelector('[data-luxletter-wizardpreview="users"]');null!==t&&(t.innerHTML=e.html,r=!0,w())},this.testMailListenerCallback=function(e){var t,r,l=document.querySelector('[data-luxletter-testmail="message"]');null!==l&&void 0===e.statusSeverity&&!0===e.status?(p(l),t=l.querySelector("p>span"),r=parseInt(t.innerHTML),t.innerHTML=(++r).toString()):null!==l&&""!==e.statusSeverity&&!0===e.status&&(l.classList.remove(...l.classList),l.classList.add("alert"),l.classList.add(e.statusSeverity),l.querySelector(".alert-heading").innerHTML=e.statusTitle,l.querySelector("p").innerHTML=e.statusMessage,p(l))},this.userDetailListenerCallback=function(e){var t=document.getElementById("luxletter-newsletter-receiver-container");null!==t&&(t.innerHTML=e.html)};var m=function(e,t,r){var l;void 0!==e&&""!==e?((l=new XMLHttpRequest).onreadystatechange=function(){4===this.readyState&&200===this.status&&null!==r&&n[r](JSON.parse(this.responseText))},l.open("POST",g(e,t),!0),l.send()):console.log("No ajax URI given!")},w=function(){if(x()&&y())for(var e=document.querySelectorAll("[data-luxletter-wizardstatus]"),t=0;t1&&(a-=1)),[360*a,100*r,100*u]},a.rgb.hwb=function(t){var e=t[0],n=t[1],i=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,i))),100*(i=1-1/255*Math.max(e,Math.max(n,i)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-a)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var i=e[t];if(i)return i;var a,r,o,s=1/0;for(var l in n)if(n.hasOwnProperty(l)){var u=n[l],d=(r=t,o=u,Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)+Math.pow(r[2]-o[2],2));d.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],i=e[1],r=e[2];return i/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.hsl.rgb=function(t){var e,n,i,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[r=255*l,r,r];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(i=o+1/3*-(u-1))<0&&i++,i>1&&i--,r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*r;return a},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,i=t[2]/100,a=n,r=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,a*=r<=1?r:2-r,[e,100*(0===i?2*a/(r+a):2*n/(i+n)),100*((i+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r));switch(i*=255,a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}},a.hsv.hsl=function(t){var e,n,i,a=t[0],r=t[1]/100,o=t[2]/100,s=Math.max(o,.01);return i=(2-r)*o,n=r*s,[a,100*(n=(n/=(e=(2-r)*s)<=1?e:2-e)||0),100*(i/=2)]},a.hwb.rgb=function(t){var e,n,i,a,r,o,s,l=t[0]/360,u=t[1]/100,d=t[2]/100,h=u+d;switch(h>1&&(u/=h,d/=h),i=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(i=1-i),a=u+i*((n=1-d)-u),e){default:case 6:case 0:r=n,o=a,s=u;break;case 1:r=a,o=n,s=u;break;case 2:r=u,o=n,s=a;break;case 3:r=u,o=a,s=n;break;case 4:r=a,o=u,s=n;break;case 5:r=n,o=u,s=a}return[255*r,255*o,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,i=t[2]/100,a=t[3]/100;return[255*(1-Math.min(1,e*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a)),255*(1-Math.min(1,i*(1-a)+a))]},a.xyz.rgb=function(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return n=-.9689*a+1.8758*r+.0415*o,i=.0557*a+-.204*r+1.057*o,e=(e=3.2406*a+-1.5372*r+-.4986*o)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.lab.xyz=function(t){var e,n,i,a=t[0];e=t[1]/500+(n=(a+16)/116),i=n-t[2]/200;var r=Math.pow(n,3),o=Math.pow(e,3),s=Math.pow(i,3);return n=r>.008856?r:(n-16/116)/7.787,e=o>.008856?o:(e-16/116)/7.787,i=s>.008856?s:(i-16/116)/7.787,[e*=95.047,n*=100,i*=108.883]},a.lab.lch=function(t){var e,n=t[0],i=t[1],a=t[2];return(e=360*Math.atan2(a,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+a*a),e]},a.lch.lab=function(t){var e,n=t[0],i=t[1];return e=t[2]/360*2*Math.PI,[n,i*Math.cos(e),i*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],i=t[2],r=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],i=t[2];return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},a.rgb.hcg=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255,r=Math.max(Math.max(n,i),a),o=Math.min(Math.min(n,i),a),s=r-o;return e=s<=0?0:r===n?(i-a)/s%6:r===i?2+(a-n)/s:4+(n-i)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?o/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=1,a=0;return(i=n<.5?2*e*n:2*e*(1-n))<1&&(a=(n-.5*i)/(1-i)),[t[0],100*i,100*a]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=e*n,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100;if(0===n)return[255*i,255*i,255*i];var a,r=[0,0,0],o=e%1*6,s=o%1,l=1-s;switch(Math.floor(o)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=l,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=l,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=l}return a=(1-n)*i,[255*(n*r[0]+a),255*(n*r[1]+a),255*(n*r[2]+a)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),i=0;return n>0&&(i=e/n),[t[0],100*i,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],100*i,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,i=n-e,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}));i.rgb,i.hsl,i.hsv,i.hwb,i.cmyk,i.xyz,i.lab,i.lch,i.hex,i.keyword,i.ansi16,i.ansi256,i.hcg,i.apple,i.gray;function a(t){var e=function(){for(var t={},e=Object.keys(i),n=e.length,a=0;a1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var i=n.length,a=0;a1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)}))}));var l=s,u={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},d={getRgba:h,getHsla:c,getRgb:function(t){var e=h(t);return e&&e.slice(0,3)},getHsl:function(t){var e=c(t);return e&&e.slice(0,3)},getHwb:f,getAlpha:function(t){var e=h(t);if(e)return e[3];if(e=c(t))return e[3];if(e=f(t))return e[3]},hexString:function(t,e){e=void 0!==e&&3===t.length?e:t[3];return"#"+b(t[0])+b(t[1])+b(t[2])+(e>=0&&e<1?b(Math.round(255*e)):"")},rgbString:function(t,e){if(e<1||t[3]&&t[3]<1)return g(t,e);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:g,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return m(t,e);var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+n+"%, "+i+"%, "+a+"%)"},percentaString:m,hslString:function(t,e){if(e<1||t[3]&&t[3]<1)return p(t,e);return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:p,hwbString:function(t,e){void 0===e&&(e=void 0!==t[3]?t[3]:1);return"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return y[t.slice(0,3)]}};function h(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(i){a=(i=i[1])[3];for(var r=0;rn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=t,i=void 0===e?.5:e,a=2*i-1,r=this.alpha()-n.alpha(),o=((a*r==-1?a:(a+r)/(1+a*r))+1)/2,s=1-o;return this.rgb(o*this.red()+s*n.red(),o*this.green()+s*n.green(),o*this.blue()+s*n.blue()).alpha(this.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new _,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&(t=i[r],"[object Array]"===(e={}.toString.call(t))?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},_.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},_.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},_.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i=0;a--)e.call(n,t[a],a);else for(a=0;a=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-C.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*C.easeInBounce(2*t):.5*C.easeOutBounce(2*t-1)+.5}},P={effects:C};D.easingEffects=C;var T=Math.PI,O=T/180,A=2*T,F=T/2,I=T/4,L=2*T/3,R={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,r){if(r){var o=Math.min(r,a/2,i/2),s=e+o,l=n+o,u=e+i-o,d=n+a-o;t.moveTo(e,l),se.left-1e-6&&t.xe.top-1e-6&&t.y0&&this.requestAnimationFrame()},advance:function(){for(var t,e,n,i,a=this.animations,r=0;r=n?(B.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(r,1)):++r}},tt=B.options.resolve,et=["push","pop","shift","splice","unshift"];function nt(t,e){var n=t._chartjs;if(n){var i=n.listeners,a=i.indexOf(e);-1!==a&&i.splice(a,1),i.length>0||(et.forEach((function(e){delete t[e]})),delete t._chartjs)}}var it=function(t,e){this.initialize(t,e)};B.extend(it.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this.getMeta(),e=this.chart,n=e.scales,i=this.getDataset(),a=e.options.scales;null!==t.xAxisID&&t.xAxisID in n&&!i.xAxisID||(t.xAxisID=i.xAxisID||a.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in n&&!i.yAxisID||(t.yAxisID=i.yAxisID||a.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&nt(this._data,this)},createMetaDataset:function(){var t=this.datasetElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(t){var e=this.dataElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index,_index:t})},addElements:function(){var t,e,n=this.getMeta(),i=this.getDataset().data||[],a=n.data;for(t=0,e=i.length;tn&&this.insertElements(n,i-n)},insertElements:function(t,e){for(var n=0;na?(r=a/e.innerRadius,t.arc(o,s,e.innerRadius-a,i+r,n-r,!0)):t.arc(o,s,a,i+Math.PI/2,n-Math.PI/2),t.closePath(),t.clip()}function st(t,e,n){var i="inner"===e.borderAlign;i?(t.lineWidth=2*e.borderWidth,t.lineJoin="round"):(t.lineWidth=e.borderWidth,t.lineJoin="bevel"),n.fullCircles&&function(t,e,n,i){var a,r=n.endAngle;for(i&&(n.endAngle=n.startAngle+rt,ot(t,n),n.endAngle=r,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=rt,n.fullCircles--)),t.beginPath(),t.arc(n.x,n.y,n.innerRadius,n.startAngle+rt,n.startAngle,!0),a=0;as;)a-=rt;for(;a=o&&a<=s,u=r>=n.innerRadius&&r<=n.outerRadius;return l&&u}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/rt)};if(e.save(),e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+rt,e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),t=0;tt.x&&(e=yt(e,"left","right")):t.basen?n:i,r:l.right||a<0?0:a>e?e:a,b:l.bottom||r<0?0:r>n?n:r,l:l.left||o<0?0:o>e?e:o}}function _t(t,e,n){var i=null===e,a=null===n,r=!(!t||i&&a)&&bt(t);return r&&(i||e>=r.left&&e<=r.right)&&(a||n>=r.top&&n<=r.bottom)}Y._set("global",{elements:{rectangle:{backgroundColor:pt,borderColor:pt,borderSkipped:"bottom",borderWidth:0}}});var wt=X.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,n=function(t){var e=bt(t),n=e.right-e.left,i=e.bottom-e.top,a=xt(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:i-a.t-a.b}}}(e),i=n.outer,a=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(i.x,i.y,i.w,i.h),i.w===a.w&&i.h===a.h||(t.save(),t.beginPath(),t.rect(i.x,i.y,i.w,i.h),t.clip(),t.fillStyle=e.borderColor,t.rect(a.x,a.y,a.w,a.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return _t(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return vt(n)?_t(n,t,null):_t(n,null,e)},inXRange:function(t){return _t(this._view,t,null)},inYRange:function(t){return _t(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return vt(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return vt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),kt={},Mt=lt,St=ht,Dt=mt,Ct=wt;kt.Arc=Mt,kt.Line=St,kt.Point=Dt,kt.Rectangle=Ct;var Pt=B._deprecated,Tt=B.valueOrDefault;function Ot(t,e,n){var i,a,r=n.barThickness,o=e.stackCount,s=e.pixels[t],l=B.isNullOrUndef(r)?function(t,e){var n,i,a,r,o=t._length;for(a=1,r=e.length;a0?Math.min(o,Math.abs(i-n)):o,n=i;return o}(e.scale,e.pixels):-1;return B.isNullOrUndef(r)?(i=l*n.categoryPercentage,a=n.barPercentage):(i=r*o,a=1),{chunk:i/o,ratio:a,start:s-i/2}}Y._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),Y._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var At=at.extend({dataElementType:kt.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var t,e,n=this;at.prototype.initialize.apply(n,arguments),(t=n.getMeta()).stack=n.getDataset().stack,t.bar=!0,e=n._getIndexScale().options,Pt("bar chart",e.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),Pt("bar chart",e.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),Pt("bar chart",e.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),Pt("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),Pt("bar chart",e.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(t){var e,n,i=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,n=i.length;e=0&&m.min>=0?m.min:m.max,x=void 0===m.start?m.end:m.max>=0&&m.min>=0?m.max-m.min:m.min-m.max,_=g.length;if(v||void 0===v&&void 0!==b)for(i=0;i<_&&(a=g[i]).index!==t;++i)a.stack===b&&(r=void 0===(u=h._parseValue(f[a.index].data[e])).start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(m.min<0&&r<0||m.max>=0&&r>0)&&(y+=r));return o=h.getPixelForValue(y),l=(s=h.getPixelForValue(y+x))-o,void 0!==p&&Math.abs(l)=0&&!c||x<0&&c?o-p:o+p),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,n,i){var a="flex"===i.barThickness?function(t,e,n){var i,a=e.pixels,r=a[t],o=t>0?a[t-1]:null,s=t=Nt?-Wt:b<-Nt?Wt:0)+p,x=Math.cos(b),_=Math.sin(b),w=Math.cos(y),k=Math.sin(y),M=b<=0&&y>=0||y>=Wt,S=b<=Yt&&y>=Yt||y>=Wt+Yt,D=b<=-Yt&&y>=-Yt||y>=Nt+Yt,C=b===-Nt||y>=Nt?-1:Math.min(x,x*m,w,w*m),P=D?-1:Math.min(_,_*m,k,k*m),T=M?1:Math.max(x,x*m,w,w*m),O=S?1:Math.max(_,_*m,k,k*m);u=(T-C)/2,d=(O-P)/2,h=-(T+C)/2,c=-(O+P)/2}for(i=0,a=g.length;i0&&!isNaN(t)?Wt*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,i,a,r,o,s,l,u=0,d=this.chart;if(!t)for(e=0,n=d.data.datasets.length;e(u=s>u?s:u)?l:u);return u},setHoverStyle:function(t){var e=t._model,n=t._options,i=B.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Rt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Rt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Rt(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,n=0;n0&&Bt(l[t-1]._model,s)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=u(n.controlPointPreviousY,s.top,s.bottom)),t0&&(r=t.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(t,e){return re(t,e,{intersect:!1})},point:function(t,e){return ne(t,te(e,t))},nearest:function(t,e,n){var i=te(e,t);n.axis=n.axis||"xy";var a=ae(n.axis);return ie(t,i,n.intersect,a)},x:function(t,e,n){var i=te(e,t),a=[],r=!1;return ee(t,(function(t){t.inXRange(i.x)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a},y:function(t,e,n){var i=te(e,t),a=[],r=!1;return ee(t,(function(t){t.inYRange(i.y)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a}}},se=B.extend;function le(t,e){return B.where(t,(function(t){return t.pos===e}))}function ue(t,e){return t.sort((function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i.index-a.index:i.weight-a.weight}))}function de(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function he(t,e,n){var i,a,r=n.box,o=t.maxPadding;if(n.size&&(t[n.pos]-=n.size),n.size=n.horizontal?r.height:r.width,t[n.pos]+=n.size,r.getPadding){var s=r.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(i=e.outerWidth-de(o,t,"left","right"),a=e.outerHeight-de(o,t,"top","bottom"),i!==t.w||a!==t.h){t.w=i,t.h=a;var l=n.horizontal?[i,t.w]:[a,t.h];return!(l[0]===l[1]||isNaN(l[0])&&isNaN(l[1]))}}function ce(t,e){var n=e.maxPadding;function i(t){var i={left:0,top:0,right:0,bottom:0};return t.forEach((function(t){i[t]=Math.max(e[t],n[t])})),i}return i(t?["left","right"]:["top","bottom"])}function fe(t,e,n){var i,a,r,o,s,l,u=[];for(i=0,a=t.length;idiv{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}"}))&&me.default||me,be="$chartjs",ye="chartjs-size-monitor",xe="chartjs-render-monitor",_e="chartjs-render-animation",we=["animationstart","webkitAnimationStart"],ke={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function Me(t,e){var n=B.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var Se=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function De(t,e,n){t.addEventListener(e,n,Se)}function Ce(t,e,n){t.removeEventListener(e,n,Se)}function Pe(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function Te(t){var e=document.createElement("div");return e.className=t||"",e}function Oe(t,e,n){var i,a,r,o,s=t[be]||(t[be]={}),l=s.resizer=function(t){var e=Te(ye),n=Te(ye+"-expand"),i=Te(ye+"-shrink");n.appendChild(Te()),i.appendChild(Te()),e.appendChild(n),e.appendChild(i),e._reset=function(){n.scrollLeft=1e6,n.scrollTop=1e6,i.scrollLeft=1e6,i.scrollTop=1e6};var a=function(){e._reset(),t()};return De(n,"scroll",a.bind(n,"expand")),De(i,"scroll",a.bind(i,"shrink")),e}((i=function(){if(s.resizer){var i=n.options.maintainAspectRatio&&t.parentNode,a=i?i.clientWidth:0;e(Pe("resize",n)),i&&i.clientWidth0){var r=t[0];r.label?n=r.label:r.xLabel?n=r.xLabel:a>0&&r.index-1?t.split("\n"):t}function He(t){var e=Y.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:We(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:We(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:We(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:We(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:We(t.titleFontStyle,e.defaultFontStyle),titleFontSize:We(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:We(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:We(t.footerFontStyle,e.defaultFontStyle),footerFontSize:We(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Be(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function je(t){return Ee([],Ve(t))}var Ue=X.extend({initialize:function(){this._model=He(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options,n=e.callbacks,i=n.beforeTitle.apply(t,arguments),a=n.title.apply(t,arguments),r=n.afterTitle.apply(t,arguments),o=[];return o=Ee(o,Ve(i)),o=Ee(o,Ve(a)),o=Ee(o,Ve(r))},getBeforeBody:function(){return je(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,i=n._options.callbacks,a=[];return B.each(t,(function(t){var r={before:[],lines:[],after:[]};Ee(r.before,Ve(i.beforeLabel.call(n,t,e))),Ee(r.lines,i.label.call(n,t,e)),Ee(r.after,Ve(i.afterLabel.call(n,t,e))),a.push(r)})),a},getAfterBody:function(){return je(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),i=e.footer.apply(t,arguments),a=e.afterFooter.apply(t,arguments),r=[];return r=Ee(r,Ve(n)),r=Ee(r,Ve(i)),r=Ee(r,Ve(a))},update:function(t){var e,n,i,a,r,o,s,l,u,d,h=this,c=h._options,f=h._model,g=h._model=He(c),m=h._active,p=h._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},y={width:f.width,height:f.height},x={x:f.caretX,y:f.caretY};if(m.length){g.opacity=1;var _=[],w=[];x=ze[c.position].call(h,m,h._eventPosition);var k=[];for(e=0,n=m.length;ei.width&&(a=i.width-e.width),a<0&&(a=0)),"top"===d?r+=h:r-="bottom"===d?e.height+h:e.height/2,"center"===d?"left"===u?a+=h:"right"===u&&(a-=h):"left"===u?a-=c:"right"===u&&(a+=c),{x:a,y:r}}(g,y,v=function(t,e){var n,i,a,r,o,s=t._model,l=t._chart,u=t._chart.chartArea,d="center",h="center";s.yl.height-e.height&&(h="bottom");var c=(u.left+u.right)/2,f=(u.top+u.bottom)/2;"center"===h?(n=function(t){return t<=c},i=function(t){return t>c}):(n=function(t){return t<=e.width/2},i=function(t){return t>=l.width-e.width/2}),a=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},r=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=f?"top":"bottom"},n(s.x)?(d="left",a(s.x)&&(d="center",h=o(s.y))):i(s.x)&&(d="right",r(s.x)&&(d="center",h=o(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:d,yAlign:g.yAlign?g.yAlign:h}}(this,y),h._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=y.width,g.height=y.height,g.caretX=x.x,g.caretY=x.y,h._model=g,t&&c.custom&&c.custom.call(h,g),h},drawCaret:function(t,e){var n=this._chart.ctx,i=this._view,a=this.getCaretPosition(t,e,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,n){var i,a,r,o,s,l,u=n.caretSize,d=n.cornerRadius,h=n.xAlign,c=n.yAlign,f=t.x,g=t.y,m=e.width,p=e.height;if("center"===c)s=g+p/2,"left"===h?(a=(i=f)-u,r=i,o=s+u,l=s-u):(a=(i=f+m)+u,r=i,o=s-u,l=s+u);else if("left"===h?(i=(a=f+d+u)-u,r=a+u):"right"===h?(i=(a=f+m-d-u)-u,r=a+u):(i=(a=n.caretX)-u,r=a+u),"top"===c)s=(o=g)-u,l=o;else{s=(o=g+p)+u,l=o;var v=r;r=i,i=v}return{x1:i,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,e,n){var i,a,r,o=e.title,s=o.length;if(s){var l=Ye(e.rtl,e.x,e.width);for(t.x=Be(e,e._titleAlign),n.textAlign=l.textAlign(e._titleAlign),n.textBaseline="middle",i=e.titleFontSize,a=e.titleSpacing,n.fillStyle=e.titleFontColor,n.font=B.fontString(i,e._titleFontStyle,e._titleFontFamily),r=0;r0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity,r=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&r&&(t.save(),t.globalAlpha=a,this.drawBackground(i,e,t,n),i.y+=e.yPadding,B.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),B.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e,n=this,i=n._options;return n._lastActive=n._lastActive||[],"mouseout"===t.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(t,i.mode,i),i.reverse&&n._active.reverse()),(e=!B.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(i.enabled||i.custom)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0),n.pivot())),e}}),Ge=ze,qe=Ue;qe.positioners=Ge;var Ze=B.valueOrDefault;function $e(){return B.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){if("xAxes"===t||"yAxes"===t){var a,r,o,s=n[t].length;for(e[t]||(e[t]=[]),a=0;a=e[t].length&&e[t].push({}),!e[t][a].type||o.type&&o.type!==e[t][a].type?B.merge(e[t][a],[Ne.getScaleDefaults(r),o]):B.merge(e[t][a],o)}else B._merger(t,e,n,i)}})}function Xe(){return B.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){var a=e[t]||Object.create(null),r=n[t];"scales"===t?e[t]=$e(a,r):"scale"===t?e[t]=B.merge(a,[Ne.getScaleDefaults(r.type),r]):B._merger(t,e,n,i)}})}function Ke(t){var e=t.options;B.each(t.scales,(function(e){pe.removeBox(t,e)})),e=Xe(Y.global,Y[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function Je(t,e,n){var i,a=function(t){return t.id===i};do{i=e+n++}while(B.findIndex(t,a)>=0);return i}function Qe(t){return"top"===t||"bottom"===t}function tn(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}Y._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var en=function(t,e){return this.construct(t,e),this};B.extend(en.prototype,{construct:function(t,e){var n=this;e=function(t){var e=(t=t||Object.create(null)).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=Xe(Y.global,Y[t.type],t.options||{}),t}(e);var i=Le.acquireContext(t,e),a=i&&i.canvas,r=a&&a.height,o=a&&a.width;n.id=B.uid(),n.ctx=i,n.canvas=a,n.config=e,n.width=o,n.height=r,n.aspectRatio=r?o/r:null,n.options=e.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,en.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),i&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Re.notify(t,"beforeInit"),B.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),Re.notify(t,"afterInit"),t},clear:function(){return B.canvas.clear(this),this},stop:function(){return Q.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,a=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(B.getMaximumWidth(i))),o=Math.max(0,Math.floor(a?r/a:B.getMaximumHeight(i)));if((e.width!==r||e.height!==o)&&(i.width=e.width=r,i.height=e.height=o,i.style.width=r+"px",i.style.height=o+"px",B.retinaScale(e,n.devicePixelRatio),!t)){var s={width:r,height:o};Re.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;B.each(e.xAxes,(function(t,n){t.id||(t.id=Je(e.xAxes,"x-axis-",n))})),B.each(e.yAxes,(function(t,n){t.id||(t.id=Je(e.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},i=[],a=Object.keys(n).reduce((function(t,e){return t[e]=!1,t}),{});e.scales&&(i=i.concat((e.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(e.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),e.scale&&i.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),B.each(i,(function(e){var i=e.options,r=i.id,o=Ze(i.type,e.dtype);Qe(i.position)!==Qe(e.dposition)&&(i.position=e.dposition),a[r]=!0;var s=null;if(r in n&&n[r].type===o)(s=n[r]).options=i,s.ctx=t.ctx,s.chart=t;else{var l=Ne.getScaleConstructor(o);if(!l)return;s=new l({id:r,type:o,options:i,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)})),B.each(a,(function(t,e){t||delete n[e]})),t.scales=n,Ne.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,n=this,i=[],a=n.data.datasets;for(t=0,e=a.length;t=0;--n)this.drawDataset(e[n],t);Re.notify(this,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n={meta:t,index:t.index,easingValue:e};!1!==Re.notify(this,"beforeDatasetDraw",[n])&&(t.controller.draw(e),Re.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this.tooltip,n={tooltip:e,easingValue:t};!1!==Re.notify(this,"beforeTooltipDraw",[n])&&(e.draw(),Re.notify(this,"afterTooltipDraw",[n]))},getElementAtEvent:function(t){return oe.modes.single(this,t)},getElementsAtEvent:function(t){return oe.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return oe.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=oe.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return oe.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var n=e._meta[this.id];return n||(n=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e.order||0,index:t}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&t!==Math.floor(t)&&(i=t-Math.floor(t));var a=B.log10(Math.abs(i)),r="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=B.log10(Math.abs(t)),s=Math.floor(o)-Math.floor(a);s=Math.max(Math.min(s,20),0),r=t.toExponential(s)}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),r=t.toFixed(l)}else r="0";return r},logarithmic:function(t,e,n){var i=t/Math.pow(10,Math.floor(B.log10(t)));return 0===t?"0":1===i||2===i||5===i||0===e||e===n.length-1?t.toExponential():""}}},ln=B.isArray,un=B.isNullOrUndef,dn=B.valueOrDefault,hn=B.valueAtIndexOrDefault;function cn(t,e,n){var i,a=t.getTicks().length,r=Math.min(e,a-1),o=t.getPixelForTick(r),s=t._startPixel,l=t._endPixel;if(!(n&&(i=1===a?Math.max(o-s,l-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(r-1))/2,(o+=rl+1e-6)))return o}function fn(t,e,n,i){var a,r,o,s,l,u,d,h,c,f,g,m,p,v=n.length,b=[],y=[],x=[],_=0,w=0;for(a=0;ae){for(n=0;n=c||d<=1||!s.isHorizontal()?s.labelRotation=h:(e=(t=s._getLabelSizes()).widest.width,n=t.highest.height-t.highest.offset,i=Math.min(s.maxWidth,s.chart.width-e),e+6>(a=l.offset?s.maxWidth/d:i/(d-1))&&(a=i/(d-(l.offset?.5:1)),r=s.maxHeight-gn(l.gridLines)-u.padding-mn(l.scaleLabel),o=Math.sqrt(e*e+n*n),f=B.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/a,1)),Math.asin(Math.min(r/o,1))-Math.asin(n/o))),f=Math.max(h,Math.min(c,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){B.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){B.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=t.chart,i=t.options,a=i.ticks,r=i.scaleLabel,o=i.gridLines,s=t._isVisible(),l="bottom"===i.position,u=t.isHorizontal();if(u?e.width=t.maxWidth:s&&(e.width=gn(o)+mn(r)),u?s&&(e.height=gn(o)+mn(r)):e.height=t.maxHeight,a.display&&s){var d=vn(a),h=t._getLabelSizes(),c=h.first,f=h.last,g=h.widest,m=h.highest,p=.4*d.minor.lineHeight,v=a.padding;if(u){var b=0!==t.labelRotation,y=B.toRadians(t.labelRotation),x=Math.cos(y),_=Math.sin(y),w=_*g.width+x*(m.height-(b?m.offset:0))+(b?0:p);e.height=Math.min(t.maxHeight,e.height+w+v);var k,M,S=t.getPixelForTick(0)-t.left,D=t.right-t.getPixelForTick(t.getTicks().length-1);b?(k=l?x*c.width+_*c.offset:_*(c.height-c.offset),M=l?_*(f.height-f.offset):x*f.width+_*f.offset):(k=c.width/2,M=f.width/2),t.paddingLeft=Math.max((k-S)*t.width/(t.width-S),0)+3,t.paddingRight=Math.max((M-D)*t.width/(t.width-D),0)+3}else{var C=a.mirror?0:g.width+v+p;e.width=Math.min(t.maxWidth,e.width+C),t.paddingTop=c.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),u?(t.width=t._length=n.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){B.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(un(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},_convertTicksToLabels:function(t){var e,n,i,a=this;for(a.ticks=t.map((function(t){return t.value})),a.beforeTickToLabelConversion(),e=a.convertTicksToLabels(t)||a.ticks,a.afterTickToLabelConversion(),n=0,i=t.length;nn-1?null:this.getPixelForDecimal(t*i+(e?i/2:0))},getPixelForDecimal:function(t){return this._reversePixels&&(t=1-t),this._startPixel+t*this._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this.min,e=this.max;return this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0},_autoSkip:function(t){var e,n,i,a,r=this.options.ticks,o=this._length,s=r.maxTicksLimit||o/this._tickSize()+1,l=r.major.enabled?function(t){var e,n,i=[];for(e=0,n=t.length;es)return function(t,e,n){var i,a,r=0,o=e[0];for(n=Math.ceil(n),i=0;iu)return r;return Math.max(u,1)}(l,t,0,s),u>0){for(e=0,n=u-1;e1?(h-d)/(u-1):null,yn(t,i,B.isNullOrUndef(a)?0:d-a,d),yn(t,i,h,B.isNullOrUndef(a)?t.length:h+a),bn(t)}return yn(t,i),bn(t)},_tickSize:function(){var t=this.options.ticks,e=B.toRadians(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),a=this._getLabelSizes(),r=t.autoSkipPadding||0,o=a?a.widest.width+r:0,s=a?a.highest.height+r:0;return this.isHorizontal()?s*n>o*i?o/n:s/i:s*i=0&&(o=t),void 0!==r&&(t=n.indexOf(r))>=0&&(s=t),e.minIndex=o,e.maxIndex=s,e.min=n[o],e.max=n[s]},buildTicks:function(){var t=this._getLabels(),e=this.minIndex,n=this.maxIndex;this.ticks=0===e&&n===t.length-1?t:t.slice(e,n+1)},getLabelForIndex:function(t,e){var n=this.chart;return n.getDatasetMeta(e).controller._getValueScaleId()===this.id?this.getRightValue(n.data.datasets[e].data[t]):this._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,n=t.ticks;_n.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),n&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(n.length-(e?0:1),1))},getPixelForValue:function(t,e,n){var i,a,r,o=this;return wn(e)||wn(n)||(t=o.chart.data.datasets[n].data[e]),wn(t)||(i=o.isHorizontal()?t.x:t.y),(void 0!==i||void 0!==t&&isNaN(e))&&(a=o._getLabels(),t=B.valueOrDefault(i,t),e=-1!==(r=a.indexOf(t))?r:e,isNaN(e)&&(e=t)),o.getPixelForDecimal((e-o._startValue)/o._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange);return Math.min(Math.max(e,0),this.ticks.length-1)},getBasePixel:function(){return this.bottom}}),Mn={position:"bottom"};kn._defaults=Mn;var Sn=B.noop,Dn=B.isNullOrUndef;var Cn=_n.extend({getRightValue:function(t){return"string"==typeof t?+t:_n.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=B.sign(t.min),i=B.sign(t.max);n<0&&i<0?t.max=0:n>0&&i>0&&(t.min=0)}var a=void 0!==e.min||void 0!==e.suggestedMin,r=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),a!==r&&t.min>=t.max&&(a?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this.options.ticks,n=e.stepSize,i=e.maxTicksLimit;return n?t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1:(t=this._computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:Sn,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:B.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=function(t,e){var n,i,a,r,o=[],s=t.stepSize,l=s||1,u=t.maxTicks-1,d=t.min,h=t.max,c=t.precision,f=e.min,g=e.max,m=B.niceNum((g-f)/u/l)*l;if(m<1e-14&&Dn(d)&&Dn(h))return[f,g];(r=Math.ceil(g/m)-Math.floor(f/m))>u&&(m=B.niceNum(r*m/u/l)*l),s||Dn(c)?n=Math.pow(10,B._decimalPlaces(m)):(n=Math.pow(10,c),m=Math.ceil(m*n)/n),i=Math.floor(f/m)*m,a=Math.ceil(g/m)*m,s&&(!Dn(d)&&B.almostWhole(d/m,m/1e3)&&(i=d),!Dn(h)&&B.almostWhole(h/m,m/1e3)&&(a=h)),r=(a-i)/m,r=B.almostEquals(r,Math.round(r),m/1e3)?Math.round(r):Math.ceil(r),i=Math.round(i*n)/n,a=Math.round(a*n)/n,o.push(Dn(d)?i:d);for(var p=1;pe.length-1?null:this.getPixelForValue(e[t])}}),Fn=Pn;An._defaults=Fn;var In=B.valueOrDefault,Ln=B.math.log10;var Rn={position:"left",ticks:{callback:sn.formatters.logarithmic}};function Nn(t,e){return B.isFinite(t)&&t>=0?t:e}var Wn=_n.extend({determineDataLimits:function(){var t,e,n,i,a,r,o=this,s=o.options,l=o.chart,u=l.data.datasets,d=o.isHorizontal();function h(t){return d?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var c=s.stacked;if(void 0===c)for(t=0;t0){var e=B.min(t),n=B.max(t);o.min=Math.min(o.min,e),o.max=Math.max(o.max,n)}}))}else for(t=0;t0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(Ln(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),i={min:Nn(e.min),max:Nn(e.max)},a=t.ticks=function(t,e){var n,i,a=[],r=In(t.min,Math.pow(10,Math.floor(Ln(e.min)))),o=Math.floor(Ln(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===r?(n=Math.floor(Ln(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),a.push(r),r=i*Math.pow(10,n)):(n=Math.floor(Ln(r)),i=Math.floor(r/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{a.push(r),10===++i&&(i=1,l=++n>=0?1:l),r=Math.round(i*Math.pow(10,n)*l)/l}while(ne.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(Ln(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,n=0;_n.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),n=In(t.options.ticks.fontSize,Y.global.defaultFontSize)/t._length),t._startValue=Ln(e),t._valueOffset=n,t._valueRange=(Ln(t.max)-Ln(e))/(1-n)},getPixelForValue:function(t){var e=this,n=0;return(t=+e.getRightValue(t))>e.min&&t>0&&(n=(Ln(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(n)},getValueForPixel:function(t){var e=this,n=e.getDecimalForPixel(t);return 0===n&&0===e.min?0:Math.pow(10,e._startValue+(n-e._valueOffset)*e._valueRange)}}),Yn=Rn;Wn._defaults=Yn;var zn=B.valueOrDefault,En=B.valueAtIndexOrDefault,Vn=B.options.resolve,Hn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:sn.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function Bn(t){var e=t.ticks;return e.display&&t.display?zn(e.fontSize,Y.global.defaultFontSize)+2*e.backdropPaddingY:0}function jn(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:ta?{start:e-n,end:e}:{start:e,end:e+n}}function Un(t){return 0===t||180===t?"center":t<180?"left":"right"}function Gn(t,e,n,i){var a,r,o=n.y+i/2;if(B.isArray(e))for(a=0,r=e.length;a270||t<90)&&(n.y-=e.h)}function Zn(t){return B.isNumber(t)?t:0}var $n=Cn.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Bn(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;B.each(e.data.datasets,(function(a,r){if(e.isDatasetVisible(r)){var o=e.getDatasetMeta(r);B.each(a.data,(function(e,a){var r=+t.getRightValue(e);isNaN(r)||o.data[a].hidden||(n=Math.min(r,n),i=Math.max(r,i))}))}})),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Bn(this.options))},convertTicksToLabels:function(){var t=this;Cn.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map((function(){var e=B.callback(t.options.pointLabels.callback,arguments,t);return e||0===e?e:""}))},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){var e,n,i,a=B.options._parseFont(t.options.pointLabels),r={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=a.string,t._pointLabelSizes=[];var s,l,u,d=t.chart.data.labels.length;for(e=0;er.r&&(r.r=f.end,o.r=h),g.startr.b&&(r.b=g.end,o.b=h)}t.setReductions(t.drawingArea,r,o)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),r=Math.max(e.r-i.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);a=Zn(a),r=Zn(r),o=Zn(o),s=Zn(s),i.drawingArea=Math.min(Math.floor(t-(a+r)/2),Math.floor(t-(o+s)/2)),i.setCenterPoint(a,r,o,s)},setCenterPoint:function(t,e,n,i){var a=this,r=a.width-e-a.drawingArea,o=t+a.drawingArea,s=n+a.drawingArea,l=a.height-a.paddingTop-i-a.drawingArea;a.xCenter=Math.floor((o+r)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)},getIndexAngle:function(t){var e=this.chart,n=(t*(360/e.data.labels.length)+((e.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(B.isNullOrUndef(t))return NaN;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this.min,n=this.max;return this.getPointPositionForValue(t||0,this.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},_drawGrid:function(){var t,e,n,i=this,a=i.ctx,r=i.options,o=r.gridLines,s=r.angleLines,l=zn(s.lineWidth,o.lineWidth),u=zn(s.color,o.color);if(r.pointLabels.display&&function(t){var e=t.ctx,n=t.options,i=n.pointLabels,a=Bn(n),r=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),o=B.options._parseFont(i);e.save(),e.font=o.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=0===s?a/2:0,u=t.getPointPosition(s,r+l+5),d=En(i.fontColor,s,Y.global.defaultFontColor);e.fillStyle=d;var h=t.getIndexAngle(s),c=B.toDegrees(h);e.textAlign=Un(c),qn(c,t._pointLabelSizes[s],u),Gn(e,t.pointLabels[s],u,o.lineHeight)}e.restore()}(i),o.display&&B.each(i.ticks,(function(t,n){0!==n&&(e=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),function(t,e,n,i){var a,r=t.ctx,o=e.circular,s=t.chart.data.labels.length,l=En(e.color,i-1),u=En(e.lineWidth,i-1);if((o||s)&&l&&u){if(r.save(),r.strokeStyle=l,r.lineWidth=u,r.setLineDash&&(r.setLineDash(e.borderDash||[]),r.lineDashOffset=e.borderDashOffset||0),r.beginPath(),o)r.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{a=t.getPointPosition(0,n),r.moveTo(a.x,a.y);for(var d=1;d=0;t--)e=i.getDistanceFromCenterForValue(r.ticks.reverse?i.min:i.max),n=i.getPointPosition(t,e),a.beginPath(),a.moveTo(i.xCenter,i.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var t=this,e=t.ctx,n=t.options.ticks;if(n.display){var i,a,r=t.getIndexAngle(0),o=B.options._parseFont(n),s=zn(n.fontColor,Y.global.defaultFontColor);e.save(),e.font=o.string,e.translate(t.xCenter,t.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",B.each(t.ticks,(function(r,l){(0!==l||n.reverse)&&(i=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),n.showLabelBackdrop&&(a=e.measureText(r).width,e.fillStyle=n.backdropColor,e.fillRect(-a/2-n.backdropPaddingX,-i-o.size/2-n.backdropPaddingY,a+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),e.fillStyle=s,e.fillText(r,0,-i))})),e.restore()}},_drawTitle:B.noop}),Xn=Hn;$n._defaults=Xn;var Kn=B._deprecated,Jn=B.options.resolve,Qn=B.valueOrDefault,ti=Number.MIN_SAFE_INTEGER||-9007199254740991,ei=Number.MAX_SAFE_INTEGER||9007199254740991,ni={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ii=Object.keys(ni);function ai(t,e){return t-e}function ri(t){return B.valueOrDefault(t.time.min,t.ticks.min)}function oi(t){return B.valueOrDefault(t.time.max,t.ticks.max)}function si(t,e,n,i){var a=function(t,e,n){for(var i,a,r,o=0,s=t.length-1;o>=0&&o<=s;){if(a=t[(i=o+s>>1)-1]||null,r=t[i],!a)return{lo:null,hi:r};if(r[e]n))return{lo:a,hi:r};s=i-1}}return{lo:r,hi:null}}(t,e,n),r=a.lo?a.hi?a.lo:t[t.length-2]:t[0],o=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=o[e]-r[e],l=s?(n-r[e])/s:0,u=(o[i]-r[i])*l;return r[i]+u}function li(t,e){var n=t._adapter,i=t.options.time,a=i.parser,r=a||i.format,o=e;return"function"==typeof a&&(o=a(o)),B.isFinite(o)||(o="string"==typeof r?n.parse(o,r):n.parse(o)),null!==o?+o:(a||"function"!=typeof r||(o=r(e),B.isFinite(o)||(o=n.parse(o))),o)}function ui(t,e){if(B.isNullOrUndef(e))return null;var n=t.options.time,i=li(t,t.getRightValue(e));return null===i?i:(n.round&&(i=+t._adapter.startOf(i,n.round)),i)}function di(t,e,n,i){var a,r,o,s=ii.length;for(a=ii.indexOf(t);a=0&&(e[r].major=!0);return e}(t,r,o,n):r}var ci=_n.extend({initialize:function(){this.mergeTicksOptions(),_n.prototype.initialize.call(this)},update:function(){var t=this,e=t.options,n=e.time||(e.time={}),i=t._adapter=new on._date(e.adapters.date);return Kn("time scale",n.format,"time.format","time.parser"),Kn("time scale",n.min,"time.min","ticks.min"),Kn("time scale",n.max,"time.max","ticks.max"),B.mergeIf(n.displayFormats,i.formats()),_n.prototype.update.apply(t,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),_n.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,n,i,a,r,o,s=this,l=s.chart,u=s._adapter,d=s.options,h=d.time.unit||"day",c=ei,f=ti,g=[],m=[],p=[],v=s._getLabels();for(t=0,n=v.length;t1?function(t){var e,n,i,a={},r=[];for(e=0,n=t.length;e1e5*u)throw e+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(a=h;a=a&&n<=r&&d.push(n);return i.min=a,i.max=r,i._unit=l.unit||(s.autoSkip?di(l.minUnit,i.min,i.max,h):function(t,e,n,i,a){var r,o;for(r=ii.length-1;r>=ii.indexOf(n);r--)if(o=ii[r],ni[o].common&&t._adapter.diff(a,i,o)>=e-1)return o;return ii[n?ii.indexOf(n):0]}(i,d.length,l.minUnit,i.min,i.max)),i._majorUnit=s.major.enabled&&"year"!==i._unit?function(t){for(var e=ii.indexOf(t)+1,n=ii.length;ee&&s=0&&t0?s:1}}),fi={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};ci._defaults=fi;var gi={category:kn,linear:An,logarithmic:Wn,radialLinear:$n,time:ci},mi=e((function(e,n){e.exports=function(){var n,i;function a(){return n.apply(null,arguments)}function r(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function o(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t){return void 0===t}function l(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function u(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function d(t,e){var n,i=[];for(n=0;n>>0,i=0;i0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+i}var E=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,V=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,H={},B={};function j(t,e,n,i){var a=i;"string"==typeof i&&(a=function(){return this[i]()}),t&&(B[t]=a),e&&(B[e[0]]=function(){return z(a.apply(this,arguments),e[1],e[2])}),n&&(B[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function U(t,e){return t.isValid()?(e=G(e,t.localeData()),H[e]=H[e]||function(t){var e,n,i,a=t.match(E);for(e=0,n=a.length;e=0&&V.test(t);)t=t.replace(V,i),V.lastIndex=0,n-=1;return t}var q=/\d/,Z=/\d\d/,$=/\d{3}/,X=/\d{4}/,K=/[+-]?\d{6}/,J=/\d\d?/,Q=/\d\d\d\d?/,tt=/\d\d\d\d\d\d?/,et=/\d{1,3}/,nt=/\d{1,4}/,it=/[+-]?\d{1,6}/,at=/\d+/,rt=/[+-]?\d+/,ot=/Z|[+-]\d\d:?\d\d/gi,st=/Z|[+-]\d\d(?::?\d\d)?/gi,lt=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ut={};function dt(t,e,n){ut[t]=O(e)?e:function(t,i){return t&&n?n:e}}function ht(t,e){return h(ut,t)?ut[t](e._strict,e._locale):new RegExp(ct(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,n,i,a){return e||n||i||a}))))}function ct(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ft={};function gt(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),l(e)&&(i=function(t,n){n[e]=k(t)}),n=0;n68?1900:2e3)};var Pt,Tt=Ot("FullYear",!0);function Ot(t,e){return function(n){return null!=n?(Ft(this,t,n),a.updateOffset(this,e),this):At(this,t)}}function At(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function Ft(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&&Ct(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),It(n,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function It(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=function(t,e){return(t%e+e)%e}(e,12);return t+=(e-n)/12,1===n?Ct(t)?29:28:31-n%7%2}Pt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e=0?(s=new Date(t+400,e,n,i,a,r,o),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,n,i,a,r,o),s}function jt(t){var e;if(t<100&&t>=0){var n=Array.prototype.slice.call(arguments);n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function Ut(t,e,n){var i=7+e-n;return-(7+jt(t,0,i).getUTCDay()-e)%7+i-1}function Gt(t,e,n,i,a){var r,o,s=1+7*(e-1)+(7+n-i)%7+Ut(t,i,a);return s<=0?o=Dt(r=t-1)+s:s>Dt(t)?(r=t+1,o=s-Dt(t)):(r=t,o=s),{year:r,dayOfYear:o}}function qt(t,e,n){var i,a,r=Ut(t.year(),e,n),o=Math.floor((t.dayOfYear()-r-1)/7)+1;return o<1?i=o+Zt(a=t.year()-1,e,n):o>Zt(t.year(),e,n)?(i=o-Zt(t.year(),e,n),a=t.year()+1):(a=t.year(),i=o),{week:i,year:a}}function Zt(t,e,n){var i=Ut(t,e,n),a=Ut(t+1,e,n);return(Dt(t)-i+a)/7}function $t(t,e){return t.slice(e,7).concat(t.slice(0,e))}j("w",["ww",2],"wo","week"),j("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),Y("week",5),Y("isoWeek",5),dt("w",J),dt("ww",J,Z),dt("W",J),dt("WW",J,Z),mt(["w","ww","W","WW"],(function(t,e,n,i){e[i.substr(0,1)]=k(t)})),j("d",0,"do","day"),j("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),j("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),j("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),j("e",0,0,"weekday"),j("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),Y("day",11),Y("weekday",11),Y("isoWeekday",11),dt("d",J),dt("e",J),dt("E",J),dt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),dt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),dt("dddd",(function(t,e){return e.weekdaysRegex(t)})),mt(["dd","ddd","dddd"],(function(t,e,n,i){var a=n._locale.weekdaysParse(t,i,n._strict);null!=a?e.d=a:g(n).invalidWeekday=t})),mt(["d","e","E"],(function(t,e,n,i){e[i]=k(t)}));var Xt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Kt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Jt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Qt(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)r=f([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(a=Pt.call(this._weekdaysParse,o))?a:null:"ddd"===e?-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:null:"dddd"===e?-1!==(a=Pt.call(this._weekdaysParse,o))?a:-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:null:"ddd"===e?-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:-1!==(a=Pt.call(this._weekdaysParse,o))?a:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:null:-1!==(a=Pt.call(this._minWeekdaysParse,o))?a:-1!==(a=Pt.call(this._weekdaysParse,o))?a:-1!==(a=Pt.call(this._shortWeekdaysParse,o))?a:null}var te=lt,ee=lt,ne=lt;function ie(){function t(t,e){return e.length-t.length}var e,n,i,a,r,o=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=f([2e3,1]).day(e),i=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),r=this.weekdays(n,""),o.push(i),s.push(a),l.push(r),u.push(i),u.push(a),u.push(r);for(o.sort(t),s.sort(t),l.sort(t),u.sort(t),e=0;e<7;e++)s[e]=ct(s[e]),l[e]=ct(l[e]),u[e]=ct(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function ae(){return this.hours()%12||12}function re(t,e){j(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function oe(t,e){return e._meridiemParse}j("H",["HH",2],0,"hour"),j("h",["hh",2],0,ae),j("k",["kk",2],0,(function(){return this.hours()||24})),j("hmm",0,0,(function(){return""+ae.apply(this)+z(this.minutes(),2)})),j("hmmss",0,0,(function(){return""+ae.apply(this)+z(this.minutes(),2)+z(this.seconds(),2)})),j("Hmm",0,0,(function(){return""+this.hours()+z(this.minutes(),2)})),j("Hmmss",0,0,(function(){return""+this.hours()+z(this.minutes(),2)+z(this.seconds(),2)})),re("a",!0),re("A",!1),L("hour","h"),Y("hour",13),dt("a",oe),dt("A",oe),dt("H",J),dt("h",J),dt("k",J),dt("HH",J,Z),dt("hh",J,Z),dt("kk",J,Z),dt("hmm",Q),dt("hmmss",tt),dt("Hmm",Q),dt("Hmmss",tt),gt(["H","HH"],xt),gt(["k","kk"],(function(t,e,n){var i=k(t);e[xt]=24===i?0:i})),gt(["a","A"],(function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t})),gt(["h","hh"],(function(t,e,n){e[xt]=k(t),g(n).bigHour=!0})),gt("hmm",(function(t,e,n){var i=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i)),g(n).bigHour=!0})),gt("hmmss",(function(t,e,n){var i=t.length-4,a=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i,2)),e[wt]=k(t.substr(a)),g(n).bigHour=!0})),gt("Hmm",(function(t,e,n){var i=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i))})),gt("Hmmss",(function(t,e,n){var i=t.length-4,a=t.length-2;e[xt]=k(t.substr(0,i)),e[_t]=k(t.substr(i,2)),e[wt]=k(t.substr(a))}));var se,le=Ot("Hours",!0),ue={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Rt,monthsShort:Nt,week:{dow:0,doy:6},weekdays:Xt,weekdaysMin:Jt,weekdaysShort:Kt,meridiemParse:/[ap]\.?m?\.?/i},de={},he={};function ce(t){return t?t.toLowerCase().replace("_","-"):t}function fe(n){var i=null;if(!de[n]&&e&&e.exports)try{i=se._abbr,t(),ge(i)}catch(t){}return de[n]}function ge(t,e){var n;return t&&((n=s(e)?pe(t):me(t,e))?se=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),se._abbr}function me(t,e){if(null!==e){var n,i=ue;if(e.abbr=t,null!=de[t])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=de[t]._config;else if(null!=e.parentLocale)if(null!=de[e.parentLocale])i=de[e.parentLocale]._config;else{if(null==(n=fe(e.parentLocale)))return he[e.parentLocale]||(he[e.parentLocale]=[]),he[e.parentLocale].push({name:t,config:e}),null;i=n._config}return de[t]=new F(A(i,e)),he[t]&&he[t].forEach((function(t){me(t.name,t.config)})),ge(t),de[t]}return delete de[t],null}function pe(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return se;if(!r(t)){if(e=fe(t))return e;t=[t]}return function(t){for(var e,n,i,a,r=0;r0;){if(i=fe(a.slice(0,e).join("-")))return i;if(n&&n.length>=e&&M(a,n,!0)>=e-1)break;e--}r++}return se}(t)}function ve(t){var e,n=t._a;return n&&-2===g(t).overflow&&(e=n[bt]<0||n[bt]>11?bt:n[yt]<1||n[yt]>It(n[vt],n[bt])?yt:n[xt]<0||n[xt]>24||24===n[xt]&&(0!==n[_t]||0!==n[wt]||0!==n[kt])?xt:n[_t]<0||n[_t]>59?_t:n[wt]<0||n[wt]>59?wt:n[kt]<0||n[kt]>999?kt:-1,g(t)._overflowDayOfYear&&(eyt)&&(e=yt),g(t)._overflowWeeks&&-1===e&&(e=Mt),g(t)._overflowWeekday&&-1===e&&(e=St),g(t).overflow=e),t}function be(t,e,n){return null!=t?t:null!=e?e:n}function ye(t){var e,n,i,r,o,s=[];if(!t._d){for(i=function(t){var e=new Date(a.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[yt]&&null==t._a[bt]&&function(t){var e,n,i,a,r,o,s,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)r=1,o=4,n=be(e.GG,t._a[vt],qt(Le(),1,4).year),i=be(e.W,1),((a=be(e.E,1))<1||a>7)&&(l=!0);else{r=t._locale._week.dow,o=t._locale._week.doy;var u=qt(Le(),r,o);n=be(e.gg,t._a[vt],u.year),i=be(e.w,u.week),null!=e.d?((a=e.d)<0||a>6)&&(l=!0):null!=e.e?(a=e.e+r,(e.e<0||e.e>6)&&(l=!0)):a=r}i<1||i>Zt(n,r,o)?g(t)._overflowWeeks=!0:null!=l?g(t)._overflowWeekday=!0:(s=Gt(n,i,a,r,o),t._a[vt]=s.year,t._dayOfYear=s.dayOfYear)}(t),null!=t._dayOfYear&&(o=be(t._a[vt],i[vt]),(t._dayOfYear>Dt(o)||0===t._dayOfYear)&&(g(t)._overflowDayOfYear=!0),n=jt(o,0,t._dayOfYear),t._a[bt]=n.getUTCMonth(),t._a[yt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=i[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[xt]&&0===t._a[_t]&&0===t._a[wt]&&0===t._a[kt]&&(t._nextDay=!0,t._a[xt]=0),t._d=(t._useUTC?jt:Bt).apply(null,s),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[xt]=24),t._w&&void 0!==t._w.d&&t._w.d!==r&&(g(t).weekdayMismatch=!0)}}var xe=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_e=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,we=/Z|[+-]\d\d(?::?\d\d)?/,ke=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Me=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Se=/^\/?Date\((\-?\d+)/i;function De(t){var e,n,i,a,r,o,s=t._i,l=xe.exec(s)||_e.exec(s);if(l){for(g(t).iso=!0,e=0,n=ke.length;e0&&g(t).unusedInput.push(o),s=s.slice(s.indexOf(n)+n.length),u+=n.length),B[r]?(n?g(t).empty=!1:g(t).unusedTokens.push(r),pt(r,n,t)):t._strict&&!n&&g(t).unusedTokens.push(r);g(t).charsLeftOver=l-u,s.length>0&&g(t).unusedInput.push(s),t._a[xt]<=12&&!0===g(t).bigHour&&t._a[xt]>0&&(g(t).bigHour=void 0),g(t).parsedDateParts=t._a.slice(0),g(t).meridiem=t._meridiem,t._a[xt]=function(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((i=t.isPM(n))&&e<12&&(e+=12),i||12!==e||(e=0),e):e}(t._locale,t._a[xt],t._meridiem),ye(t),ve(t)}else Oe(t);else De(t)}function Fe(t){var e=t._i,n=t._f;return t._locale=t._locale||pe(t._l),null===e||void 0===n&&""===e?p({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),_(e)?new x(ve(e)):(u(e)?t._d=e:r(n)?function(t){var e,n,i,a,r;if(0===t._f.length)return g(t).invalidFormat=!0,void(t._d=new Date(NaN));for(a=0;athis?this:t:p()}));function We(t,e){var n,i;if(1===e.length&&r(e[0])&&(e=e[0]),!e.length)return Le();for(n=e[0],i=1;i=0?new Date(t+400,e,n)-hn:new Date(t,e,n).valueOf()}function gn(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-hn:Date.UTC(t,e,n)}function mn(t,e){j(0,[t,t.length],0,e)}function pn(t,e,n,i,a){var r;return null==t?qt(this,i,a).year:(e>(r=Zt(t,i,a))&&(e=r),vn.call(this,t,e,n,i,a))}function vn(t,e,n,i,a){var r=Gt(t,e,n,i,a),o=jt(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}j(0,["gg",2],0,(function(){return this.weekYear()%100})),j(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),mn("gggg","weekYear"),mn("ggggg","weekYear"),mn("GGGG","isoWeekYear"),mn("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),Y("weekYear",1),Y("isoWeekYear",1),dt("G",rt),dt("g",rt),dt("GG",J,Z),dt("gg",J,Z),dt("GGGG",nt,X),dt("gggg",nt,X),dt("GGGGG",it,K),dt("ggggg",it,K),mt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,n,i){e[i.substr(0,2)]=k(t)})),mt(["gg","GG"],(function(t,e,n,i){e[i]=a.parseTwoDigitYear(t)})),j("Q",0,"Qo","quarter"),L("quarter","Q"),Y("quarter",7),dt("Q",q),gt("Q",(function(t,e){e[bt]=3*(k(t)-1)})),j("D",["DD",2],"Do","date"),L("date","D"),Y("date",9),dt("D",J),dt("DD",J,Z),dt("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),gt(["D","DD"],yt),gt("Do",(function(t,e){e[yt]=k(t.match(J)[0])}));var bn=Ot("Date",!0);j("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),Y("dayOfYear",4),dt("DDD",et),dt("DDDD",$),gt(["DDD","DDDD"],(function(t,e,n){n._dayOfYear=k(t)})),j("m",["mm",2],0,"minute"),L("minute","m"),Y("minute",14),dt("m",J),dt("mm",J,Z),gt(["m","mm"],_t);var yn=Ot("Minutes",!1);j("s",["ss",2],0,"second"),L("second","s"),Y("second",15),dt("s",J),dt("ss",J,Z),gt(["s","ss"],wt);var xn,_n=Ot("Seconds",!1);for(j("S",0,0,(function(){return~~(this.millisecond()/100)})),j(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),j(0,["SSS",3],0,"millisecond"),j(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),j(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),j(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),j(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),j(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),j(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),L("millisecond","ms"),Y("millisecond",16),dt("S",et,q),dt("SS",et,Z),dt("SSS",et,$),xn="SSSS";xn.length<=9;xn+="S")dt(xn,at);function wn(t,e){e[kt]=k(1e3*("0."+t))}for(xn="S";xn.length<=9;xn+="S")gt(xn,wn);var kn=Ot("Milliseconds",!1);j("z",0,0,"zoneAbbr"),j("zz",0,0,"zoneName");var Mn=x.prototype;function Sn(t){return t}Mn.add=en,Mn.calendar=function(t,e){var n=t||Le(),i=Ue(n,this).startOf("day"),r=a.calendarFormat(this,i)||"sameElse",o=e&&(O(e[r])?e[r].call(this,n):e[r]);return this.format(o||this.localeData().calendar(r,this,Le(n)))},Mn.clone=function(){return new x(this)},Mn.diff=function(t,e,n){var i,a,r;if(!this.isValid())return NaN;if(!(i=Ue(t,this)).isValid())return NaN;switch(a=6e4*(i.utcOffset()-this.utcOffset()),e=R(e)){case"year":r=an(this,i)/12;break;case"month":r=an(this,i);break;case"quarter":r=an(this,i)/3;break;case"second":r=(this-i)/1e3;break;case"minute":r=(this-i)/6e4;break;case"hour":r=(this-i)/36e5;break;case"day":r=(this-i-a)/864e5;break;case"week":r=(this-i-a)/6048e5;break;default:r=this-i}return n?r:w(r)},Mn.endOf=function(t){var e;if(void 0===(t=R(t))||"millisecond"===t||!this.isValid())return this;var n=this._isUTC?gn:fn;switch(t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=dn-cn(e+(this._isUTC?0:this.utcOffset()*un),dn)-1;break;case"minute":e=this._d.valueOf(),e+=un-cn(e,un)-1;break;case"second":e=this._d.valueOf(),e+=ln-cn(e,ln)-1}return this._d.setTime(e),a.updateOffset(this,!0),this},Mn.format=function(t){t||(t=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var e=U(this,t);return this.localeData().postformat(e)},Mn.from=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||Le(t).isValid())?Xe({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Mn.fromNow=function(t){return this.from(Le(),t)},Mn.to=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||Le(t).isValid())?Xe({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Mn.toNow=function(t){return this.to(Le(),t)},Mn.get=function(t){return O(this[t=R(t)])?this[t]():this},Mn.invalidAt=function(){return g(this).overflow},Mn.isAfter=function(t,e){var n=_(t)?t:Le(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=R(e)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()9999?U(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",U(n,"Z")):U(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Mn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a=e+'[")]';return this.format(n+i+"-MM-DD[T]HH:mm:ss.SSS"+a)},Mn.toJSON=function(){return this.isValid()?this.toISOString():null},Mn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Mn.unix=function(){return Math.floor(this.valueOf()/1e3)},Mn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Mn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Mn.year=Tt,Mn.isLeapYear=function(){return Ct(this.year())},Mn.weekYear=function(t){return pn.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},Mn.isoWeekYear=function(t){return pn.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},Mn.quarter=Mn.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},Mn.month=zt,Mn.daysInMonth=function(){return It(this.year(),this.month())},Mn.week=Mn.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},Mn.isoWeek=Mn.isoWeeks=function(t){var e=qt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},Mn.weeksInYear=function(){var t=this.localeData()._week;return Zt(this.year(),t.dow,t.doy)},Mn.isoWeeksInYear=function(){return Zt(this.year(),1,4)},Mn.date=bn,Mn.day=Mn.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},Mn.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},Mn.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},Mn.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},Mn.hour=Mn.hours=le,Mn.minute=Mn.minutes=yn,Mn.second=Mn.seconds=_n,Mn.millisecond=Mn.milliseconds=kn,Mn.utcOffset=function(t,e,n){var i,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=je(st,t)))return this}else Math.abs(t)<16&&!n&&(t*=60);return!this._isUTC&&e&&(i=Ge(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?tn(this,Xe(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Ge(this)},Mn.utc=function(t){return this.utcOffset(0,t)},Mn.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ge(this),"m")),this},Mn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=je(ot,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},Mn.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Le(t).utcOffset():0,(this.utcOffset()-t)%60==0)},Mn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Mn.isLocal=function(){return!!this.isValid()&&!this._isUTC},Mn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Mn.isUtc=qe,Mn.isUTC=qe,Mn.zoneAbbr=function(){return this._isUTC?"UTC":""},Mn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Mn.dates=D("dates accessor is deprecated. Use date instead.",bn),Mn.months=D("months accessor is deprecated. Use month instead",zt),Mn.years=D("years accessor is deprecated. Use year instead",Tt),Mn.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),Mn.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var t={};if(b(t,this),(t=Fe(t))._a){var e=t._isUTC?f(t._a):Le(t._a);this._isDSTShifted=this.isValid()&&M(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var Dn=F.prototype;function Cn(t,e,n,i){var a=pe(),r=f().set(i,e);return a[n](r,t)}function Pn(t,e,n){if(l(t)&&(e=t,t=void 0),t=t||"",null!=e)return Cn(t,e,n,"month");var i,a=[];for(i=0;i<12;i++)a[i]=Cn(t,i,n,"month");return a}function Tn(t,e,n,i){"boolean"==typeof t?(l(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,l(e)&&(n=e,e=void 0),e=e||"");var a,r=pe(),o=t?r._week.dow:0;if(null!=n)return Cn(e,(n+o)%7,i,"day");var s=[];for(a=0;a<7;a++)s[a]=Cn(e,(a+o)%7,i,"day");return s}Dn.calendar=function(t,e,n){var i=this._calendar[t]||this._calendar.sameElse;return O(i)?i.call(e,n):i},Dn.longDateFormat=function(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,(function(t){return t.slice(1)})),this._longDateFormat[t])},Dn.invalidDate=function(){return this._invalidDate},Dn.ordinal=function(t){return this._ordinal.replace("%d",t)},Dn.preparse=Sn,Dn.postformat=Sn,Dn.relativeTime=function(t,e,n,i){var a=this._relativeTime[n];return O(a)?a(t,e,n,i):a.replace(/%d/i,t)},Dn.pastFuture=function(t,e){var n=this._relativeTime[t>0?"future":"past"];return O(n)?n(e):n.replace(/%s/i,e)},Dn.set=function(t){var e,n;for(n in t)O(e=t[n])?this[n]=e:this["_"+n]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Dn.months=function(t,e){return t?r(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Lt).test(e)?"format":"standalone"][t.month()]:r(this._months)?this._months:this._months.standalone},Dn.monthsShort=function(t,e){return t?r(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Lt.test(e)?"format":"standalone"][t.month()]:r(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Dn.monthsParse=function(t,e,n){var i,a,r;if(this._monthsParseExact)return Wt.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(a=f([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(r="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[i]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}},Dn.monthsRegex=function(t){return this._monthsParseExact?(h(this,"_monthsRegex")||Ht.call(this),t?this._monthsStrictRegex:this._monthsRegex):(h(this,"_monthsRegex")||(this._monthsRegex=Vt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},Dn.monthsShortRegex=function(t){return this._monthsParseExact?(h(this,"_monthsRegex")||Ht.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(h(this,"_monthsShortRegex")||(this._monthsShortRegex=Et),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},Dn.week=function(t){return qt(t,this._week.dow,this._week.doy).week},Dn.firstDayOfYear=function(){return this._week.doy},Dn.firstDayOfWeek=function(){return this._week.dow},Dn.weekdays=function(t,e){var n=r(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?$t(n,this._week.dow):t?n[t.day()]:n},Dn.weekdaysMin=function(t){return!0===t?$t(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},Dn.weekdaysShort=function(t){return!0===t?$t(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},Dn.weekdaysParse=function(t,e,n){var i,a,r;if(this._weekdaysParseExact)return Qt.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(a=f([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(r="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[i]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}},Dn.weekdaysRegex=function(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(h(this,"_weekdaysRegex")||(this._weekdaysRegex=te),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},Dn.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(h(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ee),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Dn.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||ie.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(h(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ne),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Dn.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},Dn.meridiem=function(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"},ge("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===k(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),a.lang=D("moment.lang is deprecated. Use moment.locale instead.",ge),a.langData=D("moment.langData is deprecated. Use moment.localeData instead.",pe);var On=Math.abs;function An(t,e,n,i){var a=Xe(e,n);return t._milliseconds+=i*a._milliseconds,t._days+=i*a._days,t._months+=i*a._months,t._bubble()}function Fn(t){return t<0?Math.floor(t):Math.ceil(t)}function In(t){return 4800*t/146097}function Ln(t){return 146097*t/4800}function Rn(t){return function(){return this.as(t)}}var Nn=Rn("ms"),Wn=Rn("s"),Yn=Rn("m"),zn=Rn("h"),En=Rn("d"),Vn=Rn("w"),Hn=Rn("M"),Bn=Rn("Q"),jn=Rn("y");function Un(t){return function(){return this.isValid()?this._data[t]:NaN}}var Gn=Un("milliseconds"),qn=Un("seconds"),Zn=Un("minutes"),$n=Un("hours"),Xn=Un("days"),Kn=Un("months"),Jn=Un("years"),Qn=Math.round,ti={ss:44,s:45,m:45,h:22,d:26,M:11};function ei(t,e,n,i,a){return a.relativeTime(e||1,!!n,t,i)}var ni=Math.abs;function ii(t){return(t>0)-(t<0)||+t}function ai(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n=ni(this._milliseconds)/1e3,i=ni(this._days),a=ni(this._months);t=w(n/60),e=w(t/60),n%=60,t%=60;var r=w(a/12),o=a%=12,s=i,l=e,u=t,d=n?n.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var c=h<0?"-":"",f=ii(this._months)!==ii(h)?"-":"",g=ii(this._days)!==ii(h)?"-":"",m=ii(this._milliseconds)!==ii(h)?"-":"";return c+"P"+(r?f+r+"Y":"")+(o?f+o+"M":"")+(s?g+s+"D":"")+(l||u||d?"T":"")+(l?m+l+"H":"")+(u?m+u+"M":"")+(d?m+d+"S":"")}var ri=ze.prototype;return ri.isValid=function(){return this._isValid},ri.abs=function(){var t=this._data;return this._milliseconds=On(this._milliseconds),this._days=On(this._days),this._months=On(this._months),t.milliseconds=On(t.milliseconds),t.seconds=On(t.seconds),t.minutes=On(t.minutes),t.hours=On(t.hours),t.months=On(t.months),t.years=On(t.years),this},ri.add=function(t,e){return An(this,t,e,1)},ri.subtract=function(t,e){return An(this,t,e,-1)},ri.as=function(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if("month"===(t=R(t))||"quarter"===t||"year"===t)switch(e=this._days+i/864e5,n=this._months+In(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(Ln(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}},ri.asMilliseconds=Nn,ri.asSeconds=Wn,ri.asMinutes=Yn,ri.asHours=zn,ri.asDays=En,ri.asWeeks=Vn,ri.asMonths=Hn,ri.asQuarters=Bn,ri.asYears=jn,ri.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},ri._bubble=function(){var t,e,n,i,a,r=this._milliseconds,o=this._days,s=this._months,l=this._data;return r>=0&&o>=0&&s>=0||r<=0&&o<=0&&s<=0||(r+=864e5*Fn(Ln(s)+o),o=0,s=0),l.milliseconds=r%1e3,t=w(r/1e3),l.seconds=t%60,e=w(t/60),l.minutes=e%60,n=w(e/60),l.hours=n%24,o+=w(n/24),a=w(In(o)),s+=a,o-=Fn(Ln(a)),i=w(s/12),s%=12,l.days=o,l.months=s,l.years=i,this},ri.clone=function(){return Xe(this)},ri.get=function(t){return t=R(t),this.isValid()?this[t+"s"]():NaN},ri.milliseconds=Gn,ri.seconds=qn,ri.minutes=Zn,ri.hours=$n,ri.days=Xn,ri.weeks=function(){return w(this.days()/7)},ri.months=Kn,ri.years=Jn,ri.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),n=function(t,e,n){var i=Xe(t).abs(),a=Qn(i.as("s")),r=Qn(i.as("m")),o=Qn(i.as("h")),s=Qn(i.as("d")),l=Qn(i.as("M")),u=Qn(i.as("y")),d=a<=ti.ss&&["s",a]||a0,d[4]=n,ei.apply(null,d)}(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)},ri.toISOString=ai,ri.toString=ai,ri.toJSON=ai,ri.locale=rn,ri.localeData=sn,ri.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ai),ri.lang=on,j("X",0,0,"unix"),j("x",0,0,"valueOf"),dt("x",rt),dt("X",/[+-]?\d+(\.\d{1,3})?/),gt("X",(function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))})),gt("x",(function(t,e,n){n._d=new Date(k(t))})),a.version="2.24.0",n=Le,a.fn=Mn,a.min=function(){return We("isBefore",[].slice.call(arguments,0))},a.max=function(){return We("isAfter",[].slice.call(arguments,0))},a.now=function(){return Date.now?Date.now():+new Date},a.utc=f,a.unix=function(t){return Le(1e3*t)},a.months=function(t,e){return Pn(t,e,"months")},a.isDate=u,a.locale=ge,a.invalid=p,a.duration=Xe,a.isMoment=_,a.weekdays=function(t,e,n){return Tn(t,e,n,"weekdays")},a.parseZone=function(){return Le.apply(null,arguments).parseZone()},a.localeData=pe,a.isDuration=Ee,a.monthsShort=function(t,e){return Pn(t,e,"monthsShort")},a.weekdaysMin=function(t,e,n){return Tn(t,e,n,"weekdaysMin")},a.defineLocale=me,a.updateLocale=function(t,e){if(null!=e){var n,i,a=ue;null!=(i=fe(t))&&(a=i._config),e=A(a,e),(n=new F(e)).parentLocale=de[t],de[t]=n,ge(t)}else null!=de[t]&&(null!=de[t].parentLocale?de[t]=de[t].parentLocale:null!=de[t]&&delete de[t]);return de[t]},a.locales=function(){return C(de)},a.weekdaysShort=function(t,e,n){return Tn(t,e,n,"weekdaysShort")},a.normalizeUnits=R,a.relativeTimeRounding=function(t){return void 0===t?Qn:"function"==typeof t&&(Qn=t,!0)},a.relativeTimeThreshold=function(t,e){return void 0!==ti[t]&&(void 0===e?ti[t]:(ti[t]=e,"s"===t&&(ti.ss=e-1),!0))},a.calendarFormat=function(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},a.prototype=Mn,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},a}()})),pi={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};on._date.override("function"==typeof mi?{_id:"moment",formats:function(){return pi},parse:function(t,e){return"string"==typeof t&&"string"==typeof e?t=mi(t,e):t instanceof mi||(t=mi(t)),t.isValid()?t.valueOf():null},format:function(t,e){return mi(t).format(e)},add:function(t,e,n){return mi(t).add(e,n).valueOf()},diff:function(t,e,n){return mi(t).diff(mi(e),n)},startOf:function(t,e,n){return t=mi(t),"isoWeek"===e?t.isoWeekday(n).valueOf():t.startOf(e).valueOf()},endOf:function(t,e){return mi(t).endOf(e).valueOf()},_create:function(t){return mi(t)}}:{}),Y._set("global",{plugins:{filler:{propagate:!0}}});var vi={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e)&&i.dataset._children||[],r=a.length||0;return r?function(t,e){return e=n)&&i;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function yi(t){return(t.el._scale||{}).getPointPositionForValue?function(t){var e,n,i,a,r,o=t.el._scale,s=o.options,l=o.chart.data.labels.length,u=t.fill,d=[];if(!l)return null;for(e=s.ticks.reverse?o.max:o.min,n=s.ticks.reverse?o.min:o.max,i=o.getPointPositionForValue(0,e),a=0;a0;--r)B.canvas.lineTo(t,n[r],n[r-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),r=a-1;r>0;--r)t.arc(o,s,l,n[r].angle,n[r-1].angle,!0)}}function Mi(t,e,n,i,a,r){var o,s,l,u,d,h,c,f,g=e.length,m=i.spanGaps,p=[],v=[],b=0,y=0;for(t.beginPath(),o=0,s=g;o=0;--n)(e=l[n].$filler)&&e.visible&&(a=(i=e.el)._view,r=i._children||[],o=e.mapper,s=a.backgroundColor||Y.global.defaultColor,o&&s&&r.length&&(B.canvas.clipArea(u,t.chartArea),Mi(u,r,o,a,s,i._loop),B.canvas.unclipArea(u)))}},Di=B.rtl.getRtlAdapter,Ci=B.noop,Pi=B.valueOrDefault;function Ti(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}Y._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.options.legend||{},i=n.labels&&n.labels.usePointStyle;return t._getSortedDatasetMetas().map((function(n){var a=n.controller.getStyle(i?0:void 0);return{text:e[n.index].label,fillStyle:a.backgroundColor,hidden:!t.isDatasetVisible(n.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data.datasets;for(a.setAttribute("class",t.id+"-legend"),e=0,n=r.length;el.width)&&(h+=o+n.padding,d[d.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:i,height:o},d[d.length-1]+=i+n.padding})),l.height+=h}else{var c=n.padding,f=t.columnWidths=[],g=t.columnHeights=[],m=n.padding,p=0,v=0;B.each(t.legendItems,(function(t,e){var i=Ti(n,o)+o/2+a.measureText(t.text).width;e>0&&v+o+2*c>l.height&&(m+=p+n.padding,f.push(p),g.push(v),p=0,v=0),p=Math.max(p,i),v+=o+c,s[e]={left:0,top:0,width:i,height:o}})),m+=p,f.push(p),g.push(v),l.width+=m}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:Ci,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,i=Y.global,a=i.defaultColor,r=i.elements.line,o=t.height,s=t.columnHeights,l=t.width,u=t.lineWidths;if(e.display){var d,h=Di(e.rtl,t.left,t.minSize.width),c=t.ctx,f=Pi(n.fontColor,i.defaultFontColor),g=B.options._parseFont(n),m=g.size;c.textAlign=h.textAlign("left"),c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=g.string;var p=Ti(n,m),v=t.legendHitBoxes,b=function(t,i){switch(e.align){case"start":return n.padding;case"end":return t-i;default:return(t-i+n.padding)/2}},y=t.isHorizontal();d=y?{x:t.left+b(l,u[0]),y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+b(o,s[0]),line:0},B.rtl.overrideTextDirection(t.ctx,e.textDirection);var x=m+n.padding;B.each(t.legendItems,(function(e,i){var f=c.measureText(e.text).width,g=p+m/2+f,_=d.x,w=d.y;h.setWidth(t.minSize.width),y?i>0&&_+g+n.padding>t.left+t.minSize.width&&(w=d.y+=x,d.line++,_=d.x=t.left+b(l,u[d.line])):i>0&&w+x>t.top+t.minSize.height&&(_=d.x=_+t.columnWidths[d.line]+n.padding,d.line++,w=d.y=t.top+b(o,s[d.line]));var k=h.x(_);!function(t,e,i){if(!(isNaN(p)||p<=0)){c.save();var o=Pi(i.lineWidth,r.borderWidth);if(c.fillStyle=Pi(i.fillStyle,a),c.lineCap=Pi(i.lineCap,r.borderCapStyle),c.lineDashOffset=Pi(i.lineDashOffset,r.borderDashOffset),c.lineJoin=Pi(i.lineJoin,r.borderJoinStyle),c.lineWidth=o,c.strokeStyle=Pi(i.strokeStyle,a),c.setLineDash&&c.setLineDash(Pi(i.lineDash,r.borderDash)),n&&n.usePointStyle){var s=p*Math.SQRT2/2,l=h.xPlus(t,p/2),u=e+m/2;B.canvas.drawPoint(c,i.pointStyle,s,l,u,i.rotation)}else c.fillRect(h.leftForLtr(t,p),e,p,m),0!==o&&c.strokeRect(h.leftForLtr(t,p),e,p,m);c.restore()}}(k,w,e),v[i].left=h.leftForLtr(k,v[i].width),v[i].top=w,function(t,e,n,i){var a=m/2,r=h.xPlus(t,p+a),o=e+a;c.fillText(n.text,r,o),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(r,o),c.lineTo(h.xPlus(r,i),o),c.stroke())}(k,w,e,f),y?d.x+=g+n.padding:d.y+=x})),B.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var n,i,a,r=this;if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)for(a=r.legendHitBoxes,n=0;n=(i=a[n]).left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height)return r.legendItems[n];return null},handleEvent:function(t){var e,n=this,i=n.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!i.onHover&&!i.onLeave)return}else{if("click"!==a)return;if(!i.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===a?e&&i.onClick&&i.onClick.call(n,t.native,e):(i.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),i.onHover&&e&&i.onHover.call(n,t.native,e))}});function Ai(t,e){var n=new Oi({ctx:t.ctx,options:e,chart:t});pe.configure(t,n,e),pe.addBox(t,n),t.legend=n}var Fi={id:"legend",_element:Oi,beforeInit:function(t){var e=t.options.legend;e&&Ai(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(B.mergeIf(e,Y.global.legend),n?(pe.configure(t,n,e),n.options=e):Ai(t,e)):n&&(pe.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},Ii=B.noop;Y._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Li=X.extend({initialize:function(t){B.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:Ii,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:Ii,beforeSetDimensions:Ii,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:Ii,beforeBuildLabels:Ii,buildLabels:Ii,afterBuildLabels:Ii,beforeFit:Ii,fit:function(){var t,e=this,n=e.options,i=e.minSize={},a=e.isHorizontal();n.display?(t=(B.isArray(n.text)?n.text.length:1)*B.options._parseFont(n).lineHeight+2*n.padding,e.width=i.width=a?e.maxWidth:t,e.height=i.height=a?t:e.maxHeight):e.width=i.width=e.height=i.height=0},afterFit:Ii,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var i,a,r,o=B.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,u=0,d=t.top,h=t.left,c=t.bottom,f=t.right;e.fillStyle=B.valueOrDefault(n.fontColor,Y.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(a=h+(f-h)/2,r=d+l,i=f-h):(a="left"===n.position?h+l:f-l,r=d+(c-d)/2,i=c-d,u=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(a,r),e.rotate(u),e.textAlign="center",e.textBaseline="middle";var g=n.text;if(B.isArray(g))for(var m=0,p=0;p=0;i--){var a=t[i];if(e(a))return a}},B.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},B.almostEquals=function(t,e,n){return Math.abs(t-e)=t},B.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},B.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},B.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-1},B.toRadians=function(t){return t*(Math.PI/180)},B.toDegrees=function(t){return t*(180/Math.PI)},B._decimalPlaces=function(t){if(B.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},B.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},B.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},B.aliasPixel=function(t){return t%2==0?0:.5},B._alignPixel=function(t,e,n){var i=t.currentDevicePixelRatio,a=n/2;return Math.round((e-a)*i)/i+a},B.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),u=s/(s+l),d=l/(s+l),h=i*(u=isNaN(u)?0:u),c=i*(d=isNaN(d)?0:d);return{previous:{x:r.x-h*(o.x-a.x),y:r.y-h*(o.y-a.y)},next:{x:r.x+c*(o.x-a.x),y:r.y+c*(o.y-a.y)}}},B.EPSILON=Number.EPSILON||1e-14,B.splineCurveMonotone=function(t){var e,n,i,a,r,o,s,l,u,d=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),h=d.length;for(e=0;e0?d[e-1]:null,(a=e0?d[e-1]:null,a=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},B.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},B.niceNum=function(t,e){var n=Math.floor(B.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},B.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},B.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=a.clientX,i=a.clientY);var l=parseFloat(B.getStyle(r,"padding-left")),u=parseFloat(B.getStyle(r,"padding-top")),d=parseFloat(B.getStyle(r,"padding-right")),h=parseFloat(B.getStyle(r,"padding-bottom")),c=o.right-o.left-l-d,f=o.bottom-o.top-u-h;return{x:n=Math.round((n-o.left-l)/c*r.width/e.currentDevicePixelRatio),y:i=Math.round((i-o.top-u)/f*r.height/e.currentDevicePixelRatio)}},B.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},B.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},B._calculatePadding=function(t,e,n){return(e=B.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},B._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},B.getMaximumWidth=function(t){var e=B._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=n-B._calculatePadding(e,"padding-left",n)-B._calculatePadding(e,"padding-right",n),a=B.getConstraintWidth(t);return isNaN(a)?i:Math.min(i,a)},B.getMaximumHeight=function(t){var e=B._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=n-B._calculatePadding(e,"padding-top",n)-B._calculatePadding(e,"padding-bottom",n),a=B.getConstraintHeight(t);return isNaN(a)?i:Math.min(i,a)},B.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},B.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,r=t.width;i.height=a*n,i.width=r*n,t.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=a+"px",i.style.width=r+"px")}},B.fontString=function(t,e,n){return e+" "+t+"px "+n},B.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var o,s,l,u,d,h=0,c=n.length;for(o=0;on.length){for(o=0;oi&&(i=r),i},B.numberOfLabelLines=function(t){var e=1;return B.each(t,(function(t){B.isArray(t)&&t.length>e&&(e=t.length)})),e},B.color=w?function(t){return t instanceof CanvasGradient&&(t=Y.global.defaultColor),w(t)}:function(t){return console.error("Color.js not found!"),t},B.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:B.color(t).saturate(.5).darken(.1).rgbString()}}(),nn._adapters=on,nn.Animation=J,nn.animationService=Q,nn.controllers=Qt,nn.DatasetController=at,nn.defaults=Y,nn.Element=X,nn.elements=kt,nn.Interaction=oe,nn.layouts=pe,nn.platform=Le,nn.plugins=Re,nn.Scale=_n,nn.scaleService=Ne,nn.Ticks=sn,nn.Tooltip=qe,nn.helpers.each(gi,(function(t,e){nn.scaleService.registerScaleType(e,t,t._defaults)})),Ni)Ni.hasOwnProperty(Ei)&&nn.plugins.register(Ni[Ei]);nn.platform.initialize();var Vi=nn;return"undefined"!=typeof window&&(window.Chart=nn),nn.Chart=nn,nn.Legend=Ni.legend._element,nn.Title=Ni.title._element,nn.pluginService=nn.plugins,nn.PluginBase=nn.Element.extend({}),nn.canvasHelpers=nn.helpers.canvas,nn.layoutService=nn.layouts,nn.LinearScaleBase=Cn,nn.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(t){nn[t]=function(e,n){return new nn(e,nn.helpers.merge(n||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}})),Vi})); +function t(t){return t+.5|0}const e=(t,e,i)=>Math.max(Math.min(t,i),e);function i(i){return e(t(2.55*i),0,255)}function s(i){return e(t(255*i),0,255)}function n(i){return e(t(i/2.55)/100,0,1)}function o(i){return e(t(100*i),0,100)}const a={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},r=[..."0123456789ABCDEF"],l=t=>r[15&t],h=t=>r[(240&t)>>4]+r[15&t],c=t=>(240&t)>>4==(15&t);function d(t){var e=(t=>c(t.r)&&c(t.g)&&c(t.b)&&c(t.a))(t)?l:h;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const u=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function f(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function g(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function p(t,e,i){const s=f(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function m(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),a=(n+o)/2;let r,l,h;return n!==o&&(h=n-o,l=a>.5?h/(2-n-o):h/(n+o),r=function(t,e,i,s,n){return t===n?(e-i)/s+(e>16&255,o>>8&255,255&o]}return t}(),w.transparent=[0,0,0,0]);const e=w[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const S=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const P=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,D=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function C(t,e,i){if(t){let s=m(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=b(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function O(t,e){return t?Object.assign(e||{},t):t}function A(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=s(t[3]))):(e=O(t,{r:0,g:0,b:0,a:1})).a=s(e.a),e}function T(t){return"r"===t.charAt(0)?function(t){const s=S.exec(t);let n,o,a,r=255;if(s){if(s[7]!==n){const t=+s[7];r=s[8]?i(t):e(255*t,0,255)}return n=+s[1],o=+s[3],a=+s[5],n=255&(s[2]?i(n):e(n,0,255)),o=255&(s[4]?i(o):e(o,0,255)),a=255&(s[6]?i(a):e(a,0,255)),{r:n,g:o,b:a,a:r}}}(t):y(t)}class L{constructor(t){if(t instanceof L)return t;const e=typeof t;let i;var s,n,o;"object"===e?i=A(t):"string"===e&&(o=(s=t).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*a[s[1]],g:255&17*a[s[2]],b:255&17*a[s[3]],a:5===o?17*a[s[4]]:255}:7!==o&&9!==o||(n={r:a[s[1]]<<4|a[s[2]],g:a[s[3]]<<4|a[s[4]],b:a[s[5]]<<4|a[s[6]],a:9===o?a[s[7]]<<4|a[s[8]]:255})),i=n||k(t)||T(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=O(this._rgb);return t&&(t.a=n(t.a)),t}set rgb(t){this._rgb=A(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${n(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?d(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=m(t),i=e[0],s=o(e[1]),a=o(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${a}%, ${n(t.a)})`:`hsl(${i}, ${s}%, ${a}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,a=2*o-1,r=i.a-s.a,l=((a*r==-1?a:(a+r)/(1+a*r))+1)/2;n=1-l,i.r=255&l*i.r+n*s.r+.5,i.g=255&l*i.g+n*s.g+.5,i.b=255&l*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const o=D(n(t.r)),a=D(n(t.g)),r=D(n(t.b));return{r:s(P(o+i*(D(n(e.r))-o))),g:s(P(a+i*(D(n(e.g))-a))),b:s(P(r+i*(D(n(e.b))-r))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new L(this.rgb)}alpha(t){return this._rgb.a=s(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const e=this._rgb,i=t(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=i,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return C(this._rgb,2,t),this}darken(t){return C(this._rgb,2,-t),this}saturate(t){return C(this._rgb,1,t),this}desaturate(t){return C(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=m(t);i[0]=_(i[0]+e),i=b(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}} +/*! + * Chart.js v4.4.6 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */function E(){}const R=(()=>{let t=0;return()=>t++})();function I(t){return null==t}function z(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function F(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function V(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function B(t,e){return V(t)?t:e}function W(t,e){return void 0===t?e:t}const N=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function H(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function j(t,e,i,s){let n,o,a;if(z(t))if(o=t.length,s)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;nt,x:t=>t.x,y:t=>t.y};function J(t,e){const i=Z[e]||(Z[e]=function(t){const e=function(t){const e=t.split("."),i=[];let s="";for(const t of e)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function Q(t){return t.charAt(0).toUpperCase()+t.slice(1)}const tt=t=>void 0!==t,et=t=>"function"==typeof t,it=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};const st=Math.PI,nt=2*st,ot=nt+st,at=Number.POSITIVE_INFINITY,rt=st/180,lt=st/2,ht=st/4,ct=2*st/3,dt=Math.log10,ut=Math.sign;function ft(t,e,i){return Math.abs(t-e)l&&h=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function Dt(t,e,i){i=i||(i=>t[i]1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const Ct=(t,e,i,s)=>Dt(t,i,s?s=>{const n=t[s][e];return nt[s][e]Dt(t,i,(s=>t[s][e]>=i));const At=["push","pop","shift","splice","unshift"];function Tt(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(At.forEach((e=>{delete t[e]})),delete t._chartjs)}function Lt(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Et="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Rt(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,Et.call(window,(()=>{s=!1,t.apply(e,i)})))}}const It=t=>"start"===t?"left":"end"===t?"right":"center",zt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function Ft(t,e,i){const s=e.length;let n=0,o=s;if(t._sorted){const{iScale:a,_parsed:r}=t,l=a.axis,{min:h,max:c,minDefined:d,maxDefined:u}=a.getUserBounds();d&&(n=St(Math.min(Ct(r,l,h).lo,i?s:Ct(e,l,a.getPixelForValue(h)).lo),0,s-1)),o=u?St(Math.max(Ct(r,a.axis,c,!0).hi+1,i?0:Ct(e,l,a.getPixelForValue(c),!0).hi+1),n,s)-n:s-n}return{start:n,count:o}}function Vt(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}const Bt=t=>0===t||1===t,Wt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*nt/i),Nt=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*nt/i)+1,Ht={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*lt),easeOutSine:t=>Math.sin(t*lt),easeInOutSine:t=>-.5*(Math.cos(st*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Bt(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Bt(t)?t:Wt(t,.075,.3),easeOutElastic:t=>Bt(t)?t:Nt(t,.075,.3),easeInOutElastic(t){const e=.1125;return Bt(t)?t:t<.5?.5*Wt(2*t,e,.45):.5+.5*Nt(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Ht.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Ht.easeInBounce(2*t):.5*Ht.easeOutBounce(2*t-1)+.5};function jt(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function $t(t){return jt(t)?t:new L(t)}function Yt(t){return jt(t)?t:new L(t).saturate(.5).darken(.1).hexString()}const Ut=["x","y","borderWidth","radius","tension"],Xt=["color","borderColor","backgroundColor"];const qt=new Map;function Kt(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=qt.get(i);return s||(s=new Intl.NumberFormat(t,e),qt.set(i,s)),s}(e,i).format(t)}const Gt={values:t=>z(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const a=dt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Kt(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=i[e].significand||t/Math.pow(10,Math.floor(dt(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?Gt.numeric.call(this,t,e,i):""}};var Zt={formatters:Gt};const Jt=Object.create(null),Qt=Object.create(null);function te(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Yt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Yt(e.borderColor),this.hoverColor=(t,e)=>Yt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return ee(this,t,e)}get(t){return te(this,t)}describe(t,e){return ee(Qt,t,e)}override(t,e){return ee(Jt,t,e)}route(t,e,i,s){const n=te(this,t),o=te(this,i),a="_"+e;Object.defineProperties(n,{[a]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[s];return F(t)?Object.assign({},e,t):W(t,e)},set(t){this[a]=t}}})}apply(t){t.forEach((t=>t(this)))}}var se=new ie({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Xt},numbers:{type:"number",properties:Ut}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Zt.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function ne(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function oe(t,e,i,s){let n=(s=s||{}).data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(n=s.data={},o=s.garbageCollect=[],s.font=e),t.save(),t.font=e;let a=0;const r=i.length;let l,h,c,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function ce(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==o.strokeColor;let l,h;for(t.save(),t.font=n.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),I(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;lW(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=+o(t)||0;return i}function we(t){return Me(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ke(t){return Me(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Se(t){const e=we(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Pe(t,e){t=t||{},e=e||se.font;let i=W(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=W(t.style,e.style);s&&!(""+s).match(ye)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:W(t.family,e.family),lineHeight:ve(W(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:W(t.weight,e.weight),string:""};return n.string=function(t){return!t||I(t.size)||I(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n}function De(t,e,i,s){let n,o,a,r=!0;for(n=0,o=t.length;nt[0]){const o=i||t;void 0===s&&(s=We("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:s,_getTarget:n,override:i=>Oe([i,...t],e,o,s)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>Re(i,s,(()=>function(t,e,i,s){let n;for(const o of e)if(n=We(Le(o,t),i),void 0!==n)return Ee(t,n)?Ve(i,s,t,n):n}(s,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Ne(t).includes(e),ownKeys:t=>Ne(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function Ae(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Te(t,s),setContext:e=>Ae(t,e,i,s),override:n=>Ae(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Re(t,e,(()=>function(t,e,i){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=t;let r=s[e];et(r)&&a.isScriptable(e)&&(r=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t);let l=e(o,a||s);r.delete(t),Ee(t,l)&&(l=Ve(n._scopes,n,t,l));return l}(e,r,t,i));z(r)&&r.length&&(r=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=i;if(void 0!==o.index&&s(t))return e[o.index%e.length];if(F(e[0])){const i=e,s=n._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=Ve(s,n,t,l);e.push(Ae(i,o,a&&a[t],r))}}return e}(e,r,t,a.isIndexable));Ee(e,r)&&(r=Ae(r,n,o&&o[e],a));return r}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function Te(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:et(i)?i:()=>i,isIndexable:et(s)?s:()=>s}}const Le=(t,e)=>t?t+Q(e):e,Ee=(t,e)=>F(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Re(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const s=i();return t[e]=s,s}function Ie(t,e,i){return et(t)?t(e,i):t}const ze=(t,e)=>!0===t?e:"string"==typeof t?J(e,t):void 0;function Fe(t,e,i,s,n){for(const o of e){const e=ze(i,o);if(e){t.add(e);const o=Ie(e._fallback,i,n);if(void 0!==o&&o!==i&&o!==s)return o}else if(!1===e&&void 0!==s&&i!==s)return null}return!1}function Ve(t,e,i,s){const n=e._rootScopes,o=Ie(e._fallback,i,s),a=[...t,...n],r=new Set;r.add(s);let l=Be(r,a,i,o||i,s);return null!==l&&((void 0===o||o===i||(l=Be(r,a,o,l,s),null!==l))&&Oe(Array.from(r),[""],n,o,(()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];if(z(n)&&F(i))return i;return n||{}}(e,i,s))))}function Be(t,e,i,s,n){for(;i;)i=Fe(t,e,i,s,n);return i}function We(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function Ne(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function He(t,e,i,s){const{iScale:n}=t,{key:o="r"}=this._parsing,a=new Array(s);let r,l,h,c;for(r=0,l=s;re"x"===t?"y":"x";function Ue(t,e,i,s){const n=t.skip?e:t,o=e,a=i.skip?e:i,r=vt(o,n),l=vt(a,o);let h=r/(r+l),c=l/(r+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=s*h,u=s*c;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function Xe(t,e="x"){const i=Ye(e),s=t.length,n=Array(s).fill(0),o=Array(s);let a,r,l,h=$e(t,0);for(a=0;a!t.skip))),"monotone"===e.cubicInterpolationMode)Xe(t,n);else{let i=s?t[t.length-1]:t[0];for(o=0,a=t.length;ot.ownerDocument.defaultView.getComputedStyle(t,null);const ti=["top","right","bottom","left"];function ei(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=ti[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function ii(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=Qe(i),o="border-box"===n.boxSizing,a=ei(n,"padding"),r=ei(n,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let a,r,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(n,o,t.target))a=n,r=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,r=s.clientY-t.top,l=!0}return{x:a,y:r,box:l}}(t,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:f,height:g}=e;return o&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-d)/f*i.width/s),y:Math.round((h-u)/g*i.height/s)}}const si=t=>Math.round(10*t)/10;function ni(t,e,i,s){const n=Qe(t),o=ei(n,"margin"),a=Je(n.maxWidth,t,"clientWidth")||at,r=Je(n.maxHeight,t,"clientHeight")||at,l=function(t,e,i){let s,n;if(void 0===e||void 0===i){const o=t&&Ze(t);if(o){const t=o.getBoundingClientRect(),a=Qe(o),r=ei(a,"border","width"),l=ei(a,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,s=Je(a.maxWidth,o,"clientWidth"),n=Je(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||at,maxHeight:n||at}}(t,e,i);let{width:h,height:c}=l;if("content-box"===n.boxSizing){const t=ei(n,"border","width"),e=ei(n,"padding");h-=e.width+t.width,c-=e.height+t.height}h=Math.max(0,h-o.width),c=Math.max(0,s?h/s:c-o.height),h=si(Math.min(h,a,l.maxWidth)),c=si(Math.min(c,r,l.maxHeight)),h&&!c&&(c=si(h/2));return(void 0!==e||void 0!==i)&&s&&l.height&&c>l.height&&(c=l.height,h=si(Math.floor(c*s))),{width:h,height:c}}function oi(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(t.currentDevicePixelRatio=s,a.height=n,a.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const ai=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Ge()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function ri(t,e){const i=function(t,e){return Qe(t).getPropertyValue(e)}(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function li(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function hi(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function ci(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=li(t,n,i),r=li(n,o,i),l=li(o,e,i),h=li(a,r,i),c=li(r,l,i);return li(h,c,i)}function di(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ui(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function fi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function gi(t){return"angle"===t?{between:kt,compare:Mt,normalize:wt}:{between:Pt,compare:(t,e)=>t-e,normalize:t=>t}}function pi({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function mi(t,e,i){if(!i)return[t];const{property:s,start:n,end:o}=i,a=e.length,{compare:r,between:l,normalize:h}=gi(s),{start:c,end:d,loop:u,style:f}=function(t,e,i){const{property:s,start:n,end:o}=i,{between:a,normalize:r}=gi(s),l=e.length;let h,c,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,h=0,c=l;hb||l(n,x,p)&&0!==r(n,x),v=()=>!b||0===r(o,p)||l(o,x,p);for(let t=c,i=c;t<=d;++t)m=e[t%a],m.skip||(p=h(m[s]),p!==x&&(b=l(p,n,o),null===_&&y()&&(_=0===r(p,n)?t:i),null!==_&&v()&&(g.push(pi({start:_,end:t,loop:u,count:a,style:f})),_=null),i=t,x=p));return null!==_&&g.push(pi({start:_,end:d,loop:u,count:a,style:f})),g}function xi(t,e){const i=[],s=t.segments;for(let n=0;ns({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=Et.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Mi=new vi;const wi="transparent",ki={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=$t(t||wi),n=s.valid&&$t(e||wi);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class Si{constructor(t,e,i,s){const n=e[i];s=De([t.to,s,n,t.from]);const o=De([t.from,n,s]);this._active=!0,this._fn=t.fn||ki[t.type||typeof o],this._easing=Ht[t.easing]||Ht.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=De([t.to,e,s,t.from]),this._from=De([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t{const n=t[s];if(!F(n))return;const o={};for(const t of e)o[t]=n[t];(z(n.properties)&&n.properties||[s]).forEach((t=>{t!==s&&i.has(t)||i.set(t,o)}))}))}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const l=o[r];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const h=e[l];let c=n[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,a);continue}c.cancel()}d&&d.duration?(n[l]=c=new Si(d,t,l,h),s.push(c)):t[l]=h}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(Mi.add(this._chart,i),!0):void 0}}function Di(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function Ci(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n0||!i&&e<0)return n.index}return null}function Ei(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,h=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),d=e.length;let u;for(let t=0;ti[t].axis===e)).shift()}function Ii(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const zi=t=>"reset"===t||"none"===t,Fi=(t,e)=>e?t:Object.assign({},t);class Vi{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ai(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Ii(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=W(i.xAxisID,Ri(t,"x")),o=e.yAxisID=W(i.yAxisID,Ri(t,"y")),a=e.rAxisID=W(i.rAxisID,Ri(t,"r")),r=e.indexAxis,l=e.iAxisID=s(r,n,o,a),h=e.vAxisID=s(r,o,n,a);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Tt(this._data,this),t._stacked&&Ii(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(F(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:s}=e,n="x"===i.axis?"x":"y",o="x"===s.axis?"x":"y",a=Object.keys(t),r=new Array(a.length);let l,h,c;for(l=0,h=a.length;l{const e="_onData"+Q(t),i=s[t];Object.defineProperty(s,t,{configurable:!0,enumerable:!1,value(...t){const n=i.apply(this,t);return s._chartjs.listeners.forEach((i=>{"function"==typeof i[e]&&i[e](...t)})),n}})})))),this._syncList=[],this._data=e}var s,n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=Ai(e.vScale,e),e.stack!==i.stack&&(s=!0,Ii(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&(Ei(this,e._parsed),e._stacked=Ai(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:n,_stacked:o}=i,a=n.axis;let r,l,h,c=0===t&&e===s.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,h=s;else{h=z(s[t])?this.parseArrayData(i,s,t,e):F(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const n=()=>null===l[a]||d&&l[a]t&&!e.hidden&&e._stacked&&{keys:Ci(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(a);let d,u;function f(){u=s[d];const e=u[a.axis];return!V(u[t.axis])||h>e||c=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,r);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,o;for(s=0,n=e.length;s=0&&tthis.getContext(i,s,e)),c);return f.$shared&&(f.$shared=r,n[o]=Object.freeze(Fi(f,r))),f}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const l=new Pi(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||zi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){zi(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!zi(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;at-e)))}return t._cache.$bar}(e,t.type);let s,n,o,a,r=e._length;const l=()=>{32767!==o&&-32768!==o&&(tt(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,n=i.length;sMath.abs(r)&&(l=r,h=a),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:n,end:o,min:a,max:r}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function Ni(t,e,i,s){const n=t.iScale,o=t.vScale,a=n.getLabels(),r=n===o,l=[];let h,c,d,u;for(h=i,c=i+s;ht.x,i="left",s="right"):(e=t.baset.controller.options.grouped)),n=i.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(e),r=a&&a[i.axis],l=t=>{const e=t._parsed.find((t=>t[i.axis]===r)),s=e&&e[t.vScale.axis];if(I(s)||isNaN(s))return!0};for(const i of s)if((void 0===e||!l(i))&&((!1===n||-1===o.indexOf(i.stack)||void 0===n&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,o;for(n=0,o=e.data.length;n=i?1:-1)}(d,e,a)*o,u===a&&(m-=d/2);const t=e.getPixelForDecimal(0),n=e.getPixelForDecimal(1),l=Math.min(t,n),f=Math.max(t,n);m=Math.max(Math.min(m,f),l),c=m+d,i&&!h&&(r._stacks[e.axis]._visualValues[s]=e.getValueForPixel(c)-e.getValueForPixel(m))}if(m===e.getPixelForValue(a)){const t=ut(d)*e.getLineWidthForValue(a)/2;m+=t,d-=t}return{size:d,base:m,head:c,center:c+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,n=s.skipNull,o=W(s.maxBarThickness,1/0);let a,r;if(e.grouped){const i=n?this._getStackCount(t):e.stackCount,l="flex"===s.barThickness?function(t,e,i,s){const n=e.pixels,o=n[t];let a=t>0?n[t-1]:null,r=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:n}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),r=n.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+a+", "+r+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:r,includeOptions:l}=this._getSharedOptions(e,s),h=o.axis,c=a.axis;for(let d=e;d"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map(((e,n)=>{const o=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:s,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let n,o,a=t=>+i[t];if(F(i[t])){const{key:t="value"}=this._parsing;a=e=>+J(i[e],t)}for(n=t,o=t+e;nkt(t,r,l,!0)?1:Math.max(e,e*i,s,s*i),g=(t,e,s)=>kt(t,r,l,!0)?-1:Math.min(e,e*i,s,s*i),p=f(0,h,d),m=f(lt,c,u),x=g(st,h,d),b=g(st+lt,c,u);s=(p-x)/2,n=(m-b)/2,o=-(p+x)/2,a=-(m+b)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}(u,d,r),x=(i.width-o)/f,b=(i.height-o)/g,_=Math.max(Math.min(x,b)/2,0),y=N(this.options.radius,_),v=(y-Math.max(y*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*y,this.offsetY=m*y,s.total=this.calculateTotal(),this.outerRadius=y-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*c,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/nt)}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.chartArea,r=o.options.animation,l=(a.left+a.right)/2,h=(a.top+a.bottom)/2,c=n&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,{sharedOptions:f,includeOptions:g}=this._getSharedOptions(e,s);let p,m=this._getRotation();for(p=0;p0&&!isNaN(t)?nt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=Kt(e._parsed[t],i.options.locale);return{label:s[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,o,a,r;if(!t)for(s=0,n=i.data.datasets.length;s0&&this.getParsed(e-1);for(let i=0;i=x){b.skip=!0;continue}const y=this.getParsed(i),v=I(y[u]),M=b[d]=o.getPixelForValue(y[d],i),w=b[u]=n||v?a.getBasePixel():a.getPixelForValue(r?this.applyStack(a,y,r):y[u],i);b.skip=isNaN(M)||isNaN(w)||v,b.stop=i>0&&Math.abs(y[d]-_[d])>p,g&&(b.parsed=y,b.raw=l.data[i]),c&&(b.options=h||this.resolveDataElementOptions(i,f.active?"active":s)),m||this.updateElement(f,i,b,s),_=y}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Zi extends Vi{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map(((e,n)=>{const o=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:s,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=Kt(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:n}}parseObjectData(t,e,i,s){return He.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(se.max&&(e.max=s))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),o=(n-Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.options.animation,r=this._cachedMeta.rScale,l=r.xCenter,h=r.yCenter,c=r.getIndexAngle(0)-.5*st;let d,u=c;const f=360/this.countVisibleElements();for(d=0;d{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?xt(this.resolveDataElementOptions(t,e).angle||i):0}}class Ji extends Ki{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class Qi extends Vi{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return He.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],n=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:n.length===s.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const n=this._cachedMeta.rScale,o="reset"===s;for(let a=e;a0&&this.getParsed(e-1);for(let h=e;h0&&Math.abs(i[u]-b[u])>m,p&&(g.parsed=i,g.raw=l.data[h]),d&&(g.options=c||this.resolveDataElementOptions(h,e.active?"active":s)),x||this.updateElement(e,h,g,s),b=i}this.updateSharedOptions(c,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const n=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,n,o)/2}}var es=Object.freeze({__proto__:null,BarController:Xi,BubbleController:qi,DoughnutController:Ki,LineController:Gi,PieController:Ji,PolarAreaController:Zi,RadarController:Qi,ScatterController:ts});function is(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ss{static override(t){Object.assign(ss.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return is()}parse(){return is()}format(){return is()}add(){return is()}diff(){return is()}startOf(){return is()}endOf(){return is()}}var ns={_date:ss};function os(t,e,i,s){const{controller:n,data:o,_sorted:a}=t,r=n._cachedMeta.iScale;if(r&&e===r.axis&&"r"!==e&&a&&o.length){const t=r._reversePixels?Ot:Ct;if(!s)return t(o,e,i);if(n._sharedOptions){const s=o[0],n="function"==typeof s.getRange&&s.getRange(e);if(n){const s=t(o,e,i-n),a=t(o,e,i+n);return{lo:s.lo,hi:a.hi}}}}return{lo:0,hi:o.length-1}}function as(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t{t[a]&&t[a](e[i],n)&&(o.push({element:t,datasetIndex:s,index:l}),r=r||t.inRange(e.x,e.y,n))})),s&&!r?[]:o}var ds={evaluateInteractionItems:as,modes:{index(t,e,i,s){const n=ii(e,t),o=i.axis||"x",a=i.includeInvisible||!1,r=i.intersect?rs(t,n,o,s,a):hs(t,n,o,!1,s,a),l=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,s){const n=ii(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;let r=i.intersect?rs(t,n,o,s,a):hs(t,n,o,!1,s,a);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;trs(t,ii(e,t),i.axis||"xy",s,i.includeInvisible||!1),nearest(t,e,i,s){const n=ii(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;return hs(t,n,o,i.intersect,s,a)},x:(t,e,i,s)=>cs(t,ii(e,t),"x",i.intersect,s),y:(t,e,i,s)=>cs(t,ii(e,t),"y",i.intersect,s)}};const us=["left","top","right","bottom"];function fs(t,e){return t.filter((t=>t.pos===e))}function gs(t,e){return t.filter((t=>-1===us.indexOf(t.pos)&&t.box.axis===e))}function ps(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function ms(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!us.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o{s[t]=Math.max(e[t],i[t])})),s}return s(t?["left","right"]:["top","bottom"])}function vs(t,e,i,s){const n=[];let o,a,r,l,h,c;for(o=0,a=t.length,h=0;ot.box.fullSize)),!0),s=ps(fs(e,"left"),!0),n=ps(fs(e,"right")),o=ps(fs(e,"top"),!0),a=ps(fs(e,"bottom")),r=gs(e,"x"),l=gs(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:fs(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}(t.boxes),l=r.vertical,h=r.horizontal;j(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),u=Object.assign({},n);bs(u,Se(s));const f=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),g=ms(l.concat(h),d);vs(r.fullSize,f,d,g),vs(l,f,d,g),vs(h,f,d,g)&&vs(l,f,d,g),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),ws(r.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,ws(r.rightAndBottom,f,d,g),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},j(r.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class Ss{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Ps extends Ss{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ds="$chartjs",Cs={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Os=t=>null===t||""===t;const As=!!ai&&{passive:!0};function Ts(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,As)}function Ls(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Es(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Ls(i.addedNodes,s),e=e&&!Ls(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function Rs(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Ls(i.removedNodes,s),e=e&&!Ls(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const Is=new Map;let zs=0;function Fs(){const t=window.devicePixelRatio;t!==zs&&(zs=t,Is.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function Vs(t,e,i){const s=t.canvas,n=s&&Ze(s);if(!n)return;const o=Rt(((t,e)=>{const s=n.clientWidth;i(t,e),s{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||o(i,s)}));return a.observe(n),function(t,e){Is.size||window.addEventListener("resize",Fs),Is.set(t,e)}(t,o),a}function Bs(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Is.delete(t),Is.size||window.removeEventListener("resize",Fs)}(t)}function Ws(t,e,i){const s=t.canvas,n=Rt((e=>{null!==t.ctx&&i(function(t,e){const i=Cs[t.type]||t.type,{x:s,y:n}=ii(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))}),t);return function(t,e,i){t&&t.addEventListener(e,i,As)}(s,e,n),n}class Ns extends Ss{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[Ds]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Os(n)){const e=ri(t,"width");void 0!==e&&(t.width=e)}if(Os(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ri(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ds])return!1;const i=e[Ds].initial;["height","width"].forEach((t=>{const s=i[t];I(s)?e.removeAttribute(t):e.setAttribute(t,s)}));const s=i.style||{};return Object.keys(s).forEach((t=>{e.style[t]=s[t]})),e.width=e.width,delete e[Ds],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:Es,detach:Rs,resize:Vs}[e]||Ws;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Bs,detach:Bs,resize:Bs}[e]||Ts)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return ni(t,e,i,s)}isAttached(t){const e=t&&Ze(t);return!(!e||!e.isConnected)}}function Hs(t){return!Ge()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Ps:Ns}class js{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return pt(this.x)&&pt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}function $s(t,e){const i=t.options.ticks,s=function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),n=Math.min(i.maxTicksLimit||s,s),o=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;in)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;nt-e)).pop(),e}(s);for(let t=0,e=o.length-1;tn)return e}return Math.max(n,1)}(o,e,n);if(a>0){let t,i;const s=a>1?Math.round((l-r)/(a-1)):null;for(Ys(e,h,c,I(s)?0:r-s,r),t=0,i=a-1;t"top"===e||"left"===e?t[e]+i:t[e]-i,Xs=(t,e)=>Math.min(e||t,t);function qs(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;oa+r)))return h}function Gs(t){return t.drawTicks?t.tickLength:0}function Zs(t,e){if(!t.display)return 0;const i=Pe(t.font,e),s=Se(t.padding);return(z(t.text)?t.text.length:1)*i.lineHeight+s.height}function Js(t,e,i){let s=It(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class Qs extends js{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=B(t,Number.POSITIVE_INFINITY),e=B(e,Number.NEGATIVE_INFINITY),i=B(i,Number.POSITIVE_INFINITY),s=B(s,Number.NEGATIVE_INFINITY),{min:B(t,i),max:B(e,s),minDefined:V(t),maxDefined:V(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:s};const a=this.getMatchingVisibleMetas();for(let r=0,l=a.length;rs?s:i,s=n&&i>s?i:s,{min:B(i,B(s,i)),max:B(s,B(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){H(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:s,max:n}=t,o=N(e,(n-s)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(s,-Math.abs(o)),max:a(n,o)}}(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=a=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),c=h.widest.width,d=h.highest.height,u=St(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(t.offset?.5:1)),a=this.maxHeight-Gs(t.grid)-e.padding-Zs(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),l=bt(Math.min(Math.asin(St((h.highest.height+6)/o,-1,1)),Math.asin(St(a/r,-1,1))-Math.asin(St(d/r,-1,1)))),l=Math.max(s,Math.min(n,l))),this.labelRotation=l}afterCalculateLabelRotation(){H(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){H(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=Zs(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Gs(n)+o):(t.height=this.maxHeight,t.width=Gs(n)+o),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),r=2*i.padding,l=xt(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(a){const e=i.mirror?0:c*n.width+h*o.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:h*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,s,c,h)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?l?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-h+o)*this.width/(this.width-h),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){H(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n({width:o[t]||0,height:a[t]||0});return{first:w(0),last:w(e-1),widest:w(v),highest:w(M),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return St(this._alignToPixels?ae(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*s?a/i:r/s:r*s0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:o,border:a}=s,r=n.offset,l=this.isHorizontal(),h=this.ticks.length+(r?1:0),c=Gs(n),d=[],u=a.setContext(this.getContext()),f=u.display?u.width:0,g=f/2,p=function(t){return ae(i,t,f)};let m,x,b,_,y,v,M,w,k,S,P,D;if("top"===o)m=p(this.bottom),v=this.bottom-c,w=m-g,S=p(t.top)+g,D=t.bottom;else if("bottom"===o)m=p(this.top),S=t.top,D=p(t.bottom)-g,v=m+g,w=this.top+c;else if("left"===o)m=p(this.right),y=this.right-c,M=m-g,k=p(t.left)+g,P=t.right;else if("right"===o)m=p(this.left),k=t.left,P=p(t.right)-g,y=m+g,M=this.left+c;else if("x"===e){if("center"===o)m=p((t.top+t.bottom)/2+.5);else if(F(o)){const t=Object.keys(o)[0],e=o[t];m=p(this.chart.scales[t].getPixelForValue(e))}S=t.top,D=t.bottom,v=m+g,w=v+c}else if("y"===e){if("center"===o)m=p((t.left+t.right)/2);else if(F(o)){const t=Object.keys(o)[0],e=o[t];m=p(this.chart.scales[t].getPixelForValue(e))}y=m-g,M=y-c,k=t.left,P=t.right}const C=W(s.ticks.maxTicksLimit,h),O=Math.max(1,Math.ceil(h/C));for(x=0;x0&&(o-=s/2)}d={left:o,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor}}p.push({label:_,font:k,textOffset:D,options:{rotation:g,color:i,strokeColor:r,strokeWidth:h,textAlign:u,textBaseline:C,translation:[y,v],backdrop:d}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-xt(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,a=this._getLabelSizes().widest.width;let r,l;return"left"===e?s?(l=this.right+n,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l+=a)):(l=this.right-o,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l=this.left)):"right"===e?s?(l=this.left+n,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l-=a)):(l=this.left+o,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l=this.right)):r="right",{textAlign:r,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n{const s=i.split("."),n=s.pop(),o=[t].concat(s).join("."),a=e[i].split("."),r=a.pop(),l=a.join(".");se.route(o,n,l,r)}))}(e,t.defaultRoutes);t.descriptors&&se.describe(e,t.descriptors)}(t,o,i),this.override&&se.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in se[s]&&(delete se[s][i],this.override&&delete Jt[i])}}class en{constructor(){this.controllers=new tn(Vi,"datasets",!0),this.elements=new tn(js,"elements"),this.plugins=new tn(Object,"plugins"),this.scales=new tn(Qs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):j(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const s=Q(t);H(i["before"+s],[],i),e[t](i),H(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;et.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function on(t,e){return e||!1!==t?!0===t?{}:t:null}function an(t,{plugin:e,local:i},s,n){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(s,o);return i&&e.defaults&&a.push(e.defaults),t.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function rn(t,e){const i=se.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function ln(t){if("x"===t||"y"===t||"r"===t)return t}function hn(t,...e){if(ln(t))return t;for(const s of e){const e=s.axis||("top"===(i=s.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&ln(t[0].toLowerCase());if(e)return e}var i;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function cn(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function dn(t,e){const i=Jt[t.type]||{scales:{}},s=e.scales||{},n=rn(t.type,e),o=Object.create(null);return Object.keys(s).forEach((e=>{const a=s[e];if(!F(a))return console.error(`Invalid scale configuration for scale: ${e}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const r=hn(e,a,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return cn(t,"x",i[0])||cn(t,"y",i[0])}return{}}(e,t),se.scales[a.type]),l=function(t,e){return t===e?"_index_":"_value_"}(r,n),h=i.scales||{};o[e]=K(Object.create(null),[{axis:r},a,h[r],h[l]])})),t.data.datasets.forEach((i=>{const n=i.type||t.type,a=i.indexAxis||rn(n,e),r=(Jt[n]||{}).scales||{};Object.keys(r).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,a),n=i[e+"AxisID"]||e;o[n]=o[n]||Object.create(null),K(o[n],[{axis:e},s[n],r[t]])}))})),Object.keys(o).forEach((t=>{const e=o[t];K(e,[se.scales[e.type],se.scale])})),o}function un(t){const e=t.options||(t.options={});e.plugins=W(e.plugins,{}),e.scales=dn(t,e)}function fn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const gn=new Map,pn=new Set;function mn(t,e){let i=gn.get(t);return i||(i=e(),gn.set(t,i),pn.add(i)),i}const xn=(t,e,i)=>{const s=J(e,i);void 0!==s&&t.add(s)};class bn{constructor(t){this._config=function(t){return(t=t||{}).data=fn(t.data),un(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=fn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),un(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return mn(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return mn(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return mn(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return mn(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const r=new Set;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>xn(r,t,e)))),e.forEach((t=>xn(r,s,t))),e.forEach((t=>xn(r,Jt[n]||{},t))),e.forEach((t=>xn(r,se,t))),e.forEach((t=>xn(r,Qt,t)))}));const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),pn.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Jt[e]||{},se.datasets[e]||{},{type:e},se,Qt]}resolveNamedOptions(t,e,i,s=[""]){const n={$shared:!0},{resolver:o,subPrefixes:a}=_n(this._resolverCache,t,s);let r=o;if(function(t,e){const{isScriptable:i,isIndexable:s}=Te(t);for(const n of e){const e=i(n),o=s(n),a=(o||e)&&t[n];if(e&&(et(a)||yn(a))||o&&z(a))return!0}return!1}(o,e)){n.$shared=!1;r=Ae(o,i=et(i)?i():i,this.createResolver(t,i,a))}for(const t of e)n[t]=r[t];return n}createResolver(t,e,i=[""],s){const{resolver:n}=_n(this._resolverCache,t,i);return F(e)?Ae(n,e,void 0,s):n}}function _n(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let o=s.get(n);if(!o){o={resolver:Oe(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,o)}return o}const yn=t=>F(t)&&Object.getOwnPropertyNames(t).some((e=>et(t[e])));const vn=["top","bottom","left","right","chartArea"];function Mn(t,e){return"top"===t||"bottom"===t||-1===vn.indexOf(t)&&"x"===e}function wn(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function kn(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),H(i&&i.onComplete,[t],e)}function Sn(t){const e=t.chart,i=e.options.animation;H(i&&i.onProgress,[t],e)}function Pn(t){return Ge()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Dn={},Cn=t=>{const e=Pn(t);return Object.values(Dn).filter((t=>t.canvas===e)).pop()};function On(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}function An(t,e,i){return t.options.clip?t[i]:e[i]}class Tn{static defaults=se;static instances=Dn;static overrides=Jt;static registry=sn;static version="4.4.6";static getChart=Cn;static register(...t){sn.add(...t),Ln()}static unregister(...t){sn.remove(...t),Ln()}constructor(t,e){const i=this.config=new bn(e),s=Pn(t),n=Cn(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Hs(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),r=a&&a.canvas,l=r&&r.height,h=r&&r.width;this.id=R(),this.ctx=a,this.canvas=r,this.width=h,this.height=l,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new nn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}((t=>this.update(t)),o.resizeDelay||0),this._dataChanges=[],Dn[this.id]=this,a&&r?(Mi.listen(this,"complete",kn),Mi.listen(this,"progress",Sn),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:n}=this;return I(t)?e&&n?n:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return sn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():oi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return re(this.canvas,this.ctx),this}stop(){return Mi.stop(this),this}resize(t,e){Mi.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,n),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,oi(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),H(i.onResize,[this,o],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){j(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let n=[];e&&(n=n.concat(Object.keys(e).map((t=>{const i=e[t],s=hn(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))),j(n,(e=>{const n=e.options,o=n.id,a=hn(o,n),r=W(n.type,e.dtype);void 0!==n.position&&Mn(n.position,a)===Mn(e.dposition)||(n.position=e.dposition),s[o]=!0;let l=null;if(o in i&&i[o].type===r)l=i[o];else{l=new(sn.getScale(r))({id:o,type:r,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(n,t)})),j(s,((t,e)=>{t||delete i[e]})),j(i,(t=>{ks.configure(this,t,t.options),ks.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(wn("z","_idx"));const{_active:a,_lastEvent:r}=this;r?this._eventHandler(r,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){j(this.scales,(t=>{ks.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);it(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e){On(t,s,"_removeElements"===i?-n:n)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let t=1;tt.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;ks.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],j(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,n=function(t,e){const{xScale:i,yScale:s}=t;return i&&s?{left:An(i,e,"left"),right:An(i,e,"right"),top:An(s,e,"top"),bottom:An(s,e,"bottom")}:e}(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(s&&de(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),s&&ue(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return ce(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=ds.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Ce(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);tt(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Mi.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};j(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){j(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},j(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!$(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,o=e,a=this._getActiveElements(t,s,i,o),r=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,r);i&&(this._lastEvent=null,H(n.onHover,[t,a,this],this),r&&H(n.onClick,[t,a,this],this));const h=!$(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function Ln(){return j(Tn.instances,(t=>t._plugins.invalidate()))}function En(t,e,i,s){const n=Me(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(i-e)/2,a=Math.min(o,s*e/2),r=t=>{const e=(i-Math.min(o,t))*s/2;return St(t,0,Math.min(o,e))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:St(n.innerStart,0,a),innerEnd:St(n.innerEnd,0,a)}}function Rn(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function In(t,e,i,s,n,o){const{x:a,y:r,startAngle:l,pixelMargin:h,innerRadius:c}=e,d=Math.max(e.outerRadius+s+i-h,0),u=c>0?c+s+i+h:0;let f=0;const g=n-l;if(s){const t=((c>0?c-s:0)+(d>0?d-s:0))/2;f=(g-(0!==t?g*t/(t+s):g))/2}const p=(g-Math.max(.001,g*d-i/st)/d)/2,m=l+p+f,x=n-p-f,{outerStart:b,outerEnd:_,innerStart:y,innerEnd:v}=En(e,u,d,x-m),M=d-b,w=d-_,k=m+b/M,S=x-_/w,P=u+y,D=u+v,C=m+y/P,O=x-v/D;if(t.beginPath(),o){const e=(k+S)/2;if(t.arc(a,r,d,k,e),t.arc(a,r,d,e,S),_>0){const e=Rn(w,S,a,r);t.arc(e.x,e.y,_,S,x+lt)}const i=Rn(D,x,a,r);if(t.lineTo(i.x,i.y),v>0){const e=Rn(D,O,a,r);t.arc(e.x,e.y,v,x+lt,O+Math.PI)}const s=(x-v/u+(m+y/u))/2;if(t.arc(a,r,u,x-v/u,s,!0),t.arc(a,r,u,s,m+y/u,!0),y>0){const e=Rn(P,C,a,r);t.arc(e.x,e.y,y,C+Math.PI,m-lt)}const n=Rn(M,m,a,r);if(t.lineTo(n.x,n.y),b>0){const e=Rn(M,k,a,r);t.arc(e.x,e.y,b,m-lt,k)}}else{t.moveTo(a,r);const e=Math.cos(k)*d+a,i=Math.sin(k)*d+r;t.lineTo(e,i);const s=Math.cos(S)*d+a,n=Math.sin(S)*d+r;t.lineTo(s,n)}t.closePath()}function zn(t,e,i,s,n){const{fullCircles:o,startAngle:a,circumference:r,options:l}=e,{borderWidth:h,borderJoinStyle:c,borderDash:d,borderDashOffset:u}=l,f="inner"===l.borderAlign;if(!h)return;t.setLineDash(d||[]),t.lineDashOffset=u,f?(t.lineWidth=2*h,t.lineJoin=c||"round"):(t.lineWidth=h,t.lineJoin=c||"bevel");let g=e.endAngle;if(o){In(t,e,i,s,g,n);for(let e=0;en?(h=n/l,t.arc(o,a,l,i+h,s-h,!0)):t.arc(o,a,n,i+lt,s-lt),t.closePath(),t.clip()}(t,e,g),o||(In(t,e,i,s,g,n),t.stroke())}class Fn extends js{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:n,distance:o}=yt(s,{x:t,y:e}),{startAngle:a,endAngle:r,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=W(c,r-a),f=kt(n,a,r)&&a!==r,g=u>=nt||f,p=Pt(o,l+d,h+d);return g&&p}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:r,spacing:l}=this.options,h=(s+n)/2,c=(o+a+l+r)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/4,n=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>nt?Math.floor(i/nt):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const r=s*(1-Math.sin(Math.min(st,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,s,n){const{fullCircles:o,startAngle:a,circumference:r}=e;let l=e.endAngle;if(o){In(t,e,i,s,l,n);for(let e=0;er&&o>r;return{count:s,start:l,loop:e.loop,ilen:h(a+(h?r-t:t))%o,_=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=n[b(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[b(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(ig&&(g=i),m=(x*m+e)/++x):(_(),t.lineTo(e,i),u=s,x=0,f=g=i),p=i}_()}function jn(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Hn:Nn}const $n="function"==typeof Path2D;function Yn(t,e,i,s){$n&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),Vn(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,a=jn(e);for(const r of n)Vn(t,o,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}class Un extends js{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Ke(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,s=t.options.spanGaps,n=i.length;if(!n)return[];const o=!!t._loop,{start:a,end:r}=function(t,e,i,s){let n=0,o=e-1;if(i&&!s)for(;nn&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}(i,n,o,s);return bi(t,!0===s?[{start:a,end:r,loop:o}]:function(t,e,i,s){const n=t.length,o=[];let a,r=e,l=t[e];for(a=e+1;a<=i;++a){const i=t[a%n];i.skip||i.stop?l.skip||(s=!1,o.push({start:e%n,end:(a-1)%n,loop:s}),e=r=i.stop?a:null):(r=a,l.skip&&(e=a)),l=i}return null!==r&&o.push({start:e%n,end:r%n,loop:s}),o}(i,a,rt.replace("rgb(","rgba(").replace(")",", 0.5)")));function oo(t){return so[t%so.length]}function ao(t){return no[t%no.length]}function ro(t){let e=0;return(i,s)=>{const n=t.getDatasetMeta(s).controller;n instanceof Ki?e=function(t,e){return t.backgroundColor=t.data.map((()=>oo(e++))),e}(i,e):n instanceof Zi?e=function(t,e){return t.backgroundColor=t.data.map((()=>ao(e++))),e}(i,e):n&&(e=function(t,e){return t.borderColor=oo(e),t.backgroundColor=ao(e),++e}(i,e))}}function lo(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var ho={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:s},options:n}=t.config,{elements:o}=n,a=lo(s)||(r=n)&&(r.borderColor||r.backgroundColor)||o&&lo(o)||"rgba(0,0,0,0.1)"!==se.borderColor||"rgba(0,0,0,0.1)"!==se.backgroundColor;var r;if(!i.forceOverride&&a)return;const l=ro(t);s.forEach(l)}};function co(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function uo(t){t.data.datasets.forEach((t=>{co(t)}))}var fo={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void uo(t);const s=t.width;t.data.datasets.forEach(((e,n)=>{const{_data:o,indexAxis:a}=e,r=t.getDatasetMeta(n),l=o||e.data;if("y"===De([a,t.options.indexAxis]))return;if(!r.controller.supportsDecimation)return;const h=t.scales[r.xAxisID];if("linear"!==h.type&&"time"!==h.type)return;if(t.options.parsing)return;let{start:c,count:d}=function(t,e){const i=e.length;let s,n=0;const{iScale:o}=t,{min:a,max:r,minDefined:l,maxDefined:h}=o.getUserBounds();return l&&(n=St(Ct(e,o.axis,a).lo,0,i-1)),s=h?St(Ct(e,o.axis,r).hi+1,n,i)-n:i-n,{start:n,count:s}}(r,l);if(d<=(i.threshold||4*s))return void co(e);let u;switch(I(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":u=function(t,e,i,s,n){const o=n.samples||s;if(o>=i)return t.slice(e,e+i);const a=[],r=(i-2)/(o-2);let l=0;const h=e+i-1;let c,d,u,f,g,p=e;for(a[l++]=t[p],c=0;cu&&(u=f,d=t[s],g=s);a[l++]=d,p=g}return a[l++]=t[h],a}(l,c,d,s,i);break;case"min-max":u=function(t,e,i,s){let n,o,a,r,l,h,c,d,u,f,g=0,p=0;const m=[],x=e+i-1,b=t[e].x,_=t[x].x-b;for(n=e;nf&&(f=r,c=n),g=(p*g+o.x)/++p;else{const i=n-1;if(!I(h)&&!I(c)){const e=Math.min(h,c),s=Math.max(h,c);e!==d&&e!==i&&m.push({...t[e],x:g}),s!==d&&s!==i&&m.push({...t[s],x:g})}n>0&&i!==d&&m.push(t[i]),m.push(o),l=e,p=0,u=f=r,h=c=d=n}}return m}(l,c,d,s);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=u}))},destroy(t){uo(t)}};function go(t,e,i,s){if(s)return;let n=e[t],o=i[t];return"angle"===t&&(n=wt(n),o=wt(o)),{property:t,start:n,end:o}}function po(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function mo(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function xo(t,e){let i=[],s=!1;return z(t)?(s=!0,i=t):i=function(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=po(t,e,n);const a=n[t],r=n[e];null!==s?(o.push({x:a.x,y:s}),o.push({x:r.x,y:s})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))})),o}(t,e),i.length?new Un({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function bo(t){return t&&!1!==t.fill}function _o(t,e,i){let s=t[e].fill;const n=[e];let o;if(!i)return s;for(;!1!==s&&-1===n.indexOf(s);){if(!V(s))return s;if(o=t[s],!o)return!1;if(o.visible)return s;n.push(s),s=o.fill}return!1}function yo(t,e,i){const s=function(t){const e=t.options,i=e.fill;let s=W(i&&i.target,i);void 0===s&&(s=!!e.backgroundColor);if(!1===s||null===s)return!1;if(!0===s)return"origin";return s}(t);if(F(s))return!isNaN(s.value)&&s;let n=parseFloat(s);return V(n)&&Math.floor(n)===n?function(t,e,i,s){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=s)return!1;return i}(s[0],e,n,i):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function vo(t,e,i){const s=[];for(let n=0;n=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&i.fill&&So(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;bo(i)&&So(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;bo(s)&&"beforeDatasetDraw"===i.drawTime&&So(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const To=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class Lo extends js{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=H(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=Pe(i.font),n=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:r}=To(i,n);let l,h;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(o,n,a,r)+10):(h=this.maxHeight,l=this._fitCols(o,s,a,r)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+a;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach(((t,f)=>{const g=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+g+2*a>o)&&(c+=h,l[l.length-(f>0?0:1)]=0,u+=h,d++),r[f]={left:0,top:u,row:d,width:g,height:s},l[l.length-1]+=g+a})),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-t;let c=a,d=0,u=0,f=0,g=0;return this.legendItems.forEach(((t,o)=>{const{itemWidth:p,itemHeight:m}=function(t,e,i,s,n){const o=function(t,e,i,s){let n=t.text;n&&"string"!=typeof n&&(n=n.reduce(((t,e)=>t.length>e.length?t:e)));return e+i.size/2+s.measureText(n).width}(s,t,e,i),a=function(t,e,i){let s=t;"string"!=typeof e.text&&(s=Eo(e,i));return s}(n,s,e.lineHeight);return{itemWidth:o,itemHeight:a}}(i,e,n,t,s);o>0&&u+m+2*a>h&&(c+=d+a,l.push({width:d,height:u}),f+=d+a,g++,d=u=0),r[o]={left:f,top:u,col:g,width:p,height:m},d=Math.max(d,p),u+=m+a})),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:n}}=this,o=di(n,this.left,this.width);if(this.isHorizontal()){let n=0,a=zt(i,this.left+s,this.right-this.lineWidths[n]);for(const r of e)n!==r.row&&(n=r.row,a=zt(i,this.left+s,this.right-this.lineWidths[n])),r.top+=this.top+t+s,r.left=o.leftForLtr(o.x(a),r.width),a+=r.width+s}else{let n=0,a=zt(i,this.top+t+s,this.bottom-this.columnSizes[n].height);for(const r of e)r.col!==n&&(n=r.col,a=zt(i,this.top+t+s,this.bottom-this.columnSizes[n].height)),r.top=a,r.left+=this.left+s,r.left=o.leftForLtr(o.x(r.left),r.width),a+=r.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;de(t,this),this._draw(),ue(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:n,labels:o}=t,a=se.color,r=di(t.rtl,this.left,this.width),l=Pe(o.font),{padding:h}=o,c=l.size,d=c/2;let u;this.drawTitle(),s.textAlign=r.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=l.string;const{boxWidth:f,boxHeight:g,itemHeight:p}=To(o,c),m=this.isHorizontal(),x=this._computeTitleHeight();u=m?{x:zt(n,this.left+h,this.right-i[0]),y:this.top+h+x,line:0}:{x:this.left+h,y:zt(n,this.top+x+h,this.bottom-e[0].height),line:0},ui(this.ctx,t.textDirection);const b=p+h;this.legendItems.forEach(((_,y)=>{s.strokeStyle=_.fontColor,s.fillStyle=_.fontColor;const v=s.measureText(_.text).width,M=r.textAlign(_.textAlign||(_.textAlign=o.textAlign)),w=f+d+v;let k=u.x,S=u.y;r.setWidth(this.width),m?y>0&&k+w+h>this.right&&(S=u.y+=b,u.line++,k=u.x=zt(n,this.left+h,this.right-i[u.line])):y>0&&S+b>this.bottom&&(k=u.x=k+e[u.line].width+h,u.line++,S=u.y=zt(n,this.top+x+h,this.bottom-e[u.line].height));if(function(t,e,i){if(isNaN(f)||f<=0||isNaN(g)||g<0)return;s.save();const n=W(i.lineWidth,1);if(s.fillStyle=W(i.fillStyle,a),s.lineCap=W(i.lineCap,"butt"),s.lineDashOffset=W(i.lineDashOffset,0),s.lineJoin=W(i.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=W(i.strokeStyle,a),s.setLineDash(W(i.lineDash,[])),o.usePointStyle){const a={radius:g*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},l=r.xPlus(t,f/2);he(s,a,l,e+d,o.pointStyleWidth&&f)}else{const o=e+Math.max((c-g)/2,0),a=r.leftForLtr(t,f),l=ke(i.borderRadius);s.beginPath(),Object.values(l).some((t=>0!==t))?be(s,{x:a,y:o,w:f,h:g,radius:l}):s.rect(a,o,f,g),s.fill(),0!==n&&s.stroke()}s.restore()}(r.x(k),S,_),k=((t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e)(M,k+f+d,m?k+w:this.right,t.rtl),function(t,e,i){xe(s,i.text,t,e+p/2,l,{strikethrough:i.hidden,textAlign:r.textAlign(i.textAlign)})}(r.x(k),S,_),m)u.x+=w+h;else if("string"!=typeof _.text){const t=l.lineHeight;u.y+=Eo(_,t)+h}else u.y+=b})),fi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Pe(e.font),s=Se(e.padding);if(!e.display)return;const n=di(t.rtl,this.left,this.width),o=this.ctx,a=e.position,r=i.size/2,l=s.top+r;let h,c=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+l,c=zt(t.align,c,this.right-d);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=l+zt(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=zt(a,c,c+d);o.textAlign=n.textAlign(It(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,xe(o,e.text,u,h,i)}_computeTitleHeight(){const t=this.options.title,e=Pe(t.font),i=Se(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,n;if(Pt(t,this.left,this.right)&&Pt(e,this.top,this.bottom))for(n=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const l=t.controller.getStyle(i?0:void 0),h=Se(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:l.borderColor,pointStyle:s||l.pointStyle,rotation:l.rotation,textAlign:n||l.textAlign,borderRadius:a&&(r||l.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Io extends js{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=z(i.text)?i.text.length:1;this._padding=Se(i.padding);const n=s*Pe(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:n,options:o}=this,a=o.align;let r,l,h,c=0;return this.isHorizontal()?(l=zt(a,i,n),h=e+t,r=n-i):("left"===o.position?(l=i+t,h=zt(a,s,e),c=-.5*st):(l=n-t,h=zt(a,e,s),c=.5*st),r=s-e),{titleX:l,titleY:h,maxWidth:r,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Pe(e.font),s=i.lineHeight/2+this._padding.top,{titleX:n,titleY:o,maxWidth:a,rotation:r}=this._drawArgs(s);xe(t,e.text,0,0,i,{color:e.color,maxWidth:a,rotation:r,textAlign:It(e.align),textBaseline:"middle",translation:[n,o]})}}var zo={id:"title",_element:Io,start(t,e,i){!function(t,e){const i=new Io({ctx:t.ctx,options:e,chart:t});ks.configure(t,i,e),ks.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;ks.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;ks.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Fo=new WeakMap;var Vo={id:"subtitle",start(t,e,i){const s=new Io({ctx:t.ctx,options:i,chart:t});ks.configure(t,s,i),ks.addBox(t,s),Fo.set(t,s)},stop(t){ks.removeBox(t,Fo.get(t)),Fo.delete(t)},beforeUpdate(t,e,i){const s=Fo.get(t);ks.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Bo={average(t){if(!t.length)return!1;let e,i,s=new Set,n=0,o=0;for(e=0,i=t.length;et+e))/s.size,y:n/o}},nearest(t,e){if(!t.length)return!1;let i,s,n,o=e.x,a=e.y,r=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i-1?t.split("\n"):t}function Ho(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function jo(t,e){const i=t.chart.ctx,{body:s,footer:n,title:o}=t,{boxWidth:a,boxHeight:r}=e,l=Pe(e.bodyFont),h=Pe(e.titleFont),c=Pe(e.footerFont),d=o.length,u=n.length,f=s.length,g=Se(e.padding);let p=g.height,m=0,x=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(x+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*h.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),x){p+=f*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(x-f)*l.lineHeight+(x-1)*e.bodySpacing}u&&(p+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let b=0;const _=function(t){m=Math.max(m,i.measureText(t).width+b)};return i.save(),i.font=h.string,j(t.title,_),i.font=l.string,j(t.beforeBody.concat(t.afterBody),_),b=e.displayColors?a+2+e.boxPadding:0,j(s,(t=>{j(t.before,_),j(t.lines,_),j(t.after,_)})),b=0,i.font=c.string,j(t.footer,_),i.restore(),m+=g.width,{width:m,height:p}}function $o(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:l}}=t;let h="center";return"center"===s?h=n<=(r+l)/2?"left":"right":n<=o/2?h="left":n>=a-o/2&&(h="right"),function(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0||void 0}(h,t,e,i)&&(h="center"),h}function Yo(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return it.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||$o(t,e,i,s),yAlign:s}}function Uo(t,e,i,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=t,{xAlign:r,yAlign:l}=i,h=n+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=ke(a);let g=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,r);const p=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,l,h);return"center"===l?"left"===r?g+=h:"right"===r&&(g-=h):"left"===r?g-=Math.max(c,u)+n:"right"===r&&(g+=Math.max(d,f)+n),{x:St(g,0,s.width-e.width),y:St(p,0,s.height-e.height)}}function Xo(t,e,i){const s=Se(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function qo(t){return Wo([],No(t))}function Ko(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const Go={beforeTitle:E,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex{const e={before:[],lines:[],after:[]},n=Ko(i,t);Wo(e.before,No(Zo(n,"beforeLabel",this,t))),Wo(e.lines,Zo(n,"label",this,t)),Wo(e.after,No(Zo(n,"afterLabel",this,t))),s.push(e)})),s}getAfterBody(t,e){return qo(Zo(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=Zo(i,"beforeFooter",this,t),n=Zo(i,"footer",this,t),o=Zo(i,"afterFooter",this,t);let a=[];return a=Wo(a,No(s)),a=Wo(a,No(n)),a=Wo(a,No(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],o=[];let a,r,l=[];for(a=0,r=e.length;at.filter(e,s,n,i)))),t.itemSort&&(l=l.sort(((e,s)=>t.itemSort(e,s,i)))),j(l,(e=>{const i=Ko(t.callbacks,e);s.push(Zo(i,"labelColor",this,e)),n.push(Zo(i,"labelPointStyle",this,e)),o.push(Zo(i,"labelTextColor",this,e))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=Bo[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=jo(this,i),a=Object.assign({},t,e),r=Yo(this.chart,i,a),l=Uo(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:r,topRight:l,bottomLeft:h,bottomRight:c}=ke(a),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,x,b,_,y;return"center"===n?(_=u+g/2,"left"===s?(p=d,m=p-o,b=_+o,y=_-o):(p=d+f,m=p+o,b=_-o,y=_+o),x=p):(m="left"===s?d+Math.max(r,h)+o:"right"===s?d+f-Math.max(l,c)-o:this.caretX,"top"===n?(b=u,_=b-o,p=m-o,x=m+o):(b=u+g,_=b+o,p=m+o,x=m-o),y=b),{x1:p,x2:m,x3:x,y1:b,y2:_,y3:y}}drawTitle(t,e,i){const s=this.title,n=s.length;let o,a,r;if(n){const l=di(i.rtl,this.x,this.width);for(t.x=Xo(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=Pe(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,r=0;r0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,be(t,{x:e,y:f,w:l,h:r,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),be(t,{x:i,y:f+1,w:l-2,h:r-2,radius:a}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,f,l,r),t.strokeRect(e,f,l,r),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,l-2,r-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:o,displayColors:a,boxHeight:r,boxWidth:l,boxPadding:h}=i,c=Pe(i.bodyFont);let d=c.lineHeight,u=0;const f=di(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+n},p=f.textAlign(o);let m,x,b,_,y,v,M;for(e.textAlign=o,e.textBaseline="middle",e.font=c.string,t.x=Xo(this,p,i),e.fillStyle=i.bodyColor,j(this.beforeBody,g),u=a&&"right"!==p?"center"===o?l/2+h:l+2+h:0,_=0,v=s.length;_0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=Bo[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=jo(this,t),a=Object.assign({},i,this._size),r=Yo(e,t,a),l=Uo(t,a,r,e);s._to===l.x&&n._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Se(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),ui(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),fi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),n=!$(i,s),o=this._positionChanged(s,e);(n||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),a=this._positionChanged(o,t),r=e||!$(o,n)||a;return r&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=Bo[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}var Qo={id:"tooltip",_element:Jo,positioners:Bo,afterInit(t,e,i){i&&(t.tooltip=new Jo({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Go},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},ta=Object.freeze({__proto__:null,Colors:ho,Decimation:fo,Filler:Ao,Legend:Ro,SubTitle:Vo,Title:zo,Tooltip:Qo});function ea(t,e,i,s){const n=t.indexOf(e);if(-1===n)return((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s);return n!==t.lastIndexOf(e)?i:n}function ia(t){const e=this.getLabels();return t>=0&&tnull===t?null:St(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:ea(i,t,W(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return ia.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function na(t,e){const i=[],{bounds:s,step:n,min:o,max:a,precision:r,count:l,maxTicks:h,maxDigits:c,includeBounds:d}=t,u=n||1,f=h-1,{min:g,max:p}=e,m=!I(o),x=!I(a),b=!I(l),_=(p-g)/(c+1);let y,v,M,w,k=gt((p-g)/f/u)*u;if(k<1e-14&&!m&&!x)return[{value:g},{value:p}];w=Math.ceil(p/k)-Math.floor(g/k),w>f&&(k=gt(w*k/f/u)*u),I(r)||(y=Math.pow(10,r),k=Math.ceil(k*y)/y),"ticks"===s?(v=Math.floor(g/k)*k,M=Math.ceil(p/k)*k):(v=g,M=p),m&&x&&n&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((a-o)/n,k/1e3)?(w=Math.round(Math.min((a-o)/k,h)),k=(a-o)/w,v=o,M=a):b?(v=m?o:v,M=x?a:M,w=l-1,k=(M-v)/w):(w=(M-v)/k,w=ft(w,Math.round(w),k/1e3)?Math.round(w):Math.ceil(w));const S=Math.max(_t(k),_t(v));y=Math.pow(10,I(r)?S:r),v=Math.round(v*y)/y,M=Math.round(M*y)/y;let P=0;for(m&&(d&&v!==o?(i.push({value:o}),va)break;i.push({value:t})}return x&&d&&M!==a?i.length&&ft(i[i.length-1].value,a,oa(a,_,t))?i[i.length-1].value=a:i.push({value:a}):x&&M!==a||i.push({value:M}),i}function oa(t,e,{horizontal:i,minRotation:s}){const n=xt(s),o=(i?Math.sin(n):Math.cos(n))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}class aa extends Qs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return I(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this;const o=t=>s=e?s:t,a=t=>n=i?n:t;if(t){const t=ut(s),e=ut(n);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(s===n){let e=0===n?1:Math.abs(.05*n);a(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s=na({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&mt(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Kt(t,this.chart.options.locale,this.options.ticks.format)}}class ra extends aa{static id="linear";static defaults={ticks:{callback:Zt.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=V(t)?t:0,this.max=V(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=xt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const la=t=>Math.floor(dt(t)),ha=(t,e)=>Math.pow(10,la(t)+e);function ca(t){return 1===t/Math.pow(10,la(t))}function da(t,e,i){const s=Math.pow(10,i),n=Math.floor(t/s);return Math.ceil(e/s)-n}function ua(t,{min:e,max:i}){e=B(t.min,e);const s=[],n=la(e);let o=function(t,e){let i=la(e-t);for(;da(t,e,i)>10;)i++;for(;da(t,e,i)<10;)i--;return Math.min(i,la(t))}(e,i),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),l=n>o?Math.pow(10,n):0,h=Math.round((e-l)*a)/a,c=Math.floor((e-l)/r/10)*r*10;let d=Math.floor((h-c)/Math.pow(10,o)),u=B(t.min,Math.round((l+c+d*Math.pow(10,o))*a)/a);for(;u=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,a=o>=0?1:a),u=Math.round((l+c+d*Math.pow(10,o))*a)/a;const f=B(t.max,u);return s.push({value:f,major:ca(f),significand:d}),s}class fa extends Qs{static id="logarithmic";static defaults={ticks:{callback:Zt.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=aa.prototype.parse.apply(this,[t,e]);if(0!==i)return V(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=V(t)?Math.max(0,t):null,this.max=V(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!V(this._userMin)&&(this.min=t===ha(this.min,0)?ha(this.min,-1):ha(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const n=e=>i=t?i:e,o=t=>s=e?s:t;i===s&&(i<=0?(n(1),o(10)):(n(ha(i,-1)),o(ha(s,1)))),i<=0&&n(ha(s,-1)),s<=0&&o(ha(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e=ua({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&mt(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":Kt(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=dt(t),this._valueRange=dt(this.max)-dt(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(dt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function ga(t){const e=t.ticks;if(e.display&&t.display){const t=Se(e.backdropPadding);return W(e.font&&e.font.size,se.font.size)+t.height}return 0}function pa(t,e,i,s,n){return t===s||t===n?{start:e-i/2,end:e+i/2}:tn?{start:e-i,end:e}:{start:e,end:e+i}}function ma(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],n=[],o=t._pointLabels.length,a=t.options.pointLabels,r=a.centerPointLabels?st/o:0;for(let d=0;de.r&&(r=(s.end-e.r)/o,t.r=Math.max(t.r,e.r+r)),n.starte.b&&(l=(n.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}function ba(t,e,i){const s=t.drawingArea,{extra:n,additionalAngle:o,padding:a,size:r}=i,l=t.getPointPosition(e,s+n+a,o),h=Math.round(bt(wt(l.angle+lt))),c=function(t,e,i){90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e);return t}(l.y,r.h,h),d=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(h),u=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(l.x,r.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:u,top:c,right:u+r.w,bottom:c+r.h}}function _a(t,e){if(!e)return!0;const{left:i,top:s,right:n,bottom:o}=t;return!(ce({x:i,y:s},e)||ce({x:i,y:o},e)||ce({x:n,y:s},e)||ce({x:n,y:o},e))}function ya(t,e,i){const{left:s,top:n,right:o,bottom:a}=i,{backdropColor:r}=e;if(!I(r)){const i=ke(e.borderRadius),l=Se(e.backdropPadding);t.fillStyle=r;const h=s-l.left,c=n-l.top,d=o-s+l.width,u=a-n+l.height;Object.values(i).some((t=>0!==t))?(t.beginPath(),be(t,{x:h,y:c,w:d,h:u,radius:i}),t.fill()):t.fillRect(h,c,d,u)}}function va(t,e,i,s){const{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,nt);else{let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let o=1;ot,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Se(ga(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=V(t)&&!isNaN(t)?t:0,this.max=V(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ga(this.options))}generateTickLabels(t){aa.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=H(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?ma(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){return wt(t*(nt/(this._pointLabels.length||1))+xt(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(I(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(I(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t=0;n--){const e=t._pointLabelItems[n];if(!e.visible)continue;const o=s.setContext(t.getPointLabelContext(n));ya(i,o,e);const a=Pe(o.font),{x:r,y:l,textAlign:h}=e;xe(i,t._pointLabels[n],r,l+a.lineHeight/2,a,{color:o.color,textAlign:h,textBaseline:"middle"})}}(this,o),s.display&&this.ticks.forEach(((t,e)=>{if(0!==e||0===e&&this.min<0){r=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),a=s.setContext(i),l=n.setContext(i);!function(t,e,i,s,n){const o=t.ctx,a=e.circular,{color:r,lineWidth:l}=e;!a&&!s||!r||!l||i<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(n.dash||[]),o.lineDashOffset=n.dashOffset,o.beginPath(),va(t,i,a,s),o.closePath(),o.stroke(),o.restore())}(this,a,r,o,l)}})),i.display){for(t.save(),a=o-1;a>=0;a--){const s=i.setContext(this.getPointLabelContext(a)),{color:n,lineWidth:o}=s;o&&n&&(t.lineWidth=o,t.strokeStyle=n,t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset,r=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(a,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let n,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((s,a)=>{if(0===a&&this.min>=0&&!e.reverse)return;const r=i.setContext(this.getContext(a)),l=Pe(r.font);if(n=this.getDistanceFromCenterForValue(this.ticks[a].value),r.showLabelBackdrop){t.font=l.string,o=t.measureText(s.label).width,t.fillStyle=r.backdropColor;const e=Se(r.backdropPadding);t.fillRect(-o/2-e.left,-n-l.size/2-e.top,o+e.width,l.size+e.height)}xe(t,s.label,0,-n,l,{color:r.color,strokeColor:r.textStrokeColor,strokeWidth:r.textStrokeWidth})})),t.restore()}drawTitle(){}}const wa={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ka=Object.keys(wa);function Sa(t,e){return t-e}function Pa(t,e){if(I(e))return null;const i=t._adapter,{parser:s,round:n,isoWeekday:o}=t._parseOpts;let a=e;return"function"==typeof s&&(a=s(a)),V(a)||(a="string"==typeof s?i.parse(a,s):i.parse(a)),null===a?null:(n&&(a="week"!==n||!pt(o)&&!0!==o?i.startOf(a,n):i.startOf(a,"isoWeek",o)),+a)}function Da(t,e,i,s){const n=ka.length;for(let o=ka.indexOf(t);o=e?i[s]:i[n]]=!0}}else t[e]=!0}function Oa(t,e,i){const s=[],n={},o=e.length;let a,r;for(a=0;a=0&&(e[l].major=!0);return e}(t,s,n,i):s}class Aa extends Qs{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new ns._date(t.adapters.date);s.init(e),K(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:Pa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();function r(t){o||isNaN(t.min)||(s=Math.min(s,t.min)),a||isNaN(t.max)||(n=Math.max(n,t.max))}o&&a||(r(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||r(this.getMinMax(!1))),s=V(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),n=V(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,n-1),this.max=Math.max(s+1,n)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const n=this.min,o=function(t,e,i){let s=0,n=t.length;for(;ss&&t[n-1]>i;)n--;return s>0||n=ka.indexOf(i);o--){const i=ka[o];if(wa[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return ka[i?ka.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=ka.indexOf(t)+1,i=ka.length;e+t.value)))}initOffsets(t=[]){let e,i,s=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;s=St(s,0,o),n=St(n,0,o),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,n=s.time,o=n.unit||Da(n.minUnit,e,i,this._getLabelCapacity(e)),a=W(s.ticks.stepSize,1),r="week"===o&&n.isoWeekday,l=pt(r)||!0===r,h={};let c,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",r)),u=+t.startOf(u,l?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const f="data"===s.ticks.source&&this.getDataTimestamps();for(c=u,d=0;c+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,s=this._unit,n=e||i[s];return this._adapter.format(t,n)}_tickFormatFunction(t,e,i,s){const n=this.options,o=n.ticks.callback;if(o)return H(o,[t,e,i],this);const a=n.time.displayFormats,r=this._unit,l=this._majorUnit,h=r&&a[r],c=l&&a[l],d=i[e],u=l&&c&&d&&d.major;return this._adapter.format(t,s||(u?c:h))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t=t[r].pos&&e<=t[l].pos&&({lo:r,hi:l}=Ct(t,"pos",e)),({pos:s,time:o}=t[r]),({pos:n,time:a}=t[l])):(e>=t[r].time&&e<=t[l].time&&({lo:r,hi:l}=Ct(t,"time",e)),({time:s,pos:o}=t[r]),({time:n,pos:a}=t[l]));const h=n-s;return h?o+(a-o)*(e-s)/h:o}class La extends Aa{static id="timeseries";static defaults=Aa.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ta(e,this.min),this._tableRange=Ta(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],n=[];let o,a,r,l,h;for(o=0,a=t.length;o=e&&l<=i&&s.push(l);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;ot-e))}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ta(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ta(this._table,i*this._tableRange+this._minPos,!0)}}var Ea=Object.freeze({__proto__:null,CategoryScale:sa,LinearScale:ra,LogarithmicScale:fa,RadialLinearScale:Ma,TimeScale:Aa,TimeSeriesScale:La});const Ra=[es,io,ta,Ea];export{Si as Animation,Pi as Animations,Fn as ArcElement,Xi as BarController,eo as BarElement,Ss as BasePlatform,Ps as BasicPlatform,qi as BubbleController,sa as CategoryScale,Tn as Chart,ho as Colors,Vi as DatasetController,fo as Decimation,Ns as DomPlatform,Ki as DoughnutController,js as Element,Ao as Filler,ds as Interaction,Ro as Legend,Gi as LineController,Un as LineElement,ra as LinearScale,fa as LogarithmicScale,Ji as PieController,qn as PointElement,Zi as PolarAreaController,Qi as RadarController,Ma as RadialLinearScale,Qs as Scale,ts as ScatterController,Vo as SubTitle,Zt as Ticks,Aa as TimeScale,La as TimeSeriesScale,zo as Title,Qo as Tooltip,ns as _adapters,Hs as _detectPlatform,Mi as animator,es as controllers,se as defaults,io as elements,ks as layouts,ta as plugins,Ra as registerables,sn as registry,Ea as scales}; diff --git a/Resources/Public/JavaScript/Vendor/Choices.min.js b/Resources/Public/JavaScript/Vendor/Choices.min.js index 3b79f068..295be67a 100644 --- a/Resources/Public/JavaScript/Vendor/Choices.min.js +++ b/Resources/Public/JavaScript/Vendor/Choices.min.js @@ -1,2 +1,2 @@ -/*! For license information please see choices.min.js.LICENSE.txt */ -!function(){"use strict";var e={282:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.clearChoices=t.activateChoices=t.filterChoices=t.addChoice=void 0;var n=i(883);t.addChoice=function(e){var t=e.value,i=e.label,r=e.id,s=e.groupId,o=e.disabled,a=e.elementId,c=e.customProperties,l=e.placeholder,h=e.keyCode;return{type:n.ACTION_TYPES.ADD_CHOICE,value:t,label:i,id:r,groupId:s,disabled:o,elementId:a,customProperties:c,placeholder:l,keyCode:h}},t.filterChoices=function(e){return{type:n.ACTION_TYPES.FILTER_CHOICES,results:e}},t.activateChoices=function(e){return void 0===e&&(e=!0),{type:n.ACTION_TYPES.ACTIVATE_CHOICES,active:e}},t.clearChoices=function(){return{type:n.ACTION_TYPES.CLEAR_CHOICES}}},783:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.addGroup=void 0;var n=i(883);t.addGroup=function(e){var t=e.value,i=e.id,r=e.active,s=e.disabled;return{type:n.ACTION_TYPES.ADD_GROUP,value:t,id:i,active:r,disabled:s}}},464:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.highlightItem=t.removeItem=t.addItem=void 0;var n=i(883);t.addItem=function(e){var t=e.value,i=e.label,r=e.id,s=e.choiceId,o=e.groupId,a=e.customProperties,c=e.placeholder,l=e.keyCode;return{type:n.ACTION_TYPES.ADD_ITEM,value:t,label:i,id:r,choiceId:s,groupId:o,customProperties:a,placeholder:c,keyCode:l}},t.removeItem=function(e,t){return{type:n.ACTION_TYPES.REMOVE_ITEM,id:e,choiceId:t}},t.highlightItem=function(e,t){return{type:n.ACTION_TYPES.HIGHLIGHT_ITEM,id:e,highlighted:t}}},137:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.setIsLoading=t.resetTo=t.clearAll=void 0;var n=i(883);t.clearAll=function(){return{type:n.ACTION_TYPES.CLEAR_ALL}},t.resetTo=function(e){return{type:n.ACTION_TYPES.RESET_TO,state:e}},t.setIsLoading=function(e){return{type:n.ACTION_TYPES.SET_IS_LOADING,isLoading:e}}},373:function(e,t,i){var n=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,r=0,s=t.length;r=0?this._store.getGroupById(r):null;return this._store.dispatch((0,l.highlightItem)(i,!0)),t&&this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:i,value:o,label:c,groupValue:h&&h.value?h.value:null}),this},e.prototype.unhighlightItem=function(e){if(!e||!e.id)return this;var t=e.id,i=e.groupId,n=void 0===i?-1:i,r=e.value,s=void 0===r?"":r,o=e.label,a=void 0===o?"":o,c=n>=0?this._store.getGroupById(n):null;return this._store.dispatch((0,l.highlightItem)(t,!1)),this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:t,value:s,label:a,groupValue:c&&c.value?c.value:null}),this},e.prototype.highlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.highlightItem(t)})),this},e.prototype.unhighlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.unhighlightItem(t)})),this},e.prototype.removeActiveItemsByValue=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.value===e})).forEach((function(e){return t._removeItem(e)})),this},e.prototype.removeActiveItems=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.id!==e})).forEach((function(e){return t._removeItem(e)})),this},e.prototype.removeHighlightedItems=function(e){var t=this;return void 0===e&&(e=!1),this._store.highlightedActiveItems.forEach((function(i){t._removeItem(i),e&&t._triggerChange(i.value)})),this},e.prototype.showDropdown=function(e){var t=this;return this.dropdown.isActive||requestAnimationFrame((function(){t.dropdown.show(),t.containerOuter.open(t.dropdown.distanceFromTopWindow),!e&&t._canSearch&&t.input.focus(),t.passedElement.triggerEvent(d.EVENTS.showDropdown,{})})),this},e.prototype.hideDropdown=function(e){var t=this;return this.dropdown.isActive?(requestAnimationFrame((function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent(d.EVENTS.hideDropdown,{})})),this):this},e.prototype.getValue=function(e){void 0===e&&(e=!1);var t=this._store.activeItems.reduce((function(t,i){var n=e?i.value:i;return t.push(n),t}),[]);return this._isSelectOneElement?t[0]:t},e.prototype.setValue=function(e){var t=this;return this.initialised?(e.forEach((function(e){return t._setChoiceOrItem(e)})),this):this},e.prototype.setChoiceByValue=function(e){var t=this;return!this.initialised||this._isTextElement||(Array.isArray(e)?e:[e]).forEach((function(e){return t._findAndSelectChoiceByValue(e)})),this},e.prototype.setChoices=function(e,t,i,n){var r=this;if(void 0===e&&(e=[]),void 0===t&&(t="value"),void 0===i&&(i="label"),void 0===n&&(n=!1),!this.initialised)throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if("string"!=typeof t||!t)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(n&&this.clearChoices(),"function"==typeof e){var s=e(this);if("function"==typeof Promise&&s instanceof Promise)return new Promise((function(e){return requestAnimationFrame(e)})).then((function(){return r._handleLoadingState(!0)})).then((function(){return s})).then((function(e){return r.setChoices(e,t,i,n)})).catch((function(e){r.config.silent||console.error(e)})).then((function(){return r._handleLoadingState(!1)})).then((function(){return r}));if(!Array.isArray(s))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof s));return this.setChoices(s,t,i,!1)}if(!Array.isArray(e))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),e.forEach((function(e){if(e.choices)r._addGroup({id:e.id?parseInt("".concat(e.id),10):null,group:e,valueKey:t,labelKey:i});else{var n=e;r._addChoice({value:n[t],label:n[i],isSelected:!!n.selected,isDisabled:!!n.disabled,placeholder:!!n.placeholder,customProperties:n.customProperties})}})),this._stopLoading(),this},e.prototype.clearChoices=function(){return this._store.dispatch((0,a.clearChoices)()),this},e.prototype.clearStore=function(){return this._store.dispatch((0,h.clearAll)()),this},e.prototype.clearInput=function(){var e=!this._isSelectOneElement;return this.input.clear(e),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0))),this},e.prototype._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var e=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,t=this._isSelectElement,i=this._currentState.items!==this._prevState.items;e&&(t&&this._renderChoices(),i&&this._renderItems(),this._prevState=this._currentState)}},e.prototype._renderChoices=function(){var e=this,t=this._store,i=t.activeGroups,n=t.activeChoices,r=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame((function(){return e.choiceList.scrollToTop()})),i.length>=1&&!this._isSearching){var s=n.filter((function(e){return!0===e.placeholder&&-1===e.groupId}));s.length>=1&&(r=this._createChoicesFragment(s,r)),r=this._createGroupsFragment(i,n,r)}else n.length>=1&&(r=this._createChoicesFragment(n,r));if(r.childNodes&&r.childNodes.length>0){var o=this._store.activeItems,a=this._canAddItem(o,this.input.value);if(a.response)this.choiceList.append(r),this._highlightChoice();else{var c=this._getTemplate("notice",a.notice);this.choiceList.append(c)}}else{var l=void 0;c=void 0,this._isSearching?(c="function"==typeof this.config.noResultsText?this.config.noResultsText():this.config.noResultsText,l=this._getTemplate("notice",c,"no-results")):(c="function"==typeof this.config.noChoicesText?this.config.noChoicesText():this.config.noChoicesText,l=this._getTemplate("notice",c,"no-choices")),this.choiceList.append(l)}},e.prototype._renderItems=function(){var e=this._store.activeItems||[];this.itemList.clear();var t=this._createItemsFragment(e);t.childNodes&&this.itemList.append(t)},e.prototype._createGroupsFragment=function(e,t,i){var n=this;return void 0===i&&(i=document.createDocumentFragment()),this.config.shouldSort&&e.sort(this.config.sorter),e.forEach((function(e){var r=function(e){return t.filter((function(t){return n._isSelectOneElement?t.groupId===e.id:t.groupId===e.id&&("always"===n.config.renderSelectedChoices||!t.selected)}))}(e);if(r.length>=1){var s=n._getTemplate("choiceGroup",e);i.appendChild(s),n._createChoicesFragment(r,i,!0)}})),i},e.prototype._createChoicesFragment=function(e,t,i){var r=this;void 0===t&&(t=document.createDocumentFragment()),void 0===i&&(i=!1);var s=this.config,o=s.renderSelectedChoices,a=s.searchResultLimit,c=s.renderChoiceLimit,l=this._isSearching?f.sortByScore:this.config.sorter,h=function(e){if("auto"!==o||r._isSelectOneElement||!e.selected){var i=r._getTemplate("choice",e,r.config.itemSelectText);t.appendChild(i)}},u=e;"auto"!==o||this._isSelectOneElement||(u=e.filter((function(e){return!e.selected})));var d=u.reduce((function(e,t){return t.placeholder?e.placeholderChoices.push(t):e.normalChoices.push(t),e}),{placeholderChoices:[],normalChoices:[]}),p=d.placeholderChoices,m=d.normalChoices;(this.config.shouldSort||this._isSearching)&&m.sort(l);var v=u.length,g=this._isSelectOneElement?n(n([],p,!0),m,!0):m;this._isSearching?v=a:c&&c>0&&!i&&(v=c);for(var _=0;_=n){var o=r?this._searchChoices(e):0;this.passedElement.triggerEvent(d.EVENTS.search,{value:e,resultCount:o})}else s&&(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0)))}},e.prototype._canAddItem=function(e,t){var i=!0,n="function"==typeof this.config.addItemText?this.config.addItemText(t):this.config.addItemText;if(!this._isSelectOneElement){var r=(0,f.existsInArray)(e,t);this.config.maxItemCount>0&&this.config.maxItemCount<=e.length&&(i=!1,n="function"==typeof this.config.maxItemText?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&r&&i&&(i=!1,n="function"==typeof this.config.uniqueItemText?this.config.uniqueItemText(t):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&i&&"function"==typeof this.config.addItemFilter&&!this.config.addItemFilter(t)&&(i=!1,n="function"==typeof this.config.customAddItemText?this.config.customAddItemText(t):this.config.customAddItemText)}return{response:i,notice:n}},e.prototype._searchChoices=function(e){var t="string"==typeof e?e.trim():e,i="string"==typeof this._currentValue?this._currentValue.trim():this._currentValue;if(t.length<1&&t==="".concat(i," "))return 0;var r=this._store.searchableChoices,s=t,c=Object.assign(this.config.fuseOptions,{keys:n([],this.config.searchFields,!0),includeMatches:!0}),l=new o.default(r,c).search(s);return this._currentValue=t,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch((0,a.filterChoices)(l)),l.length},e.prototype._addEventListeners=function(){var e=document.documentElement;e.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("click",this._onClick,{passive:!0}),e.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(this.containerOuter.element.addEventListener("focus",this._onFocus,{passive:!0}),this.containerOuter.element.addEventListener("blur",this._onBlur,{passive:!0})),this.input.element.addEventListener("keyup",this._onKeyUp,{passive:!0}),this.input.element.addEventListener("focus",this._onFocus,{passive:!0}),this.input.element.addEventListener("blur",this._onBlur,{passive:!0}),this.input.element.form&&this.input.element.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},e.prototype._removeEventListeners=function(){var e=document.documentElement;e.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("click",this._onClick),e.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener("focus",this._onFocus),this.containerOuter.element.removeEventListener("blur",this._onBlur)),this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},e.prototype._onKeyDown=function(e){var t=e.keyCode,i=this._store.activeItems,n=this.input.isFocussed,r=this.dropdown.isActive,s=this.itemList.hasChildren(),o=String.fromCharCode(t),a=/[^\x00-\x1F]/.test(o),c=d.KEY_CODES.BACK_KEY,l=d.KEY_CODES.DELETE_KEY,h=d.KEY_CODES.ENTER_KEY,u=d.KEY_CODES.A_KEY,p=d.KEY_CODES.ESC_KEY,f=d.KEY_CODES.UP_KEY,m=d.KEY_CODES.DOWN_KEY,v=d.KEY_CODES.PAGE_UP_KEY,g=d.KEY_CODES.PAGE_DOWN_KEY;switch(this._isTextElement||r||!a||(this.showDropdown(),this.input.isFocussed||(this.input.value+=e.key.toLowerCase())),t){case u:return this._onSelectKey(e,s);case h:return this._onEnterKey(e,i,r);case p:return this._onEscapeKey(r);case f:case v:case m:case g:return this._onDirectionKey(e,r);case l:case c:return this._onDeleteKey(e,i,n)}},e.prototype._onKeyUp=function(e){var t=e.target,i=e.keyCode,n=this.input.value,r=this._store.activeItems,s=this._canAddItem(r,n),o=d.KEY_CODES.BACK_KEY,c=d.KEY_CODES.DELETE_KEY;if(this._isTextElement)if(s.notice&&n){var l=this._getTemplate("notice",s.notice);this.dropdown.element.innerHTML=l.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0);else{var h=(i===o||i===c)&&t&&!t.value,u=!this._isTextElement&&this._isSearching,p=this._canSearch&&s.response;h&&u?(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0))):p&&this._handleSearch(this.input.rawValue)}this._canSearch=this.config.searchEnabled},e.prototype._onSelectKey=function(e,t){var i=e.ctrlKey,n=e.metaKey;(i||n)&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},e.prototype._onEnterKey=function(e,t,i){var n=e.target,r=d.KEY_CODES.ENTER_KEY,s=n&&n.hasAttribute("data-button");if(this._isTextElement&&n&&n.value){var o=this.input.value;this._canAddItem(t,o).response&&(this.hideDropdown(!0),this._addItem({value:o}),this._triggerChange(o),this.clearInput())}if(s&&(this._handleButtonAction(t,n),e.preventDefault()),i){var a=this.dropdown.getChild(".".concat(this.config.classNames.highlightedState));a&&(t[0]&&(t[0].keyCode=r),this._handleChoiceAction(t,a)),e.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),e.preventDefault())},e.prototype._onEscapeKey=function(e){e&&(this.hideDropdown(!0),this.containerOuter.focus())},e.prototype._onDirectionKey=function(e,t){var i=e.keyCode,n=e.metaKey,r=d.KEY_CODES.DOWN_KEY,s=d.KEY_CODES.PAGE_UP_KEY,o=d.KEY_CODES.PAGE_DOWN_KEY;if(t||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var a=i===r||i===o?1:-1,c="[data-choice-selectable]",l=void 0;if(n||i===o||i===s)l=a>0?this.dropdown.element.querySelector("".concat(c,":last-of-type")):this.dropdown.element.querySelector(c);else{var h=this.dropdown.element.querySelector(".".concat(this.config.classNames.highlightedState));l=h?(0,f.getAdjacentEl)(h,c,a):this.dropdown.element.querySelector(c)}l&&((0,f.isScrolledIntoView)(l,this.choiceList.element,a)||this.choiceList.scrollToChildElement(l,a),this._highlightChoice(l)),e.preventDefault()}},e.prototype._onDeleteKey=function(e,t,i){var n=e.target;this._isSelectOneElement||n.value||!i||(this._handleBackspace(t),e.preventDefault())},e.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},e.prototype._onTouchEnd=function(e){var t=(e||e.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(t)&&((t===this.containerOuter.element||t===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation()),this._wasTap=!0},e.prototype._onMouseDown=function(e){var t=e.target;if(t instanceof HTMLElement){if(_&&this.choiceList.element.contains(t)){var i=this.choiceList.element.firstElementChild,n="ltr"===this._direction?e.offsetX>=i.offsetWidth:e.offsetX0&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))},e.prototype._onFocus=function(e){var t,i=this,n=e.target;n&&this.containerOuter.element.contains(n)&&((t={})[d.TEXT_TYPE]=function(){n===i.input.element&&i.containerOuter.addFocusState()},t[d.SELECT_ONE_TYPE]=function(){i.containerOuter.addFocusState(),n===i.input.element&&i.showDropdown(!0)},t[d.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.showDropdown(!0),i.containerOuter.addFocusState())},t)[this.passedElement.element.type]()},e.prototype._onBlur=function(e){var t,i=this,n=e.target;if(n&&this.containerOuter.element.contains(n)&&!this._isScrollingOnIe){var r=this._store.activeItems.some((function(e){return e.highlighted}));((t={})[d.TEXT_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),r&&i.unhighlightAll(),i.hideDropdown(!0))},t[d.SELECT_ONE_TYPE]=function(){i.containerOuter.removeFocusState(),(n===i.input.element||n===i.containerOuter.element&&!i._canSearch)&&i.hideDropdown(!0)},t[d.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),i.hideDropdown(!0),r&&i.unhighlightAll())},t)[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},e.prototype._onFormReset=function(){this._store.dispatch((0,h.resetTo)(this._initialState))},e.prototype._highlightChoice=function(e){var t=this;void 0===e&&(e=null);var i=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(i.length){var n=e;Array.from(this.dropdown.element.querySelectorAll(".".concat(this.config.classNames.highlightedState))).forEach((function(e){e.classList.remove(t.config.classNames.highlightedState),e.setAttribute("aria-selected","false")})),n?this._highlightPosition=i.indexOf(n):(n=i.length>this._highlightPosition?i[this._highlightPosition]:i[i.length-1])||(n=i[0]),n.classList.add(this.config.classNames.highlightedState),n.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(d.EVENTS.highlightChoice,{el:n}),this.dropdown.isActive&&(this.input.setActiveDescendant(n.id),this.containerOuter.setActiveDescendant(n.id))}},e.prototype._addItem=function(e){var t=e.value,i=e.label,n=void 0===i?null:i,r=e.choiceId,s=void 0===r?-1:r,o=e.groupId,a=void 0===o?-1:o,c=e.customProperties,h=void 0===c?{}:c,u=e.placeholder,p=void 0!==u&&u,f=e.keyCode,m=void 0===f?-1:f,v="string"==typeof t?t.trim():t,g=this._store.items,_=n||v,y=s||-1,E=a>=0?this._store.getGroupById(a):null,b=g?g.length+1:1;this.config.prependValue&&(v=this.config.prependValue+v.toString()),this.config.appendValue&&(v+=this.config.appendValue.toString()),this._store.dispatch((0,l.addItem)({value:v,label:_,id:b,choiceId:y,groupId:a,customProperties:h,placeholder:p,keyCode:m})),this._isSelectOneElement&&this.removeActiveItems(b),this.passedElement.triggerEvent(d.EVENTS.addItem,{id:b,value:v,label:_,customProperties:h,groupValue:E&&E.value?E.value:null,keyCode:m})},e.prototype._removeItem=function(e){var t=e.id,i=e.value,n=e.label,r=e.customProperties,s=e.choiceId,o=e.groupId,a=o&&o>=0?this._store.getGroupById(o):null;t&&s&&(this._store.dispatch((0,l.removeItem)(t,s)),this.passedElement.triggerEvent(d.EVENTS.removeItem,{id:t,value:i,label:n,customProperties:r,groupValue:a&&a.value?a.value:null}))},e.prototype._addChoice=function(e){var t=e.value,i=e.label,n=void 0===i?null:i,r=e.isSelected,s=void 0!==r&&r,o=e.isDisabled,c=void 0!==o&&o,l=e.groupId,h=void 0===l?-1:l,u=e.customProperties,d=void 0===u?{}:u,p=e.placeholder,f=void 0!==p&&p,m=e.keyCode,v=void 0===m?-1:m;if(null!=t){var g=this._store.choices,_=n||t,y=g?g.length+1:1,E="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(y);this._store.dispatch((0,a.addChoice)({id:y,groupId:h,elementId:E,value:t,label:_,disabled:c,customProperties:d,placeholder:f,keyCode:v})),s&&this._addItem({value:t,label:_,choiceId:y,customProperties:d,placeholder:f,keyCode:v})}},e.prototype._addGroup=function(e){var t=this,i=e.group,n=e.id,r=e.valueKey,s=void 0===r?"value":r,o=e.labelKey,a=void 0===o?"label":o,l=(0,f.isType)("Object",i)?i.choices:Array.from(i.getElementsByTagName("OPTION")),h=n||Math.floor((new Date).valueOf()*Math.random()),u=!!i.disabled&&i.disabled;l?(this._store.dispatch((0,c.addGroup)({value:i.label,id:h,active:!0,disabled:u})),l.forEach((function(e){var i=e.disabled||e.parentNode&&e.parentNode.disabled;t._addChoice({value:e[s],label:(0,f.isType)("Object",e)?e[a]:e.innerHTML,isSelected:e.selected,isDisabled:i,groupId:h,customProperties:e.customProperties,placeholder:e.placeholder})}))):this._store.dispatch((0,c.addGroup)({value:i.label,id:i.id,active:!1,disabled:i.disabled}))},e.prototype._getTemplate=function(e){for(var t,i=[],r=1;r0?this.element.scrollTop+o-r:e.offsetTop;requestAnimationFrame((function(){i._animateScroll(a,t)}))}},e.prototype._scrollDown=function(e,t,i){var n=(i-e)/t,r=n>1?n:1;this.element.scrollTop=e+r},e.prototype._scrollUp=function(e,t,i){var n=(e-i)/t,r=n>1?n:1;this.element.scrollTop=e-r},e.prototype._animateScroll=function(e,t){var i=this,r=n.SCROLLING_SPEED,s=this.element.scrollTop,o=!1;t>0?(this._scrollDown(s,r,e),se&&(o=!0)),o&&requestAnimationFrame((function(){i._animateScroll(e,t)}))},e}();t.default=r},730:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var n=i(799),r=function(){function e(e){var t=e.element,i=e.classNames;if(this.element=t,this.classNames=i,!(t instanceof HTMLInputElement||t instanceof HTMLSelectElement))throw new TypeError("Invalid element passed");this.isDisabled=!1}return Object.defineProperty(e.prototype,"isActive",{get:function(){return"active"===this.element.dataset.choice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.conceal=function(){this.element.classList.add(this.classNames.input),this.element.hidden=!0,this.element.tabIndex=-1;var e=this.element.getAttribute("style");e&&this.element.setAttribute("data-choice-orig-style",e),this.element.setAttribute("data-choice","active")},e.prototype.reveal=function(){this.element.classList.remove(this.classNames.input),this.element.hidden=!1,this.element.removeAttribute("tabindex");var e=this.element.getAttribute("data-choice-orig-style");e?(this.element.removeAttribute("data-choice-orig-style"),this.element.setAttribute("style",e)):this.element.removeAttribute("style"),this.element.removeAttribute("data-choice"),this.element.value=this.element.value},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},e.prototype.triggerEvent=function(e,t){(0,n.dispatchEvent)(this.element,e,t)},e}();t.default=r},541:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t){var i=t.element,n=t.classNames,r=t.delimiter,s=e.call(this,{element:i,classNames:n})||this;return s.delimiter=r,s}return r(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.setAttribute("value",e),this.element.value=e},enumerable:!1,configurable:!0}),t}(s(i(730)).default);t.default=o},982:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t){var i=t.element,n=t.classNames,r=t.template,s=e.call(this,{element:i,classNames:n})||this;return s.template=r,s}return r(t,e),Object.defineProperty(t.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optionGroups",{get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return Array.from(this.element.options)},set:function(e){var t=this,i=document.createDocumentFragment();e.forEach((function(e){return n=e,r=t.template(n),void i.appendChild(r);var n,r})),this.appendDocFragment(i)},enumerable:!1,configurable:!0}),t.prototype.appendDocFragment=function(e){this.element.innerHTML="",this.element.appendChild(e)},t}(s(i(730)).default);t.default=o},883:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.SCROLLING_SPEED=t.SELECT_MULTIPLE_TYPE=t.SELECT_ONE_TYPE=t.TEXT_TYPE=t.KEY_CODES=t.ACTION_TYPES=t.EVENTS=void 0,t.EVENTS={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem",highlightChoice:"highlightChoice",unhighlightItem:"unhighlightItem"},t.ACTION_TYPES={ADD_CHOICE:"ADD_CHOICE",FILTER_CHOICES:"FILTER_CHOICES",ACTIVATE_CHOICES:"ACTIVATE_CHOICES",CLEAR_CHOICES:"CLEAR_CHOICES",ADD_GROUP:"ADD_GROUP",ADD_ITEM:"ADD_ITEM",REMOVE_ITEM:"REMOVE_ITEM",HIGHLIGHT_ITEM:"HIGHLIGHT_ITEM",CLEAR_ALL:"CLEAR_ALL",RESET_TO:"RESET_TO",SET_IS_LOADING:"SET_IS_LOADING"},t.KEY_CODES={BACK_KEY:46,DELETE_KEY:8,ENTER_KEY:13,A_KEY:65,ESC_KEY:27,UP_KEY:38,DOWN_KEY:40,PAGE_UP_KEY:33,PAGE_DOWN_KEY:34},t.TEXT_TYPE="text",t.SELECT_ONE_TYPE="select-one",t.SELECT_MULTIPLE_TYPE="select-multiple",t.SCROLLING_SPEED=4},789:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CONFIG=t.DEFAULT_CLASSNAMES=void 0;var n=i(799);t.DEFAULT_CLASSNAMES={containerOuter:"choices",containerInner:"choices__inner",input:"choices__input",inputCloned:"choices__input--cloned",list:"choices__list",listItems:"choices__list--multiple",listSingle:"choices__list--single",listDropdown:"choices__list--dropdown",item:"choices__item",itemSelectable:"choices__item--selectable",itemDisabled:"choices__item--disabled",itemChoice:"choices__item--choice",placeholder:"choices__placeholder",group:"choices__group",groupHeading:"choices__heading",button:"choices__button",activeState:"is-active",focusState:"is-focused",openState:"is-open",disabledState:"is-disabled",highlightedState:"is-highlighted",selectedState:"is-selected",flippedState:"is-flipped",loadingState:"is-loading",noResults:"has-no-results",noChoices:"has-no-choices"},t.DEFAULT_CONFIG={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,addItemFilter:null,removeItems:!0,removeItemButton:!1,editItems:!1,allowHTML:!0,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:n.sortByAlpha,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(e){return'Press Enter to add "'.concat((0,n.sanitise)(e),'"')},maxItemText:function(e){return"Only ".concat(e," values can be added")},valueComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},labelId:"",callbackOnInit:null,callbackOnCreateTemplates:null,classNames:t.DEFAULT_CLASSNAMES}},18:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},978:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},948:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},359:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},285:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},533:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},187:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),r(i(18),t),r(i(978),t),r(i(948),t),r(i(359),t),r(i(285),t),r(i(533),t),r(i(287),t),r(i(132),t),r(i(837),t),r(i(598),t),r(i(369),t),r(i(37),t),r(i(47),t),r(i(923),t),r(i(876),t)},287:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},132:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},837:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},598:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},37:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},369:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},47:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},923:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},876:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},799:function(e,t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.parseCustomProperties=t.diff=t.cloneObject=t.existsInArray=t.dispatchEvent=t.sortByScore=t.sortByAlpha=t.strToEl=t.sanitise=t.isScrolledIntoView=t.getAdjacentEl=t.wrap=t.isType=t.getType=t.generateId=t.generateChars=t.getRandomNumber=void 0,t.getRandomNumber=function(e,t){return Math.floor(Math.random()*(t-e)+e)},t.generateChars=function(e){return Array.from({length:e},(function(){return(0,t.getRandomNumber)(0,36).toString(36)})).join("")},t.generateId=function(e,i){var n=e.id||e.name&&"".concat(e.name,"-").concat((0,t.generateChars)(2))||(0,t.generateChars)(4);return n=n.replace(/(:|\.|\[|\]|,)/g,""),"".concat(i,"-").concat(n)},t.getType=function(e){return Object.prototype.toString.call(e).slice(8,-1)},t.isType=function(e,i){return null!=i&&(0,t.getType)(i)===e},t.wrap=function(e,t){return void 0===t&&(t=document.createElement("div")),e.parentNode&&(e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t)),t.appendChild(e)},t.getAdjacentEl=function(e,t,i){void 0===i&&(i=1);for(var n="".concat(i>0?"next":"previous","ElementSibling"),r=e[n];r;){if(r.matches(t))return r;r=r[n]}return r},t.isScrolledIntoView=function(e,t,i){return void 0===i&&(i=1),!!e&&(i>0?t.scrollTop+t.offsetHeight>=e.offsetTop+e.offsetHeight:e.offsetTop>=t.scrollTop)},t.sanitise=function(e){return"string"!=typeof e?e:e.replace(/&/g,"&").replace(/>/g,">").replace(/-1?e.map((function(e){var t=e;return t.id===parseInt("".concat(o.choiceId),10)&&(t.selected=!0),t})):e;case"REMOVE_ITEM":var a=n;return a.choiceId&&a.choiceId>-1?e.map((function(e){var t=e;return t.id===parseInt("".concat(a.choiceId),10)&&(t.selected=!1),t})):e;case"FILTER_CHOICES":var c=n;return e.map((function(e){var t=e;return t.active=c.results.some((function(e){var i=e.item,n=e.score;return i.id===t.id&&(t.score=n,!0)})),t}));case"ACTIVATE_CHOICES":var l=n;return e.map((function(e){var t=e;return t.active=l.active,t}));case"CLEAR_CHOICES":return t.defaultState;default:return e}}},871:function(e,t){var i=this&&this.__spreadArray||function(e,t,i){if(i||2===arguments.length)for(var n,r=0,s=t.length;r0?"treeitem":"option"),Object.assign(E.dataset,{choice:"",id:d,value:p,selectText:i}),g?(E.classList.add(h),E.dataset.choiceDisabled="",E.setAttribute("aria-disabled","true")):(E.classList.add(c),E.dataset.choiceSelectable=""),E},input:function(e,t){var i=e.classNames,n=i.input,r=i.inputCloned,s=Object.assign(document.createElement("input"),{type:"search",name:"search_terms",className:"".concat(n," ").concat(r),autocomplete:"off",autocapitalize:"off",spellcheck:!1});return s.setAttribute("role","textbox"),s.setAttribute("aria-autocomplete","list"),s.setAttribute("aria-label",t),s},dropdown:function(e){var t=e.classNames,i=t.list,n=t.listDropdown,r=document.createElement("div");return r.classList.add(i,n),r.setAttribute("aria-expanded","false"),r},notice:function(e,t,i){var n,r=e.allowHTML,s=e.classNames,o=s.item,a=s.itemChoice,c=s.noResults,l=s.noChoices;void 0===i&&(i="");var h=[o,a];return"no-choices"===i?h.push(l):"no-results"===i&&h.push(c),Object.assign(document.createElement("div"),((n={})[r?"innerHTML":"innerText"]=t,n.className=h.join(" "),n))},option:function(e){var t=e.label,i=e.value,n=e.customProperties,r=e.active,s=e.disabled,o=new Option(t,i,!1,r);return n&&(o.dataset.customProperties="".concat(n)),o.disabled=!!s,o}};t.default=i},996:function(e){var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((i=e,Array.isArray(i)?[]:{}),e,t):e;var i}function r(e,t,i){return e.concat(t).map((function(e){return n(e,i)}))}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function o(e,t){try{return t in e}catch(e){return!1}}function a(e,i,c){(c=c||{}).arrayMerge=c.arrayMerge||r,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=n;var l=Array.isArray(i);return l===Array.isArray(e)?l?c.arrayMerge(e,i,c):function(e,t,i){var r={};return i.isMergeableObject(e)&&s(e).forEach((function(t){r[t]=n(e[t],i)})),s(t).forEach((function(s){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,s)||(o(e,s)&&i.isMergeableObject(t[s])?r[s]=function(e,t){if(!t.customMerge)return a;var i=t.customMerge(e);return"function"==typeof i?i:a}(s,i)(e[s],t[s],i):r[s]=n(t[s],i))})),r}(e,i,c):n(i,c)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,i){return a(e,i,t)}),{})};var c=a;e.exports=c},221:function(e,t,i){function n(e){return Array.isArray?Array.isArray(e):"[object Array]"===l(e)}function r(e){return"string"==typeof e}function s(e){return"number"==typeof e}function o(e){return"object"==typeof e}function a(e){return null!=e}function c(e){return!e.trim().length}function l(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}i.r(t),i.d(t,{default:function(){return R}});const h=Object.prototype.hasOwnProperty;class u{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let i=d(e);t+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function d(e){let t=null,i=null,s=null,o=1,a=null;if(r(e)||n(e))s=e,t=p(e),i=f(e);else{if(!h.call(e,"name"))throw new Error("Missing name property in key");const n=e.name;if(s=n,h.call(e,"weight")&&(o=e.weight,o<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(n));t=p(n),i=f(n),a=e.getFn}return{path:t,id:i,weight:o,src:s,getFn:a}}function p(e){return n(e)?e:e.split(".")}function f(e){return n(e)?e.join("."):e}var m={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx{if(a(e))if(t[u]){const d=e[t[u]];if(!a(d))return;if(u===t.length-1&&(r(d)||s(d)||function(e){return!0===e||!1===e||function(e){return o(e)&&null!==e}(e)&&"[object Boolean]"==l(e)}(d)))i.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(d));else if(n(d)){c=!0;for(let e=0,i=d.length;e{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,r(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();r(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t{let o=t.getFn?t.getFn(e):this.getFn(e,t.path);if(a(o))if(n(o)){let e=[];const t=[{nestedArrIndex:-1,value:o}];for(;t.length;){const{nestedArrIndex:i,value:s}=t.pop();if(a(s))if(r(s)&&!c(s)){let t={v:s,i:i,n:this.norm.get(s)};e.push(t)}else n(s)&&s.forEach(((e,i)=>{t.push({nestedArrIndex:i,value:e})}))}i.$[s]=e}else if(r(o)&&!c(o)){let e={v:o,n:this.norm.get(o)};i.$[s]=e}})),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function _(e,t,{getFn:i=m.getFn,fieldNormWeight:n=m.fieldNormWeight}={}){const r=new g({getFn:i,fieldNormWeight:n});return r.setKeys(e.map(d)),r.setSources(t),r.create(),r}function y(e,{errors:t=0,currentLocation:i=0,expectedLocation:n=0,distance:r=m.distance,ignoreLocation:s=m.ignoreLocation}={}){const o=t/e.length;if(s)return o;const a=Math.abs(n-i);return r?o+a/r:a?1:o}const E=32;function b(e){let t={};for(let i=0,n=e.length;i{this.chunks.push({pattern:e,alphabet:b(e),startIndex:t})},h=this.pattern.length;if(h>E){let e=0;const t=h%E,i=h-t;for(;e{const{isMatch:f,score:v,indices:g}=function(e,t,i,{location:n=m.location,distance:r=m.distance,threshold:s=m.threshold,findAllMatches:o=m.findAllMatches,minMatchCharLength:a=m.minMatchCharLength,includeMatches:c=m.includeMatches,ignoreLocation:l=m.ignoreLocation}={}){if(t.length>E)throw new Error("Pattern length exceeds max of 32.");const h=t.length,u=e.length,d=Math.max(0,Math.min(n,u));let p=s,f=d;const v=a>1||c,g=v?Array(u):[];let _;for(;(_=e.indexOf(t,f))>-1;){let e=y(t,{currentLocation:_,expectedLocation:d,distance:r,ignoreLocation:l});if(p=Math.min(e,p),f=_+h,v){let e=0;for(;e=c;s-=1){let o=s-1,a=i[e.charAt(o)];if(v&&(g[o]=+!!a),_[s]=(_[s+1]<<1|1)&a,n&&(_[s]|=(b[s+1]|b[s])<<1|1|b[s+1]),_[s]&I&&(S=y(t,{errors:n,currentLocation:o,expectedLocation:d,distance:r,ignoreLocation:l}),S<=p)){if(p=S,f=o,f<=d)break;c=Math.max(1,2*d-f)}}if(y(t,{errors:n+1,currentLocation:d,expectedLocation:d,distance:r,ignoreLocation:l})>p)break;b=_}const C={isMatch:f>=0,score:Math.max(.001,S)};if(v){const e=function(e=[],t=m.minMatchCharLength){let i=[],n=-1,r=-1,s=0;for(let o=e.length;s=t&&i.push([n,r]),n=-1)}return e[s-1]&&s-n>=t&&i.push([n,s-1]),i}(g,a);e.length?c&&(C.indices=e):C.isMatch=!1}return C}(e,t,d,{location:n+p,distance:r,threshold:s,findAllMatches:o,minMatchCharLength:a,includeMatches:i,ignoreLocation:c});f&&(u=!0),h+=v,f&&g&&(l=[...l,...g])}));let d={isMatch:u,score:u?h/this.chunks.length:1};return u&&i&&(d.indices=l),d}}class O{constructor(e){this.pattern=e}static isMultiMatch(e){return I(e,this.multiRegex)}static isSingleMatch(e){return I(e,this.singleRegex)}search(){}}function I(e,t){const i=e.match(t);return i?i[1]:null}class C extends O{constructor(e,{location:t=m.location,threshold:i=m.threshold,distance:n=m.distance,includeMatches:r=m.includeMatches,findAllMatches:s=m.findAllMatches,minMatchCharLength:o=m.minMatchCharLength,isCaseSensitive:a=m.isCaseSensitive,ignoreLocation:c=m.ignoreLocation}={}){super(e),this._bitapSearch=new S(e,{location:t,threshold:i,distance:n,includeMatches:r,findAllMatches:s,minMatchCharLength:o,isCaseSensitive:a,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class T extends O{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,i=0;const n=[],r=this.pattern.length;for(;(t=e.indexOf(this.pattern,i))>-1;)i=t+r,n.push([t,i-1]);const s=!!n.length;return{isMatch:s,score:s?0:1,indices:n}}}const L=[class extends O{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},T,class extends O{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends O{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends O{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends O{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends O{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},C],w=L.length,A=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,M=new Set([C.type,T.type]);const P=[];function x(e,t){for(let i=0,n=P.length;i!(!e.$and&&!e.$or),j=e=>({[N]:Object.keys(e).map((t=>({[t]:e[t]})))});function F(e,t,{auto:i=!0}={}){const s=e=>{let a=Object.keys(e);const c=(e=>!!e.$path)(e);if(!c&&a.length>1&&!D(e))return s(j(e));if((e=>!n(e)&&o(e)&&!D(e))(e)){const n=c?e.$path:a[0],s=c?e.$val:e[n];if(!r(s))throw new Error((e=>`Invalid value for key ${e}`)(n));const o={keyId:f(n),pattern:s};return i&&(o.searcher=x(s,t)),o}let l={children:[],operator:a[0]};return a.forEach((t=>{const i=e[t];n(i)&&i.forEach((e=>{l.children.push(s(e))}))})),l};return D(e)||(e=j(e)),s(e)}function k(e,t){const i=e.matches;t.matches=[],a(i)&&i.forEach((e=>{if(!a(e.indices)||!e.indices.length)return;const{indices:i,value:n}=e;let r={indices:i,value:n};e.key&&(r.key=e.key.src),e.idx>-1&&(r.refIndex=e.idx),t.matches.push(r)}))}function K(e,t){t.score=e.score}class R{constructor(e,t={},i){this.options={...m,...t},this.options.useExtendedSearch,this._keyStore=new u(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof g))throw new Error("Incorrect 'index' type");this._myIndex=t||_(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){a(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let i=0,n=this._docs.length;i{let i=1;e.matches.forEach((({key:e,norm:n,score:r})=>{const s=e?e.weight:null;i*=Math.pow(0===r&&s?Number.EPSILON:r,(s||1)*(t?1:n))})),e.score=i}))}(l,{ignoreFieldNorm:c}),o&&l.sort(a),s(t)&&t>-1&&(l=l.slice(0,t)),function(e,t,{includeMatches:i=m.includeMatches,includeScore:n=m.includeScore}={}){const r=[];return i&&r.push(k),n&&r.push(K),e.map((e=>{const{idx:i}=e,n={item:t[i],refIndex:i};return r.length&&r.forEach((t=>{t(e,n)})),n}))}(l,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){const t=x(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach((({v:e,i:i,n:r})=>{if(!a(e))return;const{isMatch:s,score:o,indices:c}=t.searchIn(e);s&&n.push({item:e,idx:i,matches:[{score:o,value:e,norm:r,indices:c}]})})),n}_searchLogical(e){const t=F(e,this.options),i=(e,t,n)=>{if(!e.children){const{keyId:i,searcher:r}=e,s=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:r});return s&&s.length?[{idx:n,item:t,matches:s}]:[]}const r=[];for(let s=0,o=e.children.length;s{if(a(e)){let o=i(t,e,n);o.length&&(r[n]||(r[n]={idx:n,item:e,matches:[]},s.push(r[n])),o.forEach((({matches:e})=>{r[n].matches.push(...e)})))}})),s}_searchObjectList(e){const t=x(e,this.options),{keys:i,records:n}=this._myIndex,r=[];return n.forEach((({$:e,i:n})=>{if(!a(e))return;let s=[];i.forEach(((i,n)=>{s.push(...this._findMatches({key:i,value:e[n],searcher:t}))})),s.length&&r.push({idx:n,item:e,matches:s})})),r}_findMatches({key:e,value:t,searcher:i}){if(!a(t))return[];let r=[];if(n(t))t.forEach((({v:t,i:n,n:s})=>{if(!a(t))return;const{isMatch:o,score:c,indices:l}=i.searchIn(t);o&&r.push({score:c,key:e,value:t,idx:n,norm:s,indices:l})}));else{const{v:n,n:s}=t,{isMatch:o,score:a,indices:c}=i.searchIn(n);o&&r.push({score:a,key:e,value:n,norm:s,indices:c})}return r}}R.version="6.6.2",R.createIndex=_,R.parseIndex=function(e,{getFn:t=m.getFn,fieldNormWeight:i=m.fieldNormWeight}={}){const{keys:n,records:r}=e,s=new g({getFn:t,fieldNormWeight:i});return s.setKeys(n),s.setIndexRecords(r),s},R.config=m,R.parseQuery=F,function(...e){P.push(...e)}(class{constructor(e,{isCaseSensitive:t=m.isCaseSensitive,includeMatches:i=m.includeMatches,minMatchCharLength:n=m.minMatchCharLength,ignoreLocation:r=m.ignoreLocation,findAllMatches:s=m.findAllMatches,location:o=m.location,threshold:a=m.threshold,distance:c=m.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:i,minMatchCharLength:n,findAllMatches:s,ignoreLocation:r,location:o,threshold:a,distance:c},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split("|").map((e=>{let i=e.trim().split(A).filter((e=>e&&!!e.trim())),n=[];for(let e=0,r=i.length;e/g,">").replace(/=0&&!window.matchMedia("(min-height: ".concat(e+1,"px)")).matches:"top"===this.position&&(i=!0),i},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype.open=function(e,t){F(this.element,this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(e,t)&&(F(this.element,this.classNames.flippedState),this.isFlipped=!0)},e.prototype.close=function(){D(this.element,this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(D(this.element,this.classNames.flippedState),this.isFlipped=!1)},e.prototype.addFocusState=function(){F(this.element,this.classNames.focusState)},e.prototype.removeFocusState=function(){D(this.element,this.classNames.focusState)},e.prototype.enable=function(){D(this.element,this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.type===_&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},e.prototype.disable=function(){F(this.element,this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.type===_&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},e.prototype.wrap=function(e){var t=this.element,i=e.parentNode;i&&(e.nextSibling?i.insertBefore(t,e.nextSibling):i.appendChild(t)),t.appendChild(e)},e.prototype.unwrap=function(e){var t=this.element,i=t.parentNode;i&&(i.insertBefore(e,t),i.removeChild(t))},e.prototype.addLoadingState=function(){F(this.element,this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},e.prototype.removeLoadingState=function(){D(this.element,this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},e}(),K=function(){function e(e){var t=e.element,i=e.type,n=e.classNames,s=e.preventPaste;this.element=t,this.type=i,this.classNames=n,this.preventPaste=s,this.isFocussed=this.element.isEqualNode(document.activeElement),this.isDisabled=t.disabled,this._onPaste=this._onPaste.bind(this),this._onInput=this._onInput.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}return Object.defineProperty(e.prototype,"placeholder",{set:function(e){this.element.placeholder=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.addEventListeners=function(){var e=this.element;e.addEventListener("paste",this._onPaste),e.addEventListener("input",this._onInput,{passive:!0}),e.addEventListener("focus",this._onFocus,{passive:!0}),e.addEventListener("blur",this._onBlur,{passive:!0})},e.prototype.removeEventListeners=function(){var e=this.element;e.removeEventListener("input",this._onInput),e.removeEventListener("paste",this._onPaste),e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur)},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.isDisabled=!0},e.prototype.focus=function(){this.isFocussed||this.element.focus()},e.prototype.blur=function(){this.isFocussed&&this.element.blur()},e.prototype.clear=function(e){return void 0===e&&(e=!0),this.element.value="",e&&this.setWidth(),this},e.prototype.setWidth=function(){var e=this.element;e.style.minWidth="".concat(e.placeholder.length+1,"ch"),e.style.width="".concat(e.value.length+1,"ch")},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype._onInput=function(){this.type!==_&&this.setWidth()},e.prototype._onPaste=function(e){this.preventPaste&&e.preventDefault()},e.prototype._onFocus=function(){this.isFocussed=!0},e.prototype._onBlur=function(){this.isFocussed=!1},e}(),B=function(){function e(e){this.element=e.element,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight}return e.prototype.prepend=function(e){var t=this.element.firstElementChild;t?this.element.insertBefore(e,t):this.element.append(e)},e.prototype.scrollToTop=function(){this.element.scrollTop=0},e.prototype.scrollToChildElement=function(e,t){var i=this;if(e){var n=t>0?this.element.scrollTop+(e.offsetTop+e.offsetHeight)-(this.element.scrollTop+this.element.offsetHeight):e.offsetTop;requestAnimationFrame((function(){i._animateScroll(n,t)}))}},e.prototype._scrollDown=function(e,t,i){var n=(i-e)/t;this.element.scrollTop=e+(n>1?n:1)},e.prototype._scrollUp=function(e,t,i){var n=(e-i)/t;this.element.scrollTop=e-(n>1?n:1)},e.prototype._animateScroll=function(e,t){var i=this,n=this.element.scrollTop,s=!1;t>0?(this._scrollDown(n,4,e),ne&&(s=!0)),s&&requestAnimationFrame((function(){i._animateScroll(e,t)}))},e}(),V=function(){function e(e){var t=e.classNames;this.element=e.element,this.classNames=t,this.isDisabled=!1}return Object.defineProperty(e.prototype,"isActive",{get:function(){return"active"===this.element.dataset.choice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.setAttribute("value",e),this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.conceal=function(){var e=this.element;F(e,this.classNames.input),e.hidden=!0,e.tabIndex=-1;var t=e.getAttribute("style");t&&e.setAttribute("data-choice-orig-style",t),e.setAttribute("data-choice","active")},e.prototype.reveal=function(){var e=this.element;D(e,this.classNames.input),e.hidden=!1,e.removeAttribute("tabindex");var t=e.getAttribute("data-choice-orig-style");t?(e.removeAttribute("data-choice-orig-style"),e.setAttribute("style",t)):e.removeAttribute("style"),e.removeAttribute("data-choice")},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},e.prototype.triggerEvent=function(e,t){var i;void 0===(i=t||{})&&(i=null),this.element.dispatchEvent(new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}))},e}(),H=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i}(V),$=function(e,t){return void 0===t&&(t=!0),void 0===e?t:!!e},q=function(e){if("string"==typeof e&&(e=e.split(" ").filter((function(e){return e.length}))),Array.isArray(e)&&e.length)return e},W=function(e,t){if("string"==typeof e)return W({value:e,label:e},!1);var i=e;if("choices"in i){if(!t)throw new TypeError("optGroup is not allowed");var n=i,s=n.choices.map((function(e){return W(e,!1)}));return{id:0,label:O(n.label)||n.value,active:!!s.length,disabled:!!n.disabled,choices:s}}var o=i;return{id:0,group:null,score:0,rank:0,value:o.value,label:o.label||o.value,active:$(o.active),selected:$(o.selected,!1),disabled:$(o.disabled,!1),placeholder:$(o.placeholder,!1),highlighted:!1,labelClass:q(o.labelClass),labelDescription:o.labelDescription,customProperties:o.customProperties}},U=function(e){return"SELECT"===e.tagName},G=function(e){function i(t){var i=t.template,n=t.extractPlaceholder,s=e.call(this,{element:t.element,classNames:t.classNames})||this;return s.template=i,s.extractPlaceholder=n,s}return t(i,e),Object.defineProperty(i.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),i.prototype.addOptions=function(e){var t=this,i=document.createDocumentFragment();e.forEach((function(e){var n=e;if(!n.element){var s=t.template(n);i.appendChild(s),n.element=s}})),this.element.appendChild(i)},i.prototype.optionsAsChoices=function(){var e=this,t=[];return this.element.querySelectorAll(":scope > option, :scope > optgroup").forEach((function(i){!function(e){return"OPTION"===e.tagName}(i)?function(e){return"OPTGROUP"===e.tagName}(i)&&t.push(e._optgroupToChoice(i)):t.push(e._optionToChoice(i))})),t},i.prototype._optionToChoice=function(e){return!e.hasAttribute("value")&&e.hasAttribute("placeholder")&&(e.setAttribute("value",""),e.value=""),{id:0,group:null,score:0,rank:0,value:e.value,label:e.innerHTML,element:e,active:!0,selected:this.extractPlaceholder?e.selected:e.hasAttribute("selected"),disabled:e.disabled,highlighted:!1,placeholder:this.extractPlaceholder&&(!e.value||e.hasAttribute("placeholder")),labelClass:void 0!==e.dataset.labelClass?q(e.dataset.labelClass):void 0,labelDescription:void 0!==e.dataset.labelDescription?e.dataset.labelDescription:void 0,customProperties:P(e.dataset.customProperties)}},i.prototype._optgroupToChoice=function(e){var t=this,i=e.querySelectorAll("option"),n=Array.from(i).map((function(e){return t._optionToChoice(e)}));return{id:0,label:e.label||"",element:e,active:!!n.length,disabled:e.disabled,choices:n}},i}(V),z={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,closeDropdownOnSelect:"auto",singleModeForMultiSelect:!1,addChoices:!1,addItems:!0,addItemFilter:function(e){return!!e&&""!==e},removeItems:!0,removeItemButton:!1,removeItemButtonAlignLeft:!1,editItems:!1,allowHTML:!1,allowHtmlUserInput:!1,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:function(e,t){var i=e.label,n=t.label,s=void 0===n?t.value:n;return O(void 0===i?e.value:i).localeCompare(O(s),[],{sensitivity:"base",ignorePunctuation:!0,numeric:!0})},shadowRoot:null,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(e){return'Press Enter to add "'.concat(e,'"')},removeItemIconText:function(){return"Remove item"},removeItemLabelText:function(e){return"Remove item: ".concat(e)},maxItemText:function(e){return"Only ".concat(e," values can be added")},valueComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},labelId:"",callbackOnInit:null,callbackOnCreateTemplates:null,classNames:{containerOuter:["choices"],containerInner:["choices__inner"],input:["choices__input"],inputCloned:["choices__input--cloned"],list:["choices__list"],listItems:["choices__list--multiple"],listSingle:["choices__list--single"],listDropdown:["choices__list--dropdown"],item:["choices__item"],itemSelectable:["choices__item--selectable"],itemDisabled:["choices__item--disabled"],itemChoice:["choices__item--choice"],description:["choices__description"],placeholder:["choices__placeholder"],group:["choices__group"],groupHeading:["choices__heading"],button:["choices__button"],activeState:["is-active"],focusState:["is-focused"],openState:["is-open"],disabledState:["is-disabled"],highlightedState:["is-highlighted"],selectedState:["is-selected"],flippedState:["is-flipped"],loadingState:["is-loading"],notice:["choices__notice"],addChoice:["choices__item--selectable","add-choice"],noResults:["has-no-results"],noChoices:["has-no-choices"]},appendGroupInSearch:!1},J=function(e){var t=e.itemEl;t&&(t.remove(),e.itemEl=void 0)},X={groups:function(e,t){var i=e,n=!0;switch(t.type){case l:i.push(t.group);break;case h:i=[];break;default:n=!1}return{state:i,update:n}},items:function(e,t,i){var n=e,s=!0;switch(t.type){case u:t.item.selected=!0,(o=t.item.element)&&(o.selected=!0,o.setAttribute("selected","")),n.push(t.item);break;case d:var o;if(t.item.selected=!1,o=t.item.element){o.selected=!1,o.removeAttribute("selected");var c=o.parentElement;c&&U(c)&&c.type===_&&(c.value="")}J(t.item),n=n.filter((function(e){return e.id!==t.item.id}));break;case r:J(t.choice),n=n.filter((function(e){return e.id!==t.choice.id}));break;case p:var a=t.highlighted,h=n.find((function(e){return e.id===t.item.id}));h&&h.highlighted!==a&&(h.highlighted=a,i&&function(e,t,i){var n=e.itemEl;n&&(D(n,i),F(n,t))}(h,a?i.classNames.highlightedState:i.classNames.selectedState,a?i.classNames.selectedState:i.classNames.highlightedState));break;default:s=!1}return{state:n,update:s}},choices:function(e,t,i){var n=e,s=!0;switch(t.type){case o:n.push(t.choice);break;case r:t.choice.choiceEl=void 0,t.choice.group&&(t.choice.group.choices=t.choice.group.choices.filter((function(e){return e.id!==t.choice.id}))),n=n.filter((function(e){return e.id!==t.choice.id}));break;case u:case d:t.item.choiceEl=void 0;break;case c:var l=[];t.results.forEach((function(e){l[e.item.id]=e})),n.forEach((function(e){var t=l[e.id];void 0!==t?(e.score=t.score,e.rank=t.rank,e.active=!0):(e.score=0,e.rank=0,e.active=!1),i&&i.appendGroupInSearch&&(e.choiceEl=void 0)}));break;case a:n.forEach((function(e){e.active=t.active,i&&i.appendGroupInSearch&&(e.choiceEl=void 0)}));break;case h:n=[];break;default:s=!1}return{state:n,update:s}}},Q=function(){function e(e){this._state=this.defaultState,this._listeners=[],this._txn=0,this._context=e}return Object.defineProperty(e.prototype,"defaultState",{get:function(){return{groups:[],items:[],choices:[]}},enumerable:!1,configurable:!0}),e.prototype.changeSet=function(e){return{groups:e,items:e,choices:e}},e.prototype.reset=function(){this._state=this.defaultState;var e=this.changeSet(!0);this._txn?this._changeSet=e:this._listeners.forEach((function(t){return t(e)}))},e.prototype.subscribe=function(e){return this._listeners.push(e),this},e.prototype.dispatch=function(e){var t=this,i=this._state,n=!1,s=this._changeSet||this.changeSet(!1);Object.keys(X).forEach((function(o){var r=X[o](i[o],e,t._context);r.update&&(n=!0,s[o]=!0,i[o]=r.state)})),n&&(this._txn?this._changeSet=s:this._listeners.forEach((function(e){return e(s)})))},e.prototype.withTxn=function(e){this._txn++;try{e()}finally{if(this._txn=Math.max(0,this._txn-1),!this._txn){var t=this._changeSet;t&&(this._changeSet=void 0,this._listeners.forEach((function(e){return e(t)})))}}},Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this.state.items},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"highlightedActiveItems",{get:function(){return this.items.filter((function(e){return!e.disabled&&e.active&&e.highlighted}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"choices",{get:function(){return this.state.choices},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeChoices",{get:function(){return this.choices.filter((function(e){return e.active}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"searchableChoices",{get:function(){return this.choices.filter((function(e){return!e.disabled&&!e.placeholder}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groups",{get:function(){return this.state.groups},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeGroups",{get:function(){var e=this;return this.state.groups.filter((function(t){var i=t.active&&!t.disabled,n=e.state.choices.some((function(e){return e.active&&!e.disabled}));return i&&n}),[])},enumerable:!1,configurable:!0}),e.prototype.inTxn=function(){return this._txn>0},e.prototype.getChoiceById=function(e){return this.activeChoices.find((function(t){return t.id===e}))},e.prototype.getGroupById=function(e){return this.groups.find((function(t){return t.id===e}))},e}(),Y="no-choices",Z="no-results",ee="add-choice";function te(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function ie(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ne(e){for(var t=1;t`Missing ${e} property in key`,de=e=>`Property 'weight' in key '${e}' must be a positive integer`,pe=Object.prototype.hasOwnProperty;class fe{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let i=me(e);this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function me(e){let t=null,i=null,n=null,s=1,o=null;if(oe(e)||se(e))n=e,t=ge(e),i=ve(e);else{if(!pe.call(e,"name"))throw new Error(ue("name"));const r=e.name;if(n=r,pe.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(de(r));t=ge(r),i=ve(r),o=e.getFn}return{path:t,id:i,weight:s,src:n,getFn:o}}function ge(e){return se(e)?e:e.split(".")}function ve(e){return se(e)?e.join("."):e}const _e={useExtendedSearch:!1,getFn:function(e,t){let i=[],n=!1;const s=(e,t,o)=>{if(ae(e))if(t[o]){const r=e[t[o]];if(!ae(r))return;if(o===t.length-1&&(oe(r)||re(r)||function(e){return!0===e||!1===e||function(e){return ce(e)&&null!==e}(e)&&"[object Boolean]"==le(e)}(r)))i.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(r));else if(se(r)){n=!0;for(let e=0,i=r.length;ee.score===t.score?e.idx{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,oe(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();oe(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t{let s=t.getFn?t.getFn(e):this.getFn(e,t.path);if(ae(s))if(se(s)){let e=[];const t=[{nestedArrIndex:-1,value:s}];for(;t.length;){const{nestedArrIndex:i,value:n}=t.pop();if(ae(n))if(oe(n)&&!he(n)){let t={v:n,i:i,n:this.norm.get(n)};e.push(t)}else se(n)&&n.forEach(((e,i)=>{t.push({nestedArrIndex:i,value:e})}))}i.$[n]=e}else if(oe(s)&&!he(s)){let e={v:s,n:this.norm.get(s)};i.$[n]=e}})),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function Ce(e,t,{getFn:i=ye.getFn,fieldNormWeight:n=ye.fieldNormWeight}={}){const s=new Ee({getFn:i,fieldNormWeight:n});return s.setKeys(e.map(me)),s.setSources(t),s.create(),s}function Se(e,{errors:t=0,currentLocation:i=0,expectedLocation:n=0,distance:s=ye.distance,ignoreLocation:o=ye.ignoreLocation}={}){const r=t/e.length;if(o)return r;const c=Math.abs(n-i);return s?r+c/s:c?1:r}const we=32;function Ie(e){let t={};for(let i=0,n=e.length;i{this.chunks.push({pattern:e,alphabet:Ie(e),startIndex:t})},l=this.pattern.length;if(l>we){let e=0;const t=l%we,i=l-t;for(;e{const{isMatch:f,score:m,indices:g}=function(e,t,i,{location:n=ye.location,distance:s=ye.distance,threshold:o=ye.threshold,findAllMatches:r=ye.findAllMatches,minMatchCharLength:c=ye.minMatchCharLength,includeMatches:a=ye.includeMatches,ignoreLocation:h=ye.ignoreLocation}={}){if(t.length>we)throw new Error("Pattern length exceeds max of 32.");const l=t.length,u=e.length,d=Math.max(0,Math.min(n,u));let p=o,f=d;const m=c>1||a,g=m?Array(u):[];let v;for(;(v=e.indexOf(t,f))>-1;){let e=Se(t,{currentLocation:v,expectedLocation:d,distance:s,ignoreLocation:h});if(p=Math.min(e,p),f=v+l,m){let e=0;for(;e=a;o-=1){let r=o-1,c=i[e.charAt(r)];if(m&&(g[r]=+!!c),C[o]=(C[o+1]<<1|1)&c,n&&(C[o]|=(_[o+1]|_[o])<<1|1|_[o+1]),C[o]&E&&(y=Se(t,{errors:n,currentLocation:r,expectedLocation:d,distance:s,ignoreLocation:h}),y<=p)){if(p=y,f=r,f<=d)break;a=Math.max(1,2*d-f)}}if(Se(t,{errors:n+1,currentLocation:d,expectedLocation:d,distance:s,ignoreLocation:h})>p)break;_=C}const C={isMatch:f>=0,score:Math.max(.001,y)};if(m){const e=function(e=[],t=ye.minMatchCharLength){let i=[],n=-1,s=-1,o=0;for(let r=e.length;o=t&&i.push([n,s]),n=-1)}return e[o-1]&&o-n>=t&&i.push([n,o-1]),i}(g,c);e.length?a&&(C.indices=e):C.isMatch=!1}return C}(e,t,d,{location:n+p,distance:s,threshold:o,findAllMatches:r,minMatchCharLength:c,includeMatches:i,ignoreLocation:a});f&&(u=!0),l+=m,f&&g&&(h=[...h,...g])}));let d={isMatch:u,score:u?l/this.chunks.length:1};return u&&i&&(d.indices=h),d}}class Ae{constructor(e){this.pattern=e}static isMultiMatch(e){return Oe(e,this.multiRegex)}static isSingleMatch(e){return Oe(e,this.singleRegex)}search(){}}function Oe(e,t){const i=e.match(t);return i?i[1]:null}class Le extends Ae{constructor(e,{location:t=ye.location,threshold:i=ye.threshold,distance:n=ye.distance,includeMatches:s=ye.includeMatches,findAllMatches:o=ye.findAllMatches,minMatchCharLength:r=ye.minMatchCharLength,isCaseSensitive:c=ye.isCaseSensitive,ignoreLocation:a=ye.ignoreLocation}={}){super(e),this._bitapSearch=new xe(e,{location:t,threshold:i,distance:n,includeMatches:s,findAllMatches:o,minMatchCharLength:r,isCaseSensitive:c,ignoreLocation:a})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Me extends Ae{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,i=0;const n=[],s=this.pattern.length;for(;(t=e.indexOf(this.pattern,i))>-1;)i=t+s,n.push([t,i-1]);const o=!!n.length;return{isMatch:o,score:o?0:1,indices:n}}}const Te=[class extends Ae{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},Me,class extends Ae{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends Ae{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends Ae{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends Ae{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends Ae{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},Le],Ne=Te.length,ke=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Fe=new Set([Le.type,Me.type]);const De=[];function Pe(e,t){for(let i=0,n=De.length;i!(!e[je]&&!e.$or),Be=e=>({[je]:Object.keys(e).map((t=>({[t]:e[t]})))});function Ve(e,t,{auto:i=!0}={}){const n=e=>{let s=Object.keys(e);const o=(e=>!!e[Re])(e);if(!o&&s.length>1&&!Ke(e))return n(Be(e));if((e=>!se(e)&&ce(e)&&!Ke(e))(e)){const n=o?e[Re]:s[0],r=o?e.$val:e[n];if(!oe(r))throw new Error((e=>`Invalid value for key ${e}`)(n));const c={keyId:ve(n),pattern:r};return i&&(c.searcher=Pe(r,t)),c}let r={children:[],operator:s[0]};return s.forEach((t=>{const i=e[t];se(i)&&i.forEach((e=>{r.children.push(n(e))}))})),r};return Ke(e)||(e=Be(e)),n(e)}function He(e,t){const i=e.matches;t.matches=[],ae(i)&&i.forEach((e=>{if(!ae(e.indices)||!e.indices.length)return;const{indices:i,value:n}=e;let s={indices:i,value:n};e.key&&(s.key=e.key.src),e.idx>-1&&(s.refIndex=e.idx),t.matches.push(s)}))}function $e(e,t){t.score=e.score}class qe{constructor(e,t={},i){this.options=ne(ne({},ye),t),this._keyStore=new fe(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Ee))throw new Error("Incorrect 'index' type");this._myIndex=t||Ce(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){ae(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const t=[];for(let i=0,n=this._docs.length;i{let i=1;e.matches.forEach((({key:e,norm:n,score:s})=>{const o=e?e.weight:null;i*=Math.pow(0===s&&o?Number.EPSILON:s,(o||1)*(t?1:n))})),e.score=i}))}(c,{ignoreFieldNorm:r}),s&&c.sort(o),re(t)&&t>-1&&(c=c.slice(0,t)),function(e,t,{includeMatches:i=ye.includeMatches,includeScore:n=ye.includeScore}={}){const s=[];return i&&s.push(He),n&&s.push($e),e.map((e=>{const{idx:i}=e,n={item:t[i],refIndex:i};return s.length&&s.forEach((t=>{t(e,n)})),n}))}(c,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){const t=Pe(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach((({v:e,i:i,n:s})=>{if(!ae(e))return;const{isMatch:o,score:r,indices:c}=t.searchIn(e);o&&n.push({item:e,idx:i,matches:[{score:r,value:e,norm:s,indices:c}]})})),n}_searchLogical(e){const t=Ve(e,this.options),i=(e,t,n)=>{if(!e.children){const{keyId:i,searcher:s}=e,o=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:s});return o&&o.length?[{idx:n,item:t,matches:o}]:[]}const s=[];for(let o=0,r=e.children.length;o{if(ae(e)){let r=i(t,e,o);r.length&&(n[o]||(n[o]={idx:o,item:e,matches:[]},s.push(n[o])),r.forEach((({matches:e})=>{n[o].matches.push(...e)})))}})),s}_searchObjectList(e){const t=Pe(e,this.options),{keys:i,records:n}=this._myIndex,s=[];return n.forEach((({$:e,i:n})=>{if(!ae(e))return;let o=[];i.forEach(((i,n)=>{o.push(...this._findMatches({key:i,value:e[n],searcher:t}))})),o.length&&s.push({idx:n,item:e,matches:o})})),s}_findMatches({key:e,value:t,searcher:i}){if(!ae(t))return[];let n=[];if(se(t))t.forEach((({v:t,i:s,n:o})=>{if(!ae(t))return;const{isMatch:r,score:c,indices:a}=i.searchIn(t);r&&n.push({score:c,key:e,value:t,idx:s,norm:o,indices:a})}));else{const{v:s,n:o}=t,{isMatch:r,score:c,indices:a}=i.searchIn(s);r&&n.push({score:c,key:e,value:s,norm:o,indices:a})}return n}}qe.version="7.0.0",qe.createIndex=Ce,qe.parseIndex=function(e,{getFn:t=ye.getFn,fieldNormWeight:i=ye.fieldNormWeight}={}){const{keys:n,records:s}=e,o=new Ee({getFn:t,fieldNormWeight:i});return o.setKeys(n),o.setIndexRecords(s),o},qe.config=ye,qe.parseQuery=Ve,function(...e){De.push(...e)}(class{constructor(e,{isCaseSensitive:t=ye.isCaseSensitive,includeMatches:i=ye.includeMatches,minMatchCharLength:n=ye.minMatchCharLength,ignoreLocation:s=ye.ignoreLocation,findAllMatches:o=ye.findAllMatches,location:r=ye.location,threshold:c=ye.threshold,distance:a=ye.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:i,minMatchCharLength:n,findAllMatches:o,ignoreLocation:s,location:r,threshold:c,distance:a},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split("|").map((e=>{let i=e.trim().split(ke).filter((e=>e&&!!e.trim())),n=[];for(let e=0,s=i.length;e element"),this)},e.prototype.removeChoice=function(e){var t=this._store.choices.find((function(t){return t.value===e}));return t?(this._clearNotice(),this._store.dispatch(b(t)),this._searcher.reset(),t.selected&&this.passedElement.triggerEvent(m,this._getChoiceForOutput(t)),this):this},e.prototype.clearChoices=function(){var e=this;return this._store.withTxn((function(){e._store.choices.forEach((function(t){t.selected||e._store.dispatch(b(t))}))})),this._searcher.reset(),this},e.prototype.clearStore=function(e){return void 0===e&&(e=!0),this._stopSearch(),e&&this.passedElement.element.replaceChildren(""),this.itemList.element.replaceChildren(""),this.choiceList.element.replaceChildren(""),this._store.reset(),this._lastAddedChoiceId=0,this._lastAddedGroupId=0,this._searcher.reset(),this},e.prototype.clearInput=function(){return this.input.clear(!this._isSelectOneElement),this._stopSearch(),this},e.prototype._validateConfig=function(){var e,t,i,n=this.config,s=(e=z,t=Object.keys(n).sort(),i=Object.keys(e).sort(),t.filter((function(e){return i.indexOf(e)<0})));s.length&&console.warn("Unknown config option(s) passed",s.join(", ")),n.allowHTML&&n.allowHtmlUserInput&&(n.addItems&&console.warn("Warning: allowHTML/allowHtmlUserInput/addItems all being true is strongly not recommended and may lead to XSS attacks"),n.addChoices&&console.warn("Warning: allowHTML/allowHtmlUserInput/addChoices all being true is strongly not recommended and may lead to XSS attacks"))},e.prototype._render=function(e){void 0===e&&(e={choices:!0,groups:!0,items:!0}),this._store.inTxn()||(this._isSelectElement&&(e.choices||e.groups)&&this._renderChoices(),e.items&&this._renderItems())},e.prototype._renderChoices=function(){var e=this;if(this._canAddItems()){var t=this.config,i=this._isSearching,n=this._store,s=n.activeGroups,o=n.activeChoices,r=0;if(i&&t.searchResultLimit>0?r=t.searchResultLimit:t.renderChoiceLimit>0&&(r=t.renderChoiceLimit),this._isSelectElement){var c=o.filter((function(e){return!e.element}));c.length&&this.passedElement.addOptions(c)}var a=document.createDocumentFragment(),h=function(e){return e.filter((function(e){return!e.placeholder&&(i?!!e.rank:t.renderSelectedChoices||!e.selected)}))},l=!1,u=function(n,s,o){i?n.sort(T):t.shouldSort&&n.sort(t.sorter);var c=n.length;c=!s&&r&&c>r?r:c,c--,n.every((function(n,s){var r=n.choiceEl||e._templates.choice(t,n,t.itemSelectText,o);return n.choiceEl=r,a.appendChild(r),n.disabled||!i&&n.selected||(l=!0),s1){var h=i.querySelector(k(n.classNames.placeholder));h&&h.remove()}else a||(c=!0,r(W({selected:!0,value:"",label:n.placeholderValue||"",placeholder:!0},!1)))}c&&(i.append(s),n.shouldSortItems&&!this._isSelectOneElement&&(t.sort(n.sorter),t.forEach((function(e){var t=o(e);t&&(t.remove(),s.append(t))})),i.append(s))),this._isTextElement&&(this.passedElement.value=t.map((function(e){return e.value})).join(n.delimiter))},e.prototype._displayNotice=function(e,t,i){void 0===i&&(i=!0);var n=this._notice;n&&(n.type===t&&n.text===e||n.type===ee&&(t===Z||t===Y))?i&&this.showDropdown(!0):(this._clearNotice(),this._notice=e?{text:e,type:t}:void 0,this._renderNotice(),i&&e&&this.showDropdown(!0))},e.prototype._clearNotice=function(){if(this._notice){var e=this.choiceList.element.querySelector(k(this.config.classNames.notice));e&&e.remove(),this._notice=void 0}},e.prototype._renderNotice=function(e){var t=this._notice;if(t){var i=this._templates.notice(this.config,t.text,t.type);e?e.append(i):this.choiceList.prepend(i)}},e.prototype._getChoiceForOutput=function(e,t){return{id:e.id,highlighted:e.highlighted,labelClass:e.labelClass,labelDescription:e.labelDescription,customProperties:e.customProperties,disabled:e.disabled,active:e.active,label:e.label,placeholder:e.placeholder,value:e.value,groupValue:e.group?e.group.label:void 0,element:e.element,keyCode:t}},e.prototype._triggerChange=function(e){null!=e&&this.passedElement.triggerEvent("change",{value:e})},e.prototype._handleButtonAction=function(e){var t=this,i=this._store.items;if(i.length&&this.config.removeItems&&this.config.removeItemButton){var n=e&&Qe(e.parentElement),s=n&&i.find((function(e){return e.id===n}));s&&this._store.withTxn((function(){if(t._removeItem(s),t._triggerChange(s.value),t._isSelectOneElement&&!t._hasNonChoicePlaceholder){var e=t._store.choices.reverse().find((function(e){return!e.disabled&&e.placeholder}));e&&(t._addItem(e),t.unhighlightAll(),e.value&&t._triggerChange(e.value))}}))}},e.prototype._handleItemAction=function(e,t){var i=this;void 0===t&&(t=!1);var n=this._store.items;if(n.length&&this.config.removeItems&&!this._isSelectOneElement){var s=Qe(e);s&&(n.forEach((function(e){e.id!==s||e.highlighted?!t&&e.highlighted&&i.unhighlightItem(e):i.highlightItem(e)})),this.input.focus())}},e.prototype._handleChoiceAction=function(e){var t=this,i=Qe(e),n=i&&this._store.getChoiceById(i);if(!n||n.disabled)return!1;var s=this.dropdown.isActive;if(!n.selected){if(!this._canAddItems())return!0;this._store.withTxn((function(){t._addItem(n,!0,!0),t.clearInput(),t.unhighlightAll()})),this._triggerChange(n.value)}return s&&this.config.closeDropdownOnSelect&&(this.hideDropdown(!0),this.containerOuter.element.focus()),!0},e.prototype._handleBackspace=function(e){var t=this.config;if(t.removeItems&&e.length){var i=e[e.length-1],n=e.some((function(e){return e.highlighted}));t.editItems&&!n&&i?(this.input.value=i.value,this.input.setWidth(),this._removeItem(i),this._triggerChange(i.value)):(n||this.highlightItem(i,!1),this.removeHighlightedItems(!0))}},e.prototype._loadChoices=function(){var e,t=this.config;if(this._isTextElement){if(this._presetChoices=t.items.map((function(e){return W(e,!1)})),this.passedElement.value){var i=this.passedElement.value.split(t.delimiter).map((function(e){return W(e,!1)}));this._presetChoices=this._presetChoices.concat(i)}this._presetChoices.forEach((function(e){e.selected=!0}))}else if(this._isSelectElement){this._presetChoices=t.choices.map((function(e){return W(e,!0)}));var n=this.passedElement.optionsAsChoices();n&&(e=this._presetChoices).push.apply(e,n)}},e.prototype._handleLoadingState=function(e){void 0===e&&(e=!0);var t=this.itemList.element;e?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?t.replaceChildren(this._templates.placeholder(this.config,this.config.loadingText)):this.input.placeholder=this.config.loadingText):(this.enable(),this.containerOuter.removeLoadingState(),this._isSelectOneElement?(t.replaceChildren(""),this._render()):this.input.placeholder=this._placeholderValue||"")},e.prototype._handleSearch=function(e){if(this.input.isFocussed)if(null!=e&&e.length>=this.config.searchFloor){var t=this.config.searchChoices?this._searchChoices(e):0;null!==t&&this.passedElement.triggerEvent(f,{value:e,resultCount:t})}else this._store.choices.some((function(e){return!e.active}))&&this._stopSearch()},e.prototype._canAddItems=function(){var e=this.config,t=e.maxItemCount,i=e.maxItemText;return!(!e.singleModeForMultiSelect&&t>0&&t<=this._store.items.length&&(this.choiceList.element.replaceChildren(""),this._displayNotice("function"==typeof i?i(t):i,ee),1))},e.prototype._canCreateItem=function(e){var t=this.config,i=!0,n="";if(i&&"function"==typeof t.addItemFilter&&!t.addItemFilter(e)&&(i=!1,n=x(t.customAddItemText,e)),i){var s=this._store.choices.find((function(i){return t.valueComparer(i.value,e)}));if(this._isSelectElement){if(s)return this._displayNotice("",ee),!1}else this._isTextElement&&!t.duplicateItemsAllowed&&s&&(i=!1,n=x(t.uniqueItemText,e))}return i&&(n=x(t.addItemText,e)),n&&this._displayNotice(n,ee),i},e.prototype._searchChoices=function(e){var t=e.trim().replace(/\s{2,}/," ");if(!t.length||t===this._currentValue)return null;var i=this._searcher;i.isEmptyIndex()&&i.index(this._store.searchableChoices);var n=i.search(t);this._currentValue=t,this._highlightPosition=0,this._isSearching=!0;var s=this._notice;return(s&&s.type)!==ee&&(n.length?this._clearNotice():this._displayNotice(A(this.config.noResultsText),Z)),this._store.dispatch(function(e){return{type:c,results:e}}(n)),n.length},e.prototype._stopSearch=function(){this._isSearching&&(this._currentValue="",this._isSearching=!1,this._clearNotice(),this._store.dispatch({type:a,active:!0}),this.passedElement.triggerEvent(f,{value:"",resultCount:0}))},e.prototype._addEventListeners=function(){var e=this._docRoot,t=this.containerOuter.element,i=this.input.element;e.addEventListener("touchend",this._onTouchEnd,!0),t.addEventListener("keydown",this._onKeyDown,!0),t.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("click",this._onClick,{passive:!0}),e.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(t.addEventListener("focus",this._onFocus,{passive:!0}),t.addEventListener("blur",this._onBlur,{passive:!0})),i.addEventListener("keyup",this._onKeyUp,{passive:!0}),i.addEventListener("input",this._onInput,{passive:!0}),i.addEventListener("focus",this._onFocus,{passive:!0}),i.addEventListener("blur",this._onBlur,{passive:!0}),i.form&&i.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},e.prototype._removeEventListeners=function(){var e=this._docRoot,t=this.containerOuter.element,i=this.input.element;e.removeEventListener("touchend",this._onTouchEnd,!0),t.removeEventListener("keydown",this._onKeyDown,!0),t.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("click",this._onClick),e.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(t.removeEventListener("focus",this._onFocus),t.removeEventListener("blur",this._onBlur)),i.removeEventListener("keyup",this._onKeyUp),i.removeEventListener("input",this._onInput),i.removeEventListener("focus",this._onFocus),i.removeEventListener("blur",this._onBlur),i.form&&i.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},e.prototype._onKeyDown=function(e){var t=e.keyCode,i=this.dropdown.isActive,n=1===e.key.length||2===e.key.length&&e.key.charCodeAt(0)>=55296||"Unidentified"===e.key;switch(this._isTextElement||i||(this.showDropdown(),!this.input.isFocussed&&n&&(this.input.value+=e.key," "===e.key&&e.preventDefault())),t){case 65:return this._onSelectKey(e,this.itemList.element.hasChildNodes());case 13:return this._onEnterKey(e,i);case 27:return this._onEscapeKey(e,i);case 38:case 33:case 40:case 34:return this._onDirectionKey(e,i);case 8:case 46:return this._onDeleteKey(e,this._store.items,this.input.isFocussed)}},e.prototype._onKeyUp=function(){this._canSearch=this.config.searchEnabled},e.prototype._onInput=function(){var e=this.input.value;e?this._canAddItems()&&(this._canSearch&&this._handleSearch(e),this._canAddUserChoices&&(this._canCreateItem(e),this._isSelectElement&&(this._highlightPosition=0,this._highlightChoice()))):this._isTextElement?this.hideDropdown(!0):this._stopSearch()},e.prototype._onSelectKey=function(e,t){(e.ctrlKey||e.metaKey)&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},e.prototype._onEnterKey=function(e,t){var i=this,n=this.input.value,s=e.target;if(e.preventDefault(),s&&s.hasAttribute("data-button"))this._handleButtonAction(s);else if(t){var o=this.dropdown.element.querySelector(k(this.config.classNames.highlightedState));if(!o||!this._handleChoiceAction(o))if(s&&n){if(this._canAddItems()){var r=!1;this._store.withTxn((function(){if(!(r=i._findAndSelectChoiceByValue(n,!0))){if(!i._canAddUserChoices)return;if(!i._canCreateItem(n))return;var e=w(n),t=i.config.allowHtmlUserInput||e===n?n:{escaped:e,raw:n};i._addChoice(W({value:t,label:t,selected:!0},!1),!0,!0),r=!0}i.clearInput(),i.unhighlightAll()})),r&&(this._triggerChange(n),this.config.closeDropdownOnSelect&&this.hideDropdown(!0))}}else this.hideDropdown(!0)}else(this._isSelectElement||this._notice)&&this.showDropdown()},e.prototype._onEscapeKey=function(e,t){t&&(e.stopPropagation(),this.hideDropdown(!0),this.containerOuter.element.focus())},e.prototype._onDirectionKey=function(e,t){var i,n,s,o=e.keyCode;if(t||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var r=40===o||34===o?1:-1,c=void 0;if(e.metaKey||34===o||33===o)c=this.dropdown.element.querySelector(r>0?"".concat(Ye,":last-of-type"):Ye);else{var a=this.dropdown.element.querySelector(k(this.config.classNames.highlightedState));c=a?function(e,t,i){void 0===i&&(i=1);for(var n="".concat(i>0?"next":"previous","ElementSibling"),s=e[n];s;){if(s.matches(t))return s;s=s[n]}return null}(a,Ye,r):this.dropdown.element.querySelector(Ye)}c&&(i=c,n=this.choiceList.element,void 0===(s=r)&&(s=1),(s>0?n.scrollTop+n.offsetHeight>=i.offsetTop+i.offsetHeight:i.offsetTop>=n.scrollTop)||this.choiceList.scrollToChildElement(c,r),this._highlightChoice(c)),e.preventDefault()}},e.prototype._onDeleteKey=function(e,t,i){this._isSelectOneElement||e.target.value||!i||(this._handleBackspace(t),e.preventDefault())},e.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},e.prototype._onTouchEnd=function(e){var t=(e||e.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(t)&&((t===this.containerOuter.element||t===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation()),this._wasTap=!0},e.prototype._onMouseDown=function(e){var t=e.target;if(t instanceof HTMLElement){if(Je&&this.choiceList.element.contains(t)){var i=this.choiceList.element.firstElementChild;this._isScrollingOnIe="ltr"===this._direction?e.offsetX>=i.offsetWidth:e.offsetXthis._highlightPosition?t[this._highlightPosition]:t[t.length-1])||(i=t[0]),F(i,n),i.setAttribute("aria-selected","true"),this.passedElement.triggerEvent("highlightChoice",{el:i}),this.dropdown.isActive&&(this.input.setActiveDescendant(i.id),this.containerOuter.setActiveDescendant(i.id))}},e.prototype._addItem=function(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!e.id)throw new TypeError("item.id must be set before _addItem is called for a choice/item");(this.config.singleModeForMultiSelect||this._isSelectOneElement)&&this.removeActiveItems(e.id),this._store.dispatch(function(e){return{type:u,item:e}}(e)),t&&(this.passedElement.triggerEvent("addItem",this._getChoiceForOutput(e)),i&&this.passedElement.triggerEvent("choice",this._getChoiceForOutput(e)))},e.prototype._removeItem=function(e){e.id&&(this._store.dispatch(E(e)),this.passedElement.triggerEvent(m,this._getChoiceForOutput(e)))},e.prototype._addChoice=function(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),e.id)throw new TypeError("Can not re-add a choice which has already been added");var n=this.config;if(!this._isSelectElement&&n.duplicateItemsAllowed||!this._store.choices.find((function(t){return n.valueComparer(t.value,e.value)}))){this._lastAddedChoiceId++,e.id=this._lastAddedChoiceId,e.elementId="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(e.id);var s=n.prependValue,r=n.appendValue;s&&(e.value=s+e.value),r&&(e.value+=r.toString()),(s||r)&&e.element&&(e.element.value=e.value),this._clearNotice(),this._store.dispatch(function(e){return{type:o,choice:e}}(e)),e.selected&&this._addItem(e,t,i)}},e.prototype._addGroup=function(e,t){var i=this;if(void 0===t&&(t=!0),e.id)throw new TypeError("Can not re-add a group which has already been added");this._store.dispatch(function(e){return{type:l,group:e}}(e)),e.choices&&(this._lastAddedGroupId++,e.id=this._lastAddedGroupId,e.choices.forEach((function(n){n.group=e,e.disabled&&(n.disabled=!0),i._addChoice(n,t)})))},e.prototype._createTemplates=function(){var e=this,t=this.config.callbackOnCreateTemplates,i={};"function"==typeof t&&(i=t.call(this,I,L,N));var n={};Object.keys(this._templates).forEach((function(t){n[t]=t in i?i[t].bind(e):e._templates[t].bind(e)})),this._templates=n},e.prototype._createElements=function(){var e=this._templates,t=this.config,i=this._isSelectOneElement,n=t.position,s=t.classNames,o=this._elementType;this.containerOuter=new R({element:e.containerOuter(t,this._direction,this._isSelectElement,i,t.searchEnabled,o,t.labelId),classNames:s,type:o,position:n}),this.containerInner=new R({element:e.containerInner(t),classNames:s,type:o,position:n}),this.input=new K({element:e.input(t,this._placeholderValue),classNames:s,type:o,preventPaste:!t.paste}),this.choiceList=new B({element:e.choiceList(t,i)}),this.itemList=new B({element:e.itemList(t,i)}),this.dropdown=new j({element:e.dropdown(t),classNames:s,type:o})},e.prototype._createStructure=function(){var e=this,t=e.containerInner,i=e.containerOuter,n=e.passedElement,s=this.dropdown.element;n.conceal(),t.wrap(n.element),i.wrap(t.element),this._isSelectOneElement?this.input.placeholder=this.config.searchPlaceholderValue||"":(this._placeholderValue&&(this.input.placeholder=this._placeholderValue),this.input.setWidth()),i.element.appendChild(t.element),i.element.appendChild(s),t.element.appendChild(this.itemList.element),s.appendChild(this.choiceList.element),this._isSelectOneElement?this.config.searchEnabled&&s.insertBefore(this.input.element,s.firstChild):t.element.appendChild(this.input.element),this._highlightPosition=0,this._isSearching=!1},e.prototype._initStore=function(){var e=this;this._store.subscribe(this._render).withTxn((function(){e._addPredefinedChoices(e._presetChoices,e._isSelectOneElement&&!e._hasNonChoicePlaceholder,!1)})),(!this._store.choices.length||this._isSelectOneElement&&this._hasNonChoicePlaceholder)&&this._render()},e.prototype._addPredefinedChoices=function(e,t,i){var n=this;void 0===t&&(t=!1),void 0===i&&(i=!0),t&&-1===e.findIndex((function(e){return e.selected}))&&e.some((function(e){return!e.disabled&&!("choices"in e)&&(e.selected=!0,!0)})),e.forEach((function(e){"choices"in e?n._isSelectElement&&n._addGroup(e,i):n._addChoice(e,i)}))},e.prototype._findAndSelectChoiceByValue=function(e,t){var i=this;void 0===t&&(t=!1);var n=this._store.choices.find((function(t){return i.config.valueComparer(t.value,e)}));return!(!n||n.disabled||n.selected||(this._addItem(n,!0,t),0))},e.prototype._generatePlaceholderValue=function(){var e=this.config;if(!e.placeholder)return null;if(this._hasNonChoicePlaceholder)return e.placeholderValue;if(this._isSelectElement){var t=this.passedElement.placeholderOption;return t?t.text:null}return null},e.prototype._warnChoicesInitFailed=function(e){if(!this.config.silent){if(!this.initialised)throw new TypeError("".concat(e," called on a non-initialised instance of Choices"));if(!this.initialisedOK)throw new TypeError("".concat(e," called for an element which has multiple instances of Choices initialised on it"))}},e.version="11.0.2",e}()})); diff --git a/composer.json b/composer.json index 7a797577..606d7859 100644 --- a/composer.json +++ b/composer.json @@ -25,12 +25,12 @@ "type": "typo3-cms-extension", "license": "GPL-2.0-or-later", "require": { - "php": ">=7.4.0", + "php": ">=8.1.0", "ext-json": "*", "ext-dom": "*", "ext-libxml": "*", "ext-pdo": "*", - "typo3/cms-core": "^11.5 || ^12.0", + "typo3/cms-core": "^12.4 || ^13.4", "tijsverkoyen/css-to-inline-styles": "^2.2", "doctrine/dbal": ">=2.11.0" }, @@ -54,34 +54,36 @@ } }, "require-dev": { - "typo3/cms-core": "^12.4", - "typo3/cms-extbase": "^12.4", - "typo3/cms-extensionmanager": "^12.4", - "typo3/cms-felogin": "^12.4", - "typo3/cms-filelist": "^12.4", - "typo3/cms-fluid-styled-content": "^12.4", - "typo3/cms-frontend": "^12.4", - "typo3/cms-info": "^12.4", - "typo3/cms-install": "^12.4", - "typo3/cms-recordlist": "^12.4", - "typo3/cms-rte-ckeditor": "^12.4", - "typo3/cms-scheduler": "^12.4", - "typo3/cms-setup": "^12.4", - "typo3/cms-t3editor": "^12.4", - "typo3/cms-tstemplate": "^12.4", - "typo3/cms-lowlevel": "^12.4", - "typo3/cms-adminpanel": "^12.4", - "typo3/cms-belog": "^12.4", - "typo3/cms-beuser": "^12.4", - "typo3/cms-dashboard": "^12.4", + "typo3/cms-core": "^13.4", + "typo3/cms-extbase": "^13.4", + "typo3/cms-extensionmanager": "^13.4", + "typo3/cms-felogin": "^13.4", + "typo3/cms-filelist": "^13.4", + "typo3/cms-fluid-styled-content": "^13.4", + "typo3/cms-frontend": "^13.4", + "typo3/cms-info": "^13.4", + "typo3/cms-install": "^13.4", + "typo3/cms-recordlist": "^13.4", + "typo3/cms-rte-ckeditor": "^13.4", + "typo3/cms-scheduler": "^13.4", + "typo3/cms-setup": "^13.4", + "typo3/cms-t3editor": "^13.4", + "typo3/cms-tstemplate": "^13.4", + "typo3/cms-lowlevel": "^13.4", + "typo3/cms-adminpanel": "^13.4", + "typo3/cms-belog": "^13.4", + "typo3/cms-beuser": "^13.4", + "typo3/cms-dashboard": "^13.4", "typo3/testing-framework": "^8.2", - "symfony/config": "^6.2", + "symfony/config": ">6.2.0", "mikey179/vfsstream": "^1.6", "squizlabs/php_codesniffer": "^3.5", "phpmd/phpmd": "^2.8", "friendsofphp/php-cs-fixer": "^3.10", "helmich/typo3-typoscript-lint": "^3.1", - "helhum/typo3-console": "^8.1" + "helhum/typo3-console": "^8.2", + "georgringer/news": "^12.0", + "in2code/lux": "dev-develop" }, "conflict": { "georgringer/news": "< 11.0.0" @@ -102,6 +104,7 @@ }, "extra": { "typo3/cms": { + "cms-package-dir": "{$vendor-dir}/typo3/cms", "web-dir": ".Build/public", "extension-key": "luxletter", "ignore-as-root": false diff --git a/ext_emconf.php b/ext_emconf.php index c4ea2894..3dab485a 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -4,14 +4,14 @@ 'title' => 'luxletter - TYPO3 Email Marketing Newsletter Tool', 'description' => 'Free newsletter extension for TYPO3 for an individual email marketing. A lot of analytics and modern concepts. Works with and without EXT:lux.', 'category' => 'plugin', - 'version' => '26.3.1', + 'version' => '27.0.0', 'author' => 'Alex Kellner', 'author_email' => 'alexander.kellner@in2code.de', 'author_company' => 'in2code.de', 'state' => 'stable', 'constraints' => [ 'depends' => [ - 'typo3' => '11.5.0-12.4.99' + 'typo3' => '12.4.0-13.4.99' ], 'conflicts' => [ 'news' => '9.0.0-10.99.99' diff --git a/ext_localconf.php b/ext_localconf.php index dbb77ca1..4263d632 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,80 +1,63 @@ 'unsubscribe'], - [\In2code\Luxletter\Controller\FrontendController::class => 'unsubscribe'], - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( - 'Luxletter', - 'Unsubscribe2', - [\In2code\Luxletter\Controller\FrontendController::class => 'unsubscribe2,unsubscribe2Update'], - [\In2code\Luxletter\Controller\FrontendController::class => 'unsubscribe2,unsubscribe2Update'], - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( - 'Luxletter', - 'Preview', - [\In2code\Luxletter\Controller\FrontendController::class => 'preview'], - [\In2code\Luxletter\Controller\FrontendController::class => 'preview'], - ); - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( - 'Luxletter', - 'TrackingPixel', - [\In2code\Luxletter\Controller\FrontendController::class => 'trackingPixel'], - [\In2code\Luxletter\Controller\FrontendController::class => 'trackingPixel'], - ); +defined('TYPO3') || die(); - /** - * Fluid Namespace - */ - $GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['luxletter'][] = 'In2code\Luxletter\ViewHelpers'; - - /** - * Add an absRefPrefix for FluidStyledMailContent to prefix images with absolute paths - * Todo: Can be removed if TYPO3 11 support is dropped and should be replaced with `fluidStyledMailContent.config.forceAbsoluteUrls = 1` - */ - if (\TYPO3\CMS\Core\Core\Environment::isCli() === false) { - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript( - 'luxletterFluidStyledMailContent', - 'setup', - 'fluidStyledMailContent.config.absRefPrefix = ' - . \In2code\Luxletter\Utility\ConfigurationUtility::getCurrentDomain() - ); - } +/** + * Include Frontend Plugins + */ +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'Luxletter', + 'Fe', + [\In2code\Luxletter\Controller\FrontendController::class => 'unsubscribe'], + [\In2code\Luxletter\Controller\FrontendController::class => 'unsubscribe'], +); +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'Luxletter', + 'Unsubscribe2', + [\In2code\Luxletter\Controller\FrontendController::class => 'unsubscribe2,unsubscribe2Update'], + [\In2code\Luxletter\Controller\FrontendController::class => 'unsubscribe2,unsubscribe2Update'], +); +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'Luxletter', + 'Preview', + [\In2code\Luxletter\Controller\FrontendController::class => 'preview'], + [\In2code\Luxletter\Controller\FrontendController::class => 'preview'], +); +\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'Luxletter', + 'TrackingPixel', + [\In2code\Luxletter\Controller\FrontendController::class => 'trackingPixel'], + [\In2code\Luxletter\Controller\FrontendController::class => 'trackingPixel'], +); - /** - * Update Wizards - */ - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['luxletterReceiversUpdateWizard'] - = \In2code\Luxletter\Update\LuxletterReceiversUpdateWizard::class; +/** + * Fluid Namespace + */ +$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['luxletter'][] = 'In2code\Luxletter\ViewHelpers'; - /** - * Add TypoScript automatically (to use it in backend modules) - */ - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript( - 'Luxletter', - 'setup', - '@import "EXT:luxletter/Configuration/TypoScript/Basic/setup.typoscript"' - ); - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript( - 'Luxletter', - 'constants', - '@import "EXT:luxletter/Configuration/TypoScript/Basic/constants.typoscript"' - ); +/** + * Update Wizards + */ +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['luxletterReceiversUpdateWizard'] + = \In2code\Luxletter\Update\LuxletterReceiversUpdateWizard::class; - /** - * CacheHash: Add LUX paramters to excluded variables - */ - \In2code\Luxletter\Utility\CacheHashUtility::addArgumentsToExcludedVariables(); - } +/** + * Add TypoScript automatically (to use it in backend modules) + */ +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript( + 'Luxletter', + 'setup', + '@import "EXT:luxletter/Configuration/TypoScript/Basic/setup.typoscript"' +); +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript( + 'Luxletter', + 'constants', + '@import "EXT:luxletter/Configuration/TypoScript/Basic/constants.typoscript"' ); + +/** + * CacheHash: Add LUX paramters to excluded variables + */ +\In2code\Luxletter\Utility\CacheHashUtility::addArgumentsToExcludedVariables(); diff --git a/ext_tables.php b/ext_tables.php index 26849f5f..9a91b7db 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -1,125 +1,90 @@ registerIcon( - 'extension-lux', - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - ['source' => 'EXT:luxletter/Resources/Public/Icons/lux.svg'] - ); - $iconRegistry->registerIcon( - 'extension-luxletter', - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - ['source' => 'EXT:luxletter/Resources/Public/Icons/Extension.svg'] - ); - $iconRegistry->registerIcon( - 'extension-lux-module', - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - ['source' => 'EXT:luxletter/Resources/Public/Icons/lux_white.svg'] - ); - $iconRegistry->registerIcon( - 'extension-luxletter-module', - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - ['source' => 'EXT:luxletter/Resources/Public/Icons/lux_module_newsletter.svg'] - ); - $iconRegistry->registerIcon( - 'extension-luxletter-star', - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - ['source' => 'EXT:luxletter/Resources/Public/Icons/star.svg'] - ); - $iconRegistry->registerIcon( - 'teaser', - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - ['source' => 'EXT:luxletter/Resources/Public/Icons/ctype-teaser.svg'] - ); - $iconRegistry->registerIcon( - 'luxletter-widget-receiver', - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - ['source' => 'EXT:luxletter/Resources/Public/Icons/widget_receiver.svg'] - ); - $iconRegistry->registerIcon( - 'luxletter-widget-newsletter', - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - ['source' => 'EXT:luxletter/Resources/Public/Icons/widget_newsletter.svg'] - ); - $iconRegistry->registerIcon( - 'apps-pagetree-luxletter', - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - ['source' => 'EXT:luxletter/Resources/Public/Icons/luxletter_doktype.svg'] - ); - $iconRegistry->registerIcon( - 'apps-pagetree-luxletter-contentFromPid', - \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, - ['source' => 'EXT:luxletter/Resources/Public/Icons/luxletter_doktype.svg'] - ); +use In2code\Luxletter\Utility\ConfigurationUtility; +use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider; +use TYPO3\CMS\Core\Imaging\IconRegistry; +use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; +use TYPO3\CMS\Core\Utility\GeneralUtility; - /** - * Include Modules - */ - // Add Main module "LUX" - shared with EXT:lux and EXT:luxenterprise (if installed) - // Acces to a main module is implicit, as soon as a user has access to at least one of its submodules. - // Todo: Can be removed, if TYPO3 11 support is dropped - if (empty($GLOBALS['TBE_MODULES']['lux'])) { - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule( - 'lux', - '', - '', - null, - [ - 'name' => 'lux', - 'labels' => 'LLL:EXT:luxletter/Resources/Private/Language/locallang_mod.xlf', - 'iconIdentifier' => 'extension-lux-module' - ] - ); - } - // Add module for analysis - // Todo: Can be removed, if TYPO3 11 support is dropped - \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule( - 'Luxletter', - 'lux', - 'luxletter', - '', - [ - \In2code\Luxletter\Controller\NewsletterController::class => - 'dashboard, list, resetFilter, edit, update, new, create, enable, disable, delete, receiver', - ], - [ - 'access' => 'user,group', - 'icon' => 'EXT:luxletter/Resources/Public/Icons/lux_module_newsletter.svg', - 'labels' => 'LLL:EXT:luxletter/Resources/Private/Language/locallang_mod_newsletter.xlf', - ] - ); +defined('TYPO3') || die(); - /** - * Add static page TSconfig - */ - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig( - '@import "EXT:luxletter/Configuration/PageTSConfig/ContentElements.typoscript"' - ); +/** + * Register Icons + */ +$iconRegistry = GeneralUtility::makeInstance( + IconRegistry::class +); +$iconRegistry->registerIcon( + 'extension-lux', + SvgIconProvider::class, + ['source' => 'EXT:luxletter/Resources/Public/Icons/lux.svg'] +); +$iconRegistry->registerIcon( + 'extension-luxletter', + SvgIconProvider::class, + ['source' => 'EXT:luxletter/Resources/Public/Icons/Extension.svg'] +); +$iconRegistry->registerIcon( + 'extension-lux-module', + SvgIconProvider::class, + ['source' => 'EXT:luxletter/Resources/Public/Icons/lux_white.svg'] +); +$iconRegistry->registerIcon( + 'extension-luxletter-module', + SvgIconProvider::class, + ['source' => 'EXT:luxletter/Resources/Public/Icons/lux_module_newsletter.svg'] +); +$iconRegistry->registerIcon( + 'extension-luxletter-star', + SvgIconProvider::class, + ['source' => 'EXT:luxletter/Resources/Public/Icons/star.svg'] +); +$iconRegistry->registerIcon( + 'teaser', + SvgIconProvider::class, + ['source' => 'EXT:luxletter/Resources/Public/Icons/ctype-teaser.svg'] +); +$iconRegistry->registerIcon( + 'luxletter-widget-receiver', + SvgIconProvider::class, + ['source' => 'EXT:luxletter/Resources/Public/Icons/widget_receiver.svg'] +); +$iconRegistry->registerIcon( + 'luxletter-widget-newsletter', + SvgIconProvider::class, + ['source' => 'EXT:luxletter/Resources/Public/Icons/widget_newsletter.svg'] +); +$iconRegistry->registerIcon( + 'apps-pagetree-luxletter', + SvgIconProvider::class, + ['source' => 'EXT:luxletter/Resources/Public/Icons/luxletter_doktype.svg'] +); +$iconRegistry->registerIcon( + 'apps-pagetree-luxletter-contentFromPid', + SvgIconProvider::class, + ['source' => 'EXT:luxletter/Resources/Public/Icons/luxletter_doktype.svg'] +); - /** - * Add new page doktype - */ - if (\In2code\Luxletter\Utility\ConfigurationUtility::isMultiLanguageModeActivated()) { - $doktype = \In2code\Luxletter\Utility\ConfigurationUtility::getMultilanguageNewsletterPageDoktype(); - $GLOBALS['PAGES_TYPES'][$doktype] = [ - 'type' => 'web', - 'allowedTables' => '*', - ]; - // Allow backend users to drag and drop the new page type: - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig( - 'options.pageTree.doktypesToShowInNewPageDragArea := addToList(' . $doktype . ')' - ); - } - } +/** + * Add static page TSconfig + */ +ExtensionManagementUtility::addPageTSConfig( + '@import "EXT:luxletter/Configuration/PageTSConfig/ContentElements.typoscript"' ); + +/** + * Add new page doktype + */ +if (ConfigurationUtility::isMultiLanguageModeActivated()) { + $doktype = ConfigurationUtility::getMultilanguageNewsletterPageDoktype(); + $GLOBALS['PAGES_TYPES'][$doktype] = [ + 'type' => 'web', + 'allowedTables' => '*', + ]; + // Allow backend users to drag and drop the new page type: + ExtensionManagementUtility::addUserTSConfig( + 'options.pageTree.doktypesToShowInNewPageDragArea := addToList(' . $doktype . ')' + ); +} diff --git a/readme.md b/readme.md index 65348f79..fee26ada 100644 --- a/readme.md +++ b/readme.md @@ -19,7 +19,7 @@ it. ### The upside * A useful and nice **dashboard** shows you the relevant information in the backend -* Modern newsletter extension for TYPO3 11 or 12 +* Modern newsletter extension for TYPO3 12 or 13 * Tracking of clicks via **PSR-15 interface** in TYPO3 * Sending mails in queue via **symfony command controller** * Records for **fe_groups** (and there related fe_users) are used to send mails to @@ -82,7 +82,7 @@ See the full [documentation](Documentation/Index.md) (installation, configuratio ## Technical requirements -* TYPO3 11 or 12 LTS is the basic CMS for this newsletter tool. +* TYPO3 12 or 13 LTS is the basic CMS for this newsletter tool. * EXT:lux is **not needed** to run luxletter but both extensions can work together to show more relevant information. * This extension needs to be **installed with composer** (classic installation could work but is not supported and tested). * fe_users in fe_groups is used to send newsletter emails to.