From f28731614ea27bb6fbb01f959c46d5015cd61bb4 Mon Sep 17 00:00:00 2001 From: Artur Kyryliuk Date: Mon, 21 Sep 2026 13:11:13 +0200 Subject: [PATCH 1/4] fix(deps): resync core/vendor with composer.lock The committed vendor tree had drifted ahead of core/composer.lock (laravel/framework v12.69.2 vs the locked v12.67.0, plus ~50 transitive packages). Rebuilt from `composer install` on PHP 8.3 so vendor matches the lock again. Co-Authored-By: Claude Opus 5 --- .../carbonphp/carbon-doctrine-types/README.md | 2 +- .../carbon-doctrine-types/composer.json | 7 +- .../Carbon/Doctrine/CarbonDoctrineType.php | 7 +- .../Carbon/Doctrine/CarbonTypeConverter.php | 6 +- core/vendor/composer/LICENSE | 2 - core/vendor/composer/autoload_classmap.php | 6 +- core/vendor/composer/autoload_real.php | 1 + core/vendor/composer/autoload_static.php | 6 +- core/vendor/composer/ca-bundle/res/cacert.pem | 148 ++--- core/vendor/composer/installed.json | 585 +++++++++--------- core/vendor/composer/installed.php | 294 ++++----- .../graham-campbell/result-type/LICENSE | 2 +- .../graham-campbell/result-type/composer.json | 4 +- .../graham-campbell/result-type/src/Error.php | 20 +- .../result-type/src/Result.php | 6 +- .../result-type/src/Success.php | 17 +- core/vendor/guzzlehttp/guzzle/CHANGELOG.md | 17 - core/vendor/guzzlehttp/guzzle/README.md | 2 +- core/vendor/guzzlehttp/guzzle/composer.json | 4 +- .../guzzlehttp/guzzle/src/HandlerStack.php | 2 +- core/vendor/guzzlehttp/promises/CHANGELOG.md | 7 - core/vendor/guzzlehttp/promises/README.md | 2 +- core/vendor/guzzlehttp/psr7/CHANGELOG.md | 10 - core/vendor/guzzlehttp/psr7/README.md | 15 +- .../guzzlehttp/psr7/src/UriNormalizer.php | 25 +- .../guzzlehttp/psr7/src/UriResolver.php | 30 - .../guzzlehttp/uri-template/CHANGELOG.md | 6 - .../console/Concerns/InteractsWithIO.php | 2 +- .../vendor/illuminate/database/Connection.php | 2 +- .../Concerns/ResolvesJsonApiElements.php | 77 +-- .../justinrainbow/json-schema/CHANGELOG.md | 32 - .../justinrainbow/json-schema/README.md | 6 +- .../json-schema/bin/validate-json | 47 +- .../justinrainbow/json-schema/composer.json | 18 +- .../AdditionalPropertiesConstraint.php | 13 +- .../Drafts/Draft06/FormatConstraint.php | 6 +- .../Drafts/Draft06/MaxLengthConstraint.php | 2 +- .../Drafts/Draft06/MinLengthConstraint.php | 2 +- .../Draft06/PropertiesNamesConstraint.php | 2 +- .../Drafts/Draft06/RequiredConstraint.php | 20 +- .../AdditionalPropertiesConstraint.php | 13 +- .../Drafts/Draft07/FormatConstraint.php | 7 +- .../Drafts/Draft07/MaxLengthConstraint.php | 2 +- .../Drafts/Draft07/MinLengthConstraint.php | 2 +- .../Draft07/PropertiesNamesConstraint.php | 2 +- .../Drafts/Draft07/RequiredConstraint.php | 20 +- .../AdditionalPropertiesConstraint.php | 13 +- .../Drafts/Draft2019/FormatConstraint.php | 7 +- .../Drafts/Draft2019/MaxLengthConstraint.php | 2 +- .../Drafts/Draft2019/MinLengthConstraint.php | 2 +- .../Draft2019/PropertiesNamesConstraint.php | 2 +- .../Drafts/Draft2019/RequiredConstraint.php | 20 +- .../Constraints/FormatConstraint.php | 6 +- .../Constraints/StringConstraint.php | 2 +- .../src/JsonSchema/Entity/JsonPointer.php | 19 - .../json-schema/src/JsonSchema/Rfc3339.php | 2 +- .../src/JsonSchema/Uri/Retrievers/Curl.php | 2 +- .../Uri/Retrievers/FileGetContents.php | 2 +- .../Default/Concerns/InteractsWithStrings.php | 6 +- .../src/Serializers/Signed.php | 9 +- .../LocalFilesystemAdapter.php | 3 +- .../src/WhitespacePathNormalizer.php | 3 +- core/vendor/monolog/monolog/CHANGELOG.md | 29 - core/vendor/monolog/monolog/composer.json | 4 +- .../Monolog/Attribute/WithMonologChannel.php | 5 +- .../monolog/src/Monolog/ErrorHandler.php | 70 +-- .../Formatter/GelfMessageFormatter.php | 6 +- .../src/Monolog/Formatter/JsonFormatter.php | 10 +- .../Monolog/Formatter/NormalizerFormatter.php | 57 +- .../Monolog/Formatter/RedactingFormatter.php | 373 ----------- .../Formatter/WrappingFormatterInterface.php | 28 - .../Handler/AbstractProcessingHandler.php | 2 +- .../Monolog/Handler/BrowserConsoleHandler.php | 10 +- .../Monolog/Handler/DeduplicationHandler.php | 12 +- .../src/Monolog/Handler/ElasticaHandler.php | 3 +- .../Monolog/Handler/ElasticsearchHandler.php | 3 +- .../src/Monolog/Handler/ErrorLogHandler.php | 1 + .../src/Monolog/Handler/FlowdockHandler.php | 2 +- .../src/Monolog/Handler/FrankenPhpHandler.php | 100 --- .../src/Monolog/Handler/LogMonsterHandler.php | 192 ------ .../Monolog/Handler/RotatingFileHandler.php | 167 +---- .../src/Monolog/Handler/StreamHandler.php | 39 +- .../Monolog/Handler/SyslogUdp/UdpSocket.php | 14 +- .../src/Monolog/Handler/SyslogUdpHandler.php | 13 +- .../Monolog/Handler/TelegramBotHandler.php | 182 +----- .../monolog/monolog/src/Monolog/Logger.php | 74 +-- .../Processor/IntrospectionProcessor.php | 4 +- .../monolog/monolog/src/Monolog/Utils.php | 72 +-- core/vendor/phpoption/phpoption/composer.json | 2 +- .../phpoption/src/PhpOption/LazyOption.php | 4 +- .../phpoption/src/PhpOption/None.php | 34 +- .../phpoption/src/PhpOption/Option.php | 73 +-- .../phpoption/src/PhpOption/Some.php | 30 +- core/vendor/symfony/console/Application.php | 6 +- core/vendor/symfony/console/Attribute/Ask.php | 11 +- core/vendor/symfony/console/Color.php | 4 +- .../symfony/console/Debug/CliRequest.php | 8 +- .../console/Descriptor/MarkdownDescriptor.php | 2 +- .../console/Formatter/OutputFormatter.php | 2 +- .../symfony/console/Helper/ProcessHelper.php | 6 +- .../symfony/console/Helper/QuestionHelper.php | 12 - .../symfony/console/Input/ArgvInput.php | 6 +- core/vendor/symfony/console/Input/Input.php | 2 +- .../symfony/console/Input/InputDefinition.php | 2 +- .../Messenger/RunCommandMessageHandler.php | 3 - .../symfony/console/Output/ConsoleOutput.php | 4 +- .../console/Output/ConsoleSectionOutput.php | 5 +- .../error-handler/DebugClassLoader.php | 5 - .../symfony/error-handler/ErrorHandler.php | 5 - .../Debug/TraceableEventDispatcher.php | 14 +- .../event-dispatcher/EventDispatcher.php | 28 +- core/vendor/symfony/filesystem/Filesystem.php | 16 +- core/vendor/symfony/filesystem/Path.php | 14 +- .../Iterator/FileTypeFilterIterator.php | 2 +- .../Iterator/VcsIgnoredFilterIterator.php | 74 +-- .../http-foundation/AcceptHeaderItem.php | 2 +- .../http-foundation/BinaryFileResponse.php | 15 +- .../symfony/http-foundation/HeaderBag.php | 4 +- .../symfony/http-foundation/IpUtils.php | 48 +- .../AbstractRequestRateLimiter.php | 2 +- .../symfony/http-foundation/Request.php | 18 +- .../QueryParameterRequestMatcher.php | 2 +- .../symfony/http-foundation/Response.php | 4 +- .../Handler/AbstractSessionHandler.php | 8 - .../Handler/MarshallingSessionHandler.php | 17 +- .../Handler/MigratingSessionHandler.php | 8 - .../Storage/MockFileSessionStorage.php | 11 - .../Storage/Proxy/SessionHandlerProxy.php | 8 - .../CacheWarmer/CacheWarmerAggregate.php | 21 +- .../Controller/ControllerResolver.php | 2 +- .../DataCollector/DumpDataCollector.php | 52 +- .../EventListener/AbstractSessionListener.php | 9 +- .../EventListener/LocaleAwareListener.php | 29 +- .../Fragment/HIncludeFragmentRenderer.php | 2 +- .../Fragment/InlineFragmentRenderer.php | 14 +- .../http-kernel/HttpCache/HttpCache.php | 8 +- .../symfony/http-kernel/HttpCache/Store.php | 16 +- .../symfony/http-kernel/HttpKernelBrowser.php | 46 +- core/vendor/symfony/http-kernel/Kernel.php | 8 +- .../Profiler/FileProfilerStorage.php | 21 +- .../symfony/http-kernel/Profiler/Profiler.php | 2 +- core/vendor/symfony/mime/Address.php | 17 +- core/vendor/symfony/mime/Header/Headers.php | 2 +- core/vendor/symfony/mime/RawMessage.php | 2 +- core/vendor/symfony/mime/composer.json | 2 +- core/vendor/symfony/polyfill-intl-idn/Idn.php | 51 -- .../polyfill-intl-normalizer/Normalizer.php | 3 +- .../symfony/process/Pipes/AbstractPipes.php | 16 +- core/vendor/symfony/process/Process.php | 3 + .../RoutingResolverPass.php | 2 +- .../routing/Generator/UrlGenerator.php | 2 - .../routing/Loader/AttributeFileLoader.php | 2 +- core/vendor/symfony/routing/RouteCompiler.php | 2 +- .../service-contracts/Attribute/Required.php | 7 - .../translation/Command/XliffLintCommand.php | 2 +- .../translation/Dumper/PoFileDumper.php | 2 +- .../Visitor/TranslatableMessageVisitor.php | 5 +- .../translation/Loader/CsvFileLoader.php | 24 +- .../Resources/bin/translation-status.php | 6 +- .../symfony/translation/Util/XliffUtils.php | 15 +- .../symfony/var-dumper/Caster/DateCaster.php | 15 +- .../symfony/var-dumper/Caster/SplCaster.php | 32 +- .../Command/Descriptor/CliDescriptor.php | 18 +- .../Command/Descriptor/HtmlDescriptor.php | 19 +- .../symfony/var-dumper/Dumper/CliDumper.php | 23 +- core/vendor/vlucas/phpdotenv/composer.json | 6 +- .../vlucas/phpdotenv/src/Loader/Loader.php | 25 +- .../vlucas/phpdotenv/src/Loader/Resolver.php | 20 +- .../phpdotenv/src/Parser/EntryParser.php | 178 ++---- .../vlucas/phpdotenv/src/Parser/Lexer.php | 2 +- .../vlucas/phpdotenv/src/Parser/Lines.php | 17 +- .../vlucas/phpdotenv/src/Parser/Parser.php | 25 +- .../vlucas/phpdotenv/src/Parser/Value.php | 13 - .../src/Repository/Adapter/ApacheAdapter.php | 3 +- .../src/Repository/Adapter/ArrayAdapter.php | 3 +- .../Repository/Adapter/EnvConstAdapter.php | 28 +- .../src/Repository/Adapter/PutenvAdapter.php | 15 +- .../Repository/Adapter/ServerConstAdapter.php | 28 +- .../src/Repository/RepositoryBuilder.php | 10 +- .../vlucas/phpdotenv/src/Store/FileStore.php | 2 +- .../phpdotenv/src/Store/StringStore.php | 4 - .../vlucas/phpdotenv/src/Util/Regex.php | 33 +- core/vendor/vlucas/phpdotenv/src/Util/Str.php | 35 +- .../vendor/vlucas/phpdotenv/src/Validator.php | 9 - 184 files changed, 1210 insertions(+), 3349 deletions(-) delete mode 100644 core/vendor/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php delete mode 100644 core/vendor/monolog/monolog/src/Monolog/Formatter/WrappingFormatterInterface.php delete mode 100644 core/vendor/monolog/monolog/src/Monolog/Handler/FrankenPhpHandler.php delete mode 100644 core/vendor/monolog/monolog/src/Monolog/Handler/LogMonsterHandler.php diff --git a/core/vendor/carbonphp/carbon-doctrine-types/README.md b/core/vendor/carbonphp/carbon-doctrine-types/README.md index baaf5fea24..5a18121b6c 100644 --- a/core/vendor/carbonphp/carbon-doctrine-types/README.md +++ b/core/vendor/carbonphp/carbon-doctrine-types/README.md @@ -4,7 +4,7 @@ Types to use Carbon in Doctrine ## Documentation -[Check how to use in the official Carbon documentation](https://carbon.nesbot.com/guide/getting-started/symfony.html) +[Check how to use in the official Carbon documentation](https://carbon.nesbot.com/symfony/) This package is an externalization of [src/Carbon/Doctrine](https://github.com/briannesbitt/Carbon/tree/2.71.0/src/Carbon/Doctrine) from `nestbot/carbon` package. diff --git a/core/vendor/carbonphp/carbon-doctrine-types/composer.json b/core/vendor/carbonphp/carbon-doctrine-types/composer.json index dbc90ec1e3..abf45c5fb5 100644 --- a/core/vendor/carbonphp/carbon-doctrine-types/composer.json +++ b/core/vendor/carbonphp/carbon-doctrine-types/composer.json @@ -32,10 +32,5 @@ "email": "kylekatarnls@gmail.com" } ], - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - } + "minimum-stability": "dev" } diff --git a/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php b/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php index 8cb82202af..a63a9b8d27 100644 --- a/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php +++ b/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php @@ -4,14 +4,13 @@ namespace Carbon\Doctrine; -use Carbon\CarbonInterface; use Doctrine\DBAL\Platforms\AbstractPlatform; interface CarbonDoctrineType { - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string; + public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform); - public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?CarbonInterface; + public function convertToPHPValue(mixed $value, AbstractPlatform $platform); - public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?string; + public function convertToDatabaseValue($value, AbstractPlatform $platform); } diff --git a/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonTypeConverter.php b/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonTypeConverter.php index d2e3786c4a..a813311777 100644 --- a/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonTypeConverter.php +++ b/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonTypeConverter.php @@ -62,7 +62,7 @@ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $pla /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?string + public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string { if ($value === null) { return $value; @@ -79,11 +79,11 @@ public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform) ); } - private function doConvertToPHPValue(mixed $value): ?CarbonInterface + private function doConvertToPHPValue(mixed $value) { $class = $this->getCarbonClassName(); - if ($value === null || (is_object($value) && is_a($value, $class))) { + if ($value === null || is_a($value, $class)) { return $value; } diff --git a/core/vendor/composer/LICENSE b/core/vendor/composer/LICENSE index f27399a042..62ecfd8d00 100644 --- a/core/vendor/composer/LICENSE +++ b/core/vendor/composer/LICENSE @@ -1,4 +1,3 @@ - Copyright (c) Nils Adermann, Jordi Boggiano Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/core/vendor/composer/autoload_classmap.php b/core/vendor/composer/autoload_classmap.php index 912fecb677..b6841170d0 100644 --- a/core/vendor/composer/autoload_classmap.php +++ b/core/vendor/composer/autoload_classmap.php @@ -1383,6 +1383,7 @@ 'EvolutionCMS\\Services\\SystemTasks\\ConsoleUninstall\\ConsoleUninstallPlan' => $baseDir . '/src/Services/SystemTasks/ConsoleUninstall/ConsoleUninstallPlan.php', 'EvolutionCMS\\Services\\SystemTasks\\ConsoleUninstall\\ConsoleUninstallRegistry' => $baseDir . '/src/Services/SystemTasks/ConsoleUninstall/ConsoleUninstallRegistry.php', 'EvolutionCMS\\Services\\SystemTasks\\ConsoleUninstall\\ConsoleUninstallResult' => $baseDir . '/src/Services/SystemTasks/ConsoleUninstall/ConsoleUninstallResult.php', + 'EvolutionCMS\\Services\\SystemTasks\\ReportsProcessFailure' => $baseDir . '/src/Services/SystemTasks/ReportsProcessFailure.php', 'EvolutionCMS\\Services\\SystemTasks\\SchedulerHealthService' => $baseDir . '/src/Services/SystemTasks/SchedulerHealthService.php', 'EvolutionCMS\\Services\\SystemTasks\\SiteUpdateFlowService' => $baseDir . '/src/Services/SystemTasks/SiteUpdateFlowService.php', 'EvolutionCMS\\Services\\SystemTasks\\SystemTaskRegistry' => $baseDir . '/src/Services/SystemTasks/SystemTaskRegistry.php', @@ -1402,6 +1403,7 @@ 'EvolutionCMS\\Support\\Formatter\\CSSMinify' => $baseDir . '/src/Support/Formatter/CSSMinify.php', 'EvolutionCMS\\Support\\Formatter\\HtmlFormatter' => $baseDir . '/src/Support/Formatter/HtmlFormatter.php', 'EvolutionCMS\\Support\\Formatter\\SqlFormatter' => $baseDir . '/src/Support/Formatter/SqlFormatter.php', + 'EvolutionCMS\\Support\\InstallerCompletion' => $baseDir . '/src/Support/InstallerCompletion.php', 'EvolutionCMS\\Support\\MailTestMailer' => $baseDir . '/src/Support/MailTestMailer.php', 'EvolutionCMS\\Support\\MailTestSmtp' => $baseDir . '/src/Support/MailTestSmtp.php', 'EvolutionCMS\\Support\\MakeTable' => $baseDir . '/src/Support/MakeTable.php', @@ -3003,11 +3005,9 @@ 'Monolog\\Formatter\\LogstashFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php', 'Monolog\\Formatter\\MongoDBFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php', 'Monolog\\Formatter\\NormalizerFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php', - 'Monolog\\Formatter\\RedactingFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php', 'Monolog\\Formatter\\ScalarFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php', 'Monolog\\Formatter\\SyslogFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php', 'Monolog\\Formatter\\WildfireFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php', - 'Monolog\\Formatter\\WrappingFormatterInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/WrappingFormatterInterface.php', 'Monolog\\Handler\\AbstractHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php', 'Monolog\\Handler\\AbstractProcessingHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php', 'Monolog\\Handler\\AbstractSyslogHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php', @@ -3035,7 +3035,6 @@ 'Monolog\\Handler\\FlowdockHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php', 'Monolog\\Handler\\FormattableHandlerInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php', 'Monolog\\Handler\\FormattableHandlerTrait' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php', - 'Monolog\\Handler\\FrankenPhpHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FrankenPhpHandler.php', 'Monolog\\Handler\\GelfHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/GelfHandler.php', 'Monolog\\Handler\\GroupHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/GroupHandler.php', 'Monolog\\Handler\\Handler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/Handler.php', @@ -3044,7 +3043,6 @@ 'Monolog\\Handler\\IFTTTHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php', 'Monolog\\Handler\\InsightOpsHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php', 'Monolog\\Handler\\LogEntriesHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php', - 'Monolog\\Handler\\LogMonsterHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/LogMonsterHandler.php', 'Monolog\\Handler\\LogglyHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/LogglyHandler.php', 'Monolog\\Handler\\LogmaticHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php', 'Monolog\\Handler\\MailHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/MailHandler.php', diff --git a/core/vendor/composer/autoload_real.php b/core/vendor/composer/autoload_real.php index 7cc20073ce..412b99c680 100644 --- a/core/vendor/composer/autoload_real.php +++ b/core/vendor/composer/autoload_real.php @@ -31,6 +31,7 @@ public static function getLoader() require __DIR__ . '/autoload_static.php'; call_user_func(\Composer\Autoload\ComposerStaticInit925fea465a58fa69f06ccf2629003e87::getInitializer($loader)); + $loader->setClassMapAuthoritative(true); $loader->register(true); $filesToLoad = \Composer\Autoload\ComposerStaticInit925fea465a58fa69f06ccf2629003e87::$files; diff --git a/core/vendor/composer/autoload_static.php b/core/vendor/composer/autoload_static.php index 3c656c57cc..ca33349176 100644 --- a/core/vendor/composer/autoload_static.php +++ b/core/vendor/composer/autoload_static.php @@ -2060,6 +2060,7 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'EvolutionCMS\\Services\\SystemTasks\\ConsoleUninstall\\ConsoleUninstallPlan' => __DIR__ . '/../..' . '/src/Services/SystemTasks/ConsoleUninstall/ConsoleUninstallPlan.php', 'EvolutionCMS\\Services\\SystemTasks\\ConsoleUninstall\\ConsoleUninstallRegistry' => __DIR__ . '/../..' . '/src/Services/SystemTasks/ConsoleUninstall/ConsoleUninstallRegistry.php', 'EvolutionCMS\\Services\\SystemTasks\\ConsoleUninstall\\ConsoleUninstallResult' => __DIR__ . '/../..' . '/src/Services/SystemTasks/ConsoleUninstall/ConsoleUninstallResult.php', + 'EvolutionCMS\\Services\\SystemTasks\\ReportsProcessFailure' => __DIR__ . '/../..' . '/src/Services/SystemTasks/ReportsProcessFailure.php', 'EvolutionCMS\\Services\\SystemTasks\\SchedulerHealthService' => __DIR__ . '/../..' . '/src/Services/SystemTasks/SchedulerHealthService.php', 'EvolutionCMS\\Services\\SystemTasks\\SiteUpdateFlowService' => __DIR__ . '/../..' . '/src/Services/SystemTasks/SiteUpdateFlowService.php', 'EvolutionCMS\\Services\\SystemTasks\\SystemTaskRegistry' => __DIR__ . '/../..' . '/src/Services/SystemTasks/SystemTaskRegistry.php', @@ -2079,6 +2080,7 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'EvolutionCMS\\Support\\Formatter\\CSSMinify' => __DIR__ . '/../..' . '/src/Support/Formatter/CSSMinify.php', 'EvolutionCMS\\Support\\Formatter\\HtmlFormatter' => __DIR__ . '/../..' . '/src/Support/Formatter/HtmlFormatter.php', 'EvolutionCMS\\Support\\Formatter\\SqlFormatter' => __DIR__ . '/../..' . '/src/Support/Formatter/SqlFormatter.php', + 'EvolutionCMS\\Support\\InstallerCompletion' => __DIR__ . '/../..' . '/src/Support/InstallerCompletion.php', 'EvolutionCMS\\Support\\MailTestMailer' => __DIR__ . '/../..' . '/src/Support/MailTestMailer.php', 'EvolutionCMS\\Support\\MailTestSmtp' => __DIR__ . '/../..' . '/src/Support/MailTestSmtp.php', 'EvolutionCMS\\Support\\MakeTable' => __DIR__ . '/../..' . '/src/Support/MakeTable.php', @@ -3680,11 +3682,9 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Monolog\\Formatter\\LogstashFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php', 'Monolog\\Formatter\\MongoDBFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php', 'Monolog\\Formatter\\NormalizerFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php', - 'Monolog\\Formatter\\RedactingFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php', 'Monolog\\Formatter\\ScalarFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php', 'Monolog\\Formatter\\SyslogFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php', 'Monolog\\Formatter\\WildfireFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php', - 'Monolog\\Formatter\\WrappingFormatterInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/WrappingFormatterInterface.php', 'Monolog\\Handler\\AbstractHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php', 'Monolog\\Handler\\AbstractProcessingHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php', 'Monolog\\Handler\\AbstractSyslogHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php', @@ -3712,7 +3712,6 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Monolog\\Handler\\FlowdockHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php', 'Monolog\\Handler\\FormattableHandlerInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php', 'Monolog\\Handler\\FormattableHandlerTrait' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php', - 'Monolog\\Handler\\FrankenPhpHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FrankenPhpHandler.php', 'Monolog\\Handler\\GelfHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/GelfHandler.php', 'Monolog\\Handler\\GroupHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/GroupHandler.php', 'Monolog\\Handler\\Handler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/Handler.php', @@ -3721,7 +3720,6 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Monolog\\Handler\\IFTTTHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php', 'Monolog\\Handler\\InsightOpsHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php', 'Monolog\\Handler\\LogEntriesHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php', - 'Monolog\\Handler\\LogMonsterHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/LogMonsterHandler.php', 'Monolog\\Handler\\LogglyHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/LogglyHandler.php', 'Monolog\\Handler\\LogmaticHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php', 'Monolog\\Handler\\MailHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/MailHandler.php', diff --git a/core/vendor/composer/ca-bundle/res/cacert.pem b/core/vendor/composer/ca-bundle/res/cacert.pem index d228daeed0..26ec7f7baa 100644 --- a/core/vendor/composer/ca-bundle/res/cacert.pem +++ b/core/vendor/composer/ca-bundle/res/cacert.pem @@ -1,7 +1,7 @@ ## ## Bundle of CA Root Certificates ## -## Certificate data from Mozilla as of: Thu Aug 13 03:12:01 2026 GMT +## Certificate data from Mozilla as of: Thu Jul 16 03:12:01 2026 GMT ## ## Find updated versions here: https://curl.se/docs/caextract.html ## @@ -16,7 +16,7 @@ ## Configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version 1.33. -## SHA256: 81b7f2576333a2e360e673f912d7b0b7a765d836c731003e348a46cac5d37198 +## SHA256: e57912808daef7b2b0fa4df2ccf17e47aeaf26c839a38f85c76003ebafd866bd ## @@ -37,6 +37,37 @@ FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= -----END CERTIFICATE----- +ePKI Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG +EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg +Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx +MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq +MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs +IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi +lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv +qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX +12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O +WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+ +ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao +lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/ +vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi +Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi +MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH +ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0 +1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq +KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV +xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP +NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r +GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE +xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx +gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy +sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD +BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= +-----END CERTIFICATE----- + NetLock Arany (Class Gold) Főtanúsítvány ======================================== -----BEGIN CERTIFICATE----- @@ -554,6 +585,27 @@ vNoBYimipidx5joifsFvHZVwIEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR 9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg== -----END CERTIFICATE----- +Atos TrustedRoot 2011 +===================== +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UEAwwVQXRvcyBU +cnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQGEwJERTAeFw0xMTA3MDcxNDU4 +MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMMFUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsG +A1UECgwEQXRvczELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCV +hTuXbyo7LjvPpvMpNb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr +54rMVD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+SZFhyBH+ +DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ4J7sVaE3IqKHBAUsR320 +HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0Lcp2AMBYHlT8oDv3FdU9T1nSatCQujgKR +z3bFmx5VdJx4IbHwLfELn8LVlhgf8FQieowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7R +l+lwrrw7GWzbITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZ +bNshMBgGA1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB +CwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8jvZfza1zv7v1Apt+h +k6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kPDpFrdRbhIfzYJsdHt6bPWHJxfrrh +TZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pcmaHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a9 +61qn8FYiqTxlVMYVqL2Gns2Dlmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G +3mB/ufNPRJLvKrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed +-----END CERTIFICATE----- + QuoVadis Root CA 1 G3 ===================== -----BEGIN CERTIFICATE----- @@ -2856,95 +2908,3 @@ CgYIKoZIzj0EAwQDgYsAMIGHAkIBLdqu9S54tma4n7Zwf2Z0z+yOfP7AAXmazlIC58PRDHpty7Ve 7hekm9sEdu4pKeiv+62sUvTXK9Z3hBC9xdIoaDQCQTV2WnXzkoYI9bIeCvZlC9p2x1L/Cx6AcCIw wzPbGO2E14vs7dOoY4G1VnxHx1YwlGhza9IuqbnZLBwpvQy6uWWL -----END CERTIFICATE----- - -SECOM TLS RSA Root CA 2024 -========================== ------BEGIN CERTIFICATE----- -MIIFmjCCA4KgAwIBAgIJAO6JNNDLgOCyMA0GCSqGSIb3DQEBDAUAMFoxCzAJBgNVBAYTAkpQMSYw -JAYDVQQKEx1TRUNPTSBUcnVzdCBTeXN0ZW1zIENvLiwgTHRkLjEjMCEGA1UEAxMaU0VDT00gVExT -IFJTQSBSb290IENBIDIwMjQwHhcNMjQwMTMxMDUxMTU1WhcNNDkwMTE0MDUxMTU1WjBaMQswCQYD -VQQGEwJKUDEmMCQGA1UEChMdU0VDT00gVHJ1c3QgU3lzdGVtcyBDby4sIEx0ZC4xIzAhBgNVBAMT -GlNFQ09NIFRMUyBSU0EgUm9vdCBDQSAyMDI0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKC -AgEA4TjizUwzxbInq8Tx11gaFYNk5fO+34y7TyM4neh0UgL5JIZbJNLTz2x//L/B71+5m6X6nGIr -7d4lFJBGtjO677hXOz93zkcWaUTm3VbOAjBlt4YWxlcccBHXuZ7o3Q+4R+ormrBdHeJ1CTUEG8tt -QbKIl3G7OZYbnH8/pP8cjPub/0kDVNuMzp7xsVRROOisQt53fMoJLlYgoebbuMphOqMCtjkJ7R6e -fEMfLp8UAVi9ZaLRn76ET/CJkk925nduuufC4BatS4mnXFmxN0vUXb0ij9B8O/D8gixQEsVSD4GK -8FWRPh3bVd/6bzdkHGJjy21XI0yejVomZUbRrOfNuz0boPGV1pt18fFC39IHQEth3OFqb5NDO3L+ -A9bNqTgAyUgRmIn4ucgDc/Ri/Km3V51ueZjy1/yk0qwJVadAVVrCt56iNeXOyEvzJADGgDQ8E1Pd -aqct8Cynz/47ReQM62vFYO08wcQkrjmX/tesiko1V1yyaf6EfPzUFzmaGy9xvkCwdbm15EdTolOj -E0H2Vb5/APDOyCFEokiYGmXTLdAUl0wKZ4IyjkHGzy0jhpaXEXE/GJcEvI6VzEchjaBL03EJ0h9p -G4OqeIOycKvAo3A+TbetyfsrgYyHzU0a7/qUjGat1AAq1nVljMpKqpinPTsf/d9H39FTUeJL7Tpz -zjUCAwEAAaNjMGEwHQYDVR0OBBYEFCzrchKOWHdkNRVWNQFXB6l9DTbmMB8GA1UdIwQYMBaAFCzr -chKOWHdkNRVWNQFXB6l9DTbmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG -SIb3DQEBDAUAA4ICAQAVwsvluSafaez5tFPR/hRTBzRxEyMMQF3XJXCVi3yegZyKoec7hmE6jx2Z -M8KgM1kn2yJRwFXHX8zUW9nBLEDWc4wuE8LrlZqhGZM9pJQXGmGzResDJV6JgRBna+j4sA1M7yId -lvL0sAfFXFCTRaWTD4E1V99RLrFzWfTcC+e180hDuNMpqOEo46+lMeW/Wvh7ifOQs+kiK0O2gHxQ -DNxslSavnCs4V7l8HRDJ2La10o70Bo7VLzf1W8MBvv0VTnxB+NjT5qTAbhGFh9Gvp4BaJpmdUf0C -5CEP6dbQlfgxWfzYr69yVT6dPQB+GFEaY03IMY+AcBCs+om1fNxrQXt9zoofMBNFbLhvpNH/JsXW -dGUzfNbO12uswTa5wah8LB18FTQN2/zPHYmvBEoLuyUgZ09VNLJo5YA0kXItVYkLjMe2SixzK4sc -UHv81IK99I91DWx7FwMVKw2xgFp+ZLYB2dnpQQrqwlW64glHUcK2N9BDsnjLSxeZ+UPECh9RxH4W -AcKiZW+cqaKMmhP2WBfR4IcR7NOL32ml11ds87hhV1CZWWFCJAcCidYZz6CZa8exzHojP9SB5RH0 -/v1KdHAisqhSjtJl/UIAHIQ48elOn8wrTdFap4Yb5aHglmMeNx+fAIhDluWVfxTO7H4dTPU+SFVR -MLAh+wwKZfqb94nMeQ== ------END CERTIFICATE----- - -SECOM TLS ECC Root CA 2024 -========================== ------BEGIN CERTIFICATE----- -MIICTDCCAdGgAwIBAgIJAIF6LO+PI3pEMAoGCCqGSM49BAMDMFoxCzAJBgNVBAYTAkpQMSYwJAYD -VQQKEx1TRUNPTSBUcnVzdCBTeXN0ZW1zIENvLiwgTHRkLjEjMCEGA1UEAxMaU0VDT00gVExTIEVD -QyBSb290IENBIDIwMjQwHhcNMjQwMTMxMDU1MjM0WhcNNDkwMTE0MDU1MjM0WjBaMQswCQYDVQQG -EwJKUDEmMCQGA1UEChMdU0VDT00gVHJ1c3QgU3lzdGVtcyBDby4sIEx0ZC4xIzAhBgNVBAMTGlNF -Q09NIFRMUyBFQ0MgUm9vdCBDQSAyMDI0MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE7NzFMtu9dzQX -SNC12fabk0+GlC5finB3R7XaZonRUd20aFiWObtuNBCLUZSfk6QXAE55BjEXsXQ/NG8yUqicXjsu -9ksDK3JZBgCwLOVh6+nwJXTvso/dEj/GUYH5mBdoo2MwYTAdBgNVHQ4EFgQUO3YReyl04k4GTFaC -QNAhL3qzydUwHwYDVR0jBBgwFoAUO3YReyl04k4GTFaCQNAhL3qzydUwDgYDVR0PAQH/BAQDAgEG -MA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwMDaQAwZgIxAN3ib8fi1pMYtAPjMilB5e5/H+t5 -CL0xPL+cZ5oTTZuSCjpAn1v7F/VAr8bFxQXAowIxAKsBVO1ACFp7skwzPvdv1EUY5a897WGLT4lb -+bjxFAWyl8wDcZJdwGZ/pAHxt1AJ1g== ------END CERTIFICATE----- - -Telia EC TLS Root CA v3 -======================= ------BEGIN CERTIFICATE----- -MIICMjCCAbegAwIBAgIPAYvSIlRjTQSLbOVHH9K1MAoGCCqGSM49BAMDMEoxCzAJBgNVBAYTAlNF -MRkwFwYDVQQKDBBUZWxpYSBDb21wYW55IEFCMSAwHgYDVQQDDBdUZWxpYSBFQyBUTFMgUm9vdCBD -QSB2MzAeFw0yMzExMTUwODU1MjZaFw00ODA1MjMxMTAwMDBaMEoxCzAJBgNVBAYTAlNFMRkwFwYD -VQQKDBBUZWxpYSBDb21wYW55IEFCMSAwHgYDVQQDDBdUZWxpYSBFQyBUTFMgUm9vdCBDQSB2MzB2 -MBAGByqGSM49AgEGBSuBBAAiA2IABMHIlhVDLbmFKUpW0iK4dpryT6emYOeS31JPwWnWPmkWRrAk -TbPX40sQfHI9mpR7Rbktu3ngg6W+BBSXSechtMCnBmWXj/EaVlmV5cY1jD2HoTfhBQ3AacpCNMLJ -K4NpZaNjMGEwHwYDVR0jBBgwFoAU1GToQ4g6cy/QGnGCNgtehd7H3kMwHQYDVR0OBBYEFNRk6EOI -OnMv0BpxgjYLXoXex95DMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49 -BAMDA2kAMGYCMQCXAUdS/9bbJ8A1JYaGf/bWt/s7Ta0ot5Ulno8OjSNYRWQIlS4tVWldvTAVA7he -OFgCMQCvKr8+Z2Rn+OBr5UHzlgBObpad1LuwNTRcdNgUJxIWadcki+UBLEi1/AURKV5md2M= ------END CERTIFICATE----- - -Telia RSA TLS Root CA v3 -======================== ------BEGIN CERTIFICATE----- -MIIFgjCCA2qgAwIBAgIPAYvSUKtCVSxHWr2h3BrFMA0GCSqGSIb3DQEBDAUAMEsxCzAJBgNVBAYT -AlNFMRkwFwYDVQQKDBBUZWxpYSBDb21wYW55IEFCMSEwHwYDVQQDDBhUZWxpYSBSU0EgVExTIFJv -b3QgQ0EgdjMwHhcNMjMxMTE1MDk0NzQyWhcNNDgwNTIzMTEwMDAwWjBLMQswCQYDVQQGEwJTRTEZ -MBcGA1UECgwQVGVsaWEgQ29tcGFueSBBQjEhMB8GA1UEAwwYVGVsaWEgUlNBIFRMUyBSb290IENB -IHYzMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAsV89KG19hCf4S1Fvk8D3TyDERhmc -vx8F7Kmb4WATx3ije1id3KHxRE0TKmcNCbAQ57bvHFEYa4hR2l20VjVadExqOW+2ld99MbEiO+jR -VOz+BbxLxJnmGwCqI+BfuTjjVReDxsxjQvjgBsClaO/sm5i70nlZcWGRtIkvWDK3NNkT5RtwXc/O -8NTFVpbUqT6cRjIj3olAblR+lRf4Ffy5o+Q9fabjYn9Z9S4itruElcEFf9Ljk7fwdTycT/rvJW9w -/B3G2a3r0f/zXNOVruIBcqE6pkSospACU2bG42fYKrbM/GWnp7u+p9Frz4jaNwpb4YHuEeS8Brat -NcP8X62jXIvvKHxlsMDJCnb4U8JzFOLsU6mohVY58BdZrvi0Gk9UOuqmgoG6dskHoksjZTlK61D/ -InzmEoA1yAYJFDVysjRxDUOu9cAwANbqmq77WIFL6BpnZgVqPtMfG6wN8BrTKdapvilVsYR59BFg -IsAVBMxrGh+W+QcvmJafUpASvlArKvVG2FI4i6PiLjSBT0+6F6EQLrYqefOQF/fBNEXb+njUQ0SU -VrAqtH4Y+OjCI/a4/JJQppxeemZcQ0SUShgiI5AM5xHO5iyaUrTjYH4zxUz9j+1FEbDH/xpstr1g -XBykspup+hRTaJcbA+UbpJqtWZndAPddJmt6YJQ+dU3pDu8CAwEAAaNjMGEwHwYDVR0jBBgwFoAU -sMep0t2yKFZzBJSMFFxIbzdSkqgwHQYDVR0OBBYEFLDHqdLdsihWcwSUjBRcSG83UpKoMA4GA1Ud -DwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBDAUAA4ICAQBdYzFsNGDRk7bR -/AgRKq+5637YuOW+w6uhpoS0VnKMUpyHCwku86hEvqivakPtfmlm4bFwt++sb/8OXsWBqtfbXMaB -NDTZl8XRMJuLWOW2JrbKkRzgG0eBUcvsadG1rrhbmZqYvFXaAZO7o4TdOZzxhBB5GOAWWXB3Iera -NP4J63zyo9n8Gqw3sJBG44em5hoYjBffP+npibyslnslRi4L6xHsCYj/Pab+OlqbMCB6v+sTCLeE -IukRVzoR9aQ45pEK7Z1QBnSsbAKQtss0JKD9d/mX143H1xePjPhTXlv5JCkhrcj+SShz0P9+EHoW -e6m9lyUEOIVn0rp+yVJWNbmyDv3VkwFxHC1ApSQsgSimjGQ4wtr6cSmordYxkV+Ro8lOIIhRksXP -yDk27gW6IjUXCkZKpxFjkL3jiBSc8SkxnwCWtXg8xwNwdFVNBGLCCuJnsneYXjJNqzRqUcoGwzsv -F3Qi/ZnHUNvISdevlgIAXL4Wvrxaqvoa01wB+GCfs57RTGE4TvAGhKNKus8K3hRT1BSpigzMIRzS -xtAOrqPN6j//QSmW9f8Jcncri4j2ihSpVrFU0NdNkMhZeAKidTFPsxCVFuW4Aniz7jqiw5sWtjbQ -rlW035izIEU4sYwQoC1Nx0Svy+mMTRai50LqFQ+A1/Hq6xHHDNx7CI83d23Erw== ------END CERTIFICATE----- diff --git a/core/vendor/composer/installed.json b/core/vendor/composer/installed.json index 7f5ee07026..1f9abacbf5 100644 --- a/core/vendor/composer/installed.json +++ b/core/vendor/composer/installed.json @@ -149,17 +149,17 @@ }, { "name": "carbonphp/carbon-doctrine-types", - "version": "3.2.1", - "version_normalized": "3.2.1.0", + "version": "3.2.0", + "version_normalized": "3.2.0.0", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", - "reference": "5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc" + "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc", - "reference": "5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc", + "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/18ba5ddfec8976260ead6e866180bd5d2f71aa1d", + "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d", "shasum": "" }, "require": { @@ -173,13 +173,8 @@ "nesbot/carbon": "^2.71.0 || ^3.0.0", "phpunit/phpunit": "^10.3" }, - "time": "2026-09-06T14:11:38+00:00", + "time": "2024-02-09T16:56:22+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { @@ -206,7 +201,7 @@ ], "support": { "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", - "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.1" + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.0" }, "funding": [ { @@ -226,17 +221,17 @@ }, { "name": "composer/ca-bundle", - "version": "1.5.14", - "version_normalized": "1.5.14.0", + "version": "1.5.13", + "version_normalized": "1.5.13.0", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "0c8abba0634f637bd78c4e451981da368d403463" + "reference": "c008272789979f709f7fcb32c2ecf1d2db5e84e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0c8abba0634f637bd78c4e451981da368d403463", - "reference": "0c8abba0634f637bd78c4e451981da368d403463", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/c008272789979f709f7fcb32c2ecf1d2db5e84e5", + "reference": "c008272789979f709f7fcb32c2ecf1d2db5e84e5", "shasum": "" }, "require": { @@ -250,7 +245,7 @@ "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, - "time": "2026-08-21T14:57:29+00:00", + "time": "2026-07-18T12:35:13+00:00", "type": "library", "extra": { "branch-alias": { @@ -285,7 +280,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.14" + "source": "https://github.com/composer/ca-bundle/tree/1.5.13" }, "funding": [ { @@ -1527,27 +1522,27 @@ }, { "name": "graham-campbell/result-type", - "version": "v1.2.0", - "version_normalized": "1.2.0.0", + "version": "v1.1.4", + "version_normalized": "1.1.4.0", "source": { "type": "git", "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "adccca3324eece92ca35463648c12b9e6293c05b" + "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/adccca3324eece92ca35463648c12b9e6293c05b", - "reference": "adccca3324eece92ca35463648c12b9e6293c05b", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/e01f4a821471308ba86aa202fed6698b6b695e3b", + "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.10" + "phpoption/phpoption": "^1.9.5" }, "require-dev": { - "phpunit/phpunit": "^8.5.52 || ^9.6.34 || ^10.5.63 || ^11.5.55 || ^12.5.14" + "phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7" }, - "time": "2026-08-24T09:06:52+00:00", + "time": "2025-12-27T19:43:20+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1576,7 +1571,7 @@ ], "support": { "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.2.0" + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.4" }, "funding": [ { @@ -1592,23 +1587,23 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.15.5", - "version_normalized": "7.15.5.0", + "version": "7.15.3", + "version_normalized": "7.15.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "ee80339fd9177ba44c49cdb653ff02a4d1106b9a" + "reference": "ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee80339fd9177ba44c49cdb653ff02a4d1106b9a", - "reference": "ee80339fd9177ba44c49cdb653ff02a4d1106b9a", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc", + "reference": "ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^2.5.3", - "guzzlehttp/psr7": "^2.13.1", + "guzzlehttp/promises": "^2.5.2", + "guzzlehttp/psr7": "^2.13", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.5 || ^3.0", @@ -1631,7 +1626,7 @@ "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, - "time": "2026-08-24T09:21:06+00:00", + "time": "2026-08-05T19:48:21+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -1703,7 +1698,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.15.5" + "source": "https://github.com/guzzle/guzzle/tree/7.15.3" }, "funding": [ { @@ -1723,17 +1718,17 @@ }, { "name": "guzzlehttp/promises", - "version": "2.5.3", - "version_normalized": "2.5.3.0", + "version": "2.5.2", + "version_normalized": "2.5.2.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "cde49999552d185d64715fe9c1f77a2aadd2f9f1" + "reference": "2823687acff28b2dbe67b2508a6b300e2c3fa4ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/cde49999552d185d64715fe9c1f77a2aadd2f9f1", - "reference": "cde49999552d185d64715fe9c1f77a2aadd2f9f1", + "url": "https://api.github.com/repos/guzzle/promises/zipball/2823687acff28b2dbe67b2508a6b300e2c3fa4ce", + "reference": "2823687acff28b2dbe67b2508a6b300e2c3fa4ce", "shasum": "" }, "require": { @@ -1744,7 +1739,7 @@ "bamarni/composer-bin-plugin": "^1.8.2", "phpunit/phpunit": "^8.5.52 || ^9.6.34" }, - "time": "2026-08-24T09:11:28+00:00", + "time": "2026-08-05T19:30:54+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -1790,7 +1785,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.5.3" + "source": "https://github.com/guzzle/promises/tree/2.5.2" }, "funding": [ { @@ -1810,17 +1805,17 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.13.1", - "version_normalized": "2.13.1.0", + "version": "2.13.0", + "version_normalized": "2.13.0.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "95e7828100de18b4e269fb1703be530082d5166d" + "reference": "dad89620b7a6edb60c15858442eb2e408b45d8f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/95e7828100de18b4e269fb1703be530082d5166d", - "reference": "95e7828100de18b4e269fb1703be530082d5166d", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/dad89620b7a6edb60c15858442eb2e408b45d8f4", + "reference": "dad89620b7a6edb60c15858442eb2e408b45d8f4", "shasum": "" }, "require": { @@ -1844,7 +1839,7 @@ "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, - "time": "2026-08-24T09:13:11+00:00", + "time": "2026-07-16T22:23:49+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -1912,7 +1907,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.13.1" + "source": "https://github.com/guzzle/psr7/tree/2.13.0" }, "funding": [ { @@ -1932,17 +1927,17 @@ }, { "name": "guzzlehttp/uri-template", - "version": "v1.0.11", - "version_normalized": "1.0.11.0", + "version": "v1.0.10", + "version_normalized": "1.0.10.0", "source": { "type": "git", "url": "https://github.com/guzzle/uri-template.git", - "reference": "d0058dccf4299d70c3d9da3378b8908b32780368" + "reference": "f6c24c21f42b990e9a58912b332d0874df6ba839" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/uri-template/zipball/d0058dccf4299d70c3d9da3378b8908b32780368", - "reference": "d0058dccf4299d70c3d9da3378b8908b32780368", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/f6c24c21f42b990e9a58912b332d0874df6ba839", + "reference": "f6c24c21f42b990e9a58912b332d0874df6ba839", "shasum": "" }, "require": { @@ -1954,7 +1949,7 @@ "phpunit/phpunit": "^8.5.52 || ^9.6.34", "uri-template/tests": "1.0.0" }, - "time": "2026-08-24T09:15:32+00:00", + "time": "2026-07-17T13:53:03+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -2001,7 +1996,7 @@ ], "support": { "issues": "https://github.com/guzzle/uri-template/issues", - "source": "https://github.com/guzzle/uri-template/tree/v1.0.11" + "source": "https://github.com/guzzle/uri-template/tree/v1.0.10" }, "funding": [ { @@ -2021,8 +2016,8 @@ }, { "name": "illuminate/bus", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", @@ -2077,8 +2072,8 @@ }, { "name": "illuminate/cache", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/cache.git", @@ -2142,8 +2137,8 @@ }, { "name": "illuminate/collections", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", @@ -2205,8 +2200,8 @@ }, { "name": "illuminate/conditionable", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", @@ -2254,8 +2249,8 @@ }, { "name": "illuminate/config", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/config.git", @@ -2305,17 +2300,17 @@ }, { "name": "illuminate/console", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/console.git", - "reference": "29f41bd7e07c14c04cb5acfaf9dc103adf2084aa" + "reference": "ce37b63fb90f036dbd34263d84725f79c6d6f221" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/console/zipball/29f41bd7e07c14c04cb5acfaf9dc103adf2084aa", - "reference": "29f41bd7e07c14c04cb5acfaf9dc103adf2084aa", + "url": "https://api.github.com/repos/illuminate/console/zipball/ce37b63fb90f036dbd34263d84725f79c6d6f221", + "reference": "ce37b63fb90f036dbd34263d84725f79c6d6f221", "shasum": "" }, "require": { @@ -2341,7 +2336,7 @@ "illuminate/filesystem": "Required to use the generator command (^12.0).", "illuminate/queue": "Required to use closures for scheduled jobs (^12.0)." }, - "time": "2026-09-08T13:37:54+00:00", + "time": "2026-07-29T14:35:23+00:00", "type": "library", "extra": { "branch-alias": { @@ -2374,8 +2369,8 @@ }, { "name": "illuminate/container", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", @@ -2439,8 +2434,8 @@ }, { "name": "illuminate/contracts", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -2490,17 +2485,17 @@ }, { "name": "illuminate/database", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "499f5112164d5bc4b744e0ac259b44e0a4c8aacc" + "reference": "6d539459fb55732a13e7f962afeffa9dca2a1cce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/499f5112164d5bc4b744e0ac259b44e0a4c8aacc", - "reference": "499f5112164d5bc4b744e0ac259b44e0a4c8aacc", + "url": "https://api.github.com/repos/illuminate/database/zipball/6d539459fb55732a13e7f962afeffa9dca2a1cce", + "reference": "6d539459fb55732a13e7f962afeffa9dca2a1cce", "shasum": "" }, "require": { @@ -2527,7 +2522,7 @@ "illuminate/pagination": "Required to paginate the result set (^12.0).", "symfony/finder": "Required to use Eloquent model factories (^7.2)." }, - "time": "2026-09-06T21:11:25+00:00", + "time": "2026-08-14T15:00:48+00:00", "type": "library", "extra": { "branch-alias": { @@ -2566,8 +2561,8 @@ }, { "name": "illuminate/events", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", @@ -2624,8 +2619,8 @@ }, { "name": "illuminate/filesystem", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/filesystem.git", @@ -2694,17 +2689,17 @@ }, { "name": "illuminate/http", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/http.git", - "reference": "a91f70083082bd6d466ea229dbbdfc48c553621c" + "reference": "5f4f82ed0ed550a01f5d95c4ddbbad409fb0d560" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/http/zipball/a91f70083082bd6d466ea229dbbdfc48c553621c", - "reference": "a91f70083082bd6d466ea229dbbdfc48c553621c", + "url": "https://api.github.com/repos/illuminate/http/zipball/5f4f82ed0ed550a01f5d95c4ddbbad409fb0d560", + "reference": "5f4f82ed0ed550a01f5d95c4ddbbad409fb0d560", "shasum": "" }, "require": { @@ -2726,7 +2721,7 @@ "suggest": { "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image()." }, - "time": "2026-08-24T22:07:52+00:00", + "time": "2026-08-06T14:28:07+00:00", "type": "library", "extra": { "branch-alias": { @@ -2759,8 +2754,8 @@ }, { "name": "illuminate/log", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/log.git", @@ -2815,8 +2810,8 @@ }, { "name": "illuminate/macroable", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -2864,8 +2859,8 @@ }, { "name": "illuminate/pagination", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/pagination.git", @@ -2917,8 +2912,8 @@ }, { "name": "illuminate/pipeline", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", @@ -2972,8 +2967,8 @@ }, { "name": "illuminate/queue", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/queue.git", @@ -3042,8 +3037,8 @@ }, { "name": "illuminate/redis", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/redis.git", @@ -3099,8 +3094,8 @@ }, { "name": "illuminate/reflection", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/reflection.git", @@ -3153,8 +3148,8 @@ }, { "name": "illuminate/routing", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/routing.git", @@ -3222,8 +3217,8 @@ }, { "name": "illuminate/session", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/session.git", @@ -3282,8 +3277,8 @@ }, { "name": "illuminate/support", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", @@ -3365,8 +3360,8 @@ }, { "name": "illuminate/translation", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/translation.git", @@ -3419,8 +3414,8 @@ }, { "name": "illuminate/validation", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/validation.git", @@ -3485,8 +3480,8 @@ }, { "name": "illuminate/view", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.67.0", + "version_normalized": "12.67.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/view.git", @@ -3602,21 +3597,20 @@ }, { "name": "justinrainbow/json-schema", - "version": "6.12.0", - "version_normalized": "6.12.0.0", + "version": "6.10.0", + "version_normalized": "6.10.0.0", "source": { "type": "git", "url": "https://github.com/jsonrainbow/json-schema.git", - "reference": "8ef236a1a37df364b518b7411a4b5bb95b040d79" + "reference": "8b1308a9d7bdbdb20ce87ef920f82b4564bb2d33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/8ef236a1a37df364b518b7411a4b5bb95b040d79", - "reference": "8ef236a1a37df364b518b7411a4b5bb95b040d79", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/8b1308a9d7bdbdb20ce87ef920f82b4564bb2d33", + "reference": "8b1308a9d7bdbdb20ce87ef920f82b4564bb2d33", "shasum": "" }, "require": { - "ext-filter": "*", "ext-json": "*", "marc-mabe/php-enum": "^4.4", "php": "^7.2 || ^8.0" @@ -3629,7 +3623,7 @@ "phpstan/phpstan": "^1.12", "phpunit/phpunit": "^8.5" }, - "time": "2026-09-04T12:54:20+00:00", + "time": "2026-06-16T20:50:26+00:00", "bin": [ "bin/validate-json" ], @@ -3651,9 +3645,20 @@ ], "authors": [ { - "name": "Danny van der Sluijs", - "email": "danny.vandersluijs@icloud.com", - "role": "Maintainer" + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" } ], "description": "A library to validate a json schema.", @@ -3664,23 +3669,23 @@ ], "support": { "issues": "https://github.com/jsonrainbow/json-schema/issues", - "source": "https://github.com/jsonrainbow/json-schema/tree/6.12.0" + "source": "https://github.com/jsonrainbow/json-schema/tree/6.10.0" }, "install-path": "../justinrainbow/json-schema" }, { "name": "laravel/prompts", - "version": "v0.3.24", - "version_normalized": "0.3.24.0", + "version": "v0.3.23", + "version_normalized": "0.3.23.0", "source": { "type": "git", "url": "https://github.com/laravel/prompts.git", - "reference": "5d3cdef29e93ca3b62b1871359db3078cd99908b" + "reference": "b7b4c35e5bc47450f6b6238c6cc9c47ba19b2221" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/prompts/zipball/5d3cdef29e93ca3b62b1871359db3078cd99908b", - "reference": "5d3cdef29e93ca3b62b1871359db3078cd99908b", + "url": "https://api.github.com/repos/laravel/prompts/zipball/b7b4c35e5bc47450f6b6238c6cc9c47ba19b2221", + "reference": "b7b4c35e5bc47450f6b6238c6cc9c47ba19b2221", "shasum": "" }, "require": { @@ -3703,7 +3708,7 @@ "suggest": { "ext-pcntl": "Required for the spinner to be animated." }, - "time": "2026-08-20T12:55:36+00:00", + "time": "2026-08-11T18:58:24+00:00", "type": "library", "extra": { "branch-alias": { @@ -3726,23 +3731,23 @@ "description": "Add beautiful and user-friendly forms to your command-line applications.", "support": { "issues": "https://github.com/laravel/prompts/issues", - "source": "https://github.com/laravel/prompts/tree/v0.3.24" + "source": "https://github.com/laravel/prompts/tree/v0.3.23" }, "install-path": "../laravel/prompts" }, { "name": "laravel/serializable-closure", - "version": "v2.0.16", - "version_normalized": "2.0.16.0", + "version": "v2.0.15", + "version_normalized": "2.0.15.0", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed" + "reference": "dccd8bcb851bb03fcc005df650b708b57cc52661" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed", - "reference": "7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/dccd8bcb851bb03fcc005df650b708b57cc52661", + "reference": "dccd8bcb851bb03fcc005df650b708b57cc52661", "shasum": "" }, "require": { @@ -3755,7 +3760,7 @@ "phpstan/phpstan": "^2.0", "symfony/var-dumper": "^6.2.0|^7.0.0|^8.0.0" }, - "time": "2026-08-18T20:28:54+00:00", + "time": "2026-07-21T16:49:22+00:00", "type": "library", "extra": { "branch-alias": { @@ -3796,17 +3801,17 @@ }, { "name": "league/flysystem", - "version": "3.36.0", - "version_normalized": "3.36.0.0", + "version": "3.35.2", + "version_normalized": "3.35.2.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "f7fb152932f30072d573510cbd4dd657d6475b25" + "reference": "b277b5dc3d56650b68904117124e79c851e12376" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f7fb152932f30072d573510cbd4dd657d6475b25", - "reference": "f7fb152932f30072d573510cbd4dd657d6475b25", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/b277b5dc3d56650b68904117124e79c851e12376", + "reference": "b277b5dc3d56650b68904117124e79c851e12376", "shasum": "" }, "require": { @@ -3842,7 +3847,7 @@ "phpunit/phpunit": "^9.5.11|^10.0", "sabre/dav": "^4.6.0" }, - "time": "2026-09-02T08:00:27+00:00", + "time": "2026-07-06T14:42:07+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -3876,23 +3881,23 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.36.0" + "source": "https://github.com/thephpleague/flysystem/tree/3.35.2" }, "install-path": "../league/flysystem" }, { "name": "league/flysystem-local", - "version": "3.35.3", - "version_normalized": "3.35.3.0", + "version": "3.31.0", + "version_normalized": "3.31.0.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-local.git", - "reference": "a099b24dce160f3b2239043d13d47c4a1a214ea4" + "reference": "2f669db18a4c20c755c2bb7d3a7b0b2340488079" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/a099b24dce160f3b2239043d13d47c4a1a214ea4", - "reference": "a099b24dce160f3b2239043d13d47c4a1a214ea4", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/2f669db18a4c20c755c2bb7d3a7b0b2340488079", + "reference": "2f669db18a4c20c755c2bb7d3a7b0b2340488079", "shasum": "" }, "require": { @@ -3901,7 +3906,7 @@ "league/mime-type-detection": "^1.0.0", "php": "^8.0.2" }, - "time": "2026-08-12T13:29:21+00:00", + "time": "2026-01-23T15:30:45+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -3928,7 +3933,7 @@ "local" ], "support": { - "source": "https://github.com/thephpleague/flysystem-local/tree/3.35.3" + "source": "https://github.com/thephpleague/flysystem-local/tree/3.31.0" }, "install-path": "../league/flysystem-local" }, @@ -4069,17 +4074,17 @@ }, { "name": "monolog/monolog", - "version": "3.12.0", - "version_normalized": "3.12.0.0", + "version": "3.10.0", + "version_normalized": "3.10.0.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "72c534fc0ab181ef52d92a68382318631e301608" + "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/72c534fc0ab181ef52d92a68382318631e301608", - "reference": "72c534fc0ab181ef52d92a68382318631e301608", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/b321dd6749f0bf7189444158a3ce785cc16d69b0", + "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0", "shasum": "" }, "require": { @@ -4105,7 +4110,6 @@ "phpstan/phpstan-strict-rules": "^2", "phpunit/phpunit": "^10.5.17 || ^11.0.7", "predis/predis": "^1.1 || ^2", - "psr/clock": "^1.0", "rollbar/rollbar": "^4.0", "ruflin/elastica": "^7 || ^8", "symfony/mailer": "^5.4 || ^6", @@ -4124,11 +4128,10 @@ "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "psr/clock": "Required to pass a clock to the Logger and control the timestamp of log records", "rollbar/rollbar": "Allow sending log messages to Rollbar", "ruflin/elastica": "Allow sending log messages to an Elastic Search server" }, - "time": "2026-09-09T08:34:20+00:00", + "time": "2026-01-02T08:56:05+00:00", "type": "library", "extra": { "branch-alias": { @@ -4161,7 +4164,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.12.0" + "source": "https://github.com/Seldaek/monolog/tree/3.10.0" }, "funding": [ { @@ -4460,17 +4463,17 @@ }, { "name": "phpoption/phpoption", - "version": "1.10.0", - "version_normalized": "1.10.0.0", + "version": "1.9.5", + "version_normalized": "1.9.5.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "67b192b6a42ec03944b972d6e633ddec78ad2c6d" + "reference": "75365b91986c2405cf5e1e012c5595cd487a98be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/67b192b6a42ec03944b972d6e633ddec78ad2c6d", - "reference": "67b192b6a42ec03944b972d6e633ddec78ad2c6d", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/75365b91986c2405cf5e1e012c5595cd487a98be", + "reference": "75365b91986c2405cf5e1e012c5595cd487a98be", "shasum": "" }, "require": { @@ -4478,9 +4481,9 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.54 || ^9.6.36 || ^10.5.64 || ^11.5.56 || ^12.5.33" + "phpunit/phpunit": "^8.5.44 || ^9.6.25 || ^10.5.53 || ^11.5.34" }, - "time": "2026-08-24T00:54:40+00:00", + "time": "2025-12-27T19:41:33+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -4522,7 +4525,7 @@ ], "support": { "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.10.0" + "source": "https://github.com/schmittjoh/php-option/tree/1.9.5" }, "funding": [ { @@ -6268,17 +6271,17 @@ }, { "name": "symfony/console", - "version": "v7.4.18", - "version_normalized": "7.4.18.0", + "version": "v7.4.16", + "version_normalized": "7.4.16.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "23d6f88a29f6d0eac45bd77d70307adf83ba7ab0" + "reference": "f4c69c9aed03abf933b294257d618bdd9b30a06d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/23d6f88a29f6d0eac45bd77d70307adf83ba7ab0", - "reference": "23d6f88a29f6d0eac45bd77d70307adf83ba7ab0", + "url": "https://api.github.com/repos/symfony/console/zipball/f4c69c9aed03abf933b294257d618bdd9b30a06d", + "reference": "f4c69c9aed03abf933b294257d618bdd9b30a06d", "shasum": "" }, "require": { @@ -6311,7 +6314,7 @@ "symfony/stopwatch": "^6.4|^7.0|^8.0", "symfony/var-dumper": "^6.4|^7.0|^8.0" }, - "time": "2026-08-25T14:18:37+00:00", + "time": "2026-07-31T12:37:14+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6345,7 +6348,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.4.18" + "source": "https://github.com/symfony/console/tree/v7.4.16" }, "funding": [ { @@ -6443,17 +6446,17 @@ }, { "name": "symfony/error-handler", - "version": "v7.4.17", - "version_normalized": "7.4.17.0", + "version": "v7.4.15", + "version_normalized": "7.4.15.0", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "8373921e231e190a88e2ad526951bbaa791576fa" + "reference": "d49f6a19f326db41ae7103bdc38e3eb35a791261" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/8373921e231e190a88e2ad526951bbaa791576fa", - "reference": "8373921e231e190a88e2ad526951bbaa791576fa", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/d49f6a19f326db41ae7103bdc38e3eb35a791261", + "reference": "d49f6a19f326db41ae7103bdc38e3eb35a791261", "shasum": "" }, "require": { @@ -6473,7 +6476,7 @@ "symfony/serializer": "^6.4|^7.0|^8.0", "symfony/webpack-encore-bundle": "^1.0|^2.0" }, - "time": "2026-08-21T17:40:08+00:00", + "time": "2026-07-21T15:13:06+00:00", "bin": [ "Resources/bin/patch-type-declarations" ], @@ -6504,7 +6507,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v7.4.17" + "source": "https://github.com/symfony/error-handler/tree/v7.4.15" }, "funding": [ { @@ -6528,17 +6531,17 @@ }, { "name": "symfony/event-dispatcher", - "version": "v7.4.17", - "version_normalized": "7.4.17.0", + "version": "v7.4.15", + "version_normalized": "7.4.15.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d269974ee93c61d03620ffee358355bfdb471d66" + "reference": "336e7f3b9e95aba04f93ea9143920c2186abfbb9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d269974ee93c61d03620ffee358355bfdb471d66", - "reference": "d269974ee93c61d03620ffee358355bfdb471d66", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/336e7f3b9e95aba04f93ea9143920c2186abfbb9", + "reference": "336e7f3b9e95aba04f93ea9143920c2186abfbb9", "shasum": "" }, "require": { @@ -6564,7 +6567,7 @@ "symfony/service-contracts": "^2.5|^3", "symfony/stopwatch": "^6.4|^7.0|^8.0" }, - "time": "2026-08-21T17:40:08+00:00", + "time": "2026-07-21T15:13:06+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6592,7 +6595,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v7.4.17" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.4.15" }, "funding": [ { @@ -6699,17 +6702,17 @@ }, { "name": "symfony/filesystem", - "version": "v7.4.18", - "version_normalized": "7.4.18.0", + "version": "v7.4.15", + "version_normalized": "7.4.15.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "90d412aa5277c6819db39e7605aa46b1019e3232" + "reference": "ff16a16bf87fdf264638b8f6995b3515975e3c79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/90d412aa5277c6819db39e7605aa46b1019e3232", - "reference": "90d412aa5277c6819db39e7605aa46b1019e3232", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/ff16a16bf87fdf264638b8f6995b3515975e3c79", + "reference": "ff16a16bf87fdf264638b8f6995b3515975e3c79", "shasum": "" }, "require": { @@ -6720,7 +6723,7 @@ "require-dev": { "symfony/process": "^6.4|^7.0|^8.0" }, - "time": "2026-08-23T10:03:40+00:00", + "time": "2026-07-22T07:36:05+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6748,7 +6751,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.4.18" + "source": "https://github.com/symfony/filesystem/tree/v7.4.15" }, "funding": [ { @@ -6772,17 +6775,17 @@ }, { "name": "symfony/finder", - "version": "v7.4.17", - "version_normalized": "7.4.17.0", + "version": "v7.4.14", + "version_normalized": "7.4.14.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "5ce28827081f6d1f0c32eaf3882750f19cb5bbe6" + "reference": "13b38720174286f55d1761152b575a8d1436fc25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/5ce28827081f6d1f0c32eaf3882750f19cb5bbe6", - "reference": "5ce28827081f6d1f0c32eaf3882750f19cb5bbe6", + "url": "https://api.github.com/repos/symfony/finder/zipball/13b38720174286f55d1761152b575a8d1436fc25", + "reference": "13b38720174286f55d1761152b575a8d1436fc25", "shasum": "" }, "require": { @@ -6791,7 +6794,7 @@ "require-dev": { "symfony/filesystem": "^6.4|^7.0|^8.0" }, - "time": "2026-08-21T12:09:28+00:00", + "time": "2026-06-27T08:31:18+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6819,7 +6822,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.4.17" + "source": "https://github.com/symfony/finder/tree/v7.4.14" }, "funding": [ { @@ -6843,17 +6846,17 @@ }, { "name": "symfony/http-foundation", - "version": "v7.4.18", - "version_normalized": "7.4.18.0", + "version": "v7.4.16", + "version_normalized": "7.4.16.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "d070b716a32fbe3bf04204db0f58ace73b86d133" + "reference": "b676451bb638e99a7d34d8a2be90406822e301eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/d070b716a32fbe3bf04204db0f58ace73b86d133", - "reference": "d070b716a32fbe3bf04204db0f58ace73b86d133", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b676451bb638e99a7d34d8a2be90406822e301eb", + "reference": "b676451bb638e99a7d34d8a2be90406822e301eb", "shasum": "" }, "require": { @@ -6876,7 +6879,7 @@ "symfony/mime": "^6.4|^7.0|^8.0", "symfony/rate-limiter": "^6.4|^7.0|^8.0" }, - "time": "2026-08-30T20:10:52+00:00", + "time": "2026-08-07T11:50:27+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6904,7 +6907,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v7.4.18" + "source": "https://github.com/symfony/http-foundation/tree/v7.4.16" }, "funding": [ { @@ -6928,17 +6931,17 @@ }, { "name": "symfony/http-kernel", - "version": "v7.4.18", - "version_normalized": "7.4.18.0", + "version": "v7.4.16", + "version_normalized": "7.4.16.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "275d2d2d24530f2a0eaf17704a3a93860a036351" + "reference": "f5e728670fa2218ae8be8ea91f2b44b7d6e5304c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/275d2d2d24530f2a0eaf17704a3a93860a036351", - "reference": "275d2d2d24530f2a0eaf17704a3a93860a036351", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f5e728670fa2218ae8be8ea91f2b44b7d6e5304c", + "reference": "f5e728670fa2218ae8be8ea91f2b44b7d6e5304c", "shasum": "" }, "require": { @@ -6998,7 +7001,7 @@ "symfony/var-exporter": "^6.4|^7.0|^8.0", "twig/twig": "^3.12|^4.0" }, - "time": "2026-08-30T21:24:29+00:00", + "time": "2026-08-07T18:00:13+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -7026,7 +7029,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v7.4.18" + "source": "https://github.com/symfony/http-kernel/tree/v7.4.16" }, "funding": [ { @@ -7050,17 +7053,17 @@ }, { "name": "symfony/mime", - "version": "v7.4.18", - "version_normalized": "7.4.18.0", + "version": "v7.4.16", + "version_normalized": "7.4.16.0", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "bf328d82105831db3e409195db0540ff57f27c80" + "reference": "20094b76a7106dbe978d31cd3bd7aa1ed248d0e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/bf328d82105831db3e409195db0540ff57f27c80", - "reference": "bf328d82105831db3e409195db0540ff57f27c80", + "url": "https://api.github.com/repos/symfony/mime/zipball/20094b76a7106dbe978d31cd3bd7aa1ed248d0e5", + "reference": "20094b76a7106dbe978d31cd3bd7aa1ed248d0e5", "shasum": "" }, "require": { @@ -7084,9 +7087,9 @@ "symfony/process": "^6.4|^7.0|^8.0", "symfony/property-access": "^6.4|^7.0|^8.0", "symfony/property-info": "^6.4|^7.0|^8.0", - "symfony/serializer": "^6.4.44|^7.4.17|^8.1.5" + "symfony/serializer": "^6.4.3|^7.0.3|^8.0" }, - "time": "2026-08-22T09:04:42+00:00", + "time": "2026-08-07T14:56:57+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -7118,7 +7121,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v7.4.18" + "source": "https://github.com/symfony/mime/tree/v7.4.16" }, "funding": [ { @@ -7313,17 +7316,17 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.42.0", - "version_normalized": "1.42.0.0", + "version": "v1.38.1", + "version_normalized": "1.38.1.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "51b5ff5ba85452b31ec6f55490b08148612339d9" + "reference": "dc21118016c039a66235cf93d96b435ffb282412" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/51b5ff5ba85452b31ec6f55490b08148612339d9", - "reference": "51b5ff5ba85452b31ec6f55490b08148612339d9", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/dc21118016c039a66235cf93d96b435ffb282412", + "reference": "dc21118016c039a66235cf93d96b435ffb282412", "shasum": "" }, "require": { @@ -7333,7 +7336,7 @@ "suggest": { "ext-intl": "For best performance" }, - "time": "2026-08-24T10:51:20+00:00", + "time": "2026-05-25T15:22:23+00:00", "type": "library", "extra": { "thanks": { @@ -7379,7 +7382,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.42.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.38.1" }, "funding": [ { @@ -7403,17 +7406,17 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.42.0", - "version_normalized": "1.42.0.0", + "version": "v1.38.0", + "version_normalized": "1.38.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502" + "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/aa20edea75bd9c48cfecc8360922e5a6e5c44502", - "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/2d446c214bdbe5b71bde5011b060a05fece3ae6b", + "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b", "shasum": "" }, "require": { @@ -7422,7 +7425,7 @@ "suggest": { "ext-intl": "For best performance" }, - "time": "2026-08-07T06:33:24+00:00", + "time": "2026-05-25T13:48:31+00:00", "type": "library", "extra": { "thanks": { @@ -7467,7 +7470,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.42.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.38.0" }, "funding": [ { @@ -7745,23 +7748,23 @@ }, { "name": "symfony/process", - "version": "v7.4.18", - "version_normalized": "7.4.18.0", + "version": "v7.4.13", + "version_normalized": "7.4.13.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "058d17fc284cce14efb2385783b55014a461b176" + "reference": "f5804be144caceb570f6747519999636b664f24c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/058d17fc284cce14efb2385783b55014a461b176", - "reference": "058d17fc284cce14efb2385783b55014a461b176", + "url": "https://api.github.com/repos/symfony/process/zipball/f5804be144caceb570f6747519999636b664f24c", + "reference": "f5804be144caceb570f6747519999636b664f24c", "shasum": "" }, "require": { "php": ">=8.2" }, - "time": "2026-08-21T17:40:08+00:00", + "time": "2026-05-23T16:05:06+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -7789,7 +7792,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.4.18" + "source": "https://github.com/symfony/process/tree/v7.4.13" }, "funding": [ { @@ -7813,17 +7816,17 @@ }, { "name": "symfony/routing", - "version": "v7.4.18", - "version_normalized": "7.4.18.0", + "version": "v7.4.15", + "version_normalized": "7.4.15.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "ddd558991e98f693ae6bf5063cc1b0362c6bbec3" + "reference": "80c0a93d3f8e7499f716204a1fb38ead942a7a2b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/ddd558991e98f693ae6bf5063cc1b0362c6bbec3", - "reference": "ddd558991e98f693ae6bf5063cc1b0362c6bbec3", + "url": "https://api.github.com/repos/symfony/routing/zipball/80c0a93d3f8e7499f716204a1fb38ead942a7a2b", + "reference": "80c0a93d3f8e7499f716204a1fb38ead942a7a2b", "shasum": "" }, "require": { @@ -7843,7 +7846,7 @@ "symfony/http-foundation": "^6.4|^7.0|^8.0", "symfony/yaml": "^6.4|^7.0|^8.0" }, - "time": "2026-08-17T13:12:36+00:00", + "time": "2026-07-21T15:13:06+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -7877,7 +7880,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v7.4.18" + "source": "https://github.com/symfony/routing/tree/v7.4.15" }, "funding": [ { @@ -7901,17 +7904,17 @@ }, { "name": "symfony/service-contracts", - "version": "v3.7.3", - "version_normalized": "3.7.3.0", + "version": "v3.7.1", + "version_normalized": "3.7.1.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257" + "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", - "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/c0a284bab1ed8aa0417e3d69250ab437739563a0", + "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0", "shasum": "" }, "require": { @@ -7922,7 +7925,7 @@ "conflict": { "ext-psr": "<1.1|>=2" }, - "time": "2026-07-27T15:39:01+00:00", + "time": "2026-06-16T09:55:08+00:00", "type": "library", "extra": { "thanks": { @@ -7967,7 +7970,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.7.3" + "source": "https://github.com/symfony/service-contracts/tree/v3.7.1" }, "funding": [ { @@ -8085,17 +8088,17 @@ }, { "name": "symfony/translation", - "version": "v7.4.17", - "version_normalized": "7.4.17.0", + "version": "v7.4.16", + "version_normalized": "7.4.16.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "2ee1e4a3b32a528a642babe041ff7c440b213b4b" + "reference": "501e0ff4553c744209ca1a68790d8a4541563710" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/2ee1e4a3b32a528a642babe041ff7c440b213b4b", - "reference": "2ee1e4a3b32a528a642babe041ff7c440b213b4b", + "url": "https://api.github.com/repos/symfony/translation/zipball/501e0ff4553c744209ca1a68790d8a4541563710", + "reference": "501e0ff4553c744209ca1a68790d8a4541563710", "shasum": "" }, "require": { @@ -8133,7 +8136,7 @@ "symfony/service-contracts": "^2.5|^3", "symfony/yaml": "^6.4|^7.0|^8.0" }, - "time": "2026-08-21T17:40:08+00:00", + "time": "2026-07-30T12:37:26+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -8164,7 +8167,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v7.4.17" + "source": "https://github.com/symfony/translation/tree/v7.4.16" }, "funding": [ { @@ -8273,17 +8276,17 @@ }, { "name": "symfony/var-dumper", - "version": "v7.4.18", - "version_normalized": "7.4.18.0", + "version": "v7.4.15", + "version_normalized": "7.4.15.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "e088da50b813f32473a76871616cbb8fa54653a8" + "reference": "04ba4add636a95ff437af3a5a9499bb1d6c6d4bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e088da50b813f32473a76871616cbb8fa54653a8", - "reference": "e088da50b813f32473a76871616cbb8fa54653a8", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/04ba4add636a95ff437af3a5a9499bb1d6c6d4bd", + "reference": "04ba4add636a95ff437af3a5a9499bb1d6c6d4bd", "shasum": "" }, "require": { @@ -8301,7 +8304,7 @@ "symfony/uid": "^6.4|^7.0|^8.0", "twig/twig": "^3.12|^4.0" }, - "time": "2026-08-30T20:10:52+00:00", + "time": "2026-07-21T15:13:06+00:00", "bin": [ "Resources/bin/var-dump-server" ], @@ -8339,7 +8342,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v7.4.18" + "source": "https://github.com/symfony/var-dumper/tree/v7.4.15" }, "funding": [ { @@ -8446,24 +8449,24 @@ }, { "name": "vlucas/phpdotenv", - "version": "v5.7.0", - "version_normalized": "5.7.0.0", + "version": "v5.6.4", + "version_normalized": "5.6.4.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "301c07936b16d88628b126b01d082ba153cf4c40" + "reference": "416df702837983f8d5ff48c9c3fee4f5f57b980b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/301c07936b16d88628b126b01d082ba153cf4c40", - "reference": "301c07936b16d88628b126b01d082ba153cf4c40", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/416df702837983f8d5ff48c9c3fee4f5f57b980b", + "reference": "416df702837983f8d5ff48c9c3fee4f5f57b980b", "shasum": "" }, "require": { "ext-pcre": "*", - "graham-campbell/result-type": "^1.2", + "graham-campbell/result-type": "^1.1.4", "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.10", + "phpoption/phpoption": "^1.9.5", "symfony/polyfill-ctype": "^1.26", "symfony/polyfill-mbstring": "^1.26", "symfony/polyfill-php80": "^1.26" @@ -8476,7 +8479,7 @@ "suggest": { "ext-filter": "Required to use the boolean validator." }, - "time": "2026-08-24T18:07:49+00:00", + "time": "2026-07-06T19:11:50+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -8509,7 +8512,7 @@ "homepage": "https://github.com/vlucas" } ], - "description": "Loads environment variables from `.env` to `$_ENV` and `$_SERVER` automagically, and optionally to `getenv()`.", + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", "keywords": [ "dotenv", "env", @@ -8517,7 +8520,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.7.0" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.4" }, "funding": [ { diff --git a/core/vendor/composer/installed.php b/core/vendor/composer/installed.php index 48d907d7f7..99d43e9208 100644 --- a/core/vendor/composer/installed.php +++ b/core/vendor/composer/installed.php @@ -1,8 +1,8 @@ array( 'name' => 'evolution-cms/evolution', - 'pretty_version' => '3.5.8', - 'version' => '3.5.8.0', + 'pretty_version' => '3.5.9', + 'version' => '3.5.9.0', 'reference' => null, 'type' => 'project', 'install_path' => __DIR__ . '/../../', @@ -29,18 +29,18 @@ 'dev_requirement' => false, ), 'carbonphp/carbon-doctrine-types' => array( - 'pretty_version' => '3.2.1', - 'version' => '3.2.1.0', - 'reference' => '5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc', + 'pretty_version' => '3.2.0', + 'version' => '3.2.0.0', + 'reference' => '18ba5ddfec8976260ead6e866180bd5d2f71aa1d', 'type' => 'library', 'install_path' => __DIR__ . '/../carbonphp/carbon-doctrine-types', 'aliases' => array(), 'dev_requirement' => false, ), 'composer/ca-bundle' => array( - 'pretty_version' => '1.5.14', - 'version' => '1.5.14.0', - 'reference' => '0c8abba0634f637bd78c4e451981da368d403463', + 'pretty_version' => '1.5.13', + 'version' => '1.5.13.0', + 'reference' => 'c008272789979f709f7fcb32c2ecf1d2db5e84e5', 'type' => 'library', 'install_path' => __DIR__ . '/./ca-bundle', 'aliases' => array(), @@ -173,8 +173,8 @@ 'dev_requirement' => false, ), 'evolution-cms/evolution' => array( - 'pretty_version' => '3.5.8', - 'version' => '3.5.8.0', + 'pretty_version' => '3.5.9', + 'version' => '3.5.9.0', 'reference' => null, 'type' => 'project', 'install_path' => __DIR__ . '/../../', @@ -209,53 +209,53 @@ 'dev_requirement' => false, ), 'graham-campbell/result-type' => array( - 'pretty_version' => 'v1.2.0', - 'version' => '1.2.0.0', - 'reference' => 'adccca3324eece92ca35463648c12b9e6293c05b', + 'pretty_version' => 'v1.1.4', + 'version' => '1.1.4.0', + 'reference' => 'e01f4a821471308ba86aa202fed6698b6b695e3b', 'type' => 'library', 'install_path' => __DIR__ . '/../graham-campbell/result-type', 'aliases' => array(), 'dev_requirement' => false, ), 'guzzlehttp/guzzle' => array( - 'pretty_version' => '7.15.5', - 'version' => '7.15.5.0', - 'reference' => 'ee80339fd9177ba44c49cdb653ff02a4d1106b9a', + 'pretty_version' => '7.15.3', + 'version' => '7.15.3.0', + 'reference' => 'ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', 'aliases' => array(), 'dev_requirement' => false, ), 'guzzlehttp/promises' => array( - 'pretty_version' => '2.5.3', - 'version' => '2.5.3.0', - 'reference' => 'cde49999552d185d64715fe9c1f77a2aadd2f9f1', + 'pretty_version' => '2.5.2', + 'version' => '2.5.2.0', + 'reference' => '2823687acff28b2dbe67b2508a6b300e2c3fa4ce', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/promises', 'aliases' => array(), 'dev_requirement' => false, ), 'guzzlehttp/psr7' => array( - 'pretty_version' => '2.13.1', - 'version' => '2.13.1.0', - 'reference' => '95e7828100de18b4e269fb1703be530082d5166d', + 'pretty_version' => '2.13.0', + 'version' => '2.13.0.0', + 'reference' => 'dad89620b7a6edb60c15858442eb2e408b45d8f4', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), 'dev_requirement' => false, ), 'guzzlehttp/uri-template' => array( - 'pretty_version' => 'v1.0.11', - 'version' => '1.0.11.0', - 'reference' => 'd0058dccf4299d70c3d9da3378b8908b32780368', + 'pretty_version' => 'v1.0.10', + 'version' => '1.0.10.0', + 'reference' => 'f6c24c21f42b990e9a58912b332d0874df6ba839', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/uri-template', 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/bus' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => '9e70f409c744e0ba6b301fa608bb5b3c8c38669a', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/bus', @@ -263,8 +263,8 @@ 'dev_requirement' => false, ), 'illuminate/cache' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => '2689356ab45bc53ffe796d1b1241babae59c69f6', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/cache', @@ -272,8 +272,8 @@ 'dev_requirement' => false, ), 'illuminate/collections' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => '83313b009c4afb6f02dbc090bdb67809756eefa2', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/collections', @@ -281,8 +281,8 @@ 'dev_requirement' => false, ), 'illuminate/conditionable' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => 'ec677967c1f2faf90b8428919124d2184a4c9b49', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/conditionable', @@ -290,8 +290,8 @@ 'dev_requirement' => false, ), 'illuminate/config' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => '7adbf5cc27081d4613e1fa2f4f53e2a4fc91ad53', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/config', @@ -299,17 +299,17 @@ 'dev_requirement' => false, ), 'illuminate/console' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', - 'reference' => '29f41bd7e07c14c04cb5acfaf9dc103adf2084aa', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', + 'reference' => 'ce37b63fb90f036dbd34263d84725f79c6d6f221', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/console', 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/container' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => '9abe9dba6b3f5220205ce143069c975a601e4294', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', @@ -317,8 +317,8 @@ 'dev_requirement' => false, ), 'illuminate/contracts' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => 'c16fd7ba7d8e6b8f336639ceb6b7e1ff6ed0efb5', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', @@ -326,17 +326,17 @@ 'dev_requirement' => false, ), 'illuminate/database' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', - 'reference' => '499f5112164d5bc4b744e0ac259b44e0a4c8aacc', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', + 'reference' => '6d539459fb55732a13e7f962afeffa9dca2a1cce', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/database', 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/events' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => 'ff22aa6017bdbd90ace660f50638ed9c580ba555', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/events', @@ -344,8 +344,8 @@ 'dev_requirement' => false, ), 'illuminate/filesystem' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => 'dc0b7440f12753060b574fa8c20c2db259fa37c9', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/filesystem', @@ -353,17 +353,17 @@ 'dev_requirement' => false, ), 'illuminate/http' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', - 'reference' => 'a91f70083082bd6d466ea229dbbdfc48c553621c', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', + 'reference' => '5f4f82ed0ed550a01f5d95c4ddbbad409fb0d560', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/http', 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/log' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => '0309c15e63d07c05218b622caa514f3ed6b226a6', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/log', @@ -371,8 +371,8 @@ 'dev_requirement' => false, ), 'illuminate/macroable' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => 'e295d62d89dcdb87e2b1bd70dd14d074a0ed73cc', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/macroable', @@ -380,8 +380,8 @@ 'dev_requirement' => false, ), 'illuminate/pagination' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => '8327d828676654053906a771abf5eea5426354ec', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/pagination', @@ -389,8 +389,8 @@ 'dev_requirement' => false, ), 'illuminate/pipeline' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => 'b6a14c20d69a44bf0a6fba664a00d23ca71770ee', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/pipeline', @@ -398,8 +398,8 @@ 'dev_requirement' => false, ), 'illuminate/queue' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => '64171cef7be5f3ac660484de502e48c566b6feca', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/queue', @@ -407,8 +407,8 @@ 'dev_requirement' => false, ), 'illuminate/redis' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => 'e46d4c3806d78d4d7733cd9b9bfb2fef30f4c8cb', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/redis', @@ -416,8 +416,8 @@ 'dev_requirement' => false, ), 'illuminate/reflection' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => '348cf5da9de89b596d7723be6425fb048e2bf4bb', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/reflection', @@ -425,8 +425,8 @@ 'dev_requirement' => false, ), 'illuminate/routing' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => '5d3cc9beca82c359f16e6c1d072903087e428ca1', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/routing', @@ -434,8 +434,8 @@ 'dev_requirement' => false, ), 'illuminate/session' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => '98802e67dd5e059c0b978b3fe8f5f0a3ac17ec4e', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/session', @@ -443,8 +443,8 @@ 'dev_requirement' => false, ), 'illuminate/support' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => '7d7a7d2dc5084aa4b1fd8b0a42094e1d3fb51e00', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/support', @@ -452,8 +452,8 @@ 'dev_requirement' => false, ), 'illuminate/translation' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => '4b555f3ca37523d1064d08e99774ab32fd0cc228', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/translation', @@ -461,8 +461,8 @@ 'dev_requirement' => false, ), 'illuminate/validation' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => 'ce2bb8d019e2510d1892b0c87f9086ea802c28e4', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/validation', @@ -470,8 +470,8 @@ 'dev_requirement' => false, ), 'illuminate/view' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.67.0', + 'version' => '12.67.0.0', 'reference' => '83bf8a22bb61145bcc1b8912103f6fb85078e35c', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/view', @@ -488,45 +488,45 @@ 'dev_requirement' => false, ), 'justinrainbow/json-schema' => array( - 'pretty_version' => '6.12.0', - 'version' => '6.12.0.0', - 'reference' => '8ef236a1a37df364b518b7411a4b5bb95b040d79', + 'pretty_version' => '6.10.0', + 'version' => '6.10.0.0', + 'reference' => '8b1308a9d7bdbdb20ce87ef920f82b4564bb2d33', 'type' => 'library', 'install_path' => __DIR__ . '/../justinrainbow/json-schema', 'aliases' => array(), 'dev_requirement' => false, ), 'laravel/prompts' => array( - 'pretty_version' => 'v0.3.24', - 'version' => '0.3.24.0', - 'reference' => '5d3cdef29e93ca3b62b1871359db3078cd99908b', + 'pretty_version' => 'v0.3.23', + 'version' => '0.3.23.0', + 'reference' => 'b7b4c35e5bc47450f6b6238c6cc9c47ba19b2221', 'type' => 'library', 'install_path' => __DIR__ . '/../laravel/prompts', 'aliases' => array(), 'dev_requirement' => false, ), 'laravel/serializable-closure' => array( - 'pretty_version' => 'v2.0.16', - 'version' => '2.0.16.0', - 'reference' => '7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed', + 'pretty_version' => 'v2.0.15', + 'version' => '2.0.15.0', + 'reference' => 'dccd8bcb851bb03fcc005df650b708b57cc52661', 'type' => 'library', 'install_path' => __DIR__ . '/../laravel/serializable-closure', 'aliases' => array(), 'dev_requirement' => false, ), 'league/flysystem' => array( - 'pretty_version' => '3.36.0', - 'version' => '3.36.0.0', - 'reference' => 'f7fb152932f30072d573510cbd4dd657d6475b25', + 'pretty_version' => '3.35.2', + 'version' => '3.35.2.0', + 'reference' => 'b277b5dc3d56650b68904117124e79c851e12376', 'type' => 'library', 'install_path' => __DIR__ . '/../league/flysystem', 'aliases' => array(), 'dev_requirement' => false, ), 'league/flysystem-local' => array( - 'pretty_version' => '3.35.3', - 'version' => '3.35.3.0', - 'reference' => 'a099b24dce160f3b2239043d13d47c4a1a214ea4', + 'pretty_version' => '3.31.0', + 'version' => '3.31.0.0', + 'reference' => '2f669db18a4c20c755c2bb7d3a7b0b2340488079', 'type' => 'library', 'install_path' => __DIR__ . '/../league/flysystem-local', 'aliases' => array(), @@ -551,9 +551,9 @@ 'dev_requirement' => false, ), 'monolog/monolog' => array( - 'pretty_version' => '3.12.0', - 'version' => '3.12.0.0', - 'reference' => '72c534fc0ab181ef52d92a68382318631e301608', + 'pretty_version' => '3.10.0', + 'version' => '3.10.0.0', + 'reference' => 'b321dd6749f0bf7189444158a3ce785cc16d69b0', 'type' => 'library', 'install_path' => __DIR__ . '/../monolog/monolog', 'aliases' => array(), @@ -593,9 +593,9 @@ 'dev_requirement' => false, ), 'phpoption/phpoption' => array( - 'pretty_version' => '1.10.0', - 'version' => '1.10.0.0', - 'reference' => '67b192b6a42ec03944b972d6e633ddec78ad2c6d', + 'pretty_version' => '1.9.5', + 'version' => '1.9.5.0', + 'reference' => '75365b91986c2405cf5e1e012c5595cd487a98be', 'type' => 'library', 'install_path' => __DIR__ . '/../phpoption/phpoption', 'aliases' => array(), @@ -897,9 +897,9 @@ 'dev_requirement' => false, ), 'symfony/console' => array( - 'pretty_version' => 'v7.4.18', - 'version' => '7.4.18.0', - 'reference' => '23d6f88a29f6d0eac45bd77d70307adf83ba7ab0', + 'pretty_version' => 'v7.4.16', + 'version' => '7.4.16.0', + 'reference' => 'f4c69c9aed03abf933b294257d618bdd9b30a06d', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), @@ -915,18 +915,18 @@ 'dev_requirement' => false, ), 'symfony/error-handler' => array( - 'pretty_version' => 'v7.4.17', - 'version' => '7.4.17.0', - 'reference' => '8373921e231e190a88e2ad526951bbaa791576fa', + 'pretty_version' => 'v7.4.15', + 'version' => '7.4.15.0', + 'reference' => 'd49f6a19f326db41ae7103bdc38e3eb35a791261', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/error-handler', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/event-dispatcher' => array( - 'pretty_version' => 'v7.4.17', - 'version' => '7.4.17.0', - 'reference' => 'd269974ee93c61d03620ffee358355bfdb471d66', + 'pretty_version' => 'v7.4.15', + 'version' => '7.4.15.0', + 'reference' => '336e7f3b9e95aba04f93ea9143920c2186abfbb9', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/event-dispatcher', 'aliases' => array(), @@ -948,45 +948,45 @@ ), ), 'symfony/filesystem' => array( - 'pretty_version' => 'v7.4.18', - 'version' => '7.4.18.0', - 'reference' => '90d412aa5277c6819db39e7605aa46b1019e3232', + 'pretty_version' => 'v7.4.15', + 'version' => '7.4.15.0', + 'reference' => 'ff16a16bf87fdf264638b8f6995b3515975e3c79', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/finder' => array( - 'pretty_version' => 'v7.4.17', - 'version' => '7.4.17.0', - 'reference' => '5ce28827081f6d1f0c32eaf3882750f19cb5bbe6', + 'pretty_version' => 'v7.4.14', + 'version' => '7.4.14.0', + 'reference' => '13b38720174286f55d1761152b575a8d1436fc25', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/http-foundation' => array( - 'pretty_version' => 'v7.4.18', - 'version' => '7.4.18.0', - 'reference' => 'd070b716a32fbe3bf04204db0f58ace73b86d133', + 'pretty_version' => 'v7.4.16', + 'version' => '7.4.16.0', + 'reference' => 'b676451bb638e99a7d34d8a2be90406822e301eb', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-foundation', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/http-kernel' => array( - 'pretty_version' => 'v7.4.18', - 'version' => '7.4.18.0', - 'reference' => '275d2d2d24530f2a0eaf17704a3a93860a036351', + 'pretty_version' => 'v7.4.16', + 'version' => '7.4.16.0', + 'reference' => 'f5e728670fa2218ae8be8ea91f2b44b7d6e5304c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-kernel', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/mime' => array( - 'pretty_version' => 'v7.4.18', - 'version' => '7.4.18.0', - 'reference' => 'bf328d82105831db3e409195db0540ff57f27c80', + 'pretty_version' => 'v7.4.16', + 'version' => '7.4.16.0', + 'reference' => '20094b76a7106dbe978d31cd3bd7aa1ed248d0e5', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/mime', 'aliases' => array(), @@ -1011,18 +1011,18 @@ 'dev_requirement' => false, ), 'symfony/polyfill-intl-idn' => array( - 'pretty_version' => 'v1.42.0', - 'version' => '1.42.0.0', - 'reference' => '51b5ff5ba85452b31ec6f55490b08148612339d9', + 'pretty_version' => 'v1.38.1', + 'version' => '1.38.1.0', + 'reference' => 'dc21118016c039a66235cf93d96b435ffb282412', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.42.0', - 'version' => '1.42.0.0', - 'reference' => 'aa20edea75bd9c48cfecc8360922e5a6e5c44502', + 'pretty_version' => 'v1.38.0', + 'version' => '1.38.0.0', + 'reference' => '2d446c214bdbe5b71bde5011b060a05fece3ae6b', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), @@ -1086,27 +1086,27 @@ 'dev_requirement' => false, ), 'symfony/process' => array( - 'pretty_version' => 'v7.4.18', - 'version' => '7.4.18.0', - 'reference' => '058d17fc284cce14efb2385783b55014a461b176', + 'pretty_version' => 'v7.4.13', + 'version' => '7.4.13.0', + 'reference' => 'f5804be144caceb570f6747519999636b664f24c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/routing' => array( - 'pretty_version' => 'v7.4.18', - 'version' => '7.4.18.0', - 'reference' => 'ddd558991e98f693ae6bf5063cc1b0362c6bbec3', + 'pretty_version' => 'v7.4.15', + 'version' => '7.4.15.0', + 'reference' => '80c0a93d3f8e7499f716204a1fb38ead942a7a2b', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/routing', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/service-contracts' => array( - 'pretty_version' => 'v3.7.3', - 'version' => '3.7.3.0', - 'reference' => '15e6a07ec2a2c75ceb1b21dd98105ee8456d2257', + 'pretty_version' => 'v3.7.1', + 'version' => '3.7.1.0', + 'reference' => 'c0a284bab1ed8aa0417e3d69250ab437739563a0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), @@ -1122,9 +1122,9 @@ 'dev_requirement' => false, ), 'symfony/translation' => array( - 'pretty_version' => 'v7.4.17', - 'version' => '7.4.17.0', - 'reference' => '2ee1e4a3b32a528a642babe041ff7c440b213b4b', + 'pretty_version' => 'v7.4.16', + 'version' => '7.4.16.0', + 'reference' => '501e0ff4553c744209ca1a68790d8a4541563710', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation', 'aliases' => array(), @@ -1146,9 +1146,9 @@ ), ), 'symfony/var-dumper' => array( - 'pretty_version' => 'v7.4.18', - 'version' => '7.4.18.0', - 'reference' => 'e088da50b813f32473a76871616cbb8fa54653a8', + 'pretty_version' => 'v7.4.15', + 'version' => '7.4.15.0', + 'reference' => '04ba4add636a95ff437af3a5a9499bb1d6c6d4bd', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/var-dumper', 'aliases' => array(), @@ -1164,9 +1164,9 @@ 'dev_requirement' => false, ), 'vlucas/phpdotenv' => array( - 'pretty_version' => 'v5.7.0', - 'version' => '5.7.0.0', - 'reference' => '301c07936b16d88628b126b01d082ba153cf4c40', + 'pretty_version' => 'v5.6.4', + 'version' => '5.6.4.0', + 'reference' => '416df702837983f8d5ff48c9c3fee4f5f57b980b', 'type' => 'library', 'install_path' => __DIR__ . '/../vlucas/phpdotenv', 'aliases' => array(), diff --git a/core/vendor/graham-campbell/result-type/LICENSE b/core/vendor/graham-campbell/result-type/LICENSE index b5d7de7b21..8e7c898886 100644 --- a/core/vendor/graham-campbell/result-type/LICENSE +++ b/core/vendor/graham-campbell/result-type/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020-2026 Graham Campbell +Copyright (c) 2020-2024 Graham Campbell Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/core/vendor/graham-campbell/result-type/composer.json b/core/vendor/graham-campbell/result-type/composer.json index ff9924048e..441412f62c 100644 --- a/core/vendor/graham-campbell/result-type/composer.json +++ b/core/vendor/graham-campbell/result-type/composer.json @@ -12,10 +12,10 @@ ], "require": { "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.10" + "phpoption/phpoption": "^1.9.5" }, "require-dev": { - "phpunit/phpunit": "^8.5.52 || ^9.6.34 || ^10.5.63 || ^11.5.55 || ^12.5.14" + "phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7" }, "autoload": { "psr-4": { diff --git a/core/vendor/graham-campbell/result-type/src/Error.php b/core/vendor/graham-campbell/result-type/src/Error.php index 1a547e206c..2c37c3e2b7 100644 --- a/core/vendor/graham-campbell/result-type/src/Error.php +++ b/core/vendor/graham-campbell/result-type/src/Error.php @@ -17,9 +17,10 @@ use PhpOption\Some; /** - * @template-covariant E + * @template T + * @template E * - * @extends \GrahamCampbell\ResultType\Result + * @extends \GrahamCampbell\ResultType\Result */ final class Error extends Result { @@ -47,7 +48,7 @@ private function __construct($value) * * @param F $value * - * @return \GrahamCampbell\ResultType\Error + * @return \GrahamCampbell\ResultType\Result */ public static function create($value) { @@ -57,7 +58,7 @@ public static function create($value) /** * Get the success option value. * - * @return \PhpOption\Option + * @return \PhpOption\Option */ public function success() { @@ -69,9 +70,9 @@ public function success() * * @template S * - * @param callable(never):S $f + * @param callable(T):S $f * - * @return \GrahamCampbell\ResultType\Error + * @return \GrahamCampbell\ResultType\Result */ public function map(callable $f) { @@ -84,12 +85,13 @@ public function map(callable $f) * @template S * @template F * - * @param callable(never):\GrahamCampbell\ResultType\Result $f + * @param callable(T):\GrahamCampbell\ResultType\Result $f * - * @return \GrahamCampbell\ResultType\Error + * @return \GrahamCampbell\ResultType\Result */ public function flatMap(callable $f) { + /** @var \GrahamCampbell\ResultType\Result */ return self::create($this->value); } @@ -110,7 +112,7 @@ public function error() * * @param callable(E):F $f * - * @return \GrahamCampbell\ResultType\Error + * @return \GrahamCampbell\ResultType\Result */ public function mapError(callable $f) { diff --git a/core/vendor/graham-campbell/result-type/src/Result.php b/core/vendor/graham-campbell/result-type/src/Result.php index 85450676dc..8c67bcdd1c 100644 --- a/core/vendor/graham-campbell/result-type/src/Result.php +++ b/core/vendor/graham-campbell/result-type/src/Result.php @@ -14,8 +14,8 @@ namespace GrahamCampbell\ResultType; /** - * @template-covariant T - * @template-covariant E + * @template T + * @template E */ abstract class Result { @@ -45,7 +45,7 @@ abstract public function map(callable $f); * * @param callable(T):\GrahamCampbell\ResultType\Result $f * - * @return \GrahamCampbell\ResultType\Result + * @return \GrahamCampbell\ResultType\Result */ abstract public function flatMap(callable $f); diff --git a/core/vendor/graham-campbell/result-type/src/Success.php b/core/vendor/graham-campbell/result-type/src/Success.php index 4dfb7d2fd9..27cd85eecb 100644 --- a/core/vendor/graham-campbell/result-type/src/Success.php +++ b/core/vendor/graham-campbell/result-type/src/Success.php @@ -17,9 +17,10 @@ use PhpOption\Some; /** - * @template-covariant T + * @template T + * @template E * - * @extends \GrahamCampbell\ResultType\Result + * @extends \GrahamCampbell\ResultType\Result */ final class Success extends Result { @@ -41,13 +42,13 @@ private function __construct($value) } /** - * Create a new success value. + * Create a new error value. * * @template S * * @param S $value * - * @return \GrahamCampbell\ResultType\Success + * @return \GrahamCampbell\ResultType\Result */ public static function create($value) { @@ -71,7 +72,7 @@ public function success() * * @param callable(T):S $f * - * @return \GrahamCampbell\ResultType\Success + * @return \GrahamCampbell\ResultType\Result */ public function map(callable $f) { @@ -96,7 +97,7 @@ public function flatMap(callable $f) /** * Get the error option value. * - * @return \PhpOption\Option + * @return \PhpOption\Option */ public function error() { @@ -108,9 +109,9 @@ public function error() * * @template F * - * @param callable(never):F $f + * @param callable(E):F $f * - * @return \GrahamCampbell\ResultType\Success + * @return \GrahamCampbell\ResultType\Result */ public function mapError(callable $f) { diff --git a/core/vendor/guzzlehttp/guzzle/CHANGELOG.md b/core/vendor/guzzlehttp/guzzle/CHANGELOG.md index 0deee721c3..efea7bde6a 100644 --- a/core/vendor/guzzlehttp/guzzle/CHANGELOG.md +++ b/core/vendor/guzzlehttp/guzzle/CHANGELOG.md @@ -3,23 +3,6 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version. -## 7.15.5 - 2026-08-24 - -### Changed - -- Adjusted `guzzlehttp/psr7` version constraint to `^2.13.1` -- Adjusted `guzzlehttp/promises` version constraint to `^2.5.3` - -## 7.15.4 - 2026-08-24 - -### Added - -- Added support for PHP 8.6 - -### Changed - -- Replace the deprecated spl_object_hash() in handler stack debug output for PHP 8.6 - ## 7.15.3 - 2026-08-05 ### Changed diff --git a/core/vendor/guzzlehttp/guzzle/README.md b/core/vendor/guzzlehttp/guzzle/README.md index 5ac97ef215..a7af068c6e 100644 --- a/core/vendor/guzzlehttp/guzzle/README.md +++ b/core/vendor/guzzlehttp/guzzle/README.md @@ -66,7 +66,7 @@ composer require guzzlehttp/guzzle | 4.x | EOL (2016-10-31) | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >=5.4,<7.0 | | 5.x | EOL (2019-10-31) | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >=5.4,<7.4 | | 6.x | EOL (2023-10-31) | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >=5.5,<8.0 | -| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.7 | +| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.6 | [guzzle-3-repo]: https://github.com/guzzle/guzzle3 [guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x diff --git a/core/vendor/guzzlehttp/guzzle/composer.json b/core/vendor/guzzlehttp/guzzle/composer.json index f2d21bcb6e..8850d1b5bd 100644 --- a/core/vendor/guzzlehttp/guzzle/composer.json +++ b/core/vendor/guzzlehttp/guzzle/composer.json @@ -53,8 +53,8 @@ "require": { "php": "^7.2.5 || ^8.0", "ext-json": "*", - "guzzlehttp/promises": "^2.5.3", - "guzzlehttp/psr7": "^2.13.1", + "guzzlehttp/promises": "^2.5.2", + "guzzlehttp/psr7": "^2.13", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.5 || ^3.0", "symfony/polyfill-php80": "^1.25" diff --git a/core/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/core/vendor/guzzlehttp/guzzle/src/HandlerStack.php index 2f11b020b5..2e0cac0977 100644 --- a/core/vendor/guzzlehttp/guzzle/src/HandlerStack.php +++ b/core/vendor/guzzlehttp/guzzle/src/HandlerStack.php @@ -284,6 +284,6 @@ private function debugCallable($fn): string } /** @var object $fn */ - return 'callable('.\spl_object_id($fn).')'; + return 'callable('.\spl_object_hash($fn).')'; } } diff --git a/core/vendor/guzzlehttp/promises/CHANGELOG.md b/core/vendor/guzzlehttp/promises/CHANGELOG.md index 2d10fb9d22..7e4c822a4b 100644 --- a/core/vendor/guzzlehttp/promises/CHANGELOG.md +++ b/core/vendor/guzzlehttp/promises/CHANGELOG.md @@ -1,13 +1,6 @@ # CHANGELOG -## 2.5.3 - 2026-08-24 - -### Added - -- Added support for PHP 8.6 - - ## 2.5.2 - 2026-08-05 ### Fixed diff --git a/core/vendor/guzzlehttp/promises/README.md b/core/vendor/guzzlehttp/promises/README.md index fccc68fb96..66d83abb5f 100644 --- a/core/vendor/guzzlehttp/promises/README.md +++ b/core/vendor/guzzlehttp/promises/README.md @@ -41,7 +41,7 @@ composer require guzzlehttp/promises | Version | Status | PHP Version | |---------|---------------------|--------------| | 1.x | Security fixes only | >=5.5,<8.3 | -| 2.x | Latest | >=7.2.5,<8.7 | +| 2.x | Latest | >=7.2.5,<8.6 | ## Quick Start diff --git a/core/vendor/guzzlehttp/psr7/CHANGELOG.md b/core/vendor/guzzlehttp/psr7/CHANGELOG.md index dbe29117cc..3d678f4e9b 100644 --- a/core/vendor/guzzlehttp/psr7/CHANGELOG.md +++ b/core/vendor/guzzlehttp/psr7/CHANGELOG.md @@ -5,16 +5,6 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 2.13.1 - 2026-08-24 - -### Added - -- Add support for PHP 8.6 - -### Fixed - -- Prefix relative paths that begin with a colon segment with `./` instead of throwing - ## 2.13.0 - 2026-07-16 ### Added diff --git a/core/vendor/guzzlehttp/psr7/README.md b/core/vendor/guzzlehttp/psr7/README.md index 80d0566ce0..13f2ba5ee6 100644 --- a/core/vendor/guzzlehttp/psr7/README.md +++ b/core/vendor/guzzlehttp/psr7/README.md @@ -25,7 +25,7 @@ composer require guzzlehttp/psr7 | Version | Status | PHP Version | |---------|---------------------|--------------| | 1.x | EOL (2024-06-30) | >=5.4,<8.2 | -| 2.x | Latest | >=7.2.5,<8.7 | +| 2.x | Latest | >=7.2.5,<8.6 | See [UPGRADING.md](UPGRADING.md) for notes on upgrading from 1.x to 2.0. @@ -800,10 +800,6 @@ browsers do when resolving a link in a website based on the current request URI. Converts the relative URI into a new URI that is resolved against the base URI. -When the resolved path is a relative-path reference whose first segment contains a colon, which would be mistaken for a -scheme name ([RFC 3986 Section 4.2](https://datatracker.ietf.org/doc/html/rfc3986#section-4.2)), it is prefixed with -`./`, e.g. `./a:b`. - ### `GuzzleHttp\Psr7\UriResolver::removeDotSegments` `public static function removeDotSegments(string $path): string` @@ -843,14 +839,7 @@ echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // pr Returns a normalized URI. The scheme and host component are already normalized to lowercase per PSR-7 UriInterface. This methods adds additional normalizations that can be configured with the `$flags` parameter which is a bitmask -of normalizations to apply. - -When a normalization rewrites the path of a relative-path reference so that its first segment contains a colon, which -would be mistaken for a scheme name ([RFC 3986 Section 4.2](https://datatracker.ietf.org/doc/html/rfc3986#section-4.2)), -the path is prefixed with `./` instead of throwing, e.g. `a%41:` becomes `./aA:` as `aA:` would be an absolute URI -with the scheme `aa`. - -The following normalizations are available: +of normalizations to apply. The following normalizations are available: - `UriNormalizer::PRESERVING_NORMALIZATIONS` diff --git a/core/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/core/vendor/guzzlehttp/psr7/src/UriNormalizer.php index d6342b65fc..e5468b8674 100644 --- a/core/vendor/guzzlehttp/psr7/src/UriNormalizer.php +++ b/core/vendor/guzzlehttp/psr7/src/UriNormalizer.php @@ -116,11 +116,6 @@ final class UriNormalizer * treated equivalent which is not necessarily true according to RFC 3986. But that difference * is highly uncommon in reality. So this potential normalization is implied in PSR-7 as well. * - * When a normalization rewrites the path of a relative-path reference so that its first - * segment contains a colon, which would be mistaken for a scheme name (RFC 3986 Section 4.2), - * the path is prefixed with "./" instead of throwing, e.g. "a%41:" becomes "./aA:" as "aA:" - * would be an absolute URI with the scheme "aa". - * * @param UriInterface $uri The URI to normalize * @param int $flags A bitmask of normalizations to apply, see constants * @@ -161,7 +156,7 @@ public static function normalize(UriInterface $uri, int $flags = self::PRESERVIN throw new \RuntimeException('Unable to remove duplicate slashes from URI path: '.preg_last_error_msg()); } - $uri = self::withGuardedPath($uri, $path); + $uri = $uri->withPath($path); } if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') { @@ -200,7 +195,8 @@ private static function capitalizePercentEncoding(UriInterface $uri): UriInterfa return Utils::asciiToUpper($match[0]); }; - return self::withGuardedPath($uri, self::normalizePercentEncodingInComponent($uri->getPath(), $regex, $callback)) + return $uri + ->withPath(self::normalizePercentEncodingInComponent($uri->getPath(), $regex, $callback)) ->withQuery(self::normalizePercentEncodingInComponent($uri->getQuery(), $regex, $callback)) ->withFragment(self::normalizePercentEncodingInComponent($uri->getFragment(), $regex, $callback)); } @@ -213,23 +209,12 @@ private static function decodeUnreservedCharacters(UriInterface $uri): UriInterf return rawurldecode($match[0]); }; - return self::withGuardedPath($uri, self::normalizePercentEncodingInComponent($uri->getPath(), $regex, $callback)) + return $uri + ->withPath(self::normalizePercentEncodingInComponent($uri->getPath(), $regex, $callback)) ->withQuery(self::normalizePercentEncodingInComponent($uri->getQuery(), $regex, $callback)) ->withFragment(self::normalizePercentEncodingInComponent($uri->getFragment(), $regex, $callback)); } - /** - * Writes the given path only when it differs from the current one, guarded so the write cannot throw. - */ - private static function withGuardedPath(UriInterface $uri, string $path): UriInterface - { - if ($path === $uri->getPath()) { - return $uri; - } - - return $uri->withPath(UriResolver::guardedPath($uri, $path)); - } - /** * @param callable(array): string $callback */ diff --git a/core/vendor/guzzlehttp/psr7/src/UriResolver.php b/core/vendor/guzzlehttp/psr7/src/UriResolver.php index 5a6ac5e30b..80b4b2058a 100644 --- a/core/vendor/guzzlehttp/psr7/src/UriResolver.php +++ b/core/vendor/guzzlehttp/psr7/src/UriResolver.php @@ -50,36 +50,10 @@ public static function removeDotSegments(string $path): string return $newPath; } - /** - * Returns the path, prefixed with "./" when it would otherwise begin a relative-path reference with a segment - * containing a colon. - * - * Such a segment would be mistaken for a scheme name (RFC 3986 Section 4.2), so a URI without a scheme and - * authority cannot hold the path, but reference resolution and percent-encoding normalization can produce one. - * The "./" prefix the RFC prescribes resolves back to the same path. - * - * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2 - * - * @internal - */ - public static function guardedPath(UriInterface $uri, string $path): string - { - if ($uri->getScheme() !== '' || $uri->getAuthority() !== '' || strpos(explode('/', $path, 2)[0], ':') === false) { - return $path; - } - - return './'.$path; - } - /** * Converts the relative URI into a new URI that is resolved against the base URI. * - * When the resolved path is a relative-path reference whose first segment contains a colon, - * which would be mistaken for a scheme name (RFC 3986 Section 4.2), it is prefixed with "./", - * e.g. "./a:b". - * * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2 - * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2 */ public static function resolve(UriInterface $base, UriInterface $rel): UriInterface { @@ -120,10 +94,6 @@ public static function resolve(UriInterface $base, UriInterface $rel): UriInterf $targetQuery = $rel->getQuery(); } - if ($targetPath !== $base->getPath()) { - $targetPath = self::guardedPath($base, $targetPath); - } - return $base ->withPath($targetPath) ->withQuery($targetQuery) diff --git a/core/vendor/guzzlehttp/uri-template/CHANGELOG.md b/core/vendor/guzzlehttp/uri-template/CHANGELOG.md index 669a091230..6b2a9d0ade 100644 --- a/core/vendor/guzzlehttp/uri-template/CHANGELOG.md +++ b/core/vendor/guzzlehttp/uri-template/CHANGELOG.md @@ -4,12 +4,6 @@ All notable changes to `uri-template` will be documented in this file. Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. -## v1.0.11 - 2026-08-24 - -### Added - -- Added support for PHP 8.6 - ## v1.0.10 - 2026-07-17 ### Fixed diff --git a/core/vendor/illuminate/console/Concerns/InteractsWithIO.php b/core/vendor/illuminate/console/Concerns/InteractsWithIO.php index 212f9aaf14..db3db629aa 100644 --- a/core/vendor/illuminate/console/Concerns/InteractsWithIO.php +++ b/core/vendor/illuminate/console/Concerns/InteractsWithIO.php @@ -169,7 +169,7 @@ public function anticipate($question, $choices, $default = null) * Prompt the user for input with auto completion. * * @param string $question - * @param iterable|(callable(string): list) $choices + * @param iterable|(callable(string): string[]) $choices * @param string|null $default * @return mixed */ diff --git a/core/vendor/illuminate/database/Connection.php b/core/vendor/illuminate/database/Connection.php index d409f1cef6..cfab16cbca 100644 --- a/core/vendor/illuminate/database/Connection.php +++ b/core/vendor/illuminate/database/Connection.php @@ -697,7 +697,7 @@ public function withoutPretending(Closure $callback) /** * Execute the given callback in "dry run" mode. * - * @param (\Closure(): (array{query: string, bindings: array, time: float|null}[])) $callback + * @param (\Closure(): array{query: string, bindings: array, time: float|null}[]) $callback * @return array{query: string, bindings: array, time: float|null}[] */ protected function withFreshQueryLog($callback) diff --git a/core/vendor/illuminate/http/Resources/JsonApi/Concerns/ResolvesJsonApiElements.php b/core/vendor/illuminate/http/Resources/JsonApi/Concerns/ResolvesJsonApiElements.php index 0955e2d465..deaddf9964 100644 --- a/core/vendor/illuminate/http/Resources/JsonApi/Concerns/ResolvesJsonApiElements.php +++ b/core/vendor/illuminate/http/Resources/JsonApi/Concerns/ResolvesJsonApiElements.php @@ -34,13 +34,6 @@ trait ResolvesJsonApiElements */ protected bool $includesPreviouslyLoadedRelationships = false; - /** - * The relationships requested relative to this included resource. - * - * @var array|null - */ - protected ?array $requestedRelationships = null; - /** * Cached loaded relationships map. * @@ -196,7 +189,10 @@ protected function compileResourceRelationships(JsonApiRequest $request): void return; } - $sparseIncluded = $this->requestedResourceRelationships($request); + $sparseIncluded = match (true) { + $this->includesPreviouslyLoadedRelationships => array_keys($this->resource->getRelations()), + default => $request->sparseIncluded(), + }; $resourceRelationships = (new Collection($this->toRelationships($request))) ->transform(fn ($value, $key) => is_int($key) ? new RelationResolver($value) : new RelationResolver($key, $value)) @@ -212,6 +208,13 @@ protected function compileResourceRelationships(JsonApiRequest $request): void $this->loadedRelationshipIdentifiers = (new LazyCollection(function () use ($request, $resourceRelationships) { foreach ($resourceRelationships as $relationName => $relationResolver) { $relatedModels = $relationResolver->handle($this->resource); + $relatedResourceClass = $relationResolver->resourceClass(); + + if (! is_null($relatedModels) && $this->includesPreviouslyLoadedRelationships === false) { + if (! empty($relations = $request->sparseIncluded($relationName))) { + $relatedModels->loadMissing($relations); + } + } yield from $this->compileResourceRelationshipUsingResolver( $request, @@ -234,7 +237,6 @@ protected function compileResourceRelationshipUsingResolver( ): Generator { $relationName = $relationResolver->relationName; $resourceClass = $relationResolver->resourceClass(); - $requestedRelationships = $this->requestedResourceRelationships($request, $relationName); // Relationship is a collection of models... if ($relatedModels instanceof Collection) { @@ -250,20 +252,16 @@ protected function compileResourceRelationshipUsingResolver( $isUnique = ! $relationship instanceof BelongsToMany; - yield $relationName => ['data' => $relatedModels->map(function ($relatedModel) use ($request, $resourceClass, $isUnique, $requestedRelationships) { + yield $relationName => ['data' => $relatedModels->map(function ($relatedModel) use ($request, $resourceClass, $isUnique) { $relatedResource = rescue(fn () => $relatedModel->toResource($resourceClass), new JsonApiResource($relatedModel)); - $relatedResource->requestedRelationships = $requestedRelationships; - - if (! empty($requestedRelationships)) { - $relatedResource->includePreviouslyLoadedRelationships()->compileResourceRelationships($request); - } - return transform( [$relatedResource->resolveResourceType($request), $relatedResource->resolveResourceIdentifier($request)], - function ($uniqueKey) use ($relatedResource, $isUnique) { + function ($uniqueKey) use ($request, $relatedModel, $relatedResource, $isUnique) { $this->loadedRelationshipsMap[] = [$relatedResource, ...$uniqueKey, $isUnique]; + $this->compileIncludedNestedRelationshipsMap($request, $relatedModel, $relatedResource); + return [ 'id' => $uniqueKey[1], 'type' => $uniqueKey[0], @@ -291,17 +289,13 @@ function ($uniqueKey) use ($relatedResource, $isUnique) { $relatedResource = rescue(fn () => $relatedModel->toResource($resourceClass), new JsonApiResource($relatedModel)); - $relatedResource->requestedRelationships = $requestedRelationships; - - if (! empty($requestedRelationships)) { - $relatedResource->includePreviouslyLoadedRelationships()->compileResourceRelationships($request); - } - yield $relationName => ['data' => transform( [$relatedResource->resolveResourceType($request), $relatedResource->resolveResourceIdentifier($request)], - function ($uniqueKey) use ($relatedResource) { + function ($uniqueKey) use ($relatedModel, $relatedResource, $request) { $this->loadedRelationshipsMap[] = [$relatedResource, ...$uniqueKey, true]; + $this->compileIncludedNestedRelationshipsMap($request, $relatedModel, $relatedResource); + return [ 'id' => $uniqueKey[1], 'type' => $uniqueKey[0], @@ -311,34 +305,17 @@ function ($uniqueKey) use ($relatedResource) { } /** - * Get the requested relationships for this resource or one of its relationships. + * Compile included relationships map. */ - protected function requestedResourceRelationships(JsonApiRequest $request, ?string $relationName = null): array + protected function compileIncludedNestedRelationshipsMap(JsonApiRequest $request, Model $relation, JsonApiResource $resource): void { - if (is_null($this->requestedRelationships)) { - if ($this->includesPreviouslyLoadedRelationships) { - return is_null($relationName) ? array_keys($this->resource->getRelations()) : []; - } - - return $request->sparseIncluded($relationName) ?? []; - } - - if (is_null($relationName)) { - $requested = (new Collection($this->requestedRelationships)) - ->map(fn ($relationship) => explode('.', $relationship, 2)[0]); - - if ($this->includesPreviouslyLoadedRelationships) { - $requested->push(...array_keys($this->resource->getRelations())); - } - - return $requested->unique()->values()->all(); - } - - return (new Collection($this->requestedRelationships)) - ->filter(fn ($relationship) => str_starts_with($relationship, $relationName.'.')) - ->map(fn ($relationship) => substr($relationship, strlen($relationName) + 1)) - ->values() - ->all(); + (new Collection($resource->toRelationships($request))) + ->transform(fn ($value, $key) => is_int($key) ? new RelationResolver($value) : new RelationResolver($key, $value)) + ->mapWithKeys(fn ($relationResolver) => [$relationResolver->relationName => $relationResolver]) + ->filter(fn ($value, $key) => in_array($key, array_keys($relation->getRelations()))) + ->each(function ($relationResolver, $key) use ($relation, $request) { + $this->compileResourceRelationshipUsingResolver($request, $relation, $relationResolver, $relation->getRelation($key)); + }); } /** diff --git a/core/vendor/justinrainbow/json-schema/CHANGELOG.md b/core/vendor/justinrainbow/json-schema/CHANGELOG.md index 58b8b6340a..e3a57c0cb8 100644 --- a/core/vendor/justinrainbow/json-schema/CHANGELOG.md +++ b/core/vendor/justinrainbow/json-schema/CHANGELOG.md @@ -7,38 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [6.12.0] - 2026-09-04 - -### Fixed -- Report additional property errors at the property path ([#942](https://github.com/jsonrainbow/json-schema/pull/942)) -- Fix RFC 3339 date-time validation with high-precision fractional seconds ([#940](https://github.com/jsonrainbow/json-schema/pull/940)) - -### Added -- Define minimal permissions on every workflow ([#941](https://github.com/jsonrainbow/json-schema/pull/941)) -- feat: Add --allow-invalid-content-type-endpoint option to validate-json ([#932](https://github.com/jsonrainbow/json-schema/pull/932)) - - -### Changed -- fix: Avoid restricted stargazers endpoint in Welcome workflow and avoid running for bot user types ([#946](https://github.com/jsonrainbow/json-schema/pull/946)) -- fix: Correct changelog and changelog updates ([#945](https://github.com/jsonrainbow/json-schema/pull/945)) - - -## [6.11.0] - 2026-08-21 - -### Fixed -- fix: Handle null byte when validating date/time formats ([#939](https://github.com/jsonrainbow/json-schema/pull/939)) -- fix: Correct php-cs-fixer setup ([#938](https://github.com/jsonrainbow/json-schema/pull/938)) -- fix: Ignore Content-Type header parameters when checking media type ([#934](https://github.com/jsonrainbow/json-schema/pull/934)) -- fix: Dont use mb_detect_encoding for mb_string function calls ([#924](https://github.com/jsonrainbow/json-schema/pull/924)) -- Add missing ext-filter dependency ([#922](https://github.com/jsonrainbow/json-schema/pull/922)) - -### Changed -- Update README with Draft 7 badge correction and include JetBrains logo ([#921](https://github.com/jsonrainbow/json-schema/pull/921)) - -### Added -- Update composer.json authors to reflect current active maintainer ([#928](https://github.com/jsonrainbow/json-schema/pull/928)) - - ## [6.10.0] - 2026-06-16 ### Added diff --git a/core/vendor/justinrainbow/json-schema/README.md b/core/vendor/justinrainbow/json-schema/README.md index 88294bcab2..02a86f94ea 100644 --- a/core/vendor/justinrainbow/json-schema/README.md +++ b/core/vendor/justinrainbow/json-schema/README.md @@ -15,7 +15,7 @@ of all existing Drafts. See [json-schema](http://json-schema.org/) for more deta ![Draft 3](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft3.json) ![Draft 4](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft4.json) ![Draft 6](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft6.json) -![Draft 7](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft7.json) +![Draft 7](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft7.json))) ![Draft 2019-09](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fdraft2019-09.json) @@ -234,7 +234,3 @@ Thanks go to these wonderful people, without their effort this project wasn't po - -# Powered by - -[![JetBrains logo.](https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.svg)](https://jb.gg/OpenSource) diff --git a/core/vendor/justinrainbow/json-schema/bin/validate-json b/core/vendor/justinrainbow/json-schema/bin/validate-json index ff21c1be23..83f0e2a867 100644 --- a/core/vendor/justinrainbow/json-schema/bin/validate-json +++ b/core/vendor/justinrainbow/json-schema/bin/validate-json @@ -23,39 +23,7 @@ require($composerAutoload); $arOptions = []; $arArgs = []; array_shift($argv);//script itself - -// options that take a value; each may be repeated -$multiValueOptions = [ - '--allow-invalid-content-type-endpoint', -]; - -$argCount = count($argv); -for ($i = 0; $i < $argCount; $i++) { - $arg = $argv[$i]; - - foreach ($multiValueOptions as $valueOption) { - if ($arg === $valueOption) { - // space-separated form: --option - if (!isset($argv[$i + 1]) || strpos($argv[$i + 1], '-') === 0) { - output("Missing value for $valueOption\n"); - exit(1); - } - $arOptions[$valueOption][] = $argv[++$i]; - continue 2; - } - - if (strpos($arg, $valueOption . '=') === 0) { - // equals form: --option= - $value = substr($arg, strlen($valueOption . '=')); - if ($value === '') { - output("Missing value for $valueOption\n"); - exit(1); - } - $arOptions[$valueOption][] = $value; - continue 2; - } - } - +foreach ($argv as $arg) { if ($arg[0] == '-') { $arOptions[$arg] = true; } else { @@ -74,10 +42,6 @@ Usage: validate-json data.json Options: --dump-schema Output full schema and exit --dump-schema-url Output URL of schema - --allow-invalid-content-type-endpoint= - Skip the Content-Type check for schemas fetched - from the given URL prefix. May be given multiple - times. --verbose Show additional output --quiet Suppress all output -h --help Show this help @@ -227,13 +191,6 @@ if ($pathSchema[0] == '/') { $resolver = new JsonSchema\Uri\UriResolver(); $retriever = new JsonSchema\Uri\UriRetriever(); -if (isset($arOptions['--allow-invalid-content-type-endpoint']) - && is_array($arOptions['--allow-invalid-content-type-endpoint']) -) { - foreach ($arOptions['--allow-invalid-content-type-endpoint'] as $endpoint) { - $retriever->addInvalidContentTypeEndpoint($endpoint); - } -} try { $urlSchema = $resolver->resolve($pathSchema, $urlData); @@ -257,7 +214,7 @@ if (isset($arOptions['--dump-schema'])) { } try { - $validator = new JsonSchema\Validator(new JsonSchema\Constraints\Factory($refResolver, $retriever)); + $validator = new JsonSchema\Validator(); $validator->validate($data, $schema); if ($validator->isValid()) { diff --git a/core/vendor/justinrainbow/json-schema/composer.json b/core/vendor/justinrainbow/json-schema/composer.json index 30e5d25101..e975e17861 100644 --- a/core/vendor/justinrainbow/json-schema/composer.json +++ b/core/vendor/justinrainbow/json-schema/composer.json @@ -10,14 +10,24 @@ "license": "MIT", "authors": [ { - "name": "Danny van der Sluijs", - "email": "danny.vandersluijs@icloud.com", - "role": "Maintainer" + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" } ], "require": { "php": "^7.2 || ^8.0", - "ext-filter": "*", "ext-json": "*", "marc-mabe/php-enum":"^4.4" }, diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/AdditionalPropertiesConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/AdditionalPropertiesConstraint.php index 0f78b32b5a..5d6c55cb59 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/AdditionalPropertiesConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/AdditionalPropertiesConstraint.php @@ -58,20 +58,15 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n if (is_object($schema->additionalProperties)) { foreach ($additionalProperties as $key => $additionalPropertiesValue) { $schemaConstraint = $this->factory->createInstanceFor('schema'); - $schemaConstraint->check($additionalPropertiesValue, $schema->additionalProperties, ($path ?? new JsonPointer(''))->withAppendedPath($key), $i); - - // The property is permitted by the schema, so it is never an "additional property" - // error; what it failed is the sub-schema, and those errors carry the reason. - if (!$schemaConstraint->isValid()) { - $this->addErrors($schemaConstraint->getErrors()); + $schemaConstraint->check($additionalPropertiesValue, $schema->additionalProperties, $path, $i); // @todo increment path + if ($schemaConstraint->isValid()) { + unset($additionalProperties[$key]); } - - unset($additionalProperties[$key]); } } foreach ($additionalProperties as $key => $additionalPropertiesValue) { - $this->addError(ConstraintError::ADDITIONAL_PROPERTIES(), ($path ?? new JsonPointer(''))->withAppendedPath($key), ['found' => $key]); + $this->addError(ConstraintError::ADDITIONAL_PROPERTIES(), $path, ['found' => $key]); } } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/FormatConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/FormatConstraint.php index d8cc0e008a..ec61b73b62 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/FormatConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/FormatConstraint.php @@ -125,11 +125,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n private function validateDateTime(string $datetime, string $format): bool { - try { - $dt = \DateTime::createFromFormat($format, $datetime); - } catch (\Throwable $e) { - return false; - } + $dt = \DateTime::createFromFormat($format, $datetime); if (!$dt) { return false; diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MaxLengthConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MaxLengthConstraint.php index 58072ec5ec..5243f488f6 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MaxLengthConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MaxLengthConstraint.php @@ -29,7 +29,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n return; } - $length = mb_strlen($value, 'UTF-8'); + $length = mb_strlen($value); if ($length <= $schema->maxLength) { return; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MinLengthConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MinLengthConstraint.php index d48d7f5203..d9c516a333 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MinLengthConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MinLengthConstraint.php @@ -29,7 +29,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n return; } - $length = mb_strlen($value, 'UTF-8'); + $length = mb_strlen($value); if ($length >= $schema->minLength) { return; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/PropertiesNamesConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/PropertiesNamesConstraint.php index 4a929de2c9..96312cef85 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/PropertiesNamesConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/PropertiesNamesConstraint.php @@ -47,7 +47,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n if (property_exists($schema->propertyNames, 'maxLength')) { foreach ($propertyNames as $propertyName => $_) { - $length = mb_strlen($propertyName, 'UTF-8'); + $length = mb_strlen($propertyName); if ($length > $schema->propertyNames->maxLength) { $this->addError(ConstraintError::PROPERTY_NAMES(), $path, ['propertyNames' => $schema->propertyNames, 'violating' => 'maxLength', 'length' => $length, 'name' => $propertyName]); } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/RequiredConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/RequiredConstraint.php index b75d0ade4a..9e56ef2213 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/RequiredConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/RequiredConstraint.php @@ -34,7 +34,25 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n continue; } - $this->addError(ConstraintError::REQUIRED(), ($path ?? new JsonPointer(''))->withAppendedPath($required), ['property' => $required]); + $this->addError(ConstraintError::REQUIRED(), $this->incrementPath($path, $required), ['property' => $required]); } } + + /** + * @todo refactor as this was only copied from UndefinedConstraint + * Bubble down the path + * + * @param JsonPointer|null $path Current path + * @param mixed $i What to append to the path + */ + protected function incrementPath(?JsonPointer $path, $i): JsonPointer + { + $path = $path ?? new JsonPointer(''); + + if ($i === null || $i === '') { + return $path; + } + + return $path->withPropertyPaths(array_merge($path->getPropertyPaths(), [$i])); + } } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/AdditionalPropertiesConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/AdditionalPropertiesConstraint.php index f94827607f..7162c11bed 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/AdditionalPropertiesConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/AdditionalPropertiesConstraint.php @@ -58,20 +58,15 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n if (is_object($schema->additionalProperties)) { foreach ($additionalProperties as $key => $additionalPropertiesValue) { $schemaConstraint = $this->factory->createInstanceFor('schema'); - $schemaConstraint->check($additionalPropertiesValue, $schema->additionalProperties, ($path ?? new JsonPointer(''))->withAppendedPath($key), $i); - - // The property is permitted by the schema, so it is never an "additional property" - // error; what it failed is the sub-schema, and those errors carry the reason. - if (!$schemaConstraint->isValid()) { - $this->addErrors($schemaConstraint->getErrors()); + $schemaConstraint->check($additionalPropertiesValue, $schema->additionalProperties, $path, $i); // @todo increment path + if ($schemaConstraint->isValid()) { + unset($additionalProperties[$key]); } - - unset($additionalProperties[$key]); } } foreach ($additionalProperties as $key => $additionalPropertiesValue) { - $this->addError(ConstraintError::ADDITIONAL_PROPERTIES(), ($path ?? new JsonPointer(''))->withAppendedPath($key), ['found' => $key]); + $this->addError(ConstraintError::ADDITIONAL_PROPERTIES(), $path, ['found' => $key]); } } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/FormatConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/FormatConstraint.php index fd5474b65b..8ddc879dd7 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/FormatConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/FormatConstraint.php @@ -149,12 +149,7 @@ private function validateDateTime(string $datetime, string $format): bool $input = sprintf('%s59%s', substr($datetime, 0, 6), substr($datetime, 8)); } - try { - $dt = \DateTimeImmutable::createFromFormat($format, $input); - } catch (\Throwable $e) { - return false; - } - + $dt = \DateTimeImmutable::createFromFormat($format, $input); if (!$dt) { return false; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MaxLengthConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MaxLengthConstraint.php index 0aae005b9d..9043cf92d8 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MaxLengthConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MaxLengthConstraint.php @@ -29,7 +29,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n return; } - $length = mb_strlen($value, 'UTF-8'); + $length = mb_strlen($value); if ($length <= $schema->maxLength) { return; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MinLengthConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MinLengthConstraint.php index a1128c74d1..5c7243a828 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MinLengthConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MinLengthConstraint.php @@ -29,7 +29,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n return; } - $length = mb_strlen($value, 'UTF-8'); + $length = mb_strlen($value); if ($length >= $schema->minLength) { return; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/PropertiesNamesConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/PropertiesNamesConstraint.php index a95f568017..e3838990e7 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/PropertiesNamesConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/PropertiesNamesConstraint.php @@ -47,7 +47,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n if (property_exists($schema->propertyNames, 'maxLength')) { foreach ($propertyNames as $propertyName => $_) { - $length = mb_strlen($propertyName, 'UTF-8'); + $length = mb_strlen($propertyName); if ($length > $schema->propertyNames->maxLength) { $this->addError(ConstraintError::PROPERTY_NAMES(), $path, ['propertyNames' => $schema->propertyNames, 'violating' => 'maxLength', 'length' => $length, 'name' => $propertyName]); } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/RequiredConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/RequiredConstraint.php index 1d2ad87438..99a5b55af0 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/RequiredConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/RequiredConstraint.php @@ -34,7 +34,25 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n continue; } - $this->addError(ConstraintError::REQUIRED(), ($path ?? new JsonPointer(''))->withAppendedPath($required), ['property' => $required]); + $this->addError(ConstraintError::REQUIRED(), $this->incrementPath($path, $required), ['property' => $required]); } } + + /** + * @todo refactor as this was only copied from UndefinedConstraint + * Bubble down the path + * + * @param JsonPointer|null $path Current path + * @param mixed $i What to append to the path + */ + protected function incrementPath(?JsonPointer $path, $i): JsonPointer + { + $path = $path ?? new JsonPointer(''); + + if ($i === null || $i === '') { + return $path; + } + + return $path->withPropertyPaths(array_merge($path->getPropertyPaths(), [$i])); + } } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/AdditionalPropertiesConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/AdditionalPropertiesConstraint.php index cdabc08103..9406c47702 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/AdditionalPropertiesConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/AdditionalPropertiesConstraint.php @@ -58,20 +58,15 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n if (is_object($schema->additionalProperties)) { foreach ($additionalProperties as $key => $additionalPropertiesValue) { $schemaConstraint = $this->factory->createInstanceFor('schema'); - $schemaConstraint->check($additionalPropertiesValue, $schema->additionalProperties, ($path ?? new JsonPointer(''))->withAppendedPath($key), $i); - - // The property is permitted by the schema, so it is never an "additional property" - // error; what it failed is the sub-schema, and those errors carry the reason. - if (!$schemaConstraint->isValid()) { - $this->addErrors($schemaConstraint->getErrors()); + $schemaConstraint->check($additionalPropertiesValue, $schema->additionalProperties, $path, $i); // @todo increment path + if ($schemaConstraint->isValid()) { + unset($additionalProperties[$key]); } - - unset($additionalProperties[$key]); } } foreach ($additionalProperties as $key => $additionalPropertiesValue) { - $this->addError(ConstraintError::ADDITIONAL_PROPERTIES(), ($path ?? new JsonPointer(''))->withAppendedPath($key), ['found' => $key]); + $this->addError(ConstraintError::ADDITIONAL_PROPERTIES(), $path, ['found' => $key]); } } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/FormatConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/FormatConstraint.php index 419f3cb2aa..5fb47c875b 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/FormatConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/FormatConstraint.php @@ -140,12 +140,7 @@ private function validateDateTime(string $datetime, string $format): bool $input = sprintf('%s59%s', substr($datetime, 0, 6), substr($datetime, 8)); } - try { - $dt = \DateTimeImmutable::createFromFormat($format, $input); - } catch (\Throwable $e) { - return false; - } - + $dt = \DateTimeImmutable::createFromFormat($format, $input); if (!$dt) { return false; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MaxLengthConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MaxLengthConstraint.php index fd341b9f21..17eee392a2 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MaxLengthConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MaxLengthConstraint.php @@ -29,7 +29,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n return; } - $length = mb_strlen($value, 'UTF-8'); + $length = mb_strlen($value); if ($length <= $schema->maxLength) { return; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MinLengthConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MinLengthConstraint.php index 3057dd67cb..9784c39ff1 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MinLengthConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MinLengthConstraint.php @@ -29,7 +29,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n return; } - $length = mb_strlen($value, 'UTF-8'); + $length = mb_strlen($value); if ($length >= $schema->minLength) { return; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/PropertiesNamesConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/PropertiesNamesConstraint.php index e7691fe4f1..1ce7f0c4fa 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/PropertiesNamesConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/PropertiesNamesConstraint.php @@ -47,7 +47,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n if (property_exists($schema->propertyNames, 'maxLength')) { foreach ($propertyNames as $propertyName => $_) { - $length = mb_strlen($propertyName, 'UTF-8'); + $length = mb_strlen($propertyName); if ($length > $schema->propertyNames->maxLength) { $this->addError(ConstraintError::PROPERTY_NAMES(), $path, ['propertyNames' => $schema->propertyNames, 'violating' => 'maxLength', 'length' => $length, 'name' => $propertyName]); } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/RequiredConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/RequiredConstraint.php index d0b11931d2..a5c4c93ad1 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/RequiredConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/RequiredConstraint.php @@ -34,7 +34,25 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n continue; } - $this->addError(ConstraintError::REQUIRED(), ($path ?? new JsonPointer(''))->withAppendedPath($required), ['property' => $required]); + $this->addError(ConstraintError::REQUIRED(), $this->incrementPath($path, $required), ['property' => $required]); } } + + /** + * @todo refactor as this was only copied from UndefinedConstraint + * Bubble down the path + * + * @param JsonPointer|null $path Current path + * @param mixed $i What to append to the path + */ + protected function incrementPath(?JsonPointer $path, $i): JsonPointer + { + $path = $path ?? new JsonPointer(''); + + if ($i === null || $i === '') { + return $path; + } + + return $path->withPropertyPaths(array_merge($path->getPropertyPaths(), [$i])); + } } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php index 20fdb2077a..c38488dd11 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php @@ -154,11 +154,7 @@ public function check(&$element, $schema = null, ?JsonPointer $path = null, $i = protected function validateDateTime($datetime, $format) { - try { - $dt = \DateTime::createFromFormat($format, (string) $datetime); - } catch (\Throwable $e) { - return false; - } + $dt = \DateTime::createFromFormat($format, (string) $datetime); if (!$dt) { return false; diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.php index d8ac07ae3e..7b811614a7 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.php @@ -54,7 +54,7 @@ public function check(&$element, $schema = null, ?JsonPointer $path = null, $i = private function strlen($string) { if (extension_loaded('mbstring')) { - return mb_strlen($string, 'UTF-8'); + return mb_strlen($string, mb_detect_encoding($string)); } // mbstring is present on all test platforms, so strlen() can be ignored for coverage diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Entity/JsonPointer.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Entity/JsonPointer.php index e03010209f..e33866b681 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Entity/JsonPointer.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Entity/JsonPointer.php @@ -127,25 +127,6 @@ public function withPropertyPaths(array $propertyPaths) return $new; } - /** - * Returns a new pointer with one more segment appended. - * - * A null or empty segment yields the pointer unchanged, so that callers can - * pass through an index they have not resolved yet. - * - * @param mixed $propertyPath - * - * @return JsonPointer - */ - public function withAppendedPath($propertyPath) - { - if ($propertyPath === null || $propertyPath === '') { - return $this; - } - - return $this->withPropertyPaths(array_merge($this->propertyPaths, [$propertyPath])); - } - /** * @return string */ diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Rfc3339.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Rfc3339.php index 75c0256f9c..2a07060df5 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Rfc3339.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Rfc3339.php @@ -25,7 +25,7 @@ public static function createFromString($input): ?\DateTime $inputHasTSeparator = strpos($input, 'T'); $dateAndTime = $matches[1]; - $microseconds = $matches[5] ? substr($matches[5], 0, 7) : '.000000'; + $microseconds = $matches[5] ?: '.000000'; $timeZone = 'Z' !== $matches[6] ? $matches[6] : '+00:00'; $dateFormat = $inputHasTSeparator === false ? 'Y-m-d H:i:s.uP' : 'Y-m-d\TH:i:s.uP'; $dateTime = \DateTimeImmutable::createFromFormat($dateFormat, $dateAndTime . $microseconds . $timeZone, new \DateTimeZone('UTC')); diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/Curl.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/Curl.php index 6387e25313..311f1d34ba 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/Curl.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/Curl.php @@ -76,7 +76,7 @@ private function fetchMessageBody($response) */ protected function fetchContentType($response) { - if (0 < preg_match('/^Content-Type:([^;\v]*)/im', $response, $match)) { + if (0 < preg_match("/Content-Type:(\V*)/ims", $response, $match)) { $this->contentType = trim($match[1]); return true; diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/FileGetContents.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/FileGetContents.php index 84598c3e8f..f60566930a 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/FileGetContents.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/FileGetContents.php @@ -97,7 +97,7 @@ private function fetchContentType(array $headers): bool */ protected static function getContentTypeMatchInHeader($header) { - if (0 < preg_match('/^Content-Type:([^;\v]*)/im', $header, $match)) { + if (0 < preg_match("/Content-Type:(\V*)/ims", $header, $match)) { return trim($match[1]); } diff --git a/core/vendor/laravel/prompts/src/Themes/Default/Concerns/InteractsWithStrings.php b/core/vendor/laravel/prompts/src/Themes/Default/Concerns/InteractsWithStrings.php index 1c1c79d081..17937bfb7d 100644 --- a/core/vendor/laravel/prompts/src/Themes/Default/Concerns/InteractsWithStrings.php +++ b/core/vendor/laravel/prompts/src/Themes/Default/Concerns/InteractsWithStrings.php @@ -42,11 +42,7 @@ protected function stripEscapeSequences(string $text): string $text = preg_replace("/<(info|comment|question|error)>(.*?)<\/\\1>/", '$2', $text); // Strip Symfony inline style tags. - do { - $text = preg_replace("/<(?:(?:[fb]g|options)=[a-z,;]+)+>(.*?)<\/>/i", '$1', $text, -1, $count); - } while ($count > 0); - - return $text; + return preg_replace("/<(?:(?:[fb]g|options)=[a-z,;]+)+>(.*?)<\/>/i", '$1', $text); } /** diff --git a/core/vendor/laravel/serializable-closure/src/Serializers/Signed.php b/core/vendor/laravel/serializable-closure/src/Serializers/Signed.php index 8cda65f39e..16f9593f5b 100644 --- a/core/vendor/laravel/serializable-closure/src/Serializers/Signed.php +++ b/core/vendor/laravel/serializable-closure/src/Serializers/Signed.php @@ -57,8 +57,6 @@ public function getClosure() * Get the serializable representation of the closure. * * @return array - * - * @throws \Laravel\SerializableClosure\Exceptions\MissingSecretKeyException */ public function __serialize() { @@ -78,15 +76,10 @@ public function __serialize() * @return void * * @throws \Laravel\SerializableClosure\Exceptions\InvalidSignatureException - * @throws \Laravel\SerializableClosure\Exceptions\MissingSecretKeyException */ public function __unserialize($signature) { - if (! static::$signer) { - throw new MissingSecretKeyException(); - } - - if (! static::$signer->verify($signature)) { + if (static::$signer && ! static::$signer->verify($signature)) { throw new InvalidSignatureException(); } diff --git a/core/vendor/league/flysystem-local/LocalFilesystemAdapter.php b/core/vendor/league/flysystem-local/LocalFilesystemAdapter.php index 33930a01fa..36700dd2a5 100644 --- a/core/vendor/league/flysystem-local/LocalFilesystemAdapter.php +++ b/core/vendor/league/flysystem-local/LocalFilesystemAdapter.php @@ -39,6 +39,7 @@ use function dirname; use function error_clear_last; use function error_get_last; +use function file_exists; use function file_put_contents; use function hash_file; use function is_dir; @@ -143,7 +144,7 @@ public function delete(string $path): void error_clear_last(); - if ( ! @unlink($location) && file_exists($location)) { + if ( ! @unlink($location)) { throw UnableToDeleteFile::atLocation($location, error_get_last()['message'] ?? ''); } } diff --git a/core/vendor/league/flysystem/src/WhitespacePathNormalizer.php b/core/vendor/league/flysystem/src/WhitespacePathNormalizer.php index 7daaf659bc..16d78fa73c 100644 --- a/core/vendor/league/flysystem/src/WhitespacePathNormalizer.php +++ b/core/vendor/league/flysystem/src/WhitespacePathNormalizer.php @@ -22,9 +22,8 @@ public function __construct(bool $allowRelativePathTraversal = true) public function normalizePath(string $path): string { $unixPath = str_replace('\\', '/', $path); - $match = preg_match('#\p{C}+#u', $unixPath); - if ($match !== 0) { + if (preg_match('#\p{C}+#u', $unixPath)) { throw CorruptedPathDetected::forPath($path); } diff --git a/core/vendor/monolog/monolog/CHANGELOG.md b/core/vendor/monolog/monolog/CHANGELOG.md index a94f2ff28d..2c89f9d181 100644 --- a/core/vendor/monolog/monolog/CHANGELOG.md +++ b/core/vendor/monolog/monolog/CHANGELOG.md @@ -1,32 +1,3 @@ -### 3.12.0 (2026-09-09) - - * Added support for reading the timestamp of new records from a PSR-20 clock, via a new `$clock` constructor param and `Logger::setClock()` (#2065) - * Added support for `#[WithMonologChannel]` on constructor/method parameters, so a channel can be bound to a single argument instead of the whole class (#2068) - * Fixed `TelegramBotHandler` breaking HTML markup when truncating or splitting long messages, open tags are now closed at the end of a chunk and reopened in the next one (#2066) - * Fixed `RedactingFormatter` not redacting secrets nested inside array values of sensitive keys (#2067) - -### 3.11.0 (2026-09-02) - - * Security: Fixed potential XSS in `BrowserConsoleHandler` when logging user provided content - * Added `RedactingFormatter` to automatically redact sensitive data from records, based on key names, `#[SensitiveParameter]` constructor params and/or regex patterns (#2041) - * Added `FrankenPhpHandler` to log records via FrankenPHP's frankenphp_log() function (#2056) - * Added `LogMonsterHandler` which complains if the code did not log enough records before the process/request ends, like a dead man's switch for logs (#2039) - * Added `FILE_PER_HOUR` rotation mode to `RotatingFileHandler` (#2040) - * Added `ErrorHandler::captureStackTraces()` to attach the stack trace of PHP errors to the records it generates (#2060) - * Added `NormalizerFormatter::setMaxTraceLength()` to limit how many stack trace frames are included when normalizing exceptions (#2015) - * Added extension points to `TelegramBotHandler` to change the API URL (e.g. for a self-hosted Bot API server) and to send extra curl headers (#2029) - * Added ability to override `IntrospectionProcessor`'s `SKIP_FUNCTIONS` in subclasses (#2050) - * Added `$maxLength` param to `SyslogUdpHandler`/`UdpSocket` to keep datagrams below the path MTU, as fragmented UDP packets are often dropped (#2049) - * Fixed `StreamHandler` truncating writes on non-blocking streams, it now loops until the whole record is written (#2016) - * Fixed stack trace frames without file/line being skipped, they are now reported as `internal[function]` entries so traces are not truncated or empty (#2061) - * Fixed `RotatingFileHandler` cleanup not finding files behind stream wrappers (e.g. private://) as glob() cannot see through those (#2058) - * Fixed `RotatingFileHandler` not using the configured timezone when computing the next rotation time (#2022) - * Fixed scalars being replaced by the "Over N levels deep" message instead of being output when the max normalization depth is reached (#2042) - * Fixed `DeduplicationHandler` failing with an undefined array key error when the store file is written to concurrently (#2020) - * Fixed `TelegramBotHandler` swallowing errors when the API returns a non-JSON response (#2030) - * Fixed `AbstractProcessingHandler::handle()` reading `$bubble` directly instead of calling `getBubble()`, so overrides of it were ignored (#2031) - * Fixed warning on PHP 8.5 when `ErrorHandler` sets the HTTP response code and a status line was already registered (#2027) - ### 3.10.0 (2026-01-02) * Added automatic directory cleanup in RotatingFileHandler (#2000) diff --git a/core/vendor/monolog/monolog/composer.json b/core/vendor/monolog/monolog/composer.json index a547ea06cd..b0fb2d7a5c 100644 --- a/core/vendor/monolog/monolog/composer.json +++ b/core/vendor/monolog/monolog/composer.json @@ -32,7 +32,6 @@ "phpstan/phpstan-strict-rules": "^2", "phpunit/phpunit": "^10.5.17 || ^11.0.7", "predis/predis": "^1.1 || ^2", - "psr/clock": "^1.0", "rollbar/rollbar": "^4.0", "ruflin/elastica": "^7 || ^8", "symfony/mailer": "^5.4 || ^6", @@ -52,8 +51,7 @@ "ext-mbstring": "Allow to work properly with unicode symbols", "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", - "ext-openssl": "Required to send log messages using SSL", - "psr/clock": "Required to pass a clock to the Logger and control the timestamp of log records" + "ext-openssl": "Required to send log messages using SSL" }, "autoload": { "psr-4": {"Monolog\\": "src/Monolog"} diff --git a/core/vendor/monolog/monolog/src/Monolog/Attribute/WithMonologChannel.php b/core/vendor/monolog/monolog/src/Monolog/Attribute/WithMonologChannel.php index 0feb213eb1..862e05b335 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Attribute/WithMonologChannel.php +++ b/core/vendor/monolog/monolog/src/Monolog/Attribute/WithMonologChannel.php @@ -12,15 +12,14 @@ namespace Monolog\Attribute; /** - * A reusable attribute to help configure a class, or one of its constructor/method arguments, - * as expecting a given logger channel. + * A reusable attribute to help configure a class as expecting a given logger channel. * * Using it offers no guarantee: it needs to be leveraged by a Monolog third-party consumer. * * Using it with the Monolog library only has no effect at all: wiring the logger instance into * other classes is not managed by Monolog. */ -#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PARAMETER)] +#[\Attribute(\Attribute::TARGET_CLASS)] final class WithMonologChannel { public function __construct( diff --git a/core/vendor/monolog/monolog/src/Monolog/ErrorHandler.php b/core/vendor/monolog/monolog/src/Monolog/ErrorHandler.php index c10f7be65b..805f2dfd9f 100644 --- a/core/vendor/monolog/monolog/src/Monolog/ErrorHandler.php +++ b/core/vendor/monolog/monolog/src/Monolog/ErrorHandler.php @@ -41,9 +41,6 @@ class ErrorHandler private bool $hasFatalErrorHandler = false; - /** @var int bitmask of E_* constants to capture stack traces for, 0 to disable */ - private int $captureStackTraceTypes = 0; - private string $fatalLevel = LogLevel::ALERT; private string|null $reservedMemory = null; @@ -142,30 +139,6 @@ public function registerFatalHandler($level = null, int $reservedMemorySize = 20 return $this; } - /** - * Attaches an ErrorException carrying the stack trace of the error to the log record's context - * - * PHP does not report where a warning/notice/deprecation came from, so without this the records - * only point at the line which raised the error, and not at its caller. Formatters rendering - * stack traces (e.g. LineFormatter::includeStacktraces) then show the full call site. - * - * This is off by default because context.exception makes errors look like exceptions to the - * handlers which treat that key specially, e.g. NewRelicHandler reports them via - * newrelic_notice_error and RollbarHandler as exception occurrences, and because formatters - * extending NormalizerFormatter then include the whole trace in every record. Narrowing - * $errorTypes is wise if you log a lot of errors: E_DEPRECATED in particular can be very - * frequent in legacy code while rarely being worth a stack trace. - * - * @param int $errorTypes bitmask of E_* constants to capture stack traces for - * @return $this - */ - public function captureStackTraces(bool $capture = true, int $errorTypes = E_ALL): self - { - $this->captureStackTraceTypes = $capture ? $errorTypes : 0; - - return $this; - } - /** * @return array */ @@ -222,8 +195,7 @@ private function handleException(\Throwable $e): never } if (!headers_sent() && \in_array(strtolower((string) \ini_get('display_errors')), ['0', '', 'false', 'off', 'none', 'no'], true)) { - // PHP 8.5+ warns if header('HTTP/...') already staged a status line, which is undetectable from userland - @http_response_code(500); + http_response_code(500); } exit(255); @@ -235,23 +207,13 @@ private function handleError(int $code, string $message, string $file = '', int return false; } - $isFatal = $this->hasFatalErrorHandler && \in_array($code, self::FATAL_ERRORS, true); - - $trace = null; - if ($isFatal || 0 !== ($this->captureStackTraceTypes & $code)) { - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - array_shift($trace); // Exclude handleError from trace - } - // fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries - if (!$isFatal) { + if (!$this->hasFatalErrorHandler || !\in_array($code, self::FATAL_ERRORS, true)) { $level = $this->errorLevelMap[$code] ?? LogLevel::CRITICAL; - $context = ['code' => $code, 'message' => $message, 'file' => $file, 'line' => $line]; - if (null !== $trace) { - $context['exception'] = self::createErrorException($code, $message, $file, $line, $trace); - } - $this->logger->log($level, self::codeToString($code).': '.$message, $context); + $this->logger->log($level, self::codeToString($code).': '.$message, ['code' => $code, 'message' => $message, 'file' => $file, 'line' => $line]); } else { + $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + array_shift($trace); // Exclude handleError from trace $this->lastFatalData = ['type' => $code, 'message' => $message, 'file' => $file, 'line' => $line, 'trace' => $trace]; } @@ -278,17 +240,11 @@ public function handleFatalError(): void $lastError = error_get_last(); } if (\is_array($lastError) && \in_array($lastError['type'], self::FATAL_ERRORS, true)) { - // PHP 8.5+ reports a trace for fatal errors which never reach the error handler (OOM, timeouts) $trace = $lastError['trace'] ?? null; - $context = ['code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'], 'trace' => $trace]; - if (\is_array($trace)) { - /** @var list> $trace */ - $context['exception'] = self::createErrorException($lastError['type'], $lastError['message'], $lastError['file'], $lastError['line'], $trace); - } $this->logger->log( $this->fatalLevel, 'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'], - $context + ['code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'], 'trace' => $trace] ); if ($this->logger instanceof Logger) { @@ -299,20 +255,6 @@ public function handleFatalError(): void } } - /** - * @param list> $trace - */ - private static function createErrorException(int $code, string $message, string $file, int $line, array $trace): \ErrorException - { - $e = new \ErrorException($message, 0, $code, $file, $line); - - // Exception::getTrace() is final, so overwriting the private property is the only way to - // report the real call site instead of ErrorHandler's own frame - (new \ReflectionProperty(\Exception::class, 'trace'))->setValue($e, $trace); - - return $e; - } - private static function codeToString(int $code): string { return match ($code) { diff --git a/core/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php b/core/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php index 4774bde00b..bf8ed24117 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php +++ b/core/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php @@ -87,11 +87,11 @@ public function __construct(?string $systemName = null, ?string $extraPrefix = n public function format(LogRecord $record): Message { $context = $extra = []; - if ($record->context !== []) { + if (isset($record->context)) { /** @var array|bool|float|int|string|null> $context */ $context = parent::normalize($record->context); } - if ($record->extra !== []) { + if (isset($record->extra)) { /** @var array|bool|float|int|string|null> $extra */ $extra = parent::normalize($record->extra); } @@ -110,7 +110,7 @@ public function format(LogRecord $record): Message $message->setShortMessage(Utils::substr($record->message, 0, $this->maxLength)); } - if ($record->channel !== '') { + if (isset($record->channel)) { $message->setAdditional('facility', $record->channel); } diff --git a/core/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/core/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php index c9281a4274..fa11d0ef02 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +++ b/core/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php @@ -160,10 +160,6 @@ protected function formatBatchNewlines(array $records): string */ protected function normalize(mixed $data, int $depth = 0): mixed { - if (is_null($data) || is_scalar($data)) { - return $data; - } - if ($depth > $this->maxNormalizeDepth) { return 'Over '.$this->maxNormalizeDepth.' levels deep, aborting normalization'; } @@ -213,7 +209,11 @@ protected function normalize(mixed $data, int $depth = 0): mixed return $data; } - return parent::normalize($data); + if (\is_resource($data)) { + return parent::normalize($data); + } + + return $data; } /** diff --git a/core/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php b/core/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php index 7fc6de4601..60da29cf7b 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +++ b/core/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php @@ -28,7 +28,6 @@ class NormalizerFormatter implements FormatterInterface protected string $dateFormat; protected int $maxNormalizeDepth = 9; protected int $maxNormalizeItemCount = 1000; - protected ?int $maxTraceLength = null; private int $jsonEncodeOptions = Utils::DEFAULT_JSON_FLAGS; @@ -123,24 +122,6 @@ public function setMaxNormalizeItemCount(int $maxNormalizeItemCount): self return $this; } - /** - * The maximum number of stack trace frames to include - */ - public function getMaxTraceLength(): ?int - { - return $this->maxTraceLength; - } - - /** - * @return $this - */ - public function setMaxTraceLength(?int $maxTraceLength): self - { - $this->maxTraceLength = $maxTraceLength; - - return $this; - } - /** * Enables `json_encode` pretty print. * @@ -193,6 +174,10 @@ protected function normalizeRecord(LogRecord $record): array */ protected function normalize(mixed $data, int $depth = 0): mixed { + if ($depth > $this->maxNormalizeDepth) { + return 'Over ' . $this->maxNormalizeDepth . ' levels deep, aborting normalization'; + } + if (null === $data || \is_scalar($data)) { if (\is_float($data)) { if (is_infinite($data)) { @@ -206,10 +191,6 @@ protected function normalize(mixed $data, int $depth = 0): mixed return $data; } - if ($depth > $this->maxNormalizeDepth) { - return 'Over ' . $this->maxNormalizeDepth . ' levels deep, aborting normalization'; - } - if (\is_array($data)) { $normalized = []; @@ -309,36 +290,14 @@ protected function normalizeException(Throwable $e, int $depth = 0) } } - $trace = array_slice($e->getTrace(), 0, $this->maxTraceLength); + $trace = $e->getTrace(); foreach ($trace as $frame) { - if (isset($frame['file'])) { + if (isset($frame['file'], $frame['line'])) { $file = $frame['file']; if ($this->basePath !== '') { - $file = preg_replace('{^'.preg_quote($this->basePath).'}', '', $file) ?? $file; - } - $data['trace'][] = $file.':'.($frame['line'] ?? 0); - } else { - // Frames called by the engine itself have no file/line: shutdown functions, - // callbacks run by internal functions, destructors. Skipping them made traces - // look shorter than they were, and entirely empty for fatal errors caught in a - // shutdown function, so they are reported by name instead. - $call = $frame['function']; - // since PHP 8.4 a closure is named after its declaring scope, which already - // includes the class, so prefixing it again would just repeat it - if (isset($frame['class']) && !str_starts_with($call, '{closure:')) { - // before 8.4 the name is \{closure}, and the class has the namespace - $call = str_ends_with($call, '\{closure}') ? '{closure}' : $call; - $call = Utils::getClassName($frame['class']).($frame['type'] ?? '::').$call; - } - // anonymous classes carry their declaration site after a NUL byte, which truncates - // syslog lines and is not valid JSON; PHP 8.4 embeds it in closure names too - $call = preg_replace('{@anonymous\x00.*?\$[0-9a-f]++(?=::|$)}s', '@anonymous', $call) ?? $call; - if ($this->basePath !== '') { - // closure names embed the file they were declared in since PHP 8.4, so the - // pattern cannot be anchored; limit it or a recurring base path is stripped twice - $call = preg_replace('{'.preg_quote($this->basePath).'}', '', $call, 1) ?? $call; + $file = preg_replace('{^'.preg_quote($this->basePath).'}', '', $file); } - $data['trace'][] = 'internal['.$call.']:0'; + $data['trace'][] = $file.':'.$frame['line']; } } diff --git a/core/vendor/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php b/core/vendor/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php deleted file mode 100644 index d97a66a1eb..0000000000 --- a/core/vendor/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php +++ /dev/null @@ -1,373 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\LogRecord; -use Monolog\Utils; - -/** - * Wraps another formatter to redact sensitive data from log records. - * - * It works in three passes so that it can mask secrets wherever they end up: - * - * - Before delegating, it masks the value of any context/extra key whose name - * matches one of the configured sensitive keys (case-insensitive, recursive). - * - After delegating, it removes those same secret values from the wrapped - * formatter's output, which catches the copies masking the record cannot - * reach, e.g. a secret interpolated into the message by the - * PsrLogMessageProcessor or embedded in an exception message. - * - Last, it runs the configured regex patterns over the output, which catches - * secrets that only became strings once the inner formatter normalized - * objects (e.g. tokens buried in an exception stack trace). If a pattern - * cannot be applied, the record is dropped instead of emitted unredacted. - * - * On top of the sensitive keys, secrets are also read from the properties of the - * objects in the record matching a constructor parameter marked - * #[SensitiveParameter]. Those can only be handled by the output pass, as the - * objects carrying them cannot be modified. This is the one part that reflects on - * every logged object, so it can be turned off with $redactSensitiveParameters. - * - * Only string and array output can be swept, so wrapping a formatter which returns - * objects (e.g. the ElasticaFormatter) leaves you with the key masking alone. - * - * Because it is a formatter rather than a processor, it is guaranteed to run - * after every processor (both Logger- and Handler-level), so it always sees the - * final record with all data at hand. - * - * @author Jordi Boggiano - */ -final class RedactingFormatter implements WrappingFormatterInterface -{ - /** - * Matches long token-like words (30+ alphanumerics, optionally prefixed like api_key_), - * which are very likely to be secrets/tokens. Provided as an opt-in pattern as it may - * cause collateral damage on legitimate long strings (hashes, UUIDs, base64, ...). - */ - public const TOKEN_PATTERN = '{\b(?:[a-z]+_)*[a-zA-Z0-9]{30,}\b}'; - - /** - * How deep to walk the record and the output, mirrors NormalizerFormatter's default - */ - private const MAX_DEPTH = 9; - - /** @var list Lowercased sensitive keys */ - private array $sensitiveKeys; - - /** @var list */ - private array $patterns; - - /** @var array> */ - private array $sensitiveProperties = []; - - /** - * @param FormatterInterface $formatter The formatter to wrap and whose output gets redacted - * @param list $sensitiveKeys Exact context/extra keys whose values to mask (case-insensitive) - * @param list $patterns PCRE patterns to mask in the formatted output (e.g. self::TOKEN_PATTERN) - * @param string $mask Replacement token - * @param bool $redactSensitiveParameters Whether to also read secrets off the properties matching a - * #[SensitiveParameter] constructor parameter, which requires - * walking and reflecting on every object in the record - * @param int $minSecretLength Minimum length a secret must have to be removed from the - * output, to avoid short values like "pass" redacting - * unrelated data - * - * @throws \InvalidArgumentException If a pattern is not a valid PCRE regex - */ - public function __construct( - private readonly FormatterInterface $formatter, - array $sensitiveKeys = ['password', 'passwd', 'pwd', 'secret', 'token', 'api_key', 'apikey', 'authorization', 'auth', 'cookie'], - array $patterns = [], - private readonly string $mask = '[REDACTED]', - private readonly bool $redactSensitiveParameters = true, - private readonly int $minSecretLength = 5, - ) { - $this->sensitiveKeys = array_values(array_map('strtolower', $sensitiveKeys)); - - foreach ($patterns as $pattern) { - if (@preg_match($pattern, '') === false) { - throw new \InvalidArgumentException(sprintf('Invalid redaction pattern provided to RedactingFormatter: %s', var_export($pattern, true))); - } - } - $this->patterns = array_values($patterns); - } - - public function getWrappedFormatter(): FormatterInterface - { - return $this->formatter; - } - - public function format(LogRecord $record) - { - // secrets must be collected before the keys get masked, as masking loses the values - $secrets = $this->collectSecrets([$record]); - - return $this->sweep($this->formatter->format($this->redactRecord($record)), $secrets); - } - - public function formatBatch(array $records) - { - $secrets = $this->collectSecrets($records); - - foreach ($records as $key => $record) { - $records[$key] = $this->redactRecord($record); - } - - return $this->sweep($this->formatter->formatBatch($records), $secrets); - } - - private function redactRecord(LogRecord $record): LogRecord - { - return $record->with( - context: $this->redactKeys($record->context), - extra: $this->redactKeys($record->extra), - ); - } - - /** - * @param array $data - * @return array - */ - private function redactKeys(array $data, int $depth = 0): array - { - // context comes from userland and can hold a self-referencing array - if ($depth > self::MAX_DEPTH) { - return $data; - } - - foreach ($data as $key => $value) { - if (\is_string($key) && \in_array(strtolower($key), $this->sensitiveKeys, true)) { - $data[$key] = $this->mask; - } elseif (\is_array($value)) { - $data[$key] = $this->redactKeys($value, $depth + 1); - } - } - - return $data; - } - - /** - * Gathers the secret values present in the given records, longest first - * - * @param iterable $records - * @return list - */ - private function collectSecrets(iterable $records): array - { - $secrets = []; - $seen = []; - foreach ($records as $record) { - $this->collect($record->context, $secrets, $seen, 0); - $this->collect($record->extra, $secrets, $seen, 0); - } - - if ([] === $secrets) { - return []; - } - - // a secret containing quotes/backslashes/newlines shows up escaped in json output, - // so both forms have to be looked for - $escapedSecrets = []; - foreach ($secrets as $secret) { - $escaped = substr(Utils::jsonEncode($secret, null, true), 1, -1); - if ($escaped !== $secret && $escaped !== '') { - $escapedSecrets[] = $escaped; - } - } - - $secrets = array_values(array_unique(array_merge($secrets, $escapedSecrets))); - // longest first, so that overlapping secrets do not leave fragments behind - usort($secrets, static fn (string $a, string $b) => \strlen($b) <=> \strlen($a)); - - return $secrets; - } - - /** - * @param list $secrets - * @param array $seen Ids of the objects visited so far, to survive cyclic graphs - */ - private function collect(mixed $data, array &$secrets, array &$seen, int $depth): void - { - if ($depth > self::MAX_DEPTH) { - return; - } - - if (\is_array($data)) { - foreach ($data as $key => $value) { - if (\is_string($key) && \in_array(strtolower($key), $this->sensitiveKeys, true)) { - // the value is masked in the record, but a nested array's leaves can still - // leak elsewhere (e.g. json-encoded by PsrLogMessageProcessor) - $this->collectSensitiveValue($value, $secrets, $depth + 1); - - continue; - } - - $this->collect($value, $secrets, $seen, $depth + 1); - } - - return; - } - - // the array walk above is essentially free, reflecting on objects is not - if (!\is_object($data) || !$this->redactSensitiveParameters) { - return; - } - - $id = spl_object_id($data); - if (isset($seen[$id])) { - return; - } - $seen[$id] = true; - - foreach ($this->getSensitiveProperties($data) as $property) { - if ($property->isInitialized($data)) { - $this->addSecret($property->getValue($data), $secrets); - } - } - - // public properties only, matching what formatters get to see, but enough to reach - // objects nested inside this one - foreach (get_object_vars($data) as $value) { - $this->collect($value, $secrets, $seen, $depth + 1); - } - } - - /** - * Collects every string leaf nested inside a value under a sensitive key. - * - * @param list $secrets - */ - private function collectSensitiveValue(mixed $value, array &$secrets, int $depth): void - { - if ($depth > self::MAX_DEPTH) { - return; - } - - if (\is_array($value)) { - foreach ($value as $item) { - $this->collectSensitiveValue($item, $secrets, $depth + 1); - } - - return; - } - - $this->addSecret($value, $secrets); - } - - /** - * Reflects the properties of an object matching a #[SensitiveParameter] constructor parameter - * - * Non-public properties are included as they can still leak through __toString(), and the - * result is cached per class as reflecting on every logged object would be far too costly. - * - * @return array - */ - private function getSensitiveProperties(object $data): array - { - $class = $data::class; - if (isset($this->sensitiveProperties[$class])) { - return $this->sensitiveProperties[$class]; - } - - $names = Utils::getSensitiveParameterNames($class); - - // PHP 8.2+ wraps the arguments it hides from stack traces in a SensitiveParameterValue, - // whose own constructor parameter is not marked. Matched by name and read as a property - // so that it does not matter whether symfony/polyfill-php82 is installed on PHP 8.1: - // naming the class makes PHPStan report either the @internal getValue() the polyfill - // inherits, or a missing class when it is absent. - if ('SensitiveParameterValue' === $class) { - $names['value'] = true; - } - - $properties = []; - foreach ($names as $name => $_) { - // walking up is required as a private property of a parent class is not - // reachable through the child's ReflectionClass - for ($reflection = new \ReflectionClass($class); false !== $reflection; $reflection = $reflection->getParentClass()) { - if ($reflection->hasProperty($name)) { - $properties[$name] = $reflection->getProperty($name); - - break; - } - } - } - - return $this->sensitiveProperties[$class] = $properties; - } - - /** - * @param list $secrets - */ - private function addSecret(mixed $value, array &$secrets): void - { - // a Stringable secret ends up in the output as its string form, so that is what - // has to be looked for - if ($value instanceof \Stringable) { - try { - $value = $value->__toString(); - } catch (\Throwable) { - return; - } - } - - // ints/floats are left out on purpose, sweeping a digit run out of the output - // would silently corrupt unrelated data - if (\is_string($value) && $value !== '' && \strlen($value) >= $this->minSecretLength) { - $secrets[] = $value; - } - } - - /** - * Removes the collected secrets and applies the configured patterns to the formatter output, - * recursing into arrays to support formatters that do not return a string (e.g. MongoDBFormatter). - * - * @param list $secrets - */ - private function sweep(mixed $formatted, array $secrets, int $depth = 0): mixed - { - if ([] === $this->patterns && [] === $secrets) { - return $formatted; - } - - // deeper than any formatter will render anyway, and a custom one may well - // hand back a self-referencing array - if ($depth > self::MAX_DEPTH) { - return $formatted; - } - - if (\is_string($formatted)) { - if ([] !== $secrets) { - $formatted = str_replace($secrets, $this->mask, $formatted); - } - if ([] !== $this->patterns) { - $replaced = preg_replace($this->patterns, $this->mask, $formatted); - if (null === $replaced) { - // the patterns could not be applied so the output cannot be trusted, drop it - // entirely. Neither the patterns (which may embed a secret themselves) nor the - // mask are reported, preg_last_error_msg() is one of a fixed set of PCRE strings - return '[RedactingFormatter dropped this record, pattern redaction failed with "'.preg_last_error_msg().'"]'; - } - $formatted = $replaced; - } - - return $formatted; - } - - if (\is_array($formatted)) { - foreach ($formatted as $key => $value) { - $formatted[$key] = $this->sweep($value, $secrets, $depth + 1); - } - } - - return $formatted; - } -} diff --git a/core/vendor/monolog/monolog/src/Monolog/Formatter/WrappingFormatterInterface.php b/core/vendor/monolog/monolog/src/Monolog/Formatter/WrappingFormatterInterface.php deleted file mode 100644 index 02a6b8851f..0000000000 --- a/core/vendor/monolog/monolog/src/Monolog/Formatter/WrappingFormatterInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * Interface for formatters decorating another formatter - * - * Handlers which only accept one specific formatter can use Utils::unwrapFormatter() - * to see through the decoration and accept a wrapped instance of that formatter. - * - * @author Jordi Boggiano - */ -interface WrappingFormatterInterface extends FormatterInterface -{ - /** - * Returns the formatter this one delegates the actual formatting to - */ - public function getWrappedFormatter(): FormatterInterface; -} diff --git a/core/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php b/core/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php index 78bec3e6a1..de13a76bec 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php +++ b/core/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php @@ -43,7 +43,7 @@ public function handle(LogRecord $record): bool $this->write($record); - return !$this->getBubble(); + return false === $this->bubble; } /** diff --git a/core/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php b/core/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php index 6d8656b989..788d7d0684 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php +++ b/core/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php @@ -262,7 +262,10 @@ private static function dump(string $title, array $dict): array } $script[] = self::call('log', self::quote('%c%s'), self::quote('font-weight: bold'), self::quote($title)); foreach ($dict as $key => $value) { - $value = Utils::jsonEncode($value, Utils::DEFAULT_JSON_FLAGS | JSON_HEX_TAG); + $value = json_encode($value); + if (false === $value) { + $value = self::quote(''); + } $script[] = self::call('log', self::quote('%s: %o'), self::quote((string) $key), $value); } @@ -271,10 +274,7 @@ private static function dump(string $title, array $dict): array private static function quote(string $arg): string { - // JSON_HEX_TAG keeps a literal < out of the output, so that a log message cannot break out - // of the surrounding or
"; -ob_end_flush(); -?> + +$_SESSION['test'] = 1; +install_sessionCheck(); + +$moduleName = "Evolution CMS"; +$moduleVersion = $evo_branch . ' ' . $evo_version; +$moduleRelease = $evo_release_date; +$moduleSQLBaseFile = "setup.sql"; +$moduleSQLDataFile = "setup.data.sql"; + +$moduleChunks = array (); // chunks - array : name, description, type - 0:file or 1:content, file or content +$moduleTemplates = array (); // templates - array : name, description, type - 0:file or 1:content, file or content +$moduleSnippets = array (); // snippets - array : name, description, type - 0:file or 1:content, file or content,properties +$modulePlugins = array (); // plugins - array : name, description, type - 0:file or 1:content, file or content,properties, events,guid +$moduleModules = array (); // modules - array : name, description, type - 0:file or 1:content, file or content, properties, guid, icon +$moduleTemplates = array (); // templates - array : name, description, type - 0:file or 1:content, file or content,properties +$moduleTVs = array (); // template variables - array : name, description, type - 0:file or 1:content, file or content,properties + +$errors= 0; + +// get post back status +$isPostBack = (count($_POST)); +$action = isset($_GET['action']) && in_array($_GET['action'], ['load', 'options', 'install']) ? $_GET['action'] : 'load'; + +ob_start(); +echo ' +Install + + +

'; + +include($modulePath . '/action.' . $action . '.php'); + +echo "

"; +ob_end_flush(); +?> diff --git a/assets/modules/store/installer/instprocessor-fast.php b/assets/modules/store/installer/instprocessor-fast.php index e56ae28d7d..af83984d64 100644 --- a/assets/modules/store/installer/instprocessor-fast.php +++ b/assets/modules/store/installer/instprocessor-fast.php @@ -1,135 +1,135 @@ -hasPermission('exec_module')) { - die('INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly.'); -} - +hasPermission('exec_module')) { + die('INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly.'); +} + error_reporting(E_ALL & ~E_NOTICE); $moduleurl = 'assets/modules/store/installer/index.php'; -$modulePath = __DIR__; -$self = $modulePath . '/index.php'; -require_once($modulePath . "/functions.php"); -$_lang = array(); -$_params = array(); -require_once($modulePath . "/lang/en.inc.php"); -if (!isset($evo_branch)) { - $evo_branch = ''; -} -if (!isset($evo_version)) { - $evo_version = ''; -} -if (!isset($evo_release_date)) { - $evo_release_date = ''; -} -if (!isset($installPath)) { - $installPath = EVO_BASE_PATH . 'assets/cache/store/install/install'; -} - -$_SESSION['test'] = 1; -install_sessionCheck(); -$moduleName = "Evolution CMS"; -$moduleVersion = $evo_branch . ' ' . $evo_version; -$moduleRelease = $evo_release_date; -$moduleSQLBaseFile = "setup.sql"; -$moduleSQLDataFile = "setup.data.sql"; - -if (!empty($installPath) && is_file($installPath . '/' . $moduleSQLBaseFile)) { - $moduleSQLDataFile = $moduleSQLBaseFile; -} - -$moduleChunks = array(); // chunks - array : name, description, type - 0:file or 1:content, file or content -$moduleTemplates = array(); // templates - array : name, description, type - 0:file or 1:content, file or content -$moduleSnippets = array(); // snippets - array : name, description, type - 0:file or 1:content, file or content,properties -$modulePlugins = array(); // plugins - array : name, description, type - 0:file or 1:content, file or content,properties, events,guid -$moduleModules = array(); // modules - array : name, description, type - 0:file or 1:content, file or content, properties, guid, icon -$moduleTemplates = array(); // templates - array : name, description, type - 0:file or 1:content, file or content,properties -$moduleTVs = array(); // template variables - array : name, description, type - 0:file or 1:content, file or content,properties - -$errors = 0; - -// get post back status -$isPostBack = (count($_POST)); - -$_POST['installmode'] = 1; -//$_POST['installdata'] = 0; -$sqlParser = ''; -$create = false; - -// set timout limit -@set_time_limit(120); // used @ to prevent warning when using safe mode? - +$modulePath = __DIR__; +$self = $modulePath . '/index.php'; +require_once($modulePath . "/functions.php"); +$_lang = array(); +$_params = array(); +require_once($modulePath . "/lang/en.inc.php"); +if (!isset($evo_branch)) { + $evo_branch = ''; +} +if (!isset($evo_version)) { + $evo_version = ''; +} +if (!isset($evo_release_date)) { + $evo_release_date = ''; +} +if (!isset($installPath)) { + $installPath = EVO_BASE_PATH . 'assets/cache/store/install/install'; +} + +$_SESSION['test'] = 1; +install_sessionCheck(); +$moduleName = "Evolution CMS"; +$moduleVersion = $evo_branch . ' ' . $evo_version; +$moduleRelease = $evo_release_date; +$moduleSQLBaseFile = "setup.sql"; +$moduleSQLDataFile = "setup.data.sql"; + +if (!empty($installPath) && is_file($installPath . '/' . $moduleSQLBaseFile)) { + $moduleSQLDataFile = $moduleSQLBaseFile; +} + +$moduleChunks = array(); // chunks - array : name, description, type - 0:file or 1:content, file or content +$moduleTemplates = array(); // templates - array : name, description, type - 0:file or 1:content, file or content +$moduleSnippets = array(); // snippets - array : name, description, type - 0:file or 1:content, file or content,properties +$modulePlugins = array(); // plugins - array : name, description, type - 0:file or 1:content, file or content,properties, events,guid +$moduleModules = array(); // modules - array : name, description, type - 0:file or 1:content, file or content, properties, guid, icon +$moduleTemplates = array(); // templates - array : name, description, type - 0:file or 1:content, file or content,properties +$moduleTVs = array(); // template variables - array : name, description, type - 0:file or 1:content, file or content,properties + +$errors = 0; + +// get post back status +$isPostBack = (count($_POST)); + +$_POST['installmode'] = 1; +//$_POST['installdata'] = 0; +$sqlParser = ''; +$create = false; + +// set timout limit +@set_time_limit(120); // used @ to prevent warning when using safe mode? + $installMode = (int)$_POST['installmode']; $optionsSelected = isset($_POST['options_selected']); $fastInstallAll = !$optionsSelected; $installData = isset($_POST['installdata']) && $_POST['installdata'] == "1" ? 1 : 0; - -// set session name variable -if (!isset ($site_sessionname)) { - $site_sessionname = 'SN' . uniqid(''); -} - -// get base path and url -$a = explode("install", str_replace("\\", "/", dirname($_SERVER["PHP_SELF"]))); -if (count($a) > 1) { - array_pop($a); -} -$url = implode("install", $a); -reset($a); -$a = explode("install", str_replace("\\", "/", realpath(__DIR__))); -if (count($a) > 1) { - array_pop($a); -} -$pth = implode("install", $a); -unset ($a); -$base_url = $url . (substr($url, -1) != "/" ? "/" : ""); -$base_path = $pth . (substr($pth, -1) != "/" ? "/" : ""); - -if (!function_exists('propertiesNameValue')) { - // parses a resource property string and returns the result as an array - // duplicate of method in documentParser class - function propertiesNameValue($propertyString) - { - $parameter = array(); - if (!empty($propertyString)) { - $tmpParams = explode("&", $propertyString); - for ($x = 0; $x < count($tmpParams); $x++) { - if (strpos($tmpParams[$x], '=', 0)) { - $pTmp = explode("=", $tmpParams[$x]); - $pvTmp = explode(";", trim($pTmp[1])); - if ($pvTmp[1] == 'list' && $pvTmp[3] != "") { - $parameter[trim($pTmp[0])] = $pvTmp[3]; //list default - } else { - if ($pvTmp[1] != 'list' && $pvTmp[2] != "") { - $parameter[trim($pTmp[0])] = $pvTmp[2]; - } - } - } - } - } - return $parameter; - } -} - -$setupPath = $modulePath; - -include "{$setupPath}/setup.info.php"; -include "sqlParser.class.php"; - -$databaseConfig = evo()->app['config']['database']['connections']['default']; -$sqlParser = new SqlParser(); -$sqlParser->mode = "upd"; -$sqlParser->ignoreDuplicateErrors = true; - + +// set session name variable +if (!isset ($site_sessionname)) { + $site_sessionname = 'SN' . uniqid(''); +} + +// get base path and url +$a = explode("install", str_replace("\\", "/", dirname($_SERVER["PHP_SELF"]))); +if (count($a) > 1) { + array_pop($a); +} +$url = implode("install", $a); +reset($a); +$a = explode("install", str_replace("\\", "/", realpath(__DIR__))); +if (count($a) > 1) { + array_pop($a); +} +$pth = implode("install", $a); +unset ($a); +$base_url = $url . (substr($url, -1) != "/" ? "/" : ""); +$base_path = $pth . (substr($pth, -1) != "/" ? "/" : ""); + +if (!function_exists('propertiesNameValue')) { + // parses a resource property string and returns the result as an array + // duplicate of method in documentParser class + function propertiesNameValue($propertyString) + { + $parameter = array(); + if (!empty($propertyString)) { + $tmpParams = explode("&", $propertyString); + for ($x = 0; $x < count($tmpParams); $x++) { + if (strpos($tmpParams[$x], '=', 0)) { + $pTmp = explode("=", $tmpParams[$x]); + $pvTmp = explode(";", trim($pTmp[1])); + if ($pvTmp[1] == 'list' && $pvTmp[3] != "") { + $parameter[trim($pTmp[0])] = $pvTmp[3]; //list default + } else { + if ($pvTmp[1] != 'list' && $pvTmp[2] != "") { + $parameter[trim($pTmp[0])] = $pvTmp[2]; + } + } + } + } + } + return $parameter; + } +} + +$setupPath = $modulePath; + +include "{$setupPath}/setup.info.php"; +include "sqlParser.class.php"; + +$databaseConfig = evo()->app['config']['database']['connections']['default']; +$sqlParser = new SqlParser(); +$sqlParser->mode = "upd"; +$sqlParser->ignoreDuplicateErrors = true; + // Install Templates $selTemplates = isset($_POST['template']) && is_array($_POST['template']) ? $_POST['template'] : array(); if (count($moduleTemplates) > 0 && ($fastInstallAll || isset($_POST['template']) || $installData)) { @@ -230,11 +230,11 @@ function propertiesNameValue($propertyString) } } } - } - } - } -} - + } + } + } +} + // Install Chunks $selChunks = isset($_POST['chunk']) && is_array($_POST['chunk']) ? $_POST['chunk'] : array(); if (count($moduleChunks) > 0 && ($fastInstallAll || isset($_POST['chunk']) || $installData)) { @@ -331,108 +331,108 @@ function propertiesNameValue($propertyString) continue; } $name = $modulePlugin[0]; - $desc = $modulePlugin[1]; - $filecontent = $modulePlugin[2]; - $properties = $modulePlugin[3]; - $events = explode(",", $modulePlugin[4]); - $guid = $modulePlugin[5]; - $category = $modulePlugin[6]; - $leg_names = []; - $disabled = $modulePlugin[9]; - if (array_key_exists(7, $modulePlugin)) { - // parse comma-separated legacy names and prepare them for sql IN clause - $leg_names = preg_split('/\s*,\s*/', $modulePlugin[7]); - } - if (!file_exists($filecontent)) { - echo "

  $name: " . $_lang['unable_install_plugin'] . " '$filecontent' " . $_lang['not_found'] . ".

"; - } else { - // disable legacy versions based on legacy_names provided - if (count($leg_names)) { - \EvolutionCMS\Models\SitePlugin::query()->whereIn('name', $leg_names)->update(['disabled' => 1]); - } - - // Create the category if it does not already exist - $category = getCreateDbCategory($category, $sqlParser); - $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); - $plugin = end($tmp); - // remove installer docblock - $plugin = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $plugin, 1); - $pluginDbRecord = \EvolutionCMS\Models\SitePlugin::where('name', $name)->orderBy('id'); - $prev_id = null; - - if ($pluginDbRecord->count() > 0) { - $insert = true; - foreach ($pluginDbRecord->get()->toArray() as $row) { - $properties = propUpdate($properties, $row['properties']); - if ($row['description'] == $desc) { - \EvolutionCMS\Models\SitePlugin::query()->where('id', $row['id'])->update(['plugincode' => $plugin, 'description' => $desc, 'properties' => $properties]); - - $insert = false; - } else { - \EvolutionCMS\Models\SitePlugin::query()->where('id', $row['id'])->update(['disabled' => 1]); - } - $prev_id = $row['id']; - } - if ($insert === true) { - $properties = propUpdate($properties, $row['properties']); - - \EvolutionCMS\Models\SitePlugin::query()->create(['name' => $name, 'plugincode' => $plugin, 'description' => $desc, 'properties' => $properties, 'moduleguid' => $guid, 'disabled' => 0, 'category' => $category]); - } - echo "

  $name: " . $_lang['upgraded'] . "

"; - } else { - $properties = parseProperties($properties, true); - \EvolutionCMS\Models\SitePlugin::query()->create(['name' => $name, 'plugincode' => $plugin, 'description' => $desc, 'properties' => $properties, 'moduleguid' => $guid, 'disabled' => $disabled, 'category' => $category]); - echo "

  $name: " . $_lang['installed'] . "

"; - } - // add system events - if (count($events) > 0) { - $sitePlugin = \EvolutionCMS\Models\SitePlugin::where('name', $name)->where('description', $desc)->first(); - if (!is_null($sitePlugin)) { - $id = $sitePlugin->id; - - // add new events - foreach ($events as $event) { - $eventName = \EvolutionCMS\Models\SystemEventname::where('name', $event)->first(); - if (!is_null($eventName)) { - $prev_priority = null; - if ($prev_id) { - $pluginEvent = \EvolutionCMS\Models\SitePluginEvent::query() - ->where('pluginid', $prev_id) - ->where('evtid', $eventName->getKey())->first(); - if (!is_null($pluginEvent)) { - $prev_priority = $pluginEvent->priority; - } - } - if (is_null($prev_priority)) { - $pluginEvent = \EvolutionCMS\Models\SitePluginEvent::query() - ->where('evtid', $eventName->getKey()) - ->orderBy('priority', 'DESC')->first(); - if (!is_null($pluginEvent)) { - $prev_priority = $pluginEvent->priority; - $prev_priority++; - } - } - if (is_null($prev_priority)) { - $prev_priority = 0; - } - $arrInsert = ['pluginid' => $id, 'evtid' => $eventName->getKey(), 'priority' => $prev_priority]; - \EvolutionCMS\Models\SitePluginEvent::query() - ->firstOrCreate($arrInsert); - } - } - - // remove absent events - \EvolutionCMS\Models\SitePluginEvent::query()->join('system_eventnames', function ($join) use ($events) { - $join->on('site_plugin_events.evtid', '=', 'system_eventnames.id') - ->whereIn('name', $events); - })->whereNull('name') - ->where('pluginid', $id)->delete(); - } - } - } - } -} - + $desc = $modulePlugin[1]; + $filecontent = $modulePlugin[2]; + $properties = $modulePlugin[3]; + $events = explode(",", $modulePlugin[4]); + $guid = $modulePlugin[5]; + $category = $modulePlugin[6]; + $leg_names = []; + $disabled = $modulePlugin[9]; + if (array_key_exists(7, $modulePlugin)) { + // parse comma-separated legacy names and prepare them for sql IN clause + $leg_names = preg_split('/\s*,\s*/', $modulePlugin[7]); + } + if (!file_exists($filecontent)) { + echo "

  $name: " . $_lang['unable_install_plugin'] . " '$filecontent' " . $_lang['not_found'] . ".

"; + } else { + // disable legacy versions based on legacy_names provided + if (count($leg_names)) { + \EvolutionCMS\Models\SitePlugin::query()->whereIn('name', $leg_names)->update(['disabled' => 1]); + } + + // Create the category if it does not already exist + $category = getCreateDbCategory($category, $sqlParser); + $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); + $plugin = end($tmp); + // remove installer docblock + $plugin = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $plugin, 1); + $pluginDbRecord = \EvolutionCMS\Models\SitePlugin::where('name', $name)->orderBy('id'); + $prev_id = null; + + if ($pluginDbRecord->count() > 0) { + $insert = true; + foreach ($pluginDbRecord->get()->toArray() as $row) { + $properties = propUpdate($properties, $row['properties']); + if ($row['description'] == $desc) { + \EvolutionCMS\Models\SitePlugin::query()->where('id', $row['id'])->update(['plugincode' => $plugin, 'description' => $desc, 'properties' => $properties]); + + $insert = false; + } else { + \EvolutionCMS\Models\SitePlugin::query()->where('id', $row['id'])->update(['disabled' => 1]); + } + $prev_id = $row['id']; + } + if ($insert === true) { + $properties = propUpdate($properties, $row['properties']); + + \EvolutionCMS\Models\SitePlugin::query()->create(['name' => $name, 'plugincode' => $plugin, 'description' => $desc, 'properties' => $properties, 'moduleguid' => $guid, 'disabled' => 0, 'category' => $category]); + } + echo "

  $name: " . $_lang['upgraded'] . "

"; + } else { + $properties = parseProperties($properties, true); + \EvolutionCMS\Models\SitePlugin::query()->create(['name' => $name, 'plugincode' => $plugin, 'description' => $desc, 'properties' => $properties, 'moduleguid' => $guid, 'disabled' => $disabled, 'category' => $category]); + echo "

  $name: " . $_lang['installed'] . "

"; + } + // add system events + if (count($events) > 0) { + $sitePlugin = \EvolutionCMS\Models\SitePlugin::where('name', $name)->where('description', $desc)->first(); + if (!is_null($sitePlugin)) { + $id = $sitePlugin->id; + + // add new events + foreach ($events as $event) { + $eventName = \EvolutionCMS\Models\SystemEventname::where('name', $event)->first(); + if (!is_null($eventName)) { + $prev_priority = null; + if ($prev_id) { + $pluginEvent = \EvolutionCMS\Models\SitePluginEvent::query() + ->where('pluginid', $prev_id) + ->where('evtid', $eventName->getKey())->first(); + if (!is_null($pluginEvent)) { + $prev_priority = $pluginEvent->priority; + } + } + if (is_null($prev_priority)) { + $pluginEvent = \EvolutionCMS\Models\SitePluginEvent::query() + ->where('evtid', $eventName->getKey()) + ->orderBy('priority', 'DESC')->first(); + if (!is_null($pluginEvent)) { + $prev_priority = $pluginEvent->priority; + $prev_priority++; + } + } + if (is_null($prev_priority)) { + $prev_priority = 0; + } + $arrInsert = ['pluginid' => $id, 'evtid' => $eventName->getKey(), 'priority' => $prev_priority]; + \EvolutionCMS\Models\SitePluginEvent::query() + ->firstOrCreate($arrInsert); + } + } + + // remove absent events + \EvolutionCMS\Models\SitePluginEvent::query()->join('system_eventnames', function ($join) use ($events) { + $join->on('site_plugin_events.evtid', '=', 'system_eventnames.id') + ->whereIn('name', $events); + })->whereNull('name') + ->where('pluginid', $id)->delete(); + } + } + } + } +} + // Install Snippets $selSnips = isset($_POST['snippet']) && is_array($_POST['snippet']) ? $_POST['snippet'] : array(); if (count($moduleSnippets) > 0 && ($fastInstallAll || isset($_POST['snippet']) || $installData)) { @@ -444,144 +444,144 @@ function propertiesNameValue($propertyString) continue; } $name = $moduleSnippet[0]; - $desc = $moduleSnippet[1]; - $filecontent = $moduleSnippet[2]; - $properties = $moduleSnippet[3]; - $category = $moduleSnippet[4]; - if (!file_exists($filecontent)) { - echo "

  $name: " . $_lang['unable_install_snippet'] . " '$filecontent' " . $_lang['not_found'] . ".

"; - } else { - // Create the category if it does not already exist - $category = getCreateDbCategory($category, $sqlParser); - $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); - $snippet = end($tmp); - // remove installer docblock - $snippet = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $snippet, 1); - $snippetDbRecord = \EvolutionCMS\Models\SiteSnippet::query()->where('name', $name)->first(); - - if (!is_null($snippetDbRecord)) { - $properties = propUpdate($properties, $snippetDbRecord->properties); - \EvolutionCMS\Models\SiteSnippet::query()->where('name', $name)->update(['snippet' => $snippet, 'description' => $desc, 'properties' => $properties]); - - echo "

  $name: " . $_lang['upgraded'] . "

"; - } else { - $properties = parseProperties($properties, true); - \EvolutionCMS\Models\SiteSnippet::query()->insert(['name' => $name, 'snippet' => $snippet, 'description' => $desc, 'properties' => $properties, 'category' => $category]); - echo "

  $name: " . $_lang['installed'] . "

"; - } - } - } -} - -// install data -if (is_file($installPath . '/' . $moduleSQLDataFile)) { - echo "

" . $_lang['installing_demo_site']; - $sqlParser->process($installPath . '/' . $moduleSQLDataFile); - // display database results - if ($sqlParser->installFailed == true) { - $errors += 1; - echo "" . $_lang['database_alerts'] . "

"; - echo "

" . $_lang['setup_couldnt_install'] . "

"; - echo "

" . $_lang['installation_error_occured'] . "

"; - for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) { - echo "" . $sqlParser->mysqlErrors[$i]["error"] . "" . $_lang['during_execution_of_sql'] . "" . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . ".


"; - } - echo "

"; - echo "

" . $_lang['some_tables_not_updated'] . "

"; - return; - } else { - echo "" . $_lang['ok'] . "

"; - } -} - -// always empty cache after install -evo()->clearCache('full'); - -// setup completed! -echo "

" . $_lang['installation_successful'] . "

"; - -// Property Update function -function propUpdate($new, $old) -{ - $newArr = parseProperties($new); - $oldArr = parseProperties($old); - foreach ($oldArr as $k => $v) { - if (isset($v['0']['options']) && isset($newArr[$k]['0']['options'])) { - $oldArr[$k]['0']['options'] = $newArr[$k]['0']['options']; - } - } - $return = $oldArr + $newArr; - $return = json_encode($return, JSON_UNESCAPED_UNICODE); - $return = ($return != '[]') ? $return : ''; - return $return; -} - -function parseProperties($propertyString, $json = false) -{ - $propertyString = str_replace('{}', '', $propertyString); - $propertyString = str_replace('} {', ',', $propertyString); - - if (empty($propertyString) || $propertyString == '{}' || $propertyString == '[]') { - $propertyString = ''; - } - - $jsonFormat = isJson($propertyString, true); - $property = array(); - // old format - if ($jsonFormat === false) { - $props = explode('&', $propertyString); - $arr = array(); - $key = array(); - foreach ($props as $prop) { - if ($prop != '') { - $arr = explode(';', $prop); - $key = explode('=', $arr['0']); - $property[$key['0']]['0']['label'] = trim($key['1']); - $property[$key['0']]['0']['type'] = trim($arr['1']); - switch ($arr['1']) { - case 'list': - case 'list-multi': - case 'checkbox': - case 'radio': - case 'menu': - $property[$key['0']]['0']['value'] = trim($arr['3']); - $property[$key['0']]['0']['options'] = trim($arr['2']); - $property[$key['0']]['0']['default'] = trim($arr['3']); - break; - default: - $property[$key['0']]['0']['value'] = trim($arr['2']); - $property[$key['0']]['0']['default'] = trim($arr['2']); - } - $property[$key['0']]['0']['desc'] = ''; - } - } - // new json-format - } else if (!empty($jsonFormat)) { - $property = $jsonFormat; - } - if ($json) { - $property = json_encode($property, JSON_UNESCAPED_UNICODE); - } - $property = ($property != '[]') ? $property : ''; - return $property; -} - -function isJson($string, $returnData = false) -{ - $data = json_decode($string, true); - return (json_last_error() == JSON_ERROR_NONE) ? ($returnData ? $data : true) : false; -} - -function getCreateDbCategory($category) -{ - $category_id = 0; - if (!empty($category)) { - $categoryDbRecord = \EvolutionCMS\Models\Category::query()->where('category', $category)->first(); - if (!is_null($categoryDbRecord)) { - $category_id = $categoryDbRecord->getKey(); - } else { - $category_id = \EvolutionCMS\Models\Category::query()->insertGetId(['category' => $category]); - } - } - return $category_id; -} + $desc = $moduleSnippet[1]; + $filecontent = $moduleSnippet[2]; + $properties = $moduleSnippet[3]; + $category = $moduleSnippet[4]; + if (!file_exists($filecontent)) { + echo "

  $name: " . $_lang['unable_install_snippet'] . " '$filecontent' " . $_lang['not_found'] . ".

"; + } else { + // Create the category if it does not already exist + $category = getCreateDbCategory($category, $sqlParser); + $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); + $snippet = end($tmp); + // remove installer docblock + $snippet = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $snippet, 1); + $snippetDbRecord = \EvolutionCMS\Models\SiteSnippet::query()->where('name', $name)->first(); + + if (!is_null($snippetDbRecord)) { + $properties = propUpdate($properties, $snippetDbRecord->properties); + \EvolutionCMS\Models\SiteSnippet::query()->where('name', $name)->update(['snippet' => $snippet, 'description' => $desc, 'properties' => $properties]); + + echo "

  $name: " . $_lang['upgraded'] . "

"; + } else { + $properties = parseProperties($properties, true); + \EvolutionCMS\Models\SiteSnippet::query()->insert(['name' => $name, 'snippet' => $snippet, 'description' => $desc, 'properties' => $properties, 'category' => $category]); + echo "

  $name: " . $_lang['installed'] . "

"; + } + } + } +} + +// install data +if (is_file($installPath . '/' . $moduleSQLDataFile)) { + echo "

" . $_lang['installing_demo_site']; + $sqlParser->process($installPath . '/' . $moduleSQLDataFile); + // display database results + if ($sqlParser->installFailed == true) { + $errors += 1; + echo "" . $_lang['database_alerts'] . "

"; + echo "

" . $_lang['setup_couldnt_install'] . "

"; + echo "

" . $_lang['installation_error_occured'] . "

"; + for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) { + echo "" . $sqlParser->mysqlErrors[$i]["error"] . "" . $_lang['during_execution_of_sql'] . "" . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . ".


"; + } + echo "

"; + echo "

" . $_lang['some_tables_not_updated'] . "

"; + return; + } else { + echo "" . $_lang['ok'] . "

"; + } +} + +// always empty cache after install +evo()->clearCache('full'); + +// setup completed! +echo "

" . $_lang['installation_successful'] . "

"; + +// Property Update function +function propUpdate($new, $old) +{ + $newArr = parseProperties($new); + $oldArr = parseProperties($old); + foreach ($oldArr as $k => $v) { + if (isset($v['0']['options']) && isset($newArr[$k]['0']['options'])) { + $oldArr[$k]['0']['options'] = $newArr[$k]['0']['options']; + } + } + $return = $oldArr + $newArr; + $return = json_encode($return, JSON_UNESCAPED_UNICODE); + $return = ($return != '[]') ? $return : ''; + return $return; +} + +function parseProperties($propertyString, $json = false) +{ + $propertyString = str_replace('{}', '', $propertyString); + $propertyString = str_replace('} {', ',', $propertyString); + + if (empty($propertyString) || $propertyString == '{}' || $propertyString == '[]') { + $propertyString = ''; + } + + $jsonFormat = isJson($propertyString, true); + $property = array(); + // old format + if ($jsonFormat === false) { + $props = explode('&', $propertyString); + $arr = array(); + $key = array(); + foreach ($props as $prop) { + if ($prop != '') { + $arr = explode(';', $prop); + $key = explode('=', $arr['0']); + $property[$key['0']]['0']['label'] = trim($key['1']); + $property[$key['0']]['0']['type'] = trim($arr['1']); + switch ($arr['1']) { + case 'list': + case 'list-multi': + case 'checkbox': + case 'radio': + case 'menu': + $property[$key['0']]['0']['value'] = trim($arr['3']); + $property[$key['0']]['0']['options'] = trim($arr['2']); + $property[$key['0']]['0']['default'] = trim($arr['3']); + break; + default: + $property[$key['0']]['0']['value'] = trim($arr['2']); + $property[$key['0']]['0']['default'] = trim($arr['2']); + } + $property[$key['0']]['0']['desc'] = ''; + } + } + // new json-format + } else if (!empty($jsonFormat)) { + $property = $jsonFormat; + } + if ($json) { + $property = json_encode($property, JSON_UNESCAPED_UNICODE); + } + $property = ($property != '[]') ? $property : ''; + return $property; +} + +function isJson($string, $returnData = false) +{ + $data = json_decode($string, true); + return (json_last_error() == JSON_ERROR_NONE) ? ($returnData ? $data : true) : false; +} + +function getCreateDbCategory($category) +{ + $category_id = 0; + if (!empty($category)) { + $categoryDbRecord = \EvolutionCMS\Models\Category::query()->where('category', $category)->first(); + if (!is_null($categoryDbRecord)) { + $category_id = $categoryDbRecord->getKey(); + } else { + $category_id = \EvolutionCMS\Models\Category::query()->insertGetId(['category' => $category]); + } + } + return $category_id; +} diff --git a/assets/modules/store/installer/instprocessor.php b/assets/modules/store/installer/instprocessor.php index c9907d437f..f5d9574d8a 100644 --- a/assets/modules/store/installer/instprocessor.php +++ b/assets/modules/store/installer/instprocessor.php @@ -1,566 +1,566 @@ -hasPermission('exec_module')) { - die('INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly.'); -} - -$_POST['installmode'] = 1; -//$_POST['installdata'] = 0; -$sqlParser = ''; -$create = false; - -// set timout limit -@set_time_limit(120); // used @ to prevent warning when using safe mode? - -$installMode= (int)$_POST['installmode']; -$installData = $_POST['installdata'] == "1" ? 1 : 0; - -// set session name variable -if (!isset ($site_sessionname)) { - $site_sessionname = 'SN' . uniqid(''); -} - -// get base path and url -$a = explode("install", str_replace("\\", "/", dirname($_SERVER["PHP_SELF"]))); -if (count($a) > 1) { - array_pop($a); -} -$url = implode("install", $a); -reset($a); -$a = explode("install", str_replace("\\", "/", realpath(__DIR__))); -if (count($a) > 1) { - array_pop($a); -} -$pth = implode("install", $a); -unset ($a); -$base_url = $url . (substr($url, -1) != "/" ? "/" : ""); -$base_path = $pth . (substr($pth, -1) != "/" ? "/" : ""); - -if (!function_exists('propertiesNameValue')) { - // parses a resource property string and returns the result as an array - // duplicate of method in documentParser class - function propertiesNameValue($propertyString) { - $parameter= array (); - if (!empty ($propertyString)) { - $tmpParams= explode("&", $propertyString); - for ($x= 0; $x < count($tmpParams); $x++) { - if (strpos($tmpParams[$x], '=', 0)) { - $pTmp= explode("=", $tmpParams[$x]); - $pvTmp= explode(";", trim($pTmp[1])); - if ($pvTmp[1] == 'list' && $pvTmp[3] != "") { - $parameter[trim($pTmp[0])] = $pvTmp[3]; //list default - } else { - if ($pvTmp[1] != 'list' && $pvTmp[2] != "") { - $parameter[trim($pTmp[0])] = $pvTmp[2]; - } - } - } - } - } - return $parameter; - } -} -$table_prefix = evo()->getDatabase()->getConfig('prefix'); -$setupPath = $modulePath; -include "{$setupPath}/setup.info.php"; -include "{$setupPath}/sqlParser.class.php"; -$sqlParser = new SqlParser(); - -// Install Templates -if (isset ($_POST['template']) || $installData) { - echo "

" . $_lang['templates'] . ":

"; - $selTemplates = $_POST['template']; - foreach ($moduleTemplates as $k => $moduleTemplate) { - $installSample = in_array('sample', $moduleTemplate[6]) && $installData == 1; - if($installSample || in_array($k, $selTemplates)) { - $name = EvolutionCms()->getDatabase()->escape($moduleTemplate[0]); - $desc = EvolutionCms()->getDatabase()->escape($moduleTemplate[1]); - $category = EvolutionCms()->getDatabase()->escape($moduleTemplate[4]); - $locked = EvolutionCms()->getDatabase()->escape($moduleTemplate[5]); - $filecontent = $moduleTemplate[3]; - if (!file_exists($filecontent)) { - echo "

  $name: " . $_lang['unable_install_template'] . " '$filecontent' " . $_lang['not_found'] . ".

"; - } else { - // Create the category if it does not already exist - $category_id = getCreateDbCategory($category, $sqlParser); - - // Strip the first comment up top - $template = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', file_get_contents($filecontent), 1); - $template = EvolutionCms()->getDatabase()->escape($template); - - // See if the template already exists - $rs = evo()->getDatabase()->query("SELECT * FROM `" . $table_prefix . "site_templates` WHERE templatename='$name'"); - - if (evo()->getDatabase()->getRecordCount($rs)) { - if (!@evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_templates` SET content='$template', description='$desc', category='$category_id', locked='$locked' WHERE templatename='$name';")) { - $errors += 1; - echo "

" . mysql_error() . "

"; - return; - } - echo "

  $name: " . $_lang['upgraded'] . "

"; - } else { - if (!@evo()->getDatabase()->query("INSERT INTO `" . $table_prefix . "site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template','$category_id','$locked');")) { - $errors += 1; - echo "

" . mysql_error() . "

"; - return; - } - echo "

  $name: " . $_lang['installed'] . "

"; - } - } - } - } -} - -// Install Template Variables -if (isset ($_POST['tv']) || $installData) { - echo "

" . $_lang['tvs'] . ":

"; - $selTVs = $_POST['tv']; - foreach ($moduleTVs as $k=>$moduleTV) { - $installSample = in_array('sample', $moduleTV[12]) && $installData == 1; - if($installSample || in_array($k, $selTVs)) { - $name = evo()->getDatabase()->escape($moduleTV[0]); - $caption = evo()->getDatabase()->escape($moduleTV[1]); - $desc = evo()->getDatabase()->escape($moduleTV[2]); - $input_type = evo()->getDatabase()->escape($moduleTV[3]); - $input_options = evo()->getDatabase()->escape($moduleTV[4]); - $input_default = evo()->getDatabase()->escape($moduleTV[5]); - $output_widget = evo()->getDatabase()->escape($moduleTV[6]); - $output_widget_params = evo()->getDatabase()->escape($moduleTV[7]); - $filecontent = $moduleTV[8]; - $assignments = $moduleTV[9]; - $category = evo()->getDatabase()->escape($moduleTV[10]); - $locked = evo()->getDatabase()->escape($moduleTV[11]); - - // Create the category if it does not already exist - $category = getCreateDbCategory($category, $sqlParser); - - $rs = evo()->getDatabase()->query("SELECT * FROM `" . $table_prefix . "site_tmplvars` WHERE name='$name'"); - if (evo()->getDatabase()->getRecordCount($rs)) { - $insert = true; - while($row = evo()->getDatabase()->getRow($rs,'assoc')) { - if (!@evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category='$category', locked='$locked', elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id='{$row['id']}';")) { - echo "

" . mysql_error() . "

"; - return; - } - $insert = false; - } - echo "

  $name: " . $_lang['upgraded'] . "

"; - } else { - //$q = "INSERT INTO `" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',(SELECT (CASE COUNT(*) WHEN 0 THEN 0 ELSE `id` END) `id` FROM `" . $table_prefix . "categories` WHERE `category` = '$category'),$locked,'$input_options','$output_widget','$output_widget_params','$input_default');"; - $q = "INSERT INTO `" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc','$category','$locked','$input_options','$output_widget','$output_widget_params','$input_default');"; - if (!@evo()->getDatabase()->query($q)) { - echo "

" . mysql_error() . "

"; - return; - } - echo "

  $name: " . $_lang['installed'] . "

"; - } - - // add template assignments - if (trim($assignments) != ''){ - $assignments = explode(',', $assignments); - - if (count($assignments) > 0) { - - // remove existing tv -> template assignments - $ds = evo()->getDatabase()->query("SELECT id FROM `".$table_prefix."site_tmplvars` WHERE name='$name' AND description='$desc';" ); - $row = evo()->getDatabase()->getRow($ds,'assoc'); - $id = $row["id"]; - evo()->getDatabase()->query("DELETE FROM $dbase.`" . $table_prefix . "site_tmplvar_templates` WHERE tmplvarid = '$id';"); - - // add tv -> template assignments - foreach ($assignments as $assignment) { - $template = evo()->getDatabase()->escape($assignment); - $where = "WHERE templatename='$template'"; - if ($template=='*') $where =''; - $ts = evo()->getDatabase()->query("SELECT id FROM `".$table_prefix."site_templates` $where;" ); - if ($ds && $ts) { - $tRow = evo()->getDatabase()->getRow($ts,'assoc'); - $templateId = $tRow['id']; - evo()->getDatabase()->query("INSERT INTO `" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES('$id', '$templateId');"); - } - } - } - } - } - } -} - -// Install Chunks -if (isset ($_POST['chunk']) || $installData) { - echo "

" . $_lang['chunks'] . ":

"; - $selChunks = $_POST['chunk']; - foreach ($moduleChunks as $k => $moduleChunk) { - $installSample = in_array('sample', $moduleChunk[5]) && $installData == 1; - if ($installSample || in_array($k, $selChunks)) { - $name = evo()->getDatabase()->escape($moduleChunk[0]); - $desc = evo()->getDatabase()->escape($moduleChunk[1]); - $category = evo()->getDatabase()->escape($moduleChunk[3]); - $overwrite = evo()->getDatabase()->escape($moduleChunk[4]); - $filecontent = $moduleChunk[2]; - - if (!file_exists($filecontent)) { - echo "

  $name: " . $_lang['unable_install_chunk'] . " '$filecontent' " . $_lang['not_found'] . ".

"; - } else { - // Create the category if it does not already exist - $category_id = getCreateDbCategory($category, $sqlParser); - - $chunk = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', file_get_contents($filecontent), 1); - $chunk = evo()->getDatabase()->escape($chunk); - $rs = evo()->getDatabase()->query("SELECT * FROM `" . $table_prefix . "site_htmlsnippets` WHERE name='$name'"); - $count_original_name = evo()->getDatabase()->getRecordCount($rs); - if ($overwrite == 'false') { - $newname = $name . '-' . str_replace('.', '_', $evo_version); - $rs = evo()->getDatabase()->query("SELECT * FROM `" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'"); - $count_new_name = evo()->getDatabase()->getRecordCount($rs); - } - $update = $count_original_name > 0 && $overwrite == 'true'; - if ($update) { - if (!@evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category='$category_id' WHERE name='$name';")) { - $errors += 1; - echo "

" . mysql_error() . "

"; - return; - } - echo "

  $name: " . $_lang['upgraded'] . "

"; - } elseif ($count_new_name == 0) { - if ($count_original_name > 0 && $overwrite == 'false') { - $name = $newname; - } - if (!@evo()->getDatabase()->query("INSERT INTO `" . $table_prefix . "site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk','$category_id');")) { - $errors += 1; - echo "

" . mysql_error() . "

"; - return; - } - echo "

  $name: " . $_lang['installed'] . "

"; - } - } - } - } -} - -// Install Modules -if (isset($_POST['module']) || $installData) { - echo "

" . $_lang['modules'] . ":

"; - $selModules = $_POST['module']; - foreach ($moduleModules as $k => $moduleModule) { - $installSample = in_array('sample', $moduleModule[7]) && $installData == 1; - if ($installSample || in_array($k, $selModules)) { - $name = evo()->getDatabase()->escape($moduleModule[0]); - $desc = evo()->getDatabase()->escape($moduleModule[1]); - $filecontent = $moduleModule[2]; - $properties = $moduleModule[3]; - $guid = evo()->getDatabase()->escape($moduleModule[4]); - $shared = evo()->getDatabase()->escape($moduleModule[5]); - $category = evo()->getDatabase()->escape($moduleModule[6]); - $icon = evo()->getDatabase()->escape($moduleModule[8]); - if (!file_exists($filecontent)) { - echo "

  $name: " . $_lang['unable_install_module'] . " '$filecontent' " . $_lang['not_found'] . ".

"; - } else { - // Create the category if it does not already exist - $category = getCreateDbCategory($category, $sqlParser); - $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); - $module = end($tmp); - // remove installer docblock - $module = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $module, 1); - $module = evo()->getDatabase()->escape($module); - $rs = evo()->getDatabase()->query("SELECT * FROM `" . $table_prefix . "site_modules` WHERE name='$name'"); - if (evo()->getDatabase()->getRecordCount($rs)) { - $row = evo()->getDatabase()->getRow($rs,'assoc'); - $props = evo()->getDatabase()->escape(propUpdate($properties,$row['properties'])); - if (!@evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared', icon='$icon' WHERE name='$name';")) { - echo "

" . mysql_error() . "

"; - return; - } - echo "

  $name: " . $_lang['upgraded'] . "

"; - } else { - $properties = evo()->getDatabase()->escape(parseProperties($properties, true)); - if (!@evo()->getDatabase()->query("INSERT INTO `" . $table_prefix . "site_modules` (name, description, modulecode, properties, guid, enable_sharedparams, category, icon) VALUES('$name', '$desc', '$module', '$properties', '$guid', '$shared', '$category', '$icon');")) { - echo "

" . mysql_error() . "

"; - return; - } - echo "

  $name: " . $_lang['installed'] . "

"; - } - } - } - } -} - -// Install Plugins -if (isset ($_POST['plugin']) || $installData) { - echo "

" . $_lang['plugins'] . ":

"; - $selPlugs = $_POST['plugin']; - foreach ($modulePlugins as $k=>$modulePlugin) { - $installSample = in_array('sample', $modulePlugin[8]) && $installData == 1; - if($installSample || in_array($k, $selPlugs)) { - $name = evo()->getDatabase()->escape($modulePlugin[0]); - $desc = evo()->getDatabase()->escape($modulePlugin[1]); - $filecontent = $modulePlugin[2]; - $properties = $modulePlugin[3]; - $events = explode(",", $modulePlugin[4]); - $guid = evo()->getDatabase()->escape($modulePlugin[5]); - $category = evo()->getDatabase()->escape($modulePlugin[6]); - $leg_names = ''; - $disabled = $modulePlugin[9]; - if (array_key_exists(7, $modulePlugin)) { - // parse comma-separated legacy names and prepare them for sql IN clause - $leg_names = "'" . implode("','", preg_split('/\s*,\s*/', evo()->getDatabase()->escape($modulePlugin[7]))) . "'"; - } - if (!file_exists($filecontent)) { - echo "

  $name: " . $_lang['unable_install_plugin'] . " '$filecontent' " . $_lang['not_found'] . ".

"; - } else { - // disable legacy versions based on legacy_names provided - if (!empty($leg_names)) { - $update_query = "UPDATE `" . $table_prefix . "site_plugins` SET disabled='1' WHERE name IN ($leg_names);"; - $rs = evo()->getDatabase()->query($update_query); - } - - // Create the category if it does not already exist - $category = getCreateDbCategory($category, $sqlParser); - $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); - $plugin = end($tmp); - // remove installer docblock - $plugin = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $plugin, 1); - $plugin = evo()->getDatabase()->escape($plugin); - $rs = evo()->getDatabase()->query("SELECT * FROM `" . $table_prefix . "site_plugins` WHERE name='$name' ORDER BY id"); - $prev_id = null; - if (evo()->getDatabase()->getRecordCount($rs)) { - $insert = true; - while($row = evo()->getDatabase()->getRow($rs,'assoc')) { - $props = evo()->getDatabase()->escape(propUpdate($properties,$row['properties'])); - if ($row['description'] == $desc) { - if (!@evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id='{$row['id']}';")) { - echo "

" . mysql_error() . "

"; - return; - } - $insert = false; - } else { - if (!@evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_plugins` SET disabled='1' WHERE id='{$row['id']}';")) { - echo "

".mysql_error()."

"; - return; - } - } - $prev_id = $row['id']; - } - if ($insert === true) { - if(!@evo()->getDatabase()->query("INSERT INTO `".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$props','$guid','0','$category');" )) { - echo "

".mysql_error()."

"; - return; - } - } - echo "

  $name: " . $_lang['upgraded'] . "

"; - } else { - $properties = evo()->getDatabase()->escape(parseProperties($properties, true)); - if (!@evo()->getDatabase()->query("INSERT INTO `" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','$disabled','$category');")) { - echo "

" . mysql_error() . "

"; - return; - } - echo "

  $name: " . $_lang['installed'] . "

"; - } - // add system events - if (count($events) > 0) { - $ds = evo()->getDatabase()->query("SELECT id FROM `".$table_prefix."site_plugins` WHERE name='$name' AND description='$desc' ORDER BY id DESC LIMIT 1;" ); - if ($ds) { - $row = evo()->getDatabase()->getRow($ds,'assoc'); - $id = $row["id"]; - $_events = implode("','", $events); - - // add new events - if ($prev_id) { - $prev_id = EvolutionCms()->getDatabase()->escape($prev_id); - - evo()->getDatabase()->query("INSERT OR IGNORE INTO `{$table_prefix}site_plugin_events` (`pluginid`, `evtid`, `priority`) - SELECT {$id} as 'pluginid', `se`.`id` AS `evtid`, COALESCE(`spe`.`priority`, MAX(`spe2`.`priority`) + 1, 0) AS `priority` - FROM `{$table_prefix}system_eventnames` `se` - LEFT JOIN `{$table_prefix}site_plugin_events` `spe` ON `spe`.`evtid` = `se`.`id` AND `spe`.`pluginid` = {$prev_id} - LEFT JOIN `{$table_prefix}site_plugin_events` `spe2` ON `spe2`.`evtid` = `se`.`id` - WHERE name IN ('{$_events}') - GROUP BY `se`.`id` - "); - } else { - evo()->getDatabase()->query("INSERT OR IGNORE INTO `{$table_prefix}site_plugin_events` (`pluginid`, `evtid`, `priority`) - SELECT {$id} as `pluginid`, `se`.`id` as `evtid`, COALESCE(MAX(`spe`.`priority`) + 1, 0) as `priority` - FROM `{$table_prefix}system_eventnames` `se` - LEFT JOIN `{$table_prefix}site_plugin_events` `spe` ON `spe`.`evtid` = `se`.`id` - WHERE `name` IN ('{$_events}') GROUP BY `se`.`id` - "); - } - - // remove existing events - evo()->getDatabase()->query("DELETE `pe` FROM `{$table_prefix}site_plugin_events` `pe` LEFT JOIN `{$table_prefix}system_eventnames` `se` ON `pe`.`evtid`=`se`.`id` AND `name` IN ('{$_events}') WHERE `name` IS NULL AND `pluginid` = {$id}"); - } - } - } - } - } -} - -// Install Snippets -if (isset ($_POST['snippet']) || $installData) { - echo "

" . $_lang['snippets'] . ":

"; - $selSnips = $_POST['snippet']; - foreach ($moduleSnippets as $k => $moduleSnippet) { - if (!is_array($moduleSnippet) || !isset($moduleSnippet[5]) || !is_array($moduleSnippet[5])) continue; - $installSample = in_array('sample', $moduleSnippet[5]) && $installData == 1; - if($installSample || in_array($k, $selSnips)) { - $name = evo()->getDatabase()->escape($moduleSnippet[0]); - $desc = evo()->getDatabase()->escape($moduleSnippet[1]); - $filecontent = $moduleSnippet[2]; - $properties = $moduleSnippet[3]; - $category = evo()->getDatabase()->escape($moduleSnippet[4]); - if (!file_exists($filecontent)) { - echo "

  $name: " . $_lang['unable_install_snippet'] . " '$filecontent' " . $_lang['not_found'] . ".

"; - } else { - // Create the category if it does not already exist - $category = getCreateDbCategory($category, $sqlParser); - $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); - $snippet = end($tmp); - // remove installer docblock - $snippet = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $snippet, 1); - $snippet = evo()->getDatabase()->escape($snippet); - $rs = evo()->getDatabase()->query("SELECT * FROM `" . $table_prefix . "site_snippets` WHERE name='$name'"); - - if (evo()->getDatabase()->getRecordCount($rs)) { - $row = evo()->getDatabase()->getRow($rs,'assoc'); - $props = evo()->getDatabase()->escape(propUpdate($properties,$row['properties'])); - if (!evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) { - echo "

" . mysql_error() . "

"; - return; - } - echo "

  $name: " . $_lang['upgraded'] . "

"; - } else { - $properties = evo()->getDatabase()->escape(parseProperties($properties, true)); - if (!evo()->getDatabase()->query("INSERT INTO `" . $table_prefix . "site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties','$category');")) { - echo "

" . mysql_error() . "

"; - return; - } - echo "

  $name: " . $_lang['installed'] . "

"; - } - } - } - } -} - -// install data -if ($installData && $moduleSQLDataFile) { - echo "

" . $_lang['installing_demo_site']; - $sqlParser->process($installPath.'/'.$moduleSQLDataFile); - // display database results - if ($sqlParser->installFailed == true) { - $errors += 1; - echo "" . $_lang['database_alerts'] . "

"; - echo "

" . $_lang['setup_couldnt_install'] . "

"; - echo "

" . $_lang['installation_error_occured'] . "

"; - for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) { - echo "" . $sqlParser->mysqlErrors[$i]["error"] . "" . $_lang['during_execution_of_sql'] . "" . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . ".


"; - } - echo "

"; - echo "

" . $_lang['some_tables_not_updated'] . "

"; - return; - } else { - echo "".$_lang['ok']."

"; - } -} - -// always empty cache after install -evo()->clearCache('full'); - -// setup completed! -echo "

" . $_lang['installation_successful'] . "

"; - -// Property Update function -function propUpdate($new,$old) { - $newArr = parseProperties($new); - $oldArr = parseProperties($old); - foreach ($oldArr as $k => $v) { - if (isset($v['0']['options'])){ - $oldArr[$k]['0']['options'] = $newArr[$k]['0']['options']; - } - } - $return = $oldArr + $newArr; - $return = json_encode($return, JSON_UNESCAPED_UNICODE); - $return = ($return != '[]') ? $return : ''; - return $return; -} - -function parseProperties($propertyString, $json=false) { - $propertyString = str_replace('{}', '', $propertyString ); - $propertyString = str_replace('} {', ',', $propertyString ); - - if (empty($propertyString) || $propertyString == '{}' || $propertyString == '[]') { - $propertyString = ''; - } - - $jsonFormat = isJson($propertyString, true); - $property = array(); - // old format - if ($jsonFormat === false) { - $props= explode('&', $propertyString); - $arr = array(); - $key = array(); - foreach ($props as $prop) { - if ($prop != '') { - $arr = explode(';', $prop); - $key = explode('=', $arr['0']); - $property[$key['0']]['0']['label'] = trim($key['1']); - $property[$key['0']]['0']['type'] = trim($arr['1']); - switch ($arr['1']) { - case 'list': - case 'list-multi': - case 'checkbox': - case 'radio': - case 'menu': - $property[$key['0']]['0']['value'] = trim($arr['3']); - $property[$key['0']]['0']['options'] = trim($arr['2']); - $property[$key['0']]['0']['default'] = trim($arr['3']); - break; - default: - $property[$key['0']]['0']['value'] = trim($arr['2']); - $property[$key['0']]['0']['default'] = trim($arr['2']); - } - $property[$key['0']]['0']['desc'] = ''; - } - } - // new json-format - } else if(!empty($jsonFormat)) { - $property = $jsonFormat; - } - if ($json) { - $property = json_encode($property, JSON_UNESCAPED_UNICODE); - } - $property = ($property != '[]') ? $property : ''; - return $property; -} - -function isJson($string, $returnData = false) { - $data = json_decode($string, true); - return (json_last_error() == JSON_ERROR_NONE) ? ($returnData ? $data : true) : false; -} - -function getCreateDbCategory($category, $sqlParser) { - $table_prefix = evo()->getDatabase()->getConfig('prefix'); - $category_id = 0; - if (!empty($category)) { - $category = evo()->getDatabase()->escape($category); - $rs = evo()->getDatabase()->query("SELECT id FROM `".$table_prefix."categories` WHERE category = '".$category."'"); - if(evo()->getDatabase()->getRecordCount($rs) && ($row = evo()->getDatabase()->getRow($rs,'assoc'))) { - $category_id = $row['id']; - } else { - $q = "INSERT INTO `".$table_prefix."categories` (`category`) VALUES ('{$category}');"; - $rs = evo()->getDatabase()->query($q); - if($rs) { - $category_id = evo()->getDatabase()->getInsertId($sqlParser->conn); - } - } - } - return $category_id; -} +hasPermission('exec_module')) { + die('INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly.'); +} + +$_POST['installmode'] = 1; +//$_POST['installdata'] = 0; +$sqlParser = ''; +$create = false; + +// set timout limit +@set_time_limit(120); // used @ to prevent warning when using safe mode? + +$installMode= (int)$_POST['installmode']; +$installData = $_POST['installdata'] == "1" ? 1 : 0; + +// set session name variable +if (!isset ($site_sessionname)) { + $site_sessionname = 'SN' . uniqid(''); +} + +// get base path and url +$a = explode("install", str_replace("\\", "/", dirname($_SERVER["PHP_SELF"]))); +if (count($a) > 1) { + array_pop($a); +} +$url = implode("install", $a); +reset($a); +$a = explode("install", str_replace("\\", "/", realpath(__DIR__))); +if (count($a) > 1) { + array_pop($a); +} +$pth = implode("install", $a); +unset ($a); +$base_url = $url . (substr($url, -1) != "/" ? "/" : ""); +$base_path = $pth . (substr($pth, -1) != "/" ? "/" : ""); + +if (!function_exists('propertiesNameValue')) { + // parses a resource property string and returns the result as an array + // duplicate of method in documentParser class + function propertiesNameValue($propertyString) { + $parameter= array (); + if (!empty ($propertyString)) { + $tmpParams= explode("&", $propertyString); + for ($x= 0; $x < count($tmpParams); $x++) { + if (strpos($tmpParams[$x], '=', 0)) { + $pTmp= explode("=", $tmpParams[$x]); + $pvTmp= explode(";", trim($pTmp[1])); + if ($pvTmp[1] == 'list' && $pvTmp[3] != "") { + $parameter[trim($pTmp[0])] = $pvTmp[3]; //list default + } else { + if ($pvTmp[1] != 'list' && $pvTmp[2] != "") { + $parameter[trim($pTmp[0])] = $pvTmp[2]; + } + } + } + } + } + return $parameter; + } +} +$table_prefix = evo()->getDatabase()->getConfig('prefix'); +$setupPath = $modulePath; +include "{$setupPath}/setup.info.php"; +include "{$setupPath}/sqlParser.class.php"; +$sqlParser = new SqlParser(); + +// Install Templates +if (isset ($_POST['template']) || $installData) { + echo "

" . $_lang['templates'] . ":

"; + $selTemplates = $_POST['template']; + foreach ($moduleTemplates as $k => $moduleTemplate) { + $installSample = in_array('sample', $moduleTemplate[6]) && $installData == 1; + if($installSample || in_array($k, $selTemplates)) { + $name = EvolutionCms()->getDatabase()->escape($moduleTemplate[0]); + $desc = EvolutionCms()->getDatabase()->escape($moduleTemplate[1]); + $category = EvolutionCms()->getDatabase()->escape($moduleTemplate[4]); + $locked = EvolutionCms()->getDatabase()->escape($moduleTemplate[5]); + $filecontent = $moduleTemplate[3]; + if (!file_exists($filecontent)) { + echo "

  $name: " . $_lang['unable_install_template'] . " '$filecontent' " . $_lang['not_found'] . ".

"; + } else { + // Create the category if it does not already exist + $category_id = getCreateDbCategory($category, $sqlParser); + + // Strip the first comment up top + $template = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', file_get_contents($filecontent), 1); + $template = EvolutionCms()->getDatabase()->escape($template); + + // See if the template already exists + $rs = evo()->getDatabase()->query("SELECT * FROM `" . $table_prefix . "site_templates` WHERE templatename='$name'"); + + if (evo()->getDatabase()->getRecordCount($rs)) { + if (!@evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_templates` SET content='$template', description='$desc', category='$category_id', locked='$locked' WHERE templatename='$name';")) { + $errors += 1; + echo "

" . mysql_error() . "

"; + return; + } + echo "

  $name: " . $_lang['upgraded'] . "

"; + } else { + if (!@evo()->getDatabase()->query("INSERT INTO `" . $table_prefix . "site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template','$category_id','$locked');")) { + $errors += 1; + echo "

" . mysql_error() . "

"; + return; + } + echo "

  $name: " . $_lang['installed'] . "

"; + } + } + } + } +} + +// Install Template Variables +if (isset ($_POST['tv']) || $installData) { + echo "

" . $_lang['tvs'] . ":

"; + $selTVs = $_POST['tv']; + foreach ($moduleTVs as $k=>$moduleTV) { + $installSample = in_array('sample', $moduleTV[12]) && $installData == 1; + if($installSample || in_array($k, $selTVs)) { + $name = evo()->getDatabase()->escape($moduleTV[0]); + $caption = evo()->getDatabase()->escape($moduleTV[1]); + $desc = evo()->getDatabase()->escape($moduleTV[2]); + $input_type = evo()->getDatabase()->escape($moduleTV[3]); + $input_options = evo()->getDatabase()->escape($moduleTV[4]); + $input_default = evo()->getDatabase()->escape($moduleTV[5]); + $output_widget = evo()->getDatabase()->escape($moduleTV[6]); + $output_widget_params = evo()->getDatabase()->escape($moduleTV[7]); + $filecontent = $moduleTV[8]; + $assignments = $moduleTV[9]; + $category = evo()->getDatabase()->escape($moduleTV[10]); + $locked = evo()->getDatabase()->escape($moduleTV[11]); + + // Create the category if it does not already exist + $category = getCreateDbCategory($category, $sqlParser); + + $rs = evo()->getDatabase()->query("SELECT * FROM `" . $table_prefix . "site_tmplvars` WHERE name='$name'"); + if (evo()->getDatabase()->getRecordCount($rs)) { + $insert = true; + while($row = evo()->getDatabase()->getRow($rs,'assoc')) { + if (!@evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category='$category', locked='$locked', elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id='{$row['id']}';")) { + echo "

" . mysql_error() . "

"; + return; + } + $insert = false; + } + echo "

  $name: " . $_lang['upgraded'] . "

"; + } else { + //$q = "INSERT INTO `" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',(SELECT (CASE COUNT(*) WHEN 0 THEN 0 ELSE `id` END) `id` FROM `" . $table_prefix . "categories` WHERE `category` = '$category'),$locked,'$input_options','$output_widget','$output_widget_params','$input_default');"; + $q = "INSERT INTO `" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc','$category','$locked','$input_options','$output_widget','$output_widget_params','$input_default');"; + if (!@evo()->getDatabase()->query($q)) { + echo "

" . mysql_error() . "

"; + return; + } + echo "

  $name: " . $_lang['installed'] . "

"; + } + + // add template assignments + if (trim($assignments) != ''){ + $assignments = explode(',', $assignments); + + if (count($assignments) > 0) { + + // remove existing tv -> template assignments + $ds = evo()->getDatabase()->query("SELECT id FROM `".$table_prefix."site_tmplvars` WHERE name='$name' AND description='$desc';" ); + $row = evo()->getDatabase()->getRow($ds,'assoc'); + $id = $row["id"]; + evo()->getDatabase()->query("DELETE FROM $dbase.`" . $table_prefix . "site_tmplvar_templates` WHERE tmplvarid = '$id';"); + + // add tv -> template assignments + foreach ($assignments as $assignment) { + $template = evo()->getDatabase()->escape($assignment); + $where = "WHERE templatename='$template'"; + if ($template=='*') $where =''; + $ts = evo()->getDatabase()->query("SELECT id FROM `".$table_prefix."site_templates` $where;" ); + if ($ds && $ts) { + $tRow = evo()->getDatabase()->getRow($ts,'assoc'); + $templateId = $tRow['id']; + evo()->getDatabase()->query("INSERT INTO `" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES('$id', '$templateId');"); + } + } + } + } + } + } +} + +// Install Chunks +if (isset ($_POST['chunk']) || $installData) { + echo "

" . $_lang['chunks'] . ":

"; + $selChunks = $_POST['chunk']; + foreach ($moduleChunks as $k => $moduleChunk) { + $installSample = in_array('sample', $moduleChunk[5]) && $installData == 1; + if ($installSample || in_array($k, $selChunks)) { + $name = evo()->getDatabase()->escape($moduleChunk[0]); + $desc = evo()->getDatabase()->escape($moduleChunk[1]); + $category = evo()->getDatabase()->escape($moduleChunk[3]); + $overwrite = evo()->getDatabase()->escape($moduleChunk[4]); + $filecontent = $moduleChunk[2]; + + if (!file_exists($filecontent)) { + echo "

  $name: " . $_lang['unable_install_chunk'] . " '$filecontent' " . $_lang['not_found'] . ".

"; + } else { + // Create the category if it does not already exist + $category_id = getCreateDbCategory($category, $sqlParser); + + $chunk = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', file_get_contents($filecontent), 1); + $chunk = evo()->getDatabase()->escape($chunk); + $rs = evo()->getDatabase()->query("SELECT * FROM `" . $table_prefix . "site_htmlsnippets` WHERE name='$name'"); + $count_original_name = evo()->getDatabase()->getRecordCount($rs); + if ($overwrite == 'false') { + $newname = $name . '-' . str_replace('.', '_', $evo_version); + $rs = evo()->getDatabase()->query("SELECT * FROM `" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'"); + $count_new_name = evo()->getDatabase()->getRecordCount($rs); + } + $update = $count_original_name > 0 && $overwrite == 'true'; + if ($update) { + if (!@evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category='$category_id' WHERE name='$name';")) { + $errors += 1; + echo "

" . mysql_error() . "

"; + return; + } + echo "

  $name: " . $_lang['upgraded'] . "

"; + } elseif ($count_new_name == 0) { + if ($count_original_name > 0 && $overwrite == 'false') { + $name = $newname; + } + if (!@evo()->getDatabase()->query("INSERT INTO `" . $table_prefix . "site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk','$category_id');")) { + $errors += 1; + echo "

" . mysql_error() . "

"; + return; + } + echo "

  $name: " . $_lang['installed'] . "

"; + } + } + } + } +} + +// Install Modules +if (isset($_POST['module']) || $installData) { + echo "

" . $_lang['modules'] . ":

"; + $selModules = $_POST['module']; + foreach ($moduleModules as $k => $moduleModule) { + $installSample = in_array('sample', $moduleModule[7]) && $installData == 1; + if ($installSample || in_array($k, $selModules)) { + $name = evo()->getDatabase()->escape($moduleModule[0]); + $desc = evo()->getDatabase()->escape($moduleModule[1]); + $filecontent = $moduleModule[2]; + $properties = $moduleModule[3]; + $guid = evo()->getDatabase()->escape($moduleModule[4]); + $shared = evo()->getDatabase()->escape($moduleModule[5]); + $category = evo()->getDatabase()->escape($moduleModule[6]); + $icon = evo()->getDatabase()->escape($moduleModule[8]); + if (!file_exists($filecontent)) { + echo "

  $name: " . $_lang['unable_install_module'] . " '$filecontent' " . $_lang['not_found'] . ".

"; + } else { + // Create the category if it does not already exist + $category = getCreateDbCategory($category, $sqlParser); + $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); + $module = end($tmp); + // remove installer docblock + $module = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $module, 1); + $module = evo()->getDatabase()->escape($module); + $rs = evo()->getDatabase()->query("SELECT * FROM `" . $table_prefix . "site_modules` WHERE name='$name'"); + if (evo()->getDatabase()->getRecordCount($rs)) { + $row = evo()->getDatabase()->getRow($rs,'assoc'); + $props = evo()->getDatabase()->escape(propUpdate($properties,$row['properties'])); + if (!@evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared', icon='$icon' WHERE name='$name';")) { + echo "

" . mysql_error() . "

"; + return; + } + echo "

  $name: " . $_lang['upgraded'] . "

"; + } else { + $properties = evo()->getDatabase()->escape(parseProperties($properties, true)); + if (!@evo()->getDatabase()->query("INSERT INTO `" . $table_prefix . "site_modules` (name, description, modulecode, properties, guid, enable_sharedparams, category, icon) VALUES('$name', '$desc', '$module', '$properties', '$guid', '$shared', '$category', '$icon');")) { + echo "

" . mysql_error() . "

"; + return; + } + echo "

  $name: " . $_lang['installed'] . "

"; + } + } + } + } +} + +// Install Plugins +if (isset ($_POST['plugin']) || $installData) { + echo "

" . $_lang['plugins'] . ":

"; + $selPlugs = $_POST['plugin']; + foreach ($modulePlugins as $k=>$modulePlugin) { + $installSample = in_array('sample', $modulePlugin[8]) && $installData == 1; + if($installSample || in_array($k, $selPlugs)) { + $name = evo()->getDatabase()->escape($modulePlugin[0]); + $desc = evo()->getDatabase()->escape($modulePlugin[1]); + $filecontent = $modulePlugin[2]; + $properties = $modulePlugin[3]; + $events = explode(",", $modulePlugin[4]); + $guid = evo()->getDatabase()->escape($modulePlugin[5]); + $category = evo()->getDatabase()->escape($modulePlugin[6]); + $leg_names = ''; + $disabled = $modulePlugin[9]; + if (array_key_exists(7, $modulePlugin)) { + // parse comma-separated legacy names and prepare them for sql IN clause + $leg_names = "'" . implode("','", preg_split('/\s*,\s*/', evo()->getDatabase()->escape($modulePlugin[7]))) . "'"; + } + if (!file_exists($filecontent)) { + echo "

  $name: " . $_lang['unable_install_plugin'] . " '$filecontent' " . $_lang['not_found'] . ".

"; + } else { + // disable legacy versions based on legacy_names provided + if (!empty($leg_names)) { + $update_query = "UPDATE `" . $table_prefix . "site_plugins` SET disabled='1' WHERE name IN ($leg_names);"; + $rs = evo()->getDatabase()->query($update_query); + } + + // Create the category if it does not already exist + $category = getCreateDbCategory($category, $sqlParser); + $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); + $plugin = end($tmp); + // remove installer docblock + $plugin = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $plugin, 1); + $plugin = evo()->getDatabase()->escape($plugin); + $rs = evo()->getDatabase()->query("SELECT * FROM `" . $table_prefix . "site_plugins` WHERE name='$name' ORDER BY id"); + $prev_id = null; + if (evo()->getDatabase()->getRecordCount($rs)) { + $insert = true; + while($row = evo()->getDatabase()->getRow($rs,'assoc')) { + $props = evo()->getDatabase()->escape(propUpdate($properties,$row['properties'])); + if ($row['description'] == $desc) { + if (!@evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id='{$row['id']}';")) { + echo "

" . mysql_error() . "

"; + return; + } + $insert = false; + } else { + if (!@evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_plugins` SET disabled='1' WHERE id='{$row['id']}';")) { + echo "

".mysql_error()."

"; + return; + } + } + $prev_id = $row['id']; + } + if ($insert === true) { + if(!@evo()->getDatabase()->query("INSERT INTO `".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$props','$guid','0','$category');" )) { + echo "

".mysql_error()."

"; + return; + } + } + echo "

  $name: " . $_lang['upgraded'] . "

"; + } else { + $properties = evo()->getDatabase()->escape(parseProperties($properties, true)); + if (!@evo()->getDatabase()->query("INSERT INTO `" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','$disabled','$category');")) { + echo "

" . mysql_error() . "

"; + return; + } + echo "

  $name: " . $_lang['installed'] . "

"; + } + // add system events + if (count($events) > 0) { + $ds = evo()->getDatabase()->query("SELECT id FROM `".$table_prefix."site_plugins` WHERE name='$name' AND description='$desc' ORDER BY id DESC LIMIT 1;" ); + if ($ds) { + $row = evo()->getDatabase()->getRow($ds,'assoc'); + $id = $row["id"]; + $_events = implode("','", $events); + + // add new events + if ($prev_id) { + $prev_id = EvolutionCms()->getDatabase()->escape($prev_id); + + evo()->getDatabase()->query("INSERT OR IGNORE INTO `{$table_prefix}site_plugin_events` (`pluginid`, `evtid`, `priority`) + SELECT {$id} as 'pluginid', `se`.`id` AS `evtid`, COALESCE(`spe`.`priority`, MAX(`spe2`.`priority`) + 1, 0) AS `priority` + FROM `{$table_prefix}system_eventnames` `se` + LEFT JOIN `{$table_prefix}site_plugin_events` `spe` ON `spe`.`evtid` = `se`.`id` AND `spe`.`pluginid` = {$prev_id} + LEFT JOIN `{$table_prefix}site_plugin_events` `spe2` ON `spe2`.`evtid` = `se`.`id` + WHERE name IN ('{$_events}') + GROUP BY `se`.`id` + "); + } else { + evo()->getDatabase()->query("INSERT OR IGNORE INTO `{$table_prefix}site_plugin_events` (`pluginid`, `evtid`, `priority`) + SELECT {$id} as `pluginid`, `se`.`id` as `evtid`, COALESCE(MAX(`spe`.`priority`) + 1, 0) as `priority` + FROM `{$table_prefix}system_eventnames` `se` + LEFT JOIN `{$table_prefix}site_plugin_events` `spe` ON `spe`.`evtid` = `se`.`id` + WHERE `name` IN ('{$_events}') GROUP BY `se`.`id` + "); + } + + // remove existing events + evo()->getDatabase()->query("DELETE `pe` FROM `{$table_prefix}site_plugin_events` `pe` LEFT JOIN `{$table_prefix}system_eventnames` `se` ON `pe`.`evtid`=`se`.`id` AND `name` IN ('{$_events}') WHERE `name` IS NULL AND `pluginid` = {$id}"); + } + } + } + } + } +} + +// Install Snippets +if (isset ($_POST['snippet']) || $installData) { + echo "

" . $_lang['snippets'] . ":

"; + $selSnips = $_POST['snippet']; + foreach ($moduleSnippets as $k => $moduleSnippet) { + if (!is_array($moduleSnippet) || !isset($moduleSnippet[5]) || !is_array($moduleSnippet[5])) continue; + $installSample = in_array('sample', $moduleSnippet[5]) && $installData == 1; + if($installSample || in_array($k, $selSnips)) { + $name = evo()->getDatabase()->escape($moduleSnippet[0]); + $desc = evo()->getDatabase()->escape($moduleSnippet[1]); + $filecontent = $moduleSnippet[2]; + $properties = $moduleSnippet[3]; + $category = evo()->getDatabase()->escape($moduleSnippet[4]); + if (!file_exists($filecontent)) { + echo "

  $name: " . $_lang['unable_install_snippet'] . " '$filecontent' " . $_lang['not_found'] . ".

"; + } else { + // Create the category if it does not already exist + $category = getCreateDbCategory($category, $sqlParser); + $tmp = preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2); + $snippet = end($tmp); + // remove installer docblock + $snippet = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $snippet, 1); + $snippet = evo()->getDatabase()->escape($snippet); + $rs = evo()->getDatabase()->query("SELECT * FROM `" . $table_prefix . "site_snippets` WHERE name='$name'"); + + if (evo()->getDatabase()->getRecordCount($rs)) { + $row = evo()->getDatabase()->getRow($rs,'assoc'); + $props = evo()->getDatabase()->escape(propUpdate($properties,$row['properties'])); + if (!evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) { + echo "

" . mysql_error() . "

"; + return; + } + echo "

  $name: " . $_lang['upgraded'] . "

"; + } else { + $properties = evo()->getDatabase()->escape(parseProperties($properties, true)); + if (!evo()->getDatabase()->query("INSERT INTO `" . $table_prefix . "site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties','$category');")) { + echo "

" . mysql_error() . "

"; + return; + } + echo "

  $name: " . $_lang['installed'] . "

"; + } + } + } + } +} + +// install data +if ($installData && $moduleSQLDataFile) { + echo "

" . $_lang['installing_demo_site']; + $sqlParser->process($installPath.'/'.$moduleSQLDataFile); + // display database results + if ($sqlParser->installFailed == true) { + $errors += 1; + echo "" . $_lang['database_alerts'] . "

"; + echo "

" . $_lang['setup_couldnt_install'] . "

"; + echo "

" . $_lang['installation_error_occured'] . "

"; + for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) { + echo "" . $sqlParser->mysqlErrors[$i]["error"] . "" . $_lang['during_execution_of_sql'] . "" . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . ".


"; + } + echo "

"; + echo "

" . $_lang['some_tables_not_updated'] . "

"; + return; + } else { + echo "".$_lang['ok']."

"; + } +} + +// always empty cache after install +evo()->clearCache('full'); + +// setup completed! +echo "

" . $_lang['installation_successful'] . "

"; + +// Property Update function +function propUpdate($new,$old) { + $newArr = parseProperties($new); + $oldArr = parseProperties($old); + foreach ($oldArr as $k => $v) { + if (isset($v['0']['options'])){ + $oldArr[$k]['0']['options'] = $newArr[$k]['0']['options']; + } + } + $return = $oldArr + $newArr; + $return = json_encode($return, JSON_UNESCAPED_UNICODE); + $return = ($return != '[]') ? $return : ''; + return $return; +} + +function parseProperties($propertyString, $json=false) { + $propertyString = str_replace('{}', '', $propertyString ); + $propertyString = str_replace('} {', ',', $propertyString ); + + if (empty($propertyString) || $propertyString == '{}' || $propertyString == '[]') { + $propertyString = ''; + } + + $jsonFormat = isJson($propertyString, true); + $property = array(); + // old format + if ($jsonFormat === false) { + $props= explode('&', $propertyString); + $arr = array(); + $key = array(); + foreach ($props as $prop) { + if ($prop != '') { + $arr = explode(';', $prop); + $key = explode('=', $arr['0']); + $property[$key['0']]['0']['label'] = trim($key['1']); + $property[$key['0']]['0']['type'] = trim($arr['1']); + switch ($arr['1']) { + case 'list': + case 'list-multi': + case 'checkbox': + case 'radio': + case 'menu': + $property[$key['0']]['0']['value'] = trim($arr['3']); + $property[$key['0']]['0']['options'] = trim($arr['2']); + $property[$key['0']]['0']['default'] = trim($arr['3']); + break; + default: + $property[$key['0']]['0']['value'] = trim($arr['2']); + $property[$key['0']]['0']['default'] = trim($arr['2']); + } + $property[$key['0']]['0']['desc'] = ''; + } + } + // new json-format + } else if(!empty($jsonFormat)) { + $property = $jsonFormat; + } + if ($json) { + $property = json_encode($property, JSON_UNESCAPED_UNICODE); + } + $property = ($property != '[]') ? $property : ''; + return $property; +} + +function isJson($string, $returnData = false) { + $data = json_decode($string, true); + return (json_last_error() == JSON_ERROR_NONE) ? ($returnData ? $data : true) : false; +} + +function getCreateDbCategory($category, $sqlParser) { + $table_prefix = evo()->getDatabase()->getConfig('prefix'); + $category_id = 0; + if (!empty($category)) { + $category = evo()->getDatabase()->escape($category); + $rs = evo()->getDatabase()->query("SELECT id FROM `".$table_prefix."categories` WHERE category = '".$category."'"); + if(evo()->getDatabase()->getRecordCount($rs) && ($row = evo()->getDatabase()->getRow($rs,'assoc'))) { + $category_id = $row['id']; + } else { + $q = "INSERT INTO `".$table_prefix."categories` (`category`) VALUES ('{$category}');"; + $rs = evo()->getDatabase()->query($q); + if($rs) { + $category_id = evo()->getDatabase()->getInsertId($sqlParser->conn); + } + } + } + return $category_id; +} diff --git a/assets/modules/store/installer/jquery-1.4.4.min.js b/assets/modules/store/installer/jquery-1.4.4.min.js index c2dcfe7bfa..8f3ca2e2da 100755 --- a/assets/modules/store/installer/jquery-1.4.4.min.js +++ b/assets/modules/store/installer/jquery-1.4.4.min.js @@ -1,167 +1,167 @@ -/*! - * jQuery JavaScript Library v1.4.4 - * http://jquery.com/ - * - * Copyright 2010, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2010, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu Nov 11 19:04:53 2010 -0500 - */ -(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= -h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;kd)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, -"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, -e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, -"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ -a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, -C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, -s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, -j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, -toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== --1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; -if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", -b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& -!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& -l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H
a";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), -k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, -scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= -false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= -1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="
";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="
t
";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= -"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= -c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); -else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; -if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, -attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& -b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; -c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, -arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= -d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ -c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== -8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== -"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ -d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= -B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== -"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== -0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); -(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; -break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, -q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= -l;g.sort(w);if(h)for(var i=1;i0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, -m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== -true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== -g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return in[3]-0},nth:function(g,i,n){return n[3]- -0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== -i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; -if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, -g);else if(typeof g.length==="number")for(var p=g.length;n";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); -n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& -function(){var g=k,i=t.createElement("div");i.innerHTML="

";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| -p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= -t.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? -function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n0)for(var h=d;h0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= -h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): -c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, -2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, -b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& -e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/\s]+\/)>/g,P={option:[1, -""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= -c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, -wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, -prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, -this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); -return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; -else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1>");try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", -prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| -b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]===""&&!x?r.childNodes:[];for(o=k.length- -1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); -d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, -jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, -zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), -h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); -if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= -d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; -e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/)<[^<]*)*<\/script>/gi, -ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== -"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("
").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& -!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, -getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", -script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| -!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= -false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; -A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", -b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& -c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| -c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= -encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", -[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), -e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); -if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", -3),a,b,d);else{d=0;for(var e=this.length;d=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, -d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* -Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} -var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; -this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| -this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= -c.timers,b=0;b-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, -e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& -c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); -c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ -b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window); +/*! + * jQuery JavaScript Library v1.4.4 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Nov 11 19:04:53 2010 -0500 + */ +(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= +h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;kd)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, +"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, +e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, +"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ +a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, +C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, +s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, +j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, +toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== +-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; +if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", +b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& +!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& +l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H
a";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), +k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, +scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= +false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= +1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="
";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="
t
";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= +"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= +c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); +else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; +if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, +attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& +b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; +c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, +arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= +d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ +c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== +8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== +"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ +d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= +B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== +"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== +0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); +(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; +break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, +q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= +l;g.sort(w);if(h)for(var i=1;i0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, +m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== +true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== +g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return in[3]-0},nth:function(g,i,n){return n[3]- +0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== +i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; +if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, +g);else if(typeof g.length==="number")for(var p=g.length;n";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); +n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& +function(){var g=k,i=t.createElement("div");i.innerHTML="

";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| +p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= +t.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? +function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n0)for(var h=d;h0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= +h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): +c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, +2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, +b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& +e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/\s]+\/)>/g,P={option:[1, +""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; +else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1>");try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", +prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| +b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]===""&&!x?r.childNodes:[];for(o=k.length- +1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); +d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, +jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, +zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), +h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); +if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= +d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; +e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/)<[^<]*)*<\/script>/gi, +ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== +"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("
").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& +!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, +getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", +script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| +!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= +false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; +A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", +b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& +c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| +c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= +encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", +[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), +e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); +if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", +3),a,b,d);else{d=0;for(var e=this.length;d=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, +d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* +Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} +var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; +this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| +this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= +c.timers,b=0;b-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, +e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& +c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); +c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ +b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window); diff --git a/assets/modules/store/installer/setup.info.php b/assets/modules/store/installer/setup.info.php index e138658371..12957db151 100644 --- a/assets/modules/store/installer/setup.info.php +++ b/assets/modules/store/installer/setup.info.php @@ -1,306 +1,306 @@ -hasPermission('exec_module')) { - die('INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly.'); -} - +hasPermission('exec_module')) { + die('INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly.'); +} + //:: Evolution CMS Installer Setup file //::::::::::::::::::::::::::::::::::::::::: require_once(EVO_MANAGER_PATH . 'includes/version.inc.php'); -$installPath = EVO_BASE_PATH . 'assets/cache/store/install'; -if (!isset($evo_branch)) { - $evo_branch = ''; -} -if (!isset($evo_version)) { - $evo_version = ''; -} -if (!isset($evo_release_date)) { - $evo_release_date = ''; -} -$moduleName = "Evolution CMS"; -$moduleVersion = $evo_branch . ' ' . $evo_version; -$moduleRelease = $evo_release_date; -$moduleSQLBaseFile = "setup.sql"; -$moduleSQLDataFile = "install/setup.data.sql"; -$chunkPath = $installPath . '/install/assets/chunks'; -$snippetPath = $installPath . '/install/assets/snippets'; -$pluginPath = $installPath . '/install/assets/plugins'; -$modulePath = $installPath . '/install/assets/modules'; -$templatePath = $installPath . '/install/assets/templates'; -$tvPath = $installPath . '/install/assets/tvs'; - -// setup Template template files - array : name, description, type - 0:file or 1:content, parameters, category -$mt = &$moduleTemplates; -if (is_dir($templatePath) && is_readable($templatePath)) { - $d = dir($templatePath); - while (false !== ($tplfile = $d->read())) { - if (substr($tplfile, -4) != '.tpl') continue; - $params = parse_docblock($templatePath, $tplfile); - if (is_array($params) && (count($params) > 0)) { - $description = empty($params['version']) ? $params['description'] : "{$params['version']} {$params['description']}"; - $mt[] = array - ( - $params['name'], - $description, - // Don't think this is gonna be used ... but adding it just in case 'type' - $params['type'], - "$templatePath/{$params['filename']}", - $params['modx_category'], - $params['lock_template'], - array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false - ); - } - } - $d->close(); -} - -// setup Template Variable template files -$mtv = &$moduleTVs; -if (is_dir($tvPath) && is_readable($tvPath)) { - $d = dir($tvPath); - while (false !== ($tplfile = $d->read())) { - if (substr($tplfile, -4) != '.tpl') continue; - $params = parse_docblock($tvPath, $tplfile); - if (is_array($params) && (count($params) > 0)) { - $description = empty($params['version']) ? $params['description'] : "{$params['version']} {$params['description']}"; - $mtv[] = array( - $params['name'], - $params['caption'], - $description, - $params['input_type'], - $params['input_options'] ?? '', - $params['input_default'] ?? '', - $params['output_widget'] ?? '', - $params['output_widget_params'] ?? '', - "$templatePath/{$params['filename']}", /* not currently used */ - $params['template_assignments'] ?? '', /* comma-separated list of template names */ - $params['modx_category'] ?? '', - $params['lock_tv'] ?? 0, /* value should be 1 or 0 */ - array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false - ); - } - } - $d->close(); -} - -// setup chunks template files - array : name, description, type - 0:file or 1:content, file or content -$mc = &$moduleChunks; -if (is_dir($chunkPath) && is_readable($chunkPath)) { - $d = dir($chunkPath); - while (false !== ($tplfile = $d->read())) { - if (substr($tplfile, -4) != '.tpl') { - continue; - } - $params = parse_docblock($chunkPath, $tplfile); - if (is_array($params) && count($params) > 0) { - $description = empty($params['version']) ? $params['description'] : "{$params['version']} {$params['description']}"; - $mc[] = array( - $params['name'], - $description, - "$chunkPath/{$params['filename']}", - $params['modx_category'] ?? '', - array_key_exists('overwrite', $params) ? $params['overwrite'] : 'true', - array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false - ); - } - } - $d->close(); -} - -// setup snippets template files - array : name, description, type - 0:file or 1:content, file or content,properties -$ms = &$moduleSnippets; - -if (is_dir($snippetPath) && is_readable($snippetPath)) { - $d = dir($snippetPath); - while (false !== ($tplfile = $d->read())) { - if (substr($tplfile, -4) != '.tpl') { - continue; - } - $params = parse_docblock($snippetPath, $tplfile); - - if (is_array($params) && count($params) > 0) { - $description = empty($params['version']) ? $params['description'] : "{$params['version']} {$params['description']}"; - $ms[] = array( - $params['name'], - $description, - "$snippetPath/{$params['filename']}", - $params['properties'] ?? '', - $params['modx_category'] ?? '', - array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false - ); - } - } - $d->close(); -} - -// setup plugins template files - array : name, description, type - 0:file or 1:content, file or content,properties -$mp = &$modulePlugins; -if (is_dir($pluginPath) && is_readable($pluginPath)) { - $d = dir($pluginPath); - while (false !== ($tplfile = $d->read())) { - if (substr($tplfile, -4) != '.tpl') { - continue; - } - $params = parse_docblock($pluginPath, $tplfile); - if (is_array($params) && count($params) > 0) { - $description = empty($params['version']) ? $params['description'] : "{$params['version']} {$params['description']}"; - $mp[] = array( - $params['name'], - $description, - "$pluginPath/{$params['filename']}", - $params['properties'] ?? '', - $params['events'] ?? '', - $params['guid'] ?? '', - $params['modx_category'] ?? '', - $params['legacy_names'] ?? '', - array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false, - $params['disabled'] ?? 0 - ); - } - } - $d->close(); -} - -// setup modules - array : name, description, type - 0:file or 1:content, file or content, properties, guid, enable_sharedparams, icon -$mm = &$moduleModules; -if (is_dir($modulePath) && is_readable($modulePath)) { - $d = dir($modulePath); - while (false !== ($tplfile = $d->read())) { - if (substr($tplfile, -4) != '.tpl') { - continue; - } - $params = parse_docblock($modulePath, $tplfile); - if (is_array($params) && count($params) > 0) { - $description = empty($params['version']) ? $params['description'] : "{$params['version']} {$params['description']}"; - $mm[] = array( - $params['name'], - $description, - "$modulePath/{$params['filename']}", - $params['properties'] ?? '', - $params['guid'] ?? '', - (int)($params['shareparams'] ?? 0), - $params['modx_category'] ?? '', - array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false, - $params['icon'] ?? '' - ); - } - } - $d->close(); -} - -// setup callback function -$callBackFnc = "clean_up"; - -function clean_up($sqlParser) -{ - $ids = array(); - $mysqlVerOk = -1; - $table_prefix = evo()->getDatabase()->getConfig('prefix'); - - if (function_exists("mysql_get_server_info")) { - $mysqlVerOk = (version_compare(mysql_get_server_info(), "4.0.2") >= 0); - } - - // secure web documents - privateweb - mysql_query("UPDATE `" . $table_prefix . "site_content` SET privateweb = 0 WHERE privateweb = 1", $sqlParser->conn); - $sql = "SELECT DISTINCT sc.id - FROM `" . $table_prefix . "site_content` sc - LEFT JOIN `" . $table_prefix . "document_groups` dg ON dg.document = sc.id - LEFT JOIN `" . $table_prefix . "webgroup_access` wga ON wga.documentgroup = dg.document_group - WHERE wga.id>0"; - $ds = evo()->getDatabase()->query($sql); - if (!$ds) { - echo "An error occurred while executing a query: " . mysql_error(); - } else { - while ($r = evo()->getDatabase()->GetRow($ds, 'assoc')) $ids[] = $r["id"]; - if (count($ids) > 0) { - mysql_query("UPDATE `" . $table_prefix . "site_content` SET privateweb = 1 WHERE id IN (" . implode(", ", $ids) . ")"); - unset($ids); - } - } - - // secure manager documents privatemgr - mysql_query("UPDATE `" . $table_prefix . "site_content` SET privatemgr = 0 WHERE privatemgr = 1"); - $sql = "SELECT DISTINCT sc.id - FROM `" . $table_prefix . "site_content` sc - LEFT JOIN `" . $table_prefix . "document_groups` dg ON dg.document = sc.id - LEFT JOIN `" . $table_prefix . "membergroup_access` mga ON mga.documentgroup = dg.document_group - WHERE mga.id>0"; - $ds = evo()->getDatabase()->query($sql); - if (!$ds) { - echo "An error occurred while executing a query: " . mysql_error(); - } else { - while ($r = evo()->getDatabase()->GetRow($ds, 'assoc')) $ids[] = $r["id"]; - if (count($ids) > 0) { - evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_content` SET privatemgr = 1 WHERE id IN (" . implode(", ", $ids) . ")"); - unset($ids); - } - } -} - -function parse_docblock($element_dir, $filename) -{ - $params = array(); - $fullpath = $element_dir . '/' . $filename; - if (is_readable($fullpath)) { - $tpl = @fopen($fullpath, "r"); - if ($tpl) { - $params['filename'] = $filename; - $docblock_start_found = false; - $name_found = false; - $description_found = false; - $docblock_end_found = false; - - while (!feof($tpl)) { - $line = fgets($tpl); - if (!$docblock_start_found) { - // find docblock start - if (strpos($line, '/**') !== false) { - $docblock_start_found = true; - } - continue; - } elseif (!$name_found) { - // find name - $ma = null; - if (preg_match("/^\s+\*\s+(.+)/", $line, $ma)) { - $params['name'] = trim($ma[1]); - $name_found = !empty($params['name']); - } - continue; - } elseif (!$description_found) { - // find description - $ma = null; - if (preg_match("/^\s+\*\s+(.+)/", $line, $ma)) { - $params['description'] = trim($ma[1]); - $description_found = !empty($params['description']); - } - continue; - } else { - $ma = null; - if (preg_match("/^\s+\*\s+\@([^\s]+)\s+(.+)/", $line, $ma)) { - $param = trim($ma[1]); - $val = trim($ma[2]); - if (!empty($param) && !empty($val)) { - if ($param == 'internal') { - $ma = null; - if (preg_match("/\@([^\s]+)\s+(.+)/", $val, $ma)) { - $param = trim($ma[1]); - $val = trim($ma[2]); - } - if (empty($param)) { - continue; - } - } - $params[$param] = $val; - } - } elseif (preg_match("/^\s*\*\/\s*$/", $line)) { - $docblock_end_found = true; - break; - } - } - } - @fclose($tpl); - } - } - return $params; -} +$installPath = EVO_BASE_PATH . 'assets/cache/store/install'; +if (!isset($evo_branch)) { + $evo_branch = ''; +} +if (!isset($evo_version)) { + $evo_version = ''; +} +if (!isset($evo_release_date)) { + $evo_release_date = ''; +} +$moduleName = "Evolution CMS"; +$moduleVersion = $evo_branch . ' ' . $evo_version; +$moduleRelease = $evo_release_date; +$moduleSQLBaseFile = "setup.sql"; +$moduleSQLDataFile = "install/setup.data.sql"; +$chunkPath = $installPath . '/install/assets/chunks'; +$snippetPath = $installPath . '/install/assets/snippets'; +$pluginPath = $installPath . '/install/assets/plugins'; +$modulePath = $installPath . '/install/assets/modules'; +$templatePath = $installPath . '/install/assets/templates'; +$tvPath = $installPath . '/install/assets/tvs'; + +// setup Template template files - array : name, description, type - 0:file or 1:content, parameters, category +$mt = &$moduleTemplates; +if (is_dir($templatePath) && is_readable($templatePath)) { + $d = dir($templatePath); + while (false !== ($tplfile = $d->read())) { + if (substr($tplfile, -4) != '.tpl') continue; + $params = parse_docblock($templatePath, $tplfile); + if (is_array($params) && (count($params) > 0)) { + $description = empty($params['version']) ? $params['description'] : "{$params['version']} {$params['description']}"; + $mt[] = array + ( + $params['name'], + $description, + // Don't think this is gonna be used ... but adding it just in case 'type' + $params['type'], + "$templatePath/{$params['filename']}", + $params['modx_category'], + $params['lock_template'], + array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false + ); + } + } + $d->close(); +} + +// setup Template Variable template files +$mtv = &$moduleTVs; +if (is_dir($tvPath) && is_readable($tvPath)) { + $d = dir($tvPath); + while (false !== ($tplfile = $d->read())) { + if (substr($tplfile, -4) != '.tpl') continue; + $params = parse_docblock($tvPath, $tplfile); + if (is_array($params) && (count($params) > 0)) { + $description = empty($params['version']) ? $params['description'] : "{$params['version']} {$params['description']}"; + $mtv[] = array( + $params['name'], + $params['caption'], + $description, + $params['input_type'], + $params['input_options'] ?? '', + $params['input_default'] ?? '', + $params['output_widget'] ?? '', + $params['output_widget_params'] ?? '', + "$templatePath/{$params['filename']}", /* not currently used */ + $params['template_assignments'] ?? '', /* comma-separated list of template names */ + $params['modx_category'] ?? '', + $params['lock_tv'] ?? 0, /* value should be 1 or 0 */ + array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false + ); + } + } + $d->close(); +} + +// setup chunks template files - array : name, description, type - 0:file or 1:content, file or content +$mc = &$moduleChunks; +if (is_dir($chunkPath) && is_readable($chunkPath)) { + $d = dir($chunkPath); + while (false !== ($tplfile = $d->read())) { + if (substr($tplfile, -4) != '.tpl') { + continue; + } + $params = parse_docblock($chunkPath, $tplfile); + if (is_array($params) && count($params) > 0) { + $description = empty($params['version']) ? $params['description'] : "{$params['version']} {$params['description']}"; + $mc[] = array( + $params['name'], + $description, + "$chunkPath/{$params['filename']}", + $params['modx_category'] ?? '', + array_key_exists('overwrite', $params) ? $params['overwrite'] : 'true', + array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false + ); + } + } + $d->close(); +} + +// setup snippets template files - array : name, description, type - 0:file or 1:content, file or content,properties +$ms = &$moduleSnippets; + +if (is_dir($snippetPath) && is_readable($snippetPath)) { + $d = dir($snippetPath); + while (false !== ($tplfile = $d->read())) { + if (substr($tplfile, -4) != '.tpl') { + continue; + } + $params = parse_docblock($snippetPath, $tplfile); + + if (is_array($params) && count($params) > 0) { + $description = empty($params['version']) ? $params['description'] : "{$params['version']} {$params['description']}"; + $ms[] = array( + $params['name'], + $description, + "$snippetPath/{$params['filename']}", + $params['properties'] ?? '', + $params['modx_category'] ?? '', + array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false + ); + } + } + $d->close(); +} + +// setup plugins template files - array : name, description, type - 0:file or 1:content, file or content,properties +$mp = &$modulePlugins; +if (is_dir($pluginPath) && is_readable($pluginPath)) { + $d = dir($pluginPath); + while (false !== ($tplfile = $d->read())) { + if (substr($tplfile, -4) != '.tpl') { + continue; + } + $params = parse_docblock($pluginPath, $tplfile); + if (is_array($params) && count($params) > 0) { + $description = empty($params['version']) ? $params['description'] : "{$params['version']} {$params['description']}"; + $mp[] = array( + $params['name'], + $description, + "$pluginPath/{$params['filename']}", + $params['properties'] ?? '', + $params['events'] ?? '', + $params['guid'] ?? '', + $params['modx_category'] ?? '', + $params['legacy_names'] ?? '', + array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false, + $params['disabled'] ?? 0 + ); + } + } + $d->close(); +} + +// setup modules - array : name, description, type - 0:file or 1:content, file or content, properties, guid, enable_sharedparams, icon +$mm = &$moduleModules; +if (is_dir($modulePath) && is_readable($modulePath)) { + $d = dir($modulePath); + while (false !== ($tplfile = $d->read())) { + if (substr($tplfile, -4) != '.tpl') { + continue; + } + $params = parse_docblock($modulePath, $tplfile); + if (is_array($params) && count($params) > 0) { + $description = empty($params['version']) ? $params['description'] : "{$params['version']} {$params['description']}"; + $mm[] = array( + $params['name'], + $description, + "$modulePath/{$params['filename']}", + $params['properties'] ?? '', + $params['guid'] ?? '', + (int)($params['shareparams'] ?? 0), + $params['modx_category'] ?? '', + array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false, + $params['icon'] ?? '' + ); + } + } + $d->close(); +} + +// setup callback function +$callBackFnc = "clean_up"; + +function clean_up($sqlParser) +{ + $ids = array(); + $mysqlVerOk = -1; + $table_prefix = evo()->getDatabase()->getConfig('prefix'); + + if (function_exists("mysql_get_server_info")) { + $mysqlVerOk = (version_compare(mysql_get_server_info(), "4.0.2") >= 0); + } + + // secure web documents - privateweb + mysql_query("UPDATE `" . $table_prefix . "site_content` SET privateweb = 0 WHERE privateweb = 1", $sqlParser->conn); + $sql = "SELECT DISTINCT sc.id + FROM `" . $table_prefix . "site_content` sc + LEFT JOIN `" . $table_prefix . "document_groups` dg ON dg.document = sc.id + LEFT JOIN `" . $table_prefix . "webgroup_access` wga ON wga.documentgroup = dg.document_group + WHERE wga.id>0"; + $ds = evo()->getDatabase()->query($sql); + if (!$ds) { + echo "An error occurred while executing a query: " . mysql_error(); + } else { + while ($r = evo()->getDatabase()->GetRow($ds, 'assoc')) $ids[] = $r["id"]; + if (count($ids) > 0) { + mysql_query("UPDATE `" . $table_prefix . "site_content` SET privateweb = 1 WHERE id IN (" . implode(", ", $ids) . ")"); + unset($ids); + } + } + + // secure manager documents privatemgr + mysql_query("UPDATE `" . $table_prefix . "site_content` SET privatemgr = 0 WHERE privatemgr = 1"); + $sql = "SELECT DISTINCT sc.id + FROM `" . $table_prefix . "site_content` sc + LEFT JOIN `" . $table_prefix . "document_groups` dg ON dg.document = sc.id + LEFT JOIN `" . $table_prefix . "membergroup_access` mga ON mga.documentgroup = dg.document_group + WHERE mga.id>0"; + $ds = evo()->getDatabase()->query($sql); + if (!$ds) { + echo "An error occurred while executing a query: " . mysql_error(); + } else { + while ($r = evo()->getDatabase()->GetRow($ds, 'assoc')) $ids[] = $r["id"]; + if (count($ids) > 0) { + evo()->getDatabase()->query("UPDATE `" . $table_prefix . "site_content` SET privatemgr = 1 WHERE id IN (" . implode(", ", $ids) . ")"); + unset($ids); + } + } +} + +function parse_docblock($element_dir, $filename) +{ + $params = array(); + $fullpath = $element_dir . '/' . $filename; + if (is_readable($fullpath)) { + $tpl = @fopen($fullpath, "r"); + if ($tpl) { + $params['filename'] = $filename; + $docblock_start_found = false; + $name_found = false; + $description_found = false; + $docblock_end_found = false; + + while (!feof($tpl)) { + $line = fgets($tpl); + if (!$docblock_start_found) { + // find docblock start + if (strpos($line, '/**') !== false) { + $docblock_start_found = true; + } + continue; + } elseif (!$name_found) { + // find name + $ma = null; + if (preg_match("/^\s+\*\s+(.+)/", $line, $ma)) { + $params['name'] = trim($ma[1]); + $name_found = !empty($params['name']); + } + continue; + } elseif (!$description_found) { + // find description + $ma = null; + if (preg_match("/^\s+\*\s+(.+)/", $line, $ma)) { + $params['description'] = trim($ma[1]); + $description_found = !empty($params['description']); + } + continue; + } else { + $ma = null; + if (preg_match("/^\s+\*\s+\@([^\s]+)\s+(.+)/", $line, $ma)) { + $param = trim($ma[1]); + $val = trim($ma[2]); + if (!empty($param) && !empty($val)) { + if ($param == 'internal') { + $ma = null; + if (preg_match("/\@([^\s]+)\s+(.+)/", $val, $ma)) { + $param = trim($ma[1]); + $val = trim($ma[2]); + } + if (empty($param)) { + continue; + } + } + $params[$param] = $val; + } + } elseif (preg_match("/^\s*\*\/\s*$/", $line)) { + $docblock_end_found = true; + break; + } + } + } + @fclose($tpl); + } + } + return $params; +} diff --git a/assets/modules/store/installer/style.css b/assets/modules/store/installer/style.css index 4a3848adf9..0fd8d5dcda 100755 --- a/assets/modules/store/installer/style.css +++ b/assets/modules/store/installer/style.css @@ -1,611 +1,611 @@ -html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, -html body * span.clear, html body * div.clear, html body * li.clear, html body * dd.clear { -background:transparent none repeat scroll 0 0; -border:0 none; -font-size:100%; -margin:0; -outline-color:-moz-use-text-color; -outline-style:none; -outline-width:0; -padding:0; -vertical-align:baseline; -} - -body { --x-system-font:none; -font-family:Helvetica,Arial,'Liberation Sans',FreeSans,sans-serif; -font-size:75%; -font-size-adjust:none; -font-stretch:normal; -font-style:normal; -font-variant:normal; -font-weight:normal; -line-height:1.5; -background: #F4F4F4 none repeat scroll 0 0; -} - -html > body { -font-size:13px; -} -body { -background-color: #FFFFFF; -font-family: "Lucida Grande","Lucida Sans Unicode",Verdana,Arial,Helvetica,sans-serif; -} - -ol, ul { -list-style-image:none; -list-style-position:outside; -list-style-type:none; -} -ins { -text-decoration:none; -} -del { -text-decoration:line-through; -} -table { -border-collapse:collapse; -border-spacing:0; -} -a:focus { -} -h1, h2, h3, h4, h5, h6 { -font-weight:normal; -} -h1 { -font-size:216.667%; -line-height:0.692308; -margin:0.461538em 0 0.230769em; -} -h2 { -font-size:166.667%; -line-height:0.9; -margin:0.6em 0 0.3em; -} -h3 { -font-size:141.667%; -line-height:0.823529; -margin:0.54902em 0 0.27451em; -font-weight: bold; -} -h4 { -font-size:116.667%; -line-height:1; -margin:0.666667em 0 0.333333em; -} -h3, h4 { -color:#585858; -font-size:1.1em; -line-height:1.3em; -margin-bottom:0.75em; -} - - -h5 { -font-size:100%; -font-weight:bold; -line-height:1.5; -margin:1em 0 0.5em; -} -h6 { -font-size:83.3333%; -font-weight:bold; -line-height:1.8; -margin:1.8em 0 0; -} -ol { -list-style-image:none; -list-style-position:outside; -list-style-type:decimal; -} -ul { -list-style-image:none; -list-style-position:outside; -list-style-type:square; -} -li { -margin-left:30px; -} -p, dl, hr, ol, ul, dl pre, table, address, fieldset { -margin-bottom:1.5em; -} -.container_12 { -margin-left:auto; -margin-right:auto; -width:700px; -} - -#rtl { - direction: rtl; - text-align: right; -} - -.alpha { -margin-left:0; -} -.omega { -margin-right:0; -} - -.clearfix:after { -clear:both; -content:'.'; -display:block; -height:0; -visibility:hidden; -} -.clearfix { -display:inline-block; -} -* html .clearfix { -height:1%; -} -.clearfix { -display:block; -} -strong, em, b, i { -} -h1, h2, h3, h4, h5, h6, address { -margin-top:0; -} -p, td, th, dt, dd, li { -color:#6A6A6A; -} -#footer p { -color:#FFFFFF; -} -code, pre { -margin-bottom:1em; -} -dt { -display:inline; -font-weight:bold; -} -dd { -margin-bottom:20px; -} -.left { -float:left; -} -.right { -float:right; -} -img.left { -float:left; -margin-right:10px; -} -img.right { -float:right; -margin-left:10px; -} -a { -color:#0066CC; -} -a img { -border:0 none; -} -sup { -font-size:smaller; -vertical-align:super; -} -.hidden { -display:none; -} -hr { -clear:both; -border-bottom: 1px solid #FFFFFF; -border-top: 1px solid #E6E6E6; -color:#E6E6E6; -height:0; -} -.clear, .cls { -background-color:transparent; -border:0 none; -clear:both !important; -height:1px; -margin-top:-1px; -visibility:hidden; -} -.center { -margin:0 auto; -text-align:center; -} - -.inputtip { -color:#888888; -} - -.help { - float: right; -} -.help a { - color: #fff; - text-decoration: none !important; - text-transform: uppercase; - -moz-border-radius: 3x; - -webkit-border-radius: 3px; - border-radius: 3px; - border: 1px solid #ffbc6c; - border-right-color: #db831a; - border-bottom-color: #db831a; - background: #f2901d; - font-size: 86%; - padding: 2px 4px; - letter-spacing: 1px; -} -.help a:hover { - background: #f8a440; -} -.help a:active { - border: 1px solid #db831a; - border-right-color: #ffbc6c; - border-bottom-color: #ffbc6c; -} -.version { - color: #fff; -} -span.mono { - font-family: Courier, monospace; -} -.buttonlinks { - display:block; - height:26px; - line-height:26px; - margin-bottom:20px; - float:right; - clear: left; -} -#rtl .buttonlinks { - float: left; -} - -.info .buttonlinks { -margin:0; -} -.buttonlinks a { --x-system-font:none; -background:transparent url(img/site-ui-gfx.png) no-repeat scroll -54px -353px; -color:#5A5A5A; -display:block; -float:left; -font: bold 11px/23px "Lucida Grande",Lucida,Verdana,sans-serif; -height:26px; -margin:0 20px 0 0; -padding:0; -max-width:250px; -text-decoration:none; -text-transform:uppercase; -} -#rtl .buttonlinks a { - margin: 0 0 0 20px; -} -.buttonlinks a span { -background:#FFFFFF url(img/site-ui-gfx.png) no-repeat scroll 100% -353px; -display:block; -float:left; -height:26px; -margin:0 0 0 10px; -padding:0 22px 0 0; -} - -.buttonlinks a:hover { -background-position:-54px -379px; -cursor:pointer; -} -.buttonlinks a:hover span { -background-position:100% -379px; -cursor:pointer; -} -.buttonlinks a:hover { -background-position:-54px -379px; -} -.buttonlinks a:hover span { -background-position:100% -379px; -} -#header .buttonlinks a:hover { -text-decoration:none; -} -.buttonlinks a.prev { -background:transparent url(img/link_button_prev.jpg) no-repeat scroll right 0; -float:left; -margin:0 20px 0 0; -} -.buttonlinks a.prev span { -background:transparent url(img/link_button_prev.jpg) no-repeat scroll left 0; -float:left; -margin:0 10px 0 0; -padding:0 0 0 22px; -} -.buttonlinks a.prev:hover { -background-position:right -26px; -} -.buttonlinks a.prev:hover span { -background-position:left -26px; -} - -#header { -background:transparent url(img/site-ui-gfx.png) repeat-x scroll -23px -23px; - margin-bottom:25px; - padding-top:16px; -} -#header a:hover { -text-decoration:underline; -} -#mainheader { -position:relative; - height:116px; - margin-top:25px; -} - -#contentarea h2 { -color:#5A8F34; -font-size:1.7em; -font-weight:bold; -line-height:1em; -margin-bottom:0.5em; -} - -#downloadbar { -background:transparent url(img/installbar.png) no-repeat scroll 0 0; -height:93px; -margin-bottom:20px; -position:relative; -width:940px; -} -#downloadinfo { - color:#FFFFFF; - font-size:26px; - font-weight:bold; - line-height:66px; - padding: 0 20px; - text-transform:lowercase; - background:none; -} - -#footer { -background:#64AB24 url(img/site-ui-gfx.png) repeat-x scroll 0 -198px; -color:#FFFFFF; -margin-top:20px; -padding-top:23px; -} -#footer-inner { - background: #64AB24 none repeat scroll 0 0; - padding: 15px 0; -} -#footer h6 { -font-size:1.7em; -margin-bottom:10px; -} -#footer a { -color:#FFFFFF; -} - -#bottom { -background:#64AB24 url(img/site-ui-gfx.png) repeat-x scroll 0 0; -clear:both; -height:23px; -margin:0; -overflow:hidden; -padding:0; -} -#content ul, #content ol { -margin-left:15px; -} -#content li { -color:#6A6A6A; -margin:0 0 5px 20px; -padding-left:5px; -} -.box_6, .box_12 { -padding-top:20px; -} -.box_6 .box-inner, .box_12 .box-inner { -margin-bottom:2px; -padding:0 20px; -} -.box_6 .box-bottom { -height:20px; -line-height:20px; -} -.notes { -background-color:#FEFFCB; -} -.info { -background-color:#F3F3F3; -} -#contentarea .notes h3 { -font-size:1.3em; -} - -.installImg { - float: left; - width: 120px; - min-height: 100px; - text-align: center; -} -#rtl .installImg { - float: right; -} -#installChoices { - margin:2em 0; -} -#installChoices h3 { - padding: 0 20px; - background: url(img/elements.gif) no-repeat top left; -} -#rtl #installChoices h3 { - background-position: top right; -} -#installChoices hr { - height: 1px; - border-width: 1px 0 0; - border-top: 1px dotted #ddd; -} -#installChoices input { - margin: 0 10px 10px 0; - float: left; - display: block; -} -#rtl #installChoices input { - margin: 0 0 10px 10px; - float: right; -} - -table { -color:#8C8C8C; -font-size:95%; -width:100%; -} -caption { -text-align:center; -} -thead th { -background:#333333 none repeat scroll 0 0; -border-right:1px solid #E4E4E4; -border-top:1px solid #E4E4E4; -color:#FFFFFF; -padding:6px 6px 6px 12px; -text-align:center; -width:10%; -} -thead th.nobg { -background:transparent none repeat scroll 0 0; -border-left:0 none; -border-right:1px solid #E4E4E4; -border-top:0 none; -color:#8C8C8C; -font-style:normal; -font-weight:normal; -text-align:left; -width:auto; -} -td, th { -background:#FFFFFF none repeat scroll 0 0; -border-bottom:1px solid #E4E4E4; -border-right:1px solid #E4E4E4; -color:#8C8C8C; -height:24px; -line-height:24px; -padding:0 6px 0 12px; -} -td.alt { -background:#F5FAFA none repeat scroll 0 0; -} -tbody th { -border-left:1px solid #E4E4E4; -border-top:0 none; -font-weight:normal; -text-align:left; -} -tbody td { -padding:3px 6px; -text-align:center; -} -tr.alt td, tr.alt th { -background:#F3F3F3 none repeat scroll 0 0; -} -tr.highlight td, tr.highlight th { -background-color:#78AE20; -background-image:none; -color:#fff; -font-size:1.1em; -font-weight:bold; -padding-bottom:5px; -padding-top:5px; -} -td del { -color:#aaa; -} -p.labelHolder { - clear: left; - margin-bottom:5px; -} - -#content ul li { background: none; list-style: none; } - -#downloadbar ul { - margin:0 0 1.5em 15px; -} -#downloadbar li { - list-style-type:none; - margin:0; -} - - -#setCollation, #AUH { - background-color:#fff; - display:none; -} - -#collationMask, #AUHMask { - background-color:#fff; - opacity:0; -} - -tbody td { - text-align:left; -} -.labelHolder label { - float: left; - margin-bottom: 5px; - width: 200px; -} -#rtl .labelHolder label { - float: right; -} -.status { - margin: 1em 0 2em; - padding: .25em .5em; - background: #eee; -} -p.actions { - line-height: 1; - margin-top: 3px; -} -p.actions a { - margin: 0 5px 1px; - padding: 2px 6px 3px; - border-bottom: 1px solid #039; - display: block; - float: left; - color: navy; - text-decoration: none; -} -#rtl p.actions a { - float: right; -} -p.actions a:hover { - background: #039; - color: #fff; -} -p.actions a:active { - background-color: #ccc; -} -img.options { - float:left; - margin: 0 10px 0 0; -} -#rtl img.options { - float:right; - margin: 0 0 0 10px; -} -span.ok { - font-weight:bold; - color:green; -} -span.notok { - font-weight:bold; - color:red; -} -#logo { -background:transparent url(img/site-ui-gfx.png) repeat -10px -289px; -display:block; -height:63px; -left:0; -line-height:63px; -margin:20px 0 0; -position:absolute; -text-indent:-9999px; -top:0; -width:228px; +html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, +html body * span.clear, html body * div.clear, html body * li.clear, html body * dd.clear { +background:transparent none repeat scroll 0 0; +border:0 none; +font-size:100%; +margin:0; +outline-color:-moz-use-text-color; +outline-style:none; +outline-width:0; +padding:0; +vertical-align:baseline; +} + +body { +-x-system-font:none; +font-family:Helvetica,Arial,'Liberation Sans',FreeSans,sans-serif; +font-size:75%; +font-size-adjust:none; +font-stretch:normal; +font-style:normal; +font-variant:normal; +font-weight:normal; +line-height:1.5; +background: #F4F4F4 none repeat scroll 0 0; +} + +html > body { +font-size:13px; +} +body { +background-color: #FFFFFF; +font-family: "Lucida Grande","Lucida Sans Unicode",Verdana,Arial,Helvetica,sans-serif; +} + +ol, ul { +list-style-image:none; +list-style-position:outside; +list-style-type:none; +} +ins { +text-decoration:none; +} +del { +text-decoration:line-through; +} +table { +border-collapse:collapse; +border-spacing:0; +} +a:focus { +} +h1, h2, h3, h4, h5, h6 { +font-weight:normal; +} +h1 { +font-size:216.667%; +line-height:0.692308; +margin:0.461538em 0 0.230769em; +} +h2 { +font-size:166.667%; +line-height:0.9; +margin:0.6em 0 0.3em; +} +h3 { +font-size:141.667%; +line-height:0.823529; +margin:0.54902em 0 0.27451em; +font-weight: bold; +} +h4 { +font-size:116.667%; +line-height:1; +margin:0.666667em 0 0.333333em; +} +h3, h4 { +color:#585858; +font-size:1.1em; +line-height:1.3em; +margin-bottom:0.75em; +} + + +h5 { +font-size:100%; +font-weight:bold; +line-height:1.5; +margin:1em 0 0.5em; +} +h6 { +font-size:83.3333%; +font-weight:bold; +line-height:1.8; +margin:1.8em 0 0; +} +ol { +list-style-image:none; +list-style-position:outside; +list-style-type:decimal; +} +ul { +list-style-image:none; +list-style-position:outside; +list-style-type:square; +} +li { +margin-left:30px; +} +p, dl, hr, ol, ul, dl pre, table, address, fieldset { +margin-bottom:1.5em; +} +.container_12 { +margin-left:auto; +margin-right:auto; +width:700px; +} + +#rtl { + direction: rtl; + text-align: right; +} + +.alpha { +margin-left:0; +} +.omega { +margin-right:0; +} + +.clearfix:after { +clear:both; +content:'.'; +display:block; +height:0; +visibility:hidden; +} +.clearfix { +display:inline-block; +} +* html .clearfix { +height:1%; +} +.clearfix { +display:block; +} +strong, em, b, i { +} +h1, h2, h3, h4, h5, h6, address { +margin-top:0; +} +p, td, th, dt, dd, li { +color:#6A6A6A; +} +#footer p { +color:#FFFFFF; +} +code, pre { +margin-bottom:1em; +} +dt { +display:inline; +font-weight:bold; +} +dd { +margin-bottom:20px; +} +.left { +float:left; +} +.right { +float:right; +} +img.left { +float:left; +margin-right:10px; +} +img.right { +float:right; +margin-left:10px; +} +a { +color:#0066CC; +} +a img { +border:0 none; +} +sup { +font-size:smaller; +vertical-align:super; +} +.hidden { +display:none; +} +hr { +clear:both; +border-bottom: 1px solid #FFFFFF; +border-top: 1px solid #E6E6E6; +color:#E6E6E6; +height:0; +} +.clear, .cls { +background-color:transparent; +border:0 none; +clear:both !important; +height:1px; +margin-top:-1px; +visibility:hidden; +} +.center { +margin:0 auto; +text-align:center; +} + +.inputtip { +color:#888888; +} + +.help { + float: right; +} +.help a { + color: #fff; + text-decoration: none !important; + text-transform: uppercase; + -moz-border-radius: 3x; + -webkit-border-radius: 3px; + border-radius: 3px; + border: 1px solid #ffbc6c; + border-right-color: #db831a; + border-bottom-color: #db831a; + background: #f2901d; + font-size: 86%; + padding: 2px 4px; + letter-spacing: 1px; +} +.help a:hover { + background: #f8a440; +} +.help a:active { + border: 1px solid #db831a; + border-right-color: #ffbc6c; + border-bottom-color: #ffbc6c; +} +.version { + color: #fff; +} +span.mono { + font-family: Courier, monospace; +} +.buttonlinks { + display:block; + height:26px; + line-height:26px; + margin-bottom:20px; + float:right; + clear: left; +} +#rtl .buttonlinks { + float: left; +} + +.info .buttonlinks { +margin:0; +} +.buttonlinks a { +-x-system-font:none; +background:transparent url(img/site-ui-gfx.png) no-repeat scroll -54px -353px; +color:#5A5A5A; +display:block; +float:left; +font: bold 11px/23px "Lucida Grande",Lucida,Verdana,sans-serif; +height:26px; +margin:0 20px 0 0; +padding:0; +max-width:250px; +text-decoration:none; +text-transform:uppercase; +} +#rtl .buttonlinks a { + margin: 0 0 0 20px; +} +.buttonlinks a span { +background:#FFFFFF url(img/site-ui-gfx.png) no-repeat scroll 100% -353px; +display:block; +float:left; +height:26px; +margin:0 0 0 10px; +padding:0 22px 0 0; +} + +.buttonlinks a:hover { +background-position:-54px -379px; +cursor:pointer; +} +.buttonlinks a:hover span { +background-position:100% -379px; +cursor:pointer; +} +.buttonlinks a:hover { +background-position:-54px -379px; +} +.buttonlinks a:hover span { +background-position:100% -379px; +} +#header .buttonlinks a:hover { +text-decoration:none; +} +.buttonlinks a.prev { +background:transparent url(img/link_button_prev.jpg) no-repeat scroll right 0; +float:left; +margin:0 20px 0 0; +} +.buttonlinks a.prev span { +background:transparent url(img/link_button_prev.jpg) no-repeat scroll left 0; +float:left; +margin:0 10px 0 0; +padding:0 0 0 22px; +} +.buttonlinks a.prev:hover { +background-position:right -26px; +} +.buttonlinks a.prev:hover span { +background-position:left -26px; +} + +#header { +background:transparent url(img/site-ui-gfx.png) repeat-x scroll -23px -23px; + margin-bottom:25px; + padding-top:16px; +} +#header a:hover { +text-decoration:underline; +} +#mainheader { +position:relative; + height:116px; + margin-top:25px; +} + +#contentarea h2 { +color:#5A8F34; +font-size:1.7em; +font-weight:bold; +line-height:1em; +margin-bottom:0.5em; +} + +#downloadbar { +background:transparent url(img/installbar.png) no-repeat scroll 0 0; +height:93px; +margin-bottom:20px; +position:relative; +width:940px; +} +#downloadinfo { + color:#FFFFFF; + font-size:26px; + font-weight:bold; + line-height:66px; + padding: 0 20px; + text-transform:lowercase; + background:none; +} + +#footer { +background:#64AB24 url(img/site-ui-gfx.png) repeat-x scroll 0 -198px; +color:#FFFFFF; +margin-top:20px; +padding-top:23px; +} +#footer-inner { + background: #64AB24 none repeat scroll 0 0; + padding: 15px 0; +} +#footer h6 { +font-size:1.7em; +margin-bottom:10px; +} +#footer a { +color:#FFFFFF; +} + +#bottom { +background:#64AB24 url(img/site-ui-gfx.png) repeat-x scroll 0 0; +clear:both; +height:23px; +margin:0; +overflow:hidden; +padding:0; +} +#content ul, #content ol { +margin-left:15px; +} +#content li { +color:#6A6A6A; +margin:0 0 5px 20px; +padding-left:5px; +} +.box_6, .box_12 { +padding-top:20px; +} +.box_6 .box-inner, .box_12 .box-inner { +margin-bottom:2px; +padding:0 20px; +} +.box_6 .box-bottom { +height:20px; +line-height:20px; +} +.notes { +background-color:#FEFFCB; +} +.info { +background-color:#F3F3F3; +} +#contentarea .notes h3 { +font-size:1.3em; +} + +.installImg { + float: left; + width: 120px; + min-height: 100px; + text-align: center; +} +#rtl .installImg { + float: right; +} +#installChoices { + margin:2em 0; +} +#installChoices h3 { + padding: 0 20px; + background: url(img/elements.gif) no-repeat top left; +} +#rtl #installChoices h3 { + background-position: top right; +} +#installChoices hr { + height: 1px; + border-width: 1px 0 0; + border-top: 1px dotted #ddd; +} +#installChoices input { + margin: 0 10px 10px 0; + float: left; + display: block; +} +#rtl #installChoices input { + margin: 0 0 10px 10px; + float: right; +} + +table { +color:#8C8C8C; +font-size:95%; +width:100%; +} +caption { +text-align:center; +} +thead th { +background:#333333 none repeat scroll 0 0; +border-right:1px solid #E4E4E4; +border-top:1px solid #E4E4E4; +color:#FFFFFF; +padding:6px 6px 6px 12px; +text-align:center; +width:10%; +} +thead th.nobg { +background:transparent none repeat scroll 0 0; +border-left:0 none; +border-right:1px solid #E4E4E4; +border-top:0 none; +color:#8C8C8C; +font-style:normal; +font-weight:normal; +text-align:left; +width:auto; +} +td, th { +background:#FFFFFF none repeat scroll 0 0; +border-bottom:1px solid #E4E4E4; +border-right:1px solid #E4E4E4; +color:#8C8C8C; +height:24px; +line-height:24px; +padding:0 6px 0 12px; +} +td.alt { +background:#F5FAFA none repeat scroll 0 0; +} +tbody th { +border-left:1px solid #E4E4E4; +border-top:0 none; +font-weight:normal; +text-align:left; +} +tbody td { +padding:3px 6px; +text-align:center; +} +tr.alt td, tr.alt th { +background:#F3F3F3 none repeat scroll 0 0; +} +tr.highlight td, tr.highlight th { +background-color:#78AE20; +background-image:none; +color:#fff; +font-size:1.1em; +font-weight:bold; +padding-bottom:5px; +padding-top:5px; +} +td del { +color:#aaa; +} +p.labelHolder { + clear: left; + margin-bottom:5px; +} + +#content ul li { background: none; list-style: none; } + +#downloadbar ul { + margin:0 0 1.5em 15px; +} +#downloadbar li { + list-style-type:none; + margin:0; +} + + +#setCollation, #AUH { + background-color:#fff; + display:none; +} + +#collationMask, #AUHMask { + background-color:#fff; + opacity:0; +} + +tbody td { + text-align:left; +} +.labelHolder label { + float: left; + margin-bottom: 5px; + width: 200px; +} +#rtl .labelHolder label { + float: right; +} +.status { + margin: 1em 0 2em; + padding: .25em .5em; + background: #eee; +} +p.actions { + line-height: 1; + margin-top: 3px; +} +p.actions a { + margin: 0 5px 1px; + padding: 2px 6px 3px; + border-bottom: 1px solid #039; + display: block; + float: left; + color: navy; + text-decoration: none; +} +#rtl p.actions a { + float: right; +} +p.actions a:hover { + background: #039; + color: #fff; +} +p.actions a:active { + background-color: #ccc; +} +img.options { + float:left; + margin: 0 10px 0 0; +} +#rtl img.options { + float:right; + margin: 0 0 0 10px; +} +span.ok { + font-weight:bold; + color:green; +} +span.notok { + font-weight:bold; + color:red; +} +#logo { +background:transparent url(img/site-ui-gfx.png) repeat -10px -289px; +display:block; +height:63px; +left:0; +line-height:63px; +margin:20px 0 0; +position:absolute; +text-indent:-9999px; +top:0; +width:228px; } \ No newline at end of file diff --git a/assets/modules/store/js/fancybox/helpers/jquery.fancybox-buttons.css b/assets/modules/store/js/fancybox/helpers/jquery.fancybox-buttons.css index c0a81df164..f80dbed27a 100755 --- a/assets/modules/store/js/fancybox/helpers/jquery.fancybox-buttons.css +++ b/assets/modules/store/js/fancybox/helpers/jquery.fancybox-buttons.css @@ -1,96 +1,96 @@ -#fancybox-buttons { - position: fixed; - left: 0; - width: 100%; - z-index: 8050; -} - -#fancybox-buttons.top { - top: 10px; -} - -#fancybox-buttons.bottom { - bottom: 10px; -} - -#fancybox-buttons ul { - display: block; - width: 166px; - height: 30px; - margin: 0 auto; - padding: 0; - list-style: none; - border: 1px solid #111; - border-radius: 3px; - -webkit-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); - -moz-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); - box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); - background: rgb(50,50,50); - background: -moz-linear-gradient(top, rgb(68,68,68) 0%, rgb(52,52,52) 50%, rgb(41,41,41) 50%, rgb(51,51,51) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(68,68,68)), color-stop(50%,rgb(52,52,52)), color-stop(50%,rgb(41,41,41)), color-stop(100%,rgb(51,51,51))); - background: -webkit-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); - background: -o-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); - background: -ms-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); - background: linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 ); -} - -#fancybox-buttons ul li { - float: left; - margin: 0; - padding: 0; -} - -#fancybox-buttons a { - display: block; - width: 30px; - height: 30px; - text-indent: -9999px; - background-image: url('fancybox_buttons.png'); - background-repeat: no-repeat; - outline: none; - opacity: 0.8; -} - -#fancybox-buttons a:hover { - opacity: 1; -} - -#fancybox-buttons a.btnPrev { - background-position: 5px 0; -} - -#fancybox-buttons a.btnNext { - background-position: -33px 0; - border-right: 1px solid #3e3e3e; -} - -#fancybox-buttons a.btnPlay { - background-position: 0 -30px; -} - -#fancybox-buttons a.btnPlayOn { - background-position: -30px -30px; -} - -#fancybox-buttons a.btnToggle { - background-position: 3px -60px; - border-left: 1px solid #111; - border-right: 1px solid #3e3e3e; - width: 35px -} - -#fancybox-buttons a.btnToggleOn { - background-position: -27px -60px; -} - -#fancybox-buttons a.btnClose { - border-left: 1px solid #111; - width: 35px; - background-position: -56px 0px; -} - -#fancybox-buttons a.btnDisabled { - opacity : 0.4; - cursor: default; -} +#fancybox-buttons { + position: fixed; + left: 0; + width: 100%; + z-index: 8050; +} + +#fancybox-buttons.top { + top: 10px; +} + +#fancybox-buttons.bottom { + bottom: 10px; +} + +#fancybox-buttons ul { + display: block; + width: 166px; + height: 30px; + margin: 0 auto; + padding: 0; + list-style: none; + border: 1px solid #111; + border-radius: 3px; + -webkit-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); + -moz-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); + box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); + background: rgb(50,50,50); + background: -moz-linear-gradient(top, rgb(68,68,68) 0%, rgb(52,52,52) 50%, rgb(41,41,41) 50%, rgb(51,51,51) 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(68,68,68)), color-stop(50%,rgb(52,52,52)), color-stop(50%,rgb(41,41,41)), color-stop(100%,rgb(51,51,51))); + background: -webkit-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); + background: -o-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); + background: -ms-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); + background: linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 ); +} + +#fancybox-buttons ul li { + float: left; + margin: 0; + padding: 0; +} + +#fancybox-buttons a { + display: block; + width: 30px; + height: 30px; + text-indent: -9999px; + background-image: url('fancybox_buttons.png'); + background-repeat: no-repeat; + outline: none; + opacity: 0.8; +} + +#fancybox-buttons a:hover { + opacity: 1; +} + +#fancybox-buttons a.btnPrev { + background-position: 5px 0; +} + +#fancybox-buttons a.btnNext { + background-position: -33px 0; + border-right: 1px solid #3e3e3e; +} + +#fancybox-buttons a.btnPlay { + background-position: 0 -30px; +} + +#fancybox-buttons a.btnPlayOn { + background-position: -30px -30px; +} + +#fancybox-buttons a.btnToggle { + background-position: 3px -60px; + border-left: 1px solid #111; + border-right: 1px solid #3e3e3e; + width: 35px +} + +#fancybox-buttons a.btnToggleOn { + background-position: -27px -60px; +} + +#fancybox-buttons a.btnClose { + border-left: 1px solid #111; + width: 35px; + background-position: -56px 0px; +} + +#fancybox-buttons a.btnDisabled { + opacity : 0.4; + cursor: default; +} diff --git a/assets/modules/store/js/fancybox/helpers/jquery.fancybox-buttons.js b/assets/modules/store/js/fancybox/helpers/jquery.fancybox-buttons.js index a31a4932c6..ff5acc93b0 100755 --- a/assets/modules/store/js/fancybox/helpers/jquery.fancybox-buttons.js +++ b/assets/modules/store/js/fancybox/helpers/jquery.fancybox-buttons.js @@ -1,121 +1,121 @@ - /*! - * Buttons helper for fancyBox - * version: 1.0.5 (Mon, 15 Oct 2012) - * @requires fancyBox v2.0 or later - * - * Usage: - * $(".fancybox").fancybox({ - * helpers : { - * buttons: { - * position : 'top' - * } - * } - * }); - * - */ -(function ($) { - //Shortcut for fancyBox object - var F = $.fancybox; - - //Add helper object - F.helpers.buttons = { - defaults : { - skipSingle : false, // disables if gallery contains single image - position : 'top', // 'top' or 'bottom' - tpl : '
' - }, - - list : null, - buttons: null, - - beforeLoad: function (opts, obj) { - //Remove self if gallery do not have at least two items - - if (opts.skipSingle && obj.group.length < 2) { - obj.helpers.buttons = false; - obj.closeBtn = true; - - return; - } - - //Increase top margin to give space for buttons - obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30; - }, - - onPlayStart: function () { - if (this.buttons) { - this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn'); - } - }, - - onPlayEnd: function () { - if (this.buttons) { - this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn'); - } - }, - - afterShow: function (opts, obj) { - var buttons = this.buttons; - - if (!buttons) { - this.list = $(opts.tpl).addClass(opts.position).appendTo('body'); - - buttons = { - prev : this.list.find('.btnPrev').click( F.prev ), - next : this.list.find('.btnNext').click( F.next ), - play : this.list.find('.btnPlay').click( F.play ), - toggle : this.list.find('.btnToggle').click( F.toggle ) - } - } - - //Prev - if (obj.index > 0 || obj.loop) { - buttons.prev.removeClass('btnDisabled'); - } else { - buttons.prev.addClass('btnDisabled'); - } - - //Next / Play - if (obj.loop || obj.index < obj.group.length - 1) { - buttons.next.removeClass('btnDisabled'); - buttons.play.removeClass('btnDisabled'); - - } else { - buttons.next.addClass('btnDisabled'); - buttons.play.addClass('btnDisabled'); - } - - this.buttons = buttons; - - this.onUpdate(opts, obj); - }, - - onUpdate: function (opts, obj) { - var toggle; - - if (!this.buttons) { - return; - } - - toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn'); - - //Size toggle button - if (obj.canShrink) { - toggle.addClass('btnToggleOn'); - - } else if (!obj.canExpand) { - toggle.addClass('btnDisabled'); - } - }, - - beforeClose: function () { - if (this.list) { - this.list.remove(); - } - - this.list = null; - this.buttons = null; - } - }; - -}(jQuery)); + /*! + * Buttons helper for fancyBox + * version: 1.0.5 (Mon, 15 Oct 2012) + * @requires fancyBox v2.0 or later + * + * Usage: + * $(".fancybox").fancybox({ + * helpers : { + * buttons: { + * position : 'top' + * } + * } + * }); + * + */ +(function ($) { + //Shortcut for fancyBox object + var F = $.fancybox; + + //Add helper object + F.helpers.buttons = { + defaults : { + skipSingle : false, // disables if gallery contains single image + position : 'top', // 'top' or 'bottom' + tpl : '
' + }, + + list : null, + buttons: null, + + beforeLoad: function (opts, obj) { + //Remove self if gallery do not have at least two items + + if (opts.skipSingle && obj.group.length < 2) { + obj.helpers.buttons = false; + obj.closeBtn = true; + + return; + } + + //Increase top margin to give space for buttons + obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30; + }, + + onPlayStart: function () { + if (this.buttons) { + this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn'); + } + }, + + onPlayEnd: function () { + if (this.buttons) { + this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn'); + } + }, + + afterShow: function (opts, obj) { + var buttons = this.buttons; + + if (!buttons) { + this.list = $(opts.tpl).addClass(opts.position).appendTo('body'); + + buttons = { + prev : this.list.find('.btnPrev').click( F.prev ), + next : this.list.find('.btnNext').click( F.next ), + play : this.list.find('.btnPlay').click( F.play ), + toggle : this.list.find('.btnToggle').click( F.toggle ) + } + } + + //Prev + if (obj.index > 0 || obj.loop) { + buttons.prev.removeClass('btnDisabled'); + } else { + buttons.prev.addClass('btnDisabled'); + } + + //Next / Play + if (obj.loop || obj.index < obj.group.length - 1) { + buttons.next.removeClass('btnDisabled'); + buttons.play.removeClass('btnDisabled'); + + } else { + buttons.next.addClass('btnDisabled'); + buttons.play.addClass('btnDisabled'); + } + + this.buttons = buttons; + + this.onUpdate(opts, obj); + }, + + onUpdate: function (opts, obj) { + var toggle; + + if (!this.buttons) { + return; + } + + toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn'); + + //Size toggle button + if (obj.canShrink) { + toggle.addClass('btnToggleOn'); + + } else if (!obj.canExpand) { + toggle.addClass('btnDisabled'); + } + }, + + beforeClose: function () { + if (this.list) { + this.list.remove(); + } + + this.list = null; + this.buttons = null; + } + }; + +}(jQuery)); diff --git a/assets/modules/store/js/fancybox/helpers/jquery.fancybox-media.js b/assets/modules/store/js/fancybox/helpers/jquery.fancybox-media.js index 2ec984d18f..88cc165c7e 100755 --- a/assets/modules/store/js/fancybox/helpers/jquery.fancybox-media.js +++ b/assets/modules/store/js/fancybox/helpers/jquery.fancybox-media.js @@ -1,196 +1,196 @@ -/*! - * Media helper for fancyBox - * version: 1.0.5 (Tue, 23 Oct 2012) - * @requires fancyBox v2.0 or later - * - * Usage: - * $(".fancybox").fancybox({ - * helpers : { - * media: true - * } - * }); - * - * Set custom URL parameters: - * $(".fancybox").fancybox({ - * helpers : { - * media: { - * youtube : { - * params : { - * autoplay : 0 - * } - * } - * } - * } - * }); - * - * Or: - * $(".fancybox").fancybox({, - * helpers : { - * media: true - * }, - * youtube : { - * autoplay: 0 - * } - * }); - * - * Supports: - * - * Youtube - * http://www.youtube.com/watch?v=opj24KnzrWo - * http://www.youtube.com/embed/opj24KnzrWo - * http://youtu.be/opj24KnzrWo - * Vimeo - * http://vimeo.com/40648169 - * http://vimeo.com/channels/staffpicks/38843628 - * http://vimeo.com/groups/surrealism/videos/36516384 - * http://player.vimeo.com/video/45074303 - * Metacafe - * http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/ - * http://www.metacafe.com/watch/7635964/ - * Dailymotion - * http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people - * Twitvid - * http://twitvid.com/QY7MD - * Twitpic - * http://twitpic.com/7p93st - * Instagram - * http://instagr.am/p/IejkuUGxQn/ - * http://instagram.com/p/IejkuUGxQn/ - * Google maps - * http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17 - * http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16 - * http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56 - */ -(function ($) { - "use strict"; - - //Shortcut for fancyBox object - var F = $.fancybox, - format = function( url, rez, params ) { - params = params || ''; - - if ( $.type( params ) === "object" ) { - params = $.param(params, true); - } - - $.each(rez, function(key, value) { - url = url.replace( '$' + key, value || '' ); - }); - - if (params.length) { - url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params; - } - - return url; - }; - - //Add helper object - F.helpers.media = { - defaults : { - youtube : { - matcher : /(youtube\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i, - params : { - autoplay : 1, - autohide : 1, - fs : 1, - rel : 0, - hd : 1, - wmode : 'opaque', - enablejsapi : 1 - }, - type : 'iframe', - url : '//www.youtube.com/embed/$3' - }, - vimeo : { - matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/, - params : { - autoplay : 1, - hd : 1, - show_title : 1, - show_byline : 1, - show_portrait : 0, - fullscreen : 1 - }, - type : 'iframe', - url : '//player.vimeo.com/video/$1' - }, - metacafe : { - matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/, - params : { - autoPlay : 'yes' - }, - type : 'swf', - url : function( rez, params, obj ) { - obj.swf.flashVars = 'playerVars=' + $.param( params, true ); - - return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf'; - } - }, - dailymotion : { - matcher : /dailymotion.com\/video\/(.*)\/?(.*)/, - params : { - additionalInfos : 0, - autoStart : 1 - }, - type : 'swf', - url : '//www.dailymotion.com/swf/video/$1' - }, - twitvid : { - matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i, - params : { - autoplay : 0 - }, - type : 'iframe', - url : '//www.twitvid.com/embed.php?guid=$1' - }, - twitpic : { - matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i, - type : 'image', - url : '//twitpic.com/show/full/$1/' - }, - instagram : { - matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i, - type : 'image', - url : '//$1/p/$2/media/' - }, - google_maps : { - matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i, - type : 'iframe', - url : function( rez ) { - return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed'); - } - } - }, - - beforeLoad : function(opts, obj) { - var url = obj.href || '', - type = false, - what, - item, - rez, - params; - - for (what in opts) { - item = opts[ what ]; - rez = url.match( item.matcher ); - - if (rez) { - type = item.type; - params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null)); - - url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params ); - - break; - } - } - - if (type) { - obj.href = url; - obj.type = type; - - obj.autoHeight = false; - } - } - }; - -}(jQuery)); +/*! + * Media helper for fancyBox + * version: 1.0.5 (Tue, 23 Oct 2012) + * @requires fancyBox v2.0 or later + * + * Usage: + * $(".fancybox").fancybox({ + * helpers : { + * media: true + * } + * }); + * + * Set custom URL parameters: + * $(".fancybox").fancybox({ + * helpers : { + * media: { + * youtube : { + * params : { + * autoplay : 0 + * } + * } + * } + * } + * }); + * + * Or: + * $(".fancybox").fancybox({, + * helpers : { + * media: true + * }, + * youtube : { + * autoplay: 0 + * } + * }); + * + * Supports: + * + * Youtube + * http://www.youtube.com/watch?v=opj24KnzrWo + * http://www.youtube.com/embed/opj24KnzrWo + * http://youtu.be/opj24KnzrWo + * Vimeo + * http://vimeo.com/40648169 + * http://vimeo.com/channels/staffpicks/38843628 + * http://vimeo.com/groups/surrealism/videos/36516384 + * http://player.vimeo.com/video/45074303 + * Metacafe + * http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/ + * http://www.metacafe.com/watch/7635964/ + * Dailymotion + * http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people + * Twitvid + * http://twitvid.com/QY7MD + * Twitpic + * http://twitpic.com/7p93st + * Instagram + * http://instagr.am/p/IejkuUGxQn/ + * http://instagram.com/p/IejkuUGxQn/ + * Google maps + * http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17 + * http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16 + * http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56 + */ +(function ($) { + "use strict"; + + //Shortcut for fancyBox object + var F = $.fancybox, + format = function( url, rez, params ) { + params = params || ''; + + if ( $.type( params ) === "object" ) { + params = $.param(params, true); + } + + $.each(rez, function(key, value) { + url = url.replace( '$' + key, value || '' ); + }); + + if (params.length) { + url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params; + } + + return url; + }; + + //Add helper object + F.helpers.media = { + defaults : { + youtube : { + matcher : /(youtube\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i, + params : { + autoplay : 1, + autohide : 1, + fs : 1, + rel : 0, + hd : 1, + wmode : 'opaque', + enablejsapi : 1 + }, + type : 'iframe', + url : '//www.youtube.com/embed/$3' + }, + vimeo : { + matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/, + params : { + autoplay : 1, + hd : 1, + show_title : 1, + show_byline : 1, + show_portrait : 0, + fullscreen : 1 + }, + type : 'iframe', + url : '//player.vimeo.com/video/$1' + }, + metacafe : { + matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/, + params : { + autoPlay : 'yes' + }, + type : 'swf', + url : function( rez, params, obj ) { + obj.swf.flashVars = 'playerVars=' + $.param( params, true ); + + return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf'; + } + }, + dailymotion : { + matcher : /dailymotion.com\/video\/(.*)\/?(.*)/, + params : { + additionalInfos : 0, + autoStart : 1 + }, + type : 'swf', + url : '//www.dailymotion.com/swf/video/$1' + }, + twitvid : { + matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i, + params : { + autoplay : 0 + }, + type : 'iframe', + url : '//www.twitvid.com/embed.php?guid=$1' + }, + twitpic : { + matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i, + type : 'image', + url : '//twitpic.com/show/full/$1/' + }, + instagram : { + matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i, + type : 'image', + url : '//$1/p/$2/media/' + }, + google_maps : { + matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i, + type : 'iframe', + url : function( rez ) { + return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed'); + } + } + }, + + beforeLoad : function(opts, obj) { + var url = obj.href || '', + type = false, + what, + item, + rez, + params; + + for (what in opts) { + item = opts[ what ]; + rez = url.match( item.matcher ); + + if (rez) { + type = item.type; + params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null)); + + url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params ); + + break; + } + } + + if (type) { + obj.href = url; + obj.type = type; + + obj.autoHeight = false; + } + } + }; + +}(jQuery)); diff --git a/assets/modules/store/js/fancybox/helpers/jquery.fancybox-thumbs.css b/assets/modules/store/js/fancybox/helpers/jquery.fancybox-thumbs.css index 7cc3e016d1..a53272057d 100755 --- a/assets/modules/store/js/fancybox/helpers/jquery.fancybox-thumbs.css +++ b/assets/modules/store/js/fancybox/helpers/jquery.fancybox-thumbs.css @@ -1,54 +1,54 @@ -#fancybox-thumbs { - position: fixed; - left: 0; - width: 100%; - overflow: hidden; - z-index: 8050; -} - -#fancybox-thumbs.bottom { - bottom: 2px; -} - -#fancybox-thumbs.top { - top: 2px; -} - -#fancybox-thumbs ul { - position: relative; - list-style: none; - margin: 0; - padding: 0; -} - -#fancybox-thumbs ul li { - float: left; - padding: 1px; - opacity: 0.5; -} - -#fancybox-thumbs ul li.active { - opacity: 0.75; - padding: 0; - border: 1px solid #fff; -} - -#fancybox-thumbs ul li:hover { - opacity: 1; -} - -#fancybox-thumbs ul li a { - display: block; - position: relative; - overflow: hidden; - border: 1px solid #222; - background: #111; - outline: none; -} - -#fancybox-thumbs ul li img { - display: block; - position: relative; - border: 0; - padding: 0; -} +#fancybox-thumbs { + position: fixed; + left: 0; + width: 100%; + overflow: hidden; + z-index: 8050; +} + +#fancybox-thumbs.bottom { + bottom: 2px; +} + +#fancybox-thumbs.top { + top: 2px; +} + +#fancybox-thumbs ul { + position: relative; + list-style: none; + margin: 0; + padding: 0; +} + +#fancybox-thumbs ul li { + float: left; + padding: 1px; + opacity: 0.5; +} + +#fancybox-thumbs ul li.active { + opacity: 0.75; + padding: 0; + border: 1px solid #fff; +} + +#fancybox-thumbs ul li:hover { + opacity: 1; +} + +#fancybox-thumbs ul li a { + display: block; + position: relative; + overflow: hidden; + border: 1px solid #222; + background: #111; + outline: none; +} + +#fancybox-thumbs ul li img { + display: block; + position: relative; + border: 0; + padding: 0; +} diff --git a/assets/modules/store/js/fancybox/helpers/jquery.fancybox-thumbs.js b/assets/modules/store/js/fancybox/helpers/jquery.fancybox-thumbs.js index c7a7c7904a..81744578b9 100755 --- a/assets/modules/store/js/fancybox/helpers/jquery.fancybox-thumbs.js +++ b/assets/modules/store/js/fancybox/helpers/jquery.fancybox-thumbs.js @@ -1,162 +1,162 @@ - /*! - * Thumbnail helper for fancyBox - * version: 1.0.7 (Mon, 01 Oct 2012) - * @requires fancyBox v2.0 or later - * - * Usage: - * $(".fancybox").fancybox({ - * helpers : { - * thumbs: { - * width : 50, - * height : 50 - * } - * } - * }); - * - */ -(function ($) { - //Shortcut for fancyBox object - var F = $.fancybox; - - //Add helper object - F.helpers.thumbs = { - defaults : { - width : 50, // thumbnail width - height : 50, // thumbnail height - position : 'bottom', // 'top' or 'bottom' - source : function ( item ) { // function to obtain the URL of the thumbnail image - var href; - - if (item.element) { - href = $(item.element).find('img').attr('src'); - } - - if (!href && item.type === 'image' && item.href) { - href = item.href; - } - - return href; - } - }, - - wrap : null, - list : null, - width : 0, - - init: function (opts, obj) { - var that = this, - list, - thumbWidth = opts.width, - thumbHeight = opts.height, - thumbSource = opts.source; - - //Build list structure - list = ''; - - for (var n = 0; n < obj.group.length; n++) { - list += '
  • '; - } - - this.wrap = $('
    ').addClass(opts.position).appendTo('body'); - this.list = $('
      ' + list + '
    ').appendTo(this.wrap); - - //Load each thumbnail - $.each(obj.group, function (i) { - var href = thumbSource( obj.group[ i ] ); - - if (!href) { - return; - } - - $("").load(function () { - var width = this.width, - height = this.height, - widthRatio, heightRatio, parent; - - if (!that.list || !width || !height) { - return; - } - - //Calculate thumbnail width/height and center it - widthRatio = width / thumbWidth; - heightRatio = height / thumbHeight; - - parent = that.list.children().eq(i).find('a'); - - if (widthRatio >= 1 && heightRatio >= 1) { - if (widthRatio > heightRatio) { - width = Math.floor(width / heightRatio); - height = thumbHeight; - - } else { - width = thumbWidth; - height = Math.floor(height / widthRatio); - } - } - - $(this).css({ - width : width, - height : height, - top : Math.floor(thumbHeight / 2 - height / 2), - left : Math.floor(thumbWidth / 2 - width / 2) - }); - - parent.width(thumbWidth).height(thumbHeight); - - $(this).hide().appendTo(parent).fadeIn(300); - - }).attr('src', href); - }); - - //Set initial width - this.width = this.list.children().eq(0).outerWidth(true); - - this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))); - }, - - beforeLoad: function (opts, obj) { - //Remove self if gallery do not have at least two items - if (obj.group.length < 2) { - obj.helpers.thumbs = false; - - return; - } - - //Increase bottom margin to give space for thumbs - obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15); - }, - - afterShow: function (opts, obj) { - //Check if exists and create or update list - if (this.list) { - this.onUpdate(opts, obj); - - } else { - this.init(opts, obj); - } - - //Set active element - this.list.children().removeClass('active').eq(obj.index).addClass('active'); - }, - - //Center list - onUpdate: function (opts, obj) { - if (this.list) { - this.list.stop(true).animate({ - 'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)) - }, 150); - } - }, - - beforeClose: function () { - if (this.wrap) { - this.wrap.remove(); - } - - this.wrap = null; - this.list = null; - this.width = 0; - } - } - -}(jQuery)); + /*! + * Thumbnail helper for fancyBox + * version: 1.0.7 (Mon, 01 Oct 2012) + * @requires fancyBox v2.0 or later + * + * Usage: + * $(".fancybox").fancybox({ + * helpers : { + * thumbs: { + * width : 50, + * height : 50 + * } + * } + * }); + * + */ +(function ($) { + //Shortcut for fancyBox object + var F = $.fancybox; + + //Add helper object + F.helpers.thumbs = { + defaults : { + width : 50, // thumbnail width + height : 50, // thumbnail height + position : 'bottom', // 'top' or 'bottom' + source : function ( item ) { // function to obtain the URL of the thumbnail image + var href; + + if (item.element) { + href = $(item.element).find('img').attr('src'); + } + + if (!href && item.type === 'image' && item.href) { + href = item.href; + } + + return href; + } + }, + + wrap : null, + list : null, + width : 0, + + init: function (opts, obj) { + var that = this, + list, + thumbWidth = opts.width, + thumbHeight = opts.height, + thumbSource = opts.source; + + //Build list structure + list = ''; + + for (var n = 0; n < obj.group.length; n++) { + list += '
  • '; + } + + this.wrap = $('
    ').addClass(opts.position).appendTo('body'); + this.list = $('
      ' + list + '
    ').appendTo(this.wrap); + + //Load each thumbnail + $.each(obj.group, function (i) { + var href = thumbSource( obj.group[ i ] ); + + if (!href) { + return; + } + + $("").load(function () { + var width = this.width, + height = this.height, + widthRatio, heightRatio, parent; + + if (!that.list || !width || !height) { + return; + } + + //Calculate thumbnail width/height and center it + widthRatio = width / thumbWidth; + heightRatio = height / thumbHeight; + + parent = that.list.children().eq(i).find('a'); + + if (widthRatio >= 1 && heightRatio >= 1) { + if (widthRatio > heightRatio) { + width = Math.floor(width / heightRatio); + height = thumbHeight; + + } else { + width = thumbWidth; + height = Math.floor(height / widthRatio); + } + } + + $(this).css({ + width : width, + height : height, + top : Math.floor(thumbHeight / 2 - height / 2), + left : Math.floor(thumbWidth / 2 - width / 2) + }); + + parent.width(thumbWidth).height(thumbHeight); + + $(this).hide().appendTo(parent).fadeIn(300); + + }).attr('src', href); + }); + + //Set initial width + this.width = this.list.children().eq(0).outerWidth(true); + + this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))); + }, + + beforeLoad: function (opts, obj) { + //Remove self if gallery do not have at least two items + if (obj.group.length < 2) { + obj.helpers.thumbs = false; + + return; + } + + //Increase bottom margin to give space for thumbs + obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15); + }, + + afterShow: function (opts, obj) { + //Check if exists and create or update list + if (this.list) { + this.onUpdate(opts, obj); + + } else { + this.init(opts, obj); + } + + //Set active element + this.list.children().removeClass('active').eq(obj.index).addClass('active'); + }, + + //Center list + onUpdate: function (opts, obj) { + if (this.list) { + this.list.stop(true).animate({ + 'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)) + }, 150); + } + }, + + beforeClose: function () { + if (this.wrap) { + this.wrap.remove(); + } + + this.wrap = null; + this.list = null; + this.width = 0; + } + } + +}(jQuery)); diff --git a/assets/modules/store/js/fancybox/jquery.fancybox.css b/assets/modules/store/js/fancybox/jquery.fancybox.css index 37e921b4c6..11e14e7c3d 100755 --- a/assets/modules/store/js/fancybox/jquery.fancybox.css +++ b/assets/modules/store/js/fancybox/jquery.fancybox.css @@ -1,249 +1,249 @@ -/*! fancyBox v2.1.4 fancyapps.com | fancyapps.com/fancybox/#license */ -.fancybox-wrap, -.fancybox-skin, -.fancybox-outer, -.fancybox-inner, -.fancybox-image, -.fancybox-wrap iframe, -.fancybox-wrap object, -.fancybox-nav, -.fancybox-nav span, -.fancybox-tmp -{ - padding: 0; - margin: 0; - border: 0; - outline: none; - vertical-align: top; -} - -.fancybox-wrap { - position: absolute; - top: 0; - left: 0; - z-index: 8020; -} - -.fancybox-skin { - position: relative; - background: #fff; - color: #444; - text-shadow: none; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -.fancybox-opened { - z-index: 8030; -} - -.fancybox-opened .fancybox-skin { - -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); - -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); - box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); -} - -.fancybox-outer, .fancybox-inner { - position: relative; -} - -.fancybox-inner { - overflow: hidden; -} - -.fancybox-type-iframe .fancybox-inner { - -webkit-overflow-scrolling: touch; -} - -.fancybox-error { - color: #444; - font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; - margin: 0; - padding: 15px; - white-space: nowrap; -} - -.fancybox-image, .fancybox-iframe { - display: block; - width: 100%; - height: 100%; -} - -.fancybox-image { - max-width: 100%; - max-height: 100%; -} - -#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { - background-image: url('fancybox_sprite.png'); -} - -#fancybox-loading { - position: fixed; - top: 50%; - left: 50%; - margin-top: -22px; - margin-left: -22px; - background-position: 0 -108px; - opacity: 0.8; - cursor: pointer; - z-index: 8060; -} - -#fancybox-loading div { - width: 44px; - height: 44px; - background: url('fancybox_loading.gif') center center no-repeat; -} - -.fancybox-close { - position: absolute; - top: -18px; - right: -18px; - width: 36px; - height: 36px; - cursor: pointer; - z-index: 8040; -} - -.fancybox-nav { - position: absolute; - top: 0; - width: 40%; - height: 100%; - cursor: pointer; - text-decoration: none; - background: transparent url('blank.gif'); /* helps IE */ - -webkit-tap-highlight-color: rgba(0,0,0,0); - z-index: 8040; -} - -.fancybox-prev { - left: 0; -} - -.fancybox-next { - right: 0; -} - -.fancybox-nav span { - position: absolute; - top: 50%; - width: 36px; - height: 34px; - margin-top: -18px; - cursor: pointer; - z-index: 8040; - visibility: hidden; -} - -.fancybox-prev span { - left: 10px; - background-position: 0 -36px; -} - -.fancybox-next span { - right: 10px; - background-position: 0 -72px; -} - -.fancybox-nav:hover span { - visibility: visible; -} - -.fancybox-tmp { - position: absolute; - top: -99999px; - left: -99999px; - visibility: hidden; - max-width: 99999px; - max-height: 99999px; - overflow: visible !important; -} - -/* Overlay helper */ - -.fancybox-lock { - overflow: hidden; -} - -.fancybox-overlay { - position: absolute; - top: 0; - left: 0; - overflow: hidden; - display: none; - z-index: 8010; - background: url('fancybox_overlay.png'); -} - -.fancybox-overlay-fixed { - position: fixed; - bottom: 0; - right: 0; -} - -.fancybox-lock .fancybox-overlay { - overflow: auto; - overflow-y: scroll; -} - -/* Title helper */ - -.fancybox-title { - visibility: hidden; - font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; - position: relative; - text-shadow: none; - z-index: 8050; -} - -.fancybox-opened .fancybox-title { - visibility: visible; -} - -.fancybox-title-float-wrap { - position: absolute; - bottom: 0; - right: 50%; - margin-bottom: -35px; - z-index: 8050; - text-align: center; -} - -.fancybox-title-float-wrap .child { - display: inline-block; - margin-right: -100%; - padding: 2px 20px; - background: transparent; /* Fallback for web browsers that doesn't support RGBa */ - background: rgba(0, 0, 0, 0.8); - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - border-radius: 15px; - text-shadow: 0 1px 2px #222; - color: #FFF; - font-weight: bold; - line-height: 24px; - white-space: nowrap; -} - -.fancybox-title-outside-wrap { - position: relative; - margin-top: 10px; - color: #fff; -} - -.fancybox-title-inside-wrap { - padding-top: 10px; -} - -.fancybox-title-over-wrap { - position: absolute; - bottom: 0; - left: 0; - color: #fff; - padding: 10px; - background: #000; - background: rgba(0, 0, 0, .8); -} +/*! fancyBox v2.1.4 fancyapps.com | fancyapps.com/fancybox/#license */ +.fancybox-wrap, +.fancybox-skin, +.fancybox-outer, +.fancybox-inner, +.fancybox-image, +.fancybox-wrap iframe, +.fancybox-wrap object, +.fancybox-nav, +.fancybox-nav span, +.fancybox-tmp +{ + padding: 0; + margin: 0; + border: 0; + outline: none; + vertical-align: top; +} + +.fancybox-wrap { + position: absolute; + top: 0; + left: 0; + z-index: 8020; +} + +.fancybox-skin { + position: relative; + background: #fff; + color: #444; + text-shadow: none; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.fancybox-opened { + z-index: 8030; +} + +.fancybox-opened .fancybox-skin { + -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); + -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); + box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); +} + +.fancybox-outer, .fancybox-inner { + position: relative; +} + +.fancybox-inner { + overflow: hidden; +} + +.fancybox-type-iframe .fancybox-inner { + -webkit-overflow-scrolling: touch; +} + +.fancybox-error { + color: #444; + font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; + margin: 0; + padding: 15px; + white-space: nowrap; +} + +.fancybox-image, .fancybox-iframe { + display: block; + width: 100%; + height: 100%; +} + +.fancybox-image { + max-width: 100%; + max-height: 100%; +} + +#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { + background-image: url('fancybox_sprite.png'); +} + +#fancybox-loading { + position: fixed; + top: 50%; + left: 50%; + margin-top: -22px; + margin-left: -22px; + background-position: 0 -108px; + opacity: 0.8; + cursor: pointer; + z-index: 8060; +} + +#fancybox-loading div { + width: 44px; + height: 44px; + background: url('fancybox_loading.gif') center center no-repeat; +} + +.fancybox-close { + position: absolute; + top: -18px; + right: -18px; + width: 36px; + height: 36px; + cursor: pointer; + z-index: 8040; +} + +.fancybox-nav { + position: absolute; + top: 0; + width: 40%; + height: 100%; + cursor: pointer; + text-decoration: none; + background: transparent url('blank.gif'); /* helps IE */ + -webkit-tap-highlight-color: rgba(0,0,0,0); + z-index: 8040; +} + +.fancybox-prev { + left: 0; +} + +.fancybox-next { + right: 0; +} + +.fancybox-nav span { + position: absolute; + top: 50%; + width: 36px; + height: 34px; + margin-top: -18px; + cursor: pointer; + z-index: 8040; + visibility: hidden; +} + +.fancybox-prev span { + left: 10px; + background-position: 0 -36px; +} + +.fancybox-next span { + right: 10px; + background-position: 0 -72px; +} + +.fancybox-nav:hover span { + visibility: visible; +} + +.fancybox-tmp { + position: absolute; + top: -99999px; + left: -99999px; + visibility: hidden; + max-width: 99999px; + max-height: 99999px; + overflow: visible !important; +} + +/* Overlay helper */ + +.fancybox-lock { + overflow: hidden; +} + +.fancybox-overlay { + position: absolute; + top: 0; + left: 0; + overflow: hidden; + display: none; + z-index: 8010; + background: url('fancybox_overlay.png'); +} + +.fancybox-overlay-fixed { + position: fixed; + bottom: 0; + right: 0; +} + +.fancybox-lock .fancybox-overlay { + overflow: auto; + overflow-y: scroll; +} + +/* Title helper */ + +.fancybox-title { + visibility: hidden; + font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; + position: relative; + text-shadow: none; + z-index: 8050; +} + +.fancybox-opened .fancybox-title { + visibility: visible; +} + +.fancybox-title-float-wrap { + position: absolute; + bottom: 0; + right: 50%; + margin-bottom: -35px; + z-index: 8050; + text-align: center; +} + +.fancybox-title-float-wrap .child { + display: inline-block; + margin-right: -100%; + padding: 2px 20px; + background: transparent; /* Fallback for web browsers that doesn't support RGBa */ + background: rgba(0, 0, 0, 0.8); + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; + text-shadow: 0 1px 2px #222; + color: #FFF; + font-weight: bold; + line-height: 24px; + white-space: nowrap; +} + +.fancybox-title-outside-wrap { + position: relative; + margin-top: 10px; + color: #fff; +} + +.fancybox-title-inside-wrap { + padding-top: 10px; +} + +.fancybox-title-over-wrap { + position: absolute; + bottom: 0; + left: 0; + color: #fff; + padding: 10px; + background: #000; + background: rgba(0, 0, 0, .8); +} diff --git a/assets/modules/store/js/fancybox/jquery.fancybox.pack.js b/assets/modules/store/js/fancybox/jquery.fancybox.pack.js index 95ce8050af..f1d24f5197 100755 --- a/assets/modules/store/js/fancybox/jquery.fancybox.pack.js +++ b/assets/modules/store/js/fancybox/jquery.fancybox.pack.js @@ -1,45 +1,45 @@ -/*! fancyBox v2.1.4 fancyapps.com | fancyapps.com/fancybox/#license */ -(function(C,z,f,r){var q=f(C),n=f(z),b=f.fancybox=function(){b.open.apply(this,arguments)},H=navigator.userAgent.match(/msie/),w=null,s=z.createTouch!==r,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},p=function(a){return a&&"string"===f.type(a)},F=function(a){return p(a)&&0
    ',image:'',iframe:'",error:'

    The requested content cannot be loaded.
    Please try again later.

    ',closeBtn:'',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0, -openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1, -isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k, -c.metadata())):k=c);g=d.href||k.href||(p(c)?c:null);h=d.title!==r?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));p(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":p(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(p(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&& -k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==r&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current|| -b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer= -setTimeout(b.next,b.current.playSpeed))},c=function(){d();f("body").unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==r&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({}, -e.dim,k)))},update:function(a){var d=a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(w),w=null);b.isOpen&&!w&&(w=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),w=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"), -b.trigger("onUpdate")),b.update())},hideLoading:function(){n.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('
    ').click(b.cancel).appendTo("body");n.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked|| -!1,d={x:q.scrollLeft(),y:q.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&C.innerWidth?C.innerWidth:q.width(),d.h=s&&C.innerHeight?C.innerHeight:q.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");n.unbind(".fb");q.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(q.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&n.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k= -e.target||e.srcElement;if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d, -e){e&&(b.helpers[d]&&f.isFunction(b.helpers[d][a]))&&(e=f.extend(!0,{},b.helpers[d].defaults,e),b.helpers[d][a](e,c))});f.event.trigger(a+".fb")}},isImage:function(a){return p(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)},isSWF:function(a){return p(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&& -(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive= -!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=!0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,x(d.padding[a]))});b.trigger("onReady"); -if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width= -this.width;b.coming.height=this.height;b._afterLoad()};a.onerror=function(){this.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g, -(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a= -b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents(); -e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("
    ").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('
    ').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder", -!1)}));break;case "image":e=a.tpl.image.replace("{href}",g);break;case "swf":e='',h="",f.each(a.swf,function(a,b){e+='';h+=" "+a+'="'+b+'"'}),e+='"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow"); -a.inner.css("overflow","yes"===k?"scroll":"no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth, -v=h.maxHeight,s=h.scrolling,q=h.scrollOutside?h.scrollbarWidth:0,y=h.margin,p=l(y[1]+y[3]),r=l(y[0]+y[2]),z,A,t,D,B,G,C,E,w;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");y=l(k.outerWidth(!0)-k.width());z=l(k.outerHeight(!0)-k.height());A=p+y;t=r+z;D=F(c)?(a.w-A)*l(c)/100:c;B=F(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(w=h.content,h.autoHeight&&1===w.data("ready"))try{w[0].contentWindow.document.location&&(g.width(D).height(9999),G=w.contents().find("body"),q&&G.css("overflow-x", -"hidden"),B=G.height())}catch(H){}}else if(h.autoWidth||h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(D),h.autoHeight||g.height(B),h.autoWidth&&(D=g.width()),h.autoHeight&&(B=g.height()),g.removeClass("fancybox-tmp");c=l(D);j=l(B);E=D/B;m=l(F(m)?l(m,"w")-A:m);n=l(F(n)?l(n,"w")-A:n);u=l(F(u)?l(u,"h")-t:u);v=l(F(v)?l(v,"h")-t:v);G=n;C=v;h.fitToView&&(n=Math.min(a.w-A,n),v=Math.min(a.h-t,v));A=a.w-p;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/E)),j>v&&(j=v,c=l(j*E)),cA||p>r)&&(c>m&&j>u)&&!(19n&&(c=n,j=l(c/E)),g.width(c).height(j),e.width(c+y),a=e.width(),p=e.height();else c=Math.max(m,Math.min(c,c-(a-A))),j=Math.max(u,Math.min(j,j-(p-r)));q&&("auto"===s&&jA||p>r)&&c>m&&j>u;c=h.aspectRatio?cu&&j
    ').appendTo("body"); -this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(q.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){f(a.target).hasClass("fancybox-overlay")&&(b.isActive?b.close():d.close())});this.overlay.css(a.css).show()}, -close:function(){f(".fancybox-overlay").remove();q.unbind("resize.overlay");this.overlay=null;!1!==this.margin&&(f("body").css("margin-right",this.margin),this.margin=!1);this.el&&this.el.removeClass("fancybox-lock")},update:function(){var a="100%",b;this.overlay.width(a).height("100%");H?(b=Math.max(z.documentElement.offsetWidth,z.body.offsetWidth),n.width()>b&&(a=n.width())):n.width()>q.width()&&(a=n.width());this.overlay.width(a).height(n.height())},onReady:function(a,b){f(".fancybox-overlay").stop(!0, -!0);this.overlay||(this.margin=n.height()>q.height()||"scroll"===f("body").css("overflow-y")?f("body").css("margin-right"):!1,this.el=z.all&&!z.querySelector?f("html"):f("body"),this.create(a));a.locked&&this.fixed&&(b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){b.locked&&(this.el.addClass("fancybox-lock"),!1!==this.margin&&f("body").css("margin-right",l(this.margin)+b.scrollbarWidth));this.open(a)},onUpdate:function(){this.fixed|| -this.update()},afterClose:function(a){this.overlay&&!b.isActive&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(p(e)&&""!==f.trim(e)){d=f('
    '+e+"
    ");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"), -H&&d.width(d.width()),d.wrapInner(''),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+ -'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):n.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};n.ready(function(){f.scrollbarWidth===r&&(f.scrollbarWidth=function(){var a=f('
    ').appendTo("body"),b=a.children(), -b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===r){var a=f.support,d=f('
    ').appendTo("body"),e=20===d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")})})})(window,document,jQuery); +/*! fancyBox v2.1.4 fancyapps.com | fancyapps.com/fancybox/#license */ +(function(C,z,f,r){var q=f(C),n=f(z),b=f.fancybox=function(){b.open.apply(this,arguments)},H=navigator.userAgent.match(/msie/),w=null,s=z.createTouch!==r,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},p=function(a){return a&&"string"===f.type(a)},F=function(a){return p(a)&&0
    ',image:'',iframe:'",error:'

    The requested content cannot be loaded.
    Please try again later.

    ',closeBtn:'',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0, +openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1, +isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k, +c.metadata())):k=c);g=d.href||k.href||(p(c)?c:null);h=d.title!==r?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));p(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":p(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(p(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&& +k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==r&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current|| +b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer= +setTimeout(b.next,b.current.playSpeed))},c=function(){d();f("body").unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==r&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({}, +e.dim,k)))},update:function(a){var d=a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(w),w=null);b.isOpen&&!w&&(w=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),w=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"), +b.trigger("onUpdate")),b.update())},hideLoading:function(){n.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('
    ').click(b.cancel).appendTo("body");n.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked|| +!1,d={x:q.scrollLeft(),y:q.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&C.innerWidth?C.innerWidth:q.width(),d.h=s&&C.innerHeight?C.innerHeight:q.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");n.unbind(".fb");q.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(q.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&n.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k= +e.target||e.srcElement;if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d, +e){e&&(b.helpers[d]&&f.isFunction(b.helpers[d][a]))&&(e=f.extend(!0,{},b.helpers[d].defaults,e),b.helpers[d][a](e,c))});f.event.trigger(a+".fb")}},isImage:function(a){return p(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)},isSWF:function(a){return p(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&& +(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive= +!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=!0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,x(d.padding[a]))});b.trigger("onReady"); +if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width= +this.width;b.coming.height=this.height;b._afterLoad()};a.onerror=function(){this.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g, +(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a= +b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents(); +e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("
    ").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('
    ').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder", +!1)}));break;case "image":e=a.tpl.image.replace("{href}",g);break;case "swf":e='',h="",f.each(a.swf,function(a,b){e+='';h+=" "+a+'="'+b+'"'}),e+='"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow"); +a.inner.css("overflow","yes"===k?"scroll":"no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth, +v=h.maxHeight,s=h.scrolling,q=h.scrollOutside?h.scrollbarWidth:0,y=h.margin,p=l(y[1]+y[3]),r=l(y[0]+y[2]),z,A,t,D,B,G,C,E,w;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");y=l(k.outerWidth(!0)-k.width());z=l(k.outerHeight(!0)-k.height());A=p+y;t=r+z;D=F(c)?(a.w-A)*l(c)/100:c;B=F(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(w=h.content,h.autoHeight&&1===w.data("ready"))try{w[0].contentWindow.document.location&&(g.width(D).height(9999),G=w.contents().find("body"),q&&G.css("overflow-x", +"hidden"),B=G.height())}catch(H){}}else if(h.autoWidth||h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(D),h.autoHeight||g.height(B),h.autoWidth&&(D=g.width()),h.autoHeight&&(B=g.height()),g.removeClass("fancybox-tmp");c=l(D);j=l(B);E=D/B;m=l(F(m)?l(m,"w")-A:m);n=l(F(n)?l(n,"w")-A:n);u=l(F(u)?l(u,"h")-t:u);v=l(F(v)?l(v,"h")-t:v);G=n;C=v;h.fitToView&&(n=Math.min(a.w-A,n),v=Math.min(a.h-t,v));A=a.w-p;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/E)),j>v&&(j=v,c=l(j*E)),cA||p>r)&&(c>m&&j>u)&&!(19n&&(c=n,j=l(c/E)),g.width(c).height(j),e.width(c+y),a=e.width(),p=e.height();else c=Math.max(m,Math.min(c,c-(a-A))),j=Math.max(u,Math.min(j,j-(p-r)));q&&("auto"===s&&jA||p>r)&&c>m&&j>u;c=h.aspectRatio?cu&&j
    ').appendTo("body"); +this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(q.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){f(a.target).hasClass("fancybox-overlay")&&(b.isActive?b.close():d.close())});this.overlay.css(a.css).show()}, +close:function(){f(".fancybox-overlay").remove();q.unbind("resize.overlay");this.overlay=null;!1!==this.margin&&(f("body").css("margin-right",this.margin),this.margin=!1);this.el&&this.el.removeClass("fancybox-lock")},update:function(){var a="100%",b;this.overlay.width(a).height("100%");H?(b=Math.max(z.documentElement.offsetWidth,z.body.offsetWidth),n.width()>b&&(a=n.width())):n.width()>q.width()&&(a=n.width());this.overlay.width(a).height(n.height())},onReady:function(a,b){f(".fancybox-overlay").stop(!0, +!0);this.overlay||(this.margin=n.height()>q.height()||"scroll"===f("body").css("overflow-y")?f("body").css("margin-right"):!1,this.el=z.all&&!z.querySelector?f("html"):f("body"),this.create(a));a.locked&&this.fixed&&(b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){b.locked&&(this.el.addClass("fancybox-lock"),!1!==this.margin&&f("body").css("margin-right",l(this.margin)+b.scrollbarWidth));this.open(a)},onUpdate:function(){this.fixed|| +this.update()},afterClose:function(a){this.overlay&&!b.isActive&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(p(e)&&""!==f.trim(e)){d=f('
    '+e+"
    ");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"), +H&&d.width(d.width()),d.wrapInner(''),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+ +'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):n.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};n.ready(function(){f.scrollbarWidth===r&&(f.scrollbarWidth=function(){var a=f('
    ').appendTo("body"),b=a.children(), +b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===r){var a=f.support,d=f('
    ').appendTo("body"),e=20===d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")})})})(window,document,jQuery); diff --git a/assets/modules/store/js/fancybox/jquery.mousewheel-3.0.6.pack.js b/assets/modules/store/js/fancybox/jquery.mousewheel-3.0.6.pack.js index 8adf44dc8b..e39a83adae 100755 --- a/assets/modules/store/js/fancybox/jquery.mousewheel-3.0.6.pack.js +++ b/assets/modules/store/js/fancybox/jquery.mousewheel-3.0.6.pack.js @@ -1,13 +1,13 @@ -/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) - * Licensed under the MIT License (LICENSE.txt). - * - * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. - * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. - * Thanks to: Seamus Leahy for adding deltaX and deltaY - * - * Version: 3.0.6 - * - * Requires: 1.2.2+ - */ -(function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;b.axis!==void 0&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);b.wheelDeltaY!==void 0&&(g=b.wheelDeltaY/120);b.wheelDeltaX!==void 0&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]= +/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) + * Licensed under the MIT License (LICENSE.txt). + * + * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. + * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. + * Thanks to: Seamus Leahy for adding deltaX and deltaY + * + * Version: 3.0.6 + * + * Requires: 1.2.2+ + */ +(function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;b.axis!==void 0&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);b.wheelDeltaY!==void 0&&(g=b.wheelDeltaY/120);b.wheelDeltaX!==void 0&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]= d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,false);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); \ No newline at end of file diff --git a/assets/modules/store/js/jquery.min.js b/assets/modules/store/js/jquery.min.js index 83589daa70..3883779527 100755 --- a/assets/modules/store/js/jquery.min.js +++ b/assets/modules/store/js/jquery.min.js @@ -1,2 +1,2 @@ -/*! jQuery v1.8.3 jquery.com | jquery.org/license */ +/*! jQuery v1.8.3 jquery.com | jquery.org/license */ (function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
    ","
    "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
    ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); \ No newline at end of file diff --git a/assets/plugins/codemirror/cm/theme/one-dark.css b/assets/plugins/codemirror/cm/theme/one-dark.css index d7aa0a3d56..307689322e 100755 --- a/assets/plugins/codemirror/cm/theme/one-dark.css +++ b/assets/plugins/codemirror/cm/theme/one-dark.css @@ -1,161 +1,161 @@ -/* - Name: one-dark - Author: Török Ádám (http://github.com/Aerobird98) - - Original Atom One Dark Theme (https://github.com/atom/one-dark-syntax & https://github.com/atom/one-dark-ui) -*/ - -/* UI Theme /----------------------------------------------------------------------------------- */ -.cm-s-one-dark.CodeMirror { -border-color: transparent; -font-size: 1em; -} -.cm-s-one-dark.CodeMirror pre { -line-height: 1.3; -} -.cm-s-one-dark.CodeMirror .CodeMirror-activeline-background { -background: #23272f !important; -} -.cm-s-one-dark.CodeMirror .cm-tab::before { -content: ""; -position: absolute; -border-left: 1px solid #353b46; -height: 100%; -} -.cm-s-one-dark.CodeMirror .cm-tab:first-child::before { -display: none; -} -.cm-s-one-dark.CodeMirror, .cm-s-one-dark .CodeMirror-scroll { -font-family: 'Inconsolata', 'Monaco', 'Consolas', 'Courier New', 'Courier', monospace; -font-weight: 300; -font-size: 1em; -background-color: #282c34; -color: #abb2bf; -} -.cm-s-one-dark div.CodeMirror-selected { -background: #343c4a; -} -.cm-s-one-dark .CodeMirror-focused div.CodeMirror-selected { -background: #485263; -} -.cm-s-one-dark .CodeMirror-lines { -padding: 4px 0; /* Vertical padding around content */ -} -.cm-s-one-dark .CodeMirror pre { -padding: 0 4px; /* Horizontal padding of content */ -} -/* Gutter & Folding */ -.cm-s-one-dark .CodeMirror-gutters { -border-color: #3c4048; -} -.cm-s-one-dark .CodeMirror .CodeMirror-gutters, .cm-s-one-dark .CodeMirror-gutter { -white-space: nowrap; -border: none; -background: #282c34; -} -.cm-s-one-dark .CodeMirror-linenumber { -padding: 0 10px; -min-width: 20px; -text-align: right; -font-size: 0.8em; -white-space: nowrap; -color: #5f6b82; -} -/* ...folding addon: fold/... */ -.cm-s-one-dark .CodeMirror-foldmarker { -line-height: .3; -cursor: pointer; -color: #abb2bf; -background: #343c4a; -} -.cm-s-one-dark .CodeMirror-foldgutter { -width: 15px; -border: none; -} -.cm-s-one-dark .CodeMirror-foldgutter-open, .cm-s-one-dark .CodeMirror-foldgutter-folded { -cursor: pointer; -} -.cm-s-one-dark .CodeMirror-foldgutter-open:after { -content: "\25BE"; -color: #393e46; -} -.cm-s-one-dark .CodeMirror.over-gutter, .cm-s-one-dark .CodeMirror-activeline .CodeMirror-foldgutter-open:after { -color: #5c6370; -} -.cm-s-one-dark .CodeMirror-foldgutter-folded:after { -content: "\25B8"; -color: #5c6370; -} -/* ...misc */ -.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { -background-color: #ccc; /* The little square between H and V scrollbars */ -} -/* Cursor */ - -.cm-s-one-dark .CodeMirror-cursor { -border-left: 2px solid hsl(220, 100%, 66%) !important; -} -.cm-s-one-dark .CodeMirror-overwrite .CodeMirror-cursor { -border-left: none !important; -border-bottom: 1px solid #fff; -} -/* Popular addons */ - -/* addon: adit/machingbrackets.js & addon: edit/matchtags.js */ -.cm-s-one-dark .CodeMirror-matchingbracket, .cm-s-one-dark .CodeMirror-matchingtag { -/* Ensure visibility against gray inline editor background */ -background-color: rgba(204, 217, 255, 0.09); -color: #abb2bf !important; -border-bottom: 1px solid #528bff; -} -/* Syntax Theme /---------------------------------------------------------------------------------- */ - -/* markdown */ -.cm-s-one-dark .cm-header { color: #e06c75; } -.cm-s-one-dark .cm-quote { color: #5c6370; font-style: italic; } -.cm-s-one-dark .cm-negative { color: #e06c75; } -.cm-s-one-dark .cm-positive { color: #e06c75; } -.cm-s-one-dark .cm-strong { color: #d19a66; font-weight: bold; } -.cm-s-one-dark .cm-header .cm-strong { color: #d19a66; font-weight: bold; } -.cm-s-one-dark .cm-em { color: #c678dd; font-style: italic; } -.cm-s-one-dark .cm-header .cm-em { color: #c678dd; font-style: italic; } -/* xml, html, ... */ -.cm-s-one-dark .cm-tag { color: #e06c75; } -.cm-s-one-dark .cm-attribute { color: #d19a66; } -.cm-s-one-dark .cm-link { color: #98c379; border-bottom: solid 1px #98c379; } -/* other ... (for example javascript) */ -.cm-s-one-dark .cm-builtin { color: #e06c75; } -.cm-s-one-dark .cm-keyword { color: #c678dd; } -.cm-s-one-dark .cm-def { color: #e5c07b; } -/* original: #d19a66; */ - -.cm-s-one-dark .cm-atom { color: #d19a66; } -.cm-s-one-dark .cm-number { color: #d19a66; } -.cm-s-one-dark .cm-property { color: #61afef; } -/* original: #abb2bf */ -.cm-s-one-dark .cm-qualifier { color: #d19a66; } -.cm-s-one-dark .cm-variable { color: #e06c75; } -.cm-s-one-dark .cm-variable-2 { color: #abb2bf; } -.cm-s-one-dark .cm-variable-3 { color: #e5c07b; } -.cm-s-one-dark .cm-string { color: #98c379; } -.cm-s-one-dark .cm-string-2 { color: #98c379; } -.cm-s-one-dark .cm-punctuation { color: #abb2bf; } -.cm-s-one-dark .cm-operator { color: #abb2bf; } -.cm-s-one-dark .cm-meta { color: #abb2bf; } -.cm-s-one-dark .cm-bracket { color: #abb2bf; } -.cm-s-one-dark .cm-comment { color: #5c6370; font-style: italic; } -.cm-s-one-dark .cm-modxChunk, .cm-s-one-dark .cm-modxSnippet, .cm-s-one-dark .cm-modxTv, .cm-s-one-dark .cm-modxPlaceholder, .cm-s-one-dark .cm-modxSnippetNoCache, .cm-s-one-dark .cm-modxVariable, .cm-s-one-dark .cm-modxUrl, .cm-s-one-dark .cm-modxConfig { -color: #00d4c0; -font-weight: 100; -} -.cm-s-one-dark .cm-modxAttribute { -color: #009688; -} -.cm-s-one-dark .cm-modxAttributeValue { -font-weight: 100; -color: #ababab; -} -.cm-s-one-dark .cm-modxBinding { -color: #a859b5; -font-weight: 100; -} +/* + Name: one-dark + Author: Török Ádám (http://github.com/Aerobird98) + + Original Atom One Dark Theme (https://github.com/atom/one-dark-syntax & https://github.com/atom/one-dark-ui) +*/ + +/* UI Theme /----------------------------------------------------------------------------------- */ +.cm-s-one-dark.CodeMirror { +border-color: transparent; +font-size: 1em; +} +.cm-s-one-dark.CodeMirror pre { +line-height: 1.3; +} +.cm-s-one-dark.CodeMirror .CodeMirror-activeline-background { +background: #23272f !important; +} +.cm-s-one-dark.CodeMirror .cm-tab::before { +content: ""; +position: absolute; +border-left: 1px solid #353b46; +height: 100%; +} +.cm-s-one-dark.CodeMirror .cm-tab:first-child::before { +display: none; +} +.cm-s-one-dark.CodeMirror, .cm-s-one-dark .CodeMirror-scroll { +font-family: 'Inconsolata', 'Monaco', 'Consolas', 'Courier New', 'Courier', monospace; +font-weight: 300; +font-size: 1em; +background-color: #282c34; +color: #abb2bf; +} +.cm-s-one-dark div.CodeMirror-selected { +background: #343c4a; +} +.cm-s-one-dark .CodeMirror-focused div.CodeMirror-selected { +background: #485263; +} +.cm-s-one-dark .CodeMirror-lines { +padding: 4px 0; /* Vertical padding around content */ +} +.cm-s-one-dark .CodeMirror pre { +padding: 0 4px; /* Horizontal padding of content */ +} +/* Gutter & Folding */ +.cm-s-one-dark .CodeMirror-gutters { +border-color: #3c4048; +} +.cm-s-one-dark .CodeMirror .CodeMirror-gutters, .cm-s-one-dark .CodeMirror-gutter { +white-space: nowrap; +border: none; +background: #282c34; +} +.cm-s-one-dark .CodeMirror-linenumber { +padding: 0 10px; +min-width: 20px; +text-align: right; +font-size: 0.8em; +white-space: nowrap; +color: #5f6b82; +} +/* ...folding addon: fold/... */ +.cm-s-one-dark .CodeMirror-foldmarker { +line-height: .3; +cursor: pointer; +color: #abb2bf; +background: #343c4a; +} +.cm-s-one-dark .CodeMirror-foldgutter { +width: 15px; +border: none; +} +.cm-s-one-dark .CodeMirror-foldgutter-open, .cm-s-one-dark .CodeMirror-foldgutter-folded { +cursor: pointer; +} +.cm-s-one-dark .CodeMirror-foldgutter-open:after { +content: "\25BE"; +color: #393e46; +} +.cm-s-one-dark .CodeMirror.over-gutter, .cm-s-one-dark .CodeMirror-activeline .CodeMirror-foldgutter-open:after { +color: #5c6370; +} +.cm-s-one-dark .CodeMirror-foldgutter-folded:after { +content: "\25B8"; +color: #5c6370; +} +/* ...misc */ +.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { +background-color: #ccc; /* The little square between H and V scrollbars */ +} +/* Cursor */ + +.cm-s-one-dark .CodeMirror-cursor { +border-left: 2px solid hsl(220, 100%, 66%) !important; +} +.cm-s-one-dark .CodeMirror-overwrite .CodeMirror-cursor { +border-left: none !important; +border-bottom: 1px solid #fff; +} +/* Popular addons */ + +/* addon: adit/machingbrackets.js & addon: edit/matchtags.js */ +.cm-s-one-dark .CodeMirror-matchingbracket, .cm-s-one-dark .CodeMirror-matchingtag { +/* Ensure visibility against gray inline editor background */ +background-color: rgba(204, 217, 255, 0.09); +color: #abb2bf !important; +border-bottom: 1px solid #528bff; +} +/* Syntax Theme /---------------------------------------------------------------------------------- */ + +/* markdown */ +.cm-s-one-dark .cm-header { color: #e06c75; } +.cm-s-one-dark .cm-quote { color: #5c6370; font-style: italic; } +.cm-s-one-dark .cm-negative { color: #e06c75; } +.cm-s-one-dark .cm-positive { color: #e06c75; } +.cm-s-one-dark .cm-strong { color: #d19a66; font-weight: bold; } +.cm-s-one-dark .cm-header .cm-strong { color: #d19a66; font-weight: bold; } +.cm-s-one-dark .cm-em { color: #c678dd; font-style: italic; } +.cm-s-one-dark .cm-header .cm-em { color: #c678dd; font-style: italic; } +/* xml, html, ... */ +.cm-s-one-dark .cm-tag { color: #e06c75; } +.cm-s-one-dark .cm-attribute { color: #d19a66; } +.cm-s-one-dark .cm-link { color: #98c379; border-bottom: solid 1px #98c379; } +/* other ... (for example javascript) */ +.cm-s-one-dark .cm-builtin { color: #e06c75; } +.cm-s-one-dark .cm-keyword { color: #c678dd; } +.cm-s-one-dark .cm-def { color: #e5c07b; } +/* original: #d19a66; */ + +.cm-s-one-dark .cm-atom { color: #d19a66; } +.cm-s-one-dark .cm-number { color: #d19a66; } +.cm-s-one-dark .cm-property { color: #61afef; } +/* original: #abb2bf */ +.cm-s-one-dark .cm-qualifier { color: #d19a66; } +.cm-s-one-dark .cm-variable { color: #e06c75; } +.cm-s-one-dark .cm-variable-2 { color: #abb2bf; } +.cm-s-one-dark .cm-variable-3 { color: #e5c07b; } +.cm-s-one-dark .cm-string { color: #98c379; } +.cm-s-one-dark .cm-string-2 { color: #98c379; } +.cm-s-one-dark .cm-punctuation { color: #abb2bf; } +.cm-s-one-dark .cm-operator { color: #abb2bf; } +.cm-s-one-dark .cm-meta { color: #abb2bf; } +.cm-s-one-dark .cm-bracket { color: #abb2bf; } +.cm-s-one-dark .cm-comment { color: #5c6370; font-style: italic; } +.cm-s-one-dark .cm-modxChunk, .cm-s-one-dark .cm-modxSnippet, .cm-s-one-dark .cm-modxTv, .cm-s-one-dark .cm-modxPlaceholder, .cm-s-one-dark .cm-modxSnippetNoCache, .cm-s-one-dark .cm-modxVariable, .cm-s-one-dark .cm-modxUrl, .cm-s-one-dark .cm-modxConfig { +color: #00d4c0; +font-weight: 100; +} +.cm-s-one-dark .cm-modxAttribute { +color: #009688; +} +.cm-s-one-dark .cm-modxAttributeValue { +font-weight: 100; +color: #ababab; +} +.cm-s-one-dark .cm-modxBinding { +color: #a859b5; +font-weight: 100; +} diff --git a/assets/plugins/extrascheck/CheckOutdated.class.php b/assets/plugins/extrascheck/CheckOutdated.class.php index 521c6cab6a..038f54931a 100644 --- a/assets/plugins/extrascheck/CheckOutdated.class.php +++ b/assets/plugins/extrascheck/CheckOutdated.class.php @@ -1,468 +1,468 @@ -modx = $modx; - $this->pluginName = $pluginName; - $this->pluginId = $this->findPluginId(); - $this->extrasId = $this->findExtrasId(); - - $this->tpl = DLTemplate::getInstance($this->modx); - - $this->setLang($lang); - } - - /** - * @param string $source - * @return array - */ - public function load($source) - { - if (0 === strpos($source, 'http')) { - $data = Cache::remember('users', 24 * 60, function () use($source) { - return json_decode(file_get_contents($source), true); - }); - } else { - $data = file_get_contents($source); - $data = json_decode($data, true); - } - - return \is_array($data) ? $data : []; - } - - /** - * @param string $name - * @param array $options - * @return string - */ - public function snippet($name, $options) - { - $out = ''; - //search the snippet by name - - $snippet = \EvolutionCMS\Models\SiteSnippet::select('id', 'name', 'description') - ->where('name', $name)->where('disabled', 0)->first(); - - if (!is_null($snippet)) { - $tpl = isset($options['template']) ? $options['template'] : - '@CODE:
    ' . - ' ' . - '[+snippet+] [+name+] (version [+currentVersion+]) ' . - ' [+isSecurity:empty:then=`[+isoutdated+] Evolution [+evo_cms_version+]`:else=`[+security_reason+].`+]' . - '
    [+please_update+] [+name+] [+to_latest+]' . - ' ([+min_required+] [+minVersion+]) [+from+]' . - ' [+extras_module+] ' . - ' [+replaced:isnotempty=`[+or_move_to+]: [+replaced+]`+]' . - '
    '; - - $minVersion = isset($options['version']) ? $options['version'] : 0; - $replaced = isset($options['replaced']) ? implode(', ', $options['replaced']) : ''; - $isSecurity = !empty($options['security']); - - //extract snippet version from description tags - $currentVersion = $this->getver($snippet->description, 'strong'); - //check snippet version and return an alert if outdated - if (version_compare($currentVersion, $minVersion, 'lt')) { - $out .= $this->parseTemplate( - $tpl, - [ - 'name' => $snippet->name, - 'replaced' => $replaced, - 'isSecurity' => $isSecurity, - 'minVersion' => $minVersion, - 'currentVersion' => $currentVersion, - 'extrasID' => $this->getExtrasId(), - 'extrasURL' => $this->getExtrasUrl($snippet->name) - ] - ); - } - - } - - return $out; - } - - /** - * @param string $name - * @param array $options - * @return string - */ - public function plugin($name, $options) - { - $out = ''; - //search the plugin by name - - $plugin = \EvolutionCMS\Models\SitePlugin::select('id', 'name', 'description') - ->where('name', $name)->where('disabled', 0)->first(); - if (!is_null($plugin)) { - $tpl = isset($options['template']) ? $options['template'] : - '@CODE:
    ' . - ' ' . - '[+plugin+] [+name+] (version [+currentVersion+]) ' . - ' [+isSecurity:empty:then=`[+isoutdated+] Evolution [+evo_cms_version+]`:else=`[+security_reason+].`+]' . - '
    [+please_update+] [+name+] [+to_latest+]' . - ' ([+min_required+] [+minVersion+]) [+from+]' . - ' [+extras_module+] ' . - ' [+replaced:isnotempty=`[+or_move_to+]: [+replaced+]`+]' . - '
    '; - - $minVersion = isset($options['version']) ? $options['version'] : 0; - $replaced = isset($options['replaced']) ? implode(', ', $options['replaced']) : ''; - $isSecurity = !empty($options['security']); - - - //extract snippet version from description tags - $currentVersion = $this->getver($plugin->description, 'strong'); - //check snippet version and return an alert if outdated - if (version_compare($currentVersion, $minVersion, 'lt')) { - $out .= $this->parseTemplate( - $tpl, - [ - 'name' => $plugin->name, - 'replaced' => $replaced, - 'isSecurity' => $isSecurity, - 'minVersion' => $minVersion, - 'currentVersion' => $currentVersion, - 'extrasID' => $this->getExtrasId(), - 'extrasURL' => $this->getExtrasUrl($plugin->name) - ] - ); - } - } - - return $out; - } - - /** - * @param string $name - * @param array $options - * @return string - */ - public function module($name, $options) - { - $out = ''; - //search the module by name - $module = \EvolutionCMS\Models\SiteModule::select('id', 'name', 'description') - ->where('name', $name)->where('disabled', 0)->first(); - if (!is_null($module)) { - $tpl = isset($options['template']) ? $options['template'] : - '@CODE:
    ' . - ' ' . - '[+lock_element_type_6+] [+name+] (version [+currentVersion+]) ' . - ' [+isSecurity:empty:then=`[+isoutdated+] Evolution [+evo_cms_version+]`:else=`[+security_reason+].`+]' . - '
    [+please_update+] [+name+] [+to_latest+]' . - ' ([+min_required+] [+minVersion+]) [+from+]' . - ' [+extras_module+] ' . - ' [+replaced:isnotempty=`[+or_move_to+]: [+replaced+]`+]' . - '
    '; - - $minVersion = isset($options['version']) ? $options['version'] : 0; - $replaced = isset($options['replaced']) ? implode(', ', $options['replaced']) : ''; - $isSecurity = !empty($options['security']); - - while ($row = $this->modx->db->getRow($query)) { - //extract snippet version from description tags - $currentVersion = $this->getver($module->description, 'strong'); - //check snippet version and return an alert if outdated - if (version_compare($currentVersion, $minVersion, 'lt')) { - $out .= $this->parseTemplate( - $tpl, - [ - 'name' => $module->name, - 'replaced' => $replaced, - 'isSecurity' => $isSecurity, - 'minVersion' => $minVersion, - 'currentVersion' => $currentVersion, - 'extrasID' => $this->getExtrasId(), - 'extrasURL' => $this->getExtrasUrl($module->name) - ] - ); - } - } - } - - return $out; - } - - /** - * @param string $path - * @param array $options - * @return string - */ - public function file($path, $options = []) - { - $out = ''; - if (file_exists(EVO_BASE_PATH . $path)) { - $isSecurity = !empty($options['security']); - - $tpl = isset($options['template']) ? $options['template'] : - '@CODE:
    ' . - ' ' . - '[+path+] ' . - ' [+isSecurity:empty:then=`[+isoutdated+] Evolution [+evo_cms_version+]`:else=`[+security_reason+].`+]' . - '
    [+please_delete+]. [+if_dont_use+]' . - '
    '; - - $out = $this->parseTemplate($tpl, compact('path', 'isSecurity')); - } - - return $out; - } - - /** - * @param string $theme - * @param array $options - * @return string - */ - public function theme($theme, $options = []) - { - $out = ''; - if (file_exists(EVO_MANAGER_PATH . 'media/style/' . $theme)) { - $isSecurity = !empty($options['security']); - - $tpl = isset($options['template']) ? $options['template'] : - '@CODE:
    ' . - ' ' . - '[+manager_theme+] [+theme+] ' . - '[+isSecurity:empty:then=`[+isoutdated+] Evolution [+evo_cms_version+]`:else=`- [+security_reason+].`+]' . - '
    [+please_delete+] [+from_folder+] [+path+]. [+if_dont_use+]' . - '
    '; - - $out = $this->parseTemplate( - $tpl, - [ - 'theme' => $theme, - 'isSecurity' => $isSecurity, - 'path' => EVO_MANAGER_PATH . 'media/style/' - ] - ); - } - - return $out; - } - - /** - * @param string $key - * @param array $options - * @return string - */ - public function rss($key, $options) - { - $out = ''; - if (isset($options['old']) && $this->modx->getConfig($key) === $options['old']) { - $tpl = isset($options['template']) ? $options['template'] : - '@CODE:
    ' . - ' ' . - '[+settings_config+] > [+' . $key . '_title+] ' . - '([+oldUrl+]) [+outdated+]. ' . - '[+please_download_and_install+] UpdateEvosRss [+from+]' . - ' [+extras_module+]' . - '
    '; - - $out = $this->parseTemplate( - $tpl, - [ - 'extrasID' => $this->getExtrasId(), - 'oldUrl' => $options['old'] - ] - ); - } - - return $out; - } - - /** - * @return int - */ - public function getExtrasId() - { - return $this->extrasId; - } - - /** - * @param null $package - * @return string - */ - public function getExtrasUrl($package = null) - { - if ($this->getExtrasId() === 0) { - $url = 'https://extras.evo.im/find/' . $package; - } else { - $url = 'index.php?a=112&id=' . $this->getExtrasId(); - } - - return $url; - } - - /** - * @return int - */ - public function findExtrasId() - { - $moduleId = \EvolutionCMS\Models\SiteModule::select('id')->where('name', 'Extras')->where('disabled', 0)->first(); - if (!is_null($moduleId)) { - return (int)$moduleId->id; - } - return 0; - } - - /** - * @return int - */ - public function getPluginId() - { - return $this->pluginId; - } - - /** - * @return int - */ - public function findPluginId() - { - $pluginId = \EvolutionCMS\Models\SitePlugin::select('id')->where('name', $this->pluginName)->where('disabled', 0)->first(); - if (!is_null($pluginId)) { - return (int)$pluginId->id; - } - return 0; - } - - /** - * @param string $title - * @return string - */ - public function makeConfigButton($title) - { - $button = ''; - if ($this->modx->hasPermission('edit_plugin')) { - $popup = [ - 'url' => EVO_MANAGER_URL . '?a=102&id=' . $this->getPluginId() . '&tab=1', - 'title1' => $title, - 'icon' => 'fa-cog', - 'iframe' => 'iframe', - 'selector2' => '#tabConfig', - 'position' => 'center', - 'width' => '80%', - 'height' => '80%', - 'hide' => 0, - 'hover' => 0, - 'overlay' => 1, - 'overlayclose' => 1 - ]; - - $button = '' . - ' ' . - ''; - } - - return $button; - } - - /** - * @param array $lexicon - */ - public function setLang($lexicon = []) - { - $lang = $this->modx->getConfig('manager_language'); - if (file_exists( __DIR__ . '/lang/'.$lang.'/core.inc.php')){ - include_once(__DIR__ . '/lang/'.$lang.'/core.inc.php'); - } else { - include_once(__DIR__ . '/lang/english/core.inc.php'); - } - $this->lang = $_lang; - /* - $this->lang = new Helpers\Lexicon($this->modx, array( - 'lang' => $lang, - 'langDir' => 'assets/plugins/extrascheck/lang/' - )); - - if (!empty($lang)) { - $this->lang->fromArray(array($lang => $lexicon)); - } - $this->lang->loadLang();*/ - } - - /** - * @param string $type - * @param string $item - * @param array $options - * @return mixed - */ - public function process($type, $item, $options) - { - $available = ['rss', 'file', 'theme', 'snippet', 'plugin', 'module']; - - if (\in_array($type, $available) && method_exists($this, $type)) { - $out = $this->{$type}($item, $options); - } - return $out; - } - - /** - * @param string $tpl - * @param array $data - * @return string - */ - public function parseTemplate($tpl, $data = []) - { - return $this->tpl->parseChunk( - ($tpl), - array_merge( - ['evo_cms_version' => $this->modx->getVersionData('version')], - $data, - $this->lang - ), - true, - false - ); - } - - /** - * function to extract snippet version from description tags - * @param $string - * @param $tag - * @return mixed - */ - protected function getver($string, $tag) - { - $content = "/<$tag>(.*?)<\/$tag>/"; - preg_match($content, $string, $text); - if(isset($text[1])) - return $text[1]; - else return false; - } -} +modx = $modx; + $this->pluginName = $pluginName; + $this->pluginId = $this->findPluginId(); + $this->extrasId = $this->findExtrasId(); + + $this->tpl = DLTemplate::getInstance($this->modx); + + $this->setLang($lang); + } + + /** + * @param string $source + * @return array + */ + public function load($source) + { + if (0 === strpos($source, 'http')) { + $data = Cache::remember('users', 24 * 60, function () use($source) { + return json_decode(file_get_contents($source), true); + }); + } else { + $data = file_get_contents($source); + $data = json_decode($data, true); + } + + return \is_array($data) ? $data : []; + } + + /** + * @param string $name + * @param array $options + * @return string + */ + public function snippet($name, $options) + { + $out = ''; + //search the snippet by name + + $snippet = \EvolutionCMS\Models\SiteSnippet::select('id', 'name', 'description') + ->where('name', $name)->where('disabled', 0)->first(); + + if (!is_null($snippet)) { + $tpl = isset($options['template']) ? $options['template'] : + '@CODE:
    ' . + ' ' . + '[+snippet+] [+name+] (version [+currentVersion+]) ' . + ' [+isSecurity:empty:then=`[+isoutdated+] Evolution [+evo_cms_version+]`:else=`[+security_reason+].`+]' . + '
    [+please_update+] [+name+] [+to_latest+]' . + ' ([+min_required+] [+minVersion+]) [+from+]' . + ' [+extras_module+] ' . + ' [+replaced:isnotempty=`[+or_move_to+]: [+replaced+]`+]' . + '
    '; + + $minVersion = isset($options['version']) ? $options['version'] : 0; + $replaced = isset($options['replaced']) ? implode(', ', $options['replaced']) : ''; + $isSecurity = !empty($options['security']); + + //extract snippet version from description tags + $currentVersion = $this->getver($snippet->description, 'strong'); + //check snippet version and return an alert if outdated + if (version_compare($currentVersion, $minVersion, 'lt')) { + $out .= $this->parseTemplate( + $tpl, + [ + 'name' => $snippet->name, + 'replaced' => $replaced, + 'isSecurity' => $isSecurity, + 'minVersion' => $minVersion, + 'currentVersion' => $currentVersion, + 'extrasID' => $this->getExtrasId(), + 'extrasURL' => $this->getExtrasUrl($snippet->name) + ] + ); + } + + } + + return $out; + } + + /** + * @param string $name + * @param array $options + * @return string + */ + public function plugin($name, $options) + { + $out = ''; + //search the plugin by name + + $plugin = \EvolutionCMS\Models\SitePlugin::select('id', 'name', 'description') + ->where('name', $name)->where('disabled', 0)->first(); + if (!is_null($plugin)) { + $tpl = isset($options['template']) ? $options['template'] : + '@CODE:
    ' . + ' ' . + '[+plugin+] [+name+] (version [+currentVersion+]) ' . + ' [+isSecurity:empty:then=`[+isoutdated+] Evolution [+evo_cms_version+]`:else=`[+security_reason+].`+]' . + '
    [+please_update+] [+name+] [+to_latest+]' . + ' ([+min_required+] [+minVersion+]) [+from+]' . + ' [+extras_module+] ' . + ' [+replaced:isnotempty=`[+or_move_to+]: [+replaced+]`+]' . + '
    '; + + $minVersion = isset($options['version']) ? $options['version'] : 0; + $replaced = isset($options['replaced']) ? implode(', ', $options['replaced']) : ''; + $isSecurity = !empty($options['security']); + + + //extract snippet version from description tags + $currentVersion = $this->getver($plugin->description, 'strong'); + //check snippet version and return an alert if outdated + if (version_compare($currentVersion, $minVersion, 'lt')) { + $out .= $this->parseTemplate( + $tpl, + [ + 'name' => $plugin->name, + 'replaced' => $replaced, + 'isSecurity' => $isSecurity, + 'minVersion' => $minVersion, + 'currentVersion' => $currentVersion, + 'extrasID' => $this->getExtrasId(), + 'extrasURL' => $this->getExtrasUrl($plugin->name) + ] + ); + } + } + + return $out; + } + + /** + * @param string $name + * @param array $options + * @return string + */ + public function module($name, $options) + { + $out = ''; + //search the module by name + $module = \EvolutionCMS\Models\SiteModule::select('id', 'name', 'description') + ->where('name', $name)->where('disabled', 0)->first(); + if (!is_null($module)) { + $tpl = isset($options['template']) ? $options['template'] : + '@CODE:
    ' . + ' ' . + '[+lock_element_type_6+] [+name+] (version [+currentVersion+]) ' . + ' [+isSecurity:empty:then=`[+isoutdated+] Evolution [+evo_cms_version+]`:else=`[+security_reason+].`+]' . + '
    [+please_update+] [+name+] [+to_latest+]' . + ' ([+min_required+] [+minVersion+]) [+from+]' . + ' [+extras_module+] ' . + ' [+replaced:isnotempty=`[+or_move_to+]: [+replaced+]`+]' . + '
    '; + + $minVersion = isset($options['version']) ? $options['version'] : 0; + $replaced = isset($options['replaced']) ? implode(', ', $options['replaced']) : ''; + $isSecurity = !empty($options['security']); + + while ($row = $this->modx->db->getRow($query)) { + //extract snippet version from description tags + $currentVersion = $this->getver($module->description, 'strong'); + //check snippet version and return an alert if outdated + if (version_compare($currentVersion, $minVersion, 'lt')) { + $out .= $this->parseTemplate( + $tpl, + [ + 'name' => $module->name, + 'replaced' => $replaced, + 'isSecurity' => $isSecurity, + 'minVersion' => $minVersion, + 'currentVersion' => $currentVersion, + 'extrasID' => $this->getExtrasId(), + 'extrasURL' => $this->getExtrasUrl($module->name) + ] + ); + } + } + } + + return $out; + } + + /** + * @param string $path + * @param array $options + * @return string + */ + public function file($path, $options = []) + { + $out = ''; + if (file_exists(EVO_BASE_PATH . $path)) { + $isSecurity = !empty($options['security']); + + $tpl = isset($options['template']) ? $options['template'] : + '@CODE:
    ' . + ' ' . + '[+path+] ' . + ' [+isSecurity:empty:then=`[+isoutdated+] Evolution [+evo_cms_version+]`:else=`[+security_reason+].`+]' . + '
    [+please_delete+]. [+if_dont_use+]' . + '
    '; + + $out = $this->parseTemplate($tpl, compact('path', 'isSecurity')); + } + + return $out; + } + + /** + * @param string $theme + * @param array $options + * @return string + */ + public function theme($theme, $options = []) + { + $out = ''; + if (file_exists(EVO_MANAGER_PATH . 'media/style/' . $theme)) { + $isSecurity = !empty($options['security']); + + $tpl = isset($options['template']) ? $options['template'] : + '@CODE:
    ' . + ' ' . + '[+manager_theme+] [+theme+] ' . + '[+isSecurity:empty:then=`[+isoutdated+] Evolution [+evo_cms_version+]`:else=`- [+security_reason+].`+]' . + '
    [+please_delete+] [+from_folder+] [+path+]. [+if_dont_use+]' . + '
    '; + + $out = $this->parseTemplate( + $tpl, + [ + 'theme' => $theme, + 'isSecurity' => $isSecurity, + 'path' => EVO_MANAGER_PATH . 'media/style/' + ] + ); + } + + return $out; + } + + /** + * @param string $key + * @param array $options + * @return string + */ + public function rss($key, $options) + { + $out = ''; + if (isset($options['old']) && $this->modx->getConfig($key) === $options['old']) { + $tpl = isset($options['template']) ? $options['template'] : + '@CODE:
    ' . + ' ' . + '[+settings_config+] > [+' . $key . '_title+] ' . + '([+oldUrl+]) [+outdated+]. ' . + '[+please_download_and_install+] UpdateEvosRss [+from+]' . + ' [+extras_module+]' . + '
    '; + + $out = $this->parseTemplate( + $tpl, + [ + 'extrasID' => $this->getExtrasId(), + 'oldUrl' => $options['old'] + ] + ); + } + + return $out; + } + + /** + * @return int + */ + public function getExtrasId() + { + return $this->extrasId; + } + + /** + * @param null $package + * @return string + */ + public function getExtrasUrl($package = null) + { + if ($this->getExtrasId() === 0) { + $url = 'https://extras.evo.im/find/' . $package; + } else { + $url = 'index.php?a=112&id=' . $this->getExtrasId(); + } + + return $url; + } + + /** + * @return int + */ + public function findExtrasId() + { + $moduleId = \EvolutionCMS\Models\SiteModule::select('id')->where('name', 'Extras')->where('disabled', 0)->first(); + if (!is_null($moduleId)) { + return (int)$moduleId->id; + } + return 0; + } + + /** + * @return int + */ + public function getPluginId() + { + return $this->pluginId; + } + + /** + * @return int + */ + public function findPluginId() + { + $pluginId = \EvolutionCMS\Models\SitePlugin::select('id')->where('name', $this->pluginName)->where('disabled', 0)->first(); + if (!is_null($pluginId)) { + return (int)$pluginId->id; + } + return 0; + } + + /** + * @param string $title + * @return string + */ + public function makeConfigButton($title) + { + $button = ''; + if ($this->modx->hasPermission('edit_plugin')) { + $popup = [ + 'url' => EVO_MANAGER_URL . '?a=102&id=' . $this->getPluginId() . '&tab=1', + 'title1' => $title, + 'icon' => 'fa-cog', + 'iframe' => 'iframe', + 'selector2' => '#tabConfig', + 'position' => 'center', + 'width' => '80%', + 'height' => '80%', + 'hide' => 0, + 'hover' => 0, + 'overlay' => 1, + 'overlayclose' => 1 + ]; + + $button = '' . + ' ' . + ''; + } + + return $button; + } + + /** + * @param array $lexicon + */ + public function setLang($lexicon = []) + { + $lang = $this->modx->getConfig('manager_language'); + if (file_exists( __DIR__ . '/lang/'.$lang.'/core.inc.php')){ + include_once(__DIR__ . '/lang/'.$lang.'/core.inc.php'); + } else { + include_once(__DIR__ . '/lang/english/core.inc.php'); + } + $this->lang = $_lang; + /* + $this->lang = new Helpers\Lexicon($this->modx, array( + 'lang' => $lang, + 'langDir' => 'assets/plugins/extrascheck/lang/' + )); + + if (!empty($lang)) { + $this->lang->fromArray(array($lang => $lexicon)); + } + $this->lang->loadLang();*/ + } + + /** + * @param string $type + * @param string $item + * @param array $options + * @return mixed + */ + public function process($type, $item, $options) + { + $available = ['rss', 'file', 'theme', 'snippet', 'plugin', 'module']; + + if (\in_array($type, $available) && method_exists($this, $type)) { + $out = $this->{$type}($item, $options); + } + return $out; + } + + /** + * @param string $tpl + * @param array $data + * @return string + */ + public function parseTemplate($tpl, $data = []) + { + return $this->tpl->parseChunk( + ($tpl), + array_merge( + ['evo_cms_version' => $this->modx->getVersionData('version')], + $data, + $this->lang + ), + true, + false + ); + } + + /** + * function to extract snippet version from description tags + * @param $string + * @param $tag + * @return mixed + */ + protected function getver($string, $tag) + { + $content = "/<$tag>(.*?)<\/$tag>/"; + preg_match($content, $string, $text); + if(isset($text[1])) + return $text[1]; + else return false; + } +} diff --git a/assets/plugins/extrascheck/OutdatedExtrasCheck.plugin.php b/assets/plugins/extrascheck/OutdatedExtrasCheck.plugin.php index 65509fcb25..7fb3bbd2fa 100644 --- a/assets/plugins/extrascheck/OutdatedExtrasCheck.plugin.php +++ b/assets/plugins/extrascheck/OutdatedExtrasCheck.plugin.php @@ -1,64 +1,64 @@ -getLoginUserID(); -$sid = $modx->sid; -$role = (int)$_SESSION['mgrRole']; -$user = $_SESSION['mgrShortname']; - -switch (true) -{ - case ($role !== 1 && $wdgVisibility === 'AdminOnly'): - // show widget only to Admin role 1 - break; - case ($role === 1 && $wdgVisibility === 'AdminExcluded'): - // show widget to all manager users excluded Admin role 1 - break; - case (isset($ThisRole) && $role != $ThisRole && $wdgVisibility === 'ThisRoleOnly'): - // show widget only to "this" role id - break; - case (isset($ThisUser) && $user != $ThisUser && $wdgVisibility === 'ThisUserOnly'): - // show widget only to "this" username - break; - default: // get plugin id and setting button - global $_lang; - $plugin_path = __DIR__; - if (!class_exists('CheckOutdated')) { - include_once __DIR__ . '/CheckOutdated.class.php'; - } - $checkOutdated = new CheckOutdated($modx, $modx->event->activePlugin, $_lang); - $outdated = $checkOutdated->load( - 'https://raw.githubusercontent.com/evolution-cms/OutdatedExtrasCheck/master/outdated.json' - ); - - $out = ''; - foreach ($outdated as $type => $elements) { - foreach ($elements as $item => $options) { - $out .= $checkOutdated->process($type, $item, $options); - } - } - - if ($out !== '' && $modx->event->name === 'OnManagerWelcomeHome') { - $button = $checkOutdated->makeConfigButton($_lang['settings_config']); - $modx->setPlaceholder('button_pl_config', $button); - - $wdgTitle = $checkOutdated->parseTemplate('@CODE:EVO [+evo_cms_version+] - [+title+]'); - $widgets['xtraCheck'] = [ - 'menuindex' => '0', - 'id' => 'xtraCheck' . $checkOutdated->getPluginId() . '', - 'cols' => 'col-lg-12', - 'headAttr' => 'style="color:#E84B39;"', - 'bodyAttr' => '', - 'icon' => 'fa-warning', - 'title' => '' . $wdgTitle . ' ' . $button . '', - 'body' => '
    ' . $out . '
    ', - 'hide' => '0' - ]; - $modx->event->setOutput(serialize($widgets)); - } - break; -} +getLoginUserID(); +$sid = $modx->sid; +$role = (int)$_SESSION['mgrRole']; +$user = $_SESSION['mgrShortname']; + +switch (true) +{ + case ($role !== 1 && $wdgVisibility === 'AdminOnly'): + // show widget only to Admin role 1 + break; + case ($role === 1 && $wdgVisibility === 'AdminExcluded'): + // show widget to all manager users excluded Admin role 1 + break; + case (isset($ThisRole) && $role != $ThisRole && $wdgVisibility === 'ThisRoleOnly'): + // show widget only to "this" role id + break; + case (isset($ThisUser) && $user != $ThisUser && $wdgVisibility === 'ThisUserOnly'): + // show widget only to "this" username + break; + default: // get plugin id and setting button + global $_lang; + $plugin_path = __DIR__; + if (!class_exists('CheckOutdated')) { + include_once __DIR__ . '/CheckOutdated.class.php'; + } + $checkOutdated = new CheckOutdated($modx, $modx->event->activePlugin, $_lang); + $outdated = $checkOutdated->load( + 'https://raw.githubusercontent.com/evolution-cms/OutdatedExtrasCheck/master/outdated.json' + ); + + $out = ''; + foreach ($outdated as $type => $elements) { + foreach ($elements as $item => $options) { + $out .= $checkOutdated->process($type, $item, $options); + } + } + + if ($out !== '' && $modx->event->name === 'OnManagerWelcomeHome') { + $button = $checkOutdated->makeConfigButton($_lang['settings_config']); + $modx->setPlaceholder('button_pl_config', $button); + + $wdgTitle = $checkOutdated->parseTemplate('@CODE:EVO [+evo_cms_version+] - [+title+]'); + $widgets['xtraCheck'] = [ + 'menuindex' => '0', + 'id' => 'xtraCheck' . $checkOutdated->getPluginId() . '', + 'cols' => 'col-lg-12', + 'headAttr' => 'style="color:#E84B39;"', + 'bodyAttr' => '', + 'icon' => 'fa-warning', + 'title' => '' . $wdgTitle . ' ' . $button . '', + 'body' => '
    ' . $out . '
    ', + 'hide' => '0' + ]; + $modx->event->setOutput(serialize($widgets)); + } + break; +} diff --git a/assets/plugins/extrascheck/lang/english/core.inc.php b/assets/plugins/extrascheck/lang/english/core.inc.php index 34463d6d41..cadc60ed08 100644 --- a/assets/plugins/extrascheck/lang/english/core.inc.php +++ b/assets/plugins/extrascheck/lang/english/core.inc.php @@ -1,33 +1,33 @@ -outdated'; -$_lang['isoutdated'] = 'is outdated and no longer compatible with'; -$_lang['no'] = 'is outdated and no longer compatible with'; -$_lang['please_update'] = 'Please update'; -$_lang['please_delete'] = 'Please delete'; -$_lang['please_download_and_install'] = 'Please download and install'; -$_lang["to_latest"] = 'to the latest version'; -$_lang['min_required'] = 'min required'; -$_lang['from'] = 'from'; -$_lang['extras_module'] = 'Extras Module'; -$_lang['or_move_to'] = 'or move to'; -$_lang['not_used'] = 'is no longer used by'; -$_lang['from_folder'] = 'from folder'; -$_lang['if_dont_use'] = 'If you don\'t use for other purpose'; -$_lang['security_reason'] = 'is vulnerable'; - -return $_lang; +outdated'; +$_lang['isoutdated'] = 'is outdated and no longer compatible with'; +$_lang['no'] = 'is outdated and no longer compatible with'; +$_lang['please_update'] = 'Please update'; +$_lang['please_delete'] = 'Please delete'; +$_lang['please_download_and_install'] = 'Please download and install'; +$_lang["to_latest"] = 'to the latest version'; +$_lang['min_required'] = 'min required'; +$_lang['from'] = 'from'; +$_lang['extras_module'] = 'Extras Module'; +$_lang['or_move_to'] = 'or move to'; +$_lang['not_used'] = 'is no longer used by'; +$_lang['from_folder'] = 'from folder'; +$_lang['if_dont_use'] = 'If you don\'t use for other purpose'; +$_lang['security_reason'] = 'is vulnerable'; + +return $_lang; diff --git a/assets/plugins/extrascheck/lang/italian/core.inc.php b/assets/plugins/extrascheck/lang/italian/core.inc.php index 870fc038c7..e60e0fcb45 100644 --- a/assets/plugins/extrascheck/lang/italian/core.inc.php +++ b/assets/plugins/extrascheck/lang/italian/core.inc.php @@ -1,32 +1,32 @@ -obsoleto'; -$_lang['isoutdated'] = 'è obsoleto e non compatibile con'; -$_lang['please_update'] = 'Aggiorna'; -$_lang['please_delete'] = 'Per favore cancellalo'; -$_lang['please_download_and_install'] = 'Per favore scarica e installa'; -$_lang["to_latest"] = 'all\'ultima versione'; -$_lang['min_required'] = 'minima richiesta '; -$_lang['from'] = 'dal'; -$_lang['extras_module'] = 'Modulo Extras'; -$_lang['or_move_to'] = 'o passa a'; -$_lang['not_used'] = 'non è più utilizzato da'; -$_lang['from_folder'] = 'dalla cartella'; -$_lang['if_dont_use'] = 'Se non lo usi per altri scopi'; -$_lang['security_reason'] = 'vulnerabile'; - -return $_lang; +obsoleto'; +$_lang['isoutdated'] = 'è obsoleto e non compatibile con'; +$_lang['please_update'] = 'Aggiorna'; +$_lang['please_delete'] = 'Per favore cancellalo'; +$_lang['please_download_and_install'] = 'Per favore scarica e installa'; +$_lang["to_latest"] = 'all\'ultima versione'; +$_lang['min_required'] = 'minima richiesta '; +$_lang['from'] = 'dal'; +$_lang['extras_module'] = 'Modulo Extras'; +$_lang['or_move_to'] = 'o passa a'; +$_lang['not_used'] = 'non è più utilizzato da'; +$_lang['from_folder'] = 'dalla cartella'; +$_lang['if_dont_use'] = 'Se non lo usi per altri scopi'; +$_lang['security_reason'] = 'vulnerabile'; + +return $_lang; diff --git a/core/config/cms/observers.php b/core/config/cms/observers.php index 31520c023b..c6e6ddc052 100644 --- a/core/config/cms/observers.php +++ b/core/config/cms/observers.php @@ -1,4 +1,4 @@ - EvolutionCMS\Observers\SiteContentObserver::class -]; + EvolutionCMS\Observers\SiteContentObserver::class +]; diff --git a/core/src/Controllers/EventLogDetails.php b/core/src/Controllers/EventLogDetails.php index 796046d250..7b2bdb0c5d 100644 --- a/core/src/Controllers/EventLogDetails.php +++ b/core/src/Controllers/EventLogDetails.php @@ -1,32 +1,32 @@ -managerTheme->getCore()->hasPermission('view_eventlog'); - } - - public function process() : bool - { - $this->parameters['log'] = Models\EventLog::findOrNew($this->getElementId()); - - return true; - } -} +managerTheme->getCore()->hasPermission('view_eventlog'); + } + + public function process() : bool + { + $this->parameters['log'] = Models\EventLog::findOrNew($this->getElementId()); + + return true; + } +} diff --git a/core/src/Controllers/MoveDocument.php b/core/src/Controllers/MoveDocument.php index 8416c3e6a8..0bdd9c1743 100644 --- a/core/src/Controllers/MoveDocument.php +++ b/core/src/Controllers/MoveDocument.php @@ -5,81 +5,81 @@ use EvolutionCMS\Legacy\Permissions; use EvolutionCMS\Support\MoveDocumentTargetGuard; use Exception; - -class MoveDocument extends AbstractController implements ManagerTheme\PageControllerInterface -{ - protected $view = 'page.move_document'; - - /** - * {@inheritdoc} - */ - public function checkLocked(): ?string - { - return null; - } - - /** - * {@inheritdoc} - */ - public function canView(): bool - { - return $this->managerTheme->getCore()->hasPermission('save_document'); - } - - public function process() : bool - { - if ((int)$this->getIndex() === 52) { - $this->handle(); - return false; - } - - $this->processDisplay(); - return true; - } - - protected function handle() - { - $newParentID = (int)get_by_key($_REQUEST, 'new_parent', 0, 'is_scalar'); - $documentID = $this->getElementId(); - - // ok, two things to check. - // first, document cannot be moved to itself - // second, new parent must be a folder. If not, set it to folder. - if ($documentID === $newParentID) { - $this->managerTheme->alertAndQuit('error_movedocument1'); - } - - if ($documentID <= 0 || $newParentID < 0) { - $this->managerTheme->alertAndQuit('error_movedocument2'); - } - - $document = $this->getDocument($documentID); - + +class MoveDocument extends AbstractController implements ManagerTheme\PageControllerInterface +{ + protected $view = 'page.move_document'; + + /** + * {@inheritdoc} + */ + public function checkLocked(): ?string + { + return null; + } + + /** + * {@inheritdoc} + */ + public function canView(): bool + { + return $this->managerTheme->getCore()->hasPermission('save_document'); + } + + public function process() : bool + { + if ((int)$this->getIndex() === 52) { + $this->handle(); + return false; + } + + $this->processDisplay(); + return true; + } + + protected function handle() + { + $newParentID = (int)get_by_key($_REQUEST, 'new_parent', 0, 'is_scalar'); + $documentID = $this->getElementId(); + + // ok, two things to check. + // first, document cannot be moved to itself + // second, new parent must be a folder. If not, set it to folder. + if ($documentID === $newParentID) { + $this->managerTheme->alertAndQuit('error_movedocument1'); + } + + if ($documentID <= 0 || $newParentID < 0) { + $this->managerTheme->alertAndQuit('error_movedocument2'); + } + + $document = $this->getDocument($documentID); + // the form (a=51) checks the source document; the action must too, or the check is bypassable $this->checkDocumentPermission($document->getKey(), 'access_permission_denied'); if (MoveDocumentTargetGuard::isInsideItself($document->getKey(), $newParentID)) { $this->managerTheme->alertAndQuit('error_movedocument1'); - } - - // check user has permission to move document to chosen location - if ($this->managerTheme->getCore()->getConfig('use_udperms') && $document->parent !== $newParentID) { - $this->checkNewParentPermission($newParentID); - } - - $evtOut = $this->managerTheme->getCore()->invokeEvent('onBeforeMoveDocument', [ - 'id_document' => $document->getKey(), - 'old_parent' => $document->parent, - 'new_parent' => $newParentID - ]); - - if (\is_array($evtOut) && count($evtOut) > 0) { - $newParent = (int)array_pop($evtOut); - if ($newParent === $document->parent) { - $this->managerTheme->alertAndQuit('error_movedocument2'); - } else { - $newParentID = $newParent; - } + } + + // check user has permission to move document to chosen location + if ($this->managerTheme->getCore()->getConfig('use_udperms') && $document->parent !== $newParentID) { + $this->checkNewParentPermission($newParentID); + } + + $evtOut = $this->managerTheme->getCore()->invokeEvent('onBeforeMoveDocument', [ + 'id_document' => $document->getKey(), + 'old_parent' => $document->parent, + 'new_parent' => $newParentID + ]); + + if (\is_array($evtOut) && count($evtOut) > 0) { + $newParent = (int)array_pop($evtOut); + if ($newParent === $document->parent) { + $this->managerTheme->alertAndQuit('error_movedocument2'); + } else { + $newParentID = $newParent; + } } if ($newParentID > 0) { $parentDocument = $this->getDocument($newParentID); @@ -89,88 +89,88 @@ protected function handle() if (MoveDocumentTargetGuard::isInsideItself($document->getKey(), $parentDocument->getKey())) { $this->managerTheme->alertAndQuit('error_movedocument1'); } - - $parentDocument->isfolder = true; - $parentDocument->save(); - if ($document->ancestor && $document->ancestor->children()->count() <= 1) { - $document->ancestor->isfolder = false; - $document->ancestor->save(); - } - $document->parent = $parentDocument->getKey(); - } else { - $document->parent = 0; - } - $document->save(); - - // Set the item name for logger - $_SESSION['itemname'] = $document->pagetitle; - - $this->managerTheme->getCore()->invokeEvent('onAfterMoveDocument', [ - 'id_document' => $document->getKey(), - 'old_parent' => $document->parent, - 'new_parent' => $newParentID - ]); - - // empty cache & sync site - $this->managerTheme->getCore()->clearCache('document'); - - header('Location: index.php?a=3&id=' . $document->getKey() . '&r=9'); - } - - protected function processDisplay() : bool - { - $id = $this->getElementId(); - $document = $this->getDocument($id); - - $this->checkDocumentPermission($document->getKey(), 'access_permission_denied'); - - // Set the item name for logger - $_SESSION['itemname'] = $document->pagetitle; - $this->parameters['document'] = $document; - - return true; - } - - /** - * @param string|int $id - * @return Models\SiteContent - */ - protected function getDocument($id) : Models\SiteContent - { - try { - if ($id <= 0) { - throw new Exception(); - } - /** @var Models\SiteContent $document */ - $document = Models\SiteContent::withTrashed()->findOrFail($id); - } catch (Exception $exception) { - $this->managerTheme->alertAndQuit('error_no_id'); - } - - return $document; - } - - protected function checkNewParentPermission($id) - { - $this->checkDocumentPermission($id, 'access_permission_parent_denied'); - } - - /** - * @param int $id - * @param string $lang lexicon key of the alert shown when access is denied - * @since 3.5.8 - */ - protected function checkDocumentPermission($id, string $lang): void - { - $udperms = new Permissions; - $udperms->user = $this->managerTheme->getCore()->getLoginUserID('mgr'); - $udperms->document = $id; - $udperms->role = $_SESSION['mgrRole']; - - if ($udperms->checkPermissions()) { - return; - } - - $this->managerTheme->alertAndQuit($lang); - } -} + + $parentDocument->isfolder = true; + $parentDocument->save(); + if ($document->ancestor && $document->ancestor->children()->count() <= 1) { + $document->ancestor->isfolder = false; + $document->ancestor->save(); + } + $document->parent = $parentDocument->getKey(); + } else { + $document->parent = 0; + } + $document->save(); + + // Set the item name for logger + $_SESSION['itemname'] = $document->pagetitle; + + $this->managerTheme->getCore()->invokeEvent('onAfterMoveDocument', [ + 'id_document' => $document->getKey(), + 'old_parent' => $document->parent, + 'new_parent' => $newParentID + ]); + + // empty cache & sync site + $this->managerTheme->getCore()->clearCache('document'); + + header('Location: index.php?a=3&id=' . $document->getKey() . '&r=9'); + } + + protected function processDisplay() : bool + { + $id = $this->getElementId(); + $document = $this->getDocument($id); + + $this->checkDocumentPermission($document->getKey(), 'access_permission_denied'); + + // Set the item name for logger + $_SESSION['itemname'] = $document->pagetitle; + $this->parameters['document'] = $document; + + return true; + } + + /** + * @param string|int $id + * @return Models\SiteContent + */ + protected function getDocument($id) : Models\SiteContent + { + try { + if ($id <= 0) { + throw new Exception(); + } + /** @var Models\SiteContent $document */ + $document = Models\SiteContent::withTrashed()->findOrFail($id); + } catch (Exception $exception) { + $this->managerTheme->alertAndQuit('error_no_id'); + } + + return $document; + } + + protected function checkNewParentPermission($id) + { + $this->checkDocumentPermission($id, 'access_permission_parent_denied'); + } + + /** + * @param int $id + * @param string $lang lexicon key of the alert shown when access is denied + * @since 3.5.8 + */ + protected function checkDocumentPermission($id, string $lang): void + { + $udperms = new Permissions; + $udperms->user = $this->managerTheme->getCore()->getLoginUserID('mgr'); + $udperms->document = $id; + $udperms->role = $_SESSION['mgrRole']; + + if ($udperms->checkPermissions()) { + return; + } + + $this->managerTheme->alertAndQuit($lang); + } +} diff --git a/core/src/Controllers/PluginPriority.php b/core/src/Controllers/PluginPriority.php index e7b22b4d3d..5de52b2576 100644 --- a/core/src/Controllers/PluginPriority.php +++ b/core/src/Controllers/PluginPriority.php @@ -1,81 +1,81 @@ -managerTheme->getCore()->hasPermission('save_plugin'); - } - - /** - * {@inheritdoc} - */ - public function getParameters(array $params = []): array - { - return parent::getParameters([ - 'events' => $this->getEventsParameter() - ]); - } - - protected function getEventsParameter() : Eloquent\Collection - { - return Models\SystemEventname::with( - [ - 'plugins' => function (Eloquent\Relations\BelongsToMany $query) { - $query->orderBy('priority'); - } - ] - )->whereHas('plugins')->orderBy('name')->get(); - } - - public function process() : bool - { - $updateMsg = false; - - if (isset($_POST['priority']) && is_array($_POST['priority'])) { - $updateMsg = true; - $db = $this->managerTheme->getCore()->getDatabase(); - $tableName = $db->getFullTableName('site_plugin_events'); - - foreach ($_POST['priority'] as $eventId => $pluginsOrder) { - if (!is_numeric($eventId) || !is_array($pluginsOrder)) { - continue; - } - - if (\count($pluginsOrder) > 0) { - foreach ($pluginsOrder as $priority => $pluginId) { - Models\SitePluginEvent::query() - ->where('pluginid', intval($pluginId)) - ->where('evtid', intval($eventId)) - ->update(['priority' => intval($priority)]); - } - } - } - - // empty cache - $this->managerTheme->getCore()->clearCache('full'); - } - - $this->parameters['updateMsg'] = $updateMsg; - - return true; - } -} +managerTheme->getCore()->hasPermission('save_plugin'); + } + + /** + * {@inheritdoc} + */ + public function getParameters(array $params = []): array + { + return parent::getParameters([ + 'events' => $this->getEventsParameter() + ]); + } + + protected function getEventsParameter() : Eloquent\Collection + { + return Models\SystemEventname::with( + [ + 'plugins' => function (Eloquent\Relations\BelongsToMany $query) { + $query->orderBy('priority'); + } + ] + )->whereHas('plugins')->orderBy('name')->get(); + } + + public function process() : bool + { + $updateMsg = false; + + if (isset($_POST['priority']) && is_array($_POST['priority'])) { + $updateMsg = true; + $db = $this->managerTheme->getCore()->getDatabase(); + $tableName = $db->getFullTableName('site_plugin_events'); + + foreach ($_POST['priority'] as $eventId => $pluginsOrder) { + if (!is_numeric($eventId) || !is_array($pluginsOrder)) { + continue; + } + + if (\count($pluginsOrder) > 0) { + foreach ($pluginsOrder as $priority => $pluginId) { + Models\SitePluginEvent::query() + ->where('pluginid', intval($pluginId)) + ->where('evtid', intval($eventId)) + ->update(['priority' => intval($priority)]); + } + } + } + + // empty cache + $this->managerTheme->getCore()->clearCache('full'); + } + + $this->parameters['updateMsg'] = $updateMsg; + + return true; + } +} diff --git a/core/src/Legacy/Phx.php b/core/src/Legacy/Phx.php index a5c8617a5e..d3df6b7e4f 100644 --- a/core/src/Legacy/Phx.php +++ b/core/src/Legacy/Phx.php @@ -1,838 +1,838 @@ - [], - 'ui' => [], - 'mo' => [] - ]; - public $safetags = [ - ['~(?modx = $modx; - $this->user["mgrid"] = isset($_SESSION['mgrInternalKey']) ? intval($_SESSION['mgrInternalKey']) : 0; - $this->user["usrid"] = isset($_SESSION['webInternalKey']) ? intval($_SESSION['webInternalKey']) : 0; - $this->user["id"] = ($this->user["usrid"] > 0) ? (-$this->user["usrid"]) : $this->user["mgrid"]; - - $this->debug = (bool)get_by_key($args, 1, false); - - $this->maxPasses = (int)get_by_key($args, 2, 50); - - $this->modx->setPlaceholder("phx", "&_PHX_INTERNAL_&"); - if (function_exists('mb_internal_encoding')) { - mb_internal_encoding($this->modx->config['evo_charset']); - } - } - - // Plugin event hook for MODx - public function OnParseDocument() - { - // Get document output from MODx - $template = $this->modx->documentOutput; - // To the parse cave .. let's go! *insert batman tune here* - $template = $this->Parse($template); - // Set processed document output in MODx - $this->modx->documentOutput = $template; - } - - // Parser: Preparation, cleaning and checkup - - /** - * @param string $template - * @return mixed|string - */ - public function Parse($template = '') - { - // If we already reached max passes don't get at it again. - if ($this->curPass == $this->maxPasses) { - return $template; - } - // Set template pre-process hash - $st = md5($template); - // Replace non-call characters in the template: [, ] - $template = preg_replace($this->safetags[0], $this->safetags[1], $template); - // To the parse mobile.. let's go! *insert batman tune here* - $template = $this->ParseValues($template); - // clean up unused placeholders that have modifiers attached (MODx can't clean them) - preg_match_all('~(?:=`[^`@]*?)(\[\+([^:\+\[\]]+)([^\[\]]*?)\+\])~s', $template, $matches); - if ($matches[0]) { - $template = str_replace($matches[1], '', $template); - $this->Log("Cleaning unsolved tags: \n" . implode("\n", $matches[2])); - } - // Restore non-call characters in the template: [, ] - $template = str_replace($this->safetags[1], $this->safetags[2], $template); - // Set template post-process hash - $et = md5($template); - // If template has changed, parse it once more... - if ($st != $et) { - $template = $this->Parse($template); - } - // Write an event log if debugging is enabled and there is something to log - if ($this->debug && $this->debugLog) { - $this->modx->logEvent($this->curPass, 1, $this->createEventLog(), $this->name . ' ' . $this->version); - $this->debugLog = false; - } - - // Return the processed template - return $template; - } - - // Parser: Tag detection and replacements - - /** - * @param string $template - * @return mixed|string - */ - public function ParseValues($template = '') - { - $this->curPass = $this->curPass + 1; - $st = md5($template); - - $this->LogPass(); - // MODX Chunks - if (preg_match_all('~(?Log('MODX Chunks -> Merging all chunk tags'); - $count = count($matches[0]); - $var_search = []; - $var_replace = []; - for ($i = 0; $i < $count; $i++) { - $var_search[] = $matches[0][$i]; - $input = $matches[1][$i]; - $this->Log('MODX Chunk: ' . $input); - $input = $this->modx->mergeChunkContent('{{' . $input . '}}'); - $var_replace[] = $this->Filter($input, $matches[2][$i]); - } - $template = str_replace($var_search, $var_replace, $template); - } - - // MODx Snippets - //if ( preg_match_all('~\[(\[|!)([^\[]*?)(!|\])\]~s',$template, $matches)) { - if (preg_match_all('~(?Log("MODx Snippet -> " . $snippet); - - // Let MODx evaluate snippet - $replace = $this->modx->evalSnippets("[[" . $snippet . "]]"); - $this->LogSnippet($replace); - - // Replace values - $var_search[] = $matches[0][$i]; - $var_replace[] = $replace; - } - $template = str_replace($var_search, $var_replace, $template); - } - - // PHx / MODx Tags - if (preg_match_all('~\[(\+|\*|\()([^:\+\[\]]+)([^\[\]]*?)(\1|\))\]~s', $template, $matches)) { - //$matches[0] // Complete string that's need to be replaced - //$matches[1] // Type - //$matches[2] // The placeholder(s) - //$matches[3] // The modifiers - //$matches[4] // Type (end character) - - $count = count($matches[0]); - $var_search = []; - $var_replace = []; - for ($i = 0; $i < $count; $i++) { - $input = $matches[2][$i]; - $modifiers = $matches[3][$i]; - $var_search[] = $matches[0][$i]; - switch ($matches[1][$i]) { - // Document / Template Variable eXtended - case "*": - $this->Log("MODx TV/DV: " . $input); - $input = $this->modx->mergeDocumentContent("[*" . $input . "*]"); - $replace = $this->Filter($input, $modifiers); - break; - // MODx Setting eXtended - case "(": - $this->Log("MODx Setting variable: " . $input); - $input = $this->modx->mergeSettingsContent("[(" . $input . ")]"); - $replace = $this->Filter($input, $modifiers); - break; - // MODx Placeholder eXtended - default: - $this->Log("MODx / PHx placeholder variable: " . $input); - // Check if placeholder is set - if (! array_key_exists($input, $this->placeholders) && - ! array_key_exists($input, $this->modx->placeholders) - ) { - // not set so try again later. - $input = ''; - } else { - // is set, get value and run filter - $input = $this->getPHxVariable($input); - } - $replace = $this->Filter($input, $modifiers); - break; - } - $var_replace[] = $replace; - } - $template = str_replace($var_search, $var_replace, $template); - } - $et = md5($template); // Post-process template hash - - // Log an event if this was the maximum pass - if ($this->curPass == $this->maxPasses) { - $this->Log("Max passes reached. infinite loop protection so exiting.\n If you need the extra passes set the max passes to the highest count of nested tags in your template."); - } - // If this pass is not at maximum passes and the template hash is not the same, get at it again. - if (($this->curPass < $this->maxPasses) && ($st != $et)) { - $template = $this->ParseValues($template); - } - - return $template; - } - - // Parser: modifier detection and eXtended processing if needed - - /** - * @param $input - * @param $modifiers - * @return mixed|null|string - */ - public function Filter($input, $modifiers) - { - $output = $input; - $this->Log(" |--- Input = '" . $output . "'"); - if (preg_match_all('~:([^:=]+)(?:=`(.*?)`(?=:[^:=]+|$))?~s', $modifiers, $matches)) { - $modifier_cmd = $matches[1]; // modifier command - $modifier_value = $matches[2]; // modifier value - $count = count($modifier_cmd); - $condition = []; - for ($i = 0; $i < $count; $i++) { - $output = trim($output); - $this->Log(" |--- Modifier = '" . $modifier_cmd[$i] . "'"); - if ($modifier_value[$i] != '') { - $this->Log(" |--- Options = '" . $modifier_value[$i] . "'"); - } - switch ($modifier_cmd[$i]) { - ##### Conditional Modifiers - case "input": - case "if": - $output = $modifier_value[$i]; - break; - case "equals": - case "is": - case "eq": - $condition[] = intval(($output == $modifier_value[$i])); - break; - case "empty": - $condition[] = intval(empty($output)); - break; - case "notequals": - case "isnot": - case "isnt": - case "ne": - $condition[] = intval(($output != $modifier_value[$i])); - break; - case "isgreaterthan": - case "isgt": - case "eg": - $condition[] = intval(($output >= $modifier_value[$i])); - break; - case "islowerthan": - case "islt": - case "el": - $condition[] = intval(($output <= $modifier_value[$i])); - break; - case "greaterthan": - case "gt": - $condition[] = intval(($output > $modifier_value[$i])); - break; - case "lowerthan": - case "lt": - $condition[] = intval(($output < $modifier_value[$i])); - break; - case "isinrole": - case "ir": - case "memberof": - case "mo": // Is Member Of (same as inrole but this one can be stringed as a conditional) - if ($output == "&_PHX_INTERNAL_&") { - $output = $this->user["id"]; - } - $grps = ($this->strlen($modifier_value[$i]) > 0) ? explode(",", $modifier_value[$i]) : []; - $condition[] = intval($this->isMemberOfWebGroupByUserId($output, $grps)); - break; - case "or": - $condition[] = "||"; - break; - case "and": - $condition[] = "&&"; - break; - case "show": - $conditional = implode(' ', $condition); - $isvalid = intval($this->runCode($conditional)); - if (!$isvalid) { - $output = null; - } - break; - case "then": - $conditional = implode(' ', $condition); - $isvalid = intval($this->runCode($conditional)); - if ($isvalid) { - $output = $modifier_value[$i]; - } else { - $output = null; - } - break; - case "else": - $conditional = implode(' ', $condition); - $isvalid = intval($this->runCode($conditional)); - if (!$isvalid) { - $output = $modifier_value[$i]; - } - break; - case "select": - $raw = explode("&", $modifier_value[$i]); - $map = []; - $count = count($raw); - for ($m = 0; $m < $count; $m++) { - $mi = explode("=", $raw[$m]); - $map[$mi[0]] = $mi[1]; - } - $output = $map[$output]; - break; - ##### End of Conditional Modifiers - - ##### String Modifiers - case "default": - $output = ($output === '') ? $modifier_value[0] : $output; - break; - case "lcase": - case "strtolower": - $output = $this->strtolower($output); - break; - case "ucase": - case "strtoupper": - $output = $this->strtoupper($output); - break; - case "ucfirst": - $output = $this->ucfirst($output); - break; - case "lcfirst": - $output = $this->lcfirst($output); - break; - case "ucwords": - $output = $this->ucwords($output); - break; - case "htmlent": - case "htmlentities": - $output = htmlentities($output, ENT_QUOTES, $this->modx->config['evo_charset']); - break; - case "html_entity_decode": - $output = html_entity_decode($output, ENT_QUOTES, $this->modx->config['evo_charset']); - break; - case "esc": - $output = preg_replace("/&(#[0-9]+|[a-z]+);/i", "&$1;", e($output)); - $output = str_replace(["[", "]", "`"], ["[", "]", "`"], $output); - break; - case "strip": - $output = preg_replace("~([\n\r\t\s]+)~", " ", $output); - break; - case "notags": - case "strip_tags": - $output = strip_tags($output); - break; - case "length": - case "len": - case "strlen": - $output = $this->strlen($output); - break; - case "reverse": - case "strrev": - $output = $this->strrev($output); - break; - case "wordwrap": // default: 70 - $wrapat = intval($modifier_value[$i]) ? intval($modifier_value[$i]) : 70; - $output = preg_replace_callback("@(\b\w+\b)@", function ($m) use ($wrapat) { - return wordwrap($m[1], $wrapat, ' ', 1); - }, $output); - break; - case "limit": // default: 100 - $limit = intval($modifier_value[$i]) ? intval($modifier_value[$i]) : 100; - $output = $this->substr($output, 0, $limit); - break; - case "str_shuffle": - case "shuffle": - $output = $this->str_shuffle($output); - break; - case "str_word_count": - case "word_count": - case "wordcount": - $output = $this->str_word_count($output); - break; - - ##### Special functions - case "math": - $filter = preg_replace("~([a-zA-Z\n\r\t\s])~", "", $modifier_value[$i]); - $filter = str_replace("?", $output, $filter); - // The letter strip above never made this safe: `$`, quotes and backslashes - // survive it, and octal escapes need no letters at all. - $output = ArithmeticExpression::evaluate($filter); - break; - case "isnotempty": - if (!empty($output)) { - $output = $modifier_value[$i]; - } - break; - case "isempty": - case "ifempty": - if (empty($output)) { - $output = $modifier_value[$i]; - } - break; - case "nl2br": - $output = nl2br($output); - break; - case "date": - $output = strftime($modifier_value[$i], (int)$output); - break; - case "set": - $c = $i + 1; - if ($count > $c && $modifier_cmd[$c] == "value") { - $output = preg_replace("~([^a-zA-Z0-9])~", "", $modifier_value[$i]); - } - break; - case "value": - if ($i > 0 && $modifier_cmd[$i - 1] == "set") { - $this->modx->SetPlaceholder("phx." . $output, $modifier_value[$i]); - } - $output = null; - break; - case "md5": - $output = md5($output); - break; - case 'inarray': - case 'in_array': - case 'in': - $modifier_value[$i] = explode(',', $modifier_value[$i]); - $condition[] = (int)(in_array($output, $modifier_value[$i]) !== false); - break; - case "userinfo": - if ($output == "&_PHX_INTERNAL_&") { - $output = $this->user["id"]; - } - $output = $this->ModUser($output, $modifier_value[$i]); - break; - case "inrole": // deprecated - if ($output == "&_PHX_INTERNAL_&") { - $output = $this->user["id"]; - } - $grps = ($this->strlen($modifier_value[$i]) > 0) ? explode(",", $modifier_value[$i]) : []; - $output = intval($this->isMemberOfWebGroupByUserId($output, $grps)); - break; - - // If we haven't yet found the modifier, let's look elsewhere - default: - $snippet = ''; - // modified by Anton Kuzmin (23.06.2010) // - $snippetName = 'phx:' . $modifier_cmd[$i]; - if (array_key_exists($snippetName, $this->modx->snippetCache)) { - $snippet = $this->modx->snippetCache[$snippetName]; - } else { -// not in cache so let's check the db - $snippetObject = $this->modx->getSnippetFromDatabase($snippetName); - $this->modx->snippetCache[$snippetObject['name']] = $snippetObject['content']; - $this->modx->snippetCache[$snippetObject['name'] . 'Props'] = $snippetObject['properties']; - if ($snippetObject['content'] !== null) { - $snippet = $snippetObject['content']; - $this->Log(" |--- DB -> Custom Modifier"); - } else { - // If snippet not found, look in the modifiers folder - $filename = $this->modx->getConfig('rb_base_dir') . 'plugins/phx/modifiers/' . $modifier_cmd[$i] . '.phx.php'; - if (@file_exists($filename)) { - $file_contents = @file_get_contents($filename); - $file_contents = str_replace('<' . '?php', '', $file_contents); - $file_contents = str_replace('?' . '>', '', $file_contents); - $file_contents = str_replace('modx->snippetCache[$snippetName] = $file_contents; - $this->modx->snippetCache[$snippetName . 'Props'] = ''; - $this->Log(" |--- File ($filename) -> Custom Modifier"); - } else { - $this->Log(" |--- PHX Error: {$modifier_cmd[$i]} could not be found"); - } - } - } - if (!empty($snippet)) { - $output = $this->modx->runSnippet($snippetName, [ - 'input' => $output, - 'output' => $output, - 'options' => $modifier_value[$i] - ]); - } else { - $output = ''; - } - break; - } - if (count($condition)) { - $this->Log(" |--- Condition = '" . $condition[count($condition) - 1] . "'"); - } - $this->Log(" |--- Output = '" . $output . "'"); - } - } - - return $output; - } - - /** - * @param string $code - * @return mixed - */ - private function runCode($code) - { - // $code is assembled from intval() results joined by `&&`/`||`, so the arithmetic - // evaluator covers it exactly and no eval() is needed to resolve it. - return ArithmeticExpression::evaluate($code); - } - - // Event logging (debug) - - /** - * @return string - */ - public function createEventLog() - { - $out = ''; - if (!empty($this->console)) { - $console = implode("\n", $this->console); - $this->console = []; - - $out = '
    ' . $console . '
    '; - } - - return $out; - } - - // Returns a cleaned string escaping the HTML and special MODx characters - - /** - * @param $string - * @return array|mixed|string - */ - public function LogClean($string) - { - $string = preg_replace("/&(#[0-9]+|[a-z]+);/i", "&$1;", $string); - $string = replace_array($string); - - return $string; - } - - // Simple log entry - - /** - * @param $string - */ - public function Log($string) - { - if ($this->debug) { - $this->debugLog = true; - $this->console[] = (count($this->console) + 1 - $this->curPass) . " [" . strftime( - "%H:%M:%S", - time() - ) . "] " . $this->LogClean($string); - } - } - - // Log snippet output - - /** - * @param $string - */ - public function LogSnippet($string) - { - if ($this->debug) { - $this->debugLog = true; - $this->console[] = (count($this->console) + 1 - $this->curPass) . " [" . strftime( - "%H:%M:%S", - time() - ) . "] " . " |--- Returns:
    " . $this->LogClean($string) . "
    "; - } - } - - // Log pass - public function LogPass() - { - $this->console[] = "
    Pass " . $this->curPass . "
    "; - } - - // Log pass - - /** - * @param $string - */ - public function LogSource($string) - { - $this->console[] = "
    Source:
    " . $this->LogClean($string); - } - - // Returns the specified field from the user record - // positive userid = manager, negative integer = webuser - - /** - * @param $userid - * @param $field - * @return mixed - */ - public function ModUser($userid, $field) - { - if (!array_key_exists($userid, $this->cache["ui"])) { - if (intval($userid) < 0) { - $user = $this->modx->getWebUserInfo(-($userid)); - } else { - $user = $this->modx->getUserInfo($userid); - } - $this->cache["ui"][$userid] = $user; - } else { - $user = $this->cache["ui"][$userid]; - } - - return $user[$field]; - } - - // Returns true if the user id is in one the specified webgroups - - /** - * @param int $userid - * @param array $groupNames - * @return bool - */ - public function isMemberOfWebGroupByUserId($userid = 0, $groupNames = []) - { - $userid = (int)$userid; - // if $groupNames is not an array return false - if (!is_array($groupNames)) { - return false; - } - - // if the user id is a negative number make it positive - if (intval($userid) < 0) { - $userid = -($userid); - } - - // Creates an array with all webgroups the user id is in - if (!array_key_exists($userid, $this->cache["mo"])) { - $tbl = $this->modx->getDatabase()->getFullTableName("webgroup_names"); - $tbl2 = $this->modx->getDatabase()->getFullTableName("web_groups"); - $sql = "SELECT `wgn`.`name` FROM {$tbl} `wgn` INNER JOIN {$tbl2} `wg` ON `wg`.`webgroup`=`wgn`.`id` AND `wg`.`webuser`={$userid}"; - $this->cache["mo"][$userid] = $grpNames = $this->modx->getDatabase()->getColumn("name", $sql); - } else { - $grpNames = $this->cache["mo"][$userid]; - } - // Check if a supplied group matches a webgroup from the array we just created - foreach ($groupNames as $k => $v) { - if (in_array(trim($v), $grpNames)) { - return true; - } - } - - // If we get here the above logic did not find a match, so return false - return false; - } - - // Returns the value of a PHx/MODx placeholder. - - /** - * @param $name - * @return mixed|string - */ - public function getPHxVariable($name) - { - // Check if this variable is created by PHx - if (array_key_exists($name, $this->placeholders)) { - // Return the value from PHx - return $this->placeholders[$name]; - } else { - // Return the value from MODx - return $this->modx->getPlaceholder($name); - } - } - - // Sets a placeholder variable which can only be access by PHx - - /** - * @param $name - * @param $value - */ - public function setPHxVariable($name, $value) - { - if ($name != "phx") { - $this->placeholders[$name] = $value; - } - } - - //mbstring - - /** - * @param $str - * @param $s - * @param null $l - * @return string - */ - public function substr($str, $s, $l = null) - { - if (function_exists('mb_substr')) { - return mb_substr($str, $s, $l); - } - - return substr($str, $s, $l); - } - - /** - * @param $str - * @return int - */ - public function strlen($str) - { - if (function_exists('mb_strlen')) { - return mb_strlen($str); - } - - return strlen($str); - } - - /** - * @param $str - * @return string - */ - public function strtolower($str) - { - if (function_exists('mb_strtolower')) { - return mb_strtolower($str); - } - - return strtolower($str); - } - - /** - * @param $str - * @return string - */ - public function strtoupper($str) - { - if (function_exists('mb_strtoupper')) { - return mb_strtoupper($str); - } - - return strtoupper($str); - } - - /** - * @param $str - * @return string - */ - public function ucfirst($str) - { - if (function_exists('mb_strtoupper') && function_exists('mb_substr') && function_exists('mb_strlen')) { - return mb_strtoupper(mb_substr($str, 0, 1)) . mb_substr($str, 1, mb_strlen($str)); - } - - return ucfirst($str); - } - - /** - * @param $str - * @return string - */ - public function lcfirst($str) - { - if (function_exists('mb_strtolower') && function_exists('mb_substr') && function_exists('mb_strlen')) { - return mb_strtolower(mb_substr($str, 0, 1)) . mb_substr($str, 1, mb_strlen($str)); - } - - return lcfirst($str); - } - - /** - * @param $str - * @return string - */ - public function ucwords($str) - { - if (function_exists('mb_convert_case')) { - return mb_convert_case($str, MB_CASE_TITLE); - } - - return ucwords($str); - } - - /** - * @param $str - * @return string - */ - public function strrev($str) - { - preg_match_all('/./us', $str, $ar); - - return implode(array_reverse($ar[0])); - } - - /** - * @param $str - * @return string - */ - public function str_shuffle($str) - { - preg_match_all('/./us', $str, $ar); - shuffle($ar[0]); - - return implode($ar[0]); - } - - /** - * @param $str - * @return int - */ - public function str_word_count($str) - { - return count(preg_split('~[^\p{L}\p{N}\']+~u', $str)); - } -} + [], + 'ui' => [], + 'mo' => [] + ]; + public $safetags = [ + ['~(?modx = $modx; + $this->user["mgrid"] = isset($_SESSION['mgrInternalKey']) ? intval($_SESSION['mgrInternalKey']) : 0; + $this->user["usrid"] = isset($_SESSION['webInternalKey']) ? intval($_SESSION['webInternalKey']) : 0; + $this->user["id"] = ($this->user["usrid"] > 0) ? (-$this->user["usrid"]) : $this->user["mgrid"]; + + $this->debug = (bool)get_by_key($args, 1, false); + + $this->maxPasses = (int)get_by_key($args, 2, 50); + + $this->modx->setPlaceholder("phx", "&_PHX_INTERNAL_&"); + if (function_exists('mb_internal_encoding')) { + mb_internal_encoding($this->modx->config['evo_charset']); + } + } + + // Plugin event hook for MODx + public function OnParseDocument() + { + // Get document output from MODx + $template = $this->modx->documentOutput; + // To the parse cave .. let's go! *insert batman tune here* + $template = $this->Parse($template); + // Set processed document output in MODx + $this->modx->documentOutput = $template; + } + + // Parser: Preparation, cleaning and checkup + + /** + * @param string $template + * @return mixed|string + */ + public function Parse($template = '') + { + // If we already reached max passes don't get at it again. + if ($this->curPass == $this->maxPasses) { + return $template; + } + // Set template pre-process hash + $st = md5($template); + // Replace non-call characters in the template: [, ] + $template = preg_replace($this->safetags[0], $this->safetags[1], $template); + // To the parse mobile.. let's go! *insert batman tune here* + $template = $this->ParseValues($template); + // clean up unused placeholders that have modifiers attached (MODx can't clean them) + preg_match_all('~(?:=`[^`@]*?)(\[\+([^:\+\[\]]+)([^\[\]]*?)\+\])~s', $template, $matches); + if ($matches[0]) { + $template = str_replace($matches[1], '', $template); + $this->Log("Cleaning unsolved tags: \n" . implode("\n", $matches[2])); + } + // Restore non-call characters in the template: [, ] + $template = str_replace($this->safetags[1], $this->safetags[2], $template); + // Set template post-process hash + $et = md5($template); + // If template has changed, parse it once more... + if ($st != $et) { + $template = $this->Parse($template); + } + // Write an event log if debugging is enabled and there is something to log + if ($this->debug && $this->debugLog) { + $this->modx->logEvent($this->curPass, 1, $this->createEventLog(), $this->name . ' ' . $this->version); + $this->debugLog = false; + } + + // Return the processed template + return $template; + } + + // Parser: Tag detection and replacements + + /** + * @param string $template + * @return mixed|string + */ + public function ParseValues($template = '') + { + $this->curPass = $this->curPass + 1; + $st = md5($template); + + $this->LogPass(); + // MODX Chunks + if (preg_match_all('~(?Log('MODX Chunks -> Merging all chunk tags'); + $count = count($matches[0]); + $var_search = []; + $var_replace = []; + for ($i = 0; $i < $count; $i++) { + $var_search[] = $matches[0][$i]; + $input = $matches[1][$i]; + $this->Log('MODX Chunk: ' . $input); + $input = $this->modx->mergeChunkContent('{{' . $input . '}}'); + $var_replace[] = $this->Filter($input, $matches[2][$i]); + } + $template = str_replace($var_search, $var_replace, $template); + } + + // MODx Snippets + //if ( preg_match_all('~\[(\[|!)([^\[]*?)(!|\])\]~s',$template, $matches)) { + if (preg_match_all('~(?Log("MODx Snippet -> " . $snippet); + + // Let MODx evaluate snippet + $replace = $this->modx->evalSnippets("[[" . $snippet . "]]"); + $this->LogSnippet($replace); + + // Replace values + $var_search[] = $matches[0][$i]; + $var_replace[] = $replace; + } + $template = str_replace($var_search, $var_replace, $template); + } + + // PHx / MODx Tags + if (preg_match_all('~\[(\+|\*|\()([^:\+\[\]]+)([^\[\]]*?)(\1|\))\]~s', $template, $matches)) { + //$matches[0] // Complete string that's need to be replaced + //$matches[1] // Type + //$matches[2] // The placeholder(s) + //$matches[3] // The modifiers + //$matches[4] // Type (end character) + + $count = count($matches[0]); + $var_search = []; + $var_replace = []; + for ($i = 0; $i < $count; $i++) { + $input = $matches[2][$i]; + $modifiers = $matches[3][$i]; + $var_search[] = $matches[0][$i]; + switch ($matches[1][$i]) { + // Document / Template Variable eXtended + case "*": + $this->Log("MODx TV/DV: " . $input); + $input = $this->modx->mergeDocumentContent("[*" . $input . "*]"); + $replace = $this->Filter($input, $modifiers); + break; + // MODx Setting eXtended + case "(": + $this->Log("MODx Setting variable: " . $input); + $input = $this->modx->mergeSettingsContent("[(" . $input . ")]"); + $replace = $this->Filter($input, $modifiers); + break; + // MODx Placeholder eXtended + default: + $this->Log("MODx / PHx placeholder variable: " . $input); + // Check if placeholder is set + if (! array_key_exists($input, $this->placeholders) && + ! array_key_exists($input, $this->modx->placeholders) + ) { + // not set so try again later. + $input = ''; + } else { + // is set, get value and run filter + $input = $this->getPHxVariable($input); + } + $replace = $this->Filter($input, $modifiers); + break; + } + $var_replace[] = $replace; + } + $template = str_replace($var_search, $var_replace, $template); + } + $et = md5($template); // Post-process template hash + + // Log an event if this was the maximum pass + if ($this->curPass == $this->maxPasses) { + $this->Log("Max passes reached. infinite loop protection so exiting.\n If you need the extra passes set the max passes to the highest count of nested tags in your template."); + } + // If this pass is not at maximum passes and the template hash is not the same, get at it again. + if (($this->curPass < $this->maxPasses) && ($st != $et)) { + $template = $this->ParseValues($template); + } + + return $template; + } + + // Parser: modifier detection and eXtended processing if needed + + /** + * @param $input + * @param $modifiers + * @return mixed|null|string + */ + public function Filter($input, $modifiers) + { + $output = $input; + $this->Log(" |--- Input = '" . $output . "'"); + if (preg_match_all('~:([^:=]+)(?:=`(.*?)`(?=:[^:=]+|$))?~s', $modifiers, $matches)) { + $modifier_cmd = $matches[1]; // modifier command + $modifier_value = $matches[2]; // modifier value + $count = count($modifier_cmd); + $condition = []; + for ($i = 0; $i < $count; $i++) { + $output = trim($output); + $this->Log(" |--- Modifier = '" . $modifier_cmd[$i] . "'"); + if ($modifier_value[$i] != '') { + $this->Log(" |--- Options = '" . $modifier_value[$i] . "'"); + } + switch ($modifier_cmd[$i]) { + ##### Conditional Modifiers + case "input": + case "if": + $output = $modifier_value[$i]; + break; + case "equals": + case "is": + case "eq": + $condition[] = intval(($output == $modifier_value[$i])); + break; + case "empty": + $condition[] = intval(empty($output)); + break; + case "notequals": + case "isnot": + case "isnt": + case "ne": + $condition[] = intval(($output != $modifier_value[$i])); + break; + case "isgreaterthan": + case "isgt": + case "eg": + $condition[] = intval(($output >= $modifier_value[$i])); + break; + case "islowerthan": + case "islt": + case "el": + $condition[] = intval(($output <= $modifier_value[$i])); + break; + case "greaterthan": + case "gt": + $condition[] = intval(($output > $modifier_value[$i])); + break; + case "lowerthan": + case "lt": + $condition[] = intval(($output < $modifier_value[$i])); + break; + case "isinrole": + case "ir": + case "memberof": + case "mo": // Is Member Of (same as inrole but this one can be stringed as a conditional) + if ($output == "&_PHX_INTERNAL_&") { + $output = $this->user["id"]; + } + $grps = ($this->strlen($modifier_value[$i]) > 0) ? explode(",", $modifier_value[$i]) : []; + $condition[] = intval($this->isMemberOfWebGroupByUserId($output, $grps)); + break; + case "or": + $condition[] = "||"; + break; + case "and": + $condition[] = "&&"; + break; + case "show": + $conditional = implode(' ', $condition); + $isvalid = intval($this->runCode($conditional)); + if (!$isvalid) { + $output = null; + } + break; + case "then": + $conditional = implode(' ', $condition); + $isvalid = intval($this->runCode($conditional)); + if ($isvalid) { + $output = $modifier_value[$i]; + } else { + $output = null; + } + break; + case "else": + $conditional = implode(' ', $condition); + $isvalid = intval($this->runCode($conditional)); + if (!$isvalid) { + $output = $modifier_value[$i]; + } + break; + case "select": + $raw = explode("&", $modifier_value[$i]); + $map = []; + $count = count($raw); + for ($m = 0; $m < $count; $m++) { + $mi = explode("=", $raw[$m]); + $map[$mi[0]] = $mi[1]; + } + $output = $map[$output]; + break; + ##### End of Conditional Modifiers + + ##### String Modifiers + case "default": + $output = ($output === '') ? $modifier_value[0] : $output; + break; + case "lcase": + case "strtolower": + $output = $this->strtolower($output); + break; + case "ucase": + case "strtoupper": + $output = $this->strtoupper($output); + break; + case "ucfirst": + $output = $this->ucfirst($output); + break; + case "lcfirst": + $output = $this->lcfirst($output); + break; + case "ucwords": + $output = $this->ucwords($output); + break; + case "htmlent": + case "htmlentities": + $output = htmlentities($output, ENT_QUOTES, $this->modx->config['evo_charset']); + break; + case "html_entity_decode": + $output = html_entity_decode($output, ENT_QUOTES, $this->modx->config['evo_charset']); + break; + case "esc": + $output = preg_replace("/&(#[0-9]+|[a-z]+);/i", "&$1;", e($output)); + $output = str_replace(["[", "]", "`"], ["[", "]", "`"], $output); + break; + case "strip": + $output = preg_replace("~([\n\r\t\s]+)~", " ", $output); + break; + case "notags": + case "strip_tags": + $output = strip_tags($output); + break; + case "length": + case "len": + case "strlen": + $output = $this->strlen($output); + break; + case "reverse": + case "strrev": + $output = $this->strrev($output); + break; + case "wordwrap": // default: 70 + $wrapat = intval($modifier_value[$i]) ? intval($modifier_value[$i]) : 70; + $output = preg_replace_callback("@(\b\w+\b)@", function ($m) use ($wrapat) { + return wordwrap($m[1], $wrapat, ' ', 1); + }, $output); + break; + case "limit": // default: 100 + $limit = intval($modifier_value[$i]) ? intval($modifier_value[$i]) : 100; + $output = $this->substr($output, 0, $limit); + break; + case "str_shuffle": + case "shuffle": + $output = $this->str_shuffle($output); + break; + case "str_word_count": + case "word_count": + case "wordcount": + $output = $this->str_word_count($output); + break; + + ##### Special functions + case "math": + $filter = preg_replace("~([a-zA-Z\n\r\t\s])~", "", $modifier_value[$i]); + $filter = str_replace("?", $output, $filter); + // The letter strip above never made this safe: `$`, quotes and backslashes + // survive it, and octal escapes need no letters at all. + $output = ArithmeticExpression::evaluate($filter); + break; + case "isnotempty": + if (!empty($output)) { + $output = $modifier_value[$i]; + } + break; + case "isempty": + case "ifempty": + if (empty($output)) { + $output = $modifier_value[$i]; + } + break; + case "nl2br": + $output = nl2br($output); + break; + case "date": + $output = strftime($modifier_value[$i], (int)$output); + break; + case "set": + $c = $i + 1; + if ($count > $c && $modifier_cmd[$c] == "value") { + $output = preg_replace("~([^a-zA-Z0-9])~", "", $modifier_value[$i]); + } + break; + case "value": + if ($i > 0 && $modifier_cmd[$i - 1] == "set") { + $this->modx->SetPlaceholder("phx." . $output, $modifier_value[$i]); + } + $output = null; + break; + case "md5": + $output = md5($output); + break; + case 'inarray': + case 'in_array': + case 'in': + $modifier_value[$i] = explode(',', $modifier_value[$i]); + $condition[] = (int)(in_array($output, $modifier_value[$i]) !== false); + break; + case "userinfo": + if ($output == "&_PHX_INTERNAL_&") { + $output = $this->user["id"]; + } + $output = $this->ModUser($output, $modifier_value[$i]); + break; + case "inrole": // deprecated + if ($output == "&_PHX_INTERNAL_&") { + $output = $this->user["id"]; + } + $grps = ($this->strlen($modifier_value[$i]) > 0) ? explode(",", $modifier_value[$i]) : []; + $output = intval($this->isMemberOfWebGroupByUserId($output, $grps)); + break; + + // If we haven't yet found the modifier, let's look elsewhere + default: + $snippet = ''; + // modified by Anton Kuzmin (23.06.2010) // + $snippetName = 'phx:' . $modifier_cmd[$i]; + if (array_key_exists($snippetName, $this->modx->snippetCache)) { + $snippet = $this->modx->snippetCache[$snippetName]; + } else { +// not in cache so let's check the db + $snippetObject = $this->modx->getSnippetFromDatabase($snippetName); + $this->modx->snippetCache[$snippetObject['name']] = $snippetObject['content']; + $this->modx->snippetCache[$snippetObject['name'] . 'Props'] = $snippetObject['properties']; + if ($snippetObject['content'] !== null) { + $snippet = $snippetObject['content']; + $this->Log(" |--- DB -> Custom Modifier"); + } else { + // If snippet not found, look in the modifiers folder + $filename = $this->modx->getConfig('rb_base_dir') . 'plugins/phx/modifiers/' . $modifier_cmd[$i] . '.phx.php'; + if (@file_exists($filename)) { + $file_contents = @file_get_contents($filename); + $file_contents = str_replace('<' . '?php', '', $file_contents); + $file_contents = str_replace('?' . '>', '', $file_contents); + $file_contents = str_replace('modx->snippetCache[$snippetName] = $file_contents; + $this->modx->snippetCache[$snippetName . 'Props'] = ''; + $this->Log(" |--- File ($filename) -> Custom Modifier"); + } else { + $this->Log(" |--- PHX Error: {$modifier_cmd[$i]} could not be found"); + } + } + } + if (!empty($snippet)) { + $output = $this->modx->runSnippet($snippetName, [ + 'input' => $output, + 'output' => $output, + 'options' => $modifier_value[$i] + ]); + } else { + $output = ''; + } + break; + } + if (count($condition)) { + $this->Log(" |--- Condition = '" . $condition[count($condition) - 1] . "'"); + } + $this->Log(" |--- Output = '" . $output . "'"); + } + } + + return $output; + } + + /** + * @param string $code + * @return mixed + */ + private function runCode($code) + { + // $code is assembled from intval() results joined by `&&`/`||`, so the arithmetic + // evaluator covers it exactly and no eval() is needed to resolve it. + return ArithmeticExpression::evaluate($code); + } + + // Event logging (debug) + + /** + * @return string + */ + public function createEventLog() + { + $out = ''; + if (!empty($this->console)) { + $console = implode("\n", $this->console); + $this->console = []; + + $out = '
    ' . $console . '
    '; + } + + return $out; + } + + // Returns a cleaned string escaping the HTML and special MODx characters + + /** + * @param $string + * @return array|mixed|string + */ + public function LogClean($string) + { + $string = preg_replace("/&(#[0-9]+|[a-z]+);/i", "&$1;", $string); + $string = replace_array($string); + + return $string; + } + + // Simple log entry + + /** + * @param $string + */ + public function Log($string) + { + if ($this->debug) { + $this->debugLog = true; + $this->console[] = (count($this->console) + 1 - $this->curPass) . " [" . strftime( + "%H:%M:%S", + time() + ) . "] " . $this->LogClean($string); + } + } + + // Log snippet output + + /** + * @param $string + */ + public function LogSnippet($string) + { + if ($this->debug) { + $this->debugLog = true; + $this->console[] = (count($this->console) + 1 - $this->curPass) . " [" . strftime( + "%H:%M:%S", + time() + ) . "] " . " |--- Returns:
    " . $this->LogClean($string) . "
    "; + } + } + + // Log pass + public function LogPass() + { + $this->console[] = "
    Pass " . $this->curPass . "
    "; + } + + // Log pass + + /** + * @param $string + */ + public function LogSource($string) + { + $this->console[] = "
    Source:
    " . $this->LogClean($string); + } + + // Returns the specified field from the user record + // positive userid = manager, negative integer = webuser + + /** + * @param $userid + * @param $field + * @return mixed + */ + public function ModUser($userid, $field) + { + if (!array_key_exists($userid, $this->cache["ui"])) { + if (intval($userid) < 0) { + $user = $this->modx->getWebUserInfo(-($userid)); + } else { + $user = $this->modx->getUserInfo($userid); + } + $this->cache["ui"][$userid] = $user; + } else { + $user = $this->cache["ui"][$userid]; + } + + return $user[$field]; + } + + // Returns true if the user id is in one the specified webgroups + + /** + * @param int $userid + * @param array $groupNames + * @return bool + */ + public function isMemberOfWebGroupByUserId($userid = 0, $groupNames = []) + { + $userid = (int)$userid; + // if $groupNames is not an array return false + if (!is_array($groupNames)) { + return false; + } + + // if the user id is a negative number make it positive + if (intval($userid) < 0) { + $userid = -($userid); + } + + // Creates an array with all webgroups the user id is in + if (!array_key_exists($userid, $this->cache["mo"])) { + $tbl = $this->modx->getDatabase()->getFullTableName("webgroup_names"); + $tbl2 = $this->modx->getDatabase()->getFullTableName("web_groups"); + $sql = "SELECT `wgn`.`name` FROM {$tbl} `wgn` INNER JOIN {$tbl2} `wg` ON `wg`.`webgroup`=`wgn`.`id` AND `wg`.`webuser`={$userid}"; + $this->cache["mo"][$userid] = $grpNames = $this->modx->getDatabase()->getColumn("name", $sql); + } else { + $grpNames = $this->cache["mo"][$userid]; + } + // Check if a supplied group matches a webgroup from the array we just created + foreach ($groupNames as $k => $v) { + if (in_array(trim($v), $grpNames)) { + return true; + } + } + + // If we get here the above logic did not find a match, so return false + return false; + } + + // Returns the value of a PHx/MODx placeholder. + + /** + * @param $name + * @return mixed|string + */ + public function getPHxVariable($name) + { + // Check if this variable is created by PHx + if (array_key_exists($name, $this->placeholders)) { + // Return the value from PHx + return $this->placeholders[$name]; + } else { + // Return the value from MODx + return $this->modx->getPlaceholder($name); + } + } + + // Sets a placeholder variable which can only be access by PHx + + /** + * @param $name + * @param $value + */ + public function setPHxVariable($name, $value) + { + if ($name != "phx") { + $this->placeholders[$name] = $value; + } + } + + //mbstring + + /** + * @param $str + * @param $s + * @param null $l + * @return string + */ + public function substr($str, $s, $l = null) + { + if (function_exists('mb_substr')) { + return mb_substr($str, $s, $l); + } + + return substr($str, $s, $l); + } + + /** + * @param $str + * @return int + */ + public function strlen($str) + { + if (function_exists('mb_strlen')) { + return mb_strlen($str); + } + + return strlen($str); + } + + /** + * @param $str + * @return string + */ + public function strtolower($str) + { + if (function_exists('mb_strtolower')) { + return mb_strtolower($str); + } + + return strtolower($str); + } + + /** + * @param $str + * @return string + */ + public function strtoupper($str) + { + if (function_exists('mb_strtoupper')) { + return mb_strtoupper($str); + } + + return strtoupper($str); + } + + /** + * @param $str + * @return string + */ + public function ucfirst($str) + { + if (function_exists('mb_strtoupper') && function_exists('mb_substr') && function_exists('mb_strlen')) { + return mb_strtoupper(mb_substr($str, 0, 1)) . mb_substr($str, 1, mb_strlen($str)); + } + + return ucfirst($str); + } + + /** + * @param $str + * @return string + */ + public function lcfirst($str) + { + if (function_exists('mb_strtolower') && function_exists('mb_substr') && function_exists('mb_strlen')) { + return mb_strtolower(mb_substr($str, 0, 1)) . mb_substr($str, 1, mb_strlen($str)); + } + + return lcfirst($str); + } + + /** + * @param $str + * @return string + */ + public function ucwords($str) + { + if (function_exists('mb_convert_case')) { + return mb_convert_case($str, MB_CASE_TITLE); + } + + return ucwords($str); + } + + /** + * @param $str + * @return string + */ + public function strrev($str) + { + preg_match_all('/./us', $str, $ar); + + return implode(array_reverse($ar[0])); + } + + /** + * @param $str + * @return string + */ + public function str_shuffle($str) + { + preg_match_all('/./us', $str, $ar); + shuffle($ar[0]); + + return implode($ar[0]); + } + + /** + * @param $str + * @return int + */ + public function str_word_count($str) + { + return count(preg_split('~[^\p{L}\p{N}\']+~u', $str)); + } +} diff --git a/core/src/Observers/SiteContentObserver.php b/core/src/Observers/SiteContentObserver.php index cdaecb1543..94b7f6ee3d 100644 --- a/core/src/Observers/SiteContentObserver.php +++ b/core/src/Observers/SiteContentObserver.php @@ -1,14 +1,14 @@ -editedby = evo()->getLoginUserID('mgr'); - $model->pagetitle = trim($model->pagetitle); - - return !empty($model->pagetitle); - } -} +editedby = evo()->getLoginUserID('mgr'); + $model->pagetitle = trim($model->pagetitle); + + return !empty($model->pagetitle); + } +} diff --git a/core/src/Parser.php b/core/src/Parser.php index 58bdbffb07..e687211c0c 100644 --- a/core/src/Parser.php +++ b/core/src/Parser.php @@ -1,572 +1,572 @@ -modx = $modx; - $this->loadBlade(); - } - - /** - * prevent the instance from being cloned - * - * @return void - */ - private function __clone () - { - } - - /** - * prevent from being unserialized - * - * @return void - */ - public function __wakeup () - { - } - - /** - * @return string - */ - public function getTemplatePath () - { - return $this->templatePath; - } - - /** - * Sets the relative path to the templates folder - * - * @param string $path - * @param bool $supRoot - * @return $this - */ - public function setTemplatePath ($path, $supRoot = false) - { - $path = trim($path); - if ($supRoot === false) { - $path = $this->cleanPath($path); - } - - if (!empty($path)) { - $this->templatePath = $path; - if ($this->blade) { - $filesystem = new Filesystem; - $viewFinder = new FileViewFinder($filesystem, [EVO_BASE_PATH . $path]); - $this->blade->setFinder($viewFinder); - } - } - - return $this; - } - - /** - * @param string $path - * @return string - */ - protected function cleanPath ($path) - { - return preg_replace(['/\.*[\/|\\\]/i', '/[\/|\\\]+/i'], ['/', '/'], $path); - } - - public function getTemplateExtension () - { - return $this->templateExtension; - } - - /** - * Sets the template file extension - * - * @param $ext - * @return $this - */ - public function setTemplateExtension ($ext) - { - $ext = $this->cleanPath(trim($ext, ". \t\n\r\0\x0B")); - - if (!empty($ext)) { - $this->templateExtension = $ext; - } - - return $this; - } - - /** - * Additional data for external templates - * - * @param array $data - * @return $this - */ - public function setTemplateData ($data = []) - { - if (is_array($data)) { - $this->templateData = $data; - } - - return $this; - } - - /** - * @param array $data - * @return array - */ - public function getTemplateData ($data = []) - { - $plh = array_merge($this->modx->getDataForView(), $this->templateData); - $plh['data'] = $data; - $plh['modx'] = $this->modx; - - return $plh; - } - - /** - * Stores data in the placeholders array - * - * @param mixed $data data - * @param int $set whether to set the global Evolution CMS placeholder as well - * @param string $key local placeholder key - * @param string $prefix prefix for the array keys - * @return string - */ - public function toPlaceholders ($data, $set = 0, $key = 'contentPlaceholder', $prefix = '') - { - $out = ''; - if ($set != 0) { - $this->modx->toPlaceholder($key, $data, $prefix); - } else { - $out = $data; - } - - return $out; - } - - /** - * refactor $modx->getChunk(); - * - * @param string $name Template: chunk name || @CODE: template || @FILE: file with template - * @return string html template with placeholders without data - */ - public function getChunk ($name) - { - $tpl = ''; - $ext = null; - $this->bladeEnabled = substr($name, 0, 3) == '@B_';//(0 === strpos($name, '@B_')); - if ($name != '' && !isset($this->modx->chunkCache[$name])) { - $mode = (preg_match( - '/^((@[A-Z_]+)[:]{0,1})(.*)/Asu', - trim($name), - $tmp - ) && isset($tmp[2], $tmp[3])) ? $tmp[2] : false; - $subTmp = (isset($tmp[3])) ? trim($tmp[3]) : null; - if ($this->bladeEnabled) { - $ext = $this->getTemplateExtension(); - $this->setTemplateExtension('blade.php'); - } - switch ($mode) { - case '@T_CODE': - case '@T_FILE': - break; - case '@B_FILE': - if ($subTmp != '' && $this->bladeEnabled) { - $tpl = $this->blade->make($this->cleanPath($subTmp)); - } - break; - case '@B_CODE': - $cache = md5($name) . '-' . sha1($subTmp); - $filesystem = $this->modx['filesystem']->drive('storage'); - if (!$filesystem->exists('blade/' . $cache . '.blade.php')) { - $filesystem->put('blade/' . $cache . '.blade.php', $subTmp); - } - $this->blade->addNamespace('cache', $filesystem->path('blade/')); - $tpl = $this->blade->make('cache::' . $cache); - break; - case '@FILE': - if ($subTmp != '') { - $real = realpath(EVO_BASE_PATH . $this->templatePath); - $path = realpath(EVO_BASE_PATH . $this->templatePath . $this->cleanPath($subTmp) . '.' . $this->templateExtension); - if (basename($path, '.' . $this->templateExtension) !== '' && - 0 === strpos($path, $real) && - file_exists($path) - ) { - $tpl = file_get_contents($path); - } - } - break; - case '@INLINE': - case '@TPL': - case '@CODE': - $tpl = $tmp[3]; //without trim - break; - case '@DOCUMENT': - case '@DOC': - switch (true) { - case ((int)$subTmp > 0): - $tpl = $this->modx->getPageInfo((int)$subTmp, 0, "content"); - $tpl = isset($tpl['content']) ? $tpl['content'] : ''; - break; - case ((int)$subTmp == 0): - $tpl = $this->modx->documentObject['content']; - break; - } - break; - case '@PLH': - case '@PLACEHOLDER': - if ($subTmp != '') { - $tpl = $this->modx->getPlaceholder($subTmp); - } - break; - case '@CFG': - case '@CONFIG': - case '@OPTIONS': - if ($subTmp != '') { - $tpl = $this->modx->getConfig($subTmp); - } - break; - case '@SNIPPET': - if ($subTmp != '') { - $tpl = $this->modx->runSnippet($subTmp, $this->modx->event->params); - } - break; - case '@RENDERPAGE': - $tpl = $this->renderDoc($subTmp, false); - break; - case '@LOADPAGE': - $tpl = $this->renderDoc($subTmp, true); - break; - case '@TEMPLATE': - $tpl = $this->getTemplate($subTmp); - break; - case '@CHUNK': - $tpl = $this->getBaseChunk($subTmp); - break; - default: - $tpl = $this->getBaseChunk($name); - } - $this->modx->chunkCache[$name] = $tpl; - } else { - $tpl = $this->getBaseChunk($name); - } - - if ($ext !== null) { - $this->setTemplateExtension($ext); - } - - return $tpl; - } - - /** - * @param string $name - * @return null|string - * - * @deprecated since 3.5.8 reading a chunk's code out of the database; the - * snippet column is only resolve()'s fallback for a chunk with no file - * @todo [remove@3.7] Remove in Evolution CMS 3.7 - */ - public function getBaseChunk ($name) - { - if (empty($name)) { - return null; - } - - if (array_key_exists($name, $this->modx->chunkCache)) { - $tpl = $this->modx->chunkCache[$name]; - } else { - /** @var \Illuminate\Database\Eloquent\Collection $chunk */ - $chunk = Models\SiteHtmlsnippet::where('name', '=', $name) - ->where('disabled', '=', 0) - ->get(); - - $row = $chunk->count() === 1 ? $chunk->first() : null; - $tpl = $row === null - ? null - : ChunkFileStore::make()->resolve((string) $row->name, $row->snippet); - $this->modx->chunkCache[$name] = $tpl; - } - - return $tpl; - } - - /** - * Renders a document, substituting placeholders and executing snippets - * - * @param int $id document ID - * @param bool $events whether to fire the OnLoadWebDocument and OnLoadDocumentObject events (inside getDocumentObject) while rendering - * @param mixed $tpl template to render the document with. Possible values: - * null - use the template assigned to the document - * int(0-n) - load the template with this ID from the database and apply it - * string - apply the template given in the string - * @return string - * - * The OnLoadWebDocument event additionally receives: - * - the source the event was fired from - * - the original Core instance - */ - public function renderDoc ($id, $events = false, $tpl = null) - { - $id = (int)$id; - if ($id <= 0) { - return ''; - } - - $m = clone $this->modx; // so that events can be fired - $m->documentIdentifier = $id; - $m->documentObject = $m->getDocumentObject('id', (int)$id, $events ? 'prepareResponse' : null); - if ($m->documentObject['type'] === 'reference') { - if (is_numeric($m->documentObject['content']) && $m->documentObject['content'] > 0) { - $m->documentObject['content'] = $this->renderDoc($m->documentObject['content'], $events); - } - } - switch (true) { - case is_integer($tpl): - $tpl = $this->getTemplate($tpl); - break; - case is_string($tpl): - break; - case $tpl === null: - default: - $tpl = $this->getTemplate($m->documentObject['template']); - } - $m->documentContent = $tpl; - if ($events) { - $m->invokeEvent("OnLoadWebDocument", [ - 'source' => 'DLTemplate', - 'mainModx' => $this->modx, - ]); - } - - return $this->parseDocumentSource($m->documentContent, $m); - } - - /** - * Returns the content of the template with the given ID - * @param int $id template ID - * @return string template HTML - */ - public function getTemplate ($id) - { - $tpl = null; - $id = (int)$id; - if ($id > 0) { - $tpl = $this->modx->db->getValue( - 'SELECT `content` FROM '.$this->modx->getFullTableName('site_templates').' WHERE `id` = '.$id - ); - } - if ($tpl === null) { - $tpl = '[*content*]'; - } - - return $tpl; - } - - /** - * refactor $modx->parseChunk(); - * - * @param string $name Template: chunk name || @CODE: template || @FILE: file with template - * @param array $data paceholder - * @param bool $parseDocumentSource render html template via Core::parseDocumentSource() - * @return string html template with data without placeholders - */ - public function parseChunk ($name, $data = [], $parseDocumentSource = false, $disablePHx = false) - { - $out = $this->getChunk($name); - $blade = strpos($name, '@B_') === 0 && $this->bladeEnabled; - switch (true) { - case $blade: - if (!empty($out)) { - $out = $out->with($this->getTemplateData($data))->render(); - } - break; - case is_array($data) && ($out != ''): - if (preg_match("/\[\+[A-Z0-9\.\_\-]+\+\]/is", $out)) { - $item = $this->renameKeyArr($data, '[', ']', '+'); - $out = str_replace(array_keys($item), array_values($item), $out); - } - if (!$disablePHx && preg_match("/:([^:=]+)(?:=`(.*?)`(?=:[^:=]+|$))?/is", $out)) { - if (is_null($this->phx) || !($this->phx instanceof Phx)) { - $this->phx = $this->createPHx(0, 1000); - } - $this->phx->placeholders = []; - $this->setPHxPlaceholders($data); - $out = $this->phx->Parse($out); - } - break; - } - if ($parseDocumentSource && !$blade) { - $out = $this->parseDocumentSource($out); - } - - return $out; - } - - /** - * - * @param string|array $value - * @param string $key - * @param string $path - */ - public function setPHxPlaceholders ($value = '', $key = '', $path = '') - { - $keypath = !empty($path) ? $path . "." . $key : $key; - $this->phx->curPass = 0; - if (is_array($value)) { - foreach ($value as $subkey => $subval) { - $this->setPHxPlaceholders($subval, $subkey, $keypath); - } - } else { - $this->phx->setPHxVariable($keypath, $value); - } - } - - /** - * - */ - protected function loadBlade () - { - try { - $this->blade = clone $this->modx['view']; - } catch (\Exception $exception) { - $this->modx->messageQuit($exception->getMessage()); - } - } - - /** - * - * @param string $string - * @return string - */ - public function cleanPHx ($string) - { - preg_match_all('~\[(\+|\*|\()([^:\+\[\]]+)([^\[\]]*?)(\1|\))\]~s', $string, $matches); - if ($matches[0]) { - $string = str_replace($matches[0], '', $string); - } - - return $string; - } - - /** - * @param int $debug - * @param int $maxpass - * @return Phx - */ - public function createPHx ($debug = 0, $maxpass = 50) - { - return new Phx($this->modx, $debug, $maxpass); - } - - /** - * Renames array keys - * - * @param array $data source array - * @param string $prefix key prefix - * @param string $suffix key suffix - * @param string $sep separator between prefix, key and suffix - * @return array array with renamed keys - */ - public function renameKeyArr ($data, $prefix = '', $suffix = '', $sep = '.') - { - return rename_key_arr($data, $prefix, $suffix, $sep); - } - - /** - * @param $out - * @param Core|null $modx - * @return mixed|string - */ - public function parseDocumentSource ($out, $modx = null) - { - if (!is_object($modx)) { - $modx = $this->modx; - } - $minParserPasses = $modx->minParserPasses; - $maxParserPasses = $modx->maxParserPasses; - - $modx->minParserPasses = 2; - $modx->maxParserPasses = 10; - - $site_status = $modx->getConfig('site_status'); - $modx->config['site_status'] = 0; - - for ($i = 1; $i <= $modx->maxParserPasses; $i++) { - $html = $out; - if (preg_match('/\[\!(.*)\!\]/us', $out)) { - $out = str_replace(['[!', '!]'], ['[[', ']]'], $out); - } - if ($i <= $modx->minParserPasses || $out != $html) { - $out = $modx->parseDocumentSource($out); - } else { - break; - } - } - - $out = $modx->rewriteUrls($out); - $out = $this->cleanPHx($out); - - $modx->config['site_status'] = $site_status; - - $modx->minParserPasses = $minParserPasses; - $modx->maxParserPasses = $maxParserPasses; - - return $out; - } -} +modx = $modx; + $this->loadBlade(); + } + + /** + * prevent the instance from being cloned + * + * @return void + */ + private function __clone () + { + } + + /** + * prevent from being unserialized + * + * @return void + */ + public function __wakeup () + { + } + + /** + * @return string + */ + public function getTemplatePath () + { + return $this->templatePath; + } + + /** + * Sets the relative path to the templates folder + * + * @param string $path + * @param bool $supRoot + * @return $this + */ + public function setTemplatePath ($path, $supRoot = false) + { + $path = trim($path); + if ($supRoot === false) { + $path = $this->cleanPath($path); + } + + if (!empty($path)) { + $this->templatePath = $path; + if ($this->blade) { + $filesystem = new Filesystem; + $viewFinder = new FileViewFinder($filesystem, [EVO_BASE_PATH . $path]); + $this->blade->setFinder($viewFinder); + } + } + + return $this; + } + + /** + * @param string $path + * @return string + */ + protected function cleanPath ($path) + { + return preg_replace(['/\.*[\/|\\\]/i', '/[\/|\\\]+/i'], ['/', '/'], $path); + } + + public function getTemplateExtension () + { + return $this->templateExtension; + } + + /** + * Sets the template file extension + * + * @param $ext + * @return $this + */ + public function setTemplateExtension ($ext) + { + $ext = $this->cleanPath(trim($ext, ". \t\n\r\0\x0B")); + + if (!empty($ext)) { + $this->templateExtension = $ext; + } + + return $this; + } + + /** + * Additional data for external templates + * + * @param array $data + * @return $this + */ + public function setTemplateData ($data = []) + { + if (is_array($data)) { + $this->templateData = $data; + } + + return $this; + } + + /** + * @param array $data + * @return array + */ + public function getTemplateData ($data = []) + { + $plh = array_merge($this->modx->getDataForView(), $this->templateData); + $plh['data'] = $data; + $plh['modx'] = $this->modx; + + return $plh; + } + + /** + * Stores data in the placeholders array + * + * @param mixed $data data + * @param int $set whether to set the global Evolution CMS placeholder as well + * @param string $key local placeholder key + * @param string $prefix prefix for the array keys + * @return string + */ + public function toPlaceholders ($data, $set = 0, $key = 'contentPlaceholder', $prefix = '') + { + $out = ''; + if ($set != 0) { + $this->modx->toPlaceholder($key, $data, $prefix); + } else { + $out = $data; + } + + return $out; + } + + /** + * refactor $modx->getChunk(); + * + * @param string $name Template: chunk name || @CODE: template || @FILE: file with template + * @return string html template with placeholders without data + */ + public function getChunk ($name) + { + $tpl = ''; + $ext = null; + $this->bladeEnabled = substr($name, 0, 3) == '@B_';//(0 === strpos($name, '@B_')); + if ($name != '' && !isset($this->modx->chunkCache[$name])) { + $mode = (preg_match( + '/^((@[A-Z_]+)[:]{0,1})(.*)/Asu', + trim($name), + $tmp + ) && isset($tmp[2], $tmp[3])) ? $tmp[2] : false; + $subTmp = (isset($tmp[3])) ? trim($tmp[3]) : null; + if ($this->bladeEnabled) { + $ext = $this->getTemplateExtension(); + $this->setTemplateExtension('blade.php'); + } + switch ($mode) { + case '@T_CODE': + case '@T_FILE': + break; + case '@B_FILE': + if ($subTmp != '' && $this->bladeEnabled) { + $tpl = $this->blade->make($this->cleanPath($subTmp)); + } + break; + case '@B_CODE': + $cache = md5($name) . '-' . sha1($subTmp); + $filesystem = $this->modx['filesystem']->drive('storage'); + if (!$filesystem->exists('blade/' . $cache . '.blade.php')) { + $filesystem->put('blade/' . $cache . '.blade.php', $subTmp); + } + $this->blade->addNamespace('cache', $filesystem->path('blade/')); + $tpl = $this->blade->make('cache::' . $cache); + break; + case '@FILE': + if ($subTmp != '') { + $real = realpath(EVO_BASE_PATH . $this->templatePath); + $path = realpath(EVO_BASE_PATH . $this->templatePath . $this->cleanPath($subTmp) . '.' . $this->templateExtension); + if (basename($path, '.' . $this->templateExtension) !== '' && + 0 === strpos($path, $real) && + file_exists($path) + ) { + $tpl = file_get_contents($path); + } + } + break; + case '@INLINE': + case '@TPL': + case '@CODE': + $tpl = $tmp[3]; //without trim + break; + case '@DOCUMENT': + case '@DOC': + switch (true) { + case ((int)$subTmp > 0): + $tpl = $this->modx->getPageInfo((int)$subTmp, 0, "content"); + $tpl = isset($tpl['content']) ? $tpl['content'] : ''; + break; + case ((int)$subTmp == 0): + $tpl = $this->modx->documentObject['content']; + break; + } + break; + case '@PLH': + case '@PLACEHOLDER': + if ($subTmp != '') { + $tpl = $this->modx->getPlaceholder($subTmp); + } + break; + case '@CFG': + case '@CONFIG': + case '@OPTIONS': + if ($subTmp != '') { + $tpl = $this->modx->getConfig($subTmp); + } + break; + case '@SNIPPET': + if ($subTmp != '') { + $tpl = $this->modx->runSnippet($subTmp, $this->modx->event->params); + } + break; + case '@RENDERPAGE': + $tpl = $this->renderDoc($subTmp, false); + break; + case '@LOADPAGE': + $tpl = $this->renderDoc($subTmp, true); + break; + case '@TEMPLATE': + $tpl = $this->getTemplate($subTmp); + break; + case '@CHUNK': + $tpl = $this->getBaseChunk($subTmp); + break; + default: + $tpl = $this->getBaseChunk($name); + } + $this->modx->chunkCache[$name] = $tpl; + } else { + $tpl = $this->getBaseChunk($name); + } + + if ($ext !== null) { + $this->setTemplateExtension($ext); + } + + return $tpl; + } + + /** + * @param string $name + * @return null|string + * + * @deprecated since 3.5.8 reading a chunk's code out of the database; the + * snippet column is only resolve()'s fallback for a chunk with no file + * @todo [remove@3.7] Remove in Evolution CMS 3.7 + */ + public function getBaseChunk ($name) + { + if (empty($name)) { + return null; + } + + if (array_key_exists($name, $this->modx->chunkCache)) { + $tpl = $this->modx->chunkCache[$name]; + } else { + /** @var \Illuminate\Database\Eloquent\Collection $chunk */ + $chunk = Models\SiteHtmlsnippet::where('name', '=', $name) + ->where('disabled', '=', 0) + ->get(); + + $row = $chunk->count() === 1 ? $chunk->first() : null; + $tpl = $row === null + ? null + : ChunkFileStore::make()->resolve((string) $row->name, $row->snippet); + $this->modx->chunkCache[$name] = $tpl; + } + + return $tpl; + } + + /** + * Renders a document, substituting placeholders and executing snippets + * + * @param int $id document ID + * @param bool $events whether to fire the OnLoadWebDocument and OnLoadDocumentObject events (inside getDocumentObject) while rendering + * @param mixed $tpl template to render the document with. Possible values: + * null - use the template assigned to the document + * int(0-n) - load the template with this ID from the database and apply it + * string - apply the template given in the string + * @return string + * + * The OnLoadWebDocument event additionally receives: + * - the source the event was fired from + * - the original Core instance + */ + public function renderDoc ($id, $events = false, $tpl = null) + { + $id = (int)$id; + if ($id <= 0) { + return ''; + } + + $m = clone $this->modx; // so that events can be fired + $m->documentIdentifier = $id; + $m->documentObject = $m->getDocumentObject('id', (int)$id, $events ? 'prepareResponse' : null); + if ($m->documentObject['type'] === 'reference') { + if (is_numeric($m->documentObject['content']) && $m->documentObject['content'] > 0) { + $m->documentObject['content'] = $this->renderDoc($m->documentObject['content'], $events); + } + } + switch (true) { + case is_integer($tpl): + $tpl = $this->getTemplate($tpl); + break; + case is_string($tpl): + break; + case $tpl === null: + default: + $tpl = $this->getTemplate($m->documentObject['template']); + } + $m->documentContent = $tpl; + if ($events) { + $m->invokeEvent("OnLoadWebDocument", [ + 'source' => 'DLTemplate', + 'mainModx' => $this->modx, + ]); + } + + return $this->parseDocumentSource($m->documentContent, $m); + } + + /** + * Returns the content of the template with the given ID + * @param int $id template ID + * @return string template HTML + */ + public function getTemplate ($id) + { + $tpl = null; + $id = (int)$id; + if ($id > 0) { + $tpl = $this->modx->db->getValue( + 'SELECT `content` FROM '.$this->modx->getFullTableName('site_templates').' WHERE `id` = '.$id + ); + } + if ($tpl === null) { + $tpl = '[*content*]'; + } + + return $tpl; + } + + /** + * refactor $modx->parseChunk(); + * + * @param string $name Template: chunk name || @CODE: template || @FILE: file with template + * @param array $data paceholder + * @param bool $parseDocumentSource render html template via Core::parseDocumentSource() + * @return string html template with data without placeholders + */ + public function parseChunk ($name, $data = [], $parseDocumentSource = false, $disablePHx = false) + { + $out = $this->getChunk($name); + $blade = strpos($name, '@B_') === 0 && $this->bladeEnabled; + switch (true) { + case $blade: + if (!empty($out)) { + $out = $out->with($this->getTemplateData($data))->render(); + } + break; + case is_array($data) && ($out != ''): + if (preg_match("/\[\+[A-Z0-9\.\_\-]+\+\]/is", $out)) { + $item = $this->renameKeyArr($data, '[', ']', '+'); + $out = str_replace(array_keys($item), array_values($item), $out); + } + if (!$disablePHx && preg_match("/:([^:=]+)(?:=`(.*?)`(?=:[^:=]+|$))?/is", $out)) { + if (is_null($this->phx) || !($this->phx instanceof Phx)) { + $this->phx = $this->createPHx(0, 1000); + } + $this->phx->placeholders = []; + $this->setPHxPlaceholders($data); + $out = $this->phx->Parse($out); + } + break; + } + if ($parseDocumentSource && !$blade) { + $out = $this->parseDocumentSource($out); + } + + return $out; + } + + /** + * + * @param string|array $value + * @param string $key + * @param string $path + */ + public function setPHxPlaceholders ($value = '', $key = '', $path = '') + { + $keypath = !empty($path) ? $path . "." . $key : $key; + $this->phx->curPass = 0; + if (is_array($value)) { + foreach ($value as $subkey => $subval) { + $this->setPHxPlaceholders($subval, $subkey, $keypath); + } + } else { + $this->phx->setPHxVariable($keypath, $value); + } + } + + /** + * + */ + protected function loadBlade () + { + try { + $this->blade = clone $this->modx['view']; + } catch (\Exception $exception) { + $this->modx->messageQuit($exception->getMessage()); + } + } + + /** + * + * @param string $string + * @return string + */ + public function cleanPHx ($string) + { + preg_match_all('~\[(\+|\*|\()([^:\+\[\]]+)([^\[\]]*?)(\1|\))\]~s', $string, $matches); + if ($matches[0]) { + $string = str_replace($matches[0], '', $string); + } + + return $string; + } + + /** + * @param int $debug + * @param int $maxpass + * @return Phx + */ + public function createPHx ($debug = 0, $maxpass = 50) + { + return new Phx($this->modx, $debug, $maxpass); + } + + /** + * Renames array keys + * + * @param array $data source array + * @param string $prefix key prefix + * @param string $suffix key suffix + * @param string $sep separator between prefix, key and suffix + * @return array array with renamed keys + */ + public function renameKeyArr ($data, $prefix = '', $suffix = '', $sep = '.') + { + return rename_key_arr($data, $prefix, $suffix, $sep); + } + + /** + * @param $out + * @param Core|null $modx + * @return mixed|string + */ + public function parseDocumentSource ($out, $modx = null) + { + if (!is_object($modx)) { + $modx = $this->modx; + } + $minParserPasses = $modx->minParserPasses; + $maxParserPasses = $modx->maxParserPasses; + + $modx->minParserPasses = 2; + $modx->maxParserPasses = 10; + + $site_status = $modx->getConfig('site_status'); + $modx->config['site_status'] = 0; + + for ($i = 1; $i <= $modx->maxParserPasses; $i++) { + $html = $out; + if (preg_match('/\[\!(.*)\!\]/us', $out)) { + $out = str_replace(['[!', '!]'], ['[[', ']]'], $out); + } + if ($i <= $modx->minParserPasses || $out != $html) { + $out = $modx->parseDocumentSource($out); + } else { + break; + } + } + + $out = $modx->rewriteUrls($out); + $out = $this->cleanPHx($out); + + $modx->config['site_status'] = $site_status; + + $modx->minParserPasses = $minParserPasses; + $modx->maxParserPasses = $maxParserPasses; + + return $out; + } +} diff --git a/core/src/Providers/BladeServiceProvider.php b/core/src/Providers/BladeServiceProvider.php index 3de98bfcaa..9ffebad782 100644 --- a/core/src/Providers/BladeServiceProvider.php +++ b/core/src/Providers/BladeServiceProvider.php @@ -1,67 +1,67 @@ -getConfig($expression)); ?>"; - }); - - Blade::directive('makeUrl', function ($expression) { - $expression = $expression ?: "''"; - return "makeUrlWithString($expression)); ?>"; - }); - - /** - * Render a public file URL with an mtime-based cache revision. - * - * @since 3.5.8 - */ - Blade::directive('revision', function ($expression) { - $expression = $expression ?: "''"; - return ""; - }); - - Blade::directive('evoParser', function ($expression) { - $expression = $expression ?: "''"; - return ""; - }); - - Blade::directive('evoRole', function ($expression) { - $expression = $expression ?: "''"; - return ""; - }); - - Blade::directive('evoElseRole', function ($expression) { - $expression = $expression ?: "''"; - return ""; - }); - - Blade::directive('evoEndRole', function () { - return ""; - }); - - Blade::if('auth', fn () => evo()->getLoginUserID() !== false); - Blade::if('guest', fn () => evo()->getLoginUserID() === false); - - /** - * @deprecated - * @since 3.5.3 - * - * It's not using anywhere. - * - * @todo [remove@3.7] Remove in Evolution CMS 3.7 - */ - $directives = $this->app['config']->get('view.directive'); - if (\is_array($directives)) { - foreach ($directives as $name => $callback) { - $this->app->get('blade.compiler')->directive($name, $callback); - } - } - } -} +getConfig($expression)); ?>"; + }); + + Blade::directive('makeUrl', function ($expression) { + $expression = $expression ?: "''"; + return "makeUrlWithString($expression)); ?>"; + }); + + /** + * Render a public file URL with an mtime-based cache revision. + * + * @since 3.5.8 + */ + Blade::directive('revision', function ($expression) { + $expression = $expression ?: "''"; + return ""; + }); + + Blade::directive('evoParser', function ($expression) { + $expression = $expression ?: "''"; + return ""; + }); + + Blade::directive('evoRole', function ($expression) { + $expression = $expression ?: "''"; + return ""; + }); + + Blade::directive('evoElseRole', function ($expression) { + $expression = $expression ?: "''"; + return ""; + }); + + Blade::directive('evoEndRole', function () { + return ""; + }); + + Blade::if('auth', fn () => evo()->getLoginUserID() !== false); + Blade::if('guest', fn () => evo()->getLoginUserID() === false); + + /** + * @deprecated + * @since 3.5.3 + * + * It's not using anywhere. + * + * @todo [remove@3.7] Remove in Evolution CMS 3.7 + */ + $directives = $this->app['config']->get('view.directive'); + if (\is_array($directives)) { + foreach ($directives as $name => $callback) { + $this->app->get('blade.compiler')->directive($name, $callback); + } + } + } +} diff --git a/core/src/Providers/ComposerServiceProvider.php b/core/src/Providers/ComposerServiceProvider.php index 22a3546959..6086ea6c38 100644 --- a/core/src/Providers/ComposerServiceProvider.php +++ b/core/src/Providers/ComposerServiceProvider.php @@ -1,37 +1,37 @@ -app->singleton('composer', function ($app) { - return new Composer($app['files'], $app->basePath()); - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return ['composer']; - } -} - +app->singleton('composer', function ($app) { + return new Composer($app['files'], $app->basePath()); + }); + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return ['composer']; + } +} + diff --git a/core/src/Providers/ObserversServiceProvider.php b/core/src/Providers/ObserversServiceProvider.php index 1fe1fbda16..cb85ce5027 100644 --- a/core/src/Providers/ObserversServiceProvider.php +++ b/core/src/Providers/ObserversServiceProvider.php @@ -1,20 +1,20 @@ -app['config']->get('cms.observers'); - - foreach ($observers as $model => $observer) { - $model::observe($observer); - } - } -} +app['config']->get('cms.observers'); + + foreach ($observers as $model => $observer) { + $model::observe($observer); + } + } +} diff --git a/core/src/Providers/PaginationServiceProvider.php b/core/src/Providers/PaginationServiceProvider.php index bd0d26e7d5..fa28bab46d 100644 --- a/core/src/Providers/PaginationServiceProvider.php +++ b/core/src/Providers/PaginationServiceProvider.php @@ -1,35 +1,35 @@ -app['view']; - }); - - Paginator::currentPathResolver(function () { - return parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); - }); - - Paginator::currentPageResolver(function ($pageName = 'page') { - $page = get_by_key($_REQUEST, $pageName, 1, 'is_scalar'); - - if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) { - return (int) $page; - } - - return 1; - }); - } -} +app['view']; + }); + + Paginator::currentPathResolver(function () { + return parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); + }); + + Paginator::currentPageResolver(function ($pageName = 'page') { + $page = get_by_key($_REQUEST, $pageName, 1, 'is_scalar'); + + if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) { + return (int) $page; + } + + return 1; + }); + } +} diff --git a/install/assets/modules/store.tpl b/install/assets/modules/store.tpl index c6d510405d..4b53a13581 100644 --- a/install/assets/modules/store.tpl +++ b/install/assets/modules/store.tpl @@ -1,19 +1,19 @@ -// - - - -js_output)) : ?> - - - -

    - get('name') ?> -

    - - - renderView('chunks/db_setup') ?> - - -
    - -
    renderView('chunks/messages', $view->getMessages('global')) ?>
    - -
    - - -
    -

    txt('cm_add_new_category') ?>

    - -
    - renderView('chunks/messages', $view->getMessages('add')) ?> - renderView('add') ?> -
    -
    - - - -
    -

    txt('cm_edit_categories') ?>

    - -
    - renderView('chunks/messages', $view->getMessages('edit')) ?> - renderView('edit', $data) ?> -
    -
    - -
    -

    txt('cm_sort_categories') ?>

    - -
    - renderView('chunks/messages', $view->getMessages('sort')) ?> - renderView('sort', $data) ?> -
    -
    - -
    -

    txt('cm_categorize_elements') ?>

    - -
    - renderView('chunks/messages', $view->getMessages('categorize')) ?> - renderView('categorize', $data) ?> -
    -
    - - - - new_translations[$view->get('manager_language')])) : ?> - -
    -

    txt('Translations') ?>

    - -
    - renderView('chunks/messages', $view->getMessages('translate')) ?> - renderView('translate', $view->new_translations[$view->get('manager_language')]) ?> -
    -
    - - - -
    - -
    - - - - - - + + + + +js_output)) : ?> + + + +

    + get('name') ?> +

    + + + renderView('chunks/db_setup') ?> + + +
    + +
    renderView('chunks/messages', $view->getMessages('global')) ?>
    + +
    + + +
    +

    txt('cm_add_new_category') ?>

    + +
    + renderView('chunks/messages', $view->getMessages('add')) ?> + renderView('add') ?> +
    +
    + + + +
    +

    txt('cm_edit_categories') ?>

    + +
    + renderView('chunks/messages', $view->getMessages('edit')) ?> + renderView('edit', $data) ?> +
    +
    + +
    +

    txt('cm_sort_categories') ?>

    + +
    + renderView('chunks/messages', $view->getMessages('sort')) ?> + renderView('sort', $data) ?> +
    +
    + +
    +

    txt('cm_categorize_elements') ?>

    + +
    + renderView('chunks/messages', $view->getMessages('categorize')) ?> + renderView('categorize', $data) ?> +
    +
    + + + + new_translations[$view->get('manager_language')])) : ?> + +
    +

    txt('Translations') ?>

    + +
    + renderView('chunks/messages', $view->getMessages('translate')) ?> + renderView('translate', $view->new_translations[$view->get('manager_language')]) ?> +
    +
    + + + +
    + +
    + + + + + + diff --git a/manager/includes/actionlist.inc.php b/manager/includes/actionlist.inc.php index 74bb666b74..9209a0cad0 100644 --- a/manager/includes/actionlist.inc.php +++ b/manager/includes/actionlist.inc.php @@ -1,6 +1,6 @@ -INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); -} - -$GLOBALS['action_list'] = include EVO_CORE_PATH . 'factory/actionlist.php'; +INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} + +$GLOBALS['action_list'] = include EVO_CORE_PATH . 'factory/actionlist.php'; diff --git a/manager/includes/controls/datagrid.class.php b/manager/includes/controls/datagrid.class.php index 81c02588d9..7ca38971dd 100644 --- a/manager/includes/controls/datagrid.class.php +++ b/manager/includes/controls/datagrid.class.php @@ -1,6 +1,6 @@ -render(); +render(); diff --git a/manager/includes/template.parser.class.inc.php b/manager/includes/template.parser.class.inc.php index 94da5d0bce..93077c20da 100755 --- a/manager/includes/template.parser.class.inc.php +++ b/manager/includes/template.parser.class.inc.php @@ -1,13 +1,13 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/manager/media/browser/mcpuk/browser.php b/manager/media/browser/mcpuk/browser.php index 7ed522bbbf..9bb4163bfc 100755 --- a/manager/media/browser/mcpuk/browser.php +++ b/manager/media/browser/mcpuk/browser.php @@ -1,28 +1,28 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/manager/media/browser/mcpuk/config.php b/manager/media/browser/mcpuk/config.php index d89ccea561..71e328794d 100755 --- a/manager/media/browser/mcpuk/config.php +++ b/manager/media/browser/mcpuk/config.php @@ -1,152 +1,152 @@ - - * @copyright 2010-2014 KCFinder Project - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 - * @link http://kcfinder.sunhater.com - */ - -// IMPORTANT!!! Do not remove uncommented settings in this file even if -// you are using session configuration. -// See http://kcfinder.sunhater.com/install for setting descriptions - -$modx = evolutionCMS(); - -$resolveUploadRoot = static function (string $defaultDir, string $defaultUrl, string $customDir): array { - $defaultDir = rtrim(str_replace('\\', '/', str_replace('[(base_path)]', EVO_BASE_PATH, $defaultDir)), '/'); - $defaultUrl = rtrim(str_replace('\\', '/', $defaultUrl), '/'); - $customDir = trim($customDir); - - if ($customDir === '') { - return [$defaultDir, $defaultUrl]; - } - - $customDir = str_replace('[(base_path)]', EVO_BASE_PATH, $customDir); - $customDir = str_replace('\\', '/', $customDir); - - if (!preg_match('/^(?:[A-Za-z]:[\/\\\\]|\/)/', $customDir)) { - $customDir = $defaultDir . '/' . ltrim($customDir, '/'); - } - - $customDir = rtrim($customDir, '/'); - $resolvedDir = str_replace('\\', '/', realpath($customDir) ?: $customDir); - - if ($defaultDir !== '' && strpos($resolvedDir, $defaultDir) === 0) { - $relativePath = ltrim(substr($resolvedDir, strlen($defaultDir)), '/'); - return [ - $resolvedDir, - $relativePath === '' ? $defaultUrl : $defaultUrl . '/' . $relativePath - ]; - } - - $siteBasePath = rtrim(str_replace('\\', '/', EVO_BASE_PATH), '/'); - $siteBaseUrl = rtrim(str_replace('\\', '/', EVO_BASE_URL), '/'); - if ($siteBasePath !== '' && strpos($resolvedDir, $siteBasePath) === 0) { - $relativePath = ltrim(substr($resolvedDir, strlen($siteBasePath)), '/'); - return [ - $resolvedDir, - $relativePath === '' ? ($siteBaseUrl === '' ? '/' : $siteBaseUrl) : - ($siteBaseUrl === '' ? '' : $siteBaseUrl) . '/' . $relativePath - ]; - } - - return [$defaultDir, $defaultUrl]; -}; - -[$uploadDir, $uploadUrl] = $resolveUploadRoot( - (string) EvolutionCMS()->getConfig('rb_base_dir'), - (string) EvolutionCMS()->getConfig('rb_base_url'), - (string) EvolutionCMS()->getConfig('image_base_upload_dir', '') -); - -$_CONFIG = [ - 'disabled' => false, - 'denyZipDownload' => EvolutionCMS()->getConfig('denyZipDownload'), - 'denyExtensionRename' => EvolutionCMS()->getConfig('denyExtensionRename'), - 'showHiddenFiles' => EvolutionCMS()->getConfig('showHiddenFiles'), - 'theme' => "evo", - 'uploadURL' => $uploadUrl, - 'uploadDir' => $uploadDir, - 'siteURL' => EVO_SITE_URL, - 'assetsURL' => $uploadUrl, - 'dirPerms' => intval(EvolutionCMS()->getConfig('new_folder_permissions'), 8), - 'filePerms' => intval(EvolutionCMS()->getConfig('new_file_permissions'), 8), - 'maxfilesize' => (int)EvolutionCMS()->getConfig('upload_maxsize'), - 'noThumbnailsRecreation' => EvolutionCMS()->getConfig('noThumbnailsRecreation'), - - 'access' => [ - - 'files' => [ - 'upload' => true, - 'delete' => true, - 'copy' => true, - 'move' => true, - 'rename' => true - ], - - 'dirs' => [ - 'create' => true, - 'delete' => true, - 'rename' => true - ] - ], - - 'deniedExts' => "exe com msi bat php phps phtml php3 php4 cgi pl", - - 'types' => [ - - // CKEditor & FCKEditor types - 'files' => str_replace(',', ' ', EvolutionCMS()->getConfig('upload_files')), - 'images' => str_replace(',', ' ', EvolutionCMS()->getConfig('upload_images')), - - // TinyMCE types - 'file' => str_replace(',', ' ', EvolutionCMS()->getConfig('upload_files')), - 'media' => str_replace(',', ' ', EvolutionCMS()->getConfig('upload_media')), - 'image' => str_replace(',', ' ', EvolutionCMS()->getConfig('upload_images')), - ], - 'dirnameChangeChars' => [ - ' ' => "_", - ':' => "." - ], - 'mime_magic' => "", - - 'maxImageWidth' => EvolutionCMS()->getConfig('maxImageWidth'), - 'maxImageHeight' => EvolutionCMS()->getConfig('maxImageHeight'), - 'clientResize' => EvolutionCMS()->getConfig('clientResize') && EvolutionCMS()->getConfig('maxImageWidth') - && EvolutionCMS()->getConfig('maxImageHeight') - ? ['maxWidth' => EvolutionCMS()->getConfig('maxImageWidth'), - 'maxHeight' => EvolutionCMS()->getConfig('maxImageHeight'), - 'quality' => EvolutionCMS()->getConfig('jpegQuality') / 100] - : [], - - 'thumbWidth' => EvolutionCMS()->getConfig('thumbWidth'), - 'thumbHeight' => EvolutionCMS()->getConfig('thumbHeight'), - 'thumbsDir' => EvolutionCMS()->getConfig('thumbsDir'), - - 'jpegQuality' => EvolutionCMS()->getConfig('jpegQuality'), - - 'cookieDomain' => "", - 'cookiePath' => "", - 'cookiePrefix' => 'KCFINDER_', - - // THE FOLLOWING SETTINGS CANNOT BE OVERRIDED WITH SESSION CONFIGURATION - '_check4htaccess' => false, - '_tinyMCEPath' => EVO_BASE_URL . "assets/plugins/tinymce/tiny_mce", - - '_sessionVar' => &$_SESSION['KCFINDER'], - //'_sessionLifetime' => 30, - //'_sessionDir' => "/full/directory/path", - - //'_sessionDomain' => ".mysite.com", - //'_sessionPath' => "/my/path", -]; - -EvolutionCMS()->invokeEvent('OnFileBrowserInit', [ - 'config' => &$_CONFIG, -]); + + * @copyright 2010-2014 KCFinder Project + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 + * @link http://kcfinder.sunhater.com + */ + +// IMPORTANT!!! Do not remove uncommented settings in this file even if +// you are using session configuration. +// See http://kcfinder.sunhater.com/install for setting descriptions + +$modx = evolutionCMS(); + +$resolveUploadRoot = static function (string $defaultDir, string $defaultUrl, string $customDir): array { + $defaultDir = rtrim(str_replace('\\', '/', str_replace('[(base_path)]', EVO_BASE_PATH, $defaultDir)), '/'); + $defaultUrl = rtrim(str_replace('\\', '/', $defaultUrl), '/'); + $customDir = trim($customDir); + + if ($customDir === '') { + return [$defaultDir, $defaultUrl]; + } + + $customDir = str_replace('[(base_path)]', EVO_BASE_PATH, $customDir); + $customDir = str_replace('\\', '/', $customDir); + + if (!preg_match('/^(?:[A-Za-z]:[\/\\\\]|\/)/', $customDir)) { + $customDir = $defaultDir . '/' . ltrim($customDir, '/'); + } + + $customDir = rtrim($customDir, '/'); + $resolvedDir = str_replace('\\', '/', realpath($customDir) ?: $customDir); + + if ($defaultDir !== '' && strpos($resolvedDir, $defaultDir) === 0) { + $relativePath = ltrim(substr($resolvedDir, strlen($defaultDir)), '/'); + return [ + $resolvedDir, + $relativePath === '' ? $defaultUrl : $defaultUrl . '/' . $relativePath + ]; + } + + $siteBasePath = rtrim(str_replace('\\', '/', EVO_BASE_PATH), '/'); + $siteBaseUrl = rtrim(str_replace('\\', '/', EVO_BASE_URL), '/'); + if ($siteBasePath !== '' && strpos($resolvedDir, $siteBasePath) === 0) { + $relativePath = ltrim(substr($resolvedDir, strlen($siteBasePath)), '/'); + return [ + $resolvedDir, + $relativePath === '' ? ($siteBaseUrl === '' ? '/' : $siteBaseUrl) : + ($siteBaseUrl === '' ? '' : $siteBaseUrl) . '/' . $relativePath + ]; + } + + return [$defaultDir, $defaultUrl]; +}; + +[$uploadDir, $uploadUrl] = $resolveUploadRoot( + (string) EvolutionCMS()->getConfig('rb_base_dir'), + (string) EvolutionCMS()->getConfig('rb_base_url'), + (string) EvolutionCMS()->getConfig('image_base_upload_dir', '') +); + +$_CONFIG = [ + 'disabled' => false, + 'denyZipDownload' => EvolutionCMS()->getConfig('denyZipDownload'), + 'denyExtensionRename' => EvolutionCMS()->getConfig('denyExtensionRename'), + 'showHiddenFiles' => EvolutionCMS()->getConfig('showHiddenFiles'), + 'theme' => "evo", + 'uploadURL' => $uploadUrl, + 'uploadDir' => $uploadDir, + 'siteURL' => EVO_SITE_URL, + 'assetsURL' => $uploadUrl, + 'dirPerms' => intval(EvolutionCMS()->getConfig('new_folder_permissions'), 8), + 'filePerms' => intval(EvolutionCMS()->getConfig('new_file_permissions'), 8), + 'maxfilesize' => (int)EvolutionCMS()->getConfig('upload_maxsize'), + 'noThumbnailsRecreation' => EvolutionCMS()->getConfig('noThumbnailsRecreation'), + + 'access' => [ + + 'files' => [ + 'upload' => true, + 'delete' => true, + 'copy' => true, + 'move' => true, + 'rename' => true + ], + + 'dirs' => [ + 'create' => true, + 'delete' => true, + 'rename' => true + ] + ], + + 'deniedExts' => "exe com msi bat php phps phtml php3 php4 cgi pl", + + 'types' => [ + + // CKEditor & FCKEditor types + 'files' => str_replace(',', ' ', EvolutionCMS()->getConfig('upload_files')), + 'images' => str_replace(',', ' ', EvolutionCMS()->getConfig('upload_images')), + + // TinyMCE types + 'file' => str_replace(',', ' ', EvolutionCMS()->getConfig('upload_files')), + 'media' => str_replace(',', ' ', EvolutionCMS()->getConfig('upload_media')), + 'image' => str_replace(',', ' ', EvolutionCMS()->getConfig('upload_images')), + ], + 'dirnameChangeChars' => [ + ' ' => "_", + ':' => "." + ], + 'mime_magic' => "", + + 'maxImageWidth' => EvolutionCMS()->getConfig('maxImageWidth'), + 'maxImageHeight' => EvolutionCMS()->getConfig('maxImageHeight'), + 'clientResize' => EvolutionCMS()->getConfig('clientResize') && EvolutionCMS()->getConfig('maxImageWidth') + && EvolutionCMS()->getConfig('maxImageHeight') + ? ['maxWidth' => EvolutionCMS()->getConfig('maxImageWidth'), + 'maxHeight' => EvolutionCMS()->getConfig('maxImageHeight'), + 'quality' => EvolutionCMS()->getConfig('jpegQuality') / 100] + : [], + + 'thumbWidth' => EvolutionCMS()->getConfig('thumbWidth'), + 'thumbHeight' => EvolutionCMS()->getConfig('thumbHeight'), + 'thumbsDir' => EvolutionCMS()->getConfig('thumbsDir'), + + 'jpegQuality' => EvolutionCMS()->getConfig('jpegQuality'), + + 'cookieDomain' => "", + 'cookiePath' => "", + 'cookiePrefix' => 'KCFINDER_', + + // THE FOLLOWING SETTINGS CANNOT BE OVERRIDED WITH SESSION CONFIGURATION + '_check4htaccess' => false, + '_tinyMCEPath' => EVO_BASE_URL . "assets/plugins/tinymce/tiny_mce", + + '_sessionVar' => &$_SESSION['KCFINDER'], + //'_sessionLifetime' => 30, + //'_sessionDir' => "/full/directory/path", + + //'_sessionDomain' => ".mysite.com", + //'_sessionPath' => "/my/path", +]; + +EvolutionCMS()->invokeEvent('OnFileBrowserInit', [ + 'config' => &$_CONFIG, +]); diff --git a/manager/media/browser/mcpuk/core/autoload.php b/manager/media/browser/mcpuk/core/autoload.php index fff9929e0a..64d758c639 100755 --- a/manager/media/browser/mcpuk/core/autoload.php +++ b/manager/media/browser/mcpuk/core/autoload.php @@ -1,150 +1,150 @@ - - * @copyright 2010-2014 KCFinder Project - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 - * @link http://kcfinder.sunhater.com - * - * This file is the place you can put any code (at the end of the file), - * which will be executed before any other. Suitable for: - * 1. Set PHP ini settings using ini_set() - * 2. Custom session save handler with session_set_save_handler() - * 3. Any custom integration code. If you use any global variables - * here, they can be accessed in config.php via $GLOBALS array. - * It's recommended to use constants instead. - */ -define('IN_MANAGER_MODE', true); -define('EVO_API_MODE', true); -include_once(__DIR__."/../../../../../index.php"); -$modx = EvolutionCMS(); - -$allowWebUser = (bool) $modx->getConfig('rb_webuser') && isset($_SESSION['webValidated']); -if (!isset($_SESSION['mgrValidated']) && !$allowWebUser) { - die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); -} -$manager_language = ManagerTheme::getLangName(); -$_GET['langCode'] = ManagerTheme::getLang(); - -// MAGIC AUTOLOAD CLASSES FUNCTION -function autoloadda9d06472ccb71b84928677ce2a6ca89($class) { - static $classes = null; - if ($classes === null) { - $classes = [ - 'browser' => '/browser.php', - 'dir' => '/../lib/helper_dir.php', - 'file' => '/../lib/helper_file.php', - 'gd' => '/../lib/class_gd.php', - 'httpCache' => '/../lib/helper_httpCache.php', - 'input' => '/../lib/class_input.php', - 'path' => '/../lib/helper_path.php', - 'text' => '/../lib/helper_text.php', - 'type_img' => '/types/type_img.php', - 'type_mime' => '/types/type_mime.php', - 'uploader' => '/uploader.php', - 'zipFolder' => '/../lib/class_zipFolder.php', - 'image' => '/../lib/class_image.php', - 'image_imagick' => '/../lib/class_image_imagick.php', - 'image_gmagick' => '/../lib/class_image_gmagick.php', - 'image_gd' => '/../lib/class_image_gd.php', - 'fastImage' => '/../lib/class_fastImage.php' - ]; - } - if (isset($classes[$class])) { - require __DIR__ . $classes[$class]; - } -} -spl_autoload_register('autoloadda9d06472ccb71b84928677ce2a6ca89', true); - -// CUSTOM SESSION SAVE HANDLER CLASS EXAMPLE -// -// Uncomment & edit it if the application you want to integrate with, have -// its own session save handler. It's not even needed to save instances of -// this class in variables. Just add a row: -// new SessionSaveHandler(); -// and your handler will rule the sessions ;-) - -/* -class SessionSaveHandler { - protected $savePath; - protected $sessionName; - - public function __construct() { - session_set_save_handler( - array($this, "open"), - array($this, "close"), - array($this, "read"), - array($this, "write"), - array($this, "destroy"), - array($this, "gc") - ); - } - - // Open function, this works like a constructor in classes and is - // executed when the session is being opened. The open function expects - // two parameters, where the first is the save path and the second is the - // session name. - public function open($savePath, $sessionName) { - $this->savePath = $savePath; - $this->sessionName = $sessionName; - return true; - } - - // Close function, this works like a destructor in classes and is - // executed when the session operation is done. - public function close() { - return true; - } - - // Read function must return string value always to make save handler - // work as expected. Return empty string if there is no data to read. - // Return values from other handlers are converted to boolean expression. - // TRUE for success, FALSE for failure. - public function read($id) { - $file = $this->savePath . "/sess_$id"; - return (string) @file_get_contents($file); - } - - // Write function that is called when session data is to be saved. This - // function expects two parameters: an identifier and the data associated - // with it. - public function write($id, $data) { - $file = $this->savePath . "/sess_$id"; - if (false !== ($fp = @fopen($file, "w"))) { - $return = fwrite($fp, $data); - fclose($fp); - return $return; - } else - return false; - } - - // The destroy handler, this is executed when a session is destroyed with - // session_destroy() and takes the session id as its only parameter. - public function destroy($id) { - $file = $this->savePath . "/sess_$id"; - return @unlink($file); - } - - // The garbage collector, this is executed when the session garbage - // collector is executed and takes the max session lifetime as its only - // parameter. - public function gc($maxlifetime) { - foreach (glob($this->savePath . "/sess_*") as $file) - if (filemtime($file) + $maxlifetime < time()) - @unlink($file); - return true; - } -} - -new SessionSaveHandler(); - -*/ - - -// PUT YOUR ADDITIONAL CODE HERE - + + * @copyright 2010-2014 KCFinder Project + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 + * @link http://kcfinder.sunhater.com + * + * This file is the place you can put any code (at the end of the file), + * which will be executed before any other. Suitable for: + * 1. Set PHP ini settings using ini_set() + * 2. Custom session save handler with session_set_save_handler() + * 3. Any custom integration code. If you use any global variables + * here, they can be accessed in config.php via $GLOBALS array. + * It's recommended to use constants instead. + */ +define('IN_MANAGER_MODE', true); +define('EVO_API_MODE', true); +include_once(__DIR__."/../../../../../index.php"); +$modx = EvolutionCMS(); + +$allowWebUser = (bool) $modx->getConfig('rb_webuser') && isset($_SESSION['webValidated']); +if (!isset($_SESSION['mgrValidated']) && !$allowWebUser) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} +$manager_language = ManagerTheme::getLangName(); +$_GET['langCode'] = ManagerTheme::getLang(); + +// MAGIC AUTOLOAD CLASSES FUNCTION +function autoloadda9d06472ccb71b84928677ce2a6ca89($class) { + static $classes = null; + if ($classes === null) { + $classes = [ + 'browser' => '/browser.php', + 'dir' => '/../lib/helper_dir.php', + 'file' => '/../lib/helper_file.php', + 'gd' => '/../lib/class_gd.php', + 'httpCache' => '/../lib/helper_httpCache.php', + 'input' => '/../lib/class_input.php', + 'path' => '/../lib/helper_path.php', + 'text' => '/../lib/helper_text.php', + 'type_img' => '/types/type_img.php', + 'type_mime' => '/types/type_mime.php', + 'uploader' => '/uploader.php', + 'zipFolder' => '/../lib/class_zipFolder.php', + 'image' => '/../lib/class_image.php', + 'image_imagick' => '/../lib/class_image_imagick.php', + 'image_gmagick' => '/../lib/class_image_gmagick.php', + 'image_gd' => '/../lib/class_image_gd.php', + 'fastImage' => '/../lib/class_fastImage.php' + ]; + } + if (isset($classes[$class])) { + require __DIR__ . $classes[$class]; + } +} +spl_autoload_register('autoloadda9d06472ccb71b84928677ce2a6ca89', true); + +// CUSTOM SESSION SAVE HANDLER CLASS EXAMPLE +// +// Uncomment & edit it if the application you want to integrate with, have +// its own session save handler. It's not even needed to save instances of +// this class in variables. Just add a row: +// new SessionSaveHandler(); +// and your handler will rule the sessions ;-) + +/* +class SessionSaveHandler { + protected $savePath; + protected $sessionName; + + public function __construct() { + session_set_save_handler( + array($this, "open"), + array($this, "close"), + array($this, "read"), + array($this, "write"), + array($this, "destroy"), + array($this, "gc") + ); + } + + // Open function, this works like a constructor in classes and is + // executed when the session is being opened. The open function expects + // two parameters, where the first is the save path and the second is the + // session name. + public function open($savePath, $sessionName) { + $this->savePath = $savePath; + $this->sessionName = $sessionName; + return true; + } + + // Close function, this works like a destructor in classes and is + // executed when the session operation is done. + public function close() { + return true; + } + + // Read function must return string value always to make save handler + // work as expected. Return empty string if there is no data to read. + // Return values from other handlers are converted to boolean expression. + // TRUE for success, FALSE for failure. + public function read($id) { + $file = $this->savePath . "/sess_$id"; + return (string) @file_get_contents($file); + } + + // Write function that is called when session data is to be saved. This + // function expects two parameters: an identifier and the data associated + // with it. + public function write($id, $data) { + $file = $this->savePath . "/sess_$id"; + if (false !== ($fp = @fopen($file, "w"))) { + $return = fwrite($fp, $data); + fclose($fp); + return $return; + } else + return false; + } + + // The destroy handler, this is executed when a session is destroyed with + // session_destroy() and takes the session id as its only parameter. + public function destroy($id) { + $file = $this->savePath . "/sess_$id"; + return @unlink($file); + } + + // The garbage collector, this is executed when the session garbage + // collector is executed and takes the max session lifetime as its only + // parameter. + public function gc($maxlifetime) { + foreach (glob($this->savePath . "/sess_*") as $file) + if (filemtime($file) + $maxlifetime < time()) + @unlink($file); + return true; + } +} + +new SessionSaveHandler(); + +*/ + + +// PUT YOUR ADDITIONAL CODE HERE + diff --git a/manager/media/browser/mcpuk/js/FileAPI/FileAPI.exif.js b/manager/media/browser/mcpuk/js/FileAPI/FileAPI.exif.js index 4dd678ce0f..0dd92d00c2 100644 --- a/manager/media/browser/mcpuk/js/FileAPI/FileAPI.exif.js +++ b/manager/media/browser/mcpuk/js/FileAPI/FileAPI.exif.js @@ -1,69 +1,69 @@ -(function (){ -/**! - * Binary Ajax 0.1.10 - * Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com, http://blog.nihilogic.dk/ - * Licensed under the MPL License [http://www.nihilogic.dk/licenses/mpl-license.txt] - * - * - * Javascript EXIF Reader 0.1.4 - * Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com, http://blog.nihilogic.dk/ - * Licensed under the MPL License [http://www.nihilogic.dk/licenses/mpl-license.txt] - */ - - -var BinaryFile=function(j,k,l){var h=j,i=k||0,b=0;this.getRawData=function(){return h};"string"==typeof j&&(b=l||h.length,this.getByteAt=function(a){return h.charCodeAt(a+i)&255},this.getBytesAt=function(a,b){for(var c=[],f=0;fc&&(c+=65536);return c};this.getSShortAt=function(a,b){var c=this.getShortAt(a,b);return 32767c&&(c+=4294967296);return c};this.getSLongAt=function(a,b){var c=this.getLongAt(a,b);return 2147483647 128*1024) { - try { - var size = Math.min(blob.size, 128 * 1024); - blob = (blob.slice || blob.mozSlice || blob.webkitSlice).call(blob, 0, size); - } catch (e) { - FileAPI.log("exception "+ e); - } - } - - FileAPI.readAsBinaryString(blob, function (evt){ - if( evt.type == 'load' ){ - var binaryString = evt.result; - var oFile = new BinaryFile(binaryString, 0, blob.size); - var exif = EXIF.readFromBinaryFile(oFile); - - defer.resolve(false, { 'exif': exif || {} }); - } - else if( evt.type == 'error' ){ - defer.resolve('read_as_binary_string_exif'); - } - }); - } - - file.__exif.then(callback); -}); -})(); +(function (){ +/**! + * Binary Ajax 0.1.10 + * Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com, http://blog.nihilogic.dk/ + * Licensed under the MPL License [http://www.nihilogic.dk/licenses/mpl-license.txt] + * + * + * Javascript EXIF Reader 0.1.4 + * Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com, http://blog.nihilogic.dk/ + * Licensed under the MPL License [http://www.nihilogic.dk/licenses/mpl-license.txt] + */ + + +var BinaryFile=function(j,k,l){var h=j,i=k||0,b=0;this.getRawData=function(){return h};"string"==typeof j&&(b=l||h.length,this.getByteAt=function(a){return h.charCodeAt(a+i)&255},this.getBytesAt=function(a,b){for(var c=[],f=0;fc&&(c+=65536);return c};this.getSShortAt=function(a,b){var c=this.getShortAt(a,b);return 32767c&&(c+=4294967296);return c};this.getSLongAt=function(a,b){var c=this.getLongAt(a,b);return 2147483647 128*1024) { + try { + var size = Math.min(blob.size, 128 * 1024); + blob = (blob.slice || blob.mozSlice || blob.webkitSlice).call(blob, 0, size); + } catch (e) { + FileAPI.log("exception "+ e); + } + } + + FileAPI.readAsBinaryString(blob, function (evt){ + if( evt.type == 'load' ){ + var binaryString = evt.result; + var oFile = new BinaryFile(binaryString, 0, blob.size); + var exif = EXIF.readFromBinaryFile(oFile); + + defer.resolve(false, { 'exif': exif || {} }); + } + else if( evt.type == 'error' ){ + defer.resolve('read_as_binary_string_exif'); + } + }); + } + + file.__exif.then(callback); +}); +})(); diff --git a/manager/media/browser/mcpuk/js/FileAPI/FileAPI.html5.js b/manager/media/browser/mcpuk/js/FileAPI/FileAPI.html5.js index e68fc60c18..aabab82d1f 100644 --- a/manager/media/browser/mcpuk/js/FileAPI/FileAPI.html5.js +++ b/manager/media/browser/mcpuk/js/FileAPI/FileAPI.html5.js @@ -1,3569 +1,3569 @@ -/*! FileAPI 2.0.19 - BSD | git://github.com/mailru/FileAPI.git - * FileAPI — a set of javascript tools for working with files. Multiupload, drag'n'drop and chunked file upload. Images: crop, resize and auto orientation by EXIF. - */ - -/* - * JavaScript Canvas to Blob 2.0.5 - * https://github.com/blueimp/JavaScript-Canvas-to-Blob - * - * Copyright 2012, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/MIT - * - * Based on stackoverflow user Stoive's code snippet: - * http://stackoverflow.com/q/4998908 - */ - -/*jslint nomen: true, regexp: true */ -/*global window, atob, Blob, ArrayBuffer, Uint8Array */ - -(function (window) { - 'use strict'; - var CanvasPrototype = window.HTMLCanvasElement && - window.HTMLCanvasElement.prototype, - hasBlobConstructor = window.Blob && (function () { - try { - return Boolean(new Blob()); - } catch (e) { - return false; - } - }()), - hasArrayBufferViewSupport = hasBlobConstructor && window.Uint8Array && - (function () { - try { - return new Blob([new Uint8Array(100)]).size === 100; - } catch (e) { - return false; - } - }()), - BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || - window.MozBlobBuilder || window.MSBlobBuilder, - dataURLtoBlob = (hasBlobConstructor || BlobBuilder) && window.atob && - window.ArrayBuffer && window.Uint8Array && function (dataURI) { - var byteString, - arrayBuffer, - intArray, - i, - mimeString, - bb; - if (dataURI.split(',')[0].indexOf('base64') >= 0) { - // Convert base64 to raw binary data held in a string: - byteString = atob(dataURI.split(',')[1]); - } else { - // Convert base64/URLEncoded data component to raw binary data: - byteString = decodeURIComponent(dataURI.split(',')[1]); - } - // Write the bytes of the string to an ArrayBuffer: - arrayBuffer = new ArrayBuffer(byteString.length); - intArray = new Uint8Array(arrayBuffer); - for (i = 0; i < byteString.length; i += 1) { - intArray[i] = byteString.charCodeAt(i); - } - // Separate out the mime component: - mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; - // Write the ArrayBuffer (or ArrayBufferView) to a blob: - if (hasBlobConstructor) { - return new Blob( - [hasArrayBufferViewSupport ? intArray : arrayBuffer], - {type: mimeString} - ); - } - bb = new BlobBuilder(); - bb.append(arrayBuffer); - return bb.getBlob(mimeString); - }; - if (window.HTMLCanvasElement && !CanvasPrototype.toBlob) { - if (CanvasPrototype.mozGetAsFile) { - CanvasPrototype.toBlob = function (callback, type, quality) { - if (quality && CanvasPrototype.toDataURL && dataURLtoBlob) { - callback(dataURLtoBlob(this.toDataURL(type, quality))); - } else { - callback(this.mozGetAsFile('blob', type)); - } - }; - } else if (CanvasPrototype.toDataURL && dataURLtoBlob) { - CanvasPrototype.toBlob = function (callback, type, quality) { - callback(dataURLtoBlob(this.toDataURL(type, quality))); - }; - } - } - window.dataURLtoBlob = dataURLtoBlob; -})(window); - -/*jslint evil: true */ -/*global window, URL, webkitURL, ActiveXObject */ - -(function (window, undef){ - 'use strict'; - - var - gid = 1, - noop = function (){}, - - document = window.document, - doctype = document.doctype || {}, - userAgent = window.navigator.userAgent, - safari = /safari\//i.test(userAgent) && !/chrome\//i.test(userAgent), - iemobile = /iemobile\//i.test(userAgent), - - // https://github.com/blueimp/JavaScript-Load-Image/blob/master/load-image.js#L48 - apiURL = (window.createObjectURL && window) || (window.URL && URL.revokeObjectURL && URL) || (window.webkitURL && webkitURL), - - Blob = window.Blob, - File = window.File, - FileReader = window.FileReader, - FormData = window.FormData, - - - XMLHttpRequest = window.XMLHttpRequest, - jQuery = window.jQuery, - - html5 = !!(File && (FileReader && (window.Uint8Array || FormData || XMLHttpRequest.prototype.sendAsBinary))) - && !(safari && /windows/i.test(userAgent) && !iemobile), // BugFix: https://github.com/mailru/FileAPI/issues/25 - - cors = html5 && ('withCredentials' in (new XMLHttpRequest)), - - chunked = html5 && !!Blob && !!(Blob.prototype.webkitSlice || Blob.prototype.mozSlice || Blob.prototype.slice), - - normalize = ('' + ''.normalize).indexOf('[native code]') > 0, - - // https://github.com/blueimp/JavaScript-Canvas-to-Blob - dataURLtoBlob = window.dataURLtoBlob, - - - _rimg = /img/i, - _rcanvas = /canvas/i, - _rimgcanvas = /img|canvas/i, - _rinput = /input/i, - _rdata = /^data:[^,]+,/, - - _toString = {}.toString, - _supportConsoleLog, - _supportConsoleLogApply, - - - Math = window.Math, - - _SIZE_CONST = function (pow){ - pow = new window.Number(Math.pow(1024, pow)); - pow.from = function (sz){ return Math.round(sz * this); }; - return pow; - }, - - _elEvents = {}, // element event listeners - _infoReader = [], // list of file info processors - - _readerEvents = 'abort progress error load loadend', - _xhrPropsExport = 'status statusText readyState response responseXML responseText responseBody'.split(' '), - - currentTarget = 'currentTarget', // for minimize - preventDefault = 'preventDefault', // and this too - - _isArray = function (ar) { - return ar && ('length' in ar); - }, - - /** - * Iterate over a object or array - */ - _each = function (obj, fn, ctx){ - if( obj ){ - if( _isArray(obj) ){ - for( var i = 0, n = obj.length; i < n; i++ ){ - if( i in obj ){ - fn.call(ctx, obj[i], i, obj); - } - } - } - else { - for( var key in obj ){ - if( obj.hasOwnProperty(key) ){ - fn.call(ctx, obj[key], key, obj); - } - } - } - } - }, - - /** - * Merge the contents of two or more objects together into the first object - */ - _extend = function (dst){ - var args = arguments, i = 1, _ext = function (val, key){ dst[key] = val; }; - for( ; i < args.length; i++ ){ - _each(args[i], _ext); - } - return dst; - }, - - /** - * Add event listener - */ - _on = function (el, type, fn){ - if( el ){ - var uid = api.uid(el); - - if( !_elEvents[uid] ){ - _elEvents[uid] = {}; - } - - var isFileReader = (FileReader && el) && (el instanceof FileReader); - _each(type.split(/\s+/), function (type){ - if( jQuery && !isFileReader){ - jQuery.event.add(el, type, fn); - } else { - if( !_elEvents[uid][type] ){ - _elEvents[uid][type] = []; - } - - _elEvents[uid][type].push(fn); - - if( el.addEventListener ){ el.addEventListener(type, fn, false); } - else if( el.attachEvent ){ el.attachEvent('on'+type, fn); } - else { el['on'+type] = fn; } - } - }); - } - }, - - - /** - * Remove event listener - */ - _off = function (el, type, fn){ - if( el ){ - var uid = api.uid(el), events = _elEvents[uid] || {}; - - var isFileReader = (FileReader && el) && (el instanceof FileReader); - _each(type.split(/\s+/), function (type){ - if( jQuery && !isFileReader){ - jQuery.event.remove(el, type, fn); - } - else { - var fns = events[type] || [], i = fns.length; - - while( i-- ){ - if( fns[i] === fn ){ - fns.splice(i, 1); - break; - } - } - - if( el.addEventListener ){ el.removeEventListener(type, fn, false); } - else if( el.detachEvent ){ el.detachEvent('on'+type, fn); } - else { el['on'+type] = null; } - } - }); - } - }, - - - _one = function(el, type, fn){ - _on(el, type, function _(evt){ - _off(el, type, _); - fn(evt); - }); - }, - - - _fixEvent = function (evt){ - if( !evt.target ){ evt.target = window.event && window.event.srcElement || document; } - if( evt.target.nodeType === 3 ){ evt.target = evt.target.parentNode; } - return evt; - }, - - - _supportInputAttr = function (attr){ - var input = document.createElement('input'); - input.setAttribute('type', "file"); - return attr in input; - }, - - - /** - * FileAPI (core object) - */ - api = { - version: '2.0.19', - - cors: false, - html5: true, - media: false, - formData: true, - multiPassResize: true, - - debug: false, - pingUrl: false, - multiFlash: false, - flashAbortTimeout: 0, - withCredentials: true, - - staticPath: './dist/', - - flashUrl: 0, // @default: './FileAPI.flash.swf' - flashImageUrl: 0, // @default: './FileAPI.flash.image.swf' - - postNameConcat: function (name, idx){ - return name + (idx != null ? '['+ idx +']' : ''); - }, - - ext2mime: { - jpg: 'image/jpeg' - , tif: 'image/tiff' - , txt: 'text/plain' - }, - - // Fallback for flash - accept: { - 'image/*': 'art bm bmp dwg dxf cbr cbz fif fpx gif ico iefs jfif jpe jpeg jpg jps jut mcf nap nif pbm pcx pgm pict pm png pnm qif qtif ras rast rf rp svf tga tif tiff xbm xbm xpm xwd' - , 'audio/*': 'm4a flac aac rm mpa wav wma ogg mp3 mp2 m3u mod amf dmf dsm far gdm imf it m15 med okt s3m stm sfx ult uni xm sid ac3 dts cue aif aiff wpl ape mac mpc mpp shn wv nsf spc gym adplug adx dsp adp ymf ast afc hps xs' - , 'video/*': 'm4v 3gp nsv ts ty strm rm rmvb m3u ifo mov qt divx xvid bivx vob nrg img iso pva wmv asf asx ogm m2v avi bin dat dvr-ms mpg mpeg mp4 mkv avc vp3 svq3 nuv viv dv fli flv wpl' - }, - - uploadRetry : 0, - networkDownRetryTimeout : 5000, // milliseconds, don't flood when network is down - - chunkSize : 0, - chunkUploadRetry : 0, - chunkNetworkDownRetryTimeout : 2000, // milliseconds, don't flood when network is down - - KB: _SIZE_CONST(1), - MB: _SIZE_CONST(2), - GB: _SIZE_CONST(3), - TB: _SIZE_CONST(4), - - EMPTY_PNG: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=', - - expando: 'fileapi' + (new Date).getTime(), - - uid: function (obj){ - return obj - ? (obj[api.expando] = obj[api.expando] || api.uid()) - : (++gid, api.expando + gid) - ; - }, - - log: function (){ - if( api.debug && _supportConsoleLog ){ - if( _supportConsoleLogApply ){ - console.log.apply(console, arguments); - } - else { - console.log([].join.call(arguments, ' ')); - } - } - }, - - /** - * Create new image - * - * @param {String} [src] - * @param {Function} [fn] 1. error -- boolean, 2. img -- Image element - * @returns {HTMLElement} - */ - newImage: function (src, fn){ - var img = document.createElement('img'); - if( fn ){ - api.event.one(img, 'error load', function (evt){ - fn(evt.type == 'error', img); - img = null; - }); - } - img.src = src; - return img; - }, - - /** - * Get XHR - * @returns {XMLHttpRequest} - */ - getXHR: function (){ - var xhr; - - if( XMLHttpRequest ){ - xhr = new XMLHttpRequest; - } - else if( window.ActiveXObject ){ - try { - xhr = new ActiveXObject('MSXML2.XMLHttp.3.0'); - } catch (e) { - xhr = new ActiveXObject('Microsoft.XMLHTTP'); - } - } - - return xhr; - }, - - isArray: _isArray, - - support: { - dnd: cors && ('ondrop' in document.createElement('div')), - cors: cors, - html5: html5, - chunked: chunked, - dataURI: true, - accept: _supportInputAttr('accept'), - multiple: _supportInputAttr('multiple') - }, - - event: { - on: _on - , off: _off - , one: _one - , fix: _fixEvent - }, - - - throttle: function(fn, delay) { - var id, args; - - return function _throttle(){ - args = arguments; - - if( !id ){ - fn.apply(window, args); - id = setTimeout(function (){ - id = 0; - fn.apply(window, args); - }, delay); - } - }; - }, - - - F: function (){}, - - - parseJSON: function (str){ - var json; - if( window.JSON && JSON.parse ){ - json = JSON.parse(str); - } - else { - json = (new Function('return ('+str.replace(/([\r\n])/g, '\\$1')+');'))(); - } - return json; - }, - - - trim: function (str){ - str = String(str); - return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); - }, - - /** - * Simple Defer - * @return {Object} - */ - defer: function (){ - var - list = [] - , result - , error - , defer = { - resolve: function (err, res){ - defer.resolve = noop; - error = err || false; - result = res; - - while( res = list.shift() ){ - res(error, result); - } - }, - - then: function (fn){ - if( error !== undef ){ - fn(error, result); - } else { - list.push(fn); - } - } - }; - - return defer; - }, - - queue: function (fn){ - var - _idx = 0 - , _length = 0 - , _fail = false - , _end = false - , queue = { - inc: function (){ - _length++; - }, - - next: function (){ - _idx++; - setTimeout(queue.check, 0); - }, - - check: function (){ - (_idx >= _length) && !_fail && queue.end(); - }, - - isFail: function (){ - return _fail; - }, - - fail: function (){ - !_fail && fn(_fail = true); - }, - - end: function (){ - if( !_end ){ - _end = true; - fn(); - } - } - } - ; - return queue; - }, - - - /** - * For each object - * - * @param {Object|Array} obj - * @param {Function} fn - * @param {*} [ctx] - */ - each: _each, - - - /** - * Async for - * @param {Array} array - * @param {Function} callback - */ - afor: function (array, callback){ - var i = 0, n = array.length; - - if( _isArray(array) && n-- ){ - (function _next(){ - callback(n != i && _next, array[i], i++); - })(); - } - else { - callback(false); - } - }, - - - /** - * Merge the contents of two or more objects together into the first object - * - * @param {Object} dst - * @return {Object} - */ - extend: _extend, - - - /** - * Is file? - * @param {File} file - * @return {Boolean} - */ - isFile: function (file){ - return _toString.call(file) === '[object File]'; - }, - - - /** - * Is blob? - * @param {Blob} blob - * @returns {Boolean} - */ - isBlob: function (blob) { - return this.isFile(blob) || (_toString.call(blob) === '[object Blob]'); - }, - - - /** - * Is canvas element - * - * @param {HTMLElement} el - * @return {Boolean} - */ - isCanvas: function (el){ - return el && _rcanvas.test(el.nodeName); - }, - - - getFilesFilter: function (filter){ - filter = typeof filter == 'string' ? filter : (filter.getAttribute && filter.getAttribute('accept') || ''); - return filter ? new RegExp('('+ filter.replace(/\./g, '\\.').replace(/,/g, '|') +')$', 'i') : /./; - }, - - - - /** - * Read as DataURL - * - * @param {File|Element} file - * @param {Function} fn - */ - readAsDataURL: function (file, fn){ - if( api.isCanvas(file) ){ - _emit(file, fn, 'load', api.toDataURL(file)); - } - else { - _readAs(file, fn, 'DataURL'); - } - }, - - - /** - * Read as Binary string - * - * @param {File} file - * @param {Function} fn - */ - readAsBinaryString: function (file, fn){ - if( _hasSupportReadAs('BinaryString') ){ - _readAs(file, fn, 'BinaryString'); - } else { - // Hello IE10! - _readAs(file, function (evt){ - if( evt.type == 'load' ){ - try { - // dataURL -> binaryString - evt.result = api.toBinaryString(evt.result); - } catch (e){ - evt.type = 'error'; - evt.message = e.toString(); - } - } - fn(evt); - }, 'DataURL'); - } - }, - - - /** - * Read as ArrayBuffer - * - * @param {File} file - * @param {Function} fn - */ - readAsArrayBuffer: function(file, fn){ - _readAs(file, fn, 'ArrayBuffer'); - }, - - - /** - * Read as text - * - * @param {File} file - * @param {String} encoding - * @param {Function} [fn] - */ - readAsText: function(file, encoding, fn){ - if( !fn ){ - fn = encoding; - encoding = 'utf-8'; - } - - _readAs(file, fn, 'Text', encoding); - }, - - - /** - * Convert image or canvas to DataURL - * - * @param {Element} el Image or Canvas element - * @param {String} [type] mime-type - * @return {String} - */ - toDataURL: function (el, type){ - if( typeof el == 'string' ){ - return el; - } - else if( el.toDataURL ){ - return el.toDataURL(type || 'image/png'); - } - }, - - - /** - * Canvert string, image or canvas to binary string - * - * @param {String|Element} val - * @return {String} - */ - toBinaryString: function (val){ - return window.atob(api.toDataURL(val).replace(_rdata, '')); - }, - - - /** - * Read file or DataURL as ImageElement - * - * @param {File|String} file - * @param {Function} fn - * @param {Boolean} [progress] - */ - readAsImage: function (file, fn, progress){ - if( api.isBlob(file) ){ - if( apiURL ){ - /** @namespace apiURL.createObjectURL */ - var data = apiURL.createObjectURL(file); - if( data === undef ){ - _emit(file, fn, 'error'); - } - else { - api.readAsImage(data, fn, progress); - } - } - else { - api.readAsDataURL(file, function (evt){ - if( evt.type == 'load' ){ - api.readAsImage(evt.result, fn, progress); - } - else if( progress || evt.type == 'error' ){ - _emit(file, fn, evt, null, { loaded: evt.loaded, total: evt.total }); - } - }); - } - } - else if( api.isCanvas(file) ){ - _emit(file, fn, 'load', file); - } - else if( _rimg.test(file.nodeName) ){ - if( file.complete ){ - _emit(file, fn, 'load', file); - } - else { - var events = 'error abort load'; - _one(file, events, function _fn(evt){ - if( evt.type == 'load' && apiURL ){ - /** @namespace apiURL.revokeObjectURL */ - apiURL.revokeObjectURL(file.src); - } - - _off(file, events, _fn); - _emit(file, fn, evt, file); - }); - } - } - else if( file.iframe ){ - _emit(file, fn, { type: 'error' }); - } - else { - // Created image - var img = api.newImage(file.dataURL || file); - api.readAsImage(img, fn, progress); - } - }, - - - /** - * Make file by name - * - * @param {String} name - * @return {Array} - */ - checkFileObj: function (name){ - var file = {}, accept = api.accept; - - if( typeof name == 'object' ){ - file = name; - } - else { - file.name = (name + '').split(/\\|\//g).pop(); - } - - if( file.type == null ){ - file.type = file.name.split('.').pop(); - } - - _each(accept, function (ext, type){ - ext = new RegExp(ext.replace(/\s/g, '|'), 'i'); - if( ext.test(file.type) || api.ext2mime[file.type] ){ - file.type = api.ext2mime[file.type] || (type.split('/')[0] +'/'+ file.type); - } - }); - - return file; - }, - - - /** - * Get drop files - * - * @param {Event} evt - * @param {Function} callback - */ - getDropFiles: function (evt, callback){ - var - files = [] - , all = [] - , items - , dataTransfer = _getDataTransfer(evt) - , transFiles = dataTransfer.files - , transItems = dataTransfer.items - , entrySupport = _isArray(transItems) && transItems[0] && _getAsEntry(transItems[0]) - , queue = api.queue(function (){ callback(files, all); }) - ; - - if( entrySupport ){ - if( normalize && transFiles ){ - var - i = transFiles.length - , file - , entry - ; - - items = new Array(i); - while( i-- ){ - file = transFiles[i]; - - try { - entry = _getAsEntry(transItems[i]); - } - catch( err ){ - api.log('[err] getDropFiles: ', err); - entry = null; - } - - if( _isEntry(entry) ){ - // OSX filesystems use Unicode Normalization Form D (NFD), - // and entry.file(…) can't read the files with the same names - if( entry.isDirectory || (entry.isFile && file.name == file.name.normalize('NFC')) ){ - items[i] = entry; - } - else { - items[i] = file; - } - } - else { - items[i] = file; - } - } - } - else { - items = transItems; - } - } - else { - items = transFiles; - } - - _each(items || [], function (item){ - queue.inc(); - - try { - if( entrySupport && _isEntry(item) ){ - _readEntryAsFiles(item, function (err, entryFiles, allEntries){ - if( err ){ - api.log('[err] getDropFiles:', err); - } else { - files.push.apply(files, entryFiles); - } - all.push.apply(all, allEntries); - - queue.next(); - }); - } - else { - _isRegularFile(item, function (yes, err){ - if( yes ){ - files.push(item); - } - else { - item.error = err; - } - all.push(item); - - queue.next(); - }); - } - } - catch( err ){ - queue.next(); - api.log('[err] getDropFiles: ', err); - } - }); - - queue.check(); - }, - - - /** - * Get file list - * - * @param {HTMLInputElement|Event} input - * @param {String|Function} [filter] - * @param {Function} [callback] - * @return {Array|Null} - */ - getFiles: function (input, filter, callback){ - var files = []; - - if( callback ){ - api.filterFiles(api.getFiles(input), filter, callback); - return null; - } - - if( input.jquery ){ - // jQuery object - input.each(function (){ - files = files.concat(api.getFiles(this)); - }); - input = files; - files = []; - } - - if( typeof filter == 'string' ){ - filter = api.getFilesFilter(filter); - } - - if( input.originalEvent ){ - // jQuery event - input = _fixEvent(input.originalEvent); - } - else if( input.srcElement ){ - // IE Event - input = _fixEvent(input); - } - - - if( input.dataTransfer ){ - // Drag'n'Drop - input = input.dataTransfer; - } - else if( input.target ){ - // Event - input = input.target; - } - - if( input.files ){ - // Input[type="file"] - files = input.files; - - if( !html5 ){ - // Partial support for file api - files[0].blob = input; - files[0].iframe = true; - } - } - else if( !html5 && isInputFile(input) ){ - if( api.trim(input.value) ){ - files = [api.checkFileObj(input.value)]; - files[0].blob = input; - files[0].iframe = true; - } - } - else if( _isArray(input) ){ - files = input; - } - - return api.filter(files, function (file){ return !filter || filter.test(file.name); }); - }, - - - /** - * Get total file size - * @param {Array} files - * @return {Number} - */ - getTotalSize: function (files){ - var size = 0, i = files && files.length; - while( i-- ){ - size += files[i].size; - } - return size; - }, - - - /** - * Get image information - * - * @param {File} file - * @param {Function} fn - */ - getInfo: function (file, fn){ - var info = {}, readers = _infoReader.concat(); - - if( api.isBlob(file) ){ - (function _next(){ - var reader = readers.shift(); - if( reader ){ - if( reader.test(file.type) ){ - reader(file, function (err, res){ - if( err ){ - fn(err); - } - else { - _extend(info, res); - _next(); - } - }); - } - else { - _next(); - } - } - else { - fn(false, info); - } - })(); - } - else { - fn('not_support_info', info); - } - }, - - - /** - * Add information reader - * - * @param {RegExp} mime - * @param {Function} fn - */ - addInfoReader: function (mime, fn){ - fn.test = function (type){ return mime.test(type); }; - _infoReader.push(fn); - }, - - - /** - * Filter of array - * - * @param {Array} input - * @param {Function} fn - * @return {Array} - */ - filter: function (input, fn){ - var result = [], i = 0, n = input.length, val; - - for( ; i < n; i++ ){ - if( i in input ){ - val = input[i]; - if( fn.call(val, val, i, input) ){ - result.push(val); - } - } - } - - return result; - }, - - - /** - * Filter files - * - * @param {Array} files - * @param {Function} eachFn - * @param {Function} resultFn - */ - filterFiles: function (files, eachFn, resultFn){ - if( files.length ){ - // HTML5 or Flash - var queue = files.concat(), file, result = [], deleted = []; - - (function _next(){ - if( queue.length ){ - file = queue.shift(); - api.getInfo(file, function (err, info){ - (eachFn(file, err ? false : info) ? result : deleted).push(file); - _next(); - }); - } - else { - resultFn(result, deleted); - } - })(); - } - else { - resultFn([], files); - } - }, - - - upload: function (options){ - options = _extend({ - jsonp: 'callback' - , prepare: api.F - , beforeupload: api.F - , upload: api.F - , fileupload: api.F - , fileprogress: api.F - , filecomplete: api.F - , progress: api.F - , complete: api.F - , pause: api.F - , imageOriginal: true - , chunkSize: api.chunkSize - , chunkUploadRetry: api.chunkUploadRetry - , uploadRetry: api.uploadRetry - }, options); - - - if( options.imageAutoOrientation && !options.imageTransform ){ - options.imageTransform = { rotate: 'auto' }; - } - - - var - proxyXHR = new api.XHR(options) - , dataArray = this._getFilesDataArray(options.files) - , _this = this - , _total = 0 - , _loaded = 0 - , _nextFile - , _complete = false - ; - - - // calc total size - _each(dataArray, function (data){ - _total += data.size; - }); - - // Array of files - proxyXHR.files = []; - _each(dataArray, function (data){ - proxyXHR.files.push(data.file); - }); - - // Set upload status props - proxyXHR.total = _total; - proxyXHR.loaded = 0; - proxyXHR.filesLeft = dataArray.length; - - // emit "beforeupload" event - options.beforeupload(proxyXHR, options); - - // Upload by file - _nextFile = function (){ - var - data = dataArray.shift() - , _file = data && data.file - , _fileLoaded = false - , _fileOptions = _simpleClone(options) - ; - - proxyXHR.filesLeft = dataArray.length; - - if( _file && _file.name === api.expando ){ - _file = null; - api.log('[warn] FileAPI.upload() — called without files'); - } - - if( ( proxyXHR.statusText != 'abort' || proxyXHR.current ) && data ){ - // Mark active job - _complete = false; - - // Set current upload file - proxyXHR.currentFile = _file; - - // Prepare file options - if (_file && options.prepare(_file, _fileOptions) === false) { - _nextFile.call(_this); - return; - } - _fileOptions.file = _file; - - _this._getFormData(_fileOptions, data, function (form){ - if( !_loaded ){ - // emit "upload" event - options.upload(proxyXHR, options); - } - - var xhr = new api.XHR(_extend({}, _fileOptions, { - - upload: _file ? function (){ - // emit "fileupload" event - options.fileupload(_file, xhr, _fileOptions); - } : noop, - - progress: _file ? function (evt){ - if( !_fileLoaded ){ - // For ignore the double calls. - _fileLoaded = (evt.loaded === evt.total); - - // emit "fileprogress" event - options.fileprogress({ - type: 'progress' - , total: data.total = evt.total - , loaded: data.loaded = evt.loaded - }, _file, xhr, _fileOptions); - - // emit "progress" event - options.progress({ - type: 'progress' - , total: _total - , loaded: proxyXHR.loaded = (_loaded + data.size * (evt.loaded/evt.total)) || 0 - }, _file, xhr, _fileOptions); - } - } : noop, - - complete: function (err){ - _each(_xhrPropsExport, function (name){ - proxyXHR[name] = xhr[name]; - }); - - if( _file ){ - data.total = (data.total || data.size); - data.loaded = data.total; - - if( !err ) { - // emulate 100% "progress" - this.progress(data); - - // fixed throttle event - _fileLoaded = true; - - // bytes loaded - _loaded += data.size; // data.size != data.total, it's desirable fix this - proxyXHR.loaded = _loaded; - } - - // emit "filecomplete" event - options.filecomplete(err, xhr, _file, _fileOptions); - } - - // upload next file - setTimeout(function () {_nextFile.call(_this);}, 0); - } - })); // xhr - - - // ... - proxyXHR.abort = function (current){ - if (!current) { dataArray.length = 0; } - this.current = current; - xhr.abort(); - }; - - // Start upload - xhr.send(form); - }); - } - else { - var successful = proxyXHR.status == 200 || proxyXHR.status == 201 || proxyXHR.status == 204; - options.complete(successful ? false : (proxyXHR.statusText || 'error'), proxyXHR, options); - // Mark done state - _complete = true; - } - }; - - - // Next tick - setTimeout(_nextFile, 0); - - - // Append more files to the existing request - // first - add them to the queue head/tail - proxyXHR.append = function (files, first) { - files = api._getFilesDataArray([].concat(files)); - - _each(files, function (data) { - _total += data.size; - proxyXHR.files.push(data.file); - if (first) { - dataArray.unshift(data); - } else { - dataArray.push(data); - } - }); - - proxyXHR.statusText = ""; - - if( _complete ){ - _nextFile.call(_this); - } - }; - - - // Removes file from queue by file reference and returns it - proxyXHR.remove = function (file) { - var i = dataArray.length, _file; - while( i-- ){ - if( dataArray[i].file == file ){ - _file = dataArray.splice(i, 1); - _total -= _file.size; - } - } - return _file; - }; - - return proxyXHR; - }, - - - _getFilesDataArray: function (data){ - var files = [], oFiles = {}; - - if( isInputFile(data) ){ - var tmp = api.getFiles(data); - oFiles[data.name || 'file'] = data.getAttribute('multiple') !== null ? tmp : tmp[0]; - } - else if( _isArray(data) && isInputFile(data[0]) ){ - _each(data, function (input){ - oFiles[input.name || 'file'] = api.getFiles(input); - }); - } - else { - oFiles = data; - } - - _each(oFiles, function add(file, name){ - if( _isArray(file) ){ - _each(file, function (file){ - add(file, name); - }); - } - else if( file && (file.name || file.image) ){ - files.push({ - name: name - , file: file - , size: file.size - , total: file.size - , loaded: 0 - }); - } - }); - - if( !files.length ){ - // Create fake `file` object - files.push({ file: { name: api.expando } }); - } - - return files; - }, - - - _getFormData: function (options, data, fn){ - var - file = data.file - , name = data.name - , filename = file.name - , filetype = file.type - , trans = api.support.transform && options.imageTransform - , Form = new api.Form - , queue = api.queue(function (){ fn(Form); }) - , isOrignTrans = trans && _isOriginTransform(trans) - , postNameConcat = api.postNameConcat - ; - - // Append data - _each(options.data, function add(val, name){ - if( typeof val == 'object' ){ - _each(val, function (v, i){ - add(v, postNameConcat(name, i)); - }); - } - else { - Form.append(name, val); - } - }); - - (function _addFile(file/**Object*/){ - if( file.image ){ // This is a FileAPI.Image - queue.inc(); - - file.toData(function (err, image){ - // @todo: требует рефакторинга и обработки ошибки - if (file.file) { - image.type = file.file.type; - image.quality = file.matrix.quality; - filename = file.file && file.file.name; - } - - filename = filename || (new Date).getTime()+'.png'; - - _addFile(image); - queue.next(); - }); - } - else if( api.Image && trans && (/^image/.test(file.type) || _rimgcanvas.test(file.nodeName)) ){ - queue.inc(); - - if( isOrignTrans ){ - // Convert to array for transform function - trans = [trans]; - } - - api.Image.transform(file, trans, options.imageAutoOrientation, function (err, images){ - if( isOrignTrans && !err ){ - if( !dataURLtoBlob && !api.flashEngine ){ - // Canvas.toBlob or Flash not supported, use multipart - Form.multipart = true; - } - - Form.append(name, images[0], filename, trans[0].type || filetype); - } - else { - var addOrigin = 0; - - if( !err ){ - _each(images, function (image, idx){ - if( !dataURLtoBlob && !api.flashEngine ){ - Form.multipart = true; - } - - if( !trans[idx].postName ){ - addOrigin = 1; - } - - Form.append(trans[idx].postName || postNameConcat(name, idx), image, filename, trans[idx].type || filetype); - }); - } - - if( err || options.imageOriginal ){ - Form.append(postNameConcat(name, (addOrigin ? 'original' : null)), file, filename, filetype); - } - } - - queue.next(); - }); - } - else if( filename !== api.expando ){ - Form.append(name, file, filename); - } - })(file); - - queue.check(); - }, - - - reset: function (inp, notRemove){ - var parent, clone; - - if( jQuery ){ - clone = jQuery(inp).clone(true).insertBefore(inp).val('')[0]; - if( !notRemove ){ - jQuery(inp).remove(); - } - } else { - parent = inp.parentNode; - clone = parent.insertBefore(inp.cloneNode(true), inp); - clone.value = ''; - - if( !notRemove ){ - parent.removeChild(inp); - } - - _each(_elEvents[api.uid(inp)], function (fns, type){ - _each(fns, function (fn){ - _off(inp, type, fn); - _on(clone, type, fn); - }); - }); - } - - return clone; - }, - - - /** - * Load remote file - * - * @param {String} url - * @param {Function} fn - * @return {XMLHttpRequest} - */ - load: function (url, fn){ - var xhr = api.getXHR(); - if( xhr ){ - xhr.open('GET', url, true); - - if( xhr.overrideMimeType ){ - xhr.overrideMimeType('text/plain; charset=x-user-defined'); - } - - _on(xhr, 'progress', function (/**Event*/evt){ - /** @namespace evt.lengthComputable */ - if( evt.lengthComputable ){ - fn({ type: evt.type, loaded: evt.loaded, total: evt.total }, xhr); - } - }); - - xhr.onreadystatechange = function(){ - if( xhr.readyState == 4 ){ - xhr.onreadystatechange = null; - if( xhr.status == 200 ){ - url = url.split('/'); - /** @namespace xhr.responseBody */ - var file = { - name: url[url.length-1] - , size: xhr.getResponseHeader('Content-Length') - , type: xhr.getResponseHeader('Content-Type') - }; - file.dataURL = 'data:'+file.type+';base64,' + api.encode64(xhr.responseBody || xhr.responseText); - fn({ type: 'load', result: file }, xhr); - } - else { - fn({ type: 'error' }, xhr); - } - } - }; - xhr.send(null); - } else { - fn({ type: 'error' }); - } - - return xhr; - }, - - encode64: function (str){ - var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', outStr = '', i = 0; - - if( typeof str !== 'string' ){ - str = String(str); - } - - while( i < str.length ){ - //all three "& 0xff" added below are there to fix a known bug - //with bytes returned by xhr.responseText - var - byte1 = str.charCodeAt(i++) & 0xff - , byte2 = str.charCodeAt(i++) & 0xff - , byte3 = str.charCodeAt(i++) & 0xff - , enc1 = byte1 >> 2 - , enc2 = ((byte1 & 3) << 4) | (byte2 >> 4) - , enc3, enc4 - ; - - if( isNaN(byte2) ){ - enc3 = enc4 = 64; - } else { - enc3 = ((byte2 & 15) << 2) | (byte3 >> 6); - enc4 = isNaN(byte3) ? 64 : byte3 & 63; - } - - outStr += b64.charAt(enc1) + b64.charAt(enc2) + b64.charAt(enc3) + b64.charAt(enc4); - } - - return outStr; - } - - } // api - ; - - - function _emit(target, fn, name, res, ext){ - var evt = { - type: name.type || name - , target: target - , result: res - }; - _extend(evt, ext); - fn(evt); - } - - - function _hasSupportReadAs(method){ - return FileReader && !!FileReader.prototype['readAs' + method]; - } - - - function _readAs(file, fn, method, encoding){ - if( api.isBlob(file) && _hasSupportReadAs(method) ){ - var Reader = new FileReader; - - // Add event listener - _on(Reader, _readerEvents, function _fn(evt){ - var type = evt.type; - if( type == 'progress' ){ - _emit(file, fn, evt, evt.target.result, { loaded: evt.loaded, total: evt.total }); - } - else if( type == 'loadend' ){ - _off(Reader, _readerEvents, _fn); - Reader = null; - } - else { - _emit(file, fn, evt, evt.target.result); - } - }); - - - try { - // ReadAs ... - if( encoding ){ - Reader['readAs' + method](file, encoding); - } - else { - Reader['readAs' + method](file); - } - } - catch (err){ - _emit(file, fn, 'error', undef, { error: err.toString() }); - } - } - else { - _emit(file, fn, 'error', undef, { error: 'filreader_not_support_' + method }); - } - } - - - function _isRegularFile(file, callback){ - // http://stackoverflow.com/questions/8856628/detecting-folders-directories-in-javascript-filelist-objects - if( !file.type && (safari || ((file.size % 4096) === 0 && (file.size <= 102400))) ){ - if( FileReader ){ - try { - var reader = new FileReader(); - - _one(reader, _readerEvents, function (evt){ - var isFile = evt.type != 'error'; - if( isFile ){ - if ( reader.readyState == null || reader.readyState === reader.LOADING ) { - reader.abort(); - } - callback(isFile); - } - else { - callback(false, reader.error); - } - }); - - reader.readAsDataURL(file); - } catch( err ){ - callback(false, err); - } - } - else { - callback(null, new Error('FileReader is not supported')); - } - } - else { - callback(true); - } - } - - - function _isEntry(item){ - return item && (item.isFile || item.isDirectory); - } - - - function _getAsEntry(item){ - var entry; - if( item.getAsEntry ){ entry = item.getAsEntry(); } - else if( item.webkitGetAsEntry ){ entry = item.webkitGetAsEntry(); } - return entry; - } - - - function _readEntryAsFiles(entry, callback){ - if( !entry ){ - // error - var err = new Error('invalid entry'); - entry = new Object(entry); - entry.error = err; - callback(err.message, [], [entry]); - } - else if( entry.isFile ){ - // Read as file - entry.file(function (file){ - // success - file.fullPath = entry.fullPath; - callback(false, [file], [file]); - }, function (err){ - // error - entry.error = err; - callback('FileError.code: ' + err.code, [], [entry]); - }); - } - else if( entry.isDirectory ){ - var - reader = entry.createReader() - , firstAttempt = true - , files = [] - , all = [entry] - ; - - var onerror = function (err){ - // error - entry.error = err; - callback('DirectoryError.code: ' + err.code, files, all); - }; - var ondone = function ondone(entries){ - if( firstAttempt ){ - firstAttempt = false; - if( !entries.length ){ - entry.error = new Error('directory is empty'); - } - } - - // success - if( entries.length ){ - api.afor(entries, function (next, entry){ - _readEntryAsFiles(entry, function (err, entryFiles, allEntries){ - if( !err ){ - files = files.concat(entryFiles); - } - all = all.concat(allEntries); - - if( next ){ - next(); - } - else { - reader.readEntries(ondone, onerror); - } - }); - }); - } - else { - callback(false, files, all); - } - }; - - reader.readEntries(ondone, onerror); - } - else { - _readEntryAsFiles(_getAsEntry(entry), callback); - } - } - - - function _simpleClone(obj){ - var copy = {}; - _each(obj, function (val, key){ - if( val && (typeof val === 'object') && (val.nodeType === void 0) ){ - val = _extend({}, val); - } - copy[key] = val; - }); - return copy; - } - - - function isInputFile(el){ - return _rinput.test(el && el.tagName); - } - - - function _getDataTransfer(evt){ - return (evt.originalEvent || evt || '').dataTransfer || {}; - } - - - function _isOriginTransform(trans){ - var key; - for( key in trans ){ - if( trans.hasOwnProperty(key) ){ - if( !(trans[key] instanceof Object || key === 'overlay' || key === 'filter') ){ - return true; - } - } - } - return false; - } - - - // Add default image info reader - api.addInfoReader(/^image/, function (file/**File*/, callback/**Function*/){ - if( !file.__dimensions ){ - var defer = file.__dimensions = api.defer(); - - api.readAsImage(file, function (evt){ - var img = evt.target; - defer.resolve(evt.type == 'load' ? false : 'error', { - width: img.width - , height: img.height - }); - img.src = api.EMPTY_PNG; - img = null; - }); - } - - file.__dimensions.then(callback); - }); - - - /** - * Drag'n'Drop special event - * - * @param {HTMLElement} el - * @param {Function} onHover - * @param {Function} onDrop - */ - api.event.dnd = function (el, onHover, onDrop){ - var _id, _type; - - if( !onDrop ){ - onDrop = onHover; - onHover = api.F; - } - - if( FileReader ){ - // Hover - _on(el, 'dragenter dragleave dragover', onHover.ff = onHover.ff || function (evt){ - var - types = _getDataTransfer(evt).types - , i = types && types.length - , debounceTrigger = false - ; - - while( i-- ){ - if( ~types[i].indexOf('File') ){ - evt[preventDefault](); - - if( _type !== evt.type ){ - _type = evt.type; // Store current type of event - - if( _type != 'dragleave' ){ - onHover.call(evt[currentTarget], true, evt); - } - - debounceTrigger = true; - } - - break; // exit from "while" - } - } - - if( debounceTrigger ){ - clearTimeout(_id); - _id = setTimeout(function (){ - onHover.call(evt[currentTarget], _type != 'dragleave', evt); - }, 50); - } - }); - - - // Drop - _on(el, 'drop', onDrop.ff = onDrop.ff || function (evt){ - evt[preventDefault](); - - _type = 0; - onHover.call(evt[currentTarget], false, evt); - - api.getDropFiles(evt, function (files, all){ - onDrop.call(evt[currentTarget], files, all, evt); - }); - }); - } - else { - api.log("Drag'n'Drop -- not supported"); - } - }; - - - /** - * Remove drag'n'drop - * @param {HTMLElement} el - * @param {Function} onHover - * @param {Function} onDrop - */ - api.event.dnd.off = function (el, onHover, onDrop){ - _off(el, 'dragenter dragleave dragover', onHover.ff); - _off(el, 'drop', onDrop.ff); - }; - - - // Support jQuery - if( jQuery && !jQuery.fn.dnd ){ - jQuery.fn.dnd = function (onHover, onDrop){ - return this.each(function (){ - api.event.dnd(this, onHover, onDrop); - }); - }; - - jQuery.fn.offdnd = function (onHover, onDrop){ - return this.each(function (){ - api.event.dnd.off(this, onHover, onDrop); - }); - }; - } - - // @export - window.FileAPI = _extend(api, window.FileAPI); - - - // Debug info - api.log('FileAPI: ' + api.version); - api.log('protocol: ' + window.location.protocol); - api.log('doctype: [' + doctype.name + '] ' + doctype.publicId + ' ' + doctype.systemId); - - - // @detect 'x-ua-compatible' - _each(document.getElementsByTagName('meta'), function (meta){ - if( /x-ua-compatible/i.test(meta.getAttribute('http-equiv')) ){ - api.log('meta.http-equiv: ' + meta.getAttribute('content')); - } - }); - - - // Configuration - try { - _supportConsoleLog = !!console.log; - _supportConsoleLogApply = !!console.log.apply; - } - catch (err) {} - - if( !api.flashUrl ){ api.flashUrl = api.staticPath + 'FileAPI.flash.swf'; } - if( !api.flashImageUrl ){ api.flashImageUrl = api.staticPath + 'FileAPI.flash.image.swf'; } - if( !api.flashWebcamUrl ){ api.flashWebcamUrl = api.staticPath + 'FileAPI.flash.camera.swf'; } -})(window, void 0); - -/*global window, FileAPI, document */ - -(function (api, document, undef) { - 'use strict'; - - var - min = Math.min, - round = Math.round, - getCanvas = function () { return document.createElement('canvas'); }, - support = false, - exifOrientation = { - 8: 270 - , 3: 180 - , 6: 90 - , 7: 270 - , 4: 180 - , 5: 90 - } - ; - - try { - support = getCanvas().toDataURL('image/png').indexOf('data:image/png') > -1; - } - catch (e){} - - - function Image(file){ - if( file instanceof Image ){ - var img = new Image(file.file); - api.extend(img.matrix, file.matrix); - return img; - } - else if( !(this instanceof Image) ){ - return new Image(file); - } - - this.file = file; - this.size = file.size || 100; - - this.matrix = { - sx: 0, - sy: 0, - sw: 0, - sh: 0, - dx: 0, - dy: 0, - dw: 0, - dh: 0, - resize: 0, // min, max OR preview - deg: 0, - quality: 1, // jpeg quality - filter: 0 - }; - } - - - Image.prototype = { - image: true, - constructor: Image, - - set: function (attrs){ - api.extend(this.matrix, attrs); - return this; - }, - - crop: function (x, y, w, h){ - if( w === undef ){ - w = x; - h = y; - x = y = 0; - } - return this.set({ sx: x, sy: y, sw: w, sh: h || w }); - }, - - resize: function (w, h, strategy){ - if( /min|max|height|width/.test(h) ){ - strategy = h; - h = w; - } - - return this.set({ dw: w, dh: h || w, resize: strategy }); - }, - - preview: function (w, h){ - return this.resize(w, h || w, 'preview'); - }, - - rotate: function (deg){ - return this.set({ deg: deg }); - }, - - filter: function (filter){ - return this.set({ filter: filter }); - }, - - overlay: function (images){ - return this.set({ overlay: images }); - }, - - clone: function (){ - return new Image(this); - }, - - _load: function (image, fn){ - var self = this; - - if( /img|video/i.test(image.nodeName) ){ - fn.call(self, null, image); - } - else { - api.readAsImage(image, function (evt){ - fn.call(self, evt.type != 'load', evt.result); - }); - } - }, - - _apply: function (image, fn){ - var - canvas = getCanvas() - , m = this.getMatrix(image) - , ctx = canvas.getContext('2d') - , width = image.videoWidth || image.width - , height = image.videoHeight || image.height - , deg = m.deg - , dw = m.dw - , dh = m.dh - , w = width - , h = height - , filter = m.filter - , copy // canvas copy - , buffer = image - , overlay = m.overlay - , queue = api.queue(function (){ image.src = api.EMPTY_PNG; fn(false, canvas); }) - , renderImageToCanvas = api.renderImageToCanvas - ; - - // Normalize angle - deg = deg - Math.floor(deg/360)*360; - - // For `renderImageToCanvas` - image._type = this.file.type; - - while(m.multipass && min(w/dw, h/dh) > 2 ){ - w = (w/2 + 0.5)|0; - h = (h/2 + 0.5)|0; - - copy = getCanvas(); - copy.width = w; - copy.height = h; - - if( buffer !== image ){ - renderImageToCanvas(copy, buffer, 0, 0, buffer.width, buffer.height, 0, 0, w, h); - buffer = copy; - } - else { - buffer = copy; - renderImageToCanvas(buffer, image, m.sx, m.sy, m.sw, m.sh, 0, 0, w, h); - m.sx = m.sy = m.sw = m.sh = 0; - } - } - - - canvas.width = (deg % 180) ? dh : dw; - canvas.height = (deg % 180) ? dw : dh; - - canvas.type = m.type; - canvas.quality = m.quality; - - ctx.rotate(deg * Math.PI / 180); - renderImageToCanvas(ctx.canvas, buffer - , m.sx, m.sy - , m.sw || buffer.width - , m.sh || buffer.height - , (deg == 180 || deg == 270 ? -dw : 0) - , (deg == 90 || deg == 180 ? -dh : 0) - , dw, dh - ); - dw = canvas.width; - dh = canvas.height; - - // Apply overlay - overlay && api.each([].concat(overlay), function (over){ - queue.inc(); - // preload - var img = new window.Image, fn = function (){ - var - x = over.x|0 - , y = over.y|0 - , w = over.w || img.width - , h = over.h || img.height - , rel = over.rel - ; - - // center | right | left - x = (rel == 1 || rel == 4 || rel == 7) ? (dw - w + x)/2 : (rel == 2 || rel == 5 || rel == 8 ? dw - (w + x) : x); - - // center | bottom | top - y = (rel == 3 || rel == 4 || rel == 5) ? (dh - h + y)/2 : (rel >= 6 ? dh - (h + y) : y); - - api.event.off(img, 'error load abort', fn); - - try { - ctx.globalAlpha = over.opacity || 1; - ctx.drawImage(img, x, y, w, h); - } - catch (er){} - - queue.next(); - }; - - api.event.on(img, 'error load abort', fn); - img.src = over.src; - - if( img.complete ){ - fn(); - } - }); - - if( filter ){ - queue.inc(); - Image.applyFilter(canvas, filter, queue.next); - } - - queue.check(); - }, - - getMatrix: function (image){ - var - m = api.extend({}, this.matrix) - , sw = m.sw = m.sw || image.videoWidth || image.naturalWidth || image.width - , sh = m.sh = m.sh || image.videoHeight || image.naturalHeight || image.height - , dw = m.dw = m.dw || sw - , dh = m.dh = m.dh || sh - , sf = sw/sh, df = dw/dh - , strategy = m.resize - ; - - if( strategy == 'preview' ){ - if( dw != sw || dh != sh ){ - // Make preview - var w, h; - - if( df >= sf ){ - w = sw; - h = w / df; - } else { - h = sh; - w = h * df; - } - - if( w != sw || h != sh ){ - m.sx = ~~((sw - w)/2); - m.sy = ~~((sh - h)/2); - sw = w; - sh = h; - } - } - } - else if( strategy == 'height' ){ - dw = dh * sf; - } - else if( strategy == 'width' ){ - dh = dw / sf; - } - else if( strategy ){ - if( !(sw > dw || sh > dh) ){ - dw = sw; - dh = sh; - } - else if( strategy == 'min' ){ - dw = round(sf < df ? min(sw, dw) : dh*sf); - dh = round(sf < df ? dw/sf : min(sh, dh)); - } - else { - dw = round(sf >= df ? min(sw, dw) : dh*sf); - dh = round(sf >= df ? dw/sf : min(sh, dh)); - } - } - - m.sw = sw; - m.sh = sh; - m.dw = dw; - m.dh = dh; - m.multipass = api.multiPassResize; - return m; - }, - - _trans: function (fn){ - this._load(this.file, function (err, image){ - if( err ){ - fn(err); - } - else { - try { - this._apply(image, fn); - } catch (err){ - api.log('[err] FileAPI.Image.fn._apply:', err); - fn(err); - } - } - }); - }, - - - get: function (fn){ - if( api.support.transform ){ - var _this = this, matrix = _this.matrix; - - if( matrix.deg == 'auto' ){ - api.getInfo(_this.file, function (err, info){ - // rotate by exif orientation - matrix.deg = exifOrientation[info && info.exif && info.exif.Orientation] || 0; - _this._trans(fn); - }); - } - else { - _this._trans(fn); - } - } - else { - fn('not_support_transform'); - } - - return this; - }, - - - toData: function (fn){ - return this.get(fn); - } - - }; - - - Image.exifOrientation = exifOrientation; - - - Image.transform = function (file, transform, autoOrientation, fn){ - function _transform(err, img){ - // img -- info object - var - images = {} - , queue = api.queue(function (err){ - fn(err, images); - }) - ; - - if( !err ){ - api.each(transform, function (params, name){ - if( !queue.isFail() ){ - var ImgTrans = new Image(img.nodeType ? img : file), isFn = typeof params == 'function'; - - if( isFn ){ - params(img, ImgTrans); - } - else if( params.width ){ - ImgTrans[params.preview ? 'preview' : 'resize'](params.width, params.height, params.strategy); - } - else { - if( params.maxWidth && (img.width > params.maxWidth || img.height > params.maxHeight) ){ - ImgTrans.resize(params.maxWidth, params.maxHeight, 'max'); - } - } - - if( params.crop ){ - var crop = params.crop; - ImgTrans.crop(crop.x|0, crop.y|0, crop.w || crop.width, crop.h || crop.height); - } - - if( params.rotate === undef && autoOrientation ){ - params.rotate = 'auto'; - } - - ImgTrans.set({ type: ImgTrans.matrix.type || params.type || file.type || 'image/png' }); - - if( !isFn ){ - ImgTrans.set({ - deg: params.rotate - , overlay: params.overlay - , filter: params.filter - , quality: params.quality || 1 - }); - } - - queue.inc(); - ImgTrans.toData(function (err, image){ - if( err ){ - queue.fail(); - } - else { - images[name] = image; - queue.next(); - } - }); - } - }); - } - else { - queue.fail(); - } - } - - - // @todo: Оло-ло, нужно рефакторить это место - if( file.width ){ - _transform(false, file); - } else { - api.getInfo(file, _transform); - } - }; - - - // @const - api.each(['TOP', 'CENTER', 'BOTTOM'], function (x, i){ - api.each(['LEFT', 'CENTER', 'RIGHT'], function (y, j){ - Image[x+'_'+y] = i*3 + j; - Image[y+'_'+x] = i*3 + j; - }); - }); - - - /** - * Trabsform element to canvas - * - * @param {Image|HTMLVideoElement} el - * @returns {Canvas} - */ - Image.toCanvas = function(el){ - var canvas = document.createElement('canvas'); - canvas.width = el.videoWidth || el.width; - canvas.height = el.videoHeight || el.height; - canvas.getContext('2d').drawImage(el, 0, 0); - return canvas; - }; - - - /** - * Create image from DataURL - * @param {String} dataURL - * @param {Object} size - * @param {Function} callback - */ - Image.fromDataURL = function (dataURL, size, callback){ - var img = api.newImage(dataURL); - api.extend(img, size); - callback(img); - }; - - - /** - * Apply filter (caman.js) - * - * @param {Canvas|Image} canvas - * @param {String|Function} filter - * @param {Function} doneFn - */ - Image.applyFilter = function (canvas, filter, doneFn){ - if( typeof filter == 'function' ){ - filter(canvas, doneFn); - } - else if( window.Caman ){ - // http://camanjs.com/guides/ - window.Caman(canvas.tagName == 'IMG' ? Image.toCanvas(canvas) : canvas, function (){ - if( typeof filter == 'string' ){ - this[filter](); - } - else { - api.each(filter, function (val, method){ - this[method](val); - }, this); - } - this.render(doneFn); - }); - } - }; - - - /** - * For load-image-ios.js - */ - api.renderImageToCanvas = function (canvas, img, sx, sy, sw, sh, dx, dy, dw, dh){ - try { - return canvas.getContext('2d').drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh); - } catch (ex) { - api.log('renderImageToCanvas failed'); - throw ex; - } - }; - - - // @export - api.support.canvas = api.support.transform = support; - api.Image = Image; -})(FileAPI, document); - -/* - * JavaScript Load Image iOS scaling fixes 1.0.3 - * https://github.com/blueimp/JavaScript-Load-Image - * - * Copyright 2013, Sebastian Tschan - * https://blueimp.net - * - * iOS image scaling fixes based on - * https://github.com/stomita/ios-imagefile-megapixel - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/MIT - */ - -/*jslint nomen: true, bitwise: true */ -/*global FileAPI, window, document */ - -(function (factory) { - 'use strict'; - factory(FileAPI); -}(function (loadImage) { - 'use strict'; - - // Only apply fixes on the iOS platform: - if (!window.navigator || !window.navigator.platform || - !(/iP(hone|od|ad)/).test(window.navigator.platform)) { - return; - } - - var originalRenderMethod = loadImage.renderImageToCanvas; - - // Detects subsampling in JPEG images: - loadImage.detectSubsampling = function (img) { - var canvas, - context; - if (img.width * img.height > 1024 * 1024) { // only consider mexapixel images - canvas = document.createElement('canvas'); - canvas.width = canvas.height = 1; - context = canvas.getContext('2d'); - context.drawImage(img, -img.width + 1, 0); - // subsampled image becomes half smaller in rendering size. - // check alpha channel value to confirm image is covering edge pixel or not. - // if alpha value is 0 image is not covering, hence subsampled. - return context.getImageData(0, 0, 1, 1).data[3] === 0; - } - return false; - }; - - // Detects vertical squash in JPEG images: - loadImage.detectVerticalSquash = function (img, subsampled) { - var naturalHeight = img.naturalHeight || img.height, - canvas = document.createElement('canvas'), - context = canvas.getContext('2d'), - data, - sy, - ey, - py, - alpha; - if (subsampled) { - naturalHeight /= 2; - } - canvas.width = 1; - canvas.height = naturalHeight; - context.drawImage(img, 0, 0); - data = context.getImageData(0, 0, 1, naturalHeight).data; - // search image edge pixel position in case it is squashed vertically: - sy = 0; - ey = naturalHeight; - py = naturalHeight; - while (py > sy) { - alpha = data[(py - 1) * 4 + 3]; - if (alpha === 0) { - ey = py; - } else { - sy = py; - } - py = (ey + sy) >> 1; - } - return (py / naturalHeight) || 1; - }; - - // Renders image to canvas while working around iOS image scaling bugs: - // https://github.com/blueimp/JavaScript-Load-Image/issues/13 - loadImage.renderImageToCanvas = function ( - canvas, - img, - sourceX, - sourceY, - sourceWidth, - sourceHeight, - destX, - destY, - destWidth, - destHeight - ) { - if (img._type === 'image/jpeg') { - var context = canvas.getContext('2d'), - tmpCanvas = document.createElement('canvas'), - tileSize = 1024, - tmpContext = tmpCanvas.getContext('2d'), - subsampled, - vertSquashRatio, - tileX, - tileY; - tmpCanvas.width = tileSize; - tmpCanvas.height = tileSize; - context.save(); - subsampled = loadImage.detectSubsampling(img); - if (subsampled) { - sourceX /= 2; - sourceY /= 2; - sourceWidth /= 2; - sourceHeight /= 2; - } - vertSquashRatio = loadImage.detectVerticalSquash(img, subsampled); - if (subsampled || vertSquashRatio !== 1) { - sourceY *= vertSquashRatio; - destWidth = Math.ceil(tileSize * destWidth / sourceWidth); - destHeight = Math.ceil( - tileSize * destHeight / sourceHeight / vertSquashRatio - ); - destY = 0; - tileY = 0; - while (tileY < sourceHeight) { - destX = 0; - tileX = 0; - while (tileX < sourceWidth) { - tmpContext.clearRect(0, 0, tileSize, tileSize); - tmpContext.drawImage( - img, - sourceX, - sourceY, - sourceWidth, - sourceHeight, - -tileX, - -tileY, - sourceWidth, - sourceHeight - ); - context.drawImage( - tmpCanvas, - 0, - 0, - tileSize, - tileSize, - destX, - destY, - destWidth, - destHeight - ); - tileX += tileSize; - destX += destWidth; - } - tileY += tileSize; - destY += destHeight; - } - context.restore(); - return canvas; - } - } - return originalRenderMethod( - canvas, - img, - sourceX, - sourceY, - sourceWidth, - sourceHeight, - destX, - destY, - destWidth, - destHeight - ); - }; - -})); - -/*global window, FileAPI */ - -(function (api, window){ - "use strict"; - - var - document = window.document - , FormData = window.FormData - , Form = function (){ this.items = []; } - , encodeURIComponent = window.encodeURIComponent - ; - - - Form.prototype = { - - append: function (name, blob, file, type){ - this.items.push({ - name: name - , blob: blob && blob.blob || (blob == void 0 ? '' : blob) - , file: blob && (file || blob.name) - , type: blob && (type || blob.type) - }); - }, - - each: function (fn){ - var i = 0, n = this.items.length; - for( ; i < n; i++ ){ - fn.call(this, this.items[i]); - } - }, - - toData: function (fn, options){ - // allow chunked transfer if we have only one file to send - // flag is used below and in XHR._send - options._chunked = api.support.chunked && options.chunkSize > 0 && api.filter(this.items, function (item){ return item.file; }).length == 1; - - if( !api.support.html5 ){ - api.log('FileAPI.Form.toHtmlData'); - this.toHtmlData(fn); - } - else if( !api.formData || this.multipart || !FormData ){ - api.log('FileAPI.Form.toMultipartData'); - this.toMultipartData(fn); - } - else if( options._chunked ){ - api.log('FileAPI.Form.toPlainData'); - this.toPlainData(fn); - } - else { - api.log('FileAPI.Form.toFormData'); - this.toFormData(fn); - } - }, - - _to: function (data, complete, next, arg){ - var queue = api.queue(function (){ - complete(data); - }); - - this.each(function (file){ - try{ - next(file, data, queue, arg); - } - catch( err ){ - api.log('FileAPI.Form._to: ' + err.message); - complete(err); - } - }); - - queue.check(); - }, - - - toHtmlData: function (fn){ - this._to(document.createDocumentFragment(), fn, function (file, data/**DocumentFragment*/){ - var blob = file.blob, hidden; - - if( file.file ){ - api.reset(blob, true); - // set new name - blob.name = file.name; - blob.disabled = false; - data.appendChild(blob); - } - else { - hidden = document.createElement('input'); - hidden.name = file.name; - hidden.type = 'hidden'; - hidden.value = blob; - data.appendChild(hidden); - } - }); - }, - - toPlainData: function (fn){ - this._to({}, fn, function (file, data, queue){ - if( file.file ){ - data.type = file.file; - } - - if( file.blob.toBlob ){ - // canvas - queue.inc(); - _convertFile(file, function (file, blob){ - data.name = file.name; - data.file = blob; - data.size = blob.length; - data.type = file.type; - queue.next(); - }); - } - else if( file.file ){ - // file - data.name = file.blob.name; - data.file = file.blob; - data.size = file.blob.size; - data.type = file.type; - } - else { - // additional data - if( !data.params ){ - data.params = []; - } - data.params.push(encodeURIComponent(file.name) +"="+ encodeURIComponent(file.blob)); - } - - data.start = -1; - data.end = data.file && data.file.FileAPIReadPosition || -1; - data.retry = 0; - }); - }, - - toFormData: function (fn){ - this._to(new FormData, fn, function (file, data, queue){ - if( file.blob && file.blob.toBlob ){ - queue.inc(); - _convertFile(file, function (file, blob){ - data.append(file.name, blob, file.file); - queue.next(); - }); - } - else if( file.file ){ - data.append(file.name, file.blob, file.file); - } - else { - data.append(file.name, file.blob); - } - - if( file.file ){ - data.append('_'+file.name, file.file); - } - }); - }, - - - toMultipartData: function (fn){ - this._to([], fn, function (file, data, queue, boundary){ - queue.inc(); - _convertFile(file, function (file, blob){ - data.push( - '--_' + boundary + ('\r\nContent-Disposition: form-data; name="'+ file.name +'"'+ (file.file ? '; filename="'+ encodeURIComponent(file.file) +'"' : '') - + (file.file ? '\r\nContent-Type: '+ (file.type || 'application/octet-stream') : '') - + '\r\n' - + '\r\n'+ (file.file ? blob : encodeURIComponent(blob)) - + '\r\n') - ); - queue.next(); - }, true); - }, api.expando); - } - }; - - - function _convertFile(file, fn, useBinaryString){ - var blob = file.blob, filename = file.file; - - if( filename ){ - if( !blob.toDataURL ){ - // The Blob is not an image. - api.readAsBinaryString(blob, function (evt){ - if( evt.type == 'load' ){ - fn(file, evt.result); - } - }); - return; - } - - var - mime = { 'image/jpeg': '.jpe?g', 'image/png': '.png' } - , type = mime[file.type] ? file.type : 'image/png' - , ext = mime[type] || '.png' - , quality = blob.quality || 1 - ; - - if( !filename.match(new RegExp(ext+'$', 'i')) ){ - // Does not change the current extension, but add a new one. - filename += ext.replace('?', ''); - } - - file.file = filename; - file.type = type; - - if( !useBinaryString && blob.toBlob ){ - blob.toBlob(function (blob){ - fn(file, blob); - }, type, quality); - } - else { - fn(file, api.toBinaryString(blob.toDataURL(type, quality))); - } - } - else { - fn(file, blob); - } - } - - - // @export - api.Form = Form; -})(FileAPI, window); - -/*global window, FileAPI, Uint8Array */ - -(function (window, api){ - "use strict"; - - var - noop = function (){} - , document = window.document - - , XHR = function (options){ - this.uid = api.uid(); - this.xhr = { - abort: noop - , getResponseHeader: noop - , getAllResponseHeaders: noop - }; - this.options = options; - }, - - _xhrResponsePostfix = { '': 1, XML: 1, Text: 1, Body: 1 } - ; - - - XHR.prototype = { - status: 0, - statusText: '', - constructor: XHR, - - getResponseHeader: function (name){ - return this.xhr.getResponseHeader(name); - }, - - getAllResponseHeaders: function (){ - return this.xhr.getAllResponseHeaders() || {}; - }, - - end: function (status, statusText){ - var _this = this, options = _this.options; - - _this.end = - _this.abort = noop; - _this.status = status; - - if( statusText ){ - _this.statusText = statusText; - } - - api.log('xhr.end:', status, statusText); - options.complete(status == 200 || status == 201 ? false : _this.statusText || 'unknown', _this); - - if( _this.xhr && _this.xhr.node ){ - setTimeout(function (){ - var node = _this.xhr.node; - try { node.parentNode.removeChild(node); } catch (e){} - try { delete window[_this.uid]; } catch (e){} - window[_this.uid] = _this.xhr.node = null; - }, 9); - } - }, - - abort: function (){ - this.end(0, 'abort'); - - if( this.xhr ){ - this.xhr.aborted = true; - this.xhr.abort(); - } - }, - - send: function (FormData){ - var _this = this, options = this.options; - - FormData.toData(function (data){ - if( data instanceof Error ){ - _this.end(0, data.message); - } - else{ - // Start uploading - options.upload(options, _this); - _this._send.call(_this, options, data); - } - }, options); - }, - - _send: function (options, data){ - var _this = this, xhr, uid = _this.uid, onLoadFnName = _this.uid + "Load", url = options.url; - - api.log('XHR._send:', data); - - if( !options.cache ){ - // No cache - url += (~url.indexOf('?') ? '&' : '?') + api.uid(); - } - - if( data.nodeName ){ - var jsonp = options.jsonp; - - // prepare callback in GET - url = url.replace(/([a-z]+)=(\?)/i, '$1='+uid); - - // legacy - options.upload(options, _this); - - var - onPostMessage = function (evt){ - if( ~url.indexOf(evt.origin) ){ - try { - var result = api.parseJSON(evt.data); - if( result.id == uid ){ - complete(result.status, result.statusText, result.response); - } - } catch( err ){ - complete(0, err.message); - } - } - }, - - // jsonp-callack - complete = window[uid] = function (status, statusText, response){ - _this.readyState = 4; - _this.responseText = response; - _this.end(status, statusText); - - api.event.off(window, 'message', onPostMessage); - window[uid] = xhr = transport = window[onLoadFnName] = null; - } - ; - - _this.xhr.abort = function (){ - try { - if( transport.stop ){ transport.stop(); } - else if( transport.contentWindow.stop ){ transport.contentWindow.stop(); } - else { transport.contentWindow.document.execCommand('Stop'); } - } - catch (er) {} - complete(0, "abort"); - }; - - api.event.on(window, 'message', onPostMessage); - - window[onLoadFnName] = function (){ - try { - var - win = transport.contentWindow - , doc = win.document - , result = win.result || api.parseJSON(doc.body.innerHTML) - ; - complete(result.status, result.statusText, result.response); - } catch (e){ - api.log('[transport.onload]', e); - } - }; - - xhr = document.createElement('div'); - xhr.innerHTML = '
    ' - + '' - + (jsonp && (options.url.indexOf('=?') < 0) ? '' : '') - + '' - ; - - // get form-data & transport - var - form = xhr.getElementsByTagName('form')[0] - , transport = xhr.getElementsByTagName('iframe')[0] - ; - - form.appendChild(data); - - api.log(form.parentNode.innerHTML); - - // append to DOM - document.body.appendChild(xhr); - - // keep a reference to node-transport - _this.xhr.node = xhr; - - // send - _this.readyState = 2; // loaded - try { - form.submit(); - } catch (err) { - api.log('iframe.error: ' + err); - } - form = null; - } - else { - // Clean url - url = url.replace(/([a-z]+)=(\?)&?/i, ''); - - // html5 - if (this.xhr && this.xhr.aborted) { - api.log("Error: already aborted"); - return; - } - xhr = _this.xhr = api.getXHR(); - - if (data.params) { - url += (url.indexOf('?') < 0 ? "?" : "&") + data.params.join("&"); - } - - xhr.open('POST', url, true); - - if( api.withCredentials ){ - xhr.withCredentials = "true"; - } - - if( !options.headers || !options.headers['X-Requested-With'] ){ - xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - } - - api.each(options.headers, function (val, key){ - xhr.setRequestHeader(key, val); - }); - - - if ( options._chunked ) { - // chunked upload - if( xhr.upload ){ - xhr.upload.addEventListener('progress', api.throttle(function (/**Event*/evt){ - if (!data.retry) { - // show progress only for correct chunk uploads - options.progress({ - type: evt.type - , total: data.size - , loaded: data.start + evt.loaded - , totalSize: data.size - }, _this, options); - } - }, 100), false); - } - - xhr.onreadystatechange = function (){ - var lkb = parseInt(xhr.getResponseHeader('X-Last-Known-Byte'), 10); - - _this.status = xhr.status; - _this.statusText = xhr.statusText; - _this.readyState = xhr.readyState; - - if( xhr.readyState == 4 ){ - for( var k in _xhrResponsePostfix ){ - _this['response'+k] = xhr['response'+k]; - } - xhr.onreadystatechange = null; - - if (!xhr.status || xhr.status - 201 > 0) { - api.log("Error: " + xhr.status); - // some kind of error - // 0 - connection fail or timeout, if xhr.aborted is true, then it's not recoverable user action - // up - server error - if (((!xhr.status && !xhr.aborted) || 500 == xhr.status || 416 == xhr.status) && ++data.retry <= options.chunkUploadRetry) { - // let's try again the same chunk - // only applicable for recoverable error codes 500 && 416 - var delay = xhr.status ? 0 : api.chunkNetworkDownRetryTimeout; - - // inform about recoverable problems - options.pause(data.file, options); - - // smart restart if server reports about the last known byte - api.log("X-Last-Known-Byte: " + lkb); - if (lkb) { - data.end = lkb; - } else { - data.end = data.start - 1; - if (416 == xhr.status) { - data.end = data.end - options.chunkSize; - } - } - - setTimeout(function () { - _this._send(options, data); - }, delay); - } else { - // no mo retries - _this.end(xhr.status); - } - } else { - // success - data.retry = 0; - - if (data.end == data.size - 1) { - // finished - _this.end(xhr.status); - } else { - // next chunk - - // shift position if server reports about the last known byte - api.log("X-Last-Known-Byte: " + lkb); - if (lkb) { - data.end = lkb; - } - data.file.FileAPIReadPosition = data.end; - - setTimeout(function () { - _this._send(options, data); - }, 0); - } - } - - xhr = null; - } - }; - - data.start = data.end + 1; - data.end = Math.max(Math.min(data.start + options.chunkSize, data.size) - 1, data.start); - - // Retrieve a slice of file - var - file = data.file - , slice = (file.slice || file.mozSlice || file.webkitSlice).call(file, data.start, data.end + 1) - ; - - if( data.size && !slice.size ){ - setTimeout(function (){ - _this.end(-1); - }); - } else { - xhr.setRequestHeader("Content-Range", "bytes " + data.start + "-" + data.end + "/" + data.size); - xhr.setRequestHeader("Content-Disposition", 'attachment; filename=' + encodeURIComponent(data.name)); - xhr.setRequestHeader("Content-Type", data.type || "application/octet-stream"); - - xhr.send(slice); - } - - file = slice = null; - } else { - // single piece upload - if( xhr.upload ){ - // https://github.com/blueimp/jQuery-File-Upload/wiki/Fixing-Safari-hanging-on-very-high-speed-connections-%281Gbps%29 - xhr.upload.addEventListener('progress', api.throttle(function (/**Event*/evt){ - options.progress(evt, _this, options); - }, 100), false); - } - - xhr.onreadystatechange = function (){ - _this.status = xhr.status; - _this.statusText = xhr.statusText; - _this.readyState = xhr.readyState; - - if( xhr.readyState == 4 ){ - for( var k in _xhrResponsePostfix ){ - _this['response'+k] = xhr['response'+k]; - } - xhr.onreadystatechange = null; - - if (!xhr.status || xhr.status > 201) { - api.log("Error: " + xhr.status); - if (((!xhr.status && !xhr.aborted) || 500 == xhr.status) && (options.retry || 0) < options.uploadRetry) { - options.retry = (options.retry || 0) + 1; - var delay = api.networkDownRetryTimeout; - - // inform about recoverable problems - options.pause(options.file, options); - - setTimeout(function () { - _this._send(options, data); - }, delay); - } else { - //success - _this.end(xhr.status); - } - } else { - //success - _this.end(xhr.status); - } - - xhr = null; - } - }; - - if( api.isArray(data) ){ - // multipart - xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary=_'+api.expando); - var rawData = data.join('') +'--_'+ api.expando +'--'; - - /** @namespace xhr.sendAsBinary https://developer.mozilla.org/ru/XMLHttpRequest#Sending_binary_content */ - if( xhr.sendAsBinary ){ - xhr.sendAsBinary(rawData); - } - else { - var bytes = Array.prototype.map.call(rawData, function(c){ return c.charCodeAt(0) & 0xff; }); - xhr.send(new Uint8Array(bytes).buffer); - - } - } else { - // FormData - xhr.send(data); - } - } - } - } - }; - - - // @export - api.XHR = XHR; -})(window, FileAPI); - -/** - * @class FileAPI.Camera - * @author RubaXa - * @support Chrome 21+, FF 18+, Opera 12+ - */ - -/*global window, FileAPI, jQuery */ -/** @namespace LocalMediaStream -- https://developer.mozilla.org/en-US/docs/WebRTC/MediaStream_API#LocalMediaStream */ -(function (window, api){ - "use strict"; - - var - URL = window.URL || window.webkitURL, - - document = window.document, - navigator = window.navigator, - - getMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia, - - html5 = !!getMedia - ; - - - // Support "media" - api.support.media = html5; - - - var Camera = function (video){ - this.video = video; - }; - - - Camera.prototype = { - isActive: function (){ - return !!this._active; - }, - - - /** - * Start camera streaming - * @param {Function} callback - */ - start: function (callback){ - var - _this = this - , video = _this.video - , _successId - , _failId - , _complete = function (err){ - _this._active = !err; - clearTimeout(_failId); - clearTimeout(_successId); -// api.event.off(video, 'loadedmetadata', _complete); - callback && callback(err, _this); - } - ; - - getMedia.call(navigator, { video: true }, function (stream/**LocalMediaStream*/){ - // Success - _this.stream = stream; - -// api.event.on(video, 'loadedmetadata', function (){ -// _complete(null); -// }); - - // Set camera stream - video.src = URL.createObjectURL(stream); - - // Note: onloadedmetadata doesn't fire in Chrome when using it with getUserMedia. - // See crbug.com/110938. - _successId = setInterval(function (){ - if( _detectVideoSignal(video) ){ - _complete(null); - } - }, 1000); - - _failId = setTimeout(function (){ - _complete('timeout'); - }, 5000); - - // Go-go-go! - video.play(); - }, _complete/*error*/); - }, - - - /** - * Stop camera streaming - */ - stop: function (){ - try { - this._active = false; - this.video.pause(); - - try { - this.stream.stop(); - } catch (err) { - api.each(this.stream.getTracks(), function (track) { - track.stop(); - }); - } - - this.stream = null; - } catch( err ){ - api.log('[FileAPI.Camera] stop:', err); - } - }, - - - /** - * Create screenshot - * @return {FileAPI.Camera.Shot} - */ - shot: function (){ - return new Shot(this.video); - } - }; - - - /** - * Get camera element from container - * - * @static - * @param {HTMLElement} el - * @return {Camera} - */ - Camera.get = function (el){ - return new Camera(el.firstChild); - }; - - - /** - * Publish camera element into container - * - * @static - * @param {HTMLElement} el - * @param {Object} options - * @param {Function} [callback] - */ - Camera.publish = function (el, options, callback){ - if( typeof options == 'function' ){ - callback = options; - options = {}; - } - - // Dimensions of "camera" - options = api.extend({}, { - width: '100%' - , height: '100%' - , start: true - }, options); - - - if( el.jquery ){ - // Extract first element, from jQuery collection - el = el[0]; - } - - - var doneFn = function (err){ - if( err ){ - callback(err); - } - else { - // Get camera - var cam = Camera.get(el); - if( options.start ){ - cam.start(callback); - } - else { - callback(null, cam); - } - } - }; - - - el.style.width = _px(options.width); - el.style.height = _px(options.height); - - - if( api.html5 && html5 ){ - // Create video element - var video = document.createElement('video'); - - // Set dimensions - video.style.width = _px(options.width); - video.style.height = _px(options.height); - - // Clean container - if( window.jQuery ){ - jQuery(el).empty(); - } else { - el.innerHTML = ''; - } - - // Add "camera" to container - el.appendChild(video); - - // end - doneFn(); - } - else { - Camera.fallback(el, options, doneFn); - } - }; - - - Camera.fallback = function (el, options, callback){ - callback('not_support_camera'); - }; - - - /** - * @class FileAPI.Camera.Shot - */ - var Shot = function (video){ - var canvas = video.nodeName ? api.Image.toCanvas(video) : video; - var shot = api.Image(canvas); - shot.type = 'image/png'; - shot.width = canvas.width; - shot.height = canvas.height; - shot.size = canvas.width * canvas.height * 4; - return shot; - }; - - - /** - * Add "px" postfix, if value is a number - * - * @private - * @param {*} val - * @return {String} - */ - function _px(val){ - return val >= 0 ? val + 'px' : val; - } - - - /** - * @private - * @param {HTMLVideoElement} video - * @return {Boolean} - */ - function _detectVideoSignal(video){ - var canvas = document.createElement('canvas'), ctx, res = false; - try { - ctx = canvas.getContext('2d'); - ctx.drawImage(video, 0, 0, 1, 1); - res = ctx.getImageData(0, 0, 1, 1).data[4] != 255; - } - catch( err ){ - api.log('[FileAPI.Camera] detectVideoSignal:', err); - } - return res; - } - - - // @export - Camera.Shot = Shot; - api.Camera = Camera; -})(window, FileAPI); - -/** - * FileAPI fallback to Flash - * - * @flash-developer "Vladimir Demidov" - */ - -/*global window, FileAPI */ -(function (window, jQuery, api) { - "use strict"; - - var _each = api.each, - _cameraQueue = []; - - if (api.support.flash && (api.media && (!api.support.media || !api.html5))) { - (function () { - function _wrap(fn) { - var id = fn.wid = api.uid(); - api.Flash._fn[id] = fn; - return 'FileAPI.Flash._fn.' + id; - } - - - function _unwrap(fn) { - try { - api.Flash._fn[fn.wid] = null; - delete api.Flash._fn[fn.wid]; - } catch (e) { - } - } - - var flash = api.Flash; - api.extend(api.Flash, { - - patchCamera: function () { - api.Camera.fallback = function (el, options, callback) { - var camId = api.uid(); - api.log('FlashAPI.Camera.publish: ' + camId); - flash.publish(el, camId, api.extend(options, { - camera: true, - onEvent: _wrap(function _(evt) { - if (evt.type === 'camera') { - _unwrap(_); - - if (evt.error) { - api.log('FlashAPI.Camera.publish.error: ' + evt.error); - callback(evt.error); - } else { - api.log('FlashAPI.Camera.publish.success: ' + camId); - callback(null); - } - } - }) - })); - }; - // Run - _each(_cameraQueue, function (args) { - api.Camera.fallback.apply(api.Camera, args); - }); - _cameraQueue = []; - - - // FileAPI.Camera:proto - api.extend(api.Camera.prototype, { - _id: function () { - return this.video.id; - }, - - start: function (callback) { - var _this = this; - flash.cmd(this._id(), 'camera.on', { - callback: _wrap(function _(evt) { - _unwrap(_); - - if (evt.error) { - api.log('FlashAPI.camera.on.error: ' + evt.error); - callback(evt.error, _this); - } else { - api.log('FlashAPI.camera.on.success: ' + _this._id()); - _this._active = true; - callback(null, _this); - } - }) - }); - }, - - stop: function () { - this._active = false; - flash.cmd(this._id(), 'camera.off'); - }, - - shot: function () { - api.log('FlashAPI.Camera.shot:', this._id()); - - var shot = api.Flash.cmd(this._id(), 'shot', {}); - shot.type = 'image/png'; - shot.flashId = this._id(); - shot.isShot = true; - - return new api.Camera.Shot(shot); - } - }); - } - }); - - api.Camera.fallback = function () { - _cameraQueue.push(arguments); - }; - - }()); - } -}(window, window.jQuery, FileAPI)); +/*! FileAPI 2.0.19 - BSD | git://github.com/mailru/FileAPI.git + * FileAPI — a set of javascript tools for working with files. Multiupload, drag'n'drop and chunked file upload. Images: crop, resize and auto orientation by EXIF. + */ + +/* + * JavaScript Canvas to Blob 2.0.5 + * https://github.com/blueimp/JavaScript-Canvas-to-Blob + * + * Copyright 2012, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * http://www.opensource.org/licenses/MIT + * + * Based on stackoverflow user Stoive's code snippet: + * http://stackoverflow.com/q/4998908 + */ + +/*jslint nomen: true, regexp: true */ +/*global window, atob, Blob, ArrayBuffer, Uint8Array */ + +(function (window) { + 'use strict'; + var CanvasPrototype = window.HTMLCanvasElement && + window.HTMLCanvasElement.prototype, + hasBlobConstructor = window.Blob && (function () { + try { + return Boolean(new Blob()); + } catch (e) { + return false; + } + }()), + hasArrayBufferViewSupport = hasBlobConstructor && window.Uint8Array && + (function () { + try { + return new Blob([new Uint8Array(100)]).size === 100; + } catch (e) { + return false; + } + }()), + BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || + window.MozBlobBuilder || window.MSBlobBuilder, + dataURLtoBlob = (hasBlobConstructor || BlobBuilder) && window.atob && + window.ArrayBuffer && window.Uint8Array && function (dataURI) { + var byteString, + arrayBuffer, + intArray, + i, + mimeString, + bb; + if (dataURI.split(',')[0].indexOf('base64') >= 0) { + // Convert base64 to raw binary data held in a string: + byteString = atob(dataURI.split(',')[1]); + } else { + // Convert base64/URLEncoded data component to raw binary data: + byteString = decodeURIComponent(dataURI.split(',')[1]); + } + // Write the bytes of the string to an ArrayBuffer: + arrayBuffer = new ArrayBuffer(byteString.length); + intArray = new Uint8Array(arrayBuffer); + for (i = 0; i < byteString.length; i += 1) { + intArray[i] = byteString.charCodeAt(i); + } + // Separate out the mime component: + mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; + // Write the ArrayBuffer (or ArrayBufferView) to a blob: + if (hasBlobConstructor) { + return new Blob( + [hasArrayBufferViewSupport ? intArray : arrayBuffer], + {type: mimeString} + ); + } + bb = new BlobBuilder(); + bb.append(arrayBuffer); + return bb.getBlob(mimeString); + }; + if (window.HTMLCanvasElement && !CanvasPrototype.toBlob) { + if (CanvasPrototype.mozGetAsFile) { + CanvasPrototype.toBlob = function (callback, type, quality) { + if (quality && CanvasPrototype.toDataURL && dataURLtoBlob) { + callback(dataURLtoBlob(this.toDataURL(type, quality))); + } else { + callback(this.mozGetAsFile('blob', type)); + } + }; + } else if (CanvasPrototype.toDataURL && dataURLtoBlob) { + CanvasPrototype.toBlob = function (callback, type, quality) { + callback(dataURLtoBlob(this.toDataURL(type, quality))); + }; + } + } + window.dataURLtoBlob = dataURLtoBlob; +})(window); + +/*jslint evil: true */ +/*global window, URL, webkitURL, ActiveXObject */ + +(function (window, undef){ + 'use strict'; + + var + gid = 1, + noop = function (){}, + + document = window.document, + doctype = document.doctype || {}, + userAgent = window.navigator.userAgent, + safari = /safari\//i.test(userAgent) && !/chrome\//i.test(userAgent), + iemobile = /iemobile\//i.test(userAgent), + + // https://github.com/blueimp/JavaScript-Load-Image/blob/master/load-image.js#L48 + apiURL = (window.createObjectURL && window) || (window.URL && URL.revokeObjectURL && URL) || (window.webkitURL && webkitURL), + + Blob = window.Blob, + File = window.File, + FileReader = window.FileReader, + FormData = window.FormData, + + + XMLHttpRequest = window.XMLHttpRequest, + jQuery = window.jQuery, + + html5 = !!(File && (FileReader && (window.Uint8Array || FormData || XMLHttpRequest.prototype.sendAsBinary))) + && !(safari && /windows/i.test(userAgent) && !iemobile), // BugFix: https://github.com/mailru/FileAPI/issues/25 + + cors = html5 && ('withCredentials' in (new XMLHttpRequest)), + + chunked = html5 && !!Blob && !!(Blob.prototype.webkitSlice || Blob.prototype.mozSlice || Blob.prototype.slice), + + normalize = ('' + ''.normalize).indexOf('[native code]') > 0, + + // https://github.com/blueimp/JavaScript-Canvas-to-Blob + dataURLtoBlob = window.dataURLtoBlob, + + + _rimg = /img/i, + _rcanvas = /canvas/i, + _rimgcanvas = /img|canvas/i, + _rinput = /input/i, + _rdata = /^data:[^,]+,/, + + _toString = {}.toString, + _supportConsoleLog, + _supportConsoleLogApply, + + + Math = window.Math, + + _SIZE_CONST = function (pow){ + pow = new window.Number(Math.pow(1024, pow)); + pow.from = function (sz){ return Math.round(sz * this); }; + return pow; + }, + + _elEvents = {}, // element event listeners + _infoReader = [], // list of file info processors + + _readerEvents = 'abort progress error load loadend', + _xhrPropsExport = 'status statusText readyState response responseXML responseText responseBody'.split(' '), + + currentTarget = 'currentTarget', // for minimize + preventDefault = 'preventDefault', // and this too + + _isArray = function (ar) { + return ar && ('length' in ar); + }, + + /** + * Iterate over a object or array + */ + _each = function (obj, fn, ctx){ + if( obj ){ + if( _isArray(obj) ){ + for( var i = 0, n = obj.length; i < n; i++ ){ + if( i in obj ){ + fn.call(ctx, obj[i], i, obj); + } + } + } + else { + for( var key in obj ){ + if( obj.hasOwnProperty(key) ){ + fn.call(ctx, obj[key], key, obj); + } + } + } + } + }, + + /** + * Merge the contents of two or more objects together into the first object + */ + _extend = function (dst){ + var args = arguments, i = 1, _ext = function (val, key){ dst[key] = val; }; + for( ; i < args.length; i++ ){ + _each(args[i], _ext); + } + return dst; + }, + + /** + * Add event listener + */ + _on = function (el, type, fn){ + if( el ){ + var uid = api.uid(el); + + if( !_elEvents[uid] ){ + _elEvents[uid] = {}; + } + + var isFileReader = (FileReader && el) && (el instanceof FileReader); + _each(type.split(/\s+/), function (type){ + if( jQuery && !isFileReader){ + jQuery.event.add(el, type, fn); + } else { + if( !_elEvents[uid][type] ){ + _elEvents[uid][type] = []; + } + + _elEvents[uid][type].push(fn); + + if( el.addEventListener ){ el.addEventListener(type, fn, false); } + else if( el.attachEvent ){ el.attachEvent('on'+type, fn); } + else { el['on'+type] = fn; } + } + }); + } + }, + + + /** + * Remove event listener + */ + _off = function (el, type, fn){ + if( el ){ + var uid = api.uid(el), events = _elEvents[uid] || {}; + + var isFileReader = (FileReader && el) && (el instanceof FileReader); + _each(type.split(/\s+/), function (type){ + if( jQuery && !isFileReader){ + jQuery.event.remove(el, type, fn); + } + else { + var fns = events[type] || [], i = fns.length; + + while( i-- ){ + if( fns[i] === fn ){ + fns.splice(i, 1); + break; + } + } + + if( el.addEventListener ){ el.removeEventListener(type, fn, false); } + else if( el.detachEvent ){ el.detachEvent('on'+type, fn); } + else { el['on'+type] = null; } + } + }); + } + }, + + + _one = function(el, type, fn){ + _on(el, type, function _(evt){ + _off(el, type, _); + fn(evt); + }); + }, + + + _fixEvent = function (evt){ + if( !evt.target ){ evt.target = window.event && window.event.srcElement || document; } + if( evt.target.nodeType === 3 ){ evt.target = evt.target.parentNode; } + return evt; + }, + + + _supportInputAttr = function (attr){ + var input = document.createElement('input'); + input.setAttribute('type', "file"); + return attr in input; + }, + + + /** + * FileAPI (core object) + */ + api = { + version: '2.0.19', + + cors: false, + html5: true, + media: false, + formData: true, + multiPassResize: true, + + debug: false, + pingUrl: false, + multiFlash: false, + flashAbortTimeout: 0, + withCredentials: true, + + staticPath: './dist/', + + flashUrl: 0, // @default: './FileAPI.flash.swf' + flashImageUrl: 0, // @default: './FileAPI.flash.image.swf' + + postNameConcat: function (name, idx){ + return name + (idx != null ? '['+ idx +']' : ''); + }, + + ext2mime: { + jpg: 'image/jpeg' + , tif: 'image/tiff' + , txt: 'text/plain' + }, + + // Fallback for flash + accept: { + 'image/*': 'art bm bmp dwg dxf cbr cbz fif fpx gif ico iefs jfif jpe jpeg jpg jps jut mcf nap nif pbm pcx pgm pict pm png pnm qif qtif ras rast rf rp svf tga tif tiff xbm xbm xpm xwd' + , 'audio/*': 'm4a flac aac rm mpa wav wma ogg mp3 mp2 m3u mod amf dmf dsm far gdm imf it m15 med okt s3m stm sfx ult uni xm sid ac3 dts cue aif aiff wpl ape mac mpc mpp shn wv nsf spc gym adplug adx dsp adp ymf ast afc hps xs' + , 'video/*': 'm4v 3gp nsv ts ty strm rm rmvb m3u ifo mov qt divx xvid bivx vob nrg img iso pva wmv asf asx ogm m2v avi bin dat dvr-ms mpg mpeg mp4 mkv avc vp3 svq3 nuv viv dv fli flv wpl' + }, + + uploadRetry : 0, + networkDownRetryTimeout : 5000, // milliseconds, don't flood when network is down + + chunkSize : 0, + chunkUploadRetry : 0, + chunkNetworkDownRetryTimeout : 2000, // milliseconds, don't flood when network is down + + KB: _SIZE_CONST(1), + MB: _SIZE_CONST(2), + GB: _SIZE_CONST(3), + TB: _SIZE_CONST(4), + + EMPTY_PNG: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=', + + expando: 'fileapi' + (new Date).getTime(), + + uid: function (obj){ + return obj + ? (obj[api.expando] = obj[api.expando] || api.uid()) + : (++gid, api.expando + gid) + ; + }, + + log: function (){ + if( api.debug && _supportConsoleLog ){ + if( _supportConsoleLogApply ){ + console.log.apply(console, arguments); + } + else { + console.log([].join.call(arguments, ' ')); + } + } + }, + + /** + * Create new image + * + * @param {String} [src] + * @param {Function} [fn] 1. error -- boolean, 2. img -- Image element + * @returns {HTMLElement} + */ + newImage: function (src, fn){ + var img = document.createElement('img'); + if( fn ){ + api.event.one(img, 'error load', function (evt){ + fn(evt.type == 'error', img); + img = null; + }); + } + img.src = src; + return img; + }, + + /** + * Get XHR + * @returns {XMLHttpRequest} + */ + getXHR: function (){ + var xhr; + + if( XMLHttpRequest ){ + xhr = new XMLHttpRequest; + } + else if( window.ActiveXObject ){ + try { + xhr = new ActiveXObject('MSXML2.XMLHttp.3.0'); + } catch (e) { + xhr = new ActiveXObject('Microsoft.XMLHTTP'); + } + } + + return xhr; + }, + + isArray: _isArray, + + support: { + dnd: cors && ('ondrop' in document.createElement('div')), + cors: cors, + html5: html5, + chunked: chunked, + dataURI: true, + accept: _supportInputAttr('accept'), + multiple: _supportInputAttr('multiple') + }, + + event: { + on: _on + , off: _off + , one: _one + , fix: _fixEvent + }, + + + throttle: function(fn, delay) { + var id, args; + + return function _throttle(){ + args = arguments; + + if( !id ){ + fn.apply(window, args); + id = setTimeout(function (){ + id = 0; + fn.apply(window, args); + }, delay); + } + }; + }, + + + F: function (){}, + + + parseJSON: function (str){ + var json; + if( window.JSON && JSON.parse ){ + json = JSON.parse(str); + } + else { + json = (new Function('return ('+str.replace(/([\r\n])/g, '\\$1')+');'))(); + } + return json; + }, + + + trim: function (str){ + str = String(str); + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); + }, + + /** + * Simple Defer + * @return {Object} + */ + defer: function (){ + var + list = [] + , result + , error + , defer = { + resolve: function (err, res){ + defer.resolve = noop; + error = err || false; + result = res; + + while( res = list.shift() ){ + res(error, result); + } + }, + + then: function (fn){ + if( error !== undef ){ + fn(error, result); + } else { + list.push(fn); + } + } + }; + + return defer; + }, + + queue: function (fn){ + var + _idx = 0 + , _length = 0 + , _fail = false + , _end = false + , queue = { + inc: function (){ + _length++; + }, + + next: function (){ + _idx++; + setTimeout(queue.check, 0); + }, + + check: function (){ + (_idx >= _length) && !_fail && queue.end(); + }, + + isFail: function (){ + return _fail; + }, + + fail: function (){ + !_fail && fn(_fail = true); + }, + + end: function (){ + if( !_end ){ + _end = true; + fn(); + } + } + } + ; + return queue; + }, + + + /** + * For each object + * + * @param {Object|Array} obj + * @param {Function} fn + * @param {*} [ctx] + */ + each: _each, + + + /** + * Async for + * @param {Array} array + * @param {Function} callback + */ + afor: function (array, callback){ + var i = 0, n = array.length; + + if( _isArray(array) && n-- ){ + (function _next(){ + callback(n != i && _next, array[i], i++); + })(); + } + else { + callback(false); + } + }, + + + /** + * Merge the contents of two or more objects together into the first object + * + * @param {Object} dst + * @return {Object} + */ + extend: _extend, + + + /** + * Is file? + * @param {File} file + * @return {Boolean} + */ + isFile: function (file){ + return _toString.call(file) === '[object File]'; + }, + + + /** + * Is blob? + * @param {Blob} blob + * @returns {Boolean} + */ + isBlob: function (blob) { + return this.isFile(blob) || (_toString.call(blob) === '[object Blob]'); + }, + + + /** + * Is canvas element + * + * @param {HTMLElement} el + * @return {Boolean} + */ + isCanvas: function (el){ + return el && _rcanvas.test(el.nodeName); + }, + + + getFilesFilter: function (filter){ + filter = typeof filter == 'string' ? filter : (filter.getAttribute && filter.getAttribute('accept') || ''); + return filter ? new RegExp('('+ filter.replace(/\./g, '\\.').replace(/,/g, '|') +')$', 'i') : /./; + }, + + + + /** + * Read as DataURL + * + * @param {File|Element} file + * @param {Function} fn + */ + readAsDataURL: function (file, fn){ + if( api.isCanvas(file) ){ + _emit(file, fn, 'load', api.toDataURL(file)); + } + else { + _readAs(file, fn, 'DataURL'); + } + }, + + + /** + * Read as Binary string + * + * @param {File} file + * @param {Function} fn + */ + readAsBinaryString: function (file, fn){ + if( _hasSupportReadAs('BinaryString') ){ + _readAs(file, fn, 'BinaryString'); + } else { + // Hello IE10! + _readAs(file, function (evt){ + if( evt.type == 'load' ){ + try { + // dataURL -> binaryString + evt.result = api.toBinaryString(evt.result); + } catch (e){ + evt.type = 'error'; + evt.message = e.toString(); + } + } + fn(evt); + }, 'DataURL'); + } + }, + + + /** + * Read as ArrayBuffer + * + * @param {File} file + * @param {Function} fn + */ + readAsArrayBuffer: function(file, fn){ + _readAs(file, fn, 'ArrayBuffer'); + }, + + + /** + * Read as text + * + * @param {File} file + * @param {String} encoding + * @param {Function} [fn] + */ + readAsText: function(file, encoding, fn){ + if( !fn ){ + fn = encoding; + encoding = 'utf-8'; + } + + _readAs(file, fn, 'Text', encoding); + }, + + + /** + * Convert image or canvas to DataURL + * + * @param {Element} el Image or Canvas element + * @param {String} [type] mime-type + * @return {String} + */ + toDataURL: function (el, type){ + if( typeof el == 'string' ){ + return el; + } + else if( el.toDataURL ){ + return el.toDataURL(type || 'image/png'); + } + }, + + + /** + * Canvert string, image or canvas to binary string + * + * @param {String|Element} val + * @return {String} + */ + toBinaryString: function (val){ + return window.atob(api.toDataURL(val).replace(_rdata, '')); + }, + + + /** + * Read file or DataURL as ImageElement + * + * @param {File|String} file + * @param {Function} fn + * @param {Boolean} [progress] + */ + readAsImage: function (file, fn, progress){ + if( api.isBlob(file) ){ + if( apiURL ){ + /** @namespace apiURL.createObjectURL */ + var data = apiURL.createObjectURL(file); + if( data === undef ){ + _emit(file, fn, 'error'); + } + else { + api.readAsImage(data, fn, progress); + } + } + else { + api.readAsDataURL(file, function (evt){ + if( evt.type == 'load' ){ + api.readAsImage(evt.result, fn, progress); + } + else if( progress || evt.type == 'error' ){ + _emit(file, fn, evt, null, { loaded: evt.loaded, total: evt.total }); + } + }); + } + } + else if( api.isCanvas(file) ){ + _emit(file, fn, 'load', file); + } + else if( _rimg.test(file.nodeName) ){ + if( file.complete ){ + _emit(file, fn, 'load', file); + } + else { + var events = 'error abort load'; + _one(file, events, function _fn(evt){ + if( evt.type == 'load' && apiURL ){ + /** @namespace apiURL.revokeObjectURL */ + apiURL.revokeObjectURL(file.src); + } + + _off(file, events, _fn); + _emit(file, fn, evt, file); + }); + } + } + else if( file.iframe ){ + _emit(file, fn, { type: 'error' }); + } + else { + // Created image + var img = api.newImage(file.dataURL || file); + api.readAsImage(img, fn, progress); + } + }, + + + /** + * Make file by name + * + * @param {String} name + * @return {Array} + */ + checkFileObj: function (name){ + var file = {}, accept = api.accept; + + if( typeof name == 'object' ){ + file = name; + } + else { + file.name = (name + '').split(/\\|\//g).pop(); + } + + if( file.type == null ){ + file.type = file.name.split('.').pop(); + } + + _each(accept, function (ext, type){ + ext = new RegExp(ext.replace(/\s/g, '|'), 'i'); + if( ext.test(file.type) || api.ext2mime[file.type] ){ + file.type = api.ext2mime[file.type] || (type.split('/')[0] +'/'+ file.type); + } + }); + + return file; + }, + + + /** + * Get drop files + * + * @param {Event} evt + * @param {Function} callback + */ + getDropFiles: function (evt, callback){ + var + files = [] + , all = [] + , items + , dataTransfer = _getDataTransfer(evt) + , transFiles = dataTransfer.files + , transItems = dataTransfer.items + , entrySupport = _isArray(transItems) && transItems[0] && _getAsEntry(transItems[0]) + , queue = api.queue(function (){ callback(files, all); }) + ; + + if( entrySupport ){ + if( normalize && transFiles ){ + var + i = transFiles.length + , file + , entry + ; + + items = new Array(i); + while( i-- ){ + file = transFiles[i]; + + try { + entry = _getAsEntry(transItems[i]); + } + catch( err ){ + api.log('[err] getDropFiles: ', err); + entry = null; + } + + if( _isEntry(entry) ){ + // OSX filesystems use Unicode Normalization Form D (NFD), + // and entry.file(…) can't read the files with the same names + if( entry.isDirectory || (entry.isFile && file.name == file.name.normalize('NFC')) ){ + items[i] = entry; + } + else { + items[i] = file; + } + } + else { + items[i] = file; + } + } + } + else { + items = transItems; + } + } + else { + items = transFiles; + } + + _each(items || [], function (item){ + queue.inc(); + + try { + if( entrySupport && _isEntry(item) ){ + _readEntryAsFiles(item, function (err, entryFiles, allEntries){ + if( err ){ + api.log('[err] getDropFiles:', err); + } else { + files.push.apply(files, entryFiles); + } + all.push.apply(all, allEntries); + + queue.next(); + }); + } + else { + _isRegularFile(item, function (yes, err){ + if( yes ){ + files.push(item); + } + else { + item.error = err; + } + all.push(item); + + queue.next(); + }); + } + } + catch( err ){ + queue.next(); + api.log('[err] getDropFiles: ', err); + } + }); + + queue.check(); + }, + + + /** + * Get file list + * + * @param {HTMLInputElement|Event} input + * @param {String|Function} [filter] + * @param {Function} [callback] + * @return {Array|Null} + */ + getFiles: function (input, filter, callback){ + var files = []; + + if( callback ){ + api.filterFiles(api.getFiles(input), filter, callback); + return null; + } + + if( input.jquery ){ + // jQuery object + input.each(function (){ + files = files.concat(api.getFiles(this)); + }); + input = files; + files = []; + } + + if( typeof filter == 'string' ){ + filter = api.getFilesFilter(filter); + } + + if( input.originalEvent ){ + // jQuery event + input = _fixEvent(input.originalEvent); + } + else if( input.srcElement ){ + // IE Event + input = _fixEvent(input); + } + + + if( input.dataTransfer ){ + // Drag'n'Drop + input = input.dataTransfer; + } + else if( input.target ){ + // Event + input = input.target; + } + + if( input.files ){ + // Input[type="file"] + files = input.files; + + if( !html5 ){ + // Partial support for file api + files[0].blob = input; + files[0].iframe = true; + } + } + else if( !html5 && isInputFile(input) ){ + if( api.trim(input.value) ){ + files = [api.checkFileObj(input.value)]; + files[0].blob = input; + files[0].iframe = true; + } + } + else if( _isArray(input) ){ + files = input; + } + + return api.filter(files, function (file){ return !filter || filter.test(file.name); }); + }, + + + /** + * Get total file size + * @param {Array} files + * @return {Number} + */ + getTotalSize: function (files){ + var size = 0, i = files && files.length; + while( i-- ){ + size += files[i].size; + } + return size; + }, + + + /** + * Get image information + * + * @param {File} file + * @param {Function} fn + */ + getInfo: function (file, fn){ + var info = {}, readers = _infoReader.concat(); + + if( api.isBlob(file) ){ + (function _next(){ + var reader = readers.shift(); + if( reader ){ + if( reader.test(file.type) ){ + reader(file, function (err, res){ + if( err ){ + fn(err); + } + else { + _extend(info, res); + _next(); + } + }); + } + else { + _next(); + } + } + else { + fn(false, info); + } + })(); + } + else { + fn('not_support_info', info); + } + }, + + + /** + * Add information reader + * + * @param {RegExp} mime + * @param {Function} fn + */ + addInfoReader: function (mime, fn){ + fn.test = function (type){ return mime.test(type); }; + _infoReader.push(fn); + }, + + + /** + * Filter of array + * + * @param {Array} input + * @param {Function} fn + * @return {Array} + */ + filter: function (input, fn){ + var result = [], i = 0, n = input.length, val; + + for( ; i < n; i++ ){ + if( i in input ){ + val = input[i]; + if( fn.call(val, val, i, input) ){ + result.push(val); + } + } + } + + return result; + }, + + + /** + * Filter files + * + * @param {Array} files + * @param {Function} eachFn + * @param {Function} resultFn + */ + filterFiles: function (files, eachFn, resultFn){ + if( files.length ){ + // HTML5 or Flash + var queue = files.concat(), file, result = [], deleted = []; + + (function _next(){ + if( queue.length ){ + file = queue.shift(); + api.getInfo(file, function (err, info){ + (eachFn(file, err ? false : info) ? result : deleted).push(file); + _next(); + }); + } + else { + resultFn(result, deleted); + } + })(); + } + else { + resultFn([], files); + } + }, + + + upload: function (options){ + options = _extend({ + jsonp: 'callback' + , prepare: api.F + , beforeupload: api.F + , upload: api.F + , fileupload: api.F + , fileprogress: api.F + , filecomplete: api.F + , progress: api.F + , complete: api.F + , pause: api.F + , imageOriginal: true + , chunkSize: api.chunkSize + , chunkUploadRetry: api.chunkUploadRetry + , uploadRetry: api.uploadRetry + }, options); + + + if( options.imageAutoOrientation && !options.imageTransform ){ + options.imageTransform = { rotate: 'auto' }; + } + + + var + proxyXHR = new api.XHR(options) + , dataArray = this._getFilesDataArray(options.files) + , _this = this + , _total = 0 + , _loaded = 0 + , _nextFile + , _complete = false + ; + + + // calc total size + _each(dataArray, function (data){ + _total += data.size; + }); + + // Array of files + proxyXHR.files = []; + _each(dataArray, function (data){ + proxyXHR.files.push(data.file); + }); + + // Set upload status props + proxyXHR.total = _total; + proxyXHR.loaded = 0; + proxyXHR.filesLeft = dataArray.length; + + // emit "beforeupload" event + options.beforeupload(proxyXHR, options); + + // Upload by file + _nextFile = function (){ + var + data = dataArray.shift() + , _file = data && data.file + , _fileLoaded = false + , _fileOptions = _simpleClone(options) + ; + + proxyXHR.filesLeft = dataArray.length; + + if( _file && _file.name === api.expando ){ + _file = null; + api.log('[warn] FileAPI.upload() — called without files'); + } + + if( ( proxyXHR.statusText != 'abort' || proxyXHR.current ) && data ){ + // Mark active job + _complete = false; + + // Set current upload file + proxyXHR.currentFile = _file; + + // Prepare file options + if (_file && options.prepare(_file, _fileOptions) === false) { + _nextFile.call(_this); + return; + } + _fileOptions.file = _file; + + _this._getFormData(_fileOptions, data, function (form){ + if( !_loaded ){ + // emit "upload" event + options.upload(proxyXHR, options); + } + + var xhr = new api.XHR(_extend({}, _fileOptions, { + + upload: _file ? function (){ + // emit "fileupload" event + options.fileupload(_file, xhr, _fileOptions); + } : noop, + + progress: _file ? function (evt){ + if( !_fileLoaded ){ + // For ignore the double calls. + _fileLoaded = (evt.loaded === evt.total); + + // emit "fileprogress" event + options.fileprogress({ + type: 'progress' + , total: data.total = evt.total + , loaded: data.loaded = evt.loaded + }, _file, xhr, _fileOptions); + + // emit "progress" event + options.progress({ + type: 'progress' + , total: _total + , loaded: proxyXHR.loaded = (_loaded + data.size * (evt.loaded/evt.total)) || 0 + }, _file, xhr, _fileOptions); + } + } : noop, + + complete: function (err){ + _each(_xhrPropsExport, function (name){ + proxyXHR[name] = xhr[name]; + }); + + if( _file ){ + data.total = (data.total || data.size); + data.loaded = data.total; + + if( !err ) { + // emulate 100% "progress" + this.progress(data); + + // fixed throttle event + _fileLoaded = true; + + // bytes loaded + _loaded += data.size; // data.size != data.total, it's desirable fix this + proxyXHR.loaded = _loaded; + } + + // emit "filecomplete" event + options.filecomplete(err, xhr, _file, _fileOptions); + } + + // upload next file + setTimeout(function () {_nextFile.call(_this);}, 0); + } + })); // xhr + + + // ... + proxyXHR.abort = function (current){ + if (!current) { dataArray.length = 0; } + this.current = current; + xhr.abort(); + }; + + // Start upload + xhr.send(form); + }); + } + else { + var successful = proxyXHR.status == 200 || proxyXHR.status == 201 || proxyXHR.status == 204; + options.complete(successful ? false : (proxyXHR.statusText || 'error'), proxyXHR, options); + // Mark done state + _complete = true; + } + }; + + + // Next tick + setTimeout(_nextFile, 0); + + + // Append more files to the existing request + // first - add them to the queue head/tail + proxyXHR.append = function (files, first) { + files = api._getFilesDataArray([].concat(files)); + + _each(files, function (data) { + _total += data.size; + proxyXHR.files.push(data.file); + if (first) { + dataArray.unshift(data); + } else { + dataArray.push(data); + } + }); + + proxyXHR.statusText = ""; + + if( _complete ){ + _nextFile.call(_this); + } + }; + + + // Removes file from queue by file reference and returns it + proxyXHR.remove = function (file) { + var i = dataArray.length, _file; + while( i-- ){ + if( dataArray[i].file == file ){ + _file = dataArray.splice(i, 1); + _total -= _file.size; + } + } + return _file; + }; + + return proxyXHR; + }, + + + _getFilesDataArray: function (data){ + var files = [], oFiles = {}; + + if( isInputFile(data) ){ + var tmp = api.getFiles(data); + oFiles[data.name || 'file'] = data.getAttribute('multiple') !== null ? tmp : tmp[0]; + } + else if( _isArray(data) && isInputFile(data[0]) ){ + _each(data, function (input){ + oFiles[input.name || 'file'] = api.getFiles(input); + }); + } + else { + oFiles = data; + } + + _each(oFiles, function add(file, name){ + if( _isArray(file) ){ + _each(file, function (file){ + add(file, name); + }); + } + else if( file && (file.name || file.image) ){ + files.push({ + name: name + , file: file + , size: file.size + , total: file.size + , loaded: 0 + }); + } + }); + + if( !files.length ){ + // Create fake `file` object + files.push({ file: { name: api.expando } }); + } + + return files; + }, + + + _getFormData: function (options, data, fn){ + var + file = data.file + , name = data.name + , filename = file.name + , filetype = file.type + , trans = api.support.transform && options.imageTransform + , Form = new api.Form + , queue = api.queue(function (){ fn(Form); }) + , isOrignTrans = trans && _isOriginTransform(trans) + , postNameConcat = api.postNameConcat + ; + + // Append data + _each(options.data, function add(val, name){ + if( typeof val == 'object' ){ + _each(val, function (v, i){ + add(v, postNameConcat(name, i)); + }); + } + else { + Form.append(name, val); + } + }); + + (function _addFile(file/**Object*/){ + if( file.image ){ // This is a FileAPI.Image + queue.inc(); + + file.toData(function (err, image){ + // @todo: требует рефакторинга и обработки ошибки + if (file.file) { + image.type = file.file.type; + image.quality = file.matrix.quality; + filename = file.file && file.file.name; + } + + filename = filename || (new Date).getTime()+'.png'; + + _addFile(image); + queue.next(); + }); + } + else if( api.Image && trans && (/^image/.test(file.type) || _rimgcanvas.test(file.nodeName)) ){ + queue.inc(); + + if( isOrignTrans ){ + // Convert to array for transform function + trans = [trans]; + } + + api.Image.transform(file, trans, options.imageAutoOrientation, function (err, images){ + if( isOrignTrans && !err ){ + if( !dataURLtoBlob && !api.flashEngine ){ + // Canvas.toBlob or Flash not supported, use multipart + Form.multipart = true; + } + + Form.append(name, images[0], filename, trans[0].type || filetype); + } + else { + var addOrigin = 0; + + if( !err ){ + _each(images, function (image, idx){ + if( !dataURLtoBlob && !api.flashEngine ){ + Form.multipart = true; + } + + if( !trans[idx].postName ){ + addOrigin = 1; + } + + Form.append(trans[idx].postName || postNameConcat(name, idx), image, filename, trans[idx].type || filetype); + }); + } + + if( err || options.imageOriginal ){ + Form.append(postNameConcat(name, (addOrigin ? 'original' : null)), file, filename, filetype); + } + } + + queue.next(); + }); + } + else if( filename !== api.expando ){ + Form.append(name, file, filename); + } + })(file); + + queue.check(); + }, + + + reset: function (inp, notRemove){ + var parent, clone; + + if( jQuery ){ + clone = jQuery(inp).clone(true).insertBefore(inp).val('')[0]; + if( !notRemove ){ + jQuery(inp).remove(); + } + } else { + parent = inp.parentNode; + clone = parent.insertBefore(inp.cloneNode(true), inp); + clone.value = ''; + + if( !notRemove ){ + parent.removeChild(inp); + } + + _each(_elEvents[api.uid(inp)], function (fns, type){ + _each(fns, function (fn){ + _off(inp, type, fn); + _on(clone, type, fn); + }); + }); + } + + return clone; + }, + + + /** + * Load remote file + * + * @param {String} url + * @param {Function} fn + * @return {XMLHttpRequest} + */ + load: function (url, fn){ + var xhr = api.getXHR(); + if( xhr ){ + xhr.open('GET', url, true); + + if( xhr.overrideMimeType ){ + xhr.overrideMimeType('text/plain; charset=x-user-defined'); + } + + _on(xhr, 'progress', function (/**Event*/evt){ + /** @namespace evt.lengthComputable */ + if( evt.lengthComputable ){ + fn({ type: evt.type, loaded: evt.loaded, total: evt.total }, xhr); + } + }); + + xhr.onreadystatechange = function(){ + if( xhr.readyState == 4 ){ + xhr.onreadystatechange = null; + if( xhr.status == 200 ){ + url = url.split('/'); + /** @namespace xhr.responseBody */ + var file = { + name: url[url.length-1] + , size: xhr.getResponseHeader('Content-Length') + , type: xhr.getResponseHeader('Content-Type') + }; + file.dataURL = 'data:'+file.type+';base64,' + api.encode64(xhr.responseBody || xhr.responseText); + fn({ type: 'load', result: file }, xhr); + } + else { + fn({ type: 'error' }, xhr); + } + } + }; + xhr.send(null); + } else { + fn({ type: 'error' }); + } + + return xhr; + }, + + encode64: function (str){ + var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', outStr = '', i = 0; + + if( typeof str !== 'string' ){ + str = String(str); + } + + while( i < str.length ){ + //all three "& 0xff" added below are there to fix a known bug + //with bytes returned by xhr.responseText + var + byte1 = str.charCodeAt(i++) & 0xff + , byte2 = str.charCodeAt(i++) & 0xff + , byte3 = str.charCodeAt(i++) & 0xff + , enc1 = byte1 >> 2 + , enc2 = ((byte1 & 3) << 4) | (byte2 >> 4) + , enc3, enc4 + ; + + if( isNaN(byte2) ){ + enc3 = enc4 = 64; + } else { + enc3 = ((byte2 & 15) << 2) | (byte3 >> 6); + enc4 = isNaN(byte3) ? 64 : byte3 & 63; + } + + outStr += b64.charAt(enc1) + b64.charAt(enc2) + b64.charAt(enc3) + b64.charAt(enc4); + } + + return outStr; + } + + } // api + ; + + + function _emit(target, fn, name, res, ext){ + var evt = { + type: name.type || name + , target: target + , result: res + }; + _extend(evt, ext); + fn(evt); + } + + + function _hasSupportReadAs(method){ + return FileReader && !!FileReader.prototype['readAs' + method]; + } + + + function _readAs(file, fn, method, encoding){ + if( api.isBlob(file) && _hasSupportReadAs(method) ){ + var Reader = new FileReader; + + // Add event listener + _on(Reader, _readerEvents, function _fn(evt){ + var type = evt.type; + if( type == 'progress' ){ + _emit(file, fn, evt, evt.target.result, { loaded: evt.loaded, total: evt.total }); + } + else if( type == 'loadend' ){ + _off(Reader, _readerEvents, _fn); + Reader = null; + } + else { + _emit(file, fn, evt, evt.target.result); + } + }); + + + try { + // ReadAs ... + if( encoding ){ + Reader['readAs' + method](file, encoding); + } + else { + Reader['readAs' + method](file); + } + } + catch (err){ + _emit(file, fn, 'error', undef, { error: err.toString() }); + } + } + else { + _emit(file, fn, 'error', undef, { error: 'filreader_not_support_' + method }); + } + } + + + function _isRegularFile(file, callback){ + // http://stackoverflow.com/questions/8856628/detecting-folders-directories-in-javascript-filelist-objects + if( !file.type && (safari || ((file.size % 4096) === 0 && (file.size <= 102400))) ){ + if( FileReader ){ + try { + var reader = new FileReader(); + + _one(reader, _readerEvents, function (evt){ + var isFile = evt.type != 'error'; + if( isFile ){ + if ( reader.readyState == null || reader.readyState === reader.LOADING ) { + reader.abort(); + } + callback(isFile); + } + else { + callback(false, reader.error); + } + }); + + reader.readAsDataURL(file); + } catch( err ){ + callback(false, err); + } + } + else { + callback(null, new Error('FileReader is not supported')); + } + } + else { + callback(true); + } + } + + + function _isEntry(item){ + return item && (item.isFile || item.isDirectory); + } + + + function _getAsEntry(item){ + var entry; + if( item.getAsEntry ){ entry = item.getAsEntry(); } + else if( item.webkitGetAsEntry ){ entry = item.webkitGetAsEntry(); } + return entry; + } + + + function _readEntryAsFiles(entry, callback){ + if( !entry ){ + // error + var err = new Error('invalid entry'); + entry = new Object(entry); + entry.error = err; + callback(err.message, [], [entry]); + } + else if( entry.isFile ){ + // Read as file + entry.file(function (file){ + // success + file.fullPath = entry.fullPath; + callback(false, [file], [file]); + }, function (err){ + // error + entry.error = err; + callback('FileError.code: ' + err.code, [], [entry]); + }); + } + else if( entry.isDirectory ){ + var + reader = entry.createReader() + , firstAttempt = true + , files = [] + , all = [entry] + ; + + var onerror = function (err){ + // error + entry.error = err; + callback('DirectoryError.code: ' + err.code, files, all); + }; + var ondone = function ondone(entries){ + if( firstAttempt ){ + firstAttempt = false; + if( !entries.length ){ + entry.error = new Error('directory is empty'); + } + } + + // success + if( entries.length ){ + api.afor(entries, function (next, entry){ + _readEntryAsFiles(entry, function (err, entryFiles, allEntries){ + if( !err ){ + files = files.concat(entryFiles); + } + all = all.concat(allEntries); + + if( next ){ + next(); + } + else { + reader.readEntries(ondone, onerror); + } + }); + }); + } + else { + callback(false, files, all); + } + }; + + reader.readEntries(ondone, onerror); + } + else { + _readEntryAsFiles(_getAsEntry(entry), callback); + } + } + + + function _simpleClone(obj){ + var copy = {}; + _each(obj, function (val, key){ + if( val && (typeof val === 'object') && (val.nodeType === void 0) ){ + val = _extend({}, val); + } + copy[key] = val; + }); + return copy; + } + + + function isInputFile(el){ + return _rinput.test(el && el.tagName); + } + + + function _getDataTransfer(evt){ + return (evt.originalEvent || evt || '').dataTransfer || {}; + } + + + function _isOriginTransform(trans){ + var key; + for( key in trans ){ + if( trans.hasOwnProperty(key) ){ + if( !(trans[key] instanceof Object || key === 'overlay' || key === 'filter') ){ + return true; + } + } + } + return false; + } + + + // Add default image info reader + api.addInfoReader(/^image/, function (file/**File*/, callback/**Function*/){ + if( !file.__dimensions ){ + var defer = file.__dimensions = api.defer(); + + api.readAsImage(file, function (evt){ + var img = evt.target; + defer.resolve(evt.type == 'load' ? false : 'error', { + width: img.width + , height: img.height + }); + img.src = api.EMPTY_PNG; + img = null; + }); + } + + file.__dimensions.then(callback); + }); + + + /** + * Drag'n'Drop special event + * + * @param {HTMLElement} el + * @param {Function} onHover + * @param {Function} onDrop + */ + api.event.dnd = function (el, onHover, onDrop){ + var _id, _type; + + if( !onDrop ){ + onDrop = onHover; + onHover = api.F; + } + + if( FileReader ){ + // Hover + _on(el, 'dragenter dragleave dragover', onHover.ff = onHover.ff || function (evt){ + var + types = _getDataTransfer(evt).types + , i = types && types.length + , debounceTrigger = false + ; + + while( i-- ){ + if( ~types[i].indexOf('File') ){ + evt[preventDefault](); + + if( _type !== evt.type ){ + _type = evt.type; // Store current type of event + + if( _type != 'dragleave' ){ + onHover.call(evt[currentTarget], true, evt); + } + + debounceTrigger = true; + } + + break; // exit from "while" + } + } + + if( debounceTrigger ){ + clearTimeout(_id); + _id = setTimeout(function (){ + onHover.call(evt[currentTarget], _type != 'dragleave', evt); + }, 50); + } + }); + + + // Drop + _on(el, 'drop', onDrop.ff = onDrop.ff || function (evt){ + evt[preventDefault](); + + _type = 0; + onHover.call(evt[currentTarget], false, evt); + + api.getDropFiles(evt, function (files, all){ + onDrop.call(evt[currentTarget], files, all, evt); + }); + }); + } + else { + api.log("Drag'n'Drop -- not supported"); + } + }; + + + /** + * Remove drag'n'drop + * @param {HTMLElement} el + * @param {Function} onHover + * @param {Function} onDrop + */ + api.event.dnd.off = function (el, onHover, onDrop){ + _off(el, 'dragenter dragleave dragover', onHover.ff); + _off(el, 'drop', onDrop.ff); + }; + + + // Support jQuery + if( jQuery && !jQuery.fn.dnd ){ + jQuery.fn.dnd = function (onHover, onDrop){ + return this.each(function (){ + api.event.dnd(this, onHover, onDrop); + }); + }; + + jQuery.fn.offdnd = function (onHover, onDrop){ + return this.each(function (){ + api.event.dnd.off(this, onHover, onDrop); + }); + }; + } + + // @export + window.FileAPI = _extend(api, window.FileAPI); + + + // Debug info + api.log('FileAPI: ' + api.version); + api.log('protocol: ' + window.location.protocol); + api.log('doctype: [' + doctype.name + '] ' + doctype.publicId + ' ' + doctype.systemId); + + + // @detect 'x-ua-compatible' + _each(document.getElementsByTagName('meta'), function (meta){ + if( /x-ua-compatible/i.test(meta.getAttribute('http-equiv')) ){ + api.log('meta.http-equiv: ' + meta.getAttribute('content')); + } + }); + + + // Configuration + try { + _supportConsoleLog = !!console.log; + _supportConsoleLogApply = !!console.log.apply; + } + catch (err) {} + + if( !api.flashUrl ){ api.flashUrl = api.staticPath + 'FileAPI.flash.swf'; } + if( !api.flashImageUrl ){ api.flashImageUrl = api.staticPath + 'FileAPI.flash.image.swf'; } + if( !api.flashWebcamUrl ){ api.flashWebcamUrl = api.staticPath + 'FileAPI.flash.camera.swf'; } +})(window, void 0); + +/*global window, FileAPI, document */ + +(function (api, document, undef) { + 'use strict'; + + var + min = Math.min, + round = Math.round, + getCanvas = function () { return document.createElement('canvas'); }, + support = false, + exifOrientation = { + 8: 270 + , 3: 180 + , 6: 90 + , 7: 270 + , 4: 180 + , 5: 90 + } + ; + + try { + support = getCanvas().toDataURL('image/png').indexOf('data:image/png') > -1; + } + catch (e){} + + + function Image(file){ + if( file instanceof Image ){ + var img = new Image(file.file); + api.extend(img.matrix, file.matrix); + return img; + } + else if( !(this instanceof Image) ){ + return new Image(file); + } + + this.file = file; + this.size = file.size || 100; + + this.matrix = { + sx: 0, + sy: 0, + sw: 0, + sh: 0, + dx: 0, + dy: 0, + dw: 0, + dh: 0, + resize: 0, // min, max OR preview + deg: 0, + quality: 1, // jpeg quality + filter: 0 + }; + } + + + Image.prototype = { + image: true, + constructor: Image, + + set: function (attrs){ + api.extend(this.matrix, attrs); + return this; + }, + + crop: function (x, y, w, h){ + if( w === undef ){ + w = x; + h = y; + x = y = 0; + } + return this.set({ sx: x, sy: y, sw: w, sh: h || w }); + }, + + resize: function (w, h, strategy){ + if( /min|max|height|width/.test(h) ){ + strategy = h; + h = w; + } + + return this.set({ dw: w, dh: h || w, resize: strategy }); + }, + + preview: function (w, h){ + return this.resize(w, h || w, 'preview'); + }, + + rotate: function (deg){ + return this.set({ deg: deg }); + }, + + filter: function (filter){ + return this.set({ filter: filter }); + }, + + overlay: function (images){ + return this.set({ overlay: images }); + }, + + clone: function (){ + return new Image(this); + }, + + _load: function (image, fn){ + var self = this; + + if( /img|video/i.test(image.nodeName) ){ + fn.call(self, null, image); + } + else { + api.readAsImage(image, function (evt){ + fn.call(self, evt.type != 'load', evt.result); + }); + } + }, + + _apply: function (image, fn){ + var + canvas = getCanvas() + , m = this.getMatrix(image) + , ctx = canvas.getContext('2d') + , width = image.videoWidth || image.width + , height = image.videoHeight || image.height + , deg = m.deg + , dw = m.dw + , dh = m.dh + , w = width + , h = height + , filter = m.filter + , copy // canvas copy + , buffer = image + , overlay = m.overlay + , queue = api.queue(function (){ image.src = api.EMPTY_PNG; fn(false, canvas); }) + , renderImageToCanvas = api.renderImageToCanvas + ; + + // Normalize angle + deg = deg - Math.floor(deg/360)*360; + + // For `renderImageToCanvas` + image._type = this.file.type; + + while(m.multipass && min(w/dw, h/dh) > 2 ){ + w = (w/2 + 0.5)|0; + h = (h/2 + 0.5)|0; + + copy = getCanvas(); + copy.width = w; + copy.height = h; + + if( buffer !== image ){ + renderImageToCanvas(copy, buffer, 0, 0, buffer.width, buffer.height, 0, 0, w, h); + buffer = copy; + } + else { + buffer = copy; + renderImageToCanvas(buffer, image, m.sx, m.sy, m.sw, m.sh, 0, 0, w, h); + m.sx = m.sy = m.sw = m.sh = 0; + } + } + + + canvas.width = (deg % 180) ? dh : dw; + canvas.height = (deg % 180) ? dw : dh; + + canvas.type = m.type; + canvas.quality = m.quality; + + ctx.rotate(deg * Math.PI / 180); + renderImageToCanvas(ctx.canvas, buffer + , m.sx, m.sy + , m.sw || buffer.width + , m.sh || buffer.height + , (deg == 180 || deg == 270 ? -dw : 0) + , (deg == 90 || deg == 180 ? -dh : 0) + , dw, dh + ); + dw = canvas.width; + dh = canvas.height; + + // Apply overlay + overlay && api.each([].concat(overlay), function (over){ + queue.inc(); + // preload + var img = new window.Image, fn = function (){ + var + x = over.x|0 + , y = over.y|0 + , w = over.w || img.width + , h = over.h || img.height + , rel = over.rel + ; + + // center | right | left + x = (rel == 1 || rel == 4 || rel == 7) ? (dw - w + x)/2 : (rel == 2 || rel == 5 || rel == 8 ? dw - (w + x) : x); + + // center | bottom | top + y = (rel == 3 || rel == 4 || rel == 5) ? (dh - h + y)/2 : (rel >= 6 ? dh - (h + y) : y); + + api.event.off(img, 'error load abort', fn); + + try { + ctx.globalAlpha = over.opacity || 1; + ctx.drawImage(img, x, y, w, h); + } + catch (er){} + + queue.next(); + }; + + api.event.on(img, 'error load abort', fn); + img.src = over.src; + + if( img.complete ){ + fn(); + } + }); + + if( filter ){ + queue.inc(); + Image.applyFilter(canvas, filter, queue.next); + } + + queue.check(); + }, + + getMatrix: function (image){ + var + m = api.extend({}, this.matrix) + , sw = m.sw = m.sw || image.videoWidth || image.naturalWidth || image.width + , sh = m.sh = m.sh || image.videoHeight || image.naturalHeight || image.height + , dw = m.dw = m.dw || sw + , dh = m.dh = m.dh || sh + , sf = sw/sh, df = dw/dh + , strategy = m.resize + ; + + if( strategy == 'preview' ){ + if( dw != sw || dh != sh ){ + // Make preview + var w, h; + + if( df >= sf ){ + w = sw; + h = w / df; + } else { + h = sh; + w = h * df; + } + + if( w != sw || h != sh ){ + m.sx = ~~((sw - w)/2); + m.sy = ~~((sh - h)/2); + sw = w; + sh = h; + } + } + } + else if( strategy == 'height' ){ + dw = dh * sf; + } + else if( strategy == 'width' ){ + dh = dw / sf; + } + else if( strategy ){ + if( !(sw > dw || sh > dh) ){ + dw = sw; + dh = sh; + } + else if( strategy == 'min' ){ + dw = round(sf < df ? min(sw, dw) : dh*sf); + dh = round(sf < df ? dw/sf : min(sh, dh)); + } + else { + dw = round(sf >= df ? min(sw, dw) : dh*sf); + dh = round(sf >= df ? dw/sf : min(sh, dh)); + } + } + + m.sw = sw; + m.sh = sh; + m.dw = dw; + m.dh = dh; + m.multipass = api.multiPassResize; + return m; + }, + + _trans: function (fn){ + this._load(this.file, function (err, image){ + if( err ){ + fn(err); + } + else { + try { + this._apply(image, fn); + } catch (err){ + api.log('[err] FileAPI.Image.fn._apply:', err); + fn(err); + } + } + }); + }, + + + get: function (fn){ + if( api.support.transform ){ + var _this = this, matrix = _this.matrix; + + if( matrix.deg == 'auto' ){ + api.getInfo(_this.file, function (err, info){ + // rotate by exif orientation + matrix.deg = exifOrientation[info && info.exif && info.exif.Orientation] || 0; + _this._trans(fn); + }); + } + else { + _this._trans(fn); + } + } + else { + fn('not_support_transform'); + } + + return this; + }, + + + toData: function (fn){ + return this.get(fn); + } + + }; + + + Image.exifOrientation = exifOrientation; + + + Image.transform = function (file, transform, autoOrientation, fn){ + function _transform(err, img){ + // img -- info object + var + images = {} + , queue = api.queue(function (err){ + fn(err, images); + }) + ; + + if( !err ){ + api.each(transform, function (params, name){ + if( !queue.isFail() ){ + var ImgTrans = new Image(img.nodeType ? img : file), isFn = typeof params == 'function'; + + if( isFn ){ + params(img, ImgTrans); + } + else if( params.width ){ + ImgTrans[params.preview ? 'preview' : 'resize'](params.width, params.height, params.strategy); + } + else { + if( params.maxWidth && (img.width > params.maxWidth || img.height > params.maxHeight) ){ + ImgTrans.resize(params.maxWidth, params.maxHeight, 'max'); + } + } + + if( params.crop ){ + var crop = params.crop; + ImgTrans.crop(crop.x|0, crop.y|0, crop.w || crop.width, crop.h || crop.height); + } + + if( params.rotate === undef && autoOrientation ){ + params.rotate = 'auto'; + } + + ImgTrans.set({ type: ImgTrans.matrix.type || params.type || file.type || 'image/png' }); + + if( !isFn ){ + ImgTrans.set({ + deg: params.rotate + , overlay: params.overlay + , filter: params.filter + , quality: params.quality || 1 + }); + } + + queue.inc(); + ImgTrans.toData(function (err, image){ + if( err ){ + queue.fail(); + } + else { + images[name] = image; + queue.next(); + } + }); + } + }); + } + else { + queue.fail(); + } + } + + + // @todo: Оло-ло, нужно рефакторить это место + if( file.width ){ + _transform(false, file); + } else { + api.getInfo(file, _transform); + } + }; + + + // @const + api.each(['TOP', 'CENTER', 'BOTTOM'], function (x, i){ + api.each(['LEFT', 'CENTER', 'RIGHT'], function (y, j){ + Image[x+'_'+y] = i*3 + j; + Image[y+'_'+x] = i*3 + j; + }); + }); + + + /** + * Trabsform element to canvas + * + * @param {Image|HTMLVideoElement} el + * @returns {Canvas} + */ + Image.toCanvas = function(el){ + var canvas = document.createElement('canvas'); + canvas.width = el.videoWidth || el.width; + canvas.height = el.videoHeight || el.height; + canvas.getContext('2d').drawImage(el, 0, 0); + return canvas; + }; + + + /** + * Create image from DataURL + * @param {String} dataURL + * @param {Object} size + * @param {Function} callback + */ + Image.fromDataURL = function (dataURL, size, callback){ + var img = api.newImage(dataURL); + api.extend(img, size); + callback(img); + }; + + + /** + * Apply filter (caman.js) + * + * @param {Canvas|Image} canvas + * @param {String|Function} filter + * @param {Function} doneFn + */ + Image.applyFilter = function (canvas, filter, doneFn){ + if( typeof filter == 'function' ){ + filter(canvas, doneFn); + } + else if( window.Caman ){ + // http://camanjs.com/guides/ + window.Caman(canvas.tagName == 'IMG' ? Image.toCanvas(canvas) : canvas, function (){ + if( typeof filter == 'string' ){ + this[filter](); + } + else { + api.each(filter, function (val, method){ + this[method](val); + }, this); + } + this.render(doneFn); + }); + } + }; + + + /** + * For load-image-ios.js + */ + api.renderImageToCanvas = function (canvas, img, sx, sy, sw, sh, dx, dy, dw, dh){ + try { + return canvas.getContext('2d').drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh); + } catch (ex) { + api.log('renderImageToCanvas failed'); + throw ex; + } + }; + + + // @export + api.support.canvas = api.support.transform = support; + api.Image = Image; +})(FileAPI, document); + +/* + * JavaScript Load Image iOS scaling fixes 1.0.3 + * https://github.com/blueimp/JavaScript-Load-Image + * + * Copyright 2013, Sebastian Tschan + * https://blueimp.net + * + * iOS image scaling fixes based on + * https://github.com/stomita/ios-imagefile-megapixel + * + * Licensed under the MIT license: + * http://www.opensource.org/licenses/MIT + */ + +/*jslint nomen: true, bitwise: true */ +/*global FileAPI, window, document */ + +(function (factory) { + 'use strict'; + factory(FileAPI); +}(function (loadImage) { + 'use strict'; + + // Only apply fixes on the iOS platform: + if (!window.navigator || !window.navigator.platform || + !(/iP(hone|od|ad)/).test(window.navigator.platform)) { + return; + } + + var originalRenderMethod = loadImage.renderImageToCanvas; + + // Detects subsampling in JPEG images: + loadImage.detectSubsampling = function (img) { + var canvas, + context; + if (img.width * img.height > 1024 * 1024) { // only consider mexapixel images + canvas = document.createElement('canvas'); + canvas.width = canvas.height = 1; + context = canvas.getContext('2d'); + context.drawImage(img, -img.width + 1, 0); + // subsampled image becomes half smaller in rendering size. + // check alpha channel value to confirm image is covering edge pixel or not. + // if alpha value is 0 image is not covering, hence subsampled. + return context.getImageData(0, 0, 1, 1).data[3] === 0; + } + return false; + }; + + // Detects vertical squash in JPEG images: + loadImage.detectVerticalSquash = function (img, subsampled) { + var naturalHeight = img.naturalHeight || img.height, + canvas = document.createElement('canvas'), + context = canvas.getContext('2d'), + data, + sy, + ey, + py, + alpha; + if (subsampled) { + naturalHeight /= 2; + } + canvas.width = 1; + canvas.height = naturalHeight; + context.drawImage(img, 0, 0); + data = context.getImageData(0, 0, 1, naturalHeight).data; + // search image edge pixel position in case it is squashed vertically: + sy = 0; + ey = naturalHeight; + py = naturalHeight; + while (py > sy) { + alpha = data[(py - 1) * 4 + 3]; + if (alpha === 0) { + ey = py; + } else { + sy = py; + } + py = (ey + sy) >> 1; + } + return (py / naturalHeight) || 1; + }; + + // Renders image to canvas while working around iOS image scaling bugs: + // https://github.com/blueimp/JavaScript-Load-Image/issues/13 + loadImage.renderImageToCanvas = function ( + canvas, + img, + sourceX, + sourceY, + sourceWidth, + sourceHeight, + destX, + destY, + destWidth, + destHeight + ) { + if (img._type === 'image/jpeg') { + var context = canvas.getContext('2d'), + tmpCanvas = document.createElement('canvas'), + tileSize = 1024, + tmpContext = tmpCanvas.getContext('2d'), + subsampled, + vertSquashRatio, + tileX, + tileY; + tmpCanvas.width = tileSize; + tmpCanvas.height = tileSize; + context.save(); + subsampled = loadImage.detectSubsampling(img); + if (subsampled) { + sourceX /= 2; + sourceY /= 2; + sourceWidth /= 2; + sourceHeight /= 2; + } + vertSquashRatio = loadImage.detectVerticalSquash(img, subsampled); + if (subsampled || vertSquashRatio !== 1) { + sourceY *= vertSquashRatio; + destWidth = Math.ceil(tileSize * destWidth / sourceWidth); + destHeight = Math.ceil( + tileSize * destHeight / sourceHeight / vertSquashRatio + ); + destY = 0; + tileY = 0; + while (tileY < sourceHeight) { + destX = 0; + tileX = 0; + while (tileX < sourceWidth) { + tmpContext.clearRect(0, 0, tileSize, tileSize); + tmpContext.drawImage( + img, + sourceX, + sourceY, + sourceWidth, + sourceHeight, + -tileX, + -tileY, + sourceWidth, + sourceHeight + ); + context.drawImage( + tmpCanvas, + 0, + 0, + tileSize, + tileSize, + destX, + destY, + destWidth, + destHeight + ); + tileX += tileSize; + destX += destWidth; + } + tileY += tileSize; + destY += destHeight; + } + context.restore(); + return canvas; + } + } + return originalRenderMethod( + canvas, + img, + sourceX, + sourceY, + sourceWidth, + sourceHeight, + destX, + destY, + destWidth, + destHeight + ); + }; + +})); + +/*global window, FileAPI */ + +(function (api, window){ + "use strict"; + + var + document = window.document + , FormData = window.FormData + , Form = function (){ this.items = []; } + , encodeURIComponent = window.encodeURIComponent + ; + + + Form.prototype = { + + append: function (name, blob, file, type){ + this.items.push({ + name: name + , blob: blob && blob.blob || (blob == void 0 ? '' : blob) + , file: blob && (file || blob.name) + , type: blob && (type || blob.type) + }); + }, + + each: function (fn){ + var i = 0, n = this.items.length; + for( ; i < n; i++ ){ + fn.call(this, this.items[i]); + } + }, + + toData: function (fn, options){ + // allow chunked transfer if we have only one file to send + // flag is used below and in XHR._send + options._chunked = api.support.chunked && options.chunkSize > 0 && api.filter(this.items, function (item){ return item.file; }).length == 1; + + if( !api.support.html5 ){ + api.log('FileAPI.Form.toHtmlData'); + this.toHtmlData(fn); + } + else if( !api.formData || this.multipart || !FormData ){ + api.log('FileAPI.Form.toMultipartData'); + this.toMultipartData(fn); + } + else if( options._chunked ){ + api.log('FileAPI.Form.toPlainData'); + this.toPlainData(fn); + } + else { + api.log('FileAPI.Form.toFormData'); + this.toFormData(fn); + } + }, + + _to: function (data, complete, next, arg){ + var queue = api.queue(function (){ + complete(data); + }); + + this.each(function (file){ + try{ + next(file, data, queue, arg); + } + catch( err ){ + api.log('FileAPI.Form._to: ' + err.message); + complete(err); + } + }); + + queue.check(); + }, + + + toHtmlData: function (fn){ + this._to(document.createDocumentFragment(), fn, function (file, data/**DocumentFragment*/){ + var blob = file.blob, hidden; + + if( file.file ){ + api.reset(blob, true); + // set new name + blob.name = file.name; + blob.disabled = false; + data.appendChild(blob); + } + else { + hidden = document.createElement('input'); + hidden.name = file.name; + hidden.type = 'hidden'; + hidden.value = blob; + data.appendChild(hidden); + } + }); + }, + + toPlainData: function (fn){ + this._to({}, fn, function (file, data, queue){ + if( file.file ){ + data.type = file.file; + } + + if( file.blob.toBlob ){ + // canvas + queue.inc(); + _convertFile(file, function (file, blob){ + data.name = file.name; + data.file = blob; + data.size = blob.length; + data.type = file.type; + queue.next(); + }); + } + else if( file.file ){ + // file + data.name = file.blob.name; + data.file = file.blob; + data.size = file.blob.size; + data.type = file.type; + } + else { + // additional data + if( !data.params ){ + data.params = []; + } + data.params.push(encodeURIComponent(file.name) +"="+ encodeURIComponent(file.blob)); + } + + data.start = -1; + data.end = data.file && data.file.FileAPIReadPosition || -1; + data.retry = 0; + }); + }, + + toFormData: function (fn){ + this._to(new FormData, fn, function (file, data, queue){ + if( file.blob && file.blob.toBlob ){ + queue.inc(); + _convertFile(file, function (file, blob){ + data.append(file.name, blob, file.file); + queue.next(); + }); + } + else if( file.file ){ + data.append(file.name, file.blob, file.file); + } + else { + data.append(file.name, file.blob); + } + + if( file.file ){ + data.append('_'+file.name, file.file); + } + }); + }, + + + toMultipartData: function (fn){ + this._to([], fn, function (file, data, queue, boundary){ + queue.inc(); + _convertFile(file, function (file, blob){ + data.push( + '--_' + boundary + ('\r\nContent-Disposition: form-data; name="'+ file.name +'"'+ (file.file ? '; filename="'+ encodeURIComponent(file.file) +'"' : '') + + (file.file ? '\r\nContent-Type: '+ (file.type || 'application/octet-stream') : '') + + '\r\n' + + '\r\n'+ (file.file ? blob : encodeURIComponent(blob)) + + '\r\n') + ); + queue.next(); + }, true); + }, api.expando); + } + }; + + + function _convertFile(file, fn, useBinaryString){ + var blob = file.blob, filename = file.file; + + if( filename ){ + if( !blob.toDataURL ){ + // The Blob is not an image. + api.readAsBinaryString(blob, function (evt){ + if( evt.type == 'load' ){ + fn(file, evt.result); + } + }); + return; + } + + var + mime = { 'image/jpeg': '.jpe?g', 'image/png': '.png' } + , type = mime[file.type] ? file.type : 'image/png' + , ext = mime[type] || '.png' + , quality = blob.quality || 1 + ; + + if( !filename.match(new RegExp(ext+'$', 'i')) ){ + // Does not change the current extension, but add a new one. + filename += ext.replace('?', ''); + } + + file.file = filename; + file.type = type; + + if( !useBinaryString && blob.toBlob ){ + blob.toBlob(function (blob){ + fn(file, blob); + }, type, quality); + } + else { + fn(file, api.toBinaryString(blob.toDataURL(type, quality))); + } + } + else { + fn(file, blob); + } + } + + + // @export + api.Form = Form; +})(FileAPI, window); + +/*global window, FileAPI, Uint8Array */ + +(function (window, api){ + "use strict"; + + var + noop = function (){} + , document = window.document + + , XHR = function (options){ + this.uid = api.uid(); + this.xhr = { + abort: noop + , getResponseHeader: noop + , getAllResponseHeaders: noop + }; + this.options = options; + }, + + _xhrResponsePostfix = { '': 1, XML: 1, Text: 1, Body: 1 } + ; + + + XHR.prototype = { + status: 0, + statusText: '', + constructor: XHR, + + getResponseHeader: function (name){ + return this.xhr.getResponseHeader(name); + }, + + getAllResponseHeaders: function (){ + return this.xhr.getAllResponseHeaders() || {}; + }, + + end: function (status, statusText){ + var _this = this, options = _this.options; + + _this.end = + _this.abort = noop; + _this.status = status; + + if( statusText ){ + _this.statusText = statusText; + } + + api.log('xhr.end:', status, statusText); + options.complete(status == 200 || status == 201 ? false : _this.statusText || 'unknown', _this); + + if( _this.xhr && _this.xhr.node ){ + setTimeout(function (){ + var node = _this.xhr.node; + try { node.parentNode.removeChild(node); } catch (e){} + try { delete window[_this.uid]; } catch (e){} + window[_this.uid] = _this.xhr.node = null; + }, 9); + } + }, + + abort: function (){ + this.end(0, 'abort'); + + if( this.xhr ){ + this.xhr.aborted = true; + this.xhr.abort(); + } + }, + + send: function (FormData){ + var _this = this, options = this.options; + + FormData.toData(function (data){ + if( data instanceof Error ){ + _this.end(0, data.message); + } + else{ + // Start uploading + options.upload(options, _this); + _this._send.call(_this, options, data); + } + }, options); + }, + + _send: function (options, data){ + var _this = this, xhr, uid = _this.uid, onLoadFnName = _this.uid + "Load", url = options.url; + + api.log('XHR._send:', data); + + if( !options.cache ){ + // No cache + url += (~url.indexOf('?') ? '&' : '?') + api.uid(); + } + + if( data.nodeName ){ + var jsonp = options.jsonp; + + // prepare callback in GET + url = url.replace(/([a-z]+)=(\?)/i, '$1='+uid); + + // legacy + options.upload(options, _this); + + var + onPostMessage = function (evt){ + if( ~url.indexOf(evt.origin) ){ + try { + var result = api.parseJSON(evt.data); + if( result.id == uid ){ + complete(result.status, result.statusText, result.response); + } + } catch( err ){ + complete(0, err.message); + } + } + }, + + // jsonp-callack + complete = window[uid] = function (status, statusText, response){ + _this.readyState = 4; + _this.responseText = response; + _this.end(status, statusText); + + api.event.off(window, 'message', onPostMessage); + window[uid] = xhr = transport = window[onLoadFnName] = null; + } + ; + + _this.xhr.abort = function (){ + try { + if( transport.stop ){ transport.stop(); } + else if( transport.contentWindow.stop ){ transport.contentWindow.stop(); } + else { transport.contentWindow.document.execCommand('Stop'); } + } + catch (er) {} + complete(0, "abort"); + }; + + api.event.on(window, 'message', onPostMessage); + + window[onLoadFnName] = function (){ + try { + var + win = transport.contentWindow + , doc = win.document + , result = win.result || api.parseJSON(doc.body.innerHTML) + ; + complete(result.status, result.statusText, result.response); + } catch (e){ + api.log('[transport.onload]', e); + } + }; + + xhr = document.createElement('div'); + xhr.innerHTML = '
    ' + + '' + + (jsonp && (options.url.indexOf('=?') < 0) ? '' : '') + + '' + ; + + // get form-data & transport + var + form = xhr.getElementsByTagName('form')[0] + , transport = xhr.getElementsByTagName('iframe')[0] + ; + + form.appendChild(data); + + api.log(form.parentNode.innerHTML); + + // append to DOM + document.body.appendChild(xhr); + + // keep a reference to node-transport + _this.xhr.node = xhr; + + // send + _this.readyState = 2; // loaded + try { + form.submit(); + } catch (err) { + api.log('iframe.error: ' + err); + } + form = null; + } + else { + // Clean url + url = url.replace(/([a-z]+)=(\?)&?/i, ''); + + // html5 + if (this.xhr && this.xhr.aborted) { + api.log("Error: already aborted"); + return; + } + xhr = _this.xhr = api.getXHR(); + + if (data.params) { + url += (url.indexOf('?') < 0 ? "?" : "&") + data.params.join("&"); + } + + xhr.open('POST', url, true); + + if( api.withCredentials ){ + xhr.withCredentials = "true"; + } + + if( !options.headers || !options.headers['X-Requested-With'] ){ + xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + } + + api.each(options.headers, function (val, key){ + xhr.setRequestHeader(key, val); + }); + + + if ( options._chunked ) { + // chunked upload + if( xhr.upload ){ + xhr.upload.addEventListener('progress', api.throttle(function (/**Event*/evt){ + if (!data.retry) { + // show progress only for correct chunk uploads + options.progress({ + type: evt.type + , total: data.size + , loaded: data.start + evt.loaded + , totalSize: data.size + }, _this, options); + } + }, 100), false); + } + + xhr.onreadystatechange = function (){ + var lkb = parseInt(xhr.getResponseHeader('X-Last-Known-Byte'), 10); + + _this.status = xhr.status; + _this.statusText = xhr.statusText; + _this.readyState = xhr.readyState; + + if( xhr.readyState == 4 ){ + for( var k in _xhrResponsePostfix ){ + _this['response'+k] = xhr['response'+k]; + } + xhr.onreadystatechange = null; + + if (!xhr.status || xhr.status - 201 > 0) { + api.log("Error: " + xhr.status); + // some kind of error + // 0 - connection fail or timeout, if xhr.aborted is true, then it's not recoverable user action + // up - server error + if (((!xhr.status && !xhr.aborted) || 500 == xhr.status || 416 == xhr.status) && ++data.retry <= options.chunkUploadRetry) { + // let's try again the same chunk + // only applicable for recoverable error codes 500 && 416 + var delay = xhr.status ? 0 : api.chunkNetworkDownRetryTimeout; + + // inform about recoverable problems + options.pause(data.file, options); + + // smart restart if server reports about the last known byte + api.log("X-Last-Known-Byte: " + lkb); + if (lkb) { + data.end = lkb; + } else { + data.end = data.start - 1; + if (416 == xhr.status) { + data.end = data.end - options.chunkSize; + } + } + + setTimeout(function () { + _this._send(options, data); + }, delay); + } else { + // no mo retries + _this.end(xhr.status); + } + } else { + // success + data.retry = 0; + + if (data.end == data.size - 1) { + // finished + _this.end(xhr.status); + } else { + // next chunk + + // shift position if server reports about the last known byte + api.log("X-Last-Known-Byte: " + lkb); + if (lkb) { + data.end = lkb; + } + data.file.FileAPIReadPosition = data.end; + + setTimeout(function () { + _this._send(options, data); + }, 0); + } + } + + xhr = null; + } + }; + + data.start = data.end + 1; + data.end = Math.max(Math.min(data.start + options.chunkSize, data.size) - 1, data.start); + + // Retrieve a slice of file + var + file = data.file + , slice = (file.slice || file.mozSlice || file.webkitSlice).call(file, data.start, data.end + 1) + ; + + if( data.size && !slice.size ){ + setTimeout(function (){ + _this.end(-1); + }); + } else { + xhr.setRequestHeader("Content-Range", "bytes " + data.start + "-" + data.end + "/" + data.size); + xhr.setRequestHeader("Content-Disposition", 'attachment; filename=' + encodeURIComponent(data.name)); + xhr.setRequestHeader("Content-Type", data.type || "application/octet-stream"); + + xhr.send(slice); + } + + file = slice = null; + } else { + // single piece upload + if( xhr.upload ){ + // https://github.com/blueimp/jQuery-File-Upload/wiki/Fixing-Safari-hanging-on-very-high-speed-connections-%281Gbps%29 + xhr.upload.addEventListener('progress', api.throttle(function (/**Event*/evt){ + options.progress(evt, _this, options); + }, 100), false); + } + + xhr.onreadystatechange = function (){ + _this.status = xhr.status; + _this.statusText = xhr.statusText; + _this.readyState = xhr.readyState; + + if( xhr.readyState == 4 ){ + for( var k in _xhrResponsePostfix ){ + _this['response'+k] = xhr['response'+k]; + } + xhr.onreadystatechange = null; + + if (!xhr.status || xhr.status > 201) { + api.log("Error: " + xhr.status); + if (((!xhr.status && !xhr.aborted) || 500 == xhr.status) && (options.retry || 0) < options.uploadRetry) { + options.retry = (options.retry || 0) + 1; + var delay = api.networkDownRetryTimeout; + + // inform about recoverable problems + options.pause(options.file, options); + + setTimeout(function () { + _this._send(options, data); + }, delay); + } else { + //success + _this.end(xhr.status); + } + } else { + //success + _this.end(xhr.status); + } + + xhr = null; + } + }; + + if( api.isArray(data) ){ + // multipart + xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary=_'+api.expando); + var rawData = data.join('') +'--_'+ api.expando +'--'; + + /** @namespace xhr.sendAsBinary https://developer.mozilla.org/ru/XMLHttpRequest#Sending_binary_content */ + if( xhr.sendAsBinary ){ + xhr.sendAsBinary(rawData); + } + else { + var bytes = Array.prototype.map.call(rawData, function(c){ return c.charCodeAt(0) & 0xff; }); + xhr.send(new Uint8Array(bytes).buffer); + + } + } else { + // FormData + xhr.send(data); + } + } + } + } + }; + + + // @export + api.XHR = XHR; +})(window, FileAPI); + +/** + * @class FileAPI.Camera + * @author RubaXa + * @support Chrome 21+, FF 18+, Opera 12+ + */ + +/*global window, FileAPI, jQuery */ +/** @namespace LocalMediaStream -- https://developer.mozilla.org/en-US/docs/WebRTC/MediaStream_API#LocalMediaStream */ +(function (window, api){ + "use strict"; + + var + URL = window.URL || window.webkitURL, + + document = window.document, + navigator = window.navigator, + + getMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia, + + html5 = !!getMedia + ; + + + // Support "media" + api.support.media = html5; + + + var Camera = function (video){ + this.video = video; + }; + + + Camera.prototype = { + isActive: function (){ + return !!this._active; + }, + + + /** + * Start camera streaming + * @param {Function} callback + */ + start: function (callback){ + var + _this = this + , video = _this.video + , _successId + , _failId + , _complete = function (err){ + _this._active = !err; + clearTimeout(_failId); + clearTimeout(_successId); +// api.event.off(video, 'loadedmetadata', _complete); + callback && callback(err, _this); + } + ; + + getMedia.call(navigator, { video: true }, function (stream/**LocalMediaStream*/){ + // Success + _this.stream = stream; + +// api.event.on(video, 'loadedmetadata', function (){ +// _complete(null); +// }); + + // Set camera stream + video.src = URL.createObjectURL(stream); + + // Note: onloadedmetadata doesn't fire in Chrome when using it with getUserMedia. + // See crbug.com/110938. + _successId = setInterval(function (){ + if( _detectVideoSignal(video) ){ + _complete(null); + } + }, 1000); + + _failId = setTimeout(function (){ + _complete('timeout'); + }, 5000); + + // Go-go-go! + video.play(); + }, _complete/*error*/); + }, + + + /** + * Stop camera streaming + */ + stop: function (){ + try { + this._active = false; + this.video.pause(); + + try { + this.stream.stop(); + } catch (err) { + api.each(this.stream.getTracks(), function (track) { + track.stop(); + }); + } + + this.stream = null; + } catch( err ){ + api.log('[FileAPI.Camera] stop:', err); + } + }, + + + /** + * Create screenshot + * @return {FileAPI.Camera.Shot} + */ + shot: function (){ + return new Shot(this.video); + } + }; + + + /** + * Get camera element from container + * + * @static + * @param {HTMLElement} el + * @return {Camera} + */ + Camera.get = function (el){ + return new Camera(el.firstChild); + }; + + + /** + * Publish camera element into container + * + * @static + * @param {HTMLElement} el + * @param {Object} options + * @param {Function} [callback] + */ + Camera.publish = function (el, options, callback){ + if( typeof options == 'function' ){ + callback = options; + options = {}; + } + + // Dimensions of "camera" + options = api.extend({}, { + width: '100%' + , height: '100%' + , start: true + }, options); + + + if( el.jquery ){ + // Extract first element, from jQuery collection + el = el[0]; + } + + + var doneFn = function (err){ + if( err ){ + callback(err); + } + else { + // Get camera + var cam = Camera.get(el); + if( options.start ){ + cam.start(callback); + } + else { + callback(null, cam); + } + } + }; + + + el.style.width = _px(options.width); + el.style.height = _px(options.height); + + + if( api.html5 && html5 ){ + // Create video element + var video = document.createElement('video'); + + // Set dimensions + video.style.width = _px(options.width); + video.style.height = _px(options.height); + + // Clean container + if( window.jQuery ){ + jQuery(el).empty(); + } else { + el.innerHTML = ''; + } + + // Add "camera" to container + el.appendChild(video); + + // end + doneFn(); + } + else { + Camera.fallback(el, options, doneFn); + } + }; + + + Camera.fallback = function (el, options, callback){ + callback('not_support_camera'); + }; + + + /** + * @class FileAPI.Camera.Shot + */ + var Shot = function (video){ + var canvas = video.nodeName ? api.Image.toCanvas(video) : video; + var shot = api.Image(canvas); + shot.type = 'image/png'; + shot.width = canvas.width; + shot.height = canvas.height; + shot.size = canvas.width * canvas.height * 4; + return shot; + }; + + + /** + * Add "px" postfix, if value is a number + * + * @private + * @param {*} val + * @return {String} + */ + function _px(val){ + return val >= 0 ? val + 'px' : val; + } + + + /** + * @private + * @param {HTMLVideoElement} video + * @return {Boolean} + */ + function _detectVideoSignal(video){ + var canvas = document.createElement('canvas'), ctx, res = false; + try { + ctx = canvas.getContext('2d'); + ctx.drawImage(video, 0, 0, 1, 1); + res = ctx.getImageData(0, 0, 1, 1).data[4] != 255; + } + catch( err ){ + api.log('[FileAPI.Camera] detectVideoSignal:', err); + } + return res; + } + + + // @export + Camera.Shot = Shot; + api.Camera = Camera; +})(window, FileAPI); + +/** + * FileAPI fallback to Flash + * + * @flash-developer "Vladimir Demidov" + */ + +/*global window, FileAPI */ +(function (window, jQuery, api) { + "use strict"; + + var _each = api.each, + _cameraQueue = []; + + if (api.support.flash && (api.media && (!api.support.media || !api.html5))) { + (function () { + function _wrap(fn) { + var id = fn.wid = api.uid(); + api.Flash._fn[id] = fn; + return 'FileAPI.Flash._fn.' + id; + } + + + function _unwrap(fn) { + try { + api.Flash._fn[fn.wid] = null; + delete api.Flash._fn[fn.wid]; + } catch (e) { + } + } + + var flash = api.Flash; + api.extend(api.Flash, { + + patchCamera: function () { + api.Camera.fallback = function (el, options, callback) { + var camId = api.uid(); + api.log('FlashAPI.Camera.publish: ' + camId); + flash.publish(el, camId, api.extend(options, { + camera: true, + onEvent: _wrap(function _(evt) { + if (evt.type === 'camera') { + _unwrap(_); + + if (evt.error) { + api.log('FlashAPI.Camera.publish.error: ' + evt.error); + callback(evt.error); + } else { + api.log('FlashAPI.Camera.publish.success: ' + camId); + callback(null); + } + } + }) + })); + }; + // Run + _each(_cameraQueue, function (args) { + api.Camera.fallback.apply(api.Camera, args); + }); + _cameraQueue = []; + + + // FileAPI.Camera:proto + api.extend(api.Camera.prototype, { + _id: function () { + return this.video.id; + }, + + start: function (callback) { + var _this = this; + flash.cmd(this._id(), 'camera.on', { + callback: _wrap(function _(evt) { + _unwrap(_); + + if (evt.error) { + api.log('FlashAPI.camera.on.error: ' + evt.error); + callback(evt.error, _this); + } else { + api.log('FlashAPI.camera.on.success: ' + _this._id()); + _this._active = true; + callback(null, _this); + } + }) + }); + }, + + stop: function () { + this._active = false; + flash.cmd(this._id(), 'camera.off'); + }, + + shot: function () { + api.log('FlashAPI.Camera.shot:', this._id()); + + var shot = api.Flash.cmd(this._id(), 'shot', {}); + shot.type = 'image/png'; + shot.flashId = this._id(); + shot.isShot = true; + + return new api.Camera.Shot(shot); + } + }); + } + }); + + api.Camera.fallback = function () { + _cameraQueue.push(arguments); + }; + + }()); + } +}(window, window.jQuery, FileAPI)); if( typeof define === "function" && define.amd ){ define("FileAPI", [], function (){ return FileAPI; }); } \ No newline at end of file diff --git a/manager/media/browser/mcpuk/js/FileAPI/FileAPI.html5.min.js b/manager/media/browser/mcpuk/js/FileAPI/FileAPI.html5.min.js index f5c8153fb4..d3a8e21162 100644 --- a/manager/media/browser/mcpuk/js/FileAPI/FileAPI.html5.min.js +++ b/manager/media/browser/mcpuk/js/FileAPI/FileAPI.html5.min.js @@ -1,3 +1,3 @@ -/*! FileAPI 2.0.19 - BSD | git://github.com/mailru/FileAPI.git */ -!function(a){"use strict";var b=a.HTMLCanvasElement&&a.HTMLCanvasElement.prototype,c=a.Blob&&function(){try{return Boolean(new Blob)}catch(a){return!1}}(),d=c&&a.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(a){return!1}}(),e=a.BlobBuilder||a.WebKitBlobBuilder||a.MozBlobBuilder||a.MSBlobBuilder,f=(c||e)&&a.atob&&a.ArrayBuffer&&a.Uint8Array&&function(a){var b,f,g,h,i,j;for(b=a.split(",")[0].indexOf("base64")>=0?atob(a.split(",")[1]):decodeURIComponent(a.split(",")[1]),f=new ArrayBuffer(b.length),g=new Uint8Array(f),h=0;h0,H=a.dataURLtoBlob,I=/img/i,J=/canvas/i,K=/img|canvas/i,L=/input/i,M=/^data:[^,]+,/,N={}.toString,O=a.Math,P=function(b){return b=new a.Number(O.pow(1024,b)),b.from=function(a){return O.round(a*this)},b},Q={},R=[],S="abort progress error load loadend",T="status statusText readyState response responseXML responseText responseBody".split(" "),U="currentTarget",V="preventDefault",W=function(a){return a&&"length"in a},X=function(a,b,c){if(a)if(W(a))for(var d=0,e=a.length;e>d;d++)d in a&&b.call(c,a[d],d,a);else for(var f in a)a.hasOwnProperty(f)&&b.call(c,a[f],f,a)},Y=function(a){for(var b=arguments,c=1,d=function(b,c){a[c]=b};c=c&&!d&&f.end()},isFail:function(){return d},fail:function(){!d&&a(d=!0)},end:function(){e||(e=!0,a())}};return f},each:X,afor:function(a,b){var c=0,d=a.length;W(a)&&d--?!function e(){b(d!=c&&e,a[c],c++)}():b(!1)},extend:Y,isFile:function(a){return"[object File]"===N.call(a)},isBlob:function(a){return this.isFile(a)||"[object Blob]"===N.call(a)},isCanvas:function(a){return a&&J.test(a.nodeName)},getFilesFilter:function(a){return a="string"==typeof a?a:a.getAttribute&&a.getAttribute("accept")||"",a?new RegExp("("+a.replace(/\./g,"\\.").replace(/,/g,"|")+")$","i"):/./},readAsDataURL:function(a,b){ca.isCanvas(a)?c(a,b,"load",ca.toDataURL(a)):e(a,b,"DataURL")},readAsBinaryString:function(a,b){d("BinaryString")?e(a,b,"BinaryString"):e(a,function(a){if("load"==a.type)try{a.result=ca.toBinaryString(a.result)}catch(c){a.type="error",a.message=c.toString()}b(a)},"DataURL")},readAsArrayBuffer:function(a,b){e(a,b,"ArrayBuffer")},readAsText:function(a,b,c){c||(c=b,b="utf-8"),e(a,c,"Text",b)},toDataURL:function(a,b){return"string"==typeof a?a:a.toDataURL?a.toDataURL(b||"image/png"):void 0},toBinaryString:function(b){return a.atob(ca.toDataURL(b).replace(M,""))},readAsImage:function(a,d,e){if(ca.isBlob(a))if(w){var f=w.createObjectURL(a);f===b?c(a,d,"error"):ca.readAsImage(f,d,e)}else ca.readAsDataURL(a,function(b){"load"==b.type?ca.readAsImage(b.result,d,e):(e||"error"==b.type)&&c(a,d,b,null,{loaded:b.loaded,total:b.total})});else if(ca.isCanvas(a))c(a,d,"load",a);else if(I.test(a.nodeName))if(a.complete)c(a,d,"load",a);else{var g="error abort load";_(a,g,function i(b){"load"==b.type&&w&&w.revokeObjectURL(a.src),$(a,g,i),c(a,d,b,a)})}else if(a.iframe)c(a,d,{type:"error"});else{var h=ca.newImage(a.dataURL||a);ca.readAsImage(h,d,e)}},checkFileObj:function(a){var b={},c=ca.accept;return"object"==typeof a?b=a:b.name=(a+"").split(/\\|\//g).pop(),null==b.type&&(b.type=b.name.split(".").pop()),X(c,function(a,c){a=new RegExp(a.replace(/\s/g,"|"),"i"),(a.test(b.type)||ca.ext2mime[b.type])&&(b.type=ca.ext2mime[b.type]||c.split("/")[0]+"/"+b.type)}),b},getDropFiles:function(a,b){var c,d=[],e=[],j=l(a),k=j.files,m=j.items,n=W(m)&&m[0]&&h(m[0]),o=ca.queue(function(){b(d,e)});if(n)if(G&&k){var p,q,r=k.length;for(c=new Array(r);r--;){p=k[r];try{q=h(m[r])}catch(s){ca.log("[err] getDropFiles: ",s),q=null}g(q)&&(q.isDirectory||q.isFile&&p.name==p.name.normalize("NFC"))?c[r]=q:c[r]=p}}else c=m;else c=k;X(c||[],function(a){o.inc();try{n&&g(a)?i(a,function(a,b,c){a?ca.log("[err] getDropFiles:",a):d.push.apply(d,b),e.push.apply(e,c),o.next()}):f(a,function(b,c){b?d.push(a):a.error=c,e.push(a),o.next()})}catch(b){o.next(),ca.log("[err] getDropFiles: ",b)}}),o.check()},getFiles:function(a,b,c){var d=[];return c?(ca.filterFiles(ca.getFiles(a),b,c),null):(a.jquery&&(a.each(function(){d=d.concat(ca.getFiles(this))}),a=d,d=[]),"string"==typeof b&&(b=ca.getFilesFilter(b)),a.originalEvent?a=aa(a.originalEvent):a.srcElement&&(a=aa(a)),a.dataTransfer?a=a.dataTransfer:a.target&&(a=a.target),a.files?(d=a.files,D||(d[0].blob=a,d[0].iframe=!0)):!D&&k(a)?ca.trim(a.value)&&(d=[ca.checkFileObj(a.value)],d[0].blob=a,d[0].iframe=!0):W(a)&&(d=a),ca.filter(d,function(a){return!b||b.test(a.name)}))},getTotalSize:function(a){for(var b=0,c=a&&a.length;c--;)b+=a[c].size;return b},getInfo:function(a,b){var c={},d=R.concat();ca.isBlob(a)?!function e(){var f=d.shift();f?f.test(a.type)?f(a,function(a,d){a?b(a):(Y(c,d),e())}):e():b(!1,c)}():b("not_support_info",c)},addInfoReader:function(a,b){b.test=function(b){return a.test(b)},R.push(b)},filter:function(a,b){for(var c,d=[],e=0,f=a.length;f>e;e++)e in a&&(c=a[e],b.call(c,c,e,a)&&d.push(c));return d},filterFiles:function(a,b,c){if(a.length){var d,e=a.concat(),f=[],g=[];!function h(){e.length?(d=e.shift(),ca.getInfo(d,function(a,c){(b(d,a?!1:c)?f:g).push(d),h()})):c(f,g)}()}else c([],a)},upload:function(a){a=Y({jsonp:"callback",prepare:ca.F,beforeupload:ca.F,upload:ca.F,fileupload:ca.F,fileprogress:ca.F,filecomplete:ca.F,progress:ca.F,complete:ca.F,pause:ca.F,imageOriginal:!0,chunkSize:ca.chunkSize,chunkUploadRetry:ca.chunkUploadRetry,uploadRetry:ca.uploadRetry},a),a.imageAutoOrientation&&!a.imageTransform&&(a.imageTransform={rotate:"auto"});var b,c=new ca.XHR(a),d=this._getFilesDataArray(a.files),e=this,f=0,g=0,h=!1;return X(d,function(a){f+=a.size}),c.files=[],X(d,function(a){c.files.push(a.file)}),c.total=f,c.loaded=0,c.filesLeft=d.length,a.beforeupload(c,a),b=function(){var i=d.shift(),k=i&&i.file,l=!1,m=j(a);if(c.filesLeft=d.length,k&&k.name===ca.expando&&(k=null,ca.log("[warn] FileAPI.upload() — called without files")),("abort"!=c.statusText||c.current)&&i){if(h=!1,c.currentFile=k,k&&a.prepare(k,m)===!1)return void b.call(e);m.file=k,e._getFormData(m,i,function(h){g||a.upload(c,a);var j=new ca.XHR(Y({},m,{upload:k?function(){a.fileupload(k,j,m)}:q,progress:k?function(b){l||(l=b.loaded===b.total,a.fileprogress({type:"progress",total:i.total=b.total,loaded:i.loaded=b.loaded},k,j,m),a.progress({type:"progress",total:f,loaded:c.loaded=g+i.size*(b.loaded/b.total)||0},k,j,m))}:q,complete:function(d){X(T,function(a){c[a]=j[a]}),k&&(i.total=i.total||i.size,i.loaded=i.total,d||(this.progress(i),l=!0,g+=i.size,c.loaded=g),a.filecomplete(d,j,k,m)),setTimeout(function(){b.call(e)},0)}}));c.abort=function(a){a||(d.length=0),this.current=a,j.abort()},j.send(h)})}else{var n=200==c.status||201==c.status||204==c.status;a.complete(n?!1:c.statusText||"error",c,a),h=!0}},setTimeout(b,0),c.append=function(a,g){a=ca._getFilesDataArray([].concat(a)),X(a,function(a){f+=a.size,c.files.push(a.file),g?d.unshift(a):d.push(a)}),c.statusText="",h&&b.call(e)},c.remove=function(a){for(var b,c=d.length;c--;)d[c].file==a&&(b=d.splice(c,1),f-=b.size);return b},c},_getFilesDataArray:function(a){var b=[],c={};if(k(a)){var d=ca.getFiles(a);c[a.name||"file"]=null!==a.getAttribute("multiple")?d:d[0]}else W(a)&&k(a[0])?X(a,function(a){c[a.name||"file"]=ca.getFiles(a)}):c=a;return X(c,function e(a,c){W(a)?X(a,function(a){e(a,c)}):a&&(a.name||a.image)&&b.push({name:c,file:a,size:a.size,total:a.size,loaded:0})}),b.length||b.push({file:{name:ca.expando}}),b},_getFormData:function(a,b,c){var d=b.file,e=b.name,f=d.name,g=d.type,h=ca.support.transform&&a.imageTransform,i=new ca.Form,j=ca.queue(function(){c(i)}),k=h&&m(h),l=ca.postNameConcat;X(a.data,function n(a,b){"object"==typeof a?X(a,function(a,c){n(a,l(b,c))}):i.append(b,a)}),function o(b){b.image?(j.inc(),b.toData(function(a,c){b.file&&(c.type=b.file.type,c.quality=b.matrix.quality,f=b.file&&b.file.name),f=f||(new Date).getTime()+".png",o(c),j.next()})):ca.Image&&h&&(/^image/.test(b.type)||K.test(b.nodeName))?(j.inc(),k&&(h=[h]),ca.Image.transform(b,h,a.imageAutoOrientation,function(c,d){if(k&&!c)H||ca.flashEngine||(i.multipart=!0),i.append(e,d[0],f,h[0].type||g);else{var m=0;c||X(d,function(a,b){H||ca.flashEngine||(i.multipart=!0),h[b].postName||(m=1),i.append(h[b].postName||l(e,b),a,f,h[b].type||g)}),(c||a.imageOriginal)&&i.append(l(e,m?"original":null),b,f,g)}j.next()})):f!==ca.expando&&i.append(e,b,f)}(d),j.check()},reset:function(a,b){var c,d;return C?(d=C(a).clone(!0).insertBefore(a).val("")[0],b||C(a).remove()):(c=a.parentNode,d=c.insertBefore(a.cloneNode(!0),a),d.value="",b||c.removeChild(a),X(Q[ca.uid(a)],function(b,c){X(b,function(b){$(a,c,b),Z(d,c,b)})})),d},load:function(a,b){var c=ca.getXHR();return c?(c.open("GET",a,!0),c.overrideMimeType&&c.overrideMimeType("text/plain; charset=x-user-defined"),Z(c,"progress",function(a){a.lengthComputable&&b({type:a.type,loaded:a.loaded,total:a.total},c)}),c.onreadystatechange=function(){if(4==c.readyState)if(c.onreadystatechange=null,200==c.status){a=a.split("/");var d={name:a[a.length-1],size:c.getResponseHeader("Content-Length"),type:c.getResponseHeader("Content-Type")};d.dataURL="data:"+d.type+";base64,"+ca.encode64(c.responseBody||c.responseText),b({type:"load",result:d},c)}else b({type:"error"},c)},c.send(null)):b({type:"error"}),c},encode64:function(a){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",d=0;for("string"!=typeof a&&(a=String(a));d>2,k=(3&g)<<4|h>>4;isNaN(h)?e=f=64:(e=(15&h)<<2|i>>6,f=isNaN(i)?64:63&i),c+=b.charAt(j)+b.charAt(k)+b.charAt(e)+b.charAt(f)}return c}};ca.addInfoReader(/^image/,function(a,b){if(!a.__dimensions){var c=a.__dimensions=ca.defer();ca.readAsImage(a,function(a){var b=a.target;c.resolve("load"==a.type?!1:"error",{width:b.width,height:b.height}),b.src=ca.EMPTY_PNG,b=null})}a.__dimensions.then(b)}),ca.event.dnd=function(a,b,c){var d,e;c||(c=b,b=ca.F),z?(Z(a,"dragenter dragleave dragover",b.ff=b.ff||function(a){for(var c=l(a).types,f=c&&c.length,g=!1;f--;)if(~c[f].indexOf("File")){a[V](),e!==a.type&&(e=a.type,"dragleave"!=e&&b.call(a[U],!0,a),g=!0);break}g&&(clearTimeout(d),d=setTimeout(function(){b.call(a[U],"dragleave"!=e,a)},50))}),Z(a,"drop",c.ff=c.ff||function(a){a[V](),e=0,b.call(a[U],!1,a),ca.getDropFiles(a,function(b,d){c.call(a[U],b,d,a)})})):ca.log("Drag'n'Drop -- not supported")},ca.event.dnd.off=function(a,b,c){$(a,"dragenter dragleave dragover",b.ff),$(a,"drop",c.ff)},C&&!C.fn.dnd&&(C.fn.dnd=function(a,b){return this.each(function(){ca.event.dnd(this,a,b)})},C.fn.offdnd=function(a,b){return this.each(function(){ca.event.dnd.off(this,a,b)})}),a.FileAPI=Y(ca,a.FileAPI),ca.log("FileAPI: "+ca.version),ca.log("protocol: "+a.location.protocol),ca.log("doctype: ["+s.name+"] "+s.publicId+" "+s.systemId),X(r.getElementsByTagName("meta"),function(a){/x-ua-compatible/i.test(a.getAttribute("http-equiv"))&&ca.log("meta.http-equiv: "+a.getAttribute("content"))});try{n=!!console.log,o=!!console.log.apply}catch(da){}ca.flashUrl||(ca.flashUrl=ca.staticPath+"FileAPI.flash.swf"),ca.flashImageUrl||(ca.flashImageUrl=ca.staticPath+"FileAPI.flash.image.swf"),ca.flashWebcamUrl||(ca.flashWebcamUrl=ca.staticPath+"FileAPI.flash.camera.swf")}(window,void 0),function(a,b,c){"use strict";function d(b){if(b instanceof d){var c=new d(b.file);return a.extend(c.matrix,b.matrix),c}return this instanceof d?(this.file=b,this.size=b.size||100,void(this.matrix={sx:0,sy:0,sw:0,sh:0,dx:0,dy:0,dw:0,dh:0,resize:0,deg:0,quality:1,filter:0})):new d(b)}var e=Math.min,f=Math.round,g=function(){return b.createElement("canvas")},h=!1,i={8:270,3:180,6:90,7:270,4:180,5:90};try{h=g().toDataURL("image/png").indexOf("data:image/png")>-1}catch(j){}d.prototype={image:!0,constructor:d,set:function(b){return a.extend(this.matrix,b),this},crop:function(a,b,d,e){return d===c&&(d=a,e=b,a=b=0),this.set({sx:a,sy:b,sw:d,sh:e||d})},resize:function(a,b,c){return/min|max|height|width/.test(b)&&(c=b,b=a),this.set({dw:a,dh:b||a,resize:c})},preview:function(a,b){return this.resize(a,b||a,"preview")},rotate:function(a){return this.set({deg:a})},filter:function(a){return this.set({filter:a})},overlay:function(a){return this.set({overlay:a})},clone:function(){return new d(this)},_load:function(b,c){var d=this;/img|video/i.test(b.nodeName)?c.call(d,null,b):a.readAsImage(b,function(a){c.call(d,"load"!=a.type,a.result)})},_apply:function(b,c){var f,h=g(),i=this.getMatrix(b),j=h.getContext("2d"),k=b.videoWidth||b.width,l=b.videoHeight||b.height,m=i.deg,n=i.dw,o=i.dh,p=k,q=l,r=i.filter,s=b,t=i.overlay,u=a.queue(function(){b.src=a.EMPTY_PNG,c(!1,h)}),v=a.renderImageToCanvas;for(m-=360*Math.floor(m/360),b._type=this.file.type;i.multipass&&e(p/n,q/o)>2;)p=p/2+.5|0,q=q/2+.5|0,f=g(),f.width=p,f.height=q,s!==b?(v(f,s,0,0,s.width,s.height,0,0,p,q),s=f):(s=f,v(s,b,i.sx,i.sy,i.sw,i.sh,0,0,p,q),i.sx=i.sy=i.sw=i.sh=0);h.width=m%180?o:n,h.height=m%180?n:o,h.type=i.type,h.quality=i.quality,j.rotate(m*Math.PI/180),v(j.canvas,s,i.sx,i.sy,i.sw||s.width,i.sh||s.height,180==m||270==m?-n:0,90==m||180==m?-o:0,n,o),n=h.width,o=h.height,t&&a.each([].concat(t),function(b){u.inc();var c=new window.Image,d=function(){var e=0|b.x,f=0|b.y,g=b.w||c.width,h=b.h||c.height,i=b.rel;e=1==i||4==i||7==i?(n-g+e)/2:2==i||5==i||8==i?n-(g+e):e,f=3==i||4==i||5==i?(o-h+f)/2:i>=6?o-(h+f):f,a.event.off(c,"error load abort",d);try{j.globalAlpha=b.opacity||1,j.drawImage(c,e,f,g,h)}catch(k){}u.next()};a.event.on(c,"error load abort",d),c.src=b.src,c.complete&&d()}),r&&(u.inc(),d.applyFilter(h,r,u.next)),u.check()},getMatrix:function(b){var c=a.extend({},this.matrix),d=c.sw=c.sw||b.videoWidth||b.naturalWidth||b.width,g=c.sh=c.sh||b.videoHeight||b.naturalHeight||b.height,h=c.dw=c.dw||d,i=c.dh=c.dh||g,j=d/g,k=h/i,l=c.resize;if("preview"==l){if(h!=d||i!=g){var m,n;k>=j?(m=d,n=m/k):(n=g,m=n*k),(m!=d||n!=g)&&(c.sx=~~((d-m)/2),c.sy=~~((g-n)/2),d=m,g=n)}}else"height"==l?h=i*j:"width"==l?i=h/j:l&&(d>h||g>i?"min"==l?(h=f(k>j?e(d,h):i*j),i=f(k>j?h/j:e(g,i))):(h=f(j>=k?e(d,h):i*j),i=f(j>=k?h/j:e(g,i))):(h=d,i=g));return c.sw=d,c.sh=g,c.dw=h,c.dh=i,c.multipass=a.multiPassResize,c},_trans:function(b){this._load(this.file,function(c,d){if(c)b(c);else try{this._apply(d,b)}catch(c){a.log("[err] FileAPI.Image.fn._apply:",c),b(c)}})},get:function(b){if(a.support.transform){var c=this,d=c.matrix;"auto"==d.deg?a.getInfo(c.file,function(a,e){d.deg=i[e&&e.exif&&e.exif.Orientation]||0,c._trans(b)}):c._trans(b)}else b("not_support_transform");return this},toData:function(a){return this.get(a)}},d.exifOrientation=i,d.transform=function(b,e,f,g){function h(h,i){var j={},k=a.queue(function(a){g(a,j)});h?k.fail():a.each(e,function(a,e){if(!k.isFail()){var g=new d(i.nodeType?i:b),h="function"==typeof a;if(h?a(i,g):a.width?g[a.preview?"preview":"resize"](a.width,a.height,a.strategy):a.maxWidth&&(i.width>a.maxWidth||i.height>a.maxHeight)&&g.resize(a.maxWidth,a.maxHeight,"max"),a.crop){var l=a.crop;g.crop(0|l.x,0|l.y,l.w||l.width,l.h||l.height)}a.rotate===c&&f&&(a.rotate="auto"),g.set({type:g.matrix.type||a.type||b.type||"image/png"}),h||g.set({deg:a.rotate,overlay:a.overlay,filter:a.filter,quality:a.quality||1}),k.inc(),g.toData(function(a,b){a?k.fail():(j[e]=b,k.next())})}})}b.width?h(!1,b):a.getInfo(b,h)},a.each(["TOP","CENTER","BOTTOM"],function(b,c){a.each(["LEFT","CENTER","RIGHT"],function(a,e){d[b+"_"+a]=3*c+e,d[a+"_"+b]=3*c+e})}),d.toCanvas=function(a){var c=b.createElement("canvas");return c.width=a.videoWidth||a.width,c.height=a.videoHeight||a.height,c.getContext("2d").drawImage(a,0,0),c},d.fromDataURL=function(b,c,d){var e=a.newImage(b);a.extend(e,c),d(e)},d.applyFilter=function(b,c,e){"function"==typeof c?c(b,e):window.Caman&&window.Caman("IMG"==b.tagName?d.toCanvas(b):b,function(){"string"==typeof c?this[c]():a.each(c,function(a,b){this[b](a)},this),this.render(e)})},a.renderImageToCanvas=function(b,c,d,e,f,g,h,i,j,k){try{return b.getContext("2d").drawImage(c,d,e,f,g,h,i,j,k)}catch(l){throw a.log("renderImageToCanvas failed"),l}},a.support.canvas=a.support.transform=h,a.Image=d}(FileAPI,document),function(a){"use strict";a(FileAPI)}(function(a){"use strict";if(window.navigator&&window.navigator.platform&&/iP(hone|od|ad)/.test(window.navigator.platform)){var b=a.renderImageToCanvas;a.detectSubsampling=function(a){var b,c;return a.width*a.height>1048576?(b=document.createElement("canvas"),b.width=b.height=1,c=b.getContext("2d"),c.drawImage(a,-a.width+1,0),0===c.getImageData(0,0,1,1).data[3]):!1},a.detectVerticalSquash=function(a,b){var c,d,e,f,g,h=a.naturalHeight||a.height,i=document.createElement("canvas"),j=i.getContext("2d");for(b&&(h/=2),i.width=1,i.height=h,j.drawImage(a,0,0),c=j.getImageData(0,0,1,h).data,d=0,e=h,f=h;f>d;)g=c[4*(f-1)+3],0===g?e=f:d=f,f=e+d>>1;return f/h||1},a.renderImageToCanvas=function(c,d,e,f,g,h,i,j,k,l){if("image/jpeg"===d._type){var m,n,o,p,q=c.getContext("2d"),r=document.createElement("canvas"),s=1024,t=r.getContext("2d");if(r.width=s,r.height=s,q.save(),m=a.detectSubsampling(d),m&&(e/=2,f/=2,g/=2,h/=2),n=a.detectVerticalSquash(d,m),m||1!==n){for(f*=n,k=Math.ceil(s*k/g),l=Math.ceil(s*l/h/n),j=0,p=0;h>p;){for(i=0,o=0;g>o;)t.clearRect(0,0,s,s),t.drawImage(d,e,f,g,h,-o,-p,g,h),q.drawImage(r,0,0,s,s,i,j,k,l),o+=s,i+=k;p+=s,j+=l}return q.restore(),c}}return b(c,d,e,f,g,h,i,j,k,l)}}}),function(a,b){"use strict";function c(b,c,d){var e=b.blob,f=b.file;if(f){if(!e.toDataURL)return void a.readAsBinaryString(e,function(a){"load"==a.type&&c(b,a.result)});var g={"image/jpeg":".jpe?g","image/png":".png"},h=g[b.type]?b.type:"image/png",i=g[h]||".png",j=e.quality||1;f.match(new RegExp(i+"$","i"))||(f+=i.replace("?","")),b.file=f,b.type=h,!d&&e.toBlob?e.toBlob(function(a){c(b,a)},h,j):c(b,a.toBinaryString(e.toDataURL(h,j)))}else c(b,e)}var d=b.document,e=b.FormData,f=function(){this.items=[]},g=b.encodeURIComponent;f.prototype={append:function(a,b,c,d){this.items.push({name:a,blob:b&&b.blob||(void 0==b?"":b),file:b&&(c||b.name),type:b&&(d||b.type)})},each:function(a){for(var b=0,c=this.items.length;c>b;b++)a.call(this,this.items[b])},toData:function(b,c){c._chunked=a.support.chunked&&c.chunkSize>0&&1==a.filter(this.items,function(a){return a.file}).length,a.support.html5?a.formData&&!this.multipart&&e?c._chunked?(a.log("FileAPI.Form.toPlainData"),this.toPlainData(b)):(a.log("FileAPI.Form.toFormData"),this.toFormData(b)):(a.log("FileAPI.Form.toMultipartData"),this.toMultipartData(b)):(a.log("FileAPI.Form.toHtmlData"),this.toHtmlData(b))},_to:function(b,c,d,e){var f=a.queue(function(){c(b)});this.each(function(g){try{d(g,b,f,e)}catch(h){a.log("FileAPI.Form._to: "+h.message),c(h)}}),f.check()},toHtmlData:function(b){this._to(d.createDocumentFragment(),b,function(b,c){var e,f=b.blob;b.file?(a.reset(f,!0),f.name=b.name,f.disabled=!1,c.appendChild(f)):(e=d.createElement("input"),e.name=b.name,e.type="hidden",e.value=f,c.appendChild(e))})},toPlainData:function(a){this._to({},a,function(a,b,d){a.file&&(b.type=a.file),a.blob.toBlob?(d.inc(),c(a,function(a,c){b.name=a.name,b.file=c,b.size=c.length,b.type=a.type,d.next()})):a.file?(b.name=a.blob.name,b.file=a.blob,b.size=a.blob.size,b.type=a.type):(b.params||(b.params=[]),b.params.push(g(a.name)+"="+g(a.blob))),b.start=-1,b.end=b.file&&b.file.FileAPIReadPosition||-1,b.retry=0})},toFormData:function(a){this._to(new e,a,function(a,b,d){a.blob&&a.blob.toBlob?(d.inc(),c(a,function(a,c){b.append(a.name,c,a.file),d.next()})):a.file?b.append(a.name,a.blob,a.file):b.append(a.name,a.blob),a.file&&b.append("_"+a.name,a.file)})},toMultipartData:function(b){this._to([],b,function(a,b,d,e){d.inc(),c(a,function(a,c){b.push("--_"+e+('\r\nContent-Disposition: form-data; name="'+a.name+'"'+(a.file?'; filename="'+g(a.file)+'"':"")+(a.file?"\r\nContent-Type: "+(a.type||"application/octet-stream"):"")+"\r\n\r\n"+(a.file?c:g(c))+"\r\n")),d.next()},!0)},a.expando)}},a.Form=f}(FileAPI,window),function(a,b){"use strict";var c=function(){},d=a.document,e=function(a){this.uid=b.uid(),this.xhr={abort:c,getResponseHeader:c,getAllResponseHeaders:c},this.options=a},f={"":1,XML:1,Text:1,Body:1};e.prototype={status:0,statusText:"",constructor:e,getResponseHeader:function(a){return this.xhr.getResponseHeader(a)},getAllResponseHeaders:function(){return this.xhr.getAllResponseHeaders()||{}},end:function(d,e){var f=this,g=f.options;f.end=f.abort=c,f.status=d,e&&(f.statusText=e),b.log("xhr.end:",d,e),g.complete(200==d||201==d?!1:f.statusText||"unknown",f),f.xhr&&f.xhr.node&&setTimeout(function(){var b=f.xhr.node;try{b.parentNode.removeChild(b)}catch(c){}try{delete a[f.uid]}catch(c){}a[f.uid]=f.xhr.node=null},9)},abort:function(){this.end(0,"abort"),this.xhr&&(this.xhr.aborted=!0,this.xhr.abort())},send:function(a){var b=this,c=this.options;a.toData(function(a){a instanceof Error?b.end(0,a.message):(c.upload(c,b),b._send.call(b,c,a))},c)},_send:function(c,e){var g,h=this,i=h.uid,j=h.uid+"Load",k=c.url;if(b.log("XHR._send:",e),c.cache||(k+=(~k.indexOf("?")?"&":"?")+b.uid()),e.nodeName){var l=c.jsonp;k=k.replace(/([a-z]+)=(\?)/i,"$1="+i),c.upload(c,h);var m=function(a){if(~k.indexOf(a.origin))try{var c=b.parseJSON(a.data);c.id==i&&n(c.status,c.statusText,c.response)}catch(d){n(0,d.message)}},n=a[i]=function(c,d,e){h.readyState=4,h.responseText=e,h.end(c,d),b.event.off(a,"message",m),a[i]=g=p=a[j]=null};h.xhr.abort=function(){try{p.stop?p.stop():p.contentWindow.stop?p.contentWindow.stop():p.contentWindow.document.execCommand("Stop")}catch(a){}n(0,"abort")},b.event.on(a,"message",m),a[j]=function(){try{var a=p.contentWindow,c=a.document,d=a.result||b.parseJSON(c.body.innerHTML);n(d.status,d.statusText,d.response)}catch(e){b.log("[transport.onload]",e)}},g=d.createElement("div"),g.innerHTML='
    '+(l&&c.url.indexOf("=?")<0?'':"")+"";var o=g.getElementsByTagName("form")[0],p=g.getElementsByTagName("iframe")[0];o.appendChild(e),b.log(o.parentNode.innerHTML),d.body.appendChild(g),h.xhr.node=g,h.readyState=2;try{o.submit()}catch(q){b.log("iframe.error: "+q)}o=null}else{if(k=k.replace(/([a-z]+)=(\?)&?/i,""),this.xhr&&this.xhr.aborted)return void b.log("Error: already aborted");if(g=h.xhr=b.getXHR(),e.params&&(k+=(k.indexOf("?")<0?"?":"&")+e.params.join("&")),g.open("POST",k,!0),b.withCredentials&&(g.withCredentials="true"),c.headers&&c.headers["X-Requested-With"]||g.setRequestHeader("X-Requested-With","XMLHttpRequest"),b.each(c.headers,function(a,b){g.setRequestHeader(b,a)}),c._chunked){g.upload&&g.upload.addEventListener("progress",b.throttle(function(a){e.retry||c.progress({type:a.type,total:e.size,loaded:e.start+a.loaded,totalSize:e.size},h,c)},100),!1),g.onreadystatechange=function(){var a=parseInt(g.getResponseHeader("X-Last-Known-Byte"),10);if(h.status=g.status,h.statusText=g.statusText,h.readyState=g.readyState,4==g.readyState){for(var d in f)h["response"+d]=g["response"+d];if(g.onreadystatechange=null,!g.status||g.status-201>0)if(b.log("Error: "+g.status),(!g.status&&!g.aborted||500==g.status||416==g.status)&&++e.retry<=c.chunkUploadRetry){var i=g.status?0:b.chunkNetworkDownRetryTimeout;c.pause(e.file,c),b.log("X-Last-Known-Byte: "+a),a?e.end=a:(e.end=e.start-1,416==g.status&&(e.end=e.end-c.chunkSize)),setTimeout(function(){h._send(c,e)},i)}else h.end(g.status);else e.retry=0,e.end==e.size-1?h.end(g.status):(b.log("X-Last-Known-Byte: "+a),a&&(e.end=a),e.file.FileAPIReadPosition=e.end,setTimeout(function(){h._send(c,e)},0));g=null}},e.start=e.end+1,e.end=Math.max(Math.min(e.start+c.chunkSize,e.size)-1,e.start);var r=e.file,s=(r.slice||r.mozSlice||r.webkitSlice).call(r,e.start,e.end+1);e.size&&!s.size?setTimeout(function(){h.end(-1)}):(g.setRequestHeader("Content-Range","bytes "+e.start+"-"+e.end+"/"+e.size),g.setRequestHeader("Content-Disposition","attachment; filename="+encodeURIComponent(e.name)),g.setRequestHeader("Content-Type",e.type||"application/octet-stream"),g.send(s)),r=s=null}else if(g.upload&&g.upload.addEventListener("progress",b.throttle(function(a){c.progress(a,h,c)},100),!1),g.onreadystatechange=function(){if(h.status=g.status,h.statusText=g.statusText,h.readyState=g.readyState,4==g.readyState){for(var a in f)h["response"+a]=g["response"+a];if(g.onreadystatechange=null,!g.status||g.status>201)if(b.log("Error: "+g.status),(!g.status&&!g.aborted||500==g.status)&&(c.retry||0)=0?a+"px":a}function d(a){var c,d=f.createElement("canvas"),e=!1;try{c=d.getContext("2d"),c.drawImage(a,0,0,1,1),e=255!=c.getImageData(0,0,1,1).data[4]}catch(g){b.log("[FileAPI.Camera] detectVideoSignal:",g)}return e}var e=a.URL||a.webkitURL,f=a.document,g=a.navigator,h=g.getUserMedia||g.webkitGetUserMedia||g.mozGetUserMedia||g.msGetUserMedia,i=!!h;b.support.media=i;var j=function(a){this.video=a};j.prototype={isActive:function(){return!!this._active},start:function(a){var b,c,f=this,i=f.video,j=function(d){f._active=!d,clearTimeout(c),clearTimeout(b),a&&a(d,f)};h.call(g,{video:!0},function(a){f.stream=a,i.src=e.createObjectURL(a),b=setInterval(function(){d(i)&&j(null)},1e3),c=setTimeout(function(){j("timeout"); +/*! FileAPI 2.0.19 - BSD | git://github.com/mailru/FileAPI.git */ +!function(a){"use strict";var b=a.HTMLCanvasElement&&a.HTMLCanvasElement.prototype,c=a.Blob&&function(){try{return Boolean(new Blob)}catch(a){return!1}}(),d=c&&a.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(a){return!1}}(),e=a.BlobBuilder||a.WebKitBlobBuilder||a.MozBlobBuilder||a.MSBlobBuilder,f=(c||e)&&a.atob&&a.ArrayBuffer&&a.Uint8Array&&function(a){var b,f,g,h,i,j;for(b=a.split(",")[0].indexOf("base64")>=0?atob(a.split(",")[1]):decodeURIComponent(a.split(",")[1]),f=new ArrayBuffer(b.length),g=new Uint8Array(f),h=0;h0,H=a.dataURLtoBlob,I=/img/i,J=/canvas/i,K=/img|canvas/i,L=/input/i,M=/^data:[^,]+,/,N={}.toString,O=a.Math,P=function(b){return b=new a.Number(O.pow(1024,b)),b.from=function(a){return O.round(a*this)},b},Q={},R=[],S="abort progress error load loadend",T="status statusText readyState response responseXML responseText responseBody".split(" "),U="currentTarget",V="preventDefault",W=function(a){return a&&"length"in a},X=function(a,b,c){if(a)if(W(a))for(var d=0,e=a.length;e>d;d++)d in a&&b.call(c,a[d],d,a);else for(var f in a)a.hasOwnProperty(f)&&b.call(c,a[f],f,a)},Y=function(a){for(var b=arguments,c=1,d=function(b,c){a[c]=b};c=c&&!d&&f.end()},isFail:function(){return d},fail:function(){!d&&a(d=!0)},end:function(){e||(e=!0,a())}};return f},each:X,afor:function(a,b){var c=0,d=a.length;W(a)&&d--?!function e(){b(d!=c&&e,a[c],c++)}():b(!1)},extend:Y,isFile:function(a){return"[object File]"===N.call(a)},isBlob:function(a){return this.isFile(a)||"[object Blob]"===N.call(a)},isCanvas:function(a){return a&&J.test(a.nodeName)},getFilesFilter:function(a){return a="string"==typeof a?a:a.getAttribute&&a.getAttribute("accept")||"",a?new RegExp("("+a.replace(/\./g,"\\.").replace(/,/g,"|")+")$","i"):/./},readAsDataURL:function(a,b){ca.isCanvas(a)?c(a,b,"load",ca.toDataURL(a)):e(a,b,"DataURL")},readAsBinaryString:function(a,b){d("BinaryString")?e(a,b,"BinaryString"):e(a,function(a){if("load"==a.type)try{a.result=ca.toBinaryString(a.result)}catch(c){a.type="error",a.message=c.toString()}b(a)},"DataURL")},readAsArrayBuffer:function(a,b){e(a,b,"ArrayBuffer")},readAsText:function(a,b,c){c||(c=b,b="utf-8"),e(a,c,"Text",b)},toDataURL:function(a,b){return"string"==typeof a?a:a.toDataURL?a.toDataURL(b||"image/png"):void 0},toBinaryString:function(b){return a.atob(ca.toDataURL(b).replace(M,""))},readAsImage:function(a,d,e){if(ca.isBlob(a))if(w){var f=w.createObjectURL(a);f===b?c(a,d,"error"):ca.readAsImage(f,d,e)}else ca.readAsDataURL(a,function(b){"load"==b.type?ca.readAsImage(b.result,d,e):(e||"error"==b.type)&&c(a,d,b,null,{loaded:b.loaded,total:b.total})});else if(ca.isCanvas(a))c(a,d,"load",a);else if(I.test(a.nodeName))if(a.complete)c(a,d,"load",a);else{var g="error abort load";_(a,g,function i(b){"load"==b.type&&w&&w.revokeObjectURL(a.src),$(a,g,i),c(a,d,b,a)})}else if(a.iframe)c(a,d,{type:"error"});else{var h=ca.newImage(a.dataURL||a);ca.readAsImage(h,d,e)}},checkFileObj:function(a){var b={},c=ca.accept;return"object"==typeof a?b=a:b.name=(a+"").split(/\\|\//g).pop(),null==b.type&&(b.type=b.name.split(".").pop()),X(c,function(a,c){a=new RegExp(a.replace(/\s/g,"|"),"i"),(a.test(b.type)||ca.ext2mime[b.type])&&(b.type=ca.ext2mime[b.type]||c.split("/")[0]+"/"+b.type)}),b},getDropFiles:function(a,b){var c,d=[],e=[],j=l(a),k=j.files,m=j.items,n=W(m)&&m[0]&&h(m[0]),o=ca.queue(function(){b(d,e)});if(n)if(G&&k){var p,q,r=k.length;for(c=new Array(r);r--;){p=k[r];try{q=h(m[r])}catch(s){ca.log("[err] getDropFiles: ",s),q=null}g(q)&&(q.isDirectory||q.isFile&&p.name==p.name.normalize("NFC"))?c[r]=q:c[r]=p}}else c=m;else c=k;X(c||[],function(a){o.inc();try{n&&g(a)?i(a,function(a,b,c){a?ca.log("[err] getDropFiles:",a):d.push.apply(d,b),e.push.apply(e,c),o.next()}):f(a,function(b,c){b?d.push(a):a.error=c,e.push(a),o.next()})}catch(b){o.next(),ca.log("[err] getDropFiles: ",b)}}),o.check()},getFiles:function(a,b,c){var d=[];return c?(ca.filterFiles(ca.getFiles(a),b,c),null):(a.jquery&&(a.each(function(){d=d.concat(ca.getFiles(this))}),a=d,d=[]),"string"==typeof b&&(b=ca.getFilesFilter(b)),a.originalEvent?a=aa(a.originalEvent):a.srcElement&&(a=aa(a)),a.dataTransfer?a=a.dataTransfer:a.target&&(a=a.target),a.files?(d=a.files,D||(d[0].blob=a,d[0].iframe=!0)):!D&&k(a)?ca.trim(a.value)&&(d=[ca.checkFileObj(a.value)],d[0].blob=a,d[0].iframe=!0):W(a)&&(d=a),ca.filter(d,function(a){return!b||b.test(a.name)}))},getTotalSize:function(a){for(var b=0,c=a&&a.length;c--;)b+=a[c].size;return b},getInfo:function(a,b){var c={},d=R.concat();ca.isBlob(a)?!function e(){var f=d.shift();f?f.test(a.type)?f(a,function(a,d){a?b(a):(Y(c,d),e())}):e():b(!1,c)}():b("not_support_info",c)},addInfoReader:function(a,b){b.test=function(b){return a.test(b)},R.push(b)},filter:function(a,b){for(var c,d=[],e=0,f=a.length;f>e;e++)e in a&&(c=a[e],b.call(c,c,e,a)&&d.push(c));return d},filterFiles:function(a,b,c){if(a.length){var d,e=a.concat(),f=[],g=[];!function h(){e.length?(d=e.shift(),ca.getInfo(d,function(a,c){(b(d,a?!1:c)?f:g).push(d),h()})):c(f,g)}()}else c([],a)},upload:function(a){a=Y({jsonp:"callback",prepare:ca.F,beforeupload:ca.F,upload:ca.F,fileupload:ca.F,fileprogress:ca.F,filecomplete:ca.F,progress:ca.F,complete:ca.F,pause:ca.F,imageOriginal:!0,chunkSize:ca.chunkSize,chunkUploadRetry:ca.chunkUploadRetry,uploadRetry:ca.uploadRetry},a),a.imageAutoOrientation&&!a.imageTransform&&(a.imageTransform={rotate:"auto"});var b,c=new ca.XHR(a),d=this._getFilesDataArray(a.files),e=this,f=0,g=0,h=!1;return X(d,function(a){f+=a.size}),c.files=[],X(d,function(a){c.files.push(a.file)}),c.total=f,c.loaded=0,c.filesLeft=d.length,a.beforeupload(c,a),b=function(){var i=d.shift(),k=i&&i.file,l=!1,m=j(a);if(c.filesLeft=d.length,k&&k.name===ca.expando&&(k=null,ca.log("[warn] FileAPI.upload() — called without files")),("abort"!=c.statusText||c.current)&&i){if(h=!1,c.currentFile=k,k&&a.prepare(k,m)===!1)return void b.call(e);m.file=k,e._getFormData(m,i,function(h){g||a.upload(c,a);var j=new ca.XHR(Y({},m,{upload:k?function(){a.fileupload(k,j,m)}:q,progress:k?function(b){l||(l=b.loaded===b.total,a.fileprogress({type:"progress",total:i.total=b.total,loaded:i.loaded=b.loaded},k,j,m),a.progress({type:"progress",total:f,loaded:c.loaded=g+i.size*(b.loaded/b.total)||0},k,j,m))}:q,complete:function(d){X(T,function(a){c[a]=j[a]}),k&&(i.total=i.total||i.size,i.loaded=i.total,d||(this.progress(i),l=!0,g+=i.size,c.loaded=g),a.filecomplete(d,j,k,m)),setTimeout(function(){b.call(e)},0)}}));c.abort=function(a){a||(d.length=0),this.current=a,j.abort()},j.send(h)})}else{var n=200==c.status||201==c.status||204==c.status;a.complete(n?!1:c.statusText||"error",c,a),h=!0}},setTimeout(b,0),c.append=function(a,g){a=ca._getFilesDataArray([].concat(a)),X(a,function(a){f+=a.size,c.files.push(a.file),g?d.unshift(a):d.push(a)}),c.statusText="",h&&b.call(e)},c.remove=function(a){for(var b,c=d.length;c--;)d[c].file==a&&(b=d.splice(c,1),f-=b.size);return b},c},_getFilesDataArray:function(a){var b=[],c={};if(k(a)){var d=ca.getFiles(a);c[a.name||"file"]=null!==a.getAttribute("multiple")?d:d[0]}else W(a)&&k(a[0])?X(a,function(a){c[a.name||"file"]=ca.getFiles(a)}):c=a;return X(c,function e(a,c){W(a)?X(a,function(a){e(a,c)}):a&&(a.name||a.image)&&b.push({name:c,file:a,size:a.size,total:a.size,loaded:0})}),b.length||b.push({file:{name:ca.expando}}),b},_getFormData:function(a,b,c){var d=b.file,e=b.name,f=d.name,g=d.type,h=ca.support.transform&&a.imageTransform,i=new ca.Form,j=ca.queue(function(){c(i)}),k=h&&m(h),l=ca.postNameConcat;X(a.data,function n(a,b){"object"==typeof a?X(a,function(a,c){n(a,l(b,c))}):i.append(b,a)}),function o(b){b.image?(j.inc(),b.toData(function(a,c){b.file&&(c.type=b.file.type,c.quality=b.matrix.quality,f=b.file&&b.file.name),f=f||(new Date).getTime()+".png",o(c),j.next()})):ca.Image&&h&&(/^image/.test(b.type)||K.test(b.nodeName))?(j.inc(),k&&(h=[h]),ca.Image.transform(b,h,a.imageAutoOrientation,function(c,d){if(k&&!c)H||ca.flashEngine||(i.multipart=!0),i.append(e,d[0],f,h[0].type||g);else{var m=0;c||X(d,function(a,b){H||ca.flashEngine||(i.multipart=!0),h[b].postName||(m=1),i.append(h[b].postName||l(e,b),a,f,h[b].type||g)}),(c||a.imageOriginal)&&i.append(l(e,m?"original":null),b,f,g)}j.next()})):f!==ca.expando&&i.append(e,b,f)}(d),j.check()},reset:function(a,b){var c,d;return C?(d=C(a).clone(!0).insertBefore(a).val("")[0],b||C(a).remove()):(c=a.parentNode,d=c.insertBefore(a.cloneNode(!0),a),d.value="",b||c.removeChild(a),X(Q[ca.uid(a)],function(b,c){X(b,function(b){$(a,c,b),Z(d,c,b)})})),d},load:function(a,b){var c=ca.getXHR();return c?(c.open("GET",a,!0),c.overrideMimeType&&c.overrideMimeType("text/plain; charset=x-user-defined"),Z(c,"progress",function(a){a.lengthComputable&&b({type:a.type,loaded:a.loaded,total:a.total},c)}),c.onreadystatechange=function(){if(4==c.readyState)if(c.onreadystatechange=null,200==c.status){a=a.split("/");var d={name:a[a.length-1],size:c.getResponseHeader("Content-Length"),type:c.getResponseHeader("Content-Type")};d.dataURL="data:"+d.type+";base64,"+ca.encode64(c.responseBody||c.responseText),b({type:"load",result:d},c)}else b({type:"error"},c)},c.send(null)):b({type:"error"}),c},encode64:function(a){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",d=0;for("string"!=typeof a&&(a=String(a));d>2,k=(3&g)<<4|h>>4;isNaN(h)?e=f=64:(e=(15&h)<<2|i>>6,f=isNaN(i)?64:63&i),c+=b.charAt(j)+b.charAt(k)+b.charAt(e)+b.charAt(f)}return c}};ca.addInfoReader(/^image/,function(a,b){if(!a.__dimensions){var c=a.__dimensions=ca.defer();ca.readAsImage(a,function(a){var b=a.target;c.resolve("load"==a.type?!1:"error",{width:b.width,height:b.height}),b.src=ca.EMPTY_PNG,b=null})}a.__dimensions.then(b)}),ca.event.dnd=function(a,b,c){var d,e;c||(c=b,b=ca.F),z?(Z(a,"dragenter dragleave dragover",b.ff=b.ff||function(a){for(var c=l(a).types,f=c&&c.length,g=!1;f--;)if(~c[f].indexOf("File")){a[V](),e!==a.type&&(e=a.type,"dragleave"!=e&&b.call(a[U],!0,a),g=!0);break}g&&(clearTimeout(d),d=setTimeout(function(){b.call(a[U],"dragleave"!=e,a)},50))}),Z(a,"drop",c.ff=c.ff||function(a){a[V](),e=0,b.call(a[U],!1,a),ca.getDropFiles(a,function(b,d){c.call(a[U],b,d,a)})})):ca.log("Drag'n'Drop -- not supported")},ca.event.dnd.off=function(a,b,c){$(a,"dragenter dragleave dragover",b.ff),$(a,"drop",c.ff)},C&&!C.fn.dnd&&(C.fn.dnd=function(a,b){return this.each(function(){ca.event.dnd(this,a,b)})},C.fn.offdnd=function(a,b){return this.each(function(){ca.event.dnd.off(this,a,b)})}),a.FileAPI=Y(ca,a.FileAPI),ca.log("FileAPI: "+ca.version),ca.log("protocol: "+a.location.protocol),ca.log("doctype: ["+s.name+"] "+s.publicId+" "+s.systemId),X(r.getElementsByTagName("meta"),function(a){/x-ua-compatible/i.test(a.getAttribute("http-equiv"))&&ca.log("meta.http-equiv: "+a.getAttribute("content"))});try{n=!!console.log,o=!!console.log.apply}catch(da){}ca.flashUrl||(ca.flashUrl=ca.staticPath+"FileAPI.flash.swf"),ca.flashImageUrl||(ca.flashImageUrl=ca.staticPath+"FileAPI.flash.image.swf"),ca.flashWebcamUrl||(ca.flashWebcamUrl=ca.staticPath+"FileAPI.flash.camera.swf")}(window,void 0),function(a,b,c){"use strict";function d(b){if(b instanceof d){var c=new d(b.file);return a.extend(c.matrix,b.matrix),c}return this instanceof d?(this.file=b,this.size=b.size||100,void(this.matrix={sx:0,sy:0,sw:0,sh:0,dx:0,dy:0,dw:0,dh:0,resize:0,deg:0,quality:1,filter:0})):new d(b)}var e=Math.min,f=Math.round,g=function(){return b.createElement("canvas")},h=!1,i={8:270,3:180,6:90,7:270,4:180,5:90};try{h=g().toDataURL("image/png").indexOf("data:image/png")>-1}catch(j){}d.prototype={image:!0,constructor:d,set:function(b){return a.extend(this.matrix,b),this},crop:function(a,b,d,e){return d===c&&(d=a,e=b,a=b=0),this.set({sx:a,sy:b,sw:d,sh:e||d})},resize:function(a,b,c){return/min|max|height|width/.test(b)&&(c=b,b=a),this.set({dw:a,dh:b||a,resize:c})},preview:function(a,b){return this.resize(a,b||a,"preview")},rotate:function(a){return this.set({deg:a})},filter:function(a){return this.set({filter:a})},overlay:function(a){return this.set({overlay:a})},clone:function(){return new d(this)},_load:function(b,c){var d=this;/img|video/i.test(b.nodeName)?c.call(d,null,b):a.readAsImage(b,function(a){c.call(d,"load"!=a.type,a.result)})},_apply:function(b,c){var f,h=g(),i=this.getMatrix(b),j=h.getContext("2d"),k=b.videoWidth||b.width,l=b.videoHeight||b.height,m=i.deg,n=i.dw,o=i.dh,p=k,q=l,r=i.filter,s=b,t=i.overlay,u=a.queue(function(){b.src=a.EMPTY_PNG,c(!1,h)}),v=a.renderImageToCanvas;for(m-=360*Math.floor(m/360),b._type=this.file.type;i.multipass&&e(p/n,q/o)>2;)p=p/2+.5|0,q=q/2+.5|0,f=g(),f.width=p,f.height=q,s!==b?(v(f,s,0,0,s.width,s.height,0,0,p,q),s=f):(s=f,v(s,b,i.sx,i.sy,i.sw,i.sh,0,0,p,q),i.sx=i.sy=i.sw=i.sh=0);h.width=m%180?o:n,h.height=m%180?n:o,h.type=i.type,h.quality=i.quality,j.rotate(m*Math.PI/180),v(j.canvas,s,i.sx,i.sy,i.sw||s.width,i.sh||s.height,180==m||270==m?-n:0,90==m||180==m?-o:0,n,o),n=h.width,o=h.height,t&&a.each([].concat(t),function(b){u.inc();var c=new window.Image,d=function(){var e=0|b.x,f=0|b.y,g=b.w||c.width,h=b.h||c.height,i=b.rel;e=1==i||4==i||7==i?(n-g+e)/2:2==i||5==i||8==i?n-(g+e):e,f=3==i||4==i||5==i?(o-h+f)/2:i>=6?o-(h+f):f,a.event.off(c,"error load abort",d);try{j.globalAlpha=b.opacity||1,j.drawImage(c,e,f,g,h)}catch(k){}u.next()};a.event.on(c,"error load abort",d),c.src=b.src,c.complete&&d()}),r&&(u.inc(),d.applyFilter(h,r,u.next)),u.check()},getMatrix:function(b){var c=a.extend({},this.matrix),d=c.sw=c.sw||b.videoWidth||b.naturalWidth||b.width,g=c.sh=c.sh||b.videoHeight||b.naturalHeight||b.height,h=c.dw=c.dw||d,i=c.dh=c.dh||g,j=d/g,k=h/i,l=c.resize;if("preview"==l){if(h!=d||i!=g){var m,n;k>=j?(m=d,n=m/k):(n=g,m=n*k),(m!=d||n!=g)&&(c.sx=~~((d-m)/2),c.sy=~~((g-n)/2),d=m,g=n)}}else"height"==l?h=i*j:"width"==l?i=h/j:l&&(d>h||g>i?"min"==l?(h=f(k>j?e(d,h):i*j),i=f(k>j?h/j:e(g,i))):(h=f(j>=k?e(d,h):i*j),i=f(j>=k?h/j:e(g,i))):(h=d,i=g));return c.sw=d,c.sh=g,c.dw=h,c.dh=i,c.multipass=a.multiPassResize,c},_trans:function(b){this._load(this.file,function(c,d){if(c)b(c);else try{this._apply(d,b)}catch(c){a.log("[err] FileAPI.Image.fn._apply:",c),b(c)}})},get:function(b){if(a.support.transform){var c=this,d=c.matrix;"auto"==d.deg?a.getInfo(c.file,function(a,e){d.deg=i[e&&e.exif&&e.exif.Orientation]||0,c._trans(b)}):c._trans(b)}else b("not_support_transform");return this},toData:function(a){return this.get(a)}},d.exifOrientation=i,d.transform=function(b,e,f,g){function h(h,i){var j={},k=a.queue(function(a){g(a,j)});h?k.fail():a.each(e,function(a,e){if(!k.isFail()){var g=new d(i.nodeType?i:b),h="function"==typeof a;if(h?a(i,g):a.width?g[a.preview?"preview":"resize"](a.width,a.height,a.strategy):a.maxWidth&&(i.width>a.maxWidth||i.height>a.maxHeight)&&g.resize(a.maxWidth,a.maxHeight,"max"),a.crop){var l=a.crop;g.crop(0|l.x,0|l.y,l.w||l.width,l.h||l.height)}a.rotate===c&&f&&(a.rotate="auto"),g.set({type:g.matrix.type||a.type||b.type||"image/png"}),h||g.set({deg:a.rotate,overlay:a.overlay,filter:a.filter,quality:a.quality||1}),k.inc(),g.toData(function(a,b){a?k.fail():(j[e]=b,k.next())})}})}b.width?h(!1,b):a.getInfo(b,h)},a.each(["TOP","CENTER","BOTTOM"],function(b,c){a.each(["LEFT","CENTER","RIGHT"],function(a,e){d[b+"_"+a]=3*c+e,d[a+"_"+b]=3*c+e})}),d.toCanvas=function(a){var c=b.createElement("canvas");return c.width=a.videoWidth||a.width,c.height=a.videoHeight||a.height,c.getContext("2d").drawImage(a,0,0),c},d.fromDataURL=function(b,c,d){var e=a.newImage(b);a.extend(e,c),d(e)},d.applyFilter=function(b,c,e){"function"==typeof c?c(b,e):window.Caman&&window.Caman("IMG"==b.tagName?d.toCanvas(b):b,function(){"string"==typeof c?this[c]():a.each(c,function(a,b){this[b](a)},this),this.render(e)})},a.renderImageToCanvas=function(b,c,d,e,f,g,h,i,j,k){try{return b.getContext("2d").drawImage(c,d,e,f,g,h,i,j,k)}catch(l){throw a.log("renderImageToCanvas failed"),l}},a.support.canvas=a.support.transform=h,a.Image=d}(FileAPI,document),function(a){"use strict";a(FileAPI)}(function(a){"use strict";if(window.navigator&&window.navigator.platform&&/iP(hone|od|ad)/.test(window.navigator.platform)){var b=a.renderImageToCanvas;a.detectSubsampling=function(a){var b,c;return a.width*a.height>1048576?(b=document.createElement("canvas"),b.width=b.height=1,c=b.getContext("2d"),c.drawImage(a,-a.width+1,0),0===c.getImageData(0,0,1,1).data[3]):!1},a.detectVerticalSquash=function(a,b){var c,d,e,f,g,h=a.naturalHeight||a.height,i=document.createElement("canvas"),j=i.getContext("2d");for(b&&(h/=2),i.width=1,i.height=h,j.drawImage(a,0,0),c=j.getImageData(0,0,1,h).data,d=0,e=h,f=h;f>d;)g=c[4*(f-1)+3],0===g?e=f:d=f,f=e+d>>1;return f/h||1},a.renderImageToCanvas=function(c,d,e,f,g,h,i,j,k,l){if("image/jpeg"===d._type){var m,n,o,p,q=c.getContext("2d"),r=document.createElement("canvas"),s=1024,t=r.getContext("2d");if(r.width=s,r.height=s,q.save(),m=a.detectSubsampling(d),m&&(e/=2,f/=2,g/=2,h/=2),n=a.detectVerticalSquash(d,m),m||1!==n){for(f*=n,k=Math.ceil(s*k/g),l=Math.ceil(s*l/h/n),j=0,p=0;h>p;){for(i=0,o=0;g>o;)t.clearRect(0,0,s,s),t.drawImage(d,e,f,g,h,-o,-p,g,h),q.drawImage(r,0,0,s,s,i,j,k,l),o+=s,i+=k;p+=s,j+=l}return q.restore(),c}}return b(c,d,e,f,g,h,i,j,k,l)}}}),function(a,b){"use strict";function c(b,c,d){var e=b.blob,f=b.file;if(f){if(!e.toDataURL)return void a.readAsBinaryString(e,function(a){"load"==a.type&&c(b,a.result)});var g={"image/jpeg":".jpe?g","image/png":".png"},h=g[b.type]?b.type:"image/png",i=g[h]||".png",j=e.quality||1;f.match(new RegExp(i+"$","i"))||(f+=i.replace("?","")),b.file=f,b.type=h,!d&&e.toBlob?e.toBlob(function(a){c(b,a)},h,j):c(b,a.toBinaryString(e.toDataURL(h,j)))}else c(b,e)}var d=b.document,e=b.FormData,f=function(){this.items=[]},g=b.encodeURIComponent;f.prototype={append:function(a,b,c,d){this.items.push({name:a,blob:b&&b.blob||(void 0==b?"":b),file:b&&(c||b.name),type:b&&(d||b.type)})},each:function(a){for(var b=0,c=this.items.length;c>b;b++)a.call(this,this.items[b])},toData:function(b,c){c._chunked=a.support.chunked&&c.chunkSize>0&&1==a.filter(this.items,function(a){return a.file}).length,a.support.html5?a.formData&&!this.multipart&&e?c._chunked?(a.log("FileAPI.Form.toPlainData"),this.toPlainData(b)):(a.log("FileAPI.Form.toFormData"),this.toFormData(b)):(a.log("FileAPI.Form.toMultipartData"),this.toMultipartData(b)):(a.log("FileAPI.Form.toHtmlData"),this.toHtmlData(b))},_to:function(b,c,d,e){var f=a.queue(function(){c(b)});this.each(function(g){try{d(g,b,f,e)}catch(h){a.log("FileAPI.Form._to: "+h.message),c(h)}}),f.check()},toHtmlData:function(b){this._to(d.createDocumentFragment(),b,function(b,c){var e,f=b.blob;b.file?(a.reset(f,!0),f.name=b.name,f.disabled=!1,c.appendChild(f)):(e=d.createElement("input"),e.name=b.name,e.type="hidden",e.value=f,c.appendChild(e))})},toPlainData:function(a){this._to({},a,function(a,b,d){a.file&&(b.type=a.file),a.blob.toBlob?(d.inc(),c(a,function(a,c){b.name=a.name,b.file=c,b.size=c.length,b.type=a.type,d.next()})):a.file?(b.name=a.blob.name,b.file=a.blob,b.size=a.blob.size,b.type=a.type):(b.params||(b.params=[]),b.params.push(g(a.name)+"="+g(a.blob))),b.start=-1,b.end=b.file&&b.file.FileAPIReadPosition||-1,b.retry=0})},toFormData:function(a){this._to(new e,a,function(a,b,d){a.blob&&a.blob.toBlob?(d.inc(),c(a,function(a,c){b.append(a.name,c,a.file),d.next()})):a.file?b.append(a.name,a.blob,a.file):b.append(a.name,a.blob),a.file&&b.append("_"+a.name,a.file)})},toMultipartData:function(b){this._to([],b,function(a,b,d,e){d.inc(),c(a,function(a,c){b.push("--_"+e+('\r\nContent-Disposition: form-data; name="'+a.name+'"'+(a.file?'; filename="'+g(a.file)+'"':"")+(a.file?"\r\nContent-Type: "+(a.type||"application/octet-stream"):"")+"\r\n\r\n"+(a.file?c:g(c))+"\r\n")),d.next()},!0)},a.expando)}},a.Form=f}(FileAPI,window),function(a,b){"use strict";var c=function(){},d=a.document,e=function(a){this.uid=b.uid(),this.xhr={abort:c,getResponseHeader:c,getAllResponseHeaders:c},this.options=a},f={"":1,XML:1,Text:1,Body:1};e.prototype={status:0,statusText:"",constructor:e,getResponseHeader:function(a){return this.xhr.getResponseHeader(a)},getAllResponseHeaders:function(){return this.xhr.getAllResponseHeaders()||{}},end:function(d,e){var f=this,g=f.options;f.end=f.abort=c,f.status=d,e&&(f.statusText=e),b.log("xhr.end:",d,e),g.complete(200==d||201==d?!1:f.statusText||"unknown",f),f.xhr&&f.xhr.node&&setTimeout(function(){var b=f.xhr.node;try{b.parentNode.removeChild(b)}catch(c){}try{delete a[f.uid]}catch(c){}a[f.uid]=f.xhr.node=null},9)},abort:function(){this.end(0,"abort"),this.xhr&&(this.xhr.aborted=!0,this.xhr.abort())},send:function(a){var b=this,c=this.options;a.toData(function(a){a instanceof Error?b.end(0,a.message):(c.upload(c,b),b._send.call(b,c,a))},c)},_send:function(c,e){var g,h=this,i=h.uid,j=h.uid+"Load",k=c.url;if(b.log("XHR._send:",e),c.cache||(k+=(~k.indexOf("?")?"&":"?")+b.uid()),e.nodeName){var l=c.jsonp;k=k.replace(/([a-z]+)=(\?)/i,"$1="+i),c.upload(c,h);var m=function(a){if(~k.indexOf(a.origin))try{var c=b.parseJSON(a.data);c.id==i&&n(c.status,c.statusText,c.response)}catch(d){n(0,d.message)}},n=a[i]=function(c,d,e){h.readyState=4,h.responseText=e,h.end(c,d),b.event.off(a,"message",m),a[i]=g=p=a[j]=null};h.xhr.abort=function(){try{p.stop?p.stop():p.contentWindow.stop?p.contentWindow.stop():p.contentWindow.document.execCommand("Stop")}catch(a){}n(0,"abort")},b.event.on(a,"message",m),a[j]=function(){try{var a=p.contentWindow,c=a.document,d=a.result||b.parseJSON(c.body.innerHTML);n(d.status,d.statusText,d.response)}catch(e){b.log("[transport.onload]",e)}},g=d.createElement("div"),g.innerHTML='
    '+(l&&c.url.indexOf("=?")<0?'':"")+"";var o=g.getElementsByTagName("form")[0],p=g.getElementsByTagName("iframe")[0];o.appendChild(e),b.log(o.parentNode.innerHTML),d.body.appendChild(g),h.xhr.node=g,h.readyState=2;try{o.submit()}catch(q){b.log("iframe.error: "+q)}o=null}else{if(k=k.replace(/([a-z]+)=(\?)&?/i,""),this.xhr&&this.xhr.aborted)return void b.log("Error: already aborted");if(g=h.xhr=b.getXHR(),e.params&&(k+=(k.indexOf("?")<0?"?":"&")+e.params.join("&")),g.open("POST",k,!0),b.withCredentials&&(g.withCredentials="true"),c.headers&&c.headers["X-Requested-With"]||g.setRequestHeader("X-Requested-With","XMLHttpRequest"),b.each(c.headers,function(a,b){g.setRequestHeader(b,a)}),c._chunked){g.upload&&g.upload.addEventListener("progress",b.throttle(function(a){e.retry||c.progress({type:a.type,total:e.size,loaded:e.start+a.loaded,totalSize:e.size},h,c)},100),!1),g.onreadystatechange=function(){var a=parseInt(g.getResponseHeader("X-Last-Known-Byte"),10);if(h.status=g.status,h.statusText=g.statusText,h.readyState=g.readyState,4==g.readyState){for(var d in f)h["response"+d]=g["response"+d];if(g.onreadystatechange=null,!g.status||g.status-201>0)if(b.log("Error: "+g.status),(!g.status&&!g.aborted||500==g.status||416==g.status)&&++e.retry<=c.chunkUploadRetry){var i=g.status?0:b.chunkNetworkDownRetryTimeout;c.pause(e.file,c),b.log("X-Last-Known-Byte: "+a),a?e.end=a:(e.end=e.start-1,416==g.status&&(e.end=e.end-c.chunkSize)),setTimeout(function(){h._send(c,e)},i)}else h.end(g.status);else e.retry=0,e.end==e.size-1?h.end(g.status):(b.log("X-Last-Known-Byte: "+a),a&&(e.end=a),e.file.FileAPIReadPosition=e.end,setTimeout(function(){h._send(c,e)},0));g=null}},e.start=e.end+1,e.end=Math.max(Math.min(e.start+c.chunkSize,e.size)-1,e.start);var r=e.file,s=(r.slice||r.mozSlice||r.webkitSlice).call(r,e.start,e.end+1);e.size&&!s.size?setTimeout(function(){h.end(-1)}):(g.setRequestHeader("Content-Range","bytes "+e.start+"-"+e.end+"/"+e.size),g.setRequestHeader("Content-Disposition","attachment; filename="+encodeURIComponent(e.name)),g.setRequestHeader("Content-Type",e.type||"application/octet-stream"),g.send(s)),r=s=null}else if(g.upload&&g.upload.addEventListener("progress",b.throttle(function(a){c.progress(a,h,c)},100),!1),g.onreadystatechange=function(){if(h.status=g.status,h.statusText=g.statusText,h.readyState=g.readyState,4==g.readyState){for(var a in f)h["response"+a]=g["response"+a];if(g.onreadystatechange=null,!g.status||g.status>201)if(b.log("Error: "+g.status),(!g.status&&!g.aborted||500==g.status)&&(c.retry||0)=0?a+"px":a}function d(a){var c,d=f.createElement("canvas"),e=!1;try{c=d.getContext("2d"),c.drawImage(a,0,0,1,1),e=255!=c.getImageData(0,0,1,1).data[4]}catch(g){b.log("[FileAPI.Camera] detectVideoSignal:",g)}return e}var e=a.URL||a.webkitURL,f=a.document,g=a.navigator,h=g.getUserMedia||g.webkitGetUserMedia||g.mozGetUserMedia||g.msGetUserMedia,i=!!h;b.support.media=i;var j=function(a){this.video=a};j.prototype={isActive:function(){return!!this._active},start:function(a){var b,c,f=this,i=f.video,j=function(d){f._active=!d,clearTimeout(c),clearTimeout(b),a&&a(d,f)};h.call(g,{video:!0},function(a){f.stream=a,i.src=e.createObjectURL(a),b=setInterval(function(){d(i)&&j(null)},1e3),c=setTimeout(function(){j("timeout"); },5e3),i.play()},j)},stop:function(){try{this._active=!1,this.video.pause();try{this.stream.stop()}catch(a){b.each(this.stream.getTracks(),function(a){a.stop()})}this.stream=null}catch(a){b.log("[FileAPI.Camera] stop:",a)}},shot:function(){return new k(this.video)}},j.get=function(a){return new j(a.firstChild)},j.publish=function(d,e,g){"function"==typeof e&&(g=e,e={}),e=b.extend({},{width:"100%",height:"100%",start:!0},e),d.jquery&&(d=d[0]);var h=function(a){if(a)g(a);else{var b=j.get(d);e.start?b.start(g):g(null,b)}};if(d.style.width=c(e.width),d.style.height=c(e.height),b.html5&&i){var k=f.createElement("video");k.style.width=c(e.width),k.style.height=c(e.height),a.jQuery?jQuery(d).empty():d.innerHTML="",d.appendChild(k),h()}else j.fallback(d,e,h)},j.fallback=function(a,b,c){c("not_support_camera")};var k=function(a){var c=a.nodeName?b.Image.toCanvas(a):a,d=b.Image(c);return d.type="image/png",d.width=c.width,d.height=c.height,d.size=c.width*c.height*4,d};j.Shot=k,b.Camera=j}(window,FileAPI),function(a,b,c){"use strict";var d=c.each,e=[];!c.support.flash||!c.media||c.support.media&&c.html5||!function(){function a(a){var b=a.wid=c.uid();return c.Flash._fn[b]=a,"FileAPI.Flash._fn."+b}function b(a){try{c.Flash._fn[a.wid]=null,delete c.Flash._fn[a.wid]}catch(b){}}var f=c.Flash;c.extend(c.Flash,{patchCamera:function(){c.Camera.fallback=function(d,e,g){var h=c.uid();c.log("FlashAPI.Camera.publish: "+h),f.publish(d,h,c.extend(e,{camera:!0,onEvent:a(function i(a){"camera"===a.type&&(b(i),a.error?(c.log("FlashAPI.Camera.publish.error: "+a.error),g(a.error)):(c.log("FlashAPI.Camera.publish.success: "+h),g(null)))})}))},d(e,function(a){c.Camera.fallback.apply(c.Camera,a)}),e=[],c.extend(c.Camera.prototype,{_id:function(){return this.video.id},start:function(d){var e=this;f.cmd(this._id(),"camera.on",{callback:a(function g(a){b(g),a.error?(c.log("FlashAPI.camera.on.error: "+a.error),d(a.error,e)):(c.log("FlashAPI.camera.on.success: "+e._id()),e._active=!0,d(null,e))})})},stop:function(){this._active=!1,f.cmd(this._id(),"camera.off")},shot:function(){c.log("FlashAPI.Camera.shot:",this._id());var a=c.Flash.cmd(this._id(),"shot",{});return a.type="image/png",a.flashId=this._id(),a.isShot=!0,new c.Camera.Shot(a)}})}}),c.Camera.fallback=function(){e.push(arguments)}}()}(window,window.jQuery,FileAPI),"function"==typeof define&&define.amd&&define("FileAPI",[],function(){return FileAPI}); \ No newline at end of file diff --git a/manager/media/browser/mcpuk/js/FileAPI/FileAPI.js b/manager/media/browser/mcpuk/js/FileAPI/FileAPI.js index 8e5b3c76ba..6b2e14b72d 100644 --- a/manager/media/browser/mcpuk/js/FileAPI/FileAPI.js +++ b/manager/media/browser/mcpuk/js/FileAPI/FileAPI.js @@ -1,4361 +1,4361 @@ -/*! FileAPI 2.0.19 - BSD | git://github.com/mailru/FileAPI.git - * FileAPI — a set of javascript tools for working with files. Multiupload, drag'n'drop and chunked file upload. Images: crop, resize and auto orientation by EXIF. - */ - -/* - * JavaScript Canvas to Blob 2.0.5 - * https://github.com/blueimp/JavaScript-Canvas-to-Blob - * - * Copyright 2012, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/MIT - * - * Based on stackoverflow user Stoive's code snippet: - * http://stackoverflow.com/q/4998908 - */ - -/*jslint nomen: true, regexp: true */ -/*global window, atob, Blob, ArrayBuffer, Uint8Array */ - -(function (window) { - 'use strict'; - var CanvasPrototype = window.HTMLCanvasElement && - window.HTMLCanvasElement.prototype, - hasBlobConstructor = window.Blob && (function () { - try { - return Boolean(new Blob()); - } catch (e) { - return false; - } - }()), - hasArrayBufferViewSupport = hasBlobConstructor && window.Uint8Array && - (function () { - try { - return new Blob([new Uint8Array(100)]).size === 100; - } catch (e) { - return false; - } - }()), - BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || - window.MozBlobBuilder || window.MSBlobBuilder, - dataURLtoBlob = (hasBlobConstructor || BlobBuilder) && window.atob && - window.ArrayBuffer && window.Uint8Array && function (dataURI) { - var byteString, - arrayBuffer, - intArray, - i, - mimeString, - bb; - if (dataURI.split(',')[0].indexOf('base64') >= 0) { - // Convert base64 to raw binary data held in a string: - byteString = atob(dataURI.split(',')[1]); - } else { - // Convert base64/URLEncoded data component to raw binary data: - byteString = decodeURIComponent(dataURI.split(',')[1]); - } - // Write the bytes of the string to an ArrayBuffer: - arrayBuffer = new ArrayBuffer(byteString.length); - intArray = new Uint8Array(arrayBuffer); - for (i = 0; i < byteString.length; i += 1) { - intArray[i] = byteString.charCodeAt(i); - } - // Separate out the mime component: - mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; - // Write the ArrayBuffer (or ArrayBufferView) to a blob: - if (hasBlobConstructor) { - return new Blob( - [hasArrayBufferViewSupport ? intArray : arrayBuffer], - {type: mimeString} - ); - } - bb = new BlobBuilder(); - bb.append(arrayBuffer); - return bb.getBlob(mimeString); - }; - if (window.HTMLCanvasElement && !CanvasPrototype.toBlob) { - if (CanvasPrototype.mozGetAsFile) { - CanvasPrototype.toBlob = function (callback, type, quality) { - if (quality && CanvasPrototype.toDataURL && dataURLtoBlob) { - callback(dataURLtoBlob(this.toDataURL(type, quality))); - } else { - callback(this.mozGetAsFile('blob', type)); - } - }; - } else if (CanvasPrototype.toDataURL && dataURLtoBlob) { - CanvasPrototype.toBlob = function (callback, type, quality) { - callback(dataURLtoBlob(this.toDataURL(type, quality))); - }; - } - } - window.dataURLtoBlob = dataURLtoBlob; -})(window); - -/*jslint evil: true */ -/*global window, URL, webkitURL, ActiveXObject */ - -(function (window, undef){ - 'use strict'; - - var - gid = 1, - noop = function (){}, - - document = window.document, - doctype = document.doctype || {}, - userAgent = window.navigator.userAgent, - safari = /safari\//i.test(userAgent) && !/chrome\//i.test(userAgent), - iemobile = /iemobile\//i.test(userAgent), - - // https://github.com/blueimp/JavaScript-Load-Image/blob/master/load-image.js#L48 - apiURL = (window.createObjectURL && window) || (window.URL && URL.revokeObjectURL && URL) || (window.webkitURL && webkitURL), - - Blob = window.Blob, - File = window.File, - FileReader = window.FileReader, - FormData = window.FormData, - - - XMLHttpRequest = window.XMLHttpRequest, - jQuery = window.jQuery, - - html5 = !!(File && (FileReader && (window.Uint8Array || FormData || XMLHttpRequest.prototype.sendAsBinary))) - && !(safari && /windows/i.test(userAgent) && !iemobile), // BugFix: https://github.com/mailru/FileAPI/issues/25 - - cors = html5 && ('withCredentials' in (new XMLHttpRequest)), - - chunked = html5 && !!Blob && !!(Blob.prototype.webkitSlice || Blob.prototype.mozSlice || Blob.prototype.slice), - - normalize = ('' + ''.normalize).indexOf('[native code]') > 0, - - // https://github.com/blueimp/JavaScript-Canvas-to-Blob - dataURLtoBlob = window.dataURLtoBlob, - - - _rimg = /img/i, - _rcanvas = /canvas/i, - _rimgcanvas = /img|canvas/i, - _rinput = /input/i, - _rdata = /^data:[^,]+,/, - - _toString = {}.toString, - _supportConsoleLog, - _supportConsoleLogApply, - - - Math = window.Math, - - _SIZE_CONST = function (pow){ - pow = new window.Number(Math.pow(1024, pow)); - pow.from = function (sz){ return Math.round(sz * this); }; - return pow; - }, - - _elEvents = {}, // element event listeners - _infoReader = [], // list of file info processors - - _readerEvents = 'abort progress error load loadend', - _xhrPropsExport = 'status statusText readyState response responseXML responseText responseBody'.split(' '), - - currentTarget = 'currentTarget', // for minimize - preventDefault = 'preventDefault', // and this too - - _isArray = function (ar) { - return ar && ('length' in ar); - }, - - /** - * Iterate over a object or array - */ - _each = function (obj, fn, ctx){ - if( obj ){ - if( _isArray(obj) ){ - for( var i = 0, n = obj.length; i < n; i++ ){ - if( i in obj ){ - fn.call(ctx, obj[i], i, obj); - } - } - } - else { - for( var key in obj ){ - if( obj.hasOwnProperty(key) ){ - fn.call(ctx, obj[key], key, obj); - } - } - } - } - }, - - /** - * Merge the contents of two or more objects together into the first object - */ - _extend = function (dst){ - var args = arguments, i = 1, _ext = function (val, key){ dst[key] = val; }; - for( ; i < args.length; i++ ){ - _each(args[i], _ext); - } - return dst; - }, - - /** - * Add event listener - */ - _on = function (el, type, fn){ - if( el ){ - var uid = api.uid(el); - - if( !_elEvents[uid] ){ - _elEvents[uid] = {}; - } - - var isFileReader = (FileReader && el) && (el instanceof FileReader); - _each(type.split(/\s+/), function (type){ - if( jQuery && !isFileReader){ - jQuery.event.add(el, type, fn); - } else { - if( !_elEvents[uid][type] ){ - _elEvents[uid][type] = []; - } - - _elEvents[uid][type].push(fn); - - if( el.addEventListener ){ el.addEventListener(type, fn, false); } - else if( el.attachEvent ){ el.attachEvent('on'+type, fn); } - else { el['on'+type] = fn; } - } - }); - } - }, - - - /** - * Remove event listener - */ - _off = function (el, type, fn){ - if( el ){ - var uid = api.uid(el), events = _elEvents[uid] || {}; - - var isFileReader = (FileReader && el) && (el instanceof FileReader); - _each(type.split(/\s+/), function (type){ - if( jQuery && !isFileReader){ - jQuery.event.remove(el, type, fn); - } - else { - var fns = events[type] || [], i = fns.length; - - while( i-- ){ - if( fns[i] === fn ){ - fns.splice(i, 1); - break; - } - } - - if( el.addEventListener ){ el.removeEventListener(type, fn, false); } - else if( el.detachEvent ){ el.detachEvent('on'+type, fn); } - else { el['on'+type] = null; } - } - }); - } - }, - - - _one = function(el, type, fn){ - _on(el, type, function _(evt){ - _off(el, type, _); - fn(evt); - }); - }, - - - _fixEvent = function (evt){ - if( !evt.target ){ evt.target = window.event && window.event.srcElement || document; } - if( evt.target.nodeType === 3 ){ evt.target = evt.target.parentNode; } - return evt; - }, - - - _supportInputAttr = function (attr){ - var input = document.createElement('input'); - input.setAttribute('type', "file"); - return attr in input; - }, - - - /** - * FileAPI (core object) - */ - api = { - version: '2.0.19', - - cors: false, - html5: true, - media: false, - formData: true, - multiPassResize: true, - - debug: false, - pingUrl: false, - multiFlash: false, - flashAbortTimeout: 0, - withCredentials: true, - - staticPath: './dist/', - - flashUrl: 0, // @default: './FileAPI.flash.swf' - flashImageUrl: 0, // @default: './FileAPI.flash.image.swf' - - postNameConcat: function (name, idx){ - return name + (idx != null ? '['+ idx +']' : ''); - }, - - ext2mime: { - jpg: 'image/jpeg' - , tif: 'image/tiff' - , txt: 'text/plain' - }, - - // Fallback for flash - accept: { - 'image/*': 'art bm bmp dwg dxf cbr cbz fif fpx gif ico iefs jfif jpe jpeg jpg jps jut mcf nap nif pbm pcx pgm pict pm png pnm qif qtif ras rast rf rp svf tga tif tiff xbm xbm xpm xwd' - , 'audio/*': 'm4a flac aac rm mpa wav wma ogg mp3 mp2 m3u mod amf dmf dsm far gdm imf it m15 med okt s3m stm sfx ult uni xm sid ac3 dts cue aif aiff wpl ape mac mpc mpp shn wv nsf spc gym adplug adx dsp adp ymf ast afc hps xs' - , 'video/*': 'm4v 3gp nsv ts ty strm rm rmvb m3u ifo mov qt divx xvid bivx vob nrg img iso pva wmv asf asx ogm m2v avi bin dat dvr-ms mpg mpeg mp4 mkv avc vp3 svq3 nuv viv dv fli flv wpl' - }, - - uploadRetry : 0, - networkDownRetryTimeout : 5000, // milliseconds, don't flood when network is down - - chunkSize : 0, - chunkUploadRetry : 0, - chunkNetworkDownRetryTimeout : 2000, // milliseconds, don't flood when network is down - - KB: _SIZE_CONST(1), - MB: _SIZE_CONST(2), - GB: _SIZE_CONST(3), - TB: _SIZE_CONST(4), - - EMPTY_PNG: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=', - - expando: 'fileapi' + (new Date).getTime(), - - uid: function (obj){ - return obj - ? (obj[api.expando] = obj[api.expando] || api.uid()) - : (++gid, api.expando + gid) - ; - }, - - log: function (){ - if( api.debug && _supportConsoleLog ){ - if( _supportConsoleLogApply ){ - console.log.apply(console, arguments); - } - else { - console.log([].join.call(arguments, ' ')); - } - } - }, - - /** - * Create new image - * - * @param {String} [src] - * @param {Function} [fn] 1. error -- boolean, 2. img -- Image element - * @returns {HTMLElement} - */ - newImage: function (src, fn){ - var img = document.createElement('img'); - if( fn ){ - api.event.one(img, 'error load', function (evt){ - fn(evt.type == 'error', img); - img = null; - }); - } - img.src = src; - return img; - }, - - /** - * Get XHR - * @returns {XMLHttpRequest} - */ - getXHR: function (){ - var xhr; - - if( XMLHttpRequest ){ - xhr = new XMLHttpRequest; - } - else if( window.ActiveXObject ){ - try { - xhr = new ActiveXObject('MSXML2.XMLHttp.3.0'); - } catch (e) { - xhr = new ActiveXObject('Microsoft.XMLHTTP'); - } - } - - return xhr; - }, - - isArray: _isArray, - - support: { - dnd: cors && ('ondrop' in document.createElement('div')), - cors: cors, - html5: html5, - chunked: chunked, - dataURI: true, - accept: _supportInputAttr('accept'), - multiple: _supportInputAttr('multiple') - }, - - event: { - on: _on - , off: _off - , one: _one - , fix: _fixEvent - }, - - - throttle: function(fn, delay) { - var id, args; - - return function _throttle(){ - args = arguments; - - if( !id ){ - fn.apply(window, args); - id = setTimeout(function (){ - id = 0; - fn.apply(window, args); - }, delay); - } - }; - }, - - - F: function (){}, - - - parseJSON: function (str){ - var json; - if( window.JSON && JSON.parse ){ - json = JSON.parse(str); - } - else { - json = (new Function('return ('+str.replace(/([\r\n])/g, '\\$1')+');'))(); - } - return json; - }, - - - trim: function (str){ - str = String(str); - return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); - }, - - /** - * Simple Defer - * @return {Object} - */ - defer: function (){ - var - list = [] - , result - , error - , defer = { - resolve: function (err, res){ - defer.resolve = noop; - error = err || false; - result = res; - - while( res = list.shift() ){ - res(error, result); - } - }, - - then: function (fn){ - if( error !== undef ){ - fn(error, result); - } else { - list.push(fn); - } - } - }; - - return defer; - }, - - queue: function (fn){ - var - _idx = 0 - , _length = 0 - , _fail = false - , _end = false - , queue = { - inc: function (){ - _length++; - }, - - next: function (){ - _idx++; - setTimeout(queue.check, 0); - }, - - check: function (){ - (_idx >= _length) && !_fail && queue.end(); - }, - - isFail: function (){ - return _fail; - }, - - fail: function (){ - !_fail && fn(_fail = true); - }, - - end: function (){ - if( !_end ){ - _end = true; - fn(); - } - } - } - ; - return queue; - }, - - - /** - * For each object - * - * @param {Object|Array} obj - * @param {Function} fn - * @param {*} [ctx] - */ - each: _each, - - - /** - * Async for - * @param {Array} array - * @param {Function} callback - */ - afor: function (array, callback){ - var i = 0, n = array.length; - - if( _isArray(array) && n-- ){ - (function _next(){ - callback(n != i && _next, array[i], i++); - })(); - } - else { - callback(false); - } - }, - - - /** - * Merge the contents of two or more objects together into the first object - * - * @param {Object} dst - * @return {Object} - */ - extend: _extend, - - - /** - * Is file? - * @param {File} file - * @return {Boolean} - */ - isFile: function (file){ - return _toString.call(file) === '[object File]'; - }, - - - /** - * Is blob? - * @param {Blob} blob - * @returns {Boolean} - */ - isBlob: function (blob) { - return this.isFile(blob) || (_toString.call(blob) === '[object Blob]'); - }, - - - /** - * Is canvas element - * - * @param {HTMLElement} el - * @return {Boolean} - */ - isCanvas: function (el){ - return el && _rcanvas.test(el.nodeName); - }, - - - getFilesFilter: function (filter){ - filter = typeof filter == 'string' ? filter : (filter.getAttribute && filter.getAttribute('accept') || ''); - return filter ? new RegExp('('+ filter.replace(/\./g, '\\.').replace(/,/g, '|') +')$', 'i') : /./; - }, - - - - /** - * Read as DataURL - * - * @param {File|Element} file - * @param {Function} fn - */ - readAsDataURL: function (file, fn){ - if( api.isCanvas(file) ){ - _emit(file, fn, 'load', api.toDataURL(file)); - } - else { - _readAs(file, fn, 'DataURL'); - } - }, - - - /** - * Read as Binary string - * - * @param {File} file - * @param {Function} fn - */ - readAsBinaryString: function (file, fn){ - if( _hasSupportReadAs('BinaryString') ){ - _readAs(file, fn, 'BinaryString'); - } else { - // Hello IE10! - _readAs(file, function (evt){ - if( evt.type == 'load' ){ - try { - // dataURL -> binaryString - evt.result = api.toBinaryString(evt.result); - } catch (e){ - evt.type = 'error'; - evt.message = e.toString(); - } - } - fn(evt); - }, 'DataURL'); - } - }, - - - /** - * Read as ArrayBuffer - * - * @param {File} file - * @param {Function} fn - */ - readAsArrayBuffer: function(file, fn){ - _readAs(file, fn, 'ArrayBuffer'); - }, - - - /** - * Read as text - * - * @param {File} file - * @param {String} encoding - * @param {Function} [fn] - */ - readAsText: function(file, encoding, fn){ - if( !fn ){ - fn = encoding; - encoding = 'utf-8'; - } - - _readAs(file, fn, 'Text', encoding); - }, - - - /** - * Convert image or canvas to DataURL - * - * @param {Element} el Image or Canvas element - * @param {String} [type] mime-type - * @return {String} - */ - toDataURL: function (el, type){ - if( typeof el == 'string' ){ - return el; - } - else if( el.toDataURL ){ - return el.toDataURL(type || 'image/png'); - } - }, - - - /** - * Canvert string, image or canvas to binary string - * - * @param {String|Element} val - * @return {String} - */ - toBinaryString: function (val){ - return window.atob(api.toDataURL(val).replace(_rdata, '')); - }, - - - /** - * Read file or DataURL as ImageElement - * - * @param {File|String} file - * @param {Function} fn - * @param {Boolean} [progress] - */ - readAsImage: function (file, fn, progress){ - if( api.isBlob(file) ){ - if( apiURL ){ - /** @namespace apiURL.createObjectURL */ - var data = apiURL.createObjectURL(file); - if( data === undef ){ - _emit(file, fn, 'error'); - } - else { - api.readAsImage(data, fn, progress); - } - } - else { - api.readAsDataURL(file, function (evt){ - if( evt.type == 'load' ){ - api.readAsImage(evt.result, fn, progress); - } - else if( progress || evt.type == 'error' ){ - _emit(file, fn, evt, null, { loaded: evt.loaded, total: evt.total }); - } - }); - } - } - else if( api.isCanvas(file) ){ - _emit(file, fn, 'load', file); - } - else if( _rimg.test(file.nodeName) ){ - if( file.complete ){ - _emit(file, fn, 'load', file); - } - else { - var events = 'error abort load'; - _one(file, events, function _fn(evt){ - if( evt.type == 'load' && apiURL ){ - /** @namespace apiURL.revokeObjectURL */ - apiURL.revokeObjectURL(file.src); - } - - _off(file, events, _fn); - _emit(file, fn, evt, file); - }); - } - } - else if( file.iframe ){ - _emit(file, fn, { type: 'error' }); - } - else { - // Created image - var img = api.newImage(file.dataURL || file); - api.readAsImage(img, fn, progress); - } - }, - - - /** - * Make file by name - * - * @param {String} name - * @return {Array} - */ - checkFileObj: function (name){ - var file = {}, accept = api.accept; - - if( typeof name == 'object' ){ - file = name; - } - else { - file.name = (name + '').split(/\\|\//g).pop(); - } - - if( file.type == null ){ - file.type = file.name.split('.').pop(); - } - - _each(accept, function (ext, type){ - ext = new RegExp(ext.replace(/\s/g, '|'), 'i'); - if( ext.test(file.type) || api.ext2mime[file.type] ){ - file.type = api.ext2mime[file.type] || (type.split('/')[0] +'/'+ file.type); - } - }); - - return file; - }, - - - /** - * Get drop files - * - * @param {Event} evt - * @param {Function} callback - */ - getDropFiles: function (evt, callback){ - var - files = [] - , all = [] - , items - , dataTransfer = _getDataTransfer(evt) - , transFiles = dataTransfer.files - , transItems = dataTransfer.items - , entrySupport = _isArray(transItems) && transItems[0] && _getAsEntry(transItems[0]) - , queue = api.queue(function (){ callback(files, all); }) - ; - - if( entrySupport ){ - if( normalize && transFiles ){ - var - i = transFiles.length - , file - , entry - ; - - items = new Array(i); - while( i-- ){ - file = transFiles[i]; - - try { - entry = _getAsEntry(transItems[i]); - } - catch( err ){ - api.log('[err] getDropFiles: ', err); - entry = null; - } - - if( _isEntry(entry) ){ - // OSX filesystems use Unicode Normalization Form D (NFD), - // and entry.file(…) can't read the files with the same names - if( entry.isDirectory || (entry.isFile && file.name == file.name.normalize('NFC')) ){ - items[i] = entry; - } - else { - items[i] = file; - } - } - else { - items[i] = file; - } - } - } - else { - items = transItems; - } - } - else { - items = transFiles; - } - - _each(items || [], function (item){ - queue.inc(); - - try { - if( entrySupport && _isEntry(item) ){ - _readEntryAsFiles(item, function (err, entryFiles, allEntries){ - if( err ){ - api.log('[err] getDropFiles:', err); - } else { - files.push.apply(files, entryFiles); - } - all.push.apply(all, allEntries); - - queue.next(); - }); - } - else { - _isRegularFile(item, function (yes, err){ - if( yes ){ - files.push(item); - } - else { - item.error = err; - } - all.push(item); - - queue.next(); - }); - } - } - catch( err ){ - queue.next(); - api.log('[err] getDropFiles: ', err); - } - }); - - queue.check(); - }, - - - /** - * Get file list - * - * @param {HTMLInputElement|Event} input - * @param {String|Function} [filter] - * @param {Function} [callback] - * @return {Array|Null} - */ - getFiles: function (input, filter, callback){ - var files = []; - - if( callback ){ - api.filterFiles(api.getFiles(input), filter, callback); - return null; - } - - if( input.jquery ){ - // jQuery object - input.each(function (){ - files = files.concat(api.getFiles(this)); - }); - input = files; - files = []; - } - - if( typeof filter == 'string' ){ - filter = api.getFilesFilter(filter); - } - - if( input.originalEvent ){ - // jQuery event - input = _fixEvent(input.originalEvent); - } - else if( input.srcElement ){ - // IE Event - input = _fixEvent(input); - } - - - if( input.dataTransfer ){ - // Drag'n'Drop - input = input.dataTransfer; - } - else if( input.target ){ - // Event - input = input.target; - } - - if( input.files ){ - // Input[type="file"] - files = input.files; - - if( !html5 ){ - // Partial support for file api - files[0].blob = input; - files[0].iframe = true; - } - } - else if( !html5 && isInputFile(input) ){ - if( api.trim(input.value) ){ - files = [api.checkFileObj(input.value)]; - files[0].blob = input; - files[0].iframe = true; - } - } - else if( _isArray(input) ){ - files = input; - } - - return api.filter(files, function (file){ return !filter || filter.test(file.name); }); - }, - - - /** - * Get total file size - * @param {Array} files - * @return {Number} - */ - getTotalSize: function (files){ - var size = 0, i = files && files.length; - while( i-- ){ - size += files[i].size; - } - return size; - }, - - - /** - * Get image information - * - * @param {File} file - * @param {Function} fn - */ - getInfo: function (file, fn){ - var info = {}, readers = _infoReader.concat(); - - if( api.isBlob(file) ){ - (function _next(){ - var reader = readers.shift(); - if( reader ){ - if( reader.test(file.type) ){ - reader(file, function (err, res){ - if( err ){ - fn(err); - } - else { - _extend(info, res); - _next(); - } - }); - } - else { - _next(); - } - } - else { - fn(false, info); - } - })(); - } - else { - fn('not_support_info', info); - } - }, - - - /** - * Add information reader - * - * @param {RegExp} mime - * @param {Function} fn - */ - addInfoReader: function (mime, fn){ - fn.test = function (type){ return mime.test(type); }; - _infoReader.push(fn); - }, - - - /** - * Filter of array - * - * @param {Array} input - * @param {Function} fn - * @return {Array} - */ - filter: function (input, fn){ - var result = [], i = 0, n = input.length, val; - - for( ; i < n; i++ ){ - if( i in input ){ - val = input[i]; - if( fn.call(val, val, i, input) ){ - result.push(val); - } - } - } - - return result; - }, - - - /** - * Filter files - * - * @param {Array} files - * @param {Function} eachFn - * @param {Function} resultFn - */ - filterFiles: function (files, eachFn, resultFn){ - if( files.length ){ - // HTML5 or Flash - var queue = files.concat(), file, result = [], deleted = []; - - (function _next(){ - if( queue.length ){ - file = queue.shift(); - api.getInfo(file, function (err, info){ - (eachFn(file, err ? false : info) ? result : deleted).push(file); - _next(); - }); - } - else { - resultFn(result, deleted); - } - })(); - } - else { - resultFn([], files); - } - }, - - - upload: function (options){ - options = _extend({ - jsonp: 'callback' - , prepare: api.F - , beforeupload: api.F - , upload: api.F - , fileupload: api.F - , fileprogress: api.F - , filecomplete: api.F - , progress: api.F - , complete: api.F - , pause: api.F - , imageOriginal: true - , chunkSize: api.chunkSize - , chunkUploadRetry: api.chunkUploadRetry - , uploadRetry: api.uploadRetry - }, options); - - - if( options.imageAutoOrientation && !options.imageTransform ){ - options.imageTransform = { rotate: 'auto' }; - } - - - var - proxyXHR = new api.XHR(options) - , dataArray = this._getFilesDataArray(options.files) - , _this = this - , _total = 0 - , _loaded = 0 - , _nextFile - , _complete = false - ; - - - // calc total size - _each(dataArray, function (data){ - _total += data.size; - }); - - // Array of files - proxyXHR.files = []; - _each(dataArray, function (data){ - proxyXHR.files.push(data.file); - }); - - // Set upload status props - proxyXHR.total = _total; - proxyXHR.loaded = 0; - proxyXHR.filesLeft = dataArray.length; - - // emit "beforeupload" event - options.beforeupload(proxyXHR, options); - - // Upload by file - _nextFile = function (){ - var - data = dataArray.shift() - , _file = data && data.file - , _fileLoaded = false - , _fileOptions = _simpleClone(options) - ; - - proxyXHR.filesLeft = dataArray.length; - - if( _file && _file.name === api.expando ){ - _file = null; - api.log('[warn] FileAPI.upload() — called without files'); - } - - if( ( proxyXHR.statusText != 'abort' || proxyXHR.current ) && data ){ - // Mark active job - _complete = false; - - // Set current upload file - proxyXHR.currentFile = _file; - - // Prepare file options - if (_file && options.prepare(_file, _fileOptions) === false) { - _nextFile.call(_this); - return; - } - _fileOptions.file = _file; - - _this._getFormData(_fileOptions, data, function (form){ - if( !_loaded ){ - // emit "upload" event - options.upload(proxyXHR, options); - } - - var xhr = new api.XHR(_extend({}, _fileOptions, { - - upload: _file ? function (){ - // emit "fileupload" event - options.fileupload(_file, xhr, _fileOptions); - } : noop, - - progress: _file ? function (evt){ - if( !_fileLoaded ){ - // For ignore the double calls. - _fileLoaded = (evt.loaded === evt.total); - - // emit "fileprogress" event - options.fileprogress({ - type: 'progress' - , total: data.total = evt.total - , loaded: data.loaded = evt.loaded - }, _file, xhr, _fileOptions); - - // emit "progress" event - options.progress({ - type: 'progress' - , total: _total - , loaded: proxyXHR.loaded = (_loaded + data.size * (evt.loaded/evt.total)) || 0 - }, _file, xhr, _fileOptions); - } - } : noop, - - complete: function (err){ - _each(_xhrPropsExport, function (name){ - proxyXHR[name] = xhr[name]; - }); - - if( _file ){ - data.total = (data.total || data.size); - data.loaded = data.total; - - if( !err ) { - // emulate 100% "progress" - this.progress(data); - - // fixed throttle event - _fileLoaded = true; - - // bytes loaded - _loaded += data.size; // data.size != data.total, it's desirable fix this - proxyXHR.loaded = _loaded; - } - - // emit "filecomplete" event - options.filecomplete(err, xhr, _file, _fileOptions); - } - - // upload next file - setTimeout(function () {_nextFile.call(_this);}, 0); - } - })); // xhr - - - // ... - proxyXHR.abort = function (current){ - if (!current) { dataArray.length = 0; } - this.current = current; - xhr.abort(); - }; - - // Start upload - xhr.send(form); - }); - } - else { - var successful = proxyXHR.status == 200 || proxyXHR.status == 201 || proxyXHR.status == 204; - options.complete(successful ? false : (proxyXHR.statusText || 'error'), proxyXHR, options); - // Mark done state - _complete = true; - } - }; - - - // Next tick - setTimeout(_nextFile, 0); - - - // Append more files to the existing request - // first - add them to the queue head/tail - proxyXHR.append = function (files, first) { - files = api._getFilesDataArray([].concat(files)); - - _each(files, function (data) { - _total += data.size; - proxyXHR.files.push(data.file); - if (first) { - dataArray.unshift(data); - } else { - dataArray.push(data); - } - }); - - proxyXHR.statusText = ""; - - if( _complete ){ - _nextFile.call(_this); - } - }; - - - // Removes file from queue by file reference and returns it - proxyXHR.remove = function (file) { - var i = dataArray.length, _file; - while( i-- ){ - if( dataArray[i].file == file ){ - _file = dataArray.splice(i, 1); - _total -= _file.size; - } - } - return _file; - }; - - return proxyXHR; - }, - - - _getFilesDataArray: function (data){ - var files = [], oFiles = {}; - - if( isInputFile(data) ){ - var tmp = api.getFiles(data); - oFiles[data.name || 'file'] = data.getAttribute('multiple') !== null ? tmp : tmp[0]; - } - else if( _isArray(data) && isInputFile(data[0]) ){ - _each(data, function (input){ - oFiles[input.name || 'file'] = api.getFiles(input); - }); - } - else { - oFiles = data; - } - - _each(oFiles, function add(file, name){ - if( _isArray(file) ){ - _each(file, function (file){ - add(file, name); - }); - } - else if( file && (file.name || file.image) ){ - files.push({ - name: name - , file: file - , size: file.size - , total: file.size - , loaded: 0 - }); - } - }); - - if( !files.length ){ - // Create fake `file` object - files.push({ file: { name: api.expando } }); - } - - return files; - }, - - - _getFormData: function (options, data, fn){ - var - file = data.file - , name = data.name - , filename = file.name - , filetype = file.type - , trans = api.support.transform && options.imageTransform - , Form = new api.Form - , queue = api.queue(function (){ fn(Form); }) - , isOrignTrans = trans && _isOriginTransform(trans) - , postNameConcat = api.postNameConcat - ; - - // Append data - _each(options.data, function add(val, name){ - if( typeof val == 'object' ){ - _each(val, function (v, i){ - add(v, postNameConcat(name, i)); - }); - } - else { - Form.append(name, val); - } - }); - - (function _addFile(file/**Object*/){ - if( file.image ){ // This is a FileAPI.Image - queue.inc(); - - file.toData(function (err, image){ - // @todo: требует рефакторинга и обработки ошибки - if (file.file) { - image.type = file.file.type; - image.quality = file.matrix.quality; - filename = file.file && file.file.name; - } - - filename = filename || (new Date).getTime()+'.png'; - - _addFile(image); - queue.next(); - }); - } - else if( api.Image && trans && (/^image/.test(file.type) || _rimgcanvas.test(file.nodeName)) ){ - queue.inc(); - - if( isOrignTrans ){ - // Convert to array for transform function - trans = [trans]; - } - - api.Image.transform(file, trans, options.imageAutoOrientation, function (err, images){ - if( isOrignTrans && !err ){ - if( !dataURLtoBlob && !api.flashEngine ){ - // Canvas.toBlob or Flash not supported, use multipart - Form.multipart = true; - } - - Form.append(name, images[0], filename, trans[0].type || filetype); - } - else { - var addOrigin = 0; - - if( !err ){ - _each(images, function (image, idx){ - if( !dataURLtoBlob && !api.flashEngine ){ - Form.multipart = true; - } - - if( !trans[idx].postName ){ - addOrigin = 1; - } - - Form.append(trans[idx].postName || postNameConcat(name, idx), image, filename, trans[idx].type || filetype); - }); - } - - if( err || options.imageOriginal ){ - Form.append(postNameConcat(name, (addOrigin ? 'original' : null)), file, filename, filetype); - } - } - - queue.next(); - }); - } - else if( filename !== api.expando ){ - Form.append(name, file, filename); - } - })(file); - - queue.check(); - }, - - - reset: function (inp, notRemove){ - var parent, clone; - - if( jQuery ){ - clone = jQuery(inp).clone(true).insertBefore(inp).val('')[0]; - if( !notRemove ){ - jQuery(inp).remove(); - } - } else { - parent = inp.parentNode; - clone = parent.insertBefore(inp.cloneNode(true), inp); - clone.value = ''; - - if( !notRemove ){ - parent.removeChild(inp); - } - - _each(_elEvents[api.uid(inp)], function (fns, type){ - _each(fns, function (fn){ - _off(inp, type, fn); - _on(clone, type, fn); - }); - }); - } - - return clone; - }, - - - /** - * Load remote file - * - * @param {String} url - * @param {Function} fn - * @return {XMLHttpRequest} - */ - load: function (url, fn){ - var xhr = api.getXHR(); - if( xhr ){ - xhr.open('GET', url, true); - - if( xhr.overrideMimeType ){ - xhr.overrideMimeType('text/plain; charset=x-user-defined'); - } - - _on(xhr, 'progress', function (/**Event*/evt){ - /** @namespace evt.lengthComputable */ - if( evt.lengthComputable ){ - fn({ type: evt.type, loaded: evt.loaded, total: evt.total }, xhr); - } - }); - - xhr.onreadystatechange = function(){ - if( xhr.readyState == 4 ){ - xhr.onreadystatechange = null; - if( xhr.status == 200 ){ - url = url.split('/'); - /** @namespace xhr.responseBody */ - var file = { - name: url[url.length-1] - , size: xhr.getResponseHeader('Content-Length') - , type: xhr.getResponseHeader('Content-Type') - }; - file.dataURL = 'data:'+file.type+';base64,' + api.encode64(xhr.responseBody || xhr.responseText); - fn({ type: 'load', result: file }, xhr); - } - else { - fn({ type: 'error' }, xhr); - } - } - }; - xhr.send(null); - } else { - fn({ type: 'error' }); - } - - return xhr; - }, - - encode64: function (str){ - var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', outStr = '', i = 0; - - if( typeof str !== 'string' ){ - str = String(str); - } - - while( i < str.length ){ - //all three "& 0xff" added below are there to fix a known bug - //with bytes returned by xhr.responseText - var - byte1 = str.charCodeAt(i++) & 0xff - , byte2 = str.charCodeAt(i++) & 0xff - , byte3 = str.charCodeAt(i++) & 0xff - , enc1 = byte1 >> 2 - , enc2 = ((byte1 & 3) << 4) | (byte2 >> 4) - , enc3, enc4 - ; - - if( isNaN(byte2) ){ - enc3 = enc4 = 64; - } else { - enc3 = ((byte2 & 15) << 2) | (byte3 >> 6); - enc4 = isNaN(byte3) ? 64 : byte3 & 63; - } - - outStr += b64.charAt(enc1) + b64.charAt(enc2) + b64.charAt(enc3) + b64.charAt(enc4); - } - - return outStr; - } - - } // api - ; - - - function _emit(target, fn, name, res, ext){ - var evt = { - type: name.type || name - , target: target - , result: res - }; - _extend(evt, ext); - fn(evt); - } - - - function _hasSupportReadAs(method){ - return FileReader && !!FileReader.prototype['readAs' + method]; - } - - - function _readAs(file, fn, method, encoding){ - if( api.isBlob(file) && _hasSupportReadAs(method) ){ - var Reader = new FileReader; - - // Add event listener - _on(Reader, _readerEvents, function _fn(evt){ - var type = evt.type; - if( type == 'progress' ){ - _emit(file, fn, evt, evt.target.result, { loaded: evt.loaded, total: evt.total }); - } - else if( type == 'loadend' ){ - _off(Reader, _readerEvents, _fn); - Reader = null; - } - else { - _emit(file, fn, evt, evt.target.result); - } - }); - - - try { - // ReadAs ... - if( encoding ){ - Reader['readAs' + method](file, encoding); - } - else { - Reader['readAs' + method](file); - } - } - catch (err){ - _emit(file, fn, 'error', undef, { error: err.toString() }); - } - } - else { - _emit(file, fn, 'error', undef, { error: 'filreader_not_support_' + method }); - } - } - - - function _isRegularFile(file, callback){ - // http://stackoverflow.com/questions/8856628/detecting-folders-directories-in-javascript-filelist-objects - if( !file.type && (safari || ((file.size % 4096) === 0 && (file.size <= 102400))) ){ - if( FileReader ){ - try { - var reader = new FileReader(); - - _one(reader, _readerEvents, function (evt){ - var isFile = evt.type != 'error'; - if( isFile ){ - if ( reader.readyState == null || reader.readyState === reader.LOADING ) { - reader.abort(); - } - callback(isFile); - } - else { - callback(false, reader.error); - } - }); - - reader.readAsDataURL(file); - } catch( err ){ - callback(false, err); - } - } - else { - callback(null, new Error('FileReader is not supported')); - } - } - else { - callback(true); - } - } - - - function _isEntry(item){ - return item && (item.isFile || item.isDirectory); - } - - - function _getAsEntry(item){ - var entry; - if( item.getAsEntry ){ entry = item.getAsEntry(); } - else if( item.webkitGetAsEntry ){ entry = item.webkitGetAsEntry(); } - return entry; - } - - - function _readEntryAsFiles(entry, callback){ - if( !entry ){ - // error - var err = new Error('invalid entry'); - entry = new Object(entry); - entry.error = err; - callback(err.message, [], [entry]); - } - else if( entry.isFile ){ - // Read as file - entry.file(function (file){ - // success - file.fullPath = entry.fullPath; - callback(false, [file], [file]); - }, function (err){ - // error - entry.error = err; - callback('FileError.code: ' + err.code, [], [entry]); - }); - } - else if( entry.isDirectory ){ - var - reader = entry.createReader() - , firstAttempt = true - , files = [] - , all = [entry] - ; - - var onerror = function (err){ - // error - entry.error = err; - callback('DirectoryError.code: ' + err.code, files, all); - }; - var ondone = function ondone(entries){ - if( firstAttempt ){ - firstAttempt = false; - if( !entries.length ){ - entry.error = new Error('directory is empty'); - } - } - - // success - if( entries.length ){ - api.afor(entries, function (next, entry){ - _readEntryAsFiles(entry, function (err, entryFiles, allEntries){ - if( !err ){ - files = files.concat(entryFiles); - } - all = all.concat(allEntries); - - if( next ){ - next(); - } - else { - reader.readEntries(ondone, onerror); - } - }); - }); - } - else { - callback(false, files, all); - } - }; - - reader.readEntries(ondone, onerror); - } - else { - _readEntryAsFiles(_getAsEntry(entry), callback); - } - } - - - function _simpleClone(obj){ - var copy = {}; - _each(obj, function (val, key){ - if( val && (typeof val === 'object') && (val.nodeType === void 0) ){ - val = _extend({}, val); - } - copy[key] = val; - }); - return copy; - } - - - function isInputFile(el){ - return _rinput.test(el && el.tagName); - } - - - function _getDataTransfer(evt){ - return (evt.originalEvent || evt || '').dataTransfer || {}; - } - - - function _isOriginTransform(trans){ - var key; - for( key in trans ){ - if( trans.hasOwnProperty(key) ){ - if( !(trans[key] instanceof Object || key === 'overlay' || key === 'filter') ){ - return true; - } - } - } - return false; - } - - - // Add default image info reader - api.addInfoReader(/^image/, function (file/**File*/, callback/**Function*/){ - if( !file.__dimensions ){ - var defer = file.__dimensions = api.defer(); - - api.readAsImage(file, function (evt){ - var img = evt.target; - defer.resolve(evt.type == 'load' ? false : 'error', { - width: img.width - , height: img.height - }); - img.src = api.EMPTY_PNG; - img = null; - }); - } - - file.__dimensions.then(callback); - }); - - - /** - * Drag'n'Drop special event - * - * @param {HTMLElement} el - * @param {Function} onHover - * @param {Function} onDrop - */ - api.event.dnd = function (el, onHover, onDrop){ - var _id, _type; - - if( !onDrop ){ - onDrop = onHover; - onHover = api.F; - } - - if( FileReader ){ - // Hover - _on(el, 'dragenter dragleave dragover', onHover.ff = onHover.ff || function (evt){ - var - types = _getDataTransfer(evt).types - , i = types && types.length - , debounceTrigger = false - ; - - while( i-- ){ - if( ~types[i].indexOf('File') ){ - evt[preventDefault](); - - if( _type !== evt.type ){ - _type = evt.type; // Store current type of event - - if( _type != 'dragleave' ){ - onHover.call(evt[currentTarget], true, evt); - } - - debounceTrigger = true; - } - - break; // exit from "while" - } - } - - if( debounceTrigger ){ - clearTimeout(_id); - _id = setTimeout(function (){ - onHover.call(evt[currentTarget], _type != 'dragleave', evt); - }, 50); - } - }); - - - // Drop - _on(el, 'drop', onDrop.ff = onDrop.ff || function (evt){ - evt[preventDefault](); - - _type = 0; - onHover.call(evt[currentTarget], false, evt); - - api.getDropFiles(evt, function (files, all){ - onDrop.call(evt[currentTarget], files, all, evt); - }); - }); - } - else { - api.log("Drag'n'Drop -- not supported"); - } - }; - - - /** - * Remove drag'n'drop - * @param {HTMLElement} el - * @param {Function} onHover - * @param {Function} onDrop - */ - api.event.dnd.off = function (el, onHover, onDrop){ - _off(el, 'dragenter dragleave dragover', onHover.ff); - _off(el, 'drop', onDrop.ff); - }; - - - // Support jQuery - if( jQuery && !jQuery.fn.dnd ){ - jQuery.fn.dnd = function (onHover, onDrop){ - return this.each(function (){ - api.event.dnd(this, onHover, onDrop); - }); - }; - - jQuery.fn.offdnd = function (onHover, onDrop){ - return this.each(function (){ - api.event.dnd.off(this, onHover, onDrop); - }); - }; - } - - // @export - window.FileAPI = _extend(api, window.FileAPI); - - - // Debug info - api.log('FileAPI: ' + api.version); - api.log('protocol: ' + window.location.protocol); - api.log('doctype: [' + doctype.name + '] ' + doctype.publicId + ' ' + doctype.systemId); - - - // @detect 'x-ua-compatible' - _each(document.getElementsByTagName('meta'), function (meta){ - if( /x-ua-compatible/i.test(meta.getAttribute('http-equiv')) ){ - api.log('meta.http-equiv: ' + meta.getAttribute('content')); - } - }); - - - // Configuration - try { - _supportConsoleLog = !!console.log; - _supportConsoleLogApply = !!console.log.apply; - } - catch (err) {} - - if( !api.flashUrl ){ api.flashUrl = api.staticPath + 'FileAPI.flash.swf'; } - if( !api.flashImageUrl ){ api.flashImageUrl = api.staticPath + 'FileAPI.flash.image.swf'; } - if( !api.flashWebcamUrl ){ api.flashWebcamUrl = api.staticPath + 'FileAPI.flash.camera.swf'; } -})(window, void 0); - -/*global window, FileAPI, document */ - -(function (api, document, undef) { - 'use strict'; - - var - min = Math.min, - round = Math.round, - getCanvas = function () { return document.createElement('canvas'); }, - support = false, - exifOrientation = { - 8: 270 - , 3: 180 - , 6: 90 - , 7: 270 - , 4: 180 - , 5: 90 - } - ; - - try { - support = getCanvas().toDataURL('image/png').indexOf('data:image/png') > -1; - } - catch (e){} - - - function Image(file){ - if( file instanceof Image ){ - var img = new Image(file.file); - api.extend(img.matrix, file.matrix); - return img; - } - else if( !(this instanceof Image) ){ - return new Image(file); - } - - this.file = file; - this.size = file.size || 100; - - this.matrix = { - sx: 0, - sy: 0, - sw: 0, - sh: 0, - dx: 0, - dy: 0, - dw: 0, - dh: 0, - resize: 0, // min, max OR preview - deg: 0, - quality: 1, // jpeg quality - filter: 0 - }; - } - - - Image.prototype = { - image: true, - constructor: Image, - - set: function (attrs){ - api.extend(this.matrix, attrs); - return this; - }, - - crop: function (x, y, w, h){ - if( w === undef ){ - w = x; - h = y; - x = y = 0; - } - return this.set({ sx: x, sy: y, sw: w, sh: h || w }); - }, - - resize: function (w, h, strategy){ - if( /min|max|height|width/.test(h) ){ - strategy = h; - h = w; - } - - return this.set({ dw: w, dh: h || w, resize: strategy }); - }, - - preview: function (w, h){ - return this.resize(w, h || w, 'preview'); - }, - - rotate: function (deg){ - return this.set({ deg: deg }); - }, - - filter: function (filter){ - return this.set({ filter: filter }); - }, - - overlay: function (images){ - return this.set({ overlay: images }); - }, - - clone: function (){ - return new Image(this); - }, - - _load: function (image, fn){ - var self = this; - - if( /img|video/i.test(image.nodeName) ){ - fn.call(self, null, image); - } - else { - api.readAsImage(image, function (evt){ - fn.call(self, evt.type != 'load', evt.result); - }); - } - }, - - _apply: function (image, fn){ - var - canvas = getCanvas() - , m = this.getMatrix(image) - , ctx = canvas.getContext('2d') - , width = image.videoWidth || image.width - , height = image.videoHeight || image.height - , deg = m.deg - , dw = m.dw - , dh = m.dh - , w = width - , h = height - , filter = m.filter - , copy // canvas copy - , buffer = image - , overlay = m.overlay - , queue = api.queue(function (){ image.src = api.EMPTY_PNG; fn(false, canvas); }) - , renderImageToCanvas = api.renderImageToCanvas - ; - - // Normalize angle - deg = deg - Math.floor(deg/360)*360; - - // For `renderImageToCanvas` - image._type = this.file.type; - - while(m.multipass && min(w/dw, h/dh) > 2 ){ - w = (w/2 + 0.5)|0; - h = (h/2 + 0.5)|0; - - copy = getCanvas(); - copy.width = w; - copy.height = h; - - if( buffer !== image ){ - renderImageToCanvas(copy, buffer, 0, 0, buffer.width, buffer.height, 0, 0, w, h); - buffer = copy; - } - else { - buffer = copy; - renderImageToCanvas(buffer, image, m.sx, m.sy, m.sw, m.sh, 0, 0, w, h); - m.sx = m.sy = m.sw = m.sh = 0; - } - } - - - canvas.width = (deg % 180) ? dh : dw; - canvas.height = (deg % 180) ? dw : dh; - - canvas.type = m.type; - canvas.quality = m.quality; - - ctx.rotate(deg * Math.PI / 180); - renderImageToCanvas(ctx.canvas, buffer - , m.sx, m.sy - , m.sw || buffer.width - , m.sh || buffer.height - , (deg == 180 || deg == 270 ? -dw : 0) - , (deg == 90 || deg == 180 ? -dh : 0) - , dw, dh - ); - dw = canvas.width; - dh = canvas.height; - - // Apply overlay - overlay && api.each([].concat(overlay), function (over){ - queue.inc(); - // preload - var img = new window.Image, fn = function (){ - var - x = over.x|0 - , y = over.y|0 - , w = over.w || img.width - , h = over.h || img.height - , rel = over.rel - ; - - // center | right | left - x = (rel == 1 || rel == 4 || rel == 7) ? (dw - w + x)/2 : (rel == 2 || rel == 5 || rel == 8 ? dw - (w + x) : x); - - // center | bottom | top - y = (rel == 3 || rel == 4 || rel == 5) ? (dh - h + y)/2 : (rel >= 6 ? dh - (h + y) : y); - - api.event.off(img, 'error load abort', fn); - - try { - ctx.globalAlpha = over.opacity || 1; - ctx.drawImage(img, x, y, w, h); - } - catch (er){} - - queue.next(); - }; - - api.event.on(img, 'error load abort', fn); - img.src = over.src; - - if( img.complete ){ - fn(); - } - }); - - if( filter ){ - queue.inc(); - Image.applyFilter(canvas, filter, queue.next); - } - - queue.check(); - }, - - getMatrix: function (image){ - var - m = api.extend({}, this.matrix) - , sw = m.sw = m.sw || image.videoWidth || image.naturalWidth || image.width - , sh = m.sh = m.sh || image.videoHeight || image.naturalHeight || image.height - , dw = m.dw = m.dw || sw - , dh = m.dh = m.dh || sh - , sf = sw/sh, df = dw/dh - , strategy = m.resize - ; - - if( strategy == 'preview' ){ - if( dw != sw || dh != sh ){ - // Make preview - var w, h; - - if( df >= sf ){ - w = sw; - h = w / df; - } else { - h = sh; - w = h * df; - } - - if( w != sw || h != sh ){ - m.sx = ~~((sw - w)/2); - m.sy = ~~((sh - h)/2); - sw = w; - sh = h; - } - } - } - else if( strategy == 'height' ){ - dw = dh * sf; - } - else if( strategy == 'width' ){ - dh = dw / sf; - } - else if( strategy ){ - if( !(sw > dw || sh > dh) ){ - dw = sw; - dh = sh; - } - else if( strategy == 'min' ){ - dw = round(sf < df ? min(sw, dw) : dh*sf); - dh = round(sf < df ? dw/sf : min(sh, dh)); - } - else { - dw = round(sf >= df ? min(sw, dw) : dh*sf); - dh = round(sf >= df ? dw/sf : min(sh, dh)); - } - } - - m.sw = sw; - m.sh = sh; - m.dw = dw; - m.dh = dh; - m.multipass = api.multiPassResize; - return m; - }, - - _trans: function (fn){ - this._load(this.file, function (err, image){ - if( err ){ - fn(err); - } - else { - try { - this._apply(image, fn); - } catch (err){ - api.log('[err] FileAPI.Image.fn._apply:', err); - fn(err); - } - } - }); - }, - - - get: function (fn){ - if( api.support.transform ){ - var _this = this, matrix = _this.matrix; - - if( matrix.deg == 'auto' ){ - api.getInfo(_this.file, function (err, info){ - // rotate by exif orientation - matrix.deg = exifOrientation[info && info.exif && info.exif.Orientation] || 0; - _this._trans(fn); - }); - } - else { - _this._trans(fn); - } - } - else { - fn('not_support_transform'); - } - - return this; - }, - - - toData: function (fn){ - return this.get(fn); - } - - }; - - - Image.exifOrientation = exifOrientation; - - - Image.transform = function (file, transform, autoOrientation, fn){ - function _transform(err, img){ - // img -- info object - var - images = {} - , queue = api.queue(function (err){ - fn(err, images); - }) - ; - - if( !err ){ - api.each(transform, function (params, name){ - if( !queue.isFail() ){ - var ImgTrans = new Image(img.nodeType ? img : file), isFn = typeof params == 'function'; - - if( isFn ){ - params(img, ImgTrans); - } - else if( params.width ){ - ImgTrans[params.preview ? 'preview' : 'resize'](params.width, params.height, params.strategy); - } - else { - if( params.maxWidth && (img.width > params.maxWidth || img.height > params.maxHeight) ){ - ImgTrans.resize(params.maxWidth, params.maxHeight, 'max'); - } - } - - if( params.crop ){ - var crop = params.crop; - ImgTrans.crop(crop.x|0, crop.y|0, crop.w || crop.width, crop.h || crop.height); - } - - if( params.rotate === undef && autoOrientation ){ - params.rotate = 'auto'; - } - - ImgTrans.set({ type: ImgTrans.matrix.type || params.type || file.type || 'image/png' }); - - if( !isFn ){ - ImgTrans.set({ - deg: params.rotate - , overlay: params.overlay - , filter: params.filter - , quality: params.quality || 1 - }); - } - - queue.inc(); - ImgTrans.toData(function (err, image){ - if( err ){ - queue.fail(); - } - else { - images[name] = image; - queue.next(); - } - }); - } - }); - } - else { - queue.fail(); - } - } - - - // @todo: Оло-ло, нужно рефакторить это место - if( file.width ){ - _transform(false, file); - } else { - api.getInfo(file, _transform); - } - }; - - - // @const - api.each(['TOP', 'CENTER', 'BOTTOM'], function (x, i){ - api.each(['LEFT', 'CENTER', 'RIGHT'], function (y, j){ - Image[x+'_'+y] = i*3 + j; - Image[y+'_'+x] = i*3 + j; - }); - }); - - - /** - * Trabsform element to canvas - * - * @param {Image|HTMLVideoElement} el - * @returns {Canvas} - */ - Image.toCanvas = function(el){ - var canvas = document.createElement('canvas'); - canvas.width = el.videoWidth || el.width; - canvas.height = el.videoHeight || el.height; - canvas.getContext('2d').drawImage(el, 0, 0); - return canvas; - }; - - - /** - * Create image from DataURL - * @param {String} dataURL - * @param {Object} size - * @param {Function} callback - */ - Image.fromDataURL = function (dataURL, size, callback){ - var img = api.newImage(dataURL); - api.extend(img, size); - callback(img); - }; - - - /** - * Apply filter (caman.js) - * - * @param {Canvas|Image} canvas - * @param {String|Function} filter - * @param {Function} doneFn - */ - Image.applyFilter = function (canvas, filter, doneFn){ - if( typeof filter == 'function' ){ - filter(canvas, doneFn); - } - else if( window.Caman ){ - // http://camanjs.com/guides/ - window.Caman(canvas.tagName == 'IMG' ? Image.toCanvas(canvas) : canvas, function (){ - if( typeof filter == 'string' ){ - this[filter](); - } - else { - api.each(filter, function (val, method){ - this[method](val); - }, this); - } - this.render(doneFn); - }); - } - }; - - - /** - * For load-image-ios.js - */ - api.renderImageToCanvas = function (canvas, img, sx, sy, sw, sh, dx, dy, dw, dh){ - try { - return canvas.getContext('2d').drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh); - } catch (ex) { - api.log('renderImageToCanvas failed'); - throw ex; - } - }; - - - // @export - api.support.canvas = api.support.transform = support; - api.Image = Image; -})(FileAPI, document); - -/* - * JavaScript Load Image iOS scaling fixes 1.0.3 - * https://github.com/blueimp/JavaScript-Load-Image - * - * Copyright 2013, Sebastian Tschan - * https://blueimp.net - * - * iOS image scaling fixes based on - * https://github.com/stomita/ios-imagefile-megapixel - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/MIT - */ - -/*jslint nomen: true, bitwise: true */ -/*global FileAPI, window, document */ - -(function (factory) { - 'use strict'; - factory(FileAPI); -}(function (loadImage) { - 'use strict'; - - // Only apply fixes on the iOS platform: - if (!window.navigator || !window.navigator.platform || - !(/iP(hone|od|ad)/).test(window.navigator.platform)) { - return; - } - - var originalRenderMethod = loadImage.renderImageToCanvas; - - // Detects subsampling in JPEG images: - loadImage.detectSubsampling = function (img) { - var canvas, - context; - if (img.width * img.height > 1024 * 1024) { // only consider mexapixel images - canvas = document.createElement('canvas'); - canvas.width = canvas.height = 1; - context = canvas.getContext('2d'); - context.drawImage(img, -img.width + 1, 0); - // subsampled image becomes half smaller in rendering size. - // check alpha channel value to confirm image is covering edge pixel or not. - // if alpha value is 0 image is not covering, hence subsampled. - return context.getImageData(0, 0, 1, 1).data[3] === 0; - } - return false; - }; - - // Detects vertical squash in JPEG images: - loadImage.detectVerticalSquash = function (img, subsampled) { - var naturalHeight = img.naturalHeight || img.height, - canvas = document.createElement('canvas'), - context = canvas.getContext('2d'), - data, - sy, - ey, - py, - alpha; - if (subsampled) { - naturalHeight /= 2; - } - canvas.width = 1; - canvas.height = naturalHeight; - context.drawImage(img, 0, 0); - data = context.getImageData(0, 0, 1, naturalHeight).data; - // search image edge pixel position in case it is squashed vertically: - sy = 0; - ey = naturalHeight; - py = naturalHeight; - while (py > sy) { - alpha = data[(py - 1) * 4 + 3]; - if (alpha === 0) { - ey = py; - } else { - sy = py; - } - py = (ey + sy) >> 1; - } - return (py / naturalHeight) || 1; - }; - - // Renders image to canvas while working around iOS image scaling bugs: - // https://github.com/blueimp/JavaScript-Load-Image/issues/13 - loadImage.renderImageToCanvas = function ( - canvas, - img, - sourceX, - sourceY, - sourceWidth, - sourceHeight, - destX, - destY, - destWidth, - destHeight - ) { - if (img._type === 'image/jpeg') { - var context = canvas.getContext('2d'), - tmpCanvas = document.createElement('canvas'), - tileSize = 1024, - tmpContext = tmpCanvas.getContext('2d'), - subsampled, - vertSquashRatio, - tileX, - tileY; - tmpCanvas.width = tileSize; - tmpCanvas.height = tileSize; - context.save(); - subsampled = loadImage.detectSubsampling(img); - if (subsampled) { - sourceX /= 2; - sourceY /= 2; - sourceWidth /= 2; - sourceHeight /= 2; - } - vertSquashRatio = loadImage.detectVerticalSquash(img, subsampled); - if (subsampled || vertSquashRatio !== 1) { - sourceY *= vertSquashRatio; - destWidth = Math.ceil(tileSize * destWidth / sourceWidth); - destHeight = Math.ceil( - tileSize * destHeight / sourceHeight / vertSquashRatio - ); - destY = 0; - tileY = 0; - while (tileY < sourceHeight) { - destX = 0; - tileX = 0; - while (tileX < sourceWidth) { - tmpContext.clearRect(0, 0, tileSize, tileSize); - tmpContext.drawImage( - img, - sourceX, - sourceY, - sourceWidth, - sourceHeight, - -tileX, - -tileY, - sourceWidth, - sourceHeight - ); - context.drawImage( - tmpCanvas, - 0, - 0, - tileSize, - tileSize, - destX, - destY, - destWidth, - destHeight - ); - tileX += tileSize; - destX += destWidth; - } - tileY += tileSize; - destY += destHeight; - } - context.restore(); - return canvas; - } - } - return originalRenderMethod( - canvas, - img, - sourceX, - sourceY, - sourceWidth, - sourceHeight, - destX, - destY, - destWidth, - destHeight - ); - }; - -})); - -/*global window, FileAPI */ - -(function (api, window){ - "use strict"; - - var - document = window.document - , FormData = window.FormData - , Form = function (){ this.items = []; } - , encodeURIComponent = window.encodeURIComponent - ; - - - Form.prototype = { - - append: function (name, blob, file, type){ - this.items.push({ - name: name - , blob: blob && blob.blob || (blob == void 0 ? '' : blob) - , file: blob && (file || blob.name) - , type: blob && (type || blob.type) - }); - }, - - each: function (fn){ - var i = 0, n = this.items.length; - for( ; i < n; i++ ){ - fn.call(this, this.items[i]); - } - }, - - toData: function (fn, options){ - // allow chunked transfer if we have only one file to send - // flag is used below and in XHR._send - options._chunked = api.support.chunked && options.chunkSize > 0 && api.filter(this.items, function (item){ return item.file; }).length == 1; - - if( !api.support.html5 ){ - api.log('FileAPI.Form.toHtmlData'); - this.toHtmlData(fn); - } - else if( !api.formData || this.multipart || !FormData ){ - api.log('FileAPI.Form.toMultipartData'); - this.toMultipartData(fn); - } - else if( options._chunked ){ - api.log('FileAPI.Form.toPlainData'); - this.toPlainData(fn); - } - else { - api.log('FileAPI.Form.toFormData'); - this.toFormData(fn); - } - }, - - _to: function (data, complete, next, arg){ - var queue = api.queue(function (){ - complete(data); - }); - - this.each(function (file){ - try{ - next(file, data, queue, arg); - } - catch( err ){ - api.log('FileAPI.Form._to: ' + err.message); - complete(err); - } - }); - - queue.check(); - }, - - - toHtmlData: function (fn){ - this._to(document.createDocumentFragment(), fn, function (file, data/**DocumentFragment*/){ - var blob = file.blob, hidden; - - if( file.file ){ - api.reset(blob, true); - // set new name - blob.name = file.name; - blob.disabled = false; - data.appendChild(blob); - } - else { - hidden = document.createElement('input'); - hidden.name = file.name; - hidden.type = 'hidden'; - hidden.value = blob; - data.appendChild(hidden); - } - }); - }, - - toPlainData: function (fn){ - this._to({}, fn, function (file, data, queue){ - if( file.file ){ - data.type = file.file; - } - - if( file.blob.toBlob ){ - // canvas - queue.inc(); - _convertFile(file, function (file, blob){ - data.name = file.name; - data.file = blob; - data.size = blob.length; - data.type = file.type; - queue.next(); - }); - } - else if( file.file ){ - // file - data.name = file.blob.name; - data.file = file.blob; - data.size = file.blob.size; - data.type = file.type; - } - else { - // additional data - if( !data.params ){ - data.params = []; - } - data.params.push(encodeURIComponent(file.name) +"="+ encodeURIComponent(file.blob)); - } - - data.start = -1; - data.end = data.file && data.file.FileAPIReadPosition || -1; - data.retry = 0; - }); - }, - - toFormData: function (fn){ - this._to(new FormData, fn, function (file, data, queue){ - if( file.blob && file.blob.toBlob ){ - queue.inc(); - _convertFile(file, function (file, blob){ - data.append(file.name, blob, file.file); - queue.next(); - }); - } - else if( file.file ){ - data.append(file.name, file.blob, file.file); - } - else { - data.append(file.name, file.blob); - } - - if( file.file ){ - data.append('_'+file.name, file.file); - } - }); - }, - - - toMultipartData: function (fn){ - this._to([], fn, function (file, data, queue, boundary){ - queue.inc(); - _convertFile(file, function (file, blob){ - data.push( - '--_' + boundary + ('\r\nContent-Disposition: form-data; name="'+ file.name +'"'+ (file.file ? '; filename="'+ encodeURIComponent(file.file) +'"' : '') - + (file.file ? '\r\nContent-Type: '+ (file.type || 'application/octet-stream') : '') - + '\r\n' - + '\r\n'+ (file.file ? blob : encodeURIComponent(blob)) - + '\r\n') - ); - queue.next(); - }, true); - }, api.expando); - } - }; - - - function _convertFile(file, fn, useBinaryString){ - var blob = file.blob, filename = file.file; - - if( filename ){ - if( !blob.toDataURL ){ - // The Blob is not an image. - api.readAsBinaryString(blob, function (evt){ - if( evt.type == 'load' ){ - fn(file, evt.result); - } - }); - return; - } - - var - mime = { 'image/jpeg': '.jpe?g', 'image/png': '.png' } - , type = mime[file.type] ? file.type : 'image/png' - , ext = mime[type] || '.png' - , quality = blob.quality || 1 - ; - - if( !filename.match(new RegExp(ext+'$', 'i')) ){ - // Does not change the current extension, but add a new one. - filename += ext.replace('?', ''); - } - - file.file = filename; - file.type = type; - - if( !useBinaryString && blob.toBlob ){ - blob.toBlob(function (blob){ - fn(file, blob); - }, type, quality); - } - else { - fn(file, api.toBinaryString(blob.toDataURL(type, quality))); - } - } - else { - fn(file, blob); - } - } - - - // @export - api.Form = Form; -})(FileAPI, window); - -/*global window, FileAPI, Uint8Array */ - -(function (window, api){ - "use strict"; - - var - noop = function (){} - , document = window.document - - , XHR = function (options){ - this.uid = api.uid(); - this.xhr = { - abort: noop - , getResponseHeader: noop - , getAllResponseHeaders: noop - }; - this.options = options; - }, - - _xhrResponsePostfix = { '': 1, XML: 1, Text: 1, Body: 1 } - ; - - - XHR.prototype = { - status: 0, - statusText: '', - constructor: XHR, - - getResponseHeader: function (name){ - return this.xhr.getResponseHeader(name); - }, - - getAllResponseHeaders: function (){ - return this.xhr.getAllResponseHeaders() || {}; - }, - - end: function (status, statusText){ - var _this = this, options = _this.options; - - _this.end = - _this.abort = noop; - _this.status = status; - - if( statusText ){ - _this.statusText = statusText; - } - - api.log('xhr.end:', status, statusText); - options.complete(status == 200 || status == 201 ? false : _this.statusText || 'unknown', _this); - - if( _this.xhr && _this.xhr.node ){ - setTimeout(function (){ - var node = _this.xhr.node; - try { node.parentNode.removeChild(node); } catch (e){} - try { delete window[_this.uid]; } catch (e){} - window[_this.uid] = _this.xhr.node = null; - }, 9); - } - }, - - abort: function (){ - this.end(0, 'abort'); - - if( this.xhr ){ - this.xhr.aborted = true; - this.xhr.abort(); - } - }, - - send: function (FormData){ - var _this = this, options = this.options; - - FormData.toData(function (data){ - if( data instanceof Error ){ - _this.end(0, data.message); - } - else{ - // Start uploading - options.upload(options, _this); - _this._send.call(_this, options, data); - } - }, options); - }, - - _send: function (options, data){ - var _this = this, xhr, uid = _this.uid, onLoadFnName = _this.uid + "Load", url = options.url; - - api.log('XHR._send:', data); - - if( !options.cache ){ - // No cache - url += (~url.indexOf('?') ? '&' : '?') + api.uid(); - } - - if( data.nodeName ){ - var jsonp = options.jsonp; - - // prepare callback in GET - url = url.replace(/([a-z]+)=(\?)/i, '$1='+uid); - - // legacy - options.upload(options, _this); - - var - onPostMessage = function (evt){ - if( ~url.indexOf(evt.origin) ){ - try { - var result = api.parseJSON(evt.data); - if( result.id == uid ){ - complete(result.status, result.statusText, result.response); - } - } catch( err ){ - complete(0, err.message); - } - } - }, - - // jsonp-callack - complete = window[uid] = function (status, statusText, response){ - _this.readyState = 4; - _this.responseText = response; - _this.end(status, statusText); - - api.event.off(window, 'message', onPostMessage); - window[uid] = xhr = transport = window[onLoadFnName] = null; - } - ; - - _this.xhr.abort = function (){ - try { - if( transport.stop ){ transport.stop(); } - else if( transport.contentWindow.stop ){ transport.contentWindow.stop(); } - else { transport.contentWindow.document.execCommand('Stop'); } - } - catch (er) {} - complete(0, "abort"); - }; - - api.event.on(window, 'message', onPostMessage); - - window[onLoadFnName] = function (){ - try { - var - win = transport.contentWindow - , doc = win.document - , result = win.result || api.parseJSON(doc.body.innerHTML) - ; - complete(result.status, result.statusText, result.response); - } catch (e){ - api.log('[transport.onload]', e); - } - }; - - xhr = document.createElement('div'); - xhr.innerHTML = '
    ' - + '' - + (jsonp && (options.url.indexOf('=?') < 0) ? '' : '') - + '' - ; - - // get form-data & transport - var - form = xhr.getElementsByTagName('form')[0] - , transport = xhr.getElementsByTagName('iframe')[0] - ; - - form.appendChild(data); - - api.log(form.parentNode.innerHTML); - - // append to DOM - document.body.appendChild(xhr); - - // keep a reference to node-transport - _this.xhr.node = xhr; - - // send - _this.readyState = 2; // loaded - try { - form.submit(); - } catch (err) { - api.log('iframe.error: ' + err); - } - form = null; - } - else { - // Clean url - url = url.replace(/([a-z]+)=(\?)&?/i, ''); - - // html5 - if (this.xhr && this.xhr.aborted) { - api.log("Error: already aborted"); - return; - } - xhr = _this.xhr = api.getXHR(); - - if (data.params) { - url += (url.indexOf('?') < 0 ? "?" : "&") + data.params.join("&"); - } - - xhr.open('POST', url, true); - - if( api.withCredentials ){ - xhr.withCredentials = "true"; - } - - if( !options.headers || !options.headers['X-Requested-With'] ){ - xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - } - - api.each(options.headers, function (val, key){ - xhr.setRequestHeader(key, val); - }); - - - if ( options._chunked ) { - // chunked upload - if( xhr.upload ){ - xhr.upload.addEventListener('progress', api.throttle(function (/**Event*/evt){ - if (!data.retry) { - // show progress only for correct chunk uploads - options.progress({ - type: evt.type - , total: data.size - , loaded: data.start + evt.loaded - , totalSize: data.size - }, _this, options); - } - }, 100), false); - } - - xhr.onreadystatechange = function (){ - var lkb = parseInt(xhr.getResponseHeader('X-Last-Known-Byte'), 10); - - _this.status = xhr.status; - _this.statusText = xhr.statusText; - _this.readyState = xhr.readyState; - - if( xhr.readyState == 4 ){ - for( var k in _xhrResponsePostfix ){ - _this['response'+k] = xhr['response'+k]; - } - xhr.onreadystatechange = null; - - if (!xhr.status || xhr.status - 201 > 0) { - api.log("Error: " + xhr.status); - // some kind of error - // 0 - connection fail or timeout, if xhr.aborted is true, then it's not recoverable user action - // up - server error - if (((!xhr.status && !xhr.aborted) || 500 == xhr.status || 416 == xhr.status) && ++data.retry <= options.chunkUploadRetry) { - // let's try again the same chunk - // only applicable for recoverable error codes 500 && 416 - var delay = xhr.status ? 0 : api.chunkNetworkDownRetryTimeout; - - // inform about recoverable problems - options.pause(data.file, options); - - // smart restart if server reports about the last known byte - api.log("X-Last-Known-Byte: " + lkb); - if (lkb) { - data.end = lkb; - } else { - data.end = data.start - 1; - if (416 == xhr.status) { - data.end = data.end - options.chunkSize; - } - } - - setTimeout(function () { - _this._send(options, data); - }, delay); - } else { - // no mo retries - _this.end(xhr.status); - } - } else { - // success - data.retry = 0; - - if (data.end == data.size - 1) { - // finished - _this.end(xhr.status); - } else { - // next chunk - - // shift position if server reports about the last known byte - api.log("X-Last-Known-Byte: " + lkb); - if (lkb) { - data.end = lkb; - } - data.file.FileAPIReadPosition = data.end; - - setTimeout(function () { - _this._send(options, data); - }, 0); - } - } - - xhr = null; - } - }; - - data.start = data.end + 1; - data.end = Math.max(Math.min(data.start + options.chunkSize, data.size) - 1, data.start); - - // Retrieve a slice of file - var - file = data.file - , slice = (file.slice || file.mozSlice || file.webkitSlice).call(file, data.start, data.end + 1) - ; - - if( data.size && !slice.size ){ - setTimeout(function (){ - _this.end(-1); - }); - } else { - xhr.setRequestHeader("Content-Range", "bytes " + data.start + "-" + data.end + "/" + data.size); - xhr.setRequestHeader("Content-Disposition", 'attachment; filename=' + encodeURIComponent(data.name)); - xhr.setRequestHeader("Content-Type", data.type || "application/octet-stream"); - - xhr.send(slice); - } - - file = slice = null; - } else { - // single piece upload - if( xhr.upload ){ - // https://github.com/blueimp/jQuery-File-Upload/wiki/Fixing-Safari-hanging-on-very-high-speed-connections-%281Gbps%29 - xhr.upload.addEventListener('progress', api.throttle(function (/**Event*/evt){ - options.progress(evt, _this, options); - }, 100), false); - } - - xhr.onreadystatechange = function (){ - _this.status = xhr.status; - _this.statusText = xhr.statusText; - _this.readyState = xhr.readyState; - - if( xhr.readyState == 4 ){ - for( var k in _xhrResponsePostfix ){ - _this['response'+k] = xhr['response'+k]; - } - xhr.onreadystatechange = null; - - if (!xhr.status || xhr.status > 201) { - api.log("Error: " + xhr.status); - if (((!xhr.status && !xhr.aborted) || 500 == xhr.status) && (options.retry || 0) < options.uploadRetry) { - options.retry = (options.retry || 0) + 1; - var delay = api.networkDownRetryTimeout; - - // inform about recoverable problems - options.pause(options.file, options); - - setTimeout(function () { - _this._send(options, data); - }, delay); - } else { - //success - _this.end(xhr.status); - } - } else { - //success - _this.end(xhr.status); - } - - xhr = null; - } - }; - - if( api.isArray(data) ){ - // multipart - xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary=_'+api.expando); - var rawData = data.join('') +'--_'+ api.expando +'--'; - - /** @namespace xhr.sendAsBinary https://developer.mozilla.org/ru/XMLHttpRequest#Sending_binary_content */ - if( xhr.sendAsBinary ){ - xhr.sendAsBinary(rawData); - } - else { - var bytes = Array.prototype.map.call(rawData, function(c){ return c.charCodeAt(0) & 0xff; }); - xhr.send(new Uint8Array(bytes).buffer); - - } - } else { - // FormData - xhr.send(data); - } - } - } - } - }; - - - // @export - api.XHR = XHR; -})(window, FileAPI); - -/** - * @class FileAPI.Camera - * @author RubaXa - * @support Chrome 21+, FF 18+, Opera 12+ - */ - -/*global window, FileAPI, jQuery */ -/** @namespace LocalMediaStream -- https://developer.mozilla.org/en-US/docs/WebRTC/MediaStream_API#LocalMediaStream */ -(function (window, api){ - "use strict"; - - var - URL = window.URL || window.webkitURL, - - document = window.document, - navigator = window.navigator, - - getMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia, - - html5 = !!getMedia - ; - - - // Support "media" - api.support.media = html5; - - - var Camera = function (video){ - this.video = video; - }; - - - Camera.prototype = { - isActive: function (){ - return !!this._active; - }, - - - /** - * Start camera streaming - * @param {Function} callback - */ - start: function (callback){ - var - _this = this - , video = _this.video - , _successId - , _failId - , _complete = function (err){ - _this._active = !err; - clearTimeout(_failId); - clearTimeout(_successId); -// api.event.off(video, 'loadedmetadata', _complete); - callback && callback(err, _this); - } - ; - - getMedia.call(navigator, { video: true }, function (stream/**LocalMediaStream*/){ - // Success - _this.stream = stream; - -// api.event.on(video, 'loadedmetadata', function (){ -// _complete(null); -// }); - - // Set camera stream - video.src = URL.createObjectURL(stream); - - // Note: onloadedmetadata doesn't fire in Chrome when using it with getUserMedia. - // See crbug.com/110938. - _successId = setInterval(function (){ - if( _detectVideoSignal(video) ){ - _complete(null); - } - }, 1000); - - _failId = setTimeout(function (){ - _complete('timeout'); - }, 5000); - - // Go-go-go! - video.play(); - }, _complete/*error*/); - }, - - - /** - * Stop camera streaming - */ - stop: function (){ - try { - this._active = false; - this.video.pause(); - - try { - this.stream.stop(); - } catch (err) { - api.each(this.stream.getTracks(), function (track) { - track.stop(); - }); - } - - this.stream = null; - } catch( err ){ - api.log('[FileAPI.Camera] stop:', err); - } - }, - - - /** - * Create screenshot - * @return {FileAPI.Camera.Shot} - */ - shot: function (){ - return new Shot(this.video); - } - }; - - - /** - * Get camera element from container - * - * @static - * @param {HTMLElement} el - * @return {Camera} - */ - Camera.get = function (el){ - return new Camera(el.firstChild); - }; - - - /** - * Publish camera element into container - * - * @static - * @param {HTMLElement} el - * @param {Object} options - * @param {Function} [callback] - */ - Camera.publish = function (el, options, callback){ - if( typeof options == 'function' ){ - callback = options; - options = {}; - } - - // Dimensions of "camera" - options = api.extend({}, { - width: '100%' - , height: '100%' - , start: true - }, options); - - - if( el.jquery ){ - // Extract first element, from jQuery collection - el = el[0]; - } - - - var doneFn = function (err){ - if( err ){ - callback(err); - } - else { - // Get camera - var cam = Camera.get(el); - if( options.start ){ - cam.start(callback); - } - else { - callback(null, cam); - } - } - }; - - - el.style.width = _px(options.width); - el.style.height = _px(options.height); - - - if( api.html5 && html5 ){ - // Create video element - var video = document.createElement('video'); - - // Set dimensions - video.style.width = _px(options.width); - video.style.height = _px(options.height); - - // Clean container - if( window.jQuery ){ - jQuery(el).empty(); - } else { - el.innerHTML = ''; - } - - // Add "camera" to container - el.appendChild(video); - - // end - doneFn(); - } - else { - Camera.fallback(el, options, doneFn); - } - }; - - - Camera.fallback = function (el, options, callback){ - callback('not_support_camera'); - }; - - - /** - * @class FileAPI.Camera.Shot - */ - var Shot = function (video){ - var canvas = video.nodeName ? api.Image.toCanvas(video) : video; - var shot = api.Image(canvas); - shot.type = 'image/png'; - shot.width = canvas.width; - shot.height = canvas.height; - shot.size = canvas.width * canvas.height * 4; - return shot; - }; - - - /** - * Add "px" postfix, if value is a number - * - * @private - * @param {*} val - * @return {String} - */ - function _px(val){ - return val >= 0 ? val + 'px' : val; - } - - - /** - * @private - * @param {HTMLVideoElement} video - * @return {Boolean} - */ - function _detectVideoSignal(video){ - var canvas = document.createElement('canvas'), ctx, res = false; - try { - ctx = canvas.getContext('2d'); - ctx.drawImage(video, 0, 0, 1, 1); - res = ctx.getImageData(0, 0, 1, 1).data[4] != 255; - } - catch( err ){ - api.log('[FileAPI.Camera] detectVideoSignal:', err); - } - return res; - } - - - // @export - Camera.Shot = Shot; - api.Camera = Camera; -})(window, FileAPI); - -/** - * FileAPI fallback to Flash - * - * @flash-developer "Vladimir Demidov" - */ - -/*global window, ActiveXObject, FileAPI */ -(function (window, jQuery, api) { - "use strict"; - - var - document = window.document - , location = window.location - , navigator = window.navigator - , _each = api.each - ; - - - api.support.flash = (function (){ - var mime = navigator.mimeTypes, has = false; - - if( navigator.plugins && typeof navigator.plugins['Shockwave Flash'] == 'object' ){ - has = navigator.plugins['Shockwave Flash'].description && !(mime && mime['application/x-shockwave-flash'] && !mime['application/x-shockwave-flash'].enabledPlugin); - } - else { - try { - has = !!(window.ActiveXObject && new ActiveXObject('ShockwaveFlash.ShockwaveFlash')); - } - catch(er){ - api.log('Flash -- does not supported.'); - } - } - - if( has && /^file:/i.test(location) ){ - api.log('[warn] Flash does not work on `file:` protocol.'); - } - - return has; - })(); - - - api.support.flash - && (0 - || !api.html5 || !api.support.html5 - || (api.cors && !api.support.cors) - || (api.media && !api.support.media) - ) - && (function (){ - var - _attr = api.uid() - , _retry = 0 - , _files = {} - , _rhttp = /^https?:/i - - , flash = { - _fn: {}, - - - /** - * Initialization & preload flash object - */ - init: function (){ - var child = document.body && document.body.firstChild; - - if( child ){ - do { - if( child.nodeType == 1 ){ - api.log('FlashAPI.state: awaiting'); - - var dummy = document.createElement('div'); - - dummy.id = '_' + _attr; - - _css(dummy, { - top: 1 - , right: 1 - , width: 5 - , height: 5 - , position: 'absolute' - , zIndex: 2147483647+'' // set max zIndex - }); - - child.parentNode.insertBefore(dummy, child); - flash.publish(dummy, _attr); - - return; - } - } - while( child = child.nextSibling ); - } - - if( _retry < 10 ){ - setTimeout(flash.init, ++_retry*50); - } - }, - - - /** - * Publish flash-object - * - * @param {HTMLElement} el - * @param {String} id - * @param {Object} [opts] - */ - publish: function (el, id, opts){ - opts = opts || {}; - el.innerHTML = _makeFlashHTML({ - id: id - , src: _getUrl(api.flashUrl, 'r=' + api.version) -// , src: _getUrl('http://v.demidov.boom.corp.mail.ru/uploaderfileapi/FlashFileAPI.swf?1') - , wmode: opts.camera ? '' : 'transparent' - , flashvars: 'callback=' + (opts.onEvent || 'FileAPI.Flash.onEvent') - + '&flashId='+ id - + '&storeKey='+ navigator.userAgent.match(/\d/ig).join('') +'_'+ api.version - + (flash.isReady || (api.pingUrl ? '&ping='+api.pingUrl : '')) - + '&timeout='+api.flashAbortTimeout - + (opts.camera ? '&useCamera=' + _getUrl(api.flashWebcamUrl) : '') - + '&debug='+(api.debug?"1":"") - }, opts); - }, - - - ready: function (){ - api.log('FlashAPI.state: ready'); - - flash.ready = api.F; - flash.isReady = true; - flash.patch(); - flash.patchCamera && flash.patchCamera(); - api.event.on(document, 'mouseover', flash.mouseover); - api.event.on(document, 'click', function (evt){ - if( flash.mouseover(evt) ){ - evt.preventDefault - ? evt.preventDefault() - : (evt.returnValue = true) - ; - } - }); - }, - - - getEl: function (){ - return document.getElementById('_'+_attr); - }, - - - getWrapper: function (node){ - do { - if( /js-fileapi-wrapper/.test(node.className) ){ - return node; - } - } - while( (node = node.parentNode) && (node !== document.body) ); - }, - - - mouseover: function (evt){ - var target = api.event.fix(evt).target; - - if( /input/i.test(target.nodeName) && target.type == 'file' && !target.disabled ){ - var - state = target.getAttribute(_attr) - , wrapper = flash.getWrapper(target) - ; - - if( api.multiFlash ){ - // check state: - // p — published - // i — initialization - // r — ready - if( state == 'i' || state == 'r' ){ - // publish fail - return false; - } - else if( state != 'p' ){ - // set "init" state - target.setAttribute(_attr, 'i'); - - var dummy = document.createElement('div'); - - if( !wrapper ){ - api.log('[err] FlashAPI.mouseover: js-fileapi-wrapper not found'); - return; - } - - _css(dummy, { - top: 0 - , left: 0 - , width: target.offsetWidth - , height: target.offsetHeight - , zIndex: 2147483647+'' // set max zIndex - , position: 'absolute' - }); - - wrapper.appendChild(dummy); - flash.publish(dummy, api.uid()); - - // set "publish" state - target.setAttribute(_attr, 'p'); - } - - return true; - } - else if( wrapper ){ - // Use one flash element - var box = _getDimensions(wrapper); - - _css(flash.getEl(), box); - - // Set current input - flash.curInp = target; - } - } - else if( !/object|embed/i.test(target.nodeName) ){ - _css(flash.getEl(), { top: 1, left: 1, width: 5, height: 5 }); - } - }, - - onEvent: function (evt){ - var type = evt.type; - - if( type == 'ready' ){ - try { - // set "ready" state - flash.getInput(evt.flashId).setAttribute(_attr, 'r'); - } catch (e){ - } - - flash.ready(); - setTimeout(function (){ flash.mouseenter(evt); }, 50); - return true; - } - else if( type === 'ping' ){ - api.log('(flash -> js).ping:', [evt.status, evt.savedStatus], evt.error); - } - else if( type === 'log' ){ - api.log('(flash -> js).log:', evt.target); - } - else if( type in flash ){ - setTimeout(function (){ - api.log('FlashAPI.event.'+evt.type+':', evt); - flash[type](evt); - }, 1); - } - }, - - - mouseenter: function (evt){ - var node = flash.getInput(evt.flashId); - - if( node ){ - // Set multiple mode - flash.cmd(evt, 'multiple', node.getAttribute('multiple') != null); - - - // Set files filter - var accept = [], exts = {}; - - _each((node.getAttribute('accept') || '').split(/,\s*/), function (mime){ - api.accept[mime] && _each(api.accept[mime].split(' '), function (ext){ - exts[ext] = 1; - }); - }); - - _each(exts, function (i, ext){ - accept.push( ext ); - }); - - flash.cmd(evt, 'accept', accept.length ? accept.join(',')+','+accept.join(',').toUpperCase() : '*'); - } - }, - - - get: function (id){ - return document[id] || window[id] || document.embeds[id]; - }, - - - getInput: function (id){ - if( api.multiFlash ){ - try { - var node = flash.getWrapper(flash.get(id)); - if( node ){ - return node.getElementsByTagName('input')[0]; - } - } catch (e){ - api.log('[err] Can not find "input" by flashId:', id, e); - } - } else { - return flash.curInp; - } - }, - - - select: function (evt){ - var - inp = flash.getInput(evt.flashId) - , uid = api.uid(inp) - , files = evt.target.files - , event - ; - - _each(files, function (file){ - api.checkFileObj(file); - }); - - _files[uid] = files; - - if( document.createEvent ){ - event = document.createEvent('Event'); - event.files = files; - event.initEvent('change', true, true); - inp.dispatchEvent(event); - } - else if( jQuery ){ - jQuery(inp).trigger({ type: 'change', files: files }); - } - else { - event = document.createEventObject(); - event.files = files; - inp.fireEvent('onchange', event); - } - }, - - - cmd: function (id, name, data, last){ - try { - api.log('(js -> flash).'+name+':', data); - return flash.get(id.flashId || id).cmd(name, data); - } catch (err){ - api.log('(js -> flash).onError:', err.toString()); - if( !last ){ - // try again - setTimeout(function (){ flash.cmd(id, name, data, true); }, 50); - } - } - }, - - - patch: function (){ - api.flashEngine = true; - - // FileAPI - _inherit(api, { - getFiles: function (input, filter, callback){ - if( callback ){ - api.filterFiles(api.getFiles(input), filter, callback); - return null; - } - - var files = api.isArray(input) ? input : _files[api.uid(input.target || input.srcElement || input)]; - - - if( !files ){ - // Файлов нету, вызываем родительский метод - return this.parent.apply(this, arguments); - } - - - if( filter ){ - filter = api.getFilesFilter(filter); - files = api.filter(files, function (file){ return filter.test(file.name); }); - } - - return files; - }, - - - getInfo: function (file, fn){ - if( _isHtmlFile(file) ){ - this.parent.apply(this, arguments); - } - else if( file.isShot ){ - fn(null, file.info = { - width: file.width, - height: file.height - }); - } - else { - if( !file.__info ){ - var defer = file.__info = api.defer(); - - flash.cmd(file, 'getFileInfo', { - id: file.id - , callback: _wrap(function _(err, info){ - _unwrap(_); - defer.resolve(err, file.info = info); - }) - }); - } - - file.__info.then(fn); - } - } - }); - - - // FileAPI.Image - api.support.transform = true; - api.Image && _inherit(api.Image.prototype, { - get: function (fn, scaleMode){ - this.set({ scaleMode: scaleMode || 'noScale' }); // noScale, exactFit - return this.parent(fn); - }, - - _load: function (file, fn){ - api.log('FlashAPI.Image._load:', file); - - if( _isHtmlFile(file) ){ - this.parent.apply(this, arguments); - } - else { - var _this = this; - api.getInfo(file, function (err){ - fn.call(_this, err, file); - }); - } - }, - - _apply: function (file, fn){ - api.log('FlashAPI.Image._apply:', file); - - if( _isHtmlFile(file) ){ - this.parent.apply(this, arguments); - } - else { - var m = this.getMatrix(file.info), doneFn = fn; - - flash.cmd(file, 'imageTransform', { - id: file.id - , matrix: m - , callback: _wrap(function _(err, base64){ - api.log('FlashAPI.Image._apply.callback:', err); - _unwrap(_); - - if( err ){ - doneFn(err); - } - else if( !api.support.html5 && (!api.support.dataURI || base64.length > 3e4) ){ - _makeFlashImage({ - width: (m.deg % 180) ? m.dh : m.dw - , height: (m.deg % 180) ? m.dw : m.dh - , scale: m.scaleMode - }, base64, doneFn); - } - else { - if( m.filter ){ - doneFn = function (err, img){ - if( err ){ - fn(err); - } - else { - api.Image.applyFilter(img, m.filter, function (){ - fn(err, this.canvas); - }); - } - }; - } - - api.newImage('data:'+ file.type +';base64,'+ base64, doneFn); - } - }) - }); - } - }, - - toData: function (fn){ - var - file = this.file - , info = file.info - , matrix = this.getMatrix(info) - ; - api.log('FlashAPI.Image.toData'); - - if( _isHtmlFile(file) ){ - this.parent.apply(this, arguments); - } - else { - if( matrix.deg == 'auto' ){ - matrix.deg = api.Image.exifOrientation[info && info.exif && info.exif.Orientation] || 0; - } - - fn.call(this, !file.info, { - id: file.id - , flashId: file.flashId - , name: file.name - , type: file.type - , matrix: matrix - }); - } - } - }); - - - api.Image && _inherit(api.Image, { - fromDataURL: function (dataURL, size, callback){ - if( !api.support.dataURI || dataURL.length > 3e4 ){ - _makeFlashImage( - api.extend({ scale: 'exactFit' }, size) - , dataURL.replace(/^data:[^,]+,/, '') - , function (err, el){ callback(el); } - ); - } - else { - this.parent(dataURL, size, callback); - } - } - }); - - // FileAPI.Form - _inherit(api.Form.prototype, { - toData: function (fn){ - var items = this.items, i = items.length; - - for( ; i--; ){ - if( items[i].file && _isHtmlFile(items[i].blob) ){ - return this.parent.apply(this, arguments); - } - } - - api.log('FlashAPI.Form.toData'); - fn(items); - } - }); - - - // FileAPI.XHR - _inherit(api.XHR.prototype, { - _send: function (options, formData){ - if( - formData.nodeName - || formData.append && api.support.html5 - || api.isArray(formData) && (typeof formData[0] === 'string') - ){ - // HTML5, Multipart or IFrame - return this.parent.apply(this, arguments); - } - - - var - data = {} - , files = {} - , _this = this - , flashId - , fileId - ; - - _each(formData, function (item){ - if( item.file ){ - files[item.name] = item = _getFileDescr(item.blob); - fileId = item.id; - flashId = item.flashId; - } - else { - data[item.name] = item.blob; - } - }); - - if( !fileId ){ - flashId = _attr; - } - - if( !flashId ){ - api.log('[err] FlashAPI._send: flashId -- undefined'); - return this.parent.apply(this, arguments); - } - else { - api.log('FlashAPI.XHR._send: '+ flashId +' -> '+ fileId); - } - - _this.xhr = { - headers: {}, - abort: function (){ flash.cmd(flashId, 'abort', { id: fileId }); }, - getResponseHeader: function (name){ return this.headers[name]; }, - getAllResponseHeaders: function (){ return this.headers; } - }; - - var queue = api.queue(function (){ - flash.cmd(flashId, 'upload', { - url: _getUrl(options.url.replace(/([a-z]+)=(\?)&?/i, '')) - , data: data - , files: fileId ? files : null - , headers: options.headers || {} - , callback: _wrap(function upload(evt){ - var type = evt.type, result = evt.result; - - api.log('FlashAPI.upload.'+type); - - if( type == 'progress' ){ - evt.loaded = Math.min(evt.loaded, evt.total); // @todo fixme - evt.lengthComputable = true; - options.progress(evt); - } - else if( type == 'complete' ){ - _unwrap(upload); - - if( typeof result == 'string' ){ - _this.responseText = result.replace(/%22/g, "\"").replace(/%5c/g, "\\").replace(/%26/g, "&").replace(/%25/g, "%"); - } - - _this.end(evt.status || 200); - } - else if( type == 'abort' || type == 'error' ){ - _this.end(evt.status || 0, evt.message); - _unwrap(upload); - } - }) - }); - }); - - - // #2174: FileReference.load() call while FileReference.upload() or vice versa - _each(files, function (file){ - queue.inc(); - api.getInfo(file, queue.next); - }); - - queue.check(); - } - }); - } - } - ; - - - function _makeFlashHTML(opts){ - return ('' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '').replace(/#(\w+)#/ig, function (a, name){ return opts[name]; }) - ; - } - - - function _css(el, css){ - if( el && el.style ){ - var key, val; - for( key in css ){ - val = css[key]; - if( typeof val == 'number' ){ - val += 'px'; - } - try { el.style[key] = val; } catch (e) {} - } - } - } - - - function _inherit(obj, methods){ - _each(methods, function (fn, name){ - var prev = obj[name]; - obj[name] = function (){ - this.parent = prev; - return fn.apply(this, arguments); - }; - }); - } - - function _isHtmlFile(file){ - return file && !file.flashId; - } - - function _wrap(fn){ - var id = fn.wid = api.uid(); - flash._fn[id] = fn; - return 'FileAPI.Flash._fn.'+id; - } - - - function _unwrap(fn){ - try { - flash._fn[fn.wid] = null; - delete flash._fn[fn.wid]; - } - catch(e){} - } - - - function _getUrl(url, params){ - if( !_rhttp.test(url) ){ - if( /^\.\//.test(url) || '/' != url.charAt(0) ){ - var path = location.pathname; - path = path.substr(0, path.lastIndexOf('/')); - url = (path +'/'+ url).replace('/./', '/'); - } - - if( '//' != url.substr(0, 2) ){ - url = '//' + location.host + url; - } - - if( !_rhttp.test(url) ){ - url = location.protocol + url; - } - } - - if( params ){ - url += (/\?/.test(url) ? '&' : '?') + params; - } - - return url; - } - - - function _makeFlashImage(opts, base64, fn){ - var - key - , flashId = api.uid() - , el = document.createElement('div') - , attempts = 10 - ; - - for( key in opts ){ - el.setAttribute(key, opts[key]); - el[key] = opts[key]; - } - - _css(el, opts); - - opts.width = '100%'; - opts.height = '100%'; - - el.innerHTML = _makeFlashHTML(api.extend({ - id: flashId - , src: _getUrl(api.flashImageUrl, 'r='+ api.uid()) - , wmode: 'opaque' - , flashvars: 'scale='+ opts.scale +'&callback='+_wrap(function _(){ - _unwrap(_); - if( --attempts > 0 ){ - _setImage(); - } - return true; - }) - }, opts)); - - function _setImage(){ - try { - // Get flash-object by id - var img = flash.get(flashId); - img.setImage(base64); - } catch (e){ - api.log('[err] FlashAPI.Preview.setImage -- can not set "base64":', e); - } - } - - fn(false, el); - el = null; - } - - - function _getFileDescr(file){ - return { - id: file.id - , name: file.name - , matrix: file.matrix - , flashId: file.flashId - }; - } - - - function _getDimensions(el){ - var - box = el.getBoundingClientRect() - , body = document.body - , docEl = (el && el.ownerDocument).documentElement - ; - - return { - top: box.top + (window.pageYOffset || docEl.scrollTop) - (docEl.clientTop || body.clientTop || 0) - , left: box.left + (window.pageXOffset || docEl.scrollLeft) - (docEl.clientLeft || body.clientLeft || 0) - , width: box.right - box.left - , height: box.bottom - box.top - }; - } - - // @export - api.Flash = flash; - - - // Check dataURI support - api.newImage('data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==', function (err, img){ - api.support.dataURI = !(img.width != 1 || img.height != 1); - flash.init(); - }); - })(); -})(window, window.jQuery, FileAPI); - -/** - * FileAPI fallback to Flash - * - * @flash-developer "Vladimir Demidov" - */ - -/*global window, FileAPI */ -(function (window, jQuery, api) { - "use strict"; - - var _each = api.each, - _cameraQueue = []; - - if (api.support.flash && (api.media && (!api.support.media || !api.html5))) { - (function () { - function _wrap(fn) { - var id = fn.wid = api.uid(); - api.Flash._fn[id] = fn; - return 'FileAPI.Flash._fn.' + id; - } - - - function _unwrap(fn) { - try { - api.Flash._fn[fn.wid] = null; - delete api.Flash._fn[fn.wid]; - } catch (e) { - } - } - - var flash = api.Flash; - api.extend(api.Flash, { - - patchCamera: function () { - api.Camera.fallback = function (el, options, callback) { - var camId = api.uid(); - api.log('FlashAPI.Camera.publish: ' + camId); - flash.publish(el, camId, api.extend(options, { - camera: true, - onEvent: _wrap(function _(evt) { - if (evt.type === 'camera') { - _unwrap(_); - - if (evt.error) { - api.log('FlashAPI.Camera.publish.error: ' + evt.error); - callback(evt.error); - } else { - api.log('FlashAPI.Camera.publish.success: ' + camId); - callback(null); - } - } - }) - })); - }; - // Run - _each(_cameraQueue, function (args) { - api.Camera.fallback.apply(api.Camera, args); - }); - _cameraQueue = []; - - - // FileAPI.Camera:proto - api.extend(api.Camera.prototype, { - _id: function () { - return this.video.id; - }, - - start: function (callback) { - var _this = this; - flash.cmd(this._id(), 'camera.on', { - callback: _wrap(function _(evt) { - _unwrap(_); - - if (evt.error) { - api.log('FlashAPI.camera.on.error: ' + evt.error); - callback(evt.error, _this); - } else { - api.log('FlashAPI.camera.on.success: ' + _this._id()); - _this._active = true; - callback(null, _this); - } - }) - }); - }, - - stop: function () { - this._active = false; - flash.cmd(this._id(), 'camera.off'); - }, - - shot: function () { - api.log('FlashAPI.Camera.shot:', this._id()); - - var shot = api.Flash.cmd(this._id(), 'shot', {}); - shot.type = 'image/png'; - shot.flashId = this._id(); - shot.isShot = true; - - return new api.Camera.Shot(shot); - } - }); - } - }); - - api.Camera.fallback = function () { - _cameraQueue.push(arguments); - }; - - }()); - } -}(window, window.jQuery, FileAPI)); +/*! FileAPI 2.0.19 - BSD | git://github.com/mailru/FileAPI.git + * FileAPI — a set of javascript tools for working with files. Multiupload, drag'n'drop and chunked file upload. Images: crop, resize and auto orientation by EXIF. + */ + +/* + * JavaScript Canvas to Blob 2.0.5 + * https://github.com/blueimp/JavaScript-Canvas-to-Blob + * + * Copyright 2012, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * http://www.opensource.org/licenses/MIT + * + * Based on stackoverflow user Stoive's code snippet: + * http://stackoverflow.com/q/4998908 + */ + +/*jslint nomen: true, regexp: true */ +/*global window, atob, Blob, ArrayBuffer, Uint8Array */ + +(function (window) { + 'use strict'; + var CanvasPrototype = window.HTMLCanvasElement && + window.HTMLCanvasElement.prototype, + hasBlobConstructor = window.Blob && (function () { + try { + return Boolean(new Blob()); + } catch (e) { + return false; + } + }()), + hasArrayBufferViewSupport = hasBlobConstructor && window.Uint8Array && + (function () { + try { + return new Blob([new Uint8Array(100)]).size === 100; + } catch (e) { + return false; + } + }()), + BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || + window.MozBlobBuilder || window.MSBlobBuilder, + dataURLtoBlob = (hasBlobConstructor || BlobBuilder) && window.atob && + window.ArrayBuffer && window.Uint8Array && function (dataURI) { + var byteString, + arrayBuffer, + intArray, + i, + mimeString, + bb; + if (dataURI.split(',')[0].indexOf('base64') >= 0) { + // Convert base64 to raw binary data held in a string: + byteString = atob(dataURI.split(',')[1]); + } else { + // Convert base64/URLEncoded data component to raw binary data: + byteString = decodeURIComponent(dataURI.split(',')[1]); + } + // Write the bytes of the string to an ArrayBuffer: + arrayBuffer = new ArrayBuffer(byteString.length); + intArray = new Uint8Array(arrayBuffer); + for (i = 0; i < byteString.length; i += 1) { + intArray[i] = byteString.charCodeAt(i); + } + // Separate out the mime component: + mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; + // Write the ArrayBuffer (or ArrayBufferView) to a blob: + if (hasBlobConstructor) { + return new Blob( + [hasArrayBufferViewSupport ? intArray : arrayBuffer], + {type: mimeString} + ); + } + bb = new BlobBuilder(); + bb.append(arrayBuffer); + return bb.getBlob(mimeString); + }; + if (window.HTMLCanvasElement && !CanvasPrototype.toBlob) { + if (CanvasPrototype.mozGetAsFile) { + CanvasPrototype.toBlob = function (callback, type, quality) { + if (quality && CanvasPrototype.toDataURL && dataURLtoBlob) { + callback(dataURLtoBlob(this.toDataURL(type, quality))); + } else { + callback(this.mozGetAsFile('blob', type)); + } + }; + } else if (CanvasPrototype.toDataURL && dataURLtoBlob) { + CanvasPrototype.toBlob = function (callback, type, quality) { + callback(dataURLtoBlob(this.toDataURL(type, quality))); + }; + } + } + window.dataURLtoBlob = dataURLtoBlob; +})(window); + +/*jslint evil: true */ +/*global window, URL, webkitURL, ActiveXObject */ + +(function (window, undef){ + 'use strict'; + + var + gid = 1, + noop = function (){}, + + document = window.document, + doctype = document.doctype || {}, + userAgent = window.navigator.userAgent, + safari = /safari\//i.test(userAgent) && !/chrome\//i.test(userAgent), + iemobile = /iemobile\//i.test(userAgent), + + // https://github.com/blueimp/JavaScript-Load-Image/blob/master/load-image.js#L48 + apiURL = (window.createObjectURL && window) || (window.URL && URL.revokeObjectURL && URL) || (window.webkitURL && webkitURL), + + Blob = window.Blob, + File = window.File, + FileReader = window.FileReader, + FormData = window.FormData, + + + XMLHttpRequest = window.XMLHttpRequest, + jQuery = window.jQuery, + + html5 = !!(File && (FileReader && (window.Uint8Array || FormData || XMLHttpRequest.prototype.sendAsBinary))) + && !(safari && /windows/i.test(userAgent) && !iemobile), // BugFix: https://github.com/mailru/FileAPI/issues/25 + + cors = html5 && ('withCredentials' in (new XMLHttpRequest)), + + chunked = html5 && !!Blob && !!(Blob.prototype.webkitSlice || Blob.prototype.mozSlice || Blob.prototype.slice), + + normalize = ('' + ''.normalize).indexOf('[native code]') > 0, + + // https://github.com/blueimp/JavaScript-Canvas-to-Blob + dataURLtoBlob = window.dataURLtoBlob, + + + _rimg = /img/i, + _rcanvas = /canvas/i, + _rimgcanvas = /img|canvas/i, + _rinput = /input/i, + _rdata = /^data:[^,]+,/, + + _toString = {}.toString, + _supportConsoleLog, + _supportConsoleLogApply, + + + Math = window.Math, + + _SIZE_CONST = function (pow){ + pow = new window.Number(Math.pow(1024, pow)); + pow.from = function (sz){ return Math.round(sz * this); }; + return pow; + }, + + _elEvents = {}, // element event listeners + _infoReader = [], // list of file info processors + + _readerEvents = 'abort progress error load loadend', + _xhrPropsExport = 'status statusText readyState response responseXML responseText responseBody'.split(' '), + + currentTarget = 'currentTarget', // for minimize + preventDefault = 'preventDefault', // and this too + + _isArray = function (ar) { + return ar && ('length' in ar); + }, + + /** + * Iterate over a object or array + */ + _each = function (obj, fn, ctx){ + if( obj ){ + if( _isArray(obj) ){ + for( var i = 0, n = obj.length; i < n; i++ ){ + if( i in obj ){ + fn.call(ctx, obj[i], i, obj); + } + } + } + else { + for( var key in obj ){ + if( obj.hasOwnProperty(key) ){ + fn.call(ctx, obj[key], key, obj); + } + } + } + } + }, + + /** + * Merge the contents of two or more objects together into the first object + */ + _extend = function (dst){ + var args = arguments, i = 1, _ext = function (val, key){ dst[key] = val; }; + for( ; i < args.length; i++ ){ + _each(args[i], _ext); + } + return dst; + }, + + /** + * Add event listener + */ + _on = function (el, type, fn){ + if( el ){ + var uid = api.uid(el); + + if( !_elEvents[uid] ){ + _elEvents[uid] = {}; + } + + var isFileReader = (FileReader && el) && (el instanceof FileReader); + _each(type.split(/\s+/), function (type){ + if( jQuery && !isFileReader){ + jQuery.event.add(el, type, fn); + } else { + if( !_elEvents[uid][type] ){ + _elEvents[uid][type] = []; + } + + _elEvents[uid][type].push(fn); + + if( el.addEventListener ){ el.addEventListener(type, fn, false); } + else if( el.attachEvent ){ el.attachEvent('on'+type, fn); } + else { el['on'+type] = fn; } + } + }); + } + }, + + + /** + * Remove event listener + */ + _off = function (el, type, fn){ + if( el ){ + var uid = api.uid(el), events = _elEvents[uid] || {}; + + var isFileReader = (FileReader && el) && (el instanceof FileReader); + _each(type.split(/\s+/), function (type){ + if( jQuery && !isFileReader){ + jQuery.event.remove(el, type, fn); + } + else { + var fns = events[type] || [], i = fns.length; + + while( i-- ){ + if( fns[i] === fn ){ + fns.splice(i, 1); + break; + } + } + + if( el.addEventListener ){ el.removeEventListener(type, fn, false); } + else if( el.detachEvent ){ el.detachEvent('on'+type, fn); } + else { el['on'+type] = null; } + } + }); + } + }, + + + _one = function(el, type, fn){ + _on(el, type, function _(evt){ + _off(el, type, _); + fn(evt); + }); + }, + + + _fixEvent = function (evt){ + if( !evt.target ){ evt.target = window.event && window.event.srcElement || document; } + if( evt.target.nodeType === 3 ){ evt.target = evt.target.parentNode; } + return evt; + }, + + + _supportInputAttr = function (attr){ + var input = document.createElement('input'); + input.setAttribute('type', "file"); + return attr in input; + }, + + + /** + * FileAPI (core object) + */ + api = { + version: '2.0.19', + + cors: false, + html5: true, + media: false, + formData: true, + multiPassResize: true, + + debug: false, + pingUrl: false, + multiFlash: false, + flashAbortTimeout: 0, + withCredentials: true, + + staticPath: './dist/', + + flashUrl: 0, // @default: './FileAPI.flash.swf' + flashImageUrl: 0, // @default: './FileAPI.flash.image.swf' + + postNameConcat: function (name, idx){ + return name + (idx != null ? '['+ idx +']' : ''); + }, + + ext2mime: { + jpg: 'image/jpeg' + , tif: 'image/tiff' + , txt: 'text/plain' + }, + + // Fallback for flash + accept: { + 'image/*': 'art bm bmp dwg dxf cbr cbz fif fpx gif ico iefs jfif jpe jpeg jpg jps jut mcf nap nif pbm pcx pgm pict pm png pnm qif qtif ras rast rf rp svf tga tif tiff xbm xbm xpm xwd' + , 'audio/*': 'm4a flac aac rm mpa wav wma ogg mp3 mp2 m3u mod amf dmf dsm far gdm imf it m15 med okt s3m stm sfx ult uni xm sid ac3 dts cue aif aiff wpl ape mac mpc mpp shn wv nsf spc gym adplug adx dsp adp ymf ast afc hps xs' + , 'video/*': 'm4v 3gp nsv ts ty strm rm rmvb m3u ifo mov qt divx xvid bivx vob nrg img iso pva wmv asf asx ogm m2v avi bin dat dvr-ms mpg mpeg mp4 mkv avc vp3 svq3 nuv viv dv fli flv wpl' + }, + + uploadRetry : 0, + networkDownRetryTimeout : 5000, // milliseconds, don't flood when network is down + + chunkSize : 0, + chunkUploadRetry : 0, + chunkNetworkDownRetryTimeout : 2000, // milliseconds, don't flood when network is down + + KB: _SIZE_CONST(1), + MB: _SIZE_CONST(2), + GB: _SIZE_CONST(3), + TB: _SIZE_CONST(4), + + EMPTY_PNG: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=', + + expando: 'fileapi' + (new Date).getTime(), + + uid: function (obj){ + return obj + ? (obj[api.expando] = obj[api.expando] || api.uid()) + : (++gid, api.expando + gid) + ; + }, + + log: function (){ + if( api.debug && _supportConsoleLog ){ + if( _supportConsoleLogApply ){ + console.log.apply(console, arguments); + } + else { + console.log([].join.call(arguments, ' ')); + } + } + }, + + /** + * Create new image + * + * @param {String} [src] + * @param {Function} [fn] 1. error -- boolean, 2. img -- Image element + * @returns {HTMLElement} + */ + newImage: function (src, fn){ + var img = document.createElement('img'); + if( fn ){ + api.event.one(img, 'error load', function (evt){ + fn(evt.type == 'error', img); + img = null; + }); + } + img.src = src; + return img; + }, + + /** + * Get XHR + * @returns {XMLHttpRequest} + */ + getXHR: function (){ + var xhr; + + if( XMLHttpRequest ){ + xhr = new XMLHttpRequest; + } + else if( window.ActiveXObject ){ + try { + xhr = new ActiveXObject('MSXML2.XMLHttp.3.0'); + } catch (e) { + xhr = new ActiveXObject('Microsoft.XMLHTTP'); + } + } + + return xhr; + }, + + isArray: _isArray, + + support: { + dnd: cors && ('ondrop' in document.createElement('div')), + cors: cors, + html5: html5, + chunked: chunked, + dataURI: true, + accept: _supportInputAttr('accept'), + multiple: _supportInputAttr('multiple') + }, + + event: { + on: _on + , off: _off + , one: _one + , fix: _fixEvent + }, + + + throttle: function(fn, delay) { + var id, args; + + return function _throttle(){ + args = arguments; + + if( !id ){ + fn.apply(window, args); + id = setTimeout(function (){ + id = 0; + fn.apply(window, args); + }, delay); + } + }; + }, + + + F: function (){}, + + + parseJSON: function (str){ + var json; + if( window.JSON && JSON.parse ){ + json = JSON.parse(str); + } + else { + json = (new Function('return ('+str.replace(/([\r\n])/g, '\\$1')+');'))(); + } + return json; + }, + + + trim: function (str){ + str = String(str); + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); + }, + + /** + * Simple Defer + * @return {Object} + */ + defer: function (){ + var + list = [] + , result + , error + , defer = { + resolve: function (err, res){ + defer.resolve = noop; + error = err || false; + result = res; + + while( res = list.shift() ){ + res(error, result); + } + }, + + then: function (fn){ + if( error !== undef ){ + fn(error, result); + } else { + list.push(fn); + } + } + }; + + return defer; + }, + + queue: function (fn){ + var + _idx = 0 + , _length = 0 + , _fail = false + , _end = false + , queue = { + inc: function (){ + _length++; + }, + + next: function (){ + _idx++; + setTimeout(queue.check, 0); + }, + + check: function (){ + (_idx >= _length) && !_fail && queue.end(); + }, + + isFail: function (){ + return _fail; + }, + + fail: function (){ + !_fail && fn(_fail = true); + }, + + end: function (){ + if( !_end ){ + _end = true; + fn(); + } + } + } + ; + return queue; + }, + + + /** + * For each object + * + * @param {Object|Array} obj + * @param {Function} fn + * @param {*} [ctx] + */ + each: _each, + + + /** + * Async for + * @param {Array} array + * @param {Function} callback + */ + afor: function (array, callback){ + var i = 0, n = array.length; + + if( _isArray(array) && n-- ){ + (function _next(){ + callback(n != i && _next, array[i], i++); + })(); + } + else { + callback(false); + } + }, + + + /** + * Merge the contents of two or more objects together into the first object + * + * @param {Object} dst + * @return {Object} + */ + extend: _extend, + + + /** + * Is file? + * @param {File} file + * @return {Boolean} + */ + isFile: function (file){ + return _toString.call(file) === '[object File]'; + }, + + + /** + * Is blob? + * @param {Blob} blob + * @returns {Boolean} + */ + isBlob: function (blob) { + return this.isFile(blob) || (_toString.call(blob) === '[object Blob]'); + }, + + + /** + * Is canvas element + * + * @param {HTMLElement} el + * @return {Boolean} + */ + isCanvas: function (el){ + return el && _rcanvas.test(el.nodeName); + }, + + + getFilesFilter: function (filter){ + filter = typeof filter == 'string' ? filter : (filter.getAttribute && filter.getAttribute('accept') || ''); + return filter ? new RegExp('('+ filter.replace(/\./g, '\\.').replace(/,/g, '|') +')$', 'i') : /./; + }, + + + + /** + * Read as DataURL + * + * @param {File|Element} file + * @param {Function} fn + */ + readAsDataURL: function (file, fn){ + if( api.isCanvas(file) ){ + _emit(file, fn, 'load', api.toDataURL(file)); + } + else { + _readAs(file, fn, 'DataURL'); + } + }, + + + /** + * Read as Binary string + * + * @param {File} file + * @param {Function} fn + */ + readAsBinaryString: function (file, fn){ + if( _hasSupportReadAs('BinaryString') ){ + _readAs(file, fn, 'BinaryString'); + } else { + // Hello IE10! + _readAs(file, function (evt){ + if( evt.type == 'load' ){ + try { + // dataURL -> binaryString + evt.result = api.toBinaryString(evt.result); + } catch (e){ + evt.type = 'error'; + evt.message = e.toString(); + } + } + fn(evt); + }, 'DataURL'); + } + }, + + + /** + * Read as ArrayBuffer + * + * @param {File} file + * @param {Function} fn + */ + readAsArrayBuffer: function(file, fn){ + _readAs(file, fn, 'ArrayBuffer'); + }, + + + /** + * Read as text + * + * @param {File} file + * @param {String} encoding + * @param {Function} [fn] + */ + readAsText: function(file, encoding, fn){ + if( !fn ){ + fn = encoding; + encoding = 'utf-8'; + } + + _readAs(file, fn, 'Text', encoding); + }, + + + /** + * Convert image or canvas to DataURL + * + * @param {Element} el Image or Canvas element + * @param {String} [type] mime-type + * @return {String} + */ + toDataURL: function (el, type){ + if( typeof el == 'string' ){ + return el; + } + else if( el.toDataURL ){ + return el.toDataURL(type || 'image/png'); + } + }, + + + /** + * Canvert string, image or canvas to binary string + * + * @param {String|Element} val + * @return {String} + */ + toBinaryString: function (val){ + return window.atob(api.toDataURL(val).replace(_rdata, '')); + }, + + + /** + * Read file or DataURL as ImageElement + * + * @param {File|String} file + * @param {Function} fn + * @param {Boolean} [progress] + */ + readAsImage: function (file, fn, progress){ + if( api.isBlob(file) ){ + if( apiURL ){ + /** @namespace apiURL.createObjectURL */ + var data = apiURL.createObjectURL(file); + if( data === undef ){ + _emit(file, fn, 'error'); + } + else { + api.readAsImage(data, fn, progress); + } + } + else { + api.readAsDataURL(file, function (evt){ + if( evt.type == 'load' ){ + api.readAsImage(evt.result, fn, progress); + } + else if( progress || evt.type == 'error' ){ + _emit(file, fn, evt, null, { loaded: evt.loaded, total: evt.total }); + } + }); + } + } + else if( api.isCanvas(file) ){ + _emit(file, fn, 'load', file); + } + else if( _rimg.test(file.nodeName) ){ + if( file.complete ){ + _emit(file, fn, 'load', file); + } + else { + var events = 'error abort load'; + _one(file, events, function _fn(evt){ + if( evt.type == 'load' && apiURL ){ + /** @namespace apiURL.revokeObjectURL */ + apiURL.revokeObjectURL(file.src); + } + + _off(file, events, _fn); + _emit(file, fn, evt, file); + }); + } + } + else if( file.iframe ){ + _emit(file, fn, { type: 'error' }); + } + else { + // Created image + var img = api.newImage(file.dataURL || file); + api.readAsImage(img, fn, progress); + } + }, + + + /** + * Make file by name + * + * @param {String} name + * @return {Array} + */ + checkFileObj: function (name){ + var file = {}, accept = api.accept; + + if( typeof name == 'object' ){ + file = name; + } + else { + file.name = (name + '').split(/\\|\//g).pop(); + } + + if( file.type == null ){ + file.type = file.name.split('.').pop(); + } + + _each(accept, function (ext, type){ + ext = new RegExp(ext.replace(/\s/g, '|'), 'i'); + if( ext.test(file.type) || api.ext2mime[file.type] ){ + file.type = api.ext2mime[file.type] || (type.split('/')[0] +'/'+ file.type); + } + }); + + return file; + }, + + + /** + * Get drop files + * + * @param {Event} evt + * @param {Function} callback + */ + getDropFiles: function (evt, callback){ + var + files = [] + , all = [] + , items + , dataTransfer = _getDataTransfer(evt) + , transFiles = dataTransfer.files + , transItems = dataTransfer.items + , entrySupport = _isArray(transItems) && transItems[0] && _getAsEntry(transItems[0]) + , queue = api.queue(function (){ callback(files, all); }) + ; + + if( entrySupport ){ + if( normalize && transFiles ){ + var + i = transFiles.length + , file + , entry + ; + + items = new Array(i); + while( i-- ){ + file = transFiles[i]; + + try { + entry = _getAsEntry(transItems[i]); + } + catch( err ){ + api.log('[err] getDropFiles: ', err); + entry = null; + } + + if( _isEntry(entry) ){ + // OSX filesystems use Unicode Normalization Form D (NFD), + // and entry.file(…) can't read the files with the same names + if( entry.isDirectory || (entry.isFile && file.name == file.name.normalize('NFC')) ){ + items[i] = entry; + } + else { + items[i] = file; + } + } + else { + items[i] = file; + } + } + } + else { + items = transItems; + } + } + else { + items = transFiles; + } + + _each(items || [], function (item){ + queue.inc(); + + try { + if( entrySupport && _isEntry(item) ){ + _readEntryAsFiles(item, function (err, entryFiles, allEntries){ + if( err ){ + api.log('[err] getDropFiles:', err); + } else { + files.push.apply(files, entryFiles); + } + all.push.apply(all, allEntries); + + queue.next(); + }); + } + else { + _isRegularFile(item, function (yes, err){ + if( yes ){ + files.push(item); + } + else { + item.error = err; + } + all.push(item); + + queue.next(); + }); + } + } + catch( err ){ + queue.next(); + api.log('[err] getDropFiles: ', err); + } + }); + + queue.check(); + }, + + + /** + * Get file list + * + * @param {HTMLInputElement|Event} input + * @param {String|Function} [filter] + * @param {Function} [callback] + * @return {Array|Null} + */ + getFiles: function (input, filter, callback){ + var files = []; + + if( callback ){ + api.filterFiles(api.getFiles(input), filter, callback); + return null; + } + + if( input.jquery ){ + // jQuery object + input.each(function (){ + files = files.concat(api.getFiles(this)); + }); + input = files; + files = []; + } + + if( typeof filter == 'string' ){ + filter = api.getFilesFilter(filter); + } + + if( input.originalEvent ){ + // jQuery event + input = _fixEvent(input.originalEvent); + } + else if( input.srcElement ){ + // IE Event + input = _fixEvent(input); + } + + + if( input.dataTransfer ){ + // Drag'n'Drop + input = input.dataTransfer; + } + else if( input.target ){ + // Event + input = input.target; + } + + if( input.files ){ + // Input[type="file"] + files = input.files; + + if( !html5 ){ + // Partial support for file api + files[0].blob = input; + files[0].iframe = true; + } + } + else if( !html5 && isInputFile(input) ){ + if( api.trim(input.value) ){ + files = [api.checkFileObj(input.value)]; + files[0].blob = input; + files[0].iframe = true; + } + } + else if( _isArray(input) ){ + files = input; + } + + return api.filter(files, function (file){ return !filter || filter.test(file.name); }); + }, + + + /** + * Get total file size + * @param {Array} files + * @return {Number} + */ + getTotalSize: function (files){ + var size = 0, i = files && files.length; + while( i-- ){ + size += files[i].size; + } + return size; + }, + + + /** + * Get image information + * + * @param {File} file + * @param {Function} fn + */ + getInfo: function (file, fn){ + var info = {}, readers = _infoReader.concat(); + + if( api.isBlob(file) ){ + (function _next(){ + var reader = readers.shift(); + if( reader ){ + if( reader.test(file.type) ){ + reader(file, function (err, res){ + if( err ){ + fn(err); + } + else { + _extend(info, res); + _next(); + } + }); + } + else { + _next(); + } + } + else { + fn(false, info); + } + })(); + } + else { + fn('not_support_info', info); + } + }, + + + /** + * Add information reader + * + * @param {RegExp} mime + * @param {Function} fn + */ + addInfoReader: function (mime, fn){ + fn.test = function (type){ return mime.test(type); }; + _infoReader.push(fn); + }, + + + /** + * Filter of array + * + * @param {Array} input + * @param {Function} fn + * @return {Array} + */ + filter: function (input, fn){ + var result = [], i = 0, n = input.length, val; + + for( ; i < n; i++ ){ + if( i in input ){ + val = input[i]; + if( fn.call(val, val, i, input) ){ + result.push(val); + } + } + } + + return result; + }, + + + /** + * Filter files + * + * @param {Array} files + * @param {Function} eachFn + * @param {Function} resultFn + */ + filterFiles: function (files, eachFn, resultFn){ + if( files.length ){ + // HTML5 or Flash + var queue = files.concat(), file, result = [], deleted = []; + + (function _next(){ + if( queue.length ){ + file = queue.shift(); + api.getInfo(file, function (err, info){ + (eachFn(file, err ? false : info) ? result : deleted).push(file); + _next(); + }); + } + else { + resultFn(result, deleted); + } + })(); + } + else { + resultFn([], files); + } + }, + + + upload: function (options){ + options = _extend({ + jsonp: 'callback' + , prepare: api.F + , beforeupload: api.F + , upload: api.F + , fileupload: api.F + , fileprogress: api.F + , filecomplete: api.F + , progress: api.F + , complete: api.F + , pause: api.F + , imageOriginal: true + , chunkSize: api.chunkSize + , chunkUploadRetry: api.chunkUploadRetry + , uploadRetry: api.uploadRetry + }, options); + + + if( options.imageAutoOrientation && !options.imageTransform ){ + options.imageTransform = { rotate: 'auto' }; + } + + + var + proxyXHR = new api.XHR(options) + , dataArray = this._getFilesDataArray(options.files) + , _this = this + , _total = 0 + , _loaded = 0 + , _nextFile + , _complete = false + ; + + + // calc total size + _each(dataArray, function (data){ + _total += data.size; + }); + + // Array of files + proxyXHR.files = []; + _each(dataArray, function (data){ + proxyXHR.files.push(data.file); + }); + + // Set upload status props + proxyXHR.total = _total; + proxyXHR.loaded = 0; + proxyXHR.filesLeft = dataArray.length; + + // emit "beforeupload" event + options.beforeupload(proxyXHR, options); + + // Upload by file + _nextFile = function (){ + var + data = dataArray.shift() + , _file = data && data.file + , _fileLoaded = false + , _fileOptions = _simpleClone(options) + ; + + proxyXHR.filesLeft = dataArray.length; + + if( _file && _file.name === api.expando ){ + _file = null; + api.log('[warn] FileAPI.upload() — called without files'); + } + + if( ( proxyXHR.statusText != 'abort' || proxyXHR.current ) && data ){ + // Mark active job + _complete = false; + + // Set current upload file + proxyXHR.currentFile = _file; + + // Prepare file options + if (_file && options.prepare(_file, _fileOptions) === false) { + _nextFile.call(_this); + return; + } + _fileOptions.file = _file; + + _this._getFormData(_fileOptions, data, function (form){ + if( !_loaded ){ + // emit "upload" event + options.upload(proxyXHR, options); + } + + var xhr = new api.XHR(_extend({}, _fileOptions, { + + upload: _file ? function (){ + // emit "fileupload" event + options.fileupload(_file, xhr, _fileOptions); + } : noop, + + progress: _file ? function (evt){ + if( !_fileLoaded ){ + // For ignore the double calls. + _fileLoaded = (evt.loaded === evt.total); + + // emit "fileprogress" event + options.fileprogress({ + type: 'progress' + , total: data.total = evt.total + , loaded: data.loaded = evt.loaded + }, _file, xhr, _fileOptions); + + // emit "progress" event + options.progress({ + type: 'progress' + , total: _total + , loaded: proxyXHR.loaded = (_loaded + data.size * (evt.loaded/evt.total)) || 0 + }, _file, xhr, _fileOptions); + } + } : noop, + + complete: function (err){ + _each(_xhrPropsExport, function (name){ + proxyXHR[name] = xhr[name]; + }); + + if( _file ){ + data.total = (data.total || data.size); + data.loaded = data.total; + + if( !err ) { + // emulate 100% "progress" + this.progress(data); + + // fixed throttle event + _fileLoaded = true; + + // bytes loaded + _loaded += data.size; // data.size != data.total, it's desirable fix this + proxyXHR.loaded = _loaded; + } + + // emit "filecomplete" event + options.filecomplete(err, xhr, _file, _fileOptions); + } + + // upload next file + setTimeout(function () {_nextFile.call(_this);}, 0); + } + })); // xhr + + + // ... + proxyXHR.abort = function (current){ + if (!current) { dataArray.length = 0; } + this.current = current; + xhr.abort(); + }; + + // Start upload + xhr.send(form); + }); + } + else { + var successful = proxyXHR.status == 200 || proxyXHR.status == 201 || proxyXHR.status == 204; + options.complete(successful ? false : (proxyXHR.statusText || 'error'), proxyXHR, options); + // Mark done state + _complete = true; + } + }; + + + // Next tick + setTimeout(_nextFile, 0); + + + // Append more files to the existing request + // first - add them to the queue head/tail + proxyXHR.append = function (files, first) { + files = api._getFilesDataArray([].concat(files)); + + _each(files, function (data) { + _total += data.size; + proxyXHR.files.push(data.file); + if (first) { + dataArray.unshift(data); + } else { + dataArray.push(data); + } + }); + + proxyXHR.statusText = ""; + + if( _complete ){ + _nextFile.call(_this); + } + }; + + + // Removes file from queue by file reference and returns it + proxyXHR.remove = function (file) { + var i = dataArray.length, _file; + while( i-- ){ + if( dataArray[i].file == file ){ + _file = dataArray.splice(i, 1); + _total -= _file.size; + } + } + return _file; + }; + + return proxyXHR; + }, + + + _getFilesDataArray: function (data){ + var files = [], oFiles = {}; + + if( isInputFile(data) ){ + var tmp = api.getFiles(data); + oFiles[data.name || 'file'] = data.getAttribute('multiple') !== null ? tmp : tmp[0]; + } + else if( _isArray(data) && isInputFile(data[0]) ){ + _each(data, function (input){ + oFiles[input.name || 'file'] = api.getFiles(input); + }); + } + else { + oFiles = data; + } + + _each(oFiles, function add(file, name){ + if( _isArray(file) ){ + _each(file, function (file){ + add(file, name); + }); + } + else if( file && (file.name || file.image) ){ + files.push({ + name: name + , file: file + , size: file.size + , total: file.size + , loaded: 0 + }); + } + }); + + if( !files.length ){ + // Create fake `file` object + files.push({ file: { name: api.expando } }); + } + + return files; + }, + + + _getFormData: function (options, data, fn){ + var + file = data.file + , name = data.name + , filename = file.name + , filetype = file.type + , trans = api.support.transform && options.imageTransform + , Form = new api.Form + , queue = api.queue(function (){ fn(Form); }) + , isOrignTrans = trans && _isOriginTransform(trans) + , postNameConcat = api.postNameConcat + ; + + // Append data + _each(options.data, function add(val, name){ + if( typeof val == 'object' ){ + _each(val, function (v, i){ + add(v, postNameConcat(name, i)); + }); + } + else { + Form.append(name, val); + } + }); + + (function _addFile(file/**Object*/){ + if( file.image ){ // This is a FileAPI.Image + queue.inc(); + + file.toData(function (err, image){ + // @todo: требует рефакторинга и обработки ошибки + if (file.file) { + image.type = file.file.type; + image.quality = file.matrix.quality; + filename = file.file && file.file.name; + } + + filename = filename || (new Date).getTime()+'.png'; + + _addFile(image); + queue.next(); + }); + } + else if( api.Image && trans && (/^image/.test(file.type) || _rimgcanvas.test(file.nodeName)) ){ + queue.inc(); + + if( isOrignTrans ){ + // Convert to array for transform function + trans = [trans]; + } + + api.Image.transform(file, trans, options.imageAutoOrientation, function (err, images){ + if( isOrignTrans && !err ){ + if( !dataURLtoBlob && !api.flashEngine ){ + // Canvas.toBlob or Flash not supported, use multipart + Form.multipart = true; + } + + Form.append(name, images[0], filename, trans[0].type || filetype); + } + else { + var addOrigin = 0; + + if( !err ){ + _each(images, function (image, idx){ + if( !dataURLtoBlob && !api.flashEngine ){ + Form.multipart = true; + } + + if( !trans[idx].postName ){ + addOrigin = 1; + } + + Form.append(trans[idx].postName || postNameConcat(name, idx), image, filename, trans[idx].type || filetype); + }); + } + + if( err || options.imageOriginal ){ + Form.append(postNameConcat(name, (addOrigin ? 'original' : null)), file, filename, filetype); + } + } + + queue.next(); + }); + } + else if( filename !== api.expando ){ + Form.append(name, file, filename); + } + })(file); + + queue.check(); + }, + + + reset: function (inp, notRemove){ + var parent, clone; + + if( jQuery ){ + clone = jQuery(inp).clone(true).insertBefore(inp).val('')[0]; + if( !notRemove ){ + jQuery(inp).remove(); + } + } else { + parent = inp.parentNode; + clone = parent.insertBefore(inp.cloneNode(true), inp); + clone.value = ''; + + if( !notRemove ){ + parent.removeChild(inp); + } + + _each(_elEvents[api.uid(inp)], function (fns, type){ + _each(fns, function (fn){ + _off(inp, type, fn); + _on(clone, type, fn); + }); + }); + } + + return clone; + }, + + + /** + * Load remote file + * + * @param {String} url + * @param {Function} fn + * @return {XMLHttpRequest} + */ + load: function (url, fn){ + var xhr = api.getXHR(); + if( xhr ){ + xhr.open('GET', url, true); + + if( xhr.overrideMimeType ){ + xhr.overrideMimeType('text/plain; charset=x-user-defined'); + } + + _on(xhr, 'progress', function (/**Event*/evt){ + /** @namespace evt.lengthComputable */ + if( evt.lengthComputable ){ + fn({ type: evt.type, loaded: evt.loaded, total: evt.total }, xhr); + } + }); + + xhr.onreadystatechange = function(){ + if( xhr.readyState == 4 ){ + xhr.onreadystatechange = null; + if( xhr.status == 200 ){ + url = url.split('/'); + /** @namespace xhr.responseBody */ + var file = { + name: url[url.length-1] + , size: xhr.getResponseHeader('Content-Length') + , type: xhr.getResponseHeader('Content-Type') + }; + file.dataURL = 'data:'+file.type+';base64,' + api.encode64(xhr.responseBody || xhr.responseText); + fn({ type: 'load', result: file }, xhr); + } + else { + fn({ type: 'error' }, xhr); + } + } + }; + xhr.send(null); + } else { + fn({ type: 'error' }); + } + + return xhr; + }, + + encode64: function (str){ + var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', outStr = '', i = 0; + + if( typeof str !== 'string' ){ + str = String(str); + } + + while( i < str.length ){ + //all three "& 0xff" added below are there to fix a known bug + //with bytes returned by xhr.responseText + var + byte1 = str.charCodeAt(i++) & 0xff + , byte2 = str.charCodeAt(i++) & 0xff + , byte3 = str.charCodeAt(i++) & 0xff + , enc1 = byte1 >> 2 + , enc2 = ((byte1 & 3) << 4) | (byte2 >> 4) + , enc3, enc4 + ; + + if( isNaN(byte2) ){ + enc3 = enc4 = 64; + } else { + enc3 = ((byte2 & 15) << 2) | (byte3 >> 6); + enc4 = isNaN(byte3) ? 64 : byte3 & 63; + } + + outStr += b64.charAt(enc1) + b64.charAt(enc2) + b64.charAt(enc3) + b64.charAt(enc4); + } + + return outStr; + } + + } // api + ; + + + function _emit(target, fn, name, res, ext){ + var evt = { + type: name.type || name + , target: target + , result: res + }; + _extend(evt, ext); + fn(evt); + } + + + function _hasSupportReadAs(method){ + return FileReader && !!FileReader.prototype['readAs' + method]; + } + + + function _readAs(file, fn, method, encoding){ + if( api.isBlob(file) && _hasSupportReadAs(method) ){ + var Reader = new FileReader; + + // Add event listener + _on(Reader, _readerEvents, function _fn(evt){ + var type = evt.type; + if( type == 'progress' ){ + _emit(file, fn, evt, evt.target.result, { loaded: evt.loaded, total: evt.total }); + } + else if( type == 'loadend' ){ + _off(Reader, _readerEvents, _fn); + Reader = null; + } + else { + _emit(file, fn, evt, evt.target.result); + } + }); + + + try { + // ReadAs ... + if( encoding ){ + Reader['readAs' + method](file, encoding); + } + else { + Reader['readAs' + method](file); + } + } + catch (err){ + _emit(file, fn, 'error', undef, { error: err.toString() }); + } + } + else { + _emit(file, fn, 'error', undef, { error: 'filreader_not_support_' + method }); + } + } + + + function _isRegularFile(file, callback){ + // http://stackoverflow.com/questions/8856628/detecting-folders-directories-in-javascript-filelist-objects + if( !file.type && (safari || ((file.size % 4096) === 0 && (file.size <= 102400))) ){ + if( FileReader ){ + try { + var reader = new FileReader(); + + _one(reader, _readerEvents, function (evt){ + var isFile = evt.type != 'error'; + if( isFile ){ + if ( reader.readyState == null || reader.readyState === reader.LOADING ) { + reader.abort(); + } + callback(isFile); + } + else { + callback(false, reader.error); + } + }); + + reader.readAsDataURL(file); + } catch( err ){ + callback(false, err); + } + } + else { + callback(null, new Error('FileReader is not supported')); + } + } + else { + callback(true); + } + } + + + function _isEntry(item){ + return item && (item.isFile || item.isDirectory); + } + + + function _getAsEntry(item){ + var entry; + if( item.getAsEntry ){ entry = item.getAsEntry(); } + else if( item.webkitGetAsEntry ){ entry = item.webkitGetAsEntry(); } + return entry; + } + + + function _readEntryAsFiles(entry, callback){ + if( !entry ){ + // error + var err = new Error('invalid entry'); + entry = new Object(entry); + entry.error = err; + callback(err.message, [], [entry]); + } + else if( entry.isFile ){ + // Read as file + entry.file(function (file){ + // success + file.fullPath = entry.fullPath; + callback(false, [file], [file]); + }, function (err){ + // error + entry.error = err; + callback('FileError.code: ' + err.code, [], [entry]); + }); + } + else if( entry.isDirectory ){ + var + reader = entry.createReader() + , firstAttempt = true + , files = [] + , all = [entry] + ; + + var onerror = function (err){ + // error + entry.error = err; + callback('DirectoryError.code: ' + err.code, files, all); + }; + var ondone = function ondone(entries){ + if( firstAttempt ){ + firstAttempt = false; + if( !entries.length ){ + entry.error = new Error('directory is empty'); + } + } + + // success + if( entries.length ){ + api.afor(entries, function (next, entry){ + _readEntryAsFiles(entry, function (err, entryFiles, allEntries){ + if( !err ){ + files = files.concat(entryFiles); + } + all = all.concat(allEntries); + + if( next ){ + next(); + } + else { + reader.readEntries(ondone, onerror); + } + }); + }); + } + else { + callback(false, files, all); + } + }; + + reader.readEntries(ondone, onerror); + } + else { + _readEntryAsFiles(_getAsEntry(entry), callback); + } + } + + + function _simpleClone(obj){ + var copy = {}; + _each(obj, function (val, key){ + if( val && (typeof val === 'object') && (val.nodeType === void 0) ){ + val = _extend({}, val); + } + copy[key] = val; + }); + return copy; + } + + + function isInputFile(el){ + return _rinput.test(el && el.tagName); + } + + + function _getDataTransfer(evt){ + return (evt.originalEvent || evt || '').dataTransfer || {}; + } + + + function _isOriginTransform(trans){ + var key; + for( key in trans ){ + if( trans.hasOwnProperty(key) ){ + if( !(trans[key] instanceof Object || key === 'overlay' || key === 'filter') ){ + return true; + } + } + } + return false; + } + + + // Add default image info reader + api.addInfoReader(/^image/, function (file/**File*/, callback/**Function*/){ + if( !file.__dimensions ){ + var defer = file.__dimensions = api.defer(); + + api.readAsImage(file, function (evt){ + var img = evt.target; + defer.resolve(evt.type == 'load' ? false : 'error', { + width: img.width + , height: img.height + }); + img.src = api.EMPTY_PNG; + img = null; + }); + } + + file.__dimensions.then(callback); + }); + + + /** + * Drag'n'Drop special event + * + * @param {HTMLElement} el + * @param {Function} onHover + * @param {Function} onDrop + */ + api.event.dnd = function (el, onHover, onDrop){ + var _id, _type; + + if( !onDrop ){ + onDrop = onHover; + onHover = api.F; + } + + if( FileReader ){ + // Hover + _on(el, 'dragenter dragleave dragover', onHover.ff = onHover.ff || function (evt){ + var + types = _getDataTransfer(evt).types + , i = types && types.length + , debounceTrigger = false + ; + + while( i-- ){ + if( ~types[i].indexOf('File') ){ + evt[preventDefault](); + + if( _type !== evt.type ){ + _type = evt.type; // Store current type of event + + if( _type != 'dragleave' ){ + onHover.call(evt[currentTarget], true, evt); + } + + debounceTrigger = true; + } + + break; // exit from "while" + } + } + + if( debounceTrigger ){ + clearTimeout(_id); + _id = setTimeout(function (){ + onHover.call(evt[currentTarget], _type != 'dragleave', evt); + }, 50); + } + }); + + + // Drop + _on(el, 'drop', onDrop.ff = onDrop.ff || function (evt){ + evt[preventDefault](); + + _type = 0; + onHover.call(evt[currentTarget], false, evt); + + api.getDropFiles(evt, function (files, all){ + onDrop.call(evt[currentTarget], files, all, evt); + }); + }); + } + else { + api.log("Drag'n'Drop -- not supported"); + } + }; + + + /** + * Remove drag'n'drop + * @param {HTMLElement} el + * @param {Function} onHover + * @param {Function} onDrop + */ + api.event.dnd.off = function (el, onHover, onDrop){ + _off(el, 'dragenter dragleave dragover', onHover.ff); + _off(el, 'drop', onDrop.ff); + }; + + + // Support jQuery + if( jQuery && !jQuery.fn.dnd ){ + jQuery.fn.dnd = function (onHover, onDrop){ + return this.each(function (){ + api.event.dnd(this, onHover, onDrop); + }); + }; + + jQuery.fn.offdnd = function (onHover, onDrop){ + return this.each(function (){ + api.event.dnd.off(this, onHover, onDrop); + }); + }; + } + + // @export + window.FileAPI = _extend(api, window.FileAPI); + + + // Debug info + api.log('FileAPI: ' + api.version); + api.log('protocol: ' + window.location.protocol); + api.log('doctype: [' + doctype.name + '] ' + doctype.publicId + ' ' + doctype.systemId); + + + // @detect 'x-ua-compatible' + _each(document.getElementsByTagName('meta'), function (meta){ + if( /x-ua-compatible/i.test(meta.getAttribute('http-equiv')) ){ + api.log('meta.http-equiv: ' + meta.getAttribute('content')); + } + }); + + + // Configuration + try { + _supportConsoleLog = !!console.log; + _supportConsoleLogApply = !!console.log.apply; + } + catch (err) {} + + if( !api.flashUrl ){ api.flashUrl = api.staticPath + 'FileAPI.flash.swf'; } + if( !api.flashImageUrl ){ api.flashImageUrl = api.staticPath + 'FileAPI.flash.image.swf'; } + if( !api.flashWebcamUrl ){ api.flashWebcamUrl = api.staticPath + 'FileAPI.flash.camera.swf'; } +})(window, void 0); + +/*global window, FileAPI, document */ + +(function (api, document, undef) { + 'use strict'; + + var + min = Math.min, + round = Math.round, + getCanvas = function () { return document.createElement('canvas'); }, + support = false, + exifOrientation = { + 8: 270 + , 3: 180 + , 6: 90 + , 7: 270 + , 4: 180 + , 5: 90 + } + ; + + try { + support = getCanvas().toDataURL('image/png').indexOf('data:image/png') > -1; + } + catch (e){} + + + function Image(file){ + if( file instanceof Image ){ + var img = new Image(file.file); + api.extend(img.matrix, file.matrix); + return img; + } + else if( !(this instanceof Image) ){ + return new Image(file); + } + + this.file = file; + this.size = file.size || 100; + + this.matrix = { + sx: 0, + sy: 0, + sw: 0, + sh: 0, + dx: 0, + dy: 0, + dw: 0, + dh: 0, + resize: 0, // min, max OR preview + deg: 0, + quality: 1, // jpeg quality + filter: 0 + }; + } + + + Image.prototype = { + image: true, + constructor: Image, + + set: function (attrs){ + api.extend(this.matrix, attrs); + return this; + }, + + crop: function (x, y, w, h){ + if( w === undef ){ + w = x; + h = y; + x = y = 0; + } + return this.set({ sx: x, sy: y, sw: w, sh: h || w }); + }, + + resize: function (w, h, strategy){ + if( /min|max|height|width/.test(h) ){ + strategy = h; + h = w; + } + + return this.set({ dw: w, dh: h || w, resize: strategy }); + }, + + preview: function (w, h){ + return this.resize(w, h || w, 'preview'); + }, + + rotate: function (deg){ + return this.set({ deg: deg }); + }, + + filter: function (filter){ + return this.set({ filter: filter }); + }, + + overlay: function (images){ + return this.set({ overlay: images }); + }, + + clone: function (){ + return new Image(this); + }, + + _load: function (image, fn){ + var self = this; + + if( /img|video/i.test(image.nodeName) ){ + fn.call(self, null, image); + } + else { + api.readAsImage(image, function (evt){ + fn.call(self, evt.type != 'load', evt.result); + }); + } + }, + + _apply: function (image, fn){ + var + canvas = getCanvas() + , m = this.getMatrix(image) + , ctx = canvas.getContext('2d') + , width = image.videoWidth || image.width + , height = image.videoHeight || image.height + , deg = m.deg + , dw = m.dw + , dh = m.dh + , w = width + , h = height + , filter = m.filter + , copy // canvas copy + , buffer = image + , overlay = m.overlay + , queue = api.queue(function (){ image.src = api.EMPTY_PNG; fn(false, canvas); }) + , renderImageToCanvas = api.renderImageToCanvas + ; + + // Normalize angle + deg = deg - Math.floor(deg/360)*360; + + // For `renderImageToCanvas` + image._type = this.file.type; + + while(m.multipass && min(w/dw, h/dh) > 2 ){ + w = (w/2 + 0.5)|0; + h = (h/2 + 0.5)|0; + + copy = getCanvas(); + copy.width = w; + copy.height = h; + + if( buffer !== image ){ + renderImageToCanvas(copy, buffer, 0, 0, buffer.width, buffer.height, 0, 0, w, h); + buffer = copy; + } + else { + buffer = copy; + renderImageToCanvas(buffer, image, m.sx, m.sy, m.sw, m.sh, 0, 0, w, h); + m.sx = m.sy = m.sw = m.sh = 0; + } + } + + + canvas.width = (deg % 180) ? dh : dw; + canvas.height = (deg % 180) ? dw : dh; + + canvas.type = m.type; + canvas.quality = m.quality; + + ctx.rotate(deg * Math.PI / 180); + renderImageToCanvas(ctx.canvas, buffer + , m.sx, m.sy + , m.sw || buffer.width + , m.sh || buffer.height + , (deg == 180 || deg == 270 ? -dw : 0) + , (deg == 90 || deg == 180 ? -dh : 0) + , dw, dh + ); + dw = canvas.width; + dh = canvas.height; + + // Apply overlay + overlay && api.each([].concat(overlay), function (over){ + queue.inc(); + // preload + var img = new window.Image, fn = function (){ + var + x = over.x|0 + , y = over.y|0 + , w = over.w || img.width + , h = over.h || img.height + , rel = over.rel + ; + + // center | right | left + x = (rel == 1 || rel == 4 || rel == 7) ? (dw - w + x)/2 : (rel == 2 || rel == 5 || rel == 8 ? dw - (w + x) : x); + + // center | bottom | top + y = (rel == 3 || rel == 4 || rel == 5) ? (dh - h + y)/2 : (rel >= 6 ? dh - (h + y) : y); + + api.event.off(img, 'error load abort', fn); + + try { + ctx.globalAlpha = over.opacity || 1; + ctx.drawImage(img, x, y, w, h); + } + catch (er){} + + queue.next(); + }; + + api.event.on(img, 'error load abort', fn); + img.src = over.src; + + if( img.complete ){ + fn(); + } + }); + + if( filter ){ + queue.inc(); + Image.applyFilter(canvas, filter, queue.next); + } + + queue.check(); + }, + + getMatrix: function (image){ + var + m = api.extend({}, this.matrix) + , sw = m.sw = m.sw || image.videoWidth || image.naturalWidth || image.width + , sh = m.sh = m.sh || image.videoHeight || image.naturalHeight || image.height + , dw = m.dw = m.dw || sw + , dh = m.dh = m.dh || sh + , sf = sw/sh, df = dw/dh + , strategy = m.resize + ; + + if( strategy == 'preview' ){ + if( dw != sw || dh != sh ){ + // Make preview + var w, h; + + if( df >= sf ){ + w = sw; + h = w / df; + } else { + h = sh; + w = h * df; + } + + if( w != sw || h != sh ){ + m.sx = ~~((sw - w)/2); + m.sy = ~~((sh - h)/2); + sw = w; + sh = h; + } + } + } + else if( strategy == 'height' ){ + dw = dh * sf; + } + else if( strategy == 'width' ){ + dh = dw / sf; + } + else if( strategy ){ + if( !(sw > dw || sh > dh) ){ + dw = sw; + dh = sh; + } + else if( strategy == 'min' ){ + dw = round(sf < df ? min(sw, dw) : dh*sf); + dh = round(sf < df ? dw/sf : min(sh, dh)); + } + else { + dw = round(sf >= df ? min(sw, dw) : dh*sf); + dh = round(sf >= df ? dw/sf : min(sh, dh)); + } + } + + m.sw = sw; + m.sh = sh; + m.dw = dw; + m.dh = dh; + m.multipass = api.multiPassResize; + return m; + }, + + _trans: function (fn){ + this._load(this.file, function (err, image){ + if( err ){ + fn(err); + } + else { + try { + this._apply(image, fn); + } catch (err){ + api.log('[err] FileAPI.Image.fn._apply:', err); + fn(err); + } + } + }); + }, + + + get: function (fn){ + if( api.support.transform ){ + var _this = this, matrix = _this.matrix; + + if( matrix.deg == 'auto' ){ + api.getInfo(_this.file, function (err, info){ + // rotate by exif orientation + matrix.deg = exifOrientation[info && info.exif && info.exif.Orientation] || 0; + _this._trans(fn); + }); + } + else { + _this._trans(fn); + } + } + else { + fn('not_support_transform'); + } + + return this; + }, + + + toData: function (fn){ + return this.get(fn); + } + + }; + + + Image.exifOrientation = exifOrientation; + + + Image.transform = function (file, transform, autoOrientation, fn){ + function _transform(err, img){ + // img -- info object + var + images = {} + , queue = api.queue(function (err){ + fn(err, images); + }) + ; + + if( !err ){ + api.each(transform, function (params, name){ + if( !queue.isFail() ){ + var ImgTrans = new Image(img.nodeType ? img : file), isFn = typeof params == 'function'; + + if( isFn ){ + params(img, ImgTrans); + } + else if( params.width ){ + ImgTrans[params.preview ? 'preview' : 'resize'](params.width, params.height, params.strategy); + } + else { + if( params.maxWidth && (img.width > params.maxWidth || img.height > params.maxHeight) ){ + ImgTrans.resize(params.maxWidth, params.maxHeight, 'max'); + } + } + + if( params.crop ){ + var crop = params.crop; + ImgTrans.crop(crop.x|0, crop.y|0, crop.w || crop.width, crop.h || crop.height); + } + + if( params.rotate === undef && autoOrientation ){ + params.rotate = 'auto'; + } + + ImgTrans.set({ type: ImgTrans.matrix.type || params.type || file.type || 'image/png' }); + + if( !isFn ){ + ImgTrans.set({ + deg: params.rotate + , overlay: params.overlay + , filter: params.filter + , quality: params.quality || 1 + }); + } + + queue.inc(); + ImgTrans.toData(function (err, image){ + if( err ){ + queue.fail(); + } + else { + images[name] = image; + queue.next(); + } + }); + } + }); + } + else { + queue.fail(); + } + } + + + // @todo: Оло-ло, нужно рефакторить это место + if( file.width ){ + _transform(false, file); + } else { + api.getInfo(file, _transform); + } + }; + + + // @const + api.each(['TOP', 'CENTER', 'BOTTOM'], function (x, i){ + api.each(['LEFT', 'CENTER', 'RIGHT'], function (y, j){ + Image[x+'_'+y] = i*3 + j; + Image[y+'_'+x] = i*3 + j; + }); + }); + + + /** + * Trabsform element to canvas + * + * @param {Image|HTMLVideoElement} el + * @returns {Canvas} + */ + Image.toCanvas = function(el){ + var canvas = document.createElement('canvas'); + canvas.width = el.videoWidth || el.width; + canvas.height = el.videoHeight || el.height; + canvas.getContext('2d').drawImage(el, 0, 0); + return canvas; + }; + + + /** + * Create image from DataURL + * @param {String} dataURL + * @param {Object} size + * @param {Function} callback + */ + Image.fromDataURL = function (dataURL, size, callback){ + var img = api.newImage(dataURL); + api.extend(img, size); + callback(img); + }; + + + /** + * Apply filter (caman.js) + * + * @param {Canvas|Image} canvas + * @param {String|Function} filter + * @param {Function} doneFn + */ + Image.applyFilter = function (canvas, filter, doneFn){ + if( typeof filter == 'function' ){ + filter(canvas, doneFn); + } + else if( window.Caman ){ + // http://camanjs.com/guides/ + window.Caman(canvas.tagName == 'IMG' ? Image.toCanvas(canvas) : canvas, function (){ + if( typeof filter == 'string' ){ + this[filter](); + } + else { + api.each(filter, function (val, method){ + this[method](val); + }, this); + } + this.render(doneFn); + }); + } + }; + + + /** + * For load-image-ios.js + */ + api.renderImageToCanvas = function (canvas, img, sx, sy, sw, sh, dx, dy, dw, dh){ + try { + return canvas.getContext('2d').drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh); + } catch (ex) { + api.log('renderImageToCanvas failed'); + throw ex; + } + }; + + + // @export + api.support.canvas = api.support.transform = support; + api.Image = Image; +})(FileAPI, document); + +/* + * JavaScript Load Image iOS scaling fixes 1.0.3 + * https://github.com/blueimp/JavaScript-Load-Image + * + * Copyright 2013, Sebastian Tschan + * https://blueimp.net + * + * iOS image scaling fixes based on + * https://github.com/stomita/ios-imagefile-megapixel + * + * Licensed under the MIT license: + * http://www.opensource.org/licenses/MIT + */ + +/*jslint nomen: true, bitwise: true */ +/*global FileAPI, window, document */ + +(function (factory) { + 'use strict'; + factory(FileAPI); +}(function (loadImage) { + 'use strict'; + + // Only apply fixes on the iOS platform: + if (!window.navigator || !window.navigator.platform || + !(/iP(hone|od|ad)/).test(window.navigator.platform)) { + return; + } + + var originalRenderMethod = loadImage.renderImageToCanvas; + + // Detects subsampling in JPEG images: + loadImage.detectSubsampling = function (img) { + var canvas, + context; + if (img.width * img.height > 1024 * 1024) { // only consider mexapixel images + canvas = document.createElement('canvas'); + canvas.width = canvas.height = 1; + context = canvas.getContext('2d'); + context.drawImage(img, -img.width + 1, 0); + // subsampled image becomes half smaller in rendering size. + // check alpha channel value to confirm image is covering edge pixel or not. + // if alpha value is 0 image is not covering, hence subsampled. + return context.getImageData(0, 0, 1, 1).data[3] === 0; + } + return false; + }; + + // Detects vertical squash in JPEG images: + loadImage.detectVerticalSquash = function (img, subsampled) { + var naturalHeight = img.naturalHeight || img.height, + canvas = document.createElement('canvas'), + context = canvas.getContext('2d'), + data, + sy, + ey, + py, + alpha; + if (subsampled) { + naturalHeight /= 2; + } + canvas.width = 1; + canvas.height = naturalHeight; + context.drawImage(img, 0, 0); + data = context.getImageData(0, 0, 1, naturalHeight).data; + // search image edge pixel position in case it is squashed vertically: + sy = 0; + ey = naturalHeight; + py = naturalHeight; + while (py > sy) { + alpha = data[(py - 1) * 4 + 3]; + if (alpha === 0) { + ey = py; + } else { + sy = py; + } + py = (ey + sy) >> 1; + } + return (py / naturalHeight) || 1; + }; + + // Renders image to canvas while working around iOS image scaling bugs: + // https://github.com/blueimp/JavaScript-Load-Image/issues/13 + loadImage.renderImageToCanvas = function ( + canvas, + img, + sourceX, + sourceY, + sourceWidth, + sourceHeight, + destX, + destY, + destWidth, + destHeight + ) { + if (img._type === 'image/jpeg') { + var context = canvas.getContext('2d'), + tmpCanvas = document.createElement('canvas'), + tileSize = 1024, + tmpContext = tmpCanvas.getContext('2d'), + subsampled, + vertSquashRatio, + tileX, + tileY; + tmpCanvas.width = tileSize; + tmpCanvas.height = tileSize; + context.save(); + subsampled = loadImage.detectSubsampling(img); + if (subsampled) { + sourceX /= 2; + sourceY /= 2; + sourceWidth /= 2; + sourceHeight /= 2; + } + vertSquashRatio = loadImage.detectVerticalSquash(img, subsampled); + if (subsampled || vertSquashRatio !== 1) { + sourceY *= vertSquashRatio; + destWidth = Math.ceil(tileSize * destWidth / sourceWidth); + destHeight = Math.ceil( + tileSize * destHeight / sourceHeight / vertSquashRatio + ); + destY = 0; + tileY = 0; + while (tileY < sourceHeight) { + destX = 0; + tileX = 0; + while (tileX < sourceWidth) { + tmpContext.clearRect(0, 0, tileSize, tileSize); + tmpContext.drawImage( + img, + sourceX, + sourceY, + sourceWidth, + sourceHeight, + -tileX, + -tileY, + sourceWidth, + sourceHeight + ); + context.drawImage( + tmpCanvas, + 0, + 0, + tileSize, + tileSize, + destX, + destY, + destWidth, + destHeight + ); + tileX += tileSize; + destX += destWidth; + } + tileY += tileSize; + destY += destHeight; + } + context.restore(); + return canvas; + } + } + return originalRenderMethod( + canvas, + img, + sourceX, + sourceY, + sourceWidth, + sourceHeight, + destX, + destY, + destWidth, + destHeight + ); + }; + +})); + +/*global window, FileAPI */ + +(function (api, window){ + "use strict"; + + var + document = window.document + , FormData = window.FormData + , Form = function (){ this.items = []; } + , encodeURIComponent = window.encodeURIComponent + ; + + + Form.prototype = { + + append: function (name, blob, file, type){ + this.items.push({ + name: name + , blob: blob && blob.blob || (blob == void 0 ? '' : blob) + , file: blob && (file || blob.name) + , type: blob && (type || blob.type) + }); + }, + + each: function (fn){ + var i = 0, n = this.items.length; + for( ; i < n; i++ ){ + fn.call(this, this.items[i]); + } + }, + + toData: function (fn, options){ + // allow chunked transfer if we have only one file to send + // flag is used below and in XHR._send + options._chunked = api.support.chunked && options.chunkSize > 0 && api.filter(this.items, function (item){ return item.file; }).length == 1; + + if( !api.support.html5 ){ + api.log('FileAPI.Form.toHtmlData'); + this.toHtmlData(fn); + } + else if( !api.formData || this.multipart || !FormData ){ + api.log('FileAPI.Form.toMultipartData'); + this.toMultipartData(fn); + } + else if( options._chunked ){ + api.log('FileAPI.Form.toPlainData'); + this.toPlainData(fn); + } + else { + api.log('FileAPI.Form.toFormData'); + this.toFormData(fn); + } + }, + + _to: function (data, complete, next, arg){ + var queue = api.queue(function (){ + complete(data); + }); + + this.each(function (file){ + try{ + next(file, data, queue, arg); + } + catch( err ){ + api.log('FileAPI.Form._to: ' + err.message); + complete(err); + } + }); + + queue.check(); + }, + + + toHtmlData: function (fn){ + this._to(document.createDocumentFragment(), fn, function (file, data/**DocumentFragment*/){ + var blob = file.blob, hidden; + + if( file.file ){ + api.reset(blob, true); + // set new name + blob.name = file.name; + blob.disabled = false; + data.appendChild(blob); + } + else { + hidden = document.createElement('input'); + hidden.name = file.name; + hidden.type = 'hidden'; + hidden.value = blob; + data.appendChild(hidden); + } + }); + }, + + toPlainData: function (fn){ + this._to({}, fn, function (file, data, queue){ + if( file.file ){ + data.type = file.file; + } + + if( file.blob.toBlob ){ + // canvas + queue.inc(); + _convertFile(file, function (file, blob){ + data.name = file.name; + data.file = blob; + data.size = blob.length; + data.type = file.type; + queue.next(); + }); + } + else if( file.file ){ + // file + data.name = file.blob.name; + data.file = file.blob; + data.size = file.blob.size; + data.type = file.type; + } + else { + // additional data + if( !data.params ){ + data.params = []; + } + data.params.push(encodeURIComponent(file.name) +"="+ encodeURIComponent(file.blob)); + } + + data.start = -1; + data.end = data.file && data.file.FileAPIReadPosition || -1; + data.retry = 0; + }); + }, + + toFormData: function (fn){ + this._to(new FormData, fn, function (file, data, queue){ + if( file.blob && file.blob.toBlob ){ + queue.inc(); + _convertFile(file, function (file, blob){ + data.append(file.name, blob, file.file); + queue.next(); + }); + } + else if( file.file ){ + data.append(file.name, file.blob, file.file); + } + else { + data.append(file.name, file.blob); + } + + if( file.file ){ + data.append('_'+file.name, file.file); + } + }); + }, + + + toMultipartData: function (fn){ + this._to([], fn, function (file, data, queue, boundary){ + queue.inc(); + _convertFile(file, function (file, blob){ + data.push( + '--_' + boundary + ('\r\nContent-Disposition: form-data; name="'+ file.name +'"'+ (file.file ? '; filename="'+ encodeURIComponent(file.file) +'"' : '') + + (file.file ? '\r\nContent-Type: '+ (file.type || 'application/octet-stream') : '') + + '\r\n' + + '\r\n'+ (file.file ? blob : encodeURIComponent(blob)) + + '\r\n') + ); + queue.next(); + }, true); + }, api.expando); + } + }; + + + function _convertFile(file, fn, useBinaryString){ + var blob = file.blob, filename = file.file; + + if( filename ){ + if( !blob.toDataURL ){ + // The Blob is not an image. + api.readAsBinaryString(blob, function (evt){ + if( evt.type == 'load' ){ + fn(file, evt.result); + } + }); + return; + } + + var + mime = { 'image/jpeg': '.jpe?g', 'image/png': '.png' } + , type = mime[file.type] ? file.type : 'image/png' + , ext = mime[type] || '.png' + , quality = blob.quality || 1 + ; + + if( !filename.match(new RegExp(ext+'$', 'i')) ){ + // Does not change the current extension, but add a new one. + filename += ext.replace('?', ''); + } + + file.file = filename; + file.type = type; + + if( !useBinaryString && blob.toBlob ){ + blob.toBlob(function (blob){ + fn(file, blob); + }, type, quality); + } + else { + fn(file, api.toBinaryString(blob.toDataURL(type, quality))); + } + } + else { + fn(file, blob); + } + } + + + // @export + api.Form = Form; +})(FileAPI, window); + +/*global window, FileAPI, Uint8Array */ + +(function (window, api){ + "use strict"; + + var + noop = function (){} + , document = window.document + + , XHR = function (options){ + this.uid = api.uid(); + this.xhr = { + abort: noop + , getResponseHeader: noop + , getAllResponseHeaders: noop + }; + this.options = options; + }, + + _xhrResponsePostfix = { '': 1, XML: 1, Text: 1, Body: 1 } + ; + + + XHR.prototype = { + status: 0, + statusText: '', + constructor: XHR, + + getResponseHeader: function (name){ + return this.xhr.getResponseHeader(name); + }, + + getAllResponseHeaders: function (){ + return this.xhr.getAllResponseHeaders() || {}; + }, + + end: function (status, statusText){ + var _this = this, options = _this.options; + + _this.end = + _this.abort = noop; + _this.status = status; + + if( statusText ){ + _this.statusText = statusText; + } + + api.log('xhr.end:', status, statusText); + options.complete(status == 200 || status == 201 ? false : _this.statusText || 'unknown', _this); + + if( _this.xhr && _this.xhr.node ){ + setTimeout(function (){ + var node = _this.xhr.node; + try { node.parentNode.removeChild(node); } catch (e){} + try { delete window[_this.uid]; } catch (e){} + window[_this.uid] = _this.xhr.node = null; + }, 9); + } + }, + + abort: function (){ + this.end(0, 'abort'); + + if( this.xhr ){ + this.xhr.aborted = true; + this.xhr.abort(); + } + }, + + send: function (FormData){ + var _this = this, options = this.options; + + FormData.toData(function (data){ + if( data instanceof Error ){ + _this.end(0, data.message); + } + else{ + // Start uploading + options.upload(options, _this); + _this._send.call(_this, options, data); + } + }, options); + }, + + _send: function (options, data){ + var _this = this, xhr, uid = _this.uid, onLoadFnName = _this.uid + "Load", url = options.url; + + api.log('XHR._send:', data); + + if( !options.cache ){ + // No cache + url += (~url.indexOf('?') ? '&' : '?') + api.uid(); + } + + if( data.nodeName ){ + var jsonp = options.jsonp; + + // prepare callback in GET + url = url.replace(/([a-z]+)=(\?)/i, '$1='+uid); + + // legacy + options.upload(options, _this); + + var + onPostMessage = function (evt){ + if( ~url.indexOf(evt.origin) ){ + try { + var result = api.parseJSON(evt.data); + if( result.id == uid ){ + complete(result.status, result.statusText, result.response); + } + } catch( err ){ + complete(0, err.message); + } + } + }, + + // jsonp-callack + complete = window[uid] = function (status, statusText, response){ + _this.readyState = 4; + _this.responseText = response; + _this.end(status, statusText); + + api.event.off(window, 'message', onPostMessage); + window[uid] = xhr = transport = window[onLoadFnName] = null; + } + ; + + _this.xhr.abort = function (){ + try { + if( transport.stop ){ transport.stop(); } + else if( transport.contentWindow.stop ){ transport.contentWindow.stop(); } + else { transport.contentWindow.document.execCommand('Stop'); } + } + catch (er) {} + complete(0, "abort"); + }; + + api.event.on(window, 'message', onPostMessage); + + window[onLoadFnName] = function (){ + try { + var + win = transport.contentWindow + , doc = win.document + , result = win.result || api.parseJSON(doc.body.innerHTML) + ; + complete(result.status, result.statusText, result.response); + } catch (e){ + api.log('[transport.onload]', e); + } + }; + + xhr = document.createElement('div'); + xhr.innerHTML = '
    ' + + '' + + (jsonp && (options.url.indexOf('=?') < 0) ? '' : '') + + '' + ; + + // get form-data & transport + var + form = xhr.getElementsByTagName('form')[0] + , transport = xhr.getElementsByTagName('iframe')[0] + ; + + form.appendChild(data); + + api.log(form.parentNode.innerHTML); + + // append to DOM + document.body.appendChild(xhr); + + // keep a reference to node-transport + _this.xhr.node = xhr; + + // send + _this.readyState = 2; // loaded + try { + form.submit(); + } catch (err) { + api.log('iframe.error: ' + err); + } + form = null; + } + else { + // Clean url + url = url.replace(/([a-z]+)=(\?)&?/i, ''); + + // html5 + if (this.xhr && this.xhr.aborted) { + api.log("Error: already aborted"); + return; + } + xhr = _this.xhr = api.getXHR(); + + if (data.params) { + url += (url.indexOf('?') < 0 ? "?" : "&") + data.params.join("&"); + } + + xhr.open('POST', url, true); + + if( api.withCredentials ){ + xhr.withCredentials = "true"; + } + + if( !options.headers || !options.headers['X-Requested-With'] ){ + xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + } + + api.each(options.headers, function (val, key){ + xhr.setRequestHeader(key, val); + }); + + + if ( options._chunked ) { + // chunked upload + if( xhr.upload ){ + xhr.upload.addEventListener('progress', api.throttle(function (/**Event*/evt){ + if (!data.retry) { + // show progress only for correct chunk uploads + options.progress({ + type: evt.type + , total: data.size + , loaded: data.start + evt.loaded + , totalSize: data.size + }, _this, options); + } + }, 100), false); + } + + xhr.onreadystatechange = function (){ + var lkb = parseInt(xhr.getResponseHeader('X-Last-Known-Byte'), 10); + + _this.status = xhr.status; + _this.statusText = xhr.statusText; + _this.readyState = xhr.readyState; + + if( xhr.readyState == 4 ){ + for( var k in _xhrResponsePostfix ){ + _this['response'+k] = xhr['response'+k]; + } + xhr.onreadystatechange = null; + + if (!xhr.status || xhr.status - 201 > 0) { + api.log("Error: " + xhr.status); + // some kind of error + // 0 - connection fail or timeout, if xhr.aborted is true, then it's not recoverable user action + // up - server error + if (((!xhr.status && !xhr.aborted) || 500 == xhr.status || 416 == xhr.status) && ++data.retry <= options.chunkUploadRetry) { + // let's try again the same chunk + // only applicable for recoverable error codes 500 && 416 + var delay = xhr.status ? 0 : api.chunkNetworkDownRetryTimeout; + + // inform about recoverable problems + options.pause(data.file, options); + + // smart restart if server reports about the last known byte + api.log("X-Last-Known-Byte: " + lkb); + if (lkb) { + data.end = lkb; + } else { + data.end = data.start - 1; + if (416 == xhr.status) { + data.end = data.end - options.chunkSize; + } + } + + setTimeout(function () { + _this._send(options, data); + }, delay); + } else { + // no mo retries + _this.end(xhr.status); + } + } else { + // success + data.retry = 0; + + if (data.end == data.size - 1) { + // finished + _this.end(xhr.status); + } else { + // next chunk + + // shift position if server reports about the last known byte + api.log("X-Last-Known-Byte: " + lkb); + if (lkb) { + data.end = lkb; + } + data.file.FileAPIReadPosition = data.end; + + setTimeout(function () { + _this._send(options, data); + }, 0); + } + } + + xhr = null; + } + }; + + data.start = data.end + 1; + data.end = Math.max(Math.min(data.start + options.chunkSize, data.size) - 1, data.start); + + // Retrieve a slice of file + var + file = data.file + , slice = (file.slice || file.mozSlice || file.webkitSlice).call(file, data.start, data.end + 1) + ; + + if( data.size && !slice.size ){ + setTimeout(function (){ + _this.end(-1); + }); + } else { + xhr.setRequestHeader("Content-Range", "bytes " + data.start + "-" + data.end + "/" + data.size); + xhr.setRequestHeader("Content-Disposition", 'attachment; filename=' + encodeURIComponent(data.name)); + xhr.setRequestHeader("Content-Type", data.type || "application/octet-stream"); + + xhr.send(slice); + } + + file = slice = null; + } else { + // single piece upload + if( xhr.upload ){ + // https://github.com/blueimp/jQuery-File-Upload/wiki/Fixing-Safari-hanging-on-very-high-speed-connections-%281Gbps%29 + xhr.upload.addEventListener('progress', api.throttle(function (/**Event*/evt){ + options.progress(evt, _this, options); + }, 100), false); + } + + xhr.onreadystatechange = function (){ + _this.status = xhr.status; + _this.statusText = xhr.statusText; + _this.readyState = xhr.readyState; + + if( xhr.readyState == 4 ){ + for( var k in _xhrResponsePostfix ){ + _this['response'+k] = xhr['response'+k]; + } + xhr.onreadystatechange = null; + + if (!xhr.status || xhr.status > 201) { + api.log("Error: " + xhr.status); + if (((!xhr.status && !xhr.aborted) || 500 == xhr.status) && (options.retry || 0) < options.uploadRetry) { + options.retry = (options.retry || 0) + 1; + var delay = api.networkDownRetryTimeout; + + // inform about recoverable problems + options.pause(options.file, options); + + setTimeout(function () { + _this._send(options, data); + }, delay); + } else { + //success + _this.end(xhr.status); + } + } else { + //success + _this.end(xhr.status); + } + + xhr = null; + } + }; + + if( api.isArray(data) ){ + // multipart + xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary=_'+api.expando); + var rawData = data.join('') +'--_'+ api.expando +'--'; + + /** @namespace xhr.sendAsBinary https://developer.mozilla.org/ru/XMLHttpRequest#Sending_binary_content */ + if( xhr.sendAsBinary ){ + xhr.sendAsBinary(rawData); + } + else { + var bytes = Array.prototype.map.call(rawData, function(c){ return c.charCodeAt(0) & 0xff; }); + xhr.send(new Uint8Array(bytes).buffer); + + } + } else { + // FormData + xhr.send(data); + } + } + } + } + }; + + + // @export + api.XHR = XHR; +})(window, FileAPI); + +/** + * @class FileAPI.Camera + * @author RubaXa + * @support Chrome 21+, FF 18+, Opera 12+ + */ + +/*global window, FileAPI, jQuery */ +/** @namespace LocalMediaStream -- https://developer.mozilla.org/en-US/docs/WebRTC/MediaStream_API#LocalMediaStream */ +(function (window, api){ + "use strict"; + + var + URL = window.URL || window.webkitURL, + + document = window.document, + navigator = window.navigator, + + getMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia, + + html5 = !!getMedia + ; + + + // Support "media" + api.support.media = html5; + + + var Camera = function (video){ + this.video = video; + }; + + + Camera.prototype = { + isActive: function (){ + return !!this._active; + }, + + + /** + * Start camera streaming + * @param {Function} callback + */ + start: function (callback){ + var + _this = this + , video = _this.video + , _successId + , _failId + , _complete = function (err){ + _this._active = !err; + clearTimeout(_failId); + clearTimeout(_successId); +// api.event.off(video, 'loadedmetadata', _complete); + callback && callback(err, _this); + } + ; + + getMedia.call(navigator, { video: true }, function (stream/**LocalMediaStream*/){ + // Success + _this.stream = stream; + +// api.event.on(video, 'loadedmetadata', function (){ +// _complete(null); +// }); + + // Set camera stream + video.src = URL.createObjectURL(stream); + + // Note: onloadedmetadata doesn't fire in Chrome when using it with getUserMedia. + // See crbug.com/110938. + _successId = setInterval(function (){ + if( _detectVideoSignal(video) ){ + _complete(null); + } + }, 1000); + + _failId = setTimeout(function (){ + _complete('timeout'); + }, 5000); + + // Go-go-go! + video.play(); + }, _complete/*error*/); + }, + + + /** + * Stop camera streaming + */ + stop: function (){ + try { + this._active = false; + this.video.pause(); + + try { + this.stream.stop(); + } catch (err) { + api.each(this.stream.getTracks(), function (track) { + track.stop(); + }); + } + + this.stream = null; + } catch( err ){ + api.log('[FileAPI.Camera] stop:', err); + } + }, + + + /** + * Create screenshot + * @return {FileAPI.Camera.Shot} + */ + shot: function (){ + return new Shot(this.video); + } + }; + + + /** + * Get camera element from container + * + * @static + * @param {HTMLElement} el + * @return {Camera} + */ + Camera.get = function (el){ + return new Camera(el.firstChild); + }; + + + /** + * Publish camera element into container + * + * @static + * @param {HTMLElement} el + * @param {Object} options + * @param {Function} [callback] + */ + Camera.publish = function (el, options, callback){ + if( typeof options == 'function' ){ + callback = options; + options = {}; + } + + // Dimensions of "camera" + options = api.extend({}, { + width: '100%' + , height: '100%' + , start: true + }, options); + + + if( el.jquery ){ + // Extract first element, from jQuery collection + el = el[0]; + } + + + var doneFn = function (err){ + if( err ){ + callback(err); + } + else { + // Get camera + var cam = Camera.get(el); + if( options.start ){ + cam.start(callback); + } + else { + callback(null, cam); + } + } + }; + + + el.style.width = _px(options.width); + el.style.height = _px(options.height); + + + if( api.html5 && html5 ){ + // Create video element + var video = document.createElement('video'); + + // Set dimensions + video.style.width = _px(options.width); + video.style.height = _px(options.height); + + // Clean container + if( window.jQuery ){ + jQuery(el).empty(); + } else { + el.innerHTML = ''; + } + + // Add "camera" to container + el.appendChild(video); + + // end + doneFn(); + } + else { + Camera.fallback(el, options, doneFn); + } + }; + + + Camera.fallback = function (el, options, callback){ + callback('not_support_camera'); + }; + + + /** + * @class FileAPI.Camera.Shot + */ + var Shot = function (video){ + var canvas = video.nodeName ? api.Image.toCanvas(video) : video; + var shot = api.Image(canvas); + shot.type = 'image/png'; + shot.width = canvas.width; + shot.height = canvas.height; + shot.size = canvas.width * canvas.height * 4; + return shot; + }; + + + /** + * Add "px" postfix, if value is a number + * + * @private + * @param {*} val + * @return {String} + */ + function _px(val){ + return val >= 0 ? val + 'px' : val; + } + + + /** + * @private + * @param {HTMLVideoElement} video + * @return {Boolean} + */ + function _detectVideoSignal(video){ + var canvas = document.createElement('canvas'), ctx, res = false; + try { + ctx = canvas.getContext('2d'); + ctx.drawImage(video, 0, 0, 1, 1); + res = ctx.getImageData(0, 0, 1, 1).data[4] != 255; + } + catch( err ){ + api.log('[FileAPI.Camera] detectVideoSignal:', err); + } + return res; + } + + + // @export + Camera.Shot = Shot; + api.Camera = Camera; +})(window, FileAPI); + +/** + * FileAPI fallback to Flash + * + * @flash-developer "Vladimir Demidov" + */ + +/*global window, ActiveXObject, FileAPI */ +(function (window, jQuery, api) { + "use strict"; + + var + document = window.document + , location = window.location + , navigator = window.navigator + , _each = api.each + ; + + + api.support.flash = (function (){ + var mime = navigator.mimeTypes, has = false; + + if( navigator.plugins && typeof navigator.plugins['Shockwave Flash'] == 'object' ){ + has = navigator.plugins['Shockwave Flash'].description && !(mime && mime['application/x-shockwave-flash'] && !mime['application/x-shockwave-flash'].enabledPlugin); + } + else { + try { + has = !!(window.ActiveXObject && new ActiveXObject('ShockwaveFlash.ShockwaveFlash')); + } + catch(er){ + api.log('Flash -- does not supported.'); + } + } + + if( has && /^file:/i.test(location) ){ + api.log('[warn] Flash does not work on `file:` protocol.'); + } + + return has; + })(); + + + api.support.flash + && (0 + || !api.html5 || !api.support.html5 + || (api.cors && !api.support.cors) + || (api.media && !api.support.media) + ) + && (function (){ + var + _attr = api.uid() + , _retry = 0 + , _files = {} + , _rhttp = /^https?:/i + + , flash = { + _fn: {}, + + + /** + * Initialization & preload flash object + */ + init: function (){ + var child = document.body && document.body.firstChild; + + if( child ){ + do { + if( child.nodeType == 1 ){ + api.log('FlashAPI.state: awaiting'); + + var dummy = document.createElement('div'); + + dummy.id = '_' + _attr; + + _css(dummy, { + top: 1 + , right: 1 + , width: 5 + , height: 5 + , position: 'absolute' + , zIndex: 2147483647+'' // set max zIndex + }); + + child.parentNode.insertBefore(dummy, child); + flash.publish(dummy, _attr); + + return; + } + } + while( child = child.nextSibling ); + } + + if( _retry < 10 ){ + setTimeout(flash.init, ++_retry*50); + } + }, + + + /** + * Publish flash-object + * + * @param {HTMLElement} el + * @param {String} id + * @param {Object} [opts] + */ + publish: function (el, id, opts){ + opts = opts || {}; + el.innerHTML = _makeFlashHTML({ + id: id + , src: _getUrl(api.flashUrl, 'r=' + api.version) +// , src: _getUrl('http://v.demidov.boom.corp.mail.ru/uploaderfileapi/FlashFileAPI.swf?1') + , wmode: opts.camera ? '' : 'transparent' + , flashvars: 'callback=' + (opts.onEvent || 'FileAPI.Flash.onEvent') + + '&flashId='+ id + + '&storeKey='+ navigator.userAgent.match(/\d/ig).join('') +'_'+ api.version + + (flash.isReady || (api.pingUrl ? '&ping='+api.pingUrl : '')) + + '&timeout='+api.flashAbortTimeout + + (opts.camera ? '&useCamera=' + _getUrl(api.flashWebcamUrl) : '') + + '&debug='+(api.debug?"1":"") + }, opts); + }, + + + ready: function (){ + api.log('FlashAPI.state: ready'); + + flash.ready = api.F; + flash.isReady = true; + flash.patch(); + flash.patchCamera && flash.patchCamera(); + api.event.on(document, 'mouseover', flash.mouseover); + api.event.on(document, 'click', function (evt){ + if( flash.mouseover(evt) ){ + evt.preventDefault + ? evt.preventDefault() + : (evt.returnValue = true) + ; + } + }); + }, + + + getEl: function (){ + return document.getElementById('_'+_attr); + }, + + + getWrapper: function (node){ + do { + if( /js-fileapi-wrapper/.test(node.className) ){ + return node; + } + } + while( (node = node.parentNode) && (node !== document.body) ); + }, + + + mouseover: function (evt){ + var target = api.event.fix(evt).target; + + if( /input/i.test(target.nodeName) && target.type == 'file' && !target.disabled ){ + var + state = target.getAttribute(_attr) + , wrapper = flash.getWrapper(target) + ; + + if( api.multiFlash ){ + // check state: + // p — published + // i — initialization + // r — ready + if( state == 'i' || state == 'r' ){ + // publish fail + return false; + } + else if( state != 'p' ){ + // set "init" state + target.setAttribute(_attr, 'i'); + + var dummy = document.createElement('div'); + + if( !wrapper ){ + api.log('[err] FlashAPI.mouseover: js-fileapi-wrapper not found'); + return; + } + + _css(dummy, { + top: 0 + , left: 0 + , width: target.offsetWidth + , height: target.offsetHeight + , zIndex: 2147483647+'' // set max zIndex + , position: 'absolute' + }); + + wrapper.appendChild(dummy); + flash.publish(dummy, api.uid()); + + // set "publish" state + target.setAttribute(_attr, 'p'); + } + + return true; + } + else if( wrapper ){ + // Use one flash element + var box = _getDimensions(wrapper); + + _css(flash.getEl(), box); + + // Set current input + flash.curInp = target; + } + } + else if( !/object|embed/i.test(target.nodeName) ){ + _css(flash.getEl(), { top: 1, left: 1, width: 5, height: 5 }); + } + }, + + onEvent: function (evt){ + var type = evt.type; + + if( type == 'ready' ){ + try { + // set "ready" state + flash.getInput(evt.flashId).setAttribute(_attr, 'r'); + } catch (e){ + } + + flash.ready(); + setTimeout(function (){ flash.mouseenter(evt); }, 50); + return true; + } + else if( type === 'ping' ){ + api.log('(flash -> js).ping:', [evt.status, evt.savedStatus], evt.error); + } + else if( type === 'log' ){ + api.log('(flash -> js).log:', evt.target); + } + else if( type in flash ){ + setTimeout(function (){ + api.log('FlashAPI.event.'+evt.type+':', evt); + flash[type](evt); + }, 1); + } + }, + + + mouseenter: function (evt){ + var node = flash.getInput(evt.flashId); + + if( node ){ + // Set multiple mode + flash.cmd(evt, 'multiple', node.getAttribute('multiple') != null); + + + // Set files filter + var accept = [], exts = {}; + + _each((node.getAttribute('accept') || '').split(/,\s*/), function (mime){ + api.accept[mime] && _each(api.accept[mime].split(' '), function (ext){ + exts[ext] = 1; + }); + }); + + _each(exts, function (i, ext){ + accept.push( ext ); + }); + + flash.cmd(evt, 'accept', accept.length ? accept.join(',')+','+accept.join(',').toUpperCase() : '*'); + } + }, + + + get: function (id){ + return document[id] || window[id] || document.embeds[id]; + }, + + + getInput: function (id){ + if( api.multiFlash ){ + try { + var node = flash.getWrapper(flash.get(id)); + if( node ){ + return node.getElementsByTagName('input')[0]; + } + } catch (e){ + api.log('[err] Can not find "input" by flashId:', id, e); + } + } else { + return flash.curInp; + } + }, + + + select: function (evt){ + var + inp = flash.getInput(evt.flashId) + , uid = api.uid(inp) + , files = evt.target.files + , event + ; + + _each(files, function (file){ + api.checkFileObj(file); + }); + + _files[uid] = files; + + if( document.createEvent ){ + event = document.createEvent('Event'); + event.files = files; + event.initEvent('change', true, true); + inp.dispatchEvent(event); + } + else if( jQuery ){ + jQuery(inp).trigger({ type: 'change', files: files }); + } + else { + event = document.createEventObject(); + event.files = files; + inp.fireEvent('onchange', event); + } + }, + + + cmd: function (id, name, data, last){ + try { + api.log('(js -> flash).'+name+':', data); + return flash.get(id.flashId || id).cmd(name, data); + } catch (err){ + api.log('(js -> flash).onError:', err.toString()); + if( !last ){ + // try again + setTimeout(function (){ flash.cmd(id, name, data, true); }, 50); + } + } + }, + + + patch: function (){ + api.flashEngine = true; + + // FileAPI + _inherit(api, { + getFiles: function (input, filter, callback){ + if( callback ){ + api.filterFiles(api.getFiles(input), filter, callback); + return null; + } + + var files = api.isArray(input) ? input : _files[api.uid(input.target || input.srcElement || input)]; + + + if( !files ){ + // Файлов нету, вызываем родительский метод + return this.parent.apply(this, arguments); + } + + + if( filter ){ + filter = api.getFilesFilter(filter); + files = api.filter(files, function (file){ return filter.test(file.name); }); + } + + return files; + }, + + + getInfo: function (file, fn){ + if( _isHtmlFile(file) ){ + this.parent.apply(this, arguments); + } + else if( file.isShot ){ + fn(null, file.info = { + width: file.width, + height: file.height + }); + } + else { + if( !file.__info ){ + var defer = file.__info = api.defer(); + + flash.cmd(file, 'getFileInfo', { + id: file.id + , callback: _wrap(function _(err, info){ + _unwrap(_); + defer.resolve(err, file.info = info); + }) + }); + } + + file.__info.then(fn); + } + } + }); + + + // FileAPI.Image + api.support.transform = true; + api.Image && _inherit(api.Image.prototype, { + get: function (fn, scaleMode){ + this.set({ scaleMode: scaleMode || 'noScale' }); // noScale, exactFit + return this.parent(fn); + }, + + _load: function (file, fn){ + api.log('FlashAPI.Image._load:', file); + + if( _isHtmlFile(file) ){ + this.parent.apply(this, arguments); + } + else { + var _this = this; + api.getInfo(file, function (err){ + fn.call(_this, err, file); + }); + } + }, + + _apply: function (file, fn){ + api.log('FlashAPI.Image._apply:', file); + + if( _isHtmlFile(file) ){ + this.parent.apply(this, arguments); + } + else { + var m = this.getMatrix(file.info), doneFn = fn; + + flash.cmd(file, 'imageTransform', { + id: file.id + , matrix: m + , callback: _wrap(function _(err, base64){ + api.log('FlashAPI.Image._apply.callback:', err); + _unwrap(_); + + if( err ){ + doneFn(err); + } + else if( !api.support.html5 && (!api.support.dataURI || base64.length > 3e4) ){ + _makeFlashImage({ + width: (m.deg % 180) ? m.dh : m.dw + , height: (m.deg % 180) ? m.dw : m.dh + , scale: m.scaleMode + }, base64, doneFn); + } + else { + if( m.filter ){ + doneFn = function (err, img){ + if( err ){ + fn(err); + } + else { + api.Image.applyFilter(img, m.filter, function (){ + fn(err, this.canvas); + }); + } + }; + } + + api.newImage('data:'+ file.type +';base64,'+ base64, doneFn); + } + }) + }); + } + }, + + toData: function (fn){ + var + file = this.file + , info = file.info + , matrix = this.getMatrix(info) + ; + api.log('FlashAPI.Image.toData'); + + if( _isHtmlFile(file) ){ + this.parent.apply(this, arguments); + } + else { + if( matrix.deg == 'auto' ){ + matrix.deg = api.Image.exifOrientation[info && info.exif && info.exif.Orientation] || 0; + } + + fn.call(this, !file.info, { + id: file.id + , flashId: file.flashId + , name: file.name + , type: file.type + , matrix: matrix + }); + } + } + }); + + + api.Image && _inherit(api.Image, { + fromDataURL: function (dataURL, size, callback){ + if( !api.support.dataURI || dataURL.length > 3e4 ){ + _makeFlashImage( + api.extend({ scale: 'exactFit' }, size) + , dataURL.replace(/^data:[^,]+,/, '') + , function (err, el){ callback(el); } + ); + } + else { + this.parent(dataURL, size, callback); + } + } + }); + + // FileAPI.Form + _inherit(api.Form.prototype, { + toData: function (fn){ + var items = this.items, i = items.length; + + for( ; i--; ){ + if( items[i].file && _isHtmlFile(items[i].blob) ){ + return this.parent.apply(this, arguments); + } + } + + api.log('FlashAPI.Form.toData'); + fn(items); + } + }); + + + // FileAPI.XHR + _inherit(api.XHR.prototype, { + _send: function (options, formData){ + if( + formData.nodeName + || formData.append && api.support.html5 + || api.isArray(formData) && (typeof formData[0] === 'string') + ){ + // HTML5, Multipart or IFrame + return this.parent.apply(this, arguments); + } + + + var + data = {} + , files = {} + , _this = this + , flashId + , fileId + ; + + _each(formData, function (item){ + if( item.file ){ + files[item.name] = item = _getFileDescr(item.blob); + fileId = item.id; + flashId = item.flashId; + } + else { + data[item.name] = item.blob; + } + }); + + if( !fileId ){ + flashId = _attr; + } + + if( !flashId ){ + api.log('[err] FlashAPI._send: flashId -- undefined'); + return this.parent.apply(this, arguments); + } + else { + api.log('FlashAPI.XHR._send: '+ flashId +' -> '+ fileId); + } + + _this.xhr = { + headers: {}, + abort: function (){ flash.cmd(flashId, 'abort', { id: fileId }); }, + getResponseHeader: function (name){ return this.headers[name]; }, + getAllResponseHeaders: function (){ return this.headers; } + }; + + var queue = api.queue(function (){ + flash.cmd(flashId, 'upload', { + url: _getUrl(options.url.replace(/([a-z]+)=(\?)&?/i, '')) + , data: data + , files: fileId ? files : null + , headers: options.headers || {} + , callback: _wrap(function upload(evt){ + var type = evt.type, result = evt.result; + + api.log('FlashAPI.upload.'+type); + + if( type == 'progress' ){ + evt.loaded = Math.min(evt.loaded, evt.total); // @todo fixme + evt.lengthComputable = true; + options.progress(evt); + } + else if( type == 'complete' ){ + _unwrap(upload); + + if( typeof result == 'string' ){ + _this.responseText = result.replace(/%22/g, "\"").replace(/%5c/g, "\\").replace(/%26/g, "&").replace(/%25/g, "%"); + } + + _this.end(evt.status || 200); + } + else if( type == 'abort' || type == 'error' ){ + _this.end(evt.status || 0, evt.message); + _unwrap(upload); + } + }) + }); + }); + + + // #2174: FileReference.load() call while FileReference.upload() or vice versa + _each(files, function (file){ + queue.inc(); + api.getInfo(file, queue.next); + }); + + queue.check(); + } + }); + } + } + ; + + + function _makeFlashHTML(opts){ + return ('' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '').replace(/#(\w+)#/ig, function (a, name){ return opts[name]; }) + ; + } + + + function _css(el, css){ + if( el && el.style ){ + var key, val; + for( key in css ){ + val = css[key]; + if( typeof val == 'number' ){ + val += 'px'; + } + try { el.style[key] = val; } catch (e) {} + } + } + } + + + function _inherit(obj, methods){ + _each(methods, function (fn, name){ + var prev = obj[name]; + obj[name] = function (){ + this.parent = prev; + return fn.apply(this, arguments); + }; + }); + } + + function _isHtmlFile(file){ + return file && !file.flashId; + } + + function _wrap(fn){ + var id = fn.wid = api.uid(); + flash._fn[id] = fn; + return 'FileAPI.Flash._fn.'+id; + } + + + function _unwrap(fn){ + try { + flash._fn[fn.wid] = null; + delete flash._fn[fn.wid]; + } + catch(e){} + } + + + function _getUrl(url, params){ + if( !_rhttp.test(url) ){ + if( /^\.\//.test(url) || '/' != url.charAt(0) ){ + var path = location.pathname; + path = path.substr(0, path.lastIndexOf('/')); + url = (path +'/'+ url).replace('/./', '/'); + } + + if( '//' != url.substr(0, 2) ){ + url = '//' + location.host + url; + } + + if( !_rhttp.test(url) ){ + url = location.protocol + url; + } + } + + if( params ){ + url += (/\?/.test(url) ? '&' : '?') + params; + } + + return url; + } + + + function _makeFlashImage(opts, base64, fn){ + var + key + , flashId = api.uid() + , el = document.createElement('div') + , attempts = 10 + ; + + for( key in opts ){ + el.setAttribute(key, opts[key]); + el[key] = opts[key]; + } + + _css(el, opts); + + opts.width = '100%'; + opts.height = '100%'; + + el.innerHTML = _makeFlashHTML(api.extend({ + id: flashId + , src: _getUrl(api.flashImageUrl, 'r='+ api.uid()) + , wmode: 'opaque' + , flashvars: 'scale='+ opts.scale +'&callback='+_wrap(function _(){ + _unwrap(_); + if( --attempts > 0 ){ + _setImage(); + } + return true; + }) + }, opts)); + + function _setImage(){ + try { + // Get flash-object by id + var img = flash.get(flashId); + img.setImage(base64); + } catch (e){ + api.log('[err] FlashAPI.Preview.setImage -- can not set "base64":', e); + } + } + + fn(false, el); + el = null; + } + + + function _getFileDescr(file){ + return { + id: file.id + , name: file.name + , matrix: file.matrix + , flashId: file.flashId + }; + } + + + function _getDimensions(el){ + var + box = el.getBoundingClientRect() + , body = document.body + , docEl = (el && el.ownerDocument).documentElement + ; + + return { + top: box.top + (window.pageYOffset || docEl.scrollTop) - (docEl.clientTop || body.clientTop || 0) + , left: box.left + (window.pageXOffset || docEl.scrollLeft) - (docEl.clientLeft || body.clientLeft || 0) + , width: box.right - box.left + , height: box.bottom - box.top + }; + } + + // @export + api.Flash = flash; + + + // Check dataURI support + api.newImage('data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==', function (err, img){ + api.support.dataURI = !(img.width != 1 || img.height != 1); + flash.init(); + }); + })(); +})(window, window.jQuery, FileAPI); + +/** + * FileAPI fallback to Flash + * + * @flash-developer "Vladimir Demidov" + */ + +/*global window, FileAPI */ +(function (window, jQuery, api) { + "use strict"; + + var _each = api.each, + _cameraQueue = []; + + if (api.support.flash && (api.media && (!api.support.media || !api.html5))) { + (function () { + function _wrap(fn) { + var id = fn.wid = api.uid(); + api.Flash._fn[id] = fn; + return 'FileAPI.Flash._fn.' + id; + } + + + function _unwrap(fn) { + try { + api.Flash._fn[fn.wid] = null; + delete api.Flash._fn[fn.wid]; + } catch (e) { + } + } + + var flash = api.Flash; + api.extend(api.Flash, { + + patchCamera: function () { + api.Camera.fallback = function (el, options, callback) { + var camId = api.uid(); + api.log('FlashAPI.Camera.publish: ' + camId); + flash.publish(el, camId, api.extend(options, { + camera: true, + onEvent: _wrap(function _(evt) { + if (evt.type === 'camera') { + _unwrap(_); + + if (evt.error) { + api.log('FlashAPI.Camera.publish.error: ' + evt.error); + callback(evt.error); + } else { + api.log('FlashAPI.Camera.publish.success: ' + camId); + callback(null); + } + } + }) + })); + }; + // Run + _each(_cameraQueue, function (args) { + api.Camera.fallback.apply(api.Camera, args); + }); + _cameraQueue = []; + + + // FileAPI.Camera:proto + api.extend(api.Camera.prototype, { + _id: function () { + return this.video.id; + }, + + start: function (callback) { + var _this = this; + flash.cmd(this._id(), 'camera.on', { + callback: _wrap(function _(evt) { + _unwrap(_); + + if (evt.error) { + api.log('FlashAPI.camera.on.error: ' + evt.error); + callback(evt.error, _this); + } else { + api.log('FlashAPI.camera.on.success: ' + _this._id()); + _this._active = true; + callback(null, _this); + } + }) + }); + }, + + stop: function () { + this._active = false; + flash.cmd(this._id(), 'camera.off'); + }, + + shot: function () { + api.log('FlashAPI.Camera.shot:', this._id()); + + var shot = api.Flash.cmd(this._id(), 'shot', {}); + shot.type = 'image/png'; + shot.flashId = this._id(); + shot.isShot = true; + + return new api.Camera.Shot(shot); + } + }); + } + }); + + api.Camera.fallback = function () { + _cameraQueue.push(arguments); + }; + + }()); + } +}(window, window.jQuery, FileAPI)); if( typeof define === "function" && define.amd ){ define("FileAPI", [], function (){ return FileAPI; }); } \ No newline at end of file diff --git a/manager/media/browser/mcpuk/js/FileAPI/FileAPI.min.js b/manager/media/browser/mcpuk/js/FileAPI/FileAPI.min.js index e7cf53fff3..01020adec0 100644 --- a/manager/media/browser/mcpuk/js/FileAPI/FileAPI.min.js +++ b/manager/media/browser/mcpuk/js/FileAPI/FileAPI.min.js @@ -1,3 +1,3 @@ -/*! FileAPI 2.0.19 - BSD | git://github.com/mailru/FileAPI.git */ -!function(a){"use strict";var b=a.HTMLCanvasElement&&a.HTMLCanvasElement.prototype,c=a.Blob&&function(){try{return Boolean(new Blob)}catch(a){return!1}}(),d=c&&a.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(a){return!1}}(),e=a.BlobBuilder||a.WebKitBlobBuilder||a.MozBlobBuilder||a.MSBlobBuilder,f=(c||e)&&a.atob&&a.ArrayBuffer&&a.Uint8Array&&function(a){var b,f,g,h,i,j;for(b=a.split(",")[0].indexOf("base64")>=0?atob(a.split(",")[1]):decodeURIComponent(a.split(",")[1]),f=new ArrayBuffer(b.length),g=new Uint8Array(f),h=0;h0,H=a.dataURLtoBlob,I=/img/i,J=/canvas/i,K=/img|canvas/i,L=/input/i,M=/^data:[^,]+,/,N={}.toString,O=a.Math,P=function(b){return b=new a.Number(O.pow(1024,b)),b.from=function(a){return O.round(a*this)},b},Q={},R=[],S="abort progress error load loadend",T="status statusText readyState response responseXML responseText responseBody".split(" "),U="currentTarget",V="preventDefault",W=function(a){return a&&"length"in a},X=function(a,b,c){if(a)if(W(a))for(var d=0,e=a.length;e>d;d++)d in a&&b.call(c,a[d],d,a);else for(var f in a)a.hasOwnProperty(f)&&b.call(c,a[f],f,a)},Y=function(a){for(var b=arguments,c=1,d=function(b,c){a[c]=b};c=c&&!d&&f.end()},isFail:function(){return d},fail:function(){!d&&a(d=!0)},end:function(){e||(e=!0,a())}};return f},each:X,afor:function(a,b){var c=0,d=a.length;W(a)&&d--?!function e(){b(d!=c&&e,a[c],c++)}():b(!1)},extend:Y,isFile:function(a){return"[object File]"===N.call(a)},isBlob:function(a){return this.isFile(a)||"[object Blob]"===N.call(a)},isCanvas:function(a){return a&&J.test(a.nodeName)},getFilesFilter:function(a){return a="string"==typeof a?a:a.getAttribute&&a.getAttribute("accept")||"",a?new RegExp("("+a.replace(/\./g,"\\.").replace(/,/g,"|")+")$","i"):/./},readAsDataURL:function(a,b){ca.isCanvas(a)?c(a,b,"load",ca.toDataURL(a)):e(a,b,"DataURL")},readAsBinaryString:function(a,b){d("BinaryString")?e(a,b,"BinaryString"):e(a,function(a){if("load"==a.type)try{a.result=ca.toBinaryString(a.result)}catch(c){a.type="error",a.message=c.toString()}b(a)},"DataURL")},readAsArrayBuffer:function(a,b){e(a,b,"ArrayBuffer")},readAsText:function(a,b,c){c||(c=b,b="utf-8"),e(a,c,"Text",b)},toDataURL:function(a,b){return"string"==typeof a?a:a.toDataURL?a.toDataURL(b||"image/png"):void 0},toBinaryString:function(b){return a.atob(ca.toDataURL(b).replace(M,""))},readAsImage:function(a,d,e){if(ca.isBlob(a))if(w){var f=w.createObjectURL(a);f===b?c(a,d,"error"):ca.readAsImage(f,d,e)}else ca.readAsDataURL(a,function(b){"load"==b.type?ca.readAsImage(b.result,d,e):(e||"error"==b.type)&&c(a,d,b,null,{loaded:b.loaded,total:b.total})});else if(ca.isCanvas(a))c(a,d,"load",a);else if(I.test(a.nodeName))if(a.complete)c(a,d,"load",a);else{var g="error abort load";_(a,g,function i(b){"load"==b.type&&w&&w.revokeObjectURL(a.src),$(a,g,i),c(a,d,b,a)})}else if(a.iframe)c(a,d,{type:"error"});else{var h=ca.newImage(a.dataURL||a);ca.readAsImage(h,d,e)}},checkFileObj:function(a){var b={},c=ca.accept;return"object"==typeof a?b=a:b.name=(a+"").split(/\\|\//g).pop(),null==b.type&&(b.type=b.name.split(".").pop()),X(c,function(a,c){a=new RegExp(a.replace(/\s/g,"|"),"i"),(a.test(b.type)||ca.ext2mime[b.type])&&(b.type=ca.ext2mime[b.type]||c.split("/")[0]+"/"+b.type)}),b},getDropFiles:function(a,b){var c,d=[],e=[],j=l(a),k=j.files,m=j.items,n=W(m)&&m[0]&&h(m[0]),o=ca.queue(function(){b(d,e)});if(n)if(G&&k){var p,q,r=k.length;for(c=new Array(r);r--;){p=k[r];try{q=h(m[r])}catch(s){ca.log("[err] getDropFiles: ",s),q=null}g(q)&&(q.isDirectory||q.isFile&&p.name==p.name.normalize("NFC"))?c[r]=q:c[r]=p}}else c=m;else c=k;X(c||[],function(a){o.inc();try{n&&g(a)?i(a,function(a,b,c){a?ca.log("[err] getDropFiles:",a):d.push.apply(d,b),e.push.apply(e,c),o.next()}):f(a,function(b,c){b?d.push(a):a.error=c,e.push(a),o.next()})}catch(b){o.next(),ca.log("[err] getDropFiles: ",b)}}),o.check()},getFiles:function(a,b,c){var d=[];return c?(ca.filterFiles(ca.getFiles(a),b,c),null):(a.jquery&&(a.each(function(){d=d.concat(ca.getFiles(this))}),a=d,d=[]),"string"==typeof b&&(b=ca.getFilesFilter(b)),a.originalEvent?a=aa(a.originalEvent):a.srcElement&&(a=aa(a)),a.dataTransfer?a=a.dataTransfer:a.target&&(a=a.target),a.files?(d=a.files,D||(d[0].blob=a,d[0].iframe=!0)):!D&&k(a)?ca.trim(a.value)&&(d=[ca.checkFileObj(a.value)],d[0].blob=a,d[0].iframe=!0):W(a)&&(d=a),ca.filter(d,function(a){return!b||b.test(a.name)}))},getTotalSize:function(a){for(var b=0,c=a&&a.length;c--;)b+=a[c].size;return b},getInfo:function(a,b){var c={},d=R.concat();ca.isBlob(a)?!function e(){var f=d.shift();f?f.test(a.type)?f(a,function(a,d){a?b(a):(Y(c,d),e())}):e():b(!1,c)}():b("not_support_info",c)},addInfoReader:function(a,b){b.test=function(b){return a.test(b)},R.push(b)},filter:function(a,b){for(var c,d=[],e=0,f=a.length;f>e;e++)e in a&&(c=a[e],b.call(c,c,e,a)&&d.push(c));return d},filterFiles:function(a,b,c){if(a.length){var d,e=a.concat(),f=[],g=[];!function h(){e.length?(d=e.shift(),ca.getInfo(d,function(a,c){(b(d,a?!1:c)?f:g).push(d),h()})):c(f,g)}()}else c([],a)},upload:function(a){a=Y({jsonp:"callback",prepare:ca.F,beforeupload:ca.F,upload:ca.F,fileupload:ca.F,fileprogress:ca.F,filecomplete:ca.F,progress:ca.F,complete:ca.F,pause:ca.F,imageOriginal:!0,chunkSize:ca.chunkSize,chunkUploadRetry:ca.chunkUploadRetry,uploadRetry:ca.uploadRetry},a),a.imageAutoOrientation&&!a.imageTransform&&(a.imageTransform={rotate:"auto"});var b,c=new ca.XHR(a),d=this._getFilesDataArray(a.files),e=this,f=0,g=0,h=!1;return X(d,function(a){f+=a.size}),c.files=[],X(d,function(a){c.files.push(a.file)}),c.total=f,c.loaded=0,c.filesLeft=d.length,a.beforeupload(c,a),b=function(){var i=d.shift(),k=i&&i.file,l=!1,m=j(a);if(c.filesLeft=d.length,k&&k.name===ca.expando&&(k=null,ca.log("[warn] FileAPI.upload() — called without files")),("abort"!=c.statusText||c.current)&&i){if(h=!1,c.currentFile=k,k&&a.prepare(k,m)===!1)return void b.call(e);m.file=k,e._getFormData(m,i,function(h){g||a.upload(c,a);var j=new ca.XHR(Y({},m,{upload:k?function(){a.fileupload(k,j,m)}:q,progress:k?function(b){l||(l=b.loaded===b.total,a.fileprogress({type:"progress",total:i.total=b.total,loaded:i.loaded=b.loaded},k,j,m),a.progress({type:"progress",total:f,loaded:c.loaded=g+i.size*(b.loaded/b.total)||0},k,j,m))}:q,complete:function(d){X(T,function(a){c[a]=j[a]}),k&&(i.total=i.total||i.size,i.loaded=i.total,d||(this.progress(i),l=!0,g+=i.size,c.loaded=g),a.filecomplete(d,j,k,m)),setTimeout(function(){b.call(e)},0)}}));c.abort=function(a){a||(d.length=0),this.current=a,j.abort()},j.send(h)})}else{var n=200==c.status||201==c.status||204==c.status;a.complete(n?!1:c.statusText||"error",c,a),h=!0}},setTimeout(b,0),c.append=function(a,g){a=ca._getFilesDataArray([].concat(a)),X(a,function(a){f+=a.size,c.files.push(a.file),g?d.unshift(a):d.push(a)}),c.statusText="",h&&b.call(e)},c.remove=function(a){for(var b,c=d.length;c--;)d[c].file==a&&(b=d.splice(c,1),f-=b.size);return b},c},_getFilesDataArray:function(a){var b=[],c={};if(k(a)){var d=ca.getFiles(a);c[a.name||"file"]=null!==a.getAttribute("multiple")?d:d[0]}else W(a)&&k(a[0])?X(a,function(a){c[a.name||"file"]=ca.getFiles(a)}):c=a;return X(c,function e(a,c){W(a)?X(a,function(a){e(a,c)}):a&&(a.name||a.image)&&b.push({name:c,file:a,size:a.size,total:a.size,loaded:0})}),b.length||b.push({file:{name:ca.expando}}),b},_getFormData:function(a,b,c){var d=b.file,e=b.name,f=d.name,g=d.type,h=ca.support.transform&&a.imageTransform,i=new ca.Form,j=ca.queue(function(){c(i)}),k=h&&m(h),l=ca.postNameConcat;X(a.data,function n(a,b){"object"==typeof a?X(a,function(a,c){n(a,l(b,c))}):i.append(b,a)}),function o(b){b.image?(j.inc(),b.toData(function(a,c){b.file&&(c.type=b.file.type,c.quality=b.matrix.quality,f=b.file&&b.file.name),f=f||(new Date).getTime()+".png",o(c),j.next()})):ca.Image&&h&&(/^image/.test(b.type)||K.test(b.nodeName))?(j.inc(),k&&(h=[h]),ca.Image.transform(b,h,a.imageAutoOrientation,function(c,d){if(k&&!c)H||ca.flashEngine||(i.multipart=!0),i.append(e,d[0],f,h[0].type||g);else{var m=0;c||X(d,function(a,b){H||ca.flashEngine||(i.multipart=!0),h[b].postName||(m=1),i.append(h[b].postName||l(e,b),a,f,h[b].type||g)}),(c||a.imageOriginal)&&i.append(l(e,m?"original":null),b,f,g)}j.next()})):f!==ca.expando&&i.append(e,b,f)}(d),j.check()},reset:function(a,b){var c,d;return C?(d=C(a).clone(!0).insertBefore(a).val("")[0],b||C(a).remove()):(c=a.parentNode,d=c.insertBefore(a.cloneNode(!0),a),d.value="",b||c.removeChild(a),X(Q[ca.uid(a)],function(b,c){X(b,function(b){$(a,c,b),Z(d,c,b)})})),d},load:function(a,b){var c=ca.getXHR();return c?(c.open("GET",a,!0),c.overrideMimeType&&c.overrideMimeType("text/plain; charset=x-user-defined"),Z(c,"progress",function(a){a.lengthComputable&&b({type:a.type,loaded:a.loaded,total:a.total},c)}),c.onreadystatechange=function(){if(4==c.readyState)if(c.onreadystatechange=null,200==c.status){a=a.split("/");var d={name:a[a.length-1],size:c.getResponseHeader("Content-Length"),type:c.getResponseHeader("Content-Type")};d.dataURL="data:"+d.type+";base64,"+ca.encode64(c.responseBody||c.responseText),b({type:"load",result:d},c)}else b({type:"error"},c)},c.send(null)):b({type:"error"}),c},encode64:function(a){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",d=0;for("string"!=typeof a&&(a=String(a));d>2,k=(3&g)<<4|h>>4;isNaN(h)?e=f=64:(e=(15&h)<<2|i>>6,f=isNaN(i)?64:63&i),c+=b.charAt(j)+b.charAt(k)+b.charAt(e)+b.charAt(f)}return c}};ca.addInfoReader(/^image/,function(a,b){if(!a.__dimensions){var c=a.__dimensions=ca.defer();ca.readAsImage(a,function(a){var b=a.target;c.resolve("load"==a.type?!1:"error",{width:b.width,height:b.height}),b.src=ca.EMPTY_PNG,b=null})}a.__dimensions.then(b)}),ca.event.dnd=function(a,b,c){var d,e;c||(c=b,b=ca.F),z?(Z(a,"dragenter dragleave dragover",b.ff=b.ff||function(a){for(var c=l(a).types,f=c&&c.length,g=!1;f--;)if(~c[f].indexOf("File")){a[V](),e!==a.type&&(e=a.type,"dragleave"!=e&&b.call(a[U],!0,a),g=!0);break}g&&(clearTimeout(d),d=setTimeout(function(){b.call(a[U],"dragleave"!=e,a)},50))}),Z(a,"drop",c.ff=c.ff||function(a){a[V](),e=0,b.call(a[U],!1,a),ca.getDropFiles(a,function(b,d){c.call(a[U],b,d,a)})})):ca.log("Drag'n'Drop -- not supported")},ca.event.dnd.off=function(a,b,c){$(a,"dragenter dragleave dragover",b.ff),$(a,"drop",c.ff)},C&&!C.fn.dnd&&(C.fn.dnd=function(a,b){return this.each(function(){ca.event.dnd(this,a,b)})},C.fn.offdnd=function(a,b){return this.each(function(){ca.event.dnd.off(this,a,b)})}),a.FileAPI=Y(ca,a.FileAPI),ca.log("FileAPI: "+ca.version),ca.log("protocol: "+a.location.protocol),ca.log("doctype: ["+s.name+"] "+s.publicId+" "+s.systemId),X(r.getElementsByTagName("meta"),function(a){/x-ua-compatible/i.test(a.getAttribute("http-equiv"))&&ca.log("meta.http-equiv: "+a.getAttribute("content"))});try{n=!!console.log,o=!!console.log.apply}catch(da){}ca.flashUrl||(ca.flashUrl=ca.staticPath+"FileAPI.flash.swf"),ca.flashImageUrl||(ca.flashImageUrl=ca.staticPath+"FileAPI.flash.image.swf"),ca.flashWebcamUrl||(ca.flashWebcamUrl=ca.staticPath+"FileAPI.flash.camera.swf")}(window,void 0),function(a,b,c){"use strict";function d(b){if(b instanceof d){var c=new d(b.file);return a.extend(c.matrix,b.matrix),c}return this instanceof d?(this.file=b,this.size=b.size||100,void(this.matrix={sx:0,sy:0,sw:0,sh:0,dx:0,dy:0,dw:0,dh:0,resize:0,deg:0,quality:1,filter:0})):new d(b)}var e=Math.min,f=Math.round,g=function(){return b.createElement("canvas")},h=!1,i={8:270,3:180,6:90,7:270,4:180,5:90};try{h=g().toDataURL("image/png").indexOf("data:image/png")>-1}catch(j){}d.prototype={image:!0,constructor:d,set:function(b){return a.extend(this.matrix,b),this},crop:function(a,b,d,e){return d===c&&(d=a,e=b,a=b=0),this.set({sx:a,sy:b,sw:d,sh:e||d})},resize:function(a,b,c){return/min|max|height|width/.test(b)&&(c=b,b=a),this.set({dw:a,dh:b||a,resize:c})},preview:function(a,b){return this.resize(a,b||a,"preview")},rotate:function(a){return this.set({deg:a})},filter:function(a){return this.set({filter:a})},overlay:function(a){return this.set({overlay:a})},clone:function(){return new d(this)},_load:function(b,c){var d=this;/img|video/i.test(b.nodeName)?c.call(d,null,b):a.readAsImage(b,function(a){c.call(d,"load"!=a.type,a.result)})},_apply:function(b,c){var f,h=g(),i=this.getMatrix(b),j=h.getContext("2d"),k=b.videoWidth||b.width,l=b.videoHeight||b.height,m=i.deg,n=i.dw,o=i.dh,p=k,q=l,r=i.filter,s=b,t=i.overlay,u=a.queue(function(){b.src=a.EMPTY_PNG,c(!1,h)}),v=a.renderImageToCanvas;for(m-=360*Math.floor(m/360),b._type=this.file.type;i.multipass&&e(p/n,q/o)>2;)p=p/2+.5|0,q=q/2+.5|0,f=g(),f.width=p,f.height=q,s!==b?(v(f,s,0,0,s.width,s.height,0,0,p,q),s=f):(s=f,v(s,b,i.sx,i.sy,i.sw,i.sh,0,0,p,q),i.sx=i.sy=i.sw=i.sh=0);h.width=m%180?o:n,h.height=m%180?n:o,h.type=i.type,h.quality=i.quality,j.rotate(m*Math.PI/180),v(j.canvas,s,i.sx,i.sy,i.sw||s.width,i.sh||s.height,180==m||270==m?-n:0,90==m||180==m?-o:0,n,o),n=h.width,o=h.height,t&&a.each([].concat(t),function(b){u.inc();var c=new window.Image,d=function(){var e=0|b.x,f=0|b.y,g=b.w||c.width,h=b.h||c.height,i=b.rel;e=1==i||4==i||7==i?(n-g+e)/2:2==i||5==i||8==i?n-(g+e):e,f=3==i||4==i||5==i?(o-h+f)/2:i>=6?o-(h+f):f,a.event.off(c,"error load abort",d);try{j.globalAlpha=b.opacity||1,j.drawImage(c,e,f,g,h)}catch(k){}u.next()};a.event.on(c,"error load abort",d),c.src=b.src,c.complete&&d()}),r&&(u.inc(),d.applyFilter(h,r,u.next)),u.check()},getMatrix:function(b){var c=a.extend({},this.matrix),d=c.sw=c.sw||b.videoWidth||b.naturalWidth||b.width,g=c.sh=c.sh||b.videoHeight||b.naturalHeight||b.height,h=c.dw=c.dw||d,i=c.dh=c.dh||g,j=d/g,k=h/i,l=c.resize;if("preview"==l){if(h!=d||i!=g){var m,n;k>=j?(m=d,n=m/k):(n=g,m=n*k),(m!=d||n!=g)&&(c.sx=~~((d-m)/2),c.sy=~~((g-n)/2),d=m,g=n)}}else"height"==l?h=i*j:"width"==l?i=h/j:l&&(d>h||g>i?"min"==l?(h=f(k>j?e(d,h):i*j),i=f(k>j?h/j:e(g,i))):(h=f(j>=k?e(d,h):i*j),i=f(j>=k?h/j:e(g,i))):(h=d,i=g));return c.sw=d,c.sh=g,c.dw=h,c.dh=i,c.multipass=a.multiPassResize,c},_trans:function(b){this._load(this.file,function(c,d){if(c)b(c);else try{this._apply(d,b)}catch(c){a.log("[err] FileAPI.Image.fn._apply:",c),b(c)}})},get:function(b){if(a.support.transform){var c=this,d=c.matrix;"auto"==d.deg?a.getInfo(c.file,function(a,e){d.deg=i[e&&e.exif&&e.exif.Orientation]||0,c._trans(b)}):c._trans(b)}else b("not_support_transform");return this},toData:function(a){return this.get(a)}},d.exifOrientation=i,d.transform=function(b,e,f,g){function h(h,i){var j={},k=a.queue(function(a){g(a,j)});h?k.fail():a.each(e,function(a,e){if(!k.isFail()){var g=new d(i.nodeType?i:b),h="function"==typeof a;if(h?a(i,g):a.width?g[a.preview?"preview":"resize"](a.width,a.height,a.strategy):a.maxWidth&&(i.width>a.maxWidth||i.height>a.maxHeight)&&g.resize(a.maxWidth,a.maxHeight,"max"),a.crop){var l=a.crop;g.crop(0|l.x,0|l.y,l.w||l.width,l.h||l.height)}a.rotate===c&&f&&(a.rotate="auto"),g.set({type:g.matrix.type||a.type||b.type||"image/png"}),h||g.set({deg:a.rotate,overlay:a.overlay,filter:a.filter,quality:a.quality||1}),k.inc(),g.toData(function(a,b){a?k.fail():(j[e]=b,k.next())})}})}b.width?h(!1,b):a.getInfo(b,h)},a.each(["TOP","CENTER","BOTTOM"],function(b,c){a.each(["LEFT","CENTER","RIGHT"],function(a,e){d[b+"_"+a]=3*c+e,d[a+"_"+b]=3*c+e})}),d.toCanvas=function(a){var c=b.createElement("canvas");return c.width=a.videoWidth||a.width,c.height=a.videoHeight||a.height,c.getContext("2d").drawImage(a,0,0),c},d.fromDataURL=function(b,c,d){var e=a.newImage(b);a.extend(e,c),d(e)},d.applyFilter=function(b,c,e){"function"==typeof c?c(b,e):window.Caman&&window.Caman("IMG"==b.tagName?d.toCanvas(b):b,function(){"string"==typeof c?this[c]():a.each(c,function(a,b){this[b](a)},this),this.render(e)})},a.renderImageToCanvas=function(b,c,d,e,f,g,h,i,j,k){try{return b.getContext("2d").drawImage(c,d,e,f,g,h,i,j,k)}catch(l){throw a.log("renderImageToCanvas failed"),l}},a.support.canvas=a.support.transform=h,a.Image=d}(FileAPI,document),function(a){"use strict";a(FileAPI)}(function(a){"use strict";if(window.navigator&&window.navigator.platform&&/iP(hone|od|ad)/.test(window.navigator.platform)){var b=a.renderImageToCanvas;a.detectSubsampling=function(a){var b,c;return a.width*a.height>1048576?(b=document.createElement("canvas"),b.width=b.height=1,c=b.getContext("2d"),c.drawImage(a,-a.width+1,0),0===c.getImageData(0,0,1,1).data[3]):!1},a.detectVerticalSquash=function(a,b){var c,d,e,f,g,h=a.naturalHeight||a.height,i=document.createElement("canvas"),j=i.getContext("2d");for(b&&(h/=2),i.width=1,i.height=h,j.drawImage(a,0,0),c=j.getImageData(0,0,1,h).data,d=0,e=h,f=h;f>d;)g=c[4*(f-1)+3],0===g?e=f:d=f,f=e+d>>1;return f/h||1},a.renderImageToCanvas=function(c,d,e,f,g,h,i,j,k,l){if("image/jpeg"===d._type){var m,n,o,p,q=c.getContext("2d"),r=document.createElement("canvas"),s=1024,t=r.getContext("2d");if(r.width=s,r.height=s,q.save(),m=a.detectSubsampling(d),m&&(e/=2,f/=2,g/=2,h/=2),n=a.detectVerticalSquash(d,m),m||1!==n){for(f*=n,k=Math.ceil(s*k/g),l=Math.ceil(s*l/h/n),j=0,p=0;h>p;){for(i=0,o=0;g>o;)t.clearRect(0,0,s,s),t.drawImage(d,e,f,g,h,-o,-p,g,h),q.drawImage(r,0,0,s,s,i,j,k,l),o+=s,i+=k;p+=s,j+=l}return q.restore(),c}}return b(c,d,e,f,g,h,i,j,k,l)}}}),function(a,b){"use strict";function c(b,c,d){var e=b.blob,f=b.file;if(f){if(!e.toDataURL)return void a.readAsBinaryString(e,function(a){"load"==a.type&&c(b,a.result)});var g={"image/jpeg":".jpe?g","image/png":".png"},h=g[b.type]?b.type:"image/png",i=g[h]||".png",j=e.quality||1;f.match(new RegExp(i+"$","i"))||(f+=i.replace("?","")),b.file=f,b.type=h,!d&&e.toBlob?e.toBlob(function(a){c(b,a)},h,j):c(b,a.toBinaryString(e.toDataURL(h,j)))}else c(b,e)}var d=b.document,e=b.FormData,f=function(){this.items=[]},g=b.encodeURIComponent;f.prototype={append:function(a,b,c,d){this.items.push({name:a,blob:b&&b.blob||(void 0==b?"":b),file:b&&(c||b.name),type:b&&(d||b.type)})},each:function(a){for(var b=0,c=this.items.length;c>b;b++)a.call(this,this.items[b])},toData:function(b,c){c._chunked=a.support.chunked&&c.chunkSize>0&&1==a.filter(this.items,function(a){return a.file}).length,a.support.html5?a.formData&&!this.multipart&&e?c._chunked?(a.log("FileAPI.Form.toPlainData"),this.toPlainData(b)):(a.log("FileAPI.Form.toFormData"),this.toFormData(b)):(a.log("FileAPI.Form.toMultipartData"),this.toMultipartData(b)):(a.log("FileAPI.Form.toHtmlData"),this.toHtmlData(b))},_to:function(b,c,d,e){var f=a.queue(function(){c(b)});this.each(function(g){try{d(g,b,f,e)}catch(h){a.log("FileAPI.Form._to: "+h.message),c(h)}}),f.check()},toHtmlData:function(b){this._to(d.createDocumentFragment(),b,function(b,c){var e,f=b.blob;b.file?(a.reset(f,!0),f.name=b.name,f.disabled=!1,c.appendChild(f)):(e=d.createElement("input"),e.name=b.name,e.type="hidden",e.value=f,c.appendChild(e))})},toPlainData:function(a){this._to({},a,function(a,b,d){a.file&&(b.type=a.file),a.blob.toBlob?(d.inc(),c(a,function(a,c){b.name=a.name,b.file=c,b.size=c.length,b.type=a.type,d.next()})):a.file?(b.name=a.blob.name,b.file=a.blob,b.size=a.blob.size,b.type=a.type):(b.params||(b.params=[]),b.params.push(g(a.name)+"="+g(a.blob))),b.start=-1,b.end=b.file&&b.file.FileAPIReadPosition||-1,b.retry=0})},toFormData:function(a){this._to(new e,a,function(a,b,d){a.blob&&a.blob.toBlob?(d.inc(),c(a,function(a,c){b.append(a.name,c,a.file),d.next()})):a.file?b.append(a.name,a.blob,a.file):b.append(a.name,a.blob),a.file&&b.append("_"+a.name,a.file)})},toMultipartData:function(b){this._to([],b,function(a,b,d,e){d.inc(),c(a,function(a,c){b.push("--_"+e+('\r\nContent-Disposition: form-data; name="'+a.name+'"'+(a.file?'; filename="'+g(a.file)+'"':"")+(a.file?"\r\nContent-Type: "+(a.type||"application/octet-stream"):"")+"\r\n\r\n"+(a.file?c:g(c))+"\r\n")),d.next()},!0)},a.expando)}},a.Form=f}(FileAPI,window),function(a,b){"use strict";var c=function(){},d=a.document,e=function(a){this.uid=b.uid(),this.xhr={abort:c,getResponseHeader:c,getAllResponseHeaders:c},this.options=a},f={"":1,XML:1,Text:1,Body:1};e.prototype={status:0,statusText:"",constructor:e,getResponseHeader:function(a){return this.xhr.getResponseHeader(a)},getAllResponseHeaders:function(){return this.xhr.getAllResponseHeaders()||{}},end:function(d,e){var f=this,g=f.options;f.end=f.abort=c,f.status=d,e&&(f.statusText=e),b.log("xhr.end:",d,e),g.complete(200==d||201==d?!1:f.statusText||"unknown",f),f.xhr&&f.xhr.node&&setTimeout(function(){var b=f.xhr.node;try{b.parentNode.removeChild(b)}catch(c){}try{delete a[f.uid]}catch(c){}a[f.uid]=f.xhr.node=null},9)},abort:function(){this.end(0,"abort"),this.xhr&&(this.xhr.aborted=!0,this.xhr.abort())},send:function(a){var b=this,c=this.options;a.toData(function(a){a instanceof Error?b.end(0,a.message):(c.upload(c,b),b._send.call(b,c,a))},c)},_send:function(c,e){var g,h=this,i=h.uid,j=h.uid+"Load",k=c.url;if(b.log("XHR._send:",e),c.cache||(k+=(~k.indexOf("?")?"&":"?")+b.uid()),e.nodeName){var l=c.jsonp;k=k.replace(/([a-z]+)=(\?)/i,"$1="+i),c.upload(c,h);var m=function(a){if(~k.indexOf(a.origin))try{var c=b.parseJSON(a.data);c.id==i&&n(c.status,c.statusText,c.response)}catch(d){n(0,d.message)}},n=a[i]=function(c,d,e){h.readyState=4,h.responseText=e,h.end(c,d),b.event.off(a,"message",m),a[i]=g=p=a[j]=null};h.xhr.abort=function(){try{p.stop?p.stop():p.contentWindow.stop?p.contentWindow.stop():p.contentWindow.document.execCommand("Stop")}catch(a){}n(0,"abort")},b.event.on(a,"message",m),a[j]=function(){try{var a=p.contentWindow,c=a.document,d=a.result||b.parseJSON(c.body.innerHTML);n(d.status,d.statusText,d.response)}catch(e){b.log("[transport.onload]",e)}},g=d.createElement("div"),g.innerHTML='
    '+(l&&c.url.indexOf("=?")<0?'':"")+"";var o=g.getElementsByTagName("form")[0],p=g.getElementsByTagName("iframe")[0];o.appendChild(e),b.log(o.parentNode.innerHTML),d.body.appendChild(g),h.xhr.node=g,h.readyState=2;try{o.submit()}catch(q){b.log("iframe.error: "+q)}o=null}else{if(k=k.replace(/([a-z]+)=(\?)&?/i,""),this.xhr&&this.xhr.aborted)return void b.log("Error: already aborted");if(g=h.xhr=b.getXHR(),e.params&&(k+=(k.indexOf("?")<0?"?":"&")+e.params.join("&")),g.open("POST",k,!0),b.withCredentials&&(g.withCredentials="true"),c.headers&&c.headers["X-Requested-With"]||g.setRequestHeader("X-Requested-With","XMLHttpRequest"),b.each(c.headers,function(a,b){g.setRequestHeader(b,a)}),c._chunked){g.upload&&g.upload.addEventListener("progress",b.throttle(function(a){e.retry||c.progress({type:a.type,total:e.size,loaded:e.start+a.loaded,totalSize:e.size},h,c)},100),!1),g.onreadystatechange=function(){var a=parseInt(g.getResponseHeader("X-Last-Known-Byte"),10);if(h.status=g.status,h.statusText=g.statusText,h.readyState=g.readyState,4==g.readyState){for(var d in f)h["response"+d]=g["response"+d];if(g.onreadystatechange=null,!g.status||g.status-201>0)if(b.log("Error: "+g.status),(!g.status&&!g.aborted||500==g.status||416==g.status)&&++e.retry<=c.chunkUploadRetry){var i=g.status?0:b.chunkNetworkDownRetryTimeout;c.pause(e.file,c),b.log("X-Last-Known-Byte: "+a),a?e.end=a:(e.end=e.start-1,416==g.status&&(e.end=e.end-c.chunkSize)),setTimeout(function(){h._send(c,e)},i)}else h.end(g.status);else e.retry=0,e.end==e.size-1?h.end(g.status):(b.log("X-Last-Known-Byte: "+a),a&&(e.end=a),e.file.FileAPIReadPosition=e.end,setTimeout(function(){h._send(c,e)},0));g=null}},e.start=e.end+1,e.end=Math.max(Math.min(e.start+c.chunkSize,e.size)-1,e.start);var r=e.file,s=(r.slice||r.mozSlice||r.webkitSlice).call(r,e.start,e.end+1);e.size&&!s.size?setTimeout(function(){h.end(-1)}):(g.setRequestHeader("Content-Range","bytes "+e.start+"-"+e.end+"/"+e.size),g.setRequestHeader("Content-Disposition","attachment; filename="+encodeURIComponent(e.name)),g.setRequestHeader("Content-Type",e.type||"application/octet-stream"),g.send(s)),r=s=null}else if(g.upload&&g.upload.addEventListener("progress",b.throttle(function(a){c.progress(a,h,c)},100),!1),g.onreadystatechange=function(){if(h.status=g.status,h.statusText=g.statusText,h.readyState=g.readyState,4==g.readyState){for(var a in f)h["response"+a]=g["response"+a];if(g.onreadystatechange=null,!g.status||g.status>201)if(b.log("Error: "+g.status),(!g.status&&!g.aborted||500==g.status)&&(c.retry||0)=0?a+"px":a}function d(a){var c,d=f.createElement("canvas"),e=!1;try{c=d.getContext("2d"),c.drawImage(a,0,0,1,1),e=255!=c.getImageData(0,0,1,1).data[4]}catch(g){b.log("[FileAPI.Camera] detectVideoSignal:",g)}return e}var e=a.URL||a.webkitURL,f=a.document,g=a.navigator,h=g.getUserMedia||g.webkitGetUserMedia||g.mozGetUserMedia||g.msGetUserMedia,i=!!h;b.support.media=i;var j=function(a){this.video=a};j.prototype={isActive:function(){return!!this._active},start:function(a){var b,c,f=this,i=f.video,j=function(d){f._active=!d,clearTimeout(c),clearTimeout(b),a&&a(d,f)};h.call(g,{video:!0},function(a){f.stream=a,i.src=e.createObjectURL(a),b=setInterval(function(){d(i)&&j(null)},1e3),c=setTimeout(function(){j("timeout"); +/*! FileAPI 2.0.19 - BSD | git://github.com/mailru/FileAPI.git */ +!function(a){"use strict";var b=a.HTMLCanvasElement&&a.HTMLCanvasElement.prototype,c=a.Blob&&function(){try{return Boolean(new Blob)}catch(a){return!1}}(),d=c&&a.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(a){return!1}}(),e=a.BlobBuilder||a.WebKitBlobBuilder||a.MozBlobBuilder||a.MSBlobBuilder,f=(c||e)&&a.atob&&a.ArrayBuffer&&a.Uint8Array&&function(a){var b,f,g,h,i,j;for(b=a.split(",")[0].indexOf("base64")>=0?atob(a.split(",")[1]):decodeURIComponent(a.split(",")[1]),f=new ArrayBuffer(b.length),g=new Uint8Array(f),h=0;h0,H=a.dataURLtoBlob,I=/img/i,J=/canvas/i,K=/img|canvas/i,L=/input/i,M=/^data:[^,]+,/,N={}.toString,O=a.Math,P=function(b){return b=new a.Number(O.pow(1024,b)),b.from=function(a){return O.round(a*this)},b},Q={},R=[],S="abort progress error load loadend",T="status statusText readyState response responseXML responseText responseBody".split(" "),U="currentTarget",V="preventDefault",W=function(a){return a&&"length"in a},X=function(a,b,c){if(a)if(W(a))for(var d=0,e=a.length;e>d;d++)d in a&&b.call(c,a[d],d,a);else for(var f in a)a.hasOwnProperty(f)&&b.call(c,a[f],f,a)},Y=function(a){for(var b=arguments,c=1,d=function(b,c){a[c]=b};c=c&&!d&&f.end()},isFail:function(){return d},fail:function(){!d&&a(d=!0)},end:function(){e||(e=!0,a())}};return f},each:X,afor:function(a,b){var c=0,d=a.length;W(a)&&d--?!function e(){b(d!=c&&e,a[c],c++)}():b(!1)},extend:Y,isFile:function(a){return"[object File]"===N.call(a)},isBlob:function(a){return this.isFile(a)||"[object Blob]"===N.call(a)},isCanvas:function(a){return a&&J.test(a.nodeName)},getFilesFilter:function(a){return a="string"==typeof a?a:a.getAttribute&&a.getAttribute("accept")||"",a?new RegExp("("+a.replace(/\./g,"\\.").replace(/,/g,"|")+")$","i"):/./},readAsDataURL:function(a,b){ca.isCanvas(a)?c(a,b,"load",ca.toDataURL(a)):e(a,b,"DataURL")},readAsBinaryString:function(a,b){d("BinaryString")?e(a,b,"BinaryString"):e(a,function(a){if("load"==a.type)try{a.result=ca.toBinaryString(a.result)}catch(c){a.type="error",a.message=c.toString()}b(a)},"DataURL")},readAsArrayBuffer:function(a,b){e(a,b,"ArrayBuffer")},readAsText:function(a,b,c){c||(c=b,b="utf-8"),e(a,c,"Text",b)},toDataURL:function(a,b){return"string"==typeof a?a:a.toDataURL?a.toDataURL(b||"image/png"):void 0},toBinaryString:function(b){return a.atob(ca.toDataURL(b).replace(M,""))},readAsImage:function(a,d,e){if(ca.isBlob(a))if(w){var f=w.createObjectURL(a);f===b?c(a,d,"error"):ca.readAsImage(f,d,e)}else ca.readAsDataURL(a,function(b){"load"==b.type?ca.readAsImage(b.result,d,e):(e||"error"==b.type)&&c(a,d,b,null,{loaded:b.loaded,total:b.total})});else if(ca.isCanvas(a))c(a,d,"load",a);else if(I.test(a.nodeName))if(a.complete)c(a,d,"load",a);else{var g="error abort load";_(a,g,function i(b){"load"==b.type&&w&&w.revokeObjectURL(a.src),$(a,g,i),c(a,d,b,a)})}else if(a.iframe)c(a,d,{type:"error"});else{var h=ca.newImage(a.dataURL||a);ca.readAsImage(h,d,e)}},checkFileObj:function(a){var b={},c=ca.accept;return"object"==typeof a?b=a:b.name=(a+"").split(/\\|\//g).pop(),null==b.type&&(b.type=b.name.split(".").pop()),X(c,function(a,c){a=new RegExp(a.replace(/\s/g,"|"),"i"),(a.test(b.type)||ca.ext2mime[b.type])&&(b.type=ca.ext2mime[b.type]||c.split("/")[0]+"/"+b.type)}),b},getDropFiles:function(a,b){var c,d=[],e=[],j=l(a),k=j.files,m=j.items,n=W(m)&&m[0]&&h(m[0]),o=ca.queue(function(){b(d,e)});if(n)if(G&&k){var p,q,r=k.length;for(c=new Array(r);r--;){p=k[r];try{q=h(m[r])}catch(s){ca.log("[err] getDropFiles: ",s),q=null}g(q)&&(q.isDirectory||q.isFile&&p.name==p.name.normalize("NFC"))?c[r]=q:c[r]=p}}else c=m;else c=k;X(c||[],function(a){o.inc();try{n&&g(a)?i(a,function(a,b,c){a?ca.log("[err] getDropFiles:",a):d.push.apply(d,b),e.push.apply(e,c),o.next()}):f(a,function(b,c){b?d.push(a):a.error=c,e.push(a),o.next()})}catch(b){o.next(),ca.log("[err] getDropFiles: ",b)}}),o.check()},getFiles:function(a,b,c){var d=[];return c?(ca.filterFiles(ca.getFiles(a),b,c),null):(a.jquery&&(a.each(function(){d=d.concat(ca.getFiles(this))}),a=d,d=[]),"string"==typeof b&&(b=ca.getFilesFilter(b)),a.originalEvent?a=aa(a.originalEvent):a.srcElement&&(a=aa(a)),a.dataTransfer?a=a.dataTransfer:a.target&&(a=a.target),a.files?(d=a.files,D||(d[0].blob=a,d[0].iframe=!0)):!D&&k(a)?ca.trim(a.value)&&(d=[ca.checkFileObj(a.value)],d[0].blob=a,d[0].iframe=!0):W(a)&&(d=a),ca.filter(d,function(a){return!b||b.test(a.name)}))},getTotalSize:function(a){for(var b=0,c=a&&a.length;c--;)b+=a[c].size;return b},getInfo:function(a,b){var c={},d=R.concat();ca.isBlob(a)?!function e(){var f=d.shift();f?f.test(a.type)?f(a,function(a,d){a?b(a):(Y(c,d),e())}):e():b(!1,c)}():b("not_support_info",c)},addInfoReader:function(a,b){b.test=function(b){return a.test(b)},R.push(b)},filter:function(a,b){for(var c,d=[],e=0,f=a.length;f>e;e++)e in a&&(c=a[e],b.call(c,c,e,a)&&d.push(c));return d},filterFiles:function(a,b,c){if(a.length){var d,e=a.concat(),f=[],g=[];!function h(){e.length?(d=e.shift(),ca.getInfo(d,function(a,c){(b(d,a?!1:c)?f:g).push(d),h()})):c(f,g)}()}else c([],a)},upload:function(a){a=Y({jsonp:"callback",prepare:ca.F,beforeupload:ca.F,upload:ca.F,fileupload:ca.F,fileprogress:ca.F,filecomplete:ca.F,progress:ca.F,complete:ca.F,pause:ca.F,imageOriginal:!0,chunkSize:ca.chunkSize,chunkUploadRetry:ca.chunkUploadRetry,uploadRetry:ca.uploadRetry},a),a.imageAutoOrientation&&!a.imageTransform&&(a.imageTransform={rotate:"auto"});var b,c=new ca.XHR(a),d=this._getFilesDataArray(a.files),e=this,f=0,g=0,h=!1;return X(d,function(a){f+=a.size}),c.files=[],X(d,function(a){c.files.push(a.file)}),c.total=f,c.loaded=0,c.filesLeft=d.length,a.beforeupload(c,a),b=function(){var i=d.shift(),k=i&&i.file,l=!1,m=j(a);if(c.filesLeft=d.length,k&&k.name===ca.expando&&(k=null,ca.log("[warn] FileAPI.upload() — called without files")),("abort"!=c.statusText||c.current)&&i){if(h=!1,c.currentFile=k,k&&a.prepare(k,m)===!1)return void b.call(e);m.file=k,e._getFormData(m,i,function(h){g||a.upload(c,a);var j=new ca.XHR(Y({},m,{upload:k?function(){a.fileupload(k,j,m)}:q,progress:k?function(b){l||(l=b.loaded===b.total,a.fileprogress({type:"progress",total:i.total=b.total,loaded:i.loaded=b.loaded},k,j,m),a.progress({type:"progress",total:f,loaded:c.loaded=g+i.size*(b.loaded/b.total)||0},k,j,m))}:q,complete:function(d){X(T,function(a){c[a]=j[a]}),k&&(i.total=i.total||i.size,i.loaded=i.total,d||(this.progress(i),l=!0,g+=i.size,c.loaded=g),a.filecomplete(d,j,k,m)),setTimeout(function(){b.call(e)},0)}}));c.abort=function(a){a||(d.length=0),this.current=a,j.abort()},j.send(h)})}else{var n=200==c.status||201==c.status||204==c.status;a.complete(n?!1:c.statusText||"error",c,a),h=!0}},setTimeout(b,0),c.append=function(a,g){a=ca._getFilesDataArray([].concat(a)),X(a,function(a){f+=a.size,c.files.push(a.file),g?d.unshift(a):d.push(a)}),c.statusText="",h&&b.call(e)},c.remove=function(a){for(var b,c=d.length;c--;)d[c].file==a&&(b=d.splice(c,1),f-=b.size);return b},c},_getFilesDataArray:function(a){var b=[],c={};if(k(a)){var d=ca.getFiles(a);c[a.name||"file"]=null!==a.getAttribute("multiple")?d:d[0]}else W(a)&&k(a[0])?X(a,function(a){c[a.name||"file"]=ca.getFiles(a)}):c=a;return X(c,function e(a,c){W(a)?X(a,function(a){e(a,c)}):a&&(a.name||a.image)&&b.push({name:c,file:a,size:a.size,total:a.size,loaded:0})}),b.length||b.push({file:{name:ca.expando}}),b},_getFormData:function(a,b,c){var d=b.file,e=b.name,f=d.name,g=d.type,h=ca.support.transform&&a.imageTransform,i=new ca.Form,j=ca.queue(function(){c(i)}),k=h&&m(h),l=ca.postNameConcat;X(a.data,function n(a,b){"object"==typeof a?X(a,function(a,c){n(a,l(b,c))}):i.append(b,a)}),function o(b){b.image?(j.inc(),b.toData(function(a,c){b.file&&(c.type=b.file.type,c.quality=b.matrix.quality,f=b.file&&b.file.name),f=f||(new Date).getTime()+".png",o(c),j.next()})):ca.Image&&h&&(/^image/.test(b.type)||K.test(b.nodeName))?(j.inc(),k&&(h=[h]),ca.Image.transform(b,h,a.imageAutoOrientation,function(c,d){if(k&&!c)H||ca.flashEngine||(i.multipart=!0),i.append(e,d[0],f,h[0].type||g);else{var m=0;c||X(d,function(a,b){H||ca.flashEngine||(i.multipart=!0),h[b].postName||(m=1),i.append(h[b].postName||l(e,b),a,f,h[b].type||g)}),(c||a.imageOriginal)&&i.append(l(e,m?"original":null),b,f,g)}j.next()})):f!==ca.expando&&i.append(e,b,f)}(d),j.check()},reset:function(a,b){var c,d;return C?(d=C(a).clone(!0).insertBefore(a).val("")[0],b||C(a).remove()):(c=a.parentNode,d=c.insertBefore(a.cloneNode(!0),a),d.value="",b||c.removeChild(a),X(Q[ca.uid(a)],function(b,c){X(b,function(b){$(a,c,b),Z(d,c,b)})})),d},load:function(a,b){var c=ca.getXHR();return c?(c.open("GET",a,!0),c.overrideMimeType&&c.overrideMimeType("text/plain; charset=x-user-defined"),Z(c,"progress",function(a){a.lengthComputable&&b({type:a.type,loaded:a.loaded,total:a.total},c)}),c.onreadystatechange=function(){if(4==c.readyState)if(c.onreadystatechange=null,200==c.status){a=a.split("/");var d={name:a[a.length-1],size:c.getResponseHeader("Content-Length"),type:c.getResponseHeader("Content-Type")};d.dataURL="data:"+d.type+";base64,"+ca.encode64(c.responseBody||c.responseText),b({type:"load",result:d},c)}else b({type:"error"},c)},c.send(null)):b({type:"error"}),c},encode64:function(a){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",d=0;for("string"!=typeof a&&(a=String(a));d>2,k=(3&g)<<4|h>>4;isNaN(h)?e=f=64:(e=(15&h)<<2|i>>6,f=isNaN(i)?64:63&i),c+=b.charAt(j)+b.charAt(k)+b.charAt(e)+b.charAt(f)}return c}};ca.addInfoReader(/^image/,function(a,b){if(!a.__dimensions){var c=a.__dimensions=ca.defer();ca.readAsImage(a,function(a){var b=a.target;c.resolve("load"==a.type?!1:"error",{width:b.width,height:b.height}),b.src=ca.EMPTY_PNG,b=null})}a.__dimensions.then(b)}),ca.event.dnd=function(a,b,c){var d,e;c||(c=b,b=ca.F),z?(Z(a,"dragenter dragleave dragover",b.ff=b.ff||function(a){for(var c=l(a).types,f=c&&c.length,g=!1;f--;)if(~c[f].indexOf("File")){a[V](),e!==a.type&&(e=a.type,"dragleave"!=e&&b.call(a[U],!0,a),g=!0);break}g&&(clearTimeout(d),d=setTimeout(function(){b.call(a[U],"dragleave"!=e,a)},50))}),Z(a,"drop",c.ff=c.ff||function(a){a[V](),e=0,b.call(a[U],!1,a),ca.getDropFiles(a,function(b,d){c.call(a[U],b,d,a)})})):ca.log("Drag'n'Drop -- not supported")},ca.event.dnd.off=function(a,b,c){$(a,"dragenter dragleave dragover",b.ff),$(a,"drop",c.ff)},C&&!C.fn.dnd&&(C.fn.dnd=function(a,b){return this.each(function(){ca.event.dnd(this,a,b)})},C.fn.offdnd=function(a,b){return this.each(function(){ca.event.dnd.off(this,a,b)})}),a.FileAPI=Y(ca,a.FileAPI),ca.log("FileAPI: "+ca.version),ca.log("protocol: "+a.location.protocol),ca.log("doctype: ["+s.name+"] "+s.publicId+" "+s.systemId),X(r.getElementsByTagName("meta"),function(a){/x-ua-compatible/i.test(a.getAttribute("http-equiv"))&&ca.log("meta.http-equiv: "+a.getAttribute("content"))});try{n=!!console.log,o=!!console.log.apply}catch(da){}ca.flashUrl||(ca.flashUrl=ca.staticPath+"FileAPI.flash.swf"),ca.flashImageUrl||(ca.flashImageUrl=ca.staticPath+"FileAPI.flash.image.swf"),ca.flashWebcamUrl||(ca.flashWebcamUrl=ca.staticPath+"FileAPI.flash.camera.swf")}(window,void 0),function(a,b,c){"use strict";function d(b){if(b instanceof d){var c=new d(b.file);return a.extend(c.matrix,b.matrix),c}return this instanceof d?(this.file=b,this.size=b.size||100,void(this.matrix={sx:0,sy:0,sw:0,sh:0,dx:0,dy:0,dw:0,dh:0,resize:0,deg:0,quality:1,filter:0})):new d(b)}var e=Math.min,f=Math.round,g=function(){return b.createElement("canvas")},h=!1,i={8:270,3:180,6:90,7:270,4:180,5:90};try{h=g().toDataURL("image/png").indexOf("data:image/png")>-1}catch(j){}d.prototype={image:!0,constructor:d,set:function(b){return a.extend(this.matrix,b),this},crop:function(a,b,d,e){return d===c&&(d=a,e=b,a=b=0),this.set({sx:a,sy:b,sw:d,sh:e||d})},resize:function(a,b,c){return/min|max|height|width/.test(b)&&(c=b,b=a),this.set({dw:a,dh:b||a,resize:c})},preview:function(a,b){return this.resize(a,b||a,"preview")},rotate:function(a){return this.set({deg:a})},filter:function(a){return this.set({filter:a})},overlay:function(a){return this.set({overlay:a})},clone:function(){return new d(this)},_load:function(b,c){var d=this;/img|video/i.test(b.nodeName)?c.call(d,null,b):a.readAsImage(b,function(a){c.call(d,"load"!=a.type,a.result)})},_apply:function(b,c){var f,h=g(),i=this.getMatrix(b),j=h.getContext("2d"),k=b.videoWidth||b.width,l=b.videoHeight||b.height,m=i.deg,n=i.dw,o=i.dh,p=k,q=l,r=i.filter,s=b,t=i.overlay,u=a.queue(function(){b.src=a.EMPTY_PNG,c(!1,h)}),v=a.renderImageToCanvas;for(m-=360*Math.floor(m/360),b._type=this.file.type;i.multipass&&e(p/n,q/o)>2;)p=p/2+.5|0,q=q/2+.5|0,f=g(),f.width=p,f.height=q,s!==b?(v(f,s,0,0,s.width,s.height,0,0,p,q),s=f):(s=f,v(s,b,i.sx,i.sy,i.sw,i.sh,0,0,p,q),i.sx=i.sy=i.sw=i.sh=0);h.width=m%180?o:n,h.height=m%180?n:o,h.type=i.type,h.quality=i.quality,j.rotate(m*Math.PI/180),v(j.canvas,s,i.sx,i.sy,i.sw||s.width,i.sh||s.height,180==m||270==m?-n:0,90==m||180==m?-o:0,n,o),n=h.width,o=h.height,t&&a.each([].concat(t),function(b){u.inc();var c=new window.Image,d=function(){var e=0|b.x,f=0|b.y,g=b.w||c.width,h=b.h||c.height,i=b.rel;e=1==i||4==i||7==i?(n-g+e)/2:2==i||5==i||8==i?n-(g+e):e,f=3==i||4==i||5==i?(o-h+f)/2:i>=6?o-(h+f):f,a.event.off(c,"error load abort",d);try{j.globalAlpha=b.opacity||1,j.drawImage(c,e,f,g,h)}catch(k){}u.next()};a.event.on(c,"error load abort",d),c.src=b.src,c.complete&&d()}),r&&(u.inc(),d.applyFilter(h,r,u.next)),u.check()},getMatrix:function(b){var c=a.extend({},this.matrix),d=c.sw=c.sw||b.videoWidth||b.naturalWidth||b.width,g=c.sh=c.sh||b.videoHeight||b.naturalHeight||b.height,h=c.dw=c.dw||d,i=c.dh=c.dh||g,j=d/g,k=h/i,l=c.resize;if("preview"==l){if(h!=d||i!=g){var m,n;k>=j?(m=d,n=m/k):(n=g,m=n*k),(m!=d||n!=g)&&(c.sx=~~((d-m)/2),c.sy=~~((g-n)/2),d=m,g=n)}}else"height"==l?h=i*j:"width"==l?i=h/j:l&&(d>h||g>i?"min"==l?(h=f(k>j?e(d,h):i*j),i=f(k>j?h/j:e(g,i))):(h=f(j>=k?e(d,h):i*j),i=f(j>=k?h/j:e(g,i))):(h=d,i=g));return c.sw=d,c.sh=g,c.dw=h,c.dh=i,c.multipass=a.multiPassResize,c},_trans:function(b){this._load(this.file,function(c,d){if(c)b(c);else try{this._apply(d,b)}catch(c){a.log("[err] FileAPI.Image.fn._apply:",c),b(c)}})},get:function(b){if(a.support.transform){var c=this,d=c.matrix;"auto"==d.deg?a.getInfo(c.file,function(a,e){d.deg=i[e&&e.exif&&e.exif.Orientation]||0,c._trans(b)}):c._trans(b)}else b("not_support_transform");return this},toData:function(a){return this.get(a)}},d.exifOrientation=i,d.transform=function(b,e,f,g){function h(h,i){var j={},k=a.queue(function(a){g(a,j)});h?k.fail():a.each(e,function(a,e){if(!k.isFail()){var g=new d(i.nodeType?i:b),h="function"==typeof a;if(h?a(i,g):a.width?g[a.preview?"preview":"resize"](a.width,a.height,a.strategy):a.maxWidth&&(i.width>a.maxWidth||i.height>a.maxHeight)&&g.resize(a.maxWidth,a.maxHeight,"max"),a.crop){var l=a.crop;g.crop(0|l.x,0|l.y,l.w||l.width,l.h||l.height)}a.rotate===c&&f&&(a.rotate="auto"),g.set({type:g.matrix.type||a.type||b.type||"image/png"}),h||g.set({deg:a.rotate,overlay:a.overlay,filter:a.filter,quality:a.quality||1}),k.inc(),g.toData(function(a,b){a?k.fail():(j[e]=b,k.next())})}})}b.width?h(!1,b):a.getInfo(b,h)},a.each(["TOP","CENTER","BOTTOM"],function(b,c){a.each(["LEFT","CENTER","RIGHT"],function(a,e){d[b+"_"+a]=3*c+e,d[a+"_"+b]=3*c+e})}),d.toCanvas=function(a){var c=b.createElement("canvas");return c.width=a.videoWidth||a.width,c.height=a.videoHeight||a.height,c.getContext("2d").drawImage(a,0,0),c},d.fromDataURL=function(b,c,d){var e=a.newImage(b);a.extend(e,c),d(e)},d.applyFilter=function(b,c,e){"function"==typeof c?c(b,e):window.Caman&&window.Caman("IMG"==b.tagName?d.toCanvas(b):b,function(){"string"==typeof c?this[c]():a.each(c,function(a,b){this[b](a)},this),this.render(e)})},a.renderImageToCanvas=function(b,c,d,e,f,g,h,i,j,k){try{return b.getContext("2d").drawImage(c,d,e,f,g,h,i,j,k)}catch(l){throw a.log("renderImageToCanvas failed"),l}},a.support.canvas=a.support.transform=h,a.Image=d}(FileAPI,document),function(a){"use strict";a(FileAPI)}(function(a){"use strict";if(window.navigator&&window.navigator.platform&&/iP(hone|od|ad)/.test(window.navigator.platform)){var b=a.renderImageToCanvas;a.detectSubsampling=function(a){var b,c;return a.width*a.height>1048576?(b=document.createElement("canvas"),b.width=b.height=1,c=b.getContext("2d"),c.drawImage(a,-a.width+1,0),0===c.getImageData(0,0,1,1).data[3]):!1},a.detectVerticalSquash=function(a,b){var c,d,e,f,g,h=a.naturalHeight||a.height,i=document.createElement("canvas"),j=i.getContext("2d");for(b&&(h/=2),i.width=1,i.height=h,j.drawImage(a,0,0),c=j.getImageData(0,0,1,h).data,d=0,e=h,f=h;f>d;)g=c[4*(f-1)+3],0===g?e=f:d=f,f=e+d>>1;return f/h||1},a.renderImageToCanvas=function(c,d,e,f,g,h,i,j,k,l){if("image/jpeg"===d._type){var m,n,o,p,q=c.getContext("2d"),r=document.createElement("canvas"),s=1024,t=r.getContext("2d");if(r.width=s,r.height=s,q.save(),m=a.detectSubsampling(d),m&&(e/=2,f/=2,g/=2,h/=2),n=a.detectVerticalSquash(d,m),m||1!==n){for(f*=n,k=Math.ceil(s*k/g),l=Math.ceil(s*l/h/n),j=0,p=0;h>p;){for(i=0,o=0;g>o;)t.clearRect(0,0,s,s),t.drawImage(d,e,f,g,h,-o,-p,g,h),q.drawImage(r,0,0,s,s,i,j,k,l),o+=s,i+=k;p+=s,j+=l}return q.restore(),c}}return b(c,d,e,f,g,h,i,j,k,l)}}}),function(a,b){"use strict";function c(b,c,d){var e=b.blob,f=b.file;if(f){if(!e.toDataURL)return void a.readAsBinaryString(e,function(a){"load"==a.type&&c(b,a.result)});var g={"image/jpeg":".jpe?g","image/png":".png"},h=g[b.type]?b.type:"image/png",i=g[h]||".png",j=e.quality||1;f.match(new RegExp(i+"$","i"))||(f+=i.replace("?","")),b.file=f,b.type=h,!d&&e.toBlob?e.toBlob(function(a){c(b,a)},h,j):c(b,a.toBinaryString(e.toDataURL(h,j)))}else c(b,e)}var d=b.document,e=b.FormData,f=function(){this.items=[]},g=b.encodeURIComponent;f.prototype={append:function(a,b,c,d){this.items.push({name:a,blob:b&&b.blob||(void 0==b?"":b),file:b&&(c||b.name),type:b&&(d||b.type)})},each:function(a){for(var b=0,c=this.items.length;c>b;b++)a.call(this,this.items[b])},toData:function(b,c){c._chunked=a.support.chunked&&c.chunkSize>0&&1==a.filter(this.items,function(a){return a.file}).length,a.support.html5?a.formData&&!this.multipart&&e?c._chunked?(a.log("FileAPI.Form.toPlainData"),this.toPlainData(b)):(a.log("FileAPI.Form.toFormData"),this.toFormData(b)):(a.log("FileAPI.Form.toMultipartData"),this.toMultipartData(b)):(a.log("FileAPI.Form.toHtmlData"),this.toHtmlData(b))},_to:function(b,c,d,e){var f=a.queue(function(){c(b)});this.each(function(g){try{d(g,b,f,e)}catch(h){a.log("FileAPI.Form._to: "+h.message),c(h)}}),f.check()},toHtmlData:function(b){this._to(d.createDocumentFragment(),b,function(b,c){var e,f=b.blob;b.file?(a.reset(f,!0),f.name=b.name,f.disabled=!1,c.appendChild(f)):(e=d.createElement("input"),e.name=b.name,e.type="hidden",e.value=f,c.appendChild(e))})},toPlainData:function(a){this._to({},a,function(a,b,d){a.file&&(b.type=a.file),a.blob.toBlob?(d.inc(),c(a,function(a,c){b.name=a.name,b.file=c,b.size=c.length,b.type=a.type,d.next()})):a.file?(b.name=a.blob.name,b.file=a.blob,b.size=a.blob.size,b.type=a.type):(b.params||(b.params=[]),b.params.push(g(a.name)+"="+g(a.blob))),b.start=-1,b.end=b.file&&b.file.FileAPIReadPosition||-1,b.retry=0})},toFormData:function(a){this._to(new e,a,function(a,b,d){a.blob&&a.blob.toBlob?(d.inc(),c(a,function(a,c){b.append(a.name,c,a.file),d.next()})):a.file?b.append(a.name,a.blob,a.file):b.append(a.name,a.blob),a.file&&b.append("_"+a.name,a.file)})},toMultipartData:function(b){this._to([],b,function(a,b,d,e){d.inc(),c(a,function(a,c){b.push("--_"+e+('\r\nContent-Disposition: form-data; name="'+a.name+'"'+(a.file?'; filename="'+g(a.file)+'"':"")+(a.file?"\r\nContent-Type: "+(a.type||"application/octet-stream"):"")+"\r\n\r\n"+(a.file?c:g(c))+"\r\n")),d.next()},!0)},a.expando)}},a.Form=f}(FileAPI,window),function(a,b){"use strict";var c=function(){},d=a.document,e=function(a){this.uid=b.uid(),this.xhr={abort:c,getResponseHeader:c,getAllResponseHeaders:c},this.options=a},f={"":1,XML:1,Text:1,Body:1};e.prototype={status:0,statusText:"",constructor:e,getResponseHeader:function(a){return this.xhr.getResponseHeader(a)},getAllResponseHeaders:function(){return this.xhr.getAllResponseHeaders()||{}},end:function(d,e){var f=this,g=f.options;f.end=f.abort=c,f.status=d,e&&(f.statusText=e),b.log("xhr.end:",d,e),g.complete(200==d||201==d?!1:f.statusText||"unknown",f),f.xhr&&f.xhr.node&&setTimeout(function(){var b=f.xhr.node;try{b.parentNode.removeChild(b)}catch(c){}try{delete a[f.uid]}catch(c){}a[f.uid]=f.xhr.node=null},9)},abort:function(){this.end(0,"abort"),this.xhr&&(this.xhr.aborted=!0,this.xhr.abort())},send:function(a){var b=this,c=this.options;a.toData(function(a){a instanceof Error?b.end(0,a.message):(c.upload(c,b),b._send.call(b,c,a))},c)},_send:function(c,e){var g,h=this,i=h.uid,j=h.uid+"Load",k=c.url;if(b.log("XHR._send:",e),c.cache||(k+=(~k.indexOf("?")?"&":"?")+b.uid()),e.nodeName){var l=c.jsonp;k=k.replace(/([a-z]+)=(\?)/i,"$1="+i),c.upload(c,h);var m=function(a){if(~k.indexOf(a.origin))try{var c=b.parseJSON(a.data);c.id==i&&n(c.status,c.statusText,c.response)}catch(d){n(0,d.message)}},n=a[i]=function(c,d,e){h.readyState=4,h.responseText=e,h.end(c,d),b.event.off(a,"message",m),a[i]=g=p=a[j]=null};h.xhr.abort=function(){try{p.stop?p.stop():p.contentWindow.stop?p.contentWindow.stop():p.contentWindow.document.execCommand("Stop")}catch(a){}n(0,"abort")},b.event.on(a,"message",m),a[j]=function(){try{var a=p.contentWindow,c=a.document,d=a.result||b.parseJSON(c.body.innerHTML);n(d.status,d.statusText,d.response)}catch(e){b.log("[transport.onload]",e)}},g=d.createElement("div"),g.innerHTML='
    '+(l&&c.url.indexOf("=?")<0?'':"")+"";var o=g.getElementsByTagName("form")[0],p=g.getElementsByTagName("iframe")[0];o.appendChild(e),b.log(o.parentNode.innerHTML),d.body.appendChild(g),h.xhr.node=g,h.readyState=2;try{o.submit()}catch(q){b.log("iframe.error: "+q)}o=null}else{if(k=k.replace(/([a-z]+)=(\?)&?/i,""),this.xhr&&this.xhr.aborted)return void b.log("Error: already aborted");if(g=h.xhr=b.getXHR(),e.params&&(k+=(k.indexOf("?")<0?"?":"&")+e.params.join("&")),g.open("POST",k,!0),b.withCredentials&&(g.withCredentials="true"),c.headers&&c.headers["X-Requested-With"]||g.setRequestHeader("X-Requested-With","XMLHttpRequest"),b.each(c.headers,function(a,b){g.setRequestHeader(b,a)}),c._chunked){g.upload&&g.upload.addEventListener("progress",b.throttle(function(a){e.retry||c.progress({type:a.type,total:e.size,loaded:e.start+a.loaded,totalSize:e.size},h,c)},100),!1),g.onreadystatechange=function(){var a=parseInt(g.getResponseHeader("X-Last-Known-Byte"),10);if(h.status=g.status,h.statusText=g.statusText,h.readyState=g.readyState,4==g.readyState){for(var d in f)h["response"+d]=g["response"+d];if(g.onreadystatechange=null,!g.status||g.status-201>0)if(b.log("Error: "+g.status),(!g.status&&!g.aborted||500==g.status||416==g.status)&&++e.retry<=c.chunkUploadRetry){var i=g.status?0:b.chunkNetworkDownRetryTimeout;c.pause(e.file,c),b.log("X-Last-Known-Byte: "+a),a?e.end=a:(e.end=e.start-1,416==g.status&&(e.end=e.end-c.chunkSize)),setTimeout(function(){h._send(c,e)},i)}else h.end(g.status);else e.retry=0,e.end==e.size-1?h.end(g.status):(b.log("X-Last-Known-Byte: "+a),a&&(e.end=a),e.file.FileAPIReadPosition=e.end,setTimeout(function(){h._send(c,e)},0));g=null}},e.start=e.end+1,e.end=Math.max(Math.min(e.start+c.chunkSize,e.size)-1,e.start);var r=e.file,s=(r.slice||r.mozSlice||r.webkitSlice).call(r,e.start,e.end+1);e.size&&!s.size?setTimeout(function(){h.end(-1)}):(g.setRequestHeader("Content-Range","bytes "+e.start+"-"+e.end+"/"+e.size),g.setRequestHeader("Content-Disposition","attachment; filename="+encodeURIComponent(e.name)),g.setRequestHeader("Content-Type",e.type||"application/octet-stream"),g.send(s)),r=s=null}else if(g.upload&&g.upload.addEventListener("progress",b.throttle(function(a){c.progress(a,h,c)},100),!1),g.onreadystatechange=function(){if(h.status=g.status,h.statusText=g.statusText,h.readyState=g.readyState,4==g.readyState){for(var a in f)h["response"+a]=g["response"+a];if(g.onreadystatechange=null,!g.status||g.status>201)if(b.log("Error: "+g.status),(!g.status&&!g.aborted||500==g.status)&&(c.retry||0)=0?a+"px":a}function d(a){var c,d=f.createElement("canvas"),e=!1;try{c=d.getContext("2d"),c.drawImage(a,0,0,1,1),e=255!=c.getImageData(0,0,1,1).data[4]}catch(g){b.log("[FileAPI.Camera] detectVideoSignal:",g)}return e}var e=a.URL||a.webkitURL,f=a.document,g=a.navigator,h=g.getUserMedia||g.webkitGetUserMedia||g.mozGetUserMedia||g.msGetUserMedia,i=!!h;b.support.media=i;var j=function(a){this.video=a};j.prototype={isActive:function(){return!!this._active},start:function(a){var b,c,f=this,i=f.video,j=function(d){f._active=!d,clearTimeout(c),clearTimeout(b),a&&a(d,f)};h.call(g,{video:!0},function(a){f.stream=a,i.src=e.createObjectURL(a),b=setInterval(function(){d(i)&&j(null)},1e3),c=setTimeout(function(){j("timeout"); },5e3),i.play()},j)},stop:function(){try{this._active=!1,this.video.pause();try{this.stream.stop()}catch(a){b.each(this.stream.getTracks(),function(a){a.stop()})}this.stream=null}catch(a){b.log("[FileAPI.Camera] stop:",a)}},shot:function(){return new k(this.video)}},j.get=function(a){return new j(a.firstChild)},j.publish=function(d,e,g){"function"==typeof e&&(g=e,e={}),e=b.extend({},{width:"100%",height:"100%",start:!0},e),d.jquery&&(d=d[0]);var h=function(a){if(a)g(a);else{var b=j.get(d);e.start?b.start(g):g(null,b)}};if(d.style.width=c(e.width),d.style.height=c(e.height),b.html5&&i){var k=f.createElement("video");k.style.width=c(e.width),k.style.height=c(e.height),a.jQuery?jQuery(d).empty():d.innerHTML="",d.appendChild(k),h()}else j.fallback(d,e,h)},j.fallback=function(a,b,c){c("not_support_camera")};var k=function(a){var c=a.nodeName?b.Image.toCanvas(a):a,d=b.Image(c);return d.type="image/png",d.width=c.width,d.height=c.height,d.size=c.width*c.height*4,d};j.Shot=k,b.Camera=j}(window,FileAPI),function(a,b,c){"use strict";var d=a.document,e=a.location,f=a.navigator,g=c.each;c.support.flash=function(){var b=f.mimeTypes,d=!1;if(f.plugins&&"object"==typeof f.plugins["Shockwave Flash"])d=f.plugins["Shockwave Flash"].description&&!(b&&b["application/x-shockwave-flash"]&&!b["application/x-shockwave-flash"].enabledPlugin);else try{d=!(!a.ActiveXObject||!new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))}catch(g){c.log("Flash -- does not supported.")}return d&&/^file:/i.test(e)&&c.log("[warn] Flash does not work on `file:` protocol."),d}(),c.support.flash&&(!c.html5||!c.support.html5||c.cors&&!c.support.cors||c.media&&!c.support.media)&&function(){function h(a){return('').replace(/#(\w+)#/gi,function(b,c){return a[c]})}function i(a,b){if(a&&a.style){var c,d;for(c in b){d=b[c],"number"==typeof d&&(d+="px");try{a.style[c]=d}catch(e){}}}}function j(a,b){g(b,function(b,c){var d=a[c];a[c]=function(){return this.parent=d,b.apply(this,arguments)}})}function k(a){return a&&!a.flashId}function l(a){var b=a.wid=c.uid();return v._fn[b]=a,"FileAPI.Flash._fn."+b}function m(a){try{v._fn[a.wid]=null,delete v._fn[a.wid]}catch(b){}}function n(a,b){if(!u.test(a)){if(/^\.\//.test(a)||"/"!=a.charAt(0)){var c=e.pathname;c=c.substr(0,c.lastIndexOf("/")),a=(c+"/"+a).replace("/./","/")}"//"!=a.substr(0,2)&&(a="//"+e.host+a),u.test(a)||(a=e.protocol+a)}return b&&(a+=(/\?/.test(a)?"&":"?")+b),a}function o(a,b,e){function f(){try{var a=v.get(j);a.setImage(b)}catch(d){c.log('[err] FlashAPI.Preview.setImage -- can not set "base64":',d)}}var g,j=c.uid(),k=d.createElement("div"),o=10;for(g in a)k.setAttribute(g,a[g]),k[g]=a[g];i(k,a),a.width="100%",a.height="100%",k.innerHTML=h(c.extend({id:j,src:n(c.flashImageUrl,"r="+c.uid()),wmode:"opaque",flashvars:"scale="+a.scale+"&callback="+l(function p(){return m(p),--o>0&&f(),!0})},a)),e(!1,k),k=null}function p(a){return{id:a.id,name:a.name,matrix:a.matrix,flashId:a.flashId}}function q(b){var c=b.getBoundingClientRect(),e=d.body,f=(b&&b.ownerDocument).documentElement;return{top:c.top+(a.pageYOffset||f.scrollTop)-(f.clientTop||e.clientTop||0),left:c.left+(a.pageXOffset||f.scrollLeft)-(f.clientLeft||e.clientLeft||0),width:c.right-c.left,height:c.bottom-c.top}}var r=c.uid(),s=0,t={},u=/^https?:/i,v={_fn:{},init:function(){var a=d.body&&d.body.firstChild;if(a)do if(1==a.nodeType){c.log("FlashAPI.state: awaiting");var b=d.createElement("div");return b.id="_"+r,i(b,{top:1,right:1,width:5,height:5,position:"absolute",zIndex:"2147483647"}),a.parentNode.insertBefore(b,a),void v.publish(b,r)}while(a=a.nextSibling);10>s&&setTimeout(v.init,50*++s)},publish:function(a,b,d){d=d||{},a.innerHTML=h({id:b,src:n(c.flashUrl,"r="+c.version),wmode:d.camera?"":"transparent",flashvars:"callback="+(d.onEvent||"FileAPI.Flash.onEvent")+"&flashId="+b+"&storeKey="+f.userAgent.match(/\d/gi).join("")+"_"+c.version+(v.isReady||(c.pingUrl?"&ping="+c.pingUrl:""))+"&timeout="+c.flashAbortTimeout+(d.camera?"&useCamera="+n(c.flashWebcamUrl):"")+"&debug="+(c.debug?"1":"")},d)},ready:function(){c.log("FlashAPI.state: ready"),v.ready=c.F,v.isReady=!0,v.patch(),v.patchCamera&&v.patchCamera(),c.event.on(d,"mouseover",v.mouseover),c.event.on(d,"click",function(a){v.mouseover(a)&&(a.preventDefault?a.preventDefault():a.returnValue=!0)})},getEl:function(){return d.getElementById("_"+r)},getWrapper:function(a){do if(/js-fileapi-wrapper/.test(a.className))return a;while((a=a.parentNode)&&a!==d.body)},mouseover:function(a){var b=c.event.fix(a).target;if(/input/i.test(b.nodeName)&&"file"==b.type&&!b.disabled){var e=b.getAttribute(r),f=v.getWrapper(b);if(c.multiFlash){if("i"==e||"r"==e)return!1;if("p"!=e){b.setAttribute(r,"i");var g=d.createElement("div");if(!f)return void c.log("[err] FlashAPI.mouseover: js-fileapi-wrapper not found");i(g,{top:0,left:0,width:b.offsetWidth,height:b.offsetHeight,zIndex:"2147483647",position:"absolute"}),f.appendChild(g),v.publish(g,c.uid()),b.setAttribute(r,"p")}return!0}if(f){var h=q(f);i(v.getEl(),h),v.curInp=b}}else/object|embed/i.test(b.nodeName)||i(v.getEl(),{top:1,left:1,width:5,height:5})},onEvent:function(a){var b=a.type;if("ready"==b){try{v.getInput(a.flashId).setAttribute(r,"r")}catch(d){}return v.ready(),setTimeout(function(){v.mouseenter(a)},50),!0}"ping"===b?c.log("(flash -> js).ping:",[a.status,a.savedStatus],a.error):"log"===b?c.log("(flash -> js).log:",a.target):b in v&&setTimeout(function(){c.log("FlashAPI.event."+a.type+":",a),v[b](a)},1)},mouseenter:function(a){var b=v.getInput(a.flashId);if(b){v.cmd(a,"multiple",null!=b.getAttribute("multiple"));var d=[],e={};g((b.getAttribute("accept")||"").split(/,\s*/),function(a){c.accept[a]&&g(c.accept[a].split(" "),function(a){e[a]=1})}),g(e,function(a,b){d.push(b)}),v.cmd(a,"accept",d.length?d.join(",")+","+d.join(",").toUpperCase():"*")}},get:function(b){return d[b]||a[b]||d.embeds[b]},getInput:function(a){if(!c.multiFlash)return v.curInp;try{var b=v.getWrapper(v.get(a));if(b)return b.getElementsByTagName("input")[0]}catch(d){c.log('[err] Can not find "input" by flashId:',a,d)}},select:function(a){var e,f=v.getInput(a.flashId),h=c.uid(f),i=a.target.files;g(i,function(a){c.checkFileObj(a)}),t[h]=i,d.createEvent?(e=d.createEvent("Event"),e.files=i,e.initEvent("change",!0,!0),f.dispatchEvent(e)):b?b(f).trigger({type:"change",files:i}):(e=d.createEventObject(),e.files=i,f.fireEvent("onchange",e))},cmd:function(a,b,d,e){try{return c.log("(js -> flash)."+b+":",d),v.get(a.flashId||a).cmd(b,d)}catch(f){c.log("(js -> flash).onError:",f.toString()),e||setTimeout(function(){v.cmd(a,b,d,!0)},50)}},patch:function(){c.flashEngine=!0,j(c,{getFiles:function(a,b,d){if(d)return c.filterFiles(c.getFiles(a),b,d),null;var e=c.isArray(a)?a:t[c.uid(a.target||a.srcElement||a)];return e?(b&&(b=c.getFilesFilter(b),e=c.filter(e,function(a){return b.test(a.name)})),e):this.parent.apply(this,arguments)},getInfo:function(a,b){if(k(a))this.parent.apply(this,arguments);else if(a.isShot)b(null,a.info={width:a.width,height:a.height});else{if(!a.__info){var d=a.__info=c.defer();v.cmd(a,"getFileInfo",{id:a.id,callback:l(function e(b,c){m(e),d.resolve(b,a.info=c)})})}a.__info.then(b)}}}),c.support.transform=!0,c.Image&&j(c.Image.prototype,{get:function(a,b){return this.set({scaleMode:b||"noScale"}),this.parent(a)},_load:function(a,b){if(c.log("FlashAPI.Image._load:",a),k(a))this.parent.apply(this,arguments);else{var d=this;c.getInfo(a,function(c){b.call(d,c,a)})}},_apply:function(a,b){if(c.log("FlashAPI.Image._apply:",a),k(a))this.parent.apply(this,arguments);else{var d=this.getMatrix(a.info),e=b;v.cmd(a,"imageTransform",{id:a.id,matrix:d,callback:l(function f(g,h){c.log("FlashAPI.Image._apply.callback:",g),m(f),g?e(g):c.support.html5||c.support.dataURI&&!(h.length>3e4)?(d.filter&&(e=function(a,e){a?b(a):c.Image.applyFilter(e,d.filter,function(){b(a,this.canvas)})}),c.newImage("data:"+a.type+";base64,"+h,e)):o({width:d.deg%180?d.dh:d.dw,height:d.deg%180?d.dw:d.dh,scale:d.scaleMode},h,e)})})}},toData:function(a){var b=this.file,d=b.info,e=this.getMatrix(d);c.log("FlashAPI.Image.toData"),k(b)?this.parent.apply(this,arguments):("auto"==e.deg&&(e.deg=c.Image.exifOrientation[d&&d.exif&&d.exif.Orientation]||0),a.call(this,!b.info,{id:b.id,flashId:b.flashId,name:b.name,type:b.type,matrix:e}))}}),c.Image&&j(c.Image,{fromDataURL:function(a,b,d){!c.support.dataURI||a.length>3e4?o(c.extend({scale:"exactFit"},b),a.replace(/^data:[^,]+,/,""),function(a,b){d(b)}):this.parent(a,b,d)}}),j(c.Form.prototype,{toData:function(a){for(var b=this.items,d=b.length;d--;)if(b[d].file&&k(b[d].blob))return this.parent.apply(this,arguments);c.log("FlashAPI.Form.toData"),a(b)}}),j(c.XHR.prototype,{_send:function(a,b){if(b.nodeName||b.append&&c.support.html5||c.isArray(b)&&"string"==typeof b[0])return this.parent.apply(this,arguments);var d,e,f={},h={},i=this;if(g(b,function(a){a.file?(h[a.name]=a=p(a.blob),e=a.id,d=a.flashId):f[a.name]=a.blob}),e||(d=r),!d)return c.log("[err] FlashAPI._send: flashId -- undefined"),this.parent.apply(this,arguments);c.log("FlashAPI.XHR._send: "+d+" -> "+e),i.xhr={headers:{},abort:function(){v.cmd(d,"abort",{id:e})},getResponseHeader:function(a){return this.headers[a]},getAllResponseHeaders:function(){return this.headers}};var j=c.queue(function(){v.cmd(d,"upload",{url:n(a.url.replace(/([a-z]+)=(\?)&?/i,"")),data:f,files:e?h:null,headers:a.headers||{},callback:l(function b(d){var e=d.type,f=d.result;c.log("FlashAPI.upload."+e),"progress"==e?(d.loaded=Math.min(d.loaded,d.total),d.lengthComputable=!0,a.progress(d)):"complete"==e?(m(b),"string"==typeof f&&(i.responseText=f.replace(/%22/g,'"').replace(/%5c/g,"\\").replace(/%26/g,"&").replace(/%25/g,"%")),i.end(d.status||200)):("abort"==e||"error"==e)&&(i.end(d.status||0,d.message),m(b))})})});g(h,function(a){j.inc(),c.getInfo(a,j.next)}),j.check()}})}};c.Flash=v,c.newImage("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",function(a,b){c.support.dataURI=!(1!=b.width||1!=b.height),v.init()})}()}(window,window.jQuery,FileAPI),function(a,b,c){"use strict";var d=c.each,e=[];!c.support.flash||!c.media||c.support.media&&c.html5||!function(){function a(a){var b=a.wid=c.uid();return c.Flash._fn[b]=a,"FileAPI.Flash._fn."+b}function b(a){try{c.Flash._fn[a.wid]=null,delete c.Flash._fn[a.wid]}catch(b){}}var f=c.Flash;c.extend(c.Flash,{patchCamera:function(){c.Camera.fallback=function(d,e,g){var h=c.uid();c.log("FlashAPI.Camera.publish: "+h),f.publish(d,h,c.extend(e,{camera:!0,onEvent:a(function i(a){"camera"===a.type&&(b(i),a.error?(c.log("FlashAPI.Camera.publish.error: "+a.error),g(a.error)):(c.log("FlashAPI.Camera.publish.success: "+h),g(null)))})}))},d(e,function(a){c.Camera.fallback.apply(c.Camera,a)}),e=[],c.extend(c.Camera.prototype,{_id:function(){return this.video.id},start:function(d){var e=this;f.cmd(this._id(),"camera.on",{callback:a(function g(a){b(g),a.error?(c.log("FlashAPI.camera.on.error: "+a.error),d(a.error,e)):(c.log("FlashAPI.camera.on.success: "+e._id()),e._active=!0,d(null,e))})})},stop:function(){this._active=!1,f.cmd(this._id(),"camera.off")},shot:function(){c.log("FlashAPI.Camera.shot:",this._id());var a=c.Flash.cmd(this._id(),"shot",{});return a.type="image/png",a.flashId=this._id(),a.isShot=!0,new c.Camera.Shot(a)}})}}),c.Camera.fallback=function(){e.push(arguments)}}()}(window,window.jQuery,FileAPI),"function"==typeof define&&define.amd&&define("FileAPI",[],function(){return FileAPI}); \ No newline at end of file diff --git a/manager/media/browser/mcpuk/js/FileAPI/crossdomain.xml.example b/manager/media/browser/mcpuk/js/FileAPI/crossdomain.xml.example index 41503ae378..32920c4f07 100644 --- a/manager/media/browser/mcpuk/js/FileAPI/crossdomain.xml.example +++ b/manager/media/browser/mcpuk/js/FileAPI/crossdomain.xml.example @@ -1,9 +1,9 @@ - - - - - - - - - + + + + + + + + + diff --git a/manager/media/browser/mcpuk/js/FileAPI/jquery.fileapi.min.js b/manager/media/browser/mcpuk/js/FileAPI/jquery.fileapi.min.js index 8cd6472513..ec7369ec59 100644 --- a/manager/media/browser/mcpuk/js/FileAPI/jquery.fileapi.min.js +++ b/manager/media/browser/mcpuk/js/FileAPI/jquery.fileapi.min.js @@ -1,2 +1,2 @@ -/*! fileapi 2.0.1 - BSD | git://github.com/mailru/FileAPI.git */ +/*! fileapi 2.0.1 - BSD | git://github.com/mailru/FileAPI.git */ (function(e,t){"use strict";var n=e.noop,i=!e.fn.prop,a=i?"attr":"prop",r="data-fileapi",o="data-fileapi-id",s=function(i,a){if(this.$el=i=e(i).on("change.fileapi",e.proxy(this,"_onSelect")),this.el=i[0],this._options={},this.options=a=e.extend({url:0,data:{},accept:0,multiple:!1,paramName:0,dataType:"json",duplicate:!1,chunkSize:0,chunkUploadRetry:3,maxSize:0,maxFiles:0,imageSize:0,sortFn:0,filterFn:0,autoUpload:!1,lang:{B:"bytes",KB:"KB",MB:"MB",GB:"GB",TB:"TB"},sizeFormat:"0.00",imageTransform:0,elements:{ctrl:{upload:'[data-fileapi="ctrl.upload"]',reset:'[data-fileapi="ctrl.reset"]',abort:'[data-fileapi="ctrl.abort"]'},empty:{show:'[data-fileapi="empty.show"]',hide:'[data-fileapi="empty.hide"]'},emptyQueue:{show:'[data-fileapi="emptyQueue.show"]',hide:'[data-fileapi="emptyQueue.hide"]'},active:{show:'[data-fileapi="active.show"]',hide:'[data-fileapi="active.hide"]'},size:'[data-fileapi="size"]',name:'[data-fileapi="name"]',progress:'[data-fileapi="progress"]',file:{tpl:'[data-fileapi="file.tpl"]',progress:'[data-fileapi="file.progress"]',active:{show:'[data-fileapi="active.show"]',hide:'[data-fileapi="active.hide"]'},preview:{el:0,get:0,width:0,height:0,processing:0}},dnd:{el:'[data-fileapi="dnd"]',hover:"dnd_hover"}},onDrop:n,onDropHover:n,onSelect:n,onUpload:n,onProgress:n,onComplete:n,onFileUpload:n,onFileProgress:n,onFileComplete:n},a),!a.url){var o=this.$el.attr("action")||this.$el.find("form").attr("action");o?a.url=o:this._throw("url — is not defined")}this.$files=this.elem("list"),this.itemTplFn=e.fn.fileapi.tpl(e("
    ").append(this.elem("file.tpl")).html()),t.each(a,function(e,t){this._setOption(t,e)},this),this.$el.on("reset.fileapi",e.proxy(this,"_onReset")).on("submit.fileapi",e.proxy(this,"_onSubmit")).on("upload.fileapi progress.fileapi complete.fileapi",e.proxy(this,"_onUploadEvent")).on("fileupload.fileapi fileprogress.fileapi filecomplete.fileapi",e.proxy(this,"_onFileUploadEvent")).on("click","["+r+"]",e.proxy(this,"_onActionClick"));var s=a.elements.ctrl;s&&(s.reset&&this.$el.on("click.fileapi",s.reset,e.proxy(this,"_onReset")),s.upload&&this.$el.on("click.fileapi",s.upload,e.proxy(this,"_onSubmit"))),this.elem("dnd.el",!0).dnd(e.proxy(this,"_onDropHover"),e.proxy(this,"_onDrop")),this.$progress=this.elem("progress"),this._crop={},this._rotate={},this.files=[],this.uploaded=[],this.clear()};s.prototype={constructor:s,_throw:function(e){throw"jquery.fileapi: "+e},_getFiles:function(e,n){var i=this.options,a=i.maxSize,r=i.filterFn,o=t.getFiles(e),s={all:o,files:[],other:[],duplicate:i.duplicate?[]:this._extractDuplicateFiles(o)},l=i.imageSize,u=this;l||r?t.filterFiles(o,function(e,t){var n=!0;return t&&l&&(n=(!l.minWidth||t.width>=l.minWidth)&&(!l.minHeight||t.height>=l.minHeight)&&(!l.maxWidth||t.height<=l.maxWidth)&&(!l.maxHeight||t.height<=l.maxHeight)),n&&(!a||a>=e.size)&&(!r||r(e,t))},function(e,t){s.files=e,s.other=t,n.call(u,s)}):(t.each(o,function(e){s[!a||a>=e.size?"files":"other"].push(e)}),n.call(u,s))},_extractDuplicateFiles:function(e){for(var t,n=[],i=e.length,a=this.files;i--;)for(t=a.length;t--;)if(this._fileCompare(e[i],a[t])){n.push(e.splice(i,1));break}return n},_fileCompare:function(e,t){return e.size==t.size&&e.name==t.name},_getFormatedSize:function(e){var n=this.options,i="B";return e>=t.TB?e/=t[i="TB"]:e>=t.GB?e/=t[i="GB"]:e>=t.MB?e/=t[i="MB"]:e>=t.KB&&(e/=t[i="KB"]),n.sizeFormat.replace(/^\d+([^\d]+)(\d*)/,function(t,a,r){return e=e.toFixed(r.length),(e+"").replace(".",a)+" "+n.lang[i]})},_onSelect:function(t){this._getFiles(t,e.proxy(function(e){e.all.length&&this.emit("select",e)!==!1&&this.add(e.files)},this))},_onActionClick:function(n){var i=n.currentTarget,a=e.attr(i,r),s=e(i).closest("["+o+"]",this.$el),l=s.attr(o),u=!0;"remove"==a?(s.remove(),this.queue=t.filter(this.queue,function(e){return t.uid(e)!=l}),this.files=t.filter(this.files,function(e){return t.uid(e)!=l}),this._redraw()):/^rotate/.test(a)?this.rotate(l,/ccw/.test(a)?"-=90":"+=90"):u=!1,u&&n.preventDefault()},_onSubmit:function(e){this.upload(),e.preventDefault()},_onReset:function(e){this.clear(),e.preventDefault()},_onDrop:function(e){this._getFiles(e,function(e){this.emit("drop",e)!==!1&&this.add(e.files)})},_onDropHover:function(t,n){if(this.emit("dropHover",{state:t,event:n})!==!1){var i=this.option("elements.dnd.hover");i&&e(n.currentTarget).toggleClass(i,t)}},_getUploadEvent:function(t){var n=this.xhr,i={xhr:n,file:n.currentFile,files:n.files,widget:this};return e.extend(i,t)},_emitUploadEvent:function(e){var t=this._getUploadEvent();this.emit(e+"upload",t)},_emitProgressEvent:function(e,t){var n=this._getUploadEvent(t);this.emit(e+"progress",n)},_emitCompleteEvent:function(t,n){var i=this.xhr,a=this._getUploadEvent({error:n,status:i.status,statusText:i.statusText,result:i.responseText});"json"==this.options.dataType&&(a.result=e.parseJSON(a.result)),this.emit(t+"complete",a)},_onUploadEvent:function(e,t){var n=this,i=this.$progress,a=e.type;if("progress"==a)i.stop().animate({width:100*(t.loaded/t.total)+"%"},300);else if("upload"==a)i.width(0);else{var r=function(){i.dequeue(),n.clear()};this.xhr=null,this.active=!1,i.length?i.queue(r):r()}},_onFileUploadPrepare:function(n,i){var a=t.uid(n),r=this._rotate[a],o=this._crop[a];if(r||o){var s=i.imageTransform=i.imageTransform||{};e.isEmptyObject(s)||parseInt(s.maxWidth||s.minWidth||s.width,10)>0||s.type||s.quality?(s.crop=o,s.rotate=r):t.each(s,function(e){e.crop=o,e.rotate=r})}},_onFileUploadEvent:function(e,n){var i=this,a=e.type.substr(4),o=t.uid(n.file),s=this.fileElem(o),l=this._$fileprogress;if(this.__fileId!==o&&(this.__fileId=o,this._$fileprogress=l=s.find(this.option("elements.file.progress"))),"progress"==a)l.stop().animate({width:100*(n.loaded/n.total)+"%"},300);else if("upload"==a||"complete"==a){var u=function(){var e="elements.file."+a;"upload"==a&&(s.find("["+r+'="remove"]').hide(),l.width(0)),l.dequeue(),s.find(i.option(e+".show")).show(),s.find(i.option(e+".hide")).hide()};l.length?l.queue(u):u(),"complete"==a&&(this.uploaded.push(n.file),delete this._rotate[o])}},_redraw:function(){var n=!!this.active,i=this.files,r=!i.length&&!n,s=!this.queue.length&&!n,l=[],u=0,c=this.$files,f=c.children().length,d=this.option("elements.file.preview");t.each(i,function(n,i){var a=t.uid(n);if(l.push(n.name),u+=n.size,c.length&&!this.fileElem(a).length){var r=this.itemTplFn({$idx:f+i,uid:n.uid,name:n.name,type:n.type,size:n.size,sizeText:this._getFormatedSize(n.size)});c.append(e(r).attr(o,a)),d.el&&this._makeFilePreview(a,n,d)}},this),this.elem("name").text(l.join(", ")),this.elem("size").text(this._getFormatedSize(u)),this.__empty!==r&&(this.__empty=r,this.elem("empty.show").toggle(r),this.elem("empty.hide").toggle(!r)),this.__emptyQueue!==s&&(this.__emptyQueue=r,this.elem("emptyQueue.show").toggle(s),this.elem("emptyQueue.hide").toggle(!s)),this.__active!==n&&(this.__active=n,this.elem("active.show").toggle(n),this.elem("active.hide").toggle(!n),this.$(".js-fileapi-wrapper,:file")[n?"attr":"removeAttr"]("aria-disabled",n)[a]("disabled",n)),this.elem("ctrl.upload").add(this.elem("ctrl.reset"))[r||n?"attr":"removeAttr"]("aria-disabled",r||n)[a]("disabled",r||n)},_makeFilePreview:function(e,n,i,a){var r=this,o=a?r.$(i.el):r.fileElem(e).find(i.el);if(/^image/.test(n.type)){t.log("_makeFilePreview:",e,n);var s=t.Image(n),l=function(){s.get(function(t,a){r._crop[e]||(t?(i.get&&i.get(o,n),r.emit("filePreviewError",{error:t,file:n})):o.html(a))})};i.width&&s.preview(i.width,i.height),i.rotate&&s.rotate(i.rotate),i.processing?i.processing(n,s,l):l()}else i.get&&i.get(o,n)},emit:function(t,n){var i,a=this.options,r=e.Event(t);return r.widget=this,t=e.camelCase("on-"+t.replace(/(file)(upload)/,"$1-$2")),e.isFunction(a[t])&&(i=a[t].call(this.el,r,n)),i!==!1&&this.$el.triggerHandler(r,n)},add:function(e){if(e.length){var n=this.options,i=n.sortFn,a=n.elements.preview;i&&e.sort(i),a&&a.el&&t.each(e,function(e){this._makeFilePreview(t.uid(e),e,a,!0)},this),this.xhr&&this.xhr.append(e),this.queue=this.queue.concat(e),this.files=this.files.concat(e),this.options.autoUpload?this.upload():this._redraw()}},$:function(t,n){return"string"==typeof t&&(t=/^#/.test(t)?t:(n?e(n):this.$el).find(t)),e(t)},elem:function(t,n){var i=this.option("elements."+t);return void 0===i&&n&&(i=this.option("elements."+t.substr(0,t.lastIndexOf(".")))),this.$("string"!=e.type(i)&&e.isEmptyObject(i)?[]:i)},fileElem:function(e){return this.$("["+o+'="'+e+'"]')},option:function(n,i){if(void 0!==i&&e.isPlainObject(i))return t.each(i,function(e,t){this.option(n+"."+t,e)},this),this;var a,r,o=this.options,s=o[n],l=0;if(-1!=n.indexOf("."))for(s=o,n=n.split("."),a=n.length;a>l;l++){if(r=n[l],void 0!==i&&1===a-l){s[r]=i;break}void 0===s[r]&&(s[r]={}),s=s[r]}else void 0!==i&&(o[n]=i);return void 0!==i&&(this._setOption(n,i,this._options[n]),this._options[n]=i),void 0!==i?i:s},_setOption:function(e,t){switch(e){case"accept":case"multiple":case"paramName":"paramName"==e&&(e="name"),t&&this.$(":file")[a](e,t)}},serialize:function(){var t,n={};return this.$el.find(":input").each(function(i,a){(i=a.name)&&!a.disabled&&(a.checked||/select|textarea|input/i.test(a.nodeName)&&/checkbox|radio/i.test(a.type))&&(t=e(a).val(),void 0!==n[i]?(n[i].push||(n[i]=[n[i]]),n[i].push(t)):n[i]=t)}),n},upload:function(){if(!this.active){this.active=!0;var n=this.$el,i=this.options,a={},r={url:i.url,data:e.extend({},this.serialize(),i.data),files:a,chunkSize:0|i.chunkSize,chunkUploadRetry:0|i.chunkUploadRetry,prepare:e.proxy(this,"_onFileUploadPrepare"),imageTransform:i.imageTransform};a[n.find(":file").attr("name")||"files[]"]=this.queue,t.each(["upload","progress","complete"],function(t){r[t]=e.proxy(this,e.camelCase("_emit-"+t+"Event"),""),r["file"+t]=e.proxy(this,e.camelCase("_emit-"+t+"Event"),"file")},this),this.xhr=t.upload(r),this._redraw()}},crop:function(n,i){var a=t.uid(n),r=this.options,o=r.multiple?this.option("elements.file.preview"):r.elements.preview,s=(r.multiple?this.fileElem(a):this.$el).find(o&&o.el);s.length&&t.getInfo(n,e.proxy(function(a,r){if(!a){s.find("div>div").length||s.html(e("
    ").css(o).css("overflow","hidden")),this.__cropFile!==n&&(this.__cropFile=n,t.Image(n).get(function(t,n){s.find(">div>div").html(e(n).width("100%").height("100%"))},"exactFit"));var l=o.width/i.w,u=o.height/i.h;s.find(">div>div").css({width:Math.round(l*r.width),height:Math.round(u*r.height),marginLeft:-Math.round(l*i.x),marginTop:-Math.round(u*i.y)})}},this)),this._crop[a]=i},rotate:function(e,n){var i="object"==typeof e?t.uid(e):e,a=this.options,r=a.multiple?this.option("elements.file.preview"):a.elements.preview,o=(a.multiple?this.fileElem(i):this.$el).find(r&&r.el),s=this._rotate;/([+-])=/.test(n)?n=s[i]=(s[i]||0)+("+"==RegExp.$1?1:-1)*n.substr(2):s[i]=n,o.css({"-webkit-transform":"rotate("+n+"deg)","-moz-transform":"rotate("+n+"deg)",transform:"rotate("+n+"deg)"})},clear:function(){this.queue=[],this._redraw()},widget:function(){return this},destroy:function(){this.$el.off(".fileapi").removeData("fileapi")}},e.fn.fileapi=function(t,n){var i=this.data("fileapi");if(i){if("widget"===t)return i;if("string"==typeof t){var a,r=i[t];return e.isFunction(r)?a=r.call(i,n,arguments[2]):void 0===r&&(a=this.option(t,n)),void 0===a?this:a}}else this.data("fileapi",new s(this,t));return this},e.fn.fileapi.version="0.1.0",e.fn.fileapi.tpl=function(e){var t=0,n="__b+='";return e.replace(/(?:<|<)%([-=])?([\s\S]+?)%(?:>|>)|$/g,function(i,a,r,o){return n+=e.slice(t,o).replace(/[\r\n"']/g,function(e){return"\\"+e}),r&&(n+=a?"'+\n((__x=("+r+"))==null?'':"+("-"==a?"__esc(__x)":"__x")+")\n+'":"';\n"+r+"\n__b+='"),t=o+i.length,i}),Function("ctx","var __x,__b='',__esc=function(val){return typeof val=='string'?val.replace(/ - * @copyright 2010-2014 KCFinder Project - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 - * @link http://kcfinder.sunhater.com - */ - +/** This file is part of KCFinder project + * + * @desc FileAPI uploader + * @package KCFinder + * @version 2.54 + * @author Pavel Tzonkov + * @copyright 2010-2014 KCFinder Project + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 + * @link http://kcfinder.sunhater.com + */ + browser.initUploader = function() { var btn = $('#toolbar a[href="kcact:upload"]'); if (!this.access.files.upload) { btn.css('display', 'none'); return; - } - $('#toolbar').prepend(''); - var upload = $('input[name="upload"]', '#toolbar'); - btn.click(function(e){ - e.preventDefault(); - browser.clearUpload(); - upload.trigger('click'); - }); + } + $('#toolbar').prepend(''); + var upload = $('input[name="upload"]', '#toolbar'); + btn.click(function(e){ + e.preventDefault(); + browser.clearUpload(); + upload.trigger('click'); + }); FileAPI.event.on(upload.get(0), 'change', function (evt){ var files = FileAPI.getFiles(evt); // Retrieve file list browser.prepareFiles(files); @@ -221,116 +221,116 @@ browser.clearUpload = function() { upload.wrap('
    ').closest('form').get(0).reset(); upload.unwrap(); }; -browser.prepareFiles = function(files) { - FileAPI.filterFiles( - files, - function(file) { - var ext = file.name.split('.').pop().toLowerCase(); - var result = browser.allowedExts.test(ext) && !browser.deniedExts.test(ext); - if (!result) { - file.message = browser.label("Denied file extension."); - } - if (result) { - result = browser.maxFileSize > file.size; - if (!result) { - file.message = browser.label("The uploaded file exceeds {size} bytes.", {size: browser.maxFileSize}); - } - } - return result; - }, function (files, rejected) { - if (rejected.length > 0) { - var messages = []; - $.each(rejected, function(i, file) { - messages.push(file.name + ': ' +file.message); - }); - browser.alert(messages.join('
    '), true, function(){browser.uploadFiles(files)}); - } else { - browser.uploadFiles(files); - } - } - ); -}; -browser.uploadFiles = function(files) { - if (!this.dirWritable) { - browser.alert(this.label("Cannot write to upload folder.")); - return; - } - var uploadInProgress = false, - filesCount = 0, - errors = [], - uploaded = 0; - if( files.length ){ - filesCount = files.length; - var options = { - url: browser.baseGetData('upload'), - files: { file: files }, - data: { - dir: browser.dir - }, - imageAutoOrientation: false, - prepare: function (file/**Object*/, options/**Object*/){ - if (file.type !== 'image/jpeg' && file.type !== 'image/png') { - options.imageTransform = false; - } - }, - upload: function() { - $('#loading').html(browser.label("Uploading file {number} of {count}... {progress}", { - number: uploaded++, - count: filesCount, - progress: "" - })); - uploadInProgress = true; - $('#loading').show(); - browser.fadeFiles(); - }, - progress: function (evt){ - var progress = Math.round((evt.loaded * 100) / evt.total) + '%'; - $('#loading').html(browser.label("Uploading file {number} of {count}... {progress}", { - number: uploaded, - count: filesCount, - progress: progress - })); - }, - filecomplete:function(err, xhr, file) { - if(err === false) { - var response; - try { - response = $.parseJSON(xhr.response); - } catch (error) { - response = { - success:false, - message:browser.label("Unable to process server response") - } - } - if (!response.success) { - if (typeof response.message === 'object') { - response.message = response.message.join('; '); - }; - errors.push(file.name + ': ' + response.message); - } - } else { - errors.push(file.name + ': ' + browser.label("Server error") + ' ' + err); - } - uploaded++; - }, - complete: function (err, xhr){ - uploadInProgress = false; - $('#loading').hide(); - browser.refresh(); - browser.clearUpload(); - if (errors.length > 0) { - browser.alert(errors.join('
    '), false); - } - } - }; - if (Object.keys(browser.clientResize).length) { - options.imageTransform = { - maxWidth: browser.clientResize.maxWidth, - maxHeight: browser.clientResize.maxHeight, - quality: browser.clientResize.quality - }; - options.imageAutoOrientation = true; - } - FileAPI.upload(options); - } -}; +browser.prepareFiles = function(files) { + FileAPI.filterFiles( + files, + function(file) { + var ext = file.name.split('.').pop().toLowerCase(); + var result = browser.allowedExts.test(ext) && !browser.deniedExts.test(ext); + if (!result) { + file.message = browser.label("Denied file extension."); + } + if (result) { + result = browser.maxFileSize > file.size; + if (!result) { + file.message = browser.label("The uploaded file exceeds {size} bytes.", {size: browser.maxFileSize}); + } + } + return result; + }, function (files, rejected) { + if (rejected.length > 0) { + var messages = []; + $.each(rejected, function(i, file) { + messages.push(file.name + ': ' +file.message); + }); + browser.alert(messages.join('
    '), true, function(){browser.uploadFiles(files)}); + } else { + browser.uploadFiles(files); + } + } + ); +}; +browser.uploadFiles = function(files) { + if (!this.dirWritable) { + browser.alert(this.label("Cannot write to upload folder.")); + return; + } + var uploadInProgress = false, + filesCount = 0, + errors = [], + uploaded = 0; + if( files.length ){ + filesCount = files.length; + var options = { + url: browser.baseGetData('upload'), + files: { file: files }, + data: { + dir: browser.dir + }, + imageAutoOrientation: false, + prepare: function (file/**Object*/, options/**Object*/){ + if (file.type !== 'image/jpeg' && file.type !== 'image/png') { + options.imageTransform = false; + } + }, + upload: function() { + $('#loading').html(browser.label("Uploading file {number} of {count}... {progress}", { + number: uploaded++, + count: filesCount, + progress: "" + })); + uploadInProgress = true; + $('#loading').show(); + browser.fadeFiles(); + }, + progress: function (evt){ + var progress = Math.round((evt.loaded * 100) / evt.total) + '%'; + $('#loading').html(browser.label("Uploading file {number} of {count}... {progress}", { + number: uploaded, + count: filesCount, + progress: progress + })); + }, + filecomplete:function(err, xhr, file) { + if(err === false) { + var response; + try { + response = $.parseJSON(xhr.response); + } catch (error) { + response = { + success:false, + message:browser.label("Unable to process server response") + } + } + if (!response.success) { + if (typeof response.message === 'object') { + response.message = response.message.join('; '); + }; + errors.push(file.name + ': ' + response.message); + } + } else { + errors.push(file.name + ': ' + browser.label("Server error") + ' ' + err); + } + uploaded++; + }, + complete: function (err, xhr){ + uploadInProgress = false; + $('#loading').hide(); + browser.refresh(); + browser.clearUpload(); + if (errors.length > 0) { + browser.alert(errors.join('
    '), false); + } + } + }; + if (Object.keys(browser.clientResize).length) { + options.imageTransform = { + maxWidth: browser.clientResize.maxWidth, + maxHeight: browser.clientResize.maxHeight, + quality: browser.clientResize.quality + }; + options.imageAutoOrientation = true; + } + FileAPI.upload(options); + } +}; diff --git a/manager/media/browser/mcpuk/js/customEvent.js b/manager/media/browser/mcpuk/js/customEvent.js index a892baa31e..5a0ff4b75a 100644 --- a/manager/media/browser/mcpuk/js/customEvent.js +++ b/manager/media/browser/mcpuk/js/customEvent.js @@ -1,15 +1,15 @@ -(function () { - if (typeof window.CustomEvent === "function") { - return false; - } - - function CustomEvent(event, params) { - params = params || {bubbles: false, cancelable: false, detail: undefined}; - var evt = document.createEvent("CustomEvent"); - evt.initCustomEvent (event, params.bubbles, params.cancelable, params.detail); - return evt; - } - - CustomEvent.prototype = window.Event.prototype; - window.CustomEvent = CustomEvent; -})(); +(function () { + if (typeof window.CustomEvent === "function") { + return false; + } + + function CustomEvent(event, params) { + params = params || {bubbles: false, cancelable: false, detail: undefined}; + var evt = document.createEvent("CustomEvent"); + evt.initCustomEvent (event, params.bubbles, params.cancelable, params.detail); + return evt; + } + + CustomEvent.prototype = window.Event.prototype; + window.CustomEvent = CustomEvent; +})(); diff --git a/manager/media/browser/mcpuk/lib/class_gd.php b/manager/media/browser/mcpuk/lib/class_gd.php index 95975b8a47..bbb2583346 100755 --- a/manager/media/browser/mcpuk/lib/class_gd.php +++ b/manager/media/browser/mcpuk/lib/class_gd.php @@ -1,424 +1,424 @@ - - * @copyright 2010, 2011 KCFinder Project - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 - * @link http://kcfinder.sunhater.com - */ - -class gd { - - /** GD resource - * @var resource */ - protected $image; - - /** Image width - * @var integer */ - protected $width; - - /** Image height - * @var integer */ - protected $height; - - /** Init error - * @var bool */ - public $init_error = false; - - /** Last builded image type constant (IMAGETYPE_XXX) - * @var integer */ - public $type; - - /** Returns an array. Element 0 - GD resource. Element 1 - width. Element 2 - height. - * Returns FALSE on failure. The only one parameter $image can be an instance of this class, - * a GD resource, an array(width, height) or path to image file. - * @param mixed $image - * @return array */ - - protected function build_image($image) { - - if ($image instanceof gd) { - $width = $image->get_width(); - $height = $image->get_height(); - $image = $image->get_image(); - - } elseif (is_resource($image) && (get_resource_type($image) == "gd")) { - $width = @imagesx($image); - $height = @imagesy($image); - - } elseif (is_array($image)) { - $height = $width = end($image); - $image = imagecreatetruecolor($width, $height); - - } elseif (false !== (list($width, $height, $type) = @getimagesize($image))) { - $image = - ($type == IMAGETYPE_GIF) ? @imagecreatefromgif($image) : ( - ($type == IMAGETYPE_WBMP) ? @imagecreatefromwbmp($image) : ( - ($type == IMAGETYPE_JPEG) ? @imagecreatefromjpeg($image) : ( - ($type == IMAGETYPE_JPEG2000) ? @imagecreatefromjpeg($image) : ( - ($type == IMAGETYPE_PNG) ? @imagecreatefrompng($image) : ( - ($type == IMAGETYPE_XBM) ? @imagecreatefromxbm($image) : false - ))))); - - if ($type == IMAGETYPE_PNG) - imagealphablending($image, false); - } - - $return = ( - is_resource($image) && - (get_resource_type($image) == "gd") && - isset($width) && - isset($height) && - (preg_match('/^[1-9][0-9]*$/', $width) !== false) && - (preg_match('/^[1-9][0-9]*$/', $height) !== false) - ) - ? [$image, $width, $height] - : false; - - if (($return !== false) && isset($type)) - $this->type = $type; - - return $return; - } - - /** Parameter $image can be: - * 1. An instance of this class (copy instance). - * 2. A GD resource. - * 3. An array with two elements. First - width, second - height. Create a blank image. - * 4. A filename string. Get image form file. - * The non-required parameter $bigger_size is the bigger dimension (width or height) the image - * will be resized to. The other dimension (height or width) will be calculated autamaticaly - * @param mixed $image - * @param integer $bigger_size - * @return gd */ - - public function __construct($image, $bigger_size=null) { - $this->image = $this->width = $this->height = null; - - $image_details = $this->build_image($image); - - if ($image_details !== false) - list($this->image, $this->width, $this->height) = $image_details; - else - $this->init_error = true; - - if (!is_null($this->image) && - !is_null($bigger_size) && - (preg_match('/^[1-9][0-9]*$/', $bigger_size) !== false) - ) { - $image = $this->image; - list($width, $height) = $this->get_prop_size($bigger_size); - $this->image = imagecreatetruecolor($width, $height); - imagealphablending($this->image, false); - imagesavealpha($this->image, true); - $this->width = $width; - $this->height = $height; - $this->imagecopyresampled($image); - } - } - - /** Returns the GD resource - * @return resource */ - - public function get_image() { - return $this->image; - } - - /** Returns the image width - * @return integer */ - - public function get_width() { - return $this->width; - } - - /** Returns the image height - * @return integer */ - - public function get_height() { - return $this->height; - } - - /** Returns calculated proportional width from the given height - * @param integer $resized_height - * @return integer */ - - public function get_prop_width($resized_height) { - $width = intval(($this->width * $resized_height) / $this->height); - if (!$width) $width = 1; - return $width; - } - - /** Returns calculated proportional height from the given width - * @param integer $resized_width - * @return integer */ - - public function get_prop_height($resized_width) { - $height = intval(($this->height * $resized_width) / $this->width); - if (!$height) $height = 1; - return $height; - } - - /** Returns an array with calculated proportional width & height. - * The parameter $bigger_size is the bigger dimension (width or height) of calculated sizes. - * The other dimension (height or width) will be calculated autamaticaly - * @param integer $bigger_size - * @return array */ - - public function get_prop_size($bigger_size) { - - if ($this->width > $this->height) { - $width = $bigger_size; - $height = $this->get_prop_height($width); - - } elseif ($this->height > $this->width) { - $height = $bigger_size; - $width = $this->get_prop_width($height); - - } else - $width = $height = $bigger_size; - - return [$width, $height]; - } - - /** Resize image. Returns TRUE on success or FALSE on failure - * @param integer $width - * @param integer $height - * @return bool */ - - public function resize($width, $height) { - if (!$width) $width = 1; - if (!$height) $height = 1; - return ( - (false !== ($img = new gd([$width, $height]))) && - $img->imagecopyresampled($this) && - (false !== ($this->image = $img->get_image())) && - (false !== ($this->width = $img->get_width())) && - (false !== ($this->height = $img->get_height())) - ); - } - - /** Resize the given image source (GD, gd object or image file path) to fit in the own image. - * The outside ares will be cropped out. Returns TRUE on success or FALSE on failure - * @param mixed $src - * @return bool */ - - public function resize_crop($src) { - $image_details = $this->build_image($src); - - if ($image_details !== false) { - list($src, $src_width, $src_height) = $image_details; - - if (($src_width / $src_height) > ($this->width / $this->height)) { - $src_w = $this->get_prop_width($src_height); - $src_h = $src_height; - $src_x = intval(($src_width - $src_w) / 2); - $src_y = 0; - - } else { - $src_w = $src_width; - $src_h = $this->get_prop_height($src_width); - $src_x = 0; - $src_y = intval(($src_height - $src_h) / 2); - } - - return imagecopyresampled($this->image, $src, 0, 0, $src_x, $src_y, $this->width, $this->height, $src_w, $src_h); - - } else - return false; - } - - /** Resize image to fit in given resolution. Returns TRUE on success or FALSE on failure - * @param integer $width - * @param integer $height - * @return bool */ - - public function resize_fit($width, $height) { - if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) - return true; - if (!$width || (($height / $width) < ($this->height / $this->width))) - $width = intval(($this->width * $height) / $this->height); - elseif (!$height || (($width / $height) < ($this->width / $this->height))) - $height = intval(($this->height * $width) / $this->width); - if (!$width) $width = 1; - if (!$height) $height = 1; - return $this->resize($width, $height); - } - - /** Neka si predstavim vyobrazhaem pravoygylnik s razmeri $width i $height. - * Izobrazhenieto shte se preorazmeri taka che to shte izliza ot tozi pravoygylnik, - * no samo po edno (x ili y) izmerenie - * @param integer $width - * @param integer $height - * @return bool */ - - public function resize_overflow($width, $height) { - - $big = (($this->width / $this->height) > ($width / $height)) - ? ($this->width * $height) / $this->height - : ($this->height * $width) / $this->width; - $big = intval($big); - - $return = ($img = new gd($this->image, $big)); - - if ($return) { - $this->image = $img->get_image(); - $this->width = $img->get_width(); - $this->height = $img->get_height(); - } - - return $return; - } - - public function gd_color() { - $args = func_get_args(); - - $expr_rgb = '/^rgb\(\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\)$/i'; - $expr_hex1 = '/^\#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i'; - $expr_hex2 = '/^\#?([0-9a-f])([0-9a-f])([0-9a-f])$/i'; - $expr_byte = '/^([01]?\d?\d|2[0-4]\d|25[0-5])$/'; - - if (!isset($args[0])) - return false; - - if (count($args[0]) == 3) { - list($r, $g, $b) = $args[0]; - - } elseif (preg_match($expr_rgb, $args[0])) { - list($r, $g, $b) = explode(" ", preg_replace($expr_rgb, "$1 $2 $3", $args[0])); - - } elseif (preg_match($expr_hex1, $args[0])) { - list($r, $g, $b) = explode(" ", preg_replace($expr_hex1, "$1 $2 $3", $args[0])); - $r = hexdec($r); - $g = hexdec($g); - $b = hexdec($b); - - } elseif (preg_match($expr_hex2, $args[0])) { - list($r, $g, $b) = explode(" ", preg_replace($expr_hex2, "$1$1 $2$2 $3$3", $args[0])); - $r = hexdec($r); - $g = hexdec($g); - $b = hexdec($b); - - } elseif ((count($args) == 3) && - preg_match($expr_byte, $args[0]) && - preg_match($expr_byte, $args[1]) && - preg_match($expr_byte, $args[2]) - ) { - list($r, $g, $b) = $args; - - } else - return false; - - return imagecolorallocate($this->image, $r, $g, $b); - } - - public function fill_color($color) { - return $this->imagefilledrectangle(0, 0, $this->width - 1, $this->height - 1, $color); - } - - -/* G D M E T H O D S */ - - public function imagecopy( - $src, - $dst_x=0, $dst_y=0, - $src_x=0, $src_y=0, - $dst_w=null, $dst_h=null, - $src_w=null, $src_h=null - ) { - $image_details = $this->build_image($src); - - if ($image_details !== false) { - list($src, $src_width, $src_height) = $image_details; - - if (is_null($dst_w)) $dst_w = $this->width - $dst_x; - if (is_null($dst_h)) $dst_h = $this->height - $dst_y; - if (is_null($src_w)) $src_w = $src_width - $src_x; - if (is_null($src_h)) $src_h = $src_height - $src_y; - return imagecopy($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); - - } else - return false; - } - - public function imagecopyresampled( - $src, - $dst_x=0, $dst_y=0, - $src_x=0, $src_y=0, - $dst_w=null, $dst_h=null, - $src_w=null, $src_h=null - ) { - $image_details = $this->build_image($src); - - if ($image_details !== false) { - list($src, $src_width, $src_height) = $image_details; - - if (is_null($dst_w)) $dst_w = $this->width - $dst_x; - if (is_null($dst_h)) $dst_h = $this->height - $dst_y; - if (is_null($src_w)) $src_w = $src_width - $src_x; - if (is_null($src_h)) $src_h = $src_height - $src_y; - imagealphablending($this->image, false); - imagesavealpha($this->image,true); - - - - - /*** gif transparent fix - 1.10.2013 ***/ - - $transindex = imagecolortransparent($src); - $palletsize = imagecolorstotal($src); - if($transindex >= 0 && $transindex < $palletsize) { - $transcol = imagecolorsforindex($src, $transindex); - - /*** end gif transparent fix ***/ - - $transindex = imagecolorallocatealpha($this->image, $transcol['red'], $transcol['green'], $transcol['blue'], 127); - imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transindex); - imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); - imagecolortransparent($this->image, $transindex); - for($y=0; $y<$dst_h; ++$y) - for($x=0; $x<$dst_w; ++$x) - if(((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) imagesetpixel($this->image, $x, $y, $transindex); - imagetruecolortopalette($this->image, true, 255); - } - else { - $transparent = imagecolorallocatealpha($this->image, 255, 255, 255, 127); - imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transparent); - imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); - } - return $this->image; - - } else - return false; - } - - public function imagefilledrectangle($x1, $y1, $x2, $y2, $color) { - $color = $this->gd_color($color); - if ($color === false) return false; - return imagefilledrectangle($this->image, $x1, $y1, $x2, $y2, $color); - } - - public function imagepng($filename=null, $quality=null, $filters=null) { - if (is_null($filename) && !headers_sent()) - header("Content-Type: image/png"); - @imagesavealpha($this->image, true); - return imagepng($this->image, $filename, $quality, $filters); - } - - public function imagejpeg($filename=null, $quality=75) { - if (is_null($filename) && !headers_sent()) - header("Content-Type: image/jpeg"); - return imagejpeg($this->image, $filename, $quality); - } - - public function imagegif($filename=null) { - if (is_null($filename) && !headers_sent()) - header("Content-Type: image/gif"); - @imagesavealpha($this->image, true); - return imagegif($this->image, $filename); - } -} + + * @copyright 2010, 2011 KCFinder Project + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 + * @link http://kcfinder.sunhater.com + */ + +class gd { + + /** GD resource + * @var resource */ + protected $image; + + /** Image width + * @var integer */ + protected $width; + + /** Image height + * @var integer */ + protected $height; + + /** Init error + * @var bool */ + public $init_error = false; + + /** Last builded image type constant (IMAGETYPE_XXX) + * @var integer */ + public $type; + + /** Returns an array. Element 0 - GD resource. Element 1 - width. Element 2 - height. + * Returns FALSE on failure. The only one parameter $image can be an instance of this class, + * a GD resource, an array(width, height) or path to image file. + * @param mixed $image + * @return array */ + + protected function build_image($image) { + + if ($image instanceof gd) { + $width = $image->get_width(); + $height = $image->get_height(); + $image = $image->get_image(); + + } elseif (is_resource($image) && (get_resource_type($image) == "gd")) { + $width = @imagesx($image); + $height = @imagesy($image); + + } elseif (is_array($image)) { + $height = $width = end($image); + $image = imagecreatetruecolor($width, $height); + + } elseif (false !== (list($width, $height, $type) = @getimagesize($image))) { + $image = + ($type == IMAGETYPE_GIF) ? @imagecreatefromgif($image) : ( + ($type == IMAGETYPE_WBMP) ? @imagecreatefromwbmp($image) : ( + ($type == IMAGETYPE_JPEG) ? @imagecreatefromjpeg($image) : ( + ($type == IMAGETYPE_JPEG2000) ? @imagecreatefromjpeg($image) : ( + ($type == IMAGETYPE_PNG) ? @imagecreatefrompng($image) : ( + ($type == IMAGETYPE_XBM) ? @imagecreatefromxbm($image) : false + ))))); + + if ($type == IMAGETYPE_PNG) + imagealphablending($image, false); + } + + $return = ( + is_resource($image) && + (get_resource_type($image) == "gd") && + isset($width) && + isset($height) && + (preg_match('/^[1-9][0-9]*$/', $width) !== false) && + (preg_match('/^[1-9][0-9]*$/', $height) !== false) + ) + ? [$image, $width, $height] + : false; + + if (($return !== false) && isset($type)) + $this->type = $type; + + return $return; + } + + /** Parameter $image can be: + * 1. An instance of this class (copy instance). + * 2. A GD resource. + * 3. An array with two elements. First - width, second - height. Create a blank image. + * 4. A filename string. Get image form file. + * The non-required parameter $bigger_size is the bigger dimension (width or height) the image + * will be resized to. The other dimension (height or width) will be calculated autamaticaly + * @param mixed $image + * @param integer $bigger_size + * @return gd */ + + public function __construct($image, $bigger_size=null) { + $this->image = $this->width = $this->height = null; + + $image_details = $this->build_image($image); + + if ($image_details !== false) + list($this->image, $this->width, $this->height) = $image_details; + else + $this->init_error = true; + + if (!is_null($this->image) && + !is_null($bigger_size) && + (preg_match('/^[1-9][0-9]*$/', $bigger_size) !== false) + ) { + $image = $this->image; + list($width, $height) = $this->get_prop_size($bigger_size); + $this->image = imagecreatetruecolor($width, $height); + imagealphablending($this->image, false); + imagesavealpha($this->image, true); + $this->width = $width; + $this->height = $height; + $this->imagecopyresampled($image); + } + } + + /** Returns the GD resource + * @return resource */ + + public function get_image() { + return $this->image; + } + + /** Returns the image width + * @return integer */ + + public function get_width() { + return $this->width; + } + + /** Returns the image height + * @return integer */ + + public function get_height() { + return $this->height; + } + + /** Returns calculated proportional width from the given height + * @param integer $resized_height + * @return integer */ + + public function get_prop_width($resized_height) { + $width = intval(($this->width * $resized_height) / $this->height); + if (!$width) $width = 1; + return $width; + } + + /** Returns calculated proportional height from the given width + * @param integer $resized_width + * @return integer */ + + public function get_prop_height($resized_width) { + $height = intval(($this->height * $resized_width) / $this->width); + if (!$height) $height = 1; + return $height; + } + + /** Returns an array with calculated proportional width & height. + * The parameter $bigger_size is the bigger dimension (width or height) of calculated sizes. + * The other dimension (height or width) will be calculated autamaticaly + * @param integer $bigger_size + * @return array */ + + public function get_prop_size($bigger_size) { + + if ($this->width > $this->height) { + $width = $bigger_size; + $height = $this->get_prop_height($width); + + } elseif ($this->height > $this->width) { + $height = $bigger_size; + $width = $this->get_prop_width($height); + + } else + $width = $height = $bigger_size; + + return [$width, $height]; + } + + /** Resize image. Returns TRUE on success or FALSE on failure + * @param integer $width + * @param integer $height + * @return bool */ + + public function resize($width, $height) { + if (!$width) $width = 1; + if (!$height) $height = 1; + return ( + (false !== ($img = new gd([$width, $height]))) && + $img->imagecopyresampled($this) && + (false !== ($this->image = $img->get_image())) && + (false !== ($this->width = $img->get_width())) && + (false !== ($this->height = $img->get_height())) + ); + } + + /** Resize the given image source (GD, gd object or image file path) to fit in the own image. + * The outside ares will be cropped out. Returns TRUE on success or FALSE on failure + * @param mixed $src + * @return bool */ + + public function resize_crop($src) { + $image_details = $this->build_image($src); + + if ($image_details !== false) { + list($src, $src_width, $src_height) = $image_details; + + if (($src_width / $src_height) > ($this->width / $this->height)) { + $src_w = $this->get_prop_width($src_height); + $src_h = $src_height; + $src_x = intval(($src_width - $src_w) / 2); + $src_y = 0; + + } else { + $src_w = $src_width; + $src_h = $this->get_prop_height($src_width); + $src_x = 0; + $src_y = intval(($src_height - $src_h) / 2); + } + + return imagecopyresampled($this->image, $src, 0, 0, $src_x, $src_y, $this->width, $this->height, $src_w, $src_h); + + } else + return false; + } + + /** Resize image to fit in given resolution. Returns TRUE on success or FALSE on failure + * @param integer $width + * @param integer $height + * @return bool */ + + public function resize_fit($width, $height) { + if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) + return true; + if (!$width || (($height / $width) < ($this->height / $this->width))) + $width = intval(($this->width * $height) / $this->height); + elseif (!$height || (($width / $height) < ($this->width / $this->height))) + $height = intval(($this->height * $width) / $this->width); + if (!$width) $width = 1; + if (!$height) $height = 1; + return $this->resize($width, $height); + } + + /** Neka si predstavim vyobrazhaem pravoygylnik s razmeri $width i $height. + * Izobrazhenieto shte se preorazmeri taka che to shte izliza ot tozi pravoygylnik, + * no samo po edno (x ili y) izmerenie + * @param integer $width + * @param integer $height + * @return bool */ + + public function resize_overflow($width, $height) { + + $big = (($this->width / $this->height) > ($width / $height)) + ? ($this->width * $height) / $this->height + : ($this->height * $width) / $this->width; + $big = intval($big); + + $return = ($img = new gd($this->image, $big)); + + if ($return) { + $this->image = $img->get_image(); + $this->width = $img->get_width(); + $this->height = $img->get_height(); + } + + return $return; + } + + public function gd_color() { + $args = func_get_args(); + + $expr_rgb = '/^rgb\(\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\)$/i'; + $expr_hex1 = '/^\#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i'; + $expr_hex2 = '/^\#?([0-9a-f])([0-9a-f])([0-9a-f])$/i'; + $expr_byte = '/^([01]?\d?\d|2[0-4]\d|25[0-5])$/'; + + if (!isset($args[0])) + return false; + + if (count($args[0]) == 3) { + list($r, $g, $b) = $args[0]; + + } elseif (preg_match($expr_rgb, $args[0])) { + list($r, $g, $b) = explode(" ", preg_replace($expr_rgb, "$1 $2 $3", $args[0])); + + } elseif (preg_match($expr_hex1, $args[0])) { + list($r, $g, $b) = explode(" ", preg_replace($expr_hex1, "$1 $2 $3", $args[0])); + $r = hexdec($r); + $g = hexdec($g); + $b = hexdec($b); + + } elseif (preg_match($expr_hex2, $args[0])) { + list($r, $g, $b) = explode(" ", preg_replace($expr_hex2, "$1$1 $2$2 $3$3", $args[0])); + $r = hexdec($r); + $g = hexdec($g); + $b = hexdec($b); + + } elseif ((count($args) == 3) && + preg_match($expr_byte, $args[0]) && + preg_match($expr_byte, $args[1]) && + preg_match($expr_byte, $args[2]) + ) { + list($r, $g, $b) = $args; + + } else + return false; + + return imagecolorallocate($this->image, $r, $g, $b); + } + + public function fill_color($color) { + return $this->imagefilledrectangle(0, 0, $this->width - 1, $this->height - 1, $color); + } + + +/* G D M E T H O D S */ + + public function imagecopy( + $src, + $dst_x=0, $dst_y=0, + $src_x=0, $src_y=0, + $dst_w=null, $dst_h=null, + $src_w=null, $src_h=null + ) { + $image_details = $this->build_image($src); + + if ($image_details !== false) { + list($src, $src_width, $src_height) = $image_details; + + if (is_null($dst_w)) $dst_w = $this->width - $dst_x; + if (is_null($dst_h)) $dst_h = $this->height - $dst_y; + if (is_null($src_w)) $src_w = $src_width - $src_x; + if (is_null($src_h)) $src_h = $src_height - $src_y; + return imagecopy($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); + + } else + return false; + } + + public function imagecopyresampled( + $src, + $dst_x=0, $dst_y=0, + $src_x=0, $src_y=0, + $dst_w=null, $dst_h=null, + $src_w=null, $src_h=null + ) { + $image_details = $this->build_image($src); + + if ($image_details !== false) { + list($src, $src_width, $src_height) = $image_details; + + if (is_null($dst_w)) $dst_w = $this->width - $dst_x; + if (is_null($dst_h)) $dst_h = $this->height - $dst_y; + if (is_null($src_w)) $src_w = $src_width - $src_x; + if (is_null($src_h)) $src_h = $src_height - $src_y; + imagealphablending($this->image, false); + imagesavealpha($this->image,true); + + + + + /*** gif transparent fix - 1.10.2013 ***/ + + $transindex = imagecolortransparent($src); + $palletsize = imagecolorstotal($src); + if($transindex >= 0 && $transindex < $palletsize) { + $transcol = imagecolorsforindex($src, $transindex); + + /*** end gif transparent fix ***/ + + $transindex = imagecolorallocatealpha($this->image, $transcol['red'], $transcol['green'], $transcol['blue'], 127); + imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transindex); + imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); + imagecolortransparent($this->image, $transindex); + for($y=0; $y<$dst_h; ++$y) + for($x=0; $x<$dst_w; ++$x) + if(((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) imagesetpixel($this->image, $x, $y, $transindex); + imagetruecolortopalette($this->image, true, 255); + } + else { + $transparent = imagecolorallocatealpha($this->image, 255, 255, 255, 127); + imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transparent); + imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); + } + return $this->image; + + } else + return false; + } + + public function imagefilledrectangle($x1, $y1, $x2, $y2, $color) { + $color = $this->gd_color($color); + if ($color === false) return false; + return imagefilledrectangle($this->image, $x1, $y1, $x2, $y2, $color); + } + + public function imagepng($filename=null, $quality=null, $filters=null) { + if (is_null($filename) && !headers_sent()) + header("Content-Type: image/png"); + @imagesavealpha($this->image, true); + return imagepng($this->image, $filename, $quality, $filters); + } + + public function imagejpeg($filename=null, $quality=75) { + if (is_null($filename) && !headers_sent()) + header("Content-Type: image/jpeg"); + return imagejpeg($this->image, $filename, $quality); + } + + public function imagegif($filename=null) { + if (is_null($filename) && !headers_sent()) + header("Content-Type: image/gif"); + @imagesavealpha($this->image, true); + return imagegif($this->image, $filename); + } +} diff --git a/manager/media/browser/mcpuk/themes/evo/style.css b/manager/media/browser/mcpuk/themes/evo/style.css index ea808bec38..6c7ea0e2f6 100644 --- a/manager/media/browser/mcpuk/themes/evo/style.css +++ b/manager/media/browser/mcpuk/themes/evo/style.css @@ -1,136 +1,136 @@ -@import "../../../../style/common/font-awesome/css/font-awesome.min.css?v=5.10.2"; -body { background: #fff; } -input { margin: 0; } -input[type="radio"], input[type="checkbox"], label { cursor: pointer; } -input[name="newName"] { width: 98% !important; } -input[type="text"] { border: 1px solid #d3d3d3; background: #fff; padding: 2px; font-size: 1.5rem; margin: 0; outline-width: 0; } -input[type="text"]:hover { box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); -webkit-box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); } -input[type="text"]:focus { border-color: #3687e2; box-shadow: 0 0 3px rgba(54, 135, 226, 1); -moz-box-shadow: 0 0 3px rgba(54, 135, 226, 1); -webkit-box-shadow: 0 0 3px rgba(54, 135, 226, 1); } -input[type="button"], input[type="submit"], input[type="reset"], button { font-size: 1.1rem; line-height: 2rem; color: #292b2c; background-color: #fff; border: 1px solid #d4d4d4; padding: 0.3rem 0.6rem; margin-left: 2px; display: inline-block; cursor: pointer; } -input[type="button"]:hover, input[type="submit"]:hover, input[type="reset"]:hover, button:hover { color: #292b2c; background-color: #e6e6e6; border-color: #adadad } -input[type="button"]:focus, input[type="submit"]:focus, input[type="reset"]:focus, button:focus { color: #292b2c; background-color: #e6e6e6; border-color: #adadad } -fieldset { margin: 0 5px 5px 0px; padding: 5px; border: 1px solid #dedede; cursor: default; } -fieldset td { white-space: nowrap; } -legend { margin: 0; padding: 0 3px; font-weight: bold; } -#folders { margin: 0; padding: 1rem 1rem 1rem .5rem; background: #fafafa; border: 0; border-right: 1px solid #dedede; border-bottom: 1px solid #dedede; } -#files { float: left; margin: 0 4px 0 0; background: #fafafa; border: 1px solid #dedede; border-left: 0; } -#files.drag { background: #ddebf8; } -#topic { padding-left: 12px; } -div.folders { margin-left: 1.7rem } -div.folder { white-space: nowrap; } -div.folder a { display: inline-block; text-decoration: none; cursor: default; outline: none; color: #000; } -span.folder { display: inline-block; font-size: 1.1rem; line-height: 1.2rem; padding: 2px 3px 2px 3px; outline: none; background: no-repeat 3px center; cursor: pointer; border: 1px solid transparent; } -span.brace { float: left; width: 1.6rem; height: 1.6rem; padding-left: 0; line-height: 1.9rem; font-size: 0; text-align: center; outline: none; } -span.current { background-color: #e4f0fa; border-color: #e4f0fa; color: #0e80cb; } -span.current:before { display: inline-block; font-family: 'Font Awesome 5 Free'; content: "\f07c"; width: 1.3em; font-size: 1.3rem; line-height: .8em; vertical-align: middle; color: #565656; font-weight:900} -span.regular { background-color: #f8f7f6; } -span.regular:before { display: inline-block; font-family: 'Font Awesome 5 Free'; content: "\f07b"; width: 1.3em; font-size: 1.3rem; line-height: .8em; vertical-align: middle; color: #565656; font-weight:900} -span.regular:hover, span.context { background-color: #ddebf8; border-color: #cee0f4; color: #000; } -span.opened:before { display: inline-block; font-family: 'Font Awesome 5 Free'; content: "\f107"; width: 1.3em; font-size: 1.3rem; line-height: .8em; vertical-align: middle; color: #565656; font-weight:900} -span.closed:before { display: inline-block; font-family: 'Font Awesome 5 Free'; content: "\f105"; width: 1.3em; font-size: 1.3rem; line-height: .8em; vertical-align: middle; color: #565656; font-weight:900} -span.denied:before { display: inline-block; font-family: 'Font Awesome 5 Free'; content: "\f05e"; width: 1.3em; font-size: 1.3rem; line-height: .8em; vertical-align: middle; color: #565656; font-weight:900} -div.file { padding: 4px; margin: 3px; border: 1px solid #aaa; background: #fff; } -div.file:hover { background: #ddebf8; border-color: #a7bed7; } -div.file .name { margin-top: 4px; font-weight: bold; height: 16px; overflow: hidden; } -tr.file td { font-size: 12px; } -/* -div.file .time { font-size: 10px; } -div.file .size { font-size: 10px; } -*/ -#files div.selected, #files div.selected:hover { background-color: #5b9bda; border-color: #2973bd; color: #fff; } -tr.file > td { padding: 3px 4px; background-color: #f8f7f6 } -tr.file:hover > td { background-color: #ddebf8; } -tr.selected > td, tr.selected:hover > td { background-color: #5b9bda; color: #fff; } -#collapseSide { padding: 5px 0; display: inline-block; float: left; margin: 0 0 0 5px; } -#hide-side { display: inline-block; width: 20px; text-align: center; font-size: 1.3rem; color: #5a5a5a; background-color: transparent; border: none; padding: 0.7rem 0.6rem 0.4rem 0.6rem; margin: 0px; } -#hide-side i.fa:hover { color: #292b2c; } -#toolbar { min-width: 500px; padding: 5px 0 5px 0; display: block; margin-top: 2px; } -#toolbar a { font-size: 1.1rem; line-height: 2rem; color: #292b2c; background-color: #fff; border: 1px solid #d4d4d4; padding: 0.3rem 0.6rem; margin-left: 5px; display: block; float: left; } -#toolbar a:before { font-family: 'Font Awesome 5 Free'; font-size: 1.3rem; display: inline-block; padding-right: 3px; margin-top: 0px; vertical-align: top; color: #404040; font-weight: bold;} -#toolbar a:hover, #toolbar a.hover { color: #292b2c; background-color: #e6e6e6; border-color: #adadad } -#toolbar a.selected, #toolbar a.selected:before { background-color: #3687e2; border-color: #3687e2; color: #fff; } -#toolbar a[href="kcact:upload"] { color: #fff; background-color: #5cb85c; border-color: #56ac56 } -#toolbar a[href="kcact:upload"]:hover { color: #fff; background-color: #449d44; border-color: #419641 } -#toolbar a[href="kcact:upload"]:before { content: "\f093"; color: #fff; font-weight: bold;} -#toolbar a[href="kcact:refresh"]:before { content: "\f021"; font-weight: bold;} -#toolbar a[href="kcact:settings"]:before { content: "\f0ad"; font-weight: bold;} -#toolbar a[href="kcact:about"], #toolbar a:hover[href="kcact:about"] { border: none; padding: 0; background: transparent; } -#toolbar a[href="kcact:about"]:before { content: "\f05a"; font-weight: bold;} -#toolbar a[href="kcact:maximize"]:before { content: "\f2d0"; font-weight: bold;} -/*try to hide Maximize button except in popup*/ -@media screen and (min-width: 840px) { -#toolbar a[href="kcact:maximize"], #toolbar a[href="kcact:maximize"]:before { display: none; } -} -@media screen and (max-width: 780px) { -#toolbar a[href="kcact:maximize"], #toolbar a[href="kcact:maximize"]:before { display: none; } -} -/*fake btn*/ -#viewThumbs, #viewList { display: none; float: left; margin: 0 0px 0 -30px; } -label.radio-thumbs:before { display: block; float: left; font-family: 'Font Awesome 5 Free'; font-size: 1.4rem; line-height: 1.6rem; vertical-align: middle; content: "\f00a"; color: #292b2c; background-color: #fff; border: 1px solid #d4d4d4; padding: 0.5rem 0.6rem; margin-left: 5px; font-weight: bold;} -label.radio-list:hover:before, label.radio-thumbs:hover:before { color: #292b2c; background-color: #e6e6e6; border-color: #adadad } -label.radio-list.labelchecked:before, label.radio-thumbs.labelchecked:before { background-color: #3687e2; border-color: #3687e2; color: #fff; } -label.radio-list:before { display: block; float: left; font-family: 'Font Awesome 5 Free'; font-size: 1.4rem; line-height: 1.6rem; vertical-align: middle; content: "\f03a"; color: #292b2c; background-color: #fff; border: 1px solid #d4d4d4; padding: 0.5rem 0.6rem; margin-left: 5px; font-weight: bold; } -input[type=checkbox] + label { color: #ccc; font-style: italic; } -input[type=checkbox]:checked + label { color: #f00; font-style: normal; } -#settings { background: #fff; padding: 5px; } -.box { width: 500px; } -.box, #loading, #alert { padding: 5px; border: 1px solid #3687e2; background: #fff; } -.box, #alert { padding: 8px; border-color: #fff; -moz-box-shadow: 0 0 4px rgba(255, 255, 255, 1); -webkit-box-shadow: 0 0 4px rgba(255, 255, 255, 1); box-shadow: 0 0 4px rgba(255, 255, 255, 1); } -#loading { background-image: url(img/loading.gif); font-weight: bold; margin-right: 4px; box-shadow: 0 0 3px rgba(54, 135, 226, 1); -moz-box-shadow: 0 0 3px rgba(54, 135, 226, 1); -webkit-box-shadow: 0 0 3px rgba(54, 135, 226, 1); } -#alert div.message, #dialog div.question { padding: 0 0 0 40px; } -#alert { background: #ff6347 url(img/alert.png) no-repeat 8px 29px; } -#dialog div.question { background: transparent url(img/confirm.png) no-repeat 0 0; } -#alert div.ok, #dialog div.buttons { padding-top: 5px; text-align: right; } -.menu { min-width: 180px; padding: 3px; border: 1px solid #dedede; background: #fff; opacity: 0.95; } -.menu a { font-size: 1.2rem; text-decoration: none; padding: 4px 4px 4px 4px; color: #000; margin: 0; outline: none; border: 1px solid transparent; } -.menu a:before { font-family: 'Font Awesome 5 Free'; font-size: 1.4rem; display: inline-block; width: 1.3rem; padding-right: 4px; margin-top: 0px; text-align: center; vertical-align: top; color: #404040; } -.menu .delimiter { border-top: 1px solid #acaaa7; padding-bottom: 3px; margin: 3px 2px 0 2px; } -.menu a:hover { background-color: #0e80cb; color: #fff; } -.menu a:hover:before { color: #fff; } -.menu a[href="kcact:refresh"]:before { content: "\f021"; font-weight: bold;} -.menu a[href="kcact:mkdir"]:before { content: "\f07b"; font-weight: bold;} -.menu a[href="kcact:mvdir"]:before, .menu a[href="kcact:mv"]:before { content: "\f246"; font-weight: bold;} -.menu a[href="kcact:rmdir"]:before, .menu a[href="kcact:rm"]:before, .menu a[href="kcact:rmcbd"]:before { content: "\f1f8"; font-weight: bold;} -.menu a[href="kcact:clpbrdadd"]:before { content: "\f0ea"; font-weight: bold;} -.menu a[href="kcact:pick"]:before, .menu a[href="kcact:pick_thumb"]:before { content: "\f00c"; font-weight: bold;} -.menu a[href="kcact:download"]:before { content: "\f019"; font-weight: bold;} -.menu a[href="kcact:view"]:before { content: "\f06e"; font-weight: bold;} -.menu a[href="kcact:cpcbd"]:before { content: "\f24d";font-weight: bold; } -.menu a[href="kcact:mvcbd"]:before { content: "\f047"; font-weight: bold;} -.menu a[href="kcact:clrcbd"]:before { content: "\f12d"; font-weight: bold;} -a.denied { color: #666; opacity: 0.5; filter: alpha(opacity:50); -cursor: default; } -a.denied:hover { background-color: #e4e3e2; border-color: transparent; box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; } -#dialog { -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); } -#dialog input[type="text"] { margin: 5px 0; width: 200px; } -#dialog div.slideshow { border: 1px solid #000; padding: 5px 5px 3px 5px; background: #000; -moz-box-shadow: 0 0 8px rgba(255, 255, 255, 1); -webkit-box-shadow: 0 0 8px rgba(255, 255, 255, 1); box-shadow: 0 0 8px rgba(255, 255, 255, 1); } -#dialog img { padding: 0; margin: 0; background: url(img/bg_transparent.png); } -#loadingDirs { padding: 5px 0 1px 24px; } -.about { text-align: center; } -.about div.head { font-weight: bold; font-size: 12px; padding: 3px 0 8px 0; } -.about div.head a { background: url(img/kcf_logo.png) no-repeat left center; padding: 0 0 0 27px; font-size: 17px; } -.about a { text-decoration: none; color: #05f; } -.about a:hover { text-decoration: underline; } -.about button { margin-top: 8px; } -#clipboard { padding: 0 4px 1px 0; } -#clipboard div { background: url(img/icons/clipboard.png) no-repeat center center; border: 1px solid transparent; padding: 1px; cursor: pointer; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; } -#clipboard div:hover { background-color: #bfbdbb; border-color: #a9a59f; } -#clipboard.selected div, #clipboard.selected div:hover { background-color: #c9c7c4; border-color: #3687e2; } -#checkver { padding-bottom: 8px; } -#checkver > span { padding: 2px; border: 1px solid transparent; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; } -#checkver > span.loading { background: url(img/loading.gif); border: 1px solid #3687e2; box-shadow: 0 0 3px rgba(54, 135, 226, 1); -moz-box-shadow: 0 0 3px rgba(54, 135, 226, 1); -webkit-box-shadow: 0 0 3px rgba(54, 135, 226, 1); } -#checkver span { padding: 3px; } -#checkver a { font-weight: normal; padding: 3px 3px 3px 20px; background: url(img/icons/download.png) no-repeat left center; } -div.title { overflow: auto; text-align: center; margin: -3px -5px 5px -5px; padding-left: 19px; padding-bottom: 2px; border-bottom: 1px solid #bbb; font-size: 2rem; cursor: move; } -.about div.title { cursor: default; } -span.close, span.clicked { float: right; width: 19px; height: 19px; background: url(img/icons/close.png) no-repeat; margin-top: 0px; cursor: pointer; } -.selectThis { padding: 6px 0; border-radius: 2px; background: #eee; color: #4ea94e; cursor: pointer; text-transform: uppercase; } -.selectThis:hover { background-color: #fff; } -.pull-right { position: absolute; } -.pull-right a { color: #bbb !important; } -div.file .thumb { background-size: contain; } -div.file .skipthumb { background-size: auto; } -.rangeTextContainer, .rangeThumbContainer { display: inline-block; padding: 0.4rem 0.4rem 0.2rem 0.4rem; margin-left: 2px; } -.hiddenrange { display: none } -.thumbsize, .textsize { display: inline-block; margin-left: 10px; } -input[type=range]::-moz-range-track { margin-top: 2px; } +@import "../../../../style/common/font-awesome/css/font-awesome.min.css?v=5.10.2"; +body { background: #fff; } +input { margin: 0; } +input[type="radio"], input[type="checkbox"], label { cursor: pointer; } +input[name="newName"] { width: 98% !important; } +input[type="text"] { border: 1px solid #d3d3d3; background: #fff; padding: 2px; font-size: 1.5rem; margin: 0; outline-width: 0; } +input[type="text"]:hover { box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); -webkit-box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); } +input[type="text"]:focus { border-color: #3687e2; box-shadow: 0 0 3px rgba(54, 135, 226, 1); -moz-box-shadow: 0 0 3px rgba(54, 135, 226, 1); -webkit-box-shadow: 0 0 3px rgba(54, 135, 226, 1); } +input[type="button"], input[type="submit"], input[type="reset"], button { font-size: 1.1rem; line-height: 2rem; color: #292b2c; background-color: #fff; border: 1px solid #d4d4d4; padding: 0.3rem 0.6rem; margin-left: 2px; display: inline-block; cursor: pointer; } +input[type="button"]:hover, input[type="submit"]:hover, input[type="reset"]:hover, button:hover { color: #292b2c; background-color: #e6e6e6; border-color: #adadad } +input[type="button"]:focus, input[type="submit"]:focus, input[type="reset"]:focus, button:focus { color: #292b2c; background-color: #e6e6e6; border-color: #adadad } +fieldset { margin: 0 5px 5px 0px; padding: 5px; border: 1px solid #dedede; cursor: default; } +fieldset td { white-space: nowrap; } +legend { margin: 0; padding: 0 3px; font-weight: bold; } +#folders { margin: 0; padding: 1rem 1rem 1rem .5rem; background: #fafafa; border: 0; border-right: 1px solid #dedede; border-bottom: 1px solid #dedede; } +#files { float: left; margin: 0 4px 0 0; background: #fafafa; border: 1px solid #dedede; border-left: 0; } +#files.drag { background: #ddebf8; } +#topic { padding-left: 12px; } +div.folders { margin-left: 1.7rem } +div.folder { white-space: nowrap; } +div.folder a { display: inline-block; text-decoration: none; cursor: default; outline: none; color: #000; } +span.folder { display: inline-block; font-size: 1.1rem; line-height: 1.2rem; padding: 2px 3px 2px 3px; outline: none; background: no-repeat 3px center; cursor: pointer; border: 1px solid transparent; } +span.brace { float: left; width: 1.6rem; height: 1.6rem; padding-left: 0; line-height: 1.9rem; font-size: 0; text-align: center; outline: none; } +span.current { background-color: #e4f0fa; border-color: #e4f0fa; color: #0e80cb; } +span.current:before { display: inline-block; font-family: 'Font Awesome 5 Free'; content: "\f07c"; width: 1.3em; font-size: 1.3rem; line-height: .8em; vertical-align: middle; color: #565656; font-weight:900} +span.regular { background-color: #f8f7f6; } +span.regular:before { display: inline-block; font-family: 'Font Awesome 5 Free'; content: "\f07b"; width: 1.3em; font-size: 1.3rem; line-height: .8em; vertical-align: middle; color: #565656; font-weight:900} +span.regular:hover, span.context { background-color: #ddebf8; border-color: #cee0f4; color: #000; } +span.opened:before { display: inline-block; font-family: 'Font Awesome 5 Free'; content: "\f107"; width: 1.3em; font-size: 1.3rem; line-height: .8em; vertical-align: middle; color: #565656; font-weight:900} +span.closed:before { display: inline-block; font-family: 'Font Awesome 5 Free'; content: "\f105"; width: 1.3em; font-size: 1.3rem; line-height: .8em; vertical-align: middle; color: #565656; font-weight:900} +span.denied:before { display: inline-block; font-family: 'Font Awesome 5 Free'; content: "\f05e"; width: 1.3em; font-size: 1.3rem; line-height: .8em; vertical-align: middle; color: #565656; font-weight:900} +div.file { padding: 4px; margin: 3px; border: 1px solid #aaa; background: #fff; } +div.file:hover { background: #ddebf8; border-color: #a7bed7; } +div.file .name { margin-top: 4px; font-weight: bold; height: 16px; overflow: hidden; } +tr.file td { font-size: 12px; } +/* +div.file .time { font-size: 10px; } +div.file .size { font-size: 10px; } +*/ +#files div.selected, #files div.selected:hover { background-color: #5b9bda; border-color: #2973bd; color: #fff; } +tr.file > td { padding: 3px 4px; background-color: #f8f7f6 } +tr.file:hover > td { background-color: #ddebf8; } +tr.selected > td, tr.selected:hover > td { background-color: #5b9bda; color: #fff; } +#collapseSide { padding: 5px 0; display: inline-block; float: left; margin: 0 0 0 5px; } +#hide-side { display: inline-block; width: 20px; text-align: center; font-size: 1.3rem; color: #5a5a5a; background-color: transparent; border: none; padding: 0.7rem 0.6rem 0.4rem 0.6rem; margin: 0px; } +#hide-side i.fa:hover { color: #292b2c; } +#toolbar { min-width: 500px; padding: 5px 0 5px 0; display: block; margin-top: 2px; } +#toolbar a { font-size: 1.1rem; line-height: 2rem; color: #292b2c; background-color: #fff; border: 1px solid #d4d4d4; padding: 0.3rem 0.6rem; margin-left: 5px; display: block; float: left; } +#toolbar a:before { font-family: 'Font Awesome 5 Free'; font-size: 1.3rem; display: inline-block; padding-right: 3px; margin-top: 0px; vertical-align: top; color: #404040; font-weight: bold;} +#toolbar a:hover, #toolbar a.hover { color: #292b2c; background-color: #e6e6e6; border-color: #adadad } +#toolbar a.selected, #toolbar a.selected:before { background-color: #3687e2; border-color: #3687e2; color: #fff; } +#toolbar a[href="kcact:upload"] { color: #fff; background-color: #5cb85c; border-color: #56ac56 } +#toolbar a[href="kcact:upload"]:hover { color: #fff; background-color: #449d44; border-color: #419641 } +#toolbar a[href="kcact:upload"]:before { content: "\f093"; color: #fff; font-weight: bold;} +#toolbar a[href="kcact:refresh"]:before { content: "\f021"; font-weight: bold;} +#toolbar a[href="kcact:settings"]:before { content: "\f0ad"; font-weight: bold;} +#toolbar a[href="kcact:about"], #toolbar a:hover[href="kcact:about"] { border: none; padding: 0; background: transparent; } +#toolbar a[href="kcact:about"]:before { content: "\f05a"; font-weight: bold;} +#toolbar a[href="kcact:maximize"]:before { content: "\f2d0"; font-weight: bold;} +/*try to hide Maximize button except in popup*/ +@media screen and (min-width: 840px) { +#toolbar a[href="kcact:maximize"], #toolbar a[href="kcact:maximize"]:before { display: none; } +} +@media screen and (max-width: 780px) { +#toolbar a[href="kcact:maximize"], #toolbar a[href="kcact:maximize"]:before { display: none; } +} +/*fake btn*/ +#viewThumbs, #viewList { display: none; float: left; margin: 0 0px 0 -30px; } +label.radio-thumbs:before { display: block; float: left; font-family: 'Font Awesome 5 Free'; font-size: 1.4rem; line-height: 1.6rem; vertical-align: middle; content: "\f00a"; color: #292b2c; background-color: #fff; border: 1px solid #d4d4d4; padding: 0.5rem 0.6rem; margin-left: 5px; font-weight: bold;} +label.radio-list:hover:before, label.radio-thumbs:hover:before { color: #292b2c; background-color: #e6e6e6; border-color: #adadad } +label.radio-list.labelchecked:before, label.radio-thumbs.labelchecked:before { background-color: #3687e2; border-color: #3687e2; color: #fff; } +label.radio-list:before { display: block; float: left; font-family: 'Font Awesome 5 Free'; font-size: 1.4rem; line-height: 1.6rem; vertical-align: middle; content: "\f03a"; color: #292b2c; background-color: #fff; border: 1px solid #d4d4d4; padding: 0.5rem 0.6rem; margin-left: 5px; font-weight: bold; } +input[type=checkbox] + label { color: #ccc; font-style: italic; } +input[type=checkbox]:checked + label { color: #f00; font-style: normal; } +#settings { background: #fff; padding: 5px; } +.box { width: 500px; } +.box, #loading, #alert { padding: 5px; border: 1px solid #3687e2; background: #fff; } +.box, #alert { padding: 8px; border-color: #fff; -moz-box-shadow: 0 0 4px rgba(255, 255, 255, 1); -webkit-box-shadow: 0 0 4px rgba(255, 255, 255, 1); box-shadow: 0 0 4px rgba(255, 255, 255, 1); } +#loading { background-image: url(img/loading.gif); font-weight: bold; margin-right: 4px; box-shadow: 0 0 3px rgba(54, 135, 226, 1); -moz-box-shadow: 0 0 3px rgba(54, 135, 226, 1); -webkit-box-shadow: 0 0 3px rgba(54, 135, 226, 1); } +#alert div.message, #dialog div.question { padding: 0 0 0 40px; } +#alert { background: #ff6347 url(img/alert.png) no-repeat 8px 29px; } +#dialog div.question { background: transparent url(img/confirm.png) no-repeat 0 0; } +#alert div.ok, #dialog div.buttons { padding-top: 5px; text-align: right; } +.menu { min-width: 180px; padding: 3px; border: 1px solid #dedede; background: #fff; opacity: 0.95; } +.menu a { font-size: 1.2rem; text-decoration: none; padding: 4px 4px 4px 4px; color: #000; margin: 0; outline: none; border: 1px solid transparent; } +.menu a:before { font-family: 'Font Awesome 5 Free'; font-size: 1.4rem; display: inline-block; width: 1.3rem; padding-right: 4px; margin-top: 0px; text-align: center; vertical-align: top; color: #404040; } +.menu .delimiter { border-top: 1px solid #acaaa7; padding-bottom: 3px; margin: 3px 2px 0 2px; } +.menu a:hover { background-color: #0e80cb; color: #fff; } +.menu a:hover:before { color: #fff; } +.menu a[href="kcact:refresh"]:before { content: "\f021"; font-weight: bold;} +.menu a[href="kcact:mkdir"]:before { content: "\f07b"; font-weight: bold;} +.menu a[href="kcact:mvdir"]:before, .menu a[href="kcact:mv"]:before { content: "\f246"; font-weight: bold;} +.menu a[href="kcact:rmdir"]:before, .menu a[href="kcact:rm"]:before, .menu a[href="kcact:rmcbd"]:before { content: "\f1f8"; font-weight: bold;} +.menu a[href="kcact:clpbrdadd"]:before { content: "\f0ea"; font-weight: bold;} +.menu a[href="kcact:pick"]:before, .menu a[href="kcact:pick_thumb"]:before { content: "\f00c"; font-weight: bold;} +.menu a[href="kcact:download"]:before { content: "\f019"; font-weight: bold;} +.menu a[href="kcact:view"]:before { content: "\f06e"; font-weight: bold;} +.menu a[href="kcact:cpcbd"]:before { content: "\f24d";font-weight: bold; } +.menu a[href="kcact:mvcbd"]:before { content: "\f047"; font-weight: bold;} +.menu a[href="kcact:clrcbd"]:before { content: "\f12d"; font-weight: bold;} +a.denied { color: #666; opacity: 0.5; filter: alpha(opacity:50); +cursor: default; } +a.denied:hover { background-color: #e4e3e2; border-color: transparent; box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; } +#dialog { -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); } +#dialog input[type="text"] { margin: 5px 0; width: 200px; } +#dialog div.slideshow { border: 1px solid #000; padding: 5px 5px 3px 5px; background: #000; -moz-box-shadow: 0 0 8px rgba(255, 255, 255, 1); -webkit-box-shadow: 0 0 8px rgba(255, 255, 255, 1); box-shadow: 0 0 8px rgba(255, 255, 255, 1); } +#dialog img { padding: 0; margin: 0; background: url(img/bg_transparent.png); } +#loadingDirs { padding: 5px 0 1px 24px; } +.about { text-align: center; } +.about div.head { font-weight: bold; font-size: 12px; padding: 3px 0 8px 0; } +.about div.head a { background: url(img/kcf_logo.png) no-repeat left center; padding: 0 0 0 27px; font-size: 17px; } +.about a { text-decoration: none; color: #05f; } +.about a:hover { text-decoration: underline; } +.about button { margin-top: 8px; } +#clipboard { padding: 0 4px 1px 0; } +#clipboard div { background: url(img/icons/clipboard.png) no-repeat center center; border: 1px solid transparent; padding: 1px; cursor: pointer; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; } +#clipboard div:hover { background-color: #bfbdbb; border-color: #a9a59f; } +#clipboard.selected div, #clipboard.selected div:hover { background-color: #c9c7c4; border-color: #3687e2; } +#checkver { padding-bottom: 8px; } +#checkver > span { padding: 2px; border: 1px solid transparent; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; } +#checkver > span.loading { background: url(img/loading.gif); border: 1px solid #3687e2; box-shadow: 0 0 3px rgba(54, 135, 226, 1); -moz-box-shadow: 0 0 3px rgba(54, 135, 226, 1); -webkit-box-shadow: 0 0 3px rgba(54, 135, 226, 1); } +#checkver span { padding: 3px; } +#checkver a { font-weight: normal; padding: 3px 3px 3px 20px; background: url(img/icons/download.png) no-repeat left center; } +div.title { overflow: auto; text-align: center; margin: -3px -5px 5px -5px; padding-left: 19px; padding-bottom: 2px; border-bottom: 1px solid #bbb; font-size: 2rem; cursor: move; } +.about div.title { cursor: default; } +span.close, span.clicked { float: right; width: 19px; height: 19px; background: url(img/icons/close.png) no-repeat; margin-top: 0px; cursor: pointer; } +.selectThis { padding: 6px 0; border-radius: 2px; background: #eee; color: #4ea94e; cursor: pointer; text-transform: uppercase; } +.selectThis:hover { background-color: #fff; } +.pull-right { position: absolute; } +.pull-right a { color: #bbb !important; } +div.file .thumb { background-size: contain; } +div.file .skipthumb { background-size: auto; } +.rangeTextContainer, .rangeThumbContainer { display: inline-block; padding: 0.4rem 0.4rem 0.2rem 0.4rem; margin-left: 2px; } +.hiddenrange { display: none } +.thumbsize, .textsize { display: inline-block; margin-left: 10px; } +input[type=range]::-moz-range-track { margin-top: 2px; } diff --git a/manager/media/browser/mcpuk/tpl/tpl_browser.php b/manager/media/browser/mcpuk/tpl/tpl_browser.php index 5369878c64..cc142ac591 100755 --- a/manager/media/browser/mcpuk/tpl/tpl_browser.php +++ b/manager/media/browser/mcpuk/tpl/tpl_browser.php @@ -1,190 +1,190 @@ - - - - - KCFinder: / - <?php echo $this->session['dir'] ?> - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - -
    - - -   - - -   - - - -
    - - - - -
    -
    - - label("Order by:") ?> - - - - - - - - - - - - - -
    - - -   - - -   - - -   - - -   - - - -
    -
    -
    - - -
    -
    -
    - -
      -
    - - - - + + + + + KCFinder: / + <?php echo $this->session['dir'] ?> + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
      +
    +
    + + + \ No newline at end of file diff --git a/manager/media/calendar/datepicker.inc.php b/manager/media/calendar/datepicker.inc.php index 22068807d1..667d28f463 100755 --- a/manager/media/calendar/datepicker.inc.php +++ b/manager/media/calendar/datepicker.inc.php @@ -1,13 +1,13 @@ -parseText($tpl, $_lang, '[%', '%]'); - } -} +parseText($tpl, $_lang, '[%', '%]'); + } +} diff --git a/manager/media/calendar/datepicker.js b/manager/media/calendar/datepicker.js index a634cb062f..49d38dd8ea 100755 --- a/manager/media/calendar/datepicker.js +++ b/manager/media/calendar/datepicker.js @@ -1,99 +1,99 @@ -'use strict'; - -var _createClass = function() { - function defineProperties(target, props) - { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) { - descriptor.writable = true; - } - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - return function(Constructor, protoProps, staticProps) { - if (protoProps) { - defineProperties(Constructor.prototype, protoProps); - } - if (staticProps) { - defineProperties(Constructor, staticProps); - } - return Constructor; - }; -}(); - -var DatePicker = function() { - function DatePicker(dp, options) - { - if (!(this instanceof DatePicker)) { - throw new TypeError('Cannot call a class as a function'); - } - - var self = this; - this.dayChars = 1; - this.dayNames = [ - 'Sunday', - 'Monday', - 'Tuesday', - 'Wednesday', - 'Thursday', - 'Friday', - 'Saturday', - ]; - this.daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - this.format = 'dd-mm-yyyy hh:mm:00'; - this.monthNames = [ - 'January', - 'February', - 'March', - 'April', - 'May', - 'June', - 'July', - 'August', - 'September', - 'October', - 'November', - 'December', - ]; - this.startDay = 7; - this.yearOrder = 'asc'; - this.yearRange = 10; - this.yearStart = new Date().getFullYear(); - this.yearOffset = -10; - this.error = ''; - options = options || []; - dp.options = { - monthNames: (options.monthNames && options.monthNames.length === 12 - ? options.monthNames - : this.monthNames) || this.monthNames, - daysInMonth: (options.daysInMonth && options.daysInMonth.length === 12 - ? options.daysInMonth - : this.daysInMonth) || this.daysInMonth, - dayNames: (options.dayNames && options.dayNames.length === 7 - ? options.dayNames - : this.dayNames) || this.dayNames, - startDay: options.startDay || this.startDay, - dayChars: options.dayChars || this.dayChars, - format: options.format || this.format, - yearStart: options.yearStart || this.yearStart, - yearRange: options.yearRange || this.yearRange, - yearOrder: options.yearOrder || this.yearOrder, - yearOffset: options.yearOffset || this.yearOffset, - }; - dp.id = dp.name; - dp.autocomplete = 'off'; - dp = DatePicker.getValue(dp); - dp.lastValidDate = dp.value; - dp.oldYear = dp.year = dp.then.getFullYear(); - dp.oldMonth = dp.month = dp.then.getMonth(); - dp.oldDay = dp.then.getDate(); - dp.nowYear = dp.today.getFullYear(); - dp.nowMonth = dp.today.getMonth(); - dp.nowDay = dp.today.getDate(); +'use strict'; + +var _createClass = function() { + function defineProperties(target, props) + { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ('value' in descriptor) { + descriptor.writable = true; + } + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function(Constructor, protoProps, staticProps) { + if (protoProps) { + defineProperties(Constructor.prototype, protoProps); + } + if (staticProps) { + defineProperties(Constructor, staticProps); + } + return Constructor; + }; +}(); + +var DatePicker = function() { + function DatePicker(dp, options) + { + if (!(this instanceof DatePicker)) { + throw new TypeError('Cannot call a class as a function'); + } + + var self = this; + this.dayChars = 1; + this.dayNames = [ + 'Sunday', + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday', + ]; + this.daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + this.format = 'dd-mm-yyyy hh:mm:00'; + this.monthNames = [ + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December', + ]; + this.startDay = 7; + this.yearOrder = 'asc'; + this.yearRange = 10; + this.yearStart = new Date().getFullYear(); + this.yearOffset = -10; + this.error = ''; + options = options || []; + dp.options = { + monthNames: (options.monthNames && options.monthNames.length === 12 + ? options.monthNames + : this.monthNames) || this.monthNames, + daysInMonth: (options.daysInMonth && options.daysInMonth.length === 12 + ? options.daysInMonth + : this.daysInMonth) || this.daysInMonth, + dayNames: (options.dayNames && options.dayNames.length === 7 + ? options.dayNames + : this.dayNames) || this.dayNames, + startDay: options.startDay || this.startDay, + dayChars: options.dayChars || this.dayChars, + format: options.format || this.format, + yearStart: options.yearStart || this.yearStart, + yearRange: options.yearRange || this.yearRange, + yearOrder: options.yearOrder || this.yearOrder, + yearOffset: options.yearOffset || this.yearOffset, + }; + dp.id = dp.name; + dp.autocomplete = 'off'; + dp = DatePicker.getValue(dp); + dp.lastValidDate = dp.value; + dp.oldYear = dp.year = dp.then.getFullYear(); + dp.oldMonth = dp.month = dp.then.getMonth(); + dp.oldDay = dp.then.getDate(); + dp.nowYear = dp.today.getFullYear(); + dp.nowMonth = dp.today.getMonth(); + dp.nowDay = dp.today.getDate(); dp.container = false; dp.calendar = false; dp.interval = null; @@ -103,37 +103,37 @@ var DatePicker = function() { }; DatePicker.bindToggle(dp); } - - _createClass(DatePicker, null, [ - { - key: 'getValue', value: function getValue(dp) { - if (dp.value !== '') { - if (dp.options.format === 'dd-mm-YYYY hh:mm:00' || - dp.options.format === 'dd-mm-YYYY') { - var dateVals = dp.value.split(' '); - var dateParts = dateVals[0].split('-'); - dp.thenvalue = dateParts[1] + '/' + dateParts[0] + '/' + dateParts[2]; - if (dateVals[1]) { - dp.thenvalue = dp.thenvalue + ' ' + dateVals[1]; - } - } else { - dp.thenvalue = dp.value; - } - dp.then = new Date(dp.thenvalue); - dp.today = new Date(); - } else { - dp.thenvalue = dp.then = dp.today = new Date(); - dp.thenvalue = dp.then; - } - return dp; - }, - }, { - key: 'updateValue', value: function updateValue(dp) { - var el = document.querySelector('td.dp_selected'); - var ds = void 0; - if (el) { - ds = el.axis.split('|'); - var formatted = DatePicker.formatValue(dp, ds[0], ds[1], ds[2]); + + _createClass(DatePicker, null, [ + { + key: 'getValue', value: function getValue(dp) { + if (dp.value !== '') { + if (dp.options.format === 'dd-mm-YYYY hh:mm:00' || + dp.options.format === 'dd-mm-YYYY') { + var dateVals = dp.value.split(' '); + var dateParts = dateVals[0].split('-'); + dp.thenvalue = dateParts[1] + '/' + dateParts[0] + '/' + dateParts[2]; + if (dateVals[1]) { + dp.thenvalue = dp.thenvalue + ' ' + dateVals[1]; + } + } else { + dp.thenvalue = dp.value; + } + dp.then = new Date(dp.thenvalue); + dp.today = new Date(); + } else { + dp.thenvalue = dp.then = dp.today = new Date(); + dp.thenvalue = dp.then; + } + return dp; + }, + }, { + key: 'updateValue', value: function updateValue(dp) { + var el = document.querySelector('td.dp_selected'); + var ds = void 0; + if (el) { + ds = el.axis.split('|'); + var formatted = DatePicker.formatValue(dp, ds[0], ds[1], ds[2]); if (formatted !== '') { dp.value = formatted; dp.lastValidDate = formatted; @@ -208,316 +208,316 @@ var DatePicker = function() { }, }, { key: 'alertError', value: function alertError(dp) { - if (typeof dp.error !== 'undefined' && dp.error !== '') { - alert(dp.error); - dp.error = ''; - } - }, - }, { - key: 'hasChild', value: function hasChild(a, b) { - var parent = a.parentNode; - while (parent && parent !== document.body) { - if (parent === b) { - return parent; - } else { - parent = parent.parentNode; - } - } - return null; - }, - }, { - key: 'close', value: function close(e) { - if (!document.getElementById(this.dp.id + 'dp_container')) { - return; - } - var clickOutside = e.target && e.target !== this.dp && e.target !== - this.dp.container && - !DatePicker.hasChild(e.target, this.dp.container); - if (clickOutside) { - if (this.dp.dirty) { - this.updateValue(this.dp); - DatePicker.alertError(this.dp); - } - DatePicker.remove(this.dp); - } - }, - }, { - key: 'create', value: function create(dp) { - var y = void 0; - var self = this; - dp = DatePicker.getValue(dp); - this.dp = dp; - if (dp.calendar) { - return false; - } - this.dp.dirty = false; - dp.container = document.createElement('div'); - dp.container.className = 'dp_container'; - dp.container.id = dp.id + 'dp_container'; - document.body.appendChild(dp.container); - document.onmousedown = function(e) { - DatePicker.close(e); - }; - document.onkeydown = function(e) { - if (e.code === 9 && !e.shift || e.code === 27 || e.code === 13) { - if (e.code === 13 && dp.container) { - e.preventDefault ? e.preventDefault() : e.returnValue = false; - if (self.dp.dirty) { - self.updateValue(dp); - } - DatePicker.remove(self.dp); - DatePicker.alertError(self.dp); - } else { - DatePicker.remove(self.dp); - } - } - }; - dp.calendar = document.createElement('div'); - dp.calendar.className = 'dp_cal'; - dp.container.appendChild(dp.calendar); - var date = new Date(); - if (dp.month >= 0 && dp.year) { - date.setFullYear(dp.year, dp.month, 1); - } else { - dp.month = parseInt(date.getMonth()); - dp.year = parseInt(date.getFullYear()); - date.setDate(1); - } - dp.year % 4 === 0 - ? dp.options.daysInMonth[1] = 29 - : dp.options.daysInMonth[1] = 28; - var firstDay = 1 - (7 + date.getDay() - dp.options.startDay) % 7; - var monthSel = document.createElement('select'); - monthSel.id = dp.id + '_monthSelect'; - for (var m = 0; m < dp.options.monthNames.length; m++) { - monthSel.options[m] = new Option(dp.options.monthNames[m], m); - if (parseInt(dp.month) === m) { - monthSel.options[m].selected = true; - } - } - var yearSel = document.createElement('select'); - yearSel.id = dp.id + '_yearSelect'; - var i = 0; - if (!dp.options.yearStart) { - dp.options.yearStart = date.getFullYear(); - } - if (dp.options.yearOrder === 'desc') { - for (y = dp.options.yearStart - dp.options.yearOffset; y > - dp.options.yearStart - dp.options.yearRange - 1; y--) { - yearSel.options[i] = new Option(y, y); - if (parseInt(dp.year) === y) { - yearSel.options[i].selected = true; - } - i++; - } - } else { - for (y = dp.options.yearStart + dp.options.yearOffset; y < - dp.options.yearStart + dp.options.yearRange + 1; y++) { - yearSel.options[i] = new Option(y, y); - if (parseInt(dp.year) === y) { - yearSel.options[i].selected = true; - } - i++; - } - } - var time = void 0; - if (!dp.time) { - var d = new Date(dp.thenvalue); - var minutes = d.getMinutes(); - if (minutes < 10) { - minutes = '0' + minutes; - } - time = d.getHours() + ':' + minutes; - } else { - time = dp.time; - } - var timeTextBox = document.createElement('input'); - timeTextBox.id = dp.id + '_timeTextBox'; - timeTextBox.className = 'cal_timeTextBox'; - timeTextBox.type = 'text'; - timeTextBox.value = time; - var submitButton = document.createElement('button'); - submitButton.id = dp.id + '_submit'; - submitButton.className = 'cal_submit btn btn-secondary'; - submitButton.innerHTML = 'OK'; - var calTable = document.createElement('table'); - var calTableThead = document.createElement('thead'); - var calSelRow = document.createElement('tr'); - var calSelCell = document.createElement('th'); - calSelCell.colSpan = 7; - calSelCell.appendChild(monthSel); - calSelCell.appendChild(yearSel); - calSelRow.appendChild(calSelCell); - calTableThead.appendChild(calSelRow); - var calTableTbody = document.createElement('tbody'); - var calDayNameRow = document.createElement('tr'); - var calDayNameCell = void 0; - for (i = 0; i < dp.options.dayNames.length; i++) { - calDayNameCell = document.createElement('th'); - calDayNameCell.innerHTML = dp.options.dayNames[(dp.options.startDay + - i) % 7].substr(0, dp.options.dayChars); - calDayNameRow.appendChild(calDayNameCell); - } - calTableTbody.appendChild(calDayNameRow); - var calDayRow = void 0; - var calDayCell = void 0; - while (firstDay <= dp.options.daysInMonth[dp.month]) { - calDayRow = document.createElement('tr'); - for (i = 0; i < 7; i++) { - calDayCell = document.createElement('td'); - if (firstDay <= dp.options.daysInMonth[dp.month] && firstDay > 0) { - calDayCell.className = dp.id + '_calDay'; - calDayCell.axis = dp.year + '|' + (parseInt(dp.month) + 1) + '|' + - firstDay; - calDayCell.innerHTML = firstDay; - } else { - calDayCell.className = 'dp_empty'; - calDayCell.innerHTML = ' '; - } - calDayRow.appendChild(calDayCell); - if (firstDay === parseInt(dp.oldDay) && dp.month === dp.oldMonth && - dp.year === dp.oldYear) { - calDayCell.classList.add('dp_selected'); - } - if (firstDay === dp.nowDay && parseInt(dp.month) === dp.nowMonth && - parseInt(dp.year) === dp.nowYear) { - calDayCell.classList.add('dp_today'); - } - firstDay++; - } - calTableTbody.appendChild(calDayRow); - } - calTable.appendChild(calTableThead); - calTable.appendChild(calTableTbody); - var calTimePara = document.createElement('p'); - calTimePara.id = dp.id + '_calTime'; - calTimePara.appendChild(timeTextBox); - calTimePara.appendChild(submitButton); - dp.calendar.appendChild(calTable); - dp.calendar.appendChild(calTimePara); - dp.position = dp.getBoundingClientRect(); - dp.container.style.left = dp.position.left + window.pageXOffset + 'px'; - if (dp.position.top + dp.container.offsetHeight > window.innerHeight) { - dp.container.style.top = dp.position.top + window.pageYOffset - - dp.container.offsetHeight + 'px'; - } else { - dp.container.style.top = dp.position.top + dp.position.height + - window.pageYOffset + 'px'; - } - var calDays = document.querySelectorAll('td.' + dp.id + '_calDay'); - for (i = 0; i < calDays.length; i++) { - calDays[i].onmouseover = function() { - this.classList.add('dp_roll'); - }; - calDays[i].onmouseout = function() { - this.classList.remove('dp_roll'); - }; - calDays[i].onclick = function() { - var el = document.querySelector('td.dp_selected'); - if (el) { - el.classList.remove('dp_selected'); - } - this.classList.add('dp_selected'); - self.updateValue(self.dp); - }; - calDays[i].ondblclick = function() { - var el = document.querySelector('td.dp_selected'); - if (el) { - el.classList.remove('dp_selected'); - } - this.classList.add('dp_selected'); - self.updateValue(self.dp); - DatePicker.remove(dp); - }; - } - monthSel.onfocus = function() { - dp.active = true; - }; - monthSel.onblur = function() { - dp.active = true; - }; - monthSel.onchange = function() { - dp.month = monthSel.value; - dp.year = yearSel.value; - DatePicker.remove(dp); - self.create(dp); - }; - yearSel.onfocus = function() { - dp.active = true; - }; - yearSel.onblur = function() { - dp.active = true; - }; - yearSel.onchange = function() { - dp.month = monthSel.value; - dp.year = yearSel.value; - DatePicker.remove(dp); - self.create(dp); - }; - timeTextBox.onfocus = function() { - dp.active = true; - }; - timeTextBox.onblur = function() { - self.updateValue(self.dp); - DatePicker.alertError(self.dp); - }; - timeTextBox.onkeyup = function(e) { - self.dp.dirty = true; - }; - submitButton.onclick = function(e) { - if (self.dp.dirty) { - self.updateValue(self.dp); - DatePicker.alertError(self.dp); - } - DatePicker.remove(self.dp); - e.stopPropagation(); - }; - }, - }, { - key: 'formatValue', value: function formatValue(dp, year, month, day) { - var time = document.getElementById(dp.id + '_timeTextBox'). - value. - split(':'); - if (!time[0] || time[0] === '' || time[0] < 0 || time[0] > 23) { - dp.error = 'Invalid hours value: ' + time[0] + - '\nAllowed range is 00:23'; - return ''; - } - if (!time[1] || time[1] === '' || time[1] < 0 || time[1] > 59 || - time[1].length !== 2) { - dp.error = 'Invalid minutes value: ' + time[1] + - '\nAllowed range is 00:59'; - return ''; - } - if (day < 10) { - day = '0' + day; - } - if (month < 10) { - month = '0' + month; - } - var dateStr = dp.options.format.replace(/dd/i, day). - replace(/mm/i, month). - replace(/yyyy/i, year). - replace(/hh/, time[0]). - replace(/mm/, time[1]); - dp.month = dp.oldMonth = '' + (month - 1) + ''; - dp.year = dp.oldYear = year; - dp.oldDay = day; - this.dp.thenvalue = month + '/' + day + '/' + year + ' ' + time[0] + - ':' + time[1] + ':00'; - return dateStr; - }, - }, { - key: 'remove', value: function remove(dp) { - dp.active = false; - if (dp.container) { - dp.container.remove(); - } - dp.calendar = false; - dp.container = false; - }, - }, - ]); - - return DatePicker; + if (typeof dp.error !== 'undefined' && dp.error !== '') { + alert(dp.error); + dp.error = ''; + } + }, + }, { + key: 'hasChild', value: function hasChild(a, b) { + var parent = a.parentNode; + while (parent && parent !== document.body) { + if (parent === b) { + return parent; + } else { + parent = parent.parentNode; + } + } + return null; + }, + }, { + key: 'close', value: function close(e) { + if (!document.getElementById(this.dp.id + 'dp_container')) { + return; + } + var clickOutside = e.target && e.target !== this.dp && e.target !== + this.dp.container && + !DatePicker.hasChild(e.target, this.dp.container); + if (clickOutside) { + if (this.dp.dirty) { + this.updateValue(this.dp); + DatePicker.alertError(this.dp); + } + DatePicker.remove(this.dp); + } + }, + }, { + key: 'create', value: function create(dp) { + var y = void 0; + var self = this; + dp = DatePicker.getValue(dp); + this.dp = dp; + if (dp.calendar) { + return false; + } + this.dp.dirty = false; + dp.container = document.createElement('div'); + dp.container.className = 'dp_container'; + dp.container.id = dp.id + 'dp_container'; + document.body.appendChild(dp.container); + document.onmousedown = function(e) { + DatePicker.close(e); + }; + document.onkeydown = function(e) { + if (e.code === 9 && !e.shift || e.code === 27 || e.code === 13) { + if (e.code === 13 && dp.container) { + e.preventDefault ? e.preventDefault() : e.returnValue = false; + if (self.dp.dirty) { + self.updateValue(dp); + } + DatePicker.remove(self.dp); + DatePicker.alertError(self.dp); + } else { + DatePicker.remove(self.dp); + } + } + }; + dp.calendar = document.createElement('div'); + dp.calendar.className = 'dp_cal'; + dp.container.appendChild(dp.calendar); + var date = new Date(); + if (dp.month >= 0 && dp.year) { + date.setFullYear(dp.year, dp.month, 1); + } else { + dp.month = parseInt(date.getMonth()); + dp.year = parseInt(date.getFullYear()); + date.setDate(1); + } + dp.year % 4 === 0 + ? dp.options.daysInMonth[1] = 29 + : dp.options.daysInMonth[1] = 28; + var firstDay = 1 - (7 + date.getDay() - dp.options.startDay) % 7; + var monthSel = document.createElement('select'); + monthSel.id = dp.id + '_monthSelect'; + for (var m = 0; m < dp.options.monthNames.length; m++) { + monthSel.options[m] = new Option(dp.options.monthNames[m], m); + if (parseInt(dp.month) === m) { + monthSel.options[m].selected = true; + } + } + var yearSel = document.createElement('select'); + yearSel.id = dp.id + '_yearSelect'; + var i = 0; + if (!dp.options.yearStart) { + dp.options.yearStart = date.getFullYear(); + } + if (dp.options.yearOrder === 'desc') { + for (y = dp.options.yearStart - dp.options.yearOffset; y > + dp.options.yearStart - dp.options.yearRange - 1; y--) { + yearSel.options[i] = new Option(y, y); + if (parseInt(dp.year) === y) { + yearSel.options[i].selected = true; + } + i++; + } + } else { + for (y = dp.options.yearStart + dp.options.yearOffset; y < + dp.options.yearStart + dp.options.yearRange + 1; y++) { + yearSel.options[i] = new Option(y, y); + if (parseInt(dp.year) === y) { + yearSel.options[i].selected = true; + } + i++; + } + } + var time = void 0; + if (!dp.time) { + var d = new Date(dp.thenvalue); + var minutes = d.getMinutes(); + if (minutes < 10) { + minutes = '0' + minutes; + } + time = d.getHours() + ':' + minutes; + } else { + time = dp.time; + } + var timeTextBox = document.createElement('input'); + timeTextBox.id = dp.id + '_timeTextBox'; + timeTextBox.className = 'cal_timeTextBox'; + timeTextBox.type = 'text'; + timeTextBox.value = time; + var submitButton = document.createElement('button'); + submitButton.id = dp.id + '_submit'; + submitButton.className = 'cal_submit btn btn-secondary'; + submitButton.innerHTML = 'OK'; + var calTable = document.createElement('table'); + var calTableThead = document.createElement('thead'); + var calSelRow = document.createElement('tr'); + var calSelCell = document.createElement('th'); + calSelCell.colSpan = 7; + calSelCell.appendChild(monthSel); + calSelCell.appendChild(yearSel); + calSelRow.appendChild(calSelCell); + calTableThead.appendChild(calSelRow); + var calTableTbody = document.createElement('tbody'); + var calDayNameRow = document.createElement('tr'); + var calDayNameCell = void 0; + for (i = 0; i < dp.options.dayNames.length; i++) { + calDayNameCell = document.createElement('th'); + calDayNameCell.innerHTML = dp.options.dayNames[(dp.options.startDay + + i) % 7].substr(0, dp.options.dayChars); + calDayNameRow.appendChild(calDayNameCell); + } + calTableTbody.appendChild(calDayNameRow); + var calDayRow = void 0; + var calDayCell = void 0; + while (firstDay <= dp.options.daysInMonth[dp.month]) { + calDayRow = document.createElement('tr'); + for (i = 0; i < 7; i++) { + calDayCell = document.createElement('td'); + if (firstDay <= dp.options.daysInMonth[dp.month] && firstDay > 0) { + calDayCell.className = dp.id + '_calDay'; + calDayCell.axis = dp.year + '|' + (parseInt(dp.month) + 1) + '|' + + firstDay; + calDayCell.innerHTML = firstDay; + } else { + calDayCell.className = 'dp_empty'; + calDayCell.innerHTML = ' '; + } + calDayRow.appendChild(calDayCell); + if (firstDay === parseInt(dp.oldDay) && dp.month === dp.oldMonth && + dp.year === dp.oldYear) { + calDayCell.classList.add('dp_selected'); + } + if (firstDay === dp.nowDay && parseInt(dp.month) === dp.nowMonth && + parseInt(dp.year) === dp.nowYear) { + calDayCell.classList.add('dp_today'); + } + firstDay++; + } + calTableTbody.appendChild(calDayRow); + } + calTable.appendChild(calTableThead); + calTable.appendChild(calTableTbody); + var calTimePara = document.createElement('p'); + calTimePara.id = dp.id + '_calTime'; + calTimePara.appendChild(timeTextBox); + calTimePara.appendChild(submitButton); + dp.calendar.appendChild(calTable); + dp.calendar.appendChild(calTimePara); + dp.position = dp.getBoundingClientRect(); + dp.container.style.left = dp.position.left + window.pageXOffset + 'px'; + if (dp.position.top + dp.container.offsetHeight > window.innerHeight) { + dp.container.style.top = dp.position.top + window.pageYOffset - + dp.container.offsetHeight + 'px'; + } else { + dp.container.style.top = dp.position.top + dp.position.height + + window.pageYOffset + 'px'; + } + var calDays = document.querySelectorAll('td.' + dp.id + '_calDay'); + for (i = 0; i < calDays.length; i++) { + calDays[i].onmouseover = function() { + this.classList.add('dp_roll'); + }; + calDays[i].onmouseout = function() { + this.classList.remove('dp_roll'); + }; + calDays[i].onclick = function() { + var el = document.querySelector('td.dp_selected'); + if (el) { + el.classList.remove('dp_selected'); + } + this.classList.add('dp_selected'); + self.updateValue(self.dp); + }; + calDays[i].ondblclick = function() { + var el = document.querySelector('td.dp_selected'); + if (el) { + el.classList.remove('dp_selected'); + } + this.classList.add('dp_selected'); + self.updateValue(self.dp); + DatePicker.remove(dp); + }; + } + monthSel.onfocus = function() { + dp.active = true; + }; + monthSel.onblur = function() { + dp.active = true; + }; + monthSel.onchange = function() { + dp.month = monthSel.value; + dp.year = yearSel.value; + DatePicker.remove(dp); + self.create(dp); + }; + yearSel.onfocus = function() { + dp.active = true; + }; + yearSel.onblur = function() { + dp.active = true; + }; + yearSel.onchange = function() { + dp.month = monthSel.value; + dp.year = yearSel.value; + DatePicker.remove(dp); + self.create(dp); + }; + timeTextBox.onfocus = function() { + dp.active = true; + }; + timeTextBox.onblur = function() { + self.updateValue(self.dp); + DatePicker.alertError(self.dp); + }; + timeTextBox.onkeyup = function(e) { + self.dp.dirty = true; + }; + submitButton.onclick = function(e) { + if (self.dp.dirty) { + self.updateValue(self.dp); + DatePicker.alertError(self.dp); + } + DatePicker.remove(self.dp); + e.stopPropagation(); + }; + }, + }, { + key: 'formatValue', value: function formatValue(dp, year, month, day) { + var time = document.getElementById(dp.id + '_timeTextBox'). + value. + split(':'); + if (!time[0] || time[0] === '' || time[0] < 0 || time[0] > 23) { + dp.error = 'Invalid hours value: ' + time[0] + + '\nAllowed range is 00:23'; + return ''; + } + if (!time[1] || time[1] === '' || time[1] < 0 || time[1] > 59 || + time[1].length !== 2) { + dp.error = 'Invalid minutes value: ' + time[1] + + '\nAllowed range is 00:59'; + return ''; + } + if (day < 10) { + day = '0' + day; + } + if (month < 10) { + month = '0' + month; + } + var dateStr = dp.options.format.replace(/dd/i, day). + replace(/mm/i, month). + replace(/yyyy/i, year). + replace(/hh/, time[0]). + replace(/mm/, time[1]); + dp.month = dp.oldMonth = '' + (month - 1) + ''; + dp.year = dp.oldYear = year; + dp.oldDay = day; + this.dp.thenvalue = month + '/' + day + '/' + year + ' ' + time[0] + + ':' + time[1] + ':00'; + return dateStr; + }, + }, { + key: 'remove', value: function remove(dp) { + dp.active = false; + if (dp.container) { + dp.container.remove(); + } + dp.calendar = false; + dp.container = false; + }, + }, + ]); + + return DatePicker; }(); diff --git a/manager/media/calendar/datepicker.tpl b/manager/media/calendar/datepicker.tpl index 34a2ba45d7..e8ad889923 100755 --- a/manager/media/calendar/datepicker.tpl +++ b/manager/media/calendar/datepicker.tpl @@ -1,21 +1,21 @@ - - + + diff --git a/manager/media/style/common/spectrum/spectrum.css b/manager/media/style/common/spectrum/spectrum.css index a31dedc2b2..b41bbafe06 100755 --- a/manager/media/style/common/spectrum/spectrum.css +++ b/manager/media/style/common/spectrum/spectrum.css @@ -1,515 +1,515 @@ -/*** -Spectrum Colorpicker v1.8.0 -https://github.com/bgrins/spectrum -Author: Brian Grinstead -License: MIT -***/ - -.sp-container { - position:absolute; - top:0; - left:0; - display:inline-block; - *display: inline; - *zoom: 1; - /* https://github.com/bgrins/spectrum/issues/40 */ - z-index: 9999994; - overflow: hidden; -} -.sp-container.sp-flat { - position: relative; - width:95%; - background:#FFF; - border:none; -} - -/* Fix for * { box-sizing: border-box; } */ -.sp-container, -.sp-container * { - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; -} - -/* http://ansciath.tumblr.com/post/7347495869/css-aspect-ratio */ -.sp-top { - position:relative; - width: 100%; - display:inline-block; -} -.sp-top-inner { - position:absolute; - top:0; - left:0; - bottom:0; - right:0; -} -.sp-color { - position: absolute; - top:0; - left:0; - bottom:0; - right:20%; -} -.sp-hue { - position: absolute; - top:0; - right:0; - bottom:0; - left:84%; - height: 100%; -} - -.sp-clear-enabled .sp-hue { - top:33px; - height: 77.5%; -} - -.sp-fill { - padding-top: 80%; -} -.sp-sat, .sp-val { - position: absolute; - top:0; - left:0; - right:0; - bottom:0; -} - -.sp-alpha-enabled .sp-top { - margin-bottom: 18px; -} -.sp-alpha-enabled .sp-alpha { - display: block; -} -.sp-alpha-handle { - position:absolute; - top:-4px; - bottom: -4px; - width: 6px; - left: 50%; - cursor: pointer; - border: 1px solid black; - background: white; - opacity: .8; -} -.sp-alpha { - display: none; - position: absolute; - bottom: -14px; - right: 0; - left: 0; - height: 8px; -} -.sp-alpha-inner { - border: solid 1px #333; -} - -.sp-clear { - display: none; -} - -.sp-clear.sp-clear-display { - background-position: center; -} - -.sp-clear-enabled .sp-clear { - display: block; - position:absolute; - top:0px; - right:0; - bottom:0; - left:84%; - height: 28px; -} - -/* Don't allow text selection */ -.sp-container, .sp-replacer, .sp-preview, .sp-dragger, .sp-slider, .sp-alpha, .sp-clear, .sp-alpha-handle, .sp-container.sp-dragging .sp-input, .sp-container button { - -webkit-user-select:none; - -moz-user-select: -moz-none; - -o-user-select:none; - user-select: none; -} - -.sp-container.sp-input-disabled .sp-input-container { - display: none; -} -.sp-container.sp-buttons-disabled .sp-button-container { - display: none; -} -.sp-container.sp-palette-buttons-disabled .sp-palette-button-container { - display: none; -} -.sp-palette-only .sp-picker-container { - display: none; -} -.sp-palette-disabled .sp-palette-container { - display: none; -} - -.sp-initial-disabled .sp-initial { - display: none; -} - - -/* Gradients for hue, saturation and value instead of images. Not pretty... but it works */ -.sp-sat { - background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0))); - background-image: -webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0)); - background-image: -moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0)); - background-image: -o-linear-gradient(left, #fff, rgba(204, 154, 129, 0)); - background-image: -ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0)); - background-image: linear-gradient(to right, #fff, rgba(204, 154, 129, 0)); - -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)"; - filter : progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81'); -} -.sp-val { - background-image: -webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0))); - background-image: -webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0)); - background-image: -moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0)); - background-image: -o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0)); - background-image: -ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0)); - background-image: linear-gradient(to top, #000, rgba(204, 154, 129, 0)); - -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)"; - filter : progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000'); -} - -.sp-hue { - background: -moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); - background: -ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); - background: -o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); - background: -webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000)); - background: -webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); - background: linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); -} - -/* IE filters do not support multiple color stops. - Generate 6 divs, line them up, and do two color gradients for each. - Yes, really. - */ -.sp-1 { - height:17%; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00'); -} -.sp-2 { - height:16%; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00'); -} -.sp-3 { - height:17%; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff'); -} -.sp-4 { - height:17%; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff'); -} -.sp-5 { - height:16%; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff'); -} -.sp-6 { - height:17%; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000'); -} - -.sp-hidden { - display: none !important; -} - -/* Clearfix hack */ -.sp-cf:before, .sp-cf:after { content: ""; display: table; } -.sp-cf:after { clear: both; } -.sp-cf { *zoom: 1; } - - -/* Mobile devices, make hue slider bigger so it is easier to slide */ -@media (max-device-width: 480px) { - .sp-color { right: 40%; } - .sp-hue { left: 63%; } - .sp-fill { padding-top: 60%; } -} -.sp-dragger { - border-radius: 5px; - height: 5px; - width: 5px; - border: 1px solid #fff; - background: #000; - cursor: pointer; - position:absolute; - top:0; - left: 0; -} -.sp-slider { - position: absolute; - top:0; - cursor:pointer; - height: 3px; - left: -1px; - right: -1px; - border: 1px solid #000; - background: white; - opacity: .8; -} - -/* -Theme authors: -Here are the basic themeable display options (colors, fonts, global widths). -See http://bgrins.github.io/spectrum/themes/ for instructions. -*/ - -.sp-container { - border-radius: 0; - background-color: #fff; - border: 0; - padding: 0; - top:1px; - left:0; - margin-bottom:3px -} -.sp-container, .sp-container button, .sp-container input, .sp-color, .sp-hue, .sp-clear { - font: normal 12px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; -} -.sp-top { - margin-bottom: 3px; -} -.sp-color, .sp-hue, .sp-clear { - border: solid 1px #666; -} - -/* Input */ -.sp-input-container { - float:right; - width: 100px; - margin-bottom: 4px; -} -.sp-initial-disabled .sp-input-container { - width: 100%; -} -.sp-input { - font-size: 12px !important; - border: 1px inset; - padding: 4px 5px; - margin: 0; - width: 100%; - background:transparent; - border-radius: 3px; - color: #222; -} -.sp-input:focus { - border: 1px solid orange; -} -.sp-input.sp-validation-error { - border: 1px solid red; - background: #fdd; -} -.sp-picker-container , .sp-palette-container { - float:left; - position: relative; - padding: 10px; - padding-bottom: 300px; - margin-bottom: -290px; - margin-left:20px; - width:95%; - border:none; -} -.sp-picker-container { - width: 210px; - /* border-left: solid 1px #fff;*/ -} - -/* Palettes */ -.sp-palette-container { - border-right: solid 1px #ccc; -} - -.sp-palette-only .sp-palette-container { - border: 0; -} - -.sp-palette .sp-thumb-el { - display: block; - position:relative; - float:left; - width: 24px; - height: 15px; - margin: 3px; - cursor: pointer; - border:solid 2px transparent; -} -.sp-palette .sp-thumb-el:hover, .sp-palette .sp-thumb-el.sp-thumb-active { - border-color: orange; -} -.sp-thumb-el { - position:relative; -} -.sp-palette-toggle {margin-right:110px;margin-top:3px;} - -.sp-container a.sp-palette-toggle{ -color:#1976d2; -font-size:16px; -font-weight:bold; -cursor:pointer; -padding:1px 10px 2px 10px;} -} -.sp-container a.sp-palette-toggle:hover -{ color: #292b2c; background-color: #e6e6e6!important; border-color: #adadad } - - -/* Initial */ -.sp-initial { - float: left; - border: solid 1px #333; -} -.sp-initial span { - width: 30px; - height: 25px; - border:none; - display:block; - float:left; - margin:0; -} - -.sp-initial .sp-clear-display { - background-position: center; -} - -/* Buttons */ -.sp-palette-button-container, -.sp-button-container { - float: right; -} - -/* Replacer (the little preview div that shows up instead of the ) */ -.sp-replacer { - margin:0; - overflow:hidden; - cursor:pointer; - padding: 4px; - display:inline-block; - *zoom: 1; - *display: inline; - border: solid 1px #91765d; - background: #eee; - color: #333; - vertical-align: middle; -} -.sp-replacer:hover, .sp-replacer.sp-active { - border-color: #F0C49B; - color: #111; -} -.sp-replacer.sp-disabled { - cursor:default; - border-color: silver; - color: silver; -} -.sp-dd { - padding: 2px 0; - height: 16px; - line-height: 16px; - float:left; - font-size:10px; -} -.sp-preview { - position:relative; - width:25px; - height: 20px; - border: solid 1px #222; - margin-right: 5px; - float:left; - z-index: 0; -} - -.sp-palette { - *width: 220px; - max-width: 220px; -} -.sp-palette .sp-thumb-el { - width:16px; - height: 16px; - margin:2px 1px; - border: solid 1px #d0d0d0; -} - -.sp-container { - padding-bottom:0; -} - - -/* Buttons: http://hellohappy.org/css3-buttons/ */ -.sp-container button { - background-color: #eeeeee; - border: 1px solid #ccc; - border-bottom: 1px solid #bbb; - border-radius: 3px; - color: #333; - font-size: 14px; - line-height: 1; - padding: 5px 4px; - text-align: center; - text-shadow: 0 1px 0 #eee; - vertical-align: middle; -} -.sp-container button:hover { - background-color: #dddddd; - border: 1px solid #bbb; - border-bottom: 1px solid #999; - cursor: pointer; - text-shadow: 0 1px 0 #ddd; -} -.sp-container button:active { - border: 1px solid #aaa; - border-bottom: 1px solid #888; -} -.sp-cancel { - font-size: 11px; - color: #d93f3f !important; - margin:0; - padding:2px; - margin-right: 5px; - vertical-align: middle; - text-decoration:none; - -} -.sp-cancel:hover { - color: #d93f3f !important; - text-decoration: underline; -} - - -.sp-palette span:hover, .sp-palette span.sp-thumb-active { - border-color: #000; -} - -.sp-preview, .sp-alpha, .sp-thumb-el { - position:relative; - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==); -} -.sp-preview-inner, .sp-alpha-inner, .sp-thumb-inner { - display:block; - position:absolute; - top:0;left:0;bottom:0;right:0; -} - -.sp-palette .sp-thumb-inner { - background-position: 50% 50%; - background-repeat: no-repeat; -} - -.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=); -} - -.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=); -} - -.sp-clear-display { - background-repeat:no-repeat; - background-position: center; - background-image: url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==); -} +/*** +Spectrum Colorpicker v1.8.0 +https://github.com/bgrins/spectrum +Author: Brian Grinstead +License: MIT +***/ + +.sp-container { + position:absolute; + top:0; + left:0; + display:inline-block; + *display: inline; + *zoom: 1; + /* https://github.com/bgrins/spectrum/issues/40 */ + z-index: 9999994; + overflow: hidden; +} +.sp-container.sp-flat { + position: relative; + width:95%; + background:#FFF; + border:none; +} + +/* Fix for * { box-sizing: border-box; } */ +.sp-container, +.sp-container * { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +/* http://ansciath.tumblr.com/post/7347495869/css-aspect-ratio */ +.sp-top { + position:relative; + width: 100%; + display:inline-block; +} +.sp-top-inner { + position:absolute; + top:0; + left:0; + bottom:0; + right:0; +} +.sp-color { + position: absolute; + top:0; + left:0; + bottom:0; + right:20%; +} +.sp-hue { + position: absolute; + top:0; + right:0; + bottom:0; + left:84%; + height: 100%; +} + +.sp-clear-enabled .sp-hue { + top:33px; + height: 77.5%; +} + +.sp-fill { + padding-top: 80%; +} +.sp-sat, .sp-val { + position: absolute; + top:0; + left:0; + right:0; + bottom:0; +} + +.sp-alpha-enabled .sp-top { + margin-bottom: 18px; +} +.sp-alpha-enabled .sp-alpha { + display: block; +} +.sp-alpha-handle { + position:absolute; + top:-4px; + bottom: -4px; + width: 6px; + left: 50%; + cursor: pointer; + border: 1px solid black; + background: white; + opacity: .8; +} +.sp-alpha { + display: none; + position: absolute; + bottom: -14px; + right: 0; + left: 0; + height: 8px; +} +.sp-alpha-inner { + border: solid 1px #333; +} + +.sp-clear { + display: none; +} + +.sp-clear.sp-clear-display { + background-position: center; +} + +.sp-clear-enabled .sp-clear { + display: block; + position:absolute; + top:0px; + right:0; + bottom:0; + left:84%; + height: 28px; +} + +/* Don't allow text selection */ +.sp-container, .sp-replacer, .sp-preview, .sp-dragger, .sp-slider, .sp-alpha, .sp-clear, .sp-alpha-handle, .sp-container.sp-dragging .sp-input, .sp-container button { + -webkit-user-select:none; + -moz-user-select: -moz-none; + -o-user-select:none; + user-select: none; +} + +.sp-container.sp-input-disabled .sp-input-container { + display: none; +} +.sp-container.sp-buttons-disabled .sp-button-container { + display: none; +} +.sp-container.sp-palette-buttons-disabled .sp-palette-button-container { + display: none; +} +.sp-palette-only .sp-picker-container { + display: none; +} +.sp-palette-disabled .sp-palette-container { + display: none; +} + +.sp-initial-disabled .sp-initial { + display: none; +} + + +/* Gradients for hue, saturation and value instead of images. Not pretty... but it works */ +.sp-sat { + background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0))); + background-image: -webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0)); + background-image: -moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0)); + background-image: -o-linear-gradient(left, #fff, rgba(204, 154, 129, 0)); + background-image: -ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0)); + background-image: linear-gradient(to right, #fff, rgba(204, 154, 129, 0)); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)"; + filter : progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81'); +} +.sp-val { + background-image: -webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0))); + background-image: -webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0)); + background-image: -moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0)); + background-image: -o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0)); + background-image: -ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0)); + background-image: linear-gradient(to top, #000, rgba(204, 154, 129, 0)); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)"; + filter : progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000'); +} + +.sp-hue { + background: -moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); + background: -ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); + background: -o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); + background: -webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000)); + background: -webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); + background: linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); +} + +/* IE filters do not support multiple color stops. + Generate 6 divs, line them up, and do two color gradients for each. + Yes, really. + */ +.sp-1 { + height:17%; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00'); +} +.sp-2 { + height:16%; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00'); +} +.sp-3 { + height:17%; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff'); +} +.sp-4 { + height:17%; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff'); +} +.sp-5 { + height:16%; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff'); +} +.sp-6 { + height:17%; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000'); +} + +.sp-hidden { + display: none !important; +} + +/* Clearfix hack */ +.sp-cf:before, .sp-cf:after { content: ""; display: table; } +.sp-cf:after { clear: both; } +.sp-cf { *zoom: 1; } + + +/* Mobile devices, make hue slider bigger so it is easier to slide */ +@media (max-device-width: 480px) { + .sp-color { right: 40%; } + .sp-hue { left: 63%; } + .sp-fill { padding-top: 60%; } +} +.sp-dragger { + border-radius: 5px; + height: 5px; + width: 5px; + border: 1px solid #fff; + background: #000; + cursor: pointer; + position:absolute; + top:0; + left: 0; +} +.sp-slider { + position: absolute; + top:0; + cursor:pointer; + height: 3px; + left: -1px; + right: -1px; + border: 1px solid #000; + background: white; + opacity: .8; +} + +/* +Theme authors: +Here are the basic themeable display options (colors, fonts, global widths). +See http://bgrins.github.io/spectrum/themes/ for instructions. +*/ + +.sp-container { + border-radius: 0; + background-color: #fff; + border: 0; + padding: 0; + top:1px; + left:0; + margin-bottom:3px +} +.sp-container, .sp-container button, .sp-container input, .sp-color, .sp-hue, .sp-clear { + font: normal 12px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; +} +.sp-top { + margin-bottom: 3px; +} +.sp-color, .sp-hue, .sp-clear { + border: solid 1px #666; +} + +/* Input */ +.sp-input-container { + float:right; + width: 100px; + margin-bottom: 4px; +} +.sp-initial-disabled .sp-input-container { + width: 100%; +} +.sp-input { + font-size: 12px !important; + border: 1px inset; + padding: 4px 5px; + margin: 0; + width: 100%; + background:transparent; + border-radius: 3px; + color: #222; +} +.sp-input:focus { + border: 1px solid orange; +} +.sp-input.sp-validation-error { + border: 1px solid red; + background: #fdd; +} +.sp-picker-container , .sp-palette-container { + float:left; + position: relative; + padding: 10px; + padding-bottom: 300px; + margin-bottom: -290px; + margin-left:20px; + width:95%; + border:none; +} +.sp-picker-container { + width: 210px; + /* border-left: solid 1px #fff;*/ +} + +/* Palettes */ +.sp-palette-container { + border-right: solid 1px #ccc; +} + +.sp-palette-only .sp-palette-container { + border: 0; +} + +.sp-palette .sp-thumb-el { + display: block; + position:relative; + float:left; + width: 24px; + height: 15px; + margin: 3px; + cursor: pointer; + border:solid 2px transparent; +} +.sp-palette .sp-thumb-el:hover, .sp-palette .sp-thumb-el.sp-thumb-active { + border-color: orange; +} +.sp-thumb-el { + position:relative; +} +.sp-palette-toggle {margin-right:110px;margin-top:3px;} + +.sp-container a.sp-palette-toggle{ +color:#1976d2; +font-size:16px; +font-weight:bold; +cursor:pointer; +padding:1px 10px 2px 10px;} +} +.sp-container a.sp-palette-toggle:hover +{ color: #292b2c; background-color: #e6e6e6!important; border-color: #adadad } + + +/* Initial */ +.sp-initial { + float: left; + border: solid 1px #333; +} +.sp-initial span { + width: 30px; + height: 25px; + border:none; + display:block; + float:left; + margin:0; +} + +.sp-initial .sp-clear-display { + background-position: center; +} + +/* Buttons */ +.sp-palette-button-container, +.sp-button-container { + float: right; +} + +/* Replacer (the little preview div that shows up instead of the ) */ +.sp-replacer { + margin:0; + overflow:hidden; + cursor:pointer; + padding: 4px; + display:inline-block; + *zoom: 1; + *display: inline; + border: solid 1px #91765d; + background: #eee; + color: #333; + vertical-align: middle; +} +.sp-replacer:hover, .sp-replacer.sp-active { + border-color: #F0C49B; + color: #111; +} +.sp-replacer.sp-disabled { + cursor:default; + border-color: silver; + color: silver; +} +.sp-dd { + padding: 2px 0; + height: 16px; + line-height: 16px; + float:left; + font-size:10px; +} +.sp-preview { + position:relative; + width:25px; + height: 20px; + border: solid 1px #222; + margin-right: 5px; + float:left; + z-index: 0; +} + +.sp-palette { + *width: 220px; + max-width: 220px; +} +.sp-palette .sp-thumb-el { + width:16px; + height: 16px; + margin:2px 1px; + border: solid 1px #d0d0d0; +} + +.sp-container { + padding-bottom:0; +} + + +/* Buttons: http://hellohappy.org/css3-buttons/ */ +.sp-container button { + background-color: #eeeeee; + border: 1px solid #ccc; + border-bottom: 1px solid #bbb; + border-radius: 3px; + color: #333; + font-size: 14px; + line-height: 1; + padding: 5px 4px; + text-align: center; + text-shadow: 0 1px 0 #eee; + vertical-align: middle; +} +.sp-container button:hover { + background-color: #dddddd; + border: 1px solid #bbb; + border-bottom: 1px solid #999; + cursor: pointer; + text-shadow: 0 1px 0 #ddd; +} +.sp-container button:active { + border: 1px solid #aaa; + border-bottom: 1px solid #888; +} +.sp-cancel { + font-size: 11px; + color: #d93f3f !important; + margin:0; + padding:2px; + margin-right: 5px; + vertical-align: middle; + text-decoration:none; + +} +.sp-cancel:hover { + color: #d93f3f !important; + text-decoration: underline; +} + + +.sp-palette span:hover, .sp-palette span.sp-thumb-active { + border-color: #000; +} + +.sp-preview, .sp-alpha, .sp-thumb-el { + position:relative; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==); +} +.sp-preview-inner, .sp-alpha-inner, .sp-thumb-inner { + display:block; + position:absolute; + top:0;left:0;bottom:0;right:0; +} + +.sp-palette .sp-thumb-inner { + background-position: 50% 50%; + background-repeat: no-repeat; +} + +.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=); +} + +.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=); +} + +.sp-clear-display { + background-repeat:no-repeat; + background-position: center; + background-image: url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==); +} #mainMenu.show .nav > li.dropdown.hover > a { background-color: #fff; color: #444!important; } \ No newline at end of file diff --git a/manager/media/style/default/color.switcher.php b/manager/media/style/default/color.switcher.php index 56dab8b15b..cbea9d5439 100755 --- a/manager/media/style/default/color.switcher.php +++ b/manager/media/style/default/color.switcher.php @@ -1,170 +1,170 @@ -
    -
    -
    -

    COLOR SWITCHER

    -
    -
    -

    Menu Background

    -
    -
    -
    -
    #000
    -
    #222
    -
    #333
    -
    #444
    -
    #555
    -
    #777
    -
    #888
    -
    #0f243e
    -
    #548dd4
    -
    #134f5c
    -
    #0b5394
    -
    #351c75
    -
    #741b47
    -
    #900
    -
    - -
    -
    -
    -
    -

    Menu links

    -
    - -
    - -
    -
    -

    Menu links:hover

    -
    - -
    -
    -
    -

    Text color

    -
    -
    -
    -
    #000
    -
    #222
    -
    #333
    -
    #444
    -
    #555
    -
    #777
    -
    #888
    -
    #b45f06
    -
    #38761d
    -
    #134f5c
    -
    #0b5394
    -
    #351c75
    -
    #741b47
    -
    #9d2661
    -
    - -
    -
    -
    -
    -

    Links Color

    -
    -
    -
    -
    #000
    -
    #222
    -
    #555
    -
    #666
    -
    #dedede
    -
    #fafafa
    -
    #fff
    -
    #b45f06
    -
    #38761d
    -
    #134f5c
    -
    #0b5394
    -
    #351c75
    -
    #741b47
    -
    #9d2661
    -
    - -
    -
    -
    - -
    -
    - +
    +
    +
    +

    COLOR SWITCHER

    +
    +
    +

    Menu Background

    +
    +
    +
    +
    #000
    +
    #222
    +
    #333
    +
    #444
    +
    #555
    +
    #777
    +
    #888
    +
    #0f243e
    +
    #548dd4
    +
    #134f5c
    +
    #0b5394
    +
    #351c75
    +
    #741b47
    +
    #900
    +
    + +
    +
    +
    +
    +

    Menu links

    +
    + +
    + +
    +
    +

    Menu links:hover

    +
    + +
    +
    +
    +

    Text color

    +
    +
    +
    +
    #000
    +
    #222
    +
    #333
    +
    #444
    +
    #555
    +
    #777
    +
    #888
    +
    #b45f06
    +
    #38761d
    +
    #134f5c
    +
    #0b5394
    +
    #351c75
    +
    #741b47
    +
    #9d2661
    +
    + +
    +
    +
    +
    +

    Links Color

    +
    +
    +
    +
    #000
    +
    #222
    +
    #555
    +
    #666
    +
    #dedede
    +
    #fafafa
    +
    #fff
    +
    #b45f06
    +
    #38761d
    +
    #134f5c
    +
    #0b5394
    +
    #351c75
    +
    #741b47
    +
    #9d2661
    +
    + +
    +
    +
    + +
    +
    + diff --git a/manager/media/style/default/css/color.switcher.css b/manager/media/style/default/css/color.switcher.css index 69df23573e..3a0418f23c 100755 --- a/manager/media/style/default/css/color.switcher.css +++ b/manager/media/style/default/css/color.switcher.css @@ -1,73 +1,73 @@ -* { margin: 0; padding: 0; box-sizing: border-box; } -.evocp-box { position: fixed; width: 300px; min-height: 100%; top: 35px; right: -300px; color: #444; z-index: 10; transition: 0.5s cubic-bezier(1, 1.48, 0.76, 0.95) right, box-shadow .5s; } -.evocp-icon { position: absolute; bottom:60px; width: 34px; height: 29px; vertical-align: middle; line-height: 28px; left: -34px; background: #fafafa; box-shadow: -3px 0 2px 1px rgba(0, 0, 0, 0.1); border-radius: 50% 0 0 50%; text-align: center; font-size: 17px; cursor: pointer; z-index: 10; -webkit-animation: colorchange 15s infinite alternate; } -.dark .evocp-icon { background: #2f323a; border: 1px solid #2f323a; border-right: 0; -webkit-animation: colorchange 15s infinite alternate; } -i.evocpicon:hover { -webkit-transform: rotate(30deg); -moz-transform: rotate(30deg); -ms-transform: rotate(30deg); -o-transform: rotate(30deg); transform: rotate(30deg); } -@keyframes colorchange { -0% { color: #b45f06; } -10% { color: #38761d; } -20% { color: #134f5c; } -30% { color: #0b5394; } -40% { color: #351c75; } -50% { color: #741b47; } -60% { color: blue; } -70% { color: #2980b9; } -80% { color: #f1c40f; } -90% { color: #2980b9; } -100% { color: #900;} -} -@-webkit-keyframes colorchange /* Safari and Chrome - necessary duplicate */ { -0% { color: #b45f06; } -10% { color: #38761d; } -20% { color: #134f5c; } -30% { color: #0b5394; } -40% { color: #351c75; } -50% { color: #741b47; } -60% { color: blue; } -70% { color: #2980b9; } -80% { color: #f1c40f; } -90% { color: #2980b9; } -100% { color: #900; } -} -.evocp-box .evocp-frame { position: absolute; width: 100%; height: 100%; top: 0; right: 0; background: #fafafa; text-align: center; font-weight: 700; color: #444; padding: 0 0 20px 0; } -.dark .evocp-box .evocp-frame { color: #dedede; background: #202329; border-top: 1px solid #2f323a; } -.evocp-box .evocp-menuHColors, .evocp-box .evocp-menuColors, .evocp-box .evocp-bgmcolors, .evocp-box .evocp-colors, .evocp-box .evocp-alinkcolors { margin: 10px; overflow: hidden; } -.evocp-box .evocp-menuHColor, .evocp-box .evocp-menuColor, .evocp-box .evocp-bgmcolor, .evocp-box .evocp-color, .evocp-box .evocp-alinkcolor { position: relative; float: left; margin: 2px; height: 31px; width: 31px; max-height: 31px; max-width: 31px; background: #2f323a; color: transparent; overflow: hidden; cursor: pointer; border: 1px solid #646b7b; border-radius: 50%; } -.evocp-box .evocp-custom-colors, .evocp-box .evocp-custom-colors { clear: both; padding-top: 20px; } -.evocp-box input[name="evocpCustomalinkcolor"], .evocp-box input[name="evocpCustommenuColor"], .evocp-box input[name="evocpCustommenuHColor"], .evocp-box input[name="evocpCustombgmColor"], .evocp-box input[name="evocpCustomTXColor"] { margin: 10px 0 0 -4px; cursor: pointer; height: 30px; width: 30px; border-radius: 50%; border: none; outline: none; background: transparent; padding: 0; } -.appear-it { right: 0; box-shadow: -3px 0 4px 1px rgba(0, 0, 0, 0.1); } -.evocp-frame h2 { font-size: 1.0rem; line-height: 1.6rem; border-bottom: 1px solid #dedede; padding-top: 4px; /* -webkit-animation: colorchange 20s infinite alternate;*/ } -.dark .evocp-frame h2 { background-color: #2f323a; border-bottom: 1px solid #dedede; } -.evocp-frame .panel-heading h3 { cursor: pointer; display: inline-block; font-size: 0.8rem; line-height: 1.1rem; margin-top: 9px; } -.evocp-frame .panel-heading h3:hover { color: #000; } -.dark .evocp-frame h3:hover { color: #fff; } -.evocp-frame .panel { margin-bottom: 2px; } -.evocp-frame .panel-heading { text-align: left; border-top: 1px solid #dedede; border-bottom: 1px solid #dedede; background-color: #f2f2f2; padding: 0 0 0 8px; text-transform: uppercase; } -.dark .evocp-frame .panel-heading { background-color: #2f323a; border-color: #3e4144; } -.evocp-frame .panel-heading .btn { margin-top: 2px } -.dark .evocp-frame .panel-heading .btn { background-color: #2f323a; border-color: #3e4144; color: #fafafa; } -.dark .evocp-frame .panel-heading .btn:hover { background-color: #1a1c21; } -.dark .evocp-frame h2 { border-color: #3e4144; } -.evocp-frame .panel-heading .togglearrow { width: 10px; font-size: 10px; color: #bbb; margin-right: 2px; margin-top: -5px; } -.evocp-box .evocp-menuHColor.colorSelected:before, .evocp-box .evocp-menuColor.colorSelected:before, .evocp-box .evocp-bgmcolor.colorSelected:before, .evocp-box .evocp-color.colorSelected:before, .evocp-box .evocp-alinkcolor.colorSelected:before { font-family: 'Font Awesome 5 Free'; content: "\f1fc"; display: inline-block; padding-top: 3px; vertical-align: middle; color: #fff; } -.evocp-box .evocp-menuHColor.evocp_light.colorSelected:before, .evocp-box .evocp-menuColor.evocp_light.colorSelected:before, .evocp-box .evocp-bgmcolor.evocp_light.colorSelected:before, .evocp-box .evocp-color.evocp_light.colorSelected:before, .evocp-box .evocp-alinkcolor.evocp_light.colorSelected:before { color: #444 !important; } -.dark .evocp-box .btn-secondary { background-color: #2f323a; border-color: #3e4144; color: #fafafa; } -/*fix for mainmenu*/ -/* -#mainMenu.show .nav > li.dropdown.hover > a { - background-color: #fff; - color: #666!important; -} -/* color picker*/ -.sp-picker-container { width: 200px; border-left: 0 !important; } -.sp-container { width: 300px; background: #f2f2f2; border: 1px solid #dedede; } -.dark .sp-container { background: #2f323a; border: 1px solid #3e4144; } -.evo-cp-replacer, .sp-replacer.sp-light { padding: 2px; background: #f2f2f2; border-color: #dedede; margin: 3px auto; } -.dark .evo-cp-replacer, .dark .sp-replacer.sp-light { background: #2f323a; border-color: #3e4144; } -.sp-dd { margin-top: 4px; color: #666; } -.dark .sp-dd { color: #bcbec0; } -.sp-preview { height: 25px; width: 25px; max-height: 25px; max-width: 25px; overflow: hidden; cursor: pointer; border-radius: 50%; border: 0px solid #2f323a; } -/* navbar left */ -.navbar-left .evocp-box { - top: 0; -} +* { margin: 0; padding: 0; box-sizing: border-box; } +.evocp-box { position: fixed; width: 300px; min-height: 100%; top: 35px; right: -300px; color: #444; z-index: 10; transition: 0.5s cubic-bezier(1, 1.48, 0.76, 0.95) right, box-shadow .5s; } +.evocp-icon { position: absolute; bottom:60px; width: 34px; height: 29px; vertical-align: middle; line-height: 28px; left: -34px; background: #fafafa; box-shadow: -3px 0 2px 1px rgba(0, 0, 0, 0.1); border-radius: 50% 0 0 50%; text-align: center; font-size: 17px; cursor: pointer; z-index: 10; -webkit-animation: colorchange 15s infinite alternate; } +.dark .evocp-icon { background: #2f323a; border: 1px solid #2f323a; border-right: 0; -webkit-animation: colorchange 15s infinite alternate; } +i.evocpicon:hover { -webkit-transform: rotate(30deg); -moz-transform: rotate(30deg); -ms-transform: rotate(30deg); -o-transform: rotate(30deg); transform: rotate(30deg); } +@keyframes colorchange { +0% { color: #b45f06; } +10% { color: #38761d; } +20% { color: #134f5c; } +30% { color: #0b5394; } +40% { color: #351c75; } +50% { color: #741b47; } +60% { color: blue; } +70% { color: #2980b9; } +80% { color: #f1c40f; } +90% { color: #2980b9; } +100% { color: #900;} +} +@-webkit-keyframes colorchange /* Safari and Chrome - necessary duplicate */ { +0% { color: #b45f06; } +10% { color: #38761d; } +20% { color: #134f5c; } +30% { color: #0b5394; } +40% { color: #351c75; } +50% { color: #741b47; } +60% { color: blue; } +70% { color: #2980b9; } +80% { color: #f1c40f; } +90% { color: #2980b9; } +100% { color: #900; } +} +.evocp-box .evocp-frame { position: absolute; width: 100%; height: 100%; top: 0; right: 0; background: #fafafa; text-align: center; font-weight: 700; color: #444; padding: 0 0 20px 0; } +.dark .evocp-box .evocp-frame { color: #dedede; background: #202329; border-top: 1px solid #2f323a; } +.evocp-box .evocp-menuHColors, .evocp-box .evocp-menuColors, .evocp-box .evocp-bgmcolors, .evocp-box .evocp-colors, .evocp-box .evocp-alinkcolors { margin: 10px; overflow: hidden; } +.evocp-box .evocp-menuHColor, .evocp-box .evocp-menuColor, .evocp-box .evocp-bgmcolor, .evocp-box .evocp-color, .evocp-box .evocp-alinkcolor { position: relative; float: left; margin: 2px; height: 31px; width: 31px; max-height: 31px; max-width: 31px; background: #2f323a; color: transparent; overflow: hidden; cursor: pointer; border: 1px solid #646b7b; border-radius: 50%; } +.evocp-box .evocp-custom-colors, .evocp-box .evocp-custom-colors { clear: both; padding-top: 20px; } +.evocp-box input[name="evocpCustomalinkcolor"], .evocp-box input[name="evocpCustommenuColor"], .evocp-box input[name="evocpCustommenuHColor"], .evocp-box input[name="evocpCustombgmColor"], .evocp-box input[name="evocpCustomTXColor"] { margin: 10px 0 0 -4px; cursor: pointer; height: 30px; width: 30px; border-radius: 50%; border: none; outline: none; background: transparent; padding: 0; } +.appear-it { right: 0; box-shadow: -3px 0 4px 1px rgba(0, 0, 0, 0.1); } +.evocp-frame h2 { font-size: 1.0rem; line-height: 1.6rem; border-bottom: 1px solid #dedede; padding-top: 4px; /* -webkit-animation: colorchange 20s infinite alternate;*/ } +.dark .evocp-frame h2 { background-color: #2f323a; border-bottom: 1px solid #dedede; } +.evocp-frame .panel-heading h3 { cursor: pointer; display: inline-block; font-size: 0.8rem; line-height: 1.1rem; margin-top: 9px; } +.evocp-frame .panel-heading h3:hover { color: #000; } +.dark .evocp-frame h3:hover { color: #fff; } +.evocp-frame .panel { margin-bottom: 2px; } +.evocp-frame .panel-heading { text-align: left; border-top: 1px solid #dedede; border-bottom: 1px solid #dedede; background-color: #f2f2f2; padding: 0 0 0 8px; text-transform: uppercase; } +.dark .evocp-frame .panel-heading { background-color: #2f323a; border-color: #3e4144; } +.evocp-frame .panel-heading .btn { margin-top: 2px } +.dark .evocp-frame .panel-heading .btn { background-color: #2f323a; border-color: #3e4144; color: #fafafa; } +.dark .evocp-frame .panel-heading .btn:hover { background-color: #1a1c21; } +.dark .evocp-frame h2 { border-color: #3e4144; } +.evocp-frame .panel-heading .togglearrow { width: 10px; font-size: 10px; color: #bbb; margin-right: 2px; margin-top: -5px; } +.evocp-box .evocp-menuHColor.colorSelected:before, .evocp-box .evocp-menuColor.colorSelected:before, .evocp-box .evocp-bgmcolor.colorSelected:before, .evocp-box .evocp-color.colorSelected:before, .evocp-box .evocp-alinkcolor.colorSelected:before { font-family: 'Font Awesome 5 Free'; content: "\f1fc"; display: inline-block; padding-top: 3px; vertical-align: middle; color: #fff; } +.evocp-box .evocp-menuHColor.evocp_light.colorSelected:before, .evocp-box .evocp-menuColor.evocp_light.colorSelected:before, .evocp-box .evocp-bgmcolor.evocp_light.colorSelected:before, .evocp-box .evocp-color.evocp_light.colorSelected:before, .evocp-box .evocp-alinkcolor.evocp_light.colorSelected:before { color: #444 !important; } +.dark .evocp-box .btn-secondary { background-color: #2f323a; border-color: #3e4144; color: #fafafa; } +/*fix for mainmenu*/ +/* +#mainMenu.show .nav > li.dropdown.hover > a { + background-color: #fff; + color: #666!important; +} +/* color picker*/ +.sp-picker-container { width: 200px; border-left: 0 !important; } +.sp-container { width: 300px; background: #f2f2f2; border: 1px solid #dedede; } +.dark .sp-container { background: #2f323a; border: 1px solid #3e4144; } +.evo-cp-replacer, .sp-replacer.sp-light { padding: 2px; background: #f2f2f2; border-color: #dedede; margin: 3px auto; } +.dark .evo-cp-replacer, .dark .sp-replacer.sp-light { background: #2f323a; border-color: #3e4144; } +.sp-dd { margin-top: 4px; color: #666; } +.dark .sp-dd { color: #bcbec0; } +.sp-preview { height: 25px; width: 25px; max-height: 25px; max-width: 25px; overflow: hidden; cursor: pointer; border-radius: 50%; border: 0px solid #2f323a; } +/* navbar left */ +.navbar-left .evocp-box { + top: 0; +} diff --git a/manager/media/style/default/css/contextmenu.css b/manager/media/style/default/css/contextmenu.css index 1148c979fb..900329a7a6 100755 --- a/manager/media/style/default/css/contextmenu.css +++ b/manager/media/style/default/css/contextmenu.css @@ -1,14 +1,14 @@ -/* contextmenu */ -#mx_contextmenu, #contextmenu, .nu-context-menu, .contextMenu { display: block !important; position: absolute; overflow: hidden; top: 0; max-width: 25rem; width: auto !important; height: auto; padding: 0.25rem 0; visibility: hidden; opacity: 0; z-index: 10000; background: #fff; font-size: 0.9em; border: none; border-radius: 0.25rem; -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); transition: opacity 0s, visibility 0s; transform: translateZ(0) } -#mx_contextmenu .fa, #contextmenu .fa, .nu-context-menu .fa, .contextMenu .fa { width: 1.3em; font-size: 0.9rem; text-align: center; } -#mx_contextmenu.show, #contextmenu.show, .nu-context-menu.active, .contextMenu { visibility: visible; opacity: 1; transition: opacity 0.1s, visibility 0.1s; } -#mx_contextmenu > div, #contextmenu > div, .nu-context-menu ul li, .contextMenu > div { padding: 0.5em 2em 0.5em 1em; } -#mx_contextmenu #nameHolder, #contextmenu .menuHeader, .nu-context-menu-title { color: #1377c5; padding: 0.75em 1em; } -#mx_contextmenu .menuLink, #contextmenu .menuLink, .nu-context-menu ul li, .contextMenu > div { cursor: pointer; } -#mx_contextmenu .menuLink:hover, #contextmenu .menuLink:hover, .nu-context-menu ul li:hover, .contextMenu > div:hover { background-color: #1976d2; color: #fff; } -#mx_contextmenu .seperator, #contextmenu .seperator, .nu-context-menu ul hr, .contextMenu .cntxMnuSeparator { height: 1px; background-color: rgba(0, 0, 0, 0.07) !important; margin: 0.25em 0; padding: 0; cursor: default; } -.nu-context-menu ul { margin: 0; padding: 0; } -.contextMenu .cntxMnuItem { white-space: nowrap } -/* modes theme */ -/* darkness */ -.darkness #mx_contextmenu, .darkness #contextmenu, .darkness .nu-context-menu, .darkness .contextMenu { background-color: #343942; color: inherit; } +/* contextmenu */ +#mx_contextmenu, #contextmenu, .nu-context-menu, .contextMenu { display: block !important; position: absolute; overflow: hidden; top: 0; max-width: 25rem; width: auto !important; height: auto; padding: 0.25rem 0; visibility: hidden; opacity: 0; z-index: 10000; background: #fff; font-size: 0.9em; border: none; border-radius: 0.25rem; -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); transition: opacity 0s, visibility 0s; transform: translateZ(0) } +#mx_contextmenu .fa, #contextmenu .fa, .nu-context-menu .fa, .contextMenu .fa { width: 1.3em; font-size: 0.9rem; text-align: center; } +#mx_contextmenu.show, #contextmenu.show, .nu-context-menu.active, .contextMenu { visibility: visible; opacity: 1; transition: opacity 0.1s, visibility 0.1s; } +#mx_contextmenu > div, #contextmenu > div, .nu-context-menu ul li, .contextMenu > div { padding: 0.5em 2em 0.5em 1em; } +#mx_contextmenu #nameHolder, #contextmenu .menuHeader, .nu-context-menu-title { color: #1377c5; padding: 0.75em 1em; } +#mx_contextmenu .menuLink, #contextmenu .menuLink, .nu-context-menu ul li, .contextMenu > div { cursor: pointer; } +#mx_contextmenu .menuLink:hover, #contextmenu .menuLink:hover, .nu-context-menu ul li:hover, .contextMenu > div:hover { background-color: #1976d2; color: #fff; } +#mx_contextmenu .seperator, #contextmenu .seperator, .nu-context-menu ul hr, .contextMenu .cntxMnuSeparator { height: 1px; background-color: rgba(0, 0, 0, 0.07) !important; margin: 0.25em 0; padding: 0; cursor: default; } +.nu-context-menu ul { margin: 0; padding: 0; } +.contextMenu .cntxMnuItem { white-space: nowrap } +/* modes theme */ +/* darkness */ +.darkness #mx_contextmenu, .darkness #contextmenu, .darkness .nu-context-menu, .darkness .contextMenu { background-color: #343942; color: inherit; } diff --git a/manager/media/style/default/css/fonts.css b/manager/media/style/default/css/fonts.css index e3941e8d2d..c1ab974b14 100755 --- a/manager/media/style/default/css/fonts.css +++ b/manager/media/style/default/css/fonts.css @@ -1,112 +1,112 @@ html { font-size: 16px } -@media (max-width: 900px) { -html { font-size: 16px; } -} -@media (max-width: 400px) { -html { font-size: 16px; } -} -@supports (-webkit-overflow-scrolling: touch) { - html, body { -webkit-overflow-scrolling: touch; overflow: auto; height: 100%; /* ios iframe scroll jumping to top fix */ } -} +@media (max-width: 900px) { +html { font-size: 16px; } +} +@media (max-width: 400px) { +html { font-size: 16px; } +} +@supports (-webkit-overflow-scrolling: touch) { + html, body { -webkit-overflow-scrolling: touch; overflow: auto; height: 100%; /* ios iframe scroll jumping to top fix */ } +} body { font-weight: normal; font-style: normal; font-size: 0.8125rem; line-height: 1.5; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: subpixel-antialiased } -/* For Arabic Font */ -html[lang="ar"] body, html[lang="ary"] body, html[lang="azb"] body, html[lang="fa-IR"] body, html[lang="haz"] body, html[lang="ps"] body, html[lang="ur"] body { font-family: Tahoma, Arial, sans-serif; } -/* For Chinese Font */ -html[lang="zh"] body { font-family: "PingFang SC", "Microsoft JhengHei", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", Helvetica, sans-serif; } -/* For Devanagari Font */ -html[lang="bn-BD"] body, html[lang="hi-IN"] body, html[lang="mr-IN"] body { font-family: Arial, sans-serif; } -/* For Greek Font */ -html[lang="el"] body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } -/* For Gujarati Font */ -html[lang="gu-IN"] body { font-family: Arial, sans-serif; } -/* For Hebrew Font */ -html[lang="he"] body { font-family: "Arial Hebrew", Arial, sans-serif; } -/* For Japanese Font */ -html[lang="ja"] body { font-family: Meiryo, "Hiragino Kaku Gothic Pro", sans-serif; } -/* For Korean font */ -html[lang="ko-KR"] body { font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; } -/* For Thai Font */ -html[lang="th"] body { font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; } -/* For Arabic Font */ -html[lang="fa"] body { font-family: Tahoma, Arial, sans-serif; } -body { background-color: #fafafa; color: #444; } -body.drag *, body.drag::after { cursor: grabbing !important; cursor: -moz-grabbing !important; cursor: -webkit-grabbing !important; cursor: -moz-grab !important; -moz-user-select: none !important; -webkit-user-select: none !important; user-select: none !important } -body.drag::after { bottom: 0; content: ""; left: 0; position: fixed; right: 0; top: 0; z-index: 999 } -body, ul, li { padding: 0; margin: 0; } -ul { margin-left: 1rem; margin-right: 1rem; } -li { list-style: none } -img { max-width: 100%; height: auto } +/* For Arabic Font */ +html[lang="ar"] body, html[lang="ary"] body, html[lang="azb"] body, html[lang="fa-IR"] body, html[lang="haz"] body, html[lang="ps"] body, html[lang="ur"] body { font-family: Tahoma, Arial, sans-serif; } +/* For Chinese Font */ +html[lang="zh"] body { font-family: "PingFang SC", "Microsoft JhengHei", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", Helvetica, sans-serif; } +/* For Devanagari Font */ +html[lang="bn-BD"] body, html[lang="hi-IN"] body, html[lang="mr-IN"] body { font-family: Arial, sans-serif; } +/* For Greek Font */ +html[lang="el"] body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } +/* For Gujarati Font */ +html[lang="gu-IN"] body { font-family: Arial, sans-serif; } +/* For Hebrew Font */ +html[lang="he"] body { font-family: "Arial Hebrew", Arial, sans-serif; } +/* For Japanese Font */ +html[lang="ja"] body { font-family: Meiryo, "Hiragino Kaku Gothic Pro", sans-serif; } +/* For Korean font */ +html[lang="ko-KR"] body { font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; } +/* For Thai Font */ +html[lang="th"] body { font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; } +/* For Arabic Font */ +html[lang="fa"] body { font-family: Tahoma, Arial, sans-serif; } +body { background-color: #fafafa; color: #444; } +body.drag *, body.drag::after { cursor: grabbing !important; cursor: -moz-grabbing !important; cursor: -webkit-grabbing !important; cursor: -moz-grab !important; -moz-user-select: none !important; -webkit-user-select: none !important; user-select: none !important } +body.drag::after { bottom: 0; content: ""; left: 0; position: fixed; right: 0; top: 0; z-index: 999 } +body, ul, li { padding: 0; margin: 0; } +ul { margin-left: 1rem; margin-right: 1rem; } +li { list-style: none } +img { max-width: 100%; height: auto } .h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { margin-bottom: .5rem; font-family: inherit; font-weight: 500; line-height: 1.1; color: inherit } -.h1, h1 { font-size: 1.75rem } -.h2, h2 { font-size: 1.5rem } -.h3, h3 { font-size: 1.25rem } -.h4, h4 { font-size: 1rem } -.h5, h5 { font-size: 0.8125rem } -.h6, h6 { font-size: 0.7rem } -h1 .fa:first-child { color:#444; margin-right: 0.5em } -a { color: #3481bc; text-decoration: none } -.text-primary { color: #3481bc !important; } -a:focus, a:hover { color: #014c8c; text-decoration: underline } -a[href=""], a:not([href]) { cursor: default } -a:not([href]):not([tabindex]) { color: inherit; text-decoration: none } -a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover { color: inherit; text-decoration: none } -a:not([href]):not([tabindex]):focus { outline: 0 } -* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box } -*::-ms-clear { display: none; } -.text-justify { text-align: justify !important } -.text-nowrap { white-space: nowrap !important } -.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap } -.text-left { text-align: left !important } -.text-right { text-align: right !important } -.text-center { text-align: center !important } -.text-lowercase { text-transform: lowercase !important } -.text-uppercase { text-transform: uppercase !important } -.text-capitalize { text-transform: capitalize !important } -.font-weight-normal { font-weight: 400 } -.font-weight-bold { font-weight: 700 } -.font-italic { font-style: italic } -.text-white { color: #fff !important } -.text-muted { color: #818a91 !important } -.text-decoration-through { text-decoration: line-through !important } -.text-underline { text-decoration: underline !important } -a.text-underline:hover { text-decoration: none !important } -a.text-muted:focus, a.text-muted:hover { color: #4b5257 !important } -.text-primary { color: #0275d8 !important } -a.text-primary:focus, a.text-primary:hover { color: #025aa5 !important } -.text-success { color: #5cb85c !important } -a.text-success:focus, a.text-success:hover { color: #449d44 !important } -.text-info { color: #5bc0de !important } -a.text-info:focus, a.text-info:hover { color: #31b0d5 !important } -.text-warning { color: #f0ad4e !important } -a.text-warning:focus, a.text-warning:hover { color: #ec971f !important } -.text-danger { color: #d9534f !important } -a.text-danger:focus, a.text-danger:hover { color: #c9302c !important } -.text-gray-dark { color: #292b2c !important } -a.text-gray-dark:focus, a.text-gray-dark:hover { color: #101112 !important } -.text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0 } -.hide { display: none !important } -.show { display: block !important } -.visible { visibility: visible !important; } -.invisible { visibility: hidden !important; } -.clear { clear: both; } -/* custom */ -#loadingmask { display: none !important; } -.fa > .fa-lock { position: relative; float: left; width: auto !important; margin-top: -1em; font-size: 0.7em !important; color: #ffc107 !important; -webkit-text-stroke: 1px rgba(0, 0, 0, 0.39); text-stroke: 1px rgba(0, 0, 0, 0.39); } -.rotate180 { -webkit-transform: rotate(180deg); -moz-transform: rotate(180deg); -ms-transform: rotate(180deg); -o-transform: rotate(180deg); transform: rotate(180deg); } -.disabledPlugin, .disabledPlugin a { color: #b68282; font-style: italic; } -h1 { font-size: 1.5em; line-height: 1.5rem; padding: 0.8rem; margin: 0; } -h1 .fa { margin-right: 0.25em; color: #1377c5; } -h1 .help { margin: 0 0 0 0.25em; color: rgba(0, 0, 0, 0.15); font-size: 0.8em; cursor: pointer } -h1 .help:hover { color: rgba(0, 0, 0, 0.3); } -h1 small { margin-left: 0.5em; line-height: 1em } -.split { height: 0; font-size: 0; clear: both; padding: 0; border-top: 1px dotted rgba(0, 0, 0, .1) } -#previewIframe { width: 100%; height: 400px; } -.messageRead { color: #333; } -.messageUnread { color: #3cb371; font-weight: 500; } -.element-edit-message { display: none } -.element-edit-message p:last-child, .element-edit-message-tab p:last-child { margin-bottom: 0 } -/* modes theme */ -/* darkness */ -.darkness h1 .help { color: #1976d2; opacity: .5; } -.darkness h1 .help:hover { opacity: 1; } +.h1, h1 { font-size: 1.75rem } +.h2, h2 { font-size: 1.5rem } +.h3, h3 { font-size: 1.25rem } +.h4, h4 { font-size: 1rem } +.h5, h5 { font-size: 0.8125rem } +.h6, h6 { font-size: 0.7rem } +h1 .fa:first-child { color:#444; margin-right: 0.5em } +a { color: #3481bc; text-decoration: none } +.text-primary { color: #3481bc !important; } +a:focus, a:hover { color: #014c8c; text-decoration: underline } +a[href=""], a:not([href]) { cursor: default } +a:not([href]):not([tabindex]) { color: inherit; text-decoration: none } +a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover { color: inherit; text-decoration: none } +a:not([href]):not([tabindex]):focus { outline: 0 } +* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box } +*::-ms-clear { display: none; } +.text-justify { text-align: justify !important } +.text-nowrap { white-space: nowrap !important } +.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap } +.text-left { text-align: left !important } +.text-right { text-align: right !important } +.text-center { text-align: center !important } +.text-lowercase { text-transform: lowercase !important } +.text-uppercase { text-transform: uppercase !important } +.text-capitalize { text-transform: capitalize !important } +.font-weight-normal { font-weight: 400 } +.font-weight-bold { font-weight: 700 } +.font-italic { font-style: italic } +.text-white { color: #fff !important } +.text-muted { color: #818a91 !important } +.text-decoration-through { text-decoration: line-through !important } +.text-underline { text-decoration: underline !important } +a.text-underline:hover { text-decoration: none !important } +a.text-muted:focus, a.text-muted:hover { color: #4b5257 !important } +.text-primary { color: #0275d8 !important } +a.text-primary:focus, a.text-primary:hover { color: #025aa5 !important } +.text-success { color: #5cb85c !important } +a.text-success:focus, a.text-success:hover { color: #449d44 !important } +.text-info { color: #5bc0de !important } +a.text-info:focus, a.text-info:hover { color: #31b0d5 !important } +.text-warning { color: #f0ad4e !important } +a.text-warning:focus, a.text-warning:hover { color: #ec971f !important } +.text-danger { color: #d9534f !important } +a.text-danger:focus, a.text-danger:hover { color: #c9302c !important } +.text-gray-dark { color: #292b2c !important } +a.text-gray-dark:focus, a.text-gray-dark:hover { color: #101112 !important } +.text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0 } +.hide { display: none !important } +.show { display: block !important } +.visible { visibility: visible !important; } +.invisible { visibility: hidden !important; } +.clear { clear: both; } +/* custom */ +#loadingmask { display: none !important; } +.fa > .fa-lock { position: relative; float: left; width: auto !important; margin-top: -1em; font-size: 0.7em !important; color: #ffc107 !important; -webkit-text-stroke: 1px rgba(0, 0, 0, 0.39); text-stroke: 1px rgba(0, 0, 0, 0.39); } +.rotate180 { -webkit-transform: rotate(180deg); -moz-transform: rotate(180deg); -ms-transform: rotate(180deg); -o-transform: rotate(180deg); transform: rotate(180deg); } +.disabledPlugin, .disabledPlugin a { color: #b68282; font-style: italic; } +h1 { font-size: 1.5em; line-height: 1.5rem; padding: 0.8rem; margin: 0; } +h1 .fa { margin-right: 0.25em; color: #1377c5; } +h1 .help { margin: 0 0 0 0.25em; color: rgba(0, 0, 0, 0.15); font-size: 0.8em; cursor: pointer } +h1 .help:hover { color: rgba(0, 0, 0, 0.3); } +h1 small { margin-left: 0.5em; line-height: 1em } +.split { height: 0; font-size: 0; clear: both; padding: 0; border-top: 1px dotted rgba(0, 0, 0, .1) } +#previewIframe { width: 100%; height: 400px; } +.messageRead { color: #333; } +.messageUnread { color: #3cb371; font-weight: 500; } +.element-edit-message { display: none } +.element-edit-message p:last-child, .element-edit-message-tab p:last-child { margin-bottom: 0 } +/* modes theme */ +/* darkness */ +.darkness h1 .help { color: #1976d2; opacity: .5; } +.darkness h1 .help:hover { opacity: 1; } diff --git a/manager/media/style/default/css/layout.css b/manager/media/style/default/css/layout.css index 173a9bcd6c..8d38186556 100755 --- a/manager/media/style/default/css/layout.css +++ b/manager/media/style/default/css/layout.css @@ -1,29 +1,29 @@ -.layout { display: table; table-layout: fixed; height: 100%; width: 100% } -.layout > .layout-row { display: table-row; vertical-align: top; height: 100% } -.layout > .layout-row > .layout-cell { display: table-cell; vertical-align: top; height: 100% } -.layout > .layout-row > .layout-cell.layout-container, .layout > .layout-row > .layout-cell .layout-container, .layout > .layout-row > .layout-cell.padded-container, .layout > .layout-row > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } -.layout > .layout-row > .layout-cell.layout-container .container-flush, .layout > .layout-row > .layout-cell .layout-container .container-flush, .layout > .layout-row > .layout-cell.padded-container .container-flush, .layout > .layout-row > .layout-cell .padded-container .container-flush { padding-top: 0 } -.layout > .layout-row > .layout-cell .layout-relative { position: relative; height: 100% } -.layout > .layout-row > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } -.layout > .layout-row > .layout-cell.min-size { width: 0 } -.layout > .layout-row > .layout-cell.min-height { height: 0 } -.layout > .layout-row > .layout-cell.center { text-align: center } -.layout > .layout-row > .layout-cell.middle { vertical-align: middle } -.layout > .layout-row > .layout-cell.layout-container, .layout > .layout-row > .layout-cell .layout-container, .layout > .layout-row > .layout-cell.padded-container, .layout > .layout-row > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } -.layout > .layout-row > .layout-cell.layout-container .container-flush, .layout > .layout-row > .layout-cell .layout-container .container-flush, .layout > .layout-row > .layout-cell.padded-container .container-flush, .layout > .layout-row > .layout-cell .padded-container .container-flush { padding-top: 0 } -.layout > .layout-row > .layout-cell .layout-relative { position: relative; height: 100% } -.layout > .layout-row > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } -.layout > .layout-row > .layout-cell.min-size { width: 0 } -.layout > .layout-row > .layout-cell.min-height { height: 0 } -.layout > .layout-row > .layout-cell.center { text-align: center } -.layout > .layout-row > .layout-cell.middle { vertical-align: middle } -.layout > .layout-row.min-size { height: 0 } -.layout > .layout-cell { display: table-cell; vertical-align: top; height: 100% } -.layout > .layout-cell.layout-container, .layout > .layout-cell .layout-container, .layout > .layout-cell.padded-container, .layout > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } -.layout > .layout-cell.layout-container .container-flush, .layout > .layout-cell .layout-container .container-flush, .layout > .layout-cell.padded-container .container-flush, .layout > .layout-cell .padded-container .container-flush { padding-top: 0 } -.layout > .layout-cell .layout-relative { position: relative; height: 100% } -.layout > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } -.layout > .layout-cell.min-size { width: 0 } -.layout > .layout-cell.min-height { height: 0 } -.layout > .layout-cell.center { text-align: center } -.layout > .layout-cell.middle { vertical-align: middle } +.layout { display: table; table-layout: fixed; height: 100%; width: 100% } +.layout > .layout-row { display: table-row; vertical-align: top; height: 100% } +.layout > .layout-row > .layout-cell { display: table-cell; vertical-align: top; height: 100% } +.layout > .layout-row > .layout-cell.layout-container, .layout > .layout-row > .layout-cell .layout-container, .layout > .layout-row > .layout-cell.padded-container, .layout > .layout-row > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } +.layout > .layout-row > .layout-cell.layout-container .container-flush, .layout > .layout-row > .layout-cell .layout-container .container-flush, .layout > .layout-row > .layout-cell.padded-container .container-flush, .layout > .layout-row > .layout-cell .padded-container .container-flush { padding-top: 0 } +.layout > .layout-row > .layout-cell .layout-relative { position: relative; height: 100% } +.layout > .layout-row > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } +.layout > .layout-row > .layout-cell.min-size { width: 0 } +.layout > .layout-row > .layout-cell.min-height { height: 0 } +.layout > .layout-row > .layout-cell.center { text-align: center } +.layout > .layout-row > .layout-cell.middle { vertical-align: middle } +.layout > .layout-row > .layout-cell.layout-container, .layout > .layout-row > .layout-cell .layout-container, .layout > .layout-row > .layout-cell.padded-container, .layout > .layout-row > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } +.layout > .layout-row > .layout-cell.layout-container .container-flush, .layout > .layout-row > .layout-cell .layout-container .container-flush, .layout > .layout-row > .layout-cell.padded-container .container-flush, .layout > .layout-row > .layout-cell .padded-container .container-flush { padding-top: 0 } +.layout > .layout-row > .layout-cell .layout-relative { position: relative; height: 100% } +.layout > .layout-row > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } +.layout > .layout-row > .layout-cell.min-size { width: 0 } +.layout > .layout-row > .layout-cell.min-height { height: 0 } +.layout > .layout-row > .layout-cell.center { text-align: center } +.layout > .layout-row > .layout-cell.middle { vertical-align: middle } +.layout > .layout-row.min-size { height: 0 } +.layout > .layout-cell { display: table-cell; vertical-align: top; height: 100% } +.layout > .layout-cell.layout-container, .layout > .layout-cell .layout-container, .layout > .layout-cell.padded-container, .layout > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } +.layout > .layout-cell.layout-container .container-flush, .layout > .layout-cell .layout-container .container-flush, .layout > .layout-cell.padded-container .container-flush, .layout > .layout-cell .padded-container .container-flush { padding-top: 0 } +.layout > .layout-cell .layout-relative { position: relative; height: 100% } +.layout > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } +.layout > .layout-cell.min-size { width: 0 } +.layout > .layout-cell.min-height { height: 0 } +.layout > .layout-cell.center { text-align: center } +.layout > .layout-cell.middle { vertical-align: middle } diff --git a/manager/media/style/default/css/page.css b/manager/media/style/default/css/page.css index 4844db2ca6..ddcccb1a0f 100644 --- a/manager/media/style/default/css/page.css +++ b/manager/media/style/default/css/page.css @@ -1,9 +1,9 @@ -@import "../../common/bootstrap/css/bootstrap.min.css?v=4.3.1"; -@import "../../common/font-awesome/css/font-awesome.min.css?v=5.10.2"; -@import 'fonts.css?v=1.3.5'; -@import "forms.css?v=1.3.5"; -@import "mainmenu.css?v=1.3.5"; -@import "tree.css"; -@import "tabpane.css"; -@import "contextmenu.css"; -@import "index.css"; +@import "../../common/bootstrap/css/bootstrap.min.css?v=4.3.1"; +@import "../../common/font-awesome/css/font-awesome.min.css?v=5.10.2"; +@import 'fonts.css?v=1.3.5'; +@import "forms.css?v=1.3.5"; +@import "mainmenu.css?v=1.3.5"; +@import "tree.css"; +@import "tabpane.css"; +@import "contextmenu.css"; +@import "index.css"; diff --git a/manager/media/style/default/index.html b/manager/media/style/default/index.html index fdd3791786..cfb7d0fe18 100755 --- a/manager/media/style/default/index.html +++ b/manager/media/style/default/index.html @@ -1,2 +1,2 @@ -

    Unauthorized access

    +

    Unauthorized access

    You're not allowed to access file folder \ No newline at end of file diff --git a/manager/media/style/default/js/color.switcher.js b/manager/media/style/default/js/color.switcher.js index 65b250c4d9..655f19ec92 100755 --- a/manager/media/style/default/js/color.switcher.js +++ b/manager/media/style/default/js/color.switcher.js @@ -1,281 +1,281 @@ -//Evolution color switcher -jQuery(document).ready(function($) { - //appear the evo colors switcher sidebar - $('.evocp-box .evocp-icon').on('click', function() { - $('.evocp-box').toggleClass('appear-it'); - }); - $('.evocp-box').attr('unselectable', 'on') - .css('user-select', 'none') - .on('selectstart', false); - - //vars// - var bgmcolor; - var color; - var menuColor; - var menuHColor; - var alinkcolor; - - // Get text color - var my_evo_color = localStorage.getItem('my_evo_color'); - if (my_evo_color) { - color = my_evo_color; - setColor(color); - } - // Get alink color - var my_evo_alinkcolor = localStorage.getItem('my_evo_alinkcolor'); - if (my_evo_alinkcolor) { - alinkcolor = my_evo_alinkcolor; - setalinkColor(alinkcolor); - } - // Get background menu color - var my_evo_bgmcolor = localStorage.getItem('my_evo_bgmcolor'); - if (my_evo_bgmcolor) { - bgmcolor = my_evo_bgmcolor; - setBgmColor(bgmcolor); - } - // Get menu link color - var my_evo_menuColor = localStorage.getItem('my_evo_menuColor'); - if (my_evo_menuColor) { - menuColor = my_evo_menuColor; - setMenuColor(menuColor); - } - // Get menu link hover color - var my_evo_menuHColor = localStorage.getItem('my_evo_menuHColor'); - if (my_evo_menuHColor) { - menuHColor = my_evo_menuHColor; - setMenuHColor(menuHColor); - } - - //Menu background part - - //change elements colors - function setBgmColor(bgmcolor) { - $('[data-evocp="bgmColor"]').css('backgroundColor', bgmcolor); - $('#mainMenu li.item > a').mouseover(function() { - $(this).css('backgroundColor', bgmcolor); - $(this).css('color', '#fff'); - }).mouseout(function() { - $(this).css('backgroundColor', '#FFF'); - $(this).css('color', '#444'); - }); - } - //store the color value in a variable - $('.evocp-bgmcolor').each(function(i) { - $('.evocp-bgmcolor').eq(i).css('backgroundColor', $(this).text()); - $('.evocp-bgmcolor').eq(i).on('click', function() { - bgmcolor = $(this).css('backgroundColor'); - // Save the color in local storage - localStorage.setItem('my_evo_bgmcolor', bgmcolor); - $(this).addClass('colorSelected').siblings().removeClass('colorSelected'); - }); - }); - //Color Picker colors - $('.bgmPicker .sp-top-inner').on('click', function() { - bgmcolor = $('.bgmcolors .sp-preview-inner').css("background-color"); - // Save the color in local storage - localStorage.setItem('my_evo_bgmcolor', bgmcolor); - setBgmColor(bgmcolor); - }); - $('.bgmPicker .sp-input').on('keydown', function() { - bgmcolor = $('.bgmcolors .sp-preview-inner').css("background-color"); - // Save the color in local storage - localStorage.setItem('my_evo_bgmcolor', bgmcolor); - setBgmColor(bgmcolor); - }); - //apply colors - $('*').on('click', function() { - setBgmColor(bgmcolor); - }); - - /////menu link Color part - - //change elements colors - function setMenuColor(menucolor) { - $('[data-evocp="menuColor"]').css('color', menuColor); - $("#mainMenu:not(.show) .nav > li > a").css('color', menuColor); - $("#mainMenu .nav .label_searchid").css('color', menuColor); - $("#mainMenu.show .nav > li > a").css('color', '#444!important'); - } - //store the color value in a variable - $('.evocp-menuColor').each(function(i) { - $('.evocp-menuColor').eq(i).css('backgroundColor', $(this).text()); - $('.evocp-menuColor').eq(i).on('click', function() { - menuColor = $(this).css('backgroundColor'); - // Save the color in local storage - localStorage.setItem('my_evo_menuColor', menuColor); - $(this).addClass('colorSelected').siblings().removeClass('colorSelected'); - }); - }); - - //Color Picker colors - $('.menucolorPicker .sp-top-inner').on('click', function() { - menuColor = $('.menuColors .sp-preview-inner').css("background-color"); - // Save the color in local storage - localStorage.setItem('my_evo_menuColor', menuColor); - setMenuColor(menuColor); - }); - $('.menucolorPicker .sp-input').on('keydown', function() { - menuColor = $('.menuColors .sp-preview-inner').css("background-color"); - // Save the color in local storage - localStorage.setItem('my_evo_menuColor', menuColor); - setMenuColor(menuColor); - }); - //apply colors - $('*').on('click', function() { - setMenuColor(menuColor); - }); - - /////menu link Hover Color - - //change elements colors - function setMenuHColor(menuHcolor) { - $('[data-evocp="menuHColor"]').css('color', menuHColor); - $('#mainMenu .nav > li:not(.active) > a.hover').css('color', menuHColor); - $('[data-evocp="menuColor"].hover').css('color', menuHColor); - - //$('#evo-tab-home.tab.selected').css('backgroundColor', bgcolor); - - $('#mainMenu .nav > li:not(.active) > a').mouseover(function() { - $(this).css('color', menuHColor); - }).mouseout(function() { - $(this).css('color', menuColor); - }); - $('#mainMenu .nav .label_searchid').mouseover(function() { - $(this).css('color', menuHColor); - }).mouseout(function() { - $(this).css('color', menuColor); - }); - $('#mainMenu .nav > li.active > a').css('color', menuHColor); - //#mainMenu.show .nav > li.dropdown.hover > a - //$('#bgPicker').val('bgcolor'); - } - //store the color value in a variable - $('.evocp-menuHColor').each(function(i) { - $('.evocp-menuHColor').eq(i).css('backgroundColor', $(this).text()); - $('.evocp-menuHColor').eq(i).on('click', function() { - menuHColor = $(this).css('backgroundColor'); - // Save the color in local storage - localStorage.setItem('my_evo_menuHColor', menuHColor); - $(this).addClass('colorSelected').siblings().removeClass('colorSelected'); - }); - }); - - //Color Picker colors - $('.menuHcolorPicker .sp-top-inner').on('click', function() { - menuHColor = $('.menuHColors .sp-preview-inner').css("background-color"); - // Save the color in local storage - localStorage.setItem('my_evo_menuHColor', menuHColor); - setMenuHColor(menuHColor); - }); - $('.menuHcolorPicker .sp-input').on('keydown', function() { - menuHColor = $('.menuHColors .sp-preview-inner').css("background-color"); - // Save the color in local storage - localStorage.setItem('my_evo_menuHColor', menuHColor); - setMenuHColor(menuHColor); - }); - //apply colors - $('*').on('click', function() { - setMenuHColor(menuHColor); - }); - - ///// Body Links color - //change elements colors - function setalinkColor(alinkcolor) { - $('[data-evocp="alinkcolor"]').css('color', alinkcolor); - //need fix and move to dedicated tree panel - // $('body:not(.dark) #treeRoot a:not(.deleted):not(.unpublished):not(.hidemenu) .title').css('color', alinkcolor); - // $('body #treeRoot a:not(.deleted):not(.unpublished):not(.hidemenu) .title').css('color', alinkcolor); - $('.container-body a:not(.btn)').css('color', alinkcolor); - } - //store the color value in a variable - $('.evocp-alinkcolor').each(function(i) { - $('.evocp-alinkcolor').eq(i).css('backgroundColor', $(this).text()); - $('.evocp-alinkcolor').eq(i).on('click', function() { - alinkcolor = $(this).css('backgroundColor'); - window.main.location.reload(); - // Save the color in local storage - localStorage.setItem('my_evo_alinkcolor', alinkcolor); - $(this).addClass('colorSelected').siblings().removeClass('colorSelected'); - }); - }); - //Color Picker colors - $('.linkcolorPicker .sp-top-inner').on('click', function() { - alinkcolor = $('.alinkcolors .sp-preview-inner').css("background-color"); - // Save the color in local storage - localStorage.setItem('my_evo_alinkcolor', alinkcolor); - setalinkColor(alinkcolor); - window.main.location.reload(); - }); - $('.linkcolorPicker .sp-input').on('keydown', function() { - alinkcolor = $('.alinkcolors .sp-preview-inner').css("background-color"); - // Save the color in local storage - localStorage.setItem('my_evo_alinkcolor', alinkcolor); - setalinkColor(alinkcolor); - window.main.location.reload(); - }); - //apply colors - $('*').on('click', function() { - setalinkColor(alinkcolor); - }); - - /////Body text color - //change elements colors - function setColor(color) { - $('[data-evocp="color"]').css('color', color); - $('[data-evocp="borderColor"]').css('border-color', color); - $('h1 .fa:not(.help)').css('color', color); - } - //store the color value in a variable - $('.evocp-color').each(function(i) { - $('.evocp-color').eq(i).css('backgroundColor', $(this).text()); - $('.evocp-color').eq(i).on('click', function() { - color = $(this).css('backgroundColor'); - window.main.location.reload(); - // Save the color in local storage - localStorage.setItem('my_evo_color', color); - $(this).addClass('colorSelected').siblings().removeClass('colorSelected'); - //alert("Text color is " + color); - - }); - }); - - //custom colors - $('.textcolorPicker .sp-top-inner').on('click', function() { - color = $('.cpcolors .sp-preview-inner').css("background-color"); - // Save the color in local storage - localStorage.setItem('my_evo_color', color); - setColor(color); - window.main.location.reload(); - }); - - //apply colors - $('*').on('click', function() { - setColor(color); - }); - - -////close document ready -}); -//clear Local Storage and reload only main frame -function cleanLocalStorageReloadMain(keys) { - keys = keys.split(','); - for (var i = 0; i < keys.length; i++) { - delete localStorage[keys[i]]; - } - window.main.location.reload(); -} -//clear Local Storage and reload all frames -function cleanLocalStorageReloadAll(keys) { - keys = keys.split(','); - for (var i = 0; i < keys.length; i++) { - delete localStorage[keys[i]]; - } - location.reload(); -} -//toggle chevron icon -jQuery(document).on('click', '.panel-heading h3', function(e) { - var $this = $(this); - icon = $(this).find("i.togglearrow"); - icon.toggleClass("fa-chevron-right fa-chevron-down") - -}) +//Evolution color switcher +jQuery(document).ready(function($) { + //appear the evo colors switcher sidebar + $('.evocp-box .evocp-icon').on('click', function() { + $('.evocp-box').toggleClass('appear-it'); + }); + $('.evocp-box').attr('unselectable', 'on') + .css('user-select', 'none') + .on('selectstart', false); + + //vars// + var bgmcolor; + var color; + var menuColor; + var menuHColor; + var alinkcolor; + + // Get text color + var my_evo_color = localStorage.getItem('my_evo_color'); + if (my_evo_color) { + color = my_evo_color; + setColor(color); + } + // Get alink color + var my_evo_alinkcolor = localStorage.getItem('my_evo_alinkcolor'); + if (my_evo_alinkcolor) { + alinkcolor = my_evo_alinkcolor; + setalinkColor(alinkcolor); + } + // Get background menu color + var my_evo_bgmcolor = localStorage.getItem('my_evo_bgmcolor'); + if (my_evo_bgmcolor) { + bgmcolor = my_evo_bgmcolor; + setBgmColor(bgmcolor); + } + // Get menu link color + var my_evo_menuColor = localStorage.getItem('my_evo_menuColor'); + if (my_evo_menuColor) { + menuColor = my_evo_menuColor; + setMenuColor(menuColor); + } + // Get menu link hover color + var my_evo_menuHColor = localStorage.getItem('my_evo_menuHColor'); + if (my_evo_menuHColor) { + menuHColor = my_evo_menuHColor; + setMenuHColor(menuHColor); + } + + //Menu background part + + //change elements colors + function setBgmColor(bgmcolor) { + $('[data-evocp="bgmColor"]').css('backgroundColor', bgmcolor); + $('#mainMenu li.item > a').mouseover(function() { + $(this).css('backgroundColor', bgmcolor); + $(this).css('color', '#fff'); + }).mouseout(function() { + $(this).css('backgroundColor', '#FFF'); + $(this).css('color', '#444'); + }); + } + //store the color value in a variable + $('.evocp-bgmcolor').each(function(i) { + $('.evocp-bgmcolor').eq(i).css('backgroundColor', $(this).text()); + $('.evocp-bgmcolor').eq(i).on('click', function() { + bgmcolor = $(this).css('backgroundColor'); + // Save the color in local storage + localStorage.setItem('my_evo_bgmcolor', bgmcolor); + $(this).addClass('colorSelected').siblings().removeClass('colorSelected'); + }); + }); + //Color Picker colors + $('.bgmPicker .sp-top-inner').on('click', function() { + bgmcolor = $('.bgmcolors .sp-preview-inner').css("background-color"); + // Save the color in local storage + localStorage.setItem('my_evo_bgmcolor', bgmcolor); + setBgmColor(bgmcolor); + }); + $('.bgmPicker .sp-input').on('keydown', function() { + bgmcolor = $('.bgmcolors .sp-preview-inner').css("background-color"); + // Save the color in local storage + localStorage.setItem('my_evo_bgmcolor', bgmcolor); + setBgmColor(bgmcolor); + }); + //apply colors + $('*').on('click', function() { + setBgmColor(bgmcolor); + }); + + /////menu link Color part + + //change elements colors + function setMenuColor(menucolor) { + $('[data-evocp="menuColor"]').css('color', menuColor); + $("#mainMenu:not(.show) .nav > li > a").css('color', menuColor); + $("#mainMenu .nav .label_searchid").css('color', menuColor); + $("#mainMenu.show .nav > li > a").css('color', '#444!important'); + } + //store the color value in a variable + $('.evocp-menuColor').each(function(i) { + $('.evocp-menuColor').eq(i).css('backgroundColor', $(this).text()); + $('.evocp-menuColor').eq(i).on('click', function() { + menuColor = $(this).css('backgroundColor'); + // Save the color in local storage + localStorage.setItem('my_evo_menuColor', menuColor); + $(this).addClass('colorSelected').siblings().removeClass('colorSelected'); + }); + }); + + //Color Picker colors + $('.menucolorPicker .sp-top-inner').on('click', function() { + menuColor = $('.menuColors .sp-preview-inner').css("background-color"); + // Save the color in local storage + localStorage.setItem('my_evo_menuColor', menuColor); + setMenuColor(menuColor); + }); + $('.menucolorPicker .sp-input').on('keydown', function() { + menuColor = $('.menuColors .sp-preview-inner').css("background-color"); + // Save the color in local storage + localStorage.setItem('my_evo_menuColor', menuColor); + setMenuColor(menuColor); + }); + //apply colors + $('*').on('click', function() { + setMenuColor(menuColor); + }); + + /////menu link Hover Color + + //change elements colors + function setMenuHColor(menuHcolor) { + $('[data-evocp="menuHColor"]').css('color', menuHColor); + $('#mainMenu .nav > li:not(.active) > a.hover').css('color', menuHColor); + $('[data-evocp="menuColor"].hover').css('color', menuHColor); + + //$('#evo-tab-home.tab.selected').css('backgroundColor', bgcolor); + + $('#mainMenu .nav > li:not(.active) > a').mouseover(function() { + $(this).css('color', menuHColor); + }).mouseout(function() { + $(this).css('color', menuColor); + }); + $('#mainMenu .nav .label_searchid').mouseover(function() { + $(this).css('color', menuHColor); + }).mouseout(function() { + $(this).css('color', menuColor); + }); + $('#mainMenu .nav > li.active > a').css('color', menuHColor); + //#mainMenu.show .nav > li.dropdown.hover > a + //$('#bgPicker').val('bgcolor'); + } + //store the color value in a variable + $('.evocp-menuHColor').each(function(i) { + $('.evocp-menuHColor').eq(i).css('backgroundColor', $(this).text()); + $('.evocp-menuHColor').eq(i).on('click', function() { + menuHColor = $(this).css('backgroundColor'); + // Save the color in local storage + localStorage.setItem('my_evo_menuHColor', menuHColor); + $(this).addClass('colorSelected').siblings().removeClass('colorSelected'); + }); + }); + + //Color Picker colors + $('.menuHcolorPicker .sp-top-inner').on('click', function() { + menuHColor = $('.menuHColors .sp-preview-inner').css("background-color"); + // Save the color in local storage + localStorage.setItem('my_evo_menuHColor', menuHColor); + setMenuHColor(menuHColor); + }); + $('.menuHcolorPicker .sp-input').on('keydown', function() { + menuHColor = $('.menuHColors .sp-preview-inner').css("background-color"); + // Save the color in local storage + localStorage.setItem('my_evo_menuHColor', menuHColor); + setMenuHColor(menuHColor); + }); + //apply colors + $('*').on('click', function() { + setMenuHColor(menuHColor); + }); + + ///// Body Links color + //change elements colors + function setalinkColor(alinkcolor) { + $('[data-evocp="alinkcolor"]').css('color', alinkcolor); + //need fix and move to dedicated tree panel + // $('body:not(.dark) #treeRoot a:not(.deleted):not(.unpublished):not(.hidemenu) .title').css('color', alinkcolor); + // $('body #treeRoot a:not(.deleted):not(.unpublished):not(.hidemenu) .title').css('color', alinkcolor); + $('.container-body a:not(.btn)').css('color', alinkcolor); + } + //store the color value in a variable + $('.evocp-alinkcolor').each(function(i) { + $('.evocp-alinkcolor').eq(i).css('backgroundColor', $(this).text()); + $('.evocp-alinkcolor').eq(i).on('click', function() { + alinkcolor = $(this).css('backgroundColor'); + window.main.location.reload(); + // Save the color in local storage + localStorage.setItem('my_evo_alinkcolor', alinkcolor); + $(this).addClass('colorSelected').siblings().removeClass('colorSelected'); + }); + }); + //Color Picker colors + $('.linkcolorPicker .sp-top-inner').on('click', function() { + alinkcolor = $('.alinkcolors .sp-preview-inner').css("background-color"); + // Save the color in local storage + localStorage.setItem('my_evo_alinkcolor', alinkcolor); + setalinkColor(alinkcolor); + window.main.location.reload(); + }); + $('.linkcolorPicker .sp-input').on('keydown', function() { + alinkcolor = $('.alinkcolors .sp-preview-inner').css("background-color"); + // Save the color in local storage + localStorage.setItem('my_evo_alinkcolor', alinkcolor); + setalinkColor(alinkcolor); + window.main.location.reload(); + }); + //apply colors + $('*').on('click', function() { + setalinkColor(alinkcolor); + }); + + /////Body text color + //change elements colors + function setColor(color) { + $('[data-evocp="color"]').css('color', color); + $('[data-evocp="borderColor"]').css('border-color', color); + $('h1 .fa:not(.help)').css('color', color); + } + //store the color value in a variable + $('.evocp-color').each(function(i) { + $('.evocp-color').eq(i).css('backgroundColor', $(this).text()); + $('.evocp-color').eq(i).on('click', function() { + color = $(this).css('backgroundColor'); + window.main.location.reload(); + // Save the color in local storage + localStorage.setItem('my_evo_color', color); + $(this).addClass('colorSelected').siblings().removeClass('colorSelected'); + //alert("Text color is " + color); + + }); + }); + + //custom colors + $('.textcolorPicker .sp-top-inner').on('click', function() { + color = $('.cpcolors .sp-preview-inner').css("background-color"); + // Save the color in local storage + localStorage.setItem('my_evo_color', color); + setColor(color); + window.main.location.reload(); + }); + + //apply colors + $('*').on('click', function() { + setColor(color); + }); + + +////close document ready +}); +//clear Local Storage and reload only main frame +function cleanLocalStorageReloadMain(keys) { + keys = keys.split(','); + for (var i = 0; i < keys.length; i++) { + delete localStorage[keys[i]]; + } + window.main.location.reload(); +} +//clear Local Storage and reload all frames +function cleanLocalStorageReloadAll(keys) { + keys = keys.split(','); + for (var i = 0; i < keys.length; i++) { + delete localStorage[keys[i]]; + } + location.reload(); +} +//toggle chevron icon +jQuery(document).on('click', '.panel-heading h3', function(e) { + var $this = $(this); + icon = $(this).find("i.togglearrow"); + icon.toggleClass("fa-chevron-right fa-chevron-down") + +}) diff --git a/manager/media/style/default/style.css b/manager/media/style/default/style.css index d86ee14dbf..a68b6c31f0 100755 --- a/manager/media/style/default/style.css +++ b/manager/media/style/default/style.css @@ -1,8 +1,8 @@ -@import "../common/bootstrap/css/bootstrap.min.css?v=4.0.0-alpha.5"; -@import "../common/font-awesome/css/font-awesome.min.css?v=4.7.0"; -@import "css/fonts.css?v=1.3.5"; -@import "css/forms.css?v=1.3.5"; -@import "css/custom.css?v=1.3.5"; -@import "css/tabpane.css"; -@import "css/contextmenu.css"; -@import "css/main.css"; +@import "../common/bootstrap/css/bootstrap.min.css?v=4.0.0-alpha.5"; +@import "../common/font-awesome/css/font-awesome.min.css?v=4.7.0"; +@import "css/fonts.css?v=1.3.5"; +@import "css/forms.css?v=1.3.5"; +@import "css/custom.css?v=1.3.5"; +@import "css/tabpane.css"; +@import "css/contextmenu.css"; +@import "css/main.css"; diff --git a/manager/media/style/default/welcome.tpl b/manager/media/style/default/welcome.tpl index 2df10fd9dc..f3e18d567e 100755 --- a/manager/media/style/default/welcome.tpl +++ b/manager/media/style/default/welcome.tpl @@ -1,33 +1,33 @@ -[[@OnManagerWelcomePrerender]] - -
    - - -
    -
    - [+logout_reminder_msg+] -
    -
    - - -
    -
    - [+multiple_sessions_msg+] -
    -
    - - -
    -
    - [+config_check_results+] -
    -
    - - -
    - [+widgets+] -
    - -
    - -[[@OnManagerWelcomeRender]] +[[@OnManagerWelcomePrerender]] + +
    + + +
    +
    + [+logout_reminder_msg+] +
    +
    + + +
    +
    + [+multiple_sessions_msg+] +
    +
    + + +
    +
    + [+config_check_results+] +
    +
    + + +
    + [+widgets+] +
    + +
    + +[[@OnManagerWelcomeRender]] diff --git a/manager/views/page/move_document.blade.php b/manager/views/page/move_document.blade.php index 885f305aa9..6a39edbfc5 100644 --- a/manager/views/page/move_document.blade.php +++ b/manager/views/page/move_document.blade.php @@ -1,76 +1,76 @@ -@extends('manager::template.page') -@section('content') - - @push('scripts.top') - - @endpush -

    - {{ $document->pagetitle }} ({{ $document->getKey() }}) -

    - - {{ ManagerTheme::styleHtml('actionbuttons.dynamic.save') }} - -
    -
    -

    {{ ManagerTheme::getLexicon('move_resource_message') }}

    - +@extends('manager::template.page') +@section('content') + + @push('scripts.top') + + @endpush +

    + {{ $document->pagetitle }} ({{ $document->getKey() }}) +

    + + {{ ManagerTheme::styleHtml('actionbuttons.dynamic.save') }} + +
    +
    +

    {{ ManagerTheme::getLexicon('move_resource_message') }}

    + @csrf - - - - -

    {{ ManagerTheme::getLexicon('resource_to_be_moved') }}: {{ $document->getKey() }}

    - {{ ManagerTheme::getLexicon('move_resource_new_parent') }} - -
    -
    -@endsection + + + + +

    {{ ManagerTheme::getLexicon('resource_to_be_moved') }}: {{ $document->getKey() }}

    + {{ ManagerTheme::getLexicon('move_resource_new_parent') }} + +
    +
    +@endsection diff --git a/manager/views/page/plugin_priority.blade.php b/manager/views/page/plugin_priority.blade.php index d4857a819b..e463358d46 100644 --- a/manager/views/page/plugin_priority.blade.php +++ b/manager/views/page/plugin_priority.blade.php @@ -1,62 +1,62 @@ -@extends('manager::template.page') -@section('content') - @push('scripts.top') - - @endpush - -

    - {{ ManagerTheme::getLexicon('plugin_priority_title') }} -

    - - {{ ManagerTheme::styleHtml('actionbuttons.dynamic.save') }} - -
    -
    - {{ ManagerTheme::getLexicon('plugin_priority') }} -

    {{ ManagerTheme::getLexicon('plugin_priority_instructions') }}

    - - @if($updateMsg) - {{ ManagerTheme::getLexicon('sort_updated') }} - @endif - - - -
    +@extends('manager::template.page') +@section('content') + @push('scripts.top') + + @endpush + +

    + {{ ManagerTheme::getLexicon('plugin_priority_title') }} +

    + + {{ ManagerTheme::styleHtml('actionbuttons.dynamic.save') }} + +
    +
    + {{ ManagerTheme::getLexicon('plugin_priority') }} +

    {{ ManagerTheme::getLexicon('plugin_priority_instructions') }}

    + + @if($updateMsg) + {{ ManagerTheme::getLexicon('sort_updated') }} + @endif + + + + @csrf - @foreach($events as $event) -
    - {{ $event->name }} -
      - @foreach($event->plugins as $plugin) -
    • disabled) class="disabledPlugin"@endif> - - {{ $plugin->name }}@if($plugin->disabled) (hide) @endif -
    • - @endforeach -
    -
    - @endforeach - -
    -
    - - -@endsection + @foreach($events as $event) +
    + {{ $event->name }} +
      + @foreach($event->plugins as $plugin) +
    • disabled) class="disabledPlugin"@endif> + + {{ $plugin->name }}@if($plugin->disabled) (hide) @endif +
    • + @endforeach +
    +
    + @endforeach + +
    +
    + + +@endsection From e8125e3dec4e3e59316597d77c207470596172a1 Mon Sep 17 00:00:00 2001 From: Artur Kyryliuk Date: Mon, 21 Sep 2026 13:20:53 +0200 Subject: [PATCH 4/4] upd(deps): regenerate composer.lock and vendor on PHP 8.3 core/composer.json had changed since the last lock, so composer.lock was removed and rebuilt from scratch with the default Windows PHP 8.3.29 and Composer 2.10.2, then vendor installed and optimised (--no-dev). Brings illuminate/* to v12.69.2, symfony/* to v7.4.17-19, monolog 3.12, carbon 3.14, guzzle 7.15.5 and the rest of the transitive tree up to date. Co-Authored-By: Claude Opus 5 --- core/composer.lock | 729 +++++++++--------- .../carbonphp/carbon-doctrine-types/README.md | 2 +- .../carbon-doctrine-types/composer.json | 7 +- .../Carbon/Doctrine/CarbonDoctrineType.php | 7 +- .../Carbon/Doctrine/CarbonTypeConverter.php | 6 +- core/vendor/composer/autoload_classmap.php | 6 + core/vendor/composer/autoload_static.php | 6 + core/vendor/composer/ca-bundle/res/cacert.pem | 148 ++-- core/vendor/composer/installed.json | 663 ++++++++-------- core/vendor/composer/installed.php | 318 ++++---- core/vendor/doctrine/lexer/SECURITY.md | 7 + core/vendor/doctrine/lexer/composer.json | 8 +- .../doctrine/lexer/src/AbstractLexer.php | 11 +- core/vendor/doctrine/lexer/src/Token.php | 6 +- .../graham-campbell/result-type/LICENSE | 2 +- .../graham-campbell/result-type/composer.json | 4 +- .../graham-campbell/result-type/src/Error.php | 20 +- .../result-type/src/Result.php | 6 +- .../result-type/src/Success.php | 17 +- core/vendor/guzzlehttp/guzzle/CHANGELOG.md | 17 + core/vendor/guzzlehttp/guzzle/README.md | 2 +- core/vendor/guzzlehttp/guzzle/composer.json | 4 +- .../guzzlehttp/guzzle/src/HandlerStack.php | 2 +- core/vendor/guzzlehttp/promises/CHANGELOG.md | 7 + core/vendor/guzzlehttp/promises/README.md | 2 +- core/vendor/guzzlehttp/psr7/CHANGELOG.md | 10 + core/vendor/guzzlehttp/psr7/README.md | 15 +- .../guzzlehttp/psr7/src/UriNormalizer.php | 25 +- .../guzzlehttp/psr7/src/UriResolver.php | 30 + .../guzzlehttp/uri-template/CHANGELOG.md | 6 + .../console/Concerns/InteractsWithIO.php | 2 +- .../vendor/illuminate/database/Connection.php | 2 +- .../Concerns/ResolvesJsonApiElements.php | 77 +- .../justinrainbow/json-schema/CHANGELOG.md | 32 + .../justinrainbow/json-schema/README.md | 6 +- .../json-schema/bin/validate-json | 47 +- .../justinrainbow/json-schema/composer.json | 18 +- .../AdditionalPropertiesConstraint.php | 13 +- .../Drafts/Draft06/FormatConstraint.php | 6 +- .../Drafts/Draft06/MaxLengthConstraint.php | 2 +- .../Drafts/Draft06/MinLengthConstraint.php | 2 +- .../Draft06/PropertiesNamesConstraint.php | 2 +- .../Drafts/Draft06/RequiredConstraint.php | 20 +- .../AdditionalPropertiesConstraint.php | 13 +- .../Drafts/Draft07/FormatConstraint.php | 7 +- .../Drafts/Draft07/MaxLengthConstraint.php | 2 +- .../Drafts/Draft07/MinLengthConstraint.php | 2 +- .../Draft07/PropertiesNamesConstraint.php | 2 +- .../Drafts/Draft07/RequiredConstraint.php | 20 +- .../AdditionalPropertiesConstraint.php | 13 +- .../Drafts/Draft2019/FormatConstraint.php | 7 +- .../Drafts/Draft2019/MaxLengthConstraint.php | 2 +- .../Drafts/Draft2019/MinLengthConstraint.php | 2 +- .../Draft2019/PropertiesNamesConstraint.php | 2 +- .../Drafts/Draft2019/RequiredConstraint.php | 20 +- .../Constraints/FormatConstraint.php | 6 +- .../Constraints/StringConstraint.php | 2 +- .../src/JsonSchema/Entity/JsonPointer.php | 19 + .../json-schema/src/JsonSchema/Rfc3339.php | 2 +- .../src/JsonSchema/Uri/Retrievers/Curl.php | 2 +- .../Uri/Retrievers/FileGetContents.php | 2 +- .../Default/Concerns/InteractsWithStrings.php | 6 +- .../src/Serializers/Signed.php | 9 +- .../LocalFilesystemAdapter.php | 3 +- .../src/WhitespacePathNormalizer.php | 3 +- core/vendor/monolog/monolog/CHANGELOG.md | 29 + core/vendor/monolog/monolog/composer.json | 4 +- .../Monolog/Attribute/WithMonologChannel.php | 5 +- .../monolog/src/Monolog/ErrorHandler.php | 70 +- .../Formatter/GelfMessageFormatter.php | 6 +- .../src/Monolog/Formatter/JsonFormatter.php | 10 +- .../Monolog/Formatter/NormalizerFormatter.php | 57 +- .../Monolog/Formatter/RedactingFormatter.php | 373 +++++++++ .../Formatter/WrappingFormatterInterface.php | 28 + .../Handler/AbstractProcessingHandler.php | 2 +- .../Monolog/Handler/BrowserConsoleHandler.php | 10 +- .../Monolog/Handler/DeduplicationHandler.php | 12 +- .../src/Monolog/Handler/ElasticaHandler.php | 3 +- .../Monolog/Handler/ElasticsearchHandler.php | 3 +- .../src/Monolog/Handler/ErrorLogHandler.php | 1 - .../src/Monolog/Handler/FlowdockHandler.php | 2 +- .../src/Monolog/Handler/FrankenPhpHandler.php | 100 +++ .../src/Monolog/Handler/LogMonsterHandler.php | 192 +++++ .../Monolog/Handler/RotatingFileHandler.php | 167 +++- .../src/Monolog/Handler/StreamHandler.php | 39 +- .../Monolog/Handler/SyslogUdp/UdpSocket.php | 14 +- .../src/Monolog/Handler/SyslogUdpHandler.php | 13 +- .../Monolog/Handler/TelegramBotHandler.php | 182 ++++- .../monolog/monolog/src/Monolog/Logger.php | 74 +- .../Processor/IntrospectionProcessor.php | 4 +- .../monolog/monolog/src/Monolog/Utils.php | 72 +- core/vendor/nesbot/carbon/readme.md | 56 +- .../nesbot/carbon/src/Carbon/CarbonPeriod.php | 41 +- .../Exceptions/NotACarbonClassException.php | 35 +- .../PeriodFilterSafetyException.php | 37 + .../nesbot/carbon/src/Carbon/Factory.php | 31 +- .../nesbot/carbon/src/Carbon/Lang/yo.php | 2 +- .../carbon/src/Carbon/Traits/Creator.php | 4 +- .../nesbot/carbon/src/Carbon/Traits/Date.php | 6 +- .../nesbot/carbon/src/Carbon/Traits/Mixin.php | 2 +- .../Carbon/Traits/ObjectInitialisation.php | 5 +- .../src/Carbon/Traits/Serialization.php | 13 +- .../src/Carbon/Traits/TogglableDetection.php | 35 + .../nesbot/carbon/src/Carbon/Traits/Units.php | 2 +- core/vendor/phpoption/phpoption/composer.json | 2 +- .../phpoption/src/PhpOption/LazyOption.php | 4 +- .../phpoption/src/PhpOption/None.php | 34 +- .../phpoption/src/PhpOption/Option.php | 73 +- .../phpoption/src/PhpOption/Some.php | 30 +- core/vendor/predis/predis/src/Client.php | 2 +- .../predis/predis/src/Command/Command.php | 61 +- .../predis/src/Command/CommandInterface.php | 6 + .../predis/predis/src/Command/RawCommand.php | 64 +- .../AbstractAggregateConnection.php | 30 +- .../predis/predis/src/Connection/Factory.php | 14 +- .../src/Connection/ParametersInterface.php | 2 +- .../predis/src/Connection/Resource/Stream.php | 10 +- .../Parser/Strategy/Resp3Strategy.php | 6 +- core/vendor/ramsey/uuid/composer.json | 2 +- core/vendor/symfony/console/Application.php | 6 +- .../symfony/console/Attribute/Argument.php | 4 + core/vendor/symfony/console/Attribute/Ask.php | 11 +- .../symfony/console/Attribute/Option.php | 4 + core/vendor/symfony/console/Color.php | 4 +- .../symfony/console/Debug/CliRequest.php | 8 +- .../console/Descriptor/MarkdownDescriptor.php | 2 +- .../Exception/InvalidArgumentException.php | 8 + .../Exception/InvalidOptionException.php | 8 + .../console/Formatter/OutputFormatter.php | 2 +- .../symfony/console/Helper/OutputWrapper.php | 5 +- .../symfony/console/Helper/ProcessHelper.php | 6 +- .../symfony/console/Helper/QuestionHelper.php | 16 +- .../symfony/console/Input/ArgvInput.php | 6 +- core/vendor/symfony/console/Input/Input.php | 2 +- .../symfony/console/Input/InputDefinition.php | 2 +- .../Messenger/RunCommandMessageHandler.php | 3 + .../symfony/console/Output/ConsoleOutput.php | 4 +- .../console/Output/ConsoleSectionOutput.php | 5 +- .../symfony/console/Question/Question.php | 8 +- .../symfony/console/Resources/completion.bash | 48 +- .../symfony/console/Resources/completion.fish | 9 +- .../symfony/console/Resources/completion.zsh | 34 +- .../error-handler/DebugClassLoader.php | 5 + .../symfony/error-handler/ErrorHandler.php | 5 + .../Debug/TraceableEventDispatcher.php | 14 +- .../event-dispatcher/EventDispatcher.php | 28 +- core/vendor/symfony/filesystem/Filesystem.php | 16 +- core/vendor/symfony/filesystem/Path.php | 14 +- core/vendor/symfony/finder/Finder.php | 8 +- core/vendor/symfony/finder/Gitignore.php | 33 +- .../ExcludeDirectoryFilterIterator.php | 5 +- .../Iterator/FileTypeFilterIterator.php | 2 +- .../Iterator/VcsIgnoredFilterIterator.php | 86 ++- .../http-foundation/AcceptHeaderItem.php | 2 +- .../http-foundation/BinaryFileResponse.php | 15 +- .../symfony/http-foundation/HeaderBag.php | 4 +- .../symfony/http-foundation/HeaderUtils.php | 9 +- .../symfony/http-foundation/IpUtils.php | 52 +- .../AbstractRequestRateLimiter.php | 2 +- .../symfony/http-foundation/Request.php | 62 +- .../RequestMatcher/PathRequestMatcher.php | 2 +- .../QueryParameterRequestMatcher.php | 2 +- .../symfony/http-foundation/Response.php | 4 +- .../Handler/AbstractSessionHandler.php | 8 + .../Handler/MarshallingSessionHandler.php | 17 +- .../Handler/MigratingSessionHandler.php | 8 + .../Storage/MockFileSessionStorage.php | 11 + .../Storage/Proxy/SessionHandlerProxy.php | 8 + .../CacheWarmer/CacheWarmerAggregate.php | 21 +- .../Controller/ControllerResolver.php | 2 +- .../DataCollector/DumpDataCollector.php | 52 +- .../EventListener/AbstractSessionListener.php | 9 +- .../EventListener/LocaleAwareListener.php | 29 +- .../Fragment/HIncludeFragmentRenderer.php | 2 +- .../Fragment/InlineFragmentRenderer.php | 14 +- .../http-kernel/HttpCache/HttpCache.php | 8 +- .../symfony/http-kernel/HttpCache/Store.php | 16 +- .../symfony/http-kernel/HttpKernelBrowser.php | 46 +- core/vendor/symfony/http-kernel/Kernel.php | 24 +- .../Profiler/FileProfilerStorage.php | 21 +- .../symfony/http-kernel/Profiler/Profiler.php | 2 +- core/vendor/symfony/mime/Address.php | 21 +- .../symfony/mime/Header/AbstractHeader.php | 7 +- core/vendor/symfony/mime/Header/Headers.php | 2 +- .../mime/Header/ParameterizedHeader.php | 2 +- core/vendor/symfony/mime/RawMessage.php | 2 +- core/vendor/symfony/mime/composer.json | 2 +- core/vendor/symfony/polyfill-intl-idn/Idn.php | 51 ++ .../polyfill-intl-normalizer/Normalizer.php | 3 +- .../symfony/process/Pipes/AbstractPipes.php | 16 +- core/vendor/symfony/process/Process.php | 10 +- .../RoutingResolverPass.php | 2 +- .../routing/Generator/UrlGenerator.php | 2 + .../routing/Loader/AttributeFileLoader.php | 2 +- core/vendor/symfony/routing/RouteCompiler.php | 2 +- .../service-contracts/Attribute/Required.php | 7 + .../symfony/string/AbstractUnicodeString.php | 9 +- core/vendor/symfony/string/ByteString.php | 6 +- .../string/Inflector/EnglishInflector.php | 13 +- .../translation/Command/XliffLintCommand.php | 2 +- .../translation/Dumper/PoFileDumper.php | 2 +- .../Visitor/TranslatableMessageVisitor.php | 5 +- .../translation/Loader/CsvFileLoader.php | 24 +- .../Resources/bin/translation-status.php | 6 +- .../symfony/translation/Util/XliffUtils.php | 15 +- .../symfony/var-dumper/Caster/DateCaster.php | 15 +- .../symfony/var-dumper/Caster/SplCaster.php | 32 +- .../Command/Descriptor/CliDescriptor.php | 18 +- .../Command/Descriptor/HtmlDescriptor.php | 19 +- .../symfony/var-dumper/Dumper/CliDumper.php | 23 +- core/vendor/vlucas/phpdotenv/composer.json | 6 +- .../vlucas/phpdotenv/src/Loader/Loader.php | 25 +- .../vlucas/phpdotenv/src/Loader/Resolver.php | 20 +- .../phpdotenv/src/Parser/EntryParser.php | 178 +++-- .../vlucas/phpdotenv/src/Parser/Lexer.php | 2 +- .../vlucas/phpdotenv/src/Parser/Lines.php | 17 +- .../vlucas/phpdotenv/src/Parser/Parser.php | 25 +- .../vlucas/phpdotenv/src/Parser/Value.php | 13 + .../src/Repository/Adapter/ApacheAdapter.php | 3 +- .../src/Repository/Adapter/ArrayAdapter.php | 3 +- .../Repository/Adapter/EnvConstAdapter.php | 28 +- .../src/Repository/Adapter/PutenvAdapter.php | 15 +- .../Repository/Adapter/ServerConstAdapter.php | 28 +- .../src/Repository/RepositoryBuilder.php | 10 +- .../vlucas/phpdotenv/src/Store/FileStore.php | 2 +- .../phpdotenv/src/Store/StringStore.php | 4 + .../vlucas/phpdotenv/src/Util/Regex.php | 33 +- core/vendor/vlucas/phpdotenv/src/Util/Str.php | 35 +- .../vendor/vlucas/phpdotenv/src/Validator.php | 9 + 229 files changed, 4413 insertions(+), 1785 deletions(-) create mode 100644 core/vendor/doctrine/lexer/SECURITY.md create mode 100644 core/vendor/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php create mode 100644 core/vendor/monolog/monolog/src/Monolog/Formatter/WrappingFormatterInterface.php create mode 100644 core/vendor/monolog/monolog/src/Monolog/Handler/FrankenPhpHandler.php create mode 100644 core/vendor/monolog/monolog/src/Monolog/Handler/LogMonsterHandler.php create mode 100644 core/vendor/nesbot/carbon/src/Carbon/Exceptions/PeriodFilterSafetyException.php create mode 100644 core/vendor/nesbot/carbon/src/Carbon/Traits/TogglableDetection.php diff --git a/core/composer.lock b/core/composer.lock index 2b6b3615a2..45d63520ff 100644 --- a/core/composer.lock +++ b/core/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b52e2e83b0bbc059cf72183cd8044b7e", + "content-hash": "395bff4947dbc25a681102a9047000ec", "packages": [ { "name": "blade-ui-kit/blade-icons", @@ -149,16 +149,16 @@ }, { "name": "carbonphp/carbon-doctrine-types", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", - "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d" + "reference": "5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/18ba5ddfec8976260ead6e866180bd5d2f71aa1d", - "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d", + "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc", + "reference": "5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc", "shasum": "" }, "require": { @@ -173,6 +173,11 @@ "phpunit/phpunit": "^10.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { "psr-4": { "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" @@ -198,7 +203,7 @@ ], "support": { "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", - "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.0" + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.1" }, "funding": [ { @@ -214,20 +219,20 @@ "type": "tidelift" } ], - "time": "2024-02-09T16:56:22+00:00" + "time": "2026-09-06T14:11:38+00:00" }, { "name": "composer/ca-bundle", - "version": "1.5.13", + "version": "1.5.14", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "c008272789979f709f7fcb32c2ecf1d2db5e84e5" + "reference": "0c8abba0634f637bd78c4e451981da368d403463" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/c008272789979f709f7fcb32c2ecf1d2db5e84e5", - "reference": "c008272789979f709f7fcb32c2ecf1d2db5e84e5", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0c8abba0634f637bd78c4e451981da368d403463", + "reference": "0c8abba0634f637bd78c4e451981da368d403463", "shasum": "" }, "require": { @@ -274,7 +279,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.13" + "source": "https://github.com/composer/ca-bundle/tree/1.5.14" }, "funding": [ { @@ -286,7 +291,7 @@ "type": "github" } ], - "time": "2026-07-18T12:35:13+00:00" + "time": "2026-08-21T14:57:29+00:00" }, { "name": "composer/class-map-generator", @@ -1114,27 +1119,25 @@ }, { "name": "doctrine/lexer", - "version": "3.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd" + "reference": "e96fe45e92a54233726014a7cc7340abf29bb14c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", - "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/e96fe45e92a54233726014a7cc7340abf29bb14c", + "reference": "e96fe45e92a54233726014a7cc7340abf29bb14c", "shasum": "" }, "require": { "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^12", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^10.5", - "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^5.21" + "doctrine/coding-standard": "^14", + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^10.5.58 || ^12.5.4" }, "type": "library", "autoload": { @@ -1171,7 +1174,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/3.0.1" + "source": "https://github.com/doctrine/lexer/tree/3.0.2" }, "funding": [ { @@ -1187,7 +1190,7 @@ "type": "tidelift" } ], - "time": "2024-02-05T11:56:58+00:00" + "time": "2026-06-14T20:44:06+00:00" }, { "name": "dragonmantank/cron-expression", @@ -1465,24 +1468,24 @@ }, { "name": "graham-campbell/result-type", - "version": "v1.1.4", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b" + "reference": "adccca3324eece92ca35463648c12b9e6293c05b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/e01f4a821471308ba86aa202fed6698b6b695e3b", - "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/adccca3324eece92ca35463648c12b9e6293c05b", + "reference": "adccca3324eece92ca35463648c12b9e6293c05b", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9.5" + "phpoption/phpoption": "^1.10" }, "require-dev": { - "phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7" + "phpunit/phpunit": "^8.5.52 || ^9.6.34 || ^10.5.63 || ^11.5.55 || ^12.5.14" }, "type": "library", "autoload": { @@ -1511,7 +1514,7 @@ ], "support": { "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.4" + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.2.0" }, "funding": [ { @@ -1523,26 +1526,26 @@ "type": "tidelift" } ], - "time": "2025-12-27T19:43:20+00:00" + "time": "2026-08-24T09:06:52+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "7.15.3", + "version": "7.15.5", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc" + "reference": "ee80339fd9177ba44c49cdb653ff02a4d1106b9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc", - "reference": "ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee80339fd9177ba44c49cdb653ff02a4d1106b9a", + "reference": "ee80339fd9177ba44c49cdb653ff02a4d1106b9a", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^2.5.2", - "guzzlehttp/psr7": "^2.13", + "guzzlehttp/promises": "^2.5.3", + "guzzlehttp/psr7": "^2.13.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.5 || ^3.0", @@ -1635,7 +1638,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.15.3" + "source": "https://github.com/guzzle/guzzle/tree/7.15.5" }, "funding": [ { @@ -1651,20 +1654,20 @@ "type": "tidelift" } ], - "time": "2026-08-05T19:48:21+00:00" + "time": "2026-08-24T09:21:06+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.5.2", + "version": "2.5.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "2823687acff28b2dbe67b2508a6b300e2c3fa4ce" + "reference": "cde49999552d185d64715fe9c1f77a2aadd2f9f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/2823687acff28b2dbe67b2508a6b300e2c3fa4ce", - "reference": "2823687acff28b2dbe67b2508a6b300e2c3fa4ce", + "url": "https://api.github.com/repos/guzzle/promises/zipball/cde49999552d185d64715fe9c1f77a2aadd2f9f1", + "reference": "cde49999552d185d64715fe9c1f77a2aadd2f9f1", "shasum": "" }, "require": { @@ -1719,7 +1722,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.5.2" + "source": "https://github.com/guzzle/promises/tree/2.5.3" }, "funding": [ { @@ -1735,20 +1738,20 @@ "type": "tidelift" } ], - "time": "2026-08-05T19:30:54+00:00" + "time": "2026-08-24T09:11:28+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.13.0", + "version": "2.13.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "dad89620b7a6edb60c15858442eb2e408b45d8f4" + "reference": "95e7828100de18b4e269fb1703be530082d5166d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/dad89620b7a6edb60c15858442eb2e408b45d8f4", - "reference": "dad89620b7a6edb60c15858442eb2e408b45d8f4", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/95e7828100de18b4e269fb1703be530082d5166d", + "reference": "95e7828100de18b4e269fb1703be530082d5166d", "shasum": "" }, "require": { @@ -1838,7 +1841,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.13.0" + "source": "https://github.com/guzzle/psr7/tree/2.13.1" }, "funding": [ { @@ -1854,20 +1857,20 @@ "type": "tidelift" } ], - "time": "2026-07-16T22:23:49+00:00" + "time": "2026-08-24T09:13:11+00:00" }, { "name": "guzzlehttp/uri-template", - "version": "v1.0.10", + "version": "v1.0.11", "source": { "type": "git", "url": "https://github.com/guzzle/uri-template.git", - "reference": "f6c24c21f42b990e9a58912b332d0874df6ba839" + "reference": "d0058dccf4299d70c3d9da3378b8908b32780368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/uri-template/zipball/f6c24c21f42b990e9a58912b332d0874df6ba839", - "reference": "f6c24c21f42b990e9a58912b332d0874df6ba839", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/d0058dccf4299d70c3d9da3378b8908b32780368", + "reference": "d0058dccf4299d70c3d9da3378b8908b32780368", "shasum": "" }, "require": { @@ -1924,7 +1927,7 @@ ], "support": { "issues": "https://github.com/guzzle/uri-template/issues", - "source": "https://github.com/guzzle/uri-template/tree/v1.0.10" + "source": "https://github.com/guzzle/uri-template/tree/v1.0.11" }, "funding": [ { @@ -1940,11 +1943,11 @@ "type": "tidelift" } ], - "time": "2026-07-17T13:53:03+00:00" + "time": "2026-08-24T09:15:32+00:00" }, { "name": "illuminate/bus", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", @@ -1997,7 +2000,7 @@ }, { "name": "illuminate/cache", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/cache.git", @@ -2059,7 +2062,7 @@ }, { "name": "illuminate/collections", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", @@ -2119,7 +2122,7 @@ }, { "name": "illuminate/conditionable", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", @@ -2165,7 +2168,7 @@ }, { "name": "illuminate/config", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/config.git", @@ -2213,16 +2216,16 @@ }, { "name": "illuminate/console", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/console.git", - "reference": "ce37b63fb90f036dbd34263d84725f79c6d6f221" + "reference": "29f41bd7e07c14c04cb5acfaf9dc103adf2084aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/console/zipball/ce37b63fb90f036dbd34263d84725f79c6d6f221", - "reference": "ce37b63fb90f036dbd34263d84725f79c6d6f221", + "url": "https://api.github.com/repos/illuminate/console/zipball/29f41bd7e07c14c04cb5acfaf9dc103adf2084aa", + "reference": "29f41bd7e07c14c04cb5acfaf9dc103adf2084aa", "shasum": "" }, "require": { @@ -2275,11 +2278,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2026-07-29T14:35:23+00:00" + "time": "2026-09-08T13:37:54+00:00" }, { "name": "illuminate/container", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", @@ -2341,7 +2344,7 @@ }, { "name": "illuminate/contracts", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -2389,16 +2392,16 @@ }, { "name": "illuminate/database", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "6d539459fb55732a13e7f962afeffa9dca2a1cce" + "reference": "499f5112164d5bc4b744e0ac259b44e0a4c8aacc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/6d539459fb55732a13e7f962afeffa9dca2a1cce", - "reference": "6d539459fb55732a13e7f962afeffa9dca2a1cce", + "url": "https://api.github.com/repos/illuminate/database/zipball/499f5112164d5bc4b744e0ac259b44e0a4c8aacc", + "reference": "499f5112164d5bc4b744e0ac259b44e0a4c8aacc", "shasum": "" }, "require": { @@ -2458,11 +2461,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2026-08-14T15:00:48+00:00" + "time": "2026-09-06T21:11:25+00:00" }, { "name": "illuminate/events", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", @@ -2517,7 +2520,7 @@ }, { "name": "illuminate/filesystem", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/filesystem.git", @@ -2584,16 +2587,16 @@ }, { "name": "illuminate/http", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/http.git", - "reference": "5f4f82ed0ed550a01f5d95c4ddbbad409fb0d560" + "reference": "a91f70083082bd6d466ea229dbbdfc48c553621c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/http/zipball/5f4f82ed0ed550a01f5d95c4ddbbad409fb0d560", - "reference": "5f4f82ed0ed550a01f5d95c4ddbbad409fb0d560", + "url": "https://api.github.com/repos/illuminate/http/zipball/a91f70083082bd6d466ea229dbbdfc48c553621c", + "reference": "a91f70083082bd6d466ea229dbbdfc48c553621c", "shasum": "" }, "require": { @@ -2642,11 +2645,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2026-08-06T14:28:07+00:00" + "time": "2026-08-24T22:07:52+00:00" }, { "name": "illuminate/log", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/log.git", @@ -2699,7 +2702,7 @@ }, { "name": "illuminate/macroable", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -2745,7 +2748,7 @@ }, { "name": "illuminate/pagination", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/pagination.git", @@ -2795,7 +2798,7 @@ }, { "name": "illuminate/pipeline", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", @@ -2847,7 +2850,7 @@ }, { "name": "illuminate/queue", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/queue.git", @@ -2914,7 +2917,7 @@ }, { "name": "illuminate/redis", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/redis.git", @@ -2968,7 +2971,7 @@ }, { "name": "illuminate/reflection", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/reflection.git", @@ -3019,7 +3022,7 @@ }, { "name": "illuminate/routing", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/routing.git", @@ -3085,7 +3088,7 @@ }, { "name": "illuminate/session", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/session.git", @@ -3142,7 +3145,7 @@ }, { "name": "illuminate/support", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", @@ -3222,7 +3225,7 @@ }, { "name": "illuminate/translation", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/translation.git", @@ -3273,7 +3276,7 @@ }, { "name": "illuminate/validation", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/validation.git", @@ -3336,7 +3339,7 @@ }, { "name": "illuminate/view", - "version": "v12.67.0", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/illuminate/view.git", @@ -3447,19 +3450,20 @@ }, { "name": "justinrainbow/json-schema", - "version": "6.10.0", + "version": "6.12.0", "source": { "type": "git", "url": "https://github.com/jsonrainbow/json-schema.git", - "reference": "8b1308a9d7bdbdb20ce87ef920f82b4564bb2d33" + "reference": "8ef236a1a37df364b518b7411a4b5bb95b040d79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/8b1308a9d7bdbdb20ce87ef920f82b4564bb2d33", - "reference": "8b1308a9d7bdbdb20ce87ef920f82b4564bb2d33", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/8ef236a1a37df364b518b7411a4b5bb95b040d79", + "reference": "8ef236a1a37df364b518b7411a4b5bb95b040d79", "shasum": "" }, "require": { + "ext-filter": "*", "ext-json": "*", "marc-mabe/php-enum": "^4.4", "php": "^7.2 || ^8.0" @@ -3492,20 +3496,9 @@ ], "authors": [ { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" + "name": "Danny van der Sluijs", + "email": "danny.vandersluijs@icloud.com", + "role": "Maintainer" } ], "description": "A library to validate a json schema.", @@ -3516,22 +3509,22 @@ ], "support": { "issues": "https://github.com/jsonrainbow/json-schema/issues", - "source": "https://github.com/jsonrainbow/json-schema/tree/6.10.0" + "source": "https://github.com/jsonrainbow/json-schema/tree/6.12.0" }, - "time": "2026-06-16T20:50:26+00:00" + "time": "2026-09-04T12:54:20+00:00" }, { "name": "laravel/prompts", - "version": "v0.3.23", + "version": "v0.3.24", "source": { "type": "git", "url": "https://github.com/laravel/prompts.git", - "reference": "b7b4c35e5bc47450f6b6238c6cc9c47ba19b2221" + "reference": "5d3cdef29e93ca3b62b1871359db3078cd99908b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/prompts/zipball/b7b4c35e5bc47450f6b6238c6cc9c47ba19b2221", - "reference": "b7b4c35e5bc47450f6b6238c6cc9c47ba19b2221", + "url": "https://api.github.com/repos/laravel/prompts/zipball/5d3cdef29e93ca3b62b1871359db3078cd99908b", + "reference": "5d3cdef29e93ca3b62b1871359db3078cd99908b", "shasum": "" }, "require": { @@ -3575,22 +3568,22 @@ "description": "Add beautiful and user-friendly forms to your command-line applications.", "support": { "issues": "https://github.com/laravel/prompts/issues", - "source": "https://github.com/laravel/prompts/tree/v0.3.23" + "source": "https://github.com/laravel/prompts/tree/v0.3.24" }, - "time": "2026-08-11T18:58:24+00:00" + "time": "2026-08-20T12:55:36+00:00" }, { "name": "laravel/serializable-closure", - "version": "v2.0.15", + "version": "v2.0.16", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "dccd8bcb851bb03fcc005df650b708b57cc52661" + "reference": "7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/dccd8bcb851bb03fcc005df650b708b57cc52661", - "reference": "dccd8bcb851bb03fcc005df650b708b57cc52661", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed", + "reference": "7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed", "shasum": "" }, "require": { @@ -3638,20 +3631,20 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2026-07-21T16:49:22+00:00" + "time": "2026-08-18T20:28:54+00:00" }, { "name": "league/flysystem", - "version": "3.35.2", + "version": "3.36.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "b277b5dc3d56650b68904117124e79c851e12376" + "reference": "f7fb152932f30072d573510cbd4dd657d6475b25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/b277b5dc3d56650b68904117124e79c851e12376", - "reference": "b277b5dc3d56650b68904117124e79c851e12376", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f7fb152932f30072d573510cbd4dd657d6475b25", + "reference": "f7fb152932f30072d573510cbd4dd657d6475b25", "shasum": "" }, "require": { @@ -3719,22 +3712,22 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.35.2" + "source": "https://github.com/thephpleague/flysystem/tree/3.36.0" }, - "time": "2026-07-06T14:42:07+00:00" + "time": "2026-09-02T08:00:27+00:00" }, { "name": "league/flysystem-local", - "version": "3.31.0", + "version": "3.35.3", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-local.git", - "reference": "2f669db18a4c20c755c2bb7d3a7b0b2340488079" + "reference": "a099b24dce160f3b2239043d13d47c4a1a214ea4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/2f669db18a4c20c755c2bb7d3a7b0b2340488079", - "reference": "2f669db18a4c20c755c2bb7d3a7b0b2340488079", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/a099b24dce160f3b2239043d13d47c4a1a214ea4", + "reference": "a099b24dce160f3b2239043d13d47c4a1a214ea4", "shasum": "" }, "require": { @@ -3768,9 +3761,9 @@ "local" ], "support": { - "source": "https://github.com/thephpleague/flysystem-local/tree/3.31.0" + "source": "https://github.com/thephpleague/flysystem-local/tree/3.35.3" }, - "time": "2026-01-23T15:30:45+00:00" + "time": "2026-08-12T13:29:21+00:00" }, { "name": "league/mime-type-detection", @@ -3903,16 +3896,16 @@ }, { "name": "monolog/monolog", - "version": "3.10.0", + "version": "3.12.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0" + "reference": "72c534fc0ab181ef52d92a68382318631e301608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/b321dd6749f0bf7189444158a3ce785cc16d69b0", - "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/72c534fc0ab181ef52d92a68382318631e301608", + "reference": "72c534fc0ab181ef52d92a68382318631e301608", "shasum": "" }, "require": { @@ -3938,6 +3931,7 @@ "phpstan/phpstan-strict-rules": "^2", "phpunit/phpunit": "^10.5.17 || ^11.0.7", "predis/predis": "^1.1 || ^2", + "psr/clock": "^1.0", "rollbar/rollbar": "^4.0", "ruflin/elastica": "^7 || ^8", "symfony/mailer": "^5.4 || ^6", @@ -3956,6 +3950,7 @@ "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "psr/clock": "Required to pass a clock to the Logger and control the timestamp of log records", "rollbar/rollbar": "Allow sending log messages to Rollbar", "ruflin/elastica": "Allow sending log messages to an Elastic Search server" }, @@ -3990,7 +3985,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.10.0" + "source": "https://github.com/Seldaek/monolog/tree/3.12.0" }, "funding": [ { @@ -4002,20 +3997,20 @@ "type": "tidelift" } ], - "time": "2026-01-02T08:56:05+00:00" + "time": "2026-09-09T08:34:20+00:00" }, { "name": "nesbot/carbon", - "version": "3.13.2", + "version": "3.14.0", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon.git", - "reference": "a1c54919f5fff9800cd03c32bd01defd5a4061cb" + "reference": "0023eaa2c9110e47446dd512a263c69c40cd41f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/a1c54919f5fff9800cd03c32bd01defd5a4061cb", - "reference": "a1c54919f5fff9800cd03c32bd01defd5a4061cb", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/0023eaa2c9110e47446dd512a263c69c40cd41f2", + "reference": "0023eaa2c9110e47446dd512a263c69c40cd41f2", "shasum": "" }, "require": { @@ -4107,7 +4102,7 @@ "type": "tidelift" } ], - "time": "2026-08-08T11:40:35+00:00" + "time": "2026-09-12T20:45:19+00:00" }, { "name": "nunomaduro/termwind", @@ -4280,16 +4275,16 @@ }, { "name": "phpoption/phpoption", - "version": "1.9.5", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "75365b91986c2405cf5e1e012c5595cd487a98be" + "reference": "67b192b6a42ec03944b972d6e633ddec78ad2c6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/75365b91986c2405cf5e1e012c5595cd487a98be", - "reference": "75365b91986c2405cf5e1e012c5595cd487a98be", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/67b192b6a42ec03944b972d6e633ddec78ad2c6d", + "reference": "67b192b6a42ec03944b972d6e633ddec78ad2c6d", "shasum": "" }, "require": { @@ -4297,7 +4292,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.44 || ^9.6.25 || ^10.5.53 || ^11.5.34" + "phpunit/phpunit": "^8.5.54 || ^9.6.36 || ^10.5.64 || ^11.5.56 || ^12.5.33" }, "type": "library", "extra": { @@ -4339,7 +4334,7 @@ ], "support": { "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.5" + "source": "https://github.com/schmittjoh/php-option/tree/1.10.0" }, "funding": [ { @@ -4351,20 +4346,20 @@ "type": "tidelift" } ], - "time": "2025-12-27T19:41:33+00:00" + "time": "2026-08-24T00:54:40+00:00" }, { "name": "predis/predis", - "version": "v3.6.0", + "version": "v3.6.1", "source": { "type": "git", "url": "https://github.com/predis/predis.git", - "reference": "2ff20c08bb63697245ffee3f198d1673086c302d" + "reference": "e2db96312ecf57a01a3477bf192d1ebc0ad7e9fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/predis/predis/zipball/2ff20c08bb63697245ffee3f198d1673086c302d", - "reference": "2ff20c08bb63697245ffee3f198d1673086c302d", + "url": "https://api.github.com/repos/predis/predis/zipball/e2db96312ecf57a01a3477bf192d1ebc0ad7e9fb", + "reference": "e2db96312ecf57a01a3477bf192d1ebc0ad7e9fb", "shasum": "" }, "require": { @@ -4406,7 +4401,7 @@ ], "support": { "issues": "https://github.com/predis/predis/issues", - "source": "https://github.com/predis/predis/tree/v3.6.0" + "source": "https://github.com/predis/predis/tree/v3.6.1" }, "funding": [ { @@ -4414,7 +4409,7 @@ "type": "github" } ], - "time": "2026-08-14T23:07:56+00:00" + "time": "2026-09-17T20:41:00+00:00" }, { "name": "psr/cache", @@ -4999,20 +4994,20 @@ }, { "name": "ramsey/uuid", - "version": "4.9.3", + "version": "4.9.4", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "1df15849d00943a67d677dc9cfd80795f038c9f8" + "reference": "75d73f48d02797c2c285a7e9f348fadc0102ffe2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/1df15849d00943a67d677dc9cfd80795f038c9f8", - "reference": "1df15849d00943a67d677dc9cfd80795f038c9f8", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/75d73f48d02797c2c285a7e9f348fadc0102ffe2", + "reference": "75d73f48d02797c2c285a7e9f348fadc0102ffe2", "shasum": "" }, "require": { - "brick/math": ">=0.8.16 <=0.18", + "brick/math": "^0.8.16 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14 || ^0.15 || ^0.16 || ^0.17 || ^0.18 || ^0.19 || ^0.20 || ^1.0", "php": "^8.0", "ramsey/collection": "^1.2 || ^2.0" }, @@ -5071,9 +5066,9 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.9.3" + "source": "https://github.com/ramsey/uuid/tree/4.9.4" }, - "time": "2026-06-18T03:57:49+00:00" + "time": "2026-09-16T11:39:30+00:00" }, { "name": "react/promise", @@ -6007,16 +6002,16 @@ }, { "name": "symfony/console", - "version": "v7.4.16", + "version": "v7.4.19", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f4c69c9aed03abf933b294257d618bdd9b30a06d" + "reference": "3a1973458b153f566a8d7499bc06ece323d60063" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f4c69c9aed03abf933b294257d618bdd9b30a06d", - "reference": "f4c69c9aed03abf933b294257d618bdd9b30a06d", + "url": "https://api.github.com/repos/symfony/console/zipball/3a1973458b153f566a8d7499bc06ece323d60063", + "reference": "3a1973458b153f566a8d7499bc06ece323d60063", "shasum": "" }, "require": { @@ -6081,7 +6076,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.4.16" + "source": "https://github.com/symfony/console/tree/v7.4.19" }, "funding": [ { @@ -6101,7 +6096,7 @@ "type": "tidelift" } ], - "time": "2026-07-31T12:37:14+00:00" + "time": "2026-09-13T10:38:41+00:00" }, { "name": "symfony/deprecation-contracts", @@ -6176,16 +6171,16 @@ }, { "name": "symfony/error-handler", - "version": "v7.4.15", + "version": "v7.4.17", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "d49f6a19f326db41ae7103bdc38e3eb35a791261" + "reference": "8373921e231e190a88e2ad526951bbaa791576fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/d49f6a19f326db41ae7103bdc38e3eb35a791261", - "reference": "d49f6a19f326db41ae7103bdc38e3eb35a791261", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/8373921e231e190a88e2ad526951bbaa791576fa", + "reference": "8373921e231e190a88e2ad526951bbaa791576fa", "shasum": "" }, "require": { @@ -6234,7 +6229,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v7.4.15" + "source": "https://github.com/symfony/error-handler/tree/v7.4.17" }, "funding": [ { @@ -6254,20 +6249,20 @@ "type": "tidelift" } ], - "time": "2026-07-21T15:13:06+00:00" + "time": "2026-08-21T17:40:08+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v7.4.15", + "version": "v7.4.17", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "336e7f3b9e95aba04f93ea9143920c2186abfbb9" + "reference": "d269974ee93c61d03620ffee358355bfdb471d66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/336e7f3b9e95aba04f93ea9143920c2186abfbb9", - "reference": "336e7f3b9e95aba04f93ea9143920c2186abfbb9", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d269974ee93c61d03620ffee358355bfdb471d66", + "reference": "d269974ee93c61d03620ffee358355bfdb471d66", "shasum": "" }, "require": { @@ -6319,7 +6314,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v7.4.15" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.4.17" }, "funding": [ { @@ -6339,7 +6334,7 @@ "type": "tidelift" } ], - "time": "2026-07-21T15:13:06+00:00" + "time": "2026-08-21T17:40:08+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -6423,16 +6418,16 @@ }, { "name": "symfony/filesystem", - "version": "v7.4.15", + "version": "v7.4.18", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "ff16a16bf87fdf264638b8f6995b3515975e3c79" + "reference": "90d412aa5277c6819db39e7605aa46b1019e3232" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/ff16a16bf87fdf264638b8f6995b3515975e3c79", - "reference": "ff16a16bf87fdf264638b8f6995b3515975e3c79", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/90d412aa5277c6819db39e7605aa46b1019e3232", + "reference": "90d412aa5277c6819db39e7605aa46b1019e3232", "shasum": "" }, "require": { @@ -6469,7 +6464,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.4.15" + "source": "https://github.com/symfony/filesystem/tree/v7.4.18" }, "funding": [ { @@ -6489,20 +6484,20 @@ "type": "tidelift" } ], - "time": "2026-07-22T07:36:05+00:00" + "time": "2026-08-23T10:03:40+00:00" }, { "name": "symfony/finder", - "version": "v7.4.14", + "version": "v7.4.19", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "13b38720174286f55d1761152b575a8d1436fc25" + "reference": "1b900bc6ae5ba60c5eee69c11ba44566190576fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/13b38720174286f55d1761152b575a8d1436fc25", - "reference": "13b38720174286f55d1761152b575a8d1436fc25", + "url": "https://api.github.com/repos/symfony/finder/zipball/1b900bc6ae5ba60c5eee69c11ba44566190576fe", + "reference": "1b900bc6ae5ba60c5eee69c11ba44566190576fe", "shasum": "" }, "require": { @@ -6537,7 +6532,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.4.14" + "source": "https://github.com/symfony/finder/tree/v7.4.19" }, "funding": [ { @@ -6557,20 +6552,20 @@ "type": "tidelift" } ], - "time": "2026-06-27T08:31:18+00:00" + "time": "2026-09-10T19:14:10+00:00" }, { "name": "symfony/http-foundation", - "version": "v7.4.16", + "version": "v7.4.19", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "b676451bb638e99a7d34d8a2be90406822e301eb" + "reference": "f7b953be7801974a5a0685e1228bbc3b12b35936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b676451bb638e99a7d34d8a2be90406822e301eb", - "reference": "b676451bb638e99a7d34d8a2be90406822e301eb", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/f7b953be7801974a5a0685e1228bbc3b12b35936", + "reference": "f7b953be7801974a5a0685e1228bbc3b12b35936", "shasum": "" }, "require": { @@ -6619,7 +6614,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v7.4.16" + "source": "https://github.com/symfony/http-foundation/tree/v7.4.19" }, "funding": [ { @@ -6639,20 +6634,20 @@ "type": "tidelift" } ], - "time": "2026-08-07T11:50:27+00:00" + "time": "2026-09-14T17:41:17+00:00" }, { "name": "symfony/http-kernel", - "version": "v7.4.16", + "version": "v7.4.19", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "f5e728670fa2218ae8be8ea91f2b44b7d6e5304c" + "reference": "683507424cc84ca85ac1551adb609b6b98216667" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f5e728670fa2218ae8be8ea91f2b44b7d6e5304c", - "reference": "f5e728670fa2218ae8be8ea91f2b44b7d6e5304c", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/683507424cc84ca85ac1551adb609b6b98216667", + "reference": "683507424cc84ca85ac1551adb609b6b98216667", "shasum": "" }, "require": { @@ -6738,7 +6733,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v7.4.16" + "source": "https://github.com/symfony/http-kernel/tree/v7.4.19" }, "funding": [ { @@ -6758,20 +6753,20 @@ "type": "tidelift" } ], - "time": "2026-08-07T18:00:13+00:00" + "time": "2026-09-15T07:09:35+00:00" }, { "name": "symfony/mime", - "version": "v7.4.16", + "version": "v7.4.19", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "20094b76a7106dbe978d31cd3bd7aa1ed248d0e5" + "reference": "f8ac7d0a800bcabbcd1f7de56594cf05e6cd5693" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/20094b76a7106dbe978d31cd3bd7aa1ed248d0e5", - "reference": "20094b76a7106dbe978d31cd3bd7aa1ed248d0e5", + "url": "https://api.github.com/repos/symfony/mime/zipball/f8ac7d0a800bcabbcd1f7de56594cf05e6cd5693", + "reference": "f8ac7d0a800bcabbcd1f7de56594cf05e6cd5693", "shasum": "" }, "require": { @@ -6795,7 +6790,7 @@ "symfony/process": "^6.4|^7.0|^8.0", "symfony/property-access": "^6.4|^7.0|^8.0", "symfony/property-info": "^6.4|^7.0|^8.0", - "symfony/serializer": "^6.4.3|^7.0.3|^8.0" + "symfony/serializer": "^6.4.44|^7.4.17|^8.1.5" }, "type": "library", "autoload": { @@ -6827,7 +6822,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v7.4.16" + "source": "https://github.com/symfony/mime/tree/v7.4.19" }, "funding": [ { @@ -6847,7 +6842,7 @@ "type": "tidelift" } ], - "time": "2026-08-07T14:56:57+00:00" + "time": "2026-09-04T10:45:44+00:00" }, { "name": "symfony/polyfill-ctype", @@ -7016,16 +7011,16 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.38.1", + "version": "v1.42.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "dc21118016c039a66235cf93d96b435ffb282412" + "reference": "51b5ff5ba85452b31ec6f55490b08148612339d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/dc21118016c039a66235cf93d96b435ffb282412", - "reference": "dc21118016c039a66235cf93d96b435ffb282412", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/51b5ff5ba85452b31ec6f55490b08148612339d9", + "reference": "51b5ff5ba85452b31ec6f55490b08148612339d9", "shasum": "" }, "require": { @@ -7079,7 +7074,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.38.1" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.42.0" }, "funding": [ { @@ -7099,20 +7094,20 @@ "type": "tidelift" } ], - "time": "2026-05-25T15:22:23+00:00" + "time": "2026-08-24T10:51:20+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.38.0", + "version": "v1.42.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b" + "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/2d446c214bdbe5b71bde5011b060a05fece3ae6b", - "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/aa20edea75bd9c48cfecc8360922e5a6e5c44502", + "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502", "shasum": "" }, "require": { @@ -7164,7 +7159,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.38.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.42.0" }, "funding": [ { @@ -7184,7 +7179,7 @@ "type": "tidelift" } ], - "time": "2026-05-25T13:48:31+00:00" + "time": "2026-08-07T06:33:24+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -7433,16 +7428,16 @@ }, { "name": "symfony/process", - "version": "v7.4.13", + "version": "v7.4.19", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "f5804be144caceb570f6747519999636b664f24c" + "reference": "ed0ae095b86994d370d5791612e55984f15aa30e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/f5804be144caceb570f6747519999636b664f24c", - "reference": "f5804be144caceb570f6747519999636b664f24c", + "url": "https://api.github.com/repos/symfony/process/zipball/ed0ae095b86994d370d5791612e55984f15aa30e", + "reference": "ed0ae095b86994d370d5791612e55984f15aa30e", "shasum": "" }, "require": { @@ -7474,7 +7469,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.4.13" + "source": "https://github.com/symfony/process/tree/v7.4.19" }, "funding": [ { @@ -7494,20 +7489,20 @@ "type": "tidelift" } ], - "time": "2026-05-23T16:05:06+00:00" + "time": "2026-09-02T12:38:34+00:00" }, { "name": "symfony/routing", - "version": "v7.4.15", + "version": "v7.4.18", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "80c0a93d3f8e7499f716204a1fb38ead942a7a2b" + "reference": "ddd558991e98f693ae6bf5063cc1b0362c6bbec3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/80c0a93d3f8e7499f716204a1fb38ead942a7a2b", - "reference": "80c0a93d3f8e7499f716204a1fb38ead942a7a2b", + "url": "https://api.github.com/repos/symfony/routing/zipball/ddd558991e98f693ae6bf5063cc1b0362c6bbec3", + "reference": "ddd558991e98f693ae6bf5063cc1b0362c6bbec3", "shasum": "" }, "require": { @@ -7559,7 +7554,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v7.4.15" + "source": "https://github.com/symfony/routing/tree/v7.4.18" }, "funding": [ { @@ -7579,20 +7574,20 @@ "type": "tidelift" } ], - "time": "2026-07-21T15:13:06+00:00" + "time": "2026-08-17T13:12:36+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.7.1", + "version": "v3.7.3", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0" + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/c0a284bab1ed8aa0417e3d69250ab437739563a0", - "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", "shasum": "" }, "require": { @@ -7646,7 +7641,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.7.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.7.3" }, "funding": [ { @@ -7666,20 +7661,20 @@ "type": "tidelift" } ], - "time": "2026-06-16T09:55:08+00:00" + "time": "2026-07-27T15:39:01+00:00" }, { "name": "symfony/string", - "version": "v7.4.15", + "version": "v7.4.19", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "e394af32256bf9e7bf80849d95e589167c10097b" + "reference": "02731ce2bd26514bec9efc0baef2cd0b0cf67f46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/e394af32256bf9e7bf80849d95e589167c10097b", - "reference": "e394af32256bf9e7bf80849d95e589167c10097b", + "url": "https://api.github.com/repos/symfony/string/zipball/02731ce2bd26514bec9efc0baef2cd0b0cf67f46", + "reference": "02731ce2bd26514bec9efc0baef2cd0b0cf67f46", "shasum": "" }, "require": { @@ -7737,7 +7732,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.4.15" + "source": "https://github.com/symfony/string/tree/v7.4.19" }, "funding": [ { @@ -7757,20 +7752,20 @@ "type": "tidelift" } ], - "time": "2026-07-28T07:33:02+00:00" + "time": "2026-09-11T14:46:58+00:00" }, { "name": "symfony/translation", - "version": "v7.4.16", + "version": "v7.4.17", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "501e0ff4553c744209ca1a68790d8a4541563710" + "reference": "2ee1e4a3b32a528a642babe041ff7c440b213b4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/501e0ff4553c744209ca1a68790d8a4541563710", - "reference": "501e0ff4553c744209ca1a68790d8a4541563710", + "url": "https://api.github.com/repos/symfony/translation/zipball/2ee1e4a3b32a528a642babe041ff7c440b213b4b", + "reference": "2ee1e4a3b32a528a642babe041ff7c440b213b4b", "shasum": "" }, "require": { @@ -7837,7 +7832,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v7.4.16" + "source": "https://github.com/symfony/translation/tree/v7.4.17" }, "funding": [ { @@ -7857,7 +7852,7 @@ "type": "tidelift" } ], - "time": "2026-07-30T12:37:26+00:00" + "time": "2026-08-21T17:40:08+00:00" }, { "name": "symfony/translation-contracts", @@ -7943,16 +7938,16 @@ }, { "name": "symfony/var-dumper", - "version": "v7.4.15", + "version": "v7.4.18", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "04ba4add636a95ff437af3a5a9499bb1d6c6d4bd" + "reference": "e088da50b813f32473a76871616cbb8fa54653a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/04ba4add636a95ff437af3a5a9499bb1d6c6d4bd", - "reference": "04ba4add636a95ff437af3a5a9499bb1d6c6d4bd", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e088da50b813f32473a76871616cbb8fa54653a8", + "reference": "e088da50b813f32473a76871616cbb8fa54653a8", "shasum": "" }, "require": { @@ -8006,7 +8001,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v7.4.15" + "source": "https://github.com/symfony/var-dumper/tree/v7.4.18" }, "funding": [ { @@ -8026,7 +8021,7 @@ "type": "tidelift" } ], - "time": "2026-07-21T15:13:06+00:00" + "time": "2026-08-30T20:10:52+00:00" }, { "name": "tracy/tracy", @@ -8110,23 +8105,23 @@ }, { "name": "vlucas/phpdotenv", - "version": "v5.6.4", + "version": "v5.7.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "416df702837983f8d5ff48c9c3fee4f5f57b980b" + "reference": "301c07936b16d88628b126b01d082ba153cf4c40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/416df702837983f8d5ff48c9c3fee4f5f57b980b", - "reference": "416df702837983f8d5ff48c9c3fee4f5f57b980b", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/301c07936b16d88628b126b01d082ba153cf4c40", + "reference": "301c07936b16d88628b126b01d082ba153cf4c40", "shasum": "" }, "require": { "ext-pcre": "*", - "graham-campbell/result-type": "^1.1.4", + "graham-campbell/result-type": "^1.2", "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9.5", + "phpoption/phpoption": "^1.10", "symfony/polyfill-ctype": "^1.26", "symfony/polyfill-mbstring": "^1.26", "symfony/polyfill-php80": "^1.26" @@ -8170,7 +8165,7 @@ "homepage": "https://github.com/vlucas" } ], - "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "description": "Loads environment variables from `.env` to `$_ENV` and `$_SERVER` automagically, and optionally to `getenv()`.", "keywords": [ "dotenv", "env", @@ -8178,7 +8173,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.4" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.7.0" }, "funding": [ { @@ -8190,7 +8185,7 @@ "type": "tidelift" } ], - "time": "2026-07-06T19:11:50+00:00" + "time": "2026-08-24T18:07:49+00:00" }, { "name": "voku/portable-ascii", @@ -8480,16 +8475,16 @@ }, { "name": "filp/whoops", - "version": "2.18.4", + "version": "2.18.5", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "d2102955e48b9fd9ab24280a7ad12ed552752c4d" + "reference": "baec851ad6ae00db8bd0fdd30d208afc1b71c56e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/d2102955e48b9fd9ab24280a7ad12ed552752c4d", - "reference": "d2102955e48b9fd9ab24280a7ad12ed552752c4d", + "url": "https://api.github.com/repos/filp/whoops/zipball/baec851ad6ae00db8bd0fdd30d208afc1b71c56e", + "reference": "baec851ad6ae00db8bd0fdd30d208afc1b71c56e", "shasum": "" }, "require": { @@ -8498,8 +8493,8 @@ }, "require-dev": { "mockery/mockery": "^1.0", - "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", - "symfony/var-dumper": "^4.0 || ^5.0" + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3 || ^10.5.58", + "symfony/var-dumper": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0" }, "suggest": { "symfony/var-dumper": "Pretty print complex values better with var-dumper available", @@ -8539,7 +8534,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.18.4" + "source": "https://github.com/filp/whoops/tree/2.18.5" }, "funding": [ { @@ -8547,7 +8542,7 @@ "type": "github" } ], - "time": "2025-08-08T12:00:00+00:00" + "time": "2026-09-18T12:00:00+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -8808,16 +8803,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.8.0", + "version": "v5.9.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f" + "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/044a6a392ff8ad0d61f14370a5fbbd0a0107152f", - "reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9e33da9553fe7786f0962b35f4e4ecf01be89def", + "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def", "shasum": "" }, "require": { @@ -8859,9 +8854,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.8.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.9.0" }, - "time": "2026-07-04T14:30:18+00:00" + "time": "2026-09-13T18:51:52+00:00" }, { "name": "nunomaduro/collision", @@ -9645,16 +9640,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "2.3.3", + "version": "2.3.5", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "fb19eedd2bb67ff8cf7a5502ad329e701d6398a3" + "reference": "148cefffaf0233e4c08cc13db8a195a56dd6dfe9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fb19eedd2bb67ff8cf7a5502ad329e701d6398a3", - "reference": "fb19eedd2bb67ff8cf7a5502ad329e701d6398a3", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/148cefffaf0233e4c08cc13db8a195a56dd6dfe9", + "reference": "148cefffaf0233e4c08cc13db8a195a56dd6dfe9", "shasum": "" }, "require": { @@ -9686,9 +9681,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.3" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.5" }, - "time": "2026-07-08T07:01:06+00:00" + "time": "2026-08-31T16:05:28+00:00" }, { "name": "phpunit/php-code-coverage", @@ -9780,23 +9775,23 @@ }, { "name": "phpunit/php-file-iterator", - "version": "6.0.1", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3d1cd096ef6bea4bf2762ba586e35dbd317cbfd5" + "reference": "a248d1640ab059b075f53a2ef0f9856e864e06b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3d1cd096ef6bea4bf2762ba586e35dbd317cbfd5", - "reference": "3d1cd096ef6bea4bf2762ba586e35dbd317cbfd5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a248d1640ab059b075f53a2ef0f9856e864e06b5", + "reference": "a248d1640ab059b075f53a2ef0f9856e864e06b5", "shasum": "" }, "require": { "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^12.5.33" }, "type": "library", "extra": { @@ -9829,7 +9824,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/6.0.1" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/6.0.2" }, "funding": [ { @@ -9849,7 +9844,7 @@ "type": "tidelift" } ], - "time": "2026-02-02T14:04:18+00:00" + "time": "2026-08-25T14:40:53+00:00" }, { "name": "phpunit/php-invoker", @@ -10131,12 +10126,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "bffbcefd4888dc8e04690bfb04bcdf4a62ab26da" + "reference": "f1dd47da8977aa9dcb913f443ed6c26042da059f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/bffbcefd4888dc8e04690bfb04bcdf4a62ab26da", - "reference": "bffbcefd4888dc8e04690bfb04bcdf4a62ab26da", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/f1dd47da8977aa9dcb913f443ed6c26042da059f", + "reference": "f1dd47da8977aa9dcb913f443ed6c26042da059f", "shasum": "" }, "conflict": { @@ -10175,7 +10170,8 @@ "andreapollastri/cipi": "<=3.1.15", "andrewhaine/silverstripe-form-capture": ">=0.2,<=0.2.3|>=1,<1.0.2|>=2,<2.2.5", "aoe/restler": "<1.7.1", - "apache-solr-for-typo3/solr": "<2.8.3", + "apache-solr-for-typo3/solr": "<11.6.6|>=12,<12.1.4|>=13,<13.1.4", + "apache/thrift": "<0.24", "apereo/phpcas": "<1.6", "api-platform/core": "<4.1.30|>=4.2,<4.2.26|>=4.3,<4.3.12", "api-platform/graphql": "<3.4.17|>=4,<4.0.22|>=4.1,<4.1.5", @@ -10242,8 +10238,10 @@ "cachethq/cachet": "<2.5.1", "cadmium-org/cadmium-cms": "<=0.4.9", "cakephp/authentication": "<2.11.1|>=3,<3.3.6|>=4,<4.1.1", - "cakephp/cakephp": "<4.5.11|>=4.6,<4.6.4|>=5,<5.1.7|>=5.2,<5.2.13|>=5.3,<5.3.6", - "cakephp/database": ">=4.2,<4.2.12|>=4.3,<4.3.11|>=4.4,<4.4.10", + "cakephp/cakephp": "<4.5.12|>=4.6,<4.6.5|>=5,<5.1.10|>=5.2,<5.2.15|>=5.3,<5.3.7", + "cakephp/database": "<4.5.12|>=4.6,<4.6.5|>=5,<5.1.10|>=5.2,<5.2.15|>=5.3,<5.3.7", + "cakephp/debug_kit": "<4.10.3|>=5,<5.2.4", + "cakephp/queue": ">=0.1.10,<2.3.1", "cardgate/magento2": "<2.0.33", "cardgate/woocommerce": "<=3.1.15", "cart2quote/module-quotation": ">=4.1.6,<4.4.6|>=5,<5.4.4", @@ -10255,6 +10253,7 @@ "centreon/centreon": "<22.10.15", "cesargb/laravel-magiclink": ">=2,<2.25.1", "cesnet/simplesamlphp-module-proxystatistics": "<3.1", + "chamilo/chamilo-lms": "<=2", "chriskacerguis/codeigniter-restserver": "<=2.7.1", "chrome-php/chrome": "<1.14", "ci4-cms-erp/ci4ms": "<=0.31.8", @@ -10270,19 +10269,21 @@ "codeigniter4/shield": "<1.0.0.0-beta8", "codiad/codiad": "<=2.8.4", "codingms/additional-tca": ">=1.7,<1.15.17|>=1.16,<1.16.9", - "codingms/modules": "<4.3.11|>=5,<5.7.4|>=6,<6.4.2|>=7,<7.5.5", + "codingms/modules": "<7.10.4|>=8,<8.1.4", "commerceteam/commerce": ">=0.9.6,<0.9.9", "components/jquery": ">=1.0.3,<3.5", - "composer/composer": "<2.2.29|>=2.3,<2.10.2", + "composer/composer": "<2.2.30|>=2.3,<2.10.3", "concrete5/concrete5": "<9.5.2", "concrete5/core": "<8.5.8|>=9,<9.1", + "contao-components/colorbox": ">=1,<1.6.4.3-dev", "contao-components/mediaelement": ">=2.14.2,<2.21.1", - "contao/comments-bundle": ">=2,<4.13.40|>=5.0.0.0-RC1-dev,<5.3.4", - "contao/contao": ">=3,<3.5.37|>=4,<4.4.56|>=4.5,<5.3.48|>=5.4,<5.7.9", + "contao/comments-bundle": ">=2,<5.3.50|>=5.4,<5.7.12", + "contao/contao": ">=3,<3.5.37|>=4,<5.3.50|>=5.4,<5.7.12", "contao/core": "<3.5.39", - "contao/core-bundle": "<5.3.48|>=5.4,<5.7.9", + "contao/core-bundle": "<5.3.50|>=5.4,<5.7.12", "contao/listing-bundle": ">=3,<=3.5.30|>=4,<4.4.8", "contao/managed-edition": "<=1.5", + "contao/newsletter-bundle": ">=5,<5.3.50|>=5.4,<5.7.12", "coreshop/core-shop": "<4.1.9|==5", "corveda/phpsandbox": "<1.3.5", "cosenary/instagram": "<=2.3", @@ -10312,7 +10313,7 @@ "dcat/laravel-admin": "<=2.1.3|==2.2.0.0-beta|==2.2.2.0-beta", "dedoc/scramble": ">=0.13.2,<0.13.22", "derhansen/fe_change_pwd": "<2.0.5|>=3,<3.0.3", - "derhansen/sf_event_mgt": "<4.3.1|>=5,<5.1.1|>=7,<7.4", + "derhansen/sf_event_mgt": "<5.9.3|>=6,<6.7.2|>=7,<7.9.3|>=8,<8.6.2|>=9,<9.0.3", "desperado/xml-bundle": "<=0.1.7", "dev-lancer/minecraft-motd-parser": "<=1.0.5", "devcode-it/openstamanager": "<=2.10.1", @@ -10419,7 +10420,7 @@ "feehi/feehicms": "<=2.1.1", "fenom/fenom": "<=2.12.1", "filament/actions": ">=3.2,<3.2.123|>=4,<=4.11.3|>=5,<=5.6.3", - "filament/filament": ">=3,<=3.3.51|>=4,<4.11.5|>=5,<5.6.5", + "filament/filament": ">=3,<=3.3.51|>=4,<4.12.6|>=5,<5.7.6", "filament/forms": ">=3,<=3.3.52", "filament/infolists": ">=3,<3.2.115|>=4,<=4.11.4|>=5,<=5.6.4", "filament/tables": ">=3,<=3.3.50|>=4,<=4.11.4|>=5,<=5.6.4", @@ -10448,7 +10449,7 @@ "forkcms/forkcms": "<5.11.1", "fossar/tcpdf-parser": "<6.2.22", "francoisjacquet/rosariosis": "<=11.5.1", - "frappant/frp-form-answers": "<3.1.2|>=4,<4.0.2", + "frappant/frp-form-answers": "<5.0.5|>=6,<6.1.3|>=7,<7.1.1", "friendsofsymfony/oauth2-php": "<1.3", "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", "friendsofsymfony/user-bundle": ">=1,<1.3.5", @@ -10468,10 +10469,10 @@ "georgringer/news": "<10.0.4|>=11,<11.4.4|>=12,<12.3.2|>=13,<13.0.2|>=14,<14.0.3", "geshi/geshi": "<=1.0.9.1", "getformwork/formwork": "<=2.3.3", - "getgrav/grav": "<2.0.4", + "getgrav/grav": "<=2.0.19", "getgrav/grav-plugin-api": "<1.0.0.0-beta15", "getgrav/grav-plugin-form": "<9.1", - "getkirby/cms": "<=4.9.3|>=5,<=5.4.3", + "getkirby/cms": "<4.9.5|>=5,<5.5.2", "getkirby/kirby": "<3.9.8.3-dev|>=3.10,<3.10.1.2-dev|>=4,<4.7.1", "getkirby/panel": "<2.5.14", "getkirby/starterkit": "<=3.7.0.2", @@ -10525,10 +10526,10 @@ "imdbphp/imdbphp": "<=5.1.1", "impresscms/impresscms": "<=1.4.5", "impresspages/impresspages": "<1.0.13", - "in2code/femanager": "<6.4.2|>=7,<7.5.3|>=8,<8.3.1", + "in2code/femanager": "<6.4.5|>=7,<7.5.5|>=8,<8.4.2|>=13,<13.3.5", "in2code/ipandlanguageredirect": "<5.1.2", "in2code/lux": "<17.6.1|>=18,<24.0.2", - "in2code/powermail": "<7.5.1|>=8,<8.5.1|>=9,<10.9.1|>=11,<12.5.3|==13", + "in2code/powermail": "<10.9.3|>=11,<12.6.1|>=13,<13.2.1", "innologi/typo3-appointments": "<2.0.6", "intelliants/subrion": "<4.2.2", "inter-mediator/inter-mediator": "==5.5", @@ -10565,8 +10566,12 @@ "jsdecena/laracom": "<2.0.9", "jsmitty12/phpwhois": "<5.1", "juzaweb/cms": "<=3.4.2", - "jweiland/events2": "<8.3.8|>=9,<9.0.6", + "jweiland/clubdirectory": "<6.0.2|>=7,<7.0.2|>=8,<8.1.3", + "jweiland/events2": "<8.6.3|>=9,<9.4.2|>=10,<10.2.12", "jweiland/kk-downloader": "<1.2.2", + "jweiland/pforum": "<4.0.4|>=5,<5.0.1|>=6,<6.2.4", + "jweiland/telephonedirectory": "<4.1.1|>=5,<5.0.1|>=6,<6.2", + "jweiland/yellowpages2": "<6.1.6|>=7,<7.0.3|>=8,<8.1.2", "kantorge/yaffa": "<=2", "kazist/phpwhois": "<=4.2.6", "kelvinmo/simplejwt": "<=1.1", @@ -10578,7 +10583,7 @@ "klaviyo/magento2-extension": ">=1,<3", "knplabs/knp-snappy": "<=1.7", "kohana/core": "<3.3.3", - "koillection/koillection": "<1.6.12", + "koillection/koillection": "<1.8.4", "krayin/laravel-crm": "<=2.2", "kreait/firebase-php": ">=3.2,<3.8.1", "kumbiaphp/kumbiapp": "<=1.1.1", @@ -10600,7 +10605,7 @@ "lavalite/cms": "<=10.1", "lavitto/typo3-form-to-database": "<2.2.5|>=3,<3.2.2|>=4,<4.2.3|>=5,<5.0.2", "lcobucci/jwt": ">=3.4,<3.4.6|>=4,<4.0.4|>=4.1,<4.1.5", - "league/commonmark": "<2.9", + "league/commonmark": "<2.10", "league/flysystem": "<1.1.4|>=2,<2.1.1", "league/oauth2-server": ">=8.3.2,<8.4.2|>=8.5,<8.5.3", "leantime/leantime": "<3.3", @@ -10612,13 +10617,15 @@ "limesurvey/limesurvey": "<=7.0.0.0-beta1", "livehelperchat/livehelperchat": "<=3.91", "livewire-filemanager/filemanager": "<=1.0.4", - "livewire/livewire": "<2.12.7|>=3.0.0.0-beta1,<3.6.4", + "livewire/livewire": "<2.12.7|>=3.0.0.0-beta1,<=3.8.2|>=4.0.0.0-beta1,<=4.3.3", "livewire/volt": "<1.7", "lms/routes": "<2.1.1", "localizationteam/l10nmgr": "<7.4|>=8,<8.7|>=9,<9.2", + "lochmueller/html5videoplayer-powermail": "<=0.2.1", "lomkit/laravel-rest-api": "<2.13", "luracast/restler": "<3.1", "luyadev/yii-helpers": "<1.2.1", + "maatwebsite/excel": ">=3.1.8,<3.1.70", "macropay-solutions/laravel-crud-wizard-free": "<3.4.17", "maestroerror/php-heic-to-jpg": "<1.0.5", "magento/community-edition": "<2.4.6.0-patch13|>=2.4.7.0-beta1,<2.4.7.0-patch8|>=2.4.8.0-beta1,<2.4.8.0-patch3|>=2.4.9.0-alpha1,<2.4.9.0-alpha3|==2.4.9", @@ -10636,6 +10643,7 @@ "marcwillmann/turn": "<0.3.3", "markhuot/craftql": "<=1.3.7", "marshmallow/nova-tiptap": "<5.7", + "mask/mask": "<8.3.12|>=9,<9.0.11", "matomo/matomo": "<1.11", "matyhtf/framework": "<3.0.6", "mautic/core": "<5.2.11|>=6,<6.0.9|>=7,<7.1.2", @@ -10651,7 +10659,7 @@ "mediawiki/data-transfer": ">=1.39,<1.39.11|>=1.41,<1.41.3|>=1.42,<1.42.2", "mediawiki/maps": "<12.1.3", "mediawiki/matomo": "<2.4.3", - "mediawiki/semantic-media-wiki": "<4.0.2", + "mediawiki/semantic-media-wiki": "<=7.2.1", "mehrwert/phpmyadmin": "<3.2", "melisplatform/melis-asset-manager": "<5.0.1", "melisplatform/melis-cms": "<5.3.4", @@ -10663,7 +10671,7 @@ "microsoft/microsoft-graph": ">=1.16,<1.109.1|>=2,<2.0.1", "microsoft/microsoft-graph-beta": "<2.0.1", "microsoft/microsoft-graph-core": "<2.0.2", - "microweber/microweber": "<2.0.20", + "microweber/microweber": "<=2.0.20", "mikehaertl/php-shellcommand": "<1.6.1", "mineadmin/mineadmin": "<3.2.0.0-alpha2", "miniorange/miniorange-saml": "<1.4.3", @@ -10674,7 +10682,7 @@ "mobiledetect/mobiledetectlib": "<2.8.32", "modx/revolution": "<=3.1", "mojo42/jirafeau": "<4.4", - "mongodb/mongodb": ">=1,<1.9.2", + "mongodb/mongodb": "<1.21.4|>=2,<2.4.1", "mongodb/mongodb-extension": "<1.21.2", "monolog/monolog": ">=1.8,<1.12", "moodle/moodle": "<4.5.9|>=5.0.0.0-beta,<5.0.5|>=5.1.0.0-beta,<5.1.2", @@ -10722,9 +10730,9 @@ "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", "october/backend": "<1.1.2", "october/cms": "<1.0.469|==1.0.469|==1.0.471|==1.1.1", - "october/october": "<3.7.14|>=4,<4.1.10", + "october/october": "<3.7.14|>=4,<4.1.10|>=4.3,<4.3.4", "october/rain": "<=3.7.13|>=4,<=4.1.9", - "october/system": "<3.7.16|>=4,<4.1.16", + "october/system": "<3.7.17|>=4,<4.2.23", "oliverklee/phpunit": "<3.5.15", "omeka/omeka-s": "<4.0.3", "onelogin/php-saml": "<2.21.1|>=3,<3.8.1|>=4,<4.3.1", @@ -10755,7 +10763,7 @@ "paragonie/random_compat": "<2", "paragonie/sodium_compat": "<1.24.1|>=2,<2.5.1", "passbolt/passbolt_api": "<4.6.2", - "paymenter/paymenter": "<=1.5.4", + "paymenter/paymenter": "<=1.5.6", "paypal/adaptivepayments-sdk-php": "<=3.9.2", "paypal/invoice-sdk-php": "<=3.9", "paypal/merchant-sdk-php": "<3.12", @@ -10768,6 +10776,7 @@ "pegasus/google-for-jobs": "<1.5.1|>=2,<2.1.1", "personnummer/personnummer": "<3.0.2", "ph7software/ph7builder": "<=17.9.1", + "phalcon/cphalcon": "<=5.15", "phanan/koel": "<=9.7", "pheditor/pheditor": "<2.0.8", "phenx/php-svg-lib": "<0.5.2", @@ -10782,7 +10791,7 @@ "phpmailer/phpmailer": "<6.5", "phpmussel/phpmussel": ">=1,<1.6", "phpmyadmin/phpmyadmin": "<5.2.2", - "phpmyfaq/phpmyfaq": "<4.1.4", + "phpmyfaq/phpmyfaq": "<=4.1.4", "phpoffice/common": "<0.2.9", "phpoffice/math": "<=0.2", "phpoffice/phpexcel": "<=1.8.2", @@ -10790,7 +10799,7 @@ "phppgadmin/phppgadmin": "<=7.13", "phpseclib/phpseclib": "<=2.0.54|>=3,<=3.0.53", "phpservermon/phpservermon": "<3.6", - "phpsysinfo/phpsysinfo": "<3.4.3", + "phpsysinfo/phpsysinfo": "<=3.4.5", "phpunit/phpunit": "<8.5.52|>=9,<9.6.33|>=10,<10.5.62|>=11,<11.5.50|>=12,<12.5.8|>=12.5.21,<12.5.22|>=13.1.5,<13.1.6", "phpwhois/phpwhois": "<=4.2.5", "phpxmlrpc/extras": "<0.6.1", @@ -10804,7 +10813,8 @@ "pimcore/demo": "<10.3", "pimcore/ecommerce-framework-bundle": "<1.0.10", "pimcore/perspective-editor": "<1.5.1", - "pimcore/pimcore": "<12.3.9|>=2026.1,<=2026.1.4", + "pimcore/pimcore": "<=12.3.9|>=2026.1,<=2026.1.5", + "pimcore/studio-backend-bundle": "<2025.4.6|>=2026.1,<2026.1.6", "pimcore/web2print-tools-bundle": "<=5.2.1|>=6.0.0.0-RC1-dev,<=6.1", "piwik/piwik": "<1.11", "pixelfed/pixelfed": "<0.12.5", @@ -10815,6 +10825,7 @@ "pocketmine/raklib": ">=0.14,<0.14.6|>=0.15,<0.15.1", "pontedilana/php-weasyprint": "<=2.5.1", "poweradmin/poweradmin": "<4.2.5|>=4.3,<4.3.4", + "predis/predis": ">=3.0.0.0-RC1-dev,<3.3", "pressbooks/pressbooks": "<5.18", "prestashop/autoupgrade": ">=4,<4.10.1", "prestashop/blockreassurance": "<=5.1.3", @@ -10828,7 +10839,7 @@ "prestashop/ps_emailsubscription": "<2.6.1", "prestashop/ps_facetedsearch": "<4.0.4", "prestashop/ps_linklist": "<3.1", - "privatebin/privatebin": "<1.4|>=1.5,<1.7.4|>=1.7.7,<2.0.3", + "privatebin/privatebin": "<=2.0.4", "processwire/processwire": "<=3.0.255", "propel/propel": ">=2.0.0.0-alpha1,<2.0.0.0-alpha8", "propel/propel1": ">=1,<1.7.2", @@ -10851,7 +10862,7 @@ "ralffreit/mfa-email": "<1.0.7|==2", "rankmath/seo-by-rank-math": "<=1.0.95", "rap2hpoutre/laravel-log-viewer": "<0.13", - "react/http": ">=0.7,<1.9", + "react/http": ">=0.6,<1.11.1", "really-simple-plugins/complianz-gdpr": "<6.4.2", "redaxo/source": "<5.21.1", "remdex/livehelperchat": "<4.29", @@ -10879,8 +10890,9 @@ "setasign/fpdi": "<2.6.7", "sfroemken/url_redirect": "<=1.2.1", "sheng/yiicms": "<1.2.1", + "shlinkio/shlink": "<=5.0.1", "shopper/cart": "<2.8", - "shopper/framework": "<2.8", + "shopper/framework": "<2.9.2", "shopware/core": "<6.6.10.18-dev|>=6.7,<6.7.10.1-dev", "shopware/platform": "<6.6.10.18-dev|>=6.7,<6.7.10.1-dev", "shopware/production": "<=6.3.5.2", @@ -10950,14 +10962,14 @@ "starcitizentools/short-description": ">=4,<4.0.1", "starcitizentools/tabber-neue": ">=1.9.1,<2.7.2|>=3,<3.1.1", "starcitizenwiki/embedvideo": "<=4", - "statamic/cms": "<5.74.3|>=6,<6.24.2", + "statamic/cms": "<5.74.3|>=6,<=6.30", "stormpath/sdk": "<9.9.99", - "studio-42/elfinder": "<=2.1.67", + "studio-42/elfinder": "<2.1.70", "studiomitte/friendlycaptcha": "<0.1.4", "subhh/libconnect": "<7.0.8|>=8,<8.1", "sukohi/surpass": "<1", "sulu/form-bundle": ">=2,<2.5.3", - "sulu/sulu": "<=2.6.22|>=3,<=3.0.5", + "sulu/sulu": "<=2.6.24|>=3,<3.0.8", "sumocoders/framework-user-bundle": "<1.4", "superbig/craft-audit": "<3.0.2", "svewap/a21glossary": "<=0.4.10", @@ -11027,6 +11039,7 @@ "symfony/webhook": ">=6.3,<6.3.8", "symfony/yaml": "<5.4.52|>=6,<6.4.40|>=7,<7.4.12|>=8,<8.0.12", "symphonycms/symphony-2": "<2.6.4", + "syssy/syssy-typo3-extension": "<3.0.6", "t3/dce": "<0.11.5|>=2.2,<2.6.2", "t3g/svg-sanitizer": "<1.0.3", "t3s/content-consent": "<1.0.3|>=2,<2.0.2", @@ -11063,7 +11076,7 @@ "twig/twig": "<3.27", "typicms/core": "<12.0.5|>=13,<13.0.9|>=14,<14.0.27|>=15,<15.0.29|>=16,<16.1.7", "typo3/cms": "<9.5.29|>=10,<10.4.35|>=11,<11.5.23|>=12,<12.2", - "typo3/cms-backend": "<10.4.57|>=11,<11.5.51|>=12,<12.4.46|>=13,<13.4.31|>=14,<14.3.3", + "typo3/cms-backend": "<10.4.60|>=11,<11.5.54|>=12,<12.4.49|>=13,<13.4.35|>=14,<14.3.7", "typo3/cms-belog": ">=10,<=10.4.47|>=11,<=11.5.41|>=12,<=12.4.24|>=13,<=13.4.2", "typo3/cms-beuser": ">=9,<9.5.55|>=10,<10.4.54|>=11,<11.5.48|>=12,<12.4.37|>=13,<13.4.18", "typo3/cms-core": "<10.4.57|>=11,<11.5.51|>=12,<12.4.46|>=13,<13.4.34|>=14,<14.3.6", @@ -11077,7 +11090,7 @@ "typo3/cms-frontend": "<4.3.9|>=4.4,<4.4.5", "typo3/cms-indexed-search": ">=10,<=10.4.47|>=11,<=11.5.41|>=12,<=12.4.24|>=13,<13.4.31|>=14,<14.3.3", "typo3/cms-install": "<4.1.14|>=4.2,<4.2.16|>=4.3,<4.3.9|>=4.4,<4.4.5|>=12.2,<12.4.8|==13.4.2", - "typo3/cms-lowlevel": ">=11,<=11.5.41", + "typo3/cms-lowlevel": ">=11,<=11.5.41|>=14.2,<14.3.7", "typo3/cms-recordlist": ">=11,<11.5.48", "typo3/cms-recycler": "<10.4.57|>=11,<11.5.51|>=12,<12.4.46|>=13,<13.4.31|>=14,<14.3.3", "typo3/cms-redirects": ">=10,<=10.4.54|>=11,<=11.5.48|>=12,<=12.4.40|>=13,<=13.4.22|>=14,<=14.0.1", @@ -11123,7 +11136,7 @@ "web-feet/coastercms": "==5.5", "web-token/jwt-bundle": "<3.4.10|>=4,<4.0.7|>=4.1,<4.1.7", "web-token/jwt-experimental": "<4.1.7", - "web-token/jwt-framework": "<4.1.7", + "web-token/jwt-framework": "<3.4.10|>=4,<4.0.7|>=4.1,<4.1.7", "web-token/jwt-library": "<3.4.10|>=4,<4.0.7|>=4.1,<4.1.7", "web-tp3/wec_map": "<3.0.3", "webbuilders-group/silverstripe-kapost-bridge": "<0.4", @@ -11173,7 +11186,7 @@ "yikesinc/yikes-inc-easy-mailchimp-extender": "<6.8.6", "yoast-seo-for-typo3/yoast_seo": "<7.2.3", "yoast/duplicate-post": "<=4.5", - "yourls/yourls": "<=1.10.2", + "yourls/yourls": "<=1.10.3", "yuan1994/tpadmin": "<=1.3.12", "yungifez/skuul": "<=2.6.5", "z-push/z-push-dev": "<2.7.6", @@ -11251,7 +11264,7 @@ "type": "tidelift" } ], - "time": "2026-08-20T19:30:24+00:00" + "time": "2026-09-18T20:28:15+00:00" }, { "name": "sebastian/cli-parser", @@ -11474,24 +11487,24 @@ }, { "name": "sebastian/diff", - "version": "7.0.0", + "version": "7.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7ab1ea946c012266ca32390913653d844ecd085f" + "reference": "cd4cabe39f8a4e8ee6818ba99f10a05561ea4ad6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7ab1ea946c012266ca32390913653d844ecd085f", - "reference": "7ab1ea946c012266ca32390913653d844ecd085f", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/cd4cabe39f8a4e8ee6818ba99f10a05561ea4ad6", + "reference": "cd4cabe39f8a4e8ee6818ba99f10a05561ea4ad6", "shasum": "" }, "require": { "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^12.0", - "symfony/process": "^7.2" + "phpunit/phpunit": "^12.5.33", + "symfony/process": "^7.4.17" }, "type": "library", "extra": { @@ -11529,15 +11542,27 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/7.0.0" + "source": "https://github.com/sebastianbergmann/diff/tree/7.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/diff", + "type": "tidelift" } ], - "time": "2025-02-07T04:55:46+00:00" + "time": "2026-08-25T15:35:54+00:00" }, { "name": "sebastian/environment", diff --git a/core/vendor/carbonphp/carbon-doctrine-types/README.md b/core/vendor/carbonphp/carbon-doctrine-types/README.md index 5a18121b6c..baaf5fea24 100644 --- a/core/vendor/carbonphp/carbon-doctrine-types/README.md +++ b/core/vendor/carbonphp/carbon-doctrine-types/README.md @@ -4,7 +4,7 @@ Types to use Carbon in Doctrine ## Documentation -[Check how to use in the official Carbon documentation](https://carbon.nesbot.com/symfony/) +[Check how to use in the official Carbon documentation](https://carbon.nesbot.com/guide/getting-started/symfony.html) This package is an externalization of [src/Carbon/Doctrine](https://github.com/briannesbitt/Carbon/tree/2.71.0/src/Carbon/Doctrine) from `nestbot/carbon` package. diff --git a/core/vendor/carbonphp/carbon-doctrine-types/composer.json b/core/vendor/carbonphp/carbon-doctrine-types/composer.json index abf45c5fb5..dbc90ec1e3 100644 --- a/core/vendor/carbonphp/carbon-doctrine-types/composer.json +++ b/core/vendor/carbonphp/carbon-doctrine-types/composer.json @@ -32,5 +32,10 @@ "email": "kylekatarnls@gmail.com" } ], - "minimum-stability": "dev" + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + } } diff --git a/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php b/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php index a63a9b8d27..8cb82202af 100644 --- a/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php +++ b/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php @@ -4,13 +4,14 @@ namespace Carbon\Doctrine; +use Carbon\CarbonInterface; use Doctrine\DBAL\Platforms\AbstractPlatform; interface CarbonDoctrineType { - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform); + public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string; - public function convertToPHPValue(mixed $value, AbstractPlatform $platform); + public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?CarbonInterface; - public function convertToDatabaseValue($value, AbstractPlatform $platform); + public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?string; } diff --git a/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonTypeConverter.php b/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonTypeConverter.php index a813311777..d2e3786c4a 100644 --- a/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonTypeConverter.php +++ b/core/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonTypeConverter.php @@ -62,7 +62,7 @@ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $pla /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string + public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?string { if ($value === null) { return $value; @@ -79,11 +79,11 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str ); } - private function doConvertToPHPValue(mixed $value) + private function doConvertToPHPValue(mixed $value): ?CarbonInterface { $class = $this->getCarbonClassName(); - if ($value === null || is_a($value, $class)) { + if ($value === null || (is_object($value) && is_a($value, $class))) { return $value; } diff --git a/core/vendor/composer/autoload_classmap.php b/core/vendor/composer/autoload_classmap.php index b6841170d0..cf73027e97 100644 --- a/core/vendor/composer/autoload_classmap.php +++ b/core/vendor/composer/autoload_classmap.php @@ -80,6 +80,7 @@ 'Carbon\\Exceptions\\NotLocaleAwareException' => $vendorDir . '/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php', 'Carbon\\Exceptions\\OutOfRangeException' => $vendorDir . '/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php', 'Carbon\\Exceptions\\ParseErrorException' => $vendorDir . '/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php', + 'Carbon\\Exceptions\\PeriodFilterSafetyException' => $vendorDir . '/nesbot/carbon/src/Carbon/Exceptions/PeriodFilterSafetyException.php', 'Carbon\\Exceptions\\RuntimeException' => $vendorDir . '/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php', 'Carbon\\Exceptions\\UnitException' => $vendorDir . '/nesbot/carbon/src/Carbon/Exceptions/UnitException.php', 'Carbon\\Exceptions\\UnitNotConfiguredException' => $vendorDir . '/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php', @@ -124,6 +125,7 @@ 'Carbon\\Traits\\Test' => $vendorDir . '/nesbot/carbon/src/Carbon/Traits/Test.php', 'Carbon\\Traits\\Timestamp' => $vendorDir . '/nesbot/carbon/src/Carbon/Traits/Timestamp.php', 'Carbon\\Traits\\ToStringFormat' => $vendorDir . '/nesbot/carbon/src/Carbon/Traits/ToStringFormat.php', + 'Carbon\\Traits\\TogglableDetection' => $vendorDir . '/nesbot/carbon/src/Carbon/Traits/TogglableDetection.php', 'Carbon\\Traits\\Units' => $vendorDir . '/nesbot/carbon/src/Carbon/Traits/Units.php', 'Carbon\\Traits\\Week' => $vendorDir . '/nesbot/carbon/src/Carbon/Traits/Week.php', 'Carbon\\Translator' => $vendorDir . '/nesbot/carbon/src/Carbon/Translator.php', @@ -3005,9 +3007,11 @@ 'Monolog\\Formatter\\LogstashFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php', 'Monolog\\Formatter\\MongoDBFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php', 'Monolog\\Formatter\\NormalizerFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php', + 'Monolog\\Formatter\\RedactingFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php', 'Monolog\\Formatter\\ScalarFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php', 'Monolog\\Formatter\\SyslogFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php', 'Monolog\\Formatter\\WildfireFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php', + 'Monolog\\Formatter\\WrappingFormatterInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/WrappingFormatterInterface.php', 'Monolog\\Handler\\AbstractHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php', 'Monolog\\Handler\\AbstractProcessingHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php', 'Monolog\\Handler\\AbstractSyslogHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php', @@ -3035,6 +3039,7 @@ 'Monolog\\Handler\\FlowdockHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php', 'Monolog\\Handler\\FormattableHandlerInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php', 'Monolog\\Handler\\FormattableHandlerTrait' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php', + 'Monolog\\Handler\\FrankenPhpHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FrankenPhpHandler.php', 'Monolog\\Handler\\GelfHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/GelfHandler.php', 'Monolog\\Handler\\GroupHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/GroupHandler.php', 'Monolog\\Handler\\Handler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/Handler.php', @@ -3043,6 +3048,7 @@ 'Monolog\\Handler\\IFTTTHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php', 'Monolog\\Handler\\InsightOpsHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php', 'Monolog\\Handler\\LogEntriesHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php', + 'Monolog\\Handler\\LogMonsterHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/LogMonsterHandler.php', 'Monolog\\Handler\\LogglyHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/LogglyHandler.php', 'Monolog\\Handler\\LogmaticHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php', 'Monolog\\Handler\\MailHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/MailHandler.php', diff --git a/core/vendor/composer/autoload_static.php b/core/vendor/composer/autoload_static.php index ca33349176..e21a21ce48 100644 --- a/core/vendor/composer/autoload_static.php +++ b/core/vendor/composer/autoload_static.php @@ -757,6 +757,7 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Carbon\\Exceptions\\NotLocaleAwareException' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php', 'Carbon\\Exceptions\\OutOfRangeException' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php', 'Carbon\\Exceptions\\ParseErrorException' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php', + 'Carbon\\Exceptions\\PeriodFilterSafetyException' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Exceptions/PeriodFilterSafetyException.php', 'Carbon\\Exceptions\\RuntimeException' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php', 'Carbon\\Exceptions\\UnitException' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Exceptions/UnitException.php', 'Carbon\\Exceptions\\UnitNotConfiguredException' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php', @@ -801,6 +802,7 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Carbon\\Traits\\Test' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Traits/Test.php', 'Carbon\\Traits\\Timestamp' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Traits/Timestamp.php', 'Carbon\\Traits\\ToStringFormat' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Traits/ToStringFormat.php', + 'Carbon\\Traits\\TogglableDetection' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Traits/TogglableDetection.php', 'Carbon\\Traits\\Units' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Traits/Units.php', 'Carbon\\Traits\\Week' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Traits/Week.php', 'Carbon\\Translator' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Translator.php', @@ -3682,9 +3684,11 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Monolog\\Formatter\\LogstashFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php', 'Monolog\\Formatter\\MongoDBFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php', 'Monolog\\Formatter\\NormalizerFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php', + 'Monolog\\Formatter\\RedactingFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php', 'Monolog\\Formatter\\ScalarFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php', 'Monolog\\Formatter\\SyslogFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php', 'Monolog\\Formatter\\WildfireFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php', + 'Monolog\\Formatter\\WrappingFormatterInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/WrappingFormatterInterface.php', 'Monolog\\Handler\\AbstractHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php', 'Monolog\\Handler\\AbstractProcessingHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php', 'Monolog\\Handler\\AbstractSyslogHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php', @@ -3712,6 +3716,7 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Monolog\\Handler\\FlowdockHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php', 'Monolog\\Handler\\FormattableHandlerInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php', 'Monolog\\Handler\\FormattableHandlerTrait' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php', + 'Monolog\\Handler\\FrankenPhpHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FrankenPhpHandler.php', 'Monolog\\Handler\\GelfHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/GelfHandler.php', 'Monolog\\Handler\\GroupHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/GroupHandler.php', 'Monolog\\Handler\\Handler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/Handler.php', @@ -3720,6 +3725,7 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Monolog\\Handler\\IFTTTHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php', 'Monolog\\Handler\\InsightOpsHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php', 'Monolog\\Handler\\LogEntriesHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php', + 'Monolog\\Handler\\LogMonsterHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/LogMonsterHandler.php', 'Monolog\\Handler\\LogglyHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/LogglyHandler.php', 'Monolog\\Handler\\LogmaticHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php', 'Monolog\\Handler\\MailHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/MailHandler.php', diff --git a/core/vendor/composer/ca-bundle/res/cacert.pem b/core/vendor/composer/ca-bundle/res/cacert.pem index 26ec7f7baa..d228daeed0 100644 --- a/core/vendor/composer/ca-bundle/res/cacert.pem +++ b/core/vendor/composer/ca-bundle/res/cacert.pem @@ -1,7 +1,7 @@ ## ## Bundle of CA Root Certificates ## -## Certificate data from Mozilla as of: Thu Jul 16 03:12:01 2026 GMT +## Certificate data from Mozilla as of: Thu Aug 13 03:12:01 2026 GMT ## ## Find updated versions here: https://curl.se/docs/caextract.html ## @@ -16,7 +16,7 @@ ## Configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version 1.33. -## SHA256: e57912808daef7b2b0fa4df2ccf17e47aeaf26c839a38f85c76003ebafd866bd +## SHA256: 81b7f2576333a2e360e673f912d7b0b7a765d836c731003e348a46cac5d37198 ## @@ -37,37 +37,6 @@ FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= -----END CERTIFICATE----- -ePKI Root Certification Authority -================================= ------BEGIN CERTIFICATE----- -MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG -EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg -Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx -MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq -MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs -IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi -lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv -qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX -12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O -WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+ -ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao -lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/ -vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi -Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi -MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH -ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0 -1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq -KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV -xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP -NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r -GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE -xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx -gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy -sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD -BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= ------END CERTIFICATE----- - NetLock Arany (Class Gold) Főtanúsítvány ======================================== -----BEGIN CERTIFICATE----- @@ -585,27 +554,6 @@ vNoBYimipidx5joifsFvHZVwIEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR 9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg== -----END CERTIFICATE----- -Atos TrustedRoot 2011 -===================== ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UEAwwVQXRvcyBU -cnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQGEwJERTAeFw0xMTA3MDcxNDU4 -MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMMFUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsG -A1UECgwEQXRvczELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCV -hTuXbyo7LjvPpvMpNb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr -54rMVD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+SZFhyBH+ -DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ4J7sVaE3IqKHBAUsR320 -HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0Lcp2AMBYHlT8oDv3FdU9T1nSatCQujgKR -z3bFmx5VdJx4IbHwLfELn8LVlhgf8FQieowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7R -l+lwrrw7GWzbITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZ -bNshMBgGA1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB -CwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8jvZfza1zv7v1Apt+h -k6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kPDpFrdRbhIfzYJsdHt6bPWHJxfrrh -TZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pcmaHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a9 -61qn8FYiqTxlVMYVqL2Gns2Dlmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G -3mB/ufNPRJLvKrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed ------END CERTIFICATE----- - QuoVadis Root CA 1 G3 ===================== -----BEGIN CERTIFICATE----- @@ -2908,3 +2856,95 @@ CgYIKoZIzj0EAwQDgYsAMIGHAkIBLdqu9S54tma4n7Zwf2Z0z+yOfP7AAXmazlIC58PRDHpty7Ve 7hekm9sEdu4pKeiv+62sUvTXK9Z3hBC9xdIoaDQCQTV2WnXzkoYI9bIeCvZlC9p2x1L/Cx6AcCIw wzPbGO2E14vs7dOoY4G1VnxHx1YwlGhza9IuqbnZLBwpvQy6uWWL -----END CERTIFICATE----- + +SECOM TLS RSA Root CA 2024 +========================== +-----BEGIN CERTIFICATE----- +MIIFmjCCA4KgAwIBAgIJAO6JNNDLgOCyMA0GCSqGSIb3DQEBDAUAMFoxCzAJBgNVBAYTAkpQMSYw +JAYDVQQKEx1TRUNPTSBUcnVzdCBTeXN0ZW1zIENvLiwgTHRkLjEjMCEGA1UEAxMaU0VDT00gVExT +IFJTQSBSb290IENBIDIwMjQwHhcNMjQwMTMxMDUxMTU1WhcNNDkwMTE0MDUxMTU1WjBaMQswCQYD +VQQGEwJKUDEmMCQGA1UEChMdU0VDT00gVHJ1c3QgU3lzdGVtcyBDby4sIEx0ZC4xIzAhBgNVBAMT +GlNFQ09NIFRMUyBSU0EgUm9vdCBDQSAyMDI0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKC +AgEA4TjizUwzxbInq8Tx11gaFYNk5fO+34y7TyM4neh0UgL5JIZbJNLTz2x//L/B71+5m6X6nGIr +7d4lFJBGtjO677hXOz93zkcWaUTm3VbOAjBlt4YWxlcccBHXuZ7o3Q+4R+ormrBdHeJ1CTUEG8tt +QbKIl3G7OZYbnH8/pP8cjPub/0kDVNuMzp7xsVRROOisQt53fMoJLlYgoebbuMphOqMCtjkJ7R6e +fEMfLp8UAVi9ZaLRn76ET/CJkk925nduuufC4BatS4mnXFmxN0vUXb0ij9B8O/D8gixQEsVSD4GK +8FWRPh3bVd/6bzdkHGJjy21XI0yejVomZUbRrOfNuz0boPGV1pt18fFC39IHQEth3OFqb5NDO3L+ +A9bNqTgAyUgRmIn4ucgDc/Ri/Km3V51ueZjy1/yk0qwJVadAVVrCt56iNeXOyEvzJADGgDQ8E1Pd +aqct8Cynz/47ReQM62vFYO08wcQkrjmX/tesiko1V1yyaf6EfPzUFzmaGy9xvkCwdbm15EdTolOj +E0H2Vb5/APDOyCFEokiYGmXTLdAUl0wKZ4IyjkHGzy0jhpaXEXE/GJcEvI6VzEchjaBL03EJ0h9p +G4OqeIOycKvAo3A+TbetyfsrgYyHzU0a7/qUjGat1AAq1nVljMpKqpinPTsf/d9H39FTUeJL7Tpz +zjUCAwEAAaNjMGEwHQYDVR0OBBYEFCzrchKOWHdkNRVWNQFXB6l9DTbmMB8GA1UdIwQYMBaAFCzr +chKOWHdkNRVWNQFXB6l9DTbmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG +SIb3DQEBDAUAA4ICAQAVwsvluSafaez5tFPR/hRTBzRxEyMMQF3XJXCVi3yegZyKoec7hmE6jx2Z +M8KgM1kn2yJRwFXHX8zUW9nBLEDWc4wuE8LrlZqhGZM9pJQXGmGzResDJV6JgRBna+j4sA1M7yId +lvL0sAfFXFCTRaWTD4E1V99RLrFzWfTcC+e180hDuNMpqOEo46+lMeW/Wvh7ifOQs+kiK0O2gHxQ +DNxslSavnCs4V7l8HRDJ2La10o70Bo7VLzf1W8MBvv0VTnxB+NjT5qTAbhGFh9Gvp4BaJpmdUf0C +5CEP6dbQlfgxWfzYr69yVT6dPQB+GFEaY03IMY+AcBCs+om1fNxrQXt9zoofMBNFbLhvpNH/JsXW +dGUzfNbO12uswTa5wah8LB18FTQN2/zPHYmvBEoLuyUgZ09VNLJo5YA0kXItVYkLjMe2SixzK4sc +UHv81IK99I91DWx7FwMVKw2xgFp+ZLYB2dnpQQrqwlW64glHUcK2N9BDsnjLSxeZ+UPECh9RxH4W +AcKiZW+cqaKMmhP2WBfR4IcR7NOL32ml11ds87hhV1CZWWFCJAcCidYZz6CZa8exzHojP9SB5RH0 +/v1KdHAisqhSjtJl/UIAHIQ48elOn8wrTdFap4Yb5aHglmMeNx+fAIhDluWVfxTO7H4dTPU+SFVR +MLAh+wwKZfqb94nMeQ== +-----END CERTIFICATE----- + +SECOM TLS ECC Root CA 2024 +========================== +-----BEGIN CERTIFICATE----- +MIICTDCCAdGgAwIBAgIJAIF6LO+PI3pEMAoGCCqGSM49BAMDMFoxCzAJBgNVBAYTAkpQMSYwJAYD +VQQKEx1TRUNPTSBUcnVzdCBTeXN0ZW1zIENvLiwgTHRkLjEjMCEGA1UEAxMaU0VDT00gVExTIEVD +QyBSb290IENBIDIwMjQwHhcNMjQwMTMxMDU1MjM0WhcNNDkwMTE0MDU1MjM0WjBaMQswCQYDVQQG +EwJKUDEmMCQGA1UEChMdU0VDT00gVHJ1c3QgU3lzdGVtcyBDby4sIEx0ZC4xIzAhBgNVBAMTGlNF +Q09NIFRMUyBFQ0MgUm9vdCBDQSAyMDI0MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE7NzFMtu9dzQX +SNC12fabk0+GlC5finB3R7XaZonRUd20aFiWObtuNBCLUZSfk6QXAE55BjEXsXQ/NG8yUqicXjsu +9ksDK3JZBgCwLOVh6+nwJXTvso/dEj/GUYH5mBdoo2MwYTAdBgNVHQ4EFgQUO3YReyl04k4GTFaC +QNAhL3qzydUwHwYDVR0jBBgwFoAUO3YReyl04k4GTFaCQNAhL3qzydUwDgYDVR0PAQH/BAQDAgEG +MA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwMDaQAwZgIxAN3ib8fi1pMYtAPjMilB5e5/H+t5 +CL0xPL+cZ5oTTZuSCjpAn1v7F/VAr8bFxQXAowIxAKsBVO1ACFp7skwzPvdv1EUY5a897WGLT4lb ++bjxFAWyl8wDcZJdwGZ/pAHxt1AJ1g== +-----END CERTIFICATE----- + +Telia EC TLS Root CA v3 +======================= +-----BEGIN CERTIFICATE----- +MIICMjCCAbegAwIBAgIPAYvSIlRjTQSLbOVHH9K1MAoGCCqGSM49BAMDMEoxCzAJBgNVBAYTAlNF +MRkwFwYDVQQKDBBUZWxpYSBDb21wYW55IEFCMSAwHgYDVQQDDBdUZWxpYSBFQyBUTFMgUm9vdCBD +QSB2MzAeFw0yMzExMTUwODU1MjZaFw00ODA1MjMxMTAwMDBaMEoxCzAJBgNVBAYTAlNFMRkwFwYD +VQQKDBBUZWxpYSBDb21wYW55IEFCMSAwHgYDVQQDDBdUZWxpYSBFQyBUTFMgUm9vdCBDQSB2MzB2 +MBAGByqGSM49AgEGBSuBBAAiA2IABMHIlhVDLbmFKUpW0iK4dpryT6emYOeS31JPwWnWPmkWRrAk +TbPX40sQfHI9mpR7Rbktu3ngg6W+BBSXSechtMCnBmWXj/EaVlmV5cY1jD2HoTfhBQ3AacpCNMLJ +K4NpZaNjMGEwHwYDVR0jBBgwFoAU1GToQ4g6cy/QGnGCNgtehd7H3kMwHQYDVR0OBBYEFNRk6EOI +OnMv0BpxgjYLXoXex95DMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49 +BAMDA2kAMGYCMQCXAUdS/9bbJ8A1JYaGf/bWt/s7Ta0ot5Ulno8OjSNYRWQIlS4tVWldvTAVA7he +OFgCMQCvKr8+Z2Rn+OBr5UHzlgBObpad1LuwNTRcdNgUJxIWadcki+UBLEi1/AURKV5md2M= +-----END CERTIFICATE----- + +Telia RSA TLS Root CA v3 +======================== +-----BEGIN CERTIFICATE----- +MIIFgjCCA2qgAwIBAgIPAYvSUKtCVSxHWr2h3BrFMA0GCSqGSIb3DQEBDAUAMEsxCzAJBgNVBAYT +AlNFMRkwFwYDVQQKDBBUZWxpYSBDb21wYW55IEFCMSEwHwYDVQQDDBhUZWxpYSBSU0EgVExTIFJv +b3QgQ0EgdjMwHhcNMjMxMTE1MDk0NzQyWhcNNDgwNTIzMTEwMDAwWjBLMQswCQYDVQQGEwJTRTEZ +MBcGA1UECgwQVGVsaWEgQ29tcGFueSBBQjEhMB8GA1UEAwwYVGVsaWEgUlNBIFRMUyBSb290IENB +IHYzMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAsV89KG19hCf4S1Fvk8D3TyDERhmc +vx8F7Kmb4WATx3ije1id3KHxRE0TKmcNCbAQ57bvHFEYa4hR2l20VjVadExqOW+2ld99MbEiO+jR +VOz+BbxLxJnmGwCqI+BfuTjjVReDxsxjQvjgBsClaO/sm5i70nlZcWGRtIkvWDK3NNkT5RtwXc/O +8NTFVpbUqT6cRjIj3olAblR+lRf4Ffy5o+Q9fabjYn9Z9S4itruElcEFf9Ljk7fwdTycT/rvJW9w +/B3G2a3r0f/zXNOVruIBcqE6pkSospACU2bG42fYKrbM/GWnp7u+p9Frz4jaNwpb4YHuEeS8Brat +NcP8X62jXIvvKHxlsMDJCnb4U8JzFOLsU6mohVY58BdZrvi0Gk9UOuqmgoG6dskHoksjZTlK61D/ +InzmEoA1yAYJFDVysjRxDUOu9cAwANbqmq77WIFL6BpnZgVqPtMfG6wN8BrTKdapvilVsYR59BFg +IsAVBMxrGh+W+QcvmJafUpASvlArKvVG2FI4i6PiLjSBT0+6F6EQLrYqefOQF/fBNEXb+njUQ0SU +VrAqtH4Y+OjCI/a4/JJQppxeemZcQ0SUShgiI5AM5xHO5iyaUrTjYH4zxUz9j+1FEbDH/xpstr1g +XBykspup+hRTaJcbA+UbpJqtWZndAPddJmt6YJQ+dU3pDu8CAwEAAaNjMGEwHwYDVR0jBBgwFoAU +sMep0t2yKFZzBJSMFFxIbzdSkqgwHQYDVR0OBBYEFLDHqdLdsihWcwSUjBRcSG83UpKoMA4GA1Ud +DwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBDAUAA4ICAQBdYzFsNGDRk7bR +/AgRKq+5637YuOW+w6uhpoS0VnKMUpyHCwku86hEvqivakPtfmlm4bFwt++sb/8OXsWBqtfbXMaB +NDTZl8XRMJuLWOW2JrbKkRzgG0eBUcvsadG1rrhbmZqYvFXaAZO7o4TdOZzxhBB5GOAWWXB3Iera +NP4J63zyo9n8Gqw3sJBG44em5hoYjBffP+npibyslnslRi4L6xHsCYj/Pab+OlqbMCB6v+sTCLeE +IukRVzoR9aQ45pEK7Z1QBnSsbAKQtss0JKD9d/mX143H1xePjPhTXlv5JCkhrcj+SShz0P9+EHoW +e6m9lyUEOIVn0rp+yVJWNbmyDv3VkwFxHC1ApSQsgSimjGQ4wtr6cSmordYxkV+Ro8lOIIhRksXP +yDk27gW6IjUXCkZKpxFjkL3jiBSc8SkxnwCWtXg8xwNwdFVNBGLCCuJnsneYXjJNqzRqUcoGwzsv +F3Qi/ZnHUNvISdevlgIAXL4Wvrxaqvoa01wB+GCfs57RTGE4TvAGhKNKus8K3hRT1BSpigzMIRzS +xtAOrqPN6j//QSmW9f8Jcncri4j2ihSpVrFU0NdNkMhZeAKidTFPsxCVFuW4Aniz7jqiw5sWtjbQ +rlW035izIEU4sYwQoC1Nx0Svy+mMTRai50LqFQ+A1/Hq6xHHDNx7CI83d23Erw== +-----END CERTIFICATE----- diff --git a/core/vendor/composer/installed.json b/core/vendor/composer/installed.json index 1f9abacbf5..fb3c31d9ff 100644 --- a/core/vendor/composer/installed.json +++ b/core/vendor/composer/installed.json @@ -149,17 +149,17 @@ }, { "name": "carbonphp/carbon-doctrine-types", - "version": "3.2.0", - "version_normalized": "3.2.0.0", + "version": "3.2.1", + "version_normalized": "3.2.1.0", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", - "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d" + "reference": "5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/18ba5ddfec8976260ead6e866180bd5d2f71aa1d", - "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d", + "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc", + "reference": "5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc", "shasum": "" }, "require": { @@ -173,8 +173,13 @@ "nesbot/carbon": "^2.71.0 || ^3.0.0", "phpunit/phpunit": "^10.3" }, - "time": "2024-02-09T16:56:22+00:00", + "time": "2026-09-06T14:11:38+00:00", "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "installation-source": "dist", "autoload": { "psr-4": { @@ -201,7 +206,7 @@ ], "support": { "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", - "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.0" + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.1" }, "funding": [ { @@ -221,17 +226,17 @@ }, { "name": "composer/ca-bundle", - "version": "1.5.13", - "version_normalized": "1.5.13.0", + "version": "1.5.14", + "version_normalized": "1.5.14.0", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "c008272789979f709f7fcb32c2ecf1d2db5e84e5" + "reference": "0c8abba0634f637bd78c4e451981da368d403463" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/c008272789979f709f7fcb32c2ecf1d2db5e84e5", - "reference": "c008272789979f709f7fcb32c2ecf1d2db5e84e5", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0c8abba0634f637bd78c4e451981da368d403463", + "reference": "0c8abba0634f637bd78c4e451981da368d403463", "shasum": "" }, "require": { @@ -245,7 +250,7 @@ "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, - "time": "2026-07-18T12:35:13+00:00", + "time": "2026-08-21T14:57:29+00:00", "type": "library", "extra": { "branch-alias": { @@ -280,7 +285,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.13" + "source": "https://github.com/composer/ca-bundle/tree/1.5.14" }, "funding": [ { @@ -1153,30 +1158,28 @@ }, { "name": "doctrine/lexer", - "version": "3.0.1", - "version_normalized": "3.0.1.0", + "version": "3.0.2", + "version_normalized": "3.0.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd" + "reference": "e96fe45e92a54233726014a7cc7340abf29bb14c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", - "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/e96fe45e92a54233726014a7cc7340abf29bb14c", + "reference": "e96fe45e92a54233726014a7cc7340abf29bb14c", "shasum": "" }, "require": { "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^12", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^10.5", - "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^5.21" + "doctrine/coding-standard": "^14", + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^10.5.58 || ^12.5.4" }, - "time": "2024-02-05T11:56:58+00:00", + "time": "2026-06-14T20:44:06+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1213,7 +1216,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/3.0.1" + "source": "https://github.com/doctrine/lexer/tree/3.0.2" }, "funding": [ { @@ -1522,27 +1525,27 @@ }, { "name": "graham-campbell/result-type", - "version": "v1.1.4", - "version_normalized": "1.1.4.0", + "version": "v1.2.0", + "version_normalized": "1.2.0.0", "source": { "type": "git", "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b" + "reference": "adccca3324eece92ca35463648c12b9e6293c05b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/e01f4a821471308ba86aa202fed6698b6b695e3b", - "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/adccca3324eece92ca35463648c12b9e6293c05b", + "reference": "adccca3324eece92ca35463648c12b9e6293c05b", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9.5" + "phpoption/phpoption": "^1.10" }, "require-dev": { - "phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7" + "phpunit/phpunit": "^8.5.52 || ^9.6.34 || ^10.5.63 || ^11.5.55 || ^12.5.14" }, - "time": "2025-12-27T19:43:20+00:00", + "time": "2026-08-24T09:06:52+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1571,7 +1574,7 @@ ], "support": { "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.4" + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.2.0" }, "funding": [ { @@ -1587,23 +1590,23 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.15.3", - "version_normalized": "7.15.3.0", + "version": "7.15.5", + "version_normalized": "7.15.5.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc" + "reference": "ee80339fd9177ba44c49cdb653ff02a4d1106b9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc", - "reference": "ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee80339fd9177ba44c49cdb653ff02a4d1106b9a", + "reference": "ee80339fd9177ba44c49cdb653ff02a4d1106b9a", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^2.5.2", - "guzzlehttp/psr7": "^2.13", + "guzzlehttp/promises": "^2.5.3", + "guzzlehttp/psr7": "^2.13.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.5 || ^3.0", @@ -1626,7 +1629,7 @@ "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, - "time": "2026-08-05T19:48:21+00:00", + "time": "2026-08-24T09:21:06+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -1698,7 +1701,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.15.3" + "source": "https://github.com/guzzle/guzzle/tree/7.15.5" }, "funding": [ { @@ -1718,17 +1721,17 @@ }, { "name": "guzzlehttp/promises", - "version": "2.5.2", - "version_normalized": "2.5.2.0", + "version": "2.5.3", + "version_normalized": "2.5.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "2823687acff28b2dbe67b2508a6b300e2c3fa4ce" + "reference": "cde49999552d185d64715fe9c1f77a2aadd2f9f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/2823687acff28b2dbe67b2508a6b300e2c3fa4ce", - "reference": "2823687acff28b2dbe67b2508a6b300e2c3fa4ce", + "url": "https://api.github.com/repos/guzzle/promises/zipball/cde49999552d185d64715fe9c1f77a2aadd2f9f1", + "reference": "cde49999552d185d64715fe9c1f77a2aadd2f9f1", "shasum": "" }, "require": { @@ -1739,7 +1742,7 @@ "bamarni/composer-bin-plugin": "^1.8.2", "phpunit/phpunit": "^8.5.52 || ^9.6.34" }, - "time": "2026-08-05T19:30:54+00:00", + "time": "2026-08-24T09:11:28+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -1785,7 +1788,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.5.2" + "source": "https://github.com/guzzle/promises/tree/2.5.3" }, "funding": [ { @@ -1805,17 +1808,17 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.13.0", - "version_normalized": "2.13.0.0", + "version": "2.13.1", + "version_normalized": "2.13.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "dad89620b7a6edb60c15858442eb2e408b45d8f4" + "reference": "95e7828100de18b4e269fb1703be530082d5166d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/dad89620b7a6edb60c15858442eb2e408b45d8f4", - "reference": "dad89620b7a6edb60c15858442eb2e408b45d8f4", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/95e7828100de18b4e269fb1703be530082d5166d", + "reference": "95e7828100de18b4e269fb1703be530082d5166d", "shasum": "" }, "require": { @@ -1839,7 +1842,7 @@ "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, - "time": "2026-07-16T22:23:49+00:00", + "time": "2026-08-24T09:13:11+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -1907,7 +1910,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.13.0" + "source": "https://github.com/guzzle/psr7/tree/2.13.1" }, "funding": [ { @@ -1927,17 +1930,17 @@ }, { "name": "guzzlehttp/uri-template", - "version": "v1.0.10", - "version_normalized": "1.0.10.0", + "version": "v1.0.11", + "version_normalized": "1.0.11.0", "source": { "type": "git", "url": "https://github.com/guzzle/uri-template.git", - "reference": "f6c24c21f42b990e9a58912b332d0874df6ba839" + "reference": "d0058dccf4299d70c3d9da3378b8908b32780368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/uri-template/zipball/f6c24c21f42b990e9a58912b332d0874df6ba839", - "reference": "f6c24c21f42b990e9a58912b332d0874df6ba839", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/d0058dccf4299d70c3d9da3378b8908b32780368", + "reference": "d0058dccf4299d70c3d9da3378b8908b32780368", "shasum": "" }, "require": { @@ -1949,7 +1952,7 @@ "phpunit/phpunit": "^8.5.52 || ^9.6.34", "uri-template/tests": "1.0.0" }, - "time": "2026-07-17T13:53:03+00:00", + "time": "2026-08-24T09:15:32+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -1996,7 +1999,7 @@ ], "support": { "issues": "https://github.com/guzzle/uri-template/issues", - "source": "https://github.com/guzzle/uri-template/tree/v1.0.10" + "source": "https://github.com/guzzle/uri-template/tree/v1.0.11" }, "funding": [ { @@ -2016,8 +2019,8 @@ }, { "name": "illuminate/bus", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", @@ -2072,8 +2075,8 @@ }, { "name": "illuminate/cache", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/cache.git", @@ -2137,8 +2140,8 @@ }, { "name": "illuminate/collections", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", @@ -2200,8 +2203,8 @@ }, { "name": "illuminate/conditionable", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", @@ -2249,8 +2252,8 @@ }, { "name": "illuminate/config", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/config.git", @@ -2300,17 +2303,17 @@ }, { "name": "illuminate/console", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/console.git", - "reference": "ce37b63fb90f036dbd34263d84725f79c6d6f221" + "reference": "29f41bd7e07c14c04cb5acfaf9dc103adf2084aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/console/zipball/ce37b63fb90f036dbd34263d84725f79c6d6f221", - "reference": "ce37b63fb90f036dbd34263d84725f79c6d6f221", + "url": "https://api.github.com/repos/illuminate/console/zipball/29f41bd7e07c14c04cb5acfaf9dc103adf2084aa", + "reference": "29f41bd7e07c14c04cb5acfaf9dc103adf2084aa", "shasum": "" }, "require": { @@ -2336,7 +2339,7 @@ "illuminate/filesystem": "Required to use the generator command (^12.0).", "illuminate/queue": "Required to use closures for scheduled jobs (^12.0)." }, - "time": "2026-07-29T14:35:23+00:00", + "time": "2026-09-08T13:37:54+00:00", "type": "library", "extra": { "branch-alias": { @@ -2369,8 +2372,8 @@ }, { "name": "illuminate/container", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", @@ -2434,8 +2437,8 @@ }, { "name": "illuminate/contracts", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -2485,17 +2488,17 @@ }, { "name": "illuminate/database", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "6d539459fb55732a13e7f962afeffa9dca2a1cce" + "reference": "499f5112164d5bc4b744e0ac259b44e0a4c8aacc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/6d539459fb55732a13e7f962afeffa9dca2a1cce", - "reference": "6d539459fb55732a13e7f962afeffa9dca2a1cce", + "url": "https://api.github.com/repos/illuminate/database/zipball/499f5112164d5bc4b744e0ac259b44e0a4c8aacc", + "reference": "499f5112164d5bc4b744e0ac259b44e0a4c8aacc", "shasum": "" }, "require": { @@ -2522,7 +2525,7 @@ "illuminate/pagination": "Required to paginate the result set (^12.0).", "symfony/finder": "Required to use Eloquent model factories (^7.2)." }, - "time": "2026-08-14T15:00:48+00:00", + "time": "2026-09-06T21:11:25+00:00", "type": "library", "extra": { "branch-alias": { @@ -2561,8 +2564,8 @@ }, { "name": "illuminate/events", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", @@ -2619,8 +2622,8 @@ }, { "name": "illuminate/filesystem", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/filesystem.git", @@ -2689,17 +2692,17 @@ }, { "name": "illuminate/http", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/http.git", - "reference": "5f4f82ed0ed550a01f5d95c4ddbbad409fb0d560" + "reference": "a91f70083082bd6d466ea229dbbdfc48c553621c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/http/zipball/5f4f82ed0ed550a01f5d95c4ddbbad409fb0d560", - "reference": "5f4f82ed0ed550a01f5d95c4ddbbad409fb0d560", + "url": "https://api.github.com/repos/illuminate/http/zipball/a91f70083082bd6d466ea229dbbdfc48c553621c", + "reference": "a91f70083082bd6d466ea229dbbdfc48c553621c", "shasum": "" }, "require": { @@ -2721,7 +2724,7 @@ "suggest": { "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image()." }, - "time": "2026-08-06T14:28:07+00:00", + "time": "2026-08-24T22:07:52+00:00", "type": "library", "extra": { "branch-alias": { @@ -2754,8 +2757,8 @@ }, { "name": "illuminate/log", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/log.git", @@ -2810,8 +2813,8 @@ }, { "name": "illuminate/macroable", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -2859,8 +2862,8 @@ }, { "name": "illuminate/pagination", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/pagination.git", @@ -2912,8 +2915,8 @@ }, { "name": "illuminate/pipeline", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", @@ -2967,8 +2970,8 @@ }, { "name": "illuminate/queue", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/queue.git", @@ -3037,8 +3040,8 @@ }, { "name": "illuminate/redis", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/redis.git", @@ -3094,8 +3097,8 @@ }, { "name": "illuminate/reflection", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/reflection.git", @@ -3148,8 +3151,8 @@ }, { "name": "illuminate/routing", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/routing.git", @@ -3217,8 +3220,8 @@ }, { "name": "illuminate/session", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/session.git", @@ -3277,8 +3280,8 @@ }, { "name": "illuminate/support", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", @@ -3360,8 +3363,8 @@ }, { "name": "illuminate/translation", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/translation.git", @@ -3414,8 +3417,8 @@ }, { "name": "illuminate/validation", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/validation.git", @@ -3480,8 +3483,8 @@ }, { "name": "illuminate/view", - "version": "v12.67.0", - "version_normalized": "12.67.0.0", + "version": "v12.69.2", + "version_normalized": "12.69.2.0", "source": { "type": "git", "url": "https://github.com/illuminate/view.git", @@ -3597,20 +3600,21 @@ }, { "name": "justinrainbow/json-schema", - "version": "6.10.0", - "version_normalized": "6.10.0.0", + "version": "6.12.0", + "version_normalized": "6.12.0.0", "source": { "type": "git", "url": "https://github.com/jsonrainbow/json-schema.git", - "reference": "8b1308a9d7bdbdb20ce87ef920f82b4564bb2d33" + "reference": "8ef236a1a37df364b518b7411a4b5bb95b040d79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/8b1308a9d7bdbdb20ce87ef920f82b4564bb2d33", - "reference": "8b1308a9d7bdbdb20ce87ef920f82b4564bb2d33", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/8ef236a1a37df364b518b7411a4b5bb95b040d79", + "reference": "8ef236a1a37df364b518b7411a4b5bb95b040d79", "shasum": "" }, "require": { + "ext-filter": "*", "ext-json": "*", "marc-mabe/php-enum": "^4.4", "php": "^7.2 || ^8.0" @@ -3623,7 +3627,7 @@ "phpstan/phpstan": "^1.12", "phpunit/phpunit": "^8.5" }, - "time": "2026-06-16T20:50:26+00:00", + "time": "2026-09-04T12:54:20+00:00", "bin": [ "bin/validate-json" ], @@ -3645,20 +3649,9 @@ ], "authors": [ { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" + "name": "Danny van der Sluijs", + "email": "danny.vandersluijs@icloud.com", + "role": "Maintainer" } ], "description": "A library to validate a json schema.", @@ -3669,23 +3662,23 @@ ], "support": { "issues": "https://github.com/jsonrainbow/json-schema/issues", - "source": "https://github.com/jsonrainbow/json-schema/tree/6.10.0" + "source": "https://github.com/jsonrainbow/json-schema/tree/6.12.0" }, "install-path": "../justinrainbow/json-schema" }, { "name": "laravel/prompts", - "version": "v0.3.23", - "version_normalized": "0.3.23.0", + "version": "v0.3.24", + "version_normalized": "0.3.24.0", "source": { "type": "git", "url": "https://github.com/laravel/prompts.git", - "reference": "b7b4c35e5bc47450f6b6238c6cc9c47ba19b2221" + "reference": "5d3cdef29e93ca3b62b1871359db3078cd99908b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/prompts/zipball/b7b4c35e5bc47450f6b6238c6cc9c47ba19b2221", - "reference": "b7b4c35e5bc47450f6b6238c6cc9c47ba19b2221", + "url": "https://api.github.com/repos/laravel/prompts/zipball/5d3cdef29e93ca3b62b1871359db3078cd99908b", + "reference": "5d3cdef29e93ca3b62b1871359db3078cd99908b", "shasum": "" }, "require": { @@ -3708,7 +3701,7 @@ "suggest": { "ext-pcntl": "Required for the spinner to be animated." }, - "time": "2026-08-11T18:58:24+00:00", + "time": "2026-08-20T12:55:36+00:00", "type": "library", "extra": { "branch-alias": { @@ -3731,23 +3724,23 @@ "description": "Add beautiful and user-friendly forms to your command-line applications.", "support": { "issues": "https://github.com/laravel/prompts/issues", - "source": "https://github.com/laravel/prompts/tree/v0.3.23" + "source": "https://github.com/laravel/prompts/tree/v0.3.24" }, "install-path": "../laravel/prompts" }, { "name": "laravel/serializable-closure", - "version": "v2.0.15", - "version_normalized": "2.0.15.0", + "version": "v2.0.16", + "version_normalized": "2.0.16.0", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "dccd8bcb851bb03fcc005df650b708b57cc52661" + "reference": "7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/dccd8bcb851bb03fcc005df650b708b57cc52661", - "reference": "dccd8bcb851bb03fcc005df650b708b57cc52661", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed", + "reference": "7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed", "shasum": "" }, "require": { @@ -3760,7 +3753,7 @@ "phpstan/phpstan": "^2.0", "symfony/var-dumper": "^6.2.0|^7.0.0|^8.0.0" }, - "time": "2026-07-21T16:49:22+00:00", + "time": "2026-08-18T20:28:54+00:00", "type": "library", "extra": { "branch-alias": { @@ -3801,17 +3794,17 @@ }, { "name": "league/flysystem", - "version": "3.35.2", - "version_normalized": "3.35.2.0", + "version": "3.36.0", + "version_normalized": "3.36.0.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "b277b5dc3d56650b68904117124e79c851e12376" + "reference": "f7fb152932f30072d573510cbd4dd657d6475b25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/b277b5dc3d56650b68904117124e79c851e12376", - "reference": "b277b5dc3d56650b68904117124e79c851e12376", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f7fb152932f30072d573510cbd4dd657d6475b25", + "reference": "f7fb152932f30072d573510cbd4dd657d6475b25", "shasum": "" }, "require": { @@ -3847,7 +3840,7 @@ "phpunit/phpunit": "^9.5.11|^10.0", "sabre/dav": "^4.6.0" }, - "time": "2026-07-06T14:42:07+00:00", + "time": "2026-09-02T08:00:27+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -3881,23 +3874,23 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.35.2" + "source": "https://github.com/thephpleague/flysystem/tree/3.36.0" }, "install-path": "../league/flysystem" }, { "name": "league/flysystem-local", - "version": "3.31.0", - "version_normalized": "3.31.0.0", + "version": "3.35.3", + "version_normalized": "3.35.3.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-local.git", - "reference": "2f669db18a4c20c755c2bb7d3a7b0b2340488079" + "reference": "a099b24dce160f3b2239043d13d47c4a1a214ea4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/2f669db18a4c20c755c2bb7d3a7b0b2340488079", - "reference": "2f669db18a4c20c755c2bb7d3a7b0b2340488079", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/a099b24dce160f3b2239043d13d47c4a1a214ea4", + "reference": "a099b24dce160f3b2239043d13d47c4a1a214ea4", "shasum": "" }, "require": { @@ -3906,7 +3899,7 @@ "league/mime-type-detection": "^1.0.0", "php": "^8.0.2" }, - "time": "2026-01-23T15:30:45+00:00", + "time": "2026-08-12T13:29:21+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -3933,7 +3926,7 @@ "local" ], "support": { - "source": "https://github.com/thephpleague/flysystem-local/tree/3.31.0" + "source": "https://github.com/thephpleague/flysystem-local/tree/3.35.3" }, "install-path": "../league/flysystem-local" }, @@ -4074,17 +4067,17 @@ }, { "name": "monolog/monolog", - "version": "3.10.0", - "version_normalized": "3.10.0.0", + "version": "3.12.0", + "version_normalized": "3.12.0.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0" + "reference": "72c534fc0ab181ef52d92a68382318631e301608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/b321dd6749f0bf7189444158a3ce785cc16d69b0", - "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/72c534fc0ab181ef52d92a68382318631e301608", + "reference": "72c534fc0ab181ef52d92a68382318631e301608", "shasum": "" }, "require": { @@ -4110,6 +4103,7 @@ "phpstan/phpstan-strict-rules": "^2", "phpunit/phpunit": "^10.5.17 || ^11.0.7", "predis/predis": "^1.1 || ^2", + "psr/clock": "^1.0", "rollbar/rollbar": "^4.0", "ruflin/elastica": "^7 || ^8", "symfony/mailer": "^5.4 || ^6", @@ -4128,10 +4122,11 @@ "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "psr/clock": "Required to pass a clock to the Logger and control the timestamp of log records", "rollbar/rollbar": "Allow sending log messages to Rollbar", "ruflin/elastica": "Allow sending log messages to an Elastic Search server" }, - "time": "2026-01-02T08:56:05+00:00", + "time": "2026-09-09T08:34:20+00:00", "type": "library", "extra": { "branch-alias": { @@ -4164,7 +4159,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.10.0" + "source": "https://github.com/Seldaek/monolog/tree/3.12.0" }, "funding": [ { @@ -4180,17 +4175,17 @@ }, { "name": "nesbot/carbon", - "version": "3.13.2", - "version_normalized": "3.13.2.0", + "version": "3.14.0", + "version_normalized": "3.14.0.0", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon.git", - "reference": "a1c54919f5fff9800cd03c32bd01defd5a4061cb" + "reference": "0023eaa2c9110e47446dd512a263c69c40cd41f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/a1c54919f5fff9800cd03c32bd01defd5a4061cb", - "reference": "a1c54919f5fff9800cd03c32bd01defd5a4061cb", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/0023eaa2c9110e47446dd512a263c69c40cd41f2", + "reference": "0023eaa2c9110e47446dd512a263c69c40cd41f2", "shasum": "" }, "require": { @@ -4216,7 +4211,7 @@ "phpunit/phpunit": "^10.5.53", "squizlabs/php_codesniffer": "^3.13.4 || ^4.0.0" }, - "time": "2026-08-08T11:40:35+00:00", + "time": "2026-09-12T20:45:19+00:00", "bin": [ "bin/carbon" ], @@ -4463,17 +4458,17 @@ }, { "name": "phpoption/phpoption", - "version": "1.9.5", - "version_normalized": "1.9.5.0", + "version": "1.10.0", + "version_normalized": "1.10.0.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "75365b91986c2405cf5e1e012c5595cd487a98be" + "reference": "67b192b6a42ec03944b972d6e633ddec78ad2c6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/75365b91986c2405cf5e1e012c5595cd487a98be", - "reference": "75365b91986c2405cf5e1e012c5595cd487a98be", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/67b192b6a42ec03944b972d6e633ddec78ad2c6d", + "reference": "67b192b6a42ec03944b972d6e633ddec78ad2c6d", "shasum": "" }, "require": { @@ -4481,9 +4476,9 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.44 || ^9.6.25 || ^10.5.53 || ^11.5.34" + "phpunit/phpunit": "^8.5.54 || ^9.6.36 || ^10.5.64 || ^11.5.56 || ^12.5.33" }, - "time": "2025-12-27T19:41:33+00:00", + "time": "2026-08-24T00:54:40+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -4525,7 +4520,7 @@ ], "support": { "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.5" + "source": "https://github.com/schmittjoh/php-option/tree/1.10.0" }, "funding": [ { @@ -4541,17 +4536,17 @@ }, { "name": "predis/predis", - "version": "v3.6.0", - "version_normalized": "3.6.0.0", + "version": "v3.6.1", + "version_normalized": "3.6.1.0", "source": { "type": "git", "url": "https://github.com/predis/predis.git", - "reference": "2ff20c08bb63697245ffee3f198d1673086c302d" + "reference": "e2db96312ecf57a01a3477bf192d1ebc0ad7e9fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/predis/predis/zipball/2ff20c08bb63697245ffee3f198d1673086c302d", - "reference": "2ff20c08bb63697245ffee3f198d1673086c302d", + "url": "https://api.github.com/repos/predis/predis/zipball/e2db96312ecf57a01a3477bf192d1ebc0ad7e9fb", + "reference": "e2db96312ecf57a01a3477bf192d1ebc0ad7e9fb", "shasum": "" }, "require": { @@ -4567,7 +4562,7 @@ "suggest": { "ext-relay": "Faster connection with in-memory caching (>=0.6.2)" }, - "time": "2026-08-14T23:07:56+00:00", + "time": "2026-09-17T20:41:00+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4595,7 +4590,7 @@ ], "support": { "issues": "https://github.com/predis/predis/issues", - "source": "https://github.com/predis/predis/tree/v3.6.0" + "source": "https://github.com/predis/predis/tree/v3.6.1" }, "funding": [ { @@ -5221,21 +5216,21 @@ }, { "name": "ramsey/uuid", - "version": "4.9.3", - "version_normalized": "4.9.3.0", + "version": "4.9.4", + "version_normalized": "4.9.4.0", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "1df15849d00943a67d677dc9cfd80795f038c9f8" + "reference": "75d73f48d02797c2c285a7e9f348fadc0102ffe2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/1df15849d00943a67d677dc9cfd80795f038c9f8", - "reference": "1df15849d00943a67d677dc9cfd80795f038c9f8", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/75d73f48d02797c2c285a7e9f348fadc0102ffe2", + "reference": "75d73f48d02797c2c285a7e9f348fadc0102ffe2", "shasum": "" }, "require": { - "brick/math": ">=0.8.16 <=0.18", + "brick/math": "^0.8.16 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14 || ^0.15 || ^0.16 || ^0.17 || ^0.18 || ^0.19 || ^0.20 || ^1.0", "php": "^8.0", "ramsey/collection": "^1.2 || ^2.0" }, @@ -5268,7 +5263,7 @@ "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." }, - "time": "2026-06-18T03:57:49+00:00", + "time": "2026-09-16T11:39:30+00:00", "type": "library", "extra": { "captainhook": { @@ -5296,7 +5291,7 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.9.3" + "source": "https://github.com/ramsey/uuid/tree/4.9.4" }, "install-path": "../ramsey/uuid" }, @@ -6271,17 +6266,17 @@ }, { "name": "symfony/console", - "version": "v7.4.16", - "version_normalized": "7.4.16.0", + "version": "v7.4.19", + "version_normalized": "7.4.19.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f4c69c9aed03abf933b294257d618bdd9b30a06d" + "reference": "3a1973458b153f566a8d7499bc06ece323d60063" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f4c69c9aed03abf933b294257d618bdd9b30a06d", - "reference": "f4c69c9aed03abf933b294257d618bdd9b30a06d", + "url": "https://api.github.com/repos/symfony/console/zipball/3a1973458b153f566a8d7499bc06ece323d60063", + "reference": "3a1973458b153f566a8d7499bc06ece323d60063", "shasum": "" }, "require": { @@ -6314,7 +6309,7 @@ "symfony/stopwatch": "^6.4|^7.0|^8.0", "symfony/var-dumper": "^6.4|^7.0|^8.0" }, - "time": "2026-07-31T12:37:14+00:00", + "time": "2026-09-13T10:38:41+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6348,7 +6343,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.4.16" + "source": "https://github.com/symfony/console/tree/v7.4.19" }, "funding": [ { @@ -6446,17 +6441,17 @@ }, { "name": "symfony/error-handler", - "version": "v7.4.15", - "version_normalized": "7.4.15.0", + "version": "v7.4.17", + "version_normalized": "7.4.17.0", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "d49f6a19f326db41ae7103bdc38e3eb35a791261" + "reference": "8373921e231e190a88e2ad526951bbaa791576fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/d49f6a19f326db41ae7103bdc38e3eb35a791261", - "reference": "d49f6a19f326db41ae7103bdc38e3eb35a791261", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/8373921e231e190a88e2ad526951bbaa791576fa", + "reference": "8373921e231e190a88e2ad526951bbaa791576fa", "shasum": "" }, "require": { @@ -6476,7 +6471,7 @@ "symfony/serializer": "^6.4|^7.0|^8.0", "symfony/webpack-encore-bundle": "^1.0|^2.0" }, - "time": "2026-07-21T15:13:06+00:00", + "time": "2026-08-21T17:40:08+00:00", "bin": [ "Resources/bin/patch-type-declarations" ], @@ -6507,7 +6502,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v7.4.15" + "source": "https://github.com/symfony/error-handler/tree/v7.4.17" }, "funding": [ { @@ -6531,17 +6526,17 @@ }, { "name": "symfony/event-dispatcher", - "version": "v7.4.15", - "version_normalized": "7.4.15.0", + "version": "v7.4.17", + "version_normalized": "7.4.17.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "336e7f3b9e95aba04f93ea9143920c2186abfbb9" + "reference": "d269974ee93c61d03620ffee358355bfdb471d66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/336e7f3b9e95aba04f93ea9143920c2186abfbb9", - "reference": "336e7f3b9e95aba04f93ea9143920c2186abfbb9", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d269974ee93c61d03620ffee358355bfdb471d66", + "reference": "d269974ee93c61d03620ffee358355bfdb471d66", "shasum": "" }, "require": { @@ -6567,7 +6562,7 @@ "symfony/service-contracts": "^2.5|^3", "symfony/stopwatch": "^6.4|^7.0|^8.0" }, - "time": "2026-07-21T15:13:06+00:00", + "time": "2026-08-21T17:40:08+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6595,7 +6590,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v7.4.15" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.4.17" }, "funding": [ { @@ -6702,17 +6697,17 @@ }, { "name": "symfony/filesystem", - "version": "v7.4.15", - "version_normalized": "7.4.15.0", + "version": "v7.4.18", + "version_normalized": "7.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "ff16a16bf87fdf264638b8f6995b3515975e3c79" + "reference": "90d412aa5277c6819db39e7605aa46b1019e3232" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/ff16a16bf87fdf264638b8f6995b3515975e3c79", - "reference": "ff16a16bf87fdf264638b8f6995b3515975e3c79", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/90d412aa5277c6819db39e7605aa46b1019e3232", + "reference": "90d412aa5277c6819db39e7605aa46b1019e3232", "shasum": "" }, "require": { @@ -6723,7 +6718,7 @@ "require-dev": { "symfony/process": "^6.4|^7.0|^8.0" }, - "time": "2026-07-22T07:36:05+00:00", + "time": "2026-08-23T10:03:40+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6751,7 +6746,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.4.15" + "source": "https://github.com/symfony/filesystem/tree/v7.4.18" }, "funding": [ { @@ -6775,17 +6770,17 @@ }, { "name": "symfony/finder", - "version": "v7.4.14", - "version_normalized": "7.4.14.0", + "version": "v7.4.19", + "version_normalized": "7.4.19.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "13b38720174286f55d1761152b575a8d1436fc25" + "reference": "1b900bc6ae5ba60c5eee69c11ba44566190576fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/13b38720174286f55d1761152b575a8d1436fc25", - "reference": "13b38720174286f55d1761152b575a8d1436fc25", + "url": "https://api.github.com/repos/symfony/finder/zipball/1b900bc6ae5ba60c5eee69c11ba44566190576fe", + "reference": "1b900bc6ae5ba60c5eee69c11ba44566190576fe", "shasum": "" }, "require": { @@ -6794,7 +6789,7 @@ "require-dev": { "symfony/filesystem": "^6.4|^7.0|^8.0" }, - "time": "2026-06-27T08:31:18+00:00", + "time": "2026-09-10T19:14:10+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6822,7 +6817,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.4.14" + "source": "https://github.com/symfony/finder/tree/v7.4.19" }, "funding": [ { @@ -6846,17 +6841,17 @@ }, { "name": "symfony/http-foundation", - "version": "v7.4.16", - "version_normalized": "7.4.16.0", + "version": "v7.4.19", + "version_normalized": "7.4.19.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "b676451bb638e99a7d34d8a2be90406822e301eb" + "reference": "f7b953be7801974a5a0685e1228bbc3b12b35936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b676451bb638e99a7d34d8a2be90406822e301eb", - "reference": "b676451bb638e99a7d34d8a2be90406822e301eb", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/f7b953be7801974a5a0685e1228bbc3b12b35936", + "reference": "f7b953be7801974a5a0685e1228bbc3b12b35936", "shasum": "" }, "require": { @@ -6879,7 +6874,7 @@ "symfony/mime": "^6.4|^7.0|^8.0", "symfony/rate-limiter": "^6.4|^7.0|^8.0" }, - "time": "2026-08-07T11:50:27+00:00", + "time": "2026-09-14T17:41:17+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6907,7 +6902,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v7.4.16" + "source": "https://github.com/symfony/http-foundation/tree/v7.4.19" }, "funding": [ { @@ -6931,17 +6926,17 @@ }, { "name": "symfony/http-kernel", - "version": "v7.4.16", - "version_normalized": "7.4.16.0", + "version": "v7.4.19", + "version_normalized": "7.4.19.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "f5e728670fa2218ae8be8ea91f2b44b7d6e5304c" + "reference": "683507424cc84ca85ac1551adb609b6b98216667" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f5e728670fa2218ae8be8ea91f2b44b7d6e5304c", - "reference": "f5e728670fa2218ae8be8ea91f2b44b7d6e5304c", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/683507424cc84ca85ac1551adb609b6b98216667", + "reference": "683507424cc84ca85ac1551adb609b6b98216667", "shasum": "" }, "require": { @@ -7001,7 +6996,7 @@ "symfony/var-exporter": "^6.4|^7.0|^8.0", "twig/twig": "^3.12|^4.0" }, - "time": "2026-08-07T18:00:13+00:00", + "time": "2026-09-15T07:09:35+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -7029,7 +7024,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v7.4.16" + "source": "https://github.com/symfony/http-kernel/tree/v7.4.19" }, "funding": [ { @@ -7053,17 +7048,17 @@ }, { "name": "symfony/mime", - "version": "v7.4.16", - "version_normalized": "7.4.16.0", + "version": "v7.4.19", + "version_normalized": "7.4.19.0", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "20094b76a7106dbe978d31cd3bd7aa1ed248d0e5" + "reference": "f8ac7d0a800bcabbcd1f7de56594cf05e6cd5693" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/20094b76a7106dbe978d31cd3bd7aa1ed248d0e5", - "reference": "20094b76a7106dbe978d31cd3bd7aa1ed248d0e5", + "url": "https://api.github.com/repos/symfony/mime/zipball/f8ac7d0a800bcabbcd1f7de56594cf05e6cd5693", + "reference": "f8ac7d0a800bcabbcd1f7de56594cf05e6cd5693", "shasum": "" }, "require": { @@ -7087,9 +7082,9 @@ "symfony/process": "^6.4|^7.0|^8.0", "symfony/property-access": "^6.4|^7.0|^8.0", "symfony/property-info": "^6.4|^7.0|^8.0", - "symfony/serializer": "^6.4.3|^7.0.3|^8.0" + "symfony/serializer": "^6.4.44|^7.4.17|^8.1.5" }, - "time": "2026-08-07T14:56:57+00:00", + "time": "2026-09-04T10:45:44+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -7121,7 +7116,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v7.4.16" + "source": "https://github.com/symfony/mime/tree/v7.4.19" }, "funding": [ { @@ -7316,17 +7311,17 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.38.1", - "version_normalized": "1.38.1.0", + "version": "v1.42.0", + "version_normalized": "1.42.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "dc21118016c039a66235cf93d96b435ffb282412" + "reference": "51b5ff5ba85452b31ec6f55490b08148612339d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/dc21118016c039a66235cf93d96b435ffb282412", - "reference": "dc21118016c039a66235cf93d96b435ffb282412", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/51b5ff5ba85452b31ec6f55490b08148612339d9", + "reference": "51b5ff5ba85452b31ec6f55490b08148612339d9", "shasum": "" }, "require": { @@ -7336,7 +7331,7 @@ "suggest": { "ext-intl": "For best performance" }, - "time": "2026-05-25T15:22:23+00:00", + "time": "2026-08-24T10:51:20+00:00", "type": "library", "extra": { "thanks": { @@ -7382,7 +7377,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.38.1" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.42.0" }, "funding": [ { @@ -7406,17 +7401,17 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.38.0", - "version_normalized": "1.38.0.0", + "version": "v1.42.0", + "version_normalized": "1.42.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b" + "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/2d446c214bdbe5b71bde5011b060a05fece3ae6b", - "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/aa20edea75bd9c48cfecc8360922e5a6e5c44502", + "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502", "shasum": "" }, "require": { @@ -7425,7 +7420,7 @@ "suggest": { "ext-intl": "For best performance" }, - "time": "2026-05-25T13:48:31+00:00", + "time": "2026-08-07T06:33:24+00:00", "type": "library", "extra": { "thanks": { @@ -7470,7 +7465,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.38.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.42.0" }, "funding": [ { @@ -7748,23 +7743,23 @@ }, { "name": "symfony/process", - "version": "v7.4.13", - "version_normalized": "7.4.13.0", + "version": "v7.4.19", + "version_normalized": "7.4.19.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "f5804be144caceb570f6747519999636b664f24c" + "reference": "ed0ae095b86994d370d5791612e55984f15aa30e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/f5804be144caceb570f6747519999636b664f24c", - "reference": "f5804be144caceb570f6747519999636b664f24c", + "url": "https://api.github.com/repos/symfony/process/zipball/ed0ae095b86994d370d5791612e55984f15aa30e", + "reference": "ed0ae095b86994d370d5791612e55984f15aa30e", "shasum": "" }, "require": { "php": ">=8.2" }, - "time": "2026-05-23T16:05:06+00:00", + "time": "2026-09-02T12:38:34+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -7792,7 +7787,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.4.13" + "source": "https://github.com/symfony/process/tree/v7.4.19" }, "funding": [ { @@ -7816,17 +7811,17 @@ }, { "name": "symfony/routing", - "version": "v7.4.15", - "version_normalized": "7.4.15.0", + "version": "v7.4.18", + "version_normalized": "7.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "80c0a93d3f8e7499f716204a1fb38ead942a7a2b" + "reference": "ddd558991e98f693ae6bf5063cc1b0362c6bbec3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/80c0a93d3f8e7499f716204a1fb38ead942a7a2b", - "reference": "80c0a93d3f8e7499f716204a1fb38ead942a7a2b", + "url": "https://api.github.com/repos/symfony/routing/zipball/ddd558991e98f693ae6bf5063cc1b0362c6bbec3", + "reference": "ddd558991e98f693ae6bf5063cc1b0362c6bbec3", "shasum": "" }, "require": { @@ -7846,7 +7841,7 @@ "symfony/http-foundation": "^6.4|^7.0|^8.0", "symfony/yaml": "^6.4|^7.0|^8.0" }, - "time": "2026-07-21T15:13:06+00:00", + "time": "2026-08-17T13:12:36+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -7880,7 +7875,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v7.4.15" + "source": "https://github.com/symfony/routing/tree/v7.4.18" }, "funding": [ { @@ -7904,17 +7899,17 @@ }, { "name": "symfony/service-contracts", - "version": "v3.7.1", - "version_normalized": "3.7.1.0", + "version": "v3.7.3", + "version_normalized": "3.7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0" + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/c0a284bab1ed8aa0417e3d69250ab437739563a0", - "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", "shasum": "" }, "require": { @@ -7925,7 +7920,7 @@ "conflict": { "ext-psr": "<1.1|>=2" }, - "time": "2026-06-16T09:55:08+00:00", + "time": "2026-07-27T15:39:01+00:00", "type": "library", "extra": { "thanks": { @@ -7970,7 +7965,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.7.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.7.3" }, "funding": [ { @@ -7994,17 +7989,17 @@ }, { "name": "symfony/string", - "version": "v7.4.15", - "version_normalized": "7.4.15.0", + "version": "v7.4.19", + "version_normalized": "7.4.19.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "e394af32256bf9e7bf80849d95e589167c10097b" + "reference": "02731ce2bd26514bec9efc0baef2cd0b0cf67f46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/e394af32256bf9e7bf80849d95e589167c10097b", - "reference": "e394af32256bf9e7bf80849d95e589167c10097b", + "url": "https://api.github.com/repos/symfony/string/zipball/02731ce2bd26514bec9efc0baef2cd0b0cf67f46", + "reference": "02731ce2bd26514bec9efc0baef2cd0b0cf67f46", "shasum": "" }, "require": { @@ -8025,7 +8020,7 @@ "symfony/translation-contracts": "^2.5|^3.0", "symfony/var-exporter": "^6.4|^7.0|^8.0" }, - "time": "2026-07-28T07:33:02+00:00", + "time": "2026-09-11T14:46:58+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -8064,7 +8059,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.4.15" + "source": "https://github.com/symfony/string/tree/v7.4.19" }, "funding": [ { @@ -8088,17 +8083,17 @@ }, { "name": "symfony/translation", - "version": "v7.4.16", - "version_normalized": "7.4.16.0", + "version": "v7.4.17", + "version_normalized": "7.4.17.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "501e0ff4553c744209ca1a68790d8a4541563710" + "reference": "2ee1e4a3b32a528a642babe041ff7c440b213b4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/501e0ff4553c744209ca1a68790d8a4541563710", - "reference": "501e0ff4553c744209ca1a68790d8a4541563710", + "url": "https://api.github.com/repos/symfony/translation/zipball/2ee1e4a3b32a528a642babe041ff7c440b213b4b", + "reference": "2ee1e4a3b32a528a642babe041ff7c440b213b4b", "shasum": "" }, "require": { @@ -8136,7 +8131,7 @@ "symfony/service-contracts": "^2.5|^3", "symfony/yaml": "^6.4|^7.0|^8.0" }, - "time": "2026-07-30T12:37:26+00:00", + "time": "2026-08-21T17:40:08+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -8167,7 +8162,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v7.4.16" + "source": "https://github.com/symfony/translation/tree/v7.4.17" }, "funding": [ { @@ -8276,17 +8271,17 @@ }, { "name": "symfony/var-dumper", - "version": "v7.4.15", - "version_normalized": "7.4.15.0", + "version": "v7.4.18", + "version_normalized": "7.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "04ba4add636a95ff437af3a5a9499bb1d6c6d4bd" + "reference": "e088da50b813f32473a76871616cbb8fa54653a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/04ba4add636a95ff437af3a5a9499bb1d6c6d4bd", - "reference": "04ba4add636a95ff437af3a5a9499bb1d6c6d4bd", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e088da50b813f32473a76871616cbb8fa54653a8", + "reference": "e088da50b813f32473a76871616cbb8fa54653a8", "shasum": "" }, "require": { @@ -8304,7 +8299,7 @@ "symfony/uid": "^6.4|^7.0|^8.0", "twig/twig": "^3.12|^4.0" }, - "time": "2026-07-21T15:13:06+00:00", + "time": "2026-08-30T20:10:52+00:00", "bin": [ "Resources/bin/var-dump-server" ], @@ -8342,7 +8337,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v7.4.15" + "source": "https://github.com/symfony/var-dumper/tree/v7.4.18" }, "funding": [ { @@ -8449,24 +8444,24 @@ }, { "name": "vlucas/phpdotenv", - "version": "v5.6.4", - "version_normalized": "5.6.4.0", + "version": "v5.7.0", + "version_normalized": "5.7.0.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "416df702837983f8d5ff48c9c3fee4f5f57b980b" + "reference": "301c07936b16d88628b126b01d082ba153cf4c40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/416df702837983f8d5ff48c9c3fee4f5f57b980b", - "reference": "416df702837983f8d5ff48c9c3fee4f5f57b980b", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/301c07936b16d88628b126b01d082ba153cf4c40", + "reference": "301c07936b16d88628b126b01d082ba153cf4c40", "shasum": "" }, "require": { "ext-pcre": "*", - "graham-campbell/result-type": "^1.1.4", + "graham-campbell/result-type": "^1.2", "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9.5", + "phpoption/phpoption": "^1.10", "symfony/polyfill-ctype": "^1.26", "symfony/polyfill-mbstring": "^1.26", "symfony/polyfill-php80": "^1.26" @@ -8479,7 +8474,7 @@ "suggest": { "ext-filter": "Required to use the boolean validator." }, - "time": "2026-07-06T19:11:50+00:00", + "time": "2026-08-24T18:07:49+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -8512,7 +8507,7 @@ "homepage": "https://github.com/vlucas" } ], - "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "description": "Loads environment variables from `.env` to `$_ENV` and `$_SERVER` automagically, and optionally to `getenv()`.", "keywords": [ "dotenv", "env", @@ -8520,7 +8515,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.4" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.7.0" }, "funding": [ { diff --git a/core/vendor/composer/installed.php b/core/vendor/composer/installed.php index 99d43e9208..47c0ba5217 100644 --- a/core/vendor/composer/installed.php +++ b/core/vendor/composer/installed.php @@ -29,18 +29,18 @@ 'dev_requirement' => false, ), 'carbonphp/carbon-doctrine-types' => array( - 'pretty_version' => '3.2.0', - 'version' => '3.2.0.0', - 'reference' => '18ba5ddfec8976260ead6e866180bd5d2f71aa1d', + 'pretty_version' => '3.2.1', + 'version' => '3.2.1.0', + 'reference' => '5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc', 'type' => 'library', 'install_path' => __DIR__ . '/../carbonphp/carbon-doctrine-types', 'aliases' => array(), 'dev_requirement' => false, ), 'composer/ca-bundle' => array( - 'pretty_version' => '1.5.13', - 'version' => '1.5.13.0', - 'reference' => 'c008272789979f709f7fcb32c2ecf1d2db5e84e5', + 'pretty_version' => '1.5.14', + 'version' => '1.5.14.0', + 'reference' => '0c8abba0634f637bd78c4e451981da368d403463', 'type' => 'library', 'install_path' => __DIR__ . '/./ca-bundle', 'aliases' => array(), @@ -146,9 +146,9 @@ 'dev_requirement' => false, ), 'doctrine/lexer' => array( - 'pretty_version' => '3.0.1', - 'version' => '3.0.1.0', - 'reference' => '31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd', + 'pretty_version' => '3.0.2', + 'version' => '3.0.2.0', + 'reference' => 'e96fe45e92a54233726014a7cc7340abf29bb14c', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/lexer', 'aliases' => array(), @@ -209,53 +209,53 @@ 'dev_requirement' => false, ), 'graham-campbell/result-type' => array( - 'pretty_version' => 'v1.1.4', - 'version' => '1.1.4.0', - 'reference' => 'e01f4a821471308ba86aa202fed6698b6b695e3b', + 'pretty_version' => 'v1.2.0', + 'version' => '1.2.0.0', + 'reference' => 'adccca3324eece92ca35463648c12b9e6293c05b', 'type' => 'library', 'install_path' => __DIR__ . '/../graham-campbell/result-type', 'aliases' => array(), 'dev_requirement' => false, ), 'guzzlehttp/guzzle' => array( - 'pretty_version' => '7.15.3', - 'version' => '7.15.3.0', - 'reference' => 'ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc', + 'pretty_version' => '7.15.5', + 'version' => '7.15.5.0', + 'reference' => 'ee80339fd9177ba44c49cdb653ff02a4d1106b9a', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', 'aliases' => array(), 'dev_requirement' => false, ), 'guzzlehttp/promises' => array( - 'pretty_version' => '2.5.2', - 'version' => '2.5.2.0', - 'reference' => '2823687acff28b2dbe67b2508a6b300e2c3fa4ce', + 'pretty_version' => '2.5.3', + 'version' => '2.5.3.0', + 'reference' => 'cde49999552d185d64715fe9c1f77a2aadd2f9f1', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/promises', 'aliases' => array(), 'dev_requirement' => false, ), 'guzzlehttp/psr7' => array( - 'pretty_version' => '2.13.0', - 'version' => '2.13.0.0', - 'reference' => 'dad89620b7a6edb60c15858442eb2e408b45d8f4', + 'pretty_version' => '2.13.1', + 'version' => '2.13.1.0', + 'reference' => '95e7828100de18b4e269fb1703be530082d5166d', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), 'dev_requirement' => false, ), 'guzzlehttp/uri-template' => array( - 'pretty_version' => 'v1.0.10', - 'version' => '1.0.10.0', - 'reference' => 'f6c24c21f42b990e9a58912b332d0874df6ba839', + 'pretty_version' => 'v1.0.11', + 'version' => '1.0.11.0', + 'reference' => 'd0058dccf4299d70c3d9da3378b8908b32780368', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/uri-template', 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/bus' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => '9e70f409c744e0ba6b301fa608bb5b3c8c38669a', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/bus', @@ -263,8 +263,8 @@ 'dev_requirement' => false, ), 'illuminate/cache' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => '2689356ab45bc53ffe796d1b1241babae59c69f6', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/cache', @@ -272,8 +272,8 @@ 'dev_requirement' => false, ), 'illuminate/collections' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => '83313b009c4afb6f02dbc090bdb67809756eefa2', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/collections', @@ -281,8 +281,8 @@ 'dev_requirement' => false, ), 'illuminate/conditionable' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => 'ec677967c1f2faf90b8428919124d2184a4c9b49', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/conditionable', @@ -290,8 +290,8 @@ 'dev_requirement' => false, ), 'illuminate/config' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => '7adbf5cc27081d4613e1fa2f4f53e2a4fc91ad53', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/config', @@ -299,17 +299,17 @@ 'dev_requirement' => false, ), 'illuminate/console' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', - 'reference' => 'ce37b63fb90f036dbd34263d84725f79c6d6f221', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', + 'reference' => '29f41bd7e07c14c04cb5acfaf9dc103adf2084aa', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/console', 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/container' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => '9abe9dba6b3f5220205ce143069c975a601e4294', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', @@ -317,8 +317,8 @@ 'dev_requirement' => false, ), 'illuminate/contracts' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => 'c16fd7ba7d8e6b8f336639ceb6b7e1ff6ed0efb5', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', @@ -326,17 +326,17 @@ 'dev_requirement' => false, ), 'illuminate/database' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', - 'reference' => '6d539459fb55732a13e7f962afeffa9dca2a1cce', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', + 'reference' => '499f5112164d5bc4b744e0ac259b44e0a4c8aacc', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/database', 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/events' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => 'ff22aa6017bdbd90ace660f50638ed9c580ba555', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/events', @@ -344,8 +344,8 @@ 'dev_requirement' => false, ), 'illuminate/filesystem' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => 'dc0b7440f12753060b574fa8c20c2db259fa37c9', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/filesystem', @@ -353,17 +353,17 @@ 'dev_requirement' => false, ), 'illuminate/http' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', - 'reference' => '5f4f82ed0ed550a01f5d95c4ddbbad409fb0d560', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', + 'reference' => 'a91f70083082bd6d466ea229dbbdfc48c553621c', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/http', 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/log' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => '0309c15e63d07c05218b622caa514f3ed6b226a6', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/log', @@ -371,8 +371,8 @@ 'dev_requirement' => false, ), 'illuminate/macroable' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => 'e295d62d89dcdb87e2b1bd70dd14d074a0ed73cc', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/macroable', @@ -380,8 +380,8 @@ 'dev_requirement' => false, ), 'illuminate/pagination' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => '8327d828676654053906a771abf5eea5426354ec', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/pagination', @@ -389,8 +389,8 @@ 'dev_requirement' => false, ), 'illuminate/pipeline' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => 'b6a14c20d69a44bf0a6fba664a00d23ca71770ee', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/pipeline', @@ -398,8 +398,8 @@ 'dev_requirement' => false, ), 'illuminate/queue' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => '64171cef7be5f3ac660484de502e48c566b6feca', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/queue', @@ -407,8 +407,8 @@ 'dev_requirement' => false, ), 'illuminate/redis' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => 'e46d4c3806d78d4d7733cd9b9bfb2fef30f4c8cb', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/redis', @@ -416,8 +416,8 @@ 'dev_requirement' => false, ), 'illuminate/reflection' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => '348cf5da9de89b596d7723be6425fb048e2bf4bb', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/reflection', @@ -425,8 +425,8 @@ 'dev_requirement' => false, ), 'illuminate/routing' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => '5d3cc9beca82c359f16e6c1d072903087e428ca1', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/routing', @@ -434,8 +434,8 @@ 'dev_requirement' => false, ), 'illuminate/session' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => '98802e67dd5e059c0b978b3fe8f5f0a3ac17ec4e', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/session', @@ -443,8 +443,8 @@ 'dev_requirement' => false, ), 'illuminate/support' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => '7d7a7d2dc5084aa4b1fd8b0a42094e1d3fb51e00', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/support', @@ -452,8 +452,8 @@ 'dev_requirement' => false, ), 'illuminate/translation' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => '4b555f3ca37523d1064d08e99774ab32fd0cc228', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/translation', @@ -461,8 +461,8 @@ 'dev_requirement' => false, ), 'illuminate/validation' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => 'ce2bb8d019e2510d1892b0c87f9086ea802c28e4', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/validation', @@ -470,8 +470,8 @@ 'dev_requirement' => false, ), 'illuminate/view' => array( - 'pretty_version' => 'v12.67.0', - 'version' => '12.67.0.0', + 'pretty_version' => 'v12.69.2', + 'version' => '12.69.2.0', 'reference' => '83bf8a22bb61145bcc1b8912103f6fb85078e35c', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/view', @@ -488,45 +488,45 @@ 'dev_requirement' => false, ), 'justinrainbow/json-schema' => array( - 'pretty_version' => '6.10.0', - 'version' => '6.10.0.0', - 'reference' => '8b1308a9d7bdbdb20ce87ef920f82b4564bb2d33', + 'pretty_version' => '6.12.0', + 'version' => '6.12.0.0', + 'reference' => '8ef236a1a37df364b518b7411a4b5bb95b040d79', 'type' => 'library', 'install_path' => __DIR__ . '/../justinrainbow/json-schema', 'aliases' => array(), 'dev_requirement' => false, ), 'laravel/prompts' => array( - 'pretty_version' => 'v0.3.23', - 'version' => '0.3.23.0', - 'reference' => 'b7b4c35e5bc47450f6b6238c6cc9c47ba19b2221', + 'pretty_version' => 'v0.3.24', + 'version' => '0.3.24.0', + 'reference' => '5d3cdef29e93ca3b62b1871359db3078cd99908b', 'type' => 'library', 'install_path' => __DIR__ . '/../laravel/prompts', 'aliases' => array(), 'dev_requirement' => false, ), 'laravel/serializable-closure' => array( - 'pretty_version' => 'v2.0.15', - 'version' => '2.0.15.0', - 'reference' => 'dccd8bcb851bb03fcc005df650b708b57cc52661', + 'pretty_version' => 'v2.0.16', + 'version' => '2.0.16.0', + 'reference' => '7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed', 'type' => 'library', 'install_path' => __DIR__ . '/../laravel/serializable-closure', 'aliases' => array(), 'dev_requirement' => false, ), 'league/flysystem' => array( - 'pretty_version' => '3.35.2', - 'version' => '3.35.2.0', - 'reference' => 'b277b5dc3d56650b68904117124e79c851e12376', + 'pretty_version' => '3.36.0', + 'version' => '3.36.0.0', + 'reference' => 'f7fb152932f30072d573510cbd4dd657d6475b25', 'type' => 'library', 'install_path' => __DIR__ . '/../league/flysystem', 'aliases' => array(), 'dev_requirement' => false, ), 'league/flysystem-local' => array( - 'pretty_version' => '3.31.0', - 'version' => '3.31.0.0', - 'reference' => '2f669db18a4c20c755c2bb7d3a7b0b2340488079', + 'pretty_version' => '3.35.3', + 'version' => '3.35.3.0', + 'reference' => 'a099b24dce160f3b2239043d13d47c4a1a214ea4', 'type' => 'library', 'install_path' => __DIR__ . '/../league/flysystem-local', 'aliases' => array(), @@ -551,9 +551,9 @@ 'dev_requirement' => false, ), 'monolog/monolog' => array( - 'pretty_version' => '3.10.0', - 'version' => '3.10.0.0', - 'reference' => 'b321dd6749f0bf7189444158a3ce785cc16d69b0', + 'pretty_version' => '3.12.0', + 'version' => '3.12.0.0', + 'reference' => '72c534fc0ab181ef52d92a68382318631e301608', 'type' => 'library', 'install_path' => __DIR__ . '/../monolog/monolog', 'aliases' => array(), @@ -566,9 +566,9 @@ ), ), 'nesbot/carbon' => array( - 'pretty_version' => '3.13.2', - 'version' => '3.13.2.0', - 'reference' => 'a1c54919f5fff9800cd03c32bd01defd5a4061cb', + 'pretty_version' => '3.14.0', + 'version' => '3.14.0.0', + 'reference' => '0023eaa2c9110e47446dd512a263c69c40cd41f2', 'type' => 'library', 'install_path' => __DIR__ . '/../nesbot/carbon', 'aliases' => array(), @@ -593,18 +593,18 @@ 'dev_requirement' => false, ), 'phpoption/phpoption' => array( - 'pretty_version' => '1.9.5', - 'version' => '1.9.5.0', - 'reference' => '75365b91986c2405cf5e1e012c5595cd487a98be', + 'pretty_version' => '1.10.0', + 'version' => '1.10.0.0', + 'reference' => '67b192b6a42ec03944b972d6e633ddec78ad2c6d', 'type' => 'library', 'install_path' => __DIR__ . '/../phpoption/phpoption', 'aliases' => array(), 'dev_requirement' => false, ), 'predis/predis' => array( - 'pretty_version' => 'v3.6.0', - 'version' => '3.6.0.0', - 'reference' => '2ff20c08bb63697245ffee3f198d1673086c302d', + 'pretty_version' => 'v3.6.1', + 'version' => '3.6.1.0', + 'reference' => 'e2db96312ecf57a01a3477bf192d1ebc0ad7e9fb', 'type' => 'library', 'install_path' => __DIR__ . '/../predis/predis', 'aliases' => array(), @@ -759,9 +759,9 @@ 'dev_requirement' => false, ), 'ramsey/uuid' => array( - 'pretty_version' => '4.9.3', - 'version' => '4.9.3.0', - 'reference' => '1df15849d00943a67d677dc9cfd80795f038c9f8', + 'pretty_version' => '4.9.4', + 'version' => '4.9.4.0', + 'reference' => '75d73f48d02797c2c285a7e9f348fadc0102ffe2', 'type' => 'library', 'install_path' => __DIR__ . '/../ramsey/uuid', 'aliases' => array(), @@ -779,7 +779,7 @@ 'rhumsaa/uuid' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.9.3', + 0 => '4.9.4', ), ), 'rosell-dk/exec-with-fallback' => array( @@ -897,9 +897,9 @@ 'dev_requirement' => false, ), 'symfony/console' => array( - 'pretty_version' => 'v7.4.16', - 'version' => '7.4.16.0', - 'reference' => 'f4c69c9aed03abf933b294257d618bdd9b30a06d', + 'pretty_version' => 'v7.4.19', + 'version' => '7.4.19.0', + 'reference' => '3a1973458b153f566a8d7499bc06ece323d60063', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), @@ -915,18 +915,18 @@ 'dev_requirement' => false, ), 'symfony/error-handler' => array( - 'pretty_version' => 'v7.4.15', - 'version' => '7.4.15.0', - 'reference' => 'd49f6a19f326db41ae7103bdc38e3eb35a791261', + 'pretty_version' => 'v7.4.17', + 'version' => '7.4.17.0', + 'reference' => '8373921e231e190a88e2ad526951bbaa791576fa', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/error-handler', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/event-dispatcher' => array( - 'pretty_version' => 'v7.4.15', - 'version' => '7.4.15.0', - 'reference' => '336e7f3b9e95aba04f93ea9143920c2186abfbb9', + 'pretty_version' => 'v7.4.17', + 'version' => '7.4.17.0', + 'reference' => 'd269974ee93c61d03620ffee358355bfdb471d66', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/event-dispatcher', 'aliases' => array(), @@ -948,45 +948,45 @@ ), ), 'symfony/filesystem' => array( - 'pretty_version' => 'v7.4.15', - 'version' => '7.4.15.0', - 'reference' => 'ff16a16bf87fdf264638b8f6995b3515975e3c79', + 'pretty_version' => 'v7.4.18', + 'version' => '7.4.18.0', + 'reference' => '90d412aa5277c6819db39e7605aa46b1019e3232', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/finder' => array( - 'pretty_version' => 'v7.4.14', - 'version' => '7.4.14.0', - 'reference' => '13b38720174286f55d1761152b575a8d1436fc25', + 'pretty_version' => 'v7.4.19', + 'version' => '7.4.19.0', + 'reference' => '1b900bc6ae5ba60c5eee69c11ba44566190576fe', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/http-foundation' => array( - 'pretty_version' => 'v7.4.16', - 'version' => '7.4.16.0', - 'reference' => 'b676451bb638e99a7d34d8a2be90406822e301eb', + 'pretty_version' => 'v7.4.19', + 'version' => '7.4.19.0', + 'reference' => 'f7b953be7801974a5a0685e1228bbc3b12b35936', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-foundation', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/http-kernel' => array( - 'pretty_version' => 'v7.4.16', - 'version' => '7.4.16.0', - 'reference' => 'f5e728670fa2218ae8be8ea91f2b44b7d6e5304c', + 'pretty_version' => 'v7.4.19', + 'version' => '7.4.19.0', + 'reference' => '683507424cc84ca85ac1551adb609b6b98216667', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-kernel', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/mime' => array( - 'pretty_version' => 'v7.4.16', - 'version' => '7.4.16.0', - 'reference' => '20094b76a7106dbe978d31cd3bd7aa1ed248d0e5', + 'pretty_version' => 'v7.4.19', + 'version' => '7.4.19.0', + 'reference' => 'f8ac7d0a800bcabbcd1f7de56594cf05e6cd5693', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/mime', 'aliases' => array(), @@ -1011,18 +1011,18 @@ 'dev_requirement' => false, ), 'symfony/polyfill-intl-idn' => array( - 'pretty_version' => 'v1.38.1', - 'version' => '1.38.1.0', - 'reference' => 'dc21118016c039a66235cf93d96b435ffb282412', + 'pretty_version' => 'v1.42.0', + 'version' => '1.42.0.0', + 'reference' => '51b5ff5ba85452b31ec6f55490b08148612339d9', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.38.0', - 'version' => '1.38.0.0', - 'reference' => '2d446c214bdbe5b71bde5011b060a05fece3ae6b', + 'pretty_version' => 'v1.42.0', + 'version' => '1.42.0.0', + 'reference' => 'aa20edea75bd9c48cfecc8360922e5a6e5c44502', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), @@ -1086,45 +1086,45 @@ 'dev_requirement' => false, ), 'symfony/process' => array( - 'pretty_version' => 'v7.4.13', - 'version' => '7.4.13.0', - 'reference' => 'f5804be144caceb570f6747519999636b664f24c', + 'pretty_version' => 'v7.4.19', + 'version' => '7.4.19.0', + 'reference' => 'ed0ae095b86994d370d5791612e55984f15aa30e', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/routing' => array( - 'pretty_version' => 'v7.4.15', - 'version' => '7.4.15.0', - 'reference' => '80c0a93d3f8e7499f716204a1fb38ead942a7a2b', + 'pretty_version' => 'v7.4.18', + 'version' => '7.4.18.0', + 'reference' => 'ddd558991e98f693ae6bf5063cc1b0362c6bbec3', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/routing', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/service-contracts' => array( - 'pretty_version' => 'v3.7.1', - 'version' => '3.7.1.0', - 'reference' => 'c0a284bab1ed8aa0417e3d69250ab437739563a0', + 'pretty_version' => 'v3.7.3', + 'version' => '3.7.3.0', + 'reference' => '15e6a07ec2a2c75ceb1b21dd98105ee8456d2257', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/string' => array( - 'pretty_version' => 'v7.4.15', - 'version' => '7.4.15.0', - 'reference' => 'e394af32256bf9e7bf80849d95e589167c10097b', + 'pretty_version' => 'v7.4.19', + 'version' => '7.4.19.0', + 'reference' => '02731ce2bd26514bec9efc0baef2cd0b0cf67f46', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/string', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/translation' => array( - 'pretty_version' => 'v7.4.16', - 'version' => '7.4.16.0', - 'reference' => '501e0ff4553c744209ca1a68790d8a4541563710', + 'pretty_version' => 'v7.4.17', + 'version' => '7.4.17.0', + 'reference' => '2ee1e4a3b32a528a642babe041ff7c440b213b4b', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation', 'aliases' => array(), @@ -1146,9 +1146,9 @@ ), ), 'symfony/var-dumper' => array( - 'pretty_version' => 'v7.4.15', - 'version' => '7.4.15.0', - 'reference' => '04ba4add636a95ff437af3a5a9499bb1d6c6d4bd', + 'pretty_version' => 'v7.4.18', + 'version' => '7.4.18.0', + 'reference' => 'e088da50b813f32473a76871616cbb8fa54653a8', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/var-dumper', 'aliases' => array(), @@ -1164,9 +1164,9 @@ 'dev_requirement' => false, ), 'vlucas/phpdotenv' => array( - 'pretty_version' => 'v5.6.4', - 'version' => '5.6.4.0', - 'reference' => '416df702837983f8d5ff48c9c3fee4f5f57b980b', + 'pretty_version' => 'v5.7.0', + 'version' => '5.7.0.0', + 'reference' => '301c07936b16d88628b126b01d082ba153cf4c40', 'type' => 'library', 'install_path' => __DIR__ . '/../vlucas/phpdotenv', 'aliases' => array(), diff --git a/core/vendor/doctrine/lexer/SECURITY.md b/core/vendor/doctrine/lexer/SECURITY.md new file mode 100644 index 0000000000..4b4deb1137 --- /dev/null +++ b/core/vendor/doctrine/lexer/SECURITY.md @@ -0,0 +1,7 @@ +# Security + +If you find a Security bug in Doctrine, please follow our +[Security reporting guidelines](https://www.doctrine-project.org/policies/security.html#reporting). + +Security vulnerabilities should be reported to security@doctrine-project.org +and not posted on the GitHub issue tracker of the project. diff --git a/core/vendor/doctrine/lexer/composer.json b/core/vendor/doctrine/lexer/composer.json index 995dafa0d8..811f1041d9 100644 --- a/core/vendor/doctrine/lexer/composer.json +++ b/core/vendor/doctrine/lexer/composer.json @@ -29,11 +29,9 @@ "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^12", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^10.5", - "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^5.21" + "doctrine/coding-standard": "^14", + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^10.5.58 || ^12.5.4" }, "autoload": { "psr-4": { diff --git a/core/vendor/doctrine/lexer/src/AbstractLexer.php b/core/vendor/doctrine/lexer/src/AbstractLexer.php index 2436885e48..260ace4780 100644 --- a/core/vendor/doctrine/lexer/src/AbstractLexer.php +++ b/core/vendor/doctrine/lexer/src/AbstractLexer.php @@ -20,7 +20,7 @@ * Base class for writing simple lexers, i.e. for creating small DSLs. * * @template T of UnitEnum|string|int - * @template V of string|int + * @template V of string|int|float|bool */ abstract class AbstractLexer { @@ -138,7 +138,7 @@ public function getInputUntilPosition(int $position) * * @return bool * - * @psalm-assert-if-true !=null $this->lookahead + * @phpstan-assert-if-true !=null $this->lookahead */ public function isNextToken(int|string|UnitEnum $type) { @@ -152,7 +152,7 @@ public function isNextToken(int|string|UnitEnum $type) * * @return bool * - * @psalm-assert-if-true !=null $this->lookahead + * @phpstan-assert-if-true !=null $this->lookahead */ public function isNextTokenAny(array $types) { @@ -164,7 +164,8 @@ public function isNextTokenAny(array $types) * * @return bool * - * @psalm-assert-if-true !null $this->lookahead + * @phpstan-impure + * @phpstan-assert-if-true !null $this->lookahead */ public function moveNext() { @@ -218,6 +219,8 @@ public function peek() * Peeks at the next token, returns it and immediately resets the peek. * * @return Token|null The next token or NULL if there are no more tokens ahead. + * + * @phpstan-impure */ public function glimpse() { diff --git a/core/vendor/doctrine/lexer/src/Token.php b/core/vendor/doctrine/lexer/src/Token.php index b6df694653..df09918089 100644 --- a/core/vendor/doctrine/lexer/src/Token.php +++ b/core/vendor/doctrine/lexer/src/Token.php @@ -10,7 +10,7 @@ /** * @template T of UnitEnum|string|int - * @template V of string|int + * @template-covariant V of string|int|float|bool */ final class Token { @@ -20,7 +20,7 @@ final class Token * @readonly * @var V */ - public string|int $value; + public string|int|float|bool $value; /** * The type of the token (identifier, numeric, string, input parameter, none) @@ -41,7 +41,7 @@ final class Token * @param V $value * @param T|null $type */ - public function __construct(string|int $value, $type, int $position) + public function __construct(string|int|float|bool $value, $type, int $position) { $this->value = $value; $this->type = $type; diff --git a/core/vendor/graham-campbell/result-type/LICENSE b/core/vendor/graham-campbell/result-type/LICENSE index 8e7c898886..b5d7de7b21 100644 --- a/core/vendor/graham-campbell/result-type/LICENSE +++ b/core/vendor/graham-campbell/result-type/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020-2024 Graham Campbell +Copyright (c) 2020-2026 Graham Campbell Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/core/vendor/graham-campbell/result-type/composer.json b/core/vendor/graham-campbell/result-type/composer.json index 441412f62c..ff9924048e 100644 --- a/core/vendor/graham-campbell/result-type/composer.json +++ b/core/vendor/graham-campbell/result-type/composer.json @@ -12,10 +12,10 @@ ], "require": { "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9.5" + "phpoption/phpoption": "^1.10" }, "require-dev": { - "phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7" + "phpunit/phpunit": "^8.5.52 || ^9.6.34 || ^10.5.63 || ^11.5.55 || ^12.5.14" }, "autoload": { "psr-4": { diff --git a/core/vendor/graham-campbell/result-type/src/Error.php b/core/vendor/graham-campbell/result-type/src/Error.php index 2c37c3e2b7..1a547e206c 100644 --- a/core/vendor/graham-campbell/result-type/src/Error.php +++ b/core/vendor/graham-campbell/result-type/src/Error.php @@ -17,10 +17,9 @@ use PhpOption\Some; /** - * @template T - * @template E + * @template-covariant E * - * @extends \GrahamCampbell\ResultType\Result + * @extends \GrahamCampbell\ResultType\Result */ final class Error extends Result { @@ -48,7 +47,7 @@ private function __construct($value) * * @param F $value * - * @return \GrahamCampbell\ResultType\Result + * @return \GrahamCampbell\ResultType\Error */ public static function create($value) { @@ -58,7 +57,7 @@ public static function create($value) /** * Get the success option value. * - * @return \PhpOption\Option + * @return \PhpOption\Option */ public function success() { @@ -70,9 +69,9 @@ public function success() * * @template S * - * @param callable(T):S $f + * @param callable(never):S $f * - * @return \GrahamCampbell\ResultType\Result + * @return \GrahamCampbell\ResultType\Error */ public function map(callable $f) { @@ -85,13 +84,12 @@ public function map(callable $f) * @template S * @template F * - * @param callable(T):\GrahamCampbell\ResultType\Result $f + * @param callable(never):\GrahamCampbell\ResultType\Result $f * - * @return \GrahamCampbell\ResultType\Result + * @return \GrahamCampbell\ResultType\Error */ public function flatMap(callable $f) { - /** @var \GrahamCampbell\ResultType\Result */ return self::create($this->value); } @@ -112,7 +110,7 @@ public function error() * * @param callable(E):F $f * - * @return \GrahamCampbell\ResultType\Result + * @return \GrahamCampbell\ResultType\Error */ public function mapError(callable $f) { diff --git a/core/vendor/graham-campbell/result-type/src/Result.php b/core/vendor/graham-campbell/result-type/src/Result.php index 8c67bcdd1c..85450676dc 100644 --- a/core/vendor/graham-campbell/result-type/src/Result.php +++ b/core/vendor/graham-campbell/result-type/src/Result.php @@ -14,8 +14,8 @@ namespace GrahamCampbell\ResultType; /** - * @template T - * @template E + * @template-covariant T + * @template-covariant E */ abstract class Result { @@ -45,7 +45,7 @@ abstract public function map(callable $f); * * @param callable(T):\GrahamCampbell\ResultType\Result $f * - * @return \GrahamCampbell\ResultType\Result + * @return \GrahamCampbell\ResultType\Result */ abstract public function flatMap(callable $f); diff --git a/core/vendor/graham-campbell/result-type/src/Success.php b/core/vendor/graham-campbell/result-type/src/Success.php index 27cd85eecb..4dfb7d2fd9 100644 --- a/core/vendor/graham-campbell/result-type/src/Success.php +++ b/core/vendor/graham-campbell/result-type/src/Success.php @@ -17,10 +17,9 @@ use PhpOption\Some; /** - * @template T - * @template E + * @template-covariant T * - * @extends \GrahamCampbell\ResultType\Result + * @extends \GrahamCampbell\ResultType\Result */ final class Success extends Result { @@ -42,13 +41,13 @@ private function __construct($value) } /** - * Create a new error value. + * Create a new success value. * * @template S * * @param S $value * - * @return \GrahamCampbell\ResultType\Result + * @return \GrahamCampbell\ResultType\Success */ public static function create($value) { @@ -72,7 +71,7 @@ public function success() * * @param callable(T):S $f * - * @return \GrahamCampbell\ResultType\Result + * @return \GrahamCampbell\ResultType\Success */ public function map(callable $f) { @@ -97,7 +96,7 @@ public function flatMap(callable $f) /** * Get the error option value. * - * @return \PhpOption\Option + * @return \PhpOption\Option */ public function error() { @@ -109,9 +108,9 @@ public function error() * * @template F * - * @param callable(E):F $f + * @param callable(never):F $f * - * @return \GrahamCampbell\ResultType\Result + * @return \GrahamCampbell\ResultType\Success */ public function mapError(callable $f) { diff --git a/core/vendor/guzzlehttp/guzzle/CHANGELOG.md b/core/vendor/guzzlehttp/guzzle/CHANGELOG.md index efea7bde6a..0deee721c3 100644 --- a/core/vendor/guzzlehttp/guzzle/CHANGELOG.md +++ b/core/vendor/guzzlehttp/guzzle/CHANGELOG.md @@ -3,6 +3,23 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version. +## 7.15.5 - 2026-08-24 + +### Changed + +- Adjusted `guzzlehttp/psr7` version constraint to `^2.13.1` +- Adjusted `guzzlehttp/promises` version constraint to `^2.5.3` + +## 7.15.4 - 2026-08-24 + +### Added + +- Added support for PHP 8.6 + +### Changed + +- Replace the deprecated spl_object_hash() in handler stack debug output for PHP 8.6 + ## 7.15.3 - 2026-08-05 ### Changed diff --git a/core/vendor/guzzlehttp/guzzle/README.md b/core/vendor/guzzlehttp/guzzle/README.md index a7af068c6e..5ac97ef215 100644 --- a/core/vendor/guzzlehttp/guzzle/README.md +++ b/core/vendor/guzzlehttp/guzzle/README.md @@ -66,7 +66,7 @@ composer require guzzlehttp/guzzle | 4.x | EOL (2016-10-31) | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >=5.4,<7.0 | | 5.x | EOL (2019-10-31) | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >=5.4,<7.4 | | 6.x | EOL (2023-10-31) | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >=5.5,<8.0 | -| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.6 | +| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.7 | [guzzle-3-repo]: https://github.com/guzzle/guzzle3 [guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x diff --git a/core/vendor/guzzlehttp/guzzle/composer.json b/core/vendor/guzzlehttp/guzzle/composer.json index 8850d1b5bd..f2d21bcb6e 100644 --- a/core/vendor/guzzlehttp/guzzle/composer.json +++ b/core/vendor/guzzlehttp/guzzle/composer.json @@ -53,8 +53,8 @@ "require": { "php": "^7.2.5 || ^8.0", "ext-json": "*", - "guzzlehttp/promises": "^2.5.2", - "guzzlehttp/psr7": "^2.13", + "guzzlehttp/promises": "^2.5.3", + "guzzlehttp/psr7": "^2.13.1", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.5 || ^3.0", "symfony/polyfill-php80": "^1.25" diff --git a/core/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/core/vendor/guzzlehttp/guzzle/src/HandlerStack.php index 2e0cac0977..2f11b020b5 100644 --- a/core/vendor/guzzlehttp/guzzle/src/HandlerStack.php +++ b/core/vendor/guzzlehttp/guzzle/src/HandlerStack.php @@ -284,6 +284,6 @@ private function debugCallable($fn): string } /** @var object $fn */ - return 'callable('.\spl_object_hash($fn).')'; + return 'callable('.\spl_object_id($fn).')'; } } diff --git a/core/vendor/guzzlehttp/promises/CHANGELOG.md b/core/vendor/guzzlehttp/promises/CHANGELOG.md index 7e4c822a4b..2d10fb9d22 100644 --- a/core/vendor/guzzlehttp/promises/CHANGELOG.md +++ b/core/vendor/guzzlehttp/promises/CHANGELOG.md @@ -1,6 +1,13 @@ # CHANGELOG +## 2.5.3 - 2026-08-24 + +### Added + +- Added support for PHP 8.6 + + ## 2.5.2 - 2026-08-05 ### Fixed diff --git a/core/vendor/guzzlehttp/promises/README.md b/core/vendor/guzzlehttp/promises/README.md index 66d83abb5f..fccc68fb96 100644 --- a/core/vendor/guzzlehttp/promises/README.md +++ b/core/vendor/guzzlehttp/promises/README.md @@ -41,7 +41,7 @@ composer require guzzlehttp/promises | Version | Status | PHP Version | |---------|---------------------|--------------| | 1.x | Security fixes only | >=5.5,<8.3 | -| 2.x | Latest | >=7.2.5,<8.6 | +| 2.x | Latest | >=7.2.5,<8.7 | ## Quick Start diff --git a/core/vendor/guzzlehttp/psr7/CHANGELOG.md b/core/vendor/guzzlehttp/psr7/CHANGELOG.md index 3d678f4e9b..dbe29117cc 100644 --- a/core/vendor/guzzlehttp/psr7/CHANGELOG.md +++ b/core/vendor/guzzlehttp/psr7/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 2.13.1 - 2026-08-24 + +### Added + +- Add support for PHP 8.6 + +### Fixed + +- Prefix relative paths that begin with a colon segment with `./` instead of throwing + ## 2.13.0 - 2026-07-16 ### Added diff --git a/core/vendor/guzzlehttp/psr7/README.md b/core/vendor/guzzlehttp/psr7/README.md index 13f2ba5ee6..80d0566ce0 100644 --- a/core/vendor/guzzlehttp/psr7/README.md +++ b/core/vendor/guzzlehttp/psr7/README.md @@ -25,7 +25,7 @@ composer require guzzlehttp/psr7 | Version | Status | PHP Version | |---------|---------------------|--------------| | 1.x | EOL (2024-06-30) | >=5.4,<8.2 | -| 2.x | Latest | >=7.2.5,<8.6 | +| 2.x | Latest | >=7.2.5,<8.7 | See [UPGRADING.md](UPGRADING.md) for notes on upgrading from 1.x to 2.0. @@ -800,6 +800,10 @@ browsers do when resolving a link in a website based on the current request URI. Converts the relative URI into a new URI that is resolved against the base URI. +When the resolved path is a relative-path reference whose first segment contains a colon, which would be mistaken for a +scheme name ([RFC 3986 Section 4.2](https://datatracker.ietf.org/doc/html/rfc3986#section-4.2)), it is prefixed with +`./`, e.g. `./a:b`. + ### `GuzzleHttp\Psr7\UriResolver::removeDotSegments` `public static function removeDotSegments(string $path): string` @@ -839,7 +843,14 @@ echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // pr Returns a normalized URI. The scheme and host component are already normalized to lowercase per PSR-7 UriInterface. This methods adds additional normalizations that can be configured with the `$flags` parameter which is a bitmask -of normalizations to apply. The following normalizations are available: +of normalizations to apply. + +When a normalization rewrites the path of a relative-path reference so that its first segment contains a colon, which +would be mistaken for a scheme name ([RFC 3986 Section 4.2](https://datatracker.ietf.org/doc/html/rfc3986#section-4.2)), +the path is prefixed with `./` instead of throwing, e.g. `a%41:` becomes `./aA:` as `aA:` would be an absolute URI +with the scheme `aa`. + +The following normalizations are available: - `UriNormalizer::PRESERVING_NORMALIZATIONS` diff --git a/core/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/core/vendor/guzzlehttp/psr7/src/UriNormalizer.php index e5468b8674..d6342b65fc 100644 --- a/core/vendor/guzzlehttp/psr7/src/UriNormalizer.php +++ b/core/vendor/guzzlehttp/psr7/src/UriNormalizer.php @@ -116,6 +116,11 @@ final class UriNormalizer * treated equivalent which is not necessarily true according to RFC 3986. But that difference * is highly uncommon in reality. So this potential normalization is implied in PSR-7 as well. * + * When a normalization rewrites the path of a relative-path reference so that its first + * segment contains a colon, which would be mistaken for a scheme name (RFC 3986 Section 4.2), + * the path is prefixed with "./" instead of throwing, e.g. "a%41:" becomes "./aA:" as "aA:" + * would be an absolute URI with the scheme "aa". + * * @param UriInterface $uri The URI to normalize * @param int $flags A bitmask of normalizations to apply, see constants * @@ -156,7 +161,7 @@ public static function normalize(UriInterface $uri, int $flags = self::PRESERVIN throw new \RuntimeException('Unable to remove duplicate slashes from URI path: '.preg_last_error_msg()); } - $uri = $uri->withPath($path); + $uri = self::withGuardedPath($uri, $path); } if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') { @@ -195,8 +200,7 @@ private static function capitalizePercentEncoding(UriInterface $uri): UriInterfa return Utils::asciiToUpper($match[0]); }; - return $uri - ->withPath(self::normalizePercentEncodingInComponent($uri->getPath(), $regex, $callback)) + return self::withGuardedPath($uri, self::normalizePercentEncodingInComponent($uri->getPath(), $regex, $callback)) ->withQuery(self::normalizePercentEncodingInComponent($uri->getQuery(), $regex, $callback)) ->withFragment(self::normalizePercentEncodingInComponent($uri->getFragment(), $regex, $callback)); } @@ -209,12 +213,23 @@ private static function decodeUnreservedCharacters(UriInterface $uri): UriInterf return rawurldecode($match[0]); }; - return $uri - ->withPath(self::normalizePercentEncodingInComponent($uri->getPath(), $regex, $callback)) + return self::withGuardedPath($uri, self::normalizePercentEncodingInComponent($uri->getPath(), $regex, $callback)) ->withQuery(self::normalizePercentEncodingInComponent($uri->getQuery(), $regex, $callback)) ->withFragment(self::normalizePercentEncodingInComponent($uri->getFragment(), $regex, $callback)); } + /** + * Writes the given path only when it differs from the current one, guarded so the write cannot throw. + */ + private static function withGuardedPath(UriInterface $uri, string $path): UriInterface + { + if ($path === $uri->getPath()) { + return $uri; + } + + return $uri->withPath(UriResolver::guardedPath($uri, $path)); + } + /** * @param callable(array): string $callback */ diff --git a/core/vendor/guzzlehttp/psr7/src/UriResolver.php b/core/vendor/guzzlehttp/psr7/src/UriResolver.php index 80b4b2058a..5a6ac5e30b 100644 --- a/core/vendor/guzzlehttp/psr7/src/UriResolver.php +++ b/core/vendor/guzzlehttp/psr7/src/UriResolver.php @@ -50,10 +50,36 @@ public static function removeDotSegments(string $path): string return $newPath; } + /** + * Returns the path, prefixed with "./" when it would otherwise begin a relative-path reference with a segment + * containing a colon. + * + * Such a segment would be mistaken for a scheme name (RFC 3986 Section 4.2), so a URI without a scheme and + * authority cannot hold the path, but reference resolution and percent-encoding normalization can produce one. + * The "./" prefix the RFC prescribes resolves back to the same path. + * + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2 + * + * @internal + */ + public static function guardedPath(UriInterface $uri, string $path): string + { + if ($uri->getScheme() !== '' || $uri->getAuthority() !== '' || strpos(explode('/', $path, 2)[0], ':') === false) { + return $path; + } + + return './'.$path; + } + /** * Converts the relative URI into a new URI that is resolved against the base URI. * + * When the resolved path is a relative-path reference whose first segment contains a colon, + * which would be mistaken for a scheme name (RFC 3986 Section 4.2), it is prefixed with "./", + * e.g. "./a:b". + * * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2 + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.2 */ public static function resolve(UriInterface $base, UriInterface $rel): UriInterface { @@ -94,6 +120,10 @@ public static function resolve(UriInterface $base, UriInterface $rel): UriInterf $targetQuery = $rel->getQuery(); } + if ($targetPath !== $base->getPath()) { + $targetPath = self::guardedPath($base, $targetPath); + } + return $base ->withPath($targetPath) ->withQuery($targetQuery) diff --git a/core/vendor/guzzlehttp/uri-template/CHANGELOG.md b/core/vendor/guzzlehttp/uri-template/CHANGELOG.md index 6b2a9d0ade..669a091230 100644 --- a/core/vendor/guzzlehttp/uri-template/CHANGELOG.md +++ b/core/vendor/guzzlehttp/uri-template/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to `uri-template` will be documented in this file. Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## v1.0.11 - 2026-08-24 + +### Added + +- Added support for PHP 8.6 + ## v1.0.10 - 2026-07-17 ### Fixed diff --git a/core/vendor/illuminate/console/Concerns/InteractsWithIO.php b/core/vendor/illuminate/console/Concerns/InteractsWithIO.php index db3db629aa..212f9aaf14 100644 --- a/core/vendor/illuminate/console/Concerns/InteractsWithIO.php +++ b/core/vendor/illuminate/console/Concerns/InteractsWithIO.php @@ -169,7 +169,7 @@ public function anticipate($question, $choices, $default = null) * Prompt the user for input with auto completion. * * @param string $question - * @param iterable|(callable(string): string[]) $choices + * @param iterable|(callable(string): list) $choices * @param string|null $default * @return mixed */ diff --git a/core/vendor/illuminate/database/Connection.php b/core/vendor/illuminate/database/Connection.php index cfab16cbca..d409f1cef6 100644 --- a/core/vendor/illuminate/database/Connection.php +++ b/core/vendor/illuminate/database/Connection.php @@ -697,7 +697,7 @@ public function withoutPretending(Closure $callback) /** * Execute the given callback in "dry run" mode. * - * @param (\Closure(): array{query: string, bindings: array, time: float|null}[]) $callback + * @param (\Closure(): (array{query: string, bindings: array, time: float|null}[])) $callback * @return array{query: string, bindings: array, time: float|null}[] */ protected function withFreshQueryLog($callback) diff --git a/core/vendor/illuminate/http/Resources/JsonApi/Concerns/ResolvesJsonApiElements.php b/core/vendor/illuminate/http/Resources/JsonApi/Concerns/ResolvesJsonApiElements.php index deaddf9964..0955e2d465 100644 --- a/core/vendor/illuminate/http/Resources/JsonApi/Concerns/ResolvesJsonApiElements.php +++ b/core/vendor/illuminate/http/Resources/JsonApi/Concerns/ResolvesJsonApiElements.php @@ -34,6 +34,13 @@ trait ResolvesJsonApiElements */ protected bool $includesPreviouslyLoadedRelationships = false; + /** + * The relationships requested relative to this included resource. + * + * @var array|null + */ + protected ?array $requestedRelationships = null; + /** * Cached loaded relationships map. * @@ -189,10 +196,7 @@ protected function compileResourceRelationships(JsonApiRequest $request): void return; } - $sparseIncluded = match (true) { - $this->includesPreviouslyLoadedRelationships => array_keys($this->resource->getRelations()), - default => $request->sparseIncluded(), - }; + $sparseIncluded = $this->requestedResourceRelationships($request); $resourceRelationships = (new Collection($this->toRelationships($request))) ->transform(fn ($value, $key) => is_int($key) ? new RelationResolver($value) : new RelationResolver($key, $value)) @@ -208,13 +212,6 @@ protected function compileResourceRelationships(JsonApiRequest $request): void $this->loadedRelationshipIdentifiers = (new LazyCollection(function () use ($request, $resourceRelationships) { foreach ($resourceRelationships as $relationName => $relationResolver) { $relatedModels = $relationResolver->handle($this->resource); - $relatedResourceClass = $relationResolver->resourceClass(); - - if (! is_null($relatedModels) && $this->includesPreviouslyLoadedRelationships === false) { - if (! empty($relations = $request->sparseIncluded($relationName))) { - $relatedModels->loadMissing($relations); - } - } yield from $this->compileResourceRelationshipUsingResolver( $request, @@ -237,6 +234,7 @@ protected function compileResourceRelationshipUsingResolver( ): Generator { $relationName = $relationResolver->relationName; $resourceClass = $relationResolver->resourceClass(); + $requestedRelationships = $this->requestedResourceRelationships($request, $relationName); // Relationship is a collection of models... if ($relatedModels instanceof Collection) { @@ -252,16 +250,20 @@ protected function compileResourceRelationshipUsingResolver( $isUnique = ! $relationship instanceof BelongsToMany; - yield $relationName => ['data' => $relatedModels->map(function ($relatedModel) use ($request, $resourceClass, $isUnique) { + yield $relationName => ['data' => $relatedModels->map(function ($relatedModel) use ($request, $resourceClass, $isUnique, $requestedRelationships) { $relatedResource = rescue(fn () => $relatedModel->toResource($resourceClass), new JsonApiResource($relatedModel)); + $relatedResource->requestedRelationships = $requestedRelationships; + + if (! empty($requestedRelationships)) { + $relatedResource->includePreviouslyLoadedRelationships()->compileResourceRelationships($request); + } + return transform( [$relatedResource->resolveResourceType($request), $relatedResource->resolveResourceIdentifier($request)], - function ($uniqueKey) use ($request, $relatedModel, $relatedResource, $isUnique) { + function ($uniqueKey) use ($relatedResource, $isUnique) { $this->loadedRelationshipsMap[] = [$relatedResource, ...$uniqueKey, $isUnique]; - $this->compileIncludedNestedRelationshipsMap($request, $relatedModel, $relatedResource); - return [ 'id' => $uniqueKey[1], 'type' => $uniqueKey[0], @@ -289,13 +291,17 @@ function ($uniqueKey) use ($request, $relatedModel, $relatedResource, $isUnique) $relatedResource = rescue(fn () => $relatedModel->toResource($resourceClass), new JsonApiResource($relatedModel)); + $relatedResource->requestedRelationships = $requestedRelationships; + + if (! empty($requestedRelationships)) { + $relatedResource->includePreviouslyLoadedRelationships()->compileResourceRelationships($request); + } + yield $relationName => ['data' => transform( [$relatedResource->resolveResourceType($request), $relatedResource->resolveResourceIdentifier($request)], - function ($uniqueKey) use ($relatedModel, $relatedResource, $request) { + function ($uniqueKey) use ($relatedResource) { $this->loadedRelationshipsMap[] = [$relatedResource, ...$uniqueKey, true]; - $this->compileIncludedNestedRelationshipsMap($request, $relatedModel, $relatedResource); - return [ 'id' => $uniqueKey[1], 'type' => $uniqueKey[0], @@ -305,17 +311,34 @@ function ($uniqueKey) use ($relatedModel, $relatedResource, $request) { } /** - * Compile included relationships map. + * Get the requested relationships for this resource or one of its relationships. */ - protected function compileIncludedNestedRelationshipsMap(JsonApiRequest $request, Model $relation, JsonApiResource $resource): void + protected function requestedResourceRelationships(JsonApiRequest $request, ?string $relationName = null): array { - (new Collection($resource->toRelationships($request))) - ->transform(fn ($value, $key) => is_int($key) ? new RelationResolver($value) : new RelationResolver($key, $value)) - ->mapWithKeys(fn ($relationResolver) => [$relationResolver->relationName => $relationResolver]) - ->filter(fn ($value, $key) => in_array($key, array_keys($relation->getRelations()))) - ->each(function ($relationResolver, $key) use ($relation, $request) { - $this->compileResourceRelationshipUsingResolver($request, $relation, $relationResolver, $relation->getRelation($key)); - }); + if (is_null($this->requestedRelationships)) { + if ($this->includesPreviouslyLoadedRelationships) { + return is_null($relationName) ? array_keys($this->resource->getRelations()) : []; + } + + return $request->sparseIncluded($relationName) ?? []; + } + + if (is_null($relationName)) { + $requested = (new Collection($this->requestedRelationships)) + ->map(fn ($relationship) => explode('.', $relationship, 2)[0]); + + if ($this->includesPreviouslyLoadedRelationships) { + $requested->push(...array_keys($this->resource->getRelations())); + } + + return $requested->unique()->values()->all(); + } + + return (new Collection($this->requestedRelationships)) + ->filter(fn ($relationship) => str_starts_with($relationship, $relationName.'.')) + ->map(fn ($relationship) => substr($relationship, strlen($relationName) + 1)) + ->values() + ->all(); } /** diff --git a/core/vendor/justinrainbow/json-schema/CHANGELOG.md b/core/vendor/justinrainbow/json-schema/CHANGELOG.md index e3a57c0cb8..58b8b6340a 100644 --- a/core/vendor/justinrainbow/json-schema/CHANGELOG.md +++ b/core/vendor/justinrainbow/json-schema/CHANGELOG.md @@ -7,6 +7,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [6.12.0] - 2026-09-04 + +### Fixed +- Report additional property errors at the property path ([#942](https://github.com/jsonrainbow/json-schema/pull/942)) +- Fix RFC 3339 date-time validation with high-precision fractional seconds ([#940](https://github.com/jsonrainbow/json-schema/pull/940)) + +### Added +- Define minimal permissions on every workflow ([#941](https://github.com/jsonrainbow/json-schema/pull/941)) +- feat: Add --allow-invalid-content-type-endpoint option to validate-json ([#932](https://github.com/jsonrainbow/json-schema/pull/932)) + + +### Changed +- fix: Avoid restricted stargazers endpoint in Welcome workflow and avoid running for bot user types ([#946](https://github.com/jsonrainbow/json-schema/pull/946)) +- fix: Correct changelog and changelog updates ([#945](https://github.com/jsonrainbow/json-schema/pull/945)) + + +## [6.11.0] - 2026-08-21 + +### Fixed +- fix: Handle null byte when validating date/time formats ([#939](https://github.com/jsonrainbow/json-schema/pull/939)) +- fix: Correct php-cs-fixer setup ([#938](https://github.com/jsonrainbow/json-schema/pull/938)) +- fix: Ignore Content-Type header parameters when checking media type ([#934](https://github.com/jsonrainbow/json-schema/pull/934)) +- fix: Dont use mb_detect_encoding for mb_string function calls ([#924](https://github.com/jsonrainbow/json-schema/pull/924)) +- Add missing ext-filter dependency ([#922](https://github.com/jsonrainbow/json-schema/pull/922)) + +### Changed +- Update README with Draft 7 badge correction and include JetBrains logo ([#921](https://github.com/jsonrainbow/json-schema/pull/921)) + +### Added +- Update composer.json authors to reflect current active maintainer ([#928](https://github.com/jsonrainbow/json-schema/pull/928)) + + ## [6.10.0] - 2026-06-16 ### Added diff --git a/core/vendor/justinrainbow/json-schema/README.md b/core/vendor/justinrainbow/json-schema/README.md index 02a86f94ea..88294bcab2 100644 --- a/core/vendor/justinrainbow/json-schema/README.md +++ b/core/vendor/justinrainbow/json-schema/README.md @@ -15,7 +15,7 @@ of all existing Drafts. See [json-schema](http://json-schema.org/) for more deta ![Draft 3](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft3.json) ![Draft 4](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft4.json) ![Draft 6](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft6.json) -![Draft 7](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft7.json))) +![Draft 7](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft7.json) ![Draft 2019-09](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fdraft2019-09.json) @@ -234,3 +234,7 @@ Thanks go to these wonderful people, without their effort this project wasn't po + +# Powered by + +[![JetBrains logo.](https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.svg)](https://jb.gg/OpenSource) diff --git a/core/vendor/justinrainbow/json-schema/bin/validate-json b/core/vendor/justinrainbow/json-schema/bin/validate-json index 83f0e2a867..ff21c1be23 100644 --- a/core/vendor/justinrainbow/json-schema/bin/validate-json +++ b/core/vendor/justinrainbow/json-schema/bin/validate-json @@ -23,7 +23,39 @@ require($composerAutoload); $arOptions = []; $arArgs = []; array_shift($argv);//script itself -foreach ($argv as $arg) { + +// options that take a value; each may be repeated +$multiValueOptions = [ + '--allow-invalid-content-type-endpoint', +]; + +$argCount = count($argv); +for ($i = 0; $i < $argCount; $i++) { + $arg = $argv[$i]; + + foreach ($multiValueOptions as $valueOption) { + if ($arg === $valueOption) { + // space-separated form: --option + if (!isset($argv[$i + 1]) || strpos($argv[$i + 1], '-') === 0) { + output("Missing value for $valueOption\n"); + exit(1); + } + $arOptions[$valueOption][] = $argv[++$i]; + continue 2; + } + + if (strpos($arg, $valueOption . '=') === 0) { + // equals form: --option= + $value = substr($arg, strlen($valueOption . '=')); + if ($value === '') { + output("Missing value for $valueOption\n"); + exit(1); + } + $arOptions[$valueOption][] = $value; + continue 2; + } + } + if ($arg[0] == '-') { $arOptions[$arg] = true; } else { @@ -42,6 +74,10 @@ Usage: validate-json data.json Options: --dump-schema Output full schema and exit --dump-schema-url Output URL of schema + --allow-invalid-content-type-endpoint= + Skip the Content-Type check for schemas fetched + from the given URL prefix. May be given multiple + times. --verbose Show additional output --quiet Suppress all output -h --help Show this help @@ -191,6 +227,13 @@ if ($pathSchema[0] == '/') { $resolver = new JsonSchema\Uri\UriResolver(); $retriever = new JsonSchema\Uri\UriRetriever(); +if (isset($arOptions['--allow-invalid-content-type-endpoint']) + && is_array($arOptions['--allow-invalid-content-type-endpoint']) +) { + foreach ($arOptions['--allow-invalid-content-type-endpoint'] as $endpoint) { + $retriever->addInvalidContentTypeEndpoint($endpoint); + } +} try { $urlSchema = $resolver->resolve($pathSchema, $urlData); @@ -214,7 +257,7 @@ if (isset($arOptions['--dump-schema'])) { } try { - $validator = new JsonSchema\Validator(); + $validator = new JsonSchema\Validator(new JsonSchema\Constraints\Factory($refResolver, $retriever)); $validator->validate($data, $schema); if ($validator->isValid()) { diff --git a/core/vendor/justinrainbow/json-schema/composer.json b/core/vendor/justinrainbow/json-schema/composer.json index e975e17861..30e5d25101 100644 --- a/core/vendor/justinrainbow/json-schema/composer.json +++ b/core/vendor/justinrainbow/json-schema/composer.json @@ -10,24 +10,14 @@ "license": "MIT", "authors": [ { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" + "name": "Danny van der Sluijs", + "email": "danny.vandersluijs@icloud.com", + "role": "Maintainer" } ], "require": { "php": "^7.2 || ^8.0", + "ext-filter": "*", "ext-json": "*", "marc-mabe/php-enum":"^4.4" }, diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/AdditionalPropertiesConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/AdditionalPropertiesConstraint.php index 5d6c55cb59..0f78b32b5a 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/AdditionalPropertiesConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/AdditionalPropertiesConstraint.php @@ -58,15 +58,20 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n if (is_object($schema->additionalProperties)) { foreach ($additionalProperties as $key => $additionalPropertiesValue) { $schemaConstraint = $this->factory->createInstanceFor('schema'); - $schemaConstraint->check($additionalPropertiesValue, $schema->additionalProperties, $path, $i); // @todo increment path - if ($schemaConstraint->isValid()) { - unset($additionalProperties[$key]); + $schemaConstraint->check($additionalPropertiesValue, $schema->additionalProperties, ($path ?? new JsonPointer(''))->withAppendedPath($key), $i); + + // The property is permitted by the schema, so it is never an "additional property" + // error; what it failed is the sub-schema, and those errors carry the reason. + if (!$schemaConstraint->isValid()) { + $this->addErrors($schemaConstraint->getErrors()); } + + unset($additionalProperties[$key]); } } foreach ($additionalProperties as $key => $additionalPropertiesValue) { - $this->addError(ConstraintError::ADDITIONAL_PROPERTIES(), $path, ['found' => $key]); + $this->addError(ConstraintError::ADDITIONAL_PROPERTIES(), ($path ?? new JsonPointer(''))->withAppendedPath($key), ['found' => $key]); } } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/FormatConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/FormatConstraint.php index ec61b73b62..d8cc0e008a 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/FormatConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/FormatConstraint.php @@ -125,7 +125,11 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n private function validateDateTime(string $datetime, string $format): bool { - $dt = \DateTime::createFromFormat($format, $datetime); + try { + $dt = \DateTime::createFromFormat($format, $datetime); + } catch (\Throwable $e) { + return false; + } if (!$dt) { return false; diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MaxLengthConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MaxLengthConstraint.php index 5243f488f6..58072ec5ec 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MaxLengthConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MaxLengthConstraint.php @@ -29,7 +29,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n return; } - $length = mb_strlen($value); + $length = mb_strlen($value, 'UTF-8'); if ($length <= $schema->maxLength) { return; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MinLengthConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MinLengthConstraint.php index d9c516a333..d48d7f5203 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MinLengthConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/MinLengthConstraint.php @@ -29,7 +29,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n return; } - $length = mb_strlen($value); + $length = mb_strlen($value, 'UTF-8'); if ($length >= $schema->minLength) { return; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/PropertiesNamesConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/PropertiesNamesConstraint.php index 96312cef85..4a929de2c9 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/PropertiesNamesConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/PropertiesNamesConstraint.php @@ -47,7 +47,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n if (property_exists($schema->propertyNames, 'maxLength')) { foreach ($propertyNames as $propertyName => $_) { - $length = mb_strlen($propertyName); + $length = mb_strlen($propertyName, 'UTF-8'); if ($length > $schema->propertyNames->maxLength) { $this->addError(ConstraintError::PROPERTY_NAMES(), $path, ['propertyNames' => $schema->propertyNames, 'violating' => 'maxLength', 'length' => $length, 'name' => $propertyName]); } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/RequiredConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/RequiredConstraint.php index 9e56ef2213..b75d0ade4a 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/RequiredConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/RequiredConstraint.php @@ -34,25 +34,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n continue; } - $this->addError(ConstraintError::REQUIRED(), $this->incrementPath($path, $required), ['property' => $required]); + $this->addError(ConstraintError::REQUIRED(), ($path ?? new JsonPointer(''))->withAppendedPath($required), ['property' => $required]); } } - - /** - * @todo refactor as this was only copied from UndefinedConstraint - * Bubble down the path - * - * @param JsonPointer|null $path Current path - * @param mixed $i What to append to the path - */ - protected function incrementPath(?JsonPointer $path, $i): JsonPointer - { - $path = $path ?? new JsonPointer(''); - - if ($i === null || $i === '') { - return $path; - } - - return $path->withPropertyPaths(array_merge($path->getPropertyPaths(), [$i])); - } } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/AdditionalPropertiesConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/AdditionalPropertiesConstraint.php index 7162c11bed..f94827607f 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/AdditionalPropertiesConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/AdditionalPropertiesConstraint.php @@ -58,15 +58,20 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n if (is_object($schema->additionalProperties)) { foreach ($additionalProperties as $key => $additionalPropertiesValue) { $schemaConstraint = $this->factory->createInstanceFor('schema'); - $schemaConstraint->check($additionalPropertiesValue, $schema->additionalProperties, $path, $i); // @todo increment path - if ($schemaConstraint->isValid()) { - unset($additionalProperties[$key]); + $schemaConstraint->check($additionalPropertiesValue, $schema->additionalProperties, ($path ?? new JsonPointer(''))->withAppendedPath($key), $i); + + // The property is permitted by the schema, so it is never an "additional property" + // error; what it failed is the sub-schema, and those errors carry the reason. + if (!$schemaConstraint->isValid()) { + $this->addErrors($schemaConstraint->getErrors()); } + + unset($additionalProperties[$key]); } } foreach ($additionalProperties as $key => $additionalPropertiesValue) { - $this->addError(ConstraintError::ADDITIONAL_PROPERTIES(), $path, ['found' => $key]); + $this->addError(ConstraintError::ADDITIONAL_PROPERTIES(), ($path ?? new JsonPointer(''))->withAppendedPath($key), ['found' => $key]); } } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/FormatConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/FormatConstraint.php index 8ddc879dd7..fd5474b65b 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/FormatConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/FormatConstraint.php @@ -149,7 +149,12 @@ private function validateDateTime(string $datetime, string $format): bool $input = sprintf('%s59%s', substr($datetime, 0, 6), substr($datetime, 8)); } - $dt = \DateTimeImmutable::createFromFormat($format, $input); + try { + $dt = \DateTimeImmutable::createFromFormat($format, $input); + } catch (\Throwable $e) { + return false; + } + if (!$dt) { return false; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MaxLengthConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MaxLengthConstraint.php index 9043cf92d8..0aae005b9d 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MaxLengthConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MaxLengthConstraint.php @@ -29,7 +29,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n return; } - $length = mb_strlen($value); + $length = mb_strlen($value, 'UTF-8'); if ($length <= $schema->maxLength) { return; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MinLengthConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MinLengthConstraint.php index 5c7243a828..a1128c74d1 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MinLengthConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/MinLengthConstraint.php @@ -29,7 +29,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n return; } - $length = mb_strlen($value); + $length = mb_strlen($value, 'UTF-8'); if ($length >= $schema->minLength) { return; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/PropertiesNamesConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/PropertiesNamesConstraint.php index e3838990e7..a95f568017 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/PropertiesNamesConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/PropertiesNamesConstraint.php @@ -47,7 +47,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n if (property_exists($schema->propertyNames, 'maxLength')) { foreach ($propertyNames as $propertyName => $_) { - $length = mb_strlen($propertyName); + $length = mb_strlen($propertyName, 'UTF-8'); if ($length > $schema->propertyNames->maxLength) { $this->addError(ConstraintError::PROPERTY_NAMES(), $path, ['propertyNames' => $schema->propertyNames, 'violating' => 'maxLength', 'length' => $length, 'name' => $propertyName]); } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/RequiredConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/RequiredConstraint.php index 99a5b55af0..1d2ad87438 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/RequiredConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/RequiredConstraint.php @@ -34,25 +34,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n continue; } - $this->addError(ConstraintError::REQUIRED(), $this->incrementPath($path, $required), ['property' => $required]); + $this->addError(ConstraintError::REQUIRED(), ($path ?? new JsonPointer(''))->withAppendedPath($required), ['property' => $required]); } } - - /** - * @todo refactor as this was only copied from UndefinedConstraint - * Bubble down the path - * - * @param JsonPointer|null $path Current path - * @param mixed $i What to append to the path - */ - protected function incrementPath(?JsonPointer $path, $i): JsonPointer - { - $path = $path ?? new JsonPointer(''); - - if ($i === null || $i === '') { - return $path; - } - - return $path->withPropertyPaths(array_merge($path->getPropertyPaths(), [$i])); - } } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/AdditionalPropertiesConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/AdditionalPropertiesConstraint.php index 9406c47702..cdabc08103 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/AdditionalPropertiesConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/AdditionalPropertiesConstraint.php @@ -58,15 +58,20 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n if (is_object($schema->additionalProperties)) { foreach ($additionalProperties as $key => $additionalPropertiesValue) { $schemaConstraint = $this->factory->createInstanceFor('schema'); - $schemaConstraint->check($additionalPropertiesValue, $schema->additionalProperties, $path, $i); // @todo increment path - if ($schemaConstraint->isValid()) { - unset($additionalProperties[$key]); + $schemaConstraint->check($additionalPropertiesValue, $schema->additionalProperties, ($path ?? new JsonPointer(''))->withAppendedPath($key), $i); + + // The property is permitted by the schema, so it is never an "additional property" + // error; what it failed is the sub-schema, and those errors carry the reason. + if (!$schemaConstraint->isValid()) { + $this->addErrors($schemaConstraint->getErrors()); } + + unset($additionalProperties[$key]); } } foreach ($additionalProperties as $key => $additionalPropertiesValue) { - $this->addError(ConstraintError::ADDITIONAL_PROPERTIES(), $path, ['found' => $key]); + $this->addError(ConstraintError::ADDITIONAL_PROPERTIES(), ($path ?? new JsonPointer(''))->withAppendedPath($key), ['found' => $key]); } } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/FormatConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/FormatConstraint.php index 5fb47c875b..419f3cb2aa 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/FormatConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/FormatConstraint.php @@ -140,7 +140,12 @@ private function validateDateTime(string $datetime, string $format): bool $input = sprintf('%s59%s', substr($datetime, 0, 6), substr($datetime, 8)); } - $dt = \DateTimeImmutable::createFromFormat($format, $input); + try { + $dt = \DateTimeImmutable::createFromFormat($format, $input); + } catch (\Throwable $e) { + return false; + } + if (!$dt) { return false; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MaxLengthConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MaxLengthConstraint.php index 17eee392a2..fd341b9f21 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MaxLengthConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MaxLengthConstraint.php @@ -29,7 +29,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n return; } - $length = mb_strlen($value); + $length = mb_strlen($value, 'UTF-8'); if ($length <= $schema->maxLength) { return; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MinLengthConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MinLengthConstraint.php index 9784c39ff1..3057dd67cb 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MinLengthConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/MinLengthConstraint.php @@ -29,7 +29,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n return; } - $length = mb_strlen($value); + $length = mb_strlen($value, 'UTF-8'); if ($length >= $schema->minLength) { return; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/PropertiesNamesConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/PropertiesNamesConstraint.php index 1ce7f0c4fa..e7691fe4f1 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/PropertiesNamesConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/PropertiesNamesConstraint.php @@ -47,7 +47,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n if (property_exists($schema->propertyNames, 'maxLength')) { foreach ($propertyNames as $propertyName => $_) { - $length = mb_strlen($propertyName); + $length = mb_strlen($propertyName, 'UTF-8'); if ($length > $schema->propertyNames->maxLength) { $this->addError(ConstraintError::PROPERTY_NAMES(), $path, ['propertyNames' => $schema->propertyNames, 'violating' => 'maxLength', 'length' => $length, 'name' => $propertyName]); } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/RequiredConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/RequiredConstraint.php index a5c4c93ad1..d0b11931d2 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/RequiredConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/RequiredConstraint.php @@ -34,25 +34,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n continue; } - $this->addError(ConstraintError::REQUIRED(), $this->incrementPath($path, $required), ['property' => $required]); + $this->addError(ConstraintError::REQUIRED(), ($path ?? new JsonPointer(''))->withAppendedPath($required), ['property' => $required]); } } - - /** - * @todo refactor as this was only copied from UndefinedConstraint - * Bubble down the path - * - * @param JsonPointer|null $path Current path - * @param mixed $i What to append to the path - */ - protected function incrementPath(?JsonPointer $path, $i): JsonPointer - { - $path = $path ?? new JsonPointer(''); - - if ($i === null || $i === '') { - return $path; - } - - return $path->withPropertyPaths(array_merge($path->getPropertyPaths(), [$i])); - } } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php index c38488dd11..20fdb2077a 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php @@ -154,7 +154,11 @@ public function check(&$element, $schema = null, ?JsonPointer $path = null, $i = protected function validateDateTime($datetime, $format) { - $dt = \DateTime::createFromFormat($format, (string) $datetime); + try { + $dt = \DateTime::createFromFormat($format, (string) $datetime); + } catch (\Throwable $e) { + return false; + } if (!$dt) { return false; diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.php index 7b811614a7..d8ac07ae3e 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.php @@ -54,7 +54,7 @@ public function check(&$element, $schema = null, ?JsonPointer $path = null, $i = private function strlen($string) { if (extension_loaded('mbstring')) { - return mb_strlen($string, mb_detect_encoding($string)); + return mb_strlen($string, 'UTF-8'); } // mbstring is present on all test platforms, so strlen() can be ignored for coverage diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Entity/JsonPointer.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Entity/JsonPointer.php index e33866b681..e03010209f 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Entity/JsonPointer.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Entity/JsonPointer.php @@ -127,6 +127,25 @@ public function withPropertyPaths(array $propertyPaths) return $new; } + /** + * Returns a new pointer with one more segment appended. + * + * A null or empty segment yields the pointer unchanged, so that callers can + * pass through an index they have not resolved yet. + * + * @param mixed $propertyPath + * + * @return JsonPointer + */ + public function withAppendedPath($propertyPath) + { + if ($propertyPath === null || $propertyPath === '') { + return $this; + } + + return $this->withPropertyPaths(array_merge($this->propertyPaths, [$propertyPath])); + } + /** * @return string */ diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Rfc3339.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Rfc3339.php index 2a07060df5..75c0256f9c 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Rfc3339.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Rfc3339.php @@ -25,7 +25,7 @@ public static function createFromString($input): ?\DateTime $inputHasTSeparator = strpos($input, 'T'); $dateAndTime = $matches[1]; - $microseconds = $matches[5] ?: '.000000'; + $microseconds = $matches[5] ? substr($matches[5], 0, 7) : '.000000'; $timeZone = 'Z' !== $matches[6] ? $matches[6] : '+00:00'; $dateFormat = $inputHasTSeparator === false ? 'Y-m-d H:i:s.uP' : 'Y-m-d\TH:i:s.uP'; $dateTime = \DateTimeImmutable::createFromFormat($dateFormat, $dateAndTime . $microseconds . $timeZone, new \DateTimeZone('UTC')); diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/Curl.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/Curl.php index 311f1d34ba..6387e25313 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/Curl.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/Curl.php @@ -76,7 +76,7 @@ private function fetchMessageBody($response) */ protected function fetchContentType($response) { - if (0 < preg_match("/Content-Type:(\V*)/ims", $response, $match)) { + if (0 < preg_match('/^Content-Type:([^;\v]*)/im', $response, $match)) { $this->contentType = trim($match[1]); return true; diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/FileGetContents.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/FileGetContents.php index f60566930a..84598c3e8f 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/FileGetContents.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/FileGetContents.php @@ -97,7 +97,7 @@ private function fetchContentType(array $headers): bool */ protected static function getContentTypeMatchInHeader($header) { - if (0 < preg_match("/Content-Type:(\V*)/ims", $header, $match)) { + if (0 < preg_match('/^Content-Type:([^;\v]*)/im', $header, $match)) { return trim($match[1]); } diff --git a/core/vendor/laravel/prompts/src/Themes/Default/Concerns/InteractsWithStrings.php b/core/vendor/laravel/prompts/src/Themes/Default/Concerns/InteractsWithStrings.php index 17937bfb7d..1c1c79d081 100644 --- a/core/vendor/laravel/prompts/src/Themes/Default/Concerns/InteractsWithStrings.php +++ b/core/vendor/laravel/prompts/src/Themes/Default/Concerns/InteractsWithStrings.php @@ -42,7 +42,11 @@ protected function stripEscapeSequences(string $text): string $text = preg_replace("/<(info|comment|question|error)>(.*?)<\/\\1>/", '$2', $text); // Strip Symfony inline style tags. - return preg_replace("/<(?:(?:[fb]g|options)=[a-z,;]+)+>(.*?)<\/>/i", '$1', $text); + do { + $text = preg_replace("/<(?:(?:[fb]g|options)=[a-z,;]+)+>(.*?)<\/>/i", '$1', $text, -1, $count); + } while ($count > 0); + + return $text; } /** diff --git a/core/vendor/laravel/serializable-closure/src/Serializers/Signed.php b/core/vendor/laravel/serializable-closure/src/Serializers/Signed.php index 16f9593f5b..8cda65f39e 100644 --- a/core/vendor/laravel/serializable-closure/src/Serializers/Signed.php +++ b/core/vendor/laravel/serializable-closure/src/Serializers/Signed.php @@ -57,6 +57,8 @@ public function getClosure() * Get the serializable representation of the closure. * * @return array + * + * @throws \Laravel\SerializableClosure\Exceptions\MissingSecretKeyException */ public function __serialize() { @@ -76,10 +78,15 @@ public function __serialize() * @return void * * @throws \Laravel\SerializableClosure\Exceptions\InvalidSignatureException + * @throws \Laravel\SerializableClosure\Exceptions\MissingSecretKeyException */ public function __unserialize($signature) { - if (static::$signer && ! static::$signer->verify($signature)) { + if (! static::$signer) { + throw new MissingSecretKeyException(); + } + + if (! static::$signer->verify($signature)) { throw new InvalidSignatureException(); } diff --git a/core/vendor/league/flysystem-local/LocalFilesystemAdapter.php b/core/vendor/league/flysystem-local/LocalFilesystemAdapter.php index 36700dd2a5..33930a01fa 100644 --- a/core/vendor/league/flysystem-local/LocalFilesystemAdapter.php +++ b/core/vendor/league/flysystem-local/LocalFilesystemAdapter.php @@ -39,7 +39,6 @@ use function dirname; use function error_clear_last; use function error_get_last; -use function file_exists; use function file_put_contents; use function hash_file; use function is_dir; @@ -144,7 +143,7 @@ public function delete(string $path): void error_clear_last(); - if ( ! @unlink($location)) { + if ( ! @unlink($location) && file_exists($location)) { throw UnableToDeleteFile::atLocation($location, error_get_last()['message'] ?? ''); } } diff --git a/core/vendor/league/flysystem/src/WhitespacePathNormalizer.php b/core/vendor/league/flysystem/src/WhitespacePathNormalizer.php index 16d78fa73c..7daaf659bc 100644 --- a/core/vendor/league/flysystem/src/WhitespacePathNormalizer.php +++ b/core/vendor/league/flysystem/src/WhitespacePathNormalizer.php @@ -22,8 +22,9 @@ public function __construct(bool $allowRelativePathTraversal = true) public function normalizePath(string $path): string { $unixPath = str_replace('\\', '/', $path); + $match = preg_match('#\p{C}+#u', $unixPath); - if (preg_match('#\p{C}+#u', $unixPath)) { + if ($match !== 0) { throw CorruptedPathDetected::forPath($path); } diff --git a/core/vendor/monolog/monolog/CHANGELOG.md b/core/vendor/monolog/monolog/CHANGELOG.md index 2c89f9d181..a94f2ff28d 100644 --- a/core/vendor/monolog/monolog/CHANGELOG.md +++ b/core/vendor/monolog/monolog/CHANGELOG.md @@ -1,3 +1,32 @@ +### 3.12.0 (2026-09-09) + + * Added support for reading the timestamp of new records from a PSR-20 clock, via a new `$clock` constructor param and `Logger::setClock()` (#2065) + * Added support for `#[WithMonologChannel]` on constructor/method parameters, so a channel can be bound to a single argument instead of the whole class (#2068) + * Fixed `TelegramBotHandler` breaking HTML markup when truncating or splitting long messages, open tags are now closed at the end of a chunk and reopened in the next one (#2066) + * Fixed `RedactingFormatter` not redacting secrets nested inside array values of sensitive keys (#2067) + +### 3.11.0 (2026-09-02) + + * Security: Fixed potential XSS in `BrowserConsoleHandler` when logging user provided content + * Added `RedactingFormatter` to automatically redact sensitive data from records, based on key names, `#[SensitiveParameter]` constructor params and/or regex patterns (#2041) + * Added `FrankenPhpHandler` to log records via FrankenPHP's frankenphp_log() function (#2056) + * Added `LogMonsterHandler` which complains if the code did not log enough records before the process/request ends, like a dead man's switch for logs (#2039) + * Added `FILE_PER_HOUR` rotation mode to `RotatingFileHandler` (#2040) + * Added `ErrorHandler::captureStackTraces()` to attach the stack trace of PHP errors to the records it generates (#2060) + * Added `NormalizerFormatter::setMaxTraceLength()` to limit how many stack trace frames are included when normalizing exceptions (#2015) + * Added extension points to `TelegramBotHandler` to change the API URL (e.g. for a self-hosted Bot API server) and to send extra curl headers (#2029) + * Added ability to override `IntrospectionProcessor`'s `SKIP_FUNCTIONS` in subclasses (#2050) + * Added `$maxLength` param to `SyslogUdpHandler`/`UdpSocket` to keep datagrams below the path MTU, as fragmented UDP packets are often dropped (#2049) + * Fixed `StreamHandler` truncating writes on non-blocking streams, it now loops until the whole record is written (#2016) + * Fixed stack trace frames without file/line being skipped, they are now reported as `internal[function]` entries so traces are not truncated or empty (#2061) + * Fixed `RotatingFileHandler` cleanup not finding files behind stream wrappers (e.g. private://) as glob() cannot see through those (#2058) + * Fixed `RotatingFileHandler` not using the configured timezone when computing the next rotation time (#2022) + * Fixed scalars being replaced by the "Over N levels deep" message instead of being output when the max normalization depth is reached (#2042) + * Fixed `DeduplicationHandler` failing with an undefined array key error when the store file is written to concurrently (#2020) + * Fixed `TelegramBotHandler` swallowing errors when the API returns a non-JSON response (#2030) + * Fixed `AbstractProcessingHandler::handle()` reading `$bubble` directly instead of calling `getBubble()`, so overrides of it were ignored (#2031) + * Fixed warning on PHP 8.5 when `ErrorHandler` sets the HTTP response code and a status line was already registered (#2027) + ### 3.10.0 (2026-01-02) * Added automatic directory cleanup in RotatingFileHandler (#2000) diff --git a/core/vendor/monolog/monolog/composer.json b/core/vendor/monolog/monolog/composer.json index b0fb2d7a5c..a547ea06cd 100644 --- a/core/vendor/monolog/monolog/composer.json +++ b/core/vendor/monolog/monolog/composer.json @@ -32,6 +32,7 @@ "phpstan/phpstan-strict-rules": "^2", "phpunit/phpunit": "^10.5.17 || ^11.0.7", "predis/predis": "^1.1 || ^2", + "psr/clock": "^1.0", "rollbar/rollbar": "^4.0", "ruflin/elastica": "^7 || ^8", "symfony/mailer": "^5.4 || ^6", @@ -51,7 +52,8 @@ "ext-mbstring": "Allow to work properly with unicode symbols", "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", - "ext-openssl": "Required to send log messages using SSL" + "ext-openssl": "Required to send log messages using SSL", + "psr/clock": "Required to pass a clock to the Logger and control the timestamp of log records" }, "autoload": { "psr-4": {"Monolog\\": "src/Monolog"} diff --git a/core/vendor/monolog/monolog/src/Monolog/Attribute/WithMonologChannel.php b/core/vendor/monolog/monolog/src/Monolog/Attribute/WithMonologChannel.php index 862e05b335..0feb213eb1 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Attribute/WithMonologChannel.php +++ b/core/vendor/monolog/monolog/src/Monolog/Attribute/WithMonologChannel.php @@ -12,14 +12,15 @@ namespace Monolog\Attribute; /** - * A reusable attribute to help configure a class as expecting a given logger channel. + * A reusable attribute to help configure a class, or one of its constructor/method arguments, + * as expecting a given logger channel. * * Using it offers no guarantee: it needs to be leveraged by a Monolog third-party consumer. * * Using it with the Monolog library only has no effect at all: wiring the logger instance into * other classes is not managed by Monolog. */ -#[\Attribute(\Attribute::TARGET_CLASS)] +#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PARAMETER)] final class WithMonologChannel { public function __construct( diff --git a/core/vendor/monolog/monolog/src/Monolog/ErrorHandler.php b/core/vendor/monolog/monolog/src/Monolog/ErrorHandler.php index 805f2dfd9f..c10f7be65b 100644 --- a/core/vendor/monolog/monolog/src/Monolog/ErrorHandler.php +++ b/core/vendor/monolog/monolog/src/Monolog/ErrorHandler.php @@ -41,6 +41,9 @@ class ErrorHandler private bool $hasFatalErrorHandler = false; + /** @var int bitmask of E_* constants to capture stack traces for, 0 to disable */ + private int $captureStackTraceTypes = 0; + private string $fatalLevel = LogLevel::ALERT; private string|null $reservedMemory = null; @@ -139,6 +142,30 @@ public function registerFatalHandler($level = null, int $reservedMemorySize = 20 return $this; } + /** + * Attaches an ErrorException carrying the stack trace of the error to the log record's context + * + * PHP does not report where a warning/notice/deprecation came from, so without this the records + * only point at the line which raised the error, and not at its caller. Formatters rendering + * stack traces (e.g. LineFormatter::includeStacktraces) then show the full call site. + * + * This is off by default because context.exception makes errors look like exceptions to the + * handlers which treat that key specially, e.g. NewRelicHandler reports them via + * newrelic_notice_error and RollbarHandler as exception occurrences, and because formatters + * extending NormalizerFormatter then include the whole trace in every record. Narrowing + * $errorTypes is wise if you log a lot of errors: E_DEPRECATED in particular can be very + * frequent in legacy code while rarely being worth a stack trace. + * + * @param int $errorTypes bitmask of E_* constants to capture stack traces for + * @return $this + */ + public function captureStackTraces(bool $capture = true, int $errorTypes = E_ALL): self + { + $this->captureStackTraceTypes = $capture ? $errorTypes : 0; + + return $this; + } + /** * @return array */ @@ -195,7 +222,8 @@ private function handleException(\Throwable $e): never } if (!headers_sent() && \in_array(strtolower((string) \ini_get('display_errors')), ['0', '', 'false', 'off', 'none', 'no'], true)) { - http_response_code(500); + // PHP 8.5+ warns if header('HTTP/...') already staged a status line, which is undetectable from userland + @http_response_code(500); } exit(255); @@ -207,13 +235,23 @@ private function handleError(int $code, string $message, string $file = '', int return false; } + $isFatal = $this->hasFatalErrorHandler && \in_array($code, self::FATAL_ERRORS, true); + + $trace = null; + if ($isFatal || 0 !== ($this->captureStackTraceTypes & $code)) { + $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + array_shift($trace); // Exclude handleError from trace + } + // fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries - if (!$this->hasFatalErrorHandler || !\in_array($code, self::FATAL_ERRORS, true)) { + if (!$isFatal) { $level = $this->errorLevelMap[$code] ?? LogLevel::CRITICAL; - $this->logger->log($level, self::codeToString($code).': '.$message, ['code' => $code, 'message' => $message, 'file' => $file, 'line' => $line]); + $context = ['code' => $code, 'message' => $message, 'file' => $file, 'line' => $line]; + if (null !== $trace) { + $context['exception'] = self::createErrorException($code, $message, $file, $line, $trace); + } + $this->logger->log($level, self::codeToString($code).': '.$message, $context); } else { - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - array_shift($trace); // Exclude handleError from trace $this->lastFatalData = ['type' => $code, 'message' => $message, 'file' => $file, 'line' => $line, 'trace' => $trace]; } @@ -240,11 +278,17 @@ public function handleFatalError(): void $lastError = error_get_last(); } if (\is_array($lastError) && \in_array($lastError['type'], self::FATAL_ERRORS, true)) { + // PHP 8.5+ reports a trace for fatal errors which never reach the error handler (OOM, timeouts) $trace = $lastError['trace'] ?? null; + $context = ['code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'], 'trace' => $trace]; + if (\is_array($trace)) { + /** @var list> $trace */ + $context['exception'] = self::createErrorException($lastError['type'], $lastError['message'], $lastError['file'], $lastError['line'], $trace); + } $this->logger->log( $this->fatalLevel, 'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'], - ['code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'], 'trace' => $trace] + $context ); if ($this->logger instanceof Logger) { @@ -255,6 +299,20 @@ public function handleFatalError(): void } } + /** + * @param list> $trace + */ + private static function createErrorException(int $code, string $message, string $file, int $line, array $trace): \ErrorException + { + $e = new \ErrorException($message, 0, $code, $file, $line); + + // Exception::getTrace() is final, so overwriting the private property is the only way to + // report the real call site instead of ErrorHandler's own frame + (new \ReflectionProperty(\Exception::class, 'trace'))->setValue($e, $trace); + + return $e; + } + private static function codeToString(int $code): string { return match ($code) { diff --git a/core/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php b/core/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php index bf8ed24117..4774bde00b 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php +++ b/core/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php @@ -87,11 +87,11 @@ public function __construct(?string $systemName = null, ?string $extraPrefix = n public function format(LogRecord $record): Message { $context = $extra = []; - if (isset($record->context)) { + if ($record->context !== []) { /** @var array|bool|float|int|string|null> $context */ $context = parent::normalize($record->context); } - if (isset($record->extra)) { + if ($record->extra !== []) { /** @var array|bool|float|int|string|null> $extra */ $extra = parent::normalize($record->extra); } @@ -110,7 +110,7 @@ public function format(LogRecord $record): Message $message->setShortMessage(Utils::substr($record->message, 0, $this->maxLength)); } - if (isset($record->channel)) { + if ($record->channel !== '') { $message->setAdditional('facility', $record->channel); } diff --git a/core/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/core/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php index fa11d0ef02..c9281a4274 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +++ b/core/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php @@ -160,6 +160,10 @@ protected function formatBatchNewlines(array $records): string */ protected function normalize(mixed $data, int $depth = 0): mixed { + if (is_null($data) || is_scalar($data)) { + return $data; + } + if ($depth > $this->maxNormalizeDepth) { return 'Over '.$this->maxNormalizeDepth.' levels deep, aborting normalization'; } @@ -209,11 +213,7 @@ protected function normalize(mixed $data, int $depth = 0): mixed return $data; } - if (\is_resource($data)) { - return parent::normalize($data); - } - - return $data; + return parent::normalize($data); } /** diff --git a/core/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php b/core/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php index 60da29cf7b..7fc6de4601 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +++ b/core/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php @@ -28,6 +28,7 @@ class NormalizerFormatter implements FormatterInterface protected string $dateFormat; protected int $maxNormalizeDepth = 9; protected int $maxNormalizeItemCount = 1000; + protected ?int $maxTraceLength = null; private int $jsonEncodeOptions = Utils::DEFAULT_JSON_FLAGS; @@ -122,6 +123,24 @@ public function setMaxNormalizeItemCount(int $maxNormalizeItemCount): self return $this; } + /** + * The maximum number of stack trace frames to include + */ + public function getMaxTraceLength(): ?int + { + return $this->maxTraceLength; + } + + /** + * @return $this + */ + public function setMaxTraceLength(?int $maxTraceLength): self + { + $this->maxTraceLength = $maxTraceLength; + + return $this; + } + /** * Enables `json_encode` pretty print. * @@ -174,10 +193,6 @@ protected function normalizeRecord(LogRecord $record): array */ protected function normalize(mixed $data, int $depth = 0): mixed { - if ($depth > $this->maxNormalizeDepth) { - return 'Over ' . $this->maxNormalizeDepth . ' levels deep, aborting normalization'; - } - if (null === $data || \is_scalar($data)) { if (\is_float($data)) { if (is_infinite($data)) { @@ -191,6 +206,10 @@ protected function normalize(mixed $data, int $depth = 0): mixed return $data; } + if ($depth > $this->maxNormalizeDepth) { + return 'Over ' . $this->maxNormalizeDepth . ' levels deep, aborting normalization'; + } + if (\is_array($data)) { $normalized = []; @@ -290,14 +309,36 @@ protected function normalizeException(Throwable $e, int $depth = 0) } } - $trace = $e->getTrace(); + $trace = array_slice($e->getTrace(), 0, $this->maxTraceLength); foreach ($trace as $frame) { - if (isset($frame['file'], $frame['line'])) { + if (isset($frame['file'])) { $file = $frame['file']; if ($this->basePath !== '') { - $file = preg_replace('{^'.preg_quote($this->basePath).'}', '', $file); + $file = preg_replace('{^'.preg_quote($this->basePath).'}', '', $file) ?? $file; + } + $data['trace'][] = $file.':'.($frame['line'] ?? 0); + } else { + // Frames called by the engine itself have no file/line: shutdown functions, + // callbacks run by internal functions, destructors. Skipping them made traces + // look shorter than they were, and entirely empty for fatal errors caught in a + // shutdown function, so they are reported by name instead. + $call = $frame['function']; + // since PHP 8.4 a closure is named after its declaring scope, which already + // includes the class, so prefixing it again would just repeat it + if (isset($frame['class']) && !str_starts_with($call, '{closure:')) { + // before 8.4 the name is \{closure}, and the class has the namespace + $call = str_ends_with($call, '\{closure}') ? '{closure}' : $call; + $call = Utils::getClassName($frame['class']).($frame['type'] ?? '::').$call; + } + // anonymous classes carry their declaration site after a NUL byte, which truncates + // syslog lines and is not valid JSON; PHP 8.4 embeds it in closure names too + $call = preg_replace('{@anonymous\x00.*?\$[0-9a-f]++(?=::|$)}s', '@anonymous', $call) ?? $call; + if ($this->basePath !== '') { + // closure names embed the file they were declared in since PHP 8.4, so the + // pattern cannot be anchored; limit it or a recurring base path is stripped twice + $call = preg_replace('{'.preg_quote($this->basePath).'}', '', $call, 1) ?? $call; } - $data['trace'][] = $file.':'.$frame['line']; + $data['trace'][] = 'internal['.$call.']:0'; } } diff --git a/core/vendor/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php b/core/vendor/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php new file mode 100644 index 0000000000..d97a66a1eb --- /dev/null +++ b/core/vendor/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php @@ -0,0 +1,373 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\LogRecord; +use Monolog\Utils; + +/** + * Wraps another formatter to redact sensitive data from log records. + * + * It works in three passes so that it can mask secrets wherever they end up: + * + * - Before delegating, it masks the value of any context/extra key whose name + * matches one of the configured sensitive keys (case-insensitive, recursive). + * - After delegating, it removes those same secret values from the wrapped + * formatter's output, which catches the copies masking the record cannot + * reach, e.g. a secret interpolated into the message by the + * PsrLogMessageProcessor or embedded in an exception message. + * - Last, it runs the configured regex patterns over the output, which catches + * secrets that only became strings once the inner formatter normalized + * objects (e.g. tokens buried in an exception stack trace). If a pattern + * cannot be applied, the record is dropped instead of emitted unredacted. + * + * On top of the sensitive keys, secrets are also read from the properties of the + * objects in the record matching a constructor parameter marked + * #[SensitiveParameter]. Those can only be handled by the output pass, as the + * objects carrying them cannot be modified. This is the one part that reflects on + * every logged object, so it can be turned off with $redactSensitiveParameters. + * + * Only string and array output can be swept, so wrapping a formatter which returns + * objects (e.g. the ElasticaFormatter) leaves you with the key masking alone. + * + * Because it is a formatter rather than a processor, it is guaranteed to run + * after every processor (both Logger- and Handler-level), so it always sees the + * final record with all data at hand. + * + * @author Jordi Boggiano + */ +final class RedactingFormatter implements WrappingFormatterInterface +{ + /** + * Matches long token-like words (30+ alphanumerics, optionally prefixed like api_key_), + * which are very likely to be secrets/tokens. Provided as an opt-in pattern as it may + * cause collateral damage on legitimate long strings (hashes, UUIDs, base64, ...). + */ + public const TOKEN_PATTERN = '{\b(?:[a-z]+_)*[a-zA-Z0-9]{30,}\b}'; + + /** + * How deep to walk the record and the output, mirrors NormalizerFormatter's default + */ + private const MAX_DEPTH = 9; + + /** @var list Lowercased sensitive keys */ + private array $sensitiveKeys; + + /** @var list */ + private array $patterns; + + /** @var array> */ + private array $sensitiveProperties = []; + + /** + * @param FormatterInterface $formatter The formatter to wrap and whose output gets redacted + * @param list $sensitiveKeys Exact context/extra keys whose values to mask (case-insensitive) + * @param list $patterns PCRE patterns to mask in the formatted output (e.g. self::TOKEN_PATTERN) + * @param string $mask Replacement token + * @param bool $redactSensitiveParameters Whether to also read secrets off the properties matching a + * #[SensitiveParameter] constructor parameter, which requires + * walking and reflecting on every object in the record + * @param int $minSecretLength Minimum length a secret must have to be removed from the + * output, to avoid short values like "pass" redacting + * unrelated data + * + * @throws \InvalidArgumentException If a pattern is not a valid PCRE regex + */ + public function __construct( + private readonly FormatterInterface $formatter, + array $sensitiveKeys = ['password', 'passwd', 'pwd', 'secret', 'token', 'api_key', 'apikey', 'authorization', 'auth', 'cookie'], + array $patterns = [], + private readonly string $mask = '[REDACTED]', + private readonly bool $redactSensitiveParameters = true, + private readonly int $minSecretLength = 5, + ) { + $this->sensitiveKeys = array_values(array_map('strtolower', $sensitiveKeys)); + + foreach ($patterns as $pattern) { + if (@preg_match($pattern, '') === false) { + throw new \InvalidArgumentException(sprintf('Invalid redaction pattern provided to RedactingFormatter: %s', var_export($pattern, true))); + } + } + $this->patterns = array_values($patterns); + } + + public function getWrappedFormatter(): FormatterInterface + { + return $this->formatter; + } + + public function format(LogRecord $record) + { + // secrets must be collected before the keys get masked, as masking loses the values + $secrets = $this->collectSecrets([$record]); + + return $this->sweep($this->formatter->format($this->redactRecord($record)), $secrets); + } + + public function formatBatch(array $records) + { + $secrets = $this->collectSecrets($records); + + foreach ($records as $key => $record) { + $records[$key] = $this->redactRecord($record); + } + + return $this->sweep($this->formatter->formatBatch($records), $secrets); + } + + private function redactRecord(LogRecord $record): LogRecord + { + return $record->with( + context: $this->redactKeys($record->context), + extra: $this->redactKeys($record->extra), + ); + } + + /** + * @param array $data + * @return array + */ + private function redactKeys(array $data, int $depth = 0): array + { + // context comes from userland and can hold a self-referencing array + if ($depth > self::MAX_DEPTH) { + return $data; + } + + foreach ($data as $key => $value) { + if (\is_string($key) && \in_array(strtolower($key), $this->sensitiveKeys, true)) { + $data[$key] = $this->mask; + } elseif (\is_array($value)) { + $data[$key] = $this->redactKeys($value, $depth + 1); + } + } + + return $data; + } + + /** + * Gathers the secret values present in the given records, longest first + * + * @param iterable $records + * @return list + */ + private function collectSecrets(iterable $records): array + { + $secrets = []; + $seen = []; + foreach ($records as $record) { + $this->collect($record->context, $secrets, $seen, 0); + $this->collect($record->extra, $secrets, $seen, 0); + } + + if ([] === $secrets) { + return []; + } + + // a secret containing quotes/backslashes/newlines shows up escaped in json output, + // so both forms have to be looked for + $escapedSecrets = []; + foreach ($secrets as $secret) { + $escaped = substr(Utils::jsonEncode($secret, null, true), 1, -1); + if ($escaped !== $secret && $escaped !== '') { + $escapedSecrets[] = $escaped; + } + } + + $secrets = array_values(array_unique(array_merge($secrets, $escapedSecrets))); + // longest first, so that overlapping secrets do not leave fragments behind + usort($secrets, static fn (string $a, string $b) => \strlen($b) <=> \strlen($a)); + + return $secrets; + } + + /** + * @param list $secrets + * @param array $seen Ids of the objects visited so far, to survive cyclic graphs + */ + private function collect(mixed $data, array &$secrets, array &$seen, int $depth): void + { + if ($depth > self::MAX_DEPTH) { + return; + } + + if (\is_array($data)) { + foreach ($data as $key => $value) { + if (\is_string($key) && \in_array(strtolower($key), $this->sensitiveKeys, true)) { + // the value is masked in the record, but a nested array's leaves can still + // leak elsewhere (e.g. json-encoded by PsrLogMessageProcessor) + $this->collectSensitiveValue($value, $secrets, $depth + 1); + + continue; + } + + $this->collect($value, $secrets, $seen, $depth + 1); + } + + return; + } + + // the array walk above is essentially free, reflecting on objects is not + if (!\is_object($data) || !$this->redactSensitiveParameters) { + return; + } + + $id = spl_object_id($data); + if (isset($seen[$id])) { + return; + } + $seen[$id] = true; + + foreach ($this->getSensitiveProperties($data) as $property) { + if ($property->isInitialized($data)) { + $this->addSecret($property->getValue($data), $secrets); + } + } + + // public properties only, matching what formatters get to see, but enough to reach + // objects nested inside this one + foreach (get_object_vars($data) as $value) { + $this->collect($value, $secrets, $seen, $depth + 1); + } + } + + /** + * Collects every string leaf nested inside a value under a sensitive key. + * + * @param list $secrets + */ + private function collectSensitiveValue(mixed $value, array &$secrets, int $depth): void + { + if ($depth > self::MAX_DEPTH) { + return; + } + + if (\is_array($value)) { + foreach ($value as $item) { + $this->collectSensitiveValue($item, $secrets, $depth + 1); + } + + return; + } + + $this->addSecret($value, $secrets); + } + + /** + * Reflects the properties of an object matching a #[SensitiveParameter] constructor parameter + * + * Non-public properties are included as they can still leak through __toString(), and the + * result is cached per class as reflecting on every logged object would be far too costly. + * + * @return array + */ + private function getSensitiveProperties(object $data): array + { + $class = $data::class; + if (isset($this->sensitiveProperties[$class])) { + return $this->sensitiveProperties[$class]; + } + + $names = Utils::getSensitiveParameterNames($class); + + // PHP 8.2+ wraps the arguments it hides from stack traces in a SensitiveParameterValue, + // whose own constructor parameter is not marked. Matched by name and read as a property + // so that it does not matter whether symfony/polyfill-php82 is installed on PHP 8.1: + // naming the class makes PHPStan report either the @internal getValue() the polyfill + // inherits, or a missing class when it is absent. + if ('SensitiveParameterValue' === $class) { + $names['value'] = true; + } + + $properties = []; + foreach ($names as $name => $_) { + // walking up is required as a private property of a parent class is not + // reachable through the child's ReflectionClass + for ($reflection = new \ReflectionClass($class); false !== $reflection; $reflection = $reflection->getParentClass()) { + if ($reflection->hasProperty($name)) { + $properties[$name] = $reflection->getProperty($name); + + break; + } + } + } + + return $this->sensitiveProperties[$class] = $properties; + } + + /** + * @param list $secrets + */ + private function addSecret(mixed $value, array &$secrets): void + { + // a Stringable secret ends up in the output as its string form, so that is what + // has to be looked for + if ($value instanceof \Stringable) { + try { + $value = $value->__toString(); + } catch (\Throwable) { + return; + } + } + + // ints/floats are left out on purpose, sweeping a digit run out of the output + // would silently corrupt unrelated data + if (\is_string($value) && $value !== '' && \strlen($value) >= $this->minSecretLength) { + $secrets[] = $value; + } + } + + /** + * Removes the collected secrets and applies the configured patterns to the formatter output, + * recursing into arrays to support formatters that do not return a string (e.g. MongoDBFormatter). + * + * @param list $secrets + */ + private function sweep(mixed $formatted, array $secrets, int $depth = 0): mixed + { + if ([] === $this->patterns && [] === $secrets) { + return $formatted; + } + + // deeper than any formatter will render anyway, and a custom one may well + // hand back a self-referencing array + if ($depth > self::MAX_DEPTH) { + return $formatted; + } + + if (\is_string($formatted)) { + if ([] !== $secrets) { + $formatted = str_replace($secrets, $this->mask, $formatted); + } + if ([] !== $this->patterns) { + $replaced = preg_replace($this->patterns, $this->mask, $formatted); + if (null === $replaced) { + // the patterns could not be applied so the output cannot be trusted, drop it + // entirely. Neither the patterns (which may embed a secret themselves) nor the + // mask are reported, preg_last_error_msg() is one of a fixed set of PCRE strings + return '[RedactingFormatter dropped this record, pattern redaction failed with "'.preg_last_error_msg().'"]'; + } + $formatted = $replaced; + } + + return $formatted; + } + + if (\is_array($formatted)) { + foreach ($formatted as $key => $value) { + $formatted[$key] = $this->sweep($value, $secrets, $depth + 1); + } + } + + return $formatted; + } +} diff --git a/core/vendor/monolog/monolog/src/Monolog/Formatter/WrappingFormatterInterface.php b/core/vendor/monolog/monolog/src/Monolog/Formatter/WrappingFormatterInterface.php new file mode 100644 index 0000000000..02a6b8851f --- /dev/null +++ b/core/vendor/monolog/monolog/src/Monolog/Formatter/WrappingFormatterInterface.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +/** + * Interface for formatters decorating another formatter + * + * Handlers which only accept one specific formatter can use Utils::unwrapFormatter() + * to see through the decoration and accept a wrapped instance of that formatter. + * + * @author Jordi Boggiano + */ +interface WrappingFormatterInterface extends FormatterInterface +{ + /** + * Returns the formatter this one delegates the actual formatting to + */ + public function getWrappedFormatter(): FormatterInterface; +} diff --git a/core/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php b/core/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php index de13a76bec..78bec3e6a1 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php +++ b/core/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php @@ -43,7 +43,7 @@ public function handle(LogRecord $record): bool $this->write($record); - return false === $this->bubble; + return !$this->getBubble(); } /** diff --git a/core/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php b/core/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php index 788d7d0684..6d8656b989 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php +++ b/core/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php @@ -262,10 +262,7 @@ private static function dump(string $title, array $dict): array } $script[] = self::call('log', self::quote('%c%s'), self::quote('font-weight: bold'), self::quote($title)); foreach ($dict as $key => $value) { - $value = json_encode($value); - if (false === $value) { - $value = self::quote(''); - } + $value = Utils::jsonEncode($value, Utils::DEFAULT_JSON_FLAGS | JSON_HEX_TAG); $script[] = self::call('log', self::quote('%s: %o'), self::quote((string) $key), $value); } @@ -274,7 +271,10 @@ private static function dump(string $title, array $dict): array private static function quote(string $arg): string { - return '"' . addcslashes($arg, "\"\n\\") . '"'; + // JSON_HEX_TAG keeps a literal < out of the output, so that a log message cannot break out + // of the surrounding or