diff --git a/EMS/common-bundle/src/Helper/EmsFields.php b/EMS/common-bundle/src/Helper/EmsFields.php index 1c44fb804..81650abb5 100644 --- a/EMS/common-bundle/src/Helper/EmsFields.php +++ b/EMS/common-bundle/src/Helper/EmsFields.php @@ -8,6 +8,7 @@ final class EmsFields public const CONTENT_FILE_HASH_FIELD = 'sha1'; public const CONTENT_FILE_SIZE_FIELD = 'filesize'; public const CONTENT_FILE_NAME_FIELD = 'filename'; + public const CONTENT_IMAGE_RESIZED_HASH_FIELD = '_image_resized_hash'; public const CONTENT_MIME_TYPE_FIELD_ = '_mime_type'; public const CONTENT_FILE_HASH_FIELD_ = '_hash'; public const CONTENT_FILE_ALGO_FIELD_ = '_algo'; diff --git a/EMS/common-bundle/src/Storage/Processor/Config.php b/EMS/common-bundle/src/Storage/Processor/Config.php index 0a094327f..922c7fee9 100644 --- a/EMS/common-bundle/src/Storage/Processor/Config.php +++ b/EMS/common-bundle/src/Storage/Processor/Config.php @@ -449,9 +449,14 @@ public static function getDefaults(): array /** * @param array $fileField */ - public static function extractHash(array $fileField, string $fileHashField = EmsFields::CONTENT_FILE_HASH_FIELD): string + public static function extractHash(array $fileField, string $fileHashField, string $processorType): string { - return $fileField[EmsFields::CONTENT_FILE_HASH_FIELD_] ?? $fileField[$fileHashField] ?? 'processor'; + $default = $fileField[EmsFields::CONTENT_FILE_HASH_FIELD_] ?? $fileField[$fileHashField] ?? 'processor'; + + return match ($processorType) { + EmsFields::ASSET_CONFIG_TYPE_IMAGE => $fileField[EmsFields::CONTENT_IMAGE_RESIZED_HASH_FIELD] ?? $default, + default => $default, + }; } /** diff --git a/EMS/common-bundle/src/Storage/Processor/Processor.php b/EMS/common-bundle/src/Storage/Processor/Processor.php index 6cc657ca2..a6a7fffe5 100644 --- a/EMS/common-bundle/src/Storage/Processor/Processor.php +++ b/EMS/common-bundle/src/Storage/Processor/Processor.php @@ -40,7 +40,7 @@ public function __construct( */ public function resolveAndGetResponse(Request $request, array $fileField, array $configArray = [], bool $immutableRoute = false): Response { - $hash = Config::extractHash($fileField); + $hash = Config::extractHash($fileField, EmsFields::CONTENT_FILE_HASH_FIELD, \strval($configArray[EmsFields::ASSET_CONFIG_TYPE] ?? 'none')); $filename = Config::extractFilename($fileField, $configArray); $mimetype = Config::extractMimetype($fileField, $configArray, $filename); $mimeType = $this->overwriteMimeType($mimetype, $configArray); diff --git a/EMS/common-bundle/src/Twig/AssetRuntime.php b/EMS/common-bundle/src/Twig/AssetRuntime.php index ac90dce03..bed1e5fa0 100644 --- a/EMS/common-bundle/src/Twig/AssetRuntime.php +++ b/EMS/common-bundle/src/Twig/AssetRuntime.php @@ -96,7 +96,7 @@ public function assetPath(array $fileField, array $assetConfig = [], string $rou { $config = $assetConfig; - $hash = Config::extractHash($fileField, $fileHashField); + $hash = Config::extractHash($fileField, $fileHashField, \strval($assetConfig[EmsFields::ASSET_CONFIG_TYPE] ?? 'none')); $filename = Config::extractFilename($fileField, $config, $filenameField, $mimeTypeField); $mimeType = Config::extractMimetype($fileField, $config, $filename, $mimeTypeField); $referenceType = Config::extractUrlType($fileField, $referenceType); diff --git a/EMS/core-bundle/assets/js/EmsListeners.js b/EMS/core-bundle/assets/js/EmsListeners.js index a1cebe963..09a4157fb 100644 --- a/EMS/core-bundle/assets/js/EmsListeners.js +++ b/EMS/core-bundle/assets/js/EmsListeners.js @@ -6,6 +6,7 @@ import PickFileFromServer from './module/pickFileFromServer'; import FileUploader from "@elasticms/file-uploader"; import Datatables from "./module/datatables"; import {tooltipDataLinks} from "./helper/tooltip"; +import {resizeImage} from "./helper/resizeImage"; export default class EmsListeners { @@ -273,11 +274,41 @@ export default class EmsListeners { } } + _resizeImage(fileHandler, container, previewUrl){ + const self = this; + const mainDiv = $(container); + const metaFields = (typeof mainDiv.data('meta-fields') !== 'undefined'); + const contentInput = mainDiv.find(".content"); + const resizedImageHashInput = mainDiv.find(".resized-image-hash"); + const previewLink = mainDiv.find(".img-responsive"); + + resizeImage(this.hashAlgo, this.initUpload, fileHandler).then((response) => { + if (null === response) { + $(resizedImageHashInput).val('') + previewLink.attr('src', previewUrl); + } else { + $(resizedImageHashInput).val(response.hash) + previewLink.attr('src', response.url); + } + }).catch((errorMessage) => { + console.error(errorMessage) + $(resizedImageHashInput).val('') + previewLink.attr('src', previewUrl); + }).finally(() => { + if(metaFields && $(contentInput).length) { + self.fileDataExtrator(container); + } + else if(typeof self.onChangeCallback === "function"){ + self.onChangeCallback(); + } + }) + } initFileUploader(fileHandler, container){ const mainDiv = $(container); const metaFields = (typeof mainDiv.data('meta-fields') !== 'undefined'); const sha1Input = mainDiv.find(".sha1"); + const resizedImageHashInput = mainDiv.find(".resized-image-hash"); const typeInput = mainDiv.find(".type"); const nameInput = mainDiv.find(".name"); const progressBar = mainDiv.find(".progress-bar"); @@ -306,6 +337,7 @@ export default class EmsListeners { emsListener: this, onHashAvailable: function(hash, type, name){ $(sha1Input).val(hash); + $(resizedImageHashInput).val(''); $(assetHashSignature).empty().append(hash); $(typeInput).val(type); $(nameInput).val(name); @@ -329,14 +361,17 @@ export default class EmsListeners { }, onUploaded: function(assetUrl, previewUrl){ viewButton.attr('href', assetUrl); - previewLink.attr('src', previewUrl); viewButton.removeClass("disabled"); clearButton.removeClass("disabled"); previewTab.removeClass('hidden'); uploadTab.addClass('hidden'); - if(metaFields && $(contentInput).length) { + const imageTypes = ['image/png','image/jpeg','image/webp'] + if(imageTypes.includes(fileHandler.type)) { + self._resizeImage(fileHandler, container, previewUrl); + } + else if(metaFields && $(contentInput).length) { self.fileDataExtrator(container); } else if(typeof self.onChangeCallback === "function"){ @@ -353,6 +388,7 @@ export default class EmsListeners { $(progressNumber).html('Error code : '+code); } $(sha1Input).val(''); + $(resizedImageHashInput).val(''); $(assetHashSignature).empty(); $(typeInput).val(''); $(nameInput).val(''); @@ -432,6 +468,7 @@ export default class EmsListeners { onAssetData(row, data){ const mainDiv = $(row); const sha1Input = mainDiv.find(".sha1"); + const resizedImageHashInput = mainDiv.find(".resized-image-hash"); const metaFields = (typeof mainDiv.data('meta-fields') !== 'undefined'); const typeInput = mainDiv.find(".type"); const nameInput = mainDiv.find(".name"); @@ -447,6 +484,7 @@ export default class EmsListeners { const uploadTab = mainDiv.find(".asset-upload-tab"); const previewLink = mainDiv.find(".img-responsive"); sha1Input.val(data.sha1); + resizedImageHashInput.val(''); assetHashSignature.empty().append(data.sha1); typeInput.val(data.mimetype); nameInput.val(data.filename); @@ -486,6 +524,7 @@ export default class EmsListeners { target.find(".clear-asset-button").click(function() { const parent = $(this).closest('.file-uploader-row'); const sha1Input = $(parent).find(".sha1"); + const resizedImageHashInput = $(parent).find(".resized-image-hash"); const typeInput = $(parent).find(".type"); const nameInput = $(parent).find(".name"); const progressBar = $(parent).find(".progress-bar"); @@ -502,6 +541,7 @@ export default class EmsListeners { $(parent).find(".file-uploader-input").val(''); sha1Input.val(''); + resizedImageHashInput.val(''); assetHashSignature.empty(); typeInput.val(''); nameInput.val(''); diff --git a/EMS/core-bundle/assets/js/component/mediaLibrary.js b/EMS/core-bundle/assets/js/component/mediaLibrary.js index a406230b8..2a8fd8ad1 100644 --- a/EMS/core-bundle/assets/js/component/mediaLibrary.js +++ b/EMS/core-bundle/assets/js/component/mediaLibrary.js @@ -1,6 +1,7 @@ import ajaxModal from "./../helper/ajaxModal"; import ProgressBar from "../helper/progressBar"; import FileUploader from "@elasticms/file-uploader"; +import {resizeImage} from "../helper/resizeImage"; export default class MediaLibrary { id; @@ -607,7 +608,7 @@ export default class MediaLibrary { this.#elements.listUploads.appendChild(liUpload); this._getFileHash(file, progressBar) - .then((fileHash) => this._createFile(file, fileHash)) + .then((fileHash) => this._resizeImage(file, fileHash)) .then(() => { progressBar.status('Finished'); setTimeout(() => { @@ -626,12 +627,24 @@ export default class MediaLibrary { }); }); } - async _createFile(file, fileHash) { + async _resizeImage(file, fileHash) { + resizeImage(this.#options.hashAlgo, this.#options.urlInitUpload, file).then((response) => { + if (null === response) { + this._createFile(file, fileHash) + } else { + this._createFile(file, fileHash, response.hash) + } + }).catch(() => { + this._createFile(file, fileHash) + }) + } + async _createFile(file, fileHash, resizedHash = null) { const formData = new FormData(); formData.append('name', file.name); formData.append('filesize', file.size); formData.append('fileMimetype', file.type); formData.append('fileHash', fileHash); + formData.append('fileResizedHash', resizedHash); const path = this.#activeFolderId ? `/add-file/${this.#activeFolderId}` : '/add-file'; await this._post(path, formData, true) diff --git a/EMS/core-bundle/assets/js/helper/resizeImage.js b/EMS/core-bundle/assets/js/helper/resizeImage.js new file mode 100644 index 000000000..6554c6d40 --- /dev/null +++ b/EMS/core-bundle/assets/js/helper/resizeImage.js @@ -0,0 +1,97 @@ +'use strict' + +import FileUploader from '@elasticms/file-uploader' + +async function resizeImage(hashAlgo, initUpload, fileHandler) { + return new Promise((resolve, reject) => { + const imageTypes = ['image/png','image/jpeg','image/webp'] + if (!imageTypes.includes(fileHandler.type)) { + resolve(null) + } + + let fileHash = null + const reader = new FileReader() + const imageMaxSize = document.body.dataset.imageMaxSize + reader.onload = function (e) { + const image = new Image() + image.onload = function (imageEvent) { + const canvas = document.createElement('canvas') + let width = image.width + let height = image.height + if (width <= imageMaxSize && height <= imageMaxSize) { + resolve(null) + } + if (width > height) { + if (width > imageMaxSize) { + height = Math.round(height * imageMaxSize / width) + width = imageMaxSize + } + } else { + if (height > imageMaxSize) { + width = Math.round(width * imageMaxSize / height) + height = imageMaxSize + } + } + canvas.width = width + canvas.height = height + canvas.getContext('2d').drawImage(image, 0, 0, width, height) + const dataUrl = canvas.toDataURL(fileHandler.type) + const resizedImage = dataUrlToBlob(dataUrl) + let basename = fileHandler.name + let extension = '' + if(basename.lastIndexOf('.') !== -1) { + extension = basename.substring(basename.lastIndexOf(".")) + basename = basename.substring(0, basename.lastIndexOf(".")) + } + resizedImage.name = `${basename}_${width}x${height}${extension}` + + const resizedImageUploader = new FileUploader({ + file: resizedImage, + algo: hashAlgo, + initUrl: initUpload, + emsListener: self, + onHashAvailable: function(hash){ + fileHash = hash + }, + onUploaded: function(assetUrl, previewUrl){ + resolve({ + hash: fileHash, + url: previewUrl, + }) + }, + onError: function(message, code){ + reject(`Error ${code} during upload of resized image with message: ${message}`) + }, + }) + } + image.src = e.target.result + } + reader.readAsDataURL(fileHandler) + }) +} + +function dataUrlToBlob(dataUrl) { + const BASE64_MARKER = ';base64,' + if (dataUrl.indexOf(BASE64_MARKER) === -1) { + const parts = dataUrl.split(',') + const contentType = parts[0].split(':')[1] + const raw = parts[1] + + return new Blob([raw], {type: contentType}) + } + + const parts = dataUrl.split(BASE64_MARKER) + const contentType = parts[0].split(':')[1] + const raw = window.atob(parts[1]) + const rawLength = raw.length + + const uInt8Array = new Uint8Array(rawLength) + + for (let i = 0; i < rawLength; ++i) { + uInt8Array[i] = raw.charCodeAt(i) + } + + return new Blob([uInt8Array], {type: contentType}) +} + +export { resizeImage, dataUrlToBlob } diff --git a/EMS/core-bundle/src/Command/JobCommand.php b/EMS/core-bundle/src/Command/JobCommand.php index 2480100c5..8920838db 100644 --- a/EMS/core-bundle/src/Command/JobCommand.php +++ b/EMS/core-bundle/src/Command/JobCommand.php @@ -1,11 +1,14 @@ addOption( - self::OPTION_DUMP, - null, - InputOption::VALUE_NONE, - 'Shows the job\'s output at the end of the execution' - ) - ->addOption( - self::OPTION_TAG, - null, - InputOption::VALUE_OPTIONAL, - 'Will treat the next scheduled job flagged with the provided tag (don\'t execute pending jobs)' - ); + + ->addOption(self::OPTION_DUMP, null, InputOption::VALUE_NONE, 'Shows the job\'s output at the end of the execution') + ->addOption(self::OPTION_TAG, null, InputOption::VALUE_OPTIONAL, 'Will treat the next scheduled job flagged with the provided tag (do not execute pending jobs)') + ; } protected function initialize(InputInterface $input, OutputInterface $output): void @@ -59,29 +56,61 @@ protected function initialize(InputInterface $input, OutputInterface $output): v protected function execute(InputInterface $input, OutputInterface $output): int { - $this->io->title('EMSCO - Job'); + $this->io->title('EMSCO - Job - Run'); - $job = $this->jobService->nextJob($this->tag); + if ($this->processReleases() || $this->processNextJob() || $this->processNextScheduledJob()) { + return self::EXECUTE_SUCCESS; + } + + $this->io->comment('Nothing to run. Cleaning jobs.'); + $this->jobService->cleanJob(self::USER_JOB_COMMAND, $this->cleanJobsTimeString); + + return self::EXECUTE_SUCCESS; + } - if (null === $job) { - $this->io->comment('No pending job to treat. Looking for due scheduled job.'); - $job = $this->jobService->nextJobScheduled(self::USER_JOB_COMMAND, $this->tag); + private function processReleases(): bool + { + $releases = $this->releaseService->findReadyAndDue(); + if (0 === \count($releases)) { + $this->io->comment('No releases scheduled to treat'); + + return false; } - if (null === $job) { - $this->io->comment('Nothing to run. Cleaning jobs.'); - $this->cleanJobs(); + foreach ($releases as $release) { + $this->releaseService->executeRelease($release, true); + $this->io->writeln(\sprintf('Release %s has been published', $release->getName())); + } - return self::EXECUTE_SUCCESS; + return true; + } + + private function processNextJob(): bool + { + $nextJob = $this->jobService->nextJob($this->tag); + + if (null === $nextJob) { + $this->io->comment('No jobs pending to treat'); + + return false; } - return $this->runJob($job, $input, $output); + return $this->executeJob($nextJob); } - /** - * @throws \Throwable - */ - protected function runJob(Job $job, InputInterface $input, OutputInterface $output): int + private function processNextScheduledJob(): bool + { + $nextScheduledJob = $this->jobService->nextJobScheduled(self::USER_JOB_COMMAND, $this->tag); + if (null === $nextScheduledJob) { + $this->io->comment('No jobs scheduled to treat'); + + return false; + } + + return $this->executeJob($nextScheduledJob); + } + + private function executeJob(Job $job): bool { $this->io->title('Preparing the job'); $this->io->listing([ @@ -90,6 +119,7 @@ protected function runJob(Job $job, InputInterface $input, OutputInterface $outp \sprintf('User: %s', $job->getUser()), \sprintf('Created: %s', $job->getCreated()->format($this->dateFormat)), ]); + $start = new \DateTime(); try { $this->jobService->run($job); @@ -97,28 +127,31 @@ protected function runJob(Job $job, InputInterface $input, OutputInterface $outp $this->jobService->finish($job->getId()); throw $e; } + $interval = \date_diff($start, new \DateTime()); - $this->io->success(\sprintf('Job completed with the return status "%s" in %s', $job->getStatus(), $interval->format('%a days, %h hours, %i minutes and %s seconds'))); + $this->io->success(\sprintf( + 'Job completed with the return status "%s" in %s', + $job->getStatus(), + $interval->format('%a days, %h hours, %i minutes and %s seconds') + )); - if (!$this->dump) { - return parent::EXECUTE_SUCCESS; + if ($this->dump) { + $this->outputJobLog($job); } + return true; + } + + private function outputJobLog(Job $job): void + { $jobLog = $job->getOutput(); if (null === $jobLog) { $this->io->write('Empty output'); } else { $this->io->section('Job\'s output:'); - $output->write($jobLog); + $this->io->write($jobLog); $this->io->section('End of job\'s output'); } - - return parent::EXECUTE_SUCCESS; - } - - private function cleanJobs(): void - { - $this->jobService->cleanJob(self::USER_JOB_COMMAND, $this->cleanJobsTimeString); } } diff --git a/EMS/core-bundle/src/Command/Release/PublishReleaseCommand.php b/EMS/core-bundle/src/Command/Release/PublishReleaseCommand.php deleted file mode 100644 index a87391a91..000000000 --- a/EMS/core-bundle/src/Command/Release/PublishReleaseCommand.php +++ /dev/null @@ -1,50 +0,0 @@ -io->title('EMSCO - Release - Publish'); - - $releases = $this->releaseService->findReadyAndDue(); - - if (empty($releases)) { - $output->writeln('No scheduled release found'); - - return parent::EXECUTE_SUCCESS; - } - - foreach ($releases as $release) { - $this->releaseService->executeRelease($release, true); - $output->writeln(\sprintf('Release %s has been published', $release->getName())); - } - - return parent::EXECUTE_SUCCESS; - } -} diff --git a/EMS/core-bundle/src/Commands.php b/EMS/core-bundle/src/Commands.php index 08097a082..869cc3ef7 100644 --- a/EMS/core-bundle/src/Commands.php +++ b/EMS/core-bundle/src/Commands.php @@ -38,7 +38,6 @@ final class Commands public const NOTIFICATION_BULK_ACTION = 'emsco:notification:bulk-action'; public const NOTIFICATION_SEND = 'emsco:notification:send'; - public const RELEASE_PUBLISH = 'emsco:release:publish'; public const RELEASE_CREATE = 'emsco:release:create'; public const REVISION_ARCHIVE = 'emsco:revision:archive'; diff --git a/EMS/core-bundle/src/Core/Component/MediaLibrary/File/MediaLibraryFile.php b/EMS/core-bundle/src/Core/Component/MediaLibrary/File/MediaLibraryFile.php index d913d2643..087d50f90 100644 --- a/EMS/core-bundle/src/Core/Component/MediaLibrary/File/MediaLibraryFile.php +++ b/EMS/core-bundle/src/Core/Component/MediaLibrary/File/MediaLibraryFile.php @@ -57,6 +57,11 @@ public function getFileHash(): ?string return $this->file[EmsFields::CONTENT_FILE_HASH_FIELD] ?? null; } + public function getFileResizedHash(): ?string + { + return $this->file[EmsFields::CONTENT_IMAGE_RESIZED_HASH_FIELD] ?? null; + } + public function getFilesize(): ?int { return $this->file[EmsFields::CONTENT_FILE_SIZE_FIELD] ?? null; @@ -73,6 +78,12 @@ public function setFileHash(?string $fileHash): void $this->setFileProperty(EmsFields::CONTENT_FILE_HASH_FIELD, $fileHash); } + public function setFileResizedHash(?string $fileHash): void + { + $this->file[EmsFields::CONTENT_IMAGE_RESIZED_HASH_FIELD] = $fileHash; + $this->setFileProperty(EmsFields::CONTENT_IMAGE_RESIZED_HASH_FIELD, $fileHash); + } + public function setFilesize(?int $filesize): void { $this->file[EmsFields::CONTENT_FILE_SIZE_FIELD] = $filesize; diff --git a/EMS/core-bundle/src/DependencyInjection/Configuration.php b/EMS/core-bundle/src/DependencyInjection/Configuration.php index 81e119892..9d42826e0 100644 --- a/EMS/core-bundle/src/DependencyInjection/Configuration.php +++ b/EMS/core-bundle/src/DependencyInjection/Configuration.php @@ -39,6 +39,7 @@ class Configuration implements ConfigurationInterface final public const FALLBACK_LOCALE = 'en'; final public const TEMPLATE_NAMESPACE = 'EMSCore'; final public const DYNAMIC_MAPPING = 'false'; + final public const IMAGE_MAX_SIZE = 2048; public function getConfigTreeBuilder(): TreeBuilder { @@ -87,6 +88,7 @@ public function getConfigTreeBuilder(): TreeBuilder ->scalarNode('custom_user_options_form')->defaultValue(null)->end() ->scalarNode('template_namespace')->defaultValue(self::TEMPLATE_NAMESPACE)->end() ->scalarNode('dynamic_mapping')->defaultValue(self::DYNAMIC_MAPPING)->end() + ->scalarNode('image_max_size')->defaultValue(self::IMAGE_MAX_SIZE)->end() ->end() ; diff --git a/EMS/core-bundle/src/DependencyInjection/EMSCoreExtension.php b/EMS/core-bundle/src/DependencyInjection/EMSCoreExtension.php index fb8e45d1e..7f3d131ff 100644 --- a/EMS/core-bundle/src/DependencyInjection/EMSCoreExtension.php +++ b/EMS/core-bundle/src/DependencyInjection/EMSCoreExtension.php @@ -103,6 +103,7 @@ public function prepend(ContainerBuilder $container): void 'time_format' => $configs[0]['time_format'] ?? Configuration::TIME_FORMAT, 'trigger_job_from_web' => $configs[0]['trigger_job_from_web'] ?? Configuration::TRIGGER_JOB_FROM_WEB, 'routes' => (new \ReflectionClass(Routes::class))->getConstants(), + 'image_max_size' => $configs[0]['image_max_size'] ?? Configuration::IMAGE_MAX_SIZE, ]; if (!empty($configs[0]['template_options'])) { diff --git a/EMS/core-bundle/src/Form/DataField/AssetFieldType.php b/EMS/core-bundle/src/Form/DataField/AssetFieldType.php index 0cf72f75c..bb764703c 100644 --- a/EMS/core-bundle/src/Form/DataField/AssetFieldType.php +++ b/EMS/core-bundle/src/Form/DataField/AssetFieldType.php @@ -2,6 +2,7 @@ namespace EMS\CoreBundle\Form\DataField; +use EMS\CommonBundle\Helper\EmsFields; use EMS\CoreBundle\Entity\DataField; use EMS\CoreBundle\Entity\FieldType; use EMS\CoreBundle\Form\Field\AssetType; @@ -94,6 +95,7 @@ public function generateMapping(FieldType $current): array 'sha1' => $this->elasticsearchService->getKeywordMapping(), 'filename' => $this->elasticsearchService->getIndexedStringMapping(), 'filesize' => $this->elasticsearchService->getLongMapping(), + EmsFields::CONTENT_IMAGE_RESIZED_HASH_FIELD => $this->elasticsearchService->getKeywordMapping(), ], ], \array_filter($current->getMappingOptions())), ]; @@ -146,6 +148,9 @@ private function testDataField(DataField $dataField): void $fileInfo['filesize'] = $this->fileService->getSize($fileInfo['sha1']); $rawData[] = $fileInfo; } + if (!empty($fileInfo[EmsFields::CONTENT_IMAGE_RESIZED_HASH_FIELD]) && !$this->fileService->head($fileInfo[EmsFields::CONTENT_IMAGE_RESIZED_HASH_FIELD])) { + $dataField->addMessage(\sprintf('Resized image of %s not found on the server try to re-upload the source image', $fileInfo['filename'])); + } } if ($isMultiple) { diff --git a/EMS/core-bundle/src/Form/DataField/IndexedAssetFieldType.php b/EMS/core-bundle/src/Form/DataField/IndexedAssetFieldType.php index 17b31da5f..19e91ca2a 100644 --- a/EMS/core-bundle/src/Form/DataField/IndexedAssetFieldType.php +++ b/EMS/core-bundle/src/Form/DataField/IndexedAssetFieldType.php @@ -90,7 +90,7 @@ public function generateMapping(FieldType $current): array EmsFields::CONTENT_FILE_HASH_FIELD => $this->elasticsearchService->getKeywordMapping(), EmsFields::CONTENT_FILE_NAME_FIELD => $this->elasticsearchService->getIndexedStringMapping(), EmsFields::CONTENT_FILE_SIZE_FIELD => $this->elasticsearchService->getLongMapping(), - '_content' => $mapping[$current->getName()], + EmsFields::CONTENT_IMAGE_RESIZED_HASH_FIELD => $this->elasticsearchService->getKeywordMapping(), '_content' => $mapping[$current->getName()], '_author' => $mapping[$current->getName()], '_title' => $mapping[$current->getName()], '_date' => $this->elasticsearchService->getDateTimeMapping(), @@ -125,6 +125,9 @@ private function testDataField(DataField $dataField): void return; } + if (!empty($raw[EmsFields::CONTENT_IMAGE_RESIZED_HASH_FIELD]) && !$this->fileService->head($raw[EmsFields::CONTENT_IMAGE_RESIZED_HASH_FIELD])) { + $dataField->addMessage(\sprintf('Resized image of %s not found on the server try to re-upload the source image', $raw['filename'])); + } $raw['filesize'] = $this->fileService->getSize($raw['sha1']); if (isset($raw['_date'])) { @@ -153,7 +156,7 @@ public function modelTransform($data, FieldType $fieldType): DataField { if (\is_array($data)) { foreach ($data as $id => $content) { - if (!\in_array($id, [EmsFields::CONTENT_FILE_HASH_FIELD, EmsFields::CONTENT_FILE_NAME_FIELD, EmsFields::CONTENT_FILE_SIZE_FIELD, EmsFields::CONTENT_MIME_TYPE_FIELD, EmsFields::CONTENT_FILE_DATE, EmsFields::CONTENT_FILE_AUTHOR, EmsFields::CONTENT_FILE_LANGUAGE, EmsFields::CONTENT_FILE_CONTENT, EmsFields::CONTENT_FILE_TITLE], true)) { + if (!\in_array($id, [EmsFields::CONTENT_FILE_HASH_FIELD, EmsFields::CONTENT_FILE_NAME_FIELD, EmsFields::CONTENT_FILE_SIZE_FIELD, EmsFields::CONTENT_MIME_TYPE_FIELD, EmsFields::CONTENT_IMAGE_RESIZED_HASH_FIELD, EmsFields::CONTENT_FILE_DATE, EmsFields::CONTENT_FILE_AUTHOR, EmsFields::CONTENT_FILE_LANGUAGE, EmsFields::CONTENT_FILE_CONTENT, EmsFields::CONTENT_FILE_TITLE], true)) { unset($data[$id]); } elseif ('sha1' !== $id && empty($data[$id])) { unset($data[$id]); diff --git a/EMS/core-bundle/src/Form/Field/AssetType.php b/EMS/core-bundle/src/Form/Field/AssetType.php index 33761245a..0187da56e 100644 --- a/EMS/core-bundle/src/Form/Field/AssetType.php +++ b/EMS/core-bundle/src/Form/Field/AssetType.php @@ -2,6 +2,7 @@ namespace EMS\CoreBundle\Form\Field; +use EMS\CommonBundle\Helper\EmsFields; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\CollectionType; use Symfony\Component\Form\Extension\Core\Type\HiddenType; @@ -33,6 +34,12 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ], 'required' => $options['required'], ]) + ->add(EmsFields::CONTENT_IMAGE_RESIZED_HASH_FIELD, HiddenType::class, [ + 'attr' => [ + 'class' => 'resized-image-hash', + ], + 'required' => false, + ]) ->add('mimetype', TextType::class, [ 'attr' => [ 'class' => 'type', diff --git a/EMS/core-bundle/src/Form/Field/FileType.php b/EMS/core-bundle/src/Form/Field/FileType.php index 3c85236b0..04dd0b76c 100644 --- a/EMS/core-bundle/src/Form/Field/FileType.php +++ b/EMS/core-bundle/src/Form/Field/FileType.php @@ -2,6 +2,7 @@ namespace EMS\CoreBundle\Form\Field; +use EMS\CommonBundle\Helper\EmsFields; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\Extension\Core\Type\TextareaType; @@ -25,6 +26,12 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ], 'required' => $options['required'], ]) + ->add(EmsFields::CONTENT_IMAGE_RESIZED_HASH_FIELD, HiddenType::class, [ + 'attr' => [ + 'class' => 'resized-image-hash', + ], + 'required' => false, + ]) ->add('mimetype', TextType::class, [ 'attr' => [ 'class' => 'type', diff --git a/EMS/core-bundle/src/Form/Form/MediaLibrary/MediaLibraryDocumentFormType.php b/EMS/core-bundle/src/Form/Form/MediaLibrary/MediaLibraryDocumentFormType.php index 82aeac150..579220078 100644 --- a/EMS/core-bundle/src/Form/Form/MediaLibrary/MediaLibraryDocumentFormType.php +++ b/EMS/core-bundle/src/Form/Form/MediaLibrary/MediaLibraryDocumentFormType.php @@ -41,6 +41,9 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ->add('fileHash', HiddenType::class, [ 'constraints' => new NotBlank(), ]) + ->add('fileResizedHash', HiddenType::class, [ + 'empty_data' => null, + ]) ; } } diff --git a/EMS/core-bundle/src/Repository/ReleaseRepository.php b/EMS/core-bundle/src/Repository/ReleaseRepository.php index 6dc58c1c7..778ab11d3 100644 --- a/EMS/core-bundle/src/Repository/ReleaseRepository.php +++ b/EMS/core-bundle/src/Repository/ReleaseRepository.php @@ -117,12 +117,13 @@ public function getInWip(int $from, int $size, ?string $orderField, string $orde public function findReadyAndDue(): array { $qb = $this->createQueryBuilder('r'); - $qb->where('r.status = :status') - ->andWhere('r.executionDate <= :dateTime') - ->setParameters([ - 'status' => Release::READY_STATUS, - 'dateTime' => new \DateTime(), - ]); + $qb + ->andWhere($qb->expr()->eq('r.status', ':status')) + ->andWhere($qb->expr()->lte('r.executionDate', ':dateTime')) + ->setParameters([ + 'status' => Release::READY_STATUS, + 'dateTime' => new \DateTime(), + ]); return $qb->getQuery()->execute(); } diff --git a/EMS/core-bundle/src/Resources/config/command.xml b/EMS/core-bundle/src/Resources/config/command.xml index dc9717f35..7e9a18490 100644 --- a/EMS/core-bundle/src/Resources/config/command.xml +++ b/EMS/core-bundle/src/Resources/config/command.xml @@ -79,10 +79,6 @@ - - - - @@ -337,6 +333,7 @@ + %ems_core.date_time_format% %ems_core.clean_jobs_time_string% diff --git a/EMS/core-bundle/src/Resources/public/css/app.570f21be6054277c22df.css b/EMS/core-bundle/src/Resources/public/css/app.f1b15f85062893311983.css similarity index 100% rename from EMS/core-bundle/src/Resources/public/css/app.570f21be6054277c22df.css rename to EMS/core-bundle/src/Resources/public/css/app.f1b15f85062893311983.css diff --git a/EMS/core-bundle/src/Resources/public/css/calendar.61efda3accde65ac077d.css b/EMS/core-bundle/src/Resources/public/css/calendar.e08dcc1df058e680457e.css similarity index 100% rename from EMS/core-bundle/src/Resources/public/css/calendar.61efda3accde65ac077d.css rename to EMS/core-bundle/src/Resources/public/css/calendar.e08dcc1df058e680457e.css diff --git a/EMS/core-bundle/src/Resources/public/css/criteria-table.61efda3accde65ac077d.css b/EMS/core-bundle/src/Resources/public/css/criteria-table.e08dcc1df058e680457e.css similarity index 100% rename from EMS/core-bundle/src/Resources/public/css/criteria-table.61efda3accde65ac077d.css rename to EMS/core-bundle/src/Resources/public/css/criteria-table.e08dcc1df058e680457e.css diff --git a/EMS/core-bundle/src/Resources/public/css/criteria-view.61efda3accde65ac077d.css b/EMS/core-bundle/src/Resources/public/css/criteria-view.e08dcc1df058e680457e.css similarity index 100% rename from EMS/core-bundle/src/Resources/public/css/criteria-view.61efda3accde65ac077d.css rename to EMS/core-bundle/src/Resources/public/css/criteria-view.e08dcc1df058e680457e.css diff --git a/EMS/core-bundle/src/Resources/public/css/edit-revision.570f21be6054277c22df.css b/EMS/core-bundle/src/Resources/public/css/edit-revision.f1b15f85062893311983.css similarity index 100% rename from EMS/core-bundle/src/Resources/public/css/edit-revision.570f21be6054277c22df.css rename to EMS/core-bundle/src/Resources/public/css/edit-revision.f1b15f85062893311983.css diff --git a/EMS/core-bundle/src/Resources/public/css/hierarchical.61efda3accde65ac077d.css b/EMS/core-bundle/src/Resources/public/css/hierarchical.e08dcc1df058e680457e.css similarity index 100% rename from EMS/core-bundle/src/Resources/public/css/hierarchical.61efda3accde65ac077d.css rename to EMS/core-bundle/src/Resources/public/css/hierarchical.e08dcc1df058e680457e.css diff --git a/EMS/core-bundle/src/Resources/public/css/i18n.61efda3accde65ac077d.css b/EMS/core-bundle/src/Resources/public/css/i18n.e08dcc1df058e680457e.css similarity index 100% rename from EMS/core-bundle/src/Resources/public/css/i18n.61efda3accde65ac077d.css rename to EMS/core-bundle/src/Resources/public/css/i18n.e08dcc1df058e680457e.css diff --git a/EMS/core-bundle/src/Resources/public/css/managed-alias.61efda3accde65ac077d.css b/EMS/core-bundle/src/Resources/public/css/managed-alias.e08dcc1df058e680457e.css similarity index 100% rename from EMS/core-bundle/src/Resources/public/css/managed-alias.61efda3accde65ac077d.css rename to EMS/core-bundle/src/Resources/public/css/managed-alias.e08dcc1df058e680457e.css diff --git a/EMS/core-bundle/src/Resources/public/css/template.61efda3accde65ac077d.css b/EMS/core-bundle/src/Resources/public/css/template.e08dcc1df058e680457e.css similarity index 100% rename from EMS/core-bundle/src/Resources/public/css/template.61efda3accde65ac077d.css rename to EMS/core-bundle/src/Resources/public/css/template.e08dcc1df058e680457e.css diff --git a/EMS/core-bundle/src/Resources/public/css/user-profile.61efda3accde65ac077d.css b/EMS/core-bundle/src/Resources/public/css/user-profile.e08dcc1df058e680457e.css similarity index 100% rename from EMS/core-bundle/src/Resources/public/css/user-profile.61efda3accde65ac077d.css rename to EMS/core-bundle/src/Resources/public/css/user-profile.e08dcc1df058e680457e.css diff --git a/EMS/core-bundle/src/Resources/public/js/app.2754a2773f6e8a4047c9.js b/EMS/core-bundle/src/Resources/public/js/app.2754a2773f6e8a4047c9.js deleted file mode 100644 index 2e6a807f2..000000000 --- a/EMS/core-bundle/src/Resources/public/js/app.2754a2773f6e8a4047c9.js +++ /dev/null @@ -1,602 +0,0 @@ -!function(){var t={300:function(t,e,n){"use strict";n.d(e,{Z:function(){return s}});var i=n(5594),r=n.n(i);class o{static defaultCallbackFinal(t,e,n,i,r){console.log("Computed hash: "+t+" in "+e+"seconds (#chunks: "+i+", #reorder: "+r+"). File size: "+o.humanFileSize(n))}static defaultCallbackProgress(t,e,n,i,r,s){console.log("File hash in progress "+t+"% after "+e+" seconds ("+o.humanFileSize(n)+"/"+o.humanFileSize(i)+") (#chunks: "+r+", #reorder: "+s+")")}static humanFileSize(t,e=!0){const n=e?1e3:1024;if(Math.abs(t)=n&&r=this.fileHandler.size&&(this.lastOffset=0,this.finalHash());else{const n=this;setTimeout((function(){n.callbackRead(t,e)}),this.timeout),this.chunkReorder++}}progressHash(t){const e=r().lib.WordArray.create(t);this.HASH.update(e),this.counter+=t.byteLength;const n=(new Date-this.timeStart)/1e3;this.chunkTotal++,this.callbackProgress.call(this.callbackContext,(this.counter/this.fileHandler.size*100).toFixed(0),n,this.counter,this.fileHandler.size,this.chunkTotal,this.chunkReorder)}finalHash(){const t=this.HASH.finalize().toString(),e=(new Date-this.timeStart)/1e3;this.callbackFinal.call(this.callbackContext,t,e,this.fileHandler.size,this.chunkTotal,this.chunkReorder)}}class s{constructor(t){this.statics={CHUNK_SIZE:8388608,UPLOADED:1,ERROR:2,UPLOADING:3,PAUSE:4,LOADING:5,UPLOADERROR:6},t.file&&(this.file=t.file,this.size=t.file.size,this.type=t.file.type,this.name=t.file.name,this.lastModified=t.file.lastModified,this.initUrl=t.initUrl,this.algo=t.algo,this.onError=t.onError,this.onHashAvailable=t.onHashAvailable,this.onUploaded=t.onUploaded,this.onProgress=t.onProgress,this.errorDescription="N/A",this.hash=null,this.chunkUrl=null,this.uploaded=0,this.type&&""!==this.type||(this.type="application/octet-stream"),new o(this.file,this.callbackHashFinal,this.callbackHashProgress,this,void 0===this.algo?"sha1":this.algo))}callbackHashFinal(t){"function"==typeof this.onHashAvailable?this.onHashAvailable(t,this.type,this.name):console.log("Hash: "+t),this.hash=t,this.status=this.statics.UPLOADING,this.initUpload()}callbackHashProgress(t){"function"==typeof this.onProgress?this.onProgress("Computing hash",0,t+"%"):console.log("Hash treated at "+t+"%")}initUpload(){const t=this;if(this.status===this.statics.UPLOADING||this.status===this.statics.PAUSE){const e=new XMLHttpRequest;e.onload=function(){if(200===this.status){const e=JSON.parse(this.responseText);e&&void 0!==e.uploaded?(t.uploaded=e.uploaded,t.chunkUrl=e.chunkUrl,t.uploaded=0&&t 1 s":t>=n&&t=i&&t=r&&t=o?(t/o).toFixed(e)+" d":t+" ms"}}},9196:function(t,e,n){var i;t.exports=(i=n(3336),n(963),n(5033),n(8656),n(2484),function(){var t=i,e=t.lib.BlockCipher,n=t.algo,r=[],o=[],s=[],a=[],l=[],c=[],d=[],h=[],u=[],f=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var n=0,i=0;for(e=0;e<256;e++){var p=i^i<<1^i<<2^i<<3^i<<4;p=p>>>8^255&p^99,r[n]=p,o[p]=n;var m=t[n],g=t[m],v=t[g],y=257*t[p]^16843008*p;s[n]=y<<24|y>>>8,a[n]=y<<16|y>>>16,l[n]=y<<8|y>>>24,c[n]=y,y=16843009*v^65537*g^257*m^16843008*n,d[p]=y<<24|y>>>8,h[p]=y<<16|y>>>16,u[p]=y<<8|y>>>24,f[p]=y,n?(n=m^t[t[t[v^m]]],i^=t[t[i]]):n=i=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,n=t.sigBytes/4,i=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],s=0;s6&&s%n==4&&(c=r[c>>>24]<<24|r[c>>>16&255]<<16|r[c>>>8&255]<<8|r[255&c]):(c=r[(c=c<<8|c>>>24)>>>24]<<24|r[c>>>16&255]<<16|r[c>>>8&255]<<8|r[255&c],c^=p[s/n|0]<<24),o[s]=o[s-n]^c);for(var a=this._invKeySchedule=[],l=0;l>>24]]^h[r[c>>>16&255]]^u[r[c>>>8&255]]^f[r[255&c]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,a,l,c,r)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,d,h,u,f,o),n=t[e+1],t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,i,r,o,s,a){for(var l=this._nRounds,c=t[e]^n[0],d=t[e+1]^n[1],h=t[e+2]^n[2],u=t[e+3]^n[3],f=4,p=1;p>>24]^r[d>>>16&255]^o[h>>>8&255]^s[255&u]^n[f++],g=i[d>>>24]^r[h>>>16&255]^o[u>>>8&255]^s[255&c]^n[f++],v=i[h>>>24]^r[u>>>16&255]^o[c>>>8&255]^s[255&d]^n[f++],y=i[u>>>24]^r[c>>>16&255]^o[d>>>8&255]^s[255&h]^n[f++];c=m,d=g,h=v,u=y}m=(a[c>>>24]<<24|a[d>>>16&255]<<16|a[h>>>8&255]<<8|a[255&u])^n[f++],g=(a[d>>>24]<<24|a[h>>>16&255]<<16|a[u>>>8&255]<<8|a[255&c])^n[f++],v=(a[h>>>24]<<24|a[u>>>16&255]<<16|a[c>>>8&255]<<8|a[255&d])^n[f++],y=(a[u>>>24]<<24|a[c>>>16&255]<<16|a[d>>>8&255]<<8|a[255&h])^n[f++],t[e]=m,t[e+1]=g,t[e+2]=v,t[e+3]=y},keySize:8});t.AES=e._createHelper(m)}(),i.AES)},2484:function(t,e,n){var i;t.exports=(i=n(3336),n(8656),void(i.lib.Cipher||function(t){var e=i,n=e.lib,r=n.Base,o=n.WordArray,s=n.BufferedBlockAlgorithm,a=e.enc,l=(a.Utf8,a.Base64),c=e.algo.EvpKDF,d=n.Cipher=s.extend({cfg:r.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,n){this.cfg=this.cfg.extend(n),this._xformMode=t,this._key=e,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?_:v}return function(e){return{encrypt:function(n,i,r){return t(i).encrypt(e,n,i,r)},decrypt:function(n,i,r){return t(i).decrypt(e,n,i,r)}}}}()}),h=(n.StreamCipher=d.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),u=n.BlockCipherMode=r.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),f=h.CBC=function(){var e=u.extend();function n(e,n,i){var r,o=this._iv;o?(r=o,this._iv=t):r=this._prevBlock;for(var s=0;s>>2];t.sigBytes-=e}},m=(n.BlockCipher=d.extend({cfg:d.cfg.extend({mode:f,padding:p}),reset:function(){var t;d.reset.call(this);var e=this.cfg,n=e.iv,i=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=i.createEncryptor:(t=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,n&&n.words):(this._mode=t.call(i,this,n&&n.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),n.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),g=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,n=t.salt;return(n?o.create([1398893684,1701076831]).concat(n).concat(e):e).toString(l)},parse:function(t){var e,n=l.parse(t),i=n.words;return 1398893684==i[0]&&1701076831==i[1]&&(e=o.create(i.slice(2,4)),i.splice(0,4),n.sigBytes-=16),m.create({ciphertext:n,salt:e})}},v=n.SerializableCipher=r.extend({cfg:r.extend({format:g}),encrypt:function(t,e,n,i){i=this.cfg.extend(i);var r=t.createEncryptor(n,i),o=r.finalize(e),s=r.cfg;return m.create({ciphertext:o,key:n,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,n,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),t.createDecryptor(n,i).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),y=(e.kdf={}).OpenSSL={execute:function(t,e,n,i){i||(i=o.random(8));var r=c.create({keySize:e+n}).compute(t,i),s=o.create(r.words.slice(e),4*n);return r.sigBytes=4*e,m.create({key:r,iv:s,salt:i})}},_=n.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:y}),encrypt:function(t,e,n,i){var r=(i=this.cfg.extend(i)).kdf.execute(n,t.keySize,t.ivSize);i.iv=r.iv;var o=v.encrypt.call(this,t,e,r.key,i);return o.mixIn(r),o},decrypt:function(t,e,n,i){i=this.cfg.extend(i),e=this._parse(e,i.format);var r=i.kdf.execute(n,t.keySize,t.ivSize,e.salt);return i.iv=r.iv,v.decrypt.call(this,t,e,r.key,i)}})}()))},3336:function(t,e,n){var i;t.exports=(i=i||function(t,e){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==n.g&&n.g.crypto&&(i=n.g.crypto),!i)try{i=n(9551)}catch(t){}var r=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),s={},a=s.lib={},l=a.Base={extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=l.extend({init:function(t,n){t=this.words=t||[],this.sigBytes=n!=e?n:4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var e=this.words,n=t.words,i=this.sigBytes,r=t.sigBytes;if(this.clamp(),i%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[i+o>>>2]|=s<<24-(i+o)%4*8}else for(var a=0;a>>2]=n[a>>>2];return this.sigBytes+=r,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=l.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],n=0;n>>2]>>>24-r%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,n=[],i=0;i>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new c.init(n,e/2)}},u=d.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,i=[],r=0;r>>2]>>>24-r%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var e=t.length,n=[],i=0;i>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new c.init(n,e)}},f=d.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},p=a.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n,i=this._data,r=i.words,o=i.sigBytes,s=this.blockSize,a=o/(4*s),l=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*s,d=t.min(4*l,o);if(l){for(var h=0;h>>6-s%4*2;r[o>>>2]|=a<<24-o%4*8,o++}return e.create(r,o)}t.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,i=this._map;t.clamp();for(var r=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var l=i.charAt(64);if(l)for(;r.length%4;)r.push(l);return r.join("")},parse:function(t){var e=t.length,i=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o>>6-s%4*2;r[o>>>2]|=a<<24-o%4*8,o++}return e.create(r,o)}t.enc.Base64url={stringify:function(t,e=!0){var n=t.words,i=t.sigBytes,r=e?this._safe_map:this._map;t.clamp();for(var o=[],s=0;s>>2]>>>24-s%4*8&255)<<16|(n[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|n[s+2>>>2]>>>24-(s+2)%4*8&255,l=0;l<4&&s+.75*l>>6*(3-l)&63));var c=r.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(t,e=!0){var i=t.length,r=e?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var s=0;s>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(t){for(var e=t.words,n=t.sigBytes,i=[],r=0;r>>2]>>>16-r%4*8&65535;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var n=t.length,i=[],r=0;r>>1]|=t.charCodeAt(r)<<16-r%2*16;return e.create(i,2*n)}},n.Utf16LE={stringify:function(t){for(var e=t.words,n=t.sigBytes,i=[],o=0;o>>2]>>>16-o%4*8&65535);i.push(String.fromCharCode(s))}return i.join("")},parse:function(t){for(var n=t.length,i=[],o=0;o>>1]|=r(t.charCodeAt(o)<<16-o%2*16);return e.create(i,2*n)}}}(),i.enc.Utf16)},8656:function(t,e,n){var i,r,o,s,a,l,c,d;t.exports=(d=n(3336),n(7776),n(7053),r=(i=d).lib,o=r.Base,s=r.WordArray,a=i.algo,l=a.MD5,c=a.EvpKDF=o.extend({cfg:o.extend({keySize:4,hasher:l,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n,i=this.cfg,r=i.hasher.create(),o=s.create(),a=o.words,l=i.keySize,c=i.iterations;a.lengthi&&(e=t.finalize(e)),e.clamp();for(var r=this._oKey=e.clone(),o=this._iKey=e.clone(),a=r.words,l=o.words,c=0;c>>2]|=t[r]<<24-r%4*8;e.call(this,i,n)}else e.apply(this,arguments)};n.prototype=t}}(),i.lib.WordArray)},5033:function(t,e,n){var i;t.exports=(i=n(3336),function(t){var e=i,n=e.lib,r=n.WordArray,o=n.Hasher,s=e.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var l=s.MD5=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var n=0;n<16;n++){var i=e+n,r=t[i];t[i]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var o=this._hash.words,s=t[e+0],l=t[e+1],f=t[e+2],p=t[e+3],m=t[e+4],g=t[e+5],v=t[e+6],y=t[e+7],_=t[e+8],b=t[e+9],w=t[e+10],T=t[e+11],C=t[e+12],E=t[e+13],D=t[e+14],k=t[e+15],x=o[0],S=o[1],I=o[2],R=o[3];x=c(x,S,I,R,s,7,a[0]),R=c(R,x,S,I,l,12,a[1]),I=c(I,R,x,S,f,17,a[2]),S=c(S,I,R,x,p,22,a[3]),x=c(x,S,I,R,m,7,a[4]),R=c(R,x,S,I,g,12,a[5]),I=c(I,R,x,S,v,17,a[6]),S=c(S,I,R,x,y,22,a[7]),x=c(x,S,I,R,_,7,a[8]),R=c(R,x,S,I,b,12,a[9]),I=c(I,R,x,S,w,17,a[10]),S=c(S,I,R,x,T,22,a[11]),x=c(x,S,I,R,C,7,a[12]),R=c(R,x,S,I,E,12,a[13]),I=c(I,R,x,S,D,17,a[14]),x=d(x,S=c(S,I,R,x,k,22,a[15]),I,R,l,5,a[16]),R=d(R,x,S,I,v,9,a[17]),I=d(I,R,x,S,T,14,a[18]),S=d(S,I,R,x,s,20,a[19]),x=d(x,S,I,R,g,5,a[20]),R=d(R,x,S,I,w,9,a[21]),I=d(I,R,x,S,k,14,a[22]),S=d(S,I,R,x,m,20,a[23]),x=d(x,S,I,R,b,5,a[24]),R=d(R,x,S,I,D,9,a[25]),I=d(I,R,x,S,p,14,a[26]),S=d(S,I,R,x,_,20,a[27]),x=d(x,S,I,R,E,5,a[28]),R=d(R,x,S,I,f,9,a[29]),I=d(I,R,x,S,y,14,a[30]),x=h(x,S=d(S,I,R,x,C,20,a[31]),I,R,g,4,a[32]),R=h(R,x,S,I,_,11,a[33]),I=h(I,R,x,S,T,16,a[34]),S=h(S,I,R,x,D,23,a[35]),x=h(x,S,I,R,l,4,a[36]),R=h(R,x,S,I,m,11,a[37]),I=h(I,R,x,S,y,16,a[38]),S=h(S,I,R,x,w,23,a[39]),x=h(x,S,I,R,E,4,a[40]),R=h(R,x,S,I,s,11,a[41]),I=h(I,R,x,S,p,16,a[42]),S=h(S,I,R,x,v,23,a[43]),x=h(x,S,I,R,b,4,a[44]),R=h(R,x,S,I,C,11,a[45]),I=h(I,R,x,S,k,16,a[46]),x=u(x,S=h(S,I,R,x,f,23,a[47]),I,R,s,6,a[48]),R=u(R,x,S,I,y,10,a[49]),I=u(I,R,x,S,D,15,a[50]),S=u(S,I,R,x,g,21,a[51]),x=u(x,S,I,R,C,6,a[52]),R=u(R,x,S,I,p,10,a[53]),I=u(I,R,x,S,w,15,a[54]),S=u(S,I,R,x,l,21,a[55]),x=u(x,S,I,R,_,6,a[56]),R=u(R,x,S,I,k,10,a[57]),I=u(I,R,x,S,v,15,a[58]),S=u(S,I,R,x,E,21,a[59]),x=u(x,S,I,R,m,6,a[60]),R=u(R,x,S,I,T,10,a[61]),I=u(I,R,x,S,f,15,a[62]),S=u(S,I,R,x,b,21,a[63]),o[0]=o[0]+x|0,o[1]=o[1]+S|0,o[2]=o[2]+I|0,o[3]=o[3]+R|0},_doFinalize:function(){var e=this._data,n=e.words,i=8*this._nDataBytes,r=8*e.sigBytes;n[r>>>5]|=128<<24-r%32;var o=t.floor(i/4294967296),s=i;n[15+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(r+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,l=a.words,c=0;c<4;c++){var d=l[c];l[c]=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8)}return a},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function c(t,e,n,i,r,o,s){var a=t+(e&n|~e&i)+r+s;return(a<>>32-o)+e}function d(t,e,n,i,r,o,s){var a=t+(e&i|n&~i)+r+s;return(a<>>32-o)+e}function h(t,e,n,i,r,o,s){var a=t+(e^n^i)+r+s;return(a<>>32-o)+e}function u(t,e,n,i,r,o,s){var a=t+(n^(e|~i))+r+s;return(a<>>32-o)+e}e.MD5=o._createHelper(l),e.HmacMD5=o._createHmacHelper(l)}(Math),i.MD5)},9921:function(t,e,n){var i;t.exports=(i=n(3336),n(2484),i.mode.CFB=function(){var t=i.lib.BlockCipherMode.extend();function e(t,e,n,i){var r,o=this._iv;o?(r=o.slice(0),this._iv=void 0):r=this._prevBlock,i.encryptBlock(r,0);for(var s=0;s>24&255)){var e=t>>16&255,n=t>>8&255,i=255&t;255===e?(e=0,255===n?(n=0,255===i?i=0:++i):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=i}else t+=1<<24;return t}function n(t){return 0===(t[0]=e(t[0]))&&(t[1]=e(t[1])),t}var r=t.Encryptor=t.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize,o=this._iv,s=this._counter;o&&(s=this._counter=o.slice(0),this._iv=void 0),n(s);var a=s.slice(0);i.encryptBlock(a,0);for(var l=0;l>>2]|=r<<24-o%4*8,t.sigBytes+=r},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},i.pad.Ansix923)},4864:function(t,e,n){var i;t.exports=(i=n(3336),n(2484),i.pad.Iso10126={pad:function(t,e){var n=4*e,r=n-t.sigBytes%n;t.concat(i.lib.WordArray.random(r-1)).concat(i.lib.WordArray.create([r<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},i.pad.Iso10126)},8218:function(t,e,n){var i;t.exports=(i=n(3336),n(2484),i.pad.Iso97971={pad:function(t,e){t.concat(i.lib.WordArray.create([2147483648],1)),i.pad.ZeroPadding.pad(t,e)},unpad:function(t){i.pad.ZeroPadding.unpad(t),t.sigBytes--}},i.pad.Iso97971)},1341:function(t,e,n){var i;t.exports=(i=n(3336),n(2484),i.pad.NoPadding={pad:function(){},unpad:function(){}},i.pad.NoPadding)},5144:function(t,e,n){var i;t.exports=(i=n(3336),n(2484),i.pad.ZeroPadding={pad:function(t,e){var n=4*e;t.clamp(),t.sigBytes+=n-(t.sigBytes%n||n)},unpad:function(t){var e=t.words,n=t.sigBytes-1;for(n=t.sigBytes-1;n>=0;n--)if(e[n>>>2]>>>24-n%4*8&255){t.sigBytes=n+1;break}}},i.pad.ZeroPadding)},9202:function(t,e,n){var i,r,o,s,a,l,c,d,h;t.exports=(h=n(3336),n(7776),n(7053),r=(i=h).lib,o=r.Base,s=r.WordArray,a=i.algo,l=a.SHA1,c=a.HMAC,d=a.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:l,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n=this.cfg,i=c.create(n.hasher,t),r=s.create(),o=s.create([1]),a=r.words,l=o.words,d=n.keySize,h=n.iterations;a.length>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var r=0;r<4;r++)l.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(e){var o=e.words,s=o[0],a=o[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),h=c>>>16|4294901760&d,u=d<<16|65535&c;for(i[0]^=c,i[1]^=h,i[2]^=d,i[3]^=u,i[4]^=c,i[5]^=h,i[6]^=d,i[7]^=u,r=0;r<4;r++)l.call(this)}},_doProcessBlock:function(t,e){var n=this._X;l.call(this),r[0]=n[0]^n[5]>>>16^n[3]<<16,r[1]=n[2]^n[7]>>>16^n[5]<<16,r[2]=n[4]^n[1]>>>16^n[7]<<16,r[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)r[i]=16711935&(r[i]<<8|r[i]>>>24)|4278255360&(r[i]<<24|r[i]>>>8),t[e+i]^=r[i]},blockSize:4,ivSize:2});function l(){for(var t=this._X,e=this._C,n=0;n<8;n++)o[n]=e[n];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,n=0;n<8;n++){var i=t[n]+e[n],r=65535&i,a=i>>>16,l=((r*r>>>17)+r*a>>>15)+a*a,c=((4294901760&i)*i|0)+((65535&i)*i|0);s[n]=l^c}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.RabbitLegacy=e._createHelper(a)}(),i.RabbitLegacy)},1636:function(t,e,n){var i;t.exports=(i=n(3336),n(963),n(5033),n(8656),n(2484),function(){var t=i,e=t.lib.StreamCipher,n=t.algo,r=[],o=[],s=[],a=n.Rabbit=e.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,n=0;n<4;n++)t[n]=16711935&(t[n]<<8|t[n]>>>24)|4278255360&(t[n]<<24|t[n]>>>8);var i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],r=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,n=0;n<4;n++)l.call(this);for(n=0;n<8;n++)r[n]^=i[n+4&7];if(e){var o=e.words,s=o[0],a=o[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),h=c>>>16|4294901760&d,u=d<<16|65535&c;for(r[0]^=c,r[1]^=h,r[2]^=d,r[3]^=u,r[4]^=c,r[5]^=h,r[6]^=d,r[7]^=u,n=0;n<4;n++)l.call(this)}},_doProcessBlock:function(t,e){var n=this._X;l.call(this),r[0]=n[0]^n[5]>>>16^n[3]<<16,r[1]=n[2]^n[7]>>>16^n[5]<<16,r[2]=n[4]^n[1]>>>16^n[7]<<16,r[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)r[i]=16711935&(r[i]<<8|r[i]>>>24)|4278255360&(r[i]<<24|r[i]>>>8),t[e+i]^=r[i]},blockSize:4,ivSize:2});function l(){for(var t=this._X,e=this._C,n=0;n<8;n++)o[n]=e[n];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,n=0;n<8;n++){var i=t[n]+e[n],r=65535&i,a=i>>>16,l=((r*r>>>17)+r*a>>>15)+a*a,c=((4294901760&i)*i|0)+((65535&i)*i|0);s[n]=l^c}t[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,t[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,t[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,t[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,t[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,t[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,t[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,t[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}t.Rabbit=e._createHelper(a)}(),i.Rabbit)},2462:function(t,e,n){var i;t.exports=(i=n(3336),n(963),n(5033),n(8656),n(2484),function(){var t=i,e=t.lib.StreamCipher,n=t.algo,r=n.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,n=t.sigBytes,i=this._S=[],r=0;r<256;r++)i[r]=r;r=0;for(var o=0;r<256;r++){var s=r%n,a=e[s>>>2]>>>24-s%4*8&255;o=(o+i[r]+a)%256;var l=i[r];i[r]=i[o],i[o]=l}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var t=this._S,e=this._i,n=this._j,i=0,r=0;r<4;r++){n=(n+t[e=(e+1)%256])%256;var o=t[e];t[e]=t[n],t[n]=o,i|=t[(t[e]+t[n])%256]<<24-8*r}return this._i=e,this._j=n,i}t.RC4=e._createHelper(r);var s=n.RC4Drop=r.extend({cfg:r.cfg.extend({drop:192}),_doReset:function(){r._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)o.call(this)}});t.RC4Drop=e._createHelper(s)}(),i.RC4)},9857:function(t,e,n){var i;t.exports=(i=n(3336), -/** @preserve - (c) 2012 by Cédric Mesnil. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -function(t){var e=i,n=e.lib,r=n.WordArray,o=n.Hasher,s=e.algo,a=r.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=r.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=r.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),d=r.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=r.create([0,1518500249,1859775393,2400959708,2840853838]),u=r.create([1352829926,1548603684,1836072691,2053994217,0]),f=s.RIPEMD160=o.extend({_doReset:function(){this._hash=r.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=0;n<16;n++){var i=e+n,r=t[i];t[i]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var o,s,f,b,w,T,C,E,D,k,x,S=this._hash.words,I=h.words,R=u.words,O=a.words,M=l.words,L=c.words,A=d.words;for(T=o=S[0],C=s=S[1],E=f=S[2],D=b=S[3],k=w=S[4],n=0;n<80;n+=1)x=o+t[e+O[n]]|0,x+=n<16?p(s,f,b)+I[0]:n<32?m(s,f,b)+I[1]:n<48?g(s,f,b)+I[2]:n<64?v(s,f,b)+I[3]:y(s,f,b)+I[4],x=(x=_(x|=0,L[n]))+w|0,o=w,w=b,b=_(f,10),f=s,s=x,x=T+t[e+M[n]]|0,x+=n<16?y(C,E,D)+R[0]:n<32?v(C,E,D)+R[1]:n<48?g(C,E,D)+R[2]:n<64?m(C,E,D)+R[3]:p(C,E,D)+R[4],x=(x=_(x|=0,A[n]))+k|0,T=k,k=D,D=_(E,10),E=C,C=x;x=S[1]+f+D|0,S[1]=S[2]+b+k|0,S[2]=S[3]+w+T|0,S[3]=S[4]+o+C|0,S[4]=S[0]+s+E|0,S[0]=x},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(e.length+1),this._process();for(var r=this._hash,o=r.words,s=0;s<5;s++){var a=o[s];o[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return r},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,n){return t^e^n}function m(t,e,n){return t&e|~t&n}function g(t,e,n){return(t|~e)^n}function v(t,e,n){return t&n|e&~n}function y(t,e,n){return t^(e|~n)}function _(t,e){return t<>>32-e}e.RIPEMD160=o._createHelper(f),e.HmacRIPEMD160=o._createHmacHelper(f)}(Math),i.RIPEMD160)},7776:function(t,e,n){var i,r,o,s,a,l,c,d;t.exports=(d=n(3336),r=(i=d).lib,o=r.WordArray,s=r.Hasher,a=i.algo,l=[],c=a.SHA1=s.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],s=n[3],a=n[4],c=0;c<80;c++){if(c<16)l[c]=0|t[e+c];else{var d=l[c-3]^l[c-8]^l[c-14]^l[c-16];l[c]=d<<1|d>>>31}var h=(i<<5|i>>>27)+a+l[c];h+=c<20?1518500249+(r&o|~r&s):c<40?1859775393+(r^o^s):c<60?(r&o|r&s|o&s)-1894007588:(r^o^s)-899497514,a=s,s=o,o=r<<30|r>>>2,r=i,i=h}n[0]=n[0]+i|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=Math.floor(n/4294967296),e[15+(i+64>>>9<<4)]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}}),i.SHA1=s._createHelper(c),i.HmacSHA1=s._createHmacHelper(c),d.SHA1)},6150:function(t,e,n){var i,r,o,s,a,l;t.exports=(l=n(3336),n(6077),r=(i=l).lib.WordArray,o=i.algo,s=o.SHA256,a=o.SHA224=s.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=s._doFinalize.call(this);return t.sigBytes-=4,t}}),i.SHA224=s._createHelper(a),i.HmacSHA224=s._createHmacHelper(a),l.SHA224)},6077:function(t,e,n){var i;t.exports=(i=n(3336),function(t){var e=i,n=e.lib,r=n.WordArray,o=n.Hasher,s=e.algo,a=[],l=[];!function(){function e(e){for(var n=t.sqrt(e),i=2;i<=n;i++)if(!(e%i))return!1;return!0}function n(t){return 4294967296*(t-(0|t))|0}for(var i=2,r=0;r<64;)e(i)&&(r<8&&(a[r]=n(t.pow(i,.5))),l[r]=n(t.pow(i,1/3)),r++),i++}();var c=[],d=s.SHA256=o.extend({_doReset:function(){this._hash=new r.init(a.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],s=n[3],a=n[4],d=n[5],h=n[6],u=n[7],f=0;f<64;f++){if(f<16)c[f]=0|t[e+f];else{var p=c[f-15],m=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=c[f-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[f]=m+c[f-7]+v+c[f-16]}var y=i&r^i&o^r&o,_=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=u+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&d^~a&h)+l[f]+c[f];u=h,h=d,d=a,a=s+b|0,s=o,o=r,r=i,i=b+(_+y)|0}n[0]=n[0]+i|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+d|0,n[6]=n[6]+h|0,n[7]=n[7]+u|0},_doFinalize:function(){var e=this._data,n=e.words,i=8*this._nDataBytes,r=8*e.sigBytes;return n[r>>>5]|=128<<24-r%32,n[14+(r+64>>>9<<4)]=t.floor(i/4294967296),n[15+(r+64>>>9<<4)]=i,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(d),e.HmacSHA256=o._createHmacHelper(d)}(Math),i.SHA256)},2819:function(t,e,n){var i;t.exports=(i=n(3336),n(7795),function(t){var e=i,n=e.lib,r=n.WordArray,o=n.Hasher,s=e.x64.Word,a=e.algo,l=[],c=[],d=[];!function(){for(var t=1,e=0,n=0;n<24;n++){l[t+5*e]=(n+1)*(n+2)/2%64;var i=(2*t+3*e)%5;t=e%5,e=i}for(t=0;t<5;t++)for(e=0;e<5;e++)c[t+5*e]=e+(2*t+3*e)%5*5;for(var r=1,o=0;o<24;o++){for(var a=0,h=0,u=0;u<7;u++){if(1&r){var f=(1<>>24)|4278255360&(o<<24|o>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(S=n[r]).high^=s,S.low^=o}for(var a=0;a<24;a++){for(var u=0;u<5;u++){for(var f=0,p=0,m=0;m<5;m++)f^=(S=n[u+5*m]).high,p^=S.low;var g=h[u];g.high=f,g.low=p}for(u=0;u<5;u++){var v=h[(u+4)%5],y=h[(u+1)%5],_=y.high,b=y.low;for(f=v.high^(_<<1|b>>>31),p=v.low^(b<<1|_>>>31),m=0;m<5;m++)(S=n[u+5*m]).high^=f,S.low^=p}for(var w=1;w<25;w++){var T=(S=n[w]).high,C=S.low,E=l[w];E<32?(f=T<>>32-E,p=C<>>32-E):(f=C<>>64-E,p=T<>>64-E);var D=h[c[w]];D.high=f,D.low=p}var k=h[0],x=n[0];for(k.high=x.high,k.low=x.low,u=0;u<5;u++)for(m=0;m<5;m++){var S=n[w=u+5*m],I=h[w],R=h[(u+1)%5+5*m],O=h[(u+2)%5+5*m];S.high=I.high^~R.high&O.high,S.low=I.low^~R.low&O.low}S=n[0];var M=d[a];S.high^=M.high,S.low^=M.low}},_doFinalize:function(){var e=this._data,n=e.words,i=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;n[i>>>5]|=1<<24-i%32,n[(t.ceil((i+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*n.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,l=a/8,c=[],d=0;d>>24)|4278255360&(u<<24|u>>>8),f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),c.push(f),c.push(u)}return new r.init(c,a)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),n=0;n<25;n++)e[n]=e[n].clone();return t}});e.SHA3=o._createHelper(u),e.HmacSHA3=o._createHmacHelper(u)}(Math),i.SHA3)},8769:function(t,e,n){var i,r,o,s,a,l,c,d;t.exports=(d=n(3336),n(7795),n(2476),r=(i=d).x64,o=r.Word,s=r.WordArray,a=i.algo,l=a.SHA512,c=a.SHA384=l.extend({_doReset:function(){this._hash=new s.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var t=l._doFinalize.call(this);return t.sigBytes-=16,t}}),i.SHA384=l._createHelper(c),i.HmacSHA384=l._createHmacHelper(c),d.SHA384)},2476:function(t,e,n){var i;t.exports=(i=n(3336),n(7795),function(){var t=i,e=t.lib.Hasher,n=t.x64,r=n.Word,o=n.WordArray,s=t.algo;function a(){return r.create.apply(r,arguments)}var l=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],c=[];!function(){for(var t=0;t<80;t++)c[t]=a()}();var d=s.SHA512=e.extend({_doReset:function(){this._hash=new o.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],s=n[3],a=n[4],d=n[5],h=n[6],u=n[7],f=i.high,p=i.low,m=r.high,g=r.low,v=o.high,y=o.low,_=s.high,b=s.low,w=a.high,T=a.low,C=d.high,E=d.low,D=h.high,k=h.low,x=u.high,S=u.low,I=f,R=p,O=m,M=g,L=v,A=y,P=_,N=b,K=w,$=T,F=C,H=E,B=D,Y=k,j=x,W=S,z=0;z<80;z++){var U,V,q=c[z];if(z<16)V=q.high=0|t[e+2*z],U=q.low=0|t[e+2*z+1];else{var G=c[z-15],X=G.high,J=G.low,Z=(X>>>1|J<<31)^(X>>>8|J<<24)^X>>>7,Q=(J>>>1|X<<31)^(J>>>8|X<<24)^(J>>>7|X<<25),tt=c[z-2],et=tt.high,nt=tt.low,it=(et>>>19|nt<<13)^(et<<3|nt>>>29)^et>>>6,rt=(nt>>>19|et<<13)^(nt<<3|et>>>29)^(nt>>>6|et<<26),ot=c[z-7],st=ot.high,at=ot.low,lt=c[z-16],ct=lt.high,dt=lt.low;V=(V=(V=Z+st+((U=Q+at)>>>0>>0?1:0))+it+((U+=rt)>>>0>>0?1:0))+ct+((U+=dt)>>>0
>>0?1:0),q.high=V,q.low=U}var ht,ut=K&F^~K&B,ft=$&H^~$&Y,pt=I&O^I&L^O&L,mt=R&M^R&A^M&A,gt=(I>>>28|R<<4)^(I<<30|R>>>2)^(I<<25|R>>>7),vt=(R>>>28|I<<4)^(R<<30|I>>>2)^(R<<25|I>>>7),yt=(K>>>14|$<<18)^(K>>>18|$<<14)^(K<<23|$>>>9),_t=($>>>14|K<<18)^($>>>18|K<<14)^($<<23|K>>>9),bt=l[z],wt=bt.high,Tt=bt.low,Ct=j+yt+((ht=W+_t)>>>0>>0?1:0),Et=vt+mt;j=B,W=Y,B=F,Y=H,F=K,H=$,K=P+(Ct=(Ct=(Ct=Ct+ut+((ht+=ft)>>>0>>0?1:0))+wt+((ht+=Tt)>>>0>>0?1:0))+V+((ht+=U)>>>0>>0?1:0))+(($=N+ht|0)>>>0>>0?1:0)|0,P=L,N=A,L=O,A=M,O=I,M=R,I=Ct+(gt+pt+(Et>>>0>>0?1:0))+((R=ht+Et|0)>>>0>>0?1:0)|0}p=i.low=p+R,i.high=f+I+(p>>>0>>0?1:0),g=r.low=g+M,r.high=m+O+(g>>>0>>0?1:0),y=o.low=y+A,o.high=v+L+(y>>>0>>0?1:0),b=s.low=b+N,s.high=_+P+(b>>>0>>0?1:0),T=a.low=T+$,a.high=w+K+(T>>>0<$>>>0?1:0),E=d.low=E+H,d.high=C+F+(E>>>0>>0?1:0),k=h.low=k+Y,h.high=D+B+(k>>>0>>0?1:0),S=u.low=S+W,u.high=x+j+(S>>>0>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(i+128>>>10<<5)]=Math.floor(n/4294967296),e[31+(i+128>>>10<<5)]=n,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(d),t.HmacSHA512=e._createHmacHelper(d)}(),i.SHA512)},8672:function(t,e,n){var i;t.exports=(i=n(3336),n(963),n(5033),n(8656),n(2484),function(){var t=i,e=t.lib,n=e.WordArray,r=e.BlockCipher,o=t.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],d=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=o.DES=r.extend({_doReset:function(){for(var t=this._key.words,e=[],n=0;n<56;n++){var i=s[n]-1;e[n]=t[i>>>5]>>>31-i%32&1}for(var r=this._subKeys=[],o=0;o<16;o++){var c=r[o]=[],d=l[o];for(n=0;n<24;n++)c[n/6|0]|=e[(a[n]-1+d)%28]<<31-n%6,c[4+(n/6|0)]|=e[28+(a[n+24]-1+d)%28]<<31-n%6;for(c[0]=c[0]<<1|c[0]>>>31,n=1;n<7;n++)c[n]=c[n]>>>4*(n-1)+3;c[7]=c[7]<<5|c[7]>>>27}var h=this._invSubKeys=[];for(n=0;n<16;n++)h[n]=r[15-n]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,n){this._lBlock=t[e],this._rBlock=t[e+1],u.call(this,4,252645135),u.call(this,16,65535),f.call(this,2,858993459),f.call(this,8,16711935),u.call(this,1,1431655765);for(var i=0;i<16;i++){for(var r=n[i],o=this._lBlock,s=this._rBlock,a=0,l=0;l<8;l++)a|=c[l][((s^r[l])&d[l])>>>0];this._lBlock=s,this._rBlock=o^a}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,u.call(this,1,1431655765),f.call(this,8,16711935),f.call(this,2,858993459),u.call(this,16,65535),u.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function u(t,e){var n=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=n,this._lBlock^=n<>>t^this._lBlock)&e;this._lBlock^=n,this._rBlock^=n<192.");var e=t.slice(0,2),i=t.length<4?t.slice(0,2):t.slice(2,4),r=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=h.createEncryptor(n.create(e)),this._des2=h.createEncryptor(n.create(i)),this._des3=h.createEncryptor(n.create(r))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=r._createHelper(p)}(),i.TripleDES)},7795:function(t,e,n){var i;t.exports=(i=n(3336),function(t){var e=i,n=e.lib,r=n.Base,o=n.WordArray,s=e.x64={};s.Word=r.extend({init:function(t,e){this.high=t,this.low=e}}),s.WordArray=r.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:8*e.length},toX32:function(){for(var t=this.words,e=t.length,n=[],i=0;i=0?parseFloat((o.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((o.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),e.isOldIE=e.isIE&&e.isIE<9,e.isGecko=e.isMozilla=o.match(/ Gecko\/\d+/),e.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),e.isWebKit=parseFloat(o.split("WebKit/")[1])||void 0,e.isChrome=parseFloat(o.split(" Chrome/")[1])||void 0,e.isEdge=parseFloat(o.split(" Edge/")[1])||void 0,e.isAIR=o.indexOf("AdobeAIR")>=0,e.isAndroid=o.indexOf("Android")>=0,e.isChromeOS=o.indexOf(" CrOS ")>=0,e.isIOS=/iPad|iPhone|iPod/.test(o)&&!window.MSStream,e.isIOS&&(e.isMac=!0),e.isMobile=e.isIOS||e.isAndroid})),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],(function(t,e,n){"use strict";var i=t("./useragent");if(e.buildDom=function t(e,n,i){if("string"==typeof e&&e){var r=document.createTextNode(e);return n&&n.appendChild(r),r}if(!Array.isArray(e))return e&&e.appendChild&&n&&n.appendChild(e),e;if("string"!=typeof e[0]||!e[0]){for(var o=[],s=0;s=1.5,"undefined"!=typeof document){var r=document.createElement("div");e.HI_DPI&&void 0!==r.style.transform&&(e.HAS_CSS_TRANSFORMS=!0),i.isEdge||void 0===r.style.animationName||(e.HAS_CSS_ANIMATION=!0),r=null}e.HAS_CSS_TRANSFORMS?e.translate=function(t,e,n){t.style.transform="translate("+Math.round(e)+"px, "+Math.round(n)+"px)"}:e.translate=function(t,e,n){t.style.top=Math.round(n)+"px",t.style.left=Math.round(e)+"px"}})),ace.define("ace/lib/oop",["require","exports","module"],(function(t,e,n){"use strict";e.inherits=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})},e.mixin=function(t,e){for(var n in e)t[n]=e[n];return t},e.implement=function(t,n){e.mixin(t,n)}})),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],(function(t,e,n){"use strict";var i=t("./oop"),r=function(){var t,e,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(e in n.FUNCTION_KEYS)t=n.FUNCTION_KEYS[e].toLowerCase(),n[t]=parseInt(e,10);for(e in n.PRINTABLE_KEYS)t=n.PRINTABLE_KEYS[e].toLowerCase(),n[t]=parseInt(e,10);return i.mixin(n,n.MODIFIER_KEYS),i.mixin(n,n.PRINTABLE_KEYS),i.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var t=["cmd","ctrl","alt","shift"],e=Math.pow(2,t.length);e--;)n.KEY_MODS[e]=t.filter((function(t){return e&n.KEY_MODS[t]})).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();i.mixin(e,r),e.keyCodeToString=function(t){var e=r[t];return"string"!=typeof e&&(e=String.fromCharCode(t)),e.toLowerCase()}})),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(t,e,n){"use strict";var i,r=t("./keys"),o=t("./useragent"),s=null,a=0;function l(){return null==i&&function(){i=!1;try{document.createComment("").addEventListener("test",(function(){}),{get passive(){i={passive:!1}}})}catch(t){}}(),i}function c(t,e,n){this.elem=t,this.type=e,this.callback=n}c.prototype.destroy=function(){h(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var d=e.addListener=function(t,e,n,i){t.addEventListener(e,n,l()),i&&i.$toDestroy.push(new c(t,e,n))},h=e.removeListener=function(t,e,n){t.removeEventListener(e,n,l())};e.stopEvent=function(t){return e.stopPropagation(t),e.preventDefault(t),!1},e.stopPropagation=function(t){t.stopPropagation&&t.stopPropagation()},e.preventDefault=function(t){t.preventDefault&&t.preventDefault()},e.getButton=function(t){return"dblclick"==t.type?0:"contextmenu"==t.type||o.isMac&&t.ctrlKey&&!t.altKey&&!t.shiftKey?2:t.button},e.capture=function(t,e,n){var i=t&&t.ownerDocument||document;function r(t){e&&e(t),n&&n(t),h(i,"mousemove",e),h(i,"mouseup",r),h(i,"dragstart",r)}return d(i,"mousemove",e),d(i,"mouseup",r),d(i,"dragstart",r),r},e.addMouseWheelListener=function(t,e,n){"onmousewheel"in t?d(t,"mousewheel",(function(t){void 0!==t.wheelDeltaX?(t.wheelX=-t.wheelDeltaX/8,t.wheelY=-t.wheelDeltaY/8):(t.wheelX=0,t.wheelY=-t.wheelDelta/8),e(t)}),n):"onwheel"in t?d(t,"wheel",(function(t){switch(t.deltaMode){case t.DOM_DELTA_PIXEL:t.wheelX=.35*t.deltaX||0,t.wheelY=.35*t.deltaY||0;break;case t.DOM_DELTA_LINE:case t.DOM_DELTA_PAGE:t.wheelX=5*(t.deltaX||0),t.wheelY=5*(t.deltaY||0)}e(t)}),n):d(t,"DOMMouseScroll",(function(t){t.axis&&t.axis==t.HORIZONTAL_AXIS?(t.wheelX=5*(t.detail||0),t.wheelY=0):(t.wheelX=0,t.wheelY=5*(t.detail||0)),e(t)}),n)},e.addMultiMouseDownListener=function(t,n,i,r,s){var a,l,c,h=0,u={2:"dblclick",3:"tripleclick",4:"quadclick"};function f(t){if(0!==e.getButton(t)?h=0:t.detail>1?++h>4&&(h=1):h=1,o.isIE){var s=Math.abs(t.clientX-a)>5||Math.abs(t.clientY-l)>5;c&&!s||(h=1),c&&clearTimeout(c),c=setTimeout((function(){c=null}),n[h-1]||600),1==h&&(a=t.clientX,l=t.clientY)}if(t._clicks=h,i[r]("mousedown",t),h>4)h=0;else if(h>1)return i[r](u[h],t)}Array.isArray(t)||(t=[t]),t.forEach((function(t){d(t,"mousedown",f,s)}))};var u=function(t){return 0|(t.ctrlKey?1:0)|(t.altKey?2:0)|(t.shiftKey?4:0)|(t.metaKey?8:0)};function f(t,e,n){var i=u(e);if(!o.isMac&&s){if(e.getModifierState&&(e.getModifierState("OS")||e.getModifierState("Win"))&&(i|=8),s.altGr){if(3==(3&i))return;s.altGr=0}if(18===n||17===n){var l="location"in e?e.location:e.keyLocation;if(17===n&&1===l)1==s[n]&&(a=e.timeStamp);else if(18===n&&3===i&&2===l){e.timeStamp-a<50&&(s.altGr=!0)}}}if((n in r.MODIFIER_KEYS&&(n=-1),!i&&13===n)&&(3===(l="location"in e?e.location:e.keyLocation)&&(t(e,i,-n),e.defaultPrevented)))return;if(o.isChromeOS&&8&i){if(t(e,i,n),e.defaultPrevented)return;i&=-9}return!!(i||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS)&&t(e,i,n)}function p(){s=Object.create(null)}if(e.getModifierString=function(t){return r.KEY_MODS[u(t)]},e.addCommandKeyListener=function(t,n,i){if(o.isOldGecko||o.isOpera&&!("KeyboardEvent"in window)){var r=null;d(t,"keydown",(function(t){r=t.keyCode}),i),d(t,"keypress",(function(t){return f(n,t,r)}),i)}else{var a=null;d(t,"keydown",(function(t){s[t.keyCode]=(s[t.keyCode]||0)+1;var e=f(n,t,t.keyCode);return a=t.defaultPrevented,e}),i),d(t,"keypress",(function(t){a&&(t.ctrlKey||t.altKey||t.shiftKey||t.metaKey)&&(e.stopEvent(t),a=null)}),i),d(t,"keyup",(function(t){s[t.keyCode]=null}),i),s||(p(),d(window,"focus",p))}},"object"==typeof window&&window.postMessage&&!o.isOldIE){var m=1;e.nextTick=function(t,n){n=n||window;var i="zero-timeout-message-"+m++,r=function(o){o.data==i&&(e.stopPropagation(o),h(n,"message",r),t())};d(n,"message",r),n.postMessage(i,"*")}}e.$idleBlocked=!1,e.onIdle=function(t,n){return setTimeout((function n(){e.$idleBlocked?setTimeout(n,100):t()}),n)},e.$idleBlockId=null,e.blockIdle=function(t){e.$idleBlockId&&clearTimeout(e.$idleBlockId),e.$idleBlocked=!0,e.$idleBlockId=setTimeout((function(){e.$idleBlocked=!1}),t||100)},e.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),e.nextFrame?e.nextFrame=e.nextFrame.bind(window):e.nextFrame=function(t){setTimeout(t,17)}})),ace.define("ace/range",["require","exports","module"],(function(t,e,n){"use strict";var i=function(t,e,n,i){this.start={row:t,column:e},this.end={row:n,column:i}};(function(){this.isEqual=function(t){return this.start.row===t.start.row&&this.end.row===t.end.row&&this.start.column===t.start.column&&this.end.column===t.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(t,e){return 0==this.compare(t,e)},this.compareRange=function(t){var e,n=t.end,i=t.start;return 1==(e=this.compare(n.row,n.column))?1==(e=this.compare(i.row,i.column))?2:0==e?1:0:-1==e?-2:-1==(e=this.compare(i.row,i.column))?-1:1==e?42:0},this.comparePoint=function(t){return this.compare(t.row,t.column)},this.containsRange=function(t){return 0==this.comparePoint(t.start)&&0==this.comparePoint(t.end)},this.intersects=function(t){var e=this.compareRange(t);return-1==e||0==e||1==e},this.isEnd=function(t,e){return this.end.row==t&&this.end.column==e},this.isStart=function(t,e){return this.start.row==t&&this.start.column==e},this.setStart=function(t,e){"object"==typeof t?(this.start.column=t.column,this.start.row=t.row):(this.start.row=t,this.start.column=e)},this.setEnd=function(t,e){"object"==typeof t?(this.end.column=t.column,this.end.row=t.row):(this.end.row=t,this.end.column=e)},this.inside=function(t,e){return 0==this.compare(t,e)&&(!this.isEnd(t,e)&&!this.isStart(t,e))},this.insideStart=function(t,e){return 0==this.compare(t,e)&&!this.isEnd(t,e)},this.insideEnd=function(t,e){return 0==this.compare(t,e)&&!this.isStart(t,e)},this.compare=function(t,e){return this.isMultiLine()||t!==this.start.row?tthis.end.row?1:this.start.row===t?e>=this.start.column?0:-1:this.end.row===t?e<=this.end.column?0:1:0:ethis.end.column?1:0},this.compareStart=function(t,e){return this.start.row==t&&this.start.column==e?-1:this.compare(t,e)},this.compareEnd=function(t,e){return this.end.row==t&&this.end.column==e?1:this.compare(t,e)},this.compareInside=function(t,e){return this.end.row==t&&this.end.column==e?1:this.start.row==t&&this.start.column==e?-1:this.compare(t,e)},this.clipRows=function(t,e){if(this.end.row>e)var n={row:e+1,column:0};else if(this.end.rowe)var r={row:e+1,column:0};else if(this.start.row0;)1&e&&(n+=t),(e>>=1)&&(t+=t);return n};var i=/^\s\s*/,r=/\s\s*$/;e.stringTrimLeft=function(t){return t.replace(i,"")},e.stringTrimRight=function(t){return t.replace(r,"")},e.copyObject=function(t){var e={};for(var n in t)e[n]=t[n];return e},e.copyArray=function(t){for(var e=[],n=0,i=t.length;nDate.now()-50)||(i=!1)},cancel:function(){i=Date.now()}}})),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],(function(t,e,n){"use strict";var i=t("../lib/event"),r=t("../lib/useragent"),o=t("../lib/dom"),s=t("../lib/lang"),a=t("../clipboard"),l=r.isChrome<18,c=r.isIE,d=r.isChrome>63,h=400,u=t("../lib/keys"),f=u.KEY_MODS,p=r.isIOS,m=p?/\s/:/\n/,g=r.isMobile;e.TextInput=function(t,e){var n=o.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",t.insertBefore(n,t.firstChild);var v=!1,y=!1,_=!1,b=!1,w="";g||(n.style.fontSize="1px");var T=!1,C=!1,E="",D=0,k=0,x=0;try{var S=document.activeElement===n}catch(t){}i.addListener(n,"blur",(function(t){C||(e.onBlur(t),S=!1)}),e),i.addListener(n,"focus",(function(t){if(!C){if(S=!0,r.isEdge)try{if(!document.hasFocus())return}catch(t){}e.onFocus(t),r.isEdge?setTimeout(I):I()}}),e),this.$focusScroll=!1,this.focus=function(){if(w||d||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var t=n.style.top;n.style.position="fixed",n.style.top="0px";try{var e=0!=n.getBoundingClientRect().top}catch(t){return}var i=[];if(e)for(var r=n.parentElement;r&&1==r.nodeType;)i.push(r),r.setAttribute("ace_nocontext",!0),r=!r.parentElement&&r.getRootNode?r.getRootNode().host:r.parentElement;n.focus({preventScroll:!0}),e&&i.forEach((function(t){t.removeAttribute("ace_nocontext")})),setTimeout((function(){n.style.position="","0px"==n.style.top&&(n.style.top=t)}),0)},this.blur=function(){n.blur()},this.isFocused=function(){return S},e.on("beforeEndOperation",(function(){var t=e.curOp,i=t&&t.command&&t.command.name;if("insertstring"!=i){var r=i&&(t.docChanged||t.selectionChanged);_&&r&&(E=n.value="",H()),I()}}));var I=p?function(t){if(S&&(!v||t)&&!b){t||(t="");var i="\n ab"+t+"cde fg\n";i!=n.value&&(n.value=E=i);var r=4+(t.length||(e.selection.isEmpty()?0:1));4==D&&k==r||n.setSelectionRange(4,r),D=4,k=r}}:function(){if(!_&&!b&&(S||O)){_=!0;var t=0,i=0,r="";if(e.session){var o=e.selection,s=o.getRange(),a=o.cursor.row;if(t=s.start.column,i=s.end.column,r=e.session.getLine(a),s.start.row!=a){var l=e.session.getLine(a-1);t=s.start.rowa+1?c.length:i,i+=r.length+1,r=r+"\n"+c}else g&&a>0&&(r="\n"+r,i+=1,t+=1);r.length>h&&(t0&&E[u]==t[u];)u++,a--;for(c=c.slice(u),u=1;l>0&&E.length-u>D-1&&E[E.length-u]==t[t.length-u];)u++,l--;d-=u-1,h-=u-1;var f=c.length-u+1;if(f<0&&(a=-f,f=0),c=c.slice(0,f),!(i||c||d||a||l||h))return"";b=!0;var p=!1;return r.isAndroid&&". "==c&&(c=" ",p=!0),c&&!a&&!l&&!d&&!h||T?e.onTextInput(c):e.onTextInput(c,{extendLeft:a,extendRight:l,restoreStart:d,restoreEnd:h}),b=!1,E=t,D=o,k=s,x=h,p?"\n":c},L=function(t){if(_)return F();if(t&&t.inputType){if("historyUndo"==t.inputType)return e.execCommand("undo");if("historyRedo"==t.inputType)return e.execCommand("redo")}var i=n.value,r=M(i,!0);(i.length>500||m.test(r)||g&&D<1&&D==k)&&I()},A=function(t,e,n){var i=t.clipboardData||window.clipboardData;if(i&&!l){var r=c||n?"Text":"text/plain";try{return e?!1!==i.setData(r,e):i.getData(r)}catch(t){if(!n)return A(t,e,!0)}}},P=function(t,r){var o=e.getCopyText();if(!o)return i.preventDefault(t);A(t,o)?(p&&(I(o),v=o,setTimeout((function(){v=!1}),10)),r?e.onCut():e.onCopy(),i.preventDefault(t)):(v=!0,n.value=o,n.select(),setTimeout((function(){v=!1,I(),r?e.onCut():e.onCopy()})))},N=function(t){P(t,!0)},K=function(t){P(t,!1)},$=function(t){var o=A(t);a.pasteCancelled()||("string"==typeof o?(o&&e.onPaste(o,t),r.isIE&&setTimeout(I),i.preventDefault(t)):(n.value="",y=!0))};i.addCommandKeyListener(n,e.onCommandKey.bind(e),e),i.addListener(n,"select",(function(t){_||(v?v=!1:!function(t){return 0===t.selectionStart&&t.selectionEnd>=E.length&&t.value===E&&E&&t.selectionEnd!==k}(n)?g&&n.selectionStart!=D&&I():(e.selectAll(),I()))}),e),i.addListener(n,"input",L,e),i.addListener(n,"cut",N,e),i.addListener(n,"copy",K,e),i.addListener(n,"paste",$,e),"oncut"in n&&"oncopy"in n&&"onpaste"in n||i.addListener(t,"keydown",(function(t){if((!r.isMac||t.metaKey)&&t.ctrlKey)switch(t.keyCode){case 67:K(t);break;case 86:$(t);break;case 88:N(t)}}),e);var F=function(){if(_&&e.onCompositionUpdate&&!e.$readOnly){if(T)return B();if(_.useTextareaForIME)e.onCompositionUpdate(n.value);else{var t=n.value;M(t),_.markerRange&&(_.context&&(_.markerRange.start.column=_.selectionStart=_.context.compositionStartOffset),_.markerRange.end.column=_.markerRange.start.column+k-_.selectionStart+x)}}},H=function(t){e.onCompositionEnd&&!e.$readOnly&&(_=!1,e.onCompositionEnd(),e.off("mousedown",B),t&&L())};function B(){C=!0,n.blur(),n.focus(),C=!1}var Y,j=s.delayedCall(F,50).schedule.bind(null,null);function W(){clearTimeout(Y),Y=setTimeout((function(){w&&(n.style.cssText=w,w=""),e.renderer.$isMousePressed=!1,e.renderer.$keepTextAreaAtCursor&&e.renderer.$moveTextAreaToCursor()}),0)}i.addListener(n,"compositionstart",(function(t){if(!_&&e.onCompositionStart&&!e.$readOnly&&(_={},!T)){t.data&&(_.useTextareaForIME=!1),setTimeout(F,0),e._signal("compositionStart"),e.on("mousedown",B);var i=e.getSelectionRange();i.end.row=i.start.row,i.end.column=i.start.column,_.markerRange=i,_.selectionStart=D,e.onCompositionStart(_),_.useTextareaForIME?(E=n.value="",D=0,k=0):(n.msGetInputContext&&(_.context=n.msGetInputContext()),n.getInputContext&&(_.context=n.getInputContext()))}}),e),i.addListener(n,"compositionupdate",F,e),i.addListener(n,"keyup",(function(t){27==t.keyCode&&n.value.lengthk&&"\n"==E[o]?s=u.end:ik&&E.slice(0,o).split("\n").length>2?s=u.down:o>k&&" "==E[o-1]?(s=u.right,a=f.option):(o>k||o==k&&k!=D&&i==o)&&(s=u.right),i!==o&&(a|=f.shift),s){if(!e.onCommandKey({},a,s)&&e.commands){s=u.keyCodeToString(s);var l=e.commands.findKeyCommand(a,s);l&&e.execCommand(l)}D=i,k=o,I("")}}};document.addEventListener("selectionchange",o),e.on("destroy",(function(){document.removeEventListener("selectionchange",o)}))}(0,e,n)},e.$setUserAgentForTests=function(t,e){g=t,p=e}})),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],(function(t,e,n){"use strict";var i=t("../lib/useragent");function r(t){t.$clickSelection=null;var e=t.editor;e.setDefaultHandler("mousedown",this.onMouseDown.bind(t)),e.setDefaultHandler("dblclick",this.onDoubleClick.bind(t)),e.setDefaultHandler("tripleclick",this.onTripleClick.bind(t)),e.setDefaultHandler("quadclick",this.onQuadClick.bind(t)),e.setDefaultHandler("mousewheel",this.onMouseWheel.bind(t));["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach((function(e){t[e]=this[e]}),this),t.selectByLines=this.extendSelectionBy.bind(t,"getLineRange"),t.selectByWords=this.extendSelectionBy.bind(t,"getWordRange")}function o(t,e){if(t.start.row==t.end.row)var n=2*e.column-t.start.column-t.end.column;else if(t.start.row!=t.end.row-1||t.start.column||t.end.column)n=2*e.row-t.start.row-t.end.row;else var n=e.column-4;return n<0?{cursor:t.start,anchor:t.end}:{cursor:t.end,anchor:t.start}}(function(){this.onMouseDown=function(t){var e=t.inSelection(),n=t.getDocumentPosition();this.mousedownEvent=t;var r=this.editor,o=t.getButton();return 0!==o?((r.getSelectionRange().isEmpty()||1==o)&&r.selection.moveToPosition(n),void(2==o&&(r.textInput.onContextMenu(t.domEvent),i.isMozilla||t.preventDefault()))):(this.mousedownEvent.time=Date.now(),!e||r.isFocused()||(r.focus(),!this.$focusTimeout||this.$clickSelection||r.inMultiSelectMode)?(this.captureMouse(t),this.startSelect(n,t.domEvent._clicks>1),t.preventDefault()):(this.setState("focusWait"),void this.captureMouse(t)))},this.startSelect=function(t,e){t=t||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(t):e||n.selection.moveToPosition(t),e||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var t,e=this.editor,n=e.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var i=this.$clickSelection.comparePoint(n);if(-1==i)t=this.$clickSelection.end;else if(1==i)t=this.$clickSelection.start;else{var r=o(this.$clickSelection,n);n=r.cursor,t=r.anchor}e.selection.setSelectionAnchor(t.row,t.column)}e.selection.selectToPosition(n),e.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(t){var e,n=this.editor,i=n.renderer.screenToTextCoordinates(this.x,this.y),r=n.selection[t](i.row,i.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(r.start),a=this.$clickSelection.comparePoint(r.end);if(-1==s&&a<=0)e=this.$clickSelection.end,r.end.row==i.row&&r.end.column==i.column||(i=r.start);else if(1==a&&s>=0)e=this.$clickSelection.start,r.start.row==i.row&&r.start.column==i.column||(i=r.end);else if(-1==s&&1==a)i=r.end,e=r.start;else{var l=o(this.$clickSelection,i);i=l.cursor,e=l.anchor}n.selection.setSelectionAnchor(e.row,e.column)}n.selection.selectToPosition(i),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var t,e,n,i,r=(t=this.mousedownEvent.x,e=this.mousedownEvent.y,n=this.x,i=this.y,Math.sqrt(Math.pow(n-t,2)+Math.pow(i-e,2))),o=Date.now();(r>0||o-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(t){var e=t.getDocumentPosition(),n=this.editor,i=n.session.getBracketRange(e);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=n.selection.getWordRange(e.row,e.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},this.onTripleClick=function(t){var e=t.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var i=n.getSelectionRange();i.isMultiLine()&&i.contains(e.row,e.column)?(this.$clickSelection=n.selection.getLineRange(i.start.row),this.$clickSelection.end=n.selection.getLineRange(i.end.row).end):this.$clickSelection=n.selection.getLineRange(e.row),this.select()},this.onQuadClick=function(t){var e=this.editor;e.selectAll(),this.$clickSelection=e.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(t){if(!t.getAccelKey()){t.getShiftKey()&&t.wheelY&&!t.wheelX&&(t.wheelX=t.wheelY,t.wheelY=0);var e=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,i=t.domEvent.timeStamp,r=i-n.t,o=r?t.wheelX/r:n.vx,s=r?t.wheelY/r:n.vy;r<550&&(o=(o+n.vx)/2,s=(s+n.vy)/2);var a=Math.abs(o/s),l=!1;if(a>=1&&e.renderer.isScrollableBy(t.wheelX*t.speed,0)&&(l=!0),a<=1&&e.renderer.isScrollableBy(0,t.wheelY*t.speed)&&(l=!0),l)n.allowed=i;else if(i-n.allowed<550){Math.abs(o)<=1.5*Math.abs(n.vx)&&Math.abs(s)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=i):n.allowed=0}return n.t=i,n.vx=o,n.vy=s,l?(e.renderer.scrollBy(t.wheelX*t.speed,t.wheelY*t.speed),t.stop()):void 0}}}).call(r.prototype),e.DefaultHandlers=r})),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],(function(t,e,n){"use strict";t("./lib/oop");var i=t("./lib/dom");function r(t){this.isOpen=!1,this.$element=null,this.$parentNode=t}(function(){this.$init=function(){return this.$element=i.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(t){this.getElement().textContent=t},this.setHtml=function(t){this.getElement().innerHTML=t},this.setPosition=function(t,e){this.getElement().style.left=t+"px",this.getElement().style.top=e+"px"},this.setClassName=function(t){i.addCssClass(this.getElement(),t)},this.show=function(t,e,n){null!=t&&this.setText(t),null!=e&&null!=n&&this.setPosition(e,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(r.prototype),e.Tooltip=r})),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],(function(t,e,n){"use strict";var i=t("../lib/dom"),r=t("../lib/oop"),o=t("../lib/event"),s=t("../tooltip").Tooltip;function a(t){s.call(this,t)}r.inherits(a,s),function(){this.setPosition=function(t,e){var n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight,r=this.getWidth(),o=this.getHeight();(t+=15)+r>n&&(t-=t+r-n),(e+=15)+o>i&&(e-=20+o),s.prototype.setPosition.call(this,t,e)}}.call(a.prototype),e.GutterHandler=function(t){var e,n,r,s=t.editor,l=s.renderer.$gutterLayer,c=new a(s.container);function d(){e&&(e=clearTimeout(e)),r&&(c.hide(),r=null,s._signal("hideGutterTooltip",c),s.off("mousewheel",d))}function h(t){c.setPosition(t.x,t.y)}t.editor.setDefaultHandler("guttermousedown",(function(e){if(s.isFocused()&&0==e.getButton()&&"foldWidgets"!=l.getRegion(e)){var n=e.getDocumentPosition().row,i=s.session.selection;if(e.getShiftKey())i.selectTo(n,0);else{if(2==e.domEvent.detail)return s.selectAll(),e.preventDefault();t.$clickSelection=s.selection.getLineRange(n)}return t.setState("selectByLines"),t.captureMouse(e),e.preventDefault()}})),t.editor.setDefaultHandler("guttermousemove",(function(o){var a=o.domEvent.target||o.domEvent.srcElement;if(i.hasCssClass(a,"ace_fold-widget"))return d();r&&t.$tooltipFollowsMouse&&h(o),n=o,e||(e=setTimeout((function(){e=null,n&&!t.isMousePressed?function(){var e=n.getDocumentPosition().row,i=l.$annotations[e];if(!i)return d();if(e==s.session.getLength()){var o=s.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(o>s.session.documentToScreenRow(a.row,a.column))return d()}if(r!=i)if(r=i.text.join("
"),c.setHtml(r),c.show(),s._signal("showGutterTooltip",c),s.on("mousewheel",d),t.$tooltipFollowsMouse)h(n);else{var u=n.domEvent.target.getBoundingClientRect(),f=c.getElement().style;f.left=u.right+"px",f.top=u.bottom+"px"}}():d()}),50))})),o.addListener(s.renderer.$gutter,"mouseout",(function(t){n=null,r&&!e&&(e=setTimeout((function(){e=null,d()}),50))}),s),s.on("changeSession",d)}})),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(t,e,n){"use strict";var i=t("../lib/event"),r=t("../lib/useragent"),o=e.MouseEvent=function(t,e){this.domEvent=t,this.editor=e,this.x=this.clientX=t.clientX,this.y=this.clientY=t.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){i.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){i.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var t=this.editor.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var e=this.getDocumentPosition();this.$inSelection=t.contains(e.row,e.column)}return this.$inSelection},this.getButton=function(){return i.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=r.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(o.prototype)})),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],(function(t,e,n){"use strict";var i=t("../lib/dom"),r=t("../lib/event"),o=t("../lib/useragent");function s(t){var e=t.editor,n=i.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",o.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach((function(e){t[e]=this[e]}),this),e.on("mousedown",this.onMouseDown.bind(t));var s,l,c,d,h,u,f,p,m,g,v,y=e.container,_=0;function b(){var t=u;(function(t,n){var i=Date.now(),r=!n||t.row!=n.row,o=!n||t.column!=n.column;!g||r||o?(e.moveCursorToPosition(t),g=i,v={x:l,y:c}):a(v.x,v.y,l,c)>5?g=null:i-g>=200&&(e.renderer.scrollCursorIntoView(),g=null)})(u=e.renderer.screenToTextCoordinates(l,c),t),function(t,n){var i=Date.now(),r=e.renderer.layerConfig.lineHeight,o=e.renderer.layerConfig.characterWidth,s=e.renderer.scroller.getBoundingClientRect(),a={x:{left:l-s.left,right:s.right-l},y:{top:c-s.top,bottom:s.bottom-c}},d=Math.min(a.x.left,a.x.right),h=Math.min(a.y.top,a.y.bottom),u={row:t.row,column:t.column};d/o<=2&&(u.column+=a.x.left=200&&e.renderer.scrollCursorIntoView(u):m=i:m=null}(u,t)}function w(){h=e.selection.toOrientedRange(),s=e.session.addMarker(h,"ace_selection",e.getSelectionStyle()),e.clearSelection(),e.isFocused()&&e.renderer.$cursorLayer.setBlinking(!1),clearInterval(d),b(),d=setInterval(b,20),_=0,r.addListener(document,"mousemove",E)}function T(){clearInterval(d),e.session.removeMarker(s),s=null,e.selection.fromOrientedRange(h),e.isFocused()&&!p&&e.$resetCursorStyle(),h=null,u=null,_=0,m=null,g=null,r.removeListener(document,"mousemove",E)}this.onDragStart=function(t){if(this.cancelDrag||!y.draggable){var i=this;return setTimeout((function(){i.startSelect(),i.captureMouse(t)}),0),t.preventDefault()}h=e.getSelectionRange();var r=t.dataTransfer;r.effectAllowed=e.getReadOnly()?"copy":"copyMove",o.isOpera&&(e.container.appendChild(n),n.scrollTop=0),r.setDragImage&&r.setDragImage(n,0,0),o.isOpera&&e.container.removeChild(n),r.clearData(),r.setData("Text",e.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(t){if(y.draggable=!1,p=!1,this.setState(null),!e.getReadOnly()){var n=t.dataTransfer.dropEffect;f||"move"!=n||e.session.remove(e.getSelectionRange()),e.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(t){if(!e.getReadOnly()&&D(t.dataTransfer))return l=t.clientX,c=t.clientY,s||w(),_++,t.dataTransfer.dropEffect=f=k(t),r.preventDefault(t)},this.onDragOver=function(t){if(!e.getReadOnly()&&D(t.dataTransfer))return l=t.clientX,c=t.clientY,s||(w(),_++),null!==C&&(C=null),t.dataTransfer.dropEffect=f=k(t),r.preventDefault(t)},this.onDragLeave=function(t){if(--_<=0&&s)return T(),f=null,r.preventDefault(t)},this.onDrop=function(t){if(u){var n=t.dataTransfer;if(p)switch(f){case"move":h=h.contains(u.row,u.column)?{start:u,end:u}:e.moveText(h,u);break;case"copy":h=e.moveText(h,u,!0)}else{var i=n.getData("Text");h={start:u,end:e.session.insert(u,i)},e.focus(),f=null}return T(),r.preventDefault(t)}},r.addListener(y,"dragstart",this.onDragStart.bind(t),e),r.addListener(y,"dragend",this.onDragEnd.bind(t),e),r.addListener(y,"dragenter",this.onDragEnter.bind(t),e),r.addListener(y,"dragover",this.onDragOver.bind(t),e),r.addListener(y,"dragleave",this.onDragLeave.bind(t),e),r.addListener(y,"drop",this.onDrop.bind(t),e);var C=null;function E(){null==C&&(C=setTimeout((function(){null!=C&&s&&T()}),20))}function D(t){var e=t.types;return!e||Array.prototype.some.call(e,(function(t){return"text/plain"==t||"Text"==t}))}function k(t){var e=["copy","copymove","all","uninitialized"],n=o.isMac?t.altKey:t.ctrlKey,i="uninitialized";try{i=t.dataTransfer.effectAllowed.toLowerCase()}catch(t){}var r="none";return n&&e.indexOf(i)>=0?r="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(i)>=0?r="move":e.indexOf(i)>=0&&(r="copy"),r}}function a(t,e,n,i){return Math.sqrt(Math.pow(n-t,2)+Math.pow(i-e,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(t){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var t=this.editor;t.container.draggable=!0,t.renderer.$cursorLayer.setBlinking(!1),t.setStyle("ace_dragging");var e=o.isWin?"default":"move";t.renderer.setCursorStyle(e),this.setState("dragReady")},this.onMouseDrag=function(t){var e=this.editor.container;o.isIE&&"dragReady"==this.state&&(a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&e.dragDrop());"dragWait"===this.state&&(a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition())))},this.onMouseDown=function(t){if(this.$dragEnabled){this.mousedownEvent=t;var e=this.editor,n=t.inSelection(),i=t.getButton();if(1===(t.domEvent.detail||1)&&0===i&&n){if(t.editor.inMultiSelectMode&&(t.getAccelKey()||t.getShiftKey()))return;this.mousedownEvent.time=Date.now();var r=t.domEvent.target||t.domEvent.srcElement;if("unselectable"in r&&(r.unselectable="on"),e.getDragDelay()){if(o.isWebKit)this.cancelDrag=!0,e.container.draggable=!0;this.setState("dragWait")}else this.startDrag();this.captureMouse(t,this.onMouseDrag.bind(this)),t.defaultPrevented=!0}}}}).call(s.prototype),e.DragdropHandler=s})),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],(function(t,e,n){"use strict";var i=t("./mouse_event").MouseEvent,r=t("../lib/event"),o=t("../lib/dom");e.addTouchListeners=function(t,e){var n,s,a,l,c,d,h,u,f,p="scroll",m=0,g=0,v=0,y=0;function _(){var t=window.navigator&&window.navigator.clipboard,n=!1,i=function(i){var r,s,a=i.target.getAttribute("action");if("more"==a||!n)return n=!n,r=e.getCopyText(),s=e.session.getUndoManager().hasUndo(),void f.replaceChild(o.buildDom(n?["span",!r&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],r&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],r&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],t&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],s&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),f.firstChild);"paste"==a?t.readText().then((function(t){e.execCommand(a,t)})):a&&("cut"!=a&&"copy"!=a||(t?t.writeText(e.getCopyText()):document.execCommand("copy")),e.execCommand(a)),f.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&e.focus()};f=o.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(t){p="menu",t.stopPropagation(),t.preventDefault(),e.textInput.focus()},ontouchend:function(t){t.stopPropagation(),t.preventDefault(),i(t)},onclick:i},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],e.container)}function b(){f||_();var t=e.selection.cursor,n=e.renderer.textToScreenCoordinates(t.row,t.column),i=e.renderer.textToScreenCoordinates(0,0).pageX,r=e.renderer.scrollLeft,o=e.container.getBoundingClientRect();f.style.top=n.pageY-o.top-3+"px",n.pageX-o.left1)return clearTimeout(c),c=null,a=-1,void(p="zoom");u=e.$mouseHandler.isMousePressed=!0;var o=e.renderer.layerConfig.lineHeight,d=e.renderer.layerConfig.lineHeight,f=t.timeStamp;l=f;var _=r[0],b=_.clientX,w=_.clientY;Math.abs(n-b)+Math.abs(s-w)>o&&(a=-1),n=t.clientX=b,s=t.clientY=w,v=y=0;var C=new i(t,e);if(h=C.getDocumentPosition(),f-a<500&&1==r.length&&!m)g++,t.preventDefault(),t.button=0,function(){c=null,clearTimeout(c),e.selection.moveToPosition(h);var t=g>=2?e.selection.getLineRange(h.row):e.session.getBracketRange(h);t&&!t.isEmpty()?e.selection.setRange(t):e.selection.selectWord(),p="wait"}();else{g=0;var E=e.selection.cursor,D=e.selection.isEmpty()?E:e.selection.anchor,k=e.renderer.$cursorLayer.getPixelPosition(E,!0),x=e.renderer.$cursorLayer.getPixelPosition(D,!0),S=e.renderer.scroller.getBoundingClientRect(),I=e.renderer.layerConfig.offset,R=e.renderer.scrollLeft,O=function(t,e){return(t/=d)*t+(e=e/o-.75)*e};if(t.clientXL?"cursor":"anchor"),p=L<3.5?"anchor":M<3.5?"cursor":"scroll",c=setTimeout(T,450)}a=f}),e),r.addListener(t,"touchend",(function(t){u=e.$mouseHandler.isMousePressed=!1,d&&clearInterval(d),"zoom"==p?(p="",m=0):c?(e.selection.moveToPosition(h),m=0,b()):"scroll"==p?(m+=60,d=setInterval((function(){m--<=0&&(clearInterval(d),d=null),Math.abs(v)<.01&&(v=0),Math.abs(y)<.01&&(y=0),m<20&&(v*=.9),m<20&&(y*=.9);var t=e.session.getScrollTop();e.renderer.scrollBy(10*v,10*y),t==e.session.getScrollTop()&&(m=0)}),10),w()):b(),clearTimeout(c),c=null}),e),r.addListener(t,"touchmove",(function(t){c&&(clearTimeout(c),c=null);var r=t.touches;if(!(r.length>1||"zoom"==p)){var o=r[0],a=n-o.clientX,d=s-o.clientY;if("wait"==p){if(!(a*a+d*d>4))return t.preventDefault();p="cursor"}n=o.clientX,s=o.clientY,t.clientX=o.clientX,t.clientY=o.clientY;var h=t.timeStamp,u=h-l;if(l=h,"scroll"==p){var f=new i(t,e);f.speed=1,f.wheelX=a,f.wheelY=d,10*Math.abs(a)1&&(r=n[n.length-2]);var s=l[e+"Path"];return null==s?s=l.basePath:"/"==i&&(e=i=""),s&&"/"!=s.slice(-1)&&(s+="/"),s+e+i+r+this.get("suffix")},e.setModuleUrl=function(t,e){return l.$moduleUrls[t]=e},e.$loading={},e.loadModule=function(n,i){var r,s;Array.isArray(n)&&(s=n[0],n=n[1]);try{r=t(n)}catch(t){}if(r&&!e.$loading[n])return i&&i(r);if(e.$loading[n]||(e.$loading[n]=[]),e.$loading[n].push(i),!(e.$loading[n].length>1)){var a=function(){t([n],(function(t){e._emit("load.module",{name:n,module:t});var i=e.$loading[n];e.$loading[n]=null,i.forEach((function(e){e&&e(t)}))}))};if(!e.get("packaged"))return a();o.loadScript(e.moduleUrl(n,s),a),c()}};var c=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),c=function(){})};function d(r){if(a&&a.document){l.packaged=r||t.packaged||i.packaged||a.define&&n.amdD.packaged;for(var o,s={},c="",d=document.currentScript||document._currentScript,h=(d&&d.ownerDocument||document).getElementsByTagName("script"),u=0;u=t){for(o=h+1;o=t;)o++;for(a=h,l=o-1;a=e.length||2!=(l=n[r-1])&&3!=l||2!=(c=e[r+1])&&3!=c?4:(o&&(c=3),c==l?c:4);case 10:return 2==(l=r>0?n[r-1]:5)&&r+10&&2==n[r-1])return 2;if(o)return 4;for(f=r+1,u=e.length;f=1425&&m<=2303||64286==m;if(l=e[f],g&&(1==l||7==l))return 1}return r<1||5==(l=e[r-1])?4:n[r-1];case 5:return o=!1,s=!0,i;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:o=!1;case h:return 4}}function g(t){var e=t.charCodeAt(0),n=e>>8;return 0==n?e>191?0:u[e]:5==n?/[\u0591-\u05f4]/.test(t)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(t)?12:/[\u0660-\u0669\u066b-\u066c]/.test(t)?3:1642==e?d:/[\u06f0-\u06f9]/.test(t)?2:7:32==n&&e<=8287?f[255&e]:254==n&&e>=65136?7:4}e.L=0,e.R=1,e.EN=2,e.ON_R=3,e.AN=4,e.R_H=5,e.B=6,e.RLE=7,e.DOT="·",e.doBidiReorder=function(t,n,d){if(t.length<2)return{};var u=t.split(""),f=new Array(u.length),v=new Array(u.length),y=[];i=d?1:0,function(t,e,n,d){var h=i?c:l,u=null,f=null,p=null,v=0,y=null,_=-1,b=null,w=null,T=[];if(!d)for(b=0,d=[];b0)if(16==y){for(b=_;b-1){for(b=_;b=0&&8==d[C];C--)e[C]=i}}(u,y,u.length,n);for(var _=0;_7&&n[_]<13||4===n[_]||n[_]===h)?y[_]=e.ON_R:_>0&&"ل"===u[_-1]&&/\u0622|\u0623|\u0625|\u0627/.test(u[_])&&(y[_-1]=y[_]=e.R_H,_++);u[u.length-1]===e.DOT&&(y[u.length-1]=e.B),"‫"===u[0]&&(y[0]=e.RLE);for(_=0;_=0&&(t=this.session.$docRowCache[n])}return t},this.getSplitIndex=function(){var t=0,e=this.session.$screenRowCache;if(e.length)for(var n,i=this.session.$getRowCacheIndex(e,this.currentRow);this.currentRow-t>0&&(n=this.session.$getRowCacheIndex(e,this.currentRow-t-1))===i;)i=n,t++;else t=this.currentRow;return t},this.updateRowLine=function(t,e){void 0===t&&(t=this.getDocumentRow());var n=t===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(t),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var o=this.session.$wrapData[t];o&&(void 0===e&&(e=this.getSplitIndex()),e>0&&o.length?(this.wrapIndent=o.indent,this.wrapOffset=this.wrapIndent*this.charWidths[i.L],this.line=ee?this.session.getOverwrite()?t:t-1:e,r=i.getVisualFromLogicalIdx(n,this.bidiMap),o=this.bidiMap.bidiLevels,s=0;!this.session.getOverwrite()&&t<=e&&o[r]%2!=0&&r++;for(var a=0;ae&&o[r]%2==0&&(s+=this.charWidths[o[r]]),this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(s+=this.rtlLineOffset),s},this.getSelections=function(t,e){var n,i=this.bidiMap,r=i.bidiLevels,o=[],s=0,a=Math.min(t,e)-this.wrapIndent,l=Math.max(t,e)-this.wrapIndent,c=!1,d=!1,h=0;this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var u,f=0;f=a&&un+o/2;){if(n+=o,i===r.length-1){o=0;break}o=this.charWidths[r[++i]]}return i>0&&r[i-1]%2!=0&&r[i]%2==0?(t0&&r[i-1]%2==0&&r[i]%2!=0?e=1+(t>n?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===r.length-1&&0===o&&r[i-1]%2==0||!this.isRtlDir&&0===i&&r[i]%2!=0?e=1+this.bidiMap.logicalFromVisual[i]:(i>0&&r[i-1]%2!=0&&0!==o&&i--,e=this.bidiMap.logicalFromVisual[i]),0===e&&this.isRtlDir&&e++,e+this.wrapIndent}}).call(s.prototype),e.BidiHandler=s})),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],(function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./lib/lang"),o=t("./lib/event_emitter").EventEmitter,s=t("./range").Range,a=function(t){this.session=t,this.doc=t.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var e=this;this.cursor.on("change",(function(t){e.$cursorChanged=!0,e.$silent||e._emit("changeCursor"),e.$isEmpty||e.$silent||e._emit("changeSelection"),e.$keepDesiredColumnOnChange||t.old.column==t.value.column||(e.$desiredColumn=null)})),this.anchor.on("change",(function(){e.$anchorChanged=!0,e.$isEmpty||e.$silent||e._emit("changeSelection")}))};(function(){i.implement(this,o),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(t,e){this.$isEmpty=!1,this.anchor.setPosition(t,e)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var t=this.anchor,e=this.lead;return t.row>e.row||t.row==e.row&&t.column>e.column},this.getRange=function(){var t=this.anchor,e=this.lead;return this.$isEmpty?s.fromPoints(e,e):this.isBackwards()?s.fromPoints(e,t):s.fromPoints(t,e)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(t,e){var n=e?t.end:t.start,i=e?t.start:t.end;this.$setSelection(n.row,n.column,i.row,i.column)},this.$setSelection=function(t,e,n,i){if(!this.$silent){var r=this.$isEmpty,o=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(t,e),this.cursor.setPosition(n,i),this.$isEmpty=!s.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||o)&&this._emit("changeSelection")}},this.$moveSelection=function(t){var e=this.lead;this.$isEmpty&&this.setSelectionAnchor(e.row,e.column),t.call(this)},this.selectTo=function(t,e){this.$moveSelection((function(){this.moveCursorTo(t,e)}))},this.selectToPosition=function(t){this.$moveSelection((function(){this.moveCursorToPosition(t)}))},this.moveTo=function(t,e){this.clearSelection(),this.moveCursorTo(t,e)},this.moveToPosition=function(t){this.clearSelection(),this.moveCursorToPosition(t)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(t,e){if(void 0===e){var n=t||this.lead;t=n.row,e=n.column}return this.session.getWordRange(t,e)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var t=this.getCursor(),e=this.session.getAWordRange(t.row,t.column);this.setSelectionRange(e)},this.getLineRange=function(t,e){var n,i="number"==typeof t?t:this.lead.row,r=this.session.getFoldLine(i);return r?(i=r.start.row,n=r.end.row):n=i,!0===e?new s(i,0,n,this.session.getLine(n).length):new s(i,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(t,e,n){var i=t.column,r=t.column+e;return n<0&&(i=t.column-e,r=t.column),this.session.isTabStop(t)&&this.doc.getLine(t.row).slice(i,r).split(" ").length-1==e},this.moveCursorLeft=function(){var t,e=this.lead.getPosition();if(t=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(0===e.column)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(e,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var t,e=this.lead.getPosition();if(t=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(t.end.row,t.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(e.column=i)}}this.moveCursorTo(e.row,e.column)},this.moveCursorFileEnd=function(){var t=this.doc.getLength()-1,e=this.doc.getLine(t).length;this.moveCursorTo(t,e)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var t=this.lead.row,e=this.lead.column,n=this.doc.getLine(t),i=n.substring(e);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var r=this.session.getFoldAt(t,e,1);if(r)this.moveCursorTo(r.end.row,r.end.column);else{if(this.session.nonTokenRe.exec(i)&&(e+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=n.substring(e)),e>=n.length)return this.moveCursorTo(t,n.length),this.moveCursorRight(),void(t0&&this.moveCursorWordLeft());this.session.tokenRe.exec(o)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,n)}},this.$shortWordEndIndex=function(t){var e,n=0,i=/\s/,r=this.session.tokenRe;if(r.lastIndex=0,this.session.tokenRe.exec(t))n=this.session.tokenRe.lastIndex;else{for(;(e=t[n])&&i.test(e);)n++;if(n<1)for(r.lastIndex=0;(e=t[n])&&!r.test(e);)if(r.lastIndex=0,n++,i.test(e)){if(n>2){n--;break}for(;(e=t[n])&&i.test(e);)n++;if(n>2)break}}return r.lastIndex=0,n},this.moveCursorShortWordRight=function(){var t=this.lead.row,e=this.lead.column,n=this.doc.getLine(t),i=n.substring(e),r=this.session.getFoldAt(t,e,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(e==n.length){var o=this.doc.getLength();do{t++,i=this.doc.getLine(t)}while(t0&&/^\s*$/.test(i));n=i.length,/\s+$/.test(i)||(i="")}var o=r.stringReverse(i),s=this.$shortWordEndIndex(o);return this.moveCursorTo(e,n-s)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(t,e){var n,i=this.session.documentToScreenPosition(this.lead.row,this.lead.column);if(0===e&&(0!==t&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column),0!=t&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var r=this.session.lineWidgets[this.lead.row];t<0?t-=r.rowsAbove||0:t>0&&(t+=r.rowCount-(r.rowsAbove||0))}var o=this.session.screenToDocumentPosition(i.row+t,i.column,n);0!==t&&0===e&&o.row===this.lead.row&&(o.column,this.lead.column),this.moveCursorTo(o.row,o.column+e,0===e)},this.moveCursorToPosition=function(t){this.moveCursorTo(t.row,t.column)},this.moveCursorTo=function(t,e,n){var i=this.session.getFoldAt(t,e,1);i&&(t=i.start.row,e=i.start.column),this.$keepDesiredColumnOnChange=!0;var r=this.session.getLine(t);/[\uDC00-\uDFFF]/.test(r.charAt(e))&&r.charAt(e-1)&&(this.lead.row==t&&this.lead.column==e+1?e-=1:e+=1),this.lead.setPosition(t,e),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(t,e,n){var i=this.session.screenToDocumentPosition(t,e);this.moveCursorTo(i.row,i.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(t){this.setSelectionRange(t,t.cursor==t.start),this.$desiredColumn=t.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(t){var e=this.getRange();return t?(t.start.column=e.start.column,t.start.row=e.start.row,t.end.column=e.end.column,t.end.row=e.end.row):t=e,t.cursor=this.isBackwards()?t.start:t.end,t.desiredColumn=this.$desiredColumn,t},this.getRangeOfMovements=function(t){var e=this.getCursor();try{t(this);var n=this.getCursor();return s.fromPoints(e,n)}catch(t){return s.fromPoints(e,e)}finally{this.moveCursorToPosition(e)}},this.toJSON=function(){if(this.rangeCount)var t=this.ranges.map((function(t){var e=t.clone();return e.isBackwards=t.cursor==t.start,e}));else(t=this.getRange()).isBackwards=this.isBackwards();return t},this.fromJSON=function(t){if(null==t.start){if(this.rangeList&&t.length>1){this.toSingleRange(t[0]);for(var e=t.length;e--;){var n=s.fromPoints(t[e].start,t[e].end);t[e].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}t=t[0]}this.rangeList&&this.toSingleRange(t),this.setSelectionRange(t,t.isBackwards)},this.isEqual=function(t){if((t.length||this.rangeCount)&&t.length!=this.rangeCount)return!1;if(!t.length||!this.ranges)return this.getRange().isEqual(t);for(var e=this.ranges.length;e--;)if(!this.ranges[e].isEqual(t[e]))return!1;return!0}}).call(a.prototype),e.Selection=a})),ace.define("ace/tokenizer",["require","exports","module","ace/config"],(function(t,e,n){"use strict";var i=t("./config"),r=2e3,o=function(t){for(var e in this.states=t,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[e],i=[],r=0,o=this.matchMappings[e]={defaultToken:"text"},s="g",a=[],l=0;l1?this.$applyToken:c.token),h>1&&(/\\\d/.test(c.regex)?d=c.regex.replace(/\\([0-9]+)/g,(function(t,e){return"\\"+(parseInt(e,10)+r+1)})):(h=1,d=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeof c.token||a.push(c)),o[r]=l,r+=h,i.push(d),c.onMatch||(c.onMatch=null)}}i.length||(o[0]=0,i.push("$")),a.forEach((function(t){t.splitRegex=this.createSplitterRegexp(t.regex,s)}),this),this.regExps[e]=new RegExp("("+i.join(")|(")+")|($)",s)}};(function(){this.$setMaxTokenCount=function(t){r=0|t},this.$applyToken=function(t){var e=this.splitRegex.exec(t).slice(1),n=this.token.apply(this,e);if("string"==typeof n)return[{type:n,value:t}];for(var i=[],r=0,o=n.length;rd){var v=t.substring(d,g-m.length);u.type==f?u.value+=v:(u.type&&c.push(u),u={type:f,value:v})}for(var y=0;yr){for(h>2*t.length&&this.reportError("infinite loop with in ace tokenizer",{startState:e,line:t});d1&&n[0]!==i&&n.unshift("#tmp",i),{tokens:c,state:n.length?n:i}},this.reportError=i.reportError}).call(o.prototype),e.Tokenizer=o})),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],(function(t,e,n){"use strict";var i=t("../lib/lang"),r=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(t,e){if(e)for(var n in t){for(var i=t[n],r=0;r=this.$rowTokens.length;){if(this.$row+=1,t||(t=this.$session.getLength()),this.$row>=t)return this.$row=t-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var t=this.$rowTokens,e=this.$tokenIndex,n=t[e].start;if(void 0!==n)return n;for(n=0;e>0;)n+=t[e-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var t=this.$rowTokens[this.$tokenIndex],e=this.getCurrentTokenColumn();return new i(this.$row,e,this.$row,e+t.value.length)}}).call(r.prototype),e.TokenIterator=r})),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],(function(t,e,n){"use strict";var i,r=t("../../lib/oop"),o=t("../behaviour").Behaviour,s=t("../../token_iterator").TokenIterator,a=t("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],c=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],d={},h={'"':'"',"'":"'"},u=function(t){var e=-1;if(t.multiSelect&&(e=t.selection.index,d.rangeCount!=t.multiSelect.rangeCount&&(d={rangeCount:t.multiSelect.rangeCount})),d[e])return i=d[e];i=d[e]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},f=function(t,e,n,i){var r=t.end.row-t.start.row;return{text:n+e+i,selection:[0,t.start.column+1,r,t.end.column+(r?0:1)]}},p=function(t){this.add("braces","insertion",(function(e,n,r,o,s){var l=r.getCursorPosition(),c=o.doc.getLine(l.row);if("{"==s){u(r);var d=r.getSelectionRange(),h=o.doc.getTextRange(d);if(""!==h&&"{"!==h&&r.getWrapBehavioursEnabled())return f(d,h,"{","}");if(p.isSaneInsertion(r,o))return/[\]\}\)]/.test(c[l.column])||r.inMultiSelectMode||t&&t.braces?(p.recordAutoInsert(r,o,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(r,o,"{"),{text:"{",selection:[1,1]})}else if("}"==s){if(u(r),"}"==c.substring(l.column,l.column+1))if(null!==o.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&p.isAutoInsertedClosing(l,c,s))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==s||"\r\n"==s){u(r);var m="";if(p.isMaybeInsertedClosing(l,c)&&(m=a.stringRepeat("}",i.maybeInsertedBrackets),p.clearMaybeInsertedClosing()),"}"===c.substring(l.column,l.column+1)){var g=o.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!g)return null;var v=this.$getIndent(o.getLine(g.row))}else{if(!m)return void p.clearMaybeInsertedClosing();v=this.$getIndent(c)}var y=v+o.getTabString();return{text:"\n"+y+"\n"+v+m,selection:[1,y.length,1,y.length]}}p.clearMaybeInsertedClosing()}})),this.add("braces","deletion",(function(t,e,n,r,o){var s=r.doc.getTextRange(o);if(!o.isMultiLine()&&"{"==s){if(u(n),"}"==r.doc.getLine(o.start.row).substring(o.end.column,o.end.column+1))return o.end.column++,o;i.maybeInsertedBrackets--}})),this.add("parens","insertion",(function(t,e,n,i,r){if("("==r){u(n);var o=n.getSelectionRange(),s=i.doc.getTextRange(o);if(""!==s&&n.getWrapBehavioursEnabled())return f(o,s,"(",")");if(p.isSaneInsertion(n,i))return p.recordAutoInsert(n,i,")"),{text:"()",selection:[1,1]}}else if(")"==r){u(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1))if(null!==i.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,r))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("parens","deletion",(function(t,e,n,i,r){var o=i.doc.getTextRange(r);if(!r.isMultiLine()&&"("==o&&(u(n),")"==i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r})),this.add("brackets","insertion",(function(t,e,n,i,r){if("["==r){u(n);var o=n.getSelectionRange(),s=i.doc.getTextRange(o);if(""!==s&&n.getWrapBehavioursEnabled())return f(o,s,"[","]");if(p.isSaneInsertion(n,i))return p.recordAutoInsert(n,i,"]"),{text:"[]",selection:[1,1]}}else if("]"==r){u(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1))if(null!==i.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&p.isAutoInsertedClosing(a,l,r))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("brackets","deletion",(function(t,e,n,i,r){var o=i.doc.getTextRange(r);if(!r.isMultiLine()&&"["==o&&(u(n),"]"==i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r})),this.add("string_dquotes","insertion",(function(t,e,n,i,r){var o=i.$mode.$quotes||h;if(1==r.length&&o[r]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(r))return;u(n);var s=r,a=n.getSelectionRange(),l=i.doc.getTextRange(a);if(!(""===l||1==l.length&&o[l])&&n.getWrapBehavioursEnabled())return f(a,l,s,s);if(!l){var c=n.getCursorPosition(),d=i.doc.getLine(c.row),p=d.substring(c.column-1,c.column),m=d.substring(c.column,c.column+1),g=i.getTokenAt(c.row,c.column),v=i.getTokenAt(c.row,c.column+1);if("\\"==p&&g&&/escape/.test(g.type))return null;var y,_=g&&/string|escape/.test(g.type),b=!v||/string|escape/.test(v.type);if(m==s)(y=_!==b)&&/string\.end/.test(v.type)&&(y=!1);else{if(_&&!b)return null;if(_&&b)return null;var w=i.$mode.tokenRe;w.lastIndex=0;var T=w.test(p);w.lastIndex=0;var C=w.test(p);if(T||C)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var E=d[c.column-2];if(p==s&&(E==s||w.test(E)))return null;y=!0}return{text:y?s+s:"",selection:[1,1]}}}})),this.add("string_dquotes","deletion",(function(t,e,n,i,r){var o=i.$mode.$quotes||h,s=i.doc.getTextRange(r);if(!r.isMultiLine()&&o.hasOwnProperty(s)&&(u(n),i.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)==s))return r.end.column++,r}))};p.isSaneInsertion=function(t,e){var n=t.getCursorPosition(),i=new s(e,n.row,n.column);if(!this.$matchTokenType(i.getCurrentToken()||"text",l)){if(/[)}\]]/.test(t.session.getLine(n.row)[n.column]))return!0;var r=new s(e,n.row,n.column+1);if(!this.$matchTokenType(r.getCurrentToken()||"text",l))return!1}return i.stepForward(),i.getCurrentTokenRow()!==n.row||this.$matchTokenType(i.getCurrentToken()||"text",c)},p.$matchTokenType=function(t,e){return e.indexOf(t.type||t)>-1},p.recordAutoInsert=function(t,e,n){var r=t.getCursorPosition(),o=e.doc.getLine(r.row);this.isAutoInsertedClosing(r,o,i.autoInsertedLineEnd[0])||(i.autoInsertedBrackets=0),i.autoInsertedRow=r.row,i.autoInsertedLineEnd=n+o.substr(r.column),i.autoInsertedBrackets++},p.recordMaybeInsert=function(t,e,n){var r=t.getCursorPosition(),o=e.doc.getLine(r.row);this.isMaybeInsertedClosing(r,o)||(i.maybeInsertedBrackets=0),i.maybeInsertedRow=r.row,i.maybeInsertedLineStart=o.substr(0,r.column)+n,i.maybeInsertedLineEnd=o.substr(r.column),i.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(t,e,n){return i.autoInsertedBrackets>0&&t.row===i.autoInsertedRow&&n===i.autoInsertedLineEnd[0]&&e.substr(t.column)===i.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(t,e){return i.maybeInsertedBrackets>0&&t.row===i.maybeInsertedRow&&e.substr(t.column)===i.maybeInsertedLineEnd&&e.substr(0,t.column)==i.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){i.autoInsertedLineEnd=i.autoInsertedLineEnd.substr(1),i.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){i&&(i.maybeInsertedBrackets=0,i.maybeInsertedRow=-1)},r.inherits(p,o),e.CstyleBehaviour=p})),ace.define("ace/unicode",["require","exports","module"],(function(t,e,n){"use strict";for(var i=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],r=0,o=[],s=0;s2?i%c!=c-1:i%c==0})}else{if(!this.blockComment)return!1;var f=this.blockComment.start,p=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+l.escapeRegExp(f)+")"),g=new RegExp("(?:"+l.escapeRegExp(p)+")\\s*$"),v=function(t,e){_(t,e)||o&&!/\S/.test(t)||(r.insertInLine({row:e,column:t.length},p),r.insertInLine({row:e,column:a},f))},y=function(t,e){var n;(n=t.match(g))&&r.removeInLine(e,t.length-n[0].length,t.length),(n=t.match(m))&&r.removeInLine(e,n[1].length,n[0].length)},_=function(t,n){if(m.test(t))return!0;for(var i=e.getTokens(n),r=0;rt.length&&(w=t.length)})),a==1/0&&(a=w,o=!1,s=!1),d&&a%c!=0&&(a=Math.floor(a/c)*c),b(s?y:v)},this.toggleBlockComment=function(t,e,n,i){var r=this.blockComment;if(r){!r.start&&r[0]&&(r=r[0]);var o,s,a=(m=new c(e,i.row,i.column)).getCurrentToken(),l=(e.selection,e.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var h,u;a&&/comment/.test(a.type);){if(-1!=(g=a.value.indexOf(r.start))){var f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g;h=new d(f,p,f,p+r.start.length);break}a=m.stepBackward()}var m;for(a=(m=new c(e,i.row,i.column)).getCurrentToken();a&&/comment/.test(a.type);){var g;if(-1!=(g=a.value.indexOf(r.end))){f=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+g;u=new d(f,p,f,p+r.end.length);break}a=m.stepForward()}u&&e.remove(u),h&&(e.remove(h),o=h.start.row,s=-r.start.length)}else s=r.start.length,o=n.start.row,e.insert(n.end,r.end),e.insert(n.start,r.start);l.start.row==o&&(l.start.column+=s),l.end.row==o&&(l.end.column+=s),e.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(t,e,n){return this.$getIndent(e)},this.checkOutdent=function(t,e,n){return!1},this.autoOutdent=function(t,e,n){},this.$getIndent=function(t){return t.match(/^\s*/)[0]},this.createWorker=function(t){return null},this.createModeDelegates=function(t){for(var e in this.$embeds=[],this.$modes={},t)if(t[e]){var n=t[e],r=n.prototype.$id,o=i.$modes[r];o||(i.$modes[r]=o=new n),i.$modes[e]||(i.$modes[e]=o),this.$embeds.push(e),this.$modes[e]=o}var s=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(e=0;ethis.row)){var n=function(e,n,i){var r="insert"==e.action,o=(r?1:-1)*(e.end.row-e.start.row),s=(r?1:-1)*(e.end.column-e.start.column),a=e.start,l=r?a:e.end;if(t(n,a,i))return{row:n.row,column:n.column};if(t(l,n,!i))return{row:n.row+o,column:n.column+(n.row==l.row?s:0)};return{row:a.row,column:a.column}}(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(t,e,n){var i;if(i=n?{row:t,column:e}:this.$clipPositionToDocument(t,e),this.row!=i.row||this.column!=i.column){var r={row:this.row,column:this.column};this.row=i.row,this.column=i.column,this._signal("change",{old:r,value:i})}},this.detach=function(){this.document.off("change",this.$onChange)},this.attach=function(t){this.document=t||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(t,e){var n={};return t>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):t<0?(n.row=0,n.column=0):(n.row=t,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,e))),e<0&&(n.column=0),n}}).call(o.prototype)})),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],(function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./apply_delta").applyDelta,o=t("./lib/event_emitter").EventEmitter,s=t("./range").Range,a=t("./anchor").Anchor,l=function(t){this.$lines=[""],0===t.length?this.$lines=[""]:Array.isArray(t)?this.insertMergedLines({row:0,column:0},t):this.insert({row:0,column:0},t)};(function(){i.implement(this,o),this.setValue=function(t){var e=this.getLength()-1;this.remove(new s(0,0,e,this.getLine(e).length)),this.insert({row:0,column:0},t)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(t,e){return new a(this,t,e)},0==="aaa".split(/a/).length?this.$split=function(t){return t.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(t){return t.split(/\r\n|\r|\n/)},this.$detectNewLine=function(t){var e=t.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=e?e[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(t){this.$newLineMode!==t&&(this.$newLineMode=t,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(t){return"\r\n"==t||"\r"==t||"\n"==t},this.getLine=function(t){return this.$lines[t]||""},this.getLines=function(t,e){return this.$lines.slice(t,e+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(t){return this.getLinesForRange(t).join(this.getNewLineCharacter())},this.getLinesForRange=function(t){var e;if(t.start.row===t.end.row)e=[this.getLine(t.start.row).substring(t.start.column,t.end.column)];else{(e=this.getLines(t.start.row,t.end.row))[0]=(e[0]||"").substring(t.start.column);var n=e.length-1;t.end.row-t.start.row==n&&(e[n]=e[n].substring(0,t.end.column))}return e},this.insertLines=function(t,e){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(t,e)},this.removeLines=function(t,e){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(t,e)},this.insertNewLine=function(t){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(t,["",""])},this.insert=function(t,e){return this.getLength()<=1&&this.$detectNewLine(e),this.insertMergedLines(t,this.$split(e))},this.insertInLine=function(t,e){var n=this.clippedPos(t.row,t.column),i=this.pos(t.row,t.column+e.length);return this.applyDelta({start:n,end:i,action:"insert",lines:[e]},!0),this.clonePos(i)},this.clippedPos=function(t,e){var n=this.getLength();void 0===t?t=n:t<0?t=0:t>=n&&(t=n-1,e=void 0);var i=this.getLine(t);return null==e&&(e=i.length),{row:t,column:e=Math.min(Math.max(e,0),i.length)}},this.clonePos=function(t){return{row:t.row,column:t.column}},this.pos=function(t,e){return{row:t,column:e}},this.$clipPosition=function(t){var e=this.getLength();return t.row>=e?(t.row=Math.max(0,e-1),t.column=this.getLine(e-1).length):(t.row=Math.max(0,t.row),t.column=Math.min(Math.max(t.column,0),this.getLine(t.row).length)),t},this.insertFullLines=function(t,e){var n=0;(t=Math.min(Math.max(t,0),this.getLength()))0,i=e=0&&this.applyDelta({start:this.pos(t,this.getLine(t).length),end:this.pos(t+1,0),action:"remove",lines:["",""]})},this.replace=function(t,e){return t instanceof s||(t=s.fromPoints(t.start,t.end)),0===e.length&&t.isEmpty()?t.start:e==this.getTextRange(t)?t.end:(this.remove(t),e?this.insert(t.start,e):t.start)},this.applyDeltas=function(t){for(var e=0;e=0;e--)this.revertDelta(t[e])},this.applyDelta=function(t,e){var n="insert"==t.action;(n?t.lines.length<=1&&!t.lines[0]:!s.comparePoints(t.start,t.end))||(n&&t.lines.length>2e4?this.$splitAndapplyLargeDelta(t,2e4):(r(this.$lines,t,e),this._signal("change",t)))},this.$safeApplyDelta=function(t){var e=this.$lines.length;("remove"==t.action&&t.start.row20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=e,-1==i&&(i=e),o<=i&&n.fireUpdateEvent(o,i)}}};(function(){i.implement(this,r),this.setTokenizer=function(t){this.tokenizer=t,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(t){this.doc=t,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(t,e){var n={first:t,last:e};this._signal("update",{data:n})},this.start=function(t){this.currentLine=Math.min(t||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(t){var e=t.start.row,n=t.end.row-e;if(0===n)this.lines[e]=null;else if("remove"==t.action)this.lines.splice(e,n+1,null),this.states.splice(e,n+1,null);else{var i=Array(n+1);i.unshift(e,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i)}this.currentLine=Math.min(e,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(t){return this.lines[t]||this.$tokenizeRow(t)},this.getState=function(t){return this.currentLine==t&&this.$tokenizeRow(t),this.states[t]||"start"},this.$tokenizeRow=function(t){var e=this.doc.getLine(t),n=this.states[t-1],i=this.tokenizer.getLineTokens(e,n,t);return this.states[t]+""!=i.state+""?(this.states[t]=i.state,this.lines[t+1]=null,this.currentLine>t+1&&(this.currentLine=t+1)):this.currentLine==t&&(this.currentLine=t+1),this.lines[t]=i.tokens}}).call(o.prototype),e.BackgroundTokenizer=o})),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(t,e,n){"use strict";var i=t("./lib/lang"),r=(t("./lib/oop"),t("./range").Range),o=function(t,e,n){this.setRegexp(t),this.clazz=e,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(t){this.regExp+""!=t+""&&(this.regExp=t,this.cache=[])},this.update=function(t,e,n,o){if(this.regExp)for(var s=o.firstRow,a=o.lastRow,l=s;l<=a;l++){var c=this.cache[l];null==c&&((c=i.getMatchOffsets(n.getLine(l),this.regExp)).length>this.MAX_RANGES&&(c=c.slice(0,this.MAX_RANGES)),c=c.map((function(t){return new r(l,t.offset,l,t.offset+t.length)})),this.cache[l]=c.length?c:"");for(var d=c.length;d--;)e.drawSingleLineMarker(t,c[d].toScreenRange(n),this.clazz,o)}}}).call(o.prototype),e.SearchHighlight=o})),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],(function(t,e,n){"use strict";var i=t("../range").Range;function r(t,e){this.foldData=t,Array.isArray(e)?this.folds=e:e=this.folds=[e];var n=e[e.length-1];this.range=new i(e[0].start.row,e[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach((function(t){t.setFoldLine(this)}),this)}(function(){this.shiftRow=function(t){this.start.row+=t,this.end.row+=t,this.folds.forEach((function(e){e.start.row+=t,e.end.row+=t}))},this.addFold=function(t){if(t.sameRow){if(t.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(t),this.folds.sort((function(t,e){return-t.range.compareEnd(e.start.row,e.start.column)})),this.range.compareEnd(t.start.row,t.start.column)>0?(this.end.row=t.end.row,this.end.column=t.end.column):this.range.compareStart(t.end.row,t.end.column)<0&&(this.start.row=t.start.row,this.start.column=t.start.column)}else if(t.start.row==this.end.row)this.folds.push(t),this.end.row=t.end.row,this.end.column=t.end.column;else{if(t.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(t),this.start.row=t.start.row,this.start.column=t.start.column}t.foldLine=this},this.containsRow=function(t){return t>=this.start.row&&t<=this.end.row},this.walk=function(t,e,n){var i,r,o=0,s=this.folds,a=!0;null==e&&(e=this.end.row,n=this.end.column);for(var l=0;l0)){var l=i(t,s.start);return 0===a?e&&0!==l?-o-2:o:l>0||0===l&&!e?o:-o-1}}return-o-1},this.add=function(t){var e=!t.isEmpty(),n=this.pointIndex(t.start,e);n<0&&(n=-n-1);var i=this.pointIndex(t.end,e,n);return i<0?i=-i-1:i++,this.ranges.splice(n,i-n,t)},this.addList=function(t){for(var e=[],n=t.length;n--;)e.push.apply(e,this.add(t[n]));return e},this.substractPoint=function(t){var e=this.pointIndex(t);if(e>=0)return this.ranges.splice(e,1)},this.merge=function(){for(var t,e=[],n=this.ranges,r=(n=n.sort((function(t,e){return i(t.start,e.start)})))[0],o=1;o=0},this.containsPoint=function(t){return this.pointIndex(t)>=0},this.rangeAtPoint=function(t){var e=this.pointIndex(t);if(e>=0)return this.ranges[e]},this.clipRows=function(t,e){var n=this.ranges;if(n[0].start.row>e||n[n.length-1].start.row=i)break}if("insert"==t.action)for(var l=r-i,c=-e.column+n.column;si)break;if(d.start.row==i&&d.start.column>=e.column&&(d.start.column==e.column&&this.$bias<=0||(d.start.column+=c,d.start.row+=l)),d.end.row==i&&d.end.column>=e.column){if(d.end.column==e.column&&this.$bias<0)continue;d.end.column==e.column&&c>0&&sd.start.column&&d.end.column==o[s+1].start.column&&(d.end.column-=c),d.end.column+=c,d.end.row+=l}}else for(l=i-r,c=e.column-n.column;sr)break;d.end.rowe.column)&&(d.end.column=e.column,d.end.row=e.row):(d.end.column+=c,d.end.row+=l):d.end.row>r&&(d.end.row+=l),d.start.rowe.column)&&(d.start.column=e.column,d.start.row=e.row):(d.start.column+=c,d.start.row+=l):d.start.row>r&&(d.start.row+=l)}if(0!=l&&s=t)return r;if(r.end.row>t)return null}return null},this.getNextFoldLine=function(t,e){var n=this.$foldData,i=0;for(e&&(i=n.indexOf(e)),-1==i&&(i=0);i=t)return r}return null},this.getFoldedRowCount=function(t,e){for(var n=this.$foldData,i=e-t+1,r=0;r=e){a=t?i-=e-a:i=0);break}s>=t&&(i-=a>=t?s-a:s-t+1)}return i},this.$addFoldLine=function(t){return this.$foldData.push(t),this.$foldData.sort((function(t,e){return t.start.row-e.start.row})),t},this.addFold=function(t,e){var n,i=this.$foldData,s=!1;t instanceof o?n=t:(n=new o(e,t)).collapseChildren=e.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,c=n.end.row,d=n.end.column,h=this.getFoldAt(a,l,1),u=this.getFoldAt(c,d,-1);if(h&&u==h)return h.addSubFold(n);h&&!h.range.isStart(a,l)&&this.removeFold(h),u&&!u.range.isEnd(c,d)&&this.removeFold(u);var f=this.getFoldsInRange(n.range);f.length>0&&(this.removeFolds(f),n.collapseChildren||f.forEach((function(t){n.addSubFold(t)})));for(var p=0;p0&&this.foldAll(t.start.row+1,t.end.row,t.collapseChildren-1),t.subFolds=[]},this.expandFolds=function(t){t.forEach((function(t){this.expandFold(t)}),this)},this.unfold=function(t,e){var n,r;if(null==t?(n=new i(0,0,this.getLength(),0),null==e&&(e=!0)):n="number"==typeof t?new i(t,0,t,this.getLine(t).length):"row"in t?i.fromPoints(t,t):t,r=this.getFoldsInRangeList(n),0!=e?this.removeFolds(r):this.expandFolds(r),r.length)return r},this.isRowFolded=function(t,e){return!!this.getFoldLine(t,e)},this.getRowFoldEnd=function(t,e){var n=this.getFoldLine(t,e);return n?n.end.row:t},this.getRowFoldStart=function(t,e){var n=this.getFoldLine(t,e);return n?n.start.row:t},this.getFoldDisplayLine=function(t,e,n,i,r){null==i&&(i=t.start.row),null==r&&(r=0),null==e&&(e=t.end.row),null==n&&(n=this.getLine(e).length);var o=this.doc,s="";return t.walk((function(t,e,n,a){if(!(ed)break}while(o&&l.test(o.type));o=r.stepBackward()}else o=r.getCurrentToken();return c.end.row=r.getCurrentTokenRow(),c.end.column=r.getCurrentTokenColumn()+o.value.length-2,c}},this.foldAll=function(t,e,n,i){null==n&&(n=1e5);var r=this.foldWidgets;if(r){e=e||this.getLength();for(var o=t=t||0;o=t&&(o=s.end.row,s.collapseChildren=n,this.addFold("...",s))}}},this.foldToLevel=function(t){for(this.foldAll();t-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var t=this;this.foldAll(null,null,null,(function(e){for(var n=t.getTokens(e),i=0;i=0;){var o=n[r];if(null==o&&(o=n[r]=this.getFoldWidget(r)),"start"==o){var s=this.getFoldWidgetRange(r);if(i||(i=s),s&&s.end.row>=t)break}r--}return{range:-1!==r&&s,firstRange:i}},this.onFoldWidgetClick=function(t,e){var n={children:(e=e.domEvent).shiftKey,all:e.ctrlKey||e.metaKey,siblings:e.altKey};if(!this.$toggleFoldWidget(t,n)){var i=e.target||e.srcElement;i&&/ace_fold-widget/.test(i.className)&&(i.className+=" ace_invalid")}},this.$toggleFoldWidget=function(t,e){if(this.getFoldWidget){var n=this.getFoldWidget(t),i=this.getLine(t),r="end"===n?-1:1,o=this.getFoldAt(t,-1===r?0:i.length,r);if(o)return e.children||e.all?this.removeFold(o):this.expandFold(o),o;var s=this.getFoldWidgetRange(t,!0);if(s&&!s.isMultiLine()&&(o=this.getFoldAt(s.start.row,s.start.column,1))&&s.isEqual(o.range))return this.removeFold(o),o;if(e.siblings){var a=this.getParentFoldRangeData(t);if(a.range)var l=a.range.start.row+1,c=a.range.end.row;this.foldAll(l,c,e.all?1e4:0)}else e.children?(c=s?s.end.row:this.getLength(),this.foldAll(t+1,c,e.all?1e4:0)):s&&(e.all&&(s.collapseChildren=1e4),this.addFold("...",s));return s}},this.toggleFoldWidget=function(t){var e=this.selection.getCursor().row;e=this.getRowFoldStart(e);var n=this.$toggleFoldWidget(e,{});if(!n){var i=this.getParentFoldRangeData(e,!0);if(n=i.range||i.firstRange){e=n.start.row;var r=this.getFoldAt(e,this.getLine(e).length,1);r?this.removeFold(r):this.addFold("...",n)}}},this.updateFoldWidgets=function(t){var e=t.start.row,n=t.end.row-e;if(0===n)this.foldWidgets[e]=null;else if("remove"==t.action)this.foldWidgets.splice(e,n+1,null);else{var i=Array(n+1);i.unshift(e,1),this.foldWidgets.splice.apply(this.foldWidgets,i)}},this.tokenizerUpdateFoldWidgets=function(t){var e=t.data;e.first!=e.last&&this.foldWidgets.length>e.first&&this.foldWidgets.splice(e.first,this.foldWidgets.length)}}})),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],(function(t,e,n){"use strict";var i=t("../token_iterator").TokenIterator,r=t("../range").Range;e.BracketMatch=function(){this.findMatchingBracket=function(t,e){if(0==t.column)return null;var n=e||this.getLine(t.row).charAt(t.column-1);if(""==n)return null;var i=n.match(/([\(\[\{])|([\)\]\}])/);return i?i[1]?this.$findClosingBracket(i[1],t):this.$findOpeningBracket(i[2],t):null},this.getBracketRange=function(t){var e,n=this.getLine(t.row),i=!0,o=n.charAt(t.column-1),s=o&&o.match(/([\(\[\{])|([\)\]\}])/);if(s||(o=n.charAt(t.column),t={row:t.row,column:t.column+1},s=o&&o.match(/([\(\[\{])|([\)\]\}])/),i=!1),!s)return null;if(s[1]){if(!(a=this.$findClosingBracket(s[1],t)))return null;e=r.fromPoints(t,a),i||(e.end.column++,e.start.column--),e.cursor=e.end}else{var a;if(!(a=this.$findOpeningBracket(s[2],t)))return null;e=r.fromPoints(a,t),i||(e.start.column++,e.end.column--),e.cursor=e.start}return e},this.getMatchingBracketRanges=function(t){var e=this.getLine(t.row),n=e.charAt(t.column-1),i=n&&n.match(/([\(\[\{])|([\)\]\}])/);if(i||(n=e.charAt(t.column),t={row:t.row,column:t.column+1},i=n&&n.match(/([\(\[\{])|([\)\]\}])/)),!i)return null;var o=new r(t.row,t.column-1,t.row,t.column),s=i[1]?this.$findClosingBracket(i[1],t):this.$findOpeningBracket(i[2],t);return s?[o,new r(s.row,s.column,s.row,s.column+1)]:[o]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(t,e,n){var r=this.$brackets[t],o=1,s=new i(this,e.row,e.column),a=s.getCurrentToken();if(a||(a=s.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=e.column-s.getCurrentTokenColumn()-2,c=a.value;;){for(;l>=0;){var d=c.charAt(l);if(d==r){if(0==(o-=1))return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else d==t&&(o+=1);l-=1}do{a=s.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(c=a.value).length-1}return null}},this.$findClosingBracket=function(t,e,n){var r=this.$brackets[t],o=1,s=new i(this,e.row,e.column),a=s.getCurrentToken();if(a||(a=s.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=e.column-s.getCurrentTokenColumn();;){for(var c=a.value,d=c.length;ln&&(this.$docRowCache.splice(n,e),this.$screenRowCache.splice(n,e))},this.$getRowCacheIndex=function(t,e){for(var n=0,i=t.length-1;n<=i;){var r=n+i>>1,o=t[r];if(e>o)n=r+1;else{if(!(e=e);o++);return(n=i[o])?(n.index=o,n.start=r-n.value.length,n):null},this.setUndoManager=function(t){if(this.$undoManager=t,this.$informUndoManager&&this.$informUndoManager.cancel(),t){var e=this;t.addSession(this),this.$syncInformUndoManager=function(){e.$informUndoManager.cancel(),e.mergeUndoDeltas=!1},this.$informUndoManager=r.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?r.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(t){this.setOption("useSoftTabs",t)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(t){this.setOption("tabSize",t)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(t){return this.$useSoftTabs&&t.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(t){this.setOption("navigateWithinSoftTabs",t)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(t){this.setOption("overwrite",t)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(t,e){this.$decorations[t]||(this.$decorations[t]=""),this.$decorations[t]+=" "+e,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(t,e){this.$decorations[t]=(this.$decorations[t]||"").replace(" "+e,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(t){this.$breakpoints=[];for(var e=0;e0&&(i=!!n.charAt(e-1).match(this.tokenRe)),i||(i=!!n.charAt(e).match(this.tokenRe)),i)var r=this.tokenRe;else if(/^\s+$/.test(n.slice(e-1,e+1)))r=/\s/;else r=this.nonTokenRe;var o=e;if(o>0){do{o--}while(o>=0&&n.charAt(o).match(r));o++}for(var s=e;st&&(t=e.screenWidth)})),this.lineWidgetWidth=t},this.$computeWidth=function(t){if(this.$modified||t){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var e=this.doc.getAllLines(),n=this.$rowLengthCache,i=0,r=0,o=this.$foldData[r],s=o?o.start.row:1/0,a=e.length,l=0;ls){if((l=o.end.row+1)>=a)break;s=(o=this.$foldData[r++])?o.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(e[l])[0]),n[l]>i&&(i=n[l])}this.screenWidth=i}},this.getLine=function(t){return this.doc.getLine(t)},this.getLines=function(t,e){return this.doc.getLines(t,e)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(t){return this.doc.getTextRange(t||this.selection.getRange())},this.insert=function(t,e){return this.doc.insert(t,e)},this.remove=function(t){return this.doc.remove(t)},this.removeFullLines=function(t,e){return this.doc.removeFullLines(t,e)},this.undoChanges=function(t,e){if(t.length){this.$fromUndo=!0;for(var n=t.length-1;-1!=n;n--){var i=t[n];"insert"==i.action||"remove"==i.action?this.doc.revertDelta(i):i.folds&&this.addFolds(i.folds)}!e&&this.$undoSelect&&(t.selectionBefore?this.selection.fromJSON(t.selectionBefore):this.selection.setRange(this.$getUndoSelection(t,!0))),this.$fromUndo=!1}},this.redoChanges=function(t,e){if(t.length){this.$fromUndo=!0;for(var n=0;nt.end.column&&(o.start.column+=c),o.end.row==t.end.row&&o.end.column>t.end.column&&(o.end.column+=c)),s&&o.start.row>=t.end.row&&(o.start.row+=s,o.end.row+=s)}if(o.end=this.insert(o.start,i),r.length){var a=t.start,l=o.start,c=(s=l.row-a.row,l.column-a.column);this.addFolds(r.map((function(t){return(t=t.clone()).start.row==a.row&&(t.start.column+=c),t.end.row==a.row&&(t.end.column+=c),t.start.row+=s,t.end.row+=s,t})))}return o},this.indentRows=function(t,e,n){n=n.replace(/\t/g,this.getTabString());for(var i=t;i<=e;i++)this.doc.insertInLine({row:i,column:0},n)},this.outdentRows=function(t){for(var e=t.collapseRows(),n=new d(0,0,0,0),i=this.getTabSize(),r=e.start.row;r<=e.end.row;++r){var o=this.getLine(r);n.start.row=r,n.end.row=r;for(var s=0;s0){var r;if((r=this.getRowFoldEnd(e+n))>this.doc.getLength()-1)return 0;i=r-e}else{t=this.$clipRowToDocument(t);i=(e=this.$clipRowToDocument(e))-t+1}var o=new d(t,0,e,Number.MAX_VALUE),s=this.getFoldsInRange(o).map((function(t){return(t=t.clone()).start.row+=i,t.end.row+=i,t})),a=0==n?this.doc.getLines(t,e):this.doc.removeFullLines(t,e);return this.doc.insertFullLines(t+i,a),s.length&&this.addFolds(s),i},this.moveLinesUp=function(t,e){return this.$moveLines(t,e,-1)},this.moveLinesDown=function(t,e){return this.$moveLines(t,e,1)},this.duplicateLines=function(t,e){return this.$moveLines(t,e,0)},this.$clipRowToDocument=function(t){return Math.max(0,Math.min(t,this.doc.getLength()-1))},this.$clipColumnToRow=function(t,e){return e<0?0:Math.min(this.doc.getLine(t).length,e)},this.$clipPositionToDocument=function(t,e){if(e=Math.max(0,e),t<0)t=0,e=0;else{var n=this.doc.getLength();t>=n?(t=n-1,e=this.doc.getLine(n-1).length):e=Math.min(this.doc.getLine(t).length,e)}return{row:t,column:e}},this.$clipRangeToDocument=function(t){t.start.row<0?(t.start.row=0,t.start.column=0):t.start.column=this.$clipColumnToRow(t.start.row,t.start.column);var e=this.doc.getLength()-1;return t.end.row>e?(t.end.row=e,t.end.column=this.doc.getLine(e).length):t.end.column=this.$clipColumnToRow(t.end.row,t.end.column),t},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(t){if(t!=this.$useWrapMode){if(this.$useWrapMode=t,this.$modified=!0,this.$resetRowCache(0),t){var e=this.getLength();this.$wrapData=Array(e),this.$updateWrapData(0,e-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(t,e){this.$wrapLimitRange.min===t&&this.$wrapLimitRange.max===e||(this.$wrapLimitRange={min:t,max:e},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(t,e){var n=this.$wrapLimitRange;n.max<0&&(n={min:e,max:e});var i=this.$constrainWrapLimit(t,n.min,n.max);return i!=this.$wrapLimit&&i>1&&(this.$wrapLimit=i,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(t,e,n){return e&&(t=Math.max(e,t)),n&&(t=Math.min(n,t)),t},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(t){this.setWrapLimitRange(t,t)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(t){var e=this.$useWrapMode,n=t.action,i=t.start,r=t.end,o=i.row,s=r.row,a=s-o,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[e?"$wrapData":"$rowLengthCache"].splice(o,a);var c=this.$foldData;l=this.getFoldsInRange(t),this.removeFolds(l);var d=0;if(m=this.getFoldLine(r.row)){m.addRemoveChars(r.row,r.column,i.column-r.column),m.shiftRow(-a);var h=this.getFoldLine(o);h&&h!==m&&(h.merge(m),m=h),d=c.indexOf(m)+1}for(;d=r.row&&m.shiftRow(-a)}s=o}else{var u=Array(a);u.unshift(o,0);var f=e?this.$wrapData:this.$rowLengthCache;f.splice.apply(f,u);c=this.$foldData,d=0;if(m=this.getFoldLine(o)){var p=m.range.compareInside(i.row,i.column);0==p?(m=m.split(i.row,i.column))&&(m.shiftRow(a),m.addRemoveChars(s,0,r.column-i.column)):-1==p&&(m.addRemoveChars(o,0,r.column-i.column),m.shiftRow(a)),d=c.indexOf(m)+1}for(;d=o&&m.shiftRow(a)}}else a=Math.abs(t.start.column-t.end.column),"remove"===n&&(l=this.getFoldsInRange(t),this.removeFolds(l),a=-a),(m=this.getFoldLine(o))&&m.addRemoveChars(o,i.column,a);return e&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,e?this.$updateWrapData(o,s):this.$updateRowLengthCache(o,s),l},this.$updateRowLengthCache=function(t,e,n){this.$rowLengthCache[t]=null,this.$rowLengthCache[e]=null},this.$updateWrapData=function(n,i){var r,o,s=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,c=this.$wrapLimit,d=n;for(i=Math.min(i,s.length-1);d<=i;)(o=this.getFoldLine(d,o))?(r=[],o.walk(function(n,i,o,a){var l;if(null!=n){(l=this.$getDisplayTokens(n,r.length))[0]=t;for(var c=1;c=4352&&t<=4447||t>=4515&&t<=4519||t>=4602&&t<=4607||t>=9001&&t<=9002||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12283||t>=12288&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12589||t>=12593&&t<=12686||t>=12688&&t<=12730||t>=12736&&t<=12771||t>=12784&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=13054||t>=13056&&t<=19903||t>=19968&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=55216&&t<=55238||t>=55243&&t<=55291||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=65281&&t<=65376||t>=65504&&t<=65510)}this.$computeWrapSplits=function(n,i,r){if(0==n.length)return[];var o=[],s=n.length,a=0,l=0,c=this.$wrapAsCode,d=this.$indentedSoftWrap,h=i<=Math.max(2*r,8)||!1===d?0:Math.floor(i/2);function u(t){for(var e=t-a,i=a;ii-f;){var p=a+i-f;if(n[p-1]>=10&&n[p]>=10)u(p);else if(n[p]!=t&&n[p]!=e){for(var m=Math.max(p-(i-(i>>2)),a-1);p>m&&n[p]m&&n[p]m&&9==n[p];)p--}else for(;p>m&&n[p]<10;)p--;p>m?u(++p):(2==n[p=a+i]&&p--,u(p-f))}else{for(;p!=a-1&&n[p]!=t;p--);if(p>a){u(p);continue}for(p=a+i;p39&&s<48||s>57&&s<64?r.push(9):s>=4352&&n(s)?r.push(1,2):r.push(1)}return r},this.$getStringScreenWidth=function(t,e,i){if(0==e)return[0,0];var r,o;for(null==e&&(e=1/0),i=i||0,o=0;o=4352&&n(r)?i+=2:i+=1,!(i>e));o++);return[i,o]},this.lineWidgets=null,this.getRowLength=function(t){var e=1;return this.lineWidgets&&(e+=this.lineWidgets[t]&&this.lineWidgets[t].rowCount||0),this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+e:e},this.getRowLineCount=function(t){return this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+1:1},this.getRowWrapIndent=function(t){if(this.$useWrapMode){var e=this.screenToDocumentPosition(t,Number.MAX_VALUE),n=this.$wrapData[e.row];return n.length&&n[0]=0){a=c[d],o=this.$docRowCache[d];var u=t>c[h-1]}else u=!h;for(var f=this.getLength()-1,p=this.getNextFoldLine(o),m=p?p.start.row:1/0;a<=t&&!(a+(l=this.getRowLength(o))>t||o>=f);)a+=l,++o>m&&(o=p.end.row+1,m=(p=this.getNextFoldLine(o,p))?p.start.row:1/0),u&&(this.$docRowCache.push(o),this.$screenRowCache.push(a));if(p&&p.start.row<=o)i=this.getFoldDisplayLine(p),o=p.start.row;else{if(a+l<=t||o>f)return{row:f,column:this.getLine(f).length};i=this.getLine(o),p=null}var g=0,v=Math.floor(t-a);if(this.$useWrapMode){var y=this.$wrapData[o];y&&(r=y[v],v>0&&y.length&&(g=y.indent,s=y[v-1]||y[y.length-1],i=i.substring(s)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+v,o,v)&&(e=this.$bidiHandler.offsetToCol(n)),s+=this.$getStringScreenWidth(i,e-g)[1],this.$useWrapMode&&s>=r&&(s=r-1),p?p.idxToPosition(s):{row:o,column:s}},this.documentToScreenPosition=function(t,e){if(void 0===e)var n=this.$clipPositionToDocument(t.row,t.column);else n=this.$clipPositionToDocument(t,e);t=n.row,e=n.column;var i,r=0,o=null;(i=this.getFoldAt(t,e,1))&&(t=i.start.row,e=i.start.column);var s,a=0,l=this.$docRowCache,c=this.$getRowCacheIndex(l,t),d=l.length;if(d&&c>=0){a=l[c],r=this.$screenRowCache[c];var h=t>l[d-1]}else h=!d;for(var u=this.getNextFoldLine(a),f=u?u.start.row:1/0;a=f){if((s=u.end.row+1)>t)break;f=(u=this.getNextFoldLine(s,u))?u.start.row:1/0}else s=a+1;r+=this.getRowLength(a),a=s,h&&(this.$docRowCache.push(a),this.$screenRowCache.push(r))}var p="";u&&a>=f?(p=this.getFoldDisplayLine(u,t,e),o=u.start.row):(p=this.getLine(t).substring(0,e),o=t);var m=0;if(this.$useWrapMode){var g=this.$wrapData[o];if(g){for(var v=0;p.length>=g[v];)r++,v++;p=p.substring(g[v-1]||0,p.length),m=v>0?g.indent:0}}return this.lineWidgets&&this.lineWidgets[a]&&this.lineWidgets[a].rowsAbove&&(r+=this.lineWidgets[a].rowsAbove),{row:r,column:m+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(t,e){return this.documentToScreenPosition(t,e).column},this.documentToScreenRow=function(t,e){return this.documentToScreenPosition(t,e).row},this.getScreenLength=function(){var t=0,e=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,i=0,r=(a=0,(e=this.$foldData[a++])?e.start.row:1/0);ir&&(i=e.end.row+1,r=(e=this.$foldData[a++])?e.start.row:1/0)}else{t=this.getLength();for(var s=this.$foldData,a=0;an);o++);return[i,o]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker(),this.removeAllListeners(),this.selection.detach()},this.isFullWidth=n}.call(p.prototype),t("./edit_session/folding").Folding.call(p.prototype),t("./edit_session/bracket_match").BracketMatch.call(p.prototype),s.defineOptions(p.prototype,"session",{wrap:{set:function(t){if(t&&"off"!=t?"free"==t?t=!0:"printMargin"==t?t=-1:"string"==typeof t&&(t=parseInt(t,10)||!1):t=!1,this.$wrap!=t)if(this.$wrap=t,t){var e="number"==typeof t?t:null;this.setWrapLimitRange(e,e),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(t){(t="auto"==t?"text"!=this.$mode.type:"text"!=t)!=this.$wrapAsCode&&(this.$wrapAsCode=t,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(t){this.$useWorker=t,this.$stopWorker(),t&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(t){(t=parseInt(t))>0&&this.$tabSize!==t&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=t,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(t){this.setFoldStyle(t)},handlesSet:!0},overwrite:{set:function(t){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(t){this.doc.setNewLineMode(t)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(t){this.setMode(t)},get:function(){return this.$modeId},handlesSet:!0}}),e.EditSession=p})),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(t,e,n){"use strict";var i=t("./lib/lang"),r=t("./lib/oop"),o=t("./range").Range,s=function(){this.$options={}};(function(){this.set=function(t){return r.mixin(this.$options,t),this},this.getOptions=function(){return i.copyObject(this.$options)},this.setOptions=function(t){this.$options=t},this.find=function(t){var e=this.$options,n=this.$matchIterator(t,e);if(!n)return!1;var i=null;return n.forEach((function(t,n,r,s){return i=new o(t,n,r,s),!(n==s&&e.start&&e.start.start&&0!=e.skipCurrent&&i.isEqual(e.start))||(i=null,!1)})),i},this.findAll=function(t){var e=this.$options;if(!e.needle)return[];this.$assembleRegExp(e);var n=e.range,r=n?t.getLines(n.start.row,n.end.row):t.doc.getAllLines(),s=[],a=e.re;if(e.$isMultiLine){var l,c=a.length,d=r.length-c;t:for(var h=a.offset||0;h<=d;h++){for(var u=0;um||(s.push(l=new o(h,m,h+c-1,g)),c>2&&(h=h+c-2))}}else for(var v=0;vw&&s[u].end.row==n.end.row;)u--;for(s=s.slice(v,u+1),v=0,u=s.length;v=a;n--)if(h(n,Number.MAX_VALUE,t))return;if(0!=e.wrap)for(n=l,a=s.row;n>=a;n--)if(h(n,Number.MAX_VALUE,t))return}};else c=function(t){var n=s.row;if(!h(n,s.column,t)){for(n+=1;n<=l;n++)if(h(n,0,t))return;if(0!=e.wrap)for(n=a,l=s.row;n<=l;n++)if(h(n,0,t))return}};if(e.$isMultiLine)var d=n.length,h=function(e,r,o){var s=i?e-d+1:e;if(!(s<0)){var a=t.getLine(s),l=a.search(n[0]);if(!(!i&&lr))return!!o(s,l,s+d-1,h)||void 0}}};else if(i)h=function(e,i,r){var o,s=t.getLine(e),a=[],l=0;for(n.lastIndex=0;o=n.exec(s);){var c=o[0].length;if(l=o.index,!c){if(l>=s.length)break;n.lastIndex=l+=1}if(o.index+c>i)break;a.push(o.index,c)}for(var d=a.length-1;d>=0;d-=2){var h=a[d-1];if(r(e,h,e,h+(c=a[d])))return!0}};else h=function(e,i,r){var o,s,a=t.getLine(e);for(n.lastIndex=i;s=n.exec(a);){var l=s[0].length;if(r(e,o=s.index,e,o+l))return!0;if(!l&&(n.lastIndex=o+=1,o>=a.length))return!1}};return{forEach:c}}}).call(s.prototype),e.Search=s})),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(t,e,n){"use strict";var i=t("../lib/keys"),r=t("../lib/useragent"),o=i.KEY_MODS;function s(t,e){this.platform=e||(r.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(t),this.$singleCommand=!0}function a(t,e){s.call(this,t,e),this.$singleCommand=!1}a.prototype=s.prototype,function(){function t(t){return"object"==typeof t&&t.bindKey&&t.bindKey.position||(t.isDefault?-100:0)}this.addCommand=function(t){this.commands[t.name]&&this.removeCommand(t),this.commands[t.name]=t,t.bindKey&&this._buildKeyHash(t)},this.removeCommand=function(t,e){var n=t&&("string"==typeof t?t:t.name);t=this.commands[n],e||delete this.commands[n];var i=this.commandKeyBinding;for(var r in i){var o=i[r];if(o==t)delete i[r];else if(Array.isArray(o)){var s=o.indexOf(t);-1!=s&&(o.splice(s,1),1==o.length&&(i[r]=o[0]))}}},this.bindKey=function(t,e,n){if("object"==typeof t&&t&&(null==n&&(n=t.position),t=t[this.platform]),t)return"function"==typeof e?this.addCommand({exec:e,bindKey:t,name:e.name||t}):void t.split("|").forEach((function(t){var i="";if(-1!=t.indexOf(" ")){var r=t.split(/\s+/);t=r.pop(),r.forEach((function(t){var e=this.parseKeys(t),n=o[e.hashId]+e.key;i+=(i?" ":"")+n,this._addCommandToBinding(i,"chainKeys")}),this),i+=" "}var s=this.parseKeys(t),a=o[s.hashId]+s.key;this._addCommandToBinding(i+a,e,n)}),this)},this._addCommandToBinding=function(e,n,i){var r,o=this.commandKeyBinding;if(n)if(!o[e]||this.$singleCommand)o[e]=n;else{Array.isArray(o[e])?-1!=(r=o[e].indexOf(n))&&o[e].splice(r,1):o[e]=[o[e]],"number"!=typeof i&&(i=t(n));var s=o[e];for(r=0;ri)break}s.splice(r,0,n)}else delete o[e]},this.addCommands=function(t){t&&Object.keys(t).forEach((function(e){var n=t[e];if(n){if("string"==typeof n)return this.bindKey(n,e);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=e),this.addCommand(n))}}),this)},this.removeCommands=function(t){Object.keys(t).forEach((function(e){this.removeCommand(t[e])}),this)},this.bindKeys=function(t){Object.keys(t).forEach((function(e){this.bindKey(e,t[e])}),this)},this._buildKeyHash=function(t){this.bindKey(t.bindKey,t)},this.parseKeys=function(t){var e=t.toLowerCase().split(/[\-\+]([\-\+])?/).filter((function(t){return t})),n=e.pop(),r=i[n];if(i.FUNCTION_KEYS[r])n=i.FUNCTION_KEYS[r].toLowerCase();else{if(!e.length)return{key:n,hashId:-1};if(1==e.length&&"shift"==e[0])return{key:n.toUpperCase(),hashId:-1}}for(var o=0,s=e.length;s--;){var a=i.KEY_MODS[e[s]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+e[s]+" in "+t),!1;o|=a}return{key:n,hashId:o}},this.findKeyCommand=function(t,e){var n=o[t]+e;return this.commandKeyBinding[n]},this.handleKeyboard=function(t,e,n,i){if(!(i<0)){var r=o[e]+n,s=this.commandKeyBinding[r];return t.$keyChain&&(t.$keyChain+=" "+r,s=this.commandKeyBinding[t.$keyChain]||s),!s||"chainKeys"!=s&&"chainKeys"!=s[s.length-1]?(t.$keyChain&&(e&&4!=e||1!=n.length?(-1==e||i>0)&&(t.$keyChain=""):t.$keyChain=t.$keyChain.slice(0,-r.length-1)),{command:s}):(t.$keyChain=t.$keyChain||r,{command:"null"})}},this.getStatusText=function(t,e){return e.$keyChain||""}}.call(s.prototype),e.HashHandler=s,e.MultiHashHandler=a})),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],(function(t,e,n){"use strict";var i=t("../lib/oop"),r=t("../keyboard/hash_handler").MultiHashHandler,o=t("../lib/event_emitter").EventEmitter,s=function(t,e){r.call(this,e,t),this.byName=this.commands,this.setDefaultHandler("exec",(function(t){return t.command.exec(t.editor,t.args||{})}))};i.inherits(s,r),function(){i.implement(this,o),this.exec=function(t,e,n){if(Array.isArray(t)){for(var i=t.length;i--;)if(this.exec(t[i],e,n))return!0;return!1}if("string"==typeof t&&(t=this.commands[t]),!t)return!1;if(e&&e.$readOnly&&!t.readOnly)return!1;if(0!=this.$checkCommandState&&t.isAvailable&&!t.isAvailable(e))return!1;var r={editor:e,command:t,args:n};return r.returnValue=this._emit("exec",r),this._signal("afterExec",r),!1!==r.returnValue},this.toggleRecording=function(t){if(!this.$inReplay)return t&&t._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(t){this.macro.push([t.command,t.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(t){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(t);try{this.$inReplay=!0,this.macro.forEach((function(e){"string"==typeof e?this.exec(e,t):this.exec(e[0],t,e[1])}),this)}finally{this.$inReplay=!1}}},this.trimMacro=function(t){return t.map((function(t){return"string"!=typeof t[0]&&(t[0]=t[0].name),t[1]||(t=t[0]),t}))}}.call(s.prototype),e.CommandManager=s})),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],(function(t,e,n){"use strict";var i=t("../lib/lang"),r=t("../config"),o=t("../range").Range;function s(t,e){return{win:t,mac:e}}e.commands=[{name:"showSettingsMenu",bindKey:s("Ctrl-,","Command-,"),exec:function(t){r.loadModule("ace/ext/settings_menu",(function(e){e.init(t),t.showSettingsMenu()}))},readOnly:!0},{name:"goToNextError",bindKey:s("Alt-E","F4"),exec:function(t){r.loadModule("./ext/error_marker",(function(e){e.showErrorMarker(t,1)}))},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:s("Alt-Shift-E","Shift-F4"),exec:function(t){r.loadModule("./ext/error_marker",(function(e){e.showErrorMarker(t,-1)}))},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:s("Ctrl-A","Command-A"),exec:function(t){t.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:s(null,"Ctrl-L"),exec:function(t){t.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:s("Ctrl-L","Command-L"),exec:function(t,e){"number"!=typeof e||isNaN(e)||t.gotoLine(e),t.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:s("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(t){t.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:s("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(t){t.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:s("F2","F2"),exec:function(t){t.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:s("Alt-F2","Alt-F2"),exec:function(t){t.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:s("Alt-0","Command-Option-0"),exec:function(t){t.session.foldAll(),t.session.unfold(t.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:s("Alt-Shift-0","Command-Option-Shift-0"),exec:function(t){t.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:s("Ctrl-K","Command-G"),exec:function(t){t.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:s("Ctrl-Shift-K","Command-Shift-G"),exec:function(t){t.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:s("Alt-K","Ctrl-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:s("Alt-Shift-K","Ctrl-Shift-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:s("Ctrl-F","Command-F"),exec:function(t){r.loadModule("ace/ext/searchbox",(function(e){e.Search(t)}))},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(t){t.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:s("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(t){t.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:s("Ctrl-Home","Command-Home|Command-Up"),exec:function(t){t.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:s("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(t){t.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:s("Up","Up|Ctrl-P"),exec:function(t,e){t.navigateUp(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:s("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(t){t.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:s("Ctrl-End","Command-End|Command-Down"),exec:function(t){t.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:s("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(t){t.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:s("Down","Down|Ctrl-N"),exec:function(t,e){t.navigateDown(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:s("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(t){t.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:s("Ctrl-Left","Option-Left"),exec:function(t){t.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:s("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(t){t.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:s("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(t){t.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:s("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(t){t.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:s("Left","Left|Ctrl-B"),exec:function(t,e){t.navigateLeft(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:s("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(t){t.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:s("Ctrl-Right","Option-Right"),exec:function(t){t.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:s("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(t){t.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:s("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(t){t.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:s("Shift-Right","Shift-Right"),exec:function(t){t.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:s("Right","Right|Ctrl-F"),exec:function(t,e){t.navigateRight(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(t){t.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:s(null,"Option-PageDown"),exec:function(t){t.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:s("PageDown","PageDown|Ctrl-V"),exec:function(t){t.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(t){t.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:s(null,"Option-PageUp"),exec:function(t){t.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(t){t.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:s("Ctrl-Up",null),exec:function(t){t.renderer.scrollBy(0,-2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:s("Ctrl-Down",null),exec:function(t){t.renderer.scrollBy(0,2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(t){t.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(t){t.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:s("Ctrl-Alt-E","Command-Option-E"),exec:function(t){t.commands.toggleRecording(t)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:s("Ctrl-Shift-E","Command-Shift-E"),exec:function(t){t.commands.replay(t)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:s("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(t){t.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:s("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(t){t.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:s("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(t){t.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:s(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(t){},readOnly:!0},{name:"cut",description:"Cut",exec:function(t){var e=t.$copyWithEmptySelection&&t.selection.isEmpty()?t.selection.getLineRange():t.selection.getRange();t._emit("cut",e),e.isEmpty()||t.session.remove(e),t.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(t,e){t.$handlePaste(e)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:s("Ctrl-D","Command-D"),exec:function(t){t.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:s("Ctrl-Shift-D","Command-Shift-D"),exec:function(t){t.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:s("Ctrl-Alt-S","Command-Alt-S"),exec:function(t){t.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:s("Ctrl-/","Command-/"),exec:function(t){t.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:s("Ctrl-Shift-/","Command-Shift-/"),exec:function(t){t.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:s("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(t){t.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:s("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(t){t.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:s("Ctrl-H","Command-Option-F"),exec:function(t){r.loadModule("ace/ext/searchbox",(function(e){e.Search(t,!0)}))}},{name:"undo",description:"Undo",bindKey:s("Ctrl-Z","Command-Z"),exec:function(t){t.undo()}},{name:"redo",description:"Redo",bindKey:s("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(t){t.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:s("Alt-Shift-Up","Command-Option-Up"),exec:function(t){t.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:s("Alt-Up","Option-Up"),exec:function(t){t.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:s("Alt-Shift-Down","Command-Option-Down"),exec:function(t){t.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:s("Alt-Down","Option-Down"),exec:function(t){t.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:s("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(t){t.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:s("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(t){t.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:s("Shift-Delete",null),exec:function(t){if(!t.selection.isEmpty())return!1;t.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:s("Alt-Backspace","Command-Backspace"),exec:function(t){t.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:s("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(t){t.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:s("Ctrl-Shift-Backspace",null),exec:function(t){var e=t.selection.getRange();e.start.column=0,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:s("Ctrl-Shift-Delete",null),exec:function(t){var e=t.selection.getRange();e.end.column=Number.MAX_VALUE,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:s("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(t){t.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:s("Ctrl-Delete","Alt-Delete"),exec:function(t){t.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:s("Shift-Tab","Shift-Tab"),exec:function(t){t.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:s("Tab","Tab"),exec:function(t){t.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:s("Ctrl-[","Ctrl-["),exec:function(t){t.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:s("Ctrl-]","Ctrl-]"),exec:function(t){t.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(t,e){t.insert(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(t,e){t.insert(i.stringRepeat(e.text||"",e.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:s(null,"Ctrl-O"),exec:function(t){t.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:s("Alt-Shift-X","Ctrl-T"),exec:function(t){t.transposeLetters()},multiSelectAction:function(t){t.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:s("Ctrl-U","Ctrl-U"),exec:function(t){t.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:s("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(t){t.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:s(null,null),exec:function(t){t.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:s("Ctrl-Shift-L","Command-Shift-L"),exec:function(t){var e=t.selection.getRange();e.start.column=e.end.column=0,e.end.row++,t.selection.setRange(e,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:s(null,null),exec:function(t){for(var e=t.selection.isBackwards(),n=e?t.selection.getSelectionLead():t.selection.getSelectionAnchor(),r=e?t.selection.getSelectionAnchor():t.selection.getSelectionLead(),s=t.session.doc.getLine(n.row).length,a=t.session.doc.getTextRange(t.selection.getRange()).replace(/\n\s*/," ").length,l=t.session.doc.getLine(n.row),c=n.row+1;c<=r.row+1;c++){var d=i.stringTrimLeft(i.stringTrimRight(t.session.doc.getLine(c)));0!==d.length&&(d=" "+d),l+=d}r.row+10?(t.selection.moveCursorTo(n.row,n.column),t.selection.selectTo(n.row,n.column+a)):(s=t.session.doc.getLine(n.row).length>s?s+1:s,t.selection.moveCursorTo(n.row,s))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:s(null,null),exec:function(t){var e=t.session.doc.getLength()-1,n=t.session.doc.getLine(e).length,i=t.selection.rangeList.ranges,r=[];i.length<1&&(i=[t.selection.getRange()]);for(var s=0;s=r.lastRow||i.end.row<=r.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var o=this.selection.toJSON();this.curOp.selectionAfter=o,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(o),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(t){if(this.$mergeUndoDeltas){var e=this.prevOp,n=this.$mergeableCommands,i=e.command&&t.command.name==e.command.name;if("insertstring"==t.command.name){var r=t.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),i=i&&this.mergeNextCommand&&(!/\s/.test(r)||/\s/.test(e.args)),this.mergeNextCommand=!0}else i=i&&-1!==n.indexOf(t.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(i=!1),i?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(t.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(t,e){if(t&&"string"==typeof t&&"ace"!=t){this.$keybindingId=t;var n=this;v.loadModule(["keybinding",t],(function(i){n.$keybindingId==t&&n.keyBinding.setKeyboardHandler(i&&i.handler),e&&e()}))}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(t),e&&e()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(t){if(this.session!=t){this.curOp&&this.endOperation(),this.curOp={};var e=this.session;if(e){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=t,t?(this.$onDocumentChange=this.onDocumentChange.bind(this),t.on("change",this.$onDocumentChange),this.renderer.setSession(t),this.$onChangeMode=this.onChangeMode.bind(this),t.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),t.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),t.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),t.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),t.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),t.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=t.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(t)),this._signal("changeSession",{session:t,oldSession:e}),this.curOp=null,e&&e._signal("changeEditor",{oldEditor:this}),t&&t._signal("changeEditor",{editor:this}),t&&t.bgTokenizer&&t.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(t,e){return this.session.doc.setValue(t),e?1==e?this.navigateFileEnd():-1==e&&this.navigateFileStart():this.selectAll(),t},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(t){this.renderer.onResize(t)},this.setTheme=function(t,e){this.renderer.setTheme(t,e)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(t){this.renderer.setStyle(t)},this.unsetStyle=function(t){this.renderer.unsetStyle(t)},this.getFontSize=function(){return this.getOption("fontSize")||r.computedStyle(this.container).fontSize},this.setFontSize=function(t){this.setOption("fontSize",t)},this.$highlightBrackets=function(){if(!this.$highlightPending){var t=this;this.$highlightPending=!0,setTimeout((function(){t.$highlightPending=!1;var e=t.session;if(e&&e.bgTokenizer){e.$bracketHighlight&&(e.$bracketHighlight.markerIds.forEach((function(t){e.removeMarker(t)})),e.$bracketHighlight=null);var n=e.getMatchingBracketRanges(t.getCursorPosition());if(!n&&e.$mode.getMatching&&(n=e.$mode.getMatching(t.session)),n){var i="ace_bracket";Array.isArray(n)?1==n.length&&(i="ace_error_bracket"):n=[n],2==n.length&&(0==f.comparePoints(n[0].end,n[1].start)?n=[f.fromPoints(n[0].start,n[1].end)]:0==f.comparePoints(n[0].start,n[1].end)&&(n=[f.fromPoints(n[1].start,n[0].end)])),e.$bracketHighlight={ranges:n,markerIds:n.map((function(t){return e.addMarker(t,i,"text")}))}}}}),50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var t=this;this.$highlightTagPending=!0,setTimeout((function(){t.$highlightTagPending=!1;var e=t.session;if(e&&e.bgTokenizer){var n=t.getCursorPosition(),i=new y(t.session,n.row,n.column),r=i.getCurrentToken();if(!r||!/\b(?:tag-open|tag-name)/.test(r.type))return e.removeMarker(e.$tagHighlight),void(e.$tagHighlight=null);if(-1===r.type.indexOf("tag-open")||(r=i.stepForward())){var o=r.value,s=r.value,a=0,l=i.stepBackward();if("<"===l.value)do{l=r,(r=i.stepForward())&&(-1!==r.type.indexOf("tag-name")?o===(s=r.value)&&("<"===l.value?a++:""===r.value&&a--)}while(r&&a>=0);else{do{if(r=l,l=i.stepBackward(),r)if(-1!==r.type.indexOf("tag-name"))o===r.value&&("<"===l.value?a++:""===r.value){for(var c=0,d=l;d;){if(-1!==d.type.indexOf("tag-name")&&d.value===o){a--;break}if("<"===d.value)break;d=i.stepBackward(),c++}for(var h=0;h1||(t=!1)),e.$highlightLineMarker&&!t)e.removeMarker(e.$highlightLineMarker.id),e.$highlightLineMarker=null;else if(!e.$highlightLineMarker&&t){var n=new f(t.row,t.column,t.row,1/0);n.id=e.addMarker(n,"ace_active-line","screenLine"),e.$highlightLineMarker=n}else t&&(e.$highlightLineMarker.start.row=t.row,e.$highlightLineMarker.end.row=t.row,e.$highlightLineMarker.start.column=t.column,e._signal("changeBackMarker"))},this.onSelectionChange=function(t){var e=this.session;if(e.$selectionMarker&&e.removeMarker(e.$selectionMarker),e.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),i=this.getSelectionStyle();e.$selectionMarker=e.addMarker(n,"ace_selection",i)}var r=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(r),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var t=this.session,e=this.getSelectionRange();if(!e.isEmpty()&&!e.isMultiLine()){var n=e.start.column,i=e.end.column,r=t.getLine(e.start.row),o=r.substring(n,i);if(!(o.length>5e3)&&/[\w\d]/.test(o)){var s=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:o}),a=r.substring(n-1,i+1);if(s.test(a))return s}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(t){this.renderer.updateText(),this._emit("changeMode",t)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var t=this.getSelectedText(),e=this.session.doc.getNewLineCharacter(),n=!1;if(!t&&this.$copyWithEmptySelection){n=!0;for(var i=this.selection.getAllRanges(),r=0;ra.search(/\S|$/)){var l=a.substr(r.column).search(/\S|$/);n.doc.removeInLine(r.row,r.column,r.column+l)}}this.clearSelection();var c=r.column,d=n.getState(r.row),h=(a=n.getLine(r.row),i.checkOutdent(d,a,t));if(n.insert(r,t),o&&o.selection&&(2==o.selection.length?this.selection.setSelectionRange(new f(r.row,c+o.selection[0],r.row,c+o.selection[1])):this.selection.setSelectionRange(new f(r.row+o.selection[0],o.selection[1],r.row+o.selection[2],o.selection[3]))),this.$enableAutoIndent){if(n.getDocument().isNewLine(t)){var u=i.getNextLineIndent(d,a.slice(0,r.column),n.getTabString());n.insert({row:r.row+1,column:0},u)}h&&i.autoOutdent(d,n,r.row)}},this.autoIndent=function(){var t,e,n=this.session,i=n.getMode();if(this.selection.isEmpty())t=0,e=n.doc.getLength()-1;else{var r=this.getSelectionRange();t=r.start.row,e=r.end.row}for(var o,s,a,l="",c="",d="",h=n.getTabString(),u=t;u<=e;u++)u>0&&(l=n.getState(u-1),c=n.getLine(u-1),d=i.getNextLineIndent(l,c,h)),o=n.getLine(u),d!==(s=i.$getIndent(o))&&(s.length>0&&(a=new f(u,0,u,s.length),n.remove(a)),d.length>0&&n.insert({row:u,column:0},d)),i.autoOutdent(l,n,u)},this.onTextInput=function(t,e){if(!e)return this.keyBinding.onTextInput(t);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,t,e);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(t,e){var n;(e.extendLeft||e.extendRight)&&((n=this.selection.getRange()).start.column-=e.extendLeft,n.end.column+=e.extendRight,n.start.column<0&&(n.start.row--,n.start.column+=this.session.getLine(n.start.row).length+1),this.selection.setRange(n),t||n.isEmpty()||this.remove());(!t&&this.selection.isEmpty()||this.insert(t,!0),e.restoreStart||e.restoreEnd)&&((n=this.selection.getRange()).start.column-=e.restoreStart,n.end.column-=e.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(t,e,n){return this.keyBinding.onCommandKey(t,e,n)},this.setOverwrite=function(t){this.session.setOverwrite(t)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(t){this.setOption("scrollSpeed",t)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(t){this.setOption("dragDelay",t)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(t){this.setOption("selectionStyle",t)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(t){this.setOption("highlightActiveLine",t)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(t){this.setOption("highlightGutterLine",t)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(t){this.setOption("highlightSelectedWord",t)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(t){this.renderer.setAnimatedScroll(t)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(t){this.renderer.setShowInvisibles(t)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(t){this.renderer.setDisplayIndentGuides(t)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(t){this.renderer.setShowPrintMargin(t)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(t){this.renderer.setPrintMarginColumn(t)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(t){this.setOption("readOnly",t)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(t){this.setOption("behavioursEnabled",t)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(t){this.setOption("wrapBehavioursEnabled",t)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(t){this.setOption("showFoldWidgets",t)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(t){this.setOption("fadeFoldWidgets",t)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(t){this.selection.isEmpty()&&("left"==t?this.selection.selectLeft():this.selection.selectRight());var e=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,i=n.getState(e.start.row),r=n.getMode().transformAction(i,"deletion",this,n,e);if(0===e.end.column){var o=n.getTextRange(e);if("\n"==o[o.length-1]){var s=n.getLine(e.end.row);/^\s+$/.test(s)&&(e.end.column=s.length)}}r&&(e=r)}this.session.remove(e),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var t=this.getSelectionRange();t.start.column==t.end.column&&t.start.row==t.end.row&&(t.end.column=0,t.end.row++),this.session.remove(t),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var t=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(t)},this.transposeLetters=function(){if(this.selection.isEmpty()){var t=this.getCursorPosition(),e=t.column;if(0!==e){var n,i,r=this.session.getLine(t.row);ee.toLowerCase()?1:0}));var r=new f(0,0,0,0);for(i=t.first;i<=t.last;i++){var o=e.getLine(i);r.start.row=i,r.end.row=i,r.end.column=o.length,e.replace(r,n[i-t.first])}},this.toggleCommentLines=function(){var t=this.session.getState(this.getCursorPosition().row),e=this.$getSelectedRows();this.session.getMode().toggleCommentLines(t,this.session,e.first,e.last)},this.toggleBlockComment=function(){var t=this.getCursorPosition(),e=this.session.getState(t.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(e,this.session,n,t)},this.getNumberAt=function(t,e){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var i=this.session.getLine(t);n.lastIndex=e)return{value:r[0],start:r.index,end:r.index+r[0].length}}return null},this.modifyNumber=function(t){var e=this.selection.getCursor().row,n=this.selection.getCursor().column,i=new f(e,n-1,e,n),r=this.session.getTextRange(i);if(!isNaN(parseFloat(r))&&isFinite(r)){var o=this.getNumberAt(e,n);if(o){var s=o.value.indexOf(".")>=0?o.start+o.value.indexOf(".")+1:o.end,a=o.start+o.value.length-s,l=parseFloat(o.value);l*=Math.pow(10,a),s!==o.end&&n=a&&s<=l&&(n=e,c.selection.clearSelection(),c.moveCursorTo(t,a+i),c.selection.selectTo(t,l+i)),a=l}));for(var d,h=this.$toggleWordPairs,u=0;uf+1)break;f=p.last}for(d--,a=this.session.$moveLines(u,f,e?0:t),e&&-1==t&&(h=d+1);h<=d;)s[h].moveBy(a,0),h++;e||(a=0),l+=a}r.fromOrientedRange(r.ranges[0]),r.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(t){return t=(t||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(t.start.row),last:this.session.getRowFoldEnd(t.end.row)}},this.onCompositionStart=function(t){this.renderer.showComposition(t)},this.onCompositionUpdate=function(t){this.renderer.setCompositionText(t)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(t){return t>=this.getFirstVisibleRow()&&t<=this.getLastVisibleRow()},this.isRowFullyVisible=function(t){return t>=this.renderer.getFirstFullyVisibleRow()&&t<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(t,e){var n=this.renderer,i=this.renderer.layerConfig,r=t*Math.floor(i.height/i.lineHeight);!0===e?this.selection.$moveSelection((function(){this.moveCursorBy(r,0)})):!1===e&&(this.selection.moveCursorBy(r,0),this.selection.clearSelection());var o=n.scrollTop;n.scrollBy(0,r*i.lineHeight),null!=e&&n.scrollCursorIntoView(null,.5),n.animateScrolling(o)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(t){this.renderer.scrollToRow(t)},this.scrollToLine=function(t,e,n,i){this.renderer.scrollToLine(t,e,n,i)},this.centerSelection=function(){var t=this.getSelectionRange(),e={row:Math.floor(t.start.row+(t.end.row-t.start.row)/2),column:Math.floor(t.start.column+(t.end.column-t.start.column)/2)};this.renderer.alignCursor(e,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(t,e){this.selection.moveCursorTo(t,e)},this.moveCursorToPosition=function(t){this.selection.moveCursorToPosition(t)},this.jumpToMatching=function(t,e){var n=this.getCursorPosition(),i=new y(this.session,n.row,n.column),r=i.getCurrentToken(),o=r||i.stepForward();if(o){var s,a,l=!1,c={},d=n.column-o.start,h={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(o.value.match(/[{}()\[\]]/g)){for(;d=0;--o)this.$tryReplace(n[o],t)&&i++;return this.selection.setSelectionRange(r),i},this.$tryReplace=function(t,e){var n=this.session.getTextRange(t);return null!==(e=this.$search.replace(n,e))?(t.end=this.session.replace(t,e),t):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(t,e,n){e||(e={}),"string"==typeof t||t instanceof RegExp?e.needle=t:"object"==typeof t&&i.mixin(e,t);var r=this.selection.getRange();null==e.needle&&((t=this.session.getTextRange(r)||this.$search.$options.needle)||(r=this.session.getWordRange(r.start.row,r.start.column),t=this.session.getTextRange(r)),this.$search.set({needle:t})),this.$search.set(e),e.start||this.$search.set({start:r});var o=this.$search.find(this.session);return e.preventScroll?o:o?(this.revealRange(o,n),o):(e.backwards?r.start=r.end:r.end=r.start,void this.selection.setRange(r))},this.findNext=function(t,e){this.find({skipCurrent:!0,backwards:!1},t,e)},this.findPrevious=function(t,e){this.find(t,{skipCurrent:!0,backwards:!0},e)},this.revealRange=function(t,e){this.session.unfold(t),this.selection.setSelectionRange(t);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(t.start,t.end,.5),!1!==e&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach((function(t){t.destroy()})),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},this.setAutoScrollEditorIntoView=function(t){if(t){var e,n=this,i=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var r=this.$scrollAnchor;r.style.cssText="position:absolute",this.container.insertBefore(r,this.container.firstChild);var o=this.on("changeSelection",(function(){i=!0})),s=this.renderer.on("beforeRender",(function(){i&&(e=n.renderer.container.getBoundingClientRect())})),a=this.renderer.on("afterRender",(function(){if(i&&e&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var t=n.renderer,o=t.$cursorLayer.$pixelPos,s=t.layerConfig,a=o.top-s.offset;null!=(i=o.top>=0&&a+e.top<0||!(o.topwindow.innerHeight)&&null)&&(r.style.top=a+"px",r.style.left=o.left+"px",r.style.height=s.lineHeight+"px",r.scrollIntoView(i)),i=e=null}}));this.setAutoScrollEditorIntoView=function(t){t||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",o),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",s))}}},this.$resetCursorStyle=function(){var t=this.$cursorStyle||"ace",e=this.renderer.$cursorLayer;e&&(e.setSmoothBlinking(/smooth/.test(t)),e.isBlinking=!this.$readOnly&&"wide"!=t,r.setCssClass(e.element,"ace_slim-cursors",/slim/.test(t)))},this.prompt=function(t,e,n){var i=this;v.loadModule("./ext/prompt",(function(r){r.prompt(i,t,e,n)}))}}.call(b.prototype),v.defineOptions(b.prototype,"editor",{selectionStyle:{set:function(t){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:t})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(t){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(t){this.textInput.setReadOnly(t),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(t){this.textInput.setCopyWithEmptySelection(t)},initialValue:!1},cursorStyle:{set:function(t){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(t){this.setAutoScrollEditorIntoView(t)}},keyboardHandler:{set:function(t){this.setKeyboardHandler(t)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(t){this.session.setValue(t)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(t){this.setSession(t)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(t){this.renderer.$gutterLayer.setShowLineNumbers(t),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),t&&this.$relativeLineNumbers?w.attach(this):w.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(t){this.$showLineNumbers&&t?w.attach(this):w.detach(this)}},placeholder:{set:function(t){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var t=this.session&&(this.renderer.$composition||this.getValue());if(t&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),r.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(t||this.renderer.placeholderNode)!t&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"");else{this.renderer.on("afterRender",this.$updatePlaceholder),r.addCssClass(this.container,"ace_hasPlaceholder");var e=r.createElement("div");e.className="ace_placeholder",e.textContent=this.$placeholder||"",this.renderer.placeholderNode=e,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var w={getText:function(t,e){return(Math.abs(t.selection.lead.row-e)||e+1+(e<9?"·":""))+""},getWidth:function(t,e,n){return Math.max(e.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(t,e){e.renderer.$loop.schedule(e.renderer.CHANGE_GUTTER)},attach:function(t){t.renderer.$gutterLayer.$renderer=this,t.on("changeSelection",this.update),this.update(null,t)},detach:function(t){t.renderer.$gutterLayer.$renderer==this&&(t.renderer.$gutterLayer.$renderer=null),t.off("changeSelection",this.update),this.update(null,t)}};e.Editor=b})),ace.define("ace/undomanager",["require","exports","module","ace/range"],(function(t,e,n){"use strict";var i=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(t){this.$session=t},this.add=function(t,e,n){this.$fromUndo||t!=this.$lastDelta&&(this.$keepRedoStack||(this.$redoStack.length=0),!1!==e&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),t.id=this.$rev=++this.$maxRev),"remove"!=t.action&&"insert"!=t.action||(this.$lastDelta=t),this.lastDeltas.push(t))},this.addSelection=function(t,e){this.selections.push({value:t,rev:e||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(t,e){null==e&&(e=this.$rev+1);for(var n=this.$undoStack,i=n.length;i--;){var r=n[i][0];if(r.id<=t)break;r.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(t){null==t&&(t=this.$rev),this.mark=t},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(t){return t?a(t):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(i.prototype);var r=t("./range").Range,o=r.comparePoints;r.comparePoints;function s(t){return{row:t.row,column:t.column}}function a(t){if(t=t||this,Array.isArray(t))return t.map(a).join("\n");var e="";return t.action?(e="insert"==t.action?"+":"-",e+="["+t.lines+"]"):t.value&&(e=Array.isArray(t.value)?t.value.map(l).join("\n"):l(t.value)),t.start&&(e+=l(t)),(t.id||t.rev)&&(e+="\t("+(t.id||t.rev)+")"),e}function l(t){return t.start.row+":"+t.start.column+"=>"+t.end.row+":"+t.end.column}function c(t,e){var n="insert"==t.action,i="insert"==e.action;if(n&&i)if(o(e.start,t.end)>=0)u(e,t,-1);else{if(!(o(e.start,t.start)<=0))return null;u(t,e,1)}else if(n&&!i)if(o(e.start,t.end)>=0)u(e,t,-1);else{if(!(o(e.end,t.start)<=0))return null;u(t,e,-1)}else if(!n&&i)if(o(e.start,t.start)>=0)u(e,t,1);else{if(!(o(e.start,t.start)<=0))return null;u(t,e,1)}else if(!n&&!i)if(o(e.start,t.start)>=0)u(e,t,1);else{if(!(o(e.end,t.start)<=0))return null;u(t,e,-1)}return[e,t]}function d(t,e){for(var n=t.length;n--;)for(var i=0;i=0?u(t,e,-1):(o(t.start,e.start)<=0||u(t,r.fromPoints(e.start,t.start),-1),u(e,t,1));else if(!n&&i)o(e.start,t.end)>=0?u(e,t,-1):(o(e.start,t.start)<=0||u(e,r.fromPoints(t.start,e.start),-1),u(t,e,1));else if(!n&&!i)if(o(e.start,t.end)>=0)u(e,t,-1);else{var s,a;if(!(o(e.end,t.start)<=0))return o(t.start,e.start)<0&&(s=t,t=p(t,e.start)),o(t.end,e.end)>0&&(a=p(t,e.end)),f(e.end,t.start,t.end,-1),a&&!s&&(t.lines=a.lines,t.start=a.start,t.end=a.end,a=t),[e,s,a].filter(Boolean);u(t,e,-1)}return[e,t]}function u(t,e,n){f(t.start,e.start,e.end,n),f(t.end,e.start,e.end,n)}function f(t,e,n,i){t.row==(1==i?e:n).row&&(t.column+=i*(n.column-e.column)),t.row+=i*(n.row-e.row)}function p(t,e){var n=t.lines,i=t.end;t.end=s(e);var r=t.end.row-t.start.row,o=n.splice(r,n.length),a=r?e.column:e.column-t.start.column;return n.push(o[0].substring(0,a)),o[0]=o[0].substr(a),{start:s(e),end:i,lines:o,action:t.action}}function m(t,e){e=function(t){return{start:s(t.start),end:s(t.end),action:t.action,lines:t.lines.slice()}}(e);for(var n=t.length;n--;){for(var i=t[n],r=0;ro&&(l=r.end.row+1,o=(r=e.getNextFoldLine(l,r))?r.start.row:1/0),l>i){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(s=this.$lines.get(++a))?s.row=l:(s=this.$lines.createCell(l,t,this.session,c),this.$lines.push(s)),this.$renderCell(s,t,r,l),l++}this._signal("afterRender"),this.$updateGutterWidth(t)},this.$updateGutterWidth=function(t){var e=this.session,n=e.gutterRenderer||this.$renderer,i=e.$firstLineNumber,r=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||e.$useWrapMode)&&(r=e.getLength()+i-1);var o=n?n.getWidth(e,r,t):r.toString().length*t.characterWidth,s=this.$padding||this.$computePadding();(o+=s.left+s.right)===this.gutterWidth||isNaN(o)||(this.gutterWidth=o,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",o))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var t=this.session.selection.getCursor();this.$cursorRow!==t.row&&(this.$cursorRow=t.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var t=this.session.selection.cursor.row;if(this.$cursorRow=t,!this.$cursorCell||this.$cursorCell.row!=t){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var e=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(i.row>this.$cursorRow){var r=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&r&&r.start.row==e[n-1].row))break;i=e[n-1]}i.element.className="ace_gutter-active-line "+i.element.className,this.$cursorCell=i;break}}}}},this.scrollLines=function(t){var e=this.config;if(this.config=t,this.$updateCursorRow(),this.$lines.pageChanged(e,t))return this.update(t);this.$lines.moveContainer(t);var n=Math.min(t.lastRow+t.gutterOffset,this.session.getLength()-1),i=this.oldLastRow;if(this.oldLastRow=n,!e||i0;r--)this.$lines.shift();if(i>n)for(r=this.session.getFoldedRowCount(n+1,i);r>0;r--)this.$lines.pop();t.firstRowi&&this.$lines.push(this.$renderLines(t,i+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(t)},this.$renderLines=function(t,e,n){for(var i=[],r=e,o=this.session.getNextFoldLine(r),s=o?o.start.row:1/0;r>s&&(r=o.end.row+1,s=(o=this.session.getNextFoldLine(r,o))?o.start.row:1/0),!(r>n);){var a=this.$lines.createCell(r,t,this.session,c);this.$renderCell(a,t,o,r),i.push(a),r++}return i},this.$renderCell=function(t,e,n,r){var o=t.element,s=this.session,a=o.childNodes[0],l=o.childNodes[1],c=s.$firstLineNumber,d=s.$breakpoints,h=s.$decorations,u=s.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&s.foldWidgets,p=n?n.start.row:Number.MAX_VALUE,m="ace_gutter-cell ";if(this.$highlightGutterLine&&(r==this.$cursorRow||n&&r=p&&this.$cursorRow<=n.end.row)&&(m+="ace_gutter-active-line ",this.$cursorCell!=t&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=t)),d[r]&&(m+=d[r]),h[r]&&(m+=h[r]),this.$annotations[r]&&(m+=this.$annotations[r].className),o.className!=m&&(o.className=m),f){var g=f[r];null==g&&(g=f[r]=s.getFoldWidget(r))}if(g){m="ace_fold-widget ace_"+g;"start"==g&&r==p&&rn.right-e.right?"foldWidgets":void 0}}).call(l.prototype),e.Gutter=l})),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],(function(t,e,n){"use strict";var i=t("../range").Range,r=t("../lib/dom"),o=function(t){this.element=r.createElement("div"),this.element.className="ace_layer ace_marker-layer",t.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(t){this.$padding=t},this.setSession=function(t){this.session=t},this.setMarkers=function(t){this.markers=t},this.elt=function(t,e){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=e,n.className=t},this.update=function(t){if(t){var e;for(var n in this.config=t,this.i=0,this.markers){var i=this.markers[n];if(i.range){var r=i.range.clipRows(t.firstRow,t.lastRow);if(!r.isEmpty())if(r=r.toScreenRange(this.session),i.renderer){var o=this.$getTop(r.start.row,t),s=this.$padding+r.start.column*t.characterWidth;i.renderer(e,r,s,o,t)}else"fullLine"==i.type?this.drawFullLineMarker(e,r,i.clazz,t):"screenLine"==i.type?this.drawScreenLineMarker(e,r,i.clazz,t):r.isMultiLine()?"text"==i.type?this.drawTextMarker(e,r,i.clazz,t):this.drawMultiLineMarker(e,r,i.clazz,t):this.drawSingleLineMarker(e,r,i.clazz+" ace_start ace_br15",t)}else i.update(e,this,this.session,t)}if(-1!=this.i)for(;this.iu?4:0)|(c==l?8:0)),r,c==l?0:1,o)},this.drawMultiLineMarker=function(t,e,n,i,r){var o=this.$padding,s=i.lineHeight,a=this.$getTop(e.start.row,i),l=o+e.start.column*i.characterWidth;(r=r||"",this.session.$bidiHandler.isBidiRow(e.start.row))?((c=e.clone()).end.row=c.start.row,c.end.column=this.session.getLine(c.start.row).length,this.drawBidiSingleLineMarker(t,c,n+" ace_br1 ace_start",i,null,r)):this.elt(n+" ace_br1 ace_start","height:"+s+"px;right:0;top:"+a+"px;left:"+l+"px;"+(r||""));if(this.session.$bidiHandler.isBidiRow(e.end.row)){var c;(c=e.clone()).start.row=c.end.row,c.start.column=0,this.drawBidiSingleLineMarker(t,c,n+" ace_br12",i,null,r)}else{a=this.$getTop(e.end.row,i);var d=e.end.column*i.characterWidth;this.elt(n+" ace_br12","height:"+s+"px;width:"+d+"px;top:"+a+"px;left:"+o+"px;"+(r||""))}if(!((s=(e.end.row-e.start.row-1)*i.lineHeight)<=0)){a=this.$getTop(e.start.row+1,i);var h=(e.start.column?1:0)|(e.end.column?0:8);this.elt(n+(h?" ace_br"+h:""),"height:"+s+"px;right:0;top:"+a+"px;left:"+o+"px;"+(r||""))}},this.drawSingleLineMarker=function(t,e,n,i,r,o){if(this.session.$bidiHandler.isBidiRow(e.start.row))return this.drawBidiSingleLineMarker(t,e,n,i,r,o);var s=i.lineHeight,a=(e.end.column+(r||0)-e.start.column)*i.characterWidth,l=this.$getTop(e.start.row,i),c=this.$padding+e.start.column*i.characterWidth;this.elt(n,"height:"+s+"px;width:"+a+"px;top:"+l+"px;left:"+c+"px;"+(o||""))},this.drawBidiSingleLineMarker=function(t,e,n,i,r,o){var s=i.lineHeight,a=this.$getTop(e.start.row,i),l=this.$padding;this.session.$bidiHandler.getSelections(e.start.column,e.end.column).forEach((function(t){this.elt(n,"height:"+s+"px;width:"+t.width+(r||0)+"px;top:"+a+"px;left:"+(l+t.left)+"px;"+(o||""))}),this)},this.drawFullLineMarker=function(t,e,n,i,r){var o=this.$getTop(e.start.row,i),s=i.lineHeight;e.start.row!=e.end.row&&(s+=this.$getTop(e.end.row,i)-o),this.elt(n,"height:"+s+"px;top:"+o+"px;left:0;right:0;"+(r||""))},this.drawScreenLineMarker=function(t,e,n,i,r){var o=this.$getTop(e.start.row,i),s=i.lineHeight;this.elt(n,"height:"+s+"px;top:"+o+"px;left:0;right:0;"+(r||""))}}).call(o.prototype),e.Marker=o})),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],(function(t,e,n){"use strict";var i=t("../lib/oop"),r=t("../lib/dom"),o=t("../lib/lang"),s=t("./lines").Lines,a=t("../lib/event_emitter").EventEmitter,l=function(t){this.dom=r,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",t.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new s(this.element)};(function(){i.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var t=this.session.doc,e="\n"==t.getNewLineCharacter()&&"windows"!=t.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=e)return this.EOL_CHAR=e,!0},this.setPadding=function(t){this.$padding=t,this.element.style.margin="0 "+t+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(t){this.$fontMetrics=t,this.$fontMetrics.on("changeCharacterSize",function(t){this._signal("changeCharacterSize",t)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(t){this.session=t,t&&this.$computeTabString()},this.showInvisibles=!1,this.showSpaces=!1,this.showTabs=!1,this.showEOL=!1,this.setShowInvisibles=function(t){return this.showInvisibles!=t&&(this.showInvisibles=t,"string"==typeof t?(this.showSpaces=/tab/i.test(t),this.showTabs=/space/i.test(t),this.showEOL=/eol/i.test(t)):this.showSpaces=this.showTabs=this.showEOL=t,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(t){return this.displayIndentGuides!=t&&(this.displayIndentGuides=t,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var t=this.session.getTabSize();this.tabSize=t;for(var e=this.$tabStrings=[0],n=1;nd&&(a=l.end.row+1,d=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>r);){var h=o[s++];if(h){this.dom.removeChildren(h),this.$renderLine(h,a,a==d&&l),c&&(h.style.top=this.$lines.computeLineTop(a,t,this.session)+"px");var u=t.lineHeight*this.session.getRowLength(a)+"px";h.style.height!=u&&(c=!0,h.style.height=u)}a++}if(c)for(;s0;r--)this.$lines.shift();if(e.lastRow>t.lastRow)for(r=this.session.getFoldedRowCount(t.lastRow+1,e.lastRow);r>0;r--)this.$lines.pop();t.firstRowe.lastRow&&this.$lines.push(this.$renderLinesFragment(t,e.lastRow+1,t.lastRow))},this.$renderLinesFragment=function(t,e,n){for(var i=[],o=e,s=this.session.getNextFoldLine(o),a=s?s.start.row:1/0;o>a&&(o=s.end.row+1,a=(s=this.session.getNextFoldLine(o,s))?s.start.row:1/0),!(o>n);){var l=this.$lines.createCell(o,t,this.session),c=l.element;this.dom.removeChildren(c),r.setStyle(c.style,"height",this.$lines.computeLineHeight(o,t,this.session)+"px"),r.setStyle(c.style,"top",this.$lines.computeLineTop(o,t,this.session)+"px"),this.$renderLine(c,o,o==a&&s),this.$useLineGroups()?c.className="ace_line_group":c.className="ace_line",i.push(l),o++}return i},this.update=function(t){this.$lines.moveContainer(t),this.config=t;for(var e=t.firstRow,n=t.lastRow,i=this.$lines;i.getLength();)i.pop();i.push(this.$renderLinesFragment(t,e,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(t,e,n,i){for(var r,s=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),c=0;r=a.exec(i);){var d=r[1],h=r[2],u=r[3],f=r[4],p=r[5];if(s.showSpaces||!h){var m=c!=r.index?i.slice(c,r.index):"";if(c=r.index+r[0].length,m&&l.appendChild(this.dom.createTextNode(m,this.element)),d){var g=s.session.getScreenTabSize(e+r.index);l.appendChild(s.$tabStrings[g].cloneNode(!0)),e+=g-1}else if(h){if(s.showSpaces)(y=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",y.textContent=o.stringRepeat(s.SPACE_CHAR,h.length),l.appendChild(y);else l.appendChild(this.com.createTextNode(h,this.element))}else if(u){(y=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",y.textContent=o.stringRepeat(s.SPACE_CHAR,u.length),l.appendChild(y)}else if(f){e+=1,(y=this.dom.createElement("span")).style.width=2*s.config.characterWidth+"px",y.className=s.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",y.textContent=s.showSpaces?s.SPACE_CHAR:f,l.appendChild(y)}else if(p){e+=1,(y=this.dom.createElement("span")).style.width=2*s.config.characterWidth+"px",y.className="ace_cjk",y.textContent=p,l.appendChild(y)}}}if(l.appendChild(this.dom.createTextNode(c?i.slice(c):i,this.element)),this.$textToken[n.type])t.appendChild(l);else{var v="ace_"+n.type.replace(/\./g," ace_"),y=this.dom.createElement("span");"fold"==n.type&&(y.style.width=n.value.length*this.config.characterWidth+"px"),y.className=v,y.appendChild(l),t.appendChild(y)}return e+i.length},this.renderIndentGuide=function(t,e,n){var i=e.search(this.$indentGuideRe);if(i<=0||i>=n)return e;if(" "==e[0]){for(var r=(i-=i%this.tabSize)/this.tabSize,o=0;o=s;)a=this.$renderToken(l,a,d,h.substring(0,s-i)),h=h.substring(s-i),i=s,l=this.$createLineElement(),t.appendChild(l),l.appendChild(this.dom.createTextNode(o.stringRepeat(" ",n.indent),this.element)),a=0,s=n[++r]||Number.MAX_VALUE;0!=h.length&&(i+=h.length,a=this.$renderToken(l,a,d,h))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},this.$renderSimpleLine=function(t,e){var n=0,i=e[0],r=i.value;this.displayIndentGuides&&(r=this.renderIndentGuide(t,r)),r&&(n=this.$renderToken(t,n,i,r));for(var o=1;othis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(t,n,i,r);n=this.$renderToken(t,n,i,r)}},this.$renderOverflowMessage=function(t,e,n,i,r){n&&this.$renderToken(t,e,n,i.slice(0,this.MAX_LINE_LENGTH-e));var o=this.dom.createElement("span");o.className="ace_inline_button ace_keyword ace_toggle_wrap",o.textContent=r?"":"",t.appendChild(o)},this.$renderLine=function(t,e,n){if(n||0==n||(n=this.session.getFoldLine(e)),n)var i=this.$getFoldLineTokens(e,n);else i=this.session.getTokens(e);var r=t;if(i.length){var o=this.session.getRowSplitData(e);if(o&&o.length){this.$renderWrappedLine(t,i,o);r=t.lastChild}else{r=t;this.$useLineGroups()&&(r=this.$createLineElement(),t.appendChild(r)),this.$renderSimpleLine(r,i)}}else this.$useLineGroups()&&(r=this.$createLineElement(),t.appendChild(r));if(this.showEOL&&r){n&&(e=n.end.row);var s=this.dom.createElement("span");s.className="ace_invisible ace_invisible_eol",s.textContent=e==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,r.appendChild(s)}},this.$getFoldLineTokens=function(t,e){var n=this.session,i=[];var r=n.getTokens(t);return e.walk((function(t,e,o,s,a){null!=t?i.push({type:"fold",value:t}):(a&&(r=n.getTokens(e)),r.length&&function(t,e,n){for(var r=0,o=0;o+t[r].value.lengthn-e&&(s=s.substring(0,n-e)),i.push({type:t[r].type,value:s}),o=e+s.length,r+=1);on?i.push({type:t[r].type,value:s.substring(0,n-o)}):i.push(t[r]),o+=s.length,r+=1}}(r,s,o))}),e.end.row,this.session.getLine(e.end.row).length),i},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),e.Text=l})),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],(function(t,e,n){"use strict";var i=t("../lib/dom"),r=function(t){this.element=i.createElement("div"),this.element.className="ace_layer ace_cursor-layer",t.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),i.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(t){for(var e=this.cursors,n=e.length;n--;)i.setStyle(e[n].style,"opacity",t?"":"0")},this.$startCssAnimation=function(){for(var t=this.cursors,e=t.length;e--;)t[e].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){i.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){i.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(t){this.$padding=t},this.setSession=function(t){this.session=t},this.setBlinking=function(t){t!=this.isBlinking&&(this.isBlinking=t,this.restartTimer())},this.setBlinkInterval=function(t){t!=this.blinkInterval&&(this.blinkInterval=t,this.restartTimer())},this.setSmoothBlinking=function(t){t!=this.smoothBlinking&&(this.smoothBlinking=t,i.setCssClass(this.element,"ace_smooth-blinking",t),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var t=i.createElement("div");return t.className="ace_cursor",this.element.appendChild(t),this.cursors.push(t),t},this.removeCursor=function(){if(this.cursors.length>1){var t=this.cursors.pop();return t.parentNode.removeChild(t),t}},this.hideCursor=function(){this.isVisible=!1,i.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,i.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var t=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&i.removeCssClass(this.element,"ace_smooth-blinking"),t(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){i.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),i.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var e=function(){this.timeoutId=setTimeout((function(){t(!1)}),.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval((function(){t(!0),e()}),this.blinkInterval),e()}else this.$stopCssAnimation()},this.getPixelPosition=function(t,e){if(!this.config||!this.session)return{left:0,top:0};t||(t=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(t);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,t.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(e?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(t,e){return t.top>=0&&t.topt.height+t.offset||s.top<0)&&n>1)){var a=this.cursors[r++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,s,t,e[n],this.session):this.isCursorInView(s,t)?(i.setStyle(l,"display","block"),i.translate(a,s.left,s.top),i.setStyle(l,"width",Math.round(t.characterWidth)+"px"),i.setStyle(l,"height",t.lineHeight+"px")):i.setStyle(l,"display","none")}}for(;this.cursors.length>r;)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c),this.$pixelPos=s,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(t){t!=this.overwrite&&(this.overwrite=t,t?i.addCssClass(this.element,"ace_overwrite-cursors"):i.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(r.prototype),e.Cursor=r})),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./lib/dom"),o=t("./lib/event"),s=t("./lib/event_emitter").EventEmitter,a=32768,l=function(t){this.element=r.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=r.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),t.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addListener(this.element,"scroll",this.onScroll.bind(this)),o.addListener(this.element,"mousedown",o.preventDefault)};(function(){i.implement(this,s),this.setVisible=function(t){this.element.style.display=t?"":"none",this.isVisible=t,this.coeff=1}}).call(l.prototype);var c=function(t,e){l.call(this,t),this.scrollTop=0,this.scrollHeight=0,e.$scrollbarWidth=this.width=r.scrollbarWidth(t.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};i.inherits(c,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var t=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-t)/(this.coeff-t)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(t){this.element.style.height=t+"px"},this.setInnerHeight=this.setScrollHeight=function(t){this.scrollHeight=t,t>a?(this.coeff=a/t,t=a):1!=this.coeff&&(this.coeff=1),this.inner.style.height=t+"px"},this.setScrollTop=function(t){this.scrollTop!=t&&(this.skipEvent=!0,this.scrollTop=t,this.element.scrollTop=t*this.coeff)}}.call(c.prototype);var d=function(t,e){l.call(this,t),this.scrollLeft=0,this.height=e.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};i.inherits(d,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(t){this.element.style.width=t+"px"},this.setInnerWidth=function(t){this.inner.style.width=t+"px"},this.setScrollWidth=function(t){this.inner.style.width=t+"px"},this.setScrollLeft=function(t){this.scrollLeft!=t&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=t)}}.call(d.prototype),e.ScrollBar=c,e.ScrollBarV=c,e.ScrollBarH=d,e.VScrollBar=c,e.HScrollBar=d})),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],(function(t,e,n){"use strict";var i=t("./lib/event"),r=function(t,e){this.onRender=t,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=e||window;var n=this;this._flush=function(t){n.pending=!1;var e=n.changes;if(e&&(i.blockIdle(100),n.changes=0,n.onRender(e)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(t){this.changes=this.changes|t,this.changes&&!this.pending&&(i.nextFrame(this._flush),this.pending=!0)},this.clear=function(t){var e=this.changes;return this.changes=0,e}}).call(r.prototype),e.RenderLoop=r})),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],(function(t,e,n){var i=t("../lib/oop"),r=t("../lib/dom"),o=t("../lib/lang"),s=t("../lib/event"),a=t("../lib/useragent"),l=t("../lib/event_emitter").EventEmitter,c=256,d="function"==typeof ResizeObserver,h=200,u=e.FontMetrics=function(t){this.el=r.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=r.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=r.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),t.appendChild(this.el),this.$measureNode.textContent=o.stringRepeat("X",c),this.$characterSize={width:0,height:0},d?this.$addObserver():this.checkForSizeChanges()};(function(){i.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(t,e){t.width=t.height="auto",t.left=t.top="0px",t.visibility="hidden",t.position="absolute",t.whiteSpace="pre",a.isIE<8?t["font-family"]="inherit":t.font="inherit",t.overflow=e?"hidden":"visible"},this.checkForSizeChanges=function(t){if(void 0===t&&(t=this.$measureSizes()),t&&(this.$characterSize.width!==t.width||this.$characterSize.height!==t.height)){this.$measureNode.style.fontWeight="bold";var e=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=t,this.charSizes=Object.create(null),this.allowBoldFonts=e&&e.width===t.width&&e.height===t.height,this._emit("changeCharacterSize",{data:t})}},this.$addObserver=function(){var t=this;this.$observer=new window.ResizeObserver((function(e){t.checkForSizeChanges()})),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var t=this;return this.$pollSizeChangesTimer=s.onIdle((function e(){t.checkForSizeChanges(),s.onIdle(e,500)}),500)},this.setPolling=function(t){t?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(t){var e={height:(t||this.$measureNode).clientHeight,width:(t||this.$measureNode).clientWidth/c};return 0===e.width||0===e.height?null:e},this.$measureCharWidth=function(t){return this.$main.textContent=o.stringRepeat(t,c),this.$main.getBoundingClientRect().width/c},this.getCharacterWidth=function(t){var e=this.charSizes[t];return void 0===e&&(e=this.charSizes[t]=this.$measureCharWidth(t)/this.$characterSize.width),e},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function t(e){return e&&e.parentElement?(window.getComputedStyle(e).zoom||1)*t(e.parentElement):1},this.$initTransformMeasureNodes=function(){var t=function(t,e){return["div",{style:"position: absolute;top:"+t+"px;left:"+e+"px;"}]};this.els=r.buildDom([t(0,0),t(h,0),t(0,h),t(h,h)],this.el)},this.transformCoordinates=function(t,e){t&&(t=o(1/this.$getZoom(this.el),t));function n(t,e,n){var i=t[1]*e[0]-t[0]*e[1];return[(-e[1]*n[0]+e[0]*n[1])/i,(+t[1]*n[0]-t[0]*n[1])/i]}function i(t,e){return[t[0]-e[0],t[1]-e[1]]}function r(t,e){return[t[0]+e[0],t[1]+e[1]]}function o(t,e){return[t*e[0],t*e[1]]}function s(t){var e=t.getBoundingClientRect();return[e.left,e.top]}this.els||this.$initTransformMeasureNodes();var a=s(this.els[0]),l=s(this.els[1]),c=s(this.els[2]),d=s(this.els[3]),u=n(i(d,l),i(d,c),i(r(l,c),r(d,a))),f=o(1+u[0],i(l,a)),p=o(1+u[1],i(c,a));if(e){var m=e,g=u[0]*m[0]/h+u[1]*m[1]/h+1,v=r(o(m[0],f),o(m[1],p));return r(o(1/g/h,v),a)}var y=i(t,a),_=n(i(f,o(u[0],y)),i(p,o(u[1],y)),y);return o(h,_)}}).call(u.prototype)})),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],(function(t,e,n){"use strict";var i=t("./lib/oop"),r=t("./lib/dom"),o=t("./config"),s=t("./layer/gutter").Gutter,a=t("./layer/marker").Marker,l=t("./layer/text").Text,c=t("./layer/cursor").Cursor,d=t("./scrollbar").HScrollBar,h=t("./scrollbar").VScrollBar,u=t("./renderloop").RenderLoop,f=t("./layer/font_metrics").FontMetrics,p=t("./lib/event_emitter").EventEmitter,m='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;padding: 0;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;font-variant-ligatures: no-common-ligatures;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_error_bracket {position: absolute;border-bottom: 1px solid #DE5555;border-radius: 0;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);transform-origin: left;white-space: pre;opacity: 0.7;margin: 0 10px;}',g=t("./lib/useragent"),v=g.isIE;r.importCssString(m,"ace_editor.css");var y=function(t,e){var n=this;this.container=t||r.createElement("div"),r.addCssClass(this.container,"ace_editor"),r.HI_DPI&&r.addCssClass(this.container,"ace_hidpi"),this.setTheme(e),this.$gutter=r.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=r.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=r.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new s(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var i=this.$textLayer=new l(this.content);this.canvas=i.element,this.$markerFront=new a(this.content),this.$cursorLayer=new c(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new d(this.container,this),this.scrollBarV.on("scroll",(function(t){n.$scrollAnimation||n.session.setScrollTop(t.data-n.scrollMargin.top)})),this.scrollBarH.on("scroll",(function(t){n.$scrollAnimation||n.session.setScrollLeft(t.data-n.scrollMargin.left)})),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",(function(t){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",t)})),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!g.isIOS,this.$loop=new u(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),o.resetOptions(this),o._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,i.implement(this,p),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),r.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(t){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=t,t&&this.scrollMargin.top&&t.getScrollTop()<=0&&t.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(t),this.$markerBack.setSession(t),this.$markerFront.setSession(t),this.$gutterLayer.setSession(t),this.$textLayer.setSession(t),t&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(t,e,n){if(void 0===e&&(e=1/0),this.$changedLines?(this.$changedLines.firstRow>t&&(this.$changedLines.firstRow=t),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(t){t?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(t,e,n,i){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=t?1:0;var r=this.container;i||(i=r.clientHeight||r.scrollHeight),n||(n=r.clientWidth||r.scrollWidth);var o=this.$updateCachedSize(t,e,n,i);if(!this.$size.scrollerHeight||!n&&!i)return this.resizing=0;t&&(this.$gutterLayer.$padding=null),t?this.$renderChanges(o|this.$changes,!0):this.$loop.schedule(o|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(t,e,n,i){i-=this.$extraHeight||0;var o=0,s=this.$size,a={width:s.width,height:s.height,scrollerHeight:s.scrollerHeight,scrollerWidth:s.scrollerWidth};if(i&&(t||s.height!=i)&&(s.height=i,o|=this.CHANGE_SIZE,s.scrollerHeight=s.height,this.$horizScroll&&(s.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",o|=this.CHANGE_SCROLL),n&&(t||s.width!=n)){o|=this.CHANGE_SIZE,s.width=n,null==e&&(e=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=e,r.setStyle(this.scrollBarH.element.style,"left",e+"px"),r.setStyle(this.scroller.style,"left",e+this.margin.left+"px"),s.scrollerWidth=Math.max(0,n-e-this.scrollBarV.getWidth()-this.margin.h),r.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";r.setStyle(this.scrollBarH.element.style,"right",l),r.setStyle(this.scroller.style,"right",l),r.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||t)&&(o|=this.CHANGE_FULL)}return s.$dirty=!n||!i,o&&this._signal("resize",a),o},this.onGutterResize=function(t){var e=this.$showGutter?t:0;e!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,e,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var t=this.$size.scrollerWidth-2*this.$padding,e=Math.floor(t/this.characterWidth);return this.session.adjustWrapLimit(e,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(t){this.setOption("animatedScroll",t)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(t){this.setOption("showInvisibles",t),this.session.$bidiHandler.setShowInvisibles(t)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(t){this.setOption("displayIndentGuides",t)},this.setShowPrintMargin=function(t){this.setOption("showPrintMargin",t)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(t){this.setOption("printMarginColumn",t)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(t){return this.setOption("showGutter",t)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(t){this.setOption("fadeFoldWidgets",t)},this.setHighlightGutterLine=function(t){this.setOption("highlightGutterLine",t)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var t=r.createElement("div");t.className="ace_layer ace_print-margin-layer",this.$printMarginEl=r.createElement("div"),this.$printMarginEl.className="ace_print-margin",t.appendChild(this.$printMarginEl),this.content.insertBefore(t,this.content.firstChild)}var e=this.$printMarginEl.style;e.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",e.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var t=this.textarea.style,e=this.$composition;if(this.$keepTextAreaAtCursor||e){var n=this.$cursorLayer.$pixelPos;if(n){e&&e.markerRange&&(n=this.$cursorLayer.getPixelPosition(e.markerRange.start,!0));var i=this.layerConfig,o=n.top,s=n.left;o-=i.offset;var a=e&&e.useTextareaForIME?this.lineHeight:v?0:1;if(o<0||o>i.height-a)r.translate(this.textarea,0,0);else{var l=1,c=this.$size.height-a;if(e)if(e.useTextareaForIME){var d=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(d)[0]}else o+=this.lineHeight+2;else o+=this.lineHeight;(s-=this.scrollLeft)>this.$size.scrollerWidth-l&&(s=this.$size.scrollerWidth-l),s+=this.gutterWidth+this.margin.left,r.setStyle(t,"height",a+"px"),r.setStyle(t,"width",l+"px"),r.translate(this.textarea,Math.min(s,this.$size.scrollerWidth-l),Math.min(o,c))}}}else r.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var t=this.layerConfig,e=t.lastRow;return this.session.documentToScreenRow(e,0)*t.lineHeight-this.session.getScrollTop()>t.height-t.lineHeight?e-1:e},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(t){this.$padding=t,this.$textLayer.setPadding(t),this.$cursorLayer.setPadding(t),this.$markerFront.setPadding(t),this.$markerBack.setPadding(t),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(t,e,n,i){var r=this.scrollMargin;r.top=0|t,r.bottom=0|e,r.right=0|i,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,r.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-r.top),this.updateFull()},this.setMargin=function(t,e,n,i){var r=this.margin;r.top=0|t,r.bottom=0|e,r.right=0|i,r.left=0|n,r.v=r.top+r.bottom,r.h=r.left+r.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(t){this.setOption("hScrollBarAlwaysVisible",t)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(t){this.setOption("vScrollBarAlwaysVisible",t)},this.$updateScrollBarV=function(){var t=this.layerConfig.maxHeight,e=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(t-=(e-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>t-e&&(t=this.scrollTop+e,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(t+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(t,e){if(this.$changes&&(t|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(t||e)){if(this.$size.$dirty)return this.$changes|=t,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",t),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(t&this.CHANGE_FULL||t&this.CHANGE_SIZE||t&this.CHANGE_TEXT||t&this.CHANGE_LINES||t&this.CHANGE_SCROLL||t&this.CHANGE_H_SCROLL){if(t|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var i=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;i>0&&(this.scrollTop=i,t|=this.CHANGE_SCROLL,t|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),t&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),r.translate(this.content,-this.scrollLeft,-n.offset);var o=n.width+2*this.$padding+"px",s=n.minHeight+"px";r.setStyle(this.content.style,"width",o),r.setStyle(this.content.style,"height",s)}if(t&this.CHANGE_H_SCROLL&&(r.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),t&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",t);if(t&this.CHANGE_SCROLL)return this.$changedLines=null,t&this.CHANGE_TEXT||t&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(t&this.CHANGE_GUTTER||t&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",t);t&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):t&this.CHANGE_LINES?(this.$updateLines()||t&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):t&this.CHANGE_TEXT||t&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):t&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),t&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),t&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),t&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender",t)}else this.$changes|=t},this.$autosize=function(){var t=this.session.getScreenLength()*this.lineHeight,e=this.$maxLines*this.lineHeight,n=Math.min(e,Math.max((this.$minLines||1)*this.lineHeight,t))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var i=!(n<=2*this.lineHeight)&&t>e;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||i!=this.$vScroll){i!=this.$vScroll&&(this.$vScroll=i,this.scrollBarV.setVisible(i));var r=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,r,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var t=this.session,e=this.$size,n=e.height<=2*this.lineHeight,i=this.session.getScreenLength()*this.lineHeight,r=this.$getLongestLine(),o=!n&&(this.$hScrollBarAlwaysVisible||e.scrollerWidth-r-2*this.$padding<0),s=this.$horizScroll!==o;s&&(this.$horizScroll=o,this.scrollBarH.setVisible(o));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=e.scrollerHeight+this.lineHeight,c=!this.$maxLines&&this.$scrollPastEnd?(e.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;i+=c;var d=this.scrollMargin;this.session.setScrollTop(Math.max(-d.top,Math.min(this.scrollTop,i-e.scrollerHeight+d.bottom))),this.session.setScrollLeft(Math.max(-d.left,Math.min(this.scrollLeft,r+2*this.$padding-e.scrollerWidth+d.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||e.scrollerHeight-i+c<0||this.scrollTop>d.top),u=a!==h;u&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var f,p,m=this.scrollTop%this.lineHeight,g=Math.ceil(l/this.lineHeight)-1,v=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),y=v+g,_=this.lineHeight;v=t.screenToDocumentRow(v,0);var b=t.getFoldLine(v);b&&(v=b.start.row),f=t.documentToScreenRow(v,0),p=t.getRowLength(v)*_,y=Math.min(t.screenToDocumentRow(y,0),t.getLength()-1),l=e.scrollerHeight+t.getRowLength(y)*_+p,m=this.scrollTop-f*_;var w=0;return(this.layerConfig.width!=r||s)&&(w=this.CHANGE_H_SCROLL),(s||u)&&(w|=this.$updateCachedSize(!0,this.gutterWidth,e.width,e.height),this._signal("scrollbarVisibilityChanged"),u&&(r=this.$getLongestLine())),this.layerConfig={width:r,padding:this.$padding,firstRow:v,firstRowScreen:f,lastRow:y,lineHeight:_,characterWidth:this.characterWidth,minHeight:l,maxHeight:i,offset:m,gutterOffset:_?Math.max(0,Math.ceil((m+e.height-e.scrollerHeight)/_)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(r-this.$padding),w},this.$updateLines=function(){if(this.$changedLines){var t=this.$changedLines.firstRow,e=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(t>n.lastRow+1||ethis.$textLayer.MAX_LINE_LENGTH&&(t=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(t*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(t,e){this.$gutterLayer.addGutterDecoration(t,e)},this.removeGutterDecoration=function(t,e){this.$gutterLayer.removeGutterDecoration(t,e)},this.updateBreakpoints=function(t){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(t){this.$gutterLayer.setAnnotations(t),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(t,e,n){this.scrollCursorIntoView(t,n),this.scrollCursorIntoView(e,n)},this.scrollCursorIntoView=function(t,e,n){if(0!==this.$size.scrollerHeight){var i=this.$cursorLayer.getPixelPosition(t),r=i.left,o=i.top,s=n&&n.top||0,a=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+s>o?(e&&l+s>o+this.lineHeight&&(o-=e*this.$size.scrollerHeight),0===o&&(o=-this.scrollMargin.top),this.session.setScrollTop(o)):l+this.$size.scrollerHeight-ar?(r=1-this.scrollMargin.top||(e>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||(t<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||(t>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0)))},this.pixelToScreenCoordinates=function(t,e){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([t,e]);t=i[1]-this.gutterWidth-this.margin.left,e=i[0]}else n=this.scroller.getBoundingClientRect();var r=t+this.scrollLeft-n.left-this.$padding,o=r/this.characterWidth,s=Math.floor((e+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(o):Math.round(o);return{row:s,column:a,side:o-a>0?1:-1,offsetX:r}},this.screenToTextCoordinates=function(t,e){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([t,e]);t=i[1]-this.gutterWidth-this.margin.left,e=i[0]}else n=this.scroller.getBoundingClientRect();var r=t+this.scrollLeft-n.left-this.$padding,o=r/this.characterWidth,s=this.$blockCursor?Math.floor(o):Math.round(o),a=Math.floor((e+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(s,0),r)},this.textToScreenCoordinates=function(t,e){var n=this.scroller.getBoundingClientRect(),i=this.session.documentToScreenPosition(t,e),r=this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,t)?this.session.$bidiHandler.getPosLeft(i.column):Math.round(i.column*this.characterWidth)),o=i.row*this.lineHeight;return{pageX:n.left+r-this.scrollLeft,pageY:n.top+o-this.scrollTop}},this.visualizeFocus=function(){r.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){r.removeCssClass(this.container,"ace_focus")},this.showComposition=function(t){this.$composition=t,t.cssText||(t.cssText=this.textarea.style.cssText),null==t.useTextareaForIME&&(t.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(r.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):t.markerId=this.session.addMarker(t.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(t){var e=this.session.selection.cursor;this.addToken(t,"composition_placeholder",e.row,e.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),r.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var t=this.session.selection.cursor;this.removeExtraToken(t.row,t.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},this.addToken=function(t,e,n,i){var r=this.session;r.bgTokenizer.lines[n]=null;var o={type:e,value:t},s=r.getTokens(n);if(null==i)s.push(o);else for(var a=0,l=0;l50&&t.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:t}))}}).call(l.prototype);e.UIWorkerClient=function(t,e,n){var i=null,r=!1,a=Object.create(o),c=[],d=new l({messageBuffer:c,terminate:function(){},postMessage:function(t){c.push(t),i&&(r?setTimeout(h):h())}});d.setEmitSync=function(t){r=t};var h=function(){var t=c.shift();t.command?i[t.command].apply(i,t.args):t.event&&a._signal(t.event,t.data)};return a.postMessage=function(t){d.onMessage({data:t})},a.callback=function(t,e){this.postMessage({type:"call",id:e,data:t})},a.emit=function(t,e){this.postMessage({type:"event",name:t,data:e})},s.loadModule(["worker",e],(function(t){for(i=new t[n](a);c.length;)h()})),d},e.WorkerClient=l,e.createWorker=a})),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],(function(t,e,n){"use strict";var i=t("./range").Range,r=t("./lib/event_emitter").EventEmitter,o=t("./lib/oop"),s=function(t,e,n,i,r,o){var s=this;this.length=e,this.session=t,this.doc=t.getDocument(),this.mainClass=r,this.othersClass=o,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=i,this.$onCursorChange=function(){setTimeout((function(){s.onCursorChange()}))},this.$pos=n;var a=t.getUndoManager().$undoStack||t.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),t.selection.on("changeCursor",this.$onCursorChange)};(function(){o.implement(this,r),this.setup=function(){var t=this,e=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=e.createAnchor(this.$pos.row,this.$pos.column);var r=this.pos;r.$insertRight=!0,r.detach(),r.markerId=n.addMarker(new i(r.row,r.column,r.row,r.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach((function(n){var i=e.createAnchor(n.row,n.column);i.$insertRight=!0,i.detach(),t.others.push(i)})),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var t=this.session,e=this;this.othersActive=!0,this.others.forEach((function(n){n.markerId=t.addMarker(new i(n.row,n.column,n.row,n.column+e.length),e.othersClass,null,!1)}))}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var t=0;t=this.pos.column&&e.start.column<=this.pos.column+this.length+1,o=e.start.column-this.pos.column;if(this.updateAnchors(t),r&&(this.length+=n),r&&!this.session.$fromUndo)if("insert"===t.action)for(var s=this.others.length-1;s>=0;s--){var a={row:(l=this.others[s]).row,column:l.column+o};this.doc.insertMergedLines(a,t.lines)}else if("remove"===t.action)for(s=this.others.length-1;s>=0;s--){var l;a={row:(l=this.others[s]).row,column:l.column+o};this.doc.remove(new i(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(t){this.pos.onChange(t);for(var e=this.others.length;e--;)this.others[e].onChange(t);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var t=this,e=this.session,n=function(n,r){e.removeMarker(n.markerId),n.markerId=e.addMarker(new i(n.row,n.column,n.row,n.column+t.length),r,null,!1)};n(this.pos,this.mainClass);for(var r=this.others.length;r--;)n(this.others[r],this.othersClass)}},this.onCursorChange=function(t){if(!this.$updating&&this.session){var e=this.session.selection.getCursor();e.row===this.pos.row&&e.column>=this.pos.column&&e.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",t)):(this.hideOtherMarkers(),this._emit("cursorLeave",t))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var t=this.session.getUndoManager(),e=(t.$undoStack||t.$undostack).length-this.$undoStackDepth,n=0;n1?t.multiSelect.joinSelections():t.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(t){t.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(t){t.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(t){t.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],e.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(t){t.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(t){return t&&t.inMultiSelectMode}}];var i=t("../keyboard/hash_handler").HashHandler;e.keyboardHandler=new i(e.multiSelectCommands)})),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],(function(t,e,n){var i=t("./range_list").RangeList,r=t("./range").Range,o=t("./selection").Selection,s=t("./mouse/multi_select_handler").onMouseDown,a=t("./lib/event"),l=t("./lib/lang"),c=t("./commands/multi_select_commands");e.commands=c.defaultCommands.concat(c.multiSelectCommands);var d=new(0,t("./search").Search);var h=t("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(h.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(t,e){if(t){if(!this.inMultiSelectMode&&0===this.rangeCount){var n=this.toOrientedRange();if(this.rangeList.add(n),this.rangeList.add(t),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),e||this.fromOrientedRange(t);this.rangeList.removeAll(),this.rangeList.add(n),this.$onAddRange(n)}t.cursor||(t.cursor=t.end);var i=this.rangeList.add(t);return this.$onAddRange(t),i.length&&this.$onRemoveRange(i),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),e||this.fromOrientedRange(t)}},this.toSingleRange=function(t){t=t||this.ranges[0];var e=this.rangeList.removeAll();e.length&&this.$onRemoveRange(e),t&&this.fromOrientedRange(t)},this.substractPoint=function(t){var e=this.rangeList.substractPoint(t);if(e)return this.$onRemoveRange(e),e[0]},this.mergeOverlappingRanges=function(){var t=this.rangeList.merge();t.length&&this.$onRemoveRange(t)},this.$onAddRange=function(t){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(t),this._signal("addRange",{range:t})},this.$onRemoveRange=function(t){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var e=this.rangeList.ranges.pop();t.push(e),this.rangeCount=0}for(var n=t.length;n--;){var i=this.ranges.indexOf(t[n]);this.ranges.splice(i,1)}this._signal("removeRange",{ranges:t}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(e=e||this.ranges[0])&&!e.isEqual(this.getRange())&&this.fromOrientedRange(e)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new i,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var t=this.ranges.length?this.ranges:[this.getRange()],e=[],n=0;n1){var t=this.rangeList.ranges,e=t[t.length-1],n=r.fromPoints(t[0].start,e.end);this.toSingleRange(),this.setSelectionRange(n,e.cursor==e.start)}else{var i=this.session.documentToScreenPosition(this.cursor),o=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(i,o).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(t,e,n){var i=[],o=t.column0;)y--;if(y>0)for(var _=0;i[_].isEmpty();)_++;for(var b=y;b>=_;b--)i[b].isEmpty()&&i.splice(b,1)}return i}}.call(o.prototype);var u=t("./editor").Editor;function f(t){t.$multiselectOnSessionChange||(t.$onAddRange=t.$onAddRange.bind(t),t.$onRemoveRange=t.$onRemoveRange.bind(t),t.$onMultiSelect=t.$onMultiSelect.bind(t),t.$onSingleSelect=t.$onSingleSelect.bind(t),t.$multiselectOnSessionChange=e.onSessionChange.bind(t),t.$checkMultiselectChange=t.$checkMultiselectChange.bind(t),t.$multiselectOnSessionChange(t),t.on("changeSession",t.$multiselectOnSessionChange),t.on("mousedown",s),t.commands.addCommands(c.defaultCommands),function(t){if(!t.textInput)return;var e=t.textInput.getElement(),n=!1;function i(e){n&&(t.renderer.setMouseCursor(""),n=!1)}a.addListener(e,"keydown",(function(e){var r=18==e.keyCode&&!(e.ctrlKey||e.shiftKey||e.metaKey);t.$blockSelectEnabled&&r?n||(t.renderer.setMouseCursor("crosshair"),n=!0):n&&i()}),t),a.addListener(e,"keyup",i,t),a.addListener(e,"blur",i,t)}(t))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(t){t.cursor||(t.cursor=t.end);var e=this.getSelectionStyle();return t.marker=this.session.addMarker(t,"ace_selection",e),this.session.$selectionMarkers.push(t),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,t},this.removeSelectionMarker=function(t){if(t.marker){this.session.removeMarker(t.marker);var e=this.session.$selectionMarkers.indexOf(t);-1!=e&&this.session.$selectionMarkers.splice(e,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(t){for(var e=this.session.$selectionMarkers,n=t.length;n--;){var i=t[n];if(i.marker){this.session.removeMarker(i.marker);var r=e.indexOf(i);-1!=r&&e.splice(r,1)}}this.session.selectionMarkerCount=e.length},this.$onAddRange=function(t){this.addSelectionMarker(t.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(t){this.removeSelectionMarkers(t.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(t){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(c.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(t){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(c.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(t){var e=t.command,n=t.editor;if(n.multiSelect){if(e.multiSelectAction)"forEach"==e.multiSelectAction?i=n.forEachSelection(e,t.args):"forEachLine"==e.multiSelectAction?i=n.forEachSelection(e,t.args,!0):"single"==e.multiSelectAction?(n.exitMultiSelectMode(),i=e.exec(n,t.args||{})):i=e.multiSelectAction(n,t.args||{});else{var i=e.exec(n,t.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return i}},this.forEachSelection=function(t,e,n){if(!this.inVirtualSelectionMode){var i,r=n&&n.keepOrder,s=1==n||n&&n.$byLines,a=this.session,l=this.selection,c=l.rangeList,d=(r?l:c).ranges;if(!d.length)return t.exec?t.exec(this,e||{}):t(this,e||{});var h=l._eventRegistry;l._eventRegistry={};var u=new o(a);this.inVirtualSelectionMode=!0;for(var f=d.length;f--;){if(s)for(;f>0&&d[f].start.row==d[f-1].end.row;)f--;u.fromOrientedRange(d[f]),u.index=f,this.selection=a.selection=u;var p=t.exec?t.exec(this,e||{}):t(this,e||{});i||void 0===p||(i=p),u.toOrientedRange(d[f])}u.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),i}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var t="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var e=this.multiSelect.rangeList.ranges,n=[],i=0;is&&(s=n.column),id?t.insert(i,l.stringRepeat(" ",o-d)):t.remove(new r(i.row,i.column,i.row,i.column-o+d)),e.start.column=e.end.column=s,e.start.row=e.end.row=i.row,e.cursor=e.end})),e.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var d=this.selection.getRange(),h=d.start.row,u=d.end.row,f=h==u;if(f){var p,m=this.session.getLength();do{p=this.session.getLine(u)}while(/[=:]/.test(p)&&++u0);h<0&&(h=0),u>=m&&(u=m-1)}var g=this.session.removeFullLines(h,u);g=this.$reAlignText(g,f),this.session.insert({row:h,column:0},g.join("\n")+"\n"),f||(d.start.column=0,d.end.column=g[g.length-1].length),this.selection.setRange(d)}},this.$reAlignText=function(t,e){var n,i,r,o=!0,s=!0;return t.map((function(t){var e=t.match(/(\s*)(.*?)(\s*)([=:].*)/);return e?null==n?(n=e[1].length,i=e[2].length,r=e[3].length,e):(n+i+r!=e[1].length+e[2].length+e[3].length&&(s=!1),n!=e[1].length&&(o=!1),n>e[1].length&&(n=e[1].length),ie[3].length&&(r=e[3].length),e):[t]})).map(e?c:o?s?function(t){return t[2]?a(n+i-t[2].length)+t[2]+a(r)+t[4].replace(/^([=:])\s+/,"$1 "):t[0]}:c:function(t){return t[2]?a(n)+t[2]+a(r)+t[4].replace(/^([=:])\s+/,"$1 "):t[0]});function a(t){return l.stringRepeat(" ",t)}function c(t){return t[2]?a(n)+t[2]+a(i-t[2].length+r)+t[4].replace(/^([=:])\s+/,"$1 "):t[0]}}}).call(u.prototype),e.onSessionChange=function(t){var e=t.session;e&&!e.multiSelect&&(e.$selectionMarkers=[],e.selection.$initRangeList(),e.multiSelect=e.selection),this.multiSelect=e&&e.multiSelect;var n=t.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),e&&(e.multiSelect.on("addRange",this.$onAddRange),e.multiSelect.on("removeRange",this.$onRemoveRange),e.multiSelect.on("multiSelect",this.$onMultiSelect),e.multiSelect.on("singleSelect",this.$onSingleSelect),e.multiSelect.lead.on("change",this.$checkMultiselectChange),e.multiSelect.anchor.on("change",this.$checkMultiselectChange)),e&&this.inMultiSelectMode!=e.selection.inMultiSelectMode&&(e.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},e.MultiSelect=f,t("./config").defineOptions(u.prototype,"editor",{enableMultiselect:{set:function(t){f(this),t?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",s)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",s))},value:!0},enableBlockSelect:{set:function(t){this.$blockSelectEnabled=t},value:!0}})})),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],(function(t,e,n){"use strict";var i=t("../../range").Range,r=e.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(t,e,n){var i=t.getLine(n);return this.foldingStartMarker.test(i)?"start":"markbeginend"==e&&this.foldingStopMarker&&this.foldingStopMarker.test(i)?"end":""},this.getFoldWidgetRange=function(t,e,n){return null},this.indentationBlock=function(t,e,n){var r=/\S/,o=t.getLine(e),s=o.search(r);if(-1!=s){for(var a=n||o.length,l=t.getLength(),c=e,d=e;++ec){var f=t.getLine(d).length;return new i(c,a,d,f)}}},this.openingBracketBlock=function(t,e,n,r,o){var s={row:n,column:r+1},a=t.$findClosingBracket(e,s,o);if(a){var l=t.foldWidgets[a.row];return null==l&&(l=t.getFoldWidget(a.row)),"start"==l&&a.row>s.row&&(a.row--,a.column=t.getLine(a.row).length),i.fromPoints(s,a)}},this.closingBracketBlock=function(t,e,n,r,o){var s={row:n,column:r},a=t.$findOpeningBracket(e,s);if(a)return a.column++,s.column--,i.fromPoints(a,s)}}).call(r.prototype)})),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],(function(t,e,n){"use strict";e.isDark=!1,e.cssClass="ace-tm",e.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',e.$id="ace/theme/textmate",t("../lib/dom").importCssString(e.cssText,e.cssClass)})),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],(function(t,e,n){"use strict";var i=t("./lib/dom");function r(t){this.session=t,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}(function(){this.getRowLength=function(t){var e;return e=this.lineWidgets&&this.lineWidgets[t]&&this.lineWidgets[t].rowCount||0,this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+1+e:1+e},this.$getWidgetScreenLength=function(){var t=0;return this.lineWidgets.forEach((function(e){e&&e.rowCount&&!e.hidden&&(t+=e.rowCount)})),t},this.$onChangeEditor=function(t){this.attach(t.editor)},this.attach=function(t){t&&t.widgetManager&&t.widgetManager!=this&&t.widgetManager.detach(),this.editor!=t&&(this.detach(),this.editor=t,t&&(t.widgetManager=this,t.renderer.on("beforeRender",this.measureWidgets),t.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(t){var e=this.editor;if(e){this.editor=null,e.widgetManager=null,e.renderer.off("beforeRender",this.measureWidgets),e.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach((function(t){t&&t.el&&t.el.parentNode&&(t._inDocument=!1,t.el.parentNode.removeChild(t.el))}))}},this.updateOnFold=function(t,e){var n=e.lineWidgets;if(n&&t.action){for(var i=t.data,r=i.start.row,o=i.end.row,s="add"==t.action,a=r+1;ae[n].column&&n++,o.unshift(n,0),e.splice.apply(e,o),this.$updateRows()}}},this.$updateRows=function(){var t=this.session.lineWidgets;if(t){var e=!0;t.forEach((function(t,n){if(t)for(e=!1,t.row=n;t.$oldWidget;)t.$oldWidget.row=n,t=t.$oldWidget})),e&&(this.session.lineWidgets=null)}},this.$registerLineWidget=function(t){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var e=this.session.lineWidgets[t.row];return e&&(t.$oldWidget=e,e.el&&e.el.parentNode&&(e.el.parentNode.removeChild(e.el),e._inDocument=!1)),this.session.lineWidgets[t.row]=t,t},this.addLineWidget=function(t){if(this.$registerLineWidget(t),t.session=this.session,!this.editor)return t;var e=this.editor.renderer;t.html&&!t.el&&(t.el=i.createElement("div"),t.el.innerHTML=t.html),t.el&&(i.addCssClass(t.el,"ace_lineWidgetContainer"),t.el.style.position="absolute",t.el.style.zIndex=5,e.container.appendChild(t.el),t._inDocument=!0,t.coverGutter||(t.el.style.zIndex=3),null==t.pixelHeight&&(t.pixelHeight=t.el.offsetHeight)),null==t.rowCount&&(t.rowCount=t.pixelHeight/e.layerConfig.lineHeight);var n=this.session.getFoldAt(t.row,0);if(t.$fold=n,n){var r=this.session.lineWidgets;t.row!=n.end.row||r[n.start.row]?t.hidden=!0:r[n.start.row]=t}return this.session._emit("changeFold",{data:{start:{row:t.row}}}),this.$updateRows(),this.renderWidgets(null,e),this.onWidgetChanged(t),t},this.removeLineWidget=function(t){if(t._inDocument=!1,t.session=null,t.el&&t.el.parentNode&&t.el.parentNode.removeChild(t.el),t.editor&&t.editor.destroy)try{t.editor.destroy()}catch(t){}if(this.session.lineWidgets){var e=this.session.lineWidgets[t.row];if(e==t)this.session.lineWidgets[t.row]=t.$oldWidget,t.$oldWidget&&this.onWidgetChanged(t.$oldWidget);else for(;e;){if(e.$oldWidget==t){e.$oldWidget=t.$oldWidget;break}e=e.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:t.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(t){for(var e=this.session.lineWidgets,n=e&&e[t],i=[];n;)i.push(n),n=n.$oldWidget;return i},this.onWidgetChanged=function(t){this.session._changedWidgets.push(t),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(t,e){var n=this.session._changedWidgets,i=e.layerConfig;if(n&&n.length){for(var r=1/0,o=0;o0&&!i[r];)r--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,e.$cursorLayer.config=n;for(var s=r;s<=o;s++){var a=i[s];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,e.container.appendChild(a.el));var l=e.$cursorLayer.getPixelPosition({row:s,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var c=a.coverGutter?0:e.gutterWidth;a.fixedWidth||(c-=e.scrollLeft),a.el.style.left=c+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=e.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}).call(r.prototype),e.LineWidgets=r})),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],(function(t,e,n){"use strict";var i=t("../line_widgets").LineWidgets,r=t("../lib/dom"),o=t("../range").Range;e.showErrorMarker=function(t,e){var n=t.session;n.widgetManager||(n.widgetManager=new i(n),n.widgetManager.attach(t));var s=t.getCursorPosition(),a=s.row,l=n.widgetManager.getWidgetsAtRow(a).filter((function(t){return"errorMarker"==t.type}))[0];l?l.destroy():a-=e;var c,d=function(t,e,n){var i=t.getAnnotations().sort(o.comparePoints);if(i.length){var r=function(t,e,n){for(var i=0,r=t.length-1;i<=r;){var o=i+r>>1,s=n(e,t[o]);if(s>0)i=o+1;else{if(!(s<0))return o;r=o-1}}return-(i+1)}(i,{row:e,column:-1},o.comparePoints);r<0&&(r=-r-1),r>=i.length?r=n>0?0:i.length-1:0===r&&n<0&&(r=i.length-1);var s=i[r];if(s&&n){if(s.row===e){do{s=i[r+=n]}while(s&&s.row===e);if(!s)return i.slice()}var a=[];e=s.row;do{a[n<0?"unshift":"push"](s),s=i[r+=n]}while(s&&s.row==e);return a.length&&a}}}(n,a,e);if(d){var h=d[0];s.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,s.row=h.row,c=t.renderer.$gutterLayer.$annotations[s.row]}else{if(l)return;c={text:["Looks good!"],className:"ace_ok"}}t.session.unfold(s.row),t.selection.moveToPosition(s);var u={row:s.row,fixedWidth:!0,coverGutter:!0,el:r.createElement("div"),type:"errorMarker"},f=u.el.appendChild(r.createElement("div")),p=u.el.appendChild(r.createElement("div"));p.className="error_widget_arrow "+c.className;var m=t.renderer.$cursorLayer.getPixelPosition(s).left;p.style.left=m+t.renderer.gutterWidth-5+"px",u.el.className="error_widget_wrapper",f.className="error_widget "+c.className,f.innerHTML=c.text.join("
"),f.appendChild(r.createElement("div"));var g=function(t,e,n){if(0===e&&("esc"===n||"return"===n))return u.destroy(),{command:"null"}};u.destroy=function(){t.$mouseHandler.isMousePressed||(t.keyBinding.removeKeyboardHandler(g),n.widgetManager.removeLineWidget(u),t.off("changeSelection",u.destroy),t.off("changeSession",u.destroy),t.off("mouseup",u.destroy),t.off("change",u.destroy))},t.keyBinding.addKeyboardHandler(g),t.on("changeSelection",u.destroy),t.on("changeSession",u.destroy),t.on("mouseup",u.destroy),t.on("change",u.destroy),t.session.widgetManager.addLineWidget(u),u.el.onmousedown=t.focus.bind(t),t.renderer.scrollCursorIntoView(null,.5,{bottom:u.el.offsetHeight})},r.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")})),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],(function(t,e,i){"use strict";t("./lib/fixoldbrowsers");var r=t("./lib/dom"),o=t("./lib/event"),s=t("./range").Range,a=t("./editor").Editor,l=t("./edit_session").EditSession,c=t("./undomanager").UndoManager,d=t("./virtual_renderer").VirtualRenderer;t("./worker/worker_client"),t("./keyboard/hash_handler"),t("./placeholder"),t("./multi_select"),t("./mode/folding/fold_mode"),t("./theme/textmate"),t("./ext/error_marker"),e.config=t("./config"),e.require=t,e.define=n.amdD,e.edit=function(t,n){if("string"==typeof t){var i=t;if(!(t=document.getElementById(i)))throw new Error("ace.edit can't find div #"+i)}if(t&&t.env&&t.env.editor instanceof a)return t.env.editor;var s="";if(t&&/input|textarea/i.test(t.tagName)){var l=t;s=l.value,t=r.createElement("pre"),l.parentNode.replaceChild(t,l)}else t&&(s=t.textContent,t.innerHTML="");var c=e.createEditSession(s),h=new a(new d(t),c,n),u={document:c,editor:h,onResize:h.resize.bind(h,null)};return l&&(u.textarea=l),o.addListener(window,"resize",u.onResize),h.on("destroy",(function(){o.removeListener(window,"resize",u.onResize),u.editor.container.env=null})),h.container.env=h.env=u,h},e.createEditSession=function(t,e){var n=new l(t,e);return n.setUndoManager(new c),n},e.Range=s,e.Editor=a,e.EditSession=l,e.UndoManager=c,e.VirtualRenderer=d,e.version=e.config.version})),ace.require(["ace/ace"],(function(e){for(var n in e&&(e.config.init(!0),e.define=ace.define),window.ace||(window.ace=e),e)e.hasOwnProperty(n)&&(window.ace[n]=e[n]);window.ace.default=window.ace,t&&(t.exports=window.ace)}))},717:function(t,e,n){t=n.nmd(t),ace.define("ace/ext/modelist",["require","exports","module"],(function(t,e,n){"use strict";var i=[];var r=function(t,e,n){var i;this.name=t,this.caption=e,this.mode="ace/mode/"+t,this.extensions=n,i=/\^/.test(n)?n.replace(/\|(\^)?/g,(function(t,e){return"$|"+(e?"^":"^.*\\.")}))+"$":"^.*\\.("+n+")$",this.extRe=new RegExp(i,"gi")};r.prototype.supportsFile=function(t){return t.match(this.extRe)};var o={ABAP:["abap"],ABC:["abc"],ActionScript:["as"],ADA:["ada|adb"],Alda:["alda"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],Apex:["apex|cls|trigger|tgr"],AQL:["aql"],AsciiDoc:["asciidoc|adoc"],ASL:["dsl|asl"],Assembly_x86:["asm|a"],AutoHotKey:["ahk"],BatchFile:["bat|cmd"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp|ino"],C9Search:["c9search_results"],Cirru:["cirru|cr"],Clojure:["clj|cljs"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm"],Crystal:["cr"],CSharp:["cs"],Csound_Document:["csd"],Csound_Orchestra:["orc"],Csound_Score:["sco"],CSS:["css"],Curly:["curly"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Dockerfile:["^Dockerfile"],Dot:["dot"],Drools:["drl"],Edifact:["edi"],Eiffel:["e|ge"],EJS:["ejs"],Elixir:["ex|exs"],Elm:["elm"],Erlang:["erl|hrl"],Forth:["frt|fs|ldr|fth|4th"],Fortran:["f|f90"],FSharp:["fsi|fs|ml|mli|fsx|fsscript"],FSL:["fsl"],FTL:["ftl"],Gcode:["gcode"],Gherkin:["feature"],Gitignore:["^.gitignore"],Glsl:["glsl|frag|vert"],Gobstones:["gbs"],golang:["go"],GraphQLSchema:["gql"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],Haskell_Cabal:["cabal"],haXe:["hx"],Hjson:["hjson"],HTML:["html|htm|xhtml|vue|we|wpy"],HTML_Elixir:["eex|html.eex"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Io:["io"],Jack:["jack"],Jade:["jade|pug"],Java:["java"],JavaScript:["js|jsm|jsx"],JSON:["json"],JSON5:["json5"],JSONiq:["jq"],JSP:["jsp"],JSSM:["jssm|jssm_state"],JSX:["jsx"],Julia:["jl"],Kotlin:["kt|kts"],LaTeX:["tex|latex|ltx|bib"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],LogiQL:["logic|lql"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],Mask:["mask"],MATLAB:["matlab"],Maze:["mz"],MediaWiki:["wiki|mediawiki"],MEL:["mel"],MIXAL:["mixal"],MUSHCode:["mc|mush"],MySQL:["mysql"],Nginx:["nginx|conf"],Nim:["nim"],Nix:["nix"],NSIS:["nsi|nsh"],Nunjucks:["nunjucks|nunjs|nj|njk"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Pascal:["pas|p"],Perl:["pl|pm"],Perl6:["p6|pl6|pm6"],pgSQL:["pgsql"],PHP:["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],PHP_Laravel_blade:["blade.php"],Pig:["pig"],Powershell:["ps1"],Praat:["praat|praatscript|psc|proc"],Prisma:["prisma"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],Puppet:["epp|pp"],Python:["py"],QML:["qml"],R:["r"],Razor:["cshtml|asp"],RDoc:["Rd"],Red:["red|reds"],RHTML:["Rhtml"],RST:["rst"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SASS:["sass"],SCAD:["scad"],Scala:["scala|sbt"],Scheme:["scm|sm|rkt|oak|scheme"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Slim:["slim|skim"],Smarty:["smarty|tpl"],snippets:["snippets"],Soy_Template:["soy"],Space:["space"],SQL:["sql"],SQLServer:["sqlserver"],Stylus:["styl|stylus"],SVG:["svg"],Swift:["swift"],Tcl:["tcl"],Terraform:["tf","tfvars","terragrunt"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],TSX:["tsx"],Twig:["latte|twig|swig"],Typescript:["ts|typescript|str"],Vala:["vala"],VBScript:["vbs|vb"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],VHDL:["vhd|vhdl"],Visualforce:["vfp|component|page"],Wollok:["wlk|wpgm|wtest"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],XQuery:["xq"],YAML:["yaml|yml"],Zeek:["zeek|bro"],Django:["html"]},s={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C and C++",Csound_Document:"Csound Document",Csound_Orchestra:"Csound",Csound_Score:"Csound Score",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",HTML_Elixir:"HTML (Elixir)",FTL:"FreeMarker",PHP_Laravel_blade:"PHP (Blade Template)",Perl6:"Perl 6",AutoHotKey:"AutoHotkey / AutoIt"},a={};for(var l in o){var c=o[l],d=(s[l]||l).replace(/_/g," "),h=l.toLowerCase(),u=new r(h,d,c[0]);a[h]=u,i.push(u)}n.exports={getModeForPath:function(t){for(var e=a.text,n=t.split(/[\/\\]/).pop(),r=0;r -* @version v2.4.18 -* @repository git://github.com/ColorlibHQ/AdminLTE.git -* @license MIT -*/if(void 0===i)throw new Error("AdminLTE requires jQuery");!function(t){"use strict";function e(e,n){if(this.element=e,this.options=n,this.$overlay=t(n.overlayTemplate),""===n.source)throw new Error("Source url was not defined. Please specify a url in your BoxRefresh source option.");this._setUpListeners(),this.load()}var n="lte.boxrefresh",i={source:"",params:{},trigger:".refresh-btn",content:".box-body",loadInContent:!0,responseType:"",overlayTemplate:'
',onLoadStart:function(){},onLoadDone:function(t){return t}};function r(r){return this.each((function(){var o=t(this),s=o.data(n);if(!s){var a=t.extend({},i,o.data(),"object"==typeof r&&r);o.data(n,s=new e(o,a))}if("string"==typeof s){if(void 0===s[r])throw new Error("No method named "+r);s[r]()}}))}e.prototype.load=function(){this._addOverlay(),this.options.onLoadStart.call(t(this)),t.get(this.options.source,this.options.params,function(e){this.options.loadInContent&&t(this.element).find(this.options.content).html(e),this.options.onLoadDone.call(t(this),e),this._removeOverlay()}.bind(this),""!==this.options.responseType&&this.options.responseType)},e.prototype._setUpListeners=function(){t(this.element).on("click",this.options.trigger,function(t){t&&t.preventDefault(),this.load()}.bind(this))},e.prototype._addOverlay=function(){t(this.element).append(this.$overlay)},e.prototype._removeOverlay=function(){t(this.$overlay).remove()};var o=t.fn.boxRefresh;t.fn.boxRefresh=r,t.fn.boxRefresh.Constructor=e,t.fn.boxRefresh.noConflict=function(){return t.fn.boxRefresh=o,this},t(window).on("load",(function(){t('[data-widget="box-refresh"]').each((function(){r.call(t(this))}))}))}(i),function(t){"use strict";function e(t,e){this.element=t,this.options=e,this._setUpListeners()}var n="lte.boxwidget",i={animationSpeed:500,collapseTrigger:'[data-widget="collapse"]',removeTrigger:'[data-widget="remove"]',collapseIcon:"fa-minus",expandIcon:"fa-plus",removeIcon:"fa-times"},r=".box-header",o=".box-body",s=".box-footer",a=".box-tools",l="collapsed-box";function c(r){return this.each((function(){var o=t(this),s=o.data(n);if(!s){var a=t.extend({},i,o.data(),"object"==typeof r&&r);o.data(n,s=new e(o,a))}if("string"==typeof r){if(void 0===s[r])throw new Error("No method named "+r);s[r]()}}))}e.prototype.toggle=function(){t(this.element).is(".collapsed-box")?this.expand():this.collapse()},e.prototype.expand=function(){var e=t.Event("expanded.boxwidget"),n=t.Event("expanding.boxwidget"),i=this.options.collapseIcon,c=this.options.expandIcon;t(this.element).removeClass(l),t(this.element).children(r+", "+o+", "+s).children(a).find("."+c).removeClass(c).addClass(i),t(this.element).children(o+", "+s).slideDown(this.options.animationSpeed,function(){t(this.element).trigger(e)}.bind(this)).trigger(n)},e.prototype.collapse=function(){var e=t.Event("collapsed.boxwidget"),n=t.Event("collapsing.boxwidget"),i=this.options.collapseIcon,c=this.options.expandIcon;t(this.element).children(r+", "+o+", "+s).children(a).find("."+i).removeClass(i).addClass(c),t(this.element).children(o+", "+s).slideUp(this.options.animationSpeed,function(){t(this.element).addClass(l),t(this.element).trigger(e)}.bind(this)).trigger(n)},e.prototype.remove=function(){var e=t.Event("removed.boxwidget"),n=t.Event("removing.boxwidget");t(this.element).slideUp(this.options.animationSpeed,function(){t(this.element).trigger(e),t(this.element).remove()}.bind(this)).trigger(n)},e.prototype._setUpListeners=function(){var e=this;t(this.element).on("click",this.options.collapseTrigger,(function(n){return n&&n.preventDefault(),e.toggle(t(this)),!1})),t(this.element).on("click",this.options.removeTrigger,(function(n){return n&&n.preventDefault(),e.remove(t(this)),!1}))};var d=t.fn.boxWidget;t.fn.boxWidget=c,t.fn.boxWidget.Constructor=e,t.fn.boxWidget.noConflict=function(){return t.fn.boxWidget=d,this},t(window).on("load",(function(){t(".box").each((function(){c.call(t(this))}))}))}(i),function(t){"use strict";function e(t,e){this.element=t,this.options=e,this.hasBindedResize=!1,this.init()}var n="lte.controlsidebar",i={controlsidebarSlide:!0},r=".control-sidebar",o='[data-toggle="control-sidebar"]',s=".control-sidebar-open",a="control-sidebar-open",l="control-sidebar-hold-transition";function c(r){return this.each((function(){var o=t(this),s=o.data(n);if(!s){var a=t.extend({},i,o.data(),"object"==typeof r&&r);o.data(n,s=new e(o,a))}"string"==typeof r&&s.toggle()}))}e.prototype.init=function(){t(this.element).is(o)||t(this).on("click",this.toggle),this.fix(),t(window).resize(function(){this.fix()}.bind(this))},e.prototype.toggle=function(e){e&&e.preventDefault(),this.fix(),t(r).is(s)||t("body").is(s)?this.collapse():this.expand()},e.prototype.expand=function(){t(r).show(),this.options.controlsidebarSlide?t(r).addClass(a):t("body").addClass(l).addClass(a).delay(50).queue((function(){t("body").removeClass(l),t(this).dequeue()})),t(this.element).trigger(t.Event("expanded.controlsidebar"))},e.prototype.collapse=function(){this.options.controlsidebarSlide?t(r).removeClass(a):t("body").addClass(l).removeClass(a).delay(50).queue((function(){t("body").removeClass(l),t(this).dequeue()})),t(r).fadeOut(),t(this.element).trigger(t.Event("collapsed.controlsidebar"))},e.prototype.fix=function(){t("body").is(".layout-boxed")&&this._fixForBoxed(t(".control-sidebar-bg"))},e.prototype._fixForBoxed=function(e){e.css({position:"absolute",height:t(".wrapper").height()})};var d=t.fn.controlSidebar;t.fn.controlSidebar=c,t.fn.controlSidebar.Constructor=e,t.fn.controlSidebar.noConflict=function(){return t.fn.controlSidebar=d,this},t(document).on("click",o,(function(e){e&&e.preventDefault(),c.call(t(this),"toggle")}))}(i),function(t){"use strict";function e(t){this.element=t}var n="lte.directchat";function i(i){return this.each((function(){var r=t(this),o=r.data(n);o||r.data(n,o=new e(r)),"string"==typeof i&&o.toggle(r)}))}e.prototype.toggle=function(t){t.parents(".direct-chat").first().toggleClass("direct-chat-contacts-open")};var r=t.fn.directChat;t.fn.directChat=i,t.fn.directChat.Constructor=e,t.fn.directChat.noConflict=function(){return t.fn.directChat=r,this},t(document).on("click",'[data-widget="chat-pane-toggle"]',(function(e){e&&e.preventDefault(),i.call(t(this),"toggle")}))}(i),function(t){"use strict";function e(t){this.options=t,this.init()}var n="lte.pushmenu",i={collapseScreenSize:767,expandOnHover:!1,expandTransitionDelay:200},r='[data-toggle="push-menu"]',o=".sidebar-mini",s="sidebar-collapse",a="sidebar-open",l="sidebar-expanded-on-hover",c="expanded.pushMenu",d="collapsed.pushMenu";function h(r){return this.each((function(){var o=t(this),s=o.data(n);if(!s){var a=t.extend({},i,o.data(),"object"==typeof r&&r);o.data(n,s=new e(a))}"toggle"===r&&s.toggle()}))}e.prototype.init=function(){(this.options.expandOnHover||t("body").is(o+".fixed"))&&(this.expandOnHover(),t("body").addClass("sidebar-mini-expand-feature")),t(".content-wrapper").click(function(){t(window).width()<=this.options.collapseScreenSize&&t("body").hasClass(a)&&this.close()}.bind(this)),t(".sidebar-form .form-control").click((function(t){t.stopPropagation()}))},e.prototype.toggle=function(){var e=t(window).width(),n=!t("body").hasClass(s);e<=this.options.collapseScreenSize&&(n=t("body").hasClass(a)),n?this.close():this.open()},e.prototype.open=function(){t(window).width()>this.options.collapseScreenSize?t("body").removeClass(s).trigger(t.Event(c)):t("body").addClass(a).trigger(t.Event(c))},e.prototype.close=function(){t(window).width()>this.options.collapseScreenSize?t("body").addClass(s).trigger(t.Event(d)):t("body").removeClass(a+" "+s).trigger(t.Event(d))},e.prototype.expandOnHover=function(){t(".main-sidebar").hover(function(){t("body").is(o+".sidebar-collapse")&&t(window).width()>this.options.collapseScreenSize&&this.expand()}.bind(this),function(){t("body").is(".sidebar-expanded-on-hover")&&this.collapse()}.bind(this))},e.prototype.expand=function(){setTimeout((function(){t("body").removeClass(s).addClass(l)}),this.options.expandTransitionDelay)},e.prototype.collapse=function(){setTimeout((function(){t("body").removeClass(l).addClass(s)}),this.options.expandTransitionDelay)};var u=t.fn.pushMenu;t.fn.pushMenu=h,t.fn.pushMenu.Constructor=e,t.fn.pushMenu.noConflict=function(){return t.fn.pushMenu=u,this},t(document).on("click",r,(function(e){e.preventDefault(),h.call(t(this),"toggle")})),t(window).on("load",(function(){h.call(t(r))}))}(i),function(t){"use strict";function e(t,e){this.element=t,this.options=e,this._setUpListeners()}var n="lte.todolist",i={onCheck:function(t){return t},onUnCheck:function(t){return t}},r={data:'[data-widget="todo-list"]'};function o(r){return this.each((function(){var o=t(this),s=o.data(n);if(!s){var a=t.extend({},i,o.data(),"object"==typeof r&&r);o.data(n,s=new e(o,a))}if("string"==typeof s){if(void 0===s[r])throw new Error("No method named "+r);s[r]()}}))}e.prototype.toggle=function(t){t.parents(r.li).first().toggleClass("done"),t.prop("checked")?this.check(t):this.unCheck(t)},e.prototype.check=function(t){this.options.onCheck.call(t)},e.prototype.unCheck=function(t){this.options.onUnCheck.call(t)},e.prototype._setUpListeners=function(){var e=this;t(this.element).on("change ifChanged","input:checkbox",(function(){e.toggle(t(this))}))};var s=t.fn.todoList;t.fn.todoList=o,t.fn.todoList.Constructor=e,t.fn.todoList.noConflict=function(){return t.fn.todoList=s,this},t(window).on("load",(function(){t(r.data).each((function(){o.call(t(this))}))}))}(i),function(t){"use strict";function e(e,n){this.element=e,this.options=n,t(this.element).addClass(l),t(r+s,this.element).addClass(a),this._setUpListeners()}var n="lte.tree",i={animationSpeed:500,accordion:!0,followLink:!1,trigger:".treeview a"},r=".treeview",o=".treeview-menu",s=".active",a="menu-open",l="tree";function c(r){return this.each((function(){var o=t(this);if(!o.data(n)){var s=t.extend({},i,o.data(),"object"==typeof r&&r);o.data(n,new e(o,s))}}))}e.prototype.toggle=function(t,e){var n=t.next(o),i=t.parent(),s=i.hasClass(a);i.is(r)&&(this.options.followLink&&"#"!==t.attr("href")||e.preventDefault(),s?this.collapse(n,i):this.expand(n,i))},e.prototype.expand=function(e,n){var i=t.Event("expanded.tree");if(this.options.accordion){var r=n.siblings(".menu-open, .active"),s=r.children(o);this.collapse(s,r)}n.addClass(a),e.stop().slideDown(this.options.animationSpeed,function(){t(this.element).trigger(i),n.height("auto")}.bind(this))},e.prototype.collapse=function(e,n){var i=t.Event("collapsed.tree");n.removeClass(a),e.stop().slideUp(this.options.animationSpeed,function(){t(this.element).trigger(i),n.find(r).removeClass(a).find(o).hide()}.bind(this))},e.prototype._setUpListeners=function(){var e=this;t(this.element).on("click",this.options.trigger,(function(n){e.toggle(t(this),n)}))};var d=t.fn.tree;t.fn.tree=c,t.fn.tree.Constructor=e,t.fn.tree.noConflict=function(){return t.fn.tree=d,this},t(window).on("load",(function(){t('[data-widget="tree"]').each((function(){c.call(t(this))}))}))}(i),function(t){"use strict";function e(t){this.options=t,this.bindedResize=!1,this.activate()}var n="lte.layout",i={slimscroll:!0,resetHeight:!0},r=".wrapper",o=".content-wrapper",s=".main-header",a=".sidebar",l=".sidebar-menu",c="fixed";function d(r){return this.each((function(){var o=t(this),s=o.data(n);if(!s){var a=t.extend({},i,o.data(),"object"==typeof r&&r);o.data(n,s=new e(a))}if("string"==typeof r){if(void 0===s[r])throw new Error("No method named "+r);s[r]()}}))}e.prototype.activate=function(){this.fix(),this.fixSidebar(),t("body").removeClass("hold-transition"),this.options.resetHeight&&t("body, html, "+r).css({height:"auto","min-height":"100%"}),this.bindedResize||(t(window).resize(function(){this.fix(),this.fixSidebar(),t(".main-header .logo, "+a).one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(){this.fix(),this.fixSidebar()}.bind(this))}.bind(this)),this.bindedResize=!0),t(l).on("expanded.tree",function(){this.fix(),this.fixSidebar()}.bind(this)),t(l).on("collapsed.tree",function(){this.fix(),this.fixSidebar()}.bind(this))},e.prototype.fix=function(){t(".layout-boxed > "+r).css("overflow","hidden");var e=t(".main-footer").outerHeight()||0,n=t(s).outerHeight()||0,i=n+e,l=t(window).height(),d=t(a).outerHeight()||0;if(t("body").hasClass(c))t(o).css("min-height",l-e);else{var h;h=d+n<=l?(t(o).css("min-height",l-i),l-i):(t(o).css("min-height",d),d);var u=t(".control-sidebar");void 0!==u&&u.height()>h&&t(o).css("min-height",u.height())}},e.prototype.fixSidebar=function(){t("body").hasClass(c)?this.options.slimscroll&&void 0!==t.fn.slimScroll&&0===t(".main-sidebar").find("slimScrollDiv").length&&t(a).slimScroll({height:t(window).height()-t(s).height()+"px"}):void 0!==t.fn.slimScroll&&t(a).slimScroll({destroy:!0}).height("auto")};var h=t.fn.layout;t.fn.layout=d,t.fn.layout.Constuctor=e,t.fn.layout.noConflict=function(){return t.fn.layout=h,this},t(window).on("load",(function(){d.call(t("body"))}))}(i)},111:function(t,e,n){ -/*! - * Timepicker Component for Twitter Bootstrap - * - * Copyright 2013 Joris de Wit and bootstrap-timepicker contributors - * - * Contributors https://github.com/jdewit/bootstrap-timepicker/graphs/contributors - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -!function(t,e,n){"use strict";var i=function(e,n){this.widget="",this.$element=t(e),this.defaultTime=n.defaultTime,this.disableFocus=n.disableFocus,this.disableMousewheel=n.disableMousewheel,this.isOpen=n.isOpen,this.minuteStep=n.minuteStep,this.modalBackdrop=n.modalBackdrop,this.orientation=n.orientation,this.secondStep=n.secondStep,this.snapToStep=n.snapToStep,this.showInputs=n.showInputs,this.showMeridian=n.showMeridian,this.showSeconds=n.showSeconds,this.template=n.template,this.appendWidgetTo=n.appendWidgetTo,this.showWidgetOnAddonClick=n.showWidgetOnAddonClick,this.icons=n.icons,this.maxHours=n.maxHours,this.explicitMode=n.explicitMode,this.handleDocumentClick=function(t){var e=t.data.scope;e.$element.parent().find(t.target).length||e.$widget.is(t.target)||e.$widget.find(t.target).length||e.hideWidget()},this._init()};i.prototype={constructor:i,_init:function(){var e=this;this.showWidgetOnAddonClick&&this.$element.parent().hasClass("input-group")&&this.$element.parent().hasClass("bootstrap-timepicker")?(this.$element.parent(".input-group.bootstrap-timepicker").find(".input-group-addon").on({"click.timepicker":t.proxy(this.showWidget,this)}),this.$element.on({"focus.timepicker":t.proxy(this.highlightUnit,this),"click.timepicker":t.proxy(this.highlightUnit,this),"keydown.timepicker":t.proxy(this.elementKeydown,this),"blur.timepicker":t.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":t.proxy(this.mousewheel,this)})):this.template?this.$element.on({"focus.timepicker":t.proxy(this.showWidget,this),"click.timepicker":t.proxy(this.showWidget,this),"blur.timepicker":t.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":t.proxy(this.mousewheel,this)}):this.$element.on({"focus.timepicker":t.proxy(this.highlightUnit,this),"click.timepicker":t.proxy(this.highlightUnit,this),"keydown.timepicker":t.proxy(this.elementKeydown,this),"blur.timepicker":t.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":t.proxy(this.mousewheel,this)}),!1!==this.template?this.$widget=t(this.getTemplate()).on("click",t.proxy(this.widgetClick,this)):this.$widget=!1,this.showInputs&&!1!==this.$widget&&this.$widget.find("input").each((function(){t(this).on({"click.timepicker":function(){t(this).select()},"keydown.timepicker":t.proxy(e.widgetKeydown,e),"keyup.timepicker":t.proxy(e.widgetKeyup,e)})})),this.setDefaultTime(this.defaultTime)},blurElement:function(){this.highlightedUnit=null,this.updateFromElementVal()},clear:function(){this.hour="",this.minute="",this.second="",this.meridian="",this.$element.val("")},decrementHour:function(){if(this.showMeridian)if(1===this.hour)this.hour=12;else{if(12===this.hour)return this.hour--,this.toggleMeridian();if(0===this.hour)return this.hour=11,this.toggleMeridian();this.hour--}else this.hour<=0?this.hour=this.maxHours-1:this.hour--},decrementMinute:function(t){var e;(e=t?this.minute-t:this.minute-this.minuteStep)<0?(this.decrementHour(),this.minute=e+60):this.minute=e},decrementSecond:function(){var t=this.second-this.secondStep;t<0?(this.decrementMinute(!0),this.second=t+60):this.second=t},elementKeydown:function(t){switch(t.which){case 9:if(t.shiftKey){if("hour"===this.highlightedUnit){this.hideWidget();break}this.highlightPrevUnit()}else{if(this.showMeridian&&"meridian"===this.highlightedUnit||this.showSeconds&&"second"===this.highlightedUnit||!this.showMeridian&&!this.showSeconds&&"minute"===this.highlightedUnit){this.hideWidget();break}this.highlightNextUnit()}t.preventDefault(),this.updateFromElementVal();break;case 27:this.updateFromElementVal();break;case 37:t.preventDefault(),this.highlightPrevUnit(),this.updateFromElementVal();break;case 38:switch(t.preventDefault(),this.highlightedUnit){case"hour":this.incrementHour(),this.highlightHour();break;case"minute":this.incrementMinute(),this.highlightMinute();break;case"second":this.incrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian()}this.update();break;case 39:t.preventDefault(),this.highlightNextUnit(),this.updateFromElementVal();break;case 40:switch(t.preventDefault(),this.highlightedUnit){case"hour":this.decrementHour(),this.highlightHour();break;case"minute":this.decrementMinute(),this.highlightMinute();break;case"second":this.decrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian()}this.update()}},getCursorPosition:function(){var t=this.$element.get(0);if("selectionStart"in t)return t.selectionStart;if(n.selection){t.focus();var e=n.selection.createRange(),i=n.selection.createRange().text.length;return e.moveStart("character",-t.value.length),e.text.length-i}},getTemplate:function(){var t,e,n,i,r,o;switch(this.showInputs?(e='',n='',i='',r=''):(e='',n='',i='',r=''),o=''+(this.showSeconds?'':"")+(this.showMeridian?'':"")+" "+(this.showSeconds?'":"")+(this.showMeridian?'":"")+''+(this.showSeconds?'':"")+(this.showMeridian?'':"")+"
   
"+e+' :'+n+":'+i+" '+r+"
  
",this.template){case"modal":t='
';break;case"dropdown":t='"}return t},getTime:function(){return""===this.hour?"":this.hour+":"+(1===this.minute.toString().length?"0"+this.minute:this.minute)+(this.showSeconds?":"+(1===this.second.toString().length?"0"+this.second:this.second):"")+(this.showMeridian?" "+this.meridian:"")},hideWidget:function(){!1!==this.isOpen&&(this.$element.trigger({type:"hide.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}}),"modal"===this.template&&this.$widget.modal?this.$widget.modal("hide"):this.$widget.removeClass("open"),t(n).off("mousedown.timepicker, touchend.timepicker",this.handleDocumentClick),this.isOpen=!1,this.$widget.detach())},highlightUnit:function(){this.position=this.getCursorPosition(),this.position>=0&&this.position<=2?this.highlightHour():this.position>=3&&this.position<=5?this.highlightMinute():this.position>=6&&this.position<=8?this.showSeconds?this.highlightSecond():this.highlightMeridian():this.position>=9&&this.position<=11&&this.highlightMeridian()},highlightNextUnit:function(){switch(this.highlightedUnit){case"hour":this.highlightMinute();break;case"minute":this.showSeconds?this.highlightSecond():this.showMeridian?this.highlightMeridian():this.highlightHour();break;case"second":this.showMeridian?this.highlightMeridian():this.highlightHour();break;case"meridian":this.highlightHour()}},highlightPrevUnit:function(){switch(this.highlightedUnit){case"hour":this.showMeridian?this.highlightMeridian():this.showSeconds?this.highlightSecond():this.highlightMinute();break;case"minute":this.highlightHour();break;case"second":this.highlightMinute();break;case"meridian":this.showSeconds?this.highlightSecond():this.highlightMinute()}},highlightHour:function(){var t=this.$element.get(0),e=this;this.highlightedUnit="hour",t.setSelectionRange&&setTimeout((function(){e.hour<10?t.setSelectionRange(0,1):t.setSelectionRange(0,2)}),0)},highlightMinute:function(){var t=this.$element.get(0),e=this;this.highlightedUnit="minute",t.setSelectionRange&&setTimeout((function(){e.hour<10?t.setSelectionRange(2,4):t.setSelectionRange(3,5)}),0)},highlightSecond:function(){var t=this.$element.get(0),e=this;this.highlightedUnit="second",t.setSelectionRange&&setTimeout((function(){e.hour<10?t.setSelectionRange(5,7):t.setSelectionRange(6,8)}),0)},highlightMeridian:function(){var t=this.$element.get(0),e=this;this.highlightedUnit="meridian",t.setSelectionRange&&(this.showSeconds?setTimeout((function(){e.hour<10?t.setSelectionRange(8,10):t.setSelectionRange(9,11)}),0):setTimeout((function(){e.hour<10?t.setSelectionRange(5,7):t.setSelectionRange(6,8)}),0))},incrementHour:function(){if(this.showMeridian){if(11===this.hour)return this.hour++,this.toggleMeridian();12===this.hour&&(this.hour=0)}this.hour!==this.maxHours-1?this.hour++:this.hour=0},incrementMinute:function(t){var e;(e=t?this.minute+t:this.minute+this.minuteStep-this.minute%this.minuteStep)>59?(this.incrementHour(),this.minute=e-60):this.minute=e},incrementSecond:function(){var t=this.second+this.secondStep-this.second%this.secondStep;t>59?(this.incrementMinute(!0),this.second=t-60):this.second=t},mousewheel:function(e){if(!this.disableMousewheel){e.preventDefault(),e.stopPropagation();var n=e.originalEvent.wheelDelta||-e.originalEvent.detail,i=null;switch("mousewheel"===e.type?i=-1*e.originalEvent.wheelDelta:"DOMMouseScroll"===e.type&&(i=40*e.originalEvent.detail),i&&(e.preventDefault(),t(this).scrollTop(i+t(this).scrollTop())),this.highlightedUnit){case"minute":n>0?this.incrementMinute():this.decrementMinute(),this.highlightMinute();break;case"second":n>0?this.incrementSecond():this.decrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian();break;default:n>0?this.incrementHour():this.decrementHour(),this.highlightHour()}return!1}},changeToNearestStep:function(t,e){return t%e==0?t:Math.round(t%e/e)?(t+(e-t%e))%60:t-t%e},place:function(){if(!this.isInline){var n=this.$widget.outerWidth(),i=this.$widget.outerHeight(),r=t(e).width(),o=t(e).height(),s=t(e).scrollTop(),a=parseInt(this.$element.parents().filter((function(){return"auto"!==t(this).css("z-index")})).first().css("z-index"),10)+10,l=this.component?this.component.parent().offset():this.$element.offset(),c=this.component?this.component.outerHeight(!0):this.$element.outerHeight(!1),d=this.component?this.component.outerWidth(!0):this.$element.outerWidth(!1),h=l.left,u=l.top;this.$widget.removeClass("timepicker-orient-top timepicker-orient-bottom timepicker-orient-right timepicker-orient-left"),"auto"!==this.orientation.x?(this.$widget.addClass("timepicker-orient-"+this.orientation.x),"right"===this.orientation.x&&(h-=n-d)):(this.$widget.addClass("timepicker-orient-left"),l.left<0?h-=l.left-10:l.left+n>r&&(h=r-n-10));var f,p,m=this.orientation.y;"auto"===m&&(f=-s+l.top-i,p=s+o-(l.top+c+i),m=Math.max(f,p)===p?"top":"bottom"),this.$widget.addClass("timepicker-orient-"+m),"top"===m?u+=c:u-=i+parseInt(this.$widget.css("padding-top"),10),this.$widget.css({top:u,left:h,zIndex:a})}},remove:function(){t("document").off(".timepicker"),this.$widget&&this.$widget.remove(),delete this.$element.data().timepicker},setDefaultTime:function(t){if(this.$element.val())this.updateFromElementVal();else if("current"===t){var e=new Date,n=e.getHours(),i=e.getMinutes(),r=e.getSeconds(),o="AM";0!==r&&60===(r=Math.ceil(e.getSeconds()/this.secondStep)*this.secondStep)&&(i+=1,r=0),0!==i&&60===(i=Math.ceil(e.getMinutes()/this.minuteStep)*this.minuteStep)&&(n+=1,i=0),this.showMeridian&&(0===n?n=12:n>=12?(n>12&&(n-=12),o="PM"):o="AM"),this.hour=n,this.minute=i,this.second=r,this.meridian=o,this.update()}else!1===t?(this.hour=0,this.minute=0,this.second=0,this.meridian="AM"):this.setTime(t)},setTime:function(t,e){if(t){var n,i,r,o,s,a;if("object"==typeof t&&t.getMonth)r=t.getHours(),o=t.getMinutes(),s=t.getSeconds(),this.showMeridian&&(a="AM",r>12&&(a="PM",r%=12),12===r&&(a="PM"));else{if((n=(/a/i.test(t)?1:0)+(/p/i.test(t)?2:0))>2)return void this.clear();if(r=(i=t.replace(/[^0-9\:]/g,"").split(":"))[0]?i[0].toString():i.toString(),this.explicitMode&&r.length>2&&r.length%2!=0)return void this.clear();o=i[1]?i[1].toString():"",s=i[2]?i[2].toString():"",r.length>4&&(s=r.slice(-2),r=r.slice(0,-2)),r.length>2&&(o=r.slice(-2),r=r.slice(0,-2)),o.length>2&&(s=o.slice(-2),o=o.slice(0,-2)),r=parseInt(r,10),o=parseInt(o,10),s=parseInt(s,10),isNaN(r)&&(r=0),isNaN(o)&&(o=0),isNaN(s)&&(s=0),s>59&&(s=59),o>59&&(o=59),r>=this.maxHours&&(r=this.maxHours-1),this.showMeridian?(r>12&&(n=2,r-=12),n||(n=1),0===r&&(r=12),a=1===n?"AM":"PM"):r<12&&2===n?r+=12:r>=this.maxHours?r=this.maxHours-1:(r<0||12===r&&1===n)&&(r=0)}this.hour=r,this.snapToStep?(this.minute=this.changeToNearestStep(o,this.minuteStep),this.second=this.changeToNearestStep(s,this.secondStep)):(this.minute=o,this.second=s),this.meridian=a,this.update(e)}else this.clear()},showWidget:function(){this.isOpen||this.$element.is(":disabled")||(this.$widget.appendTo(this.appendWidgetTo),t(n).on("mousedown.timepicker, touchend.timepicker",{scope:this},this.handleDocumentClick),this.$element.trigger({type:"show.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}}),this.place(),this.disableFocus&&this.$element.blur(),""===this.hour&&(this.defaultTime?this.setDefaultTime(this.defaultTime):this.setTime("0:0:0")),"modal"===this.template&&this.$widget.modal?this.$widget.modal("show").on("hidden",t.proxy(this.hideWidget,this)):!1===this.isOpen&&this.$widget.addClass("open"),this.isOpen=!0)},toggleMeridian:function(){this.meridian="AM"===this.meridian?"PM":"AM"},update:function(t){this.updateElement(),t||this.updateWidget(),this.$element.trigger({type:"changeTime.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}})},updateElement:function(){this.$element.val(this.getTime()).change()},updateFromElementVal:function(){this.setTime(this.$element.val())},updateWidget:function(){if(!1!==this.$widget){var t=this.hour,e=1===this.minute.toString().length?"0"+this.minute:this.minute,n=1===this.second.toString().length?"0"+this.second:this.second;this.showInputs?(this.$widget.find("input.bootstrap-timepicker-hour").val(t),this.$widget.find("input.bootstrap-timepicker-minute").val(e),this.showSeconds&&this.$widget.find("input.bootstrap-timepicker-second").val(n),this.showMeridian&&this.$widget.find("input.bootstrap-timepicker-meridian").val(this.meridian)):(this.$widget.find("span.bootstrap-timepicker-hour").text(t),this.$widget.find("span.bootstrap-timepicker-minute").text(e),this.showSeconds&&this.$widget.find("span.bootstrap-timepicker-second").text(n),this.showMeridian&&this.$widget.find("span.bootstrap-timepicker-meridian").text(this.meridian))}},updateFromWidgetInputs:function(){if(!1!==this.$widget){var t=this.$widget.find("input.bootstrap-timepicker-hour").val()+":"+this.$widget.find("input.bootstrap-timepicker-minute").val()+(this.showSeconds?":"+this.$widget.find("input.bootstrap-timepicker-second").val():"")+(this.showMeridian?this.$widget.find("input.bootstrap-timepicker-meridian").val():"");this.setTime(t,!0)}},widgetClick:function(e){e.stopPropagation(),e.preventDefault();var n=t(e.target),i=n.closest("a").data("action");i&&this[i](),this.update(),n.is("input")&&n.get(0).setSelectionRange(0,2)},widgetKeydown:function(e){var n=t(e.target),i=n.attr("class").replace("bootstrap-timepicker-","");switch(e.which){case 9:if(e.shiftKey){if("hour"===i)return this.hideWidget()}else if(this.showMeridian&&"meridian"===i||this.showSeconds&&"second"===i||!this.showMeridian&&!this.showSeconds&&"minute"===i)return this.hideWidget();break;case 27:this.hideWidget();break;case 38:switch(e.preventDefault(),i){case"hour":this.incrementHour();break;case"minute":this.incrementMinute();break;case"second":this.incrementSecond();break;case"meridian":this.toggleMeridian()}this.setTime(this.getTime()),n.get(0).setSelectionRange(0,2);break;case 40:switch(e.preventDefault(),i){case"hour":this.decrementHour();break;case"minute":this.decrementMinute();break;case"second":this.decrementSecond();break;case"meridian":this.toggleMeridian()}this.setTime(this.getTime()),n.get(0).setSelectionRange(0,2)}},widgetKeyup:function(t){(65===t.which||77===t.which||80===t.which||46===t.which||8===t.which||t.which>=48&&t.which<=57||t.which>=96&&t.which<=105)&&this.updateFromWidgetInputs()}},t.fn.timepicker=function(e){var n=Array.apply(null,arguments);return n.shift(),this.each((function(){var r=t(this),o=r.data("timepicker"),s="object"==typeof e&&e;o||r.data("timepicker",o=new i(this,t.extend({},t.fn.timepicker.defaults,s,t(this).data()))),"string"==typeof e&&o[e].apply(o,n)}))},t.fn.timepicker.defaults={defaultTime:"current",disableFocus:!1,disableMousewheel:!1,isOpen:!1,minuteStep:15,modalBackdrop:!1,orientation:{x:"auto",y:"auto"},secondStep:15,snapToStep:!1,showSeconds:!1,showInputs:!0,showMeridian:!0,template:"dropdown",appendWidgetTo:"body",showWidgetOnAddonClick:!0,icons:{up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down"},maxHours:24,explicitMode:!1},t.fn.timepicker.Constructor=i,t(n).on("focus.timepicker.data-api click.timepicker.data-api",'[data-provide="timepicker"]',(function(e){var n=t(this);n.data("timepicker")||(e.preventDefault(),n.timepicker())}))}(n(9755),window,document)},4561:function(t,e,n){"use strict";n.d(e,{Z:function(){return g}});var i=n(9755),r=n.n(i),o=n(3239),s=n.n(o),a=n(7361);function l(t,e){for(var n=0;n a");i(r);var o=function(t,e){var n=window.MutationObserver||window.WebKitMutationObserver;if(t&&1===t.nodeType){if(n){var i=new n(e);return i.observe(t,{childList:!0,subtree:!0}),i}window.addEventListener&&(t.addEventListener("DOMNodeInserted",e,!1),t.addEventListener("DOMNodeRemoved",e,!1))}}(n,(function(t){[].forEach.call(t,(function(t){t.addedNodes.length<1||[].forEach.call(t.addedNodes,(function(t){i(t.querySelectorAll("div[data-json] > a"))}))}))}))}))}}])&&l(e.prototype,n),i&&l(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}(),d=n(300),h=n(3423),u=n(1611),f=n(9755);function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;if(p(this,t),void 0!==e){this.target=e,this.onChangeCallback=n;var i=f("body");this.initUpload=i.data("init-upload"),this.fileExtract=i.data("file-extract"),this.fileExtractForced=i.data("file-extract-forced"),this.hashAlgo=i.data("hash-algo"),this.addListeners(),new h.Z(e)}else console.log("Impossible to add ems listeners as no target is defined")}var e,n,i;return e=t,n=[{key:"addListeners",value:function(){this.addCheckBoxListeners(),this.addSelect2Listeners(),this.addCollapsibleCollectionListeners(),this.addSortableListListeners(),this.addNestedSortableListeners(),this.addCodeEditorListeners(),this.addRemoveButtonListeners(),this.addObjectPickerListeners(),this.addFieldsToDisplayByValue(),this.addFileUploaderListerners(),this.addA2LixLibSfCollection(),this.addDisabledButtonTreatListeners(),this.addDateRangeListeners(),(0,u.B)(this.target)}},{key:"addFieldsToDisplayByValue",value:function(){for(var t=this.target.getElementsByClassName("fields-to-display-by-input-value"),e=function(e){var n=t[e].closest(".fields-to-display-by-value").getElementsByClassName("fields-to-display-for");t[e].onchange=function(){for(var i=t[e].value,r=0;r0&&(u=l.data("max-lines"));var f=1;l.data("min-lines")&&l.data("min-lines")>0&&(f=l.data("min-lines"));var p=s().edit(a,{mode:d,readOnly:c,maxLines:u,minLines:f,theme:h});p.on("change",(function(t){l.val(p.getValue()),"function"==typeof e.onChangeCallback&&e.onChangeCallback()})),p.commands.addCommands([{name:"fullscreen",bindKey:{win:"F11",mac:"Esc"},exec:function(t){o.hasClass("panel-fullscreen")?(t.setOption("maxLines",u),o.removeClass("panel-fullscreen"),t.setAutoScrollEditorIntoView(!1)):(t.setOption("maxLines",1/0),o.addClass("panel-fullscreen"),t.setAutoScrollEditorIntoView(!0)),t.resize()}},{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e){t.getAceConfig().loadModule("ace/ext/keybinding_menu",(function(t){t.init(e),e.showKeyboardShortcuts()}))}}])},o=0;o div",maxLevels:e,expression:/()(.+)/,isTree:n,expandOnHover:700,startCollapsed:!0})})),r()(this.target).find(".reorder-button").on("click",(function(){var t=r()(this).closest("form"),e=t.find(".nested-sortable").nestedSortable("toHierarchy",{startDepthCount:0});t.find("input.reorder-items").val(JSON.stringify(e)).trigger("change")}));var t=".json_menu_editor_fieldtype_widget ";0===r()(this.target).find(t).length&&(t=".mjs-nestedSortable "),r()(this.target).hasClass("mjs-nestedSortable")&&(t=""),r()(this.target).find(t+".button-collapse").click((function(t){t.preventDefault();var e="true"===f(this).attr("aria-expanded");f(this).parent().find("> button").attr("aria-expanded",!e);var n=f(this).closest(".collapsible-container");e?n.find("ol").first().show():n.find("ol").first().hide()})),r()(this.target).find(t+".button-collapse-all").click((function(t){t.preventDefault();var e="true"===f(this).attr("aria-expanded"),n=f(this).closest(".collapsible-container");n.find(".button-collapse").attr("aria-expanded",!e),n.find(".button-collapse-all").attr("aria-expanded",!e),e?n.find("ol").not(".not-collapsible").show():n.find("ol").not(".not-collapsible").hide()}))}},{key:"initFilesUploader",value:function(e,n){var i=f(n).closest(".file-uploader-row"),r=i.data("multiple"),o=i.find(".tab-pane.asset-preview-tab"),s=i.find(".tab-pane.asset-upload-tab"),a=i.find(".tab-pane.asset-list-tab > ol");void 0!==r&&(a.removeClass("hidden"),o.addClass("hidden"),s.addClass("hidden"));var l=parseInt(a.attr("data-file-list-index"));a.attr("data-file-list-index",l+e.length);for(var c=0;c1&&void 0!==arguments[1]&&arguments[1],n=this,i=f(t).find(".sha1"),r=f(t).find(".name"),o=f(t).find(".date"),s=f(t).find(".author"),a=f(t).find(".language"),l=f(t).find(".content"),c=f(t).find(".title"),d=f(t).find(".progress-text"),h=f(t).find(".progress-number"),u=f(t).find(".asset-preview-tab"),p=f(t).find(".asset-upload-tab"),m=(e?this.fileExtractForced:this.fileExtract).replace(/__file_identifier__/g,f(i).val()).replace(/__file_name__/g,f(r).val());f(d).html("Extracting information from asset..."),f(h).html(""),p.show(),u.hide(),window.ajaxRequest.get(m).success((function(t){f(o).val(t.date),f(s).val(t.author),f(a).val(t.language),f(l).val(t.content),f(c).val(t.title)})).fail((function(t){if(!t||!Array.isArray(t.warning)||1!==t.warning.length){var e=f("#modal-notifications");f(e.find(".modal-body")).html("Something went wrong while extracting information from file"),e.modal("show")}})).always((function(){f(d).html(""),p.hide(),u.show(),"function"==typeof n.onChangeCallback&&n.onChangeCallback()}))}},{key:"fileDragHover",value:function(t){t.stopPropagation(),t.preventDefault()}},{key:"onAssetData",value:function(t,e){var n=f(t),i=n.find(".sha1"),r=void 0!==n.data("meta-fields"),o=n.find(".type"),s=n.find(".name"),a=n.find(".asset-hash-signature"),l=n.find(".date"),c=n.find(".author"),d=n.find(".language"),h=n.find(".content"),u=n.find(".title"),p=n.find(".view-asset-button"),m=n.find(".clear-asset-button"),g=n.find(".asset-preview-tab"),v=n.find(".asset-upload-tab"),y=n.find(".img-responsive");i.val(e.sha1),a.empty().append(e.sha1),o.val(e.mimetype),s.val(e.filename),p.attr("href",e.view_url),y.attr("src",e.preview_url),l.val(""),c.val(""),d.val(""),h.val(""),u.val(""),p.removeClass("disabled"),m.removeClass("disabled"),g.removeClass("hidden"),v.addClass("hidden"),r?this.fileDataExtrator(t):"function"==typeof this.onChangeCallback&&this.onChangeCallback()}},{key:"addFileUploaderListerners",value:function(){var t=r()(this.target),e=this;new c(this.target),t.find(".file-uploader-row").on("updateAssetData",(function(t){e.onAssetData(this,t.originalEvent.detail)})),t.find(".extract-file-info").click((function(){var t=f(this).closest(".modal-content");e.fileDataExtrator(t,!0)})),t.find(".clear-asset-button").click((function(){var t=f(this).closest(".file-uploader-row"),e=f(t).find(".sha1"),n=f(t).find(".type"),i=f(t).find(".name"),r=f(t).find(".progress-bar"),o=f(t).find(".progress-text"),s=f(t).find(".progress-number"),a=f(t).find(".asset-preview-tab"),l=f(t).find(".asset-upload-tab"),c=f(t).find(".asset-hash-signature"),d=f(t).find(".date"),h=f(t).find(".author"),u=f(t).find(".language"),p=f(t).find(".content"),m=f(t).find(".title");return f(t).find(".file-uploader-input").val(""),e.val(""),c.empty(),n.val(""),i.val(""),f(d).val(""),f(h).val(""),f(u).val(""),f(p).val(""),f(m).val(""),f(r).css("width","0%"),f(o).html(""),f(s).html(""),a.addClass("hidden"),l.removeClass("hidden"),f(t).find(".view-asset-button").addClass("disabled"),f(this).addClass("disabled"),!1}));var n=this.target.getElementsByClassName("file-uploader-input");[].forEach.call(n,(function(t){t.onchange=function(){e.initFilesUploader(t.files,t)}})),t.find(".file-uploader-row").each((function(){this.addEventListener("dragover",e.fileDragHover,!1),this.addEventListener("dragleave",e.fileDragHover,!1),this.addEventListener("drop",(function(t){e.fileDragHover(t);var n=t.target.files||t.dataTransfer.files;e.initFilesUploader(n,this)}),!1)}))}},{key:"addSortableListListeners",value:function(){r()(this.target).find("ul.sortable").sortable()}},{key:"addCheckBoxListeners",value:function(){var t=this;r()(this.target).iCheck({checkboxClass:"icheckbox_square-blue",radioClass:"iradio_square-blue",increaseArea:"20%"}).on("ifChecked",(function(){r()(this).attr("data-grouped-checkbox-target")&&r()(t.target).find(r()(this).attr("data-grouped-checkbox-target")).iCheck("check")})).on("ifUnchecked",(function(){r()(this).attr("data-grouped-checkbox-target")&&r()(t.target).find(r()(this).attr("data-grouped-checkbox-target")).iCheck("uncheck")}))}},{key:"addObjectPickerListeners",value:function(){var t=f("body").data("search-api");r()(this.target).find(".objectpicker").each((function(){var e=r()(this),n=e.data("type"),i=e.data("search-id"),o=e.data("query-search"),s=e.data("query-search-label"),a=e.data("circleOnly"),l=e.data("dynamic-loading"),c=e.data("sortable"),d=e.data("locale"),h=e.data("referrer-ems-id"),u={escapeMarkup:function(t){return t},templateResult:formatRepo,templateSelection:formatRepoSelection,allowClear:!0,placeholder:s&&""!==s?s:"Search"};e.attr("multiple")&&(u.closeOnSelect=!1),l&&(u.minimumInputLength=1,u.ajax={url:t,dataType:"json",delay:250,data:function(t){var e={q:t.term,page:t.page,type:n,searchId:i,querySearch:o};return void 0!==d&&(e.locale=d),void 0!==h&&(e.referrerEmsId=h),void 0!==a&&(e.circle=a),e},processResults:function(t,e){return e.page=e.page||1,{results:t.items,pagination:{more:30*e.pager?1:nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:null;new i.Z(t.get(0),e),!1===g&&(g=(new d).getConfig()),t.find(".remove-content-button").on("click",(function(t){t.preventDefault();var n=h(this).closest(".collection-item-panel");n.find("input._ems_internal_deleted").val("deleted"),n.hide(),e&&e()})),e&&(t.find("input").not(".ignore-ems-update,.datetime-picker,datetime-picker").on("input",e),t.find("select").not(".ignore-ems-update").on("change",e),t.find("textarea").not(".ignore-ems-update").on("input",e)),t.find(".add-content-button").on("click",(function(t){t.preventDefault();var n=h(this).closest(".collection-panel"),i=n.data("index"),r=n.data("prototype"),o=new RegExp(n.data("prototype-name"),"g"),s=new RegExp(n.data("prototype-label"),"g"),a=h(r.replace(s,i+1).replace(o,i));n.data("index",i+1),v(a),n.children(".panel-body").children(".collection-panel-container").append(a),e&&e()})),t.find(".ems-sortable > div").sortable({handle:".ems-handle"}),t.find(".selectpicker").selectpicker(),t.find(".ckeditor_ems").each((function(){var t=h(this).attr("data-height");t||(t=400);var n=h(this).attr("data-format-tags");n&&(g.format_tags=n);var i=h(this).attr("data-styles-set");i&&(g.stylesSet=i);var r=h(this).attr("data-content-css");r&&(g.contentsCss=r);var o=h(this).attr("data-lang");o&&(g.language=o),g.referrerEmsId=h(this).attr("data-referrer-ems-id");var s=h(this).attr("data-table-default-css");if(void 0===s&&(s="table table-bordered"),g.height=t,g.div_wrapTable="true",g.allowedContent=!0,g.extraAllowedContent="p(*)[*]{*};div(*)[*]{*};li(*)[*]{*};ul(*)[*]{*}",CKEDITOR.dtd.$removeEmpty.i=0,CKEDITOR.on("instanceReady",(function(t){var e,n,i=t.editor,r=null===(e=g)||void 0===e||null===(n=e.ems)||void 0===n?void 0:n.translations;if(void 0!==r&&r.hasOwnProperty(i.langCode)){var o=r[i.langCode];[].concat(f(Object.getOwnPropertyNames(i.lang)),f(Object.getOwnPropertyNames(Object.getPrototypeOf(i.lang)))).forEach((function(t){Object.entries(o).forEach((function(e){var n=u(e,2),r=n[0],o=n[1],s=r.split(".");t===s[0]&&i.lang[t].hasOwnProperty(s[1])&&(i.lang[t][s[1]]=o)}))}))}})),e&&!CKEDITOR.instances[h(this).attr("id")]&&!1===h(this).hasClass("ignore-ems-update")?CKEDITOR.replace(this,g).on("key",e):CKEDITOR.replace(this,g),CKEDITOR.on("dialogDefinition",(function(t){var e=t.data.name,n=t.data.definition;if("table"===e){var i=n.getContents("info");i.get("txtBorder").default=0,i.get("txtCellPad").default="",i.get("txtCellSpace").default="",i.get("txtWidth").default="",n.getContents("advanced").get("advCSSClasses").default=s}})),g.hasOwnProperty("emsAjaxPaste")){var a=CKEDITOR.instances[h(this).attr("id")];a.on("beforePaste",(function(t){var e=t.data.dataTransfer.getData("text/html");e&&""!==e&&(t.cancel(),fetch(g.emsAjaxPaste,{method:"POST",body:JSON.stringify({content:e}),headers:{"Content-Type":"application/json"}}).then((function(t){return t.ok?t.json().then((function(t){a.fire("paste",{type:"auto",dataValue:t.content,method:"paste"})})):Promise.reject(t)})).catch((function(){console.error("error pasting")})))}))}})),t.find(".colorpicker-component").colorpicker(),e&&t.find(".colorpicker-component").bind("changeColor",e),t.find(".timepicker").each((function(){var t={showMeridian:h(this).data("show-meridian"),explicitMode:h(this).data("explicit-mode"),minuteStep:h(this).data("minute-step"),disableMousewheel:!0,defaultTime:!1};h(this).unbind("change"),h(this).not(".ignore-ems-update")?e&&h(this).timepicker(t).on("changeTime.timepicker",e):h(this).timepicker(t)})),t.find(".datepicker").each((function(){h(this).unbind("change");var t={format:h(this).attr("data-date-format"),todayBtn:!0,weekStart:h(this).attr("data-week-start"),daysOfWeekHighlighted:h(this).attr("data-days-of-week-highlighted"),daysOfWeekDisabled:h(this).attr("data-days-of-week-disabled"),todayHighlight:h(this).attr("data-today-highlight")};h(this).attr("data-multidate")&&"false"!==h(this).attr("data-multidate")&&(t.multidate=!0),h(this).datepicker(t),e&&h(this).not(".ignore-ems-update").on("dp.change",e)})),t.find(".datetime-picker").each((function(){var t=h(this);t.unbind("change"),t.datetimepicker({keepInvalid:!0,extraFormats:[moment.ISO_8601]}),e&&t.not(".ignore-ems-update").on("dp.change",e)})),t.find("textarea,input").each((function(){var t=this.parentNode.querySelector(".text-counter");if(null!==t&&t.hasAttribute("data-counter-label")&&t.parentNode===this.parentNode){var e=t.getAttribute("data-counter-label"),n=function(n){var i=n.value.length;t.textContent=e.replace("%count%",i)};this.addEventListener("keyup",(function(t){n(t.target)})),n(this)}}))}},7361:function(t,e,n){"use strict";n.d(e,{O:function(){return c}});var i=n(4127),r=n(1611),o=(n(3423),n(9755));function s(t,e){for(var n=0;n div.alert").forEach((function(t){t.remove()})),this.loadingElement.style.display="block",this.modal.querySelectorAll("input, button, .select2, textarea").forEach((function(t){t.classList.add("emsco-modal-has-been-disabled"),t.setAttribute("disabled","disabled")}))}},{key:"stateReady",value:function(){this.loadingElement.style.display="none",this.modal.querySelector(".ajax-modal-body").style.display="block",this.modal.querySelectorAll("input.emsco-modal-has-been-disabled, button.emsco-modal-has-been-disabled, .select2.emsco-modal-has-been-disabled, textarea.emsco-modal-has-been-disabled").forEach((function(t){t.removeAttribute("disabled"),t.classList.remove("emsco-modal-has-been-disabled")}))}},{key:"load",value:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.modal.querySelector(".modal-dialog");r.classList.remove("modal-xs","modal-sm","modal-md","modal-lg","modal-auto-size"),t.hasOwnProperty("size")?r.classList.add("modal-"+t.size):r.classList.add("modal-md"),t.hasOwnProperty("noLoading")||this.stateLoading(),t.hasOwnProperty("title")&&(this.modal.querySelector(".modal-title").innerHTML=t.title),this.$modal.modal("show");var o={method:"GET",headers:{"Content-Type":"application/json"}};t.hasOwnProperty("data")&&(o.method="POST",o.body=t.data),fetch(t.url,o).then((function(t){return t.ok?t.json().then((function(r){n.ajaxReady(r,t.url,e,i),n.stateReady()})):Promise.reject(t)})).catch((function(t){if("function"!=typeof i)throw n.printMessage("error","Error loading ..."),t;i(t)}))}},{key:"submitForm",value:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;for(var r in CKEDITOR.instances)CKEDITOR.instances.hasOwnProperty(r)&&CKEDITOR.instances[r].updateElement();var o=new FormData(this.modal.querySelector("form"));this.stateLoading(),fetch(t,{method:"POST",body:o}).then((function(t){return t.ok?t.json().then((function(i){n.ajaxReady(i,t.url,e),n.stateReady()})):Promise.reject(t)})).catch((function(t){if("function"!=typeof i)throw n.printMessage("error","Error loading ..."),t;i(t)}))}},{key:"ajaxReady",value:function(t,e,n){var s=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(t.hasOwnProperty("modalClose")&&!0===t.modalClose)return"function"==typeof n&&n(t,this.modal),void this.$modal.modal("hide");t.hasOwnProperty("modalTitle")&&this.$modal.find(".modal-title").html(t.modalTitle),t.hasOwnProperty("modalBody")&&(this.$modal.find(".ajax-modal-body").html(t.modalBody),this.$modal.find(":input").each((function(){o(this).addClass("ignore-ems-update")})),(0,i.n)(this.$modal)),t.hasOwnProperty("modalFooter")?this.$modal.find(".ajax-modal-footer").html(t.modalFooter):this.$modal.find(".ajax-modal-footer").html('');var c=t.hasOwnProperty("modalMessages")?t.modalMessages:[];c.forEach((function(t){var e=Object.keys(t)[0],n=t[e];s.printMessage(e,n)}));var d=this.modal.querySelector("form");d&&d.addEventListener("submit",(function(t){l.submitForm(e,n,a),t.preventDefault()}));var h=this.modal.querySelector("#ajax-modal-submit");h&&(h.addEventListener("click",(function(){l.submitForm(e,n,a)})),document.addEventListener("keydown",this.onKeyDown)),(0,r.B)(this.modal),"function"==typeof n&&n(t,this.modal)}},{key:"printMessage",value:function(t,e){var n;switch(t){case"warning":n="alert-warning";break;case"error":n="alert-danger";break;case"info":n="alert-info";break;default:n="alert-success"}this.modal.querySelector(".ajax-modal-body").insertAdjacentHTML("afterbegin",'")}}],n&&s(e.prototype,n),a&&s(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}(),l=new a("#ajax-modal"),c=new a("#pick-file-server-modal");e.Z=l},1611:function(t,e,n){"use strict";n.d(e,{B:function(){return r}});var i=n(9755);function r(t){for(var e=t.querySelectorAll('[data-toggle="tooltip"]'),n=0;n"+t.text+""},window.formatRepoSelection=function(t){var e,n,r;t.hasOwnProperty("element")&&t.element instanceof HTMLElement?e=null!==(n=t.element.dataset.tooltip)&&void 0!==n?n:null:e=null!==(r=t.tooltip)&&void 0!==r?r:null;if(null!==e){var o=i(''+t.text+"");return o.tooltip(),o}return t.text},window.objectPickerListeners=function(t,e){var n=t.data("type"),i=t.data("dynamic-loading"),r=t.data("search-id"),o=t.data("query-search"),s={escapeMarkup:function(t){return t},templateResult:formatRepo,templateSelection:formatRepoSelection};e?s.maximumSelectionLength=e:t.attr("multiple")&&(s.allowClear=!0,s.closeOnSelect=!1),i&&(s.ajax={url:object_search_url,dataType:"json",delay:250,data:function(t){return{q:t.term,page:t.page,type:n,searchId:r,querySearch:o}},processResults:function(t,e){return e.page=e.page||1,{results:t.items,pagination:{more:30*e.page=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(a&&l){if(this.prev=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},t}function w(t,e,n,i,r,o,s){try{var a=t[o](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(i,r)}function T(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function s(t){w(o,i,r,s,a,"next",t)}function a(t){w(o,i,r,s,a,"throw",t)}s(void 0)}))}}function C(t,e){for(var n=0;n div.media-lib-load-more"),listFiles:e.querySelector("ul.media-lib-list-files"),listFolders:e.querySelector("ul.media-lib-list-folders"),listUploads:e.querySelector("ul.media-lib-list-uploads")}),this._init()}var e,n,i,o,s,a,l,c,d,h;return e=t,n=[{key:"_init",value:function(){var t=this;this.loading(!0),this._addEventListeners(),this._initInfiniteScrollFiles(k(this,O).files,k(this,O).loadMoreFiles),Promise.allSettled([this._getFolders(),this._getFiles()]).then((function(){return t.loading(!1)}))}},{key:"isLoading",value:function(){return this.element.classList.contains("loading")}},{key:"loading",value:function(t){var e=this.element.querySelectorAll("button:not(.close-button)"),n=!!k(this,O).inputUpload&&k(this,O).header.querySelector('label[for="'.concat(k(this,O).inputUpload.id,'"]'));t?(this.element.classList.add("loading"),e.forEach((function(t){return t.disabled=!0})),n&&n.setAttribute("disabled","disabled")):(this.element.classList.remove("loading"),e.forEach((function(t){return t.disabled=!1})),n&&n.removeAttribute("disabled"))}},{key:"getSearchBox",value:function(){return k(this,O).header.querySelector(".media-lib-search")}},{key:"getFolders",value:function(){return k(this,O).listFolders.querySelectorAll(".media-lib-folder")}},{key:"getSelectionFile",value:function(){var t=this.getSelectionFiles();return 1===t.length?t[0]:null}},{key:"getSelectionFiles",value:function(){return k(this,O).listFiles.querySelectorAll(".active")}},{key:"_addEventListeners",value:function(){var t=this;this.element.onkeyup=function(e){e.shiftKey&&x(t,P,null),e.target.classList.contains("media-lib-search")&&t._onSearchInput(e.target,1e3)},this.element.onclick=function(e){if(!t.isLoading()){var n=e.target.classList;n.contains("media-lib-search")||(n.contains("media-lib-file")&&t._onClickFile(e.target,e),n.contains("media-lib-folder")&&t._onClickFolder(e.target),n.contains("btn-file-upload")&&k(t,O).inputUpload.click(),n.contains("btn-file-view")&&t._onClickButtonFileView(e.target),n.contains("btn-file-rename")&&t._onClickButtonFileRename(e.target),n.contains("btn-file-delete")&&t._onClickButtonFileDelete(e.target),n.contains("btn-files-delete")&&t._onClickButtonFilesDelete(e.target),n.contains("btn-files-move")&&t._onClickButtonFilesMove(e.target),n.contains("btn-folder-add")&&t._onClickButtonFolderAdd(),n.contains("btn-folder-delete")&&t._onClickButtonFolderDelete(e.target),n.contains("btn-folder-rename")&&t._onClickButtonFolderRename(e.target),n.contains("btn-home")&&t._onClickButtonHome(e.target),n.contains("breadcrumb-item")&&t._onClickBreadcrumbItem(e.target),["media-lib-file","btn-file-rename","btn-file-delete","btn-files-delete","btn-files-move","btn-file-view"].some((function(t){return n.contains(t)}))||t._selectFilesReset())}},k(this,O).inputUpload.onchange=function(e){t.isLoading()||e.target.classList.contains("file-uploader-input")&&(t._uploadFiles(Array.from(e.target.files)),e.target.value="")},["dragenter","dragover","dragleave","drop","dragend"].forEach((function(e){k(t,O).files.addEventListener(e,(function(e){return t._onDragUpload(e)}))}))}},{key:"_onClickFile",value:function(t,e){var n=this;this.loading(!0);var i=1===this._selectFiles(t,e).length?t.dataset.id:null;this._getHeader(i).then((function(){n.loading(!1)}))}},{key:"_onClickButtonFileView",value:function(t){var e=this,n=function(t,n){var i=k(e,O).listFiles.querySelector(".media-lib-file[data-id='".concat(t,"']")).closest("li")[n];return i?i.querySelector(".media-lib-file"):null},i=function(t,i,o){var a=r.Z.modal.querySelector(".btn-preview-".concat(t));a&&null!==n(o,i)&&(a.style.display="inline-block",a.addEventListener("click",(function(){var t=n(o,i);if(t){var r=k(e,O).files.querySelector(".media-lib-file-header"),a=r?r.getBoundingClientRect().height:0;e._selectFilesReset(),e._selectFile(t),k(e,O).files.scrollTop=t.offsetTop-k(e,O).files.offsetTop-a,s(t.dataset.id)}})))},o=function(t){var e={ArrowRight:"next",ArrowLeft:"prev"}[t.key]||!1;if(e){var n=r.Z.modal.querySelector(".btn-preview-".concat(e));n&&n.click()}},s=function(t){r.Z.modal.addEventListener("ajax-modal-close",(function t(){r.Z.modal.removeEventListener("ajax-modal-close",t),document.removeEventListener("keydown",o);var n=e.getSelectionFile();n&&n.click()})),r.Z.load({url:"".concat(k(e,I),"/file/").concat(t,"/view"),size:"auto-size",noLoading:!0},(function(){i("prev","previousSibling",t),i("next","nextSibling",t),document.addEventListener("keydown",o)}))};s(t.dataset.id)}},{key:"_onClickButtonFileRename",value:function(t){var e=this,n=t.dataset.id,i=k(this,O).listFiles.querySelector(".media-lib-file[data-id='".concat(n,"']"));r.Z.load({url:"".concat(k(this,I),"/file/").concat(n,"/rename"),size:"sm"},(function(t){t.hasOwnProperty("success")&&!1!==t.success&&(t.hasOwnProperty("fileRow")&&(i.closest("li").innerHTML=t.fileRow),e._getHeader().then((function(){r.Z.close(),e.loading(!1)})))}))}},{key:"_onClickButtonFileDelete",value:function(t){var e=this,n=t.dataset.id,i=k(this,O).listFiles.querySelector(".media-lib-file[data-id='".concat(n,"']"));this._post("/file/".concat(n,"/delete")).then((function(t){t.hasOwnProperty("success")&&!1!==t.success&&(i.closest("li").remove(),e._selectFilesReset(),e.loading(!1))}))}},{key:"_onClickButtonFilesDelete",value:function(t){var e,n=this,i=this.getSelectionFiles();if(!(i.length<1)){var o=k(this,M)?"/delete-files/".concat(k(this,M)):"/delete-files",s=new URLSearchParams({selectionFiles:i.length.toString()}),a=null!==(e=t.dataset.modalSize)&&void 0!==e?e:"sm";r.Z.load({url:k(this,I)+o+"?"+s.toString(),size:a},(function(t){if(t.hasOwnProperty("success")&&!1!==t.success){var e=0,o=new v("progress-delete-files",{label:"Deleting files",value:100,showPercentage:!0});r.Z.getBodyElement().append(o.element()),n.loading(!0),Promise.allSettled(Array.from(i).map((function(r){return n._post("/file/".concat(r.dataset.id,"/delete")).then((function(){t.hasOwnProperty("success")&&!1!==t.success&&(r.closest("li").remove(),o.progress(Math.round(++e/i.length*100)).style("success"))}))}))).then((function(){return n._selectFilesReset()})).then((function(){return n.loading(!1)})).then((function(){return new Promise((function(t){return setTimeout(t,2e3)}))})).then((function(){return r.Z.close()}))}}))}}},{key:"_onClickButtonFilesMove",value:function(t,e){var n,i=this,o=this.getSelectionFiles();if(0!==o.length){var s=k(this,M)?"/move-files/".concat(k(this,M)):"/move-files",a=new URLSearchParams({selectionFiles:o.length.toString()});e&&a.append("targetId",e);var l=null!==(n=t.dataset.modalSize)&&void 0!==n?n:"sm";r.Z.load({url:k(this,I)+s+"?"+a.toString(),size:l},(function(t){if(t.hasOwnProperty("success")&&!1!==t.success&&t.hasOwnProperty("targetFolderId")){var e=t.targetFolderId,n=0,s=[],a=new v("progress-move-files",{label:1===o.length?"Moving file":"Moving files",value:100,showPercentage:!0}),l=document.createElement("div");l.id="move-errors",l.className="alert alert-danger",l.style.display="none",l.attributes.role="alert",r.Z.getBodyElement().append(l),r.Z.getBodyElement().append(a.element()),i.loading(!0),Promise.allSettled(Array.from(o).map((function(t){return new Promise((function(c,d){i._post("/file/".concat(t.dataset.id,"/move"),{targetFolderId:e}).then((function(e){e.hasOwnProperty("success")&&!1!==e.success&&(t.closest("li").remove(),c())})).catch((function(t){return t.json().then((function(t){s[t.error]=(s[t.error]||0)+1;var e="";for(var n in s)e+="

".concat(n," : for ").concat(s[n]," files

");l.style.display="block",l.innerHTML=e,d()}))})).finally((function(){a.style("success").progress(Math.round(++n/o.length*100)).status("".concat(n," / ").concat(o.length));var t=r.Z.getBodyElement().querySelector("div#move-errors");t&&r.Z.getBodyElement().replaceChild(l,t)}))}))}))).then((function(){return i._selectFilesReset()})).then((function(){return i.loading(!1)})).then((function(){0===Object.keys(s).length&&setTimeout((function(){r.Z.close()}),2e3)}))}}))}}},{key:"_onClickFolder",value:function(t){var e=this;this.loading(!0),this.getFolders().forEach((function(t){return t.classList.remove("active")})),t.classList.add("active");var n=t.closest("li");n&&n.classList.contains("has-children")&&n.classList.toggle("open"),x(this,M,t.dataset.id),this._getFiles().then((function(){return e.loading(!1)}))}},{key:"_onClickButtonFolderAdd",value:function(){var t=this,e=k(this,M)?"/add-folder/".concat(k(this,M)):"/add-folder";r.Z.load({url:k(this,I)+e,size:"sm"},(function(e){e.hasOwnProperty("success")&&!0===e.success&&(t.loading(!0),t._getFolders(e.path).then((function(){return t.loading(!1)})))}))}},{key:"_onClickButtonFolderDelete",value:function(t){var e,n=this,i=t.dataset.id,o=null!==(e=t.dataset.modalSize)&&void 0!==e?e:"sm";r.Z.load({url:"".concat(k(this,I),"/folder/").concat(i,"/delete"),size:o},(function(t){if(t.hasOwnProperty("success")&&!1!==t.success&&t.hasOwnProperty("jobId")){var e=new v("progress-"+t.jobId,{label:"Deleting folder",value:100,showPercentage:!1});r.Z.getBodyElement().append(e.element()),n.loading(!0),Promise.allSettled([n._startJob(t.jobId),n._jobPolling(t.jobId,e)]).then((function(){return n._onClickButtonHome()})).then((function(){return n._getFolders()})).then((function(){return new Promise((function(t){return setTimeout(t,2e3)}))})).then((function(){return r.Z.close()}))}}))}},{key:"_onClickButtonFolderRename",value:function(t){var e=this,n=t.dataset.id;r.Z.load({url:"".concat(k(this,I),"/folder/").concat(n,"/rename"),size:"sm"},(function(t){if(t.hasOwnProperty("success")&&!1!==t.success&&t.hasOwnProperty("jobId")&&t.hasOwnProperty("path")){var n=new v("progress-"+t.jobId,{label:"Renaming",value:100,showPercentage:!1});r.Z.getBodyElement().append(n.element()),e.loading(!0),Promise.allSettled([e._startJob(t.jobId),e._jobPolling(t.jobId,n)]).then((function(){return e._getFolders(t.path)})).then((function(){return new Promise((function(t){return setTimeout(t,2e3)}))})).then((function(){return r.Z.close()}))}}))}},{key:"_onClickButtonHome",value:function(){var t=this;this.loading(!0),this.getFolders().forEach((function(t){return t.classList.remove("active")})),x(this,M,null),this._getFiles().then((function(){return t.loading(!1)}))}},{key:"_onClickBreadcrumbItem",value:function(t){var e=t.dataset.id;if(e){var n=k(this,O).listFolders.querySelector('.media-lib-folder[data-id="'.concat(e,'"]'));this._onClickFolder(n)}else this._onClickButtonHome()}},{key:"_onSearchInput",value:function(t,e){var n=this;clearTimeout(k(this,$)),x(this,$,setTimeout((function(){x(n,F,t.value),n._getFiles(0).then((function(){return n.loading(!1)}))}),e))}},{key:"_getHeader",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n="/header",i=new URLSearchParams;return e&&i.append("fileId",e),this.getSelectionFiles().length>0&&i.append("selectionFiles",this.getSelectionFiles().length.toString()),k(this,M)&&i.append("folderId",k(this,M)),k(this,F)&&i.append("search",k(this,F)),i.size>0&&(n=n+"?"+i.toString()),this._get(n).then((function(e){e.hasOwnProperty("header")&&t._refreshHeader(e.header)}))}},{key:"_getFiles",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;0===e&&(x(this,A,0),k(this,O).loadMoreFiles.classList.remove("show-load-more"),k(this,O).listFiles.innerHTML="");var n=new URLSearchParams({from:e.toString()});k(this,F)&&n.append("search",k(this,F));var i=k(this,M)?"/files/".concat(k(this,M)):"/files";return this._get("".concat(i,"?").concat(n.toString())).then((function(e){t._appendFiles(e)}))}},{key:"_getFolders",value:function(t){var e=this;return k(this,O).listFolders.innerHTML="",this._get("/folders").then((function(n){e._appendFolderItems(n),t&&e._openPath(t)}))}},{key:"_openPath",value:function(t){var e="";if(t.split("/").filter((function(t){return""!==t})).forEach((function(t){e+="/".concat(t);var n=document.querySelector('.media-lib-folder[data-path="'.concat(e,'"]')),i=n?n.closest("li"):null;i&&i.classList.contains("has-children")&&i.classList.add("open")})),""!==e){var n=document.querySelector('.media-lib-folder[data-path="'.concat(e,'"]'));n&&this._onClickFolder(n)}}},{key:"_appendFiles",value:function(t){t.hasOwnProperty("header")&&(this._refreshHeader(t.header),x(this,L,t.header)),t.hasOwnProperty("rowHeader")&&(k(this,O).listFiles.innerHTML+=t.rowHeader),t.hasOwnProperty("totalRows")&&x(this,A,k(this,A)+t.totalRows),t.hasOwnProperty("rows")&&(k(this,O).listFiles.innerHTML+=t.rows),t.hasOwnProperty("remaining")&&t.remaining?k(this,O).loadMoreFiles.classList.add("show-load-more"):k(this,O).loadMoreFiles.classList.remove("show-load-more")}},{key:"_appendFolderItems",value:function(t){var e=this;k(this,O).listFolders.innerHTML=t.folders,this.getFolders().forEach((function(t){["dragenter","dragover","dragleave","drop"].forEach((function(n){t.addEventListener(n,(function(t){return e._onDragFolder(t)}))}))}))}},{key:"_refreshHeader",value:function(t){var e=document.activeElement===this.getSearchBox();if(k(this,O).header.innerHTML=t,e){var n=this.getSearchBox();n.focus();var i=n.value;n.value="",n.value=i}}},{key:"_onDragUpload",value:function(t){var e,n;if(!(k(this,K).length>0)&&("dragend"===t.type&&x(this,N,0),"dragover"===t.type&&t.preventDefault(),"dragenter"===t.type&&(x(this,N,(e=k(this,N),++e)),k(this,O).files.classList.add("media-lib-drop-area"),this._selectFilesReset()),"dragleave"===t.type&&(x(this,N,(n=k(this,N),--n)),0===k(this,N)&&k(this,O).files.classList.remove("media-lib-drop-area")),"drop"===t.type)){t.preventDefault(),x(this,N,0),k(this,O).files.classList.remove("media-lib-drop-area");var i=t.target.files||t.dataTransfer.files;this._uploadFiles(Array.from(i))}}},{key:"_onDragFolder",value:function(t){if(0!==k(this,K).length&&t.target.dataset.id!==k(this,M)&&("dragover"===t.type&&t.preventDefault(),"dragenter"===t.type&&(this.getFolders().forEach((function(t){return t.classList.remove("media-lib-drop-area")})),t.target.classList.add("media-lib-drop-area")),"dragleave"===t.type&&t.target.classList.remove("media-lib-drop-area"),"drop"===t.type)){t.preventDefault(),t.target.classList.remove("media-lib-drop-area");var e=t.target.dataset.id,n=k(this,O).header.querySelector(".btn-files-move");this._onClickButtonFilesMove(n,e)}}},{key:"_onDragFile",value:function(t){"dragstart"===t.type&&x(this,K,this.getSelectionFiles()),"dragend"===t.type&&(x(this,K,[]),this._selectFilesReset())}},{key:"_uploadFiles",value:function(t){var e=this;this.loading(!0),Promise.allSettled(t.map((function(t){return e._uploadFile(t)}))).then((function(){return e._getFiles().then((function(){return e.loading(!1)}))}))}},{key:"_uploadFile",value:function(t){var e=this;return new Promise((function(n,i){var r=Date.now(),o=document.createElement("li");o.id="upload-".concat(r);var s=document.createElement("div");s.className="upload-file";var a=document.createElement("button");a.type="button",a.className="close-button",a.addEventListener("click",(function(){k(e,O).listUploads.removeChild(o),o=!1,i()}));var l=document.createElement("i");l.className="fa fa-times",l.setAttribute("aria-hidden","true"),a.appendChild(l);var c=new v("progress-".concat(r),{label:t.name,value:5});s.append(c.style("success").element()),s.append(a),o.appendChild(s),k(e,O).listUploads.appendChild(o),e._getFileHash(t,c).then((function(n){return e._createFile(t,n)})).then((function(){c.status("Finished"),setTimeout((function(){k(e,O).listUploads.removeChild(o),n()}),1e3)})).catch((function(t){s.classList.add("upload-error"),c.status(t.message).style("danger").progress(100),setTimeout((function(){!1!==o&&(k(e,O).listUploads.removeChild(o),i())}),3e3)}))}))}},{key:"_createFile",value:(h=T(b().mark((function t(e,n){var i,r;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i=new FormData).append("name",e.name),i.append("filesize",e.size),i.append("fileMimetype",e.type),i.append("fileHash",n),r=k(this,M)?"/add-file/".concat(k(this,M)):"/add-file",t.next=8,this._post(r,i,!0).catch((function(t){return t.json().then((function(t){throw new Error(t.error)}))}));case 8:case"end":return t.stop()}}),t,this)}))),function(t,e){return h.apply(this,arguments)})},{key:"_getFileHash",value:(d=T(b().mark((function t(e,n){var i,r=this;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(t,i){var o=null;new y.Z({file:e,algo:k(r,R).hashAlgo,initUrl:k(r,R).urlInitUpload,onHashAvailable:function(t){n.status("Hash available").progress(0),o=t},onProgress:function(t,e,i){"Computing hash"===t&&n.status("Calculating ...").progress(i),"Uploading"===t&&n.status("Uploading: "+i).progress(Math.round(100*e))},onUploaded:function(){n.status("Uploaded").progress(100),t(o)},onError:function(t){return i(t)}})}));case 2:if("string"==typeof(i=t.sent)){t.next=5;break}throw new Error("Invalid hash");case 5:return t.abrupt("return",i);case 6:case"end":return t.stop()}}),t)}))),function(t,e){return d.apply(this,arguments)})},{key:"_initInfiniteScrollFiles",value:function(t,e){var n=this;new IntersectionObserver((function(t){t.forEach((function(t){t.isIntersecting&&(n.loading(!0),n._getFiles(k(n,A)).then((function(){return n.loading(!1)})))}))}),{root:t,rootMargin:"0px",threshold:.5}).observe(e)}},{key:"_selectFile",value:function(t){var e=this;t.classList.add("active"),t.draggable=!0,["dragstart","dragend"].forEach((function(n){t.addEventListener(n,(function(t){return e._onDragFile(t)}))}))}},{key:"_selectFiles",value:function(t,e){var n=this;if(e.shiftKey&&null!==k(this,P)){var i=k(this,O).listFiles.querySelectorAll(".media-lib-file"),r=Array.from(i).indexOf(t),o=Array.from(i).indexOf(k(this,P));if(r>o){var s=[o,r];r=s[0],o=s[1]}i.forEach((function(t,e){e>=r&&e<=o&&n._selectFile(t)}))}else e.ctrlKey||this._selectFilesReset(!1),this._selectFile(t);return x(this,P,t),this.getSelectionFiles()}},{key:"_selectFilesReset",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];!0===e&&this._refreshHeader(k(this,L)),this.getSelectionFiles().forEach((function(e){e.classList.remove("active"),e.draggable=!1,["dragstart","dragend"].forEach((function(n){e.removeEventListener(n,(function(e){return t._onDragFile(e)}))}))}))}},{key:"_jobPolling",value:(c=T(b().mark((function t(e,n){var i;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._getJobStatus(e);case 2:if(!0===(i=t.sent).started&&i.progress>0&&n.status("Running ...").progress(i.progress).style("success"),!0!==i.done){t.next=7;break}return n.status("Finished").progress(100),t.abrupt("return",i);case 7:return t.next=9,new Promise((function(t){return setTimeout(t,1500)}));case 9:return t.next=11,this._jobPolling(e,n);case 11:return t.abrupt("return",t.sent);case 12:case"end":return t.stop()}}),t,this)}))),function(t,e){return c.apply(this,arguments)})},{key:"_startJob",value:(l=T(b().mark((function t(e){var n;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("/job/start/".concat(e),{method:"POST",headers:{"Content-Type":"application/json"}});case 2:return n=t.sent,t.abrupt("return",n.json());case 4:case"end":return t.stop()}}),t)}))),function(t){return l.apply(this,arguments)})},{key:"_getJobStatus",value:(a=T(b().mark((function t(e){var n;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("/job/status/".concat(e),{method:"GET",headers:{"Content-Type":"application/json"}});case 2:return n=t.sent,t.abrupt("return",n.json());case 4:case"end":return t.stop()}}),t)}))),function(t){return a.apply(this,arguments)})},{key:"_get",value:(s=T(b().mark((function t(e){var n;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading(!0),t.next=3,fetch("".concat(k(this,I)).concat(e),{method:"GET",headers:{"Content-Type":"application/json"}});case 3:return n=t.sent,t.abrupt("return",n.json());case 5:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"_post",value:(o=T(b().mark((function t(e){var n,i,r,o,s=arguments;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:{},i=s.length>2&&void 0!==s[2]&&s[2],this.loading(!0),r={},r=i?{method:"POST",body:n}:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)},t.next=7,fetch("".concat(k(this,I)).concat(e),r);case 7:return o=t.sent,t.abrupt("return",o.ok?o.json():Promise.reject(o));case 9:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})}],n&&C(e.prototype,n),i&&C(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}(),B=n(9755),Y=n.n(B),j=n(9755);function W(t){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(t)}function z(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var i,r,o=[],s=!0,a=!1;try{for(n=n.call(t);!(s=(i=n.next()).done)&&(o.push(i.value),!e||o.length!==e);s=!0);}catch(t){a=!0,r=t}finally{try{s||null==n.return||n.return()}finally{if(a)throw r}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return U(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n div",stop:function(){n.relocate()}}),this.addListeners(e),this.updateCollapseButtons()}var e,n,r;return e=t,n=[{key:"addListeners",value:function(t){var e=Y()(t),n=this;e.find(".json_menu_sortable_remove_button").on("click",(function(t){n.removeElement(this,t)})),e.find(".json_menu_sortable_add_item_button").on("click",(function(t){t.preventDefault(),n.addItem(j(this),"prototype-item",j(this).data())})),e.find(".json_menu_sortable_add_node_button").on("click",(function(t){t.preventDefault(),n.addItem(j(this),"prototype-node",j(this).data())})),e.find(".json_menu_sortable_paste_button").on("click",(function(t){t.preventDefault(),n.paste(j(this))})),e.find("input.itemLabel").on("input",(function(t){n.updateLabel(this,t)}))}},{key:"updateLabel",value:function(t,e){Y()(t).closest("li").data("label",Y()(t).val()),this.relocate()}},{key:"removeElement",value:function(t,e){e.preventDefault(),Y()(t).closest("li").remove(),this.relocate()}},{key:"addItem",value:function(t,e,n){var r=q(),o=this.parent.find(".json_menu_editor_fieldtype_widget").data(e);o=o.replace(/%uuid%/g,r);for(var s=0,a=Object.entries(n);s0?u.children("ol").append(h):u.append(j("
    ").append(h)),u.find(".button-collapse:first").attr("aria-expanded",!1);var f=Y()("#"+r);this.addListeners(f),new i.Z(f.get(0)),this.relocate(),this.setFocus(r)}},{key:"setFocus",value:function(t){Y()("#"+t).find("input").focus()}},{key:"updateCollapseButtons",value:function(){this.parent.find("li.nestedSortable").each((function(){var t=j(this).find(".button-collapse:first");0===j(this).find("ol:first li").length?t.css("display","none"):t.show()}))}},{key:"relocate",value:function(){this.updateCollapseButtons();var t=this.nestedSortable.nestedSortable("toHierarchy",{startDepthCount:0}),e=JSON.stringify(function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=n;return Object.keys(e).forEach((function(n){var r=e[n],o={id:r.id,label:r.label,contentType:r.contentType,type:r.type,object:r.object};r.hasOwnProperty("children")&&(o.children=t(r.children)),i.push(o)})),i}(t));this.hiddenField.val(e).trigger("input").trigger("change")}}],n&&V(e.prototype,n),r&&V(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function X(t,e,n){var i=new XMLHttpRequest;i.open("POST",t,!0),i.setRequestHeader("Content-Type","application/json"),J(i,n,e)}function J(t,e,n){t.onreadystatechange=function(){if(t.readyState===XMLHttpRequest.DONE){var n=JSON.parse(t.responseText);"function"==typeof e&&e(n,t)}},t.send(n)}var Z=n(9755);function Q(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var i,r,o=[],s=!0,a=!1;try{for(n=n.call(t);!(s=(i=n.next()).done)&&(o.push(i.value),!e||o.length!==e);s=!0);}catch(t){a=!0,r=t}finally{try{s||null==n.return||n.return()}finally{if(a)throw r}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return tt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tt(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n div",update:function(){i._relocate()},isAllowed:function(t,e,n){var r=Z(n).data(),o=e?Z(e).data():Z(i.target).data(),s=i.nodes[r.nodeId];return i.nodes[o.nodeId].addNodes.includes(s.name)}})),this._addEventListeners(this.target),window.addEventListener("focus",(function(){n._refreshPasteButtons()})),this._initSilentPublish(),this.selectItemId?(this.selectItem(this.selectItemId,!0),this.loading(!1)):this.loading(!1)}var e,n,i;return e=t,n=[{key:"getId",value:function(){return this.target.getAttribute("id")}},{key:"getStructureJson",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=function t(e){var n=[],i=e.querySelector("ol.json-menu-nested-list");return i&&i.querySelectorAll(":scope > li.json-menu-nested-item").forEach((function(e){var i=JSON.parse(e.dataset.item);i.children=t(e),n.push(i)})),n},n=e(this.target);if(!t)return JSON.stringify(n);var i=JSON.parse(this.target.dataset.item);return i.children=e(this.target),JSON.stringify(i)}},{key:"loading",value:function(t){var e=this.target.querySelector(".json-menu-nested-loading");e.style.display=t?"flex":"none"}},{key:"selectItem",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this._getElementItem(t);if(null!==n){this.target.querySelectorAll("li.json-menu-nested-item").forEach((function(t){t.classList.remove("json-menu-nested-item-selected")})),n.classList.add("json-menu-nested-item-selected");var i=n.parentNode;if(null!==i){for(;i&&!i.classList.contains("json-menu-nested-root");){if(i.classList.contains("json-menu-nested-item")){var r=i.querySelector(".btn-collapse");r&&r.dispatchEvent(new CustomEvent("show"))}i=i.parentNode}e&&setTimeout((function(){n.scrollIntoView()}),1e3)}}}},{key:"_parseAttributes",value:function(){this.target.hasAttribute("data-hidden-field-id")&&(this.hiddenField=document.getElementById(this.target.dataset.hiddenFieldId)),this.config=this.target.dataset.config,this.nodes=JSON.parse(this.target.dataset.nodes),this.urls=JSON.parse(this.target.dataset.urls),this.selectItemId=!!this.target.hasAttribute("data-select-item-id")&&this.target.dataset.selectItemId}},{key:"_addEventListeners",value:function(t){this._relocate(),this._buttonItemAdd(t),this._buttonItemEdit(t),this._buttonItemDelete(t),this._buttonItemPreview(t),this._buttonItemCopy(t),this._buttonItemCopyAll(t),this._buttonItemPaste(t),this._refreshPasteButtons()}},{key:"_relocate",value:function(){this.target.querySelectorAll("li.json-menu-nested-item").forEach((function(t){t.classList.remove("json-menu-nested-item-selected")})),this.target.querySelectorAll("ol").forEach((function(t){t.hasAttribute("data-list")||t.setAttribute("data-list",t.parentElement.dataset.item),t.classList.contains("json-menu-nested-list")||t.classList.add("json-menu-nested-list"),t.classList.contains("collapse")||t.classList.contains("json-menu-nested-root")||t.classList.add("collapse")})),document.querySelectorAll(".collapsible").forEach((function(t){var e=t.querySelector(".btn-collapse");if(null!==e){var n=t.querySelectorAll(":scope > .collapse"),i=!1,r=!1;n.forEach((function(t){i=!!t.firstElementChild,r="block"===t.style.display&&0==r})),e.setAttribute("aria-expanded",r),i?(e.style.display="inline-block",e.onclick=function(t){t.preventDefault();var i=e.getAttribute("aria-expanded");e.setAttribute("aria-expanded","true"==i?"false":"true"),n.forEach((function(t){t.style.display="true"==i?"none":"block"}))},e.addEventListener("show",(function(t){t.preventDefault(),t.target.setAttribute("aria-expanded","true"),n.forEach((function(t){t.style.display="block"}))})),e.addEventListener("hide",(function(t){t.preventDefault(),t.target.setAttribute("aria-expanded","false"),n.forEach((function(t){t.style.display="none"}))}))):(e.style.display="none",e.onclick=function(t){})}})),this.hasOwnProperty("hiddenField")&&null!==this.hiddenField&&(this.hiddenField.classList.contains("json-menu-nested-silent-publish")?(this.hiddenField.value=this.getStructureJson(!0),this.hiddenField.dispatchEvent(new CustomEvent("silentPublish"))):(this.hiddenField.value=this.getStructureJson(),Z(this.hiddenField).trigger("input").trigger("change")))}},{key:"_getElementItem",value:function(t){return this.target.parentElement.querySelector('[data-item-id="'.concat(t,'"]'))}},{key:"_getElementItemList",value:function(t){return this.target.querySelector('[data-list="'.concat(t,'"]'))}},{key:"_getCopy",value:function(){return!!localStorage.hasOwnProperty(this.copyName)&&function t(e,n){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=0,o=Object.entries(e);r '):"")+"Add: ".concat(a.label),data:JSON.stringify({_data:{level:s,item_id:l,config:e.config,defaultData:c.get("defaultData")}}),size:"lg"},(function(t){t.hasOwnProperty("success")&&!0===t.success&&(e._appendHtml(i,t.html),e.selectItem(l))}))}}}))}},{key:"_buttonItemEdit",value:function(t){var e=this;t.querySelectorAll(".btn-json-menu-nested-edit").forEach((function(t){t.onclick=function(n){n.preventDefault();var i=t.dataset.itemId,o=JSON.parse(e._getElementItem(i).dataset.item),s=t.dataset.nodeId,a=t.dataset.level;if(e.nodes.hasOwnProperty(s)){var l=e.nodes[s];r.Z.load({url:l.urlEdit,title:(l.icon?' '):"")+"Edit: ".concat(l.label),data:JSON.stringify({_data:{level:a,item_id:i,object:o.object,config:e.config}}),size:"lg"},(function(t){if(t.hasOwnProperty("success")&&!1!==t.success){var n=e._getElementItemList(i);e._getElementItem(i).outerHTML=t.html,n&&e._getElementItem(i).insertAdjacentHTML("beforeend",n.outerHTML),e._addEventListeners(e._getElementItem(i).parentNode)}}))}}}))}},{key:"_buttonItemDelete",value:function(t){var e=this;t.querySelectorAll(".btn-json-menu-nested-delete").forEach((function(t){t.onclick=function(n){n.preventDefault();var i=t.dataset.itemId,r=e._getElementItem(i);r.parentNode.removeChild(r),e._relocate()}}))}},{key:"_buttonItemCopyAll",value:function(t){var e=this,n=t.querySelector(".btn-json-menu-nested-copy-all");null!==n&&(n.onclick=function(t){t.preventDefault(),e._setCopy({id:"_root",label:"_root",type:"_root",children:JSON.parse(e.getStructureJson())})})}},{key:"_buttonItemCopy",value:function(t){var e=this;t.querySelectorAll(".btn-json-menu-nested-copy").forEach((function(t){t.parentElement,t.onclick=function(n){n.preventDefault();var i=t.dataset.itemId,r=function t(n){var i=JSON.parse(n.dataset.item),r=[],o=e._getElementItemList(n.dataset.itemId);return o&&o.querySelectorAll(":scope > li").forEach((function(e){r.push(t(e))})),{id:it(),label:i.label,type:i.type,object:i.object,children:r}}(e._getElementItem(i));e._setCopy(r)}}))}},{key:"_buttonItemPaste",value:function(t){var e=this;t.querySelectorAll(".btn-json-menu-nested-paste").forEach((function(t){t.onclick=function(n){n.preventDefault();var i=e._getCopy();if(!1!==i){e.loading(!0);var r=t.dataset.itemId,o=(e._getElementItem(r),t.dataset.nodeId);e.nodes[o],X(e.urls.paste,JSON.stringify({_data:{copied:i,config:e.config}}),(function(t){e._appendHtml(r,t.html),e.loading(!1)}))}}}))}},{key:"_buttonItemPreview",value:function(t){var e=this;t.querySelectorAll(".btn-json-menu-nested-preview").forEach((function(t){t.onclick=function(n){n.preventDefault();var i=t.dataset.itemId,o=e._getElementItem(i),s=JSON.parse(o.dataset.item);r.Z.load({url:e.urls.preview,title:t.dataset.title,size:"lg",data:JSON.stringify({_data:{type:s.type,object:s.object}})})}}))}},{key:"_appendHtml",value:function(t,e){var n=this._getElementItemList(t);if(n)n.insertAdjacentHTML("beforeend",e);else{var i='
      ').concat(e,"
    ");this._getElementItem(t).insertAdjacentHTML("beforeend",i)}this._addEventListeners(this._getElementItem(t).parentElement)}},{key:"_initSilentPublish",value:function(){var t=this;null!==this.hiddenField&&this.hiddenField.classList.contains("json-menu-nested-silent-publish")&&this.hiddenField.addEventListener("silentPublish",(function(e){var n=t.hiddenField.value;t.loading(!0),X(t.urls.silentPublish,JSON.stringify({_data:{update:n,config:t.config}}),(function(e,n){if(200===n.status)return e.hasOwnProperty("urls")&&(t.urls=e.urls,t.target.setAttribute("data-urls",JSON.stringify(t.urls))),e.hasOwnProperty("nodes")&&(t.nodes=e.nodes,t.target.setAttribute("data-nodes",JSON.stringify(t.nodes))),void setTimeout((function(){return t.loading(!1)}),250);e.hasOwnProperty("alert")&&(document.getElementById(t.getId()+"-alerts").innerHTML=e.alert)}))}))}},{key:"_refreshPasteButtons",value:function(){var t=this,e=this._getCopy();document.querySelectorAll(".btn-json-menu-nested-paste").forEach((function(n){var i=n.parentElement;if(null!==e){var r=n.dataset.nodeId,o=t.nodes[r],s=e.type,a=n.dataset.allow;void 0!==o&&o.addNodes.includes(s)||a===s?i.style.display="list-item":i.style.display="none"}else i.style.display="none"}))}}],n&&et(e.prototype,n),i&&et(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}(),ot=n(1474);function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}function at(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */at=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function l(t,e,n,i){var r=e&&e.prototype instanceof h?e:h,o=Object.create(r.prototype),s=new C(i||[]);return o._invoke=function(t,e,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return D()}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=b(s,n);if(a){if(a===d)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=c(t,e,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}(t,n,s),o}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var d={};function h(){}function u(){}function f(){}var p={};a(p,r,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(E([])));g&&g!==e&&n.call(g,r)&&(p=g);var v=f.prototype=h.prototype=Object.create(p);function y(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function i(r,o,s,a){var l=c(t[r],t,o);if("throw"!==l.type){var d=l.arg,h=d.value;return h&&"object"==st(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,s,a)}),(function(t){i("throw",t,s,a)})):e.resolve(h).then((function(t){d.value=t,s(d)}),(function(t){return i("throw",t,s,a)}))}a(l.arg)}var r;this._invoke=function(t,n){function o(){return new e((function(e,r){i(t,n,e,r)}))}return r=r?r.then(o,o):o()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=c(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,d;var r=i.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function E(t){if(t){var e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function e(){for(;++i=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(a&&l){if(this.prev=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;T(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:E(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},t}function lt(t,e,n,i,r,o,s){try{var a=t[o](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(i,r)}function ct(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function s(t){lt(o,i,r,s,a,"next",t)}function a(t){lt(o,i,r,s,a,"throw",t)}s(void 0)}))}}function dt(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=e.activeItemId,i=void 0===n?null:n,r=e.loadChildrenId,o=void 0===r?null:r;this._post("/render",{active_item_id:i,load_parent_ids:ft(this,_t),load_children_id:o}).then((function(e){e.hasOwnProperty("tree")&&e.hasOwnProperty("load_parent_ids")&&(pt(t,_t,e.load_parent_ids),ft(t,vt).innerHTML=e.tree,t._dispatchEvent("jmn-load",{data:e,elements:t._sortables()})||t.loading(!1))}))}},{key:"itemGet",value:function(t){return this._get("/item/".concat(t))}},{key:"itemAdd",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return this._post("/item/".concat(t,"/add"),{position:n,add:e})}},{key:"itemDelete",value:function(t){var e=this;this._post("/item/".concat(t,"/delete")).then((function(n){e._dispatchEvent("jmn-delete",{data:n,nodeId:t})||e.load()}))}},{key:"loading",value:function(t){this.element.querySelector(".jmn-node-loading").style.display=t?"flex":"none"}},{key:"_addClickListeners",value:function(){var t=this;this.element.addEventListener("click",(function(e){var n=e.target,i=n.parentElement.closest(".jmn-node"),r=i?i.dataset.id:"_root";n.classList.contains("jmn-btn-add")&&t._onClickButtonAdd(n,r),n.classList.contains("jmn-btn-edit")&&t._onClickButtonEdit(n,r),n.classList.contains("jmn-btn-view")&&t._onClickButtonView(n,r),n.classList.contains("jmn-btn-delete")&&t._onClickButtonDelete(r),n.dataset.hasOwnProperty("jmnModalCustom")&&t._onClickModalCustom(n,r)}),!0)}},{key:"_onClickButtonAdd",value:function(t,e){this._ajaxModal(t,"/item/".concat(e,"/modal-add/").concat(t.dataset.add),"jmn-add")}},{key:"_onClickButtonEdit",value:function(t,e){this._ajaxModal(t,"/item/".concat(e,"/modal-edit"),"jmn-edit")}},{key:"_onClickButtonView",value:function(t,e){this._ajaxModal(t,"/item/".concat(e,"/modal-view"),"jmn-view")}},{key:"_onClickButtonDelete",value:function(t){this.itemDelete(t)}},{key:"_onClickModalCustom",value:function(t,e){var n=t.dataset.jmnModalCustom;this._ajaxModal(t,"/item/".concat(e,"/modal-custom/").concat(n),"jmn-modal-custom")}},{key:"_onClickButtonCollapse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.getAttribute("aria-expanded"),i=event.target.parentElement.closest(".jmn-node"),r=i.dataset.id;if("true"===n){t.setAttribute("aria-expanded","false");var o=i.querySelectorAll(".jmn-node"),s=Array.from(o).map((function(t){return t.dataset.id}));o.forEach((function(t){return t.remove()})),pt(this,_t,ft(this,_t).filter((function(t){return t!==r&&!s.includes(t)}))),this.load()}else t.setAttribute("aria-expanded","true"),ft(this,_t).push(r),this.load({loadChildrenId:e?r:null})}},{key:"_addClickLongPressListeners",value:function(){var t,e=this,n=!1;this.element.addEventListener("mousedown",(function(e){e.target.classList.contains("jmn-btn-collapse")&&(t=setTimeout((function(){n=!0}),300))}),!0),this.element.addEventListener("mouseup",(function(i){i.target.classList.contains("jmn-btn-collapse")&&(e._onClickButtonCollapse(i.target,n),clearTimeout(t),n=!1)}))}},{key:"_sortables",value:function(){var t=this,e={group:"shared",draggable:".jmn-node",handle:".jmn-btn-move",dragoverBubble:!0,ghostClass:"jmn-move-ghost",chosenClass:"jmn-move-chosen",dragClass:"jmn-move-drag",animation:10,fallbackOnBody:!0,swapThreshold:.5,onMove:function(e){return t._onMove(e)},onEnd:function(e){return t._onMoveEnd(e)}},n=this.element.querySelectorAll(".jmn-sortable");return n.forEach((function(n){ft(t,bt)[n.id]=ot.ZP.create(n,e)})),n}},{key:"_onMove",value:function(t){var e=t.dragged,n=t.to;return!(!e.dataset.hasOwnProperty("type")||!n.dataset.hasOwnProperty("types"))&&JSON.parse(n.dataset.types).includes(e.dataset.type)}},{key:"_onMoveEnd",value:function(t){var e=t.item.dataset.id,n=window.jsonMenuNestedComponents[t.to.closest(".json-menu-nested-component").id],i=window.jsonMenuNestedComponents[t.from.closest(".json-menu-nested-component").id],r=t.newIndex,o=t.to.closest(".jmn-node").dataset.id,s=t.from.closest(".jmn-node").dataset.id;n.id===i.id?this._post("/item/".concat(e,"/move"),{fromParentId:s,toParentId:o,position:r}).finally((function(){return n.load({activeItemId:e})})):i.itemGet(e).then((function(t){if(!t.hasOwnProperty("item"))throw new Error(JSON.stringify(t));return n.itemAdd(o,t.item,r)})).then((function(t){if(!t.hasOwnProperty("success")||!t.success)throw new Error(JSON.stringify(t));return i.itemDelete(e)})).catch((function(){})).finally((function(){n.load({activeItemId:e}),i.load()}))}},{key:"_ajaxModal",value:function(t,e,n){var i,o=this,s=null,a=null!==(i=t.dataset.modalSize)&&void 0!==i?i:this.modalSize,l=function t(){o.load({activeItemId:s}),r.Z.modal.removeEventListener("ajax-modal-close",t)};r.Z.modal.addEventListener("ajax-modal-close",l),r.Z.load({url:"".concat(ft(this,yt)).concat(e),size:a},(function(t){if(o._dispatchEvent(n,{data:t,ajaxModal:r.Z})&&r.Z.modal.removeEventListener("ajax-modal-close",l),"jmn-add"===n||"jmn-edit"===n){if(!t.hasOwnProperty("success")||!t.success)return;t.hasOwnProperty("load")&&ft(o,_t).push(t.load),t.hasOwnProperty("item")&&t.item.hasOwnProperty("id")&&(s=t.item.id),r.Z.close()}}))}},{key:"_dispatchEvent",value:function(t,e){return e.jmn=this,!this.element.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e}))}},{key:"_get",value:(s=ct(at().mark((function t(e){var n;return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading(!0),t.next=3,fetch("".concat(ft(this,yt)).concat(e),{method:"GET",headers:{"Content-Type":"application/json"}});case 3:return n=t.sent,t.abrupt("return",n.json());case 5:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"_post",value:(o=ct(at().mark((function t(e){var n,i,r=arguments;return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},this.loading(!0),t.next=4,fetch("".concat(ft(this,yt)).concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});case 4:return i=t.sent,t.abrupt("return",i.json());case 6:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})}],n&&dt(e.prototype,n),i&&dt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Tt=n(9755);gt=function(t){t(document).ready((function(){var e,n,o,s;(e=t('section.sidebar ul.sidebar-menu a[href="'+window.location.pathname+window.location.search+'"]')).length>0?e.last().parents("li").addClass("active"):t("#side-menu-id").each((function(){t("#"+t(this).data("target")).parents("li").addClass("active")})),t("img.lazy").show().lazyload({effect:"fadeIn",threshold:200}),t(".match-height").matchHeight(),t("#modal-notification-close-button").on("click",(function(){t("#modal-notifications .modal-body").empty(),t("#modal-notifications").modal("hide")})),t("a.request_job").on("click",(function(e){e.preventDefault(),window.ajaxRequest.post(t(e.target).data("url")).success((function(e){window.ajaxRequest.post(e.jobUrl),t("ul#commands-log").prepend('
  1. Job #'+e.jobId+"
  2. ")}))})),t(".toggle-button").on("click",(function(){var e=t(this).data("toggle-contain"),n=t(this).html();t(this).html(e),t(this).data("toggle-contain",n)})),t("#add-search-filter-button").on("click",(function(e){e.preventDefault();var n=t("#list-of-search-filters"),r=n.data("prototype"),o=n.data("index"),s=t(r.replace(/__name__/g,o));n.data("index",o+1),new i.Z(s.get(0)),n.append(s)})),function(){var e=t(".code_editor_mode_ems");if(e){for(var n=ace.require("ace/ext/modelist"),i=[],r=0;r0;)e=n.pop();return!!("number"!=typeof e||115!==e&&83!==e||!t.ctrlKey&&!t.metaKey||t.altKey)||(i(t),!1)}))})),function(){t(".json_menu_editor_fieldtype").each((function(){new G(this)}));var e=[];t(".json-menu-nested").each((function(){var t=new rt(this);e[t.getId()]=t})),window.jsonMenuNested=e}(),n=document.getElementsByClassName("media-lib"),o=document.querySelector("body").dataset,[].forEach.call(n,(function(t){new H(t,{urlMediaLib:"/component/media-lib",urlInitUpload:o.initUpload,hashAlgo:o.hashAlgo})})),function(){var t=document.getElementsByClassName("json-menu-nested-component");window.jsonMenuNestedComponents=[],[].forEach.call(t,(function(t){var e=new wt(t);if(e.id in window.jsonMenuNestedComponents)throw new Error("duplicate id : ".concat(e.id));window.jsonMenuNestedComponents[e.id]=e}))}(),s=document.querySelectorAll("a[data-ajax-modal-url]"),[].forEach.call(s,(function(t){t.onclick=function(t){r.Z.load({url:t.target.dataset.ajaxModalUrl,size:t.target.dataset.ajaxModalSize},(function(t){t.hasOwnProperty("success")&&!0===t.success&&location.reload()}))}})),document.addEventListener("click",(function(t){if(t.target.classList.contains("core-post-button")){t.preventDefault();var e=t.target,n=JSON.parse(e.dataset.postSettings),i=e.href,r=n.hasOwnProperty("form")?document.getElementById(n.form):document.createElement("form");if(n.hasOwnProperty("form")){var o=document.createElement("INPUT");o.style.display="none",o.type="TEXT",o.name="source_url",o.value=i,r.appendChild(o),n.action&&(r.action=JSON.parse(n.action))}else r.style.display="none",r.method="post",r.action=i,e.parentNode.appendChild(r);if(n.hasOwnProperty("value")&&n.hasOwnProperty("name")){var s=document.createElement("INPUT");s.style.display="none",s.type="TEXT",s.name=JSON.parse(n.name),s.value=JSON.parse(n.value),r.appendChild(s)}r.submit()}})),window.setInterval((function(){t.getJSON(t("body").attr("data-status-url")).done((function(e){t("#status-overview").html(e.body)})).fail((function(e,n,i){var r=n+", "+i;t("#status-overview").html(' '+r)}))}),18e4),window.dispatchEvent(new CustomEvent("emsReady"))}))},"function"==typeof define&&n.amdO?define(["jquery"],gt):gt(window.jQuery)},3423:function(t,e,n){"use strict";function i(t,e){for(var n=0;ne&&t=0;n--)if(i=this.items[n],r=i.item[0],(o=this._intersectsWithPointer(i))&&i.instance===this.currentContainer){if(-1!==r.className.indexOf(_.disabledClass))if(2===o){if((d=this.items[n+1])&&d.item.hasClass(_.disabledClass))continue}else if(1===o&&(h=this.items[n-1])&&h.item.hasClass(_.disabledClass))continue;if(f=1===o?"next":"prev",!(r===this.currentItem[0]||this.placeholder[f]()[0]===r||t.contains(this.placeholder[0],r)||"semi-dynamic"===this.options.type&&t.contains(this.element[0],r))){if(this.mouseentered||(t(r).mouseenter(),this.mouseentered=!0),_.isTree&&t(r).hasClass(_.collapsedClass)&&_.expandOnHover&&(this.hovering||(t(r).addClass(_.hoveringClass),this.hovering=window.setTimeout((function(){t(r).removeClass(_.collapsedClass).addClass(_.expandedClass),y.refreshPositions(),y._trigger("expand",e,y._uiHash())}),_.expandOnHover))),this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;t(r).mouseleave(),this.mouseentered=!1,t(r).removeClass(_.hoveringClass),this.hovering&&window.clearTimeout(this.hovering),this.hovering=null,!_.protectRoot||this.currentItem[0].parentNode===this.element[0]&&r.parentNode!==this.element[0]?_.protectRoot||this._rearrange(e,i):this.currentItem[0].parentNode!==this.element[0]&&r.parentNode===this.element[0]?(t(r).children(_.listType).length||(r.appendChild(u),_.isTree&&t(r).removeClass(_.leafClass).addClass(_.branchClass+" "+_.expandedClass)),void 0!==(p="down"===this.direction?t(r).prev().children(_.listType):t(r).children(_.listType))[0]&&this._rearrange(e,null,p)):this._rearrange(e,i),this._clearEmpty(r),this._trigger("change",e,this._uiHash());break}}if(function(){var t=this.placeholder.prev();m=t.length?t:null}.call(this),null!=m)for(;"li"!==m[0].nodeName.toLowerCase()||-1!==m[0].className.indexOf(_.disabledClass)||m[0]===this.currentItem[0]||m[0]===this.helper[0];){if(!m[0].previousSibling){m=null;break}m=t(m[0].previousSibling)}if(function(){var t=this.placeholder.next();g=t.length?t:null}.call(this),null!=g)for(;"li"!==g[0].nodeName.toLowerCase()||-1!==g[0].className.indexOf(_.disabledClass)||g[0]===this.currentItem[0]||g[0]===this.helper[0];){if(!g[0].nextSibling){g=null;break}g=t(g[0].nextSibling)}return this.beyondMaxLevels=0,null==a||null!=g||_.protectRoot&&a[0].parentNode==this.element[0]||!(_.rtl&&this.positionAbs.left+this.helper.outerWidth()>a.offset().left+a.outerWidth()||!_.rtl&&this.positionAbs.leftm.offset().left+_.tabSize)?this._isAllowed(a,l,l+c):(this._isAllowed(m,l,l+c+1),m.children(_.listType).length||(m[0].appendChild(u),_.isTree&&m.removeClass(_.leafClass).addClass(_.branchClass+" "+_.expandedClass)),s&&s<=m.offset().top?m.children(_.listType).prepend(this.placeholder):m.children(_.listType)[0].appendChild(this.placeholder[0]),void 0!==a&&this._clearEmpty(a[0]),this._trigger("change",e,this._uiHash())):(a.after(this.placeholder[0]),v=!a.children(_.listItem).children("li:visible:not(.ui-sortable-helper)").length,_.isTree&&v&&a.removeClass(this.options.branchClass+" "+this.options.expandedClass).addClass(this.options.leafClass),void 0!==a&&this._clearEmpty(a[0]),this._trigger("change",e,this._uiHash())),this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e){this.beyondMaxLevels&&(this.placeholder.removeClass(this.options.errorClass),this.domPosition.prev?t(this.domPosition.prev).after(this.placeholder):t(this.domPosition.parent).prepend(this.placeholder),this._trigger("revert",e,this._uiHash())),t("."+this.options.hoveringClass).mouseleave().removeClass(this.options.hoveringClass),this.mouseentered=!1,this.hovering&&window.clearTimeout(this.hovering),this.hovering=null,this._relocate_event=e,this._pid_current=t(this.domPosition.parent).parent().attr("id"),this._sort_current=this.domPosition.prev?t(this.domPosition.prev).next().index():0,t.ui.sortable.prototype._mouseStop.apply(this,arguments)},_intersectsWithSides:function(t){var n=this.options.isTree?.8:.5,i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height*n,t.height),r=e(this.positionAbs.top+this.offset.click.top,t.top-t.height*n,t.height),o=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"===a&&o||"left"===a&&!o:s&&("down"===s&&i||"up"===s&&r)},_contactContainers:function(){this.options.protectRoot&&this.currentItem[0].parentNode===this.element[0]||t.ui.sortable.prototype._contactContainers.apply(this,arguments)},_clear:function(){var e,n;for(t.ui.sortable.prototype._clear.apply(this,arguments),this._pid_current===this._uiHash().item.parent().parent().attr("id")&&this._sort_current===this._uiHash().item.index()||this._trigger("relocate",this._relocate_event,this._uiHash()),e=this.items.length-1;e>=0;e--)n=this.items[e].item[0],this._clearEmpty(n)},serialize:function(e){var n=t.extend({},this.options,e),i=this._getItemsAsjQuery(n&&n.connected),r=[];return t(i).each((function(){var e=(t(n.item||this).attr(n.attribute||"id")||"").match(n.expression||/(.+)[-=_](.+)/),i=(t(n.item||this).parent(n.listType).parent(n.items).attr(n.attribute||"id")||"").match(n.expression||/(.+)[-=_](.+)/);e&&r.push((n.key||e[1])+"["+(n.key&&n.expression?e[1]:e[2])+"]="+(i?n.key&&n.expression?i[1]:i[2]:n.rootID))})),!r.length&&n.key&&r.push(n.key+"="),r.join("&")},toHierarchy:function(e){var n=t.extend({},this.options,e),i=[];return t(this.element).children(n.items).each((function(){var t=r(this);i.push(t)})),i;function r(e){var i,o=(t(e).attr(n.attribute||"id")||"").match(n.expression||/(.+)[-=_](.+)/),s=t(e).data();if(s.nestedSortableItem&&delete s.nestedSortableItem,o)return i={id:o[2]},i=t.extend({},i,s),t(e).children(n.listType).children(n.items).length>0&&(i.children=[],t(e).children(n.listType).children(n.items).each((function(){var t=r(this);i.children.push(t)}))),i}},toArray:function(e){var n=t.extend({},this.options,e),i=n.startDepthCount||0,r=[],o=1;return n.excludeRoot||(r.push({item_id:n.rootID,parent_id:null,depth:i,left:o,right:2*(t(n.items,this.element).length+1)}),o++),t(this.element).children(n.items).each((function(){o=s(this,i,o)})),r=r.sort((function(t,e){return t.left-e.left}));function s(e,o,a){var l,c,d=a+1;if(t(e).children(n.listType).children(n.items).length>0&&(o++,t(e).children(n.listType).children(n.items).each((function(){d=s(t(this),o,d)})),o--),l=t(e).attr(n.attribute||"id").match(n.expression||/(.+)[-=_](.+)/),c=o===i?n.rootID:t(e).parent(n.listType).parent(n.items).attr(n.attribute||"id").match(n.expression||/(.+)[-=_](.+)/)[2],l){var h=t(e).data("name");r.push({id:l[2],parent_id:c,depth:o,left:a,right:d,name:h})}return a=d+1}},_clearEmpty:function(e){function n(e,n,i,r){r&&(n=[i,i=n][0]),t(e).removeClass(n).addClass(i)}var i=this.options,r=t(e).children(i.listType),o=r.is(":not(:empty)"),s=i.doNotClear||o||i.protectRoot&&t(e)[0]===this.element[0];i.isTree&&(n(e,i.branchClass,i.leafClass,s),s&&o&&n(e,i.collapsedClass,i.expandedClass)),s||r.remove()},_getLevel:function(t){var e,n=1;if(this.options.listType)for(e=t.closest(this.options.listType);e&&e.length>0&&!e.is(".ui-sortable");)n++,e=e.parent().closest(this.options.listType);return n},_getChildLevels:function(e,n){var i=this,r=this.options,o=0;return n=n||0,t(e).children(r.listType).children(r.items).each((function(t,e){o=Math.max(i._getChildLevels(e,n+1),o)})),n?o+1:o},_isAllowed:function(t,e,n){var i=this.options,r=this.placeholder.closest(".ui-sortable").nestedSortable("option","maxLevels"),o=this.currentItem.parent().parent();i.disableParentChange&&(void 0!==t&&!o.is(t)||void 0===t&&o.is("li"))||!i.isAllowed(this.placeholder,t,this.currentItem)?(this.placeholder.addClass(i.errorClass),this.beyondMaxLevels=r *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,n){return t>=e&&t=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,n){var i=null,r=!1,o=this;return!(this.reverting||this.options.disabled||"static"===this.options.type||(this._refreshItems(e),t(e.target).parents().each((function(){if(t.data(this,o.widgetName+"-item")===o)return i=t(this),!1})),t.data(e.target,o.widgetName+"-item")===o&&(i=t(e.target)),!i||this.options.handle&&!n&&(t(this.options.handle,i).find("*").addBack().each((function(){this===e.target&&(r=!0)})),!r)||(this.currentItem=i,this._removeCurrentsFromItems(),0)))},_mouseStart:function(e,n,i){var r,o,s=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,s.cursorAt&&this._adjustOffsetFromHelper(s.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),s.containment&&this._setContainment(),s.cursor&&"auto"!==s.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",s.cursor),this.storedStylesheet=t("").appendTo(o)),s.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",s.opacity)),s.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",s.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(r=this.containers.length-1;r>=0;r--)this.containers[r]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var n,i,r,o,s=this.options,a=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;n--)if(r=(i=this.items[n]).item[0],(o=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(r===this.currentItem[0]||this.placeholder[1===o?"next":"prev"]()[0]===r||t.contains(this.placeholder[0],r)||"semi-dynamic"===this.options.type&&t.contains(this.element[0],r))){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(e,i),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,n){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var i=this,r=this.placeholder.offset(),o=this.options.axis,s={};o&&"x"!==o||(s.left=r.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(s.top=r.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(s,parseInt(this.options.revert,10)||500,(function(){i._clear(e)}))}else this._clear(e,n);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var n=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},t(n).each((function(){var n=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);n&&i.push((e.key||n[1]+"[]")+"="+(e.key&&e.expression?n[1]:n[2]))})),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(e){var n=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},n.each((function(){i.push(t(e.item||this).attr(e.attribute||"id")||"")})),i},_intersectsWith:function(t){var e=this.positionAbs.left,n=e+this.helperProportions.width,i=this.positionAbs.top,r=i+this.helperProportions.height,o=t.left,s=o+t.width,a=t.top,l=a+t.height,c=this.offset.click.top,d=this.offset.click.left,h="x"===this.options.axis||i+c>a&&i+co&&e+dt[this.floating?"width":"height"]?f:o0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var n,i,r,o,s=[],a=[],l=this._connectWith();if(l&&e)for(n=l.length-1;n>=0;n--)for(i=(r=t(l[n],this.document[0])).length-1;i>=0;i--)(o=t.data(r[i],this.widgetFullName))&&o!==this&&!o.options.disabled&&a.push([t.isFunction(o.options.items)?o.options.items.call(o.element):t(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);function c(){s.push(this)}for(a.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),n=a.length-1;n>=0;n--)a[n][0].each(c);return t(s)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,(function(t){for(var n=0;n=0;n--)for(i=(r=t(u[n],this.document[0])).length-1;i>=0;i--)(o=t.data(r[i],this.widgetFullName))&&o!==this&&!o.options.disabled&&(h.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(n=h.length-1;n>=0;n--)for(s=h[n][1],i=0,c=(a=h[n][0]).length;i=0;n--)(i=this.items[n]).instance!==this.currentContainer&&this.currentContainer&&i.item[0]!==this.currentItem[0]||(r=this.options.toleranceElement?t(this.options.toleranceElement,i.item):i.item,e||(i.width=r.outerWidth(),i.height=r.outerHeight()),o=r.offset(),i.left=o.left,i.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(n=this.containers.length-1;n>=0;n--)o=this.containers[n].element.offset(),this.containers[n].containerCache.left=o.left,this.containers[n].containerCache.top=o.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight();return this},_createPlaceholder:function(e){var n,i=(e=e||this).options;i.placeholder&&i.placeholder.constructor!==String||(n=i.placeholder,i.placeholder={element:function(){var i=e.currentItem[0].nodeName.toLowerCase(),r=t("<"+i+">",e.document[0]);return e._addClass(r,"ui-sortable-placeholder",n||e.currentItem[0].className)._removeClass(r,"ui-sortable-helper"),"tbody"===i?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("",e.document[0]).appendTo(r)):"tr"===i?e._createTrPlaceholder(e.currentItem,r):"img"===i&&r.attr("src",e.currentItem.attr("src")),n||r.css("visibility","hidden"),r},update:function(t,r){n&&!i.forcePlaceholderSize||(r.height()||r.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),r.width()||r.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(i.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),i.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,n){var i=this;e.children().each((function(){t(" ",i.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}))},_contactContainers:function(e){var n,i,r,o,s,a,l,c,d,h,u=null,f=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(u&&t.contains(this.containers[n].element[0],u.element[0]))continue;u=this.containers[n],f=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",e,this._uiHash(this)),this.containers[n].containerCache.over=0);if(u)if(1===this.containers.length)this.containers[f].containerCache.over||(this.containers[f]._trigger("over",e,this._uiHash(this)),this.containers[f].containerCache.over=1);else{for(r=1e4,o=null,s=(d=u.floating||this._isFloating(this.currentItem))?"left":"top",a=d?"width":"height",h=d?"pageX":"pageY",i=this.items.length-1;i>=0;i--)t.contains(this.containers[f].element[0],this.items[i].item[0])&&this.items[i].item[0]!==this.currentItem[0]&&(l=this.items[i].item.offset()[s],c=!1,e[h]-l>this.items[i][a]/2&&(c=!0),Math.abs(e[h]-l)this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),r.grid&&(n=this.originalPageY+Math.round((s-this.originalPageY)/r.grid[1])*r.grid[1],s=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-r.grid[1]:n+r.grid[1]:n,i=this.originalPageX+Math.round((o-this.originalPageX)/r.grid[0])*r.grid[0],o=this.containment?i-this.offset.click.left>=this.containment[0]&&i-this.offset.click.left<=this.containment[2]?i:i-this.offset.click.left>=this.containment[0]?i-r.grid[0]:i+r.grid[0]:i)),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:a.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:a.scrollLeft())}},_rearrange:function(t,e,n,i){n?n[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var r=this.counter;this._delay((function(){r===this.counter&&this.refreshPositions(!i)}))},_clear:function(t,e){this.reverting=!1;var n,i=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(n in this._storedCSS)"auto"!==this._storedCSS[n]&&"static"!==this._storedCSS[n]||(this._storedCSS[n]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function r(t,e,n){return function(i){n._trigger(t,i,e._uiHash(e))}}for(this.fromOutside&&!e&&i.push((function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))})),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||i.push((function(t){this._trigger("update",t,this._uiHash())})),this!==this.currentContainer&&(e||(i.push((function(t){this._trigger("remove",t,this._uiHash())})),i.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),i.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),n=this.containers.length-1;n>=0;n--)e||i.push(r("deactivate",this,this.containers[n])),this.containers[n].containerCache.over&&(i.push(r("out",this,this.containers[n])),this.containers[n].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(n=0;n0?s-4:s;for(n=0;n>16&255,c[d++]=e>>8&255,c[d++]=255&e;2===a&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,c[d++]=255&e);1===a&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,c[d++]=e>>8&255,c[d++]=255&e);return c},e.fromByteArray=function(t){for(var e,i=t.length,r=i%3,o=[],s=16383,a=0,l=i-r;al?l:a+s));1===r?(e=t[i-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===r&&(e=(t[i-2]<<8)+t[i-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,i){for(var r,o,s=[],a=e;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},8997:function(t,e,n){var i,r; -/*! - * Bootstrap Colorpicker v2.5.2 - * https://itsjavi.com/bootstrap-colorpicker/ - * - * Originally written by (c) 2012 Stefan Petre - * Licensed under the Apache License v2.0 - * http://www.apache.org/licenses/LICENSE-2.0.txt - * - */i=[n(9755)],r=function(t){return function(t){"use strict";var e=function(n,i,r,o,s){this.fallbackValue=r?"string"==typeof r?this.parse(r):r:null,this.fallbackFormat=o||"rgba",this.hexNumberSignPrefix=!0===s,this.value=this.fallbackValue,this.origFormat=null,this.predefinedColors=i||{},this.colors=t.extend({},e.webColors,this.predefinedColors),n&&(void 0!==n.h?this.value=n:this.setColor(String(n))),this.value||(this.value={h:0,s:0,b:0,a:1})};e.webColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32",transparent:"transparent"},e.prototype={constructor:e,colors:{},predefinedColors:{},getValue:function(){return this.value},setValue:function(t){this.value=t},_sanitizeNumber:function(t){return"number"==typeof t?t:isNaN(t)||null===t||""===t||void 0===t?1:""===t?0:void 0!==t.toLowerCase?(t.match(/^\./)&&(t="0"+t),Math.ceil(100*parseFloat(t))/100):1},isTransparent:function(t){return!(!t||!("string"==typeof t||t instanceof String))&&("transparent"===(t=t.toLowerCase().trim())||t.match(/#?00000000/)||t.match(/(rgba|hsla)\(0,0,0,0?\.?0\)/))},rgbaIsTransparent:function(t){return 0===t.r&&0===t.g&&0===t.b&&0===t.a},setColor:function(t){if(t=t.toLowerCase().trim()){if(this.isTransparent(t))return this.value={h:0,s:0,b:0,a:0},!0;var e=this.parse(t);e?(this.value=this.value={h:e.h,s:e.s,b:e.b,a:e.a},this.origFormat||(this.origFormat=e.format)):this.fallbackValue&&(this.value=this.fallbackValue)}return!1},setHue:function(t){this.value.h=1-t},setSaturation:function(t){this.value.s=t},setBrightness:function(t){this.value.b=1-t},setAlpha:function(t){this.value.a=Math.round(parseInt(100*(1-t),10)/100*100)/100},toRGB:function(t,e,n,i){var r,o,s,a,l;return 0===arguments.length&&(t=this.value.h,e=this.value.s,n=this.value.b,i=this.value.a),t=(t*=360)%360/60,r=o=s=n-(l=n*e),r+=[l,a=l*(1-Math.abs(t%2-1)),0,0,a,l][t=~~t],o+=[a,l,l,a,0,0][t],s+=[0,0,a,l,l,a][t],{r:Math.round(255*r),g:Math.round(255*o),b:Math.round(255*s),a:i}},toHex:function(t,e,n,i,r){arguments.length<=1&&(e=this.value.h,n=this.value.s,i=this.value.b,r=this.value.a);var o="#",s=this.toRGB(e,n,i,r);return this.rgbaIsTransparent(s)?"transparent":(t||(o=this.hexNumberSignPrefix?"#":""),o+((1<<24)+(parseInt(s.r)<<16)+(parseInt(s.g)<<8)+parseInt(s.b)).toString(16).slice(1))},toHSL:function(t,e,n,i){0===arguments.length&&(t=this.value.h,e=this.value.s,n=this.value.b,i=this.value.a);var r=t,o=(2-e)*n,s=e*n;return s/=o>0&&o<=1?o:2-o,o/=2,s>1&&(s=1),{h:isNaN(r)?0:r,s:isNaN(s)?0:s,l:isNaN(o)?0:o,a:isNaN(i)?0:i}},toAlias:function(t,e,n,i){var r,o=0===arguments.length?this.toHex(!0):this.toHex(!0,t,e,n,i),s="alias"===this.origFormat?o:this.toString(!1,this.origFormat);for(var a in this.colors)if((r=this.colors[a].toLowerCase().trim())===o||r===s)return a;return!1},RGBtoHSB:function(t,e,n,i){var r,o,s,a;return t/=255,e/=255,n/=255,r=((r=0==(a=(s=Math.max(t,e,n))-Math.min(t,e,n))?null:s===t?(e-n)/a:s===e?(n-t)/a+2:(t-e)/a+4)+360)%6*60/360,o=0===a?0:a/s,{h:this._sanitizeNumber(r),s:o,b:s,a:this._sanitizeNumber(i)}},HueToRGB:function(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t},HSLtoRGB:function(t,e,n,i){var r;e<0&&(e=0);var o=2*n-(r=n<=.5?n*(1+e):n+e-n*e),s=t+1/3,a=t,l=t-1/3;return[Math.round(255*this.HueToRGB(o,r,s)),Math.round(255*this.HueToRGB(o,r,a)),Math.round(255*this.HueToRGB(o,r,l)),this._sanitizeNumber(i)]},parse:function(e){if("string"!=typeof e)return this.fallbackValue;if(0===arguments.length)return!1;var n,i,r=this,o=!1,s=void 0!==this.colors[e];return s&&(e=this.colors[e].toLowerCase().trim()),t.each(this.stringParsers,(function(t,a){var l=a.re.exec(e);return!(n=l&&a.parse.apply(r,[l]))||(o={},i=s?"alias":a.format?a.format:r.getValidFallbackFormat(),(o=i.match(/hsla?/)?r.RGBtoHSB.apply(r,r.HSLtoRGB.apply(r,n)):r.RGBtoHSB.apply(r,n))instanceof Object&&(o.format=i),!1)})),o},getValidFallbackFormat:function(){var t=["rgba","rgb","hex","hsla","hsl"];return this.origFormat&&-1!==t.indexOf(this.origFormat)?this.origFormat:this.fallbackFormat&&-1!==t.indexOf(this.fallbackFormat)?this.fallbackFormat:"rgba"},toString:function(t,n,i){i=i||!1;var r=!1;switch(n=n||this.origFormat||this.fallbackFormat){case"rgb":return r=this.toRGB(),this.rgbaIsTransparent(r)?"transparent":"rgb("+r.r+","+r.g+","+r.b+")";case"rgba":return"rgba("+(r=this.toRGB()).r+","+r.g+","+r.b+","+r.a+")";case"hsl":return r=this.toHSL(),"hsl("+Math.round(360*r.h)+","+Math.round(100*r.s)+"%,"+Math.round(100*r.l)+"%)";case"hsla":return r=this.toHSL(),"hsla("+Math.round(360*r.h)+","+Math.round(100*r.s)+"%,"+Math.round(100*r.l)+"%,"+r.a+")";case"hex":return this.toHex(t);case"alias":return!1===(r=this.toAlias())?this.toString(t,this.getValidFallbackFormat()):i&&!(r in e.webColors)&&r in this.predefinedColors?this.predefinedColors[r]:r;default:return r}},stringParsers:[{re:/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*?\)/,format:"rgb",parse:function(t){return[t[1],t[2],t[3],1]}},{re:/rgb\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,format:"rgb",parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],1]}},{re:/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/hsl\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,format:"hsl",parse:function(t){return[t[1]/360,t[2]/100,t[3]/100,t[4]]}},{re:/hsla\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"hsla",parse:function(t){return[t[1]/360,t[2]/100,t[3]/100,t[4]]}},{re:/#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,format:"hex",parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),1]}},{re:/#?([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,format:"hex",parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),1]}}],colorNameToHex:function(t){return void 0!==this.colors[t.toLowerCase()]&&this.colors[t.toLowerCase()]}};var n={horizontal:!1,inline:!1,color:!1,format:!1,input:"input",container:!1,component:".add-on, .input-group-addon",fallbackColor:!1,fallbackFormat:"hex",hexNumberSignPrefix:!0,sliders:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setHue"},alpha:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setAlpha"}},slidersHorz:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:100,maxTop:0,callLeft:"setHue",callTop:!1},alpha:{maxLeft:100,maxTop:0,callLeft:"setAlpha",callTop:!1}},template:''}),(e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype)).constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),n=this.getContent();if(this.options.html){var i=typeof n;this.options.sanitize&&(e=this.sanitizeHtml(e),"string"===i&&(n=this.sanitizeHtml(n))),t.find(".popover-title").html(e),t.find(".popover-content").children().detach().end()["string"===i?"html":"append"](n)}else t.find(".popover-title").text(e),t.find(".popover-content").children().detach().end().text(n);t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var n=t.fn.popover;t.fn.popover=function(n){return this.each((function(){var i=t(this),r=i.data("bs.popover"),o="object"==typeof n&&n;!r&&/destroy|hide/.test(n)||(r||i.data("bs.popover",r=new e(this,o)),"string"==typeof n&&r[n]())}))},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=n,this}}(n(9755))},3497:function(t,e,n){!function(t){"use strict";function e(n,i){this.$body=t(document.body),this.$scrollElement=t(n).is(document.body)?t(window):t(n),this.options=t.extend({},e.DEFAULTS,i),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",t.proxy(this.process,this)),this.refresh(),this.process()}function n(n){return this.each((function(){var i=t(this),r=i.data("bs.scrollspy"),o="object"==typeof n&&n;r||i.data("bs.scrollspy",r=new e(this,o)),"string"==typeof n&&r[n]()}))}e.VERSION="3.4.1",e.DEFAULTS={offset:10},e.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},e.prototype.refresh=function(){var e=this,n="offset",i=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),t.isWindow(this.$scrollElement[0])||(n="position",i=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map((function(){var e=t(this),r=e.data("target")||e.attr("href"),o=/^#./.test(r)&&t(r);return o&&o.length&&o.is(":visible")&&[[o[n]().top+i,r]]||null})).sort((function(t,e){return t[0]-e[0]})).each((function(){e.offsets.push(this[0]),e.targets.push(this[1])}))},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,n=this.getScrollHeight(),i=this.options.offset+n-this.$scrollElement.height(),r=this.offsets,o=this.targets,s=this.activeTarget;if(this.scrollHeight!=n&&this.refresh(),e>=i)return s!=(t=o[o.length-1])&&this.activate(t);if(s&&e=r[t]&&(void 0===r[t+1]||e .active"),s=r&&t.support.transition&&(o.length&&o.hasClass("fade")||!!i.find("> .fade").length);function a(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),n.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),s?(n[0].offsetWidth,n.addClass("in")):n.removeClass("fade"),n.parent(".dropdown-menu").length&&n.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),r&&r()}o.length&&s?o.one("bsTransitionEnd",a).emulateTransitionEnd(e.TRANSITION_DURATION):a(),o.removeClass("in")};var i=t.fn.tab;t.fn.tab=n,t.fn.tab.Constructor=e,t.fn.tab.noConflict=function(){return t.fn.tab=i,this};var r=function(e){e.preventDefault(),n.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',r).on("click.bs.tab.data-api",'[data-toggle="pill"]',r)}(n(9755))},6278:function(t,e,n){!function(t){"use strict";var e=["sanitize","whiteList","sanitizeFn"],n=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],i={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,o=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function s(e,i){var s=e.nodeName.toLowerCase();if(-1!==t.inArray(s,i))return-1===t.inArray(s,n)||Boolean(e.nodeValue.match(r)||e.nodeValue.match(o));for(var a=t(i).filter((function(t,e){return e instanceof RegExp})),l=0,c=a.length;l
    ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:i},l.prototype.init=function(e,n,i){if(this.enabled=!0,this.type=e,this.$element=t(n),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&t(document).find(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var r=this.options.trigger.split(" "),o=r.length;o--;){var s=r[o];if("click"==s)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",l="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},l.prototype.getDefaults=function(){return l.DEFAULTS},l.prototype.getOptions=function(n){var i=this.$element.data();for(var r in i)i.hasOwnProperty(r)&&-1!==t.inArray(r,e)&&delete i[r];return(n=t.extend({},this.getDefaults(),i,n)).delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),n.sanitize&&(n.template=a(n.template,n.whiteList,n.sanitizeFn)),n},l.prototype.getDelegateOptions=function(){var e={},n=this.getDefaults();return this._options&&t.each(this._options,(function(t,i){n[t]!=i&&(e[t]=i)})),e},l.prototype.enter=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),e instanceof t.Event&&(n.inState["focusin"==e.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState)n.hoverState="in";else{if(clearTimeout(n.timeout),n.hoverState="in",!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout((function(){"in"==n.hoverState&&n.show()}),n.options.delay.show)}},l.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},l.prototype.leave=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),e instanceof t.Event&&(n.inState["focusout"==e.type?"focus":"hover"]=!1),!n.isInStateTrue()){if(clearTimeout(n.timeout),n.hoverState="out",!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout((function(){"out"==n.hoverState&&n.hide()}),n.options.delay.hide)}},l.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var n=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!n)return;var i=this,r=this.tip(),o=this.getUID(this.type);this.setContent(),r.attr("id",o),this.$element.attr("aria-describedby",o),this.options.animation&&r.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,r[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,c=a.test(s);c&&(s=s.replace(a,"")||"top"),r.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?r.appendTo(t(document).find(this.options.container)):r.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var d=this.getPosition(),h=r[0].offsetWidth,u=r[0].offsetHeight;if(c){var f=s,p=this.getPosition(this.$viewport);s="bottom"==s&&d.bottom+u>p.bottom?"top":"top"==s&&d.top-up.width?"left":"left"==s&&d.left-hs.top+s.height&&(r.top=s.top+s.height-l)}else{var c=e.left-o,d=e.left+o+n;cs.right&&(r.left=s.left+s.width-d)}return r},l.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},l.prototype.getUID=function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},l.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},l.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},l.prototype.enable=function(){this.enabled=!0},l.prototype.disable=function(){this.enabled=!1},l.prototype.toggleEnabled=function(){this.enabled=!this.enabled},l.prototype.toggle=function(e){var n=this;e&&((n=t(e.currentTarget).data("bs."+this.type))||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n))),e?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},l.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide((function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null}))},l.prototype.sanitizeHtml=function(t){return a(t,this.options.whiteList,this.options.sanitizeFn)};var c=t.fn.tooltip;t.fn.tooltip=function(e){return this.each((function(){var n=t(this),i=n.data("bs.tooltip"),r="object"==typeof e&&e;!i&&/destroy|hide/.test(e)||(i||n.data("bs.tooltip",i=new l(this,r)),"string"==typeof e&&i[e]())}))},t.fn.tooltip.Constructor=l,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=c,this}}(n(9755))},8294:function(t,e,n){!function(t){"use strict";t.fn.emulateTransitionEnd=function(e){var n=!1,i=this;t(this).one("bsTransitionEnd",(function(){n=!0}));return setTimeout((function(){n||t(i).trigger(t.support.transition.end)}),e),this},t((function(){t.support.transition=function(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in e)if(void 0!==t.style[n])return{end:e[n]};return!1}(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})}))}(n(9755))},8764:function(t,e,n){"use strict"; -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */var i=n(9742),r=n(645),o=n(5826);function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(t).length;default:if(i)return B(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return S(this,e,n);case"latin1":case"binary":return I(this,e,n);case"base64":return D(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function g(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function v(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=l.from(e,i)),l.isBuffer(e))return 0===e.length?-1:y(t,e,n,i,r);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,i,r){var o,s=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(r){var d=-1;for(o=n;oa&&(n=a-l),o=n;o>=0;o--){for(var h=!0,u=0;ur&&(i=r):i=r;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s>8,r=n%256,o.push(r),o.push(i);return o}(e,t.length-n),t,n,i)}function D(t,e,n){return 0===e&&n===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,n))}function k(t,e,n){n=Math.min(t.length,n);for(var i=[],r=e;r239?4:c>223?3:c>191?2:1;if(r+h<=n)switch(h){case 1:c<128&&(d=c);break;case 2:128==(192&(o=t[r+1]))&&(l=(31&c)<<6|63&o)>127&&(d=l);break;case 3:o=t[r+1],s=t[r+2],128==(192&o)&&128==(192&s)&&(l=(15&c)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(d=l);break;case 4:o=t[r+1],s=t[r+2],a=t[r+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(d=l)}null===d?(d=65533,h=1):d>65535&&(d-=65536,i.push(d>>>10&1023|55296),d=56320|1023&d),i.push(d),r+=h}return function(t){var e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);var n="",i=0;for(;i0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},l.prototype.compare=function(t,e,n,i,r){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(r>>>=0)-(i>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(o,s),c=this.slice(i,r),d=t.slice(e,n),h=0;hr)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return _(this,t,e,n);case"utf8":case"utf-8":return b(this,t,e,n);case"ascii":return w(this,t,e,n);case"latin1":case"binary":return T(this,t,e,n);case"base64":return C(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function S(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;ri)&&(n=i);for(var r="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,n,i,r,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function A(t,e,n,i){e<0&&(e=65535+e+1);for(var r=0,o=Math.min(t.length-n,2);r>>8*(i?r:1-r)}function P(t,e,n,i){e<0&&(e=4294967295+e+1);for(var r=0,o=Math.min(t.length-n,4);r>>8*(i?r:3-r)&255}function N(t,e,n,i,r,o){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function K(t,e,n,i,o){return o||N(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function $(t,e,n,i,o){return o||N(t,0,n,8),r.write(t,e,n,i,52,8),n+8}l.prototype.slice=function(t,e){var n,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(r*=256);)i+=this[t+--e]*r;return i},l.prototype.readUInt8=function(t,e){return e||M(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||M(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||M(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var i=this[t],r=1,o=0;++o=(r*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var i=e,r=1,o=this[t+--i];i>0&&(r*=256);)o+=this[t+--i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||M(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){e||M(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||M(t,4,this.length),r.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||M(t,4,this.length),r.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||M(t,8,this.length),r.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||M(t,8,this.length),r.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,n,i){(t=+t,e|=0,n|=0,i)||L(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+r]=t/o&255;return e+n},l.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):A(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):A(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):P(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);L(this,t,e,n,r-1,-r)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+n},l.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);L(this,t,e,n,r-1,-r)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):A(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):A(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):P(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,n){return K(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return K(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return $(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return $(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--r)t[r+e]=this[r+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Y(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,n,i){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}},4349:function(t,e,n){var i=n(4155),r=n(4627),o=n(687),s=n(2830).Stream,a=t.exports=function(){var t=null;function e(e){if(t)throw new Error("multiple inputs specified");t=e}var n=null;function o(t){if(n)throw new Error("multiple outputs specified");n=t}for(var s=0;s0&&this.down(e),t>0?this.right(t):t<0&&this.left(-t),this},l.prototype.up=function(t){return void 0===t&&(t=1),this.write(o("["+Math.floor(t)+"A")),this},l.prototype.down=function(t){return void 0===t&&(t=1),this.write(o("["+Math.floor(t)+"B")),this},l.prototype.right=function(t){return void 0===t&&(t=1),this.write(o("["+Math.floor(t)+"C")),this},l.prototype.left=function(t){return void 0===t&&(t=1),this.write(o("["+Math.floor(t)+"D")),this},l.prototype.column=function(t){return this.write(o("["+Math.floor(t)+"G")),this},l.prototype.push=function(t){return this.write(o(t?"7":"[s")),this},l.prototype.pop=function(t){return this.write(o(t?"8":"[u")),this},l.prototype.erase=function(t){return"end"===t||"$"===t?this.write(o("[K")):"start"===t||"^"===t?this.write(o("[1K")):"line"===t?this.write(o("[2K")):"down"===t?this.write(o("[J")):"up"===t||"screen"===t?this.write(o("[1J")):this.emit("error",new Error("Unknown erase type: "+t)),this},l.prototype.display=function(t){var e={reset:0,bright:1,dim:2,underscore:4,blink:5,reverse:7,hidden:8}[t];return void 0===e&&this.emit("error",new Error("Unknown attribute: "+t)),this.write(o("["+e+"m")),this},l.prototype.foreground=function(t){if("number"==typeof t)(t<0||t>=256)&&this.emit("error",new Error("Color out of range: "+t)),this.write(o("[38;5;"+t+"m"));else{var e={black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37}[t.toLowerCase()];e||this.emit("error",new Error("Unknown color: "+t)),this.write(o("["+e+"m"))}return this},l.prototype.background=function(t){if("number"==typeof t)(t<0||t>=256)&&this.emit("error",new Error("Color out of range: "+t)),this.write(o("[48;5;"+t+"m"));else{var e={black:40,red:41,green:42,yellow:43,blue:44,magenta:45,cyan:46,white:47}[t.toLowerCase()];e||this.emit("error",new Error("Unknown color: "+t)),this.write(o("["+e+"m"))}return this},l.prototype.cursor=function(t){return this.write(o(t?"[?25h":"[?25l")),this};var c=a.extractCodes=function(t){for(var e=[],n=-1,i=0;i=0&&e.push(t.slice(n,i)),n=i):n>=0&&i===t.length-1&&e.push(t.slice(n));return e}},687:function(t,e,n){var i=n(8764).Buffer,r=(t.exports=function(t){return new i([27].concat(function t(e){return"string"==typeof e?e.split("").map(r):Array.isArray(e)?e.reduce((function(e,n){return e.concat(t(n))}),[]):void 0}(t)))}).ord=function(t){return t.charCodeAt(0)}},1260:function(t,e,n){var i; -/*! - * Chart.js - * http://chartjs.org/ - * Version: 1.1.1 - * - * Copyright 2015 Nick Downie - * Released under the MIT license - * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md - */(function(){"use strict";var r=this,o=r.Chart,s=function(t){this.canvas=t.canvas,this.ctx=t;var e=function(t,e){return t["offset"+e]?t["offset"+e]:document.defaultView.getComputedStyle(t).getPropertyValue(e)};this.width=e(t.canvas,"Width")||t.canvas.width,this.height=e(t.canvas,"Height")||t.canvas.height;return this.aspectRatio=this.width/this.height,c.retinaScale(this),this};s.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,customTooltips:!1,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipTitleTemplate:"<%= label%>",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>",multiTooltipTemplate:"<%= datasetLabel %>: <%= value %>",multiTooltipKeyBackground:"#fff",segmentColorDefault:["#A6CEE3","#1F78B4","#B2DF8A","#33A02C","#FB9A99","#E31A1C","#FDBF6F","#FF7F00","#CAB2D6","#6A3D9A","#B4B482","#B15928"],segmentHighlightColorDefaults:["#CEF6FF","#47A0DC","#DAFFB2","#5BC854","#FFC2C1","#FF4244","#FFE797","#FFA728","#F2DAFE","#9265C2","#DCDCAA","#D98150"],onAnimationProgress:function(){},onAnimationComplete:function(){}}},s.types={};var a,l,c=s.helpers={},d=c.each=function(t,e,n){var i,r=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length)for(i=0;i=0;i--){var r=t[i];if(e(r))return r}},c.inherits=function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=e.prototype,n.prototype=new i,n.extend=m,t&&u(n.prototype,t),n.__super__=e.prototype,n}),g=c.noop=function(){},v=c.uid=(a=0,function(){return"chart-"+a++}),y=c.warn=function(t){window.console&&"function"==typeof window.console.warn&&console.warn(t)},_=c.amd=n.amdO,b=c.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},w=c.max=function(t){return Math.max.apply(Math,t)},T=c.min=function(t){return Math.min.apply(Math,t)},C=(c.cap=function(t,e,n){if(b(e)){if(t>e)return e}else if(b(n)&&t=o,a=[];d(t,(function(t){null==t||a.push(t)}));var l=T(a),c=w(a);c===l&&(c+=.5,l>=.5&&!i?l-=.5:c+=.5);for(var h=Math.abs(c-l),u=k(h),f=Math.ceil(c/(1*Math.pow(10,u)))*Math.pow(10,u),p=i?0:Math.floor(l/(1*Math.pow(10,u)))*Math.pow(10,u),m=f-p,g=Math.pow(10,u),v=Math.round(m/g);(v>o||2*vo)g*=2,(v=Math.round(m/g))%1!=0&&(s=!0);else if(r&&u>=0){if(g/2%1!=0)break;g/=2,v=Math.round(m/g)}else g/=2,v=Math.round(m/g);return s&&(g=m/(v=2)),{steps:v,stepValue:g,min:p,max:p+v*g}},c.template=function(t,e){if(t instanceof Function)return t(e);var n,i,r,o={};return i=e,r=/\W/.test(n=t)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+n.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):o[n]=o[n],i?r(i):r}),S=(c.generateLabels=function(t,e,n,i){var r=new Array(e);return t&&d(r,(function(e,o){r[o]=x(t,{value:n+i*(o+1)})})),r},c.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(1-Math.pow(2,-10*t/1))},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-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)?1:(n||(n=.3),ii?n:i})),i},H=c.drawRoundedRectangle=function(t,e,n,i,r,o){t.beginPath(),t.moveTo(e+o,n),t.lineTo(e+i-o,n),t.quadraticCurveTo(e+i,n,e+i,n+o),t.lineTo(e+i,n+r-o),t.quadraticCurveTo(e+i,n+r,e+i-o,n+r),t.lineTo(e+o,n+r),t.quadraticCurveTo(e,n+r,e,n+r-o),t.lineTo(e,n+o),t.quadraticCurveTo(e,n,e+o,n),t.closePath()};s.instances={},u((s.Type=function(t,e,n){this.options=e,this.chart=n,this.id=v(),s.instances[this.id]=this,e.responsive&&this.resize(),this.initialize.call(this,t)}).prototype,{initialize:function(){return this},clear:function(){return K(this.chart),this},stop:function(){return s.animationService.cancelAnimation(this),this},resize:function(t){this.stop();var e=this.chart.canvas,n=L(this.chart.canvas),i=this.options.maintainAspectRatio?n/this.chart.aspectRatio:A(this.chart.canvas);return e.width=this.chart.width=n,e.height=this.chart.height=i,N(this.chart),"function"==typeof t&&t.apply(this,Array.prototype.slice.call(arguments,1)),this},reflow:g,render:function(t){if(t&&this.reflow(),this.options.animation&&!t){var e=new s.Animation;e.numSteps=this.options.animationSteps,e.easing=this.options.animationEasing,e.render=function(t,e){var n=c.easingEffects[e.easing],i=e.currentStep/e.numSteps,r=n(i);t.draw(r,i,e.currentStep)},e.onAnimationProgress=this.options.onAnimationProgress,e.onAnimationComplete=this.options.onAnimationComplete,s.animationService.addAnimation(this,e)}else this.draw(),this.options.onAnimationComplete.call(this);return this},generateLegend:function(){return c.template(this.options.legendTemplate,this)},destroy:function(){this.stop(),this.clear(),M(this,this.events);var t=this.chart.canvas;t.width=this.chart.width,t.height=this.chart.height,t.style.removeProperty?(t.style.removeProperty("width"),t.style.removeProperty("height")):(t.style.removeAttribute("width"),t.style.removeAttribute("height")),delete s.instances[this.id]},showTooltip:function(t,e){if(void 0===this.activeElements&&(this.activeElements=[]),function(t){var e=!1;return t.length!==this.activeElements.length?e=!0:(d(t,(function(t,n){t!==this.activeElements[n]&&(e=!0)}),this),e)}.call(this,t)||e){if(this.activeElements=t,this.draw(),this.options.customTooltips&&this.options.customTooltips(!1),t.length>0)if(this.datasets&&this.datasets.length>1){for(var n,i,r=this.datasets.length-1;r>=0&&(n=this.datasets[r].points||this.datasets[r].bars||this.datasets[r].segments,-1===(i=p(n,t[0])));r--);var o=[],a=[],l=function(t){var e,n,r,s,l,d=[],h=[],u=[];return c.each(this.datasets,(function(t){(e=t.points||t.bars||t.segments)[i]&&e[i].hasValue()&&d.push(e[i])})),c.each(d,(function(t){h.push(t.x),u.push(t.y),o.push(c.template(this.options.multiTooltipTemplate,t)),a.push({fill:t._saved.fillColor||t.fillColor,stroke:t._saved.strokeColor||t.strokeColor})}),this),l=T(u),r=w(u),s=T(h),n=w(h),{x:s>this.chart.width/2?s:n,y:(l+r)/2}}.call(this,i);new s.MultiTooltip({x:l.x,y:l.y,xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,xOffset:this.options.tooltipXOffset,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,titleTextColor:this.options.tooltipTitleFontColor,titleFontFamily:this.options.tooltipTitleFontFamily,titleFontStyle:this.options.tooltipTitleFontStyle,titleFontSize:this.options.tooltipTitleFontSize,cornerRadius:this.options.tooltipCornerRadius,labels:o,legendColors:a,legendColorBackground:this.options.multiTooltipKeyBackground,title:x(this.options.tooltipTitleTemplate,t[0]),chart:this.chart,ctx:this.chart.ctx,custom:this.options.customTooltips}).draw()}else d(t,(function(t){var e=t.tooltipPosition();new s.Tooltip({x:Math.round(e.x),y:Math.round(e.y),xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,caretHeight:this.options.tooltipCaretSize,cornerRadius:this.options.tooltipCornerRadius,text:x(this.options.tooltipTemplate,t),chart:this.chart,custom:this.options.customTooltips}).draw()}),this);return this}},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)}}),s.Type.extend=function(t){var e=this,n=function(){return e.apply(this,arguments)};if(n.prototype=h(e.prototype),u(n.prototype,t),n.extend=s.Type.extend,t.name||e.prototype.name){var i=t.name||e.prototype.name,r=s.defaults[e.prototype.name]?h(s.defaults[e.prototype.name]):{};s.defaults[i]=u(r,t.defaults),s.types[i]=n,s.prototype[i]=function(t,e){var r=f(s.defaults.global,s.defaults[i],e||{});return new n(t,r,this)}}else y("Name not provided for this chart, so it hasn't been registered");return e},s.Element=function(t){u(this,t),this.initialize.apply(this,arguments),this.save()},u(s.Element.prototype,{initialize:function(){},restore:function(t){return t?d(t,(function(t){this[t]=this._saved[t]}),this):u(this,this._saved),this},save:function(){return this._saved=h(this),delete this._saved._saved,this},update:function(t){return d(t,(function(t,e){this._saved[e]=this[e],this[e]=t}),this),this},transition:function(t,e){return d(t,(function(t,n){this[n]=(t-this._saved[n])*e+this._saved[n]}),this),this},tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return b(this.value)}}),s.Element.extend=m,s.Point=s.Element.extend({display:!0,inRange:function(t,e){var n=this.hitDetectionRadius+this.radius;return Math.pow(t-this.x,2)+Math.pow(e-this.y,2)=r:i>=r&&i<=o,a=n.distance>=this.innerRadius&&n.distance<=this.outerRadius;return s&&a},tooltipPosition:function(){var t=this.startAngle+(this.endAngle-this.startAngle)/2,e=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(t)*e,y:this.y+Math.sin(t)*e}},draw:function(t){var e=this.ctx;e.beginPath(),e.arc(this.x,this.y,this.outerRadius<0?0:this.outerRadius,this.startAngle,this.endAngle),e.arc(this.x,this.y,this.innerRadius<0?0:this.innerRadius,this.endAngle,this.startAngle,!0),e.closePath(),e.strokeStyle=this.strokeColor,e.lineWidth=this.strokeWidth,e.fillStyle=this.fillColor,e.fill(),e.lineJoin="bevel",this.showStroke&&e.stroke()}}),s.Rectangle=s.Element.extend({draw:function(){var t=this.ctx,e=this.width/2,n=this.x-e,i=this.x+e,r=this.base-(this.base-this.y),o=this.strokeWidth/2;this.showStroke&&(n+=o,i-=o,r+=o),t.beginPath(),t.fillStyle=this.fillColor,t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.moveTo(n,this.base),t.lineTo(n,r),t.lineTo(i,r),t.lineTo(i,this.base),t.fill(),this.showStroke&&t.stroke()},height:function(){return this.base-this.y},inRange:function(t,e){return t>=this.x-this.width/2&&t<=this.x+this.width/2&&e>=this.y&&e<=this.base}}),s.Animation=s.Element.extend({currentStep:null,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),s.Tooltip=s.Element.extend({draw:function(){var t=this.chart.ctx;t.font=$(this.fontSize,this.fontStyle,this.fontFamily),this.xAlign="center",this.yAlign="above";var e=this.caretPadding=2,n=t.measureText(this.text).width+2*this.xPadding,i=this.fontSize+2*this.yPadding,r=i+this.caretHeight+e;this.x+n/2>this.chart.width?this.xAlign="left":this.x-n/2<0&&(this.xAlign="right"),this.y-r<0&&(this.yAlign="below");var o=this.x-n/2,s=this.y-r;if(t.fillStyle=this.fillColor,this.custom)this.custom(this);else{switch(this.yAlign){case"above":t.beginPath(),t.moveTo(this.x,this.y-e),t.lineTo(this.x+this.caretHeight,this.y-(e+this.caretHeight)),t.lineTo(this.x-this.caretHeight,this.y-(e+this.caretHeight)),t.closePath(),t.fill();break;case"below":s=this.y+e+this.caretHeight,t.beginPath(),t.moveTo(this.x,this.y+e),t.lineTo(this.x+this.caretHeight,this.y+e+this.caretHeight),t.lineTo(this.x-this.caretHeight,this.y+e+this.caretHeight),t.closePath(),t.fill()}switch(this.xAlign){case"left":o=this.x-n+(this.cornerRadius+this.caretHeight);break;case"right":o=this.x-(this.cornerRadius+this.caretHeight)}H(t,o,s,n,i,this.cornerRadius),t.fill(),t.fillStyle=this.textColor,t.textAlign="center",t.textBaseline="middle",t.fillText(this.text,o+n/2,s+i/2)}}}),s.MultiTooltip=s.Element.extend({initialize:function(){this.font=$(this.fontSize,this.fontStyle,this.fontFamily),this.titleFont=$(this.titleFontSize,this.titleFontStyle,this.titleFontFamily),this.titleHeight=this.title?1.5*this.titleFontSize:0,this.height=this.labels.length*this.fontSize+(this.labels.length-1)*(this.fontSize/2)+2*this.yPadding+this.titleHeight,this.ctx.font=this.titleFont;var t=this.ctx.measureText(this.title).width,e=F(this.ctx,this.font,this.labels)+this.fontSize+3,n=w([e,t]);this.width=n+2*this.xPadding;var i=this.height/2;this.y-i<0?this.y=i:this.y+i>this.chart.height&&(this.y=this.chart.height-i),this.x>this.chart.width/2?this.x-=this.xOffset+this.width:this.x+=this.xOffset},getLineHeight:function(t){var e=this.y-this.height/2+this.yPadding,n=t-1;return 0===t?e+this.titleHeight/3:e+(1.5*this.fontSize*n+this.fontSize/2)+this.titleHeight},draw:function(){if(this.custom)this.custom(this);else{H(this.ctx,this.x,this.y-this.height/2,this.width,this.height,this.cornerRadius);var t=this.ctx;t.fillStyle=this.fillColor,t.fill(),t.closePath(),t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.titleTextColor,t.font=this.titleFont,t.fillText(this.title,this.x+this.xPadding,this.getLineHeight(0)),t.font=this.font,c.each(this.labels,(function(e,n){t.fillStyle=this.textColor,t.fillText(e,this.x+this.xPadding+this.fontSize+3,this.getLineHeight(n+1)),t.fillStyle=this.legendColorBackground,t.fillRect(this.x+this.xPadding,this.getLineHeight(n+1)-this.fontSize/2,this.fontSize,this.fontSize),t.fillStyle=this.legendColors[n].fill,t.fillRect(this.x+this.xPadding,this.getLineHeight(n+1)-this.fontSize/2,this.fontSize,this.fontSize)}),this)}}}),s.Scale=s.Element.extend({initialize:function(){this.fit()},buildYLabels:function(){this.yLabels=[];for(var t=C(this.stepValue),e=0;e<=this.steps;e++)this.yLabels.push(x(this.templateString,{value:(this.min+e*this.stepValue).toFixed(t)}));this.yLabelWidth=this.display&&this.showLabels?F(this.ctx,this.font,this.yLabels)+10:0},addXLabel:function(t){this.xLabels.push(t),this.valuesCount++,this.fit()},removeXLabel:function(){this.xLabels.shift(),this.valuesCount--,this.fit()},fit:function(){this.startPoint=this.display?this.fontSize:0,this.endPoint=this.display?this.height-1.5*this.fontSize-5:this.height,this.startPoint+=this.padding,this.endPoint-=this.padding;var t,e=this.endPoint,n=this.endPoint-this.startPoint;for(this.calculateYRange(n),this.buildYLabels(),this.calculateXLabelRotation();n>this.endPoint-this.startPoint;)n=this.endPoint-this.startPoint,t=this.yLabelWidth,this.calculateYRange(n),this.buildYLabels(),tthis.yLabelWidth?e/2:this.yLabelWidth,this.xLabelRotation=0,this.display){var i,r=F(this.ctx,this.font,this.xLabels);this.xLabelWidth=r;for(var o=Math.floor(this.calculateX(1)-this.calculateX(0))-6;this.xLabelWidth>o&&0===this.xLabelRotation||this.xLabelWidth>o&&this.xLabelRotation<=90&&this.xLabelRotation>0;)(i=Math.cos(E(this.xLabelRotation)))*n,(t=i*e)+this.fontSize/2>this.yLabelWidth&&(this.xScalePaddingLeft=t+this.fontSize/2),this.xScalePaddingRight=this.fontSize/2,this.xLabelRotation++,this.xLabelWidth=i*r;this.xLabelRotation>0&&(this.endPoint-=Math.sin(E(this.xLabelRotation))*r+3)}else this.xLabelWidth=0,this.xScalePaddingRight=this.padding,this.xScalePaddingLeft=this.padding},calculateYRange:g,drawingArea:function(){return this.startPoint-this.endPoint},calculateY:function(t){var e=this.drawingArea()/(this.min-this.max);return this.endPoint-e*(t-this.min)},calculateX:function(t){this.xLabelRotation;var e=(this.width-(this.xScalePaddingLeft+this.xScalePaddingRight))/Math.max(this.valuesCount-(this.offsetGridLines?0:1),1),n=e*t+this.xScalePaddingLeft;return this.offsetGridLines&&(n+=e/2),Math.round(n)},update:function(t){c.extend(this,t),this.fit()},draw:function(){var t=this.ctx,e=(this.endPoint-this.startPoint)/this.steps,n=Math.round(this.xScalePaddingLeft);this.display&&(t.fillStyle=this.textColor,t.font=this.font,d(this.yLabels,(function(i,r){var o=this.endPoint-e*r,s=Math.round(o),a=this.showHorizontalLines;t.textAlign="right",t.textBaseline="middle",this.showLabels&&t.fillText(i,n-10,o),0!==r||a||(a=!0),a&&t.beginPath(),r>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),s+=c.aliasPixel(t.lineWidth),a&&(t.moveTo(n,s),t.lineTo(this.width,s),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(n-5,s),t.lineTo(n,s),t.stroke(),t.closePath()}),this),d(this.xLabels,(function(e,n){var i=this.calculateX(n)+D(this.lineWidth),r=this.calculateX(n-(this.offsetGridLines?.5:0))+D(this.lineWidth),o=this.xLabelRotation>0,s=this.showVerticalLines;0!==n||s||(s=!0),s&&t.beginPath(),n>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),s&&(t.moveTo(r,this.endPoint),t.lineTo(r,this.startPoint-3),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(r,this.endPoint),t.lineTo(r,this.endPoint+5),t.stroke(),t.closePath(),t.save(),t.translate(i,o?this.endPoint+12:this.endPoint+8),t.rotate(-1*E(this.xLabelRotation)),t.font=this.font,t.textAlign=o?"right":"center",t.textBaseline=o?"middle":"top",t.fillText(e,0,0),t.restore()}),this))}}),s.RadialScale=s.Element.extend({initialize:function(){this.size=T([this.height,this.width]),this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2},calculateCenterOffset:function(t){var e=this.drawingArea/(this.max-this.min);return(t-this.min)*e},update:function(){this.lineArc?this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize(),this.buildYLabels()},buildYLabels:function(){this.yLabels=[];for(var t=C(this.stepValue),e=0;e<=this.steps;e++)this.yLabels.push(x(this.templateString,{value:(this.min+e*this.stepValue).toFixed(t)}))},getCircumference:function(){return 2*Math.PI/this.valuesCount},setScaleSize:function(){var t,e,n,i,r,o,s,a,l,c,d,h,u=T([this.height/2-this.pointLabelFontSize-5,this.width/2]),f=this.width,p=0;for(this.ctx.font=$(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),e=0;ef&&(f=t.x+i,r=e),t.x-if&&(f=t.x+n,r=e):e>this.valuesCount/2&&t.x-n0){var i,r=n*(this.drawingArea/this.steps),o=this.yCenter-r;if(this.lineWidth>0)if(t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,this.lineArc)t.beginPath(),t.arc(this.xCenter,this.yCenter,r,0,2*Math.PI),t.closePath(),t.stroke();else{t.beginPath();for(var s=0;s=0;e--){var n=null,i=null;if(this.angleLineWidth>0&&e%this.angleLineInterval==0&&(n=this.calculateCenterOffset(this.max),i=this.getPointPosition(e,n),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(i.x,i.y),t.stroke(),t.closePath()),this.backgroundColors&&this.backgroundColors.length==this.valuesCount){null==n&&(n=this.calculateCenterOffset(this.max)),null==i&&(i=this.getPointPosition(e,n));var r=this.getPointPosition(0===e?this.valuesCount-1:e-1,n),o=this.getPointPosition(e===this.valuesCount-1?0:e+1,n),s={x:(r.x+i.x)/2,y:(r.y+i.y)/2},a={x:(i.x+o.x)/2,y:(i.y+o.y)/2};t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(s.x,s.y),t.lineTo(i.x,i.y),t.lineTo(a.x,a.y),t.fillStyle=this.backgroundColors[e],t.fill(),t.closePath()}var l=this.getPointPosition(e,this.calculateCenterOffset(this.max)+5);t.font=$(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),t.fillStyle=this.pointLabelFontColor;var c=this.labels.length,h=this.labels.length/2,u=h/2,f=ec-u,p=e===u||e===c-u;t.textAlign=0===e||e===h?"center":e1&&(e=Math.floor(this.dropFrames),this.dropFrames-=e);for(var n=0;nthis.animations[n].animationObject.numSteps&&(this.animations[n].animationObject.currentStep=this.animations[n].animationObject.numSteps),this.animations[n].animationObject.render(this.animations[n].chartInstance,this.animations[n].animationObject),this.animations[n].animationObject.currentStep==this.animations[n].animationObject.numSteps&&(this.animations[n].animationObject.onAnimationComplete.call(this.animations[n].chartInstance),this.animations.splice(n,1),n--);var i=(Date.now()-t-this.frameDuration)/this.frameDuration;i>1&&(this.dropFrames+=i),this.animations.length>0&&c.requestAnimFrame.call(window,this.digestWrapper)}},c.addEvent(window,"resize",(function(){clearTimeout(l),l=setTimeout((function(){d(s.instances,(function(t){t.options.responsive&&t.resize(t.render,!0)}))}),50)})),_?void 0===(i=function(){return s}.apply(e,[]))||(t.exports=i):t.exports&&(t.exports=s),r.Chart=s,s.noConflict=function(){return r.Chart=o,s}}).call(this),function(){"use strict";var t=this.Chart,e=t.helpers;t.Type.extend({name:"Bar",defaults:{scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,legendTemplate:'
      <% for (var i=0; i
    • <%if(datasets[i].label){%><%=datasets[i].label%><%}%>
    • <%}%>
    '},initialize:function(n){var i=this.options;this.ScaleClass=t.Scale.extend({offsetGridLines:!0,calculateBarX:function(t,e,n){var r=this.calculateBaseWidth(),o=this.calculateX(n)-r/2,s=this.calculateBarWidth(t);return o+s*e+e*i.barDatasetSpacing+s/2},calculateBaseWidth:function(){return this.calculateX(1)-this.calculateX(0)-2*i.barValueSpacing},calculateBarWidth:function(t){return(this.calculateBaseWidth()-(t-1)*i.barDatasetSpacing)/t}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,(function(t){var n="mouseout"!==t.type?this.getBarsAtEvent(t):[];this.eachBars((function(t){t.restore(["fillColor","strokeColor"])})),e.each(n,(function(t){t&&(t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke)})),this.showTooltip(n)})),this.BarClass=t.Rectangle.extend({strokeWidth:this.options.barStrokeWidth,showStroke:this.options.barShowStroke,ctx:this.chart.ctx}),e.each(n.datasets,(function(t,i){var r={label:t.label||null,fillColor:t.fillColor,strokeColor:t.strokeColor,bars:[]};this.datasets.push(r),e.each(t.data,(function(e,i){r.bars.push(new this.BarClass({value:e,label:n.labels[i],datasetLabel:t.label,strokeColor:"object"==typeof t.strokeColor?t.strokeColor[i]:t.strokeColor,fillColor:"object"==typeof t.fillColor?t.fillColor[i]:t.fillColor,highlightFill:t.highlightFill?"object"==typeof t.highlightFill?t.highlightFill[i]:t.highlightFill:"object"==typeof t.fillColor?t.fillColor[i]:t.fillColor,highlightStroke:t.highlightStroke?"object"==typeof t.highlightStroke?t.highlightStroke[i]:t.highlightStroke:"object"==typeof t.strokeColor?t.strokeColor[i]:t.strokeColor}))}),this)}),this),this.buildScale(n.labels),this.BarClass.prototype.base=this.scale.endPoint,this.eachBars((function(t,n,i){e.extend(t,{width:this.scale.calculateBarWidth(this.datasets.length),x:this.scale.calculateBarX(this.datasets.length,i,n),y:this.scale.endPoint}),t.save()}),this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,(function(t){t.restore(["fillColor","strokeColor"])})),this.eachBars((function(t){t.save()})),this.render()},eachBars:function(t){e.each(this.datasets,(function(n,i){e.each(n.bars,t,this,i)}),this)},getBarsAtEvent:function(t){for(var n,i=[],r=e.getRelativePosition(t),o=function(t){i.push(t.bars[n])},s=0;s<% for (var i=0; i
  3. <%if(segments[i].label){%><%=segments[i].label%><%}%>
  4. <%}%>'};t.Type.extend({name:"Doughnut",defaults:n,initialize:function(n){this.segments=[],this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,this.SegmentArc=t.Arc.extend({ctx:this.chart.ctx,x:this.chart.width/2,y:this.chart.height/2}),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,(function(t){var n="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,(function(t){t.restore(["fillColor"])})),e.each(n,(function(t){t.fillColor=t.highlightColor})),this.showTooltip(n)})),this.calculateTotal(n),e.each(n,(function(t,e){t.color||(t.color="hsl("+360*e/n.length+", 100%, 50%)"),this.addData(t,e,!0)}),this),this.render()},getSegmentsAtEvent:function(t){var n=[],i=e.getRelativePosition(t);return e.each(this.segments,(function(t){t.inRange(i.x,i.y)&&n.push(t)}),this),n},addData:function(e,n,i){var r=void 0!==n?n:this.segments.length;void 0===e.color&&(e.color=t.defaults.global.segmentColorDefault[r%t.defaults.global.segmentColorDefault.length],e.highlight=t.defaults.global.segmentHighlightColorDefaults[r%t.defaults.global.segmentHighlightColorDefaults.length]),this.segments.splice(r,0,new this.SegmentArc({value:e.value,outerRadius:this.options.animateScale?0:this.outerRadius,innerRadius:this.options.animateScale?0:this.outerRadius/100*this.options.percentageInnerCutout,fillColor:e.color,highlightColor:e.highlight||e.color,showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,startAngle:1.5*Math.PI,circumference:this.options.animateRotate?0:this.calculateCircumference(e.value),label:e.label})),i||(this.reflow(),this.update())},calculateCircumference:function(t){return this.total>0?2*Math.PI*(t/this.total):0},calculateTotal:function(t){this.total=0,e.each(t,(function(t){this.total+=Math.abs(t.value)}),this)},update:function(){this.calculateTotal(this.segments),e.each(this.activeElements,(function(t){t.restore(["fillColor"])})),e.each(this.segments,(function(t){t.save()})),this.render()},removeData:function(t){var n=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(n,1),this.reflow(),this.update()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,e.each(this.segments,(function(t){t.update({outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout})}),this)},draw:function(t){var n=t||1;this.clear(),e.each(this.segments,(function(t,e){t.transition({circumference:this.calculateCircumference(t.value),outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout},n),t.endAngle=t.startAngle+t.circumference,t.draw(),0===e&&(t.startAngle=1.5*Math.PI),e<% for (var i=0; i
  5. <%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  6. <%}%>',offsetGridLines:!1},initialize:function(n){this.PointClass=t.Point.extend({offsetGridLines:this.options.offsetGridLines,strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx,inRange:function(t){return Math.pow(t-this.x,2)0&&nthis.scale.endPoint?t.controlPoints.outer.y=this.scale.endPoint:t.controlPoints.outer.ythis.scale.endPoint?t.controlPoints.inner.y=this.scale.endPoint:t.controlPoints.inner.y0&&(i.lineTo(s[s.length-1].x,this.scale.endPoint),i.lineTo(s[0].x,this.scale.endPoint),i.fillStyle=t.fillColor,i.closePath(),i.fill()),e.each(s,(function(t){t.draw()}))}),this))}})}.call(this),function(){"use strict";var t=this.Chart,e=t.helpers;t.Type.extend({name:"PolarArea",defaults:{scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBeginAtZero:!0,scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,scaleShowLine:!0,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'
      <% for (var i=0; i
    • <%if(segments[i].label){%><%=segments[i].label%><%}%>
    • <%}%>
    '},initialize:function(n){this.segments=[],this.SegmentArc=t.Arc.extend({showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,ctx:this.chart.ctx,innerRadius:0,x:this.chart.width/2,y:this.chart.height/2}),this.scale=new t.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,lineArc:!0,width:this.chart.width,height:this.chart.height,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,valuesCount:n.length}),this.updateScaleRange(n),this.scale.update(),e.each(n,(function(t,e){this.addData(t,e,!0)}),this),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,(function(t){var n="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,(function(t){t.restore(["fillColor"])})),e.each(n,(function(t){t.fillColor=t.highlightColor})),this.showTooltip(n)})),this.render()},getSegmentsAtEvent:function(t){var n=[],i=e.getRelativePosition(t);return e.each(this.segments,(function(t){t.inRange(i.x,i.y)&&n.push(t)}),this),n},addData:function(t,e,n){var i=e||this.segments.length;this.segments.splice(i,0,new this.SegmentArc({fillColor:t.color,highlightColor:t.highlight||t.color,label:t.label,value:t.value,outerRadius:this.options.animateScale?0:this.scale.calculateCenterOffset(t.value),circumference:this.options.animateRotate?0:this.scale.getCircumference(),startAngle:1.5*Math.PI})),n||(this.reflow(),this.update())},removeData:function(t){var n=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(n,1),this.reflow(),this.update()},calculateTotal:function(t){this.total=0,e.each(t,(function(t){this.total+=t.value}),this),this.scale.valuesCount=this.segments.length},updateScaleRange:function(t){var n=[];e.each(t,(function(t){n.push(t.value)}));var i=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(n,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,i,{size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})},update:function(){this.calculateTotal(this.segments),e.each(this.segments,(function(t){t.save()})),this.reflow(),this.render()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.updateScaleRange(this.segments),this.scale.update(),e.extend(this.scale,{xCenter:this.chart.width/2,yCenter:this.chart.height/2}),e.each(this.segments,(function(t){t.update({outerRadius:this.scale.calculateCenterOffset(t.value)})}),this)},draw:function(t){var n=t||1;this.clear(),e.each(this.segments,(function(t,e){t.transition({circumference:this.scale.getCircumference(),outerRadius:this.scale.calculateCenterOffset(t.value)},n),t.endAngle=t.startAngle+t.circumference,0===e&&(t.startAngle=1.5*Math.PI),e<% for (var i=0; i
  7. <%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  8. <%}%>'},initialize:function(n){this.PointClass=t.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx}),this.datasets=[],this.buildScale(n),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,(function(t){var n="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints((function(t){t.restore(["fillColor","strokeColor"])})),e.each(n,(function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke})),this.showTooltip(n)})),e.each(n.datasets,(function(t){var i={label:t.label||null,fillColor:t.fillColor,strokeColor:t.strokeColor,pointColor:t.pointColor,pointStrokeColor:t.pointStrokeColor,points:[]};this.datasets.push(i),e.each(t.data,(function(e,r){var o;this.scale.animation||(o=this.scale.getPointPosition(r,this.scale.calculateCenterOffset(e))),i.points.push(new this.PointClass({value:e,label:n.labels[r],datasetLabel:t.label,x:this.options.animation?this.scale.xCenter:o.x,y:this.options.animation?this.scale.yCenter:o.y,strokeColor:t.pointStrokeColor,fillColor:t.pointColor,highlightFill:t.pointHighlightFill||t.pointColor,highlightStroke:t.pointHighlightStroke||t.pointStrokeColor}))}),this)}),this),this.render()},eachPoints:function(t){e.each(this.datasets,(function(n){e.each(n.points,t,this)}),this)},getPointsAtEvent:function(t){var n=e.getRelativePosition(t),i=e.getAngleFromPoint({x:this.scale.xCenter,y:this.scale.yCenter},n),r=2*Math.PI/this.scale.valuesCount,o=Math.round((i.angle-1.5*Math.PI)/r),s=[];return(o>=this.scale.valuesCount||o<0)&&(o=0),i.distance<=this.scale.drawingArea&&e.each(this.datasets,(function(t){s.push(t.points[o])})),s},buildScale:function(e){this.scale=new t.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backgroundColors:this.options.scaleBackgroundColors,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,angleLineInterval:this.options.angleLineInterval?this.options.angleLineInterval:1,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:e.labels,valuesCount:e.datasets[0].data.length}),this.scale.setScaleSize(),this.updateScaleRange(e.datasets),this.scale.buildYLabels()},updateScaleRange:function(t){var n,i=(n=[],e.each(t,(function(t){t.data?n=n.concat(t.data):e.each(t.points,(function(t){n.push(t.value)}))})),n),r=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,r)},addData:function(t,n){this.scale.valuesCount++,e.each(t,(function(t,e){var i=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(t));this.datasets[e].points.push(new this.PointClass({value:t,label:n,datasetLabel:this.datasets[e].label,x:i.x,y:i.y,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))}),this),this.scale.labels.push(n),this.reflow(),this.update()},removeData:function(){this.scale.valuesCount--,this.scale.labels.shift(),e.each(this.datasets,(function(t){t.points.shift()}),this),this.reflow(),this.update()},update:function(){this.eachPoints((function(t){t.save()})),this.reflow(),this.render()},reflow:function(){e.extend(this.scale,{width:this.chart.width,height:this.chart.height,size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2}),this.updateScaleRange(this.datasets),this.scale.setScaleSize(),this.scale.buildYLabels()},draw:function(t){var n=t||1,i=this.chart.ctx;this.clear(),this.scale.draw(),e.each(this.datasets,(function(t){e.each(t.points,(function(t,e){t.hasValue()&&t.transition(this.scale.getPointPosition(e,this.scale.calculateCenterOffset(t.value)),n)}),this),i.lineWidth=this.options.datasetStrokeWidth,i.strokeStyle=t.strokeColor,i.beginPath(),e.each(t.points,(function(t,e){0===e?i.moveTo(t.x,t.y):i.lineTo(t.x,t.y)}),this),i.closePath(),i.stroke(),i.fillStyle=t.fillColor,this.options.datasetFill&&i.fill(),e.each(t.points,(function(t){t.hasValue()&&t.draw()}))}),this)}})}.call(this)},7284:function(){var t,e,n;window.CKEDITOR&&window.CKEDITOR.dom||(window.CKEDITOR||(window.CKEDITOR=function(){var t=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,e={timestamp:"M19A",version:"4.17.2 (Standard)",revision:"cb93181c83",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:t},status:"unloaded",basePath:function(){var e=window.CKEDITOR_BASEPATH||"";if(!e)for(var n=document.getElementsByTagName("script"),i=0;id.getListenerIndex(i)){d=d.listeners,r||(r=this),isNaN(s)&&(s=10),a.fn=i,a.priority=s;for(var h=d.length-1;0<=h;h--)if(d[h].priority<=s)return d.splice(h+1,0,a),{removeListener:l};d.unshift(a)}return{removeListener:l}},once:function(){var t=Array.prototype.slice.call(arguments),e=t[1];return t[1]=function(t){return t.removeListener(),e.apply(this,arguments)},this.on.apply(this,t)},capture:function(){CKEDITOR.event.useCapture=1;var t=this.on.apply(this,arguments);return CKEDITOR.event.useCapture=0,t},fire:function(){var t=0,i=function(){t=1},r=0,o=function(){r=1};return function(s,a,l){var c=e(this)[s];s=t;var d=r;if(t=r=0,c&&(u=c.listeners).length)for(var h,u=u.slice(0),f=0;fdocument.documentMode),mobile:-1i||n.quirks),n.gecko&&(e=t.match(/rv:([\d\.]+)/))&&(i=1e4*(e=e[1].split("."))[0]+100*(e[1]||0)+1*(e[2]||0)),n.air&&(i=parseFloat(t.match(/ adobeair\/(\d+)/)[1])),n.webkit&&(i=parseFloat(t.match(/ applewebkit\/(\d+)/)[1])),n.version=i,n.isCompatible=!(n.ie&&7>i||n.gecko&&4e4>i||n.webkit&&534>i),n.hidpi=2<=window.devicePixelRatio,n.needsBrFiller=n.gecko||n.webkit||n.ie&&10i,n.cssClass="cke_browser_"+(n.ie?"ie":n.gecko?"gecko":n.webkit?"webkit":"unknown"),n.quirks&&(n.cssClass+=" cke_browser_quirks"),n.ie&&(n.cssClass+=" cke_browser_ie"+(n.quirks?"6 cke_browser_iequirks":n.version)),n.air&&(n.cssClass+=" cke_browser_air"),n.iOS&&(n.cssClass+=" cke_browser_ios"),n.hidpi&&(n.cssClass+=" cke_hidpi"),n}()),"unloaded"==CKEDITOR.status&&(CKEDITOR.event.implementOn(CKEDITOR),CKEDITOR.loadFullCore=function(){if("basic_ready"!=CKEDITOR.status)CKEDITOR.loadFullCore._load=1;else{delete CKEDITOR.loadFullCore;var t=document.createElement("script");t.type="text/javascript",t.src=CKEDITOR.basePath+"ckeditor.js",document.getElementsByTagName("head")[0].appendChild(t)}},CKEDITOR.loadFullCoreTimeout=0,CKEDITOR.add=function(t){(this._.pending||(this._.pending=[])).push(t)},CKEDITOR.domReady((function(){var t=CKEDITOR.loadFullCore,e=CKEDITOR.loadFullCoreTimeout;t&&(CKEDITOR.status="basic_ready",t&&t._load?t():e&&setTimeout((function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()}),1e3*e))})),CKEDITOR.status="basic_loaded"),CKEDITOR.VERBOSITY_WARN=1,CKEDITOR.VERBOSITY_ERROR=2,CKEDITOR.verbosity=CKEDITOR.VERBOSITY_WARN|CKEDITOR.VERBOSITY_ERROR,CKEDITOR.warn=function(t,e){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_WARN&&CKEDITOR.fire("log",{type:"warn",errorCode:t,additionalData:e})},CKEDITOR.error=function(t,e){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_ERROR&&CKEDITOR.fire("log",{type:"error",errorCode:t,additionalData:e})},CKEDITOR.on("log",(function(t){if(window.console&&window.console.log){var e=console[t.data.type]?t.data.type:"log",n=t.data.errorCode;(t=t.data.additionalData)?console[e]("[CKEDITOR] Error code: "+n+".",t):console[e]("[CKEDITOR] Error code: "+n+"."),console[e]("[CKEDITOR] For more information about this error go to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#"+n)}}),null,null,999),CKEDITOR.dom={},function(){function t(t,e,n){this._minInterval=t,this._context=n,this._lastOutput=this._scheduledTimer=0,this._output=CKEDITOR.tools.bind(e,n||{});var i=this;this.input=function(){function t(){i._lastOutput=(new Date).getTime(),i._scheduledTimer=0,i._call()}if(!i._scheduledTimer||!1!==i._reschedule()){var e=(new Date).getTime()-i._lastOutput;e/g,s=/",amp:"&",quot:'"',nbsp:" ",shy:"­"},d=function(t,e){return"#"==e[0]?String.fromCharCode(parseInt(e.slice(1),10)):c[e]};CKEDITOR.on("reset",(function(){n=[]})),CKEDITOR.tools={arrayCompare:function(t,e){if(!t&&!e)return!0;if(!t||!e||t.length!=e.length)return!1;for(var n=0;n"+e+""):(e=CKEDITOR.appendTimestamp(e),n.push('')));return n.join("")},htmlEncode:function(t){return null==t?"":String(t).replace(r,"&").replace(o,">").replace(s,"<")},htmlDecode:function(t){return t.replace(l,d)},htmlEncodeAttr:function(t){return CKEDITOR.tools.htmlEncode(t).replace(a,""")},htmlDecodeAttr:function(t){return CKEDITOR.tools.htmlDecode(t)},transformPlainTextToHtml:function(t,e){var n=e==CKEDITOR.ENTER_BR,i=(i=this.htmlEncode(t.replace(/\r\n/g,"\n"))).replace(/\t/g,"    "),r=e==CKEDITOR.ENTER_P?"p":"div";if(!n){var o=/\n{2}/g;if(o.test(i)){var s="<"+r+">",a="";i=s+i.replace(o,(function(){return a+s}))+a}}return i=i.replace(/\n/g,"
    "),n||(i=i.replace(new RegExp("
    (?=)"),(function(t){return CKEDITOR.tools.repeat(t,2)}))),(i=i.replace(/^ | $/g," ")).replace(/(>|\s) /g,(function(t,e){return e+" "})).replace(/ (?=<)/g," ")},getNextNumber:function(){var t=0;return function(){return++t}}(),getNextId:function(){return"cke_"+this.getNextNumber()},getUniqueId:function(){for(var t="e",e=0;8>e;e++)t+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return t},override:function(t,e){var n=e(t);return n.prototype=t.prototype,n},setTimeout:function(t,e,n,i,r){return r||(r=window),n||(n=r),r.setTimeout((function(){i?t.apply(n,[].concat(i)):t.apply(n)}),e||0)},throttle:function(t,e,n){return new this.buffers.throttle(t,e,n)},trim:function(){var t=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(e){return e.replace(t,"")}}(),ltrim:function(){var t=/^[ \t\n\r]+/g;return function(e){return e.replace(t,"")}}(),rtrim:function(){var t=/[ \t\n\r]+$/g;return function(e){return e.replace(t,"")}}(),indexOf:function(t,e){if("function"==typeof e){for(var n=0,i=t.length;n',CKEDITOR.document),CKEDITOR.document.getBody().append(t)),!/%$/.test(e)){var n=0>parseFloat(e);return n&&(e=e.replace("-","")),t.setStyle("width",e),e=t.$.clientWidth,n?-e:e}return e}}(),repeat:function(t,e){return Array(e+1).join(t)},tryThese:function(){for(var t,e=0,n=arguments.length;ee;e++)t[e]=("0"+parseInt(t[e],10).toString(16)).slice(-2);return"#"+t.join("")}))},normalizeHex:function(t){return t.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi,(function(t,e,n,i){return 3==(t=e.toLowerCase()).length&&(t=[(t=t.split(""))[0],t[0],t[1],t[1],t[2],t[2]].join("")),"#"+t+i}))},_isValidColorFormat:function(t){return!!t&&(t=t.replace(/\s+/g,""),/^[a-z0-9()#%,./]+$/i.test(t))},parseCssText:function(t,e,n){var i={};return n&&(t=new CKEDITOR.dom.element("span").setAttribute("style",t).getAttribute("style")||""),t&&(t=CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(t))),t&&";"!=t?(t.replace(/"/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,(function(t,n,r){e&&("font-family"==(n=n.toLowerCase())&&(r=r.replace(/\s*,\s*/g,",")),r=CKEDITOR.tools.trim(r)),i[n]=r})),i):i},writeCssText:function(t,e){var n,i=[];for(n in t)i.push(n+":"+t[n]);return e&&i.sort(),i.join("; ")},objectCompare:function(t,e,n){var i;if(!t&&!e)return!0;if(!t||!e)return!1;for(i in t)if(t[i]!=e[i])return!1;if(!n)for(i in e)if(t[i]!=e[i])return!1;return!0},objectKeys:function(t){return CKEDITOR.tools.object.keys(t)},convertArrayToObject:function(t,e){var n={};1==arguments.length&&(e=!0);for(var i=0,r=t.length;in;n++)t.push(Math.floor(256*Math.random()));for(n=0;n=e||0==i&&48<=e&&57>=e||1==i&&48<=e&&57>=e&&45==o?r+"\\"+e.toString(16)+" ":0==i&&1==n&&45==e?r+"\\"+t.charAt(i):128<=e||45==e||95==e||48<=e&&57>=e||65<=e&&90>=e||97<=e&&122>=e?r+t.charAt(i):r+"\\"+t.charAt(i);t=r}else t="";return t},getMouseButton:function(t){return!!(t=t&&t.data?t.data.$:t)&&CKEDITOR.tools.normalizeMouseButton(t.button)},normalizeMouseButton:function(t,e){if(!CKEDITOR.env.ie||9<=CKEDITOR.env.version&&!CKEDITOR.env.ie6Compat)return t;for(var n=[[CKEDITOR.MOUSE_BUTTON_LEFT,1],[CKEDITOR.MOUSE_BUTTON_MIDDLE,4],[CKEDITOR.MOUSE_BUTTON_RIGHT,2]],i=0;is)for(r=s;3>r;r++)o[r]=0;for(a[0]=(252&o[0])>>2,a[1]=(3&o[0])<<4|o[1]>>4,a[2]=(15&o[1])<<2|(192&o[2])>>6,a[3]=63&o[2],r=0;4>r;r++)n=r<=s?n+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a[r]):n+"="}return n},style:{parse:{_borderStyle:"none hidden dotted dashed solid double groove ridge inset outset".split(" "),_widthRegExp:/^(thin|medium|thick|[\+-]?\d+(\.\d+)?[a-z%]+|[\+-]?0+(\.0+)?|\.\d+[a-z%]+)$/,_rgbaRegExp:/rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi,_hslaRegExp:/hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,background:function(t){var e={},n=this._findColor(t);return n.length&&(e.color=n[0],CKEDITOR.tools.array.forEach(n,(function(e){t=t.replace(e,"")}))),(t=CKEDITOR.tools.trim(t))&&(e.unprocessed=t),e},margin:function(t){return CKEDITOR.tools.style.parse.sideShorthand(t,(function(t){return t.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset|revert)/g)||["0px"]}))},sideShorthand:function(t,e){function n(t){i.top=r[t[0]],i.right=r[t[1]],i.bottom=r[t[2]],i.left=r[t[3]]}var i={},r=e?e(t):t.split(/\s+/);switch(r.length){case 1:n([0,0,0,0]);break;case 2:n([0,1,0,1]);break;case 3:n([0,1,2,1]);break;case 4:n([0,1,2,3])}return i},border:function(t){return CKEDITOR.tools.style.border.fromCssRule(t)},_findColor:function(t){var e=[],n=CKEDITOR.tools.array;return(e=(e=e.concat(t.match(this._rgbaRegExp)||[])).concat(t.match(this._hslaRegExp)||[])).concat(n.filter(t.split(/\s+/),(function(t){return!!t.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi)||t.toLowerCase()in CKEDITOR.tools.style.parse._colors})))}}},array:{filter:function(t,e,n){var i=[];return this.forEach(t,(function(r,o){e.call(n,r,o,t)&&i.push(r)})),i},find:function(t,e,n){for(var i=t.length,r=0;rCKEDITOR.env.version&&(!t||"object"!=typeof t)){if(e=[],"string"==typeof t)for(n=0;nCKEDITOR.env.version)for(r=0;rCKEDITOR.env.version&&(this.type==CKEDITOR.NODE_ELEMENT||this.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)&&function e(n){if(n.type==CKEDITOR.NODE_ELEMENT||n.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT){if(n.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var i=n.getName();":"==i[0]&&n.renameNode(i.substring(1))}if(t)for(i=0;ie.sourceIndex||0>n.sourceIndex?CKEDITOR.POSITION_DISCONNECTED:e.sourceIndex=document.documentMode||!e||(t=e+":"+t),new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(t))},getHead:function(){var t=this.$.getElementsByTagName("head")[0];return t?new CKEDITOR.dom.element(t):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),!0)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)},getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||this.$.defaultView)},write:function(t){this.$.open("text/html","replace"),CKEDITOR.env.ie&&(t=t.replace(/(?:^\s*]*?>)|^/i,'$&\n