diff --git a/app/Bus/Commands/Schedule/CreateScheduleCommand.php b/app/Bus/Commands/Schedule/CreateScheduleCommand.php index ebeec0d8..d40d68df 100644 --- a/app/Bus/Commands/Schedule/CreateScheduleCommand.php +++ b/app/Bus/Commands/Schedule/CreateScheduleCommand.php @@ -60,6 +60,13 @@ final class CreateScheduleCommand */ public $components; + /** + * Whether to notify that the incident was reported. + * + * @var bool + */ + public $notify; + /** * The validation rules. * @@ -72,6 +79,7 @@ final class CreateScheduleCommand 'scheduled_at' => 'required|string', 'completed_at' => 'nullable|string', 'components' => 'nullable|array', + 'notify' => 'nullable|bool', ]; /** @@ -83,10 +91,11 @@ final class CreateScheduleCommand * @param string $scheduled_at * @param string $completed_at * @param array $components + * @param bool $notify * * @return void */ - public function __construct($name, $message, $status, $scheduled_at, $completed_at, array $components = []) + public function __construct($name, $message, $status, $scheduled_at, $completed_at, $components, $notify) { $this->name = $name; $this->message = $message; @@ -94,5 +103,6 @@ final class CreateScheduleCommand $this->scheduled_at = $scheduled_at; $this->completed_at = $completed_at; $this->components = $components; + $this->notify = $notify; } } diff --git a/app/Bus/Events/Schedule/ScheduleWasCreatedEvent.php b/app/Bus/Events/Schedule/ScheduleWasCreatedEvent.php index 1e1ecb4e..2438658d 100644 --- a/app/Bus/Events/Schedule/ScheduleWasCreatedEvent.php +++ b/app/Bus/Events/Schedule/ScheduleWasCreatedEvent.php @@ -36,18 +36,27 @@ final class ScheduleWasCreatedEvent implements ActionInterface, ScheduleEventInt */ public $schedule; + /** + * Whether to notify that the incident was reported. + * + * @var bool + */ + public $notify; + /** * Create a new schedule was created event instance. * * @param \CachetHQ\Cachet\Models\User $user * @param \CachetHQ\Cachet\Models\Schedule $schedule + * @param bool notify * * @return void */ - public function __construct(User $user, Schedule $schedule) + public function __construct(User $user, Schedule $schedule, $notify = false) { $this->user = $user; $this->schedule = $schedule; + $this->notify = $notify; } /** diff --git a/app/Bus/Handlers/Commands/Schedule/CreateScheduleCommandHandler.php b/app/Bus/Handlers/Commands/Schedule/CreateScheduleCommandHandler.php index 23de4933..9069eadb 100644 --- a/app/Bus/Handlers/Commands/Schedule/CreateScheduleCommandHandler.php +++ b/app/Bus/Handlers/Commands/Schedule/CreateScheduleCommandHandler.php @@ -66,8 +66,7 @@ class CreateScheduleCommandHandler { try { $schedule = Schedule::create($this->filter($command)); - - event(new ScheduleWasCreatedEvent($this->auth->user(), $schedule)); + event(new ScheduleWasCreatedEvent($this->auth->user(), $schedule, (bool) $command->notify)); } catch (InvalidArgumentException $e) { throw new ValidationException(new MessageBag([$e->getMessage()])); } @@ -96,6 +95,7 @@ class CreateScheduleCommandHandler 'status' => $command->status, 'scheduled_at' => $scheduledAt, 'completed_at' => $completedAt, + 'notify' => $command->notify, ]; $availableParams = array_filter($params, function ($val) { diff --git a/app/Bus/Handlers/Events/Schedule/SendScheduleEmailNotificationHandler.php b/app/Bus/Handlers/Events/Schedule/SendScheduleEmailNotificationHandler.php index 11e6b377..84e9db31 100644 --- a/app/Bus/Handlers/Events/Schedule/SendScheduleEmailNotificationHandler.php +++ b/app/Bus/Handlers/Events/Schedule/SendScheduleEmailNotificationHandler.php @@ -51,6 +51,9 @@ class SendScheduleEmailNotificationHandler public function handle(ScheduleEventInterface $event) { $schedule = $event->schedule; + if (!$event->notify) { + return false; + } // First notify all global subscribers. $globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get()->each(function ($subscriber) use ($schedule) { diff --git a/app/Foundation/Providers/RouteServiceProvider.php b/app/Foundation/Providers/RouteServiceProvider.php index 45c01a5d..cadbe50b 100644 --- a/app/Foundation/Providers/RouteServiceProvider.php +++ b/app/Foundation/Providers/RouteServiceProvider.php @@ -13,6 +13,7 @@ namespace CachetHQ\Cachet\Foundation\Providers; use CachetHQ\Cachet\Http\Middleware\Acceptable; use CachetHQ\Cachet\Http\Middleware\Authenticate; +use CachetHQ\Cachet\Http\Middleware\RemoteUserAuthenticate; use CachetHQ\Cachet\Http\Middleware\Timezone; use CachetHQ\Cachet\Http\Middleware\VerifyCsrfToken; use CachetHQ\Cachet\Http\Routes\ApiSystemRoutes; @@ -151,6 +152,7 @@ class RouteServiceProvider extends ServiceProvider if ($applyAlwaysAuthenticate && !$this->isWhiteListedAuthRoute($routes)) { $middleware[] = Authenticate::class; + $middleware[] = RemoteUserAuthenticate::class; } $router->group(['middleware' => $middleware], function (Router $router) use ($routes) { diff --git a/app/Http/Controllers/Api/ScheduleController.php b/app/Http/Controllers/Api/ScheduleController.php index d12eabc7..c59f46db 100644 --- a/app/Http/Controllers/Api/ScheduleController.php +++ b/app/Http/Controllers/Api/ScheduleController.php @@ -73,7 +73,8 @@ class ScheduleController extends AbstractApiController Binput::get('status'), Binput::get('scheduled_at'), Binput::get('completed_at'), - Binput::get('components', []) + Binput::get('components', []), + Binput::get('notify', false) )); } catch (QueryException $e) { throw new BadRequestHttpException(); diff --git a/app/Http/Controllers/Dashboard/MetricController.php b/app/Http/Controllers/Dashboard/MetricController.php index 56a4f6e9..1a0b601c 100644 --- a/app/Http/Controllers/Dashboard/MetricController.php +++ b/app/Http/Controllers/Dashboard/MetricController.php @@ -45,8 +45,7 @@ class MetricController extends Controller public function showAddMetric() { return View::make('dashboard.metrics.add') - ->withPageTitle(trans('dashboard.metrics.add.title').' - '.trans('dashboard.dashboard')) - ->withAcceptableThresholds(Metric::ACCEPTABLE_THRESHOLDS); + ->withPageTitle(trans('dashboard.metrics.add.title').' - '.trans('dashboard.dashboard')); } /** @@ -132,8 +131,7 @@ class MetricController extends Controller { return View::make('dashboard.metrics.edit') ->withPageTitle(trans('dashboard.metrics.edit.title').' - '.trans('dashboard.dashboard')) - ->withMetric($metric) - ->withAcceptableThresholds(Metric::ACCEPTABLE_THRESHOLDS); + ->withMetric($metric); } /** diff --git a/app/Http/Controllers/Dashboard/ScheduleController.php b/app/Http/Controllers/Dashboard/ScheduleController.php index ceb369bc..c06216a9 100644 --- a/app/Http/Controllers/Dashboard/ScheduleController.php +++ b/app/Http/Controllers/Dashboard/ScheduleController.php @@ -15,6 +15,7 @@ use AltThree\Validator\ValidationException; use CachetHQ\Cachet\Bus\Commands\Schedule\CreateScheduleCommand; use CachetHQ\Cachet\Bus\Commands\Schedule\DeleteScheduleCommand; use CachetHQ\Cachet\Bus\Commands\Schedule\UpdateScheduleCommand; +use CachetHQ\Cachet\Integrations\Contracts\System; use CachetHQ\Cachet\Models\IncidentTemplate; use CachetHQ\Cachet\Models\Schedule; use GrahamCampbell\Binput\Facades\Binput; @@ -35,13 +36,21 @@ class ScheduleController extends Controller */ protected $subMenu = []; + /** + * The system instance. + * + * @var \CachetHQ\Cachet\Integrations\Contracts\System + */ + protected $system; + /** * Creates a new schedule controller instance. * * @return void */ - public function __construct() + public function __construct(System $system) { + $this->system = $system; View::share('subTitle', trans('dashboard.schedule.title')); } @@ -70,7 +79,8 @@ class ScheduleController extends Controller return View::make('dashboard.maintenance.add') ->withPageTitle(trans('dashboard.schedule.add.title').' - '.trans('dashboard.dashboard')) - ->withIncidentTemplates($incidentTemplates); + ->withIncidentTemplates($incidentTemplates) + ->withNotificationsEnabled($this->system->canNotifySubscribers()); } /** @@ -87,7 +97,8 @@ class ScheduleController extends Controller Binput::get('status', Schedule::UPCOMING), Binput::get('scheduled_at'), Binput::get('completed_at'), - Binput::get('components', []) + Binput::get('components', []), + Binput::get('notify', false) )); } catch (ValidationException $e) { return cachet_redirect('dashboard.schedule.create') diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index cc9e60b8..aafdf0c6 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -15,9 +15,11 @@ use Barryvdh\Cors\HandleCors; use CachetHQ\Cachet\Http\Middleware\Admin; use CachetHQ\Cachet\Http\Middleware\ApiAuthentication; use CachetHQ\Cachet\Http\Middleware\Authenticate; +use CachetHQ\Cachet\Http\Middleware\CacheControl; use CachetHQ\Cachet\Http\Middleware\Localize; use CachetHQ\Cachet\Http\Middleware\ReadyForUse; use CachetHQ\Cachet\Http\Middleware\RedirectIfAuthenticated; +use CachetHQ\Cachet\Http\Middleware\RemoteUserAuthenticate; use CachetHQ\Cachet\Http\Middleware\SetupAlreadyCompleted; use CachetHQ\Cachet\Http\Middleware\SubscribersConfigured; use CachetHQ\Cachet\Http\Middleware\Throttler; @@ -44,16 +46,18 @@ class Kernel extends HttpKernel * @var array */ protected $routeMiddleware = [ - 'admin' => Admin::class, - 'can' => Authorize::class, - 'cors' => HandleCors::class, - 'auth' => Authenticate::class, - 'auth.api' => ApiAuthentication::class, - 'guest' => RedirectIfAuthenticated::class, - 'localize' => Localize::class, - 'ready' => ReadyForUse::class, - 'setup' => SetupAlreadyCompleted::class, - 'subscribers' => SubscribersConfigured::class, - 'throttle' => Throttler::class, + 'admin' => Admin::class, + 'auth.api' => ApiAuthentication::class, + 'auth.remoteuser' => RemoteUserAuthenticate::class, + 'auth' => Authenticate::class, + 'cache' => CacheControl::class, + 'can' => Authorize::class, + 'cors' => HandleCors::class, + 'guest' => RedirectIfAuthenticated::class, + 'localize' => Localize::class, + 'ready' => ReadyForUse::class, + 'setup' => SetupAlreadyCompleted::class, + 'subscribers' => SubscribersConfigured::class, + 'throttle' => Throttler::class, ]; } diff --git a/app/Http/Middleware/CacheControl.php b/app/Http/Middleware/CacheControl.php new file mode 100644 index 00000000..fa54dfe0 --- /dev/null +++ b/app/Http/Middleware/CacheControl.php @@ -0,0 +1,37 @@ +header('Cache-Control', 'public,max-age='.$maxAge); + + return $response; + } +} diff --git a/app/Http/Middleware/RemoteUserAuthenticate.php b/app/Http/Middleware/RemoteUserAuthenticate.php new file mode 100644 index 00000000..075c0c4a --- /dev/null +++ b/app/Http/Middleware/RemoteUserAuthenticate.php @@ -0,0 +1,53 @@ +auth = $auth; + } + + /** + * Handle an incoming request. + * + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * + * @return mixed + */ + public function handle(Request $request, Closure $next) + { + if ($remoteUser = $request->server('REMOTE_USER')) { + $user = User::where('email', '=', $remoteUser)->first(); + + if ($user instanceof User && $this->auth->guest()) { + $this->auth->login($user); + } + } + + return $next($request); + } +} diff --git a/app/Http/Middleware/SubscribersConfigured.php b/app/Http/Middleware/SubscribersConfigured.php index b154b435..116b20a5 100644 --- a/app/Http/Middleware/SubscribersConfigured.php +++ b/app/Http/Middleware/SubscribersConfigured.php @@ -52,10 +52,6 @@ class SubscribersConfigured */ public function handle(Request $request, Closure $next) { - if (!$this->config->get('setting.enable_subscribers')) { - return cachet_redirect('status-page'); - } - return $next($request); } } diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 9fcdfb79..83a86c5e 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -13,6 +13,7 @@ namespace CachetHQ\Cachet\Http\Middleware; use Fideloper\Proxy\TrustProxies as Middleware; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Config; /** * This is the trust proxies middleware class. @@ -42,6 +43,8 @@ class TrustProxies extends Middleware */ public function __construct() { - $this->proxies = empty(env('TRUSTED_PROXIES')) ? '*' : explode(',', trim(env('TRUSTED_PROXIES'))); + $proxies = Config::get('trustedproxies.proxies'); + + $this->proxies = empty($proxies) ? '*' : explode(',', trim($proxies)); } } diff --git a/app/Http/Routes/ApiSystemRoutes.php b/app/Http/Routes/ApiSystemRoutes.php index 80899f71..92a7aa2e 100644 --- a/app/Http/Routes/ApiSystemRoutes.php +++ b/app/Http/Routes/ApiSystemRoutes.php @@ -43,7 +43,7 @@ class ApiSystemRoutes $router->group(['middleware' => ['auth.api']], function (Registrar $router) { $router->get('ping', 'GeneralController@ping'); $router->get('version', 'GeneralController@version'); - $router->get('status', 'GeneralController@status'); + $router->get('status', ['uses' => 'GeneralController@status', 'middleware' => ['cache']]); }); }); } diff --git a/app/Models/Metric.php b/app/Models/Metric.php index 8b5bc2d6..8f1e98df 100644 --- a/app/Models/Metric.php +++ b/app/Models/Metric.php @@ -62,13 +62,6 @@ class Metric extends Model implements HasPresenter */ const VISIBLE_HIDDEN = 2; - /** - * Array of acceptable threshold minutes. - * - * @var int[] - */ - const ACCEPTABLE_THRESHOLDS = [1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60]; - /** * The model's attributes. * @@ -134,7 +127,6 @@ class Metric extends Model implements HasPresenter 'default_value' => 'required|numeric', 'places' => 'required|numeric|between:0,4', 'default_view' => 'required|numeric|between:0,3', - 'threshold' => 'required|numeric|between:0,10', 'visible' => 'required|numeric|between:0,2', ]; diff --git a/app/Models/User.php b/app/Models/User.php index 219a5218..0422082b 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -12,21 +12,19 @@ namespace CachetHQ\Cachet\Models; use AltThree\Validator\ValidatingTrait; -use CachetHQ\Cachet\Presenters\UserPresenter; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Str; -use McCool\LaravelAutoPresenter\HasPresenter; /** * This is the user model. * * @author James Brooks */ -class User extends Authenticatable implements HasPresenter +class User extends Authenticatable { use Notifiable, ValidatingTrait; @@ -211,14 +209,4 @@ class User extends Authenticatable implements HasPresenter { return trim($this->google_2fa_secret) !== ''; } - - /** - * Get the presenter class. - * - * @return string - */ - public function getPresenterClass() - { - return UserPresenter::class; - } } diff --git a/app/Notifications/Component/ComponentStatusChangedNotification.php b/app/Notifications/Component/ComponentStatusChangedNotification.php index 8621e6f7..47502ed2 100644 --- a/app/Notifications/Component/ComponentStatusChangedNotification.php +++ b/app/Notifications/Component/ComponentStatusChangedNotification.php @@ -140,7 +140,7 @@ class ComponentStatusChangedNotification extends Notification return (new SlackMessage()) ->$status() - ->content(trans('notifications.component.status_update.slack.subject')) + ->content(trans('notifications.component.status_update.slack.title')) ->attachment(function ($attachment) use ($content, $notifiable) { $attachment->title($content, cachet_route('status-page')) ->fields(array_filter([ diff --git a/app/Notifications/Incident/NewIncidentNotification.php b/app/Notifications/Incident/NewIncidentNotification.php index f816fa6f..c0f956b2 100644 --- a/app/Notifications/Incident/NewIncidentNotification.php +++ b/app/Notifications/Incident/NewIncidentNotification.php @@ -133,8 +133,7 @@ class NewIncidentNotification extends Notification ->fields(array_filter([ 'ID' => "#{$this->incident->id}", 'Link' => $this->incident->permalink, - ])) - ->footer(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])); + ])); }); } } diff --git a/app/Notifications/Schedule/NewScheduleNotification.php b/app/Notifications/Schedule/NewScheduleNotification.php index 2ba73596..b86c61de 100644 --- a/app/Notifications/Schedule/NewScheduleNotification.php +++ b/app/Notifications/Schedule/NewScheduleNotification.php @@ -124,8 +124,7 @@ class NewScheduleNotification extends Notification implements ShouldQueue ->fields(array_filter([ 'ID' => "#{$this->schedule->id}", 'Status' => $this->schedule->human_status, - ])) - ->footer(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])); + ])); }); } } diff --git a/app/Presenters/UserPresenter.php b/app/Presenters/UserPresenter.php deleted file mode 100644 index b14022d7..00000000 --- a/app/Presenters/UserPresenter.php +++ /dev/null @@ -1,51 +0,0 @@ - - */ -class UserPresenter extends BasePresenter implements Arrayable -{ - /** - * Returns the users avatar. - * - * @return string - */ - public function avatar() - { - if (Config::get('setting.enable_external_dependencies')) { - return sprintf('https://www.gravatar.com/avatar/%s?size=%d', md5(strtolower($this->email)), 200); - } - - return Avatar::create($this->username)->toBase64(); - } - - /** - * Convert the presenter instance to an array. - * - * @return string[] - */ - public function toArray() - { - return array_merge($this->wrappedObject->toArray(), [ - 'avatar' => $this->avatar(), - ]); - } -} diff --git a/composer.json b/composer.json index 7f6eeac8..bfcd4ba3 100644 --- a/composer.json +++ b/composer.json @@ -49,7 +49,6 @@ "jenssegers/date": "^3.4", "laravel/framework": "5.7.*", "laravel/tinker": "^1.0", - "laravolt/avatar": "^2.1", "mccool/laravel-auto-presenter": "^7.1", "nexmo/client": "^1.5", "pragmarx/google2fa": "^0.7.1", @@ -64,7 +63,6 @@ "filp/whoops": "^2.3", "fzaninotto/faker": "^1.8", "graham-campbell/analyzer": "^2.1", - "graham-campbell/testbench-core": "^3.0", "mockery/mockery": "^1.2", "phpunit/phpunit": "^7.4", "tightenco/mailthief": "^0.3.14" diff --git a/composer.lock b/composer.lock index 8439b8fd..3cef25c7 100644 --- a/composer.lock +++ b/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": "616135d38596e8d3c78ed774082dad7e", + "content-hash": "0bb0a073b8972260345c7a83eebb9243", "packages": [ { "name": "alt-three/badger", @@ -602,62 +602,6 @@ ], "time": "2018-11-02T09:03:50+00:00" }, - { - "name": "danielstjules/stringy", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/danielstjules/Stringy.git", - "reference": "df24ab62d2d8213bbbe88cc36fc35a4503b4bd7e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/danielstjules/Stringy/zipball/df24ab62d2d8213bbbe88cc36fc35a4503b4bd7e", - "reference": "df24ab62d2d8213bbbe88cc36fc35a4503b4bd7e", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "symfony/polyfill-mbstring": "~1.1" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Stringy\\": "src/" - }, - "files": [ - "src/Create.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel St. Jules", - "email": "danielst.jules@gmail.com", - "homepage": "http://www.danielstjules.com" - } - ], - "description": "A string manipulation library with multibyte support", - "homepage": "https://github.com/danielstjules/Stringy", - "keywords": [ - "UTF", - "helpers", - "manipulation", - "methods", - "multibyte", - "string", - "utf-8", - "utility", - "utils" - ], - "time": "2017-06-12T01:10:27+00:00" - }, { "name": "dnoegel/php-xdg-base-dir", "version": "0.1", @@ -1832,76 +1776,6 @@ ], "time": "2019-07-01T23:21:34+00:00" }, - { - "name": "intervention/image", - "version": "2.5.0", - "source": { - "type": "git", - "url": "https://github.com/Intervention/image.git", - "reference": "39eaef720d082ecc54c64bf54541c55f10db546d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Intervention/image/zipball/39eaef720d082ecc54c64bf54541c55f10db546d", - "reference": "39eaef720d082ecc54c64bf54541c55f10db546d", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "guzzlehttp/psr7": "~1.1", - "php": ">=5.4.0" - }, - "require-dev": { - "mockery/mockery": "~0.9.2", - "phpunit/phpunit": "^4.8 || ^5.7" - }, - "suggest": { - "ext-gd": "to use GD library based image processing.", - "ext-imagick": "to use Imagick based image processing.", - "intervention/imagecache": "Caching extension for the Intervention Image library" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - }, - "laravel": { - "providers": [ - "Intervention\\Image\\ImageServiceProvider" - ], - "aliases": { - "Image": "Intervention\\Image\\Facades\\Image" - } - } - }, - "autoload": { - "psr-4": { - "Intervention\\Image\\": "src/Intervention/Image" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Oliver Vogel", - "email": "oliver@olivervogel.com", - "homepage": "http://olivervogel.com/" - } - ], - "description": "Image handling and manipulation library with support for Laravel integration", - "homepage": "http://image.intervention.io/", - "keywords": [ - "gd", - "image", - "imagick", - "laravel", - "thumbnail", - "watermark" - ], - "time": "2019-06-24T14:06:31+00:00" - }, { "name": "jakub-onderka/php-console-color", "version": "v0.2", @@ -2423,72 +2297,6 @@ ], "time": "2018-10-12T19:39:35+00:00" }, - { - "name": "laravolt/avatar", - "version": "2.2.1", - "source": { - "type": "git", - "url": "https://github.com/laravolt/avatar.git", - "reference": "58470dbbac0704772d87e775ac60dcd1580f022a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravolt/avatar/zipball/58470dbbac0704772d87e775ac60dcd1580f022a", - "reference": "58470dbbac0704772d87e775ac60dcd1580f022a", - "shasum": "" - }, - "require": { - "danielstjules/stringy": "~3.1", - "illuminate/cache": "~5.2", - "illuminate/support": "~5.2", - "intervention/image": "^2.1", - "php": ">=7.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.1", - "phpunit/phpunit": "~6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - }, - "laravel": { - "providers": [ - "Laravolt\\Avatar\\ServiceProvider" - ], - "aliases": { - "Avatar": "Laravolt\\Avatar\\Facade" - } - } - }, - "autoload": { - "psr-4": { - "Laravolt\\Avatar\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bayu Hendra Winata", - "email": "uyab.exe@gmail.com", - "homepage": "http://id-laravel.com", - "role": "Developer" - } - ], - "description": "Turn name, email, and any other string into initial-based avatar or gravatar.", - "homepage": "https://github.com/laravolt/avatar", - "keywords": [ - "avatar", - "gravatar", - "laravel", - "laravolt" - ], - "time": "2019-05-24T23:46:54+00:00" - }, { "name": "lcobucci/jwt", "version": "3.3.1", diff --git a/config/app.php b/config/app.php index 84920b9e..a8cb9af5 100644 --- a/config/app.php +++ b/config/app.php @@ -185,7 +185,6 @@ return [ GrahamCampbell\Security\SecurityServiceProvider::class, Jenssegers\Date\DateServiceProvider::class, Laravel\Tinker\TinkerServiceProvider::class, - Laravolt\Avatar\ServiceProvider::class, McCool\LaravelAutoPresenter\AutoPresenterServiceProvider::class, PragmaRX\Google2FA\Vendor\Laravel\ServiceProvider::class, diff --git a/config/trustedproxy.php b/config/trustedproxy.php index c8cfc7c0..b815629b 100644 --- a/config/trustedproxy.php +++ b/config/trustedproxy.php @@ -24,7 +24,7 @@ return [ * of your proxy (e.g. if using ELB or similar). * */ - 'proxies' => null, // [,], '*' + 'proxies' => env('TRUSTED_PROXIES'), // [,], '*' /* * To trust one or more specific proxies that connect diff --git a/docs/setup/installation.md b/docs/setup/installation.md index e194aa6b..139cfe90 100644 --- a/docs/setup/installation.md +++ b/docs/setup/installation.md @@ -71,7 +71,7 @@ Cachet comes with an installation command that will: - Run seeders (of which there are none) ```bash -php artisan app:install +php artisan cachet:install ``` > Never change the `APP_KEY` after installation on production environment. diff --git a/package.json b/package.json index 55fd73b0..e65091ec 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "devDependencies": { "animate-sass": "^0.8.2", - "axios": "^0.18", + "axios": "^0.19", "bootstrap-sass": "^3.4.1", "chart.js": "^2.8.0", "cross-env": "^5.1", @@ -26,7 +26,7 @@ "laravel-mix": "^2.1", "laravel-mix-purgecss": "^3.0.0", "livestamp": "git+https://github.com/mattbradley/livestampjs.git#develop", - "lodash": "^4.17.11", + "lodash": "^4.17.13", "messenger": "git+https://github.com/HubSpot/messenger.git", "moment": "^2.24.0", "promise": "^7.3.1", diff --git a/public/dist/js/all.js b/public/dist/js/all.js index 06549564..9b76908e 100644 --- a/public/dist/js/all.js +++ b/public/dist/js/all.js @@ -25,4 +25,4 @@ return null==e?e:$o.call(e)}function Gr(e){if(!e||!e.length)return[];var t=0;ret }(),je=!1,Ee=!1,He=Math.abs,Ae=Math.min,Oe=Math.max,Pe=[],Ne=function(e,t){var n=c(e),r=ye(n.width)-ye(n.paddingLeft)-ye(n.paddingRight)-ye(n.borderLeftWidth)-ye(n.borderRightWidth),i=y(e,0,t),o=y(e,1,t),a=i&&c(i),s=o&&c(o),u=a&&ye(a.marginLeft)+ye(a.marginRight)+S(i).width,l=s&&ye(s.marginLeft)+ye(s.marginRight)+S(o).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&"none"!==a.float){var d="left"===a.float?"left":"right";return!o||"both"!==s.clear&&s.clear!==d?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||r<=u&&"none"===n[Ye]||o&&"none"===n[Ye]&&r=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){E&&_(E),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;l(e,"mouseup",this._disableDelayedDrag),l(e,"touchend",this._disableDelayedDrag),l(e,"touchcancel",this._disableDelayedDrag),l(e,"mousemove",this._delayedDragTouchMoveHandler),l(e,"touchmove",this._delayedDragTouchMoveHandler),l(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||("touch"==e.pointerType?e:null),!this.nativeDraggable||t?this.options.supportPointer?u(ge,"pointermove",this._onTouchMove):u(ge,t?"touchmove":"mousemove",this._onTouchMove):(u(E,"dragend",this),u(P,"dragstart",this._onDragStart));try{ge.selection?D(function(){ge.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(ue=!1,P&&E){this.nativeDraggable&&(u(ge,"dragover",this._handleAutoScroll),u(ge,"dragover",n));var r=this.options;!e&&d(E,r.dragClass,!1),d(E,r.ghostClass,!0),c(E,"transform",""),a.active=this,e&&this._appendGhost(),p(this,P,"start",E,P,P,F,void 0,q,void 0,t)}else this._nulling()},_emulateDragOver:function(e){if(Z){if(this._lastX===Z.clientX&&this._lastY===Z.clientY&&!e)return;this._lastX=Z.clientX,this._lastY=Z.clientY,r();for(var t=ge.elementFromPoint(Z.clientX,Z.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Z.clientX,Z.clientY))!==n;)n=t;if(n)do{if(n[me]&&n[me]._onDragOver({clientX:Z.clientX,clientY:Z.clientY,target:t,rootEl:n})&&!this.options.dragoverBubble)break;t=n}while(n=n.parentNode);E.parentNode[me]._computeIsAligned(Z),i()}},_onTouchMove:function(e,t){if(K){var n=this.options,r=n.fallbackTolerance,i=n.fallbackOffset,o=e.touches?e.touches[0]:e,s=A&&f(A),u=A&&s&&s.a,l=A&&s&&s.d,d=De&&ie&&j(ie),h=(o.clientX-K.clientX+i.x)/(u||1)+(d?d[0]-he[0]:0)/(u||1),p=(o.clientY-K.clientY+i.y)/(l||1)+(d?d[1]-he[1]:0)/(l||1),m=e.touches?"translate3d("+h+"px,"+p+"px,0)":"translate("+h+"px,"+p+"px)";if(!a.active&&!ue){if(r&&Ae(He(o.clientX-this._lastX),He(o.clientY-this._lastY))'),i=e.minicolors.defaults;t.data("minicolors-initialized")||(n=e.extend(!0,{},i,n),r.addClass("minicolors-theme-"+n.theme).toggleClass("minicolors-with-opacity",n.opacity).toggleClass("minicolors-no-data-uris",!0!==n.dataUris),void 0!==n.position&&e.each(n.position.split(" "),function(){r.addClass("minicolors-position-"+this)}),t.addClass("minicolors-input").data("minicolors-initialized",!1).data("minicolors-settings",n).prop("size",7).wrap(r).after('
'),n.inline||(t.after(''),t.next(".minicolors-swatch").on("click",function(e){e.preventDefault(),t.focus()})),t.parent().find(".minicolors-panel").on("selectstart",function(){return!1}).end(),n.inline&&t.parent().addClass("minicolors-inline"),s(t,!1),t.data("minicolors-initialized",!0))}function n(e){var t=e.parent();e.removeData("minicolors-initialized").removeData("minicolors-settings").removeProp("size").removeClass("minicolors-input"),t.before(e).remove()}function r(e){var t=e.parent(),n=t.find(".minicolors-panel"),r=e.data("minicolors-settings");!e.data("minicolors-initialized")||e.prop("disabled")||t.hasClass("minicolors-inline")||t.hasClass("minicolors-focus")||(i(),t.addClass("minicolors-focus"),n.stop(!0,!0).fadeIn(r.showSpeed,function(){r.show&&r.show.call(e.get(0))}))}function i(){e(".minicolors-focus").each(function(){var t=e(this),n=t.find(".minicolors-input"),r=t.find(".minicolors-panel"),i=n.data("minicolors-settings");r.fadeOut(i.hideSpeed,function(){i.hide&&i.hide.call(n.get(0)),t.removeClass("minicolors-focus")})})}function o(e,t,n){var r,i,o,s,u=e.parents(".minicolors").find(".minicolors-input"),l=u.data("minicolors-settings"),d=e.find("[class$=-picker]"),c=e.offset().left,f=e.offset().top,h=Math.round(t.pageX-c),p=Math.round(t.pageY-f),m=n?l.animationSpeed:0;t.originalEvent.changedTouches&&(h=t.originalEvent.changedTouches[0].pageX-c,p=t.originalEvent.changedTouches[0].pageY-f),0>h&&(h=0),0>p&&(p=0),h>e.width()&&(h=e.width()),p>e.height()&&(p=e.height()),e.parent().is(".minicolors-slider-wheel")&&d.parent().is(".minicolors-grid")&&(r=75-h,i=75-p,o=Math.sqrt(r*r+i*i),s=Math.atan2(i,r),0>s&&(s+=2*Math.PI),o>75&&(o=75,h=75-75*Math.cos(s),p=75-75*Math.sin(s)),h=Math.round(h),p=Math.round(p)),e.is(".minicolors-grid")?d.stop(!0).animate({top:p+"px",left:h+"px"},m,l.animationEasing,function(){a(u,e)}):d.stop(!0).animate({top:p+"px"},m,l.animationEasing,function(){a(u,e)})}function a(e,t){function n(e,t){var n,r;return e.length&&t?(n=e.offset().left,r=e.offset().top,{x:n-t.offset().left+e.outerWidth()/2,y:r-t.offset().top+e.outerHeight()/2}):null}var r,i,o,a,s,l,d,f=e.val(),p=e.attr("data-opacity"),m=e.parent(),g=e.data("minicolors-settings"),y=m.find(".minicolors-swatch"),v=m.find(".minicolors-grid"),b=m.find(".minicolors-slider"),M=m.find(".minicolors-opacity-slider"),w=v.find("[class$=-picker]"),L=b.find("[class$=-picker]"),x=M.find("[class$=-picker]"),k=n(w,v),T=n(L,b),D=n(x,M);if(t.is(".minicolors-grid, .minicolors-slider")){switch(g.control){case"wheel":a=v.width()/2-k.x,s=v.height()/2-k.y,l=Math.sqrt(a*a+s*s),d=Math.atan2(s,a),0>d&&(d+=2*Math.PI),l>75&&(l=75,k.x=69-75*Math.cos(d),k.y=69-75*Math.sin(d)),i=h(l/.75,0,100),r=h(180*d/Math.PI,0,360),o=h(100-Math.floor(T.y*(100/b.height())),0,100),f=_({h:r,s:i,b:o}),b.css("backgroundColor",_({h:r,s:i,b:100}));break;case"saturation":r=h(parseInt(k.x*(360/v.width()),10),0,360),i=h(100-Math.floor(T.y*(100/b.height())),0,100),o=h(100-Math.floor(k.y*(100/v.height())),0,100),f=_({h:r,s:i,b:o}),b.css("backgroundColor",_({h:r,s:100,b:o})),m.find(".minicolors-grid-inner").css("opacity",i/100);break;case"brightness":r=h(parseInt(k.x*(360/v.width()),10),0,360),i=h(100-Math.floor(k.y*(100/v.height())),0,100),o=h(100-Math.floor(T.y*(100/b.height())),0,100),f=_({h:r,s:i,b:o}),b.css("backgroundColor",_({h:r,s:i,b:100})),m.find(".minicolors-grid-inner").css("opacity",1-o/100);break;default:r=h(360-parseInt(T.y*(360/b.height()),10),0,360),i=h(Math.floor(k.x*(100/v.width())),0,100),o=h(100-Math.floor(k.y*(100/v.height())),0,100),f=_({h:r,s:i,b:o}),v.css("backgroundColor",_({h:r,s:100,b:100}))}e.val(c(f,g.letterCase))}t.is(".minicolors-opacity-slider")&&(p=g.opacity?parseFloat(1-D.y/M.height()).toFixed(2):1,g.opacity&&e.attr("data-opacity",p)),y.find("SPAN").css({backgroundColor:f,opacity:p}),u(e,f,p)}function s(e,t){var n,r,i,o,a,s,l,d=e.parent(),p=e.data("minicolors-settings"),m=d.find(".minicolors-swatch"),y=d.find(".minicolors-grid"),v=d.find(".minicolors-slider"),b=d.find(".minicolors-opacity-slider"),M=y.find("[class$=-picker]"),w=v.find("[class$=-picker]"),L=b.find("[class$=-picker]");switch(n=c(f(e.val(),!0),p.letterCase),n||(n=c(f(p.defaultValue,!0),p.letterCase)),r=g(n),t||e.val(n),p.opacity&&(i=""===e.attr("data-opacity")?1:h(parseFloat(e.attr("data-opacity")).toFixed(2),0,1),isNaN(i)&&(i=1),e.attr("data-opacity",i),m.find("SPAN").css("opacity",i),a=h(b.height()-b.height()*i,0,b.height()),L.css("top",a+"px")),m.find("SPAN").css("backgroundColor",n),p.control){case"wheel":s=h(Math.ceil(.75*r.s),0,y.height()/2),l=r.h*Math.PI/180,o=h(75-Math.cos(l)*s,0,y.width()),a=h(75-Math.sin(l)*s,0,y.height()),M.css({top:a+"px",left:o+"px"}),a=150-r.b/(100/y.height()),""===n&&(a=0),w.css("top",a+"px"),v.css("backgroundColor",_({h:r.h,s:r.s,b:100}));break;case"saturation":o=h(5*r.h/12,0,150),a=h(y.height()-Math.ceil(r.b/(100/y.height())),0,y.height()),M.css({top:a+"px",left:o+"px"}),a=h(v.height()-r.s*(v.height()/100),0,v.height()),w.css("top",a+"px"),v.css("backgroundColor",_({h:r.h,s:100,b:r.b})),d.find(".minicolors-grid-inner").css("opacity",r.s/100);break;case"brightness":o=h(5*r.h/12,0,150),a=h(y.height()-Math.ceil(r.s/(100/y.height())),0,y.height()),M.css({top:a+"px",left:o+"px"}),a=h(v.height()-r.b*(v.height()/100),0,v.height()),w.css("top",a+"px"),v.css("backgroundColor",_({h:r.h,s:r.s,b:100})),d.find(".minicolors-grid-inner").css("opacity",1-r.b/100);break;default:o=h(Math.ceil(r.s/(100/y.width())),0,y.width()),a=h(y.height()-Math.ceil(r.b/(100/y.height())),0,y.height()),M.css({top:a+"px",left:o+"px"}),a=h(v.height()-r.h/(360/v.height()),0,v.height()),w.css("top",a+"px"),y.css("backgroundColor",_({h:r.h,s:100,b:100}))}e.data("minicolors-initialized")&&u(e,n,i)}function u(e,t,n){var r=e.data("minicolors-settings"),i=e.data("minicolors-lastChange");i&&i.hex===t&&i.opacity===n||(e.data("minicolors-lastChange",{hex:t,opacity:n}),r.change&&(r.changeDelay?(clearTimeout(e.data("minicolors-changeTimeout")),e.data("minicolors-changeTimeout",setTimeout(function(){r.change.call(e.get(0),t,n)},r.changeDelay))):r.change.call(e.get(0),t,n)),e.trigger("change").trigger("input"))}function l(t){var n=f(e(t).val(),!0),r=v(n),i=e(t).attr("data-opacity");return r?(void 0!==i&&e.extend(r,{a:parseFloat(i)}),r):null}function d(t,n){var r=f(e(t).val(),!0),i=v(r),o=e(t).attr("data-opacity");return i?(void 0===o&&(o=1),n?"rgba("+i.r+", "+i.g+", "+i.b+", "+parseFloat(o)+")":"rgb("+i.r+", "+i.g+", "+i.b+")"):null}function c(e,t){return"uppercase"===t?e.toUpperCase():e.toLowerCase()}function f(e,t){return e=e.replace(/[^A-F0-9]/gi,""),3!==e.length&&6!==e.length?"":(3===e.length&&t&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),"#"+e)}function h(e,t,n){return t>e&&(e=t),e>n&&(e=n),e}function p(e){var t={},n=Math.round(e.h),r=Math.round(255*e.s/100),i=Math.round(255*e.b/100);if(0===r)t.r=t.g=t.b=i;else{var o=i,a=(255-r)*i/255,s=n%60*(o-a)/60;360===n&&(n=0),60>n?(t.r=o,t.b=a,t.g=a+s):120>n?(t.g=o,t.b=a,t.r=o-s):180>n?(t.g=o,t.r=a,t.b=a+s):240>n?(t.b=o,t.r=a,t.g=o-s):300>n?(t.b=o,t.g=a,t.r=a+s):360>n?(t.r=o,t.g=a,t.b=o-s):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}}function m(t){var n=[t.r.toString(16),t.g.toString(16),t.b.toString(16)];return e.each(n,function(e,t){1===t.length&&(n[e]="0"+t)}),"#"+n.join("")}function _(e){return m(p(e))}function g(e){var t=y(v(e));return 0===t.s&&(t.h=360),t}function y(e){var t={h:0,s:0,b:0},n=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b),i=r-n;return t.b=r,t.s=0!==r?255*i/r:0,t.h=0!==t.s?e.r===r?(e.g-e.b)/i:e.g===r?2+(e.b-e.r)/i:4+(e.r-e.g)/i:-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t}function v(e){return e=parseInt(e.indexOf("#")>-1?e.substring(1):e,16),{r:e>>16,g:(65280&e)>>8,b:255&e}}e.minicolors={defaults:{animationSpeed:50,animationEasing:"swing",change:null,changeDelay:0,control:"hue",dataUris:!0,defaultValue:"",hide:null,hideSpeed:100,inline:!1,letterCase:"lowercase",opacity:!1,position:"bottom left",show:null,showSpeed:100,theme:"default"}},e.extend(e.fn,{minicolors:function(o,a){switch(o){case"destroy":return e(this).each(function(){n(e(this))}),e(this);case"hide":return i(),e(this);case"opacity":return void 0===a?e(this).attr("data-opacity"):(e(this).each(function(){s(e(this).attr("data-opacity",a))}),e(this));case"rgbObject":return l(e(this));case"rgbString":case"rgbaString":return d(e(this),"rgbaString"===o);case"settings":return void 0===a?e(this).data("minicolors-settings"):(e(this).each(function(){var t=e(this).data("minicolors-settings")||{};n(e(this)),e(this).minicolors(e.extend(!0,t,a))}),e(this));case"show":return r(e(this).eq(0)),e(this);case"value":return void 0===a?e(this).val():(e(this).each(function(){s(e(this).val(a))}),e(this));default:return"create"!==o&&(a=o),e(this).each(function(){t(e(this),a)}),e(this)}}}),e(document).on("mousedown.minicolors touchstart.minicolors",function(t){e(t.target).parents().add(t.target).hasClass("minicolors")||i()}).on("mousedown.minicolors touchstart.minicolors",".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider",function(t){var n=e(this);t.preventDefault(),e(document).data("minicolors-target",n),o(n,t,!0)}).on("mousemove.minicolors touchmove.minicolors",function(t){var n=e(document).data("minicolors-target");n&&o(n,t)}).on("mouseup.minicolors touchend.minicolors",function(){e(this).removeData("minicolors-target")}).on("mousedown.minicolors touchstart.minicolors",".minicolors-swatch",function(t){var n=e(this).parent().find(".minicolors-input");t.preventDefault(),r(n)}).on("focus.minicolors",".minicolors-input",function(){var t=e(this);t.data("minicolors-initialized")&&r(t)}).on("blur.minicolors",".minicolors-input",function(){var t=e(this),n=t.data("minicolors-settings");t.data("minicolors-initialized")&&(t.val(f(t.val(),!0)),""===t.val()&&t.val(f(n.defaultValue,!0)),t.val(c(t.val(),n.letterCase)))}).on("keydown.minicolors",".minicolors-input",function(t){var n=e(this);if(n.data("minicolors-initialized"))switch(t.keyCode){case 9:i();break;case 13:case 27:i(),n.blur()}}).on("keyup.minicolors",".minicolors-input",function(){var t=e(this);t.data("minicolors-initialized")&&s(t,!0)}).on("paste.minicolors",".minicolors-input",function(){var t=e(this);t.data("minicolors-initialized")&&setTimeout(function(){s(t,!0)},1)})}),function(e,t,n){!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):jQuery&&!jQuery.fn.sparkline&&e(jQuery)}(function(n){"use strict";var r,i,o,a,s,u,l,d,c,f,h,p,m,_,g,y,v,b,M,w,L,x,k,T,D,Y,S,C,j,E,H,A={},O=0;r=function(){return{common:{type:"line",lineColor:"#00f",fillColor:"#cdf",defaultPixelsPerValue:3,width:"auto",height:"auto",composite:!1,tagValuesAttribute:"values",tagOptionsPrefix:"spark",enableTagOptions:!1,enableHighlight:!0,highlightLighten:1.4,tooltipSkipNull:!0,tooltipPrefix:"",tooltipSuffix:"",disableHiddenCheck:!1,numberFormatter:!1,numberDigitGroupCount:3,numberDigitGroupSep:",",numberDecimalMark:".",disableTooltips:!1,disableInteraction:!1},line:{spotColor:"#f80",highlightSpotColor:"#5f5",highlightLineColor:"#f22",spotRadius:1.5,minSpotColor:"#f80",maxSpotColor:"#f80",lineWidth:1,normalRangeMin:void 0,normalRangeMax:void 0,normalRangeColor:"#ccc",drawNormalOnTop:!1,chartRangeMin:void 0,chartRangeMax:void 0,chartRangeMinX:void 0,chartRangeMaxX:void 0,tooltipFormat:new o(' {{prefix}}{{y}}{{suffix}}')},bar:{barColor:"#3366cc",negBarColor:"#f44",stackedBarColor:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],zeroColor:void 0,nullColor:void 0,zeroAxis:!0,barWidth:4,barSpacing:1,chartRangeMax:void 0,chartRangeMin:void 0,chartRangeClip:!1,colorMap:void 0,tooltipFormat:new o(' {{prefix}}{{value}}{{suffix}}')},tristate:{barWidth:4,barSpacing:1,posBarColor:"#6f6",negBarColor:"#f44",zeroBarColor:"#999",colorMap:{},tooltipFormat:new o(' {{value:map}}'),tooltipValueLookups:{map:{"-1":"Loss",0:"Draw",1:"Win"}}},discrete:{lineHeight:"auto",thresholdColor:void 0,thresholdValue:0,chartRangeMax:void 0,chartRangeMin:void 0,chartRangeClip:!1,tooltipFormat:new o("{{prefix}}{{value}}{{suffix}}")},bullet:{targetColor:"#f33",targetWidth:3,performanceColor:"#33f",rangeColors:["#d3dafe","#a8b6ff","#7f94ff"],base:void 0,tooltipFormat:new o("{{fieldkey:fields}} - {{value}}"),tooltipValueLookups:{fields:{r:"Range",p:"Performance",t:"Target"}}},pie:{offset:0,sliceColors:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],borderWidth:0,borderColor:"#000",tooltipFormat:new o(' {{value}} ({{percent.1}}%)')},box:{raw:!1,boxLineColor:"#000",boxFillColor:"#cdf",whiskerColor:"#000",outlierLineColor:"#333",outlierFillColor:"#fff",medianColor:"#f00",showOutliers:!0,outlierIQR:1.5,spotRadius:1.5,target:void 0,targetColor:"#4a2",chartRangeMax:void 0,chartRangeMin:void 0,tooltipFormat:new o("{{field:fields}}: {{value}}"),tooltipFormatFieldlistKey:"field",tooltipValueLookups:{fields:{lq:"Lower Quartile",med:"Median",uq:"Upper Quartile",lo:"Left Outlier",ro:"Right Outlier",lw:"Left Whisker",rw:"Right Whisker"}}}}}, D='.jqstooltip { position: absolute;left: 0px;top: 0px;visibility: hidden;background: rgb(0, 0, 0) transparent;background-color: rgba(0,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";color: white;font: 10px arial, san serif;text-align: left;white-space: nowrap;padding: 5px;border: 1px solid white;box-sizing: content-box;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}',i=function(){var e,t;return e=function(){this.init.apply(this,arguments)},arguments.length>1?(arguments[0]?(e.prototype=n.extend(new arguments[0],arguments[arguments.length-1]),e._super=arguments[0].prototype):e.prototype=arguments[arguments.length-1],arguments.length>2&&(t=Array.prototype.slice.call(arguments,1,-1),t.unshift(e.prototype),n.extend.apply(n,t))):e.prototype=arguments[0],e.prototype.cls=e,e},n.SPFormatClass=o=i({fre:/\{\{([\w.]+?)(:(.+?))?\}\}/g,precre:/(\w+)\.(\d+)/,init:function(e,t){this.format=e,this.fclass=t},render:function(e,t,n){var r,i,o,a,s,u=this,l=e;return this.format.replace(this.fre,function(){var e;return i=arguments[1],o=arguments[3],r=u.precre.exec(i),r?(s=r[2],i=r[1]):s=!1,void 0===(a=l[i])?"":o&&t&&t[o]?(e=t[o],e.get?t[o].get(a)||a:t[o][a]||a):(c(a)&&(a=n.get("numberFormatter")?n.get("numberFormatter")(a):m(a,s,n.get("numberDigitGroupCount"),n.get("numberDigitGroupSep"),n.get("numberDecimalMark"))),a)})}}),n.spformat=function(e,t){return new o(e,t)},a=function(e,t,n){return en?n:e},s=function(e,n){var r;return 2===n?(r=t.floor(e.length/2),e.length%2?e[r]:(e[r-1]+e[r])/2):e.length%2?(r=(e.length*n+n)/4,r%1?(e[t.floor(r)]+e[t.floor(r)-1])/2:e[r-1]):(r=(e.length*n+2)/4,r%1?(e[t.floor(r)]+e[t.floor(r)-1])/2:e[r-1])},u=function(e){var t;switch(e){case"undefined":e=void 0;break;case"null":e=null;break;case"true":e=!0;break;case"false":e=!1;break;default:t=parseFloat(e),e==t&&(e=t)}return e},l=function(e){var t,n=[];for(t=e.length;t--;)n[t]=u(e[t]);return n},d=function(e,t){var n,r,i=[];for(n=0,r=e.length;n0;s-=r)e.splice(s,0,i);return e.join("")},f=function(e,t,n){var r;for(r=t.length;r--;)if((!n||null!==t[r])&&t[r]!==e)return!1;return!0},p=function(e){return n.isArray(e)?e:[e]},h=function(t){var n,r;if(e.createStyleSheet)try{return void(e.createStyleSheet().cssText=t)}catch(e){r=!0}n=e.createElement("style"),n.type="text/css",e.getElementsByTagName("head")[0].appendChild(n),r?e.styleSheets[e.styleSheets.length-1].cssText=t:n["string"==typeof e.body.style.WebkitAppearance?"innerText":"innerHTML"]=t},n.fn.simpledraw=function(t,r,i,o){var a,s;if(i&&(a=this.data("_jqs_vcanvas")))return a;if(!1===n.fn.sparkline.canvas)return!1;if(void 0===n.fn.sparkline.canvas){var u=e.createElement("canvas");if(u.getContext&&u.getContext("2d"))n.fn.sparkline.canvas=function(e,t,n,r){return new j(e,t,n,r)};else{if(!e.namespaces||e.namespaces.v)return n.fn.sparkline.canvas=!1,!1;e.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML"),n.fn.sparkline.canvas=function(e,t,n,r){return new E(e,t,n)}}}return void 0===t&&(t=n(this).innerWidth()),void 0===r&&(r=n(this).innerHeight()),a=n.fn.sparkline.canvas(t,r,this,o),s=n(this).data("_jqs_mhandler"),s&&s.registerCanvas(a),a},n.fn.cleardraw=function(){var e=this.data("_jqs_vcanvas");e&&e.reset()},n.RangeMapClass=_=i({init:function(e){var t,n,r=[];for(t in e)e.hasOwnProperty(t)&&"string"==typeof t&&t.indexOf(":")>-1&&(n=t.split(":"),n[0]=0===n[0].length?-1/0:parseFloat(n[0]),n[1]=0===n[1].length?1/0:parseFloat(n[1]),n[2]=e[t],r.push(n));this.map=e,this.rangelist=r||!1},get:function(e){var t,n,r,i=this.rangelist;if(void 0!==(r=this.map[e]))return r;if(i)for(t=i.length;t--;)if(n=i[t],n[0]<=e&&n[1]>=e)return n[2]}}),n.range_map=function(e){return new _(e)},g=i({init:function(e,t){var r=n(e);this.$el=r,this.options=t,this.currentPageX=0,this.currentPageY=0,this.el=e,this.splist=[],this.tooltip=null,this.over=!1,this.displayTooltips=!t.get("disableTooltips"),this.highlightEnabled=!t.get("disableHighlight")},registerSparkline:function(e){this.splist.push(e),this.over&&this.updateDisplay()},registerCanvas:function(e){var t=n(e.canvas);this.canvas=e,this.$canvas=t,t.mouseenter(n.proxy(this.mouseenter,this)),t.mouseleave(n.proxy(this.mouseleave,this)),t.click(n.proxy(this.mouseclick,this))},reset:function(e){this.splist=[],this.tooltip&&e&&(this.tooltip.remove(),this.tooltip=void 0)},mouseclick:function(e){var t=n.Event("sparklineClick");t.originalEvent=e,t.sparklines=this.splist,this.$el.trigger(t)},mouseenter:function(t){n(e.body).unbind("mousemove.jqs"),n(e.body).bind("mousemove.jqs",n.proxy(this.mousemove,this)),this.over=!0,this.currentPageX=t.pageX,this.currentPageY=t.pageY,this.currentEl=t.target,!this.tooltip&&this.displayTooltips&&(this.tooltip=new y(this.options),this.tooltip.updatePosition(t.pageX,t.pageY)),this.updateDisplay()},mouseleave:function(){n(e.body).unbind("mousemove.jqs");var t,r,i=this.splist,o=i.length,a=!1;for(this.over=!1,this.currentEl=null,this.tooltip&&(this.tooltip.remove(),this.tooltip=null),r=0;r